Skip to content

Commit 553c19f

Browse files
committed
[nrf fromtree] 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. Signed-off-by: Chaitanya Tata <[email protected]> (cherry picked from commit 1da74ef)
1 parent c0a19c7 commit 553c19f

File tree

6 files changed

+22
-0
lines changed

6 files changed

+22
-0
lines changed

include/zephyr/net/wifi_mgmt.h

Lines changed: 7 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 */
@@ -850,6 +852,7 @@ struct wifi_ap_config_params {
850852
uint32_t max_num_sta;
851853
};
852854

855+
#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_DPP
853856
/** @brief Wi-Fi DPP configuration parameter */
854857
/** Wi-Fi DPP QR-CODE in string max len for SHA512 */
855858
#define WIFI_DPP_QRCODE_MAX_LEN 255
@@ -1025,6 +1028,7 @@ struct wifi_dpp_params {
10251028
char resp[WIFI_DPP_QRCODE_MAX_LEN + 1];
10261029
};
10271030
};
1031+
#endif /* CONFIG_WIFI_NM_WPA_SUPPLICANT_DPP */
10281032

10291033
#include <zephyr/net/net_if.h>
10301034

@@ -1232,6 +1236,8 @@ struct wifi_mgmt_ops {
12321236
* @return 0 if ok, < 0 if error
12331237
*/
12341238
int (*ap_config_params)(const struct device *dev, struct wifi_ap_config_params *params);
1239+
1240+
#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_DPP
12351241
/** Dispatch DPP operations by action enum, with or without arguments in string format
12361242
*
12371243
* @param dev Pointer to the device structure for the driver instance
@@ -1240,6 +1246,7 @@ struct wifi_mgmt_ops {
12401246
* @return 0 if ok, < 0 if error
12411247
*/
12421248
int (*dpp_dispatch)(const struct device *dev, struct wifi_dpp_params *params);
1249+
#endif /* CONFIG_WIFI_NM_WPA_SUPPLICANT_DPP */
12431250
/** Flush PMKSA cache entries
12441251
*
12451252
* @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
@@ -1767,6 +1767,7 @@ int supplicant_ap_sta_disconnect(const struct device *dev,
17671767
}
17681768
#endif /* CONFIG_AP */
17691769

1770+
#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_DPP
17701771
static const char *dpp_params_to_args_curve(int curve)
17711772
{
17721773
switch (curve) {
@@ -2056,6 +2057,7 @@ int supplicant_dpp_dispatch(const struct device *dev, struct wifi_dpp_params *pa
20562057
os_free(cmd);
20572058
return 0;
20582059
}
2060+
#endif /* CONFIG_WIFI_NM_WPA_SUPPLICANT_DPP */
20592061

20602062
#ifdef CONFIG_WIFI_NM_HOSTAPD_AP
20612063
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
@@ -269,6 +269,7 @@ int supplicant_ap_sta_disconnect(const struct device *dev,
269269

270270
#endif /* CONFIG_AP */
271271

272+
#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_DPP
272273
/**
273274
* @brief Dispatch DPP operations for STA
274275
*
@@ -277,6 +278,7 @@ int supplicant_ap_sta_disconnect(const struct device *dev,
277278
* @return 0 for OK; -1 for ERROR
278279
*/
279280
int supplicant_dpp_dispatch(const struct device *dev, struct wifi_dpp_params *params);
281+
#endif /* CONFIG_WIFI_NM_WPA_SUPPLICANT_DPP */
280282

281283
#ifdef CONFIG_WIFI_NM_HOSTAPD_AP
282284
/**

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
@@ -852,6 +852,7 @@ static int wifi_set_rts_threshold(uint32_t mgmt_request, struct net_if *iface,
852852

853853
NET_MGMT_REGISTER_REQUEST_HANDLER(NET_REQUEST_WIFI_RTS_THRESHOLD, wifi_set_rts_threshold);
854854

855+
#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_DPP
855856
static int wifi_dpp(uint32_t mgmt_request, struct net_if *iface,
856857
void *data, size_t len)
857858
{
@@ -868,6 +869,8 @@ static int wifi_dpp(uint32_t mgmt_request, struct net_if *iface,
868869

869870
NET_MGMT_REGISTER_REQUEST_HANDLER(NET_REQUEST_WIFI_DPP, wifi_dpp);
870871

872+
#endif /* CONFIG_WIFI_NM_WPA_SUPPLICANT_DPP */
873+
871874
static int wifi_pmksa_flush(uint32_t mgmt_request, struct net_if *iface,
872875
void *data, size_t len)
873876
{

subsys/net/l2/wifi/wifi_shell.c

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

2146+
#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_DPP
21462147
static int parse_dpp_args_auth_init(const struct shell *sh, size_t argc, char *argv[],
21472148
struct wifi_dpp_params *params)
21482149
{
@@ -2680,6 +2681,7 @@ static int cmd_wifi_dpp_reconfig(const struct shell *sh, size_t argc, char *argv
26802681
return 0;
26812682
}
26822683

2684+
#endif /* CONFIG_WIFI_NM_WPA_SUPPLICANT_DPP */
26832685
static int cmd_wifi_pmksa_flush(const struct shell *sh, size_t argc, char *argv[])
26842686
{
26852687
struct net_if *iface = net_if_get_wifi_sta();
@@ -2757,6 +2759,7 @@ SHELL_STATIC_SUBCMD_SET_CREATE(wifi_twt_ops,
27572759
SHELL_SUBCMD_SET_END
27582760
);
27592761

2762+
#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_DPP
27602763
SHELL_STATIC_SUBCMD_SET_CREATE(
27612764
wifi_cmd_dpp,
27622765
SHELL_CMD_ARG(configurator_add, NULL,
@@ -2833,6 +2836,7 @@ SHELL_STATIC_SUBCMD_SET_CREATE(
28332836
cmd_wifi_dpp_reconfig, 2, 0),
28342837
SHELL_SUBCMD_SET_END
28352838
);
2839+
#endif /* CONFIG_WIFI_NM_WPA_SUPPLICANT_DPP */
28362840

28372841
SHELL_STATIC_SUBCMD_SET_CREATE(wifi_commands,
28382842
SHELL_CMD_ARG(version, NULL, "Print Wi-Fi Driver and Firmware versions\n",
@@ -2969,7 +2973,9 @@ SHELL_STATIC_SUBCMD_SET_CREATE(wifi_commands,
29692973
"<rts_threshold: rts threshold/off>.\n",
29702974
cmd_wifi_set_rts_threshold,
29712975
1, 1),
2976+
#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_DPP
29722977
SHELL_CMD(dpp, &wifi_cmd_dpp, "DPP actions\n", NULL),
2978+
#endif /* CONFIG_WIFI_NM_WPA_SUPPLICANT_DPP */
29732979
SHELL_CMD_ARG(pmksa_flush, NULL,
29742980
"Flush PMKSA cache entries.\n",
29752981
cmd_wifi_pmksa_flush, 1, 0),

0 commit comments

Comments
 (0)