mac80211: update brcmfmac including missing boardrev workaround
[openwrt.git] / package / kernel / mac80211 / patches / 310-ath9k_hw-ignore-eeprom-magic-mismatch-on-flash-based.patch
1 From: Felix Fietkau <nbd@openwrt.org>
2 Date: Thu, 21 Jan 2016 16:28:44 +0100
3 Subject: [PATCH] ath9k_hw: ignore eeprom magic mismatch on flash based devices
4
5 Many AR913x based devices (maybe others too) do not have a valid EEPROM
6 magic in their calibration data partition.
7
8 Fixes: 6fa658fd5ab2 ("ath9k: Simplify and fix eeprom endianness swapping")
9 Signed-off-by: Felix Fietkau <nbd@openwrt.org>
10 ---
11
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_
15                 return -EIO;
16         }
17  
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) {
24                         ath_info(common,
25                                  "Ignoring endianness difference in EEPROM magic bytes.\n");
26 -
27 -                       *swap_needed = false;
28                 } else {
29                         *swap_needed = true;
30                 }
31 -       } else {
32 +       } else if (magic != AR5416_EEPROM_MAGIC) {
33 +               if (ath9k_hw_use_flash(ah))
34 +                       return 0;
35 +
36                 ath_err(common,
37                         "Invalid EEPROM Magic (0x%04x).\n", magic);
38                 return -EINVAL;