From 9766cb709089fc460fda66c06a3da756af4a2930 Mon Sep 17 00:00:00 2001 From: Mathias Kresin Date: Fri, 26 Aug 2016 09:16:53 +0200 Subject: rt2x00: add support for mac addr from device tree On some devices the EEPROMs of Ralink Wi-Fi chips have a default Ralink MAC address set (RT3062F: 00:0C:43:30:62:00, RT3060F: 00:0C:43:30:60:00). Using multiple of these devices in the same network can cause nasty issues. Allow to override the MAC in the EEPROM with (a known good) one set in the device tree to bypass the issue. Signed-off-by: Mathias Kresin Acked-by: Stanislaw Gruszka Signed-off-by: Kalle Valo --- drivers/net/wireless/ralink/rt2x00/rt2400pci.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'drivers/net/wireless/ralink/rt2x00/rt2400pci.c') diff --git a/drivers/net/wireless/ralink/rt2x00/rt2400pci.c b/drivers/net/wireless/ralink/rt2x00/rt2400pci.c index 155f343981fe..085c5b423bdf 100644 --- a/drivers/net/wireless/ralink/rt2x00/rt2400pci.c +++ b/drivers/net/wireless/ralink/rt2x00/rt2400pci.c @@ -1459,10 +1459,7 @@ static int rt2400pci_validate_eeprom(struct rt2x00_dev *rt2x00dev) * Start validation of the data that has been read. */ mac = rt2x00_eeprom_addr(rt2x00dev, EEPROM_MAC_ADDR_0); - if (!is_valid_ether_addr(mac)) { - eth_random_addr(mac); - rt2x00_eeprom_dbg(rt2x00dev, "MAC: %pM\n", mac); - } + rt2x00lib_set_mac_address(rt2x00dev, mac); rt2x00_eeprom_read(rt2x00dev, EEPROM_ANTENNA, &word); if (word == 0xffff) { -- cgit v1.2.3