diff options
author | Pavel Roskin <proski@gnu.org> | 2011-07-29 20:39:32 +0300 |
---|---|---|
committer | Jouni Malinen <j@w1.fi> | 2011-07-29 20:51:50 +0300 |
commit | f11634bf5ddf8aed5d490b478542074c5465728f (patch) | |
tree | 01ee0fcfb4637fb08ff775eb6a603941310ae08f | |
parent | a79d5479dfd983622ebabee5f1c8cf9b5236f9d7 (diff) | |
download | external_wpa_supplicant_8_ti-f11634bf5ddf8aed5d490b478542074c5465728f.zip external_wpa_supplicant_8_ti-f11634bf5ddf8aed5d490b478542074c5465728f.tar.gz external_wpa_supplicant_8_ti-f11634bf5ddf8aed5d490b478542074c5465728f.tar.bz2 |
hostap: Add channel selection support in hostapd
Signed-off-by: Pavel Roskin <proski@gnu.org>
-rw-r--r-- | src/drivers/driver_hostap.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/drivers/driver_hostap.c b/src/drivers/driver_hostap.c index e855c1b..7151753 100644 --- a/src/drivers/driver_hostap.c +++ b/src/drivers/driver_hostap.c @@ -1058,6 +1058,25 @@ static int hostap_sta_deauth(void *priv, const u8 *own_addr, const u8 *addr, } +static int hostap_set_freq(void *priv, struct hostapd_freq_params *freq) +{ + struct hostap_driver_data *drv = priv; + struct iwreq iwr; + + os_memset(&iwr, 0, sizeof(iwr)); + os_strlcpy(iwr.ifr_name, drv->iface, IFNAMSIZ); + iwr.u.freq.m = freq->channel; + iwr.u.freq.e = 0; + + if (ioctl(drv->ioctl_sock, SIOCSIWFREQ, &iwr) < 0) { + perror("ioctl[SIOCSIWFREQ]"); + return -1; + } + + return 0; +} + + static int hostap_sta_disassoc(void *priv, const u8 *own_addr, const u8 *addr, int reason) { @@ -1632,6 +1651,7 @@ const struct wpa_driver_ops wpa_driver_hostap_ops = { .sta_clear_stats = hostap_sta_clear_stats, .get_hw_feature_data = hostap_get_hw_feature_data, .set_ap_wps_ie = hostap_set_ap_wps_ie, + .set_freq = hostap_set_freq, #else /* HOSTAPD */ .get_bssid = wpa_driver_hostap_get_bssid, .get_ssid = wpa_driver_hostap_get_ssid, |