smsc95xx: Fix MAC address programming and some minor issues
v2 cover smsc95xx: Fix MAC address programming and some minor issues
Changes since v1:
- Use __get_unaligned_le16/32 as suggested by Mike Frysinger.
- Use format "%pM" to print ethernet address.
- Drop third patch as it is not really required/useful.
Wolfgang Grandegger (2):
smsc95xx: Fix MAC address programming
smsc95xx: Debug message cleanup
drivers/usb/eth/smsc95xx.c | 16 ++++++---------- 1 files changed, 6 insertions(+), 10 deletions(-)
Signature · 1 line
1.7.4.1
PATCH v2 1/2 smsc95xx: Fix MAC address programming
Commit 79ad54400932d6484178a372fb3b659e3437473b broke MAC address programming in the SMSC95xx register set.
--- drivers/usb/eth/smsc95xx.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
drivers/usb/eth/smsc95xx.c +3 -3
@@ -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 (ð->enetaddr[0 ]); +u32 addr_hi =__get_unaligned_le16 (ð->enetaddr[4 ]);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);
Signature · 1 line
1.7.4.1
PATCH v2 1/2 smsc95xx: Fix MAC address programming
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20111115/48b0486d/attachment.pgp
PATCH v2 1/2 smsc95xx: Fix MAC address programming
In reply to Wolfgang GrandeggerHi Wolfgang,
Quoted 25 lines · Wolfgang Grandegger
Commit
79ad54400932d6484178a372fb3b659e3437473bbroke MAC address programming in the SMSC95xx register set.Cc Marek Vasut <[email protected]>Cc Wolfgang Denk <[email protected]>Cc Simon Glass <[email protected]>Cc Mike Frysinger <[email protected]>Signed-off-by Wolfgang Grandegger <[email protected]>---
?drivers/usb/eth/smsc95xx.c | ? ?6 +++---
?1 files changed, 3 insertions(+), 3 deletions(-)drivers/usb/eth/smsc95xx.c +0
-0@@ -20,6 +20,7 @@?* MA 02111-1307 USA
?*/+#include <
asm/unaligned.h>
?#include <common.h>
?#include <usb.h>
?#include <linux/mii.h>
drivers/usb/eth/smsc95xx.c static int smsc95xx_init_mac_address(struct eth_device *eth, · line 377
Quoted 6 lines
drivers/usb/eth/smsc95xx.c +2
-1@@ -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(ð->enetaddr[0]); + ? ? ? u32 addr_hi = __get_unaligned_le16(ð->enetaddr[4]);
Would prefer that you leave the definitions alone, but it's not important.
Quoted 13 lines
drivers/usb/eth/smsc95xx.c +0
-0? ? ? ?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
PATCH v2 1/2 smsc95xx: Fix MAC address programming
In reply to Wolfgang GrandeggerQuoted 9 lines · Wolfgang Grandegger
Commit
79ad54400932d6484178a372fb3b659e3437473bbroke MAC address programming in the SMSC95xx register set.Cc Marek Vasut <[email protected]>Cc Wolfgang Denk <[email protected]>Cc Simon Glass <[email protected]>Cc Mike Frysinger <[email protected]>Signed-off-by Wolfgang Grandegger <[email protected]>---
Applied to u-boot-staging, sbabic at denx.de, thanks.
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de =====================================================================
PATCH v2 2/2 smsc95xx: Debug message cleanup
In reply to Wolfgang Grandegger--- drivers/usb/eth/smsc95xx.c | 10 +++------- 1 files changed, 3 insertions(+), 7 deletions(-)
drivers/usb/eth/smsc95xx.c +3 -7
@@ -380,18 +380,14 @@ static int smsc95xx_write_hwaddr(struct eth_device *eth)/* set hardware address */ debug ("** %s()\n" , __func__); ret =smsc95xx_write_reg (dev,ADDRL , addr_lo); -if (ret <0 ) { -debug ("Failed to write ADDRL: %d\n" , ret); +if (ret <0 )return ret; - } ret =smsc95xx_write_reg (dev,ADDRH , addr_hi);if (ret <0 )return ret; -debug ("MAC %02x:%02x:%02x:%02x:%02x:%02x\n" , - eth->enetaddr[0 ], eth->enetaddr[1 ], - eth->enetaddr[2 ], eth->enetaddr[3 ], - eth->enetaddr[4 ], eth->enetaddr[5 ]); + +debug ("MAC %pM\n" , eth->enetaddr); dev->have_hwaddr =1 ;return 0 ; }
Signature · 1 line
1.7.4.1
PATCH v2 2/2 smsc95xx: Debug message cleanup
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20111115/cbe0c337/attachment.pgp
PATCH v2 2/2 smsc95xx: Debug message cleanup
In reply to Wolfgang GrandeggerQuoted 6 lines · Wolfgang Grandegger
Cc Simon Glass <[email protected]>Cc Mike Frysinger <[email protected]>Signed-off-by Wolfgang Grandegger <[email protected]>---
?drivers/usb/eth/smsc95xx.c | ? 10 +++-------
?1 files changed, 3 insertions(+), 7 deletions(-)
Quoted 31 lines
drivers/usb/eth/smsc95xx.c +0
-0@@ -380,18 +380,14 @@ static int smsc95xx_write_hwaddr(struct eth_device *eth)? ? ? ?/* set hardware address */
? ? ? ?debug("** %s()\n",__func__);
? ? ? ?ret =smsc95xx_write_reg(dev, ADDRL, addr_lo);
- ? ? ? if (ret < 0) {
- ? ? ? ? ? ? ?debug("Failed to write ADDRL: %d\n", ret);
+ ? ? ? if (ret < 0)
? ? ? ? ? ? ? ?return ret;
- ? ? ? }? ? ? ?ret =
smsc95xx_write_reg(dev, ADDRH, addr_hi); ? ? ? ?if (ret < 0)
? ? ? ? ? ? ? ?return ret;
- ? ? ? debug("MAC %02x:%02x:%02x:%02x:%02x:%02x\n",
- ? ? ? ? ? ? ? eth->enetaddr[0], eth->enetaddr[1],
- ? ? ? ? ? ? ? eth->enetaddr[2], eth->enetaddr[3],
- ? ? ? ? ? ? ? eth->enetaddr[4], eth->enetaddr[5]); +
+ ? ? ?debug("MAC %pM\n", eth->enetaddr);
? ? ? ?dev->have_hwaddr = 1;
? ? ? ?return 0;
?}
--
1.7.4.1
PATCH v2 2/2 smsc95xx: Debug message cleanup
Hi Simon,
Quoted 9 lines · Simon Glass
Quoted 6 lines · Wolfgang Grandegger
Cc Simon Glass <[email protected]>Cc Mike Frysinger <[email protected]>Signed-off-by Wolfgang Grandegger <[email protected]>--- drivers/usb/eth/smsc95xx.c | 10 +++------- 1 files changed, 3 insertions(+), 7 deletions(-)Acked-by Simon Glass <[email protected]>
Thanks. Who will take care of these patches? Do you know?
Wolfgang.
PATCH v2 2/2 smsc95xx: Debug message cleanup
Quoted 13 lines · Wolfgang Grandegger
Hi Simon,
Quoted 9 lines · Simon Glass
Quoted 6 lines · Wolfgang Grandegger
Cc Simon Glass <[email protected]>Cc Mike Frysinger <[email protected]>Signed-off-by Wolfgang Grandegger <[email protected]>--- drivers/usb/eth/smsc95xx.c | 10 +++------- 1 files changed, 3 insertions(+), 7 deletions(-)Acked-by Simon Glass <[email protected]>
Quoted 8 lines
Thanks. Who will take care of these patches? Do you know?
Wolfgang.
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot
Hi Wolfgang,
I have already merged your patches into u-boot-staging, sbabic at denx.de branch, and sent a pull request to Wolfgang (Denk).
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de =====================================================================
PATCH v2 2/2 smsc95xx: Debug message cleanup
In reply to Wolfgang GrandeggerQuoted 4 lines · Wolfgang Grandegger
Cc Simon Glass <[email protected]>Cc Mike Frysinger <[email protected]>Signed-off-by Wolfgang Grandegger <[email protected]>---
Applied to u-boot-staging, sbabic at denx.de, thanks.
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de =====================================================================