Skip to content

Commit 9202531

Browse files
krish2718bjarki-andreasen
authored andcommitted
[nrf fromlist] net: wifi: Fix DPP disabled build
In case WPA supplicant disabled DPP, we need to compile out the corresponding DPP code in Wi-Fi shell too. Upstream PR: zephyrproject-rtos/zephyr#79224 Signed-off-by: Chaitanya Tata <[email protected]>
1 parent c04eb11 commit 9202531

File tree

6 files changed

+23
-0
lines changed

6 files changed

+23
-0
lines changed

include/zephyr/net/wifi_mgmt.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,11 +219,13 @@ NET_MGMT_DEFINE_REQUEST_HANDLER(NET_REQUEST_WIFI_RTS_THRESHOLD);
219219

220220
NET_MGMT_DEFINE_REQUEST_HANDLER(NET_REQUEST_WIFI_AP_CONFIG_PARAM);
221221

222+
#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_DPP
222223
/** Request a Wi-Fi DPP operation */
223224
#define NET_REQUEST_WIFI_DPP \
224225
(_NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_DPP)
225226

226227
NET_MGMT_DEFINE_REQUEST_HANDLER(NET_REQUEST_WIFI_DPP);
228+
#endif /* CONFIG_WIFI_NM_WPA_SUPPLICANT_DPP */
227229

228230
#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_WNM
229231
/** Request a Wi-Fi BTM query */
@@ -846,6 +848,7 @@ struct wifi_ap_config_params {
846848
uint32_t max_num_sta;
847849
};
848850

851+
#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_DPP
849852
/** @brief Wi-Fi DPP configuration parameter */
850853
/** Wi-Fi DPP QR-CODE in string max len for SHA512 */
851854
#define WIFI_DPP_QRCODE_MAX_LEN 255
@@ -1022,6 +1025,8 @@ struct wifi_dpp_params {
10221025
};
10231026
};
10241027

1028+
#endif /* CONFIG_WIFI_NM_WPA_SUPPLICANT_DPP */
1029+
10251030
#include <zephyr/net/net_if.h>
10261031

10271032
/** Scan result callback
@@ -1228,6 +1233,8 @@ struct wifi_mgmt_ops {
12281233
* @return 0 if ok, < 0 if error
12291234
*/
12301235
int (*ap_config_params)(const struct device *dev, struct wifi_ap_config_params *params);
1236+
1237+
#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_DPP
12311238
/** Dispatch DPP operations by action enum, with or without arguments in string format
12321239
*
12331240
* @param dev Pointer to the device structure for the driver instance
@@ -1236,6 +1243,7 @@ struct wifi_mgmt_ops {
12361243
* @return 0 if ok, < 0 if error
12371244
*/
12381245
int (*dpp_dispatch)(const struct device *dev, struct wifi_dpp_params *params);
1246+
#endif /* CONFIG_WIFI_NM_WPA_SUPPLICANT_DPP */
12391247
/** Flush PMKSA cache entries
12401248
*
12411249
* @param dev Pointer to the device structure for the driver instance.

modules/hostap/src/supp_api.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1626,6 +1626,7 @@ int supplicant_ap_sta_disconnect(const struct device *dev,
16261626
}
16271627
#endif /* CONFIG_AP */
16281628

1629+
#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_DPP
16291630
static const char *dpp_params_to_args_curve(int curve)
16301631
{
16311632
switch (curve) {
@@ -1915,6 +1916,7 @@ int supplicant_dpp_dispatch(const struct device *dev, struct wifi_dpp_params *pa
19151916
os_free(cmd);
19161917
return 0;
19171918
}
1919+
#endif /* CONFIG_WIFI_NM_WPA_SUPPLICANT_DPP */
19181920

19191921
#ifdef CONFIG_WIFI_NM_HOSTAPD_AP
19201922
int hapd_dpp_dispatch(const struct device *dev, struct wifi_dpp_params *params)

modules/hostap/src/supp_api.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,7 @@ int supplicant_ap_sta_disconnect(const struct device *dev,
260260

261261
#endif /* CONFIG_AP */
262262

263+
#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_DPP
263264
/**
264265
* @brief Dispatch DPP operations for STA
265266
*
@@ -268,6 +269,7 @@ int supplicant_ap_sta_disconnect(const struct device *dev,
268269
* @return 0 for OK; -1 for ERROR
269270
*/
270271
int supplicant_dpp_dispatch(const struct device *dev, struct wifi_dpp_params *params);
272+
#endif /* CONFIG_WIFI_NM_WPA_SUPPLICANT_DPP */
271273

272274
#ifdef CONFIG_WIFI_NM_HOSTAPD_AP
273275
/**

modules/hostap/src/supp_main.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,9 @@ static const struct wifi_mgmt_ops mgmt_ops = {
8080
.ap_disable = supplicant_ap_disable,
8181
.ap_sta_disconnect = supplicant_ap_sta_disconnect,
8282
#endif /* CONFIG_AP */
83+
#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_DPP
8384
.dpp_dispatch = supplicant_dpp_dispatch,
85+
#endif /* CONFIG_WIFI_NM_WPA_SUPPLICANT_DPP */
8486
.pmksa_flush = supplicant_pmksa_flush,
8587
#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE
8688
.enterprise_creds = supplicant_add_enterprise_creds,

subsys/net/l2/wifi/wifi_mgmt.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -833,6 +833,7 @@ static int wifi_set_rts_threshold(uint32_t mgmt_request, struct net_if *iface,
833833

834834
NET_MGMT_REGISTER_REQUEST_HANDLER(NET_REQUEST_WIFI_RTS_THRESHOLD, wifi_set_rts_threshold);
835835

836+
#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_DPP
836837
static int wifi_dpp(uint32_t mgmt_request, struct net_if *iface,
837838
void *data, size_t len)
838839
{
@@ -849,6 +850,8 @@ static int wifi_dpp(uint32_t mgmt_request, struct net_if *iface,
849850

850851
NET_MGMT_REGISTER_REQUEST_HANDLER(NET_REQUEST_WIFI_DPP, wifi_dpp);
851852

853+
#endif /* CONFIG_WIFI_NM_WPA_SUPPLICANT_DPP */
854+
852855
static int wifi_pmksa_flush(uint32_t mgmt_request, struct net_if *iface,
853856
void *data, size_t len)
854857
{

subsys/net/l2/wifi/wifi_shell.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2106,6 +2106,7 @@ static int cmd_wifi_version(const struct shell *sh, size_t argc, char *argv[])
21062106
return 0;
21072107
}
21082108

2109+
#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_DPP
21092110
static int parse_dpp_args_auth_init(const struct shell *sh, size_t argc, char *argv[],
21102111
struct wifi_dpp_params *params)
21112112
{
@@ -2640,6 +2641,7 @@ static int cmd_wifi_dpp_reconfig(const struct shell *sh, size_t argc, char *argv
26402641
return 0;
26412642
}
26422643

2644+
#endif /* CONFIG_WIFI_NM_WPA_SUPPLICANT_DPP */
26432645
static int cmd_wifi_pmksa_flush(const struct shell *sh, size_t argc, char *argv[])
26442646
{
26452647
struct net_if *iface = net_if_get_wifi_sta();
@@ -2717,6 +2719,7 @@ SHELL_STATIC_SUBCMD_SET_CREATE(wifi_twt_ops,
27172719
SHELL_SUBCMD_SET_END
27182720
);
27192721

2722+
#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_DPP
27202723
SHELL_STATIC_SUBCMD_SET_CREATE(
27212724
wifi_cmd_dpp,
27222725
SHELL_CMD_ARG(configurator_add, NULL,
@@ -2793,6 +2796,7 @@ SHELL_STATIC_SUBCMD_SET_CREATE(
27932796
cmd_wifi_dpp_reconfig, 2, 0),
27942797
SHELL_SUBCMD_SET_END
27952798
);
2799+
#endif /* CONFIG_WIFI_NM_WPA_SUPPLICANT_DPP */
27962800

27972801
SHELL_STATIC_SUBCMD_SET_CREATE(wifi_commands,
27982802
SHELL_CMD_ARG(version, NULL, "Print Wi-Fi Driver and Firmware versions\n",
@@ -2929,7 +2933,9 @@ SHELL_STATIC_SUBCMD_SET_CREATE(wifi_commands,
29292933
"<rts_threshold: rts threshold/off>.\n",
29302934
cmd_wifi_set_rts_threshold,
29312935
1, 1),
2936+
#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_DPP
29322937
SHELL_CMD(dpp, &wifi_cmd_dpp, "DPP actions\n", NULL),
2938+
#endif /* CONFIG_WIFI_NM_WPA_SUPPLICANT_DPP */
29332939
SHELL_CMD_ARG(pmksa_flush, NULL,
29342940
"Flush PMKSA cache entries.\n",
29352941
cmd_wifi_pmksa_flush, 1, 0),

0 commit comments

Comments
 (0)