aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/usb/catc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/usb/catc.c')
-rw-r--r--drivers/net/usb/catc.c41
1 files changed, 22 insertions, 19 deletions
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 }
344resubmit: 346resubmit:
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