Deleted Added
full compact
if_cdce.c (193045) if_cdce.c (194228)
1/* $NetBSD: if_cdce.c,v 1.4 2004/10/24 12:50:54 augustss Exp $ */
2
3/*-
4 * Copyright (c) 1997, 1998, 1999, 2000-2003 Bill Paul <wpaul@windriver.com>
5 * Copyright (c) 2003-2005 Craig Boston
6 * Copyright (c) 2004 Daniel Hartmeier
7 * Copyright (c) 2009 Hans Petter Selasky
8 * All rights reserved.

--- 27 unchanged lines hidden (view full) ---

36 */
37
38/*
39 * USB Communication Device Class (Ethernet Networking Control Model)
40 * http://www.usb.org/developers/devclass_docs/usbcdc11.pdf
41 */
42
43#include <sys/cdefs.h>
1/* $NetBSD: if_cdce.c,v 1.4 2004/10/24 12:50:54 augustss Exp $ */
2
3/*-
4 * Copyright (c) 1997, 1998, 1999, 2000-2003 Bill Paul <wpaul@windriver.com>
5 * Copyright (c) 2003-2005 Craig Boston
6 * Copyright (c) 2004 Daniel Hartmeier
7 * Copyright (c) 2009 Hans Petter Selasky
8 * All rights reserved.

--- 27 unchanged lines hidden (view full) ---

36 */
37
38/*
39 * USB Communication Device Class (Ethernet Networking Control Model)
40 * http://www.usb.org/developers/devclass_docs/usbcdc11.pdf
41 */
42
43#include <sys/cdefs.h>
44__FBSDID("$FreeBSD: head/sys/dev/usb/net/if_cdce.c 193045 2009-05-29 18:46:57Z thompsa $");
44__FBSDID("$FreeBSD: head/sys/dev/usb/net/if_cdce.c 194228 2009-06-15 01:02:43Z thompsa $");
45
46#include "usbdevs.h"
47#include <dev/usb/usb.h>
48#include <dev/usb/usb_mfunc.h>
49#include <dev/usb/usb_error.h>
50#include <dev/usb/usb_cdc.h>
51
52#define USB_DEBUG_VAR cdce_debug

--- 149 unchanged lines hidden (view full) ---

202 {USB_VPI(USB_VENDOR_SHARP, USB_PRODUCT_SHARP_SLC750, CDCE_FLAG_ZAURUS | CDCE_FLAG_NO_UNION)},
203};
204
205static int
206cdce_probe(device_t dev)
207{
208 struct usb_attach_arg *uaa = device_get_ivars(dev);
209
45
46#include "usbdevs.h"
47#include <dev/usb/usb.h>
48#include <dev/usb/usb_mfunc.h>
49#include <dev/usb/usb_error.h>
50#include <dev/usb/usb_cdc.h>
51
52#define USB_DEBUG_VAR cdce_debug

--- 149 unchanged lines hidden (view full) ---

202 {USB_VPI(USB_VENDOR_SHARP, USB_PRODUCT_SHARP_SLC750, CDCE_FLAG_ZAURUS | CDCE_FLAG_NO_UNION)},
203};
204
205static int
206cdce_probe(device_t dev)
207{
208 struct usb_attach_arg *uaa = device_get_ivars(dev);
209
210 return (usb2_lookup_id_by_uaa(cdce_devs, sizeof(cdce_devs), uaa));
210 return (usbd_lookup_id_by_uaa(cdce_devs, sizeof(cdce_devs), uaa));
211}
212
213static void
214cdce_attach_post(struct usb_ether *ue)
215{
216 /* no-op */
217 return;
218}

--- 9 unchanged lines hidden (view full) ---

228 const struct usb_interface_descriptor *id;
229 const struct usb_cdc_ethernet_descriptor *ued;
230 int error;
231 uint8_t i;
232 char eaddr_str[5 * ETHER_ADDR_LEN]; /* approx */
233
234 sc->sc_flags = USB_GET_DRIVER_INFO(uaa);
235
211}
212
213static void
214cdce_attach_post(struct usb_ether *ue)
215{
216 /* no-op */
217 return;
218}

--- 9 unchanged lines hidden (view full) ---

228 const struct usb_interface_descriptor *id;
229 const struct usb_cdc_ethernet_descriptor *ued;
230 int error;
231 uint8_t i;
232 char eaddr_str[5 * ETHER_ADDR_LEN]; /* approx */
233
234 sc->sc_flags = USB_GET_DRIVER_INFO(uaa);
235
236 device_set_usb2_desc(dev);
236 device_set_usb_desc(dev);
237
238 mtx_init(&sc->sc_mtx, device_get_nameunit(dev), NULL, MTX_DEF);
239
240 if (sc->sc_flags & CDCE_FLAG_NO_UNION) {
241 sc->sc_ifaces_index[0] = uaa->info.bIfaceIndex;
242 sc->sc_ifaces_index[1] = uaa->info.bIfaceIndex;
243 sc->sc_data_iface_no = 0; /* not used */
244 goto alloc_transfers;

--- 5 unchanged lines hidden (view full) ---

250 if ((ud == NULL) || (ud->bLength < sizeof(*ud))) {
251 device_printf(dev, "no union descriptor!\n");
252 goto detach;
253 }
254 sc->sc_data_iface_no = ud->bSlaveInterface[0];
255
256 for (i = 0;; i++) {
257
237
238 mtx_init(&sc->sc_mtx, device_get_nameunit(dev), NULL, MTX_DEF);
239
240 if (sc->sc_flags & CDCE_FLAG_NO_UNION) {
241 sc->sc_ifaces_index[0] = uaa->info.bIfaceIndex;
242 sc->sc_ifaces_index[1] = uaa->info.bIfaceIndex;
243 sc->sc_data_iface_no = 0; /* not used */
244 goto alloc_transfers;

--- 5 unchanged lines hidden (view full) ---

250 if ((ud == NULL) || (ud->bLength < sizeof(*ud))) {
251 device_printf(dev, "no union descriptor!\n");
252 goto detach;
253 }
254 sc->sc_data_iface_no = ud->bSlaveInterface[0];
255
256 for (i = 0;; i++) {
257
258 iface = usb2_get_iface(uaa->device, i);
258 iface = usbd_get_iface(uaa->device, i);
259
260 if (iface) {
261
259
260 if (iface) {
261
262 id = usb2_get_interface_descriptor(iface);
262 id = usbd_get_interface_descriptor(iface);
263
264 if (id && (id->bInterfaceNumber ==
265 sc->sc_data_iface_no)) {
266 sc->sc_ifaces_index[0] = i;
267 sc->sc_ifaces_index[1] = uaa->info.bIfaceIndex;
263
264 if (id && (id->bInterfaceNumber ==
265 sc->sc_data_iface_no)) {
266 sc->sc_ifaces_index[0] = i;
267 sc->sc_ifaces_index[1] = uaa->info.bIfaceIndex;
268 usb2_set_parent_iface(uaa->device, i, uaa->info.bIfaceIndex);
268 usbd_set_parent_iface(uaa->device, i, uaa->info.bIfaceIndex);
269 break;
270 }
271 } else {
272 device_printf(dev, "no data interface found!\n");
273 goto detach;
274 }
275 }
276

--- 19 unchanged lines hidden (view full) ---

296 * through the list of all available interface settings
297 * looking for one with both IN and OUT endpoints.
298 */
299
300alloc_transfers:
301
302 for (i = 0; i != 32; i++) {
303
269 break;
270 }
271 } else {
272 device_printf(dev, "no data interface found!\n");
273 goto detach;
274 }
275 }
276

--- 19 unchanged lines hidden (view full) ---

296 * through the list of all available interface settings
297 * looking for one with both IN and OUT endpoints.
298 */
299
300alloc_transfers:
301
302 for (i = 0; i != 32; i++) {
303
304 error = usb2_set_alt_interface_index
304 error = usbd_set_alt_interface_index
305 (uaa->device, sc->sc_ifaces_index[0], i);
306
307 if (error) {
308 device_printf(dev, "no valid alternate "
309 "setting found!\n");
310 goto detach;
311 }
305 (uaa->device, sc->sc_ifaces_index[0], i);
306
307 if (error) {
308 device_printf(dev, "no valid alternate "
309 "setting found!\n");
310 goto detach;
311 }
312 error = usb2_transfer_setup
312 error = usbd_transfer_setup
313 (uaa->device, sc->sc_ifaces_index,
314 sc->sc_xfer, cdce_config, CDCE_N_TRANSFER,
315 sc, &sc->sc_mtx);
316
317 if (error == 0) {
318 break;
319 }
320 }
321
322 ued = usb2_find_descriptor
323 (uaa->device, NULL, uaa->info.bIfaceIndex,
324 UDESC_CS_INTERFACE, 0 - 1, UDESCSUB_CDC_ENF, 0 - 1);
325
326 if ((ued == NULL) || (ued->bLength < sizeof(*ued))) {
327 error = USB_ERR_INVAL;
328 } else {
313 (uaa->device, sc->sc_ifaces_index,
314 sc->sc_xfer, cdce_config, CDCE_N_TRANSFER,
315 sc, &sc->sc_mtx);
316
317 if (error == 0) {
318 break;
319 }
320 }
321
322 ued = usb2_find_descriptor
323 (uaa->device, NULL, uaa->info.bIfaceIndex,
324 UDESC_CS_INTERFACE, 0 - 1, UDESCSUB_CDC_ENF, 0 - 1);
325
326 if ((ued == NULL) || (ued->bLength < sizeof(*ued))) {
327 error = USB_ERR_INVAL;
328 } else {
329 error = usb2_req_get_string_any(uaa->device, NULL,
329 error = usbd_req_get_string_any(uaa->device, NULL,
330 eaddr_str, sizeof(eaddr_str), ued->iMacAddress);
331 }
332
333 if (error) {
334
335 /* fake MAC address */
336
337 device_printf(dev, "faking MAC address\n");

--- 32 unchanged lines hidden (view full) ---

370 }
371
372 ue->ue_sc = sc;
373 ue->ue_dev = dev;
374 ue->ue_udev = uaa->device;
375 ue->ue_mtx = &sc->sc_mtx;
376 ue->ue_methods = &cdce_ue_methods;
377
330 eaddr_str, sizeof(eaddr_str), ued->iMacAddress);
331 }
332
333 if (error) {
334
335 /* fake MAC address */
336
337 device_printf(dev, "faking MAC address\n");

--- 32 unchanged lines hidden (view full) ---

370 }
371
372 ue->ue_sc = sc;
373 ue->ue_dev = dev;
374 ue->ue_udev = uaa->device;
375 ue->ue_mtx = &sc->sc_mtx;
376 ue->ue_methods = &cdce_ue_methods;
377
378 error = usb2_ether_ifattach(ue);
378 error = uether_ifattach(ue);
379 if (error) {
380 device_printf(dev, "could not attach interface\n");
381 goto detach;
382 }
383 return (0); /* success */
384
385detach:
386 cdce_detach(dev);
387 return (ENXIO); /* failure */
388}
389
390static int
391cdce_detach(device_t dev)
392{
393 struct cdce_softc *sc = device_get_softc(dev);
394 struct usb_ether *ue = &sc->sc_ue;
395
396 /* stop all USB transfers first */
379 if (error) {
380 device_printf(dev, "could not attach interface\n");
381 goto detach;
382 }
383 return (0); /* success */
384
385detach:
386 cdce_detach(dev);
387 return (ENXIO); /* failure */
388}
389
390static int
391cdce_detach(device_t dev)
392{
393 struct cdce_softc *sc = device_get_softc(dev);
394 struct usb_ether *ue = &sc->sc_ue;
395
396 /* stop all USB transfers first */
397 usb2_transfer_unsetup(sc->sc_xfer, CDCE_N_TRANSFER);
398 usb2_ether_ifdetach(ue);
397 usbd_transfer_unsetup(sc->sc_xfer, CDCE_N_TRANSFER);
398 uether_ifdetach(ue);
399 mtx_destroy(&sc->sc_mtx);
400
401 return (0);
402}
403
404static void
405cdce_start(struct usb_ether *ue)
406{
399 mtx_destroy(&sc->sc_mtx);
400
401 return (0);
402}
403
404static void
405cdce_start(struct usb_ether *ue)
406{
407 struct cdce_softc *sc = usb2_ether_getsc(ue);
407 struct cdce_softc *sc = uether_getsc(ue);
408
409 /*
410 * Start the USB transfers, if not already started:
411 */
408
409 /*
410 * Start the USB transfers, if not already started:
411 */
412 usb2_transfer_start(sc->sc_xfer[CDCE_BULK_TX]);
413 usb2_transfer_start(sc->sc_xfer[CDCE_BULK_RX]);
412 usbd_transfer_start(sc->sc_xfer[CDCE_BULK_TX]);
413 usbd_transfer_start(sc->sc_xfer[CDCE_BULK_RX]);
414}
415
416static void
417cdce_free_queue(struct mbuf **ppm, uint8_t n)
418{
419 uint8_t x;
420 for (x = 0; x != n; x++) {
421 if (ppm[x] != NULL) {
422 m_freem(ppm[x]);
423 ppm[x] = NULL;
424 }
425 }
426}
427
428static void
429cdce_bulk_write_callback(struct usb_xfer *xfer)
430{
431 struct cdce_softc *sc = xfer->priv_sc;
414}
415
416static void
417cdce_free_queue(struct mbuf **ppm, uint8_t n)
418{
419 uint8_t x;
420 for (x = 0; x != n; x++) {
421 if (ppm[x] != NULL) {
422 m_freem(ppm[x]);
423 ppm[x] = NULL;
424 }
425 }
426}
427
428static void
429cdce_bulk_write_callback(struct usb_xfer *xfer)
430{
431 struct cdce_softc *sc = xfer->priv_sc;
432 struct ifnet *ifp = usb2_ether_getifp(&sc->sc_ue);
432 struct ifnet *ifp = uether_getifp(&sc->sc_ue);
433 struct mbuf *m;
434 struct mbuf *mt;
435 uint32_t crc;
436 uint8_t x;
437
438 DPRINTFN(1, "\n");
439
440 switch (USB_GET_STATE(xfer)) {

--- 41 unchanged lines hidden (view full) ---

482 }
483 m = mt;
484 }
485 if (m->m_pkthdr.len > MCLBYTES) {
486 m->m_pkthdr.len = MCLBYTES;
487 }
488 sc->sc_tx_buf[x] = m;
489 xfer->frlengths[x] = m->m_len;
433 struct mbuf *m;
434 struct mbuf *mt;
435 uint32_t crc;
436 uint8_t x;
437
438 DPRINTFN(1, "\n");
439
440 switch (USB_GET_STATE(xfer)) {

--- 41 unchanged lines hidden (view full) ---

482 }
483 m = mt;
484 }
485 if (m->m_pkthdr.len > MCLBYTES) {
486 m->m_pkthdr.len = MCLBYTES;
487 }
488 sc->sc_tx_buf[x] = m;
489 xfer->frlengths[x] = m->m_len;
490 usb2_set_frame_data(xfer, m->m_data, x);
490 usbd_set_frame_data(xfer, m->m_data, x);
491
492 /*
493 * If there's a BPF listener, bounce a copy of
494 * this frame to him:
495 */
496 BPF_MTAP(ifp, m);
497 }
498 if (x != 0) {
499 xfer->nframes = x;
491
492 /*
493 * If there's a BPF listener, bounce a copy of
494 * this frame to him:
495 */
496 BPF_MTAP(ifp, m);
497 }
498 if (x != 0) {
499 xfer->nframes = x;
500 usb2_start_hardware(xfer);
500 usbd_transfer_submit(xfer);
501 }
502 break;
503
504 default: /* Error */
505 DPRINTFN(11, "transfer error, %s\n",
501 }
502 break;
503
504 default: /* Error */
505 DPRINTFN(11, "transfer error, %s\n",
506 usb2_errstr(xfer->error));
506 usbd_errstr(xfer->error));
507
508 /* free all previous TX buffers */
509 cdce_free_queue(sc->sc_tx_buf, CDCE_FRAMES_MAX);
510
511 /* count output errors */
512 ifp->if_oerrors++;
513
514 if (xfer->error != USB_ERR_CANCELLED) {

--- 22 unchanged lines hidden (view full) ---

537
538 error = m_apply(m, src_offset, src_len, cdce_m_crc32_cb, &crc);
539 return (crc ^ 0xFFFFFFFF);
540}
541
542static void
543cdce_init(struct usb_ether *ue)
544{
507
508 /* free all previous TX buffers */
509 cdce_free_queue(sc->sc_tx_buf, CDCE_FRAMES_MAX);
510
511 /* count output errors */
512 ifp->if_oerrors++;
513
514 if (xfer->error != USB_ERR_CANCELLED) {

--- 22 unchanged lines hidden (view full) ---

537
538 error = m_apply(m, src_offset, src_len, cdce_m_crc32_cb, &crc);
539 return (crc ^ 0xFFFFFFFF);
540}
541
542static void
543cdce_init(struct usb_ether *ue)
544{
545 struct cdce_softc *sc = usb2_ether_getsc(ue);
546 struct ifnet *ifp = usb2_ether_getifp(ue);
545 struct cdce_softc *sc = uether_getsc(ue);
546 struct ifnet *ifp = uether_getifp(ue);
547
548 CDCE_LOCK_ASSERT(sc, MA_OWNED);
549
550 ifp->if_drv_flags |= IFF_DRV_RUNNING;
551
552 /* start interrupt transfer */
547
548 CDCE_LOCK_ASSERT(sc, MA_OWNED);
549
550 ifp->if_drv_flags |= IFF_DRV_RUNNING;
551
552 /* start interrupt transfer */
553 usb2_transfer_start(sc->sc_xfer[CDCE_INTR_RX]);
554 usb2_transfer_start(sc->sc_xfer[CDCE_INTR_TX]);
553 usbd_transfer_start(sc->sc_xfer[CDCE_INTR_RX]);
554 usbd_transfer_start(sc->sc_xfer[CDCE_INTR_TX]);
555
556 /* stall data write direction, which depends on USB mode */
555
556 /* stall data write direction, which depends on USB mode */
557 usb2_transfer_set_stall(sc->sc_xfer[CDCE_BULK_TX]);
557 usbd_transfer_set_stall(sc->sc_xfer[CDCE_BULK_TX]);
558
559 /* start data transfers */
560 cdce_start(ue);
561}
562
563static void
564cdce_stop(struct usb_ether *ue)
565{
558
559 /* start data transfers */
560 cdce_start(ue);
561}
562
563static void
564cdce_stop(struct usb_ether *ue)
565{
566 struct cdce_softc *sc = usb2_ether_getsc(ue);
567 struct ifnet *ifp = usb2_ether_getifp(ue);
566 struct cdce_softc *sc = uether_getsc(ue);
567 struct ifnet *ifp = uether_getifp(ue);
568
569 CDCE_LOCK_ASSERT(sc, MA_OWNED);
570
571 ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
572
573 /*
574 * stop all the transfers, if not already stopped:
575 */
568
569 CDCE_LOCK_ASSERT(sc, MA_OWNED);
570
571 ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
572
573 /*
574 * stop all the transfers, if not already stopped:
575 */
576 usb2_transfer_stop(sc->sc_xfer[CDCE_BULK_RX]);
577 usb2_transfer_stop(sc->sc_xfer[CDCE_BULK_TX]);
578 usb2_transfer_stop(sc->sc_xfer[CDCE_INTR_RX]);
579 usb2_transfer_stop(sc->sc_xfer[CDCE_INTR_TX]);
576 usbd_transfer_stop(sc->sc_xfer[CDCE_BULK_RX]);
577 usbd_transfer_stop(sc->sc_xfer[CDCE_BULK_TX]);
578 usbd_transfer_stop(sc->sc_xfer[CDCE_INTR_RX]);
579 usbd_transfer_stop(sc->sc_xfer[CDCE_INTR_TX]);
580}
581
582static void
583cdce_setmulti(struct usb_ether *ue)
584{
585 /* no-op */
586 return;
587}

--- 42 unchanged lines hidden (view full) ---

630 (xfer->frlengths[x] >= 14))
631 xfer->frlengths[x] -= 4;
632
633 if (xfer->frlengths[x] < sizeof(struct ether_header)) {
634 m_freem(m);
635 continue;
636 }
637 /* queue up mbuf */
580}
581
582static void
583cdce_setmulti(struct usb_ether *ue)
584{
585 /* no-op */
586 return;
587}

--- 42 unchanged lines hidden (view full) ---

630 (xfer->frlengths[x] >= 14))
631 xfer->frlengths[x] -= 4;
632
633 if (xfer->frlengths[x] < sizeof(struct ether_header)) {
634 m_freem(m);
635 continue;
636 }
637 /* queue up mbuf */
638 usb2_ether_rxmbuf(&sc->sc_ue, m, xfer->frlengths[x]);
638 uether_rxmbuf(&sc->sc_ue, m, xfer->frlengths[x]);
639 }
640
641 /* FALLTHROUGH */
642 case USB_ST_SETUP:
643 /*
644 * TODO: Implement support for multi frame transfers,
645 * when the USB hardware supports it.
646 */
647 for (x = 0; x != 1; x++) {
648 if (sc->sc_rx_buf[x] == NULL) {
639 }
640
641 /* FALLTHROUGH */
642 case USB_ST_SETUP:
643 /*
644 * TODO: Implement support for multi frame transfers,
645 * when the USB hardware supports it.
646 */
647 for (x = 0; x != 1; x++) {
648 if (sc->sc_rx_buf[x] == NULL) {
649 m = usb2_ether_newbuf();
649 m = uether_newbuf();
650 if (m == NULL)
651 goto tr_stall;
652 sc->sc_rx_buf[x] = m;
653 } else {
654 m = sc->sc_rx_buf[x];
655 }
656
650 if (m == NULL)
651 goto tr_stall;
652 sc->sc_rx_buf[x] = m;
653 } else {
654 m = sc->sc_rx_buf[x];
655 }
656
657 usb2_set_frame_data(xfer, m->m_data, x);
657 usbd_set_frame_data(xfer, m->m_data, x);
658 xfer->frlengths[x] = m->m_len;
659 }
660 /* set number of frames and start hardware */
661 xfer->nframes = x;
658 xfer->frlengths[x] = m->m_len;
659 }
660 /* set number of frames and start hardware */
661 xfer->nframes = x;
662 usb2_start_hardware(xfer);
662 usbd_transfer_submit(xfer);
663 /* flush any received frames */
663 /* flush any received frames */
664 usb2_ether_rxflush(&sc->sc_ue);
664 uether_rxflush(&sc->sc_ue);
665 break;
666
667 default: /* Error */
668 DPRINTF("error = %s\n",
665 break;
666
667 default: /* Error */
668 DPRINTF("error = %s\n",
669 usb2_errstr(xfer->error));
669 usbd_errstr(xfer->error));
670
671 if (xfer->error != USB_ERR_CANCELLED) {
672tr_stall:
673 /* try to clear stall first */
674 xfer->flags.stall_pipe = 1;
675 xfer->nframes = 0;
670
671 if (xfer->error != USB_ERR_CANCELLED) {
672tr_stall:
673 /* try to clear stall first */
674 xfer->flags.stall_pipe = 1;
675 xfer->nframes = 0;
676 usb2_start_hardware(xfer);
676 usbd_transfer_submit(xfer);
677 break;
678 }
679
680 /* need to free the RX-mbufs when we are cancelled */
681 cdce_free_queue(sc->sc_rx_buf, CDCE_FRAMES_MAX);
682 break;
683 }
684}

--- 9 unchanged lines hidden (view full) ---

694 xfer->actlen);
695
696 /* TODO: decode some indications */
697
698 /* FALLTHROUGH */
699 case USB_ST_SETUP:
700tr_setup:
701 xfer->frlengths[0] = xfer->max_data_length;
677 break;
678 }
679
680 /* need to free the RX-mbufs when we are cancelled */
681 cdce_free_queue(sc->sc_rx_buf, CDCE_FRAMES_MAX);
682 break;
683 }
684}

--- 9 unchanged lines hidden (view full) ---

694 xfer->actlen);
695
696 /* TODO: decode some indications */
697
698 /* FALLTHROUGH */
699 case USB_ST_SETUP:
700tr_setup:
701 xfer->frlengths[0] = xfer->max_data_length;
702 usb2_start_hardware(xfer);
702 usbd_transfer_submit(xfer);
703 break;
704
705 default: /* Error */
706 if (xfer->error != USB_ERR_CANCELLED) {
707 /* start clear stall */
708 xfer->flags.stall_pipe = 1;
709 goto tr_setup;
710 }

--- 10 unchanged lines hidden (view full) ---

721
722 DPRINTF("Transferred %d bytes\n", xfer->actlen);
723
724 /* FALLTHROUGH */
725 case USB_ST_SETUP:
726tr_setup:
727#if 0
728 xfer->frlengths[0] = XXX;
703 break;
704
705 default: /* Error */
706 if (xfer->error != USB_ERR_CANCELLED) {
707 /* start clear stall */
708 xfer->flags.stall_pipe = 1;
709 goto tr_setup;
710 }

--- 10 unchanged lines hidden (view full) ---

721
722 DPRINTF("Transferred %d bytes\n", xfer->actlen);
723
724 /* FALLTHROUGH */
725 case USB_ST_SETUP:
726tr_setup:
727#if 0
728 xfer->frlengths[0] = XXX;
729 usb2_start_hardware(xfer);
729 usbd_transfer_submit(xfer);
730#endif
731 break;
732
733 default: /* Error */
734 if (xfer->error != USB_ERR_CANCELLED) {
735 /* start clear stall */
736 xfer->flags.stall_pipe = 1;
737 goto tr_setup;

--- 12 unchanged lines hidden ---
730#endif
731 break;
732
733 default: /* Error */
734 if (xfer->error != USB_ERR_CANCELLED) {
735 /* start clear stall */
736 xfer->flags.stall_pipe = 1;
737 goto tr_setup;

--- 12 unchanged lines hidden ---