Lines Matching +full:rx +full:- +full:inactive
1 // SPDX-License-Identifier: GPL-2.0+
3 * u_ether.c -- Ethernet-over-USB link layer utilities for Gadget stack
5 * Copyright (C) 2003-2005,2008 David Brownell
6 * Copyright (C) 2003-2004 Robert Schwebel, Benedikt Spranger
48 #define UETH__VERSION "29-May-2008"
65 spinlock_t req_lock; /* guard {rx,tx}_reqs */
91 /*-------------------------------------------------------------------------*/
93 #define RX_EXTRA 20 /* bytes guarding against rx overflows */
100 if (gadget->speed == USB_SPEED_HIGH || gadget->speed >= USB_SPEED_SUPER) in qlen()
106 /*-------------------------------------------------------------------------*/
114 strscpy(p->driver, "g_ether", sizeof(p->driver)); in eth_get_drvinfo()
115 strscpy(p->version, UETH__VERSION, sizeof(p->version)); in eth_get_drvinfo()
116 if (dev->gadget) { in eth_get_drvinfo()
117 strscpy(p->fw_version, dev->gadget->name, sizeof(p->fw_version)); in eth_get_drvinfo()
118 strscpy(p->bus_info, dev_name(&dev->gadget->dev), sizeof(p->bus_info)); in eth_get_drvinfo()
123 * - WOL (by tracking suspends and issuing remote wakeup)
124 * - msglevel (implies updated messaging)
125 * - ... probably more ethtool ops
135 if (test_and_set_bit(flag, &dev->todo)) in defer_kevent()
137 if (!schedule_work(&dev->work)) in defer_kevent()
148 struct usb_gadget *g = dev->gadget; in rx_submit()
150 int retval = -ENOMEM; in rx_submit()
155 spin_lock_irqsave(&dev->lock, flags); in rx_submit()
156 if (dev->port_usb) in rx_submit()
157 out = dev->port_usb->out_ep; in rx_submit()
163 spin_unlock_irqrestore(&dev->lock, flags); in rx_submit()
164 return -ENOTCONN; in rx_submit()
175 * pad to end-of-packet. That's potentially nice for speed, but in rx_submit()
177 * new packets don't only start after a short RX). in rx_submit()
179 size += sizeof(struct ethhdr) + dev->net->mtu + RX_EXTRA; in rx_submit()
180 size += dev->port_usb->header_len; in rx_submit()
182 if (g->quirk_ep_out_aligned_size) { in rx_submit()
183 size += out->maxpacket - 1; in rx_submit()
184 size -= size % out->maxpacket; in rx_submit()
187 if (dev->port_usb->is_fixed) in rx_submit()
188 size = max_t(size_t, size, dev->port_usb->fixed_out_len); in rx_submit()
189 spin_unlock_irqrestore(&dev->lock, flags); in rx_submit()
191 skb = __netdev_alloc_skb(dev->net, size + NET_IP_ALIGN, gfp_flags); in rx_submit()
193 DBG(dev, "no rx skb\n"); in rx_submit()
201 if (likely(!dev->no_skb_reserve)) in rx_submit()
204 req->buf = skb->data; in rx_submit()
205 req->length = size; in rx_submit()
206 req->complete = rx_complete; in rx_submit()
207 req->context = skb; in rx_submit()
210 if (retval == -ENOMEM) in rx_submit()
214 DBG(dev, "rx submit --> %d\n", retval); in rx_submit()
217 spin_lock_irqsave(&dev->req_lock, flags); in rx_submit()
218 list_add(&req->list, &dev->rx_reqs); in rx_submit()
219 spin_unlock_irqrestore(&dev->req_lock, flags); in rx_submit()
226 struct sk_buff *skb = req->context, *skb2; in rx_complete()
227 struct eth_dev *dev = ep->driver_data; in rx_complete()
228 int status = req->status; in rx_complete()
234 skb_put(skb, req->actual); in rx_complete()
236 if (dev->unwrap) { in rx_complete()
239 spin_lock_irqsave(&dev->lock, flags); in rx_complete()
240 if (dev->port_usb) { in rx_complete()
241 status = dev->unwrap(dev->port_usb, in rx_complete()
243 &dev->rx_frames); in rx_complete()
246 status = -ENOTCONN; in rx_complete()
248 spin_unlock_irqrestore(&dev->lock, flags); in rx_complete()
250 skb_queue_tail(&dev->rx_frames, skb); in rx_complete()
254 skb2 = skb_dequeue(&dev->rx_frames); in rx_complete()
257 || ETH_HLEN > skb2->len in rx_complete()
258 || skb2->len > GETHER_MAX_ETH_FRAME_LEN) { in rx_complete()
259 dev->net->stats.rx_errors++; in rx_complete()
260 dev->net->stats.rx_length_errors++; in rx_complete()
261 DBG(dev, "rx length %d\n", skb2->len); in rx_complete()
265 skb2->protocol = eth_type_trans(skb2, dev->net); in rx_complete()
266 dev->net->stats.rx_packets++; in rx_complete()
267 dev->net->stats.rx_bytes += skb2->len; in rx_complete()
274 skb2 = skb_dequeue(&dev->rx_frames); in rx_complete()
278 /* software-driven interface shutdown */ in rx_complete()
279 case -ECONNRESET: /* unlink */ in rx_complete()
280 case -ESHUTDOWN: /* disconnect etc */ in rx_complete()
281 VDBG(dev, "rx shutdown, code %d\n", status); in rx_complete()
285 case -ECONNABORTED: /* endpoint reset */ in rx_complete()
286 DBG(dev, "rx %s reset\n", ep->name); in rx_complete()
293 case -EOVERFLOW: in rx_complete()
294 dev->net->stats.rx_over_errors++; in rx_complete()
298 dev->net->stats.rx_errors++; in rx_complete()
299 DBG(dev, "rx status %d\n", status); in rx_complete()
305 if (!netif_running(dev->net)) { in rx_complete()
307 spin_lock(&dev->req_lock); in rx_complete()
308 list_add(&req->list, &dev->rx_reqs); in rx_complete()
309 spin_unlock(&dev->req_lock); in rx_complete()
322 return -ENOMEM; in prealloc()
327 if (i-- == 0) in prealloc()
330 while (i--) { in prealloc()
333 return list_empty(list) ? -ENOMEM : 0; in prealloc()
334 list_add(&req->list, list); in prealloc()
343 next = req->list.next; in prealloc()
344 list_del(&req->list); in prealloc()
359 spin_lock(&dev->req_lock); in alloc_requests()
360 status = prealloc(&dev->tx_reqs, link->in_ep, n); in alloc_requests()
363 status = prealloc(&dev->rx_reqs, link->out_ep, n); in alloc_requests()
370 spin_unlock(&dev->req_lock); in alloc_requests()
380 spin_lock_irqsave(&dev->req_lock, flags); in rx_fill()
381 while (!list_empty(&dev->rx_reqs)) { in rx_fill()
382 req = list_first_entry(&dev->rx_reqs, struct usb_request, list); in rx_fill()
383 list_del_init(&req->list); in rx_fill()
384 spin_unlock_irqrestore(&dev->req_lock, flags); in rx_fill()
391 spin_lock_irqsave(&dev->req_lock, flags); in rx_fill()
393 spin_unlock_irqrestore(&dev->req_lock, flags); in rx_fill()
400 if (test_and_clear_bit(WORK_RX_MEMORY, &dev->todo)) { in eth_work()
401 if (netif_running(dev->net)) in eth_work()
405 if (dev->todo) in eth_work()
406 DBG(dev, "work done, flags = 0x%lx\n", dev->todo); in eth_work()
411 struct sk_buff *skb = req->context; in tx_complete()
412 struct eth_dev *dev = ep->driver_data; in tx_complete()
414 switch (req->status) { in tx_complete()
416 dev->net->stats.tx_errors++; in tx_complete()
417 VDBG(dev, "tx err %d\n", req->status); in tx_complete()
419 case -ECONNRESET: /* unlink */ in tx_complete()
420 case -ESHUTDOWN: /* disconnect etc */ in tx_complete()
424 dev->net->stats.tx_bytes += skb->len; in tx_complete()
427 dev->net->stats.tx_packets++; in tx_complete()
429 spin_lock(&dev->req_lock); in tx_complete()
430 list_add(&req->list, &dev->tx_reqs); in tx_complete()
431 spin_unlock(&dev->req_lock); in tx_complete()
433 atomic_dec(&dev->tx_qlen); in tx_complete()
434 if (netif_carrier_ok(dev->net)) in tx_complete()
435 netif_wake_queue(dev->net); in tx_complete()
446 struct usb_function *func = &port->func; in ether_wakeup_host()
447 struct usb_gadget *gadget = func->config->cdev->gadget; in ether_wakeup_host()
449 if (func->func_suspended) in ether_wakeup_host()
468 spin_lock_irqsave(&dev->lock, flags); in eth_start_xmit()
469 if (dev->port_usb) { in eth_start_xmit()
470 in = dev->port_usb->in_ep; in eth_start_xmit()
471 cdc_filter = dev->port_usb->cdc_filter; in eth_start_xmit()
477 if (dev->port_usb && dev->port_usb->is_suspend) { in eth_start_xmit()
480 spin_unlock_irqrestore(&dev->lock, flags); in eth_start_xmit()
481 ether_wakeup_host(dev->port_usb); in eth_start_xmit()
485 spin_unlock_irqrestore(&dev->lock, flags); in eth_start_xmit()
495 u8 *dest = skb->data; in eth_start_xmit()
515 spin_lock_irqsave(&dev->req_lock, flags); in eth_start_xmit()
521 if (list_empty(&dev->tx_reqs)) { in eth_start_xmit()
522 spin_unlock_irqrestore(&dev->req_lock, flags); in eth_start_xmit()
526 req = list_first_entry(&dev->tx_reqs, struct usb_request, list); in eth_start_xmit()
527 list_del(&req->list); in eth_start_xmit()
530 if (list_empty(&dev->tx_reqs)) in eth_start_xmit()
532 spin_unlock_irqrestore(&dev->req_lock, flags); in eth_start_xmit()
538 if (dev->wrap) { in eth_start_xmit()
541 spin_lock_irqsave(&dev->lock, flags); in eth_start_xmit()
542 if (dev->port_usb) in eth_start_xmit()
543 skb = dev->wrap(dev->port_usb, skb); in eth_start_xmit()
544 spin_unlock_irqrestore(&dev->lock, flags); in eth_start_xmit()
549 if (dev->port_usb && in eth_start_xmit()
550 dev->port_usb->supports_multi_frame) in eth_start_xmit()
556 length = skb->len; in eth_start_xmit()
557 req->buf = skb->data; in eth_start_xmit()
558 req->context = skb; in eth_start_xmit()
559 req->complete = tx_complete; in eth_start_xmit()
562 if (dev->port_usb && in eth_start_xmit()
563 dev->port_usb->is_fixed && in eth_start_xmit()
564 length == dev->port_usb->fixed_in_len && in eth_start_xmit()
565 (length % in->maxpacket) == 0) in eth_start_xmit()
566 req->zero = 0; in eth_start_xmit()
568 req->zero = 1; in eth_start_xmit()
570 /* use zlp framing on tx for strict CDC-Ether conformance, in eth_start_xmit()
571 * though any robust network rx path ignores extra padding. in eth_start_xmit()
574 if (req->zero && !dev->zlp && (length % in->maxpacket) == 0) in eth_start_xmit()
577 req->length = length; in eth_start_xmit()
586 atomic_inc(&dev->tx_qlen); in eth_start_xmit()
592 dev->net->stats.tx_dropped++; in eth_start_xmit()
594 spin_lock_irqsave(&dev->req_lock, flags); in eth_start_xmit()
595 if (list_empty(&dev->tx_reqs)) in eth_start_xmit()
597 list_add(&req->list, &dev->tx_reqs); in eth_start_xmit()
598 spin_unlock_irqrestore(&dev->req_lock, flags); in eth_start_xmit()
603 /*-------------------------------------------------------------------------*/
609 /* fill the rx queue */ in eth_start()
613 atomic_set(&dev->tx_qlen, 0); in eth_start()
614 netif_wake_queue(dev->net); in eth_start()
623 if (netif_carrier_ok(dev->net)) in eth_open()
626 spin_lock_irq(&dev->lock); in eth_open()
627 link = dev->port_usb; in eth_open()
628 if (link && link->open) in eth_open()
629 link->open(link); in eth_open()
630 spin_unlock_irq(&dev->lock); in eth_open()
643 DBG(dev, "stop stats: rx/tx %ld/%ld, errs %ld/%ld\n", in eth_stop()
644 dev->net->stats.rx_packets, dev->net->stats.tx_packets, in eth_stop()
645 dev->net->stats.rx_errors, dev->net->stats.tx_errors in eth_stop()
649 spin_lock_irqsave(&dev->lock, flags); in eth_stop()
650 if (dev->port_usb) { in eth_stop()
651 struct gether *link = dev->port_usb; in eth_stop()
655 if (link->close) in eth_stop()
656 link->close(link); in eth_stop()
658 /* NOTE: we have no abort-queue primitive we could use in eth_stop()
661 * wrong, but that's a self-correcting error. in eth_stop()
667 in = link->in_ep->desc; in eth_stop()
668 out = link->out_ep->desc; in eth_stop()
669 usb_ep_disable(link->in_ep); in eth_stop()
670 usb_ep_disable(link->out_ep); in eth_stop()
673 link->in_ep->desc = in; in eth_stop()
674 link->out_ep->desc = out; in eth_stop()
675 usb_ep_enable(link->in_ep); in eth_stop()
676 usb_ep_enable(link->out_ep); in eth_stop()
679 spin_unlock_irqrestore(&dev->lock, flags); in eth_stop()
684 /*-------------------------------------------------------------------------*/
710 return -EINVAL; in get_ether_addr_str()
729 * gether_setup_name - initialize one ethernet-over-usb link
753 return ERR_PTR(-ENOMEM); in gether_setup_name()
756 spin_lock_init(&dev->lock); in gether_setup_name()
757 spin_lock_init(&dev->req_lock); in gether_setup_name()
758 INIT_WORK(&dev->work, eth_work); in gether_setup_name()
759 INIT_LIST_HEAD(&dev->tx_reqs); in gether_setup_name()
760 INIT_LIST_HEAD(&dev->rx_reqs); in gether_setup_name()
762 skb_queue_head_init(&dev->rx_frames); in gether_setup_name()
765 dev->net = net; in gether_setup_name()
766 dev->qmult = qmult; in gether_setup_name()
767 snprintf(net->name, sizeof(net->name), "%s%%d", netname); in gether_setup_name()
770 net->addr_assign_type = NET_ADDR_RANDOM; in gether_setup_name()
771 dev_warn(&g->dev, in gether_setup_name()
774 net->addr_assign_type = NET_ADDR_SET; in gether_setup_name()
777 if (get_ether_addr(host_addr, dev->host_mac)) in gether_setup_name()
778 dev_warn(&g->dev, in gether_setup_name()
782 memcpy(ethaddr, dev->host_mac, ETH_ALEN); in gether_setup_name()
784 net->netdev_ops = ð_netdev_ops; in gether_setup_name()
786 net->ethtool_ops = &ops; in gether_setup_name()
788 /* MTU range: 14 - 15412 */ in gether_setup_name()
789 net->min_mtu = ETH_HLEN; in gether_setup_name()
790 net->max_mtu = GETHER_MAX_MTU_SIZE; in gether_setup_name()
792 dev->gadget = g; in gether_setup_name()
793 SET_NETDEV_DEV(net, &g->dev); in gether_setup_name()
798 dev_dbg(&g->dev, "register_netdev failed, %d\n", status); in gether_setup_name()
802 INFO(dev, "MAC %pM\n", net->dev_addr); in gether_setup_name()
803 INFO(dev, "HOST MAC %pM\n", dev->host_mac); in gether_setup_name()
806 * two kinds of host-initiated state changes: in gether_setup_name()
807 * - iff DATA transfer is active, carrier is "on" in gether_setup_name()
808 * - tx queueing enabled if open *and* carrier is "on" in gether_setup_name()
824 return ERR_PTR(-ENOMEM); in gether_setup_name_default()
827 spin_lock_init(&dev->lock); in gether_setup_name_default()
828 spin_lock_init(&dev->req_lock); in gether_setup_name_default()
829 INIT_WORK(&dev->work, eth_work); in gether_setup_name_default()
830 INIT_LIST_HEAD(&dev->tx_reqs); in gether_setup_name_default()
831 INIT_LIST_HEAD(&dev->rx_reqs); in gether_setup_name_default()
833 skb_queue_head_init(&dev->rx_frames); in gether_setup_name_default()
836 dev->net = net; in gether_setup_name_default()
837 dev->qmult = QMULT_DEFAULT; in gether_setup_name_default()
838 snprintf(net->name, sizeof(net->name), "%s%%d", netname); in gether_setup_name_default()
840 eth_random_addr(dev->dev_mac); in gether_setup_name_default()
843 net->addr_assign_type = NET_ADDR_RANDOM; in gether_setup_name_default()
845 eth_random_addr(dev->host_mac); in gether_setup_name_default()
847 net->netdev_ops = ð_netdev_ops; in gether_setup_name_default()
849 net->ethtool_ops = &ops; in gether_setup_name_default()
852 /* MTU range: 14 - 15412 */ in gether_setup_name_default()
853 net->min_mtu = ETH_HLEN; in gether_setup_name_default()
854 net->max_mtu = GETHER_MAX_MTU_SIZE; in gether_setup_name_default()
866 if (!net->dev.parent) in gether_register_netdev()
867 return -EINVAL; in gether_register_netdev()
869 g = dev->gadget; in gether_register_netdev()
871 eth_hw_addr_set(net, dev->dev_mac); in gether_register_netdev()
875 dev_dbg(&g->dev, "register_netdev failed, %d\n", status); in gether_register_netdev()
878 INFO(dev, "HOST MAC %pM\n", dev->host_mac); in gether_register_netdev()
879 INFO(dev, "MAC %pM\n", dev->dev_mac); in gether_register_netdev()
881 /* two kinds of host-initiated state changes: in gether_register_netdev()
882 * - iff DATA transfer is active, carrier is "on" in gether_register_netdev()
883 * - tx queueing enabled if open *and* carrier is "on" in gether_register_netdev()
897 dev->gadget = g; in gether_set_gadget()
898 SET_NETDEV_DEV(net, &g->dev); in gether_set_gadget()
906 ret = device_move(&net->dev, &g->dev, DPM_ORDER_DEV_AFTER_PARENT); in gether_attach_gadget()
919 device_move(&net->dev, NULL, DPM_ORDER_NONE); in gether_detach_gadget()
920 dev->gadget = NULL; in gether_detach_gadget()
931 return -EINVAL; in gether_set_dev_addr()
932 memcpy(dev->dev_mac, new_addr, ETH_ALEN); in gether_set_dev_addr()
933 net->addr_assign_type = NET_ADDR_SET; in gether_set_dev_addr()
944 ret = get_ether_addr_str(dev->dev_mac, dev_addr, len); in gether_get_dev_addr()
961 return -EINVAL; in gether_set_host_addr()
962 memcpy(dev->host_mac, new_addr, ETH_ALEN); in gether_set_host_addr()
973 ret = get_ether_addr_str(dev->host_mac, host_addr, len); in gether_get_host_addr()
988 return -EINVAL; in gether_get_host_addr_cdc()
991 snprintf(host_addr, len, "%pm", dev->host_mac); in gether_get_host_addr_cdc()
1004 memcpy(host_mac, dev->host_mac, ETH_ALEN); in gether_get_host_addr_u8()
1013 dev->qmult = qmult; in gether_set_qmult()
1022 return dev->qmult; in gether_get_qmult()
1033 dev->ifname_set ? net->name : netdev_name(net)); in gether_get_ifname()
1045 if (name[len - 1] == '\n') in gether_set_ifname()
1046 len--; in gether_set_ifname()
1049 return -E2BIG; in gether_set_ifname()
1053 return -EINVAL; in gether_set_ifname()
1058 return -EINVAL; in gether_set_ifname()
1060 strscpy(net->name, tmp); in gether_set_ifname()
1061 dev->ifname_set = true; in gether_set_ifname()
1069 struct eth_dev *dev = link->ioport; in gether_suspend()
1075 if (atomic_read(&dev->tx_qlen)) { in gether_suspend()
1080 if (!ether_wakeup_host(dev->port_usb)) in gether_suspend()
1083 spin_lock_irqsave(&dev->lock, flags); in gether_suspend()
1084 link->is_suspend = true; in gether_suspend()
1085 spin_unlock_irqrestore(&dev->lock, flags); in gether_suspend()
1091 struct eth_dev *dev = link->ioport; in gether_resume()
1097 if (netif_queue_stopped(dev->net)) in gether_resume()
1098 netif_start_queue(dev->net); in gether_resume()
1100 spin_lock_irqsave(&dev->lock, flags); in gether_resume()
1101 link->is_suspend = false; in gether_resume()
1102 spin_unlock_irqrestore(&dev->lock, flags); in gether_resume()
1107 * gether_cleanup - remove Ethernet-over-USB device
1117 unregister_netdev(dev->net); in gether_cleanup()
1118 flush_work(&dev->work); in gether_cleanup()
1119 free_netdev(dev->net); in gether_cleanup()
1124 * gether_connect - notify network layer that USB link is active
1136 * indicate some error code (negative errno), ep->driver_data values
1141 struct eth_dev *dev = link->ioport; in gether_connect()
1145 return ERR_PTR(-EINVAL); in gether_connect()
1147 link->in_ep->driver_data = dev; in gether_connect()
1148 result = usb_ep_enable(link->in_ep); in gether_connect()
1150 DBG(dev, "enable %s --> %d\n", in gether_connect()
1151 link->in_ep->name, result); in gether_connect()
1155 link->out_ep->driver_data = dev; in gether_connect()
1156 result = usb_ep_enable(link->out_ep); in gether_connect()
1158 DBG(dev, "enable %s --> %d\n", in gether_connect()
1159 link->out_ep->name, result); in gether_connect()
1164 result = alloc_requests(dev, link, qlen(dev->gadget, in gether_connect()
1165 dev->qmult)); in gether_connect()
1168 dev->zlp = link->is_zlp_ok; in gether_connect()
1169 dev->no_skb_reserve = gadget_avoids_skb_reserve(dev->gadget); in gether_connect()
1170 DBG(dev, "qlen %d\n", qlen(dev->gadget, dev->qmult)); in gether_connect()
1172 dev->header_len = link->header_len; in gether_connect()
1173 dev->unwrap = link->unwrap; in gether_connect()
1174 dev->wrap = link->wrap; in gether_connect()
1176 spin_lock(&dev->lock); in gether_connect()
1177 dev->port_usb = link; in gether_connect()
1178 if (netif_running(dev->net)) { in gether_connect()
1179 if (link->open) in gether_connect()
1180 link->open(link); in gether_connect()
1182 if (link->close) in gether_connect()
1183 link->close(link); in gether_connect()
1185 spin_unlock(&dev->lock); in gether_connect()
1187 netif_carrier_on(dev->net); in gether_connect()
1188 if (netif_running(dev->net)) in gether_connect()
1193 (void) usb_ep_disable(link->out_ep); in gether_connect()
1195 (void) usb_ep_disable(link->in_ep); in gether_connect()
1201 return dev->net; in gether_connect()
1206 * gether_disconnect - notify network layer that USB link is inactive
1211 * the connection went inactive ("no carrier").
1214 * The endpoints are inactive, and accordingly without active USB I/O.
1219 struct eth_dev *dev = link->ioport; in gether_disconnect()
1228 spin_lock(&dev->lock); in gether_disconnect()
1229 dev->port_usb = NULL; in gether_disconnect()
1230 link->is_suspend = false; in gether_disconnect()
1231 spin_unlock(&dev->lock); in gether_disconnect()
1233 netif_stop_queue(dev->net); in gether_disconnect()
1234 netif_carrier_off(dev->net); in gether_disconnect()
1240 usb_ep_disable(link->in_ep); in gether_disconnect()
1241 spin_lock(&dev->req_lock); in gether_disconnect()
1242 while (!list_empty(&dev->tx_reqs)) { in gether_disconnect()
1243 req = list_first_entry(&dev->tx_reqs, struct usb_request, list); in gether_disconnect()
1244 list_del(&req->list); in gether_disconnect()
1246 spin_unlock(&dev->req_lock); in gether_disconnect()
1247 usb_ep_free_request(link->in_ep, req); in gether_disconnect()
1248 spin_lock(&dev->req_lock); in gether_disconnect()
1250 spin_unlock(&dev->req_lock); in gether_disconnect()
1251 link->in_ep->desc = NULL; in gether_disconnect()
1253 usb_ep_disable(link->out_ep); in gether_disconnect()
1254 spin_lock(&dev->req_lock); in gether_disconnect()
1255 while (!list_empty(&dev->rx_reqs)) { in gether_disconnect()
1256 req = list_first_entry(&dev->rx_reqs, struct usb_request, list); in gether_disconnect()
1257 list_del(&req->list); in gether_disconnect()
1259 spin_unlock(&dev->req_lock); in gether_disconnect()
1260 usb_ep_free_request(link->out_ep, req); in gether_disconnect()
1261 spin_lock(&dev->req_lock); in gether_disconnect()
1263 spin_unlock(&dev->req_lock); in gether_disconnect()
1264 link->out_ep->desc = NULL; in gether_disconnect()
1267 dev->header_len = 0; in gether_disconnect()
1268 dev->unwrap = NULL; in gether_disconnect()
1269 dev->wrap = NULL; in gether_disconnect()
1273 MODULE_DESCRIPTION("Ethernet-over-USB link layer utilities for Gadget stack");