aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/adm5120/files/arch
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2007-12-12 08:43:41 +0000
committerGabor Juhos <juhosg@openwrt.org>2007-12-12 08:43:41 +0000
commitee39216f390ef58e964000c9c4bc249f71e996ff (patch)
treeae58c7602f42cb5f33274ac198568a1addffb842 /target/linux/adm5120/files/arch
parentbe29e04c420c095ac093991d747d4d0d6ce79381 (diff)
downloadupstream-ee39216f390ef58e964000c9c4bc249f71e996ff.tar.gz
upstream-ee39216f390ef58e964000c9c4bc249f71e996ff.tar.bz2
upstream-ee39216f390ef58e964000c9c4bc249f71e996ff.zip
[adm5120] fix mac address setup on RouterBOARDs
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@9713 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/adm5120/files/arch')
-rw-r--r--target/linux/adm5120/files/arch/mips/adm5120/boards/mikrotik.c12
-rw-r--r--target/linux/adm5120/files/arch/mips/adm5120/prom/routerboot.c12
2 files changed, 9 insertions, 15 deletions
diff --git a/target/linux/adm5120/files/arch/mips/adm5120/boards/mikrotik.c b/target/linux/adm5120/files/arch/mips/adm5120/boards/mikrotik.c
index 3d2facfd15..744c82f15a 100644
--- a/target/linux/adm5120/files/arch/mips/adm5120/boards/mikrotik.c
+++ b/target/linux/adm5120/files/arch/mips/adm5120/boards/mikrotik.c
@@ -64,8 +64,6 @@
#define RB153_GPIO_CF_RDY ADM5120_GPIO_P1L1
#define RB153_GPIO_CF_WT ADM5120_GPIO_P0L0
-extern struct rb_hard_settings rb_hs;
-
/*--------------------------------------------------------------------------*/
static struct adm5120_pci_irq rb1xx_pci_irqs[] __initdata = {
@@ -219,9 +217,13 @@ static void __init rb1xx_mac_setup(void)
{
int i, j;
- for (i = 0; i < rb_hs.mac_count; i++) {
- for (j = 0; j < RB_MAC_SIZE; j++)
- adm5120_eth_macs[i][j] = rb_hs.macs[i][j];
+ if (!rb_hs.mac_base)
+ return;
+
+ for (i = 0; i < 6; i++) {
+ for (j = 0; j < 5; j++)
+ adm5120_eth_macs[i][j] = rb_hs.mac_base[j];
+ adm5120_eth_macs[i][5] = rb_hs.mac_base[5]+i;
}
}
diff --git a/target/linux/adm5120/files/arch/mips/adm5120/prom/routerboot.c b/target/linux/adm5120/files/arch/mips/adm5120/prom/routerboot.c
index a93382dc8a..0effe24d0e 100644
--- a/target/linux/adm5120/files/arch/mips/adm5120/prom/routerboot.c
+++ b/target/linux/adm5120/files/arch/mips/adm5120/prom/routerboot.c
@@ -37,7 +37,6 @@
#include "prom_read.h"
struct rb_hard_settings rb_hs;
-EXPORT_SYMBOL(rb_hs);
static int rb_found;
static int __init routerboot_load_hs(u8 *buf, u16 buflen)
@@ -86,15 +85,8 @@ static int __init routerboot_load_hs(u8 *buf, u16 buflen)
rb_hs.mac_count = prom_read_le32(buf);
break;
case RB_ID_MAC_ADDRESS_PACK:
- rb_hs.mac_count = len/RB_MAC_SIZE;
- if (rb_hs.mac_count > RB_MAX_MAC_COUNT)
- rb_hs.mac_count = RB_MAX_MAC_COUNT;
- mac = buf;
- for (i = 0; i < rb_hs.mac_count; i++) {
- for (j = 0; j < RB_MAC_SIZE; j++)
- rb_hs.macs[i][j] = mac[j];
- mac += RB_MAC_SIZE;
- }
+ if ((len / RB_MAC_SIZE) > 0)
+ rb_hs.mac_base = buf;
break;
}