aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorHelmut Schaa <helmut.schaa@googlemail.com>2011-01-30 19:16:29 (GMT)
committerJouni Malinen <j@w1.fi>2011-01-30 19:16:29 (GMT)
commitf1bed4a70ddb4a9e7e11e3ebac6f9c479c502ceb (patch)
tree31297eca0567701be5d262cc6bf0d1b44421d000 /src
parent1161ff1ef5e4bdc0e1727a039d6b23ac74b863d0 (diff)
downloadhostap-f1bed4a70ddb4a9e7e11e3ebac6f9c479c502ceb.zip
hostap-f1bed4a70ddb4a9e7e11e3ebac6f9c479c502ceb.tar.gz
hostap-f1bed4a70ddb4a9e7e11e3ebac6f9c479c502ceb.tar.bz2
nl80211: Make use of the ht opmode bss attribute
In order to enable protection mechanisms for different HT opmodes the driver needs to be aware of the current HT opmode that is calculated by hostapd. Hence, pass the current opmode to the nl80211 driver via the bss attribute NL80211_ATTR_BSS_HT_OPMODE. Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Diffstat (limited to 'src')
-rw-r--r--src/drivers/driver_nl80211.c26
1 files changed, 21 insertions, 5 deletions
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index acb8f33..6ca3f81 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -5293,7 +5293,8 @@ static int i802_set_tx_queue_params(void *priv, int queue, int aifs,
}
-static int i802_set_bss(void *priv, int cts, int preamble, int slot)
+static int i802_set_bss(void *priv, int cts, int preamble, int slot,
+ int ht_opmode)
{
struct i802_bss *bss = priv;
struct wpa_driver_nl80211_data *drv = bss->drv;
@@ -5312,7 +5313,8 @@ static int i802_set_bss(void *priv, int cts, int preamble, int slot)
NLA_PUT_U8(msg, NL80211_ATTR_BSS_SHORT_PREAMBLE, preamble);
if (slot >= 0)
NLA_PUT_U8(msg, NL80211_ATTR_BSS_SHORT_SLOT_TIME, slot);
-
+ if (ht_opmode >= 0)
+ NLA_PUT_U16(msg, NL80211_ATTR_BSS_HT_OPMODE, ht_opmode);
NLA_PUT_U32(msg, NL80211_ATTR_IFINDEX, if_nametoindex(bss->ifname));
return send_and_recv_msgs(drv, msg, NULL, NULL);
@@ -5323,19 +5325,19 @@ static int i802_set_bss(void *priv, int cts, int preamble, int slot)
static int i802_set_cts_protect(void *priv, int value)
{
- return i802_set_bss(priv, value, -1, -1);
+ return i802_set_bss(priv, value, -1, -1, -1);
}
static int i802_set_preamble(void *priv, int value)
{
- return i802_set_bss(priv, -1, value, -1);
+ return i802_set_bss(priv, -1, value, -1, -1);
}
static int i802_set_short_slot_time(void *priv, int value)
{
- return i802_set_bss(priv, -1, -1, value);
+ return i802_set_bss(priv, -1, -1, value, -1);
}
@@ -5403,6 +5405,19 @@ static int i802_set_wds_sta(void *priv, const u8 *addr, int aid, int val,
}
+static int i802_set_ht_params(void *priv, const u8 *ht_capab,
+ size_t ht_capab_len, const u8 *ht_oper,
+ size_t ht_oper_len)
+{
+ if (ht_oper_len >= 6) {
+ /* ht opmode uses 16bit in octet 5 & 6 */
+ u16 ht_opmode = le_to_host16(((u16 *) ht_oper)[2]);
+ return i802_set_bss(priv, -1, -1, -1, ht_opmode);
+ } else
+ return -1;
+}
+
+
static void handle_eapol(int sock, void *eloop_ctx, void *sock_ctx)
{
struct wpa_driver_nl80211_data *drv = eloop_ctx;
@@ -6407,6 +6422,7 @@ const struct wpa_driver_ops wpa_driver_nl80211_ops = {
.set_tx_queue_params = i802_set_tx_queue_params,
.set_sta_vlan = i802_set_sta_vlan,
.set_wds_sta = i802_set_wds_sta,
+ .set_ht_params = i802_set_ht_params,
#endif /* HOSTAPD */
.set_freq = i802_set_freq,
.send_action = wpa_driver_nl80211_send_action,