diff options
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/usb/asix.c | 5 | ||||
-rw-r--r-- | drivers/net/usb/catc.c | 41 | ||||
-rw-r--r-- | drivers/net/usb/dm9601.c | 5 | ||||
-rw-r--r-- | drivers/net/usb/kaweth.c | 17 | ||||
-rw-r--r-- | drivers/net/usb/mcs7830.c | 5 | ||||
-rw-r--r-- | drivers/net/usb/pegasus.c | 33 | ||||
-rw-r--r-- | drivers/net/usb/rtl8150.c | 38 | ||||
-rw-r--r-- | drivers/net/usb/smsc95xx.c | 5 |
8 files changed, 83 insertions, 66 deletions
diff --git a/drivers/net/usb/asix.c b/drivers/net/usb/asix.c index de57490103fc..e009481c606c 100644 --- a/drivers/net/usb/asix.c +++ b/drivers/net/usb/asix.c | |||
@@ -246,10 +246,11 @@ out: | |||
246 | static void asix_async_cmd_callback(struct urb *urb) | 246 | static void asix_async_cmd_callback(struct urb *urb) |
247 | { | 247 | { |
248 | struct usb_ctrlrequest *req = (struct usb_ctrlrequest *)urb->context; | 248 | struct usb_ctrlrequest *req = (struct usb_ctrlrequest *)urb->context; |
249 | int status = urb->status; | ||
249 | 250 | ||
250 | if (urb->status < 0) | 251 | if (status < 0) |
251 | printk(KERN_DEBUG "asix_async_cmd_callback() failed with %d", | 252 | printk(KERN_DEBUG "asix_async_cmd_callback() failed with %d", |
252 | urb->status); | 253 | status); |
253 | 254 | ||
254 | kfree(req); | 255 | kfree(req); |
255 | usb_free_urb(urb); | 256 | usb_free_urb(urb); |
diff --git a/drivers/net/usb/catc.c b/drivers/net/usb/catc.c index d7621239059a..cb7acbbb2798 100644 --- a/drivers/net/usb/catc.c +++ b/drivers/net/usb/catc.c | |||
@@ -229,14 +229,15 @@ static void catc_rx_done(struct urb *urb) | |||
229 | u8 *pkt_start = urb->transfer_buffer; | 229 | u8 *pkt_start = urb->transfer_buffer; |
230 | struct sk_buff *skb; | 230 | struct sk_buff *skb; |
231 | int pkt_len, pkt_offset = 0; | 231 | int pkt_len, pkt_offset = 0; |
232 | int status = urb->status; | ||
232 | 233 | ||
233 | if (!catc->is_f5u011) { | 234 | if (!catc->is_f5u011) { |
234 | clear_bit(RX_RUNNING, &catc->flags); | 235 | clear_bit(RX_RUNNING, &catc->flags); |
235 | pkt_offset = 2; | 236 | pkt_offset = 2; |
236 | } | 237 | } |
237 | 238 | ||
238 | if (urb->status) { | 239 | if (status) { |
239 | dbg("rx_done, status %d, length %d", urb->status, urb->actual_length); | 240 | dbg("rx_done, status %d, length %d", status, urb->actual_length); |
240 | return; | 241 | return; |
241 | } | 242 | } |
242 | 243 | ||
@@ -273,12 +274,12 @@ static void catc_rx_done(struct urb *urb) | |||
273 | 274 | ||
274 | if (catc->is_f5u011) { | 275 | if (catc->is_f5u011) { |
275 | if (atomic_read(&catc->recq_sz)) { | 276 | if (atomic_read(&catc->recq_sz)) { |
276 | int status; | 277 | int state; |
277 | atomic_dec(&catc->recq_sz); | 278 | atomic_dec(&catc->recq_sz); |
278 | dbg("getting extra packet"); | 279 | dbg("getting extra packet"); |
279 | urb->dev = catc->usbdev; | 280 | urb->dev = catc->usbdev; |
280 | if ((status = usb_submit_urb(urb, GFP_ATOMIC)) < 0) { | 281 | if ((state = usb_submit_urb(urb, GFP_ATOMIC)) < 0) { |
281 | dbg("submit(rx_urb) status %d", status); | 282 | dbg("submit(rx_urb) status %d", state); |
282 | } | 283 | } |
283 | } else { | 284 | } else { |
284 | clear_bit(RX_RUNNING, &catc->flags); | 285 | clear_bit(RX_RUNNING, &catc->flags); |
@@ -290,8 +291,9 @@ static void catc_irq_done(struct urb *urb) | |||
290 | { | 291 | { |
291 | struct catc *catc = urb->context; | 292 | struct catc *catc = urb->context; |
292 | u8 *data = urb->transfer_buffer; | 293 | u8 *data = urb->transfer_buffer; |
293 | int status; | 294 | int status = urb->status; |
294 | unsigned int hasdata = 0, linksts = LinkNoChange; | 295 | unsigned int hasdata = 0, linksts = LinkNoChange; |
296 | int res; | ||
295 | 297 | ||
296 | if (!catc->is_f5u011) { | 298 | if (!catc->is_f5u011) { |
297 | hasdata = data[1] & 0x80; | 299 | hasdata = data[1] & 0x80; |
@@ -307,7 +309,7 @@ static void catc_irq_done(struct urb *urb) | |||
307 | linksts = LinkBad; | 309 | linksts = LinkBad; |
308 | } | 310 | } |
309 | 311 | ||
310 | switch (urb->status) { | 312 | switch (status) { |
311 | case 0: /* success */ | 313 | case 0: /* success */ |
312 | break; | 314 | break; |
313 | case -ECONNRESET: /* unlink */ | 315 | case -ECONNRESET: /* unlink */ |
@@ -316,7 +318,7 @@ static void catc_irq_done(struct urb *urb) | |||
316 | return; | 318 | return; |
317 | /* -EPIPE: should clear the halt */ | 319 | /* -EPIPE: should clear the halt */ |
318 | default: /* error */ | 320 | default: /* error */ |
319 | dbg("irq_done, status %d, data %02x %02x.", urb->status, data[0], data[1]); | 321 | dbg("irq_done, status %d, data %02x %02x.", status, data[0], data[1]); |
320 | goto resubmit; | 322 | goto resubmit; |
321 | } | 323 | } |
322 | 324 | ||
@@ -336,17 +338,17 @@ static void catc_irq_done(struct urb *urb) | |||
336 | atomic_inc(&catc->recq_sz); | 338 | atomic_inc(&catc->recq_sz); |
337 | } else { | 339 | } else { |
338 | catc->rx_urb->dev = catc->usbdev; | 340 | catc->rx_urb->dev = catc->usbdev; |
339 | if ((status = usb_submit_urb(catc->rx_urb, GFP_ATOMIC)) < 0) { | 341 | if ((res = usb_submit_urb(catc->rx_urb, GFP_ATOMIC)) < 0) { |
340 | err("submit(rx_urb) status %d", status); | 342 | err("submit(rx_urb) status %d", res); |
341 | } | 343 | } |
342 | } | 344 | } |
343 | } | 345 | } |
344 | resubmit: | 346 | resubmit: |
345 | status = usb_submit_urb (urb, GFP_ATOMIC); | 347 | res = usb_submit_urb (urb, GFP_ATOMIC); |
346 | if (status) | 348 | if (res) |
347 | err ("can't resubmit intr, %s-%s, status %d", | 349 | err ("can't resubmit intr, %s-%s, status %d", |
348 | catc->usbdev->bus->bus_name, | 350 | catc->usbdev->bus->bus_name, |
349 | catc->usbdev->devpath, status); | 351 | catc->usbdev->devpath, res); |
350 | } | 352 | } |
351 | 353 | ||
352 | /* | 354 | /* |
@@ -378,9 +380,9 @@ static void catc_tx_done(struct urb *urb) | |||
378 | { | 380 | { |
379 | struct catc *catc = urb->context; | 381 | struct catc *catc = urb->context; |
380 | unsigned long flags; | 382 | unsigned long flags; |
381 | int r; | 383 | int r, status = urb->status; |
382 | 384 | ||
383 | if (urb->status == -ECONNRESET) { | 385 | if (status == -ECONNRESET) { |
384 | dbg("Tx Reset."); | 386 | dbg("Tx Reset."); |
385 | urb->status = 0; | 387 | urb->status = 0; |
386 | catc->netdev->trans_start = jiffies; | 388 | catc->netdev->trans_start = jiffies; |
@@ -390,8 +392,8 @@ static void catc_tx_done(struct urb *urb) | |||
390 | return; | 392 | return; |
391 | } | 393 | } |
392 | 394 | ||
393 | if (urb->status) { | 395 | if (status) { |
394 | dbg("tx_done, status %d, length %d", urb->status, urb->actual_length); | 396 | dbg("tx_done, status %d, length %d", status, urb->actual_length); |
395 | return; | 397 | return; |
396 | } | 398 | } |
397 | 399 | ||
@@ -502,9 +504,10 @@ static void catc_ctrl_done(struct urb *urb) | |||
502 | struct catc *catc = urb->context; | 504 | struct catc *catc = urb->context; |
503 | struct ctrl_queue *q; | 505 | struct ctrl_queue *q; |
504 | unsigned long flags; | 506 | unsigned long flags; |
507 | int status = urb->status; | ||
505 | 508 | ||
506 | if (urb->status) | 509 | if (status) |
507 | dbg("ctrl_done, status %d, len %d.", urb->status, urb->actual_length); | 510 | dbg("ctrl_done, status %d, len %d.", status, urb->actual_length); |
508 | 511 | ||
509 | spin_lock_irqsave(&catc->ctrl_lock, flags); | 512 | spin_lock_irqsave(&catc->ctrl_lock, flags); |
510 | 513 | ||
diff --git a/drivers/net/usb/dm9601.c b/drivers/net/usb/dm9601.c index db3377dae9d5..edd244f3acb5 100644 --- a/drivers/net/usb/dm9601.c +++ b/drivers/net/usb/dm9601.c | |||
@@ -123,10 +123,11 @@ static int dm_write_reg(struct usbnet *dev, u8 reg, u8 value) | |||
123 | static void dm_write_async_callback(struct urb *urb) | 123 | static void dm_write_async_callback(struct urb *urb) |
124 | { | 124 | { |
125 | struct usb_ctrlrequest *req = (struct usb_ctrlrequest *)urb->context; | 125 | struct usb_ctrlrequest *req = (struct usb_ctrlrequest *)urb->context; |
126 | int status = urb->status; | ||
126 | 127 | ||
127 | if (urb->status < 0) | 128 | if (status < 0) |
128 | printk(KERN_DEBUG "dm_write_async_callback() failed with %d\n", | 129 | printk(KERN_DEBUG "dm_write_async_callback() failed with %d\n", |
129 | urb->status); | 130 | status); |
130 | 131 | ||
131 | kfree(req); | 132 | kfree(req); |
132 | usb_free_urb(urb); | 133 | usb_free_urb(urb); |
diff --git a/drivers/net/usb/kaweth.c b/drivers/net/usb/kaweth.c index fdbf3be24fda..2ee034f70d1c 100644 --- a/drivers/net/usb/kaweth.c +++ b/drivers/net/usb/kaweth.c | |||
@@ -516,8 +516,9 @@ static void int_callback(struct urb *u) | |||
516 | { | 516 | { |
517 | struct kaweth_device *kaweth = u->context; | 517 | struct kaweth_device *kaweth = u->context; |
518 | int act_state; | 518 | int act_state; |
519 | int status = u->status; | ||
519 | 520 | ||
520 | switch (u->status) { | 521 | switch (status) { |
521 | case 0: /* success */ | 522 | case 0: /* success */ |
522 | break; | 523 | break; |
523 | case -ECONNRESET: /* unlink */ | 524 | case -ECONNRESET: /* unlink */ |
@@ -598,6 +599,7 @@ static void kaweth_usb_receive(struct urb *urb) | |||
598 | { | 599 | { |
599 | struct kaweth_device *kaweth = urb->context; | 600 | struct kaweth_device *kaweth = urb->context; |
600 | struct net_device *net = kaweth->net; | 601 | struct net_device *net = kaweth->net; |
602 | int status = urb->status; | ||
601 | 603 | ||
602 | int count = urb->actual_length; | 604 | int count = urb->actual_length; |
603 | int count2 = urb->transfer_buffer_length; | 605 | int count2 = urb->transfer_buffer_length; |
@@ -606,7 +608,7 @@ static void kaweth_usb_receive(struct urb *urb) | |||
606 | 608 | ||
607 | struct sk_buff *skb; | 609 | struct sk_buff *skb; |
608 | 610 | ||
609 | if(unlikely(urb->status == -ECONNRESET || urb->status == -ESHUTDOWN)) | 611 | if(unlikely(status == -ECONNRESET || status == -ESHUTDOWN)) |
610 | /* we are killed - set a flag and wake the disconnect handler */ | 612 | /* we are killed - set a flag and wake the disconnect handler */ |
611 | { | 613 | { |
612 | kaweth->end = 1; | 614 | kaweth->end = 1; |
@@ -621,10 +623,10 @@ static void kaweth_usb_receive(struct urb *urb) | |||
621 | } | 623 | } |
622 | spin_unlock(&kaweth->device_lock); | 624 | spin_unlock(&kaweth->device_lock); |
623 | 625 | ||
624 | if(urb->status && urb->status != -EREMOTEIO && count != 1) { | 626 | if(status && status != -EREMOTEIO && count != 1) { |
625 | err("%s RX status: %d count: %d packet_len: %d", | 627 | err("%s RX status: %d count: %d packet_len: %d", |
626 | net->name, | 628 | net->name, |
627 | urb->status, | 629 | status, |
628 | count, | 630 | count, |
629 | (int)pkt_len); | 631 | (int)pkt_len); |
630 | kaweth_resubmit_rx_urb(kaweth, GFP_ATOMIC); | 632 | kaweth_resubmit_rx_urb(kaweth, GFP_ATOMIC); |
@@ -775,10 +777,11 @@ static void kaweth_usb_transmit_complete(struct urb *urb) | |||
775 | { | 777 | { |
776 | struct kaweth_device *kaweth = urb->context; | 778 | struct kaweth_device *kaweth = urb->context; |
777 | struct sk_buff *skb = kaweth->tx_skb; | 779 | struct sk_buff *skb = kaweth->tx_skb; |
780 | int status = urb->status; | ||
778 | 781 | ||
779 | if (unlikely(urb->status != 0)) | 782 | if (unlikely(status != 0)) |
780 | if (urb->status != -ENOENT) | 783 | if (status != -ENOENT) |
781 | dbg("%s: TX status %d.", kaweth->net->name, urb->status); | 784 | dbg("%s: TX status %d.", kaweth->net->name, status); |
782 | 785 | ||
783 | netif_wake_queue(kaweth->net); | 786 | netif_wake_queue(kaweth->net); |
784 | dev_kfree_skb_irq(skb); | 787 | dev_kfree_skb_irq(skb); |
diff --git a/drivers/net/usb/mcs7830.c b/drivers/net/usb/mcs7830.c index bbcc76ae3c9c..5385d66b306e 100644 --- a/drivers/net/usb/mcs7830.c +++ b/drivers/net/usb/mcs7830.c | |||
@@ -115,10 +115,11 @@ static int mcs7830_set_reg(struct usbnet *dev, u16 index, u16 size, void *data) | |||
115 | static void mcs7830_async_cmd_callback(struct urb *urb) | 115 | static void mcs7830_async_cmd_callback(struct urb *urb) |
116 | { | 116 | { |
117 | struct usb_ctrlrequest *req = (struct usb_ctrlrequest *)urb->context; | 117 | struct usb_ctrlrequest *req = (struct usb_ctrlrequest *)urb->context; |
118 | int status = urb->status; | ||
118 | 119 | ||
119 | if (urb->status < 0) | 120 | if (status < 0) |
120 | printk(KERN_DEBUG "%s() failed with %d\n", | 121 | printk(KERN_DEBUG "%s() failed with %d\n", |
121 | __func__, urb->status); | 122 | __func__, status); |
122 | 123 | ||
123 | kfree(req); | 124 | kfree(req); |
124 | usb_free_urb(urb); | 125 | usb_free_urb(urb); |
diff --git a/drivers/net/usb/pegasus.c b/drivers/net/usb/pegasus.c index 075e8e94225e..166880c113d6 100644 --- a/drivers/net/usb/pegasus.c +++ b/drivers/net/usb/pegasus.c | |||
@@ -99,11 +99,12 @@ static int update_eth_regs_async(pegasus_t *); | |||
99 | static void ctrl_callback(struct urb *urb) | 99 | static void ctrl_callback(struct urb *urb) |
100 | { | 100 | { |
101 | pegasus_t *pegasus = urb->context; | 101 | pegasus_t *pegasus = urb->context; |
102 | int status = urb->status; | ||
102 | 103 | ||
103 | if (!pegasus) | 104 | if (!pegasus) |
104 | return; | 105 | return; |
105 | 106 | ||
106 | switch (urb->status) { | 107 | switch (status) { |
107 | case 0: | 108 | case 0: |
108 | if (pegasus->flags & ETH_REGS_CHANGE) { | 109 | if (pegasus->flags & ETH_REGS_CHANGE) { |
109 | pegasus->flags &= ~ETH_REGS_CHANGE; | 110 | pegasus->flags &= ~ETH_REGS_CHANGE; |
@@ -119,7 +120,7 @@ static void ctrl_callback(struct urb *urb) | |||
119 | default: | 120 | default: |
120 | if (netif_msg_drv(pegasus) && printk_ratelimit()) | 121 | if (netif_msg_drv(pegasus) && printk_ratelimit()) |
121 | dev_dbg(&pegasus->intf->dev, "%s, status %d\n", | 122 | dev_dbg(&pegasus->intf->dev, "%s, status %d\n", |
122 | __func__, urb->status); | 123 | __func__, status); |
123 | } | 124 | } |
124 | pegasus->flags &= ~ETH_REGS_CHANGED; | 125 | pegasus->flags &= ~ETH_REGS_CHANGED; |
125 | wake_up(&pegasus->ctrl_wait); | 126 | wake_up(&pegasus->ctrl_wait); |
@@ -611,6 +612,7 @@ static void read_bulk_callback(struct urb *urb) | |||
611 | pegasus_t *pegasus = urb->context; | 612 | pegasus_t *pegasus = urb->context; |
612 | struct net_device *net; | 613 | struct net_device *net; |
613 | int rx_status, count = urb->actual_length; | 614 | int rx_status, count = urb->actual_length; |
615 | int status = urb->status; | ||
614 | u8 *buf = urb->transfer_buffer; | 616 | u8 *buf = urb->transfer_buffer; |
615 | __u16 pkt_len; | 617 | __u16 pkt_len; |
616 | 618 | ||
@@ -621,7 +623,7 @@ static void read_bulk_callback(struct urb *urb) | |||
621 | if (!netif_device_present(net) || !netif_running(net)) | 623 | if (!netif_device_present(net) || !netif_running(net)) |
622 | return; | 624 | return; |
623 | 625 | ||
624 | switch (urb->status) { | 626 | switch (status) { |
625 | case 0: | 627 | case 0: |
626 | break; | 628 | break; |
627 | case -ETIME: | 629 | case -ETIME: |
@@ -639,11 +641,11 @@ static void read_bulk_callback(struct urb *urb) | |||
639 | case -ECONNRESET: | 641 | case -ECONNRESET: |
640 | case -ESHUTDOWN: | 642 | case -ESHUTDOWN: |
641 | if (netif_msg_ifdown(pegasus)) | 643 | if (netif_msg_ifdown(pegasus)) |
642 | pr_debug("%s: rx unlink, %d\n", net->name, urb->status); | 644 | pr_debug("%s: rx unlink, %d\n", net->name, status); |
643 | return; | 645 | return; |
644 | default: | 646 | default: |
645 | if (netif_msg_rx_err(pegasus)) | 647 | if (netif_msg_rx_err(pegasus)) |
646 | pr_debug("%s: RX status %d\n", net->name, urb->status); | 648 | pr_debug("%s: RX status %d\n", net->name, status); |
647 | goto goon; | 649 | goto goon; |
648 | } | 650 | } |
649 | 651 | ||
@@ -769,6 +771,7 @@ static void write_bulk_callback(struct urb *urb) | |||
769 | { | 771 | { |
770 | pegasus_t *pegasus = urb->context; | 772 | pegasus_t *pegasus = urb->context; |
771 | struct net_device *net; | 773 | struct net_device *net; |
774 | int status = urb->status; | ||
772 | 775 | ||
773 | if (!pegasus) | 776 | if (!pegasus) |
774 | return; | 777 | return; |
@@ -778,7 +781,7 @@ static void write_bulk_callback(struct urb *urb) | |||
778 | if (!netif_device_present(net) || !netif_running(net)) | 781 | if (!netif_device_present(net) || !netif_running(net)) |
779 | return; | 782 | return; |
780 | 783 | ||
781 | switch (urb->status) { | 784 | switch (status) { |
782 | case -EPIPE: | 785 | case -EPIPE: |
783 | /* FIXME schedule_work() to clear the tx halt */ | 786 | /* FIXME schedule_work() to clear the tx halt */ |
784 | netif_stop_queue(net); | 787 | netif_stop_queue(net); |
@@ -790,11 +793,11 @@ static void write_bulk_callback(struct urb *urb) | |||
790 | case -ECONNRESET: | 793 | case -ECONNRESET: |
791 | case -ESHUTDOWN: | 794 | case -ESHUTDOWN: |
792 | if (netif_msg_ifdown(pegasus)) | 795 | if (netif_msg_ifdown(pegasus)) |
793 | pr_debug("%s: tx unlink, %d\n", net->name, urb->status); | 796 | pr_debug("%s: tx unlink, %d\n", net->name, status); |
794 | return; | 797 | return; |
795 | default: | 798 | default: |
796 | if (netif_msg_tx_err(pegasus)) | 799 | if (netif_msg_tx_err(pegasus)) |
797 | pr_info("%s: TX status %d\n", net->name, urb->status); | 800 | pr_info("%s: TX status %d\n", net->name, status); |
798 | /* FALL THROUGH */ | 801 | /* FALL THROUGH */ |
799 | case 0: | 802 | case 0: |
800 | break; | 803 | break; |
@@ -808,13 +811,13 @@ static void intr_callback(struct urb *urb) | |||
808 | { | 811 | { |
809 | pegasus_t *pegasus = urb->context; | 812 | pegasus_t *pegasus = urb->context; |
810 | struct net_device *net; | 813 | struct net_device *net; |
811 | int status; | 814 | int res, status = urb->status; |
812 | 815 | ||
813 | if (!pegasus) | 816 | if (!pegasus) |
814 | return; | 817 | return; |
815 | net = pegasus->net; | 818 | net = pegasus->net; |
816 | 819 | ||
817 | switch (urb->status) { | 820 | switch (status) { |
818 | case 0: | 821 | case 0: |
819 | break; | 822 | break; |
820 | case -ECONNRESET: /* unlink */ | 823 | case -ECONNRESET: /* unlink */ |
@@ -827,7 +830,7 @@ static void intr_callback(struct urb *urb) | |||
827 | */ | 830 | */ |
828 | if (netif_msg_timer(pegasus)) | 831 | if (netif_msg_timer(pegasus)) |
829 | pr_debug("%s: intr status %d\n", net->name, | 832 | pr_debug("%s: intr status %d\n", net->name, |
830 | urb->status); | 833 | status); |
831 | } | 834 | } |
832 | 835 | ||
833 | if (urb->actual_length >= 6) { | 836 | if (urb->actual_length >= 6) { |
@@ -854,12 +857,12 @@ static void intr_callback(struct urb *urb) | |||
854 | pegasus->stats.rx_missed_errors += ((d[3] & 0x7f) << 8) | d[4]; | 857 | pegasus->stats.rx_missed_errors += ((d[3] & 0x7f) << 8) | d[4]; |
855 | } | 858 | } |
856 | 859 | ||
857 | status = usb_submit_urb(urb, GFP_ATOMIC); | 860 | res = usb_submit_urb(urb, GFP_ATOMIC); |
858 | if (status == -ENODEV) | 861 | if (res == -ENODEV) |
859 | netif_device_detach(pegasus->net); | 862 | netif_device_detach(pegasus->net); |
860 | if (status && netif_msg_timer(pegasus)) | 863 | if (res && netif_msg_timer(pegasus)) |
861 | printk(KERN_ERR "%s: can't resubmit interrupt urb, %d\n", | 864 | printk(KERN_ERR "%s: can't resubmit interrupt urb, %d\n", |
862 | net->name, status); | 865 | net->name, res); |
863 | } | 866 | } |
864 | 867 | ||
865 | static void pegasus_tx_timeout(struct net_device *net) | 868 | static void pegasus_tx_timeout(struct net_device *net) |
diff --git a/drivers/net/usb/rtl8150.c b/drivers/net/usb/rtl8150.c index 6133401ebc67..d8664bf18c00 100644 --- a/drivers/net/usb/rtl8150.c +++ b/drivers/net/usb/rtl8150.c | |||
@@ -212,8 +212,9 @@ static int set_registers(rtl8150_t * dev, u16 indx, u16 size, void *data) | |||
212 | static void ctrl_callback(struct urb *urb) | 212 | static void ctrl_callback(struct urb *urb) |
213 | { | 213 | { |
214 | rtl8150_t *dev; | 214 | rtl8150_t *dev; |
215 | int status = urb->status; | ||
215 | 216 | ||
216 | switch (urb->status) { | 217 | switch (status) { |
217 | case 0: | 218 | case 0: |
218 | break; | 219 | break; |
219 | case -EINPROGRESS: | 220 | case -EINPROGRESS: |
@@ -221,7 +222,7 @@ static void ctrl_callback(struct urb *urb) | |||
221 | case -ENOENT: | 222 | case -ENOENT: |
222 | break; | 223 | break; |
223 | default: | 224 | default: |
224 | dev_warn(&urb->dev->dev, "ctrl urb status %d\n", urb->status); | 225 | dev_warn(&urb->dev->dev, "ctrl urb status %d\n", status); |
225 | } | 226 | } |
226 | dev = urb->context; | 227 | dev = urb->context; |
227 | clear_bit(RX_REG_SET, &dev->flags); | 228 | clear_bit(RX_REG_SET, &dev->flags); |
@@ -424,7 +425,8 @@ static void read_bulk_callback(struct urb *urb) | |||
424 | struct sk_buff *skb; | 425 | struct sk_buff *skb; |
425 | struct net_device *netdev; | 426 | struct net_device *netdev; |
426 | u16 rx_stat; | 427 | u16 rx_stat; |
427 | int status; | 428 | int status = urb->status; |
429 | int result; | ||
428 | 430 | ||
429 | dev = urb->context; | 431 | dev = urb->context; |
430 | if (!dev) | 432 | if (!dev) |
@@ -435,7 +437,7 @@ static void read_bulk_callback(struct urb *urb) | |||
435 | if (!netif_device_present(netdev)) | 437 | if (!netif_device_present(netdev)) |
436 | return; | 438 | return; |
437 | 439 | ||
438 | switch (urb->status) { | 440 | switch (status) { |
439 | case 0: | 441 | case 0: |
440 | break; | 442 | break; |
441 | case -ENOENT: | 443 | case -ENOENT: |
@@ -444,7 +446,7 @@ static void read_bulk_callback(struct urb *urb) | |||
444 | dev_warn(&urb->dev->dev, "may be reset is needed?..\n"); | 446 | dev_warn(&urb->dev->dev, "may be reset is needed?..\n"); |
445 | goto goon; | 447 | goto goon; |
446 | default: | 448 | default: |
447 | dev_warn(&urb->dev->dev, "Rx status %d\n", urb->status); | 449 | dev_warn(&urb->dev->dev, "Rx status %d\n", status); |
448 | goto goon; | 450 | goto goon; |
449 | } | 451 | } |
450 | 452 | ||
@@ -474,10 +476,10 @@ static void read_bulk_callback(struct urb *urb) | |||
474 | goon: | 476 | goon: |
475 | usb_fill_bulk_urb(dev->rx_urb, dev->udev, usb_rcvbulkpipe(dev->udev, 1), | 477 | usb_fill_bulk_urb(dev->rx_urb, dev->udev, usb_rcvbulkpipe(dev->udev, 1), |
476 | dev->rx_skb->data, RTL8150_MTU, read_bulk_callback, dev); | 478 | dev->rx_skb->data, RTL8150_MTU, read_bulk_callback, dev); |
477 | status = usb_submit_urb(dev->rx_urb, GFP_ATOMIC); | 479 | result = usb_submit_urb(dev->rx_urb, GFP_ATOMIC); |
478 | if (status == -ENODEV) | 480 | if (result == -ENODEV) |
479 | netif_device_detach(dev->netdev); | 481 | netif_device_detach(dev->netdev); |
480 | else if (status) { | 482 | else if (result) { |
481 | set_bit(RX_URB_FAIL, &dev->flags); | 483 | set_bit(RX_URB_FAIL, &dev->flags); |
482 | goto resched; | 484 | goto resched; |
483 | } else { | 485 | } else { |
@@ -530,6 +532,7 @@ tlsched: | |||
530 | static void write_bulk_callback(struct urb *urb) | 532 | static void write_bulk_callback(struct urb *urb) |
531 | { | 533 | { |
532 | rtl8150_t *dev; | 534 | rtl8150_t *dev; |
535 | int status = urb->status; | ||
533 | 536 | ||
534 | dev = urb->context; | 537 | dev = urb->context; |
535 | if (!dev) | 538 | if (!dev) |
@@ -537,9 +540,9 @@ static void write_bulk_callback(struct urb *urb) | |||
537 | dev_kfree_skb_irq(dev->tx_skb); | 540 | dev_kfree_skb_irq(dev->tx_skb); |
538 | if (!netif_device_present(dev->netdev)) | 541 | if (!netif_device_present(dev->netdev)) |
539 | return; | 542 | return; |
540 | if (urb->status) | 543 | if (status) |
541 | dev_info(&urb->dev->dev, "%s: Tx status %d\n", | 544 | dev_info(&urb->dev->dev, "%s: Tx status %d\n", |
542 | dev->netdev->name, urb->status); | 545 | dev->netdev->name, status); |
543 | dev->netdev->trans_start = jiffies; | 546 | dev->netdev->trans_start = jiffies; |
544 | netif_wake_queue(dev->netdev); | 547 | netif_wake_queue(dev->netdev); |
545 | } | 548 | } |
@@ -548,12 +551,13 @@ static void intr_callback(struct urb *urb) | |||
548 | { | 551 | { |
549 | rtl8150_t *dev; | 552 | rtl8150_t *dev; |
550 | __u8 *d; | 553 | __u8 *d; |
551 | int status; | 554 | int status = urb->status; |
555 | int res; | ||
552 | 556 | ||
553 | dev = urb->context; | 557 | dev = urb->context; |
554 | if (!dev) | 558 | if (!dev) |
555 | return; | 559 | return; |
556 | switch (urb->status) { | 560 | switch (status) { |
557 | case 0: /* success */ | 561 | case 0: /* success */ |
558 | break; | 562 | break; |
559 | case -ECONNRESET: /* unlink */ | 563 | case -ECONNRESET: /* unlink */ |
@@ -563,7 +567,7 @@ static void intr_callback(struct urb *urb) | |||
563 | /* -EPIPE: should clear the halt */ | 567 | /* -EPIPE: should clear the halt */ |
564 | default: | 568 | default: |
565 | dev_info(&urb->dev->dev, "%s: intr status %d\n", | 569 | dev_info(&urb->dev->dev, "%s: intr status %d\n", |
566 | dev->netdev->name, urb->status); | 570 | dev->netdev->name, status); |
567 | goto resubmit; | 571 | goto resubmit; |
568 | } | 572 | } |
569 | 573 | ||
@@ -591,13 +595,13 @@ static void intr_callback(struct urb *urb) | |||
591 | } | 595 | } |
592 | 596 | ||
593 | resubmit: | 597 | resubmit: |
594 | status = usb_submit_urb (urb, GFP_ATOMIC); | 598 | res = usb_submit_urb (urb, GFP_ATOMIC); |
595 | if (status == -ENODEV) | 599 | if (res == -ENODEV) |
596 | netif_device_detach(dev->netdev); | 600 | netif_device_detach(dev->netdev); |
597 | else if (status) | 601 | else if (res) |
598 | err ("can't resubmit intr, %s-%s/input0, status %d", | 602 | err ("can't resubmit intr, %s-%s/input0, status %d", |
599 | dev->udev->bus->bus_name, | 603 | dev->udev->bus->bus_name, |
600 | dev->udev->devpath, status); | 604 | dev->udev->devpath, res); |
601 | } | 605 | } |
602 | 606 | ||
603 | static int rtl8150_suspend(struct usb_interface *intf, pm_message_t message) | 607 | static int rtl8150_suspend(struct usb_interface *intf, pm_message_t message) |
diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c index fed22ffedd57..5574abe29c73 100644 --- a/drivers/net/usb/smsc95xx.c +++ b/drivers/net/usb/smsc95xx.c | |||
@@ -311,9 +311,10 @@ static void smsc95xx_async_cmd_callback(struct urb *urb, struct pt_regs *regs) | |||
311 | { | 311 | { |
312 | struct usb_context *usb_context = urb->context; | 312 | struct usb_context *usb_context = urb->context; |
313 | struct usbnet *dev = usb_context->dev; | 313 | struct usbnet *dev = usb_context->dev; |
314 | int status = urb->status; | ||
314 | 315 | ||
315 | if (urb->status < 0) | 316 | if (status < 0) |
316 | devwarn(dev, "async callback failed with %d", urb->status); | 317 | devwarn(dev, "async callback failed with %d", status); |
317 | 318 | ||
318 | complete(&usb_context->notify); | 319 | complete(&usb_context->notify); |
319 | 320 | ||