aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/ap.c
diff options
context:
space:
mode:
authorAndrei Otcheretianski <andrei.otcheretianski@intel.com>2015-09-08 09:46:16 (GMT)
committerJouni Malinen <j@w1.fi>2015-10-03 17:10:37 (GMT)
commit73afc20d409652b89cbc2f5e3cf8583d6bf4dcaa (patch)
treec9adcb63dfb597608b0952d24e6b8482796c2705 /wpa_supplicant/ap.c
parent6315bfdba2ecf6bd6b1d0a7814efff63869dbf93 (diff)
downloadhostap-73afc20d409652b89cbc2f5e3cf8583d6bf4dcaa.zip
hostap-73afc20d409652b89cbc2f5e3cf8583d6bf4dcaa.tar.gz
hostap-73afc20d409652b89cbc2f5e3cf8583d6bf4dcaa.tar.bz2
P2P: Implement wpas_p2p_move_go_csa()
Use channel switch mechanism to move a P2P GO to a new channel, when required. In order to be able to reconfigure the GO channel, split wpa_supplicant_conf_ap() function, so the frequency configuration part can be reused to find additional CSA settings. Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
Diffstat (limited to 'wpa_supplicant/ap.c')
-rw-r--r--wpa_supplicant/ap.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/wpa_supplicant/ap.c b/wpa_supplicant/ap.c
index 7a4f4cf..26ac703 100644
--- a/wpa_supplicant/ap.c
+++ b/wpa_supplicant/ap.c
@@ -76,10 +76,19 @@ no_vht:
#endif /* CONFIG_IEEE80211N */
-void wpa_supplicant_conf_ap_ht(struct wpa_supplicant *wpa_s,
- struct wpa_ssid *ssid,
- struct hostapd_config *conf)
+int wpa_supplicant_conf_ap_ht(struct wpa_supplicant *wpa_s,
+ struct wpa_ssid *ssid,
+ struct hostapd_config *conf)
{
+ conf->hw_mode = ieee80211_freq_to_chan(ssid->frequency,
+ &conf->channel);
+
+ if (conf->hw_mode == NUM_HOSTAPD_MODES) {
+ wpa_printf(MSG_ERROR, "Unsupported AP mode frequency: %d MHz",
+ ssid->frequency);
+ return -1;
+ }
+
/* TODO: enable HT40 if driver supports it;
* drop to 11b if driver does not support 11g */
@@ -166,6 +175,8 @@ void wpa_supplicant_conf_ap_ht(struct wpa_supplicant *wpa_s,
}
}
#endif /* CONFIG_IEEE80211N */
+
+ return 0;
}
@@ -179,15 +190,8 @@ static int wpa_supplicant_conf_ap(struct wpa_supplicant *wpa_s,
os_strlcpy(bss->iface, wpa_s->ifname, sizeof(bss->iface));
- conf->hw_mode = ieee80211_freq_to_chan(ssid->frequency,
- &conf->channel);
- if (conf->hw_mode == NUM_HOSTAPD_MODES) {
- wpa_printf(MSG_ERROR, "Unsupported AP mode frequency: %d MHz",
- ssid->frequency);
+ if (wpa_supplicant_conf_ap_ht(wpa_s, ssid, conf))
return -1;
- }
-
- wpa_supplicant_conf_ap_ht(wpa_s, ssid, conf);
if (ieee80211_is_dfs(ssid->frequency) && wpa_s->conf->country[0]) {
conf->ieee80211h = 1;