aboutsummaryrefslogtreecommitdiffstats
path: root/sys/linux/vusb.txt
diff options
context:
space:
mode:
authorAndrey Konovalov <andreyknvl@google.com>2019-12-13 19:11:27 +0100
committerDmitry Vyukov <dvyukov@google.com>2019-12-16 09:28:02 +0100
commit0ae38e44894e5a52fe35a56b1d2ad18477cc6b59 (patch)
treee964534f3d53f87153cde3177bb2aed73ca20322 /sys/linux/vusb.txt
parenteef6e5808d6507716d331b9eff67fdd991be891a (diff)
sys/linux: minor improvements for USB descriptions
1. Define endpoint maxpacket as flags with a few valid values. 2. Define bits of bmNetworkCapabilities.
Diffstat (limited to 'sys/linux/vusb.txt')
-rw-r--r--sys/linux/vusb.txt12
1 files changed, 8 insertions, 4 deletions
diff --git a/sys/linux/vusb.txt b/sys/linux/vusb.txt
index 374e18df3..04b3be375 100644
--- a/sys/linux/vusb.txt
+++ b/sys/linux/vusb.txt
@@ -86,8 +86,6 @@ type usb_device_descriptor_t[CLASS, SUBCLASS, PROTOCOL, VENDOR, PRODUCT, DEVICE,
usb_versions = 0x110, 0x200, 0x201, 0x250, 0x300, 0x310
# https://elixir.bootlin.com/linux/v5.1.7/source/drivers/usb/core/hub.c#L4661
-# TODO: dummy driver has complex requirements for packet sizes, account for those:
-# https://elixir.bootlin.com/linux/v5.3.6/source/drivers/usb/gadget/udc/dummy_hcd.c#L497
usb_device_max_packet_sizes = 8, 16, 32, 64, 255
type usb_config_descriptor_t[NUM, IFSNUM, ATTRS, IFS] {
@@ -132,7 +130,7 @@ type usb_endpoint_descriptor_t[ADDR, ATTRS, EXTRA] {
bEndpointAddress ADDR
bmAttributes ATTRS
- wMaxPacketSize int16[0:1024]
+ wMaxPacketSize flags[usb_endpoint_max_packet_sizes, int16]
bInterval int8
bRefresh int8
@@ -141,6 +139,10 @@ type usb_endpoint_descriptor_t[ADDR, ATTRS, EXTRA] {
extra EXTRA
} [packed]
+# TODO: dummy driver has complex requirements for packet sizes, account for those:
+# https://elixir.bootlin.com/linux/v5.3.6/source/drivers/usb/gadget/udc/dummy_hcd.c#L497
+usb_endpoint_max_packet_sizes = 8, 16, 32, 64, 512, 1023, 1024
+
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
@@ -894,9 +896,11 @@ usb_cdc_ncm_desc {
bDescriptorSubType const[USB_CDC_NCM_TYPE, int8]
bcdNcmVersion int16
- bmNetworkCapabilities int8
+ bmNetworkCapabilities flags[usb_cdc_ncm_ncaps, int8]
} [packed]
+usb_cdc_ncm_ncaps = USB_CDC_NCM_NCAP_ETH_FILTER, USB_CDC_NCM_NCAP_NET_ADDRESS, USB_CDC_NCM_NCAP_ENCAP_COMMAND, USB_CDC_NCM_NCAP_MAX_DATAGRAM_SIZE, USB_CDC_NCM_NCAP_CRC_MODE, USB_CDC_NCM_NCAP_NTB_INPUT_SIZE
+
usb_cdc_mbim_desc {
bLength len[parent, int8]
bDescriptorType const[USB_DT_CS_INTERFACE, int8]