diff options
author | Amitkumar Karwar <akarwar@marvell.com> | 2011-04-21 17:10:27 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-04-25 14:50:17 -0400 |
commit | 40db6c77ab48c3f3240422ff92fd6da222e2eb95 (patch) | |
tree | f880a016b250d24bd8c2af822c9f345b6f41de32 | |
parent | 0a6c9b1b666671a22905d38bc41ec1a04b85832f (diff) |
cfg80211: module_param to disable HT40 in 2.4GHz band
Currently mac80211 uses ieee80211_disable_40mhz_24ghz module
parameter to allow disabling 40MHz operation in the 2.4GHz band.
Move this handling from mac80211 to cfg80211 so that the feature
will be more generic.
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Reviewed-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | net/mac80211/main.c | 18 | ||||
-rw-r--r-- | net/wireless/core.c | 17 |
2 files changed, 17 insertions, 18 deletions
diff --git a/net/mac80211/main.c b/net/mac80211/main.c index 0ab2a8df312d..61877662e8f8 100644 --- a/net/mac80211/main.c +++ b/net/mac80211/main.c | |||
@@ -33,12 +33,6 @@ | |||
33 | #include "cfg.h" | 33 | #include "cfg.h" |
34 | #include "debugfs.h" | 34 | #include "debugfs.h" |
35 | 35 | ||
36 | |||
37 | static bool ieee80211_disable_40mhz_24ghz; | ||
38 | module_param(ieee80211_disable_40mhz_24ghz, bool, 0644); | ||
39 | MODULE_PARM_DESC(ieee80211_disable_40mhz_24ghz, | ||
40 | "Disable 40MHz support in the 2.4GHz band"); | ||
41 | |||
42 | static struct lock_class_key ieee80211_rx_skb_queue_class; | 36 | static struct lock_class_key ieee80211_rx_skb_queue_class; |
43 | 37 | ||
44 | void ieee80211_configure_filter(struct ieee80211_local *local) | 38 | void ieee80211_configure_filter(struct ieee80211_local *local) |
@@ -728,18 +722,6 @@ int ieee80211_register_hw(struct ieee80211_hw *hw) | |||
728 | } | 722 | } |
729 | channels += sband->n_channels; | 723 | channels += sband->n_channels; |
730 | 724 | ||
731 | /* | ||
732 | * Since ieee80211_disable_40mhz_24ghz is global, we can | ||
733 | * modify the sband's ht data even if the driver uses a | ||
734 | * global structure for that. | ||
735 | */ | ||
736 | if (ieee80211_disable_40mhz_24ghz && | ||
737 | band == IEEE80211_BAND_2GHZ && | ||
738 | sband->ht_cap.ht_supported) { | ||
739 | sband->ht_cap.cap &= ~IEEE80211_HT_CAP_SUP_WIDTH_20_40; | ||
740 | sband->ht_cap.cap &= ~IEEE80211_HT_CAP_SGI_40; | ||
741 | } | ||
742 | |||
743 | if (max_bitrates < sband->n_bitrates) | 725 | if (max_bitrates < sband->n_bitrates) |
744 | max_bitrates = sband->n_bitrates; | 726 | max_bitrates = sband->n_bitrates; |
745 | supp_ht = supp_ht || sband->ht_cap.ht_supported; | 727 | supp_ht = supp_ht || sband->ht_cap.ht_supported; |
diff --git a/net/wireless/core.c b/net/wireless/core.c index fe01de29bfe8..bbf1fa11107a 100644 --- a/net/wireless/core.c +++ b/net/wireless/core.c | |||
@@ -46,6 +46,11 @@ static struct dentry *ieee80211_debugfs_dir; | |||
46 | /* for the cleanup, scan and event works */ | 46 | /* for the cleanup, scan and event works */ |
47 | struct workqueue_struct *cfg80211_wq; | 47 | struct workqueue_struct *cfg80211_wq; |
48 | 48 | ||
49 | static bool cfg80211_disable_40mhz_24ghz; | ||
50 | module_param(cfg80211_disable_40mhz_24ghz, bool, 0644); | ||
51 | MODULE_PARM_DESC(cfg80211_disable_40mhz_24ghz, | ||
52 | "Disable 40MHz support in the 2.4GHz band"); | ||
53 | |||
49 | /* requires cfg80211_mutex to be held! */ | 54 | /* requires cfg80211_mutex to be held! */ |
50 | struct cfg80211_registered_device *cfg80211_rdev_by_wiphy_idx(int wiphy_idx) | 55 | struct cfg80211_registered_device *cfg80211_rdev_by_wiphy_idx(int wiphy_idx) |
51 | { | 56 | { |
@@ -451,6 +456,18 @@ int wiphy_register(struct wiphy *wiphy) | |||
451 | return -EINVAL; | 456 | return -EINVAL; |
452 | 457 | ||
453 | /* | 458 | /* |
459 | * Since cfg80211_disable_40mhz_24ghz is global, we can | ||
460 | * modify the sband's ht data even if the driver uses a | ||
461 | * global structure for that. | ||
462 | */ | ||
463 | if (cfg80211_disable_40mhz_24ghz && | ||
464 | band == IEEE80211_BAND_2GHZ && | ||
465 | sband->ht_cap.ht_supported) { | ||
466 | sband->ht_cap.cap &= ~IEEE80211_HT_CAP_SUP_WIDTH_20_40; | ||
467 | sband->ht_cap.cap &= ~IEEE80211_HT_CAP_SGI_40; | ||
468 | } | ||
469 | |||
470 | /* | ||
454 | * Since we use a u32 for rate bitmaps in | 471 | * Since we use a u32 for rate bitmaps in |
455 | * ieee80211_get_response_rate, we cannot | 472 | * ieee80211_get_response_rate, we cannot |
456 | * have more than 32 legacy rates. | 473 | * have more than 32 legacy rates. |