aboutsummaryrefslogtreecommitdiffstats
path: root/package
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2009-11-25 20:35:58 +0000
committerGabor Juhos <juhosg@openwrt.org>2009-11-25 20:35:58 +0000
commit3662ae4e389bbd93fadf09d213c4e9a12fa097ad (patch)
treeb5631bea4b7e1ef8ac56d2584bdfd467a016da29 /package
parent22dbc6d993078d768e05db710ab810854f40f017 (diff)
downloadupstream-3662ae4e389bbd93fadf09d213c4e9a12fa097ad.tar.gz
upstream-3662ae4e389bbd93fadf09d213c4e9a12fa097ad.tar.bz2
upstream-3662ae4e389bbd93fadf09d213c4e9a12fa097ad.zip
package/mac80211: disable 2GHz band for 5GHz only devices
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@18537 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package')
-rw-r--r--package/mac80211/Makefile2
-rw-r--r--package/mac80211/patches/550-ath9k-enable-2GHz-band-only-if-the-device-supports.patch52
2 files changed, 53 insertions, 1 deletions
diff --git a/package/mac80211/Makefile b/package/mac80211/Makefile
index 2da34badac..62903e2665 100644
--- a/package/mac80211/Makefile
+++ b/package/mac80211/Makefile
@@ -11,7 +11,7 @@ include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=mac80211
PKG_VERSION:=2009-11-21
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PKG_SOURCE_URL:= \
http://www.orbit-lab.org/kernel/compat-wireless-2.6/2009/11 \
http://wireless.kernel.org/download/compat-wireless-2.6
diff --git a/package/mac80211/patches/550-ath9k-enable-2GHz-band-only-if-the-device-supports.patch b/package/mac80211/patches/550-ath9k-enable-2GHz-band-only-if-the-device-supports.patch
new file mode 100644
index 0000000000..dca58ed1f6
--- /dev/null
+++ b/package/mac80211/patches/550-ath9k-enable-2GHz-band-only-if-the-device-supports.patch
@@ -0,0 +1,52 @@
+--- a/drivers/net/wireless/ath/ath9k/main.c
++++ b/drivers/net/wireless/ath/ath9k/main.c
+@@ -1805,13 +1805,15 @@ static int ath_init_softc(u16 devid, str
+
+ /* setup channels and rates */
+
+- sc->sbands[IEEE80211_BAND_2GHZ].channels = ath9k_2ghz_chantable;
+- sc->sbands[IEEE80211_BAND_2GHZ].band = IEEE80211_BAND_2GHZ;
+- sc->sbands[IEEE80211_BAND_2GHZ].n_channels =
+- ARRAY_SIZE(ath9k_2ghz_chantable);
+- sc->sbands[IEEE80211_BAND_2GHZ].bitrates = ath9k_legacy_rates;
+- sc->sbands[IEEE80211_BAND_2GHZ].n_bitrates =
+- ARRAY_SIZE(ath9k_legacy_rates);
++ if (test_bit(ATH9K_MODE_11G, sc->sc_ah->caps.wireless_modes)) {
++ sc->sbands[IEEE80211_BAND_2GHZ].channels = ath9k_2ghz_chantable;
++ sc->sbands[IEEE80211_BAND_2GHZ].band = IEEE80211_BAND_2GHZ;
++ sc->sbands[IEEE80211_BAND_2GHZ].n_channels =
++ ARRAY_SIZE(ath9k_2ghz_chantable);
++ sc->sbands[IEEE80211_BAND_2GHZ].bitrates = ath9k_legacy_rates;
++ sc->sbands[IEEE80211_BAND_2GHZ].n_bitrates =
++ ARRAY_SIZE(ath9k_legacy_rates);
++ }
+
+ if (test_bit(ATH9K_MODE_11A, sc->sc_ah->caps.wireless_modes)) {
+ sc->sbands[IEEE80211_BAND_5GHZ].channels = ath9k_5ghz_chantable;
+@@ -1886,8 +1888,9 @@ void ath_set_hw_capab(struct ath_softc *
+
+ hw->rate_control_algorithm = "ath9k_rate_control";
+
+- hw->wiphy->bands[IEEE80211_BAND_2GHZ] =
+- &sc->sbands[IEEE80211_BAND_2GHZ];
++ if (test_bit(ATH9K_MODE_11G, sc->sc_ah->caps.wireless_modes))
++ hw->wiphy->bands[IEEE80211_BAND_2GHZ] =
++ &sc->sbands[IEEE80211_BAND_2GHZ];
+ if (test_bit(ATH9K_MODE_11A, sc->sc_ah->caps.wireless_modes))
+ hw->wiphy->bands[IEEE80211_BAND_5GHZ] =
+ &sc->sbands[IEEE80211_BAND_5GHZ];
+@@ -1926,9 +1929,12 @@ int ath_init_device(u16 devid, struct at
+ reg = &common->regulatory;
+
+ if (ah->caps.hw_caps & ATH9K_HW_CAP_HT) {
+- setup_ht_cap(sc, &sc->sbands[IEEE80211_BAND_2GHZ].ht_cap);
++ if (test_bit(ATH9K_MODE_11G, ah->caps.wireless_modes))
++ setup_ht_cap(sc,
++ &sc->sbands[IEEE80211_BAND_2GHZ].ht_cap);
+ if (test_bit(ATH9K_MODE_11A, ah->caps.wireless_modes))
+- setup_ht_cap(sc, &sc->sbands[IEEE80211_BAND_5GHZ].ht_cap);
++ setup_ht_cap(sc,
++ &sc->sbands[IEEE80211_BAND_5GHZ].ht_cap);
+ }
+
+ /* initialize tx/rx engine */