All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marek Vasut <marex@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] usb: eth: asix88179: add ability to modify MAC address
Date: Sat, 10 Jan 2015 01:43:04 +0100	[thread overview]
Message-ID: <201501100143.04325.marex@denx.de> (raw)
In-Reply-To: <1420721935-5273-1-git-send-email-rgriessl@cit-ec.uni-bielefeld.de>

On Thursday, January 08, 2015 at 01:58:55 PM, Rene Griessl wrote:
> Here is the promised patch, that enables U-Boot to modify the MAC
> address of the AX88179.
> Tested on RECS5250 (similar to Arndale5250)
> 
> Signed-off-by: Rene Griessl <rgriessl@cit-ec.uni-bielefeld.de>
> ---
>  drivers/usb/eth/asix88179.c | 17 +++++++++++++++++
>  1 file changed, 17 insertions(+)
> 
> diff --git a/drivers/usb/eth/asix88179.c b/drivers/usb/eth/asix88179.c
> index b8ca720..b551540 100644
> --- a/drivers/usb/eth/asix88179.c
> +++ b/drivers/usb/eth/asix88179.c
> @@ -271,6 +271,22 @@ static int asix_read_mac(struct eth_device *eth)
>  	return 0;
>  }
> 
> +static int asix_write_mac(struct eth_device *eth)
> +{
> +	struct ueth_data *dev = (struct ueth_data *)eth->priv;
> +	int ret;
> +	u8 buf[ETH_ALEN];
> +
> +	memcpy(buf, eth->enetaddr, ETH_ALEN);

Why is the memcpy needed ?

> +	ret = asix_write_cmd(dev, AX_ACCESS_MAC, AX_NODE_ID, ETH_ALEN,
> +				 ETH_ALEN, buf);
> +	if (ret < 0)
> +		debug("Failed to set MAC address: %02x\n", ret);
> +
> +	return ret;
> +}

Otherwise looks good :)

Best regards,
Marek Vasut

      reply	other threads:[~2015-01-10  0:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-08 12:58 [U-Boot] [PATCH] usb: eth: asix88179: add ability to modify MAC address Rene Griessl
2015-01-10  0:43 ` Marek Vasut [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201501100143.04325.marex@denx.de \
    --to=marex@denx.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.