1 --- a/drivers/net/wireless/ath/ath5k/eeprom.c
2 +++ b/drivers/net/wireless/ath/ath5k/eeprom.c
4 \*************************************/
6 #include <linux/slab.h>
7 +#include <linux/ath5k_platform.h>
8 +#include <linux/pci.h>
12 @@ -1722,7 +1724,7 @@ ath5k_eeprom_read_spur_chans(struct ath5
16 - * Read the MAC address from eeprom
17 + * Read the MAC address from eeprom or platform_data
19 int ath5k_eeprom_read_mac(struct ath5k_hw *ah, u8 *mac)
21 @@ -1730,6 +1732,16 @@ int ath5k_eeprom_read_mac(struct ath5k_h
25 + struct ath5k_platform_data *pdata = NULL;
27 + if (ah->ah_sc->pdev)
28 + pdata = ah->ah_sc->pdev->dev.platform_data;
30 + if (pdata && pdata->macaddr)
32 + memcpy(mac, pdata->macaddr, ETH_ALEN);
36 AR5K_EEPROM_READ(0x20, data);
38 --- a/drivers/net/wireless/ath/ath5k/pci.c
39 +++ b/drivers/net/wireless/ath/ath5k/pci.c
41 #include <linux/nl80211.h>
42 #include <linux/pci.h>
43 #include <linux/pci-aspm.h>
44 +#include <linux/ath5k_platform.h>
48 @@ -74,6 +75,19 @@ ath5k_pci_eeprom_read(struct ath_common
50 struct ath5k_hw *ah = (struct ath5k_hw *) common->ah;
52 + struct ath5k_platform_data *pdata = NULL;
54 + if (ah->ah_sc->pdev)
55 + pdata = ah->ah_sc->pdev->dev.platform_data;
57 + if (pdata && pdata->eeprom_data && pdata->eeprom_data[0] == AR5K_EEPROM_MAGIC_VALUE)
59 + if (offset >= ATH5K_PLAT_EEP_MAX_WORDS)
62 + *data = pdata->eeprom_data[offset];
67 * Initialize EEPROM access