]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
ath9k_hw: disable hardware ad-hoc flag on ar934x rev 3
authorFelix Fietkau <nbd@openwrt.org>
Sat, 27 Sep 2014 20:49:44 +0000 (22:49 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 30 Sep 2014 17:17:39 +0000 (13:17 -0400)
On AR934x rev 3, settin the ad-hoc flag completely messes up hardware
state - beacons get stuck, almost no packets make it out, hardware is
constantly reset.

When leaving out that flag and setting up the hw like in AP mode, TSF
timers won't be automatically synced, but at least the rest works.

AR934x rev 2 and older are not affected by this bug

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath/ath9k/hw.c
drivers/net/wireless/ath/ath9k/reg.h

index cf0128e6869e749f1bbf0e5998f12a62f52e39a4..88654e384ae29410f1f05f2a01bd6cc250585879 100644 (file)
@@ -1189,9 +1189,12 @@ static void ath9k_hw_set_operating_mode(struct ath_hw *ah, int opmode)
 
        switch (opmode) {
        case NL80211_IFTYPE_ADHOC:
-               set |= AR_STA_ID1_ADHOC;
-               REG_SET_BIT(ah, AR_CFG, AR_CFG_AP_ADHOC_INDICATION);
-               break;
+               if (!AR_SREV_9340_13(ah)) {
+                       set |= AR_STA_ID1_ADHOC;
+                       REG_SET_BIT(ah, AR_CFG, AR_CFG_AP_ADHOC_INDICATION);
+                       break;
+               }
+               /* fall through */
        case NL80211_IFTYPE_MESH_POINT:
        case NL80211_IFTYPE_AP:
                set |= AR_STA_ID1_STA_AP;
index a1499700bcf26d243fd159f0d6d918b459c8239f..95fdf93c2b7c72998545a9b262d6a8314f2c6187 100644 (file)
 #define AR_SREV_9340(_ah) \
        (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9340))
 
+#define AR_SREV_9340_13(_ah) \
+       (AR_SREV_9340((_ah)) && \
+        ((_ah)->hw_version.macRev == AR_SREV_REVISION_9340_13))
+
 #define AR_SREV_9340_13_OR_LATER(_ah) \
        (AR_SREV_9340((_ah)) && \
         ((_ah)->hw_version.macRev >= AR_SREV_REVISION_9340_13))