Commit 1da74ef7 authored by Chaitanya Tata's avatar Chaitanya Tata Committed by Fabio Baltieri
Browse files

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: default avatarChaitanya Tata <Chaitanya.Tata@nordicsemi.no>
parent 86da989a
Loading
Loading
Loading
Loading
+7 −0
Changes for include/zephyr/net/wifi_mgmt.h: 7 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -221,11 +221,13 @@ NET_MGMT_DEFINE_REQUEST_HANDLER(NET_REQUEST_WIFI_RTS_THRESHOLD);

NET_MGMT_DEFINE_REQUEST_HANDLER(NET_REQUEST_WIFI_AP_CONFIG_PARAM);

#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_DPP
/** Request a Wi-Fi DPP operation */
#define NET_REQUEST_WIFI_DPP			\
	(_NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_DPP)

NET_MGMT_DEFINE_REQUEST_HANDLER(NET_REQUEST_WIFI_DPP);
#endif /* CONFIG_WIFI_NM_WPA_SUPPLICANT_DPP */

#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_WNM
/** Request a Wi-Fi BTM query */
@@ -852,6 +854,7 @@ struct wifi_ap_config_params {
	uint32_t max_num_sta;
};

#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_DPP
/** @brief Wi-Fi DPP configuration parameter */
/** Wi-Fi DPP QR-CODE in string max len for SHA512 */
#define WIFI_DPP_QRCODE_MAX_LEN 255
@@ -1027,6 +1030,7 @@ struct wifi_dpp_params {
		char resp[WIFI_DPP_QRCODE_MAX_LEN + 1];
	};
};
#endif /* CONFIG_WIFI_NM_WPA_SUPPLICANT_DPP */

#define WIFI_WPS_PIN_MAX_LEN 8

@@ -1254,6 +1258,8 @@ struct wifi_mgmt_ops {
	 * @return 0 if ok, < 0 if error
	 */
	int (*ap_config_params)(const struct device *dev, struct wifi_ap_config_params *params);

#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_DPP
	/** Dispatch DPP operations by action enum, with or without arguments in string format
	 *
	 * @param dev Pointer to the device structure for the driver instance
@@ -1262,6 +1268,7 @@ struct wifi_mgmt_ops {
	 * @return 0 if ok, < 0 if error
	 */
	int (*dpp_dispatch)(const struct device *dev, struct wifi_dpp_params *params);
#endif /* CONFIG_WIFI_NM_WPA_SUPPLICANT_DPP */
	/** Flush PMKSA cache entries
	 *
	 * @param dev Pointer to the device structure for the driver instance.
+2 −0
Changes for modules/hostap/src/supp_api.c: 2 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -1768,6 +1768,7 @@ out:
}
#endif /* CONFIG_AP */

#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_DPP
static const char *dpp_params_to_args_curve(int curve)
{
	switch (curve) {
@@ -2057,6 +2058,7 @@ int supplicant_dpp_dispatch(const struct device *dev, struct wifi_dpp_params *pa
	os_free(cmd);
	return 0;
}
#endif /* CONFIG_WIFI_NM_WPA_SUPPLICANT_DPP */

#ifdef CONFIG_WIFI_NM_HOSTAPD_AP
int hapd_dpp_dispatch(const struct device *dev, struct wifi_dpp_params *params)
+2 −0
Changes for modules/hostap/src/supp_api.h: 2 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -278,6 +278,7 @@ int supplicant_ap_sta_disconnect(const struct device *dev,

#endif /* CONFIG_AP */

#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_DPP
/**
 * @brief Dispatch DPP operations for STA
 *
@@ -286,6 +287,7 @@ int supplicant_ap_sta_disconnect(const struct device *dev,
 * @return 0 for OK; -1 for ERROR
 */
int supplicant_dpp_dispatch(const struct device *dev, struct wifi_dpp_params *params);
#endif /* CONFIG_WIFI_NM_WPA_SUPPLICANT_DPP */

#ifdef CONFIG_WIFI_NM_HOSTAPD_AP
/**
+2 −0
Changes for modules/hostap/src/supp_main.c: 2 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -81,7 +81,9 @@ static const struct wifi_mgmt_ops mgmt_ops = {
	.ap_disable = supplicant_ap_disable,
	.ap_sta_disconnect = supplicant_ap_sta_disconnect,
#endif /* CONFIG_AP */
#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_DPP
	.dpp_dispatch = supplicant_dpp_dispatch,
#endif /* CONFIG_WIFI_NM_WPA_SUPPLICANT_DPP */
	.pmksa_flush = supplicant_pmksa_flush,
#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE
	.enterprise_creds = supplicant_add_enterprise_creds,
+3 −0
Changes for subsys/net/l2/wifi/wifi_mgmt.c: 3 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -848,6 +848,7 @@ static int wifi_set_rts_threshold(uint32_t mgmt_request, struct net_if *iface,

NET_MGMT_REGISTER_REQUEST_HANDLER(NET_REQUEST_WIFI_RTS_THRESHOLD, wifi_set_rts_threshold);

#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_DPP
static int wifi_dpp(uint32_t mgmt_request, struct net_if *iface,
		    void *data, size_t len)
{
@@ -864,6 +865,8 @@ static int wifi_dpp(uint32_t mgmt_request, struct net_if *iface,

NET_MGMT_REGISTER_REQUEST_HANDLER(NET_REQUEST_WIFI_DPP, wifi_dpp);

#endif /* CONFIG_WIFI_NM_WPA_SUPPLICANT_DPP */

static int wifi_pmksa_flush(uint32_t mgmt_request, struct net_if *iface,
					   void *data, size_t len)
{
Loading