]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
cfg80211: Add new BSS attribute ht_opmode
authorHelmut Schaa <helmut.schaa@googlemail.com>
Fri, 19 Nov 2010 11:40:25 +0000 (12:40 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 8 Dec 2010 20:38:43 +0000 (15:38 -0500)
Add a new BSS attribute to allow hostapd to set the current HT opmode.
Otherwise drivers won't be able to set up protection for HT rates in
AP mode.

Cc: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
include/linux/nl80211.h
include/net/cfg80211.h
net/wireless/nl80211.c

index 8e28053ea4235707427e5d774d9208dc00daed33..380421253d16001596d2536beb3afb2cb90e5379 100644 (file)
@@ -849,6 +849,8 @@ enum nl80211_commands {
  *     flag isn't set, the frame will be rejected. This is also used as an
  *     nl80211 capability flag.
  *
+ * @NL80211_ATTR_BSS_HTOPMODE: HT operation mode (u16)
+ *
  * @NL80211_ATTR_MAX: highest attribute number currently defined
  * @__NL80211_ATTR_AFTER_LAST: internal use
  */
@@ -1025,6 +1027,8 @@ enum nl80211_attrs {
 
        NL80211_ATTR_OFFCHANNEL_TX_OK,
 
+       NL80211_ATTR_BSS_HT_OPMODE,
+
        /* add attributes here, update the policy in nl80211.c */
 
        __NL80211_ATTR_AFTER_LAST,
index 8764c9a5bab7ecf4a608784ed6aafe226bf782b4..0d5979924be34dd913a5fd39fd6dd88c0487d288 100644 (file)
@@ -605,6 +605,8 @@ struct mpath_info {
  *     (or NULL for no change)
  * @basic_rates_len: number of basic rates
  * @ap_isolate: do not forward packets between connected stations
+ * @ht_opmode: HT Operation mode
+ *     (u16 = opmode, -1 = do not change)
  */
 struct bss_parameters {
        int use_cts_prot;
@@ -613,6 +615,7 @@ struct bss_parameters {
        u8 *basic_rates;
        u8 basic_rates_len;
        int ap_isolate;
+       int ht_opmode;
 };
 
 /*
index 2cf03331d4a23d72f1979750ad787debb35743f3..c3f80e565365eaf01ee0b1a0faeea328c320ae62 100644 (file)
@@ -121,6 +121,7 @@ static const struct nla_policy nl80211_policy[NL80211_ATTR_MAX+1] = {
        [NL80211_ATTR_BSS_SHORT_SLOT_TIME] = { .type = NLA_U8 },
        [NL80211_ATTR_BSS_BASIC_RATES] = { .type = NLA_BINARY,
                                           .len = NL80211_MAX_SUPP_RATES },
+       [NL80211_ATTR_BSS_HT_OPMODE] = { .type = NLA_U16 },
 
        [NL80211_ATTR_MESH_PARAMS] = { .type = NLA_NESTED },
 
@@ -2462,6 +2463,7 @@ static int nl80211_set_bss(struct sk_buff *skb, struct genl_info *info)
        params.use_short_preamble = -1;
        params.use_short_slot_time = -1;
        params.ap_isolate = -1;
+       params.ht_opmode = -1;
 
        if (info->attrs[NL80211_ATTR_BSS_CTS_PROT])
                params.use_cts_prot =
@@ -2480,6 +2482,9 @@ static int nl80211_set_bss(struct sk_buff *skb, struct genl_info *info)
        }
        if (info->attrs[NL80211_ATTR_AP_ISOLATE])
                params.ap_isolate = !!nla_get_u8(info->attrs[NL80211_ATTR_AP_ISOLATE]);
+       if (info->attrs[NL80211_ATTR_BSS_HT_OPMODE])
+               params.ht_opmode =
+                       nla_get_u16(info->attrs[NL80211_ATTR_BSS_HT_OPMODE]);
 
        if (!rdev->ops->change_bss)
                return -EOPNOTSUPP;