From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek Vasut Date: Sat, 10 Jan 2015 01:43:04 +0100 Subject: [U-Boot] [PATCH] usb: eth: asix88179: add ability to modify MAC address In-Reply-To: <1420721935-5273-1-git-send-email-rgriessl@cit-ec.uni-bielefeld.de> References: <1420721935-5273-1-git-send-email-rgriessl@cit-ec.uni-bielefeld.de> Message-ID: <201501100143.04325.marex@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.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 > --- > 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