1 --- a/drivers/net/wireless/ath/ath9k/hw.c
2 +++ b/drivers/net/wireless/ath/ath9k/hw.c
6 #include <linux/etherdevice.h>
7 +#include <linux/ath9k_platform.h>
8 #include <asm/unaligned.h>
14 @@ -424,17 +426,23 @@ static int ath9k_hw_rf_claim(struct ath_
15 static int ath9k_hw_init_macaddr(struct ath_hw *ah)
17 struct ath_common *common = ath9k_hw_common(ah);
18 + struct ath_softc *sc = (struct ath_softc *) common->priv;
19 + struct ath9k_platform_data *pdata = sc->dev->platform_data;
25 - for (i = 0; i < 3; i++) {
26 - eeval = ah->eep_ops->get_eeprom(ah, AR_EEPROM_MAC(i));
28 - common->macaddr[2 * i] = eeval >> 8;
29 - common->macaddr[2 * i + 1] = eeval & 0xff;
31 + if (pdata && pdata->macaddr)
32 + memcpy(common->macaddr, pdata->macaddr, ETH_ALEN);
34 + for (i = 0; i < 3; i++) {
35 + eeval = ah->eep_ops->get_eeprom(ah, AR_EEPROM_MAC(i));
37 + common->macaddr[2 * i] = eeval >> 8;
38 + common->macaddr[2 * i + 1] = eeval & 0xff;
41 if (!is_valid_ether_addr(common->macaddr)) {
42 DECLARE_MAC_BUF(macbuf);
44 --- a/include/linux/ath9k_platform.h
45 +++ b/include/linux/ath9k_platform.h
48 struct ath9k_platform_data {
49 u16 eeprom_data[ATH9K_PLAT_EEP_MAX_WORDS];
53 #endif /* _LINUX_ATH9K_PLATFORM_H */