aboutsummaryrefslogtreecommitdiffstats
path: root/package/kernel/mac80211/patches/333-ath9k-add-support-for-endian-swap-of-eeprom-from-pla.patch
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2014-11-07 19:41:07 +0000
committerFelix Fietkau <nbd@openwrt.org>2014-11-07 19:41:07 +0000
commit47f462d16716fdbcb24af448009d7c84f26c33d3 (patch)
tree3bb43623cbdd8222e53e7e2a9a85122ec6ce2adc /package/kernel/mac80211/patches/333-ath9k-add-support-for-endian-swap-of-eeprom-from-pla.patch
parentb798df3e960f6bcb4910a4bee447ccadc0bb7d97 (diff)
downloadmaster-187ad058-47f462d16716fdbcb24af448009d7c84f26c33d3.tar.gz
master-187ad058-47f462d16716fdbcb24af448009d7c84f26c33d3.tar.bz2
master-187ad058-47f462d16716fdbcb24af448009d7c84f26c33d3.zip
mac80211: update to wireless-testing 2014-11-04
Signed-off-by: Felix Fietkau <nbd@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@43210 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/kernel/mac80211/patches/333-ath9k-add-support-for-endian-swap-of-eeprom-from-pla.patch')
-rw-r--r--package/kernel/mac80211/patches/333-ath9k-add-support-for-endian-swap-of-eeprom-from-pla.patch92
1 files changed, 0 insertions, 92 deletions
diff --git a/package/kernel/mac80211/patches/333-ath9k-add-support-for-endian-swap-of-eeprom-from-pla.patch b/package/kernel/mac80211/patches/333-ath9k-add-support-for-endian-swap-of-eeprom-from-pla.patch
deleted file mode 100644
index df1a710a1c..0000000000
--- a/package/kernel/mac80211/patches/333-ath9k-add-support-for-endian-swap-of-eeprom-from-pla.patch
+++ /dev/null
@@ -1,92 +0,0 @@
-From: Felix Fietkau <nbd@openwrt.org>
-Date: Sat, 18 Oct 2014 18:24:15 +0200
-Subject: [PATCH] ath9k: add support for endian swap of eeprom from
- platform data
-
-On some devices (especially little-endian ones), the flash EEPROM data
-has a different endian, which needs to be detected.
-Add a flag to the platform data to allow overriding that behavior
-
-Signed-off-by: Felix Fietkau <nbd@openwrt.org>
----
-
---- a/drivers/net/wireless/ath/ath9k/eeprom_def.c
-+++ b/drivers/net/wireless/ath/ath9k/eeprom_def.c
-@@ -262,7 +262,7 @@ static int ath9k_hw_def_check_eeprom(str
- {
- struct ar5416_eeprom_def *eep = &ah->eeprom.def;
- struct ath_common *common = ath9k_hw_common(ah);
-- u16 *eepdata, temp, magic, magic2;
-+ u16 *eepdata, temp, magic;
- u32 sum = 0, el;
- bool need_swap = false;
- int i, addr, size;
-@@ -272,27 +272,16 @@ static int ath9k_hw_def_check_eeprom(str
- return false;
- }
-
-- if (!ath9k_hw_use_flash(ah)) {
-- ath_dbg(common, EEPROM, "Read Magic = 0x%04X\n", magic);
--
-- if (magic != AR5416_EEPROM_MAGIC) {
-- magic2 = swab16(magic);
--
-- if (magic2 == AR5416_EEPROM_MAGIC) {
-- size = sizeof(struct ar5416_eeprom_def);
-- need_swap = true;
-- eepdata = (u16 *) (&ah->eeprom);
--
-- for (addr = 0; addr < size / sizeof(u16); addr++) {
-- temp = swab16(*eepdata);
-- *eepdata = temp;
-- eepdata++;
-- }
-- } else {
-- ath_err(common,
-- "Invalid EEPROM Magic. Endianness mismatch.\n");
-- return -EINVAL;
-- }
-+ if (swab16(magic) == AR5416_EEPROM_MAGIC &&
-+ !(ah->ah_flags & AH_NO_EEP_SWAP)) {
-+ size = sizeof(struct ar5416_eeprom_def);
-+ need_swap = true;
-+ eepdata = (u16 *) (&ah->eeprom);
-+
-+ for (addr = 0; addr < size / sizeof(u16); addr++) {
-+ temp = swab16(*eepdata);
-+ *eepdata = temp;
-+ eepdata++;
- }
- }
-
---- a/drivers/net/wireless/ath/ath9k/hw.h
-+++ b/drivers/net/wireless/ath/ath9k/hw.h
-@@ -731,6 +731,7 @@ enum ath_cal_list {
- #define AH_USE_EEPROM 0x1
- #define AH_UNPLUGGED 0x2 /* The card has been physically removed. */
- #define AH_FASTCC 0x4
-+#define AH_NO_EEP_SWAP 0x8 /* Do not swap EEPROM data */
-
- struct ath_hw {
- struct ath_ops reg_ops;
---- a/drivers/net/wireless/ath/ath9k/init.c
-+++ b/drivers/net/wireless/ath/ath9k/init.c
-@@ -531,6 +531,8 @@ static int ath9k_init_softc(u16 devid, s
- ah->is_clk_25mhz = pdata->is_clk_25mhz;
- ah->get_mac_revision = pdata->get_mac_revision;
- ah->external_reset = pdata->external_reset;
-+ if (!pdata->endian_check)
-+ ah->ah_flags |= AH_NO_EEP_SWAP;
- }
-
- common->ops = &ah->reg_ops;
---- a/include/linux/ath9k_platform.h
-+++ b/include/linux/ath9k_platform.h
-@@ -31,6 +31,7 @@ struct ath9k_platform_data {
- u32 gpio_mask;
- u32 gpio_val;
-
-+ bool endian_check;
- bool is_clk_25mhz;
- bool tx_gain_buffalo;
-