aboutsummaryrefslogtreecommitdiffstats
path: root/package/kernel/mac80211/patches/607-rt2x00-add_platform_data_mac_addr.patch
blob: bca7be85333f077eb035be405d9782a760d4856c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
--- a/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c
+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c
@@ -1001,8 +1001,13 @@ static void rt2x00lib_rate(struct ieee80
 
 void rt2x00lib_set_mac_address(struct rt2x00_dev *rt2x00dev, u8 *eeprom_mac_addr)
 {
+	struct rt2x00_platform_data *pdata;
 	const char *mac_addr;
 
+	pdata = rt2x00dev->dev->platform_data;
+	if (pdata && pdata->mac_address)
+		ether_addr_copy(eeprom_mac_addr, pdata->mac_address);
+
 	mac_addr = of_get_mac_address(rt2x00dev->dev->of_node);
 	if (mac_addr)
 		ether_addr_copy(eeprom_mac_addr, mac_addr);
--- a/include/linux/rt2x00_platform.h
+++ b/include/linux/rt2x00_platform.h
@@ -14,6 +14,7 @@
 
 struct rt2x00_platform_data {
 	char *eeprom_file_name;
+	const u8 *mac_address;
 
 	int disable_2ghz;
 	int disable_5ghz;