]> code.ossystems Code Review - meta-freescale.git/commitdiff
linux-imx (2.6.35.3): smsc95xx: generate random MAC address once
authorOtavio Salvador <otavio@ossystems.com.br>
Tue, 29 May 2012 13:11:04 +0000 (10:11 -0300)
committerOtavio Salvador <otavio@ossystems.com.br>
Tue, 29 May 2012 13:11:04 +0000 (10:11 -0300)
The smsc95xx driver currently generates a new random MAC address
every time the interface is brought up. This makes it impossible to
override using the standard `ifconfig hw ether` approach.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
meta-fsl-arm/recipes-kernel/linux/linux-imx-2.6.35.3/smsc95xx-randomize-mac-once.patch [new file with mode: 0644]
meta-fsl-arm/recipes-kernel/linux/linux-imx_2.6.35.3.bb

diff --git a/meta-fsl-arm/recipes-kernel/linux/linux-imx-2.6.35.3/smsc95xx-randomize-mac-once.patch b/meta-fsl-arm/recipes-kernel/linux/linux-imx-2.6.35.3/smsc95xx-randomize-mac-once.patch
new file mode 100644 (file)
index 0000000..18a5a7e
--- /dev/null
@@ -0,0 +1,51 @@
+smsc95xx: generate random MAC address once, not every ifup
+
+The smsc95xx driver currently generates a new random MAC address
+every time the interface is brought up. This makes it impossible to
+override using the standard `ifconfig hw ether` approach.
+
+Past patches tried to make the MAC address a module parameter or
+base it off the die ID, but it seems to me much simpler (and
+hopefully less controversial) to stick with the current random
+generation scheme, but allow the user to change the address.
+
+This patch does exactly that - it moves the random address
+generation from smsc95xx_reset() into smsc95xx_bind(), so that it is
+done once on module load, not on every ifup. The user can then
+override this using the standard mechanisms.
+
+Applies against 2.6.35 and linux-2.6 head.
+
+Upstream-Status: Backport [2.6.36]
+
+Signed-off-by: Bernard Blackham <b-omap@largestprime.net>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+---
+ drivers/net/usb/smsc95xx.c |    4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c
+index 12a3c88..65cb1ab 100644
+--- a/drivers/net/usb/smsc95xx.c
++++ b/drivers/net/usb/smsc95xx.c
+@@ -805,8 +805,6 @@ static int smsc95xx_reset(struct usbnet *dev)
+               return ret;
+       }
+-      smsc95xx_init_mac_address(dev);
+-
+       ret = smsc95xx_set_mac_address(dev);
+       if (ret < 0)
+               return ret;
+@@ -1047,6 +1045,8 @@ static int smsc95xx_bind(struct usbnet *dev, struct usb_interface *intf)
+       pdata->use_tx_csum = DEFAULT_TX_CSUM_ENABLE;
+       pdata->use_rx_csum = DEFAULT_RX_CSUM_ENABLE;
++      smsc95xx_init_mac_address(dev);
++
+       /* Init all registers */
+       ret = smsc95xx_reset(dev);
+-- 
+1.7.7.6
+
index 6c8822f6c6609bd0cf27d02eab0ffa12fedef574..6a0ccd38e358710984f28151c5b34e81ff396444 100644 (file)
@@ -4,7 +4,7 @@
 DESCRIPTION = "Linux kernel for imx platforms"
 LICENSE = "GPLv2"
 LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7"
-PR = "r18"
+PR = "r19"
 
 inherit kernel
 COMPATIBLE_MACHINE = "(mxs|mx5)"
@@ -31,6 +31,7 @@ SRC_URI = "git://git.freescale.com/imx/linux-2.6-imx.git;tag=rel_imx_2.6.35_11.0
            file://mx28-removecpufreq.patch \
            file://mxs-duart-use-ttyAMA-for-device-name.patch \
            file://w1-fix-support-multiple-master.patch \
+           file://smsc95xx-randomize-mac-once.patch \
            file://0001-mx53_loco-add-USR-led-support.patch \
            file://001_Add_accept4_syscall.patch \
            file://002_Return_ERESTARTSYS_from_IPU_GET_EVENT.patch \