ChangeSet 1.1318, 2003/05/29 22:44:25-07:00, david-b@pacbell.net [PATCH] USB: ethernet "gadget", rx overflows happen I tightened up rx overflow logic in the net2280 driver a while back, and it broke MTU size packets in this driver (host pads them out). This patch accomodates it by allocating a slightly larger buffer (almost 3*512). drivers/usb/gadget/ether.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletion(-) diff -Nru a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c --- a/drivers/usb/gadget/ether.c Fri May 30 11:35:07 2003 +++ b/drivers/usb/gadget/ether.c Fri May 30 11:35:07 2003 @@ -76,6 +76,7 @@ #define MIN_PACKET sizeof(struct ethhdr) #define MAX_PACKET ETH_DATA_LEN /* biggest packet we'll rx/tx */ +#define RX_EXTRA 20 /* guard against rx overflows */ /* FIXME allow high speed jumbograms */ @@ -1226,7 +1227,7 @@ int retval = 0; size_t size; - size = (sizeof (struct ethhdr) + dev->net.mtu); + size = (sizeof (struct ethhdr) + dev->net.mtu + RX_EXTRA); if ((skb = alloc_skb (size, gfp_flags)) == 0) { DEBUG (dev, "no rx skb\n");