diff options
author | Florian Fainelli <florian@openwrt.org> | 2013-06-18 10:54:24 +0000 |
---|---|---|
committer | Florian Fainelli <florian@openwrt.org> | 2013-06-18 10:54:24 +0000 |
commit | 4c0b484f86cdde219085a2f9b0cb265da81cd970 (patch) | |
tree | a7bbf53b5919cf0bb94d544231bc9dcda6a93a0c /target/linux/brcm63xx | |
parent | 9a035029ca5be81c4ad81b2053db7a1fc2be7cf0 (diff) | |
download | master-187ad058-4c0b484f86cdde219085a2f9b0cb265da81cd970.tar.gz master-187ad058-4c0b484f86cdde219085a2f9b0cb265da81cd970.tar.bz2 master-187ad058-4c0b484f86cdde219085a2f9b0cb265da81cd970.zip |
brcm63xx: provide a default sane MAC address for Cable Modem devices
Cable modem devices currently poke at some random location in RAM and
may end up having an invalid MAC address which is not suitable. Provide
a default one which is sane.
Signed-off-by: Florian Fainelli <florian@openwrt.org>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@36957 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/brcm63xx')
-rw-r--r-- | target/linux/brcm63xx/patches-3.9/426-hcs_mac_addr_pool.patch | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/target/linux/brcm63xx/patches-3.9/426-hcs_mac_addr_pool.patch b/target/linux/brcm63xx/patches-3.9/426-hcs_mac_addr_pool.patch new file mode 100644 index 0000000000..6354fe6214 --- /dev/null +++ b/target/linux/brcm63xx/patches-3.9/426-hcs_mac_addr_pool.patch @@ -0,0 +1,26 @@ +--- a/arch/mips/bcm63xx/nvram.c ++++ b/arch/mips/bcm63xx/nvram.c +@@ -52,6 +52,7 @@ void __init bcm63xx_nvram_init(void *add + { + unsigned int check_len; + u32 crc, expected_crc; ++ u8 hcs_mac_addr[ETH_ALEN] = { 0x00, 0x10, 0x18, 0xff, 0xff, 0xff }; + + /* extract nvram data */ + memcpy(&nvram, addr, sizeof(nvram)); +@@ -73,6 +74,15 @@ void __init bcm63xx_nvram_init(void *add + if (crc != expected_crc) + pr_warn("nvram checksum failed, contents may be invalid (expected %08x, got %08x)\n", + expected_crc, crc); ++ ++ /* Cable modems have a different NVRAM which is embedded in the eCos ++ * firmware and not easily extractible, give at least a MAC address ++ * pool. ++ */ ++ if (BCMCPU_IS_3368()) { ++ memcpy(nvram.mac_addr_base, hcs_mac_addr, ETH_ALEN); ++ nvram.mac_addr_count = 2; ++ } + } + + u8 *bcm63xx_nvram_get_name(void) |