[U-Boot] [PATCH v2 1/2] smsc95xx: Fix MAC address programming

Simon Glass sjg at chromium.org
Wed Nov 16 00:21:26 CET 2011


Hi Wolfgang,

On Tue, Nov 15, 2011 at 1:19 AM, Wolfgang Grandegger <wg at denx.de> wrote:
> Commit 79ad54400932d6484178a372fb3b659e3437473b broke MAC address
> programming in the SMSC95xx register set.
>
> Cc: Marek Vasut <marek.vasut at gmail.com>
> Cc: Wolfgang Denk <wd at denx.de>
> Cc: Simon Glass <sjg at chromium.org>
> Cc: Mike Frysinger <vapier at gentoo.org>
> Signed-off-by: Wolfgang Grandegger <wg at denx.de>
> ---
>  drivers/usb/eth/smsc95xx.c |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/usb/eth/smsc95xx.c b/drivers/usb/eth/smsc95xx.c
> index 7ee4f87..b5626e6 100644
> --- a/drivers/usb/eth/smsc95xx.c
> +++ b/drivers/usb/eth/smsc95xx.c
> @@ -20,6 +20,7 @@
>  * MA 02111-1307 USA
>  */
>
> +#include <asm/unaligned.h>
>  #include <common.h>
>  #include <usb.h>
>  #include <linux/mii.h>
> @@ -372,13 +373,12 @@ static int smsc95xx_init_mac_address(struct eth_device *eth,
>  static int smsc95xx_write_hwaddr(struct eth_device *eth)
>  {
>        struct ueth_data *dev = (struct ueth_data *)eth->priv;
> -       u32 addr_lo, addr_hi;
> +       u32 addr_lo = __get_unaligned_le32(&eth->enetaddr[0]);
> +       u32 addr_hi = __get_unaligned_le16(&eth->enetaddr[4]);

Would prefer that you leave the definitions alone, but it's not important.

>        int ret;
>
>        /* set hardware address */
>        debug("** %s()\n", __func__);
> -       addr_lo = cpu_to_le32(*eth->enetaddr);
> -       addr_hi = cpu_to_le16(*((u16 *)(eth->enetaddr + 4)));
>        ret = smsc95xx_write_reg(dev, ADDRL, addr_lo);
>        if (ret < 0) {
>                debug("Failed to write ADDRL: %d\n", ret);
> --
> 1.7.4.1
>
>
Acked-by: Simon Glass <sjg at chromium.org>


More information about the U-Boot mailing list