nuttx/drivers/usbdev
Ricard Rosson d6444d0a7b
Some checks are pending
MemBrowse Memory Report / changes-filter (push) Waiting to run
MemBrowse Memory Report / load-targets (push) Waiting to run
MemBrowse Memory Report / identical (push) Blocked by required conditions
MemBrowse Memory Report / analyze (push) Blocked by required conditions
drivers/usbdev: re-assert soft connect in cdcecm/cdcncm disconnect()
The USB device controller drivers invoke CLASS_DISCONNECT() on every
USB bus reset, and a bus reset is the first step of normal host
enumeration.  Every other class driver (cdcacm, usbmsc, rndis)
re-asserts DEV_CONNECT() at the end of its disconnect() handler so
that the device remains attached; cdcecm and cdcncm did not, so on
controllers that soft-disconnect around bus reset (e.g. rp2040, which
drops the pull-up in its bus-reset handler) a standalone CDC-ECM or
CDC-NCM device is left soft-disconnected by the first bus reset and
never enumerates on the host.

Mirror the cdcacm behavior and perform the soft connect in the
disconnect() methods, unless part of a composite device (composite.c
already re-connects in its own disconnect handler).

Fixes the standalone CDC-ECM case of issue #15880.

Validated on raspberrypi-pico (RP2040): with this change a standalone
CONFIG_NET_CDCECM device that previously never appeared on the host
enumerates via cdc_ether and pings with 0% loss.  cdcncm has the
identical defect and receives the identical fix.

Signed-off-by: Ricard Rosson <ricard@groundbits.com>
Co-authored-by: Xiang Xiao <xiaoxiang781216@gmail.com>
Assisted-by: Claude (Anthropic Claude Code)
2026-07-30 01:38:22 +08:00
..
adb.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
cdcacm.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
cdcacm.h drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
cdcacm_desc.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
cdcecm.c drivers/usbdev: re-assert soft connect in cdcecm/cdcncm disconnect() 2026-07-30 01:38:22 +08:00
cdcecm.h drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
cdcncm.c drivers/usbdev: re-assert soft connect in cdcecm/cdcncm disconnect() 2026-07-30 01:38:22 +08:00
CMakeLists.txt drivers/usbdev: add UVC gadget class driver 2026-03-29 12:35:22 -03:00
composite.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
composite.h driver/usbdev: Use small lock to protect composite device 2025-12-13 16:45:06 +08:00
composite_desc.c drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
dfu.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
Kconfig drivers/usbdev: add UVC gadget class driver 2026-03-29 12:35:22 -03:00
Make.defs drivers/usbdev: add UVC gadget class driver 2026-03-29 12:35:22 -03:00
mtp.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
pl2303.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
rndis.c drivers/usbdev: rndis: Reject truncated responses 2026-07-06 07:40:40 +02:00
rndis_std.h drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
usbdev_desc.c drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
usbdev_fs.c drivers/: Multiple Drivers Are Registered With World Writable Part 3 2026-07-16 09:49:07 -03:00
usbdev_fs.h drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
usbdev_req.c drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
usbdev_strings.c drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
usbdev_trace.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
usbdev_trprintf.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
usbmsc.c usbmsc: fix composite-mode class requests and Hi>Di stall behavior 2026-07-16 15:49:05 +08:00
usbmsc.h drivers/usbdev: Use small lock to protect usbdev msc 2025-12-13 16:45:06 +08:00
usbmsc_desc.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
usbmsc_scsi.c usbmsc: fix composite-mode class requests and Hi>Di stall behavior 2026-07-16 15:49:05 +08:00
uvc.c drivers/: Multiple Drivers Are Registered With World Writable - Part 2 2026-07-15 15:27:28 +08:00