1 From: Felix Fietkau <nbd@nbd.name>
2 Date: Thu, 21 Jan 2016 16:28:44 +0100
3 Subject: [PATCH] ath9k_hw: ignore eeprom magic mismatch on flash based devices
5 Many AR913x based devices (maybe others too) do not have a valid EEPROM
6 magic in their calibration data partition.
8 Fixes: 6fa658fd5ab2 ("ath9k: Simplify and fix eeprom endianness swapping")
9 Signed-off-by: Felix Fietkau <nbd@nbd.name>
12 --- a/drivers/net/wireless/ath/ath9k/eeprom.c
13 +++ b/drivers/net/wireless/ath/ath9k/eeprom.c
14 @@ -150,18 +150,18 @@ int ath9k_hw_nvram_swap_data(struct ath_
18 - if (magic == AR5416_EEPROM_MAGIC) {
19 - *swap_needed = false;
20 - } else if (swab16(magic) == AR5416_EEPROM_MAGIC) {
21 + *swap_needed = false;
22 + if (swab16(magic) == AR5416_EEPROM_MAGIC) {
23 if (ah->ah_flags & AH_NO_EEP_SWAP) {
25 "Ignoring endianness difference in EEPROM magic bytes.\n");
27 - *swap_needed = false;
32 + } else if (magic != AR5416_EEPROM_MAGIC) {
33 + if (ath9k_hw_use_flash(ah))
37 "Invalid EEPROM Magic (0x%04x).\n", magic);