diff options
author | Felix Fietkau <nbd@openwrt.org> | 2011-04-11 03:26:08 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2011-04-11 03:26:08 +0000 |
commit | 370f14a6d461cb9bd20ec5c1900b1b872993af5e (patch) | |
tree | 69cdea3e246fb0d4b1339bb573e2c44b688311fe /package/mac80211/patches | |
parent | f9710f430415d64e981aacfbb67616d6543959e7 (diff) | |
download | master-187ad058-370f14a6d461cb9bd20ec5c1900b1b872993af5e.tar.gz master-187ad058-370f14a6d461cb9bd20ec5c1900b1b872993af5e.tar.bz2 master-187ad058-370f14a6d461cb9bd20ec5c1900b1b872993af5e.zip |
ath5k: disable the unusable 2 GHz mode on the first radio of a dual-band AR5312 device
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@26587 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/mac80211/patches')
-rw-r--r-- | package/mac80211/patches/475-ath5k_fix_ar5312_5ghz_cap.patch | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/package/mac80211/patches/475-ath5k_fix_ar5312_5ghz_cap.patch b/package/mac80211/patches/475-ath5k_fix_ar5312_5ghz_cap.patch new file mode 100644 index 0000000000..535c61e433 --- /dev/null +++ b/package/mac80211/patches/475-ath5k_fix_ar5312_5ghz_cap.patch @@ -0,0 +1,50 @@ +--- a/drivers/net/wireless/ath/ath5k/base.h ++++ b/drivers/net/wireless/ath/ath5k/base.h +@@ -193,12 +193,13 @@ struct ath5k_softc { + dma_addr_t desc_daddr; /* DMA (physical) address */ + size_t desc_len; /* size of TX/RX descriptors */ + +- DECLARE_BITMAP(status, 5); ++ DECLARE_BITMAP(status, 6); + #define ATH_STAT_INVALID 0 /* disable hardware accesses */ + #define ATH_STAT_MRRETRY 1 /* multi-rate retry support */ + #define ATH_STAT_PROMISC 2 + #define ATH_STAT_LEDSOFT 3 /* enable LED gpio status */ + #define ATH_STAT_STARTED 4 /* opened & irqs enabled */ ++#define ATH_STAT_2G_DISABLED 5 /* multiband radio without 2G */ + + unsigned int filter_flags; /* HW flags, AR5K_RX_FILTER_* */ + struct ieee80211_channel *curchan; /* current h/w channel */ +--- a/drivers/net/wireless/ath/ath5k/ahb.c ++++ b/drivers/net/wireless/ath/ath5k/ahb.c +@@ -160,6 +160,16 @@ static int ath_ahb_probe(struct platform + else + reg |= AR5K_AR5312_ENABLE_WLAN1; + __raw_writel(reg, (void __iomem *) AR5K_AR5312_ENABLE); ++ ++ /* ++ * On a dual-band AR5312, the multiband radio is only ++ * used as pass-through. Disable 2 GHz support in the ++ * driver for it ++ */ ++ if (to_platform_device(sc->dev)->id == 0 && ++ (bcfg->config->flags & (BD_WLAN0|BD_WLAN1)) == ++ (BD_WLAN1|BD_WLAN0)) ++ __set_bit(ATH_STAT_2G_DISABLED, sc->status); + } + + ret = ath5k_init_softc(sc, &ath_ahb_bus_ops); +--- a/drivers/net/wireless/ath/ath5k/attach.c ++++ b/drivers/net/wireless/ath/ath5k/attach.c +@@ -313,6 +313,11 @@ int ath5k_hw_init(struct ath5k_softc *sc + goto err; + } + ++ if (test_bit(ATH_STAT_2G_DISABLED, sc->status)) { ++ __clear_bit(AR5K_MODE_11B, ah->ah_capabilities.cap_mode); ++ __clear_bit(AR5K_MODE_11G, ah->ah_capabilities.cap_mode); ++ } ++ + /* Crypto settings */ + common->keymax = (sc->ah->ah_version == AR5K_AR5210 ? + AR5K_KEYTABLE_SIZE_5210 : AR5K_KEYTABLE_SIZE_5211); |