aboutsummaryrefslogtreecommitdiffstats
path: root/package/mac80211
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2012-06-27 01:23:17 +0000
committerFelix Fietkau <nbd@openwrt.org>2012-06-27 01:23:17 +0000
commit6dfce4a40950afcedb64f7c61da3534e8ef1b10d (patch)
treee23cdf75346fb99ef6573e90762a6bb2ea615e68 /package/mac80211
parentf2faac1b94b1043de1e7dea20f51b1c0b6bc845b (diff)
downloadmaster-187ad058-6dfce4a40950afcedb64f7c61da3534e8ef1b10d.tar.gz
master-187ad058-6dfce4a40950afcedb64f7c61da3534e8ef1b10d.tar.bz2
master-187ad058-6dfce4a40950afcedb64f7c61da3534e8ef1b10d.zip
ath9k: make antenna mask validation more flexible, allow arbitrary tx chain combinations, enable rx for chains that have enabled tx as well, fix using the second antenna for single-stream diversity based devices
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@32508 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/mac80211')
-rw-r--r--package/mac80211/patches/561-ath9k_antenna_mask_validate.patch13
1 files changed, 9 insertions, 4 deletions
diff --git a/package/mac80211/patches/561-ath9k_antenna_mask_validate.patch b/package/mac80211/patches/561-ath9k_antenna_mask_validate.patch
index c84162fe44..f837c686c7 100644
--- a/package/mac80211/patches/561-ath9k_antenna_mask_validate.patch
+++ b/package/mac80211/patches/561-ath9k_antenna_mask_validate.patch
@@ -1,16 +1,18 @@
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
-@@ -1929,12 +1929,24 @@ static u32 fill_chainmask(u32 cap, u32 n
+@@ -1929,14 +1929,29 @@ static u32 fill_chainmask(u32 cap, u32 n
return filled;
}
-+static bool validate_antenna_mask(u32 val)
++static bool validate_antenna_mask(struct ath_hw *ah, u32 val)
+{
-+ switch (val & 0x7) {
++ switch (val & ah->caps.rx_chainmask) {
+ case 0x1:
+ case 0x3:
+ case 0x7:
+ return true;
++ case 0x2:
++ return (ah->caps.rx_chainmask == 1);
+ default:
+ return false;
+ }
@@ -22,7 +24,10 @@
struct ath_hw *ah = sc->sc_ah;
- if (!rx_ant || !tx_ant)
-+ if (!validate_antenna_mask(rx_ant) || !validate_antenna_mask(tx_ant))
++ if (!validate_antenna_mask(ah, rx_ant) || !tx_ant)
return -EINVAL;
++ rx_ant |= tx_ant;
sc->ant_rx = rx_ant;
+ sc->ant_tx = tx_ant;
+