atheros: fix up empty radio data mac address (based on patch from #8601)

SVN-Revision: 26555
lede-17.01
Felix Fietkau 2011-04-09 18:25:59 +00:00
parent 4eb507901a
commit 63c08f0f0b
1 changed files with 8 additions and 1 deletions

View File

@ -85,7 +85,7 @@
+obj-$(CONFIG_ATHEROS_AR2315) += ar2315.o +obj-$(CONFIG_ATHEROS_AR2315) += ar2315.o
--- /dev/null --- /dev/null
+++ b/arch/mips/ar231x/board.c +++ b/arch/mips/ar231x/board.c
@@ -0,0 +1,251 @@ @@ -0,0 +1,258 @@
+/* +/*
+ * This file is subject to the terms and conditions of the GNU General Public + * This file is subject to the terms and conditions of the GNU General Public
+ * License. See the file "COPYING" in the main directory of this archive + * License. See the file "COPYING" in the main directory of this archive
@ -225,6 +225,7 @@
+ u8 *bcfg, *rcfg; + u8 *bcfg, *rcfg;
+ u8 *board_data; + u8 *board_data;
+ u8 *radio_data; + u8 *radio_data;
+ u8 *mac_addr;
+ u32 offset; + u32 offset;
+ +
+ ar231x_board.config = NULL; + ar231x_board.config = NULL;
@ -282,6 +283,12 @@
+ rcfg_size = BOARD_CONFIG_BUFSZ - offset; + rcfg_size = BOARD_CONFIG_BUFSZ - offset;
+ memcpy(radio_data, rcfg, rcfg_size); + memcpy(radio_data, rcfg, rcfg_size);
+ +
+ mac_addr = &radio_data[0x1d * 2];
+ if (is_broadcast_ether_addr(mac_addr)) {
+ printk(KERN_INFO "Radio MAC is blank; using board-data\n");
+ memcpy(mac_addr, ar231x_board.config->wlan0_mac, ETH_ALEN);
+ }
+
+ return 0; + return 0;
+} +}
+ +