diff options
Diffstat (limited to 'drivers/net/wireless/ath9k/pci.c')
-rw-r--r-- | drivers/net/wireless/ath9k/pci.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath9k/pci.c b/drivers/net/wireless/ath9k/pci.c index 4ff1caa9ba99..05612bf28360 100644 --- a/drivers/net/wireless/ath9k/pci.c +++ b/drivers/net/wireless/ath9k/pci.c | |||
@@ -58,9 +58,27 @@ static void ath_pci_cleanup(struct ath_softc *sc) | |||
58 | pci_disable_device(pdev); | 58 | pci_disable_device(pdev); |
59 | } | 59 | } |
60 | 60 | ||
61 | static bool ath_pci_eeprom_read(struct ath_hal *ah, u32 off, u16 *data) | ||
62 | { | ||
63 | (void)REG_READ(ah, AR5416_EEPROM_OFFSET + (off << AR5416_EEPROM_S)); | ||
64 | |||
65 | if (!ath9k_hw_wait(ah, | ||
66 | AR_EEPROM_STATUS_DATA, | ||
67 | AR_EEPROM_STATUS_DATA_BUSY | | ||
68 | AR_EEPROM_STATUS_DATA_PROT_ACCESS, 0)) { | ||
69 | return false; | ||
70 | } | ||
71 | |||
72 | *data = MS(REG_READ(ah, AR_EEPROM_STATUS_DATA), | ||
73 | AR_EEPROM_STATUS_DATA_VAL); | ||
74 | |||
75 | return true; | ||
76 | } | ||
77 | |||
61 | static struct ath_bus_ops ath_pci_bus_ops = { | 78 | static struct ath_bus_ops ath_pci_bus_ops = { |
62 | .read_cachesize = ath_pci_read_cachesize, | 79 | .read_cachesize = ath_pci_read_cachesize, |
63 | .cleanup = ath_pci_cleanup, | 80 | .cleanup = ath_pci_cleanup, |
81 | .eeprom_read = ath_pci_eeprom_read, | ||
64 | }; | 82 | }; |
65 | 83 | ||
66 | static int ath_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) | 84 | static int ath_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) |