summaryrefslogtreecommitdiff
path: root/sys/dev/usb/usb.h
AgeCommit message (Collapse)Author
2022-09-16Cast to uint32_t to avoid undefined behavior in UGETDW(). Found by kUBSan.msaitoh
2022-04-17usbdi(9): Restore usb_descriptor_t to its correct definition.riastradh
Descriptors in the USB spec all start with bLength and bDescriptorType. bDescriptorSubtype is only for certain class-specific descriptors. Many descriptors, such as usb_device_descriptor_t, _do not_ have bDescriptorSubtype, so using a structure that has bDescriptorSubtype for such descrpitors is wrong. There is some history here: - Back in 1998, when augustss@ introduced the USB stack, the type usb_descriptor_t was erroneously defined with a bDescriptorSubtype member. - In 2007, drochner@ removed this member to accurately reflect the USB spec. - In 2018, khorben@ appeared to have accidentally reintroduced it while importing the umb(4) driver from OpenBSD, which still has the erroneous bDescriptorSubtype member in usb_descriptor_t. The umb(4) driver has since been adjusted to correctly use usb_cdc_descriptor_t instead of usb_descriptor_t (and I have now restored umidi_cs_descriptor_t which I had removed last month before I realized this history of usb_descriptor_t), so this member is no longer necessary.
2021-10-11Update USB_PORT_RESET_RECOVERT to comply with the USB 2.0 specificationjmcneill
which says it should be max 10 milliseconds. From FreeBSD: https://github.com/freebsd/freebsd-src/commit/70ffaaa69c830d26b59136d0b0447ab2f8683db8
2019-08-23avoid using old bsd types (u_int etc) so that this compiles withmrg
_POSIX_C_SOURCE as noted in PR#48339.
2019-08-07Introduce USB_DESCRIPTOR_SIZE (3), and fix two bugs:maxv
1) In usbd_find_idesc(), make sure the tables we're reading fit in the allocated buffer, otherwise small overflow (seen on KASAN, with bLength=1). 2) Modify usbd_find_edesc(), to fix the same issues as 1). ok mrg@
2018-07-31Add a port of the umb(4) driver from OpenBSDkhorben
The umb(4) driver provides support for USB MBIM (Mobile Broadband Interface Model) devices. MBIM devices establish connections via cellular networks such as GPRS, UMTS, and LTE. They appear as a regular point-to-point network interface, transporting raw IP frames. Required configuration parameters like PIN and APN have to be set with umbctl(8), a new tool specific to this driver. The IP address is configured automatically; the default route and DNS server information have to be set separately. The driver is not fully functional yet, it is therefore still marked as experimental and disabled by default. Any help welcome to complete it! Tested on NetBSD/amd64, with a Sierra Wireless EM7345 LTE modem on a Lenovo ThinkPad T440s. No functional change expected otherwise.
2017-01-19Pull across xhci(4) improvemnts from nick-nhusbskrll
2016-09-17Update from t-hash with some changes from me.skrll
2016-04-23Merge nick-nhusbskrll
- API / infrastructure changes to support memory management changes. - Memory management improvements and bug fixes. - HCDs should now be MP safe - conversion to KERNHIST based debug - FS/LS isoc support on ehci(4). - conversion to kmem(9) - Some USB 3 support - mostly from Takahiro HAYASHI (t-hash). - interrupt transfers now get proper DMA operations - general bug fixes - kern/48308 - uhub status notification improvements - umass(4) probe fix (applied to HEAD already) - ohci(4) short transfer fix
2015-03-26Various usb 3 related changes from Takahiro HAYASHIskrll
2014-11-08Add more structs and defines from various sources including FreeBSD,skrll
OpenBSD and Takahiro HAYASHI
2014-09-12Improve USB debugging with USBHIST based on KERNHIST.skrll
Convert some DPRINTFs to USBHIST_LOG and allow usbdebug, ehcidebug and umassdebug to be changed via sysctl. Remove the #define mess in usb.h. This was started by mrg@ and updated by reinoud@
2014-08-12Add a UPS_SUPER_SPEED. From Takahiro HAYASHI.skrll
2014-08-12Add XHCI_DEBUG. From Takahiro HAYASHI with tweaks from me.skrll
One day someone(tm) will tidyup USB debug stuff.
2014-08-12Define AXEN_DEBUG. From Takahiro HAYASHI.skrll
2013-11-01DOTG is dead. Long live DWC2.skrll
2013-09-13A few more USB 3.0 constants.jakllsch
2013-08-21Add UDESC_SSHUB and UDPROTO_SSHUB constants from USB 3.0.jakllsch
2013-04-05Add a UPS_C_PORT_L1 defineskrll
2013-04-05Add a UPS_PORT_L1 defineskrll
2013-03-21Add some defines from the USB 2.0 specification and suppliments. Also,skrll
add some accessor macros while I'm here.
2013-01-13Add DWC_OTG_DEBUGskrll
2013-01-09USTIR_DEBUG_IOCTLS doesnt compile, and depends on a missing member in struct ↵jmcneill
irframe_methods, so remove it
2013-01-07more debug flags.christos
2013-01-05fix debug variables.christos
- include opt_usb.h in usb.h so that USB_DEBUG gets set properly in it. - normalize and sort debugging variables
2012-08-24Fix typosmsaitoh
2012-06-14Add the CDC protocol identifier "no class specific protocol required"blymn
and allow the umodem match routine to match on this protocol. This allows some recent arduino boards serial interfaces to attach.
2012-03-06pull down from usbmp:mrg
kill the !USE_USE_SOFTINTR code.
2011-08-23defopt UMASS_DEBUGchristos
2011-07-20Add UIPROTO_RNDIS.jakllsch
2011-01-18Add preliminary support for Embedded Transaction Translator Function (asmatt
found on the MPC8536 and AR9334) which allows low/full devices to be connected to an EHCI root hub.
2010-12-25Add missing semicolon.wiz
2010-12-25add USB interface assoc descriptor (IAD) infojmcneill
2010-11-19Added UIPROTO_MOUSE for HID-class.phx
2010-11-03Stop using the compatibility macros USB_ATTACH(), USB_DETACH(),dyoung
USB_MATCH(), et cetera. These files produce the same assembly (according to objdump -d) before and after the change
2010-06-02Add symbolic constant for number of USB 2.0 microframes per frame.jakllsch
2010-05-15Add Debug Descriptor structures and constants,jakllsch
as well as symbolic identifiers for USB packet IDs.
2010-03-06add UHSO_DEBUG for uhso(4) driverplunky
2009-09-04Extract some definitions from usb_port.h and put them into usb.h.dyoung
2008-08-02High speed isochronous transfer support, from Jeremy Morse as part ofjmcneill
Google Summer of Code 2008.
2008-06-18USB video class definitions, from Patrick Mahoney for GSoC 2008.jmcneill
2008-05-26some cleanup:drochner
-unifdef -since the roothub attach doesn't use locators, don't call config_stdsubmatch() -- it is a no-op in that case -ifsubmatch has configuration and interface always set to useful values, remove unnecessary checks -remove now unused locator definitions from shared header
2008-04-28Remove clause 3 and 4 from TNF licensesmartin
2007-12-25Convert many of the uses of __attribute__ to equivalentperry
__packed, __unused and __dead macros from cdefs.h
2007-02-26-remove "bDescriptorSubtype" from usb_descriptor_t - this is not partdrochner
of the common USB spec -Fix length of string descriptor: Descriptors have only a byte field for length, so 2*127+2 is already too much. Some devices obviously don't reply to string read requests with impossible length which happened if "sizeof(usb_string_descriptor_t) was used.
2007-01-19Kill the "bus powered" bit in the configuration descriptor. This doesn'tdrochner
exist in newer spec revisions, and is recommended to be set to 1. So call it _MBO and also use it in the fake root hub descriptors, just for sanity, even if nothing ever looks at it.
2006-12-03Restore compatibility of USB_DEVICEINFO ioctl and reads from /dev/usb withpavel
NetBSD 3.x. Patch from Stephan Thesing provided in http://mail-index.netbsd.org/current-users/2006/03/21/0002.html, with some modifications by me. See also http://mail-index.netbsd.org/current-users/2006/08/29/0017.html The code is conditionally compiled depending on COMPAT_30. Also fix a leak of struct usb_event in usbread() introduced while converting on-stack variables to dynamic allocation. Reviewed by martin@.
2006-07-24Add UGEN_BULK_RA_WB, which allows users of ugen(4) to request readgdt
ahead and write behind, improving performance for the Universal Software Radio Peripheral (USRP) used with GNU Radio. Enable UGEN_BULK_RA_WB in GENERIC and GENERIC_LAPTOP; behavior is unchanged unless the new ioctl is called. This code was written by Joanne Mikkelson under funding from DARPA's ACERT program. ok'd by christos@, tested by Berndt Josef Wulf
2005-12-11merge ktrace-lwp.christos
2005-05-02Use UTF8 to encode strings read from the device (instead of using '?' foraugustss
characters >=0x100). Also add serial number string to the device information struct.