Skip to content

Commit

Permalink
ath9k_hw: fall back to OTP ROM when platform data has no valid eeprom…
Browse files Browse the repository at this point in the history
… data

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Felix Fietkau authored and John W. Linville committed Jul 17, 2012
1 parent 433c399 commit 0196736
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
Original file line number Diff line number Diff line change
Expand Up @@ -3260,10 +3260,20 @@ static int ar9300_eeprom_restore_internal(struct ath_hw *ah,
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)
Expand Down

0 comments on commit 0196736

Please sign in to comment.