aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/usb/usb_bus.h
Commit message (Collapse)AuthorAgeFilesLines
* usb: change LIST to SLIST to avoid LinuxKPI conflictsBjoern A. Zeeb2024-09-241-1/+1
| | | | | | | | | | | | | In order to better integrate modern LinuxKPI USB this tries to reduce a contention point of "LIST". Given there is no need to use a LIST here change it to SLIST to avoid conflicts. It is a workaround which does not solve the actual problem (overlapping namespaces) but it helps us a lot for now. Sponsored by: The FreeBSD Foundation X-MFC? unclear Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D46534
* sys: Remove $FreeBSD$: one-line .c comment patternWarner Losh2023-08-161-1/+0
| | | | Remove /^/[*/]\s*\$FreeBSD\$.*\n/
* spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDWarner Losh2023-05-121-1/+1
| | | | | | | | | The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause. Discussed with: pfg MFC After: 3 days Sponsored by: Netflix
* Make USB statistics per device instead of per bus.Hans Petter Selasky2019-12-271-10/+1
| | | | | | | | | | | Bump the FreeBSD version due to structure change to force recompilation of external USB modules. MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=356135
* Add quirk for XHCI(4) controllers to support USB control transfersHans Petter Selasky2019-09-201-0/+1
| | | | | | | | | | | | | | | above 1Kbyte. It might look like some XHCI(4) controllers do not support when the USB control transfer is split using a link TRB. The next NORMAL TRB after the link TRB is simply failing with XHCI error code 4. The quirk ensures we allocate a 64Kbyte buffer so that the data stage TRB is not broken with a link TRB. Found at: EuroBSDcon 2019 MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=352556
* sys/dev: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-271-0/+2
| | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Notes: svn path=/head/; revision=326255
* Improve the realtime properties of USB transfers for embedded systemsHans Petter Selasky2015-08-141-6/+13
| | | | | | | | | | | | | | | | | | | | | | | like RPI-B and RPI-2. Description of problem: USB transfers can process data in their callbacks sometimes causing unacceptable latency for other USB transfers. Separate BULK completion callbacks from CONTROL, INTERRUPT and ISOCHRONOUS callbacks, and give BULK completion callbacks lesser execution priority than the others. This way USB audio won't be interfered by heavy USB ethernet usage for example. Further serve USB transfer completion in a round robin fashion, instead of only serving the most CPU hungry. This has been done by adding a third flag to USB transfer queue structure which keeps track of looping callbacks. The "command" callback function then decides what to do when looping. MFC after: 2 weeks Notes: svn path=/head/; revision=286773
* Resolve a special case deadlock: When two or more threads areHans Petter Selasky2015-01-131-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | simultaneously detaching kernel drivers on the same USB device we can get stuck in the "usb_wait_pending_ref_locked()" function because the conditions needed for allowing detach are not met. The "destroy_dev()" function waits for all system calls involving the given character device to return. Character device system calls may lock the USB enumeration lock, which is also held when "destroy_dev()" is called. This can sometimes lead to a deadlock not noticed by WITNESS. The current solution is to ensure the calling thread is the only one holding the USB enumeration lock and prevent other threads from getting refs while a USB device detach is ongoing. This turned out not to be sufficient. To solve this deadlock we could use "destroy_dev_sched()" to schedule the device destruction in the background, but then we don't know when it is safe to free() the private data of the character device. Instead a callback function is executed by the USB explore process to kill off any leftover USB character devices synchronously after the USB device explore code is finished and the USB enumeration lock is no longer locked. This makes porting easier and also ensures us that character devices must eventually go away after a USB device detach. While at it ensure that "flag_iserror" is only written when "priv_mtx" is locked, which is protecting it. MFC after: 5 days Notes: svn path=/head/; revision=277136
* Add 64-bit DMA support in the XHCI controller driver.Hans Petter Selasky2015-01-051-0/+1
| | | | | | | | | | - Fix some comments and whitespace while at it. MFC after: 1 month Submitted by: marius@ Notes: svn path=/head/; revision=276717
* - Add softc pointer argument to FIFO functions as an optimisation.Hans Petter Selasky2014-05-181-0/+1
| | | | | | | | | | | - Implement support for interrupt filters in the DWC OTG driver, to reduce the amount of CPU task switching when only feeding the FIFOs. - Add common spinlock to the USB bus structure. MFC after: 2 weeks Notes: svn path=/head/; revision=266394
* USB method structures for USB controllers and USB pipes should beHans Petter Selasky2013-12-111-1/+1
| | | | | | | | constant and does not need to be modified. This also saves a small amount of RAM. Notes: svn path=/head/; revision=259218
* Improve the XHCI command timeout recovery handling code.Hans Petter Selasky2013-12-061-0/+1
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=259023
* - Move scratch data from the USB bus structure to the USB device structureHans Petter Selasky2013-02-101-10/+0
| | | | | | | | | | | | | so that simultaneous access cannot happen. Protect scratch area using the enumeration lock. Also reduce stack usage in usbd_transfer_setup() by moving some big stack members to the scratch area. This saves around 200 bytes of stack. - Fix a whitespace. MFC after: 1 week Notes: svn path=/head/; revision=246616
* Add defines to more easily allow a single threaded version of the FreeBSDHans Petter Selasky2013-02-051-0/+8
| | | | | | | USB stack. This is useful for non-kernel purposes, like the loader. Notes: svn path=/head/; revision=246363
* Fix some nits.Hans Petter Selasky2013-02-051-0/+2
| | | | Notes: svn path=/head/; revision=246360
* Implement better support for USB controller suspend and resume.Hans Petter Selasky2011-12-141-1/+5
| | | | | | | | | | | | | This patch should remove the need for kldunload of USB controller drivers at suspend and kldload of USB controller drivers at resume. This patch also fixes some build issues in avr32dci.c MFC after: 2 weeks Notes: svn path=/head/; revision=228483
* Removes all duplicated code with BPF that it's greatly simplified andWeongyo Jeong2010-11-241-1/+1
| | | | | | | | | | take all benefits whenever BPF code is improved. Pointed by: jkim Reviewed by: thompsa Notes: svn path=/head/; revision=215802
* Adds a USB packet filter feature to the stack that it could captureWeongyo Jeong2010-11-221-0/+2
| | | | | | | | | | | | packets which go through each USB host controllers. Its implementations are almost based on BPF code and very similar with it except it's little bit customized for USB packet only. The userland program usbdump(8) would be committed soon. Discussed with: hps, thompsa, yongari Notes: svn path=/head/; revision=215649
* Add support for USB language selection.Andrew Thompson2009-09-281-1/+5
| | | | | | | | | PR: usb/138563 Reported by: Bruce Cran Submitted by: Hans Petter Selasky Notes: svn path=/head/; revision=197559
* Fix _USB2_* refernces in the header protection defines.Andrew Thompson2009-06-151-3/+3
| | | | Notes: svn path=/head/; revision=194230
* Revert the size_t part of the last commit for the moment, this blows up theAndrew Thompson2009-05-301-1/+1
| | | | | | | USB_ADD_BYTES macro. Notes: svn path=/head/; revision=193074
* s/usb2_/usb_/ on all typedefs for the USB stack.Andrew Thompson2009-05-291-2/+2
| | | | Notes: svn path=/head/; revision=193045
* s/usb2_/usb_/ on all C structs for the USB stack.Andrew Thompson2009-05-281-22/+22
| | | | Notes: svn path=/head/; revision=192984
* Use enums for speed and rev data types.Andrew Thompson2009-05-211-1/+1
| | | | Notes: svn path=/head/; revision=192500
* MFp4 //depot/projects/usb@160930Andrew Thompson2009-04-221-12/+0
| | | | | | | | | | Change the roothub exec functions to take the usb request and data pointers directly rather than placing them on the parent bus struct. Submitted by: Hans Petter Selasky Notes: svn path=/head/; revision=191402
* MFp4 //depot/projects/usb@160706Andrew Thompson2009-04-221-1/+7
| | | | | | | | | Resolve possible device side mode deadlock by creating another thread. Submitted by: Hans Petter Selasky Notes: svn path=/head/; revision=191400
* Provide a better commit log for r190735, forced by making a whitespace change.Andrew Thompson2009-04-061-2/+2
| | | | | | | | | | | | | | | Refactor how we interface with the root HUB. This is achieved by making a direct call from usb2_do_request to the host controller for root hub requests, this call will perform the controller specific register read/writes and return the error code. This cuts out a lot of code in the host controller files and saves one thread per USB bus. Submitted by: Hans Petter Selasky Notes: svn path=/head/; revision=190754
* MFp4 //depot/projects/usb@159922Andrew Thompson2009-04-051-2/+12
| | | | | | | | | | Refactor how we interface with the root HUB. This cuts around 1200 lines of code totally and saves one thread per USB bus. Submitted by: Hans Petter Selasky Notes: svn path=/head/; revision=190735
* Fix compile with USB_HAVE_BUSDMA/USB_HAVE_UGEN/USB_HAVE_STRINGS.Andrew Thompson2009-03-201-1/+2
| | | | | | | Submitted by: Hans Petter Selasky Notes: svn path=/head/; revision=190191
* MFp4 //depot/projects/usb @159431,159437,159438Andrew Thompson2009-03-201-3/+3
| | | | | | | | | | - start using the new USB typedefs in the USB core - Remove usage of USB_ADD_BYTES() Submitted by: Hans Petter Selasky Notes: svn path=/head/; revision=190181
* Change USB over to make_dev() for all device nodes, previously it hooked intoAndrew Thompson2009-02-271-1/+0
| | | | | | | | | | | | | | | | | | the devfs clone handler to open the (invisible) devices on the fly. The /dev entries are layed out as follows, /dev/usbctl = master device /dev/usb/0.1.0.5 = usb device, (<bus>.<dev>.<iface>.<endpoint>) /dev/ugen0.1 -> usb/0.1.0.0 = ugen link to ctrl endpoint This also removes the custom permissions model from USB. Bump __FreeBSD_version to 800066. Submitted by: rink (earlier version) Notes: svn path=/head/; revision=189110
* Move the new USB stack into its new home.Andrew Thompson2009-02-231-0/+104
Notes: svn path=/head/; revision=188942