Fix compiler error on CONFIG_AP without CONFIG_P2P builds

/usr/bin/ld: /home/honma/git/hostap/build/wpa_supplicant/ap.o: in function `wpas_conf_ap_he_6ghz':
/home/honma/git/hostap/wpa_supplicant/ap.c:245: undefined reference to `wpas_p2p_get_sec_channel_offset_40mhz'

Fixes: e5173e8b12 ("P2P: Enable multiple channel widths for P2P in 6 GHz band")
Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
This commit is contained in:
Masashi Honma 2021-11-01 08:03:37 +09:00 committed by Jouni Malinen
parent 726eda65fb
commit b306a92dfc

View file

@ -196,6 +196,8 @@ wpa_supplicant_find_hw_mode(struct wpa_supplicant *wpa_s,
} }
#ifdef CONFIG_P2P
static int get_max_oper_chwidth_6ghz(int chwidth) static int get_max_oper_chwidth_6ghz(int chwidth)
{ {
switch (chwidth) { switch (chwidth) {
@ -256,6 +258,8 @@ static void wpas_conf_ap_he_6ghz(struct wpa_supplicant *wpa_s,
wpas_conf_ap_vht(wpa_s, ssid, conf, mode); wpas_conf_ap_vht(wpa_s, ssid, conf, mode);
} }
#endif /* CONFIG_P2P */
int wpa_supplicant_conf_ap_ht(struct wpa_supplicant *wpa_s, int wpa_supplicant_conf_ap_ht(struct wpa_supplicant *wpa_s,
struct wpa_ssid *ssid, struct wpa_ssid *ssid,
@ -319,7 +323,9 @@ int wpa_supplicant_conf_ap_ht(struct wpa_supplicant *wpa_s,
if (mode && is_6ghz_freq(ssid->frequency) && if (mode && is_6ghz_freq(ssid->frequency) &&
conf->hw_mode == HOSTAPD_MODE_IEEE80211A) { conf->hw_mode == HOSTAPD_MODE_IEEE80211A) {
#ifdef CONFIG_P2P
wpas_conf_ap_he_6ghz(wpa_s, mode, ssid, conf); wpas_conf_ap_he_6ghz(wpa_s, mode, ssid, conf);
#endif /* CONFIG_P2P */
} else if (!no_ht && mode && mode->ht_capab) { } else if (!no_ht && mode && mode->ht_capab) {
wpa_printf(MSG_DEBUG, wpa_printf(MSG_DEBUG,
"Enable HT support (p2p_group=%d 11a=%d ht40_hw_capab=%d ssid->ht40=%d)", "Enable HT support (p2p_group=%d 11a=%d ht40_hw_capab=%d ssid->ht40=%d)",