2012-03-25 08:51:08 +00:00
|
|
|
--- a/drivers/net/wireless/ath/ath9k/eeprom_def.c
|
|
|
|
+++ b/drivers/net/wireless/ath/ath9k/eeprom_def.c
|
2012-12-10 15:46:15 +00:00
|
|
|
@@ -262,7 +262,7 @@ static int ath9k_hw_def_check_eeprom(str
|
2012-09-08 11:10:54 +00:00
|
|
|
{
|
|
|
|
struct ar5416_eeprom_def *eep = &ah->eeprom.def;
|
2012-03-25 08:51:08 +00:00
|
|
|
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;
|
2012-12-10 15:46:15 +00:00
|
|
|
@@ -272,27 +272,16 @@ static int ath9k_hw_def_check_eeprom(str
|
2012-03-25 08:51:08 +00:00
|
|
|
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;
|
|
|
|
- }
|
2012-03-27 13:21:53 +00:00
|
|
|
+ if (swab16(magic) == AR5416_EEPROM_MAGIC &&
|
|
|
|
+ !(ah->ah_flags & AH_NO_EEP_SWAP)) {
|
2012-03-25 08:51:08 +00:00
|
|
|
+ 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++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-03-27 13:21:53 +00:00
|
|
|
--- a/drivers/net/wireless/ath/ath9k/eeprom_4k.c
|
|
|
|
+++ b/drivers/net/wireless/ath/ath9k/eeprom_4k.c
|
2012-12-10 15:46:15 +00:00
|
|
|
@@ -57,7 +57,7 @@ static bool ath9k_hw_4k_fill_eeprom(stru
|
|
|
|
{
|
|
|
|
struct ath_common *common = ath9k_hw_common(ah);
|
2012-03-27 13:21:53 +00:00
|
|
|
|
|
|
|
- if (!ath9k_hw_use_flash(ah)) {
|
|
|
|
+ if (!(ah->ah_flags & AH_NO_EEP_SWAP)) {
|
2012-12-10 15:46:15 +00:00
|
|
|
ath_dbg(common, EEPROM, "Reading from EEPROM, not flash\n");
|
|
|
|
}
|
|
|
|
|
2012-03-27 13:21:53 +00:00
|
|
|
--- a/drivers/net/wireless/ath/ath9k/eeprom_9287.c
|
|
|
|
+++ b/drivers/net/wireless/ath/ath9k/eeprom_9287.c
|
2012-12-10 15:46:15 +00:00
|
|
|
@@ -60,7 +60,7 @@ static bool ath9k_hw_ar9287_fill_eeprom(
|
|
|
|
{
|
2012-03-27 13:21:53 +00:00
|
|
|
struct ath_common *common = ath9k_hw_common(ah);
|
|
|
|
|
|
|
|
- if (!ath9k_hw_use_flash(ah)) {
|
|
|
|
+ if (!(ah->ah_flags & AH_NO_EEP_SWAP)) {
|
2012-12-10 15:46:15 +00:00
|
|
|
ath_dbg(common, EEPROM, "Reading from EEPROM, not flash\n");
|
|
|
|
}
|
|
|
|
|
2012-03-27 13:21:53 +00:00
|
|
|
--- a/drivers/net/wireless/ath/ath9k/hw.h
|
|
|
|
+++ b/drivers/net/wireless/ath/ath9k/hw.h
|
2013-12-19 17:18:07 +00:00
|
|
|
@@ -707,6 +707,7 @@ enum ath_cal_list {
|
2012-03-27 13:21:53 +00:00
|
|
|
#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
|
2013-12-19 17:18:07 +00:00
|
|
|
@@ -719,6 +719,8 @@ static int ath9k_init_softc(u16 devid, s
|
2012-03-27 13:21:53 +00:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2013-11-12 22:11:33 +00:00
|
|
|
common->ops = &ah->reg_ops;
|
2012-03-27 13:21:53 +00:00
|
|
|
--- a/include/linux/ath9k_platform.h
|
|
|
|
+++ b/include/linux/ath9k_platform.h
|
2012-12-10 15:46:15 +00:00
|
|
|
@@ -31,6 +31,7 @@ struct ath9k_platform_data {
|
2012-03-27 13:21:53 +00:00
|
|
|
u32 gpio_mask;
|
|
|
|
u32 gpio_val;
|
|
|
|
|
|
|
|
+ bool endian_check;
|
|
|
|
bool is_clk_25mhz;
|
2013-12-08 14:48:30 +00:00
|
|
|
bool tx_gain_buffalo;
|
|
|
|
|