[Letux-kernel] [PATCH v2] net: davicom: dm9000: allow to pass MAC address through mac_addr module parameter

David Miller davem at davemloft.net
Fri Feb 14 18:51:43 CET 2020


From: "H. Nikolaus Schaller" <hns at goldelico.com>
Date: Fri, 14 Feb 2020 17:07:35 +0100

> The MIPS Ingenic CI20 board is shipped with a quite old u-boot
> (ci20-v2013.10 see https://elinux.org/CI20_Dev_Zone). This passes
> the MAC address through dm9000.mac_addr=xx:xx:xx:xx:xx:xx
> kernel module parameter to give the board a fixed MAC address.
> 
> This is not processed by the dm9000 driver which assigns a random
> MAC address on each boot, making DHCP assign a new IP address
> each time.
> 
> So we add a check for the mac_addr module parameter as a last
> resort before assigning a random one. This mechanism can also
> be used outside of u-boot to provide a value through modprobe
> config.
> 
> To parse the MAC address in a new function get_mac_addr() we
> use an copy adapted from the ksz884x.c driver which provides
> the same functionality.
> 
> Signed-off-by: H. Nikolaus Schaller <hns at goldelico.com>

Sorry, this is not appropriate.  Module parameters in networking
drivers never are.


More information about the Letux-kernel mailing list