aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/u_ether.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2010-12-16 13:05:06 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2010-12-16 13:05:06 -0500
commit36facadd9ea98f8415d0dbb63e0763b7ee9d3911 (patch)
tree99dea00b332ed852f2b0a4923b581dd723f03634 /drivers/usb/gadget/u_ether.c
parent2faa83e2a519abea1055d156ce1b42b8fa57e87b (diff)
parent0b83ae960cd7d4a5ee02786ecf41ab45688999bf (diff)
Merge branch 'usb-next' into musb-merge
* usb-next: (132 commits) USB: uas: Use GFP_NOIO instead of GFP_KERNEL in I/O submission path USB: uas: Ensure we only bind to a UAS interface USB: uas: Rename sense pipe and sense urb to status pipe and status urb USB: uas: Use kzalloc instead of kmalloc USB: uas: Fix up the Sense IU usb: musb: core: kill unneeded #include's DA8xx: assign name to MUSB IRQ resource usb: gadget: g_ncm added usb: gadget: f_ncm.c added usb: gadget: u_ether: prepare for NCM usb: pch_udc: Fix setup transfers with data out usb: pch_udc: Fix compile error, warnings and checkpatch warnings usb: add ab8500 usb transceiver driver USB: gadget: Implement runtime PM for MSM bus glue driver USB: gadget: Implement runtime PM for ci13xxx gadget USB: gadget: Add USB controller driver for MSM SoC USB: gadget: Introduce ci13xxx_udc_driver struct USB: gadget: Initialize ci13xxx gadget device's coherent DMA mask USB: gadget: Fix "scheduling while atomic" bugs in ci13xxx_udc USB: gadget: Separate out PCI bus code from ci13xxx_udc ...
Diffstat (limited to 'drivers/usb/gadget/u_ether.c')
-rw-r--r--drivers/usb/gadget/u_ether.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/drivers/usb/gadget/u_ether.c b/drivers/usb/gadget/u_ether.c
index fbe86ca95802..e3454fe46b47 100644
--- a/drivers/usb/gadget/u_ether.c
+++ b/drivers/usb/gadget/u_ether.c
@@ -240,6 +240,9 @@ rx_submit(struct eth_dev *dev, struct usb_request *req, gfp_t gfp_flags)
240 size += out->maxpacket - 1; 240 size += out->maxpacket - 1;
241 size -= size % out->maxpacket; 241 size -= size % out->maxpacket;
242 242
243 if (dev->port_usb->is_fixed)
244 size = max(size, dev->port_usb->fixed_out_len);
245
243 skb = alloc_skb(size + NET_IP_ALIGN, gfp_flags); 246 skb = alloc_skb(size + NET_IP_ALIGN, gfp_flags);
244 if (skb == NULL) { 247 if (skb == NULL) {
245 DBG(dev, "no rx skb\n"); 248 DBG(dev, "no rx skb\n");
@@ -578,12 +581,19 @@ static netdev_tx_t eth_start_xmit(struct sk_buff *skb,
578 req->context = skb; 581 req->context = skb;
579 req->complete = tx_complete; 582 req->complete = tx_complete;
580 583
584 /* NCM requires no zlp if transfer is dwNtbInMaxSize */
585 if (dev->port_usb->is_fixed &&
586 length == dev->port_usb->fixed_in_len &&
587 (length % in->maxpacket) == 0)
588 req->zero = 0;
589 else
590 req->zero = 1;
591
581 /* use zlp framing on tx for strict CDC-Ether conformance, 592 /* use zlp framing on tx for strict CDC-Ether conformance,
582 * though any robust network rx path ignores extra padding. 593 * though any robust network rx path ignores extra padding.
583 * and some hardware doesn't like to write zlps. 594 * and some hardware doesn't like to write zlps.
584 */ 595 */
585 req->zero = 1; 596 if (req->zero && !dev->zlp && (length % in->maxpacket) == 0)
586 if (!dev->zlp && (length % in->maxpacket) == 0)
587 length++; 597 length++;
588 598
589 req->length = length; 599 req->length = length;