diff options
Diffstat (limited to 'drivers/usb/gadget/net2280.c')
-rw-r--r-- | drivers/usb/gadget/net2280.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/usb/gadget/net2280.c b/drivers/usb/gadget/net2280.c index 3acc896a5d4c..3024c679e38e 100644 --- a/drivers/usb/gadget/net2280.c +++ b/drivers/usb/gadget/net2280.c | |||
@@ -1040,6 +1040,7 @@ net2280_queue (struct usb_ep *_ep, struct usb_request *_req, gfp_t gfp_flags) | |||
1040 | 1040 | ||
1041 | } /* else the irq handler advances the queue. */ | 1041 | } /* else the irq handler advances the queue. */ |
1042 | 1042 | ||
1043 | ep->responded = 1; | ||
1043 | if (req) | 1044 | if (req) |
1044 | list_add_tail (&req->queue, &ep->queue); | 1045 | list_add_tail (&req->queue, &ep->queue); |
1045 | done: | 1046 | done: |
@@ -2188,7 +2189,8 @@ static void handle_ep_small (struct net2280_ep *ep) | |||
2188 | ep->stopped = 1; | 2189 | ep->stopped = 1; |
2189 | set_halt (ep); | 2190 | set_halt (ep); |
2190 | mode = 2; | 2191 | mode = 2; |
2191 | } else if (!req && !ep->stopped) | 2192 | } else if (ep->responded && |
2193 | !req && !ep->stopped) | ||
2192 | write_fifo (ep, NULL); | 2194 | write_fifo (ep, NULL); |
2193 | } | 2195 | } |
2194 | } else { | 2196 | } else { |
@@ -2203,7 +2205,7 @@ static void handle_ep_small (struct net2280_ep *ep) | |||
2203 | } else if (((t & (1 << DATA_OUT_PING_TOKEN_INTERRUPT)) | 2205 | } else if (((t & (1 << DATA_OUT_PING_TOKEN_INTERRUPT)) |
2204 | && req | 2206 | && req |
2205 | && req->req.actual == req->req.length) | 2207 | && req->req.actual == req->req.length) |
2206 | || !req) { | 2208 | || (ep->responded && !req)) { |
2207 | ep->dev->protocol_stall = 1; | 2209 | ep->dev->protocol_stall = 1; |
2208 | set_halt (ep); | 2210 | set_halt (ep); |
2209 | ep->stopped = 1; | 2211 | ep->stopped = 1; |
@@ -2469,6 +2471,7 @@ static void handle_stat0_irqs (struct net2280 *dev, u32 stat) | |||
2469 | /* we made the hardware handle most lowlevel requests; | 2471 | /* we made the hardware handle most lowlevel requests; |
2470 | * everything else goes uplevel to the gadget code. | 2472 | * everything else goes uplevel to the gadget code. |
2471 | */ | 2473 | */ |
2474 | ep->responded = 1; | ||
2472 | switch (u.r.bRequest) { | 2475 | switch (u.r.bRequest) { |
2473 | case USB_REQ_GET_STATUS: { | 2476 | case USB_REQ_GET_STATUS: { |
2474 | struct net2280_ep *e; | 2477 | struct net2280_ep *e; |
@@ -2537,6 +2540,7 @@ delegate: | |||
2537 | u.r.bRequestType, u.r.bRequest, | 2540 | u.r.bRequestType, u.r.bRequest, |
2538 | w_value, w_index, w_length, | 2541 | w_value, w_index, w_length, |
2539 | readl (&ep->regs->ep_cfg)); | 2542 | readl (&ep->regs->ep_cfg)); |
2543 | ep->responded = 0; | ||
2540 | spin_unlock (&dev->lock); | 2544 | spin_unlock (&dev->lock); |
2541 | tmp = dev->driver->setup (&dev->gadget, &u.r); | 2545 | tmp = dev->driver->setup (&dev->gadget, &u.r); |
2542 | spin_lock (&dev->lock); | 2546 | spin_lock (&dev->lock); |
@@ -2857,7 +2861,7 @@ static int net2280_probe (struct pci_dev *pdev, const struct pci_device_id *id) | |||
2857 | } | 2861 | } |
2858 | 2862 | ||
2859 | /* alloc, and start init */ | 2863 | /* alloc, and start init */ |
2860 | dev = kzalloc (sizeof *dev, SLAB_KERNEL); | 2864 | dev = kzalloc (sizeof *dev, GFP_KERNEL); |
2861 | if (dev == NULL){ | 2865 | if (dev == NULL){ |
2862 | retval = -ENOMEM; | 2866 | retval = -ENOMEM; |
2863 | goto done; | 2867 | goto done; |