aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/usb/dm9601.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-03 00:01:38 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-03 00:01:38 -0400
commitb59449bea276793b8f228ea07bcb861670d79d75 (patch)
treec5e405e27e07a5800ca21312ad45c2a3af892449 /drivers/net/usb/dm9601.c
parentfffe566b8f735fa71b38c7cc487b471b85894401 (diff)
parent63ac9b915924d1237d2135fcb4de724e6127ca5e (diff)
Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6
* 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6: 3c589_cs: fix local_bh_enable warning RESEND [PATCH 3/3] NetXen: Graceful teardown of interface and hardware upon module unload drivers/net/ns83820.c: fix a check-after-use net/usb/cdc_ether minor sparse cleanup RESEND [PATCH 2/3] NetXen: Support per PCI-function interrupt mask registers RESEND [PATCH 1/3] NetXen: Fix issue of MSI not working correctly dm9601: Return 0 from bind() on success Update MAINTAINERS for USB network devices usbnet: Zero padding byte if there is tail room in skb dm9601: HW header size shouldn't be included in packet length starfire list alpha as 64 bit arch myri10ge: SET_NETDEV_DEV() gianfar: Fix typo bug introduced by move to udp_hdr() [PATCH] libertas: remove private ioctls [PATCH] libertas: fix WPA associations by handling ENABLE_RSN correctly [PATCH] libertas: kill wlan_scan_process_results [PATCH] libertas: style fixes
Diffstat (limited to 'drivers/net/usb/dm9601.c')
-rw-r--r--drivers/net/usb/dm9601.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/net/usb/dm9601.c b/drivers/net/usb/dm9601.c
index a67638601477..16c7a0e87850 100644
--- a/drivers/net/usb/dm9601.c
+++ b/drivers/net/usb/dm9601.c
@@ -414,18 +414,16 @@ static int dm9601_bind(struct usbnet *dev, struct usb_interface *intf)
414 dev->mii.reg_num_mask = 0x1f; 414 dev->mii.reg_num_mask = 0x1f;
415 415
416 /* reset */ 416 /* reset */
417 ret = dm_write_reg(dev, DM_NET_CTRL, 1); 417 dm_write_reg(dev, DM_NET_CTRL, 1);
418 udelay(20); 418 udelay(20);
419 419
420 /* read MAC */ 420 /* read MAC */
421 ret = dm_read(dev, DM_PHY_ADDR, ETH_ALEN, dev->net->dev_addr); 421 if (dm_read(dev, DM_PHY_ADDR, ETH_ALEN, dev->net->dev_addr) < 0) {
422 if (ret < 0) {
423 printk(KERN_ERR "Error reading MAC address\n"); 422 printk(KERN_ERR "Error reading MAC address\n");
424 ret = -ENODEV; 423 ret = -ENODEV;
425 goto out; 424 goto out;
426 } 425 }
427 426
428
429 /* power up phy */ 427 /* power up phy */
430 dm_write_reg(dev, DM_GPR_CTRL, 1); 428 dm_write_reg(dev, DM_GPR_CTRL, 1);
431 dm_write_reg(dev, DM_GPR_DATA, 0); 429 dm_write_reg(dev, DM_GPR_DATA, 0);
@@ -489,6 +487,8 @@ static struct sk_buff *dm9601_tx_fixup(struct usbnet *dev, struct sk_buff *skb,
489 b3..n: packet data 487 b3..n: packet data
490 */ 488 */
491 489
490 len = skb->len;
491
492 if (skb_headroom(skb) < DM_TX_OVERHEAD) { 492 if (skb_headroom(skb) < DM_TX_OVERHEAD) {
493 struct sk_buff *skb2; 493 struct sk_buff *skb2;
494 494
@@ -501,10 +501,9 @@ static struct sk_buff *dm9601_tx_fixup(struct usbnet *dev, struct sk_buff *skb,
501 501
502 __skb_push(skb, DM_TX_OVERHEAD); 502 __skb_push(skb, DM_TX_OVERHEAD);
503 503
504 len = skb->len;
505 /* usbnet adds padding if length is a multiple of packet size 504 /* usbnet adds padding if length is a multiple of packet size
506 if so, adjust length value in header */ 505 if so, adjust length value in header */
507 if ((len % dev->maxpacket) == 0) 506 if ((skb->len % dev->maxpacket) == 0)
508 len++; 507 len++;
509 508
510 skb->data[0] = len; 509 skb->data[0] = len;