Skip to content

Commit 52db58d

Browse files
jfischer-nokartben
authored andcommitted
usb: device: remove loopback function in favor of new device stack
This function is used for testing purposes only, there is no real use for it in a user application. Remove in favor of implementation in new device stack. Also remove the part of the documentation that depends on loopback. Documentation on how to implement your own USB device function using the new USB device support will follow during the documentation rework. Signed-off-by: Johann Fischer <[email protected]>
1 parent 5b38549 commit 52db58d

File tree

6 files changed

+2
-256
lines changed

6 files changed

+2
-256
lines changed

doc/connectivity/usb/device/usb_device.rst

Lines changed: 2 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -391,61 +391,6 @@ BOS descriptor and handled by the stack.
391391

392392
See :zephyr:code-sample:`webusb` sample for reference.
393393

394-
Implementing a non-standard USB class
395-
*************************************
396-
397-
The configuration of USB device is done in the stack layer.
398-
399-
The following structures and callbacks need to be defined:
400-
401-
* Part of USB Descriptor table
402-
* USB Endpoint configuration table
403-
* USB Device configuration structure
404-
* Endpoint callbacks
405-
* Optionally class, vendor and custom handlers
406-
407-
For example, for the USB loopback application:
408-
409-
.. literalinclude:: ../../../../subsys/usb/device/class/loopback.c
410-
:language: c
411-
:start-after: usb.rst config structure start
412-
:end-before: usb.rst config structure end
413-
:linenos:
414-
415-
Endpoint configuration:
416-
417-
.. literalinclude:: ../../../../subsys/usb/device/class/loopback.c
418-
:language: c
419-
:start-after: usb.rst endpoint configuration start
420-
:end-before: usb.rst endpoint configuration end
421-
:linenos:
422-
423-
USB Device configuration structure:
424-
425-
.. literalinclude:: ../../../../subsys/usb/device/class/loopback.c
426-
:language: c
427-
:start-after: usb.rst device config data start
428-
:end-before: usb.rst device config data end
429-
:linenos:
430-
431-
432-
The vendor device requests are forwarded by the USB stack core driver to the
433-
class driver through the registered vendor handler.
434-
435-
For the loopback class driver, :c:func:`loopback_vendor_handler` processes
436-
the vendor requests:
437-
438-
.. literalinclude:: ../../../../subsys/usb/device/class/loopback.c
439-
:language: c
440-
:start-after: usb.rst vendor handler start
441-
:end-before: usb.rst vendor handler end
442-
:linenos:
443-
444-
The class driver waits for the :makevar:`USB_DC_CONFIGURED` device status code
445-
before transmitting any data.
446-
447-
.. _testing_USB_native_sim:
448-
449394
Interface number and endpoint address assignment
450395
************************************************
451396

@@ -510,6 +455,8 @@ prevent you from implementing a hardware-clone firmware. Instead, if possible,
510455
the host driver implementation should be fixed to use values from the interface
511456
and endpoint descriptor.
512457

458+
.. _testing_USB_native_sim:
459+
513460
Testing over USBIP in native_sim
514461
********************************
515462

subsys/usb/device/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ config USB_REQUEST_BUFFER_SIZE
9595
range 8 65536
9696
default 256 if USB_DEVICE_NETWORK_RNDIS
9797
default 266 if (USB_DEVICE_BLUETOOTH && USB_DEVICE_BLUETOOTH_BIG_BUF)
98-
default 1024 if USB_DEVICE_LOOPBACK
9998
default 128
10099

101100
config USB_MAX_ALT_SETTING

subsys/usb/device/class/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
zephyr_sources_ifdef(CONFIG_USB_CDC_ACM cdc_acm.c)
44
zephyr_sources_ifdef(CONFIG_USB_MASS_STORAGE msc.c)
55
zephyr_sources_ifdef(CONFIG_USB_DEVICE_BLUETOOTH bluetooth.c)
6-
zephyr_sources_ifdef(CONFIG_USB_DEVICE_LOOPBACK loopback.c)
76

87
add_subdirectory_ifdef(CONFIG_USB_DEVICE_AUDIO audio)
98
add_subdirectory_ifdef(CONFIG_USB_DEVICE_NETWORK netusb)

subsys/usb/device/class/Kconfig

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ source "subsys/usb/device/class/Kconfig.msc"
99

1010
source "subsys/usb/device/class/Kconfig.bt"
1111

12-
source "subsys/usb/device/class/Kconfig.test"
13-
1412
source "subsys/usb/device/class/netusb/Kconfig"
1513

1614
source "subsys/usb/device/class/hid/Kconfig"

subsys/usb/device/class/Kconfig.test

Lines changed: 0 additions & 15 deletions
This file was deleted.

subsys/usb/device/class/loopback.c

Lines changed: 0 additions & 182 deletions
This file was deleted.

0 commit comments

Comments
 (0)