diff options
author | Jouni Malinen <jouni.malinen@atheros.com> | 2008-11-25 20:59:39 +0200 |
---|---|---|
committer | Jouni Malinen <j@w1.fi> | 2008-11-25 20:59:39 +0200 |
commit | 95da9bbc364778c4cc72dff9d60f74bc1dbdfbb5 (patch) | |
tree | 0b4f8f385206380ccda00cf241acf8c3737c41e8 /hostapd/driver.h | |
parent | ffbcf648ed1d9cb1deb08d15ffa6960341829348 (diff) | |
download | external_wpa_supplicant_8_ti-95da9bbc364778c4cc72dff9d60f74bc1dbdfbb5.zip external_wpa_supplicant_8_ti-95da9bbc364778c4cc72dff9d60f74bc1dbdfbb5.tar.gz external_wpa_supplicant_8_ti-95da9bbc364778c4cc72dff9d60f74bc1dbdfbb5.tar.bz2 |
nl80211: Add support for setting channel frequency and HT20 vs. HT40
This depends on a patch to Linux nl80211/mac80211 that has not yet been
merged into wireless-testing. If that change is not present, the old
mechanism (WEXT) will be used instead.
Diffstat (limited to 'hostapd/driver.h')
-rw-r--r-- | hostapd/driver.h | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/hostapd/driver.h b/hostapd/driver.h index 723275f..4331e1b 100644 --- a/hostapd/driver.h +++ b/hostapd/driver.h @@ -27,6 +27,14 @@ struct hostapd_sta_add_params { const struct ht_cap_ie *ht_capabilities; }; +struct hostapd_freq_params { + int mode; + int freq; + int sec_channel_offset; /* 0 = HT40 disabled, -1 = HT40 enabled, + * secondary channel below primary, 1 = HT40 + * enabled, secondary channel above primary */ +}; + enum hostapd_driver_if_type { HOSTAPD_IF_VLAN, HOSTAPD_IF_WDS }; @@ -99,7 +107,9 @@ struct wpa_driver_ops { int (*get_inact_sec)(void *priv, const u8 *addr); int (*sta_clear_stats)(void *priv, const u8 *addr); + /* note: set_freq() is deprecated; use sta_freq() instead */ int (*set_freq)(void *priv, int mode, int freq); + int (*set_freq2)(void *priv, struct hostapd_freq_params *freq); int (*set_rts)(void *priv, int rts); int (*get_rts)(void *priv, int *rts); int (*set_frag)(void *priv, int frag); @@ -421,9 +431,21 @@ hostapd_get_inact_sec(struct hostapd_data *hapd, const u8 *addr) } static inline int -hostapd_set_freq(struct hostapd_data *hapd, int mode, int freq) +hostapd_set_freq(struct hostapd_data *hapd, int mode, int freq, + int sec_channel_offset) { - if (hapd->driver == NULL || hapd->driver->set_freq == NULL) + if (hapd->driver == NULL) + return 0; + if (hapd->driver->set_freq2) { + struct hostapd_freq_params data; + os_memset(&data, 0, sizeof(data)); + data.mode = mode; + data.freq = freq; + data.sec_channel_offset = sec_channel_offset; + return hapd->driver->set_freq2(hapd->drv_priv, &data); + } + + if (hapd->driver->set_freq == NULL) return 0; return hapd->driver->set_freq(hapd->drv_priv, mode, freq); } |