}
-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;
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);
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);
}
}
+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;
.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,