cfg80211: add VHT support for IBSS
authorJanusz.Dziedzic@tieto.com <Janusz.Dziedzic@tieto.com>
Sat, 21 Feb 2015 15:52:39 +0000 (16:52 +0100)
committerJohannes Berg <johannes.berg@intel.com>
Tue, 3 Mar 2015 14:56:04 +0000 (15:56 +0100)
Add NL80211_EXT_FEATURE_VHT_IBSS flag and VHT
support for IBSS.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
include/uapi/linux/nl80211.h
net/wireless/nl80211.c

index 2dcf9bba317c35137dd0f526ceeef3147069b3d0..8ee31f10840773b04e15e1ea0951c44715eccc86 100644 (file)
@@ -4328,11 +4328,13 @@ enum nl80211_feature_flags {
 
 /**
  * enum nl80211_ext_feature_index - bit index of extended features.
+ * @NL80211_EXT_FEATURE_VHT_IBSS: This driver supports IBSS with VHT datarates.
  *
  * @NUM_NL80211_EXT_FEATURES: number of extended features.
  * @MAX_NL80211_EXT_FEATURES: highest extended feature index.
  */
 enum nl80211_ext_feature_index {
+       NL80211_EXT_FEATURE_VHT_IBSS,
 
        /* add new features before the definition below */
        NUM_NL80211_EXT_FEATURES,
index 9c6e23ede5b233c62801fb93936a0bb34a8c996e..66666fdf1c8d643b644e7e0bd86bbcf64d4952f6 100644 (file)
@@ -7265,8 +7265,18 @@ static int nl80211_join_ibss(struct sk_buff *skb, struct genl_info *info)
                break;
        case NL80211_CHAN_WIDTH_20:
        case NL80211_CHAN_WIDTH_40:
-               if (rdev->wiphy.features & NL80211_FEATURE_HT_IBSS)
-                       break;
+               if (!(rdev->wiphy.features & NL80211_FEATURE_HT_IBSS))
+                       return -EINVAL;
+               break;
+       case NL80211_CHAN_WIDTH_80:
+       case NL80211_CHAN_WIDTH_80P80:
+       case NL80211_CHAN_WIDTH_160:
+               if (!(rdev->wiphy.features & NL80211_FEATURE_HT_IBSS))
+                       return -EINVAL;
+               if (!wiphy_ext_feature_isset(&rdev->wiphy,
+                                            NL80211_EXT_FEATURE_VHT_IBSS))
+                       return -EINVAL;
+               break;
        default:
                return -EINVAL;
        }