aboutsummaryrefslogtreecommitdiffstats
path: root/package
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2012-02-18 17:36:09 +0000
committerGabor Juhos <juhosg@openwrt.org>2012-02-18 17:36:09 +0000
commit89d7f8112ea4d4f66696028f482197ee92e6fe1a (patch)
treece06dda38c54735272f5a1230e4ae887b9bed5cb /package
parentd4b6ea4a9a33b6f11ab8049770ded5e25185bd8e (diff)
downloadupstream-89d7f8112ea4d4f66696028f482197ee92e6fe1a.tar.gz
upstream-89d7f8112ea4d4f66696028f482197ee92e6fe1a.tar.bz2
upstream-89d7f8112ea4d4f66696028f482197ee92e6fe1a.zip
mac80211: rt2x00: allow to disable bands via platform data
SVN-Revision: 30629
Diffstat (limited to 'package')
-rw-r--r--package/mac80211/Makefile2
-rw-r--r--package/mac80211/patches/608-rt2x00-allow_disabling_bands_through_platform_data.patch47
2 files changed, 48 insertions, 1 deletions
diff --git a/package/mac80211/Makefile b/package/mac80211/Makefile
index 13727d153a..1c1ff0db4f 100644
--- a/package/mac80211/Makefile
+++ b/package/mac80211/Makefile
@@ -11,7 +11,7 @@ include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=mac80211
PKG_VERSION:=2012-02-06
-PKG_RELEASE:=3
+PKG_RELEASE:=4
PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources
PKG_MD5SUM:=fae71c35ee3f3de6329f2db7aed6d265
diff --git a/package/mac80211/patches/608-rt2x00-allow_disabling_bands_through_platform_data.patch b/package/mac80211/patches/608-rt2x00-allow_disabling_bands_through_platform_data.patch
new file mode 100644
index 0000000000..df8f44509e
--- /dev/null
+++ b/package/mac80211/patches/608-rt2x00-allow_disabling_bands_through_platform_data.patch
@@ -0,0 +1,47 @@
+--- a/include/linux/rt2x00_platform.h
++++ b/include/linux/rt2x00_platform.h
+@@ -14,6 +14,9 @@
+
+ struct rt2x00_platform_data {
+ char *eeprom_file_name;
++
++ int disable_2ghz;
++ int disable_5ghz;
+ };
+
+ #endif /* _RT2X00_PLATFORM_H */
+--- a/drivers/net/wireless/rt2x00/rt2x00dev.c
++++ b/drivers/net/wireless/rt2x00/rt2x00dev.c
+@@ -825,6 +825,22 @@ static int rt2x00lib_probe_hw_modes(stru
+ unsigned int num_rates;
+ unsigned int i;
+
++ if (rt2x00dev->dev->platform_data) {
++ struct rt2x00_platform_data *pdata;
++
++ pdata = rt2x00dev->dev->platform_data;
++ if (pdata->disable_2ghz)
++ spec->supported_bands &= ~SUPPORT_BAND_2GHZ;
++ if (pdata->disable_5ghz)
++ spec->supported_bands &= ~SUPPORT_BAND_5GHZ;
++ }
++
++ if ((spec->supported_bands & SUPPORT_BAND_BOTH) == 0) {
++ ERROR(rt2x00dev, "No supported bands\n");
++ return -EINVAL;
++ }
++
++
+ num_rates = 0;
+ if (spec->supported_rates & SUPPORT_RATE_CCK)
+ num_rates += 4;
+--- a/drivers/net/wireless/rt2x00/rt2x00.h
++++ b/drivers/net/wireless/rt2x00/rt2x00.h
+@@ -420,6 +420,7 @@ struct hw_mode_spec {
+ unsigned int supported_bands;
+ #define SUPPORT_BAND_2GHZ 0x00000001
+ #define SUPPORT_BAND_5GHZ 0x00000002
++#define SUPPORT_BAND_BOTH (SUPPORT_BAND_2GHZ | SUPPORT_BAND_5GHZ)
+
+ unsigned int supported_rates;
+ #define SUPPORT_RATE_CCK 0x00000001