netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] smsc95xx: fix register dump of last register
@ 2012-12-10 11:03 Steve Glendinning
  2012-12-10 11:03 ` [PATCH 2/2] smsc95xx: fix async register writes on big endian platforms Steve Glendinning
  2012-12-10 19:10 ` [PATCH 1/2] smsc95xx: fix register dump of last register David Miller
  0 siblings, 2 replies; 4+ messages in thread
From: Steve Glendinning @ 2012-12-10 11:03 UTC (permalink / raw)
  To: netdev; +Cc: Steve Glendinning

This patch fixes the ethtool register dump for smsc95xx to dump
all 4 bytes of the final register (COE_CR) instead of just the
first byte.

Signed-off-by: Steve Glendinning <steve.glendinning@shawell.net>
---
 drivers/net/usb/smsc95xx.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c
index f7e1e18..a00dcc4 100644
--- a/drivers/net/usb/smsc95xx.c
+++ b/drivers/net/usb/smsc95xx.c
@@ -691,7 +691,7 @@ static int smsc95xx_ethtool_set_eeprom(struct net_device *netdev,
 static int smsc95xx_ethtool_getregslen(struct net_device *netdev)
 {
 	/* all smsc95xx registers */
-	return COE_CR - ID_REV + 1;
+	return COE_CR - ID_REV + sizeof(u32);
 }
 
 static void
-- 
1.7.10.4

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

* [PATCH 2/2] smsc95xx: fix async register writes on big endian platforms
  2012-12-10 11:03 [PATCH 1/2] smsc95xx: fix register dump of last register Steve Glendinning
@ 2012-12-10 11:03 ` Steve Glendinning
  2012-12-10 19:10   ` David Miller
  2012-12-10 19:10 ` [PATCH 1/2] smsc95xx: fix register dump of last register David Miller
  1 sibling, 1 reply; 4+ messages in thread
From: Steve Glendinning @ 2012-12-10 11:03 UTC (permalink / raw)
  To: netdev; +Cc: Steve Glendinning

This patch fixes a missing endian conversion which results in the
interface failing to come up on BE platforms.

It also removes an unnecessary pointer dereference from this
function.

Signed-off-by: Steve Glendinning <steve.glendinning@shawell.net>
---
 drivers/net/usb/smsc95xx.c |   14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c
index a00dcc4..9b73670 100644
--- a/drivers/net/usb/smsc95xx.c
+++ b/drivers/net/usb/smsc95xx.c
@@ -421,15 +421,19 @@ static int smsc95xx_write_eeprom(struct usbnet *dev, u32 offset, u32 length,
 }
 
 static int __must_check smsc95xx_write_reg_async(struct usbnet *dev, u16 index,
-						 u32 *data)
+						 u32 data)
 {
 	const u16 size = 4;
+	u32 buf;
 	int ret;
 
+	buf = data;
+	cpu_to_le32s(&buf);
+
 	ret = usbnet_write_cmd_async(dev, USB_VENDOR_REQUEST_WRITE_REGISTER,
 				     USB_DIR_OUT | USB_TYPE_VENDOR |
 				     USB_RECIP_DEVICE,
-				     0, index, data, size);
+				     0, index, &buf, size);
 	if (ret < 0)
 		netdev_warn(dev->net, "Error write async cmd, sts=%d\n",
 			    ret);
@@ -490,15 +494,15 @@ static void smsc95xx_set_multicast(struct net_device *netdev)
 	spin_unlock_irqrestore(&pdata->mac_cr_lock, flags);
 
 	/* Initiate async writes, as we can't wait for completion here */
-	ret = smsc95xx_write_reg_async(dev, HASHH, &pdata->hash_hi);
+	ret = smsc95xx_write_reg_async(dev, HASHH, pdata->hash_hi);
 	if (ret < 0)
 		netdev_warn(dev->net, "failed to initiate async write to HASHH\n");
 
-	ret = smsc95xx_write_reg_async(dev, HASHL, &pdata->hash_lo);
+	ret = smsc95xx_write_reg_async(dev, HASHL, pdata->hash_lo);
 	if (ret < 0)
 		netdev_warn(dev->net, "failed to initiate async write to HASHL\n");
 
-	ret = smsc95xx_write_reg_async(dev, MAC_CR, &pdata->mac_cr);
+	ret = smsc95xx_write_reg_async(dev, MAC_CR, pdata->mac_cr);
 	if (ret < 0)
 		netdev_warn(dev->net, "failed to initiate async write to MAC_CR\n");
 }
-- 
1.7.10.4

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

* Re: [PATCH 1/2] smsc95xx: fix register dump of last register
  2012-12-10 11:03 [PATCH 1/2] smsc95xx: fix register dump of last register Steve Glendinning
  2012-12-10 11:03 ` [PATCH 2/2] smsc95xx: fix async register writes on big endian platforms Steve Glendinning
@ 2012-12-10 19:10 ` David Miller
  1 sibling, 0 replies; 4+ messages in thread
From: David Miller @ 2012-12-10 19:10 UTC (permalink / raw)
  To: steve.glendinning; +Cc: netdev

From: Steve Glendinning <steve.glendinning@shawell.net>
Date: Mon, 10 Dec 2012 11:03:07 +0000

> This patch fixes the ethtool register dump for smsc95xx to dump
> all 4 bytes of the final register (COE_CR) instead of just the
> first byte.
> 
> Signed-off-by: Steve Glendinning <steve.glendinning@shawell.net>

Applied.

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

* Re: [PATCH 2/2] smsc95xx: fix async register writes on big endian platforms
  2012-12-10 11:03 ` [PATCH 2/2] smsc95xx: fix async register writes on big endian platforms Steve Glendinning
@ 2012-12-10 19:10   ` David Miller
  0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2012-12-10 19:10 UTC (permalink / raw)
  To: steve.glendinning; +Cc: netdev

From: Steve Glendinning <steve.glendinning@shawell.net>
Date: Mon, 10 Dec 2012 11:03:08 +0000

> This patch fixes a missing endian conversion which results in the
> interface failing to come up on BE platforms.
> 
> It also removes an unnecessary pointer dereference from this
> function.
> 
> Signed-off-by: Steve Glendinning <steve.glendinning@shawell.net>

Applied.

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

end of thread, other threads:[~2012-12-10 19:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-10 11:03 [PATCH 1/2] smsc95xx: fix register dump of last register Steve Glendinning
2012-12-10 11:03 ` [PATCH 2/2] smsc95xx: fix async register writes on big endian platforms Steve Glendinning
2012-12-10 19:10   ` David Miller
2012-12-10 19:10 ` [PATCH 1/2] smsc95xx: fix register dump of last register David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).