1 --- a/include/linux/rt2x00_platform.h
2 +++ b/include/linux/rt2x00_platform.h
5 struct rt2x00_platform_data {
6 char *eeprom_file_name;
7 + const u8 *mac_address;
11 --- a/drivers/net/wireless/rt2x00/rt2x00dev.c
12 +++ b/drivers/net/wireless/rt2x00/rt2x00dev.c
13 @@ -825,6 +825,18 @@ static void rt2x00lib_rate(struct ieee80
14 entry->flags |= IEEE80211_RATE_SHORT_PREAMBLE;
17 +const u8 *rt2x00lib_get_mac_address(struct rt2x00_dev *rt2x00dev)
19 + struct rt2x00_platform_data *pdata;
21 + pdata = rt2x00dev->dev->platform_data;
25 + return pdata->mac_address;
27 +EXPORT_SYMBOL_GPL(rt2x00lib_get_mac_address);
29 static int rt2x00lib_probe_hw_modes(struct rt2x00_dev *rt2x00dev,
30 struct hw_mode_spec *spec)
32 --- a/drivers/net/wireless/rt2x00/rt2x00.h
33 +++ b/drivers/net/wireless/rt2x00/rt2x00.h
34 @@ -1280,6 +1280,7 @@ static inline void rt2x00debug_dump_fram
36 u32 rt2x00lib_get_bssidx(struct rt2x00_dev *rt2x00dev,
37 struct ieee80211_vif *vif);
38 +const u8 *rt2x00lib_get_mac_address(struct rt2x00_dev *rt2x00dev);
41 * Interrupt context handlers.
42 --- a/drivers/net/wireless/rt2x00/rt61pci.c
43 +++ b/drivers/net/wireless/rt2x00/rt61pci.c
44 @@ -2393,6 +2393,7 @@ static int rt61pci_validate_eeprom(struc
48 + const u8 *pdata_mac;
51 rt2x00pci_register_read(rt2x00dev, E2PROM_CSR, ®);
52 @@ -2413,7 +2414,11 @@ static int rt61pci_validate_eeprom(struc
54 * Start validation of the data that has been read.
56 + pdata_mac = rt2x00lib_get_mac_address(rt2x00dev);
57 mac = rt2x00_eeprom_addr(rt2x00dev, EEPROM_MAC_ADDR_0);
59 + memcpy(mac, pdata_mac, 6);
61 if (!is_valid_ether_addr(mac)) {
62 random_ether_addr(mac);
63 EEPROM(rt2x00dev, "MAC: %pM\n", mac);