summaryrefslogtreecommitdiff
path: root/package/mac80211/patches/542-ath9k-add-MAC-revision-detection-for-AR9330.patch
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2011-06-01 13:12:31 +0000
committerGabor Juhos <juhosg@openwrt.org>2011-06-01 13:12:31 +0000
commit9769854aaee74ec632ca54f22791e6696df7cda0 (patch)
treef205ec3b34dc5434346c9a4d35b501f0e1d5beb8 /package/mac80211/patches/542-ath9k-add-MAC-revision-detection-for-AR9330.patch
parent750af1522ba651b715bd801f8032d5e990e87e5b (diff)
downloadmtk-20170518-9769854aaee74ec632ca54f22791e6696df7cda0.zip
mtk-20170518-9769854aaee74ec632ca54f22791e6696df7cda0.tar.gz
mtk-20170518-9769854aaee74ec632ca54f22791e6696df7cda0.tar.bz2
mac80211: add initial support for AR9330
SVN-Revision: 27084
Diffstat (limited to 'package/mac80211/patches/542-ath9k-add-MAC-revision-detection-for-AR9330.patch')
-rw-r--r--package/mac80211/patches/542-ath9k-add-MAC-revision-detection-for-AR9330.patch57
1 files changed, 57 insertions, 0 deletions
diff --git a/package/mac80211/patches/542-ath9k-add-MAC-revision-detection-for-AR9330.patch b/package/mac80211/patches/542-ath9k-add-MAC-revision-detection-for-AR9330.patch
new file mode 100644
index 0000000..9f5fa1c
--- /dev/null
+++ b/package/mac80211/patches/542-ath9k-add-MAC-revision-detection-for-AR9330.patch
@@ -0,0 +1,57 @@
+diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
+index 05c2ba2..ade8655 100644
+--- a/drivers/net/wireless/ath/ath9k/hw.c
++++ b/drivers/net/wireless/ath/ath9k/hw.c
+@@ -251,6 +251,15 @@ static void ath9k_hw_read_revisions(struct ath_hw *ah)
+ case AR5416_AR9100_DEVID:
+ ah->hw_version.macVersion = AR_SREV_VERSION_9100;
+ break;
++ case AR9300_DEVID_AR9330:
++ ah->hw_version.macVersion = AR_SREV_VERSION_9330;
++ if (ah->get_mac_revision) {
++ ah->hw_version.macRev = ah->get_mac_revision();
++ } else {
++ val = REG_READ(ah, AR_SREV);
++ ah->hw_version.macRev = MS(val, AR_SREV_REVISION2);
++ }
++ return;
+ case AR9300_DEVID_AR9340:
+ ah->hw_version.macVersion = AR_SREV_VERSION_9340;
+ val = REG_READ(ah, AR_SREV);
+diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h
+index 9f23451..8d9ac49 100644
+--- a/drivers/net/wireless/ath/ath9k/hw.h
++++ b/drivers/net/wireless/ath/ath9k/hw.h
+@@ -863,6 +863,7 @@ struct ath_hw {
+ u32 ent_mode;
+
+ bool is_clk_25mhz;
++ int (*get_mac_revision)(void);
+ };
+
+ struct ath_bus_ops {
+diff --git a/drivers/net/wireless/ath/ath9k/init.c b/drivers/net/wireless/ath/ath9k/init.c
+index 45c585a..c2defa2 100644
+--- a/drivers/net/wireless/ath/ath9k/init.c
++++ b/drivers/net/wireless/ath/ath9k/init.c
+@@ -575,6 +575,7 @@ static int ath9k_init_softc(u16 devid, struct ath_softc *sc, u16 subsysid,
+ sc->sc_ah->gpio_val = pdata->gpio_val;
+ sc->sc_ah->led_pin = pdata->led_pin;
+ ah->is_clk_25mhz = pdata->is_clk_25mhz;
++ ah->get_mac_revision = pdata->get_mac_revision;
+ }
+
+ common = ath9k_hw_common(ah);
+diff --git a/include/linux/ath9k_platform.h b/include/linux/ath9k_platform.h
+index 60a7c49..c207607 100644
+--- a/include/linux/ath9k_platform.h
++++ b/include/linux/ath9k_platform.h
+@@ -30,6 +30,7 @@ struct ath9k_platform_data {
+ u32 gpio_val;
+
+ bool is_clk_25mhz;
++ int (*get_mac_revision)(void);
+ };
+
+ #endif /* _LINUX_ATH9K_PLATFORM_H */
+