diff options
author | Felix Fietkau <nbd@openwrt.org> | 2012-07-15 13:53:29 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-07-17 15:11:33 -0400 |
commit | 01967360a20598f95947a86af26c930ab1b50205 (patch) | |
tree | 82faf0a6aa8a60d459f475d8c43725027509176d /drivers/net/wireless/ath/ath9k | |
parent | 433c3990a3595efe81e34a8c12ebf1746b94dc88 (diff) |
ath9k_hw: fall back to OTP ROM when platform data has no valid eeprom data
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/ar9003_eeprom.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c index 25de6f9a9778..3cddd78e88ac 100644 --- 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_internal(struct ath_hw *ah, | |||
3260 | int it; | 3260 | int it; |
3261 | u16 checksum, mchecksum; | 3261 | u16 checksum, mchecksum; |
3262 | struct ath_common *common = ath9k_hw_common(ah); | 3262 | struct ath_common *common = ath9k_hw_common(ah); |
3263 | struct ar9300_eeprom *eep; | ||
3263 | eeprom_read_op read; | 3264 | eeprom_read_op read; |
3264 | 3265 | ||
3265 | if (ath9k_hw_use_flash(ah)) | 3266 | if (ath9k_hw_use_flash(ah)) { |
3266 | return ar9300_eeprom_restore_flash(ah, mptr, mdata_size); | 3267 | u8 txrx; |
3268 | |||
3269 | ar9300_eeprom_restore_flash(ah, mptr, mdata_size); | ||
3270 | |||
3271 | /* check if eeprom contains valid data */ | ||
3272 | eep = (struct ar9300_eeprom *) mptr; | ||
3273 | txrx = eep->baseEepHeader.txrxMask; | ||
3274 | if (txrx != 0 && txrx != 0xff) | ||
3275 | return 0; | ||
3276 | } | ||
3267 | 3277 | ||
3268 | word = kzalloc(2048, GFP_KERNEL); | 3278 | word = kzalloc(2048, GFP_KERNEL); |
3269 | if (!word) | 3279 | if (!word) |