aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/main.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2010-08-12 09:38:38 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-08-24 16:27:56 -0400
commit2e161f78e5f63a7f9fd25a766bb7f816a01eb14a (patch)
treebefd44feeb1f47da1f41e6fc310a223ad67030ff /net/mac80211/main.c
parentac4c977d16d843f12901595c91773dddb65768a9 (diff)
cfg80211/mac80211: extensible frame processing
Allow userspace to register for more than just action frames by giving the frame subtype, and make it possible to use this in various modes as well. With some tweaks and some added functionality this will, in the future, also be usable in AP mode and be able to replace the cooked monitor interface currently used in that case. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/main.c')
-rw-r--r--net/mac80211/main.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index 0afccda42a24..a53feac4618c 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -417,6 +417,41 @@ void ieee80211_napi_complete(struct ieee80211_hw *hw)
417} 417}
418EXPORT_SYMBOL(ieee80211_napi_complete); 418EXPORT_SYMBOL(ieee80211_napi_complete);
419 419
420/* There isn't a lot of sense in it, but you can transmit anything you like */
421static const struct ieee80211_txrx_stypes
422ieee80211_default_mgmt_stypes[NUM_NL80211_IFTYPES] = {
423 [NL80211_IFTYPE_ADHOC] = {
424 .tx = 0xffff,
425 .rx = BIT(IEEE80211_STYPE_ACTION >> 4),
426 },
427 [NL80211_IFTYPE_STATION] = {
428 .tx = 0xffff,
429 .rx = BIT(IEEE80211_STYPE_ACTION >> 4) |
430 BIT(IEEE80211_STYPE_PROBE_REQ >> 4),
431 },
432 [NL80211_IFTYPE_AP] = {
433 .tx = 0xffff,
434 .rx = BIT(IEEE80211_STYPE_ASSOC_REQ >> 4) |
435 BIT(IEEE80211_STYPE_REASSOC_REQ >> 4) |
436 BIT(IEEE80211_STYPE_PROBE_REQ >> 4) |
437 BIT(IEEE80211_STYPE_DISASSOC >> 4) |
438 BIT(IEEE80211_STYPE_AUTH >> 4) |
439 BIT(IEEE80211_STYPE_DEAUTH >> 4) |
440 BIT(IEEE80211_STYPE_ACTION >> 4),
441 },
442 [NL80211_IFTYPE_AP_VLAN] = {
443 /* copy AP */
444 .tx = 0xffff,
445 .rx = BIT(IEEE80211_STYPE_ASSOC_REQ >> 4) |
446 BIT(IEEE80211_STYPE_REASSOC_REQ >> 4) |
447 BIT(IEEE80211_STYPE_PROBE_REQ >> 4) |
448 BIT(IEEE80211_STYPE_DISASSOC >> 4) |
449 BIT(IEEE80211_STYPE_AUTH >> 4) |
450 BIT(IEEE80211_STYPE_DEAUTH >> 4) |
451 BIT(IEEE80211_STYPE_ACTION >> 4),
452 },
453};
454
420struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len, 455struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len,
421 const struct ieee80211_ops *ops) 456 const struct ieee80211_ops *ops)
422{ 457{
@@ -446,6 +481,8 @@ struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len,
446 if (!wiphy) 481 if (!wiphy)
447 return NULL; 482 return NULL;
448 483
484 wiphy->mgmt_stypes = ieee80211_default_mgmt_stypes;
485
449 wiphy->flags |= WIPHY_FLAG_NETNS_OK | 486 wiphy->flags |= WIPHY_FLAG_NETNS_OK |
450 WIPHY_FLAG_4ADDR_AP | 487 WIPHY_FLAG_4ADDR_AP |
451 WIPHY_FLAG_4ADDR_STATION; 488 WIPHY_FLAG_4ADDR_STATION;