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

From: David Miller
Date: Fri Feb 14 2020 - 12:51:56 EST


From: "H. Nikolaus Schaller" <hns@xxxxxxxxxxxxx>
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@xxxxxxxxxxxxx>

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