[OpenWrt-Devel] [PATCH 1/3] ralink: add ethernet macaddr to dts for FireWRT

John Crispin blogic at openwrt.org
Fri Jan 30 03:04:53 EST 2015



On 30/01/2015 08:59, Yousong Zhou wrote:
> Hi,
> 
> On 30 January 2015 at 15:19, wengbj <fl.service at t-firefly.com> wrote:
>> ---
>>  .../linux/ramips/base-files/etc/board.d/02_network |    7 +++++++
>>  target/linux/ramips/dts/FIREWRT.dts                |    5 +++++
>>  2 files changed, 12 insertions(+)
>>
>> diff --git a/target/linux/ramips/base-files/etc/board.d/02_network b/target/linux/ramips/base-files/etc/board.d/02_network
>> index 7724c3e..dcb497a 100755
>> --- a/target/linux/ramips/base-files/etc/board.d/02_network
>> +++ b/target/linux/ramips/base-files/etc/board.d/02_network
>> @@ -340,6 +340,13 @@ ramips_setup_macs()
>>                 wan_mac=$(mtd_get_mac_binary factory 46)
>>                 ;;
>>
>> +       firewrt)
>> +               wan_mac=$(mtd_get_mac_binary factory 57350)
>> +               lan_mac=$(mtd_get_mac_binary factory 57344)
>> +               [ "${lan_mac}x" = "ff:ff:ff:ff:ff:ffx" ] && lan_mac=$(cat /sys/class/net/eth0/address)
>> +               [ "${wan_mac}x" = "ff:ff:ff:ff:ff:ffx" ] && wan_mac=$(macaddr_add "$lan_mac" 1)
>> +               ;;
>> +
> 
> This hunk should be unnecessary.  You can try remove this and see if
> it can still get MAC address from offset 0xe000 of factory partition.
> 
>                 yousong
> 

i agree, this is a work around for boards that have not passed the mfg
process yet.







>>         *)
>>                 lan_mac=$(cat /sys/class/net/eth0/address)
>>                 wan_mac=$(macaddr_add "$lan_mac" 1)
>> diff --git a/target/linux/ramips/dts/FIREWRT.dts b/target/linux/ramips/dts/FIREWRT.dts
>> index 2e5d26b..4e9e28b 100644
>> --- a/target/linux/ramips/dts/FIREWRT.dts
>> +++ b/target/linux/ramips/dts/FIREWRT.dts
>> @@ -78,4 +78,9 @@
>>                         };
>>                 };
>>         };
>> +
>> +       ethernet at 1e100000 {
>> +               mtd-mac-address = <&factory 0xe000>;
>> +       };
>> +
>>  };
>> --
>> 1.7.9.5
>> _______________________________________________
>> openwrt-devel mailing list
>> openwrt-devel at lists.openwrt.org
>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list