summaryrefslogtreecommitdiffstats
path: root/target/linux
diff options
context:
space:
mode:
authornbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>2012-05-20 21:58:03 +0000
committernbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>2012-05-20 21:58:03 +0000
commitfb17c4e710a6c4fc576bedb96f4c26bc8c54ab67 (patch)
treea4798c77c22fe7e2b90837ad27aa9ff993787f6f /target/linux
parent31fe90a64af3659d6df5cfce15aa9c77dcd98492 (diff)
lantiq: allow platforms with rt2x00 to override the mac address without overriding eeprom, fixes bogus wlan mac address on arv4520
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@31835 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux')
-rw-r--r--target/linux/generic/files/include/linux/rt2x00_platform.h1
-rw-r--r--target/linux/lantiq/files-3.3/arch/mips/lantiq/xway/dev-wifi-rt2x00.c3
-rw-r--r--target/linux/lantiq/files-3.3/arch/mips/lantiq/xway/dev-wifi-rt2x00.h2
-rw-r--r--target/linux/lantiq/files-3.3/arch/mips/lantiq/xway/mach-arv.c5
4 files changed, 7 insertions, 4 deletions
diff --git a/target/linux/generic/files/include/linux/rt2x00_platform.h b/target/linux/generic/files/include/linux/rt2x00_platform.h
index b4c776873..e10377e21 100644
--- a/target/linux/generic/files/include/linux/rt2x00_platform.h
+++ b/target/linux/generic/files/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;
diff --git a/target/linux/lantiq/files-3.3/arch/mips/lantiq/xway/dev-wifi-rt2x00.c b/target/linux/lantiq/files-3.3/arch/mips/lantiq/xway/dev-wifi-rt2x00.c
index 8975f6be7..8e271f06e 100644
--- a/target/linux/lantiq/files-3.3/arch/mips/lantiq/xway/dev-wifi-rt2x00.c
+++ b/target/linux/lantiq/files-3.3/arch/mips/lantiq/xway/dev-wifi-rt2x00.c
@@ -24,8 +24,9 @@ rt2x00_pci_plat_dev_init(struct pci_dev *dev)
}
void __init
-ltq_register_rt2x00(const char *firmware)
+ltq_register_rt2x00(const char *firmware, const u8 *mac)
{
rt2x00_pdata.eeprom_file_name = kstrdup(firmware, GFP_KERNEL);
+ rt2x00_pdata.mac_address = mac;
ltqpci_plat_dev_init = rt2x00_pci_plat_dev_init;
}
diff --git a/target/linux/lantiq/files-3.3/arch/mips/lantiq/xway/dev-wifi-rt2x00.h b/target/linux/lantiq/files-3.3/arch/mips/lantiq/xway/dev-wifi-rt2x00.h
index 060ca5027..941c26535 100644
--- a/target/linux/lantiq/files-3.3/arch/mips/lantiq/xway/dev-wifi-rt2x00.h
+++ b/target/linux/lantiq/files-3.3/arch/mips/lantiq/xway/dev-wifi-rt2x00.h
@@ -9,6 +9,6 @@
#ifndef _DEV_WIFI_RT2X00_H__
#define _DEV_WIFI_RT2X00_H__
-extern void ltq_register_rt2x00(const char *firmware);
+extern void ltq_register_rt2x00(const char *firmware, const u8 *mac);
#endif
diff --git a/target/linux/lantiq/files-3.3/arch/mips/lantiq/xway/mach-arv.c b/target/linux/lantiq/files-3.3/arch/mips/lantiq/xway/mach-arv.c
index c300b9d42..4abb2d500 100644
--- a/target/linux/lantiq/files-3.3/arch/mips/lantiq/xway/mach-arv.c
+++ b/target/linux/lantiq/files-3.3/arch/mips/lantiq/xway/mach-arv.c
@@ -597,6 +597,7 @@ arv4520pw_init(void)
ltq_register_pci(&ltq_pci_data);
ltq_register_tapi();
arv_register_ethernet(ARV4520PW_MAC_ADDR);
+ ltq_register_rt2x00(NULL, (const u8 *) ltq_eth_data.mac.sa_data);
xway_register_dwc(ARV4520PW_USB);
gpio_request(ARV4520PW_SWITCH_RESET, "switch");
@@ -686,7 +687,7 @@ arv7525pw_init(void)
ltq_pci_data.irq[14] = (INT_NUM_IM3_IRL0 + 31);
ltq_register_pci(&ltq_pci_data);
ltq_eth_data.mii_mode = PHY_INTERFACE_MODE_MII;
- ltq_register_rt2x00("RT2860.eeprom");
+ ltq_register_rt2x00("RT2860.eeprom", NULL);
ltq_register_tapi();
arv_register_ethernet(ARV7525P_MAC_ADDR);
}
@@ -773,7 +774,7 @@ arv752dpw_init(void)
ltq_pci_data.gpio |= PCI_EXIN1 | PCI_REQ2;
ltq_register_pci(&ltq_pci_data);
xway_register_dwc(ARV752DPW22_USB);
- ltq_register_rt2x00("RT2860.eeprom");
+ ltq_register_rt2x00("RT2860.eeprom", NULL);
arv_register_ethernet(ARV752DPW22_MAC_ADDR);
gpio_request(ARV752DPW22_RELAY, "relay");
gpio_set_value(ARV752DPW22_RELAY, 1);