smsc95xx: fix transmission where ZLP is expected
Usbnet framework assumes USB hardware doesn't handle zero length packets, but SMSC LAN95xx requires these to be sent for correct operation. This patch fixes an easily reproducible tx lockup when sending a frame that results in exactly 512 bytes in a USB transmission (e.g. a UDP frame with 458 data bytes, due to IP headers and our USB headers). It adds an extra flag to usbnet for the hardware driver to indicate that it can handle and requires the zero length packets. This patch should not affect other usbnet users, please also consider for -stable. Signed-off-by: Steve Glendinning <steve.glendinning@smsc.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
36989b9087
commit
ec47562382
@ -1049,7 +1049,7 @@ netdev_tx_t usbnet_start_xmit (struct sk_buff *skb,
|
||||
* NOTE: strictly conforming cdc-ether devices should expect
|
||||
* the ZLP here, but ignore the one-byte packet.
|
||||
*/
|
||||
if ((length % dev->maxpacket) == 0) {
|
||||
if (!(info->flags & FLAG_SEND_ZLP) && (length % dev->maxpacket) == 0) {
|
||||
urb->transfer_buffer_length++;
|
||||
if (skb_tailroom(skb)) {
|
||||
skb->data[skb->len] = 0;
|
||||
|
Reference in New Issue
Block a user