aboutsummaryrefslogtreecommitdiffstats
path: root/package
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2012-06-04 10:42:03 +0000
committerFelix Fietkau <nbd@openwrt.org>2012-06-04 10:42:03 +0000
commitb755998cd7d06275d2f98be337ed66de72f349c4 (patch)
tree06871e10b9868d39affcdf9a06bb136fbc5c1560 /package
parentffea8eb913378252b8cb29849cc3c5050036dc4f (diff)
downloadupstream-b755998cd7d06275d2f98be337ed66de72f349c4.tar.gz
upstream-b755998cd7d06275d2f98be337ed66de72f349c4.tar.bz2
upstream-b755998cd7d06275d2f98be337ed66de72f349c4.zip
ath9k: fall back to OTP ROM if the platform data does not contain valid eeprom data
SVN-Revision: 32044
Diffstat (limited to 'package')
-rw-r--r--package/mac80211/patches/560-ath9k_ar9003_otp_fallback.patch25
1 files changed, 25 insertions, 0 deletions
diff --git a/package/mac80211/patches/560-ath9k_ar9003_otp_fallback.patch b/package/mac80211/patches/560-ath9k_ar9003_otp_fallback.patch
new file mode 100644
index 0000000000..8bcf44e4ac
--- /dev/null
+++ b/package/mac80211/patches/560-ath9k_ar9003_otp_fallback.patch
@@ -0,0 +1,25 @@
+--- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
++++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
+@@ -3260,10 +3260,20 @@ static int ar9300_eeprom_restore_interna
+ int it;
+ u16 checksum, mchecksum;
+ struct ath_common *common = ath9k_hw_common(ah);
++ struct ar9300_eeprom *eep;
+ eeprom_read_op read;
+
+- if (ath9k_hw_use_flash(ah))
+- return ar9300_eeprom_restore_flash(ah, mptr, mdata_size);
++ if (ath9k_hw_use_flash(ah)) {
++ u8 txrx;
++
++ ar9300_eeprom_restore_flash(ah, mptr, mdata_size);
++
++ /* check if eeprom contains valid data */
++ eep = (struct ar9300_eeprom *) mptr;
++ txrx = eep->baseEepHeader.txrxMask;
++ if (txrx != 0 && txrx != 0xff)
++ return 0;
++ }
+
+ word = kzalloc(2048, GFP_KERNEL);
+ if (!word)