UPSTREAM: mwifiex: advertise mgmt_stype to cfg80211
authorBing Zhao <bzhao@marvell.com>
Fri, 5 Oct 2012 22:59:19 +0000 (15:59 -0700)
committerGerrit <chrome-bot@google.com>
Mon, 8 Oct 2012 06:33:25 +0000 (23:33 -0700)
Advertise supported management frame types to cfg80211.

Signed-off-by: Stone Piao <piaoyun@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
BUG=chrome-os-partner:14959
TEST=pass pre-WiFi Cert. test case 5.2.48

Change-Id: I4498bc5e9812fb00ad33f83ab20ef66774dd8210
Reviewed-on: https://gerrit.chromium.org/gerrit/34850
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Ready: Bing Zhao <bzhao@marvell.com>
Tested-by: Bing Zhao <bzhao@marvell.com>
drivers/net/wireless/mwifiex/cfg80211.c

index 5c9d83b..4bc0539 100644 (file)
@@ -830,6 +830,35 @@ static const u32 mwifiex_cipher_suites[] = {
        WLAN_CIPHER_SUITE_CCMP,
 };
 
+/* Supported mgmt frame types to be advertised to cfg80211 */
+static const struct ieee80211_txrx_stypes
+mwifiex_mgmt_stypes[NUM_NL80211_IFTYPES] = {
+       [NL80211_IFTYPE_STATION] = {
+               .tx = BIT(IEEE80211_STYPE_ACTION >> 4) |
+                     BIT(IEEE80211_STYPE_PROBE_RESP >> 4),
+               .rx = BIT(IEEE80211_STYPE_ACTION >> 4) |
+                     BIT(IEEE80211_STYPE_PROBE_REQ >> 4),
+       },
+       [NL80211_IFTYPE_AP] = {
+               .tx = BIT(IEEE80211_STYPE_ACTION >> 4) |
+                     BIT(IEEE80211_STYPE_PROBE_RESP >> 4),
+               .rx = BIT(IEEE80211_STYPE_ACTION >> 4) |
+                     BIT(IEEE80211_STYPE_PROBE_REQ >> 4),
+       },
+       [NL80211_IFTYPE_P2P_CLIENT] = {
+               .tx = BIT(IEEE80211_STYPE_ACTION >> 4) |
+                     BIT(IEEE80211_STYPE_PROBE_RESP >> 4),
+               .rx = BIT(IEEE80211_STYPE_ACTION >> 4) |
+                     BIT(IEEE80211_STYPE_PROBE_REQ >> 4),
+       },
+       [NL80211_IFTYPE_P2P_GO] = {
+               .tx = BIT(IEEE80211_STYPE_ACTION >> 4) |
+                     BIT(IEEE80211_STYPE_PROBE_RESP >> 4),
+               .rx = BIT(IEEE80211_STYPE_ACTION >> 4) |
+                     BIT(IEEE80211_STYPE_PROBE_REQ >> 4),
+       },
+};
+
 /*
  * CFG802.11 operation handler for setting bit rates.
  *
@@ -1596,6 +1625,7 @@ int mwifiex_register_cfg80211(struct mwifiex_private *priv)
        wdev->iftype = NL80211_IFTYPE_STATION;
        wdev->wiphy->max_scan_ssids = 10;
        wdev->wiphy->max_scan_ie_len = MWIFIEX_MAX_VSIE_LEN;
+       wdev->wiphy->mgmt_stypes = mwifiex_mgmt_stypes;
        wdev->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) |
                                       BIT(NL80211_IFTYPE_ADHOC);