public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v2] usb: eth: asix88179: add ability to modify MAC address
@ 2015-01-12 16:51 Rene Griessl
  2015-01-12 16:54 ` Marek Vasut
  0 siblings, 1 reply; 5+ messages in thread
From: Rene Griessl @ 2015-01-12 16:51 UTC (permalink / raw)
  To: u-boot

This patch 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>
---

Changes for v2:
	- removed memcpy
 
 drivers/usb/eth/asix88179.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/drivers/usb/eth/asix88179.c b/drivers/usb/eth/asix88179.c
index b8ca720..0ef85db 100644
--- a/drivers/usb/eth/asix88179.c
+++ b/drivers/usb/eth/asix88179.c
@@ -271,6 +271,19 @@ 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;
+
+	ret = asix_write_cmd(dev, AX_ACCESS_MAC, AX_NODE_ID, ETH_ALEN,
+				 ETH_ALEN, eth->enetaddr);
+	if (ret < 0)
+		debug("Failed to set MAC address: %02x\n", ret);
+
+	return ret;
+}
+
 static int asix_basic_reset(struct ueth_data *dev)
 {
 	struct asix_private *dev_priv = (struct asix_private *)dev->dev_priv;
@@ -686,6 +699,7 @@ int ax88179_eth_get_info(struct usb_device *dev, struct ueth_data *ss,
 	eth->send = asix_send;
 	eth->recv = asix_recv;
 	eth->halt = asix_halt;
+	eth->write_hwaddr = asix_write_mac;
 	eth->priv = ss;
 
 	if (asix_basic_reset(ss))
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [U-Boot] [PATCH v2] usb: eth: asix88179: add ability to modify MAC address
  2015-01-12 16:51 [U-Boot] [PATCH v2] usb: eth: asix88179: add ability to modify MAC address Rene Griessl
@ 2015-01-12 16:54 ` Marek Vasut
  2015-01-12 17:07   ` René Griessl
  0 siblings, 1 reply; 5+ messages in thread
From: Marek Vasut @ 2015-01-12 16:54 UTC (permalink / raw)
  To: u-boot

On Monday, January 12, 2015 at 05:51:16 PM, Rene Griessl wrote:
> This patch 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>
> ---
> 
> Changes for v2:
> 	- removed memcpy

Hi!

what was the reason for the memcpy() in the first place please ?

Otherwise,

Reviewed-by: Marek Vasut <marex@denx.de>

Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [U-Boot] [PATCH v2] usb: eth: asix88179: add ability to modify MAC address
  2015-01-12 16:54 ` Marek Vasut
@ 2015-01-12 17:07   ` René Griessl
  2015-01-12 17:37     ` Marek Vasut
  0 siblings, 1 reply; 5+ messages in thread
From: René Griessl @ 2015-01-12 17:07 UTC (permalink / raw)
  To: u-boot


Am 12.01.2015 um 17:54 schrieb Marek Vasut:
> On Monday, January 12, 2015 at 05:51:16 PM, Rene Griessl wrote:
>> This patch 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>
>> ---
>>
>> Changes for v2:
>> 	- removed memcpy
> Hi!
>
> what was the reason for the memcpy() in the first place please ?
I copied the function from the asix.c driver. There it is needed for the 
cache aligned buffer.
But in this case the alignment is already implemented in the write 
function. So you were right, it is not needed here!
> Otherwise,
>
> Reviewed-by: Marek Vasut <marex@denx.de>
>
> Best regards,
> Marek Vasut

-- 

--------------------------------------------------------

Dipl.-Ing. Ren? Griessl
Universit?t Bielefeld
AG Kognitronik & Sensorik
Exzellenzcluster Cognitive Interaction Technology (CITEC)
Inspiration 1 (Zehlendorfer Damm 199)
33615 Bielefeld

Telefon : +49 521-106-67362
Fax     : +49 521-106-12348
eMail   : rgriessl at cit-ec.uni-bielefeld.de
Internet: http://www.ks.cit-ec.uni-bielefeld.de/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [U-Boot] [PATCH v2] usb: eth: asix88179: add ability to modify MAC address
  2015-01-12 17:07   ` René Griessl
@ 2015-01-12 17:37     ` Marek Vasut
  2015-01-12 18:04       ` Joe Hershberger
  0 siblings, 1 reply; 5+ messages in thread
From: Marek Vasut @ 2015-01-12 17:37 UTC (permalink / raw)
  To: u-boot

On Monday, January 12, 2015 at 06:07:27 PM, Ren? Griessl wrote:
> Am 12.01.2015 um 17:54 schrieb Marek Vasut:
> > On Monday, January 12, 2015 at 05:51:16 PM, Rene Griessl wrote:
> >> This patch 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>
> >> ---
> >> 
> >> Changes for v2:
> >> 	- removed memcpy
> > 
> > Hi!
> > 
> > what was the reason for the memcpy() in the first place please ?
> 
> I copied the function from the asix.c driver. There it is needed for the
> cache aligned buffer.
> But in this case the alignment is already implemented in the write
> function. So you were right, it is not needed here!

OK, thanks!

Applied to u-boot-usb/next , thanks!

Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [U-Boot] [PATCH v2] usb: eth: asix88179: add ability to modify MAC address
  2015-01-12 17:37     ` Marek Vasut
@ 2015-01-12 18:04       ` Joe Hershberger
  0 siblings, 0 replies; 5+ messages in thread
From: Joe Hershberger @ 2015-01-12 18:04 UTC (permalink / raw)
  To: u-boot

On Mon, Jan 12, 2015 at 11:37 AM, Marek Vasut <marex@denx.de> wrote:
>
> On Monday, January 12, 2015 at 06:07:27 PM, Ren? Griessl wrote:
> > Am 12.01.2015 um 17:54 schrieb Marek Vasut:
> > > On Monday, January 12, 2015 at 05:51:16 PM, Rene Griessl wrote:
> > >> This patch 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>
> > >> ---
> > >>
> > >> Changes for v2:
> > >>    - removed memcpy
> > >
> > > Hi!
> > >
> > > what was the reason for the memcpy() in the first place please ?
> >
> > I copied the function from the asix.c driver. There it is needed for the
> > cache aligned buffer.
> > But in this case the alignment is already implemented in the write
> > function. So you were right, it is not needed here!
>
> OK, thanks!
>
> Applied to u-boot-usb/next , thanks!

Looks good... Thanks, guys!

-Joe

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-01-12 18:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-12 16:51 [U-Boot] [PATCH v2] usb: eth: asix88179: add ability to modify MAC address Rene Griessl
2015-01-12 16:54 ` Marek Vasut
2015-01-12 17:07   ` René Griessl
2015-01-12 17:37     ` Marek Vasut
2015-01-12 18:04       ` Joe Hershberger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox