diff options
author | Florian Schilhabel <florian.c.schilhabel@googlemail.com> | 2010-02-19 14:11:37 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-03-03 19:43:04 -0500 |
commit | 29a1fbc88b822497a0a4d8e9cb7d8a471e70f339 (patch) | |
tree | 05cd1af093c498734caf75d383d502c0bbcc8f37 /drivers/staging | |
parent | 2f22560880786acceb6bc63cbda7125e8d9a2206 (diff) |
Staging: rtl8192su: fix for rtl819xU:Error TX URB for zero byte xxx, error -2
according to 'linux device drivers',
ENOENT, ECONNRESET, ESHUTDOWN are not real transmission errors.
also, a little cosmetics.
Signed-off-by: Florian Schilhabel <florian.c.schilhabel@googlemail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/rtl8192su/r8192U_core.c | 36 |
1 files changed, 21 insertions, 15 deletions
diff --git a/drivers/staging/rtl8192su/r8192U_core.c b/drivers/staging/rtl8192su/r8192U_core.c index 23d1d35be7e..8393bc57bdf 100644 --- a/drivers/staging/rtl8192su/r8192U_core.c +++ b/drivers/staging/rtl8192su/r8192U_core.c | |||
@@ -2340,25 +2340,24 @@ short rtl8192SU_tx(struct net_device *dev, struct sk_buff* skb) | |||
2340 | skb->len, rtl8192_tx_isr, skb); | 2340 | skb->len, rtl8192_tx_isr, skb); |
2341 | 2341 | ||
2342 | status = usb_submit_urb(tx_urb, GFP_ATOMIC); | 2342 | status = usb_submit_urb(tx_urb, GFP_ATOMIC); |
2343 | if (!status){ | 2343 | if (!status) { |
2344 | //we need to send 0 byte packet whenever 512N bytes/64N(HIGN SPEED/NORMAL SPEED) bytes packet has been transmitted. Otherwise, it will be halt to wait for another packet. WB. 2008.08.27 | 2344 | /* |
2345 | * we need to send 0 byte packet whenever 512N bytes/64N(HIGN SPEED/NORMAL SPEED) bytes packet has been transmitted. | ||
2346 | * Otherwise, it will be halt to wait for another packet. WB. 2008.08.27 | ||
2347 | */ | ||
2345 | bool bSend0Byte = false; | 2348 | bool bSend0Byte = false; |
2346 | u8 zero = 0; | 2349 | u8 zero = 0; |
2347 | if(udev->speed == USB_SPEED_HIGH) | 2350 | if(udev->speed == USB_SPEED_HIGH) { |
2348 | { | ||
2349 | if (skb->len > 0 && skb->len % 512 == 0) | 2351 | if (skb->len > 0 && skb->len % 512 == 0) |
2350 | bSend0Byte = true; | 2352 | bSend0Byte = true; |
2351 | } | 2353 | } |
2352 | else | 2354 | else { |
2353 | { | ||
2354 | if (skb->len > 0 && skb->len % 64 == 0) | 2355 | if (skb->len > 0 && skb->len % 64 == 0) |
2355 | bSend0Byte = true; | 2356 | bSend0Byte = true; |
2356 | } | 2357 | } |
2357 | if (bSend0Byte) | 2358 | if (bSend0Byte) { |
2358 | { | ||
2359 | #if 1 | ||
2360 | tx_urb_zero = usb_alloc_urb(0,GFP_ATOMIC); | 2359 | tx_urb_zero = usb_alloc_urb(0,GFP_ATOMIC); |
2361 | if(!tx_urb_zero){ | 2360 | if(!tx_urb_zero) { |
2362 | RT_TRACE(COMP_ERR, "can't alloc urb for zero byte\n"); | 2361 | RT_TRACE(COMP_ERR, "can't alloc urb for zero byte\n"); |
2363 | return -ENOMEM; | 2362 | return -ENOMEM; |
2364 | } | 2363 | } |
@@ -2366,16 +2365,23 @@ short rtl8192SU_tx(struct net_device *dev, struct sk_buff* skb) | |||
2366 | usb_sndbulkpipe(udev,idx_pipe), &zero, | 2365 | usb_sndbulkpipe(udev,idx_pipe), &zero, |
2367 | 0, tx_zero_isr, dev); | 2366 | 0, tx_zero_isr, dev); |
2368 | status = usb_submit_urb(tx_urb_zero, GFP_ATOMIC); | 2367 | status = usb_submit_urb(tx_urb_zero, GFP_ATOMIC); |
2369 | if (status){ | 2368 | switch (status) { |
2370 | RT_TRACE(COMP_ERR, "Error TX URB for zero byte %d, error %d", atomic_read(&priv->tx_pending[tcb_desc->queue_index]), status); | 2369 | case 0: |
2371 | return -1; | 2370 | break; |
2371 | case -ECONNRESET: | ||
2372 | case -ENOENT: | ||
2373 | case -ESHUTDOWN: | ||
2374 | break; | ||
2375 | default: | ||
2376 | RT_TRACE(COMP_ERR, "Error TX URB for zero byte %d, error %d", | ||
2377 | atomic_read(&priv->tx_pending[tcb_desc->queue_index]), status); | ||
2378 | return -1; | ||
2372 | } | 2379 | } |
2373 | #endif | ||
2374 | } | 2380 | } |
2375 | dev->trans_start = jiffies; | 2381 | dev->trans_start = jiffies; |
2376 | atomic_inc(&priv->tx_pending[tcb_desc->queue_index]); | 2382 | atomic_inc(&priv->tx_pending[tcb_desc->queue_index]); |
2377 | return 0; | 2383 | return 0; |
2378 | }else{ | 2384 | } else { |
2379 | RT_TRACE(COMP_ERR, "Error TX URB %d, error %d", atomic_read(&priv->tx_pending[tcb_desc->queue_index]), | 2385 | RT_TRACE(COMP_ERR, "Error TX URB %d, error %d", atomic_read(&priv->tx_pending[tcb_desc->queue_index]), |
2380 | status); | 2386 | status); |
2381 | return -1; | 2387 | return -1; |