summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/controller/usb_controller.c
Commit message (Collapse)AuthorAgeFilesLines
* MFC r277136:hselasky2015-02-051-0/+40
| | | | | | | | | | Resolve a special case deadlock: When two or more threads are 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. While at it ensure that "flag_iserror" is only written when "priv_mtx" is locked, which is protecting it.
* MFC r266969 and r276717:hselasky2015-02-051-1/+1
| | | | | | Add 64-bit DMA support in the XHCI controller driver. - Fix some comments and whitespaces while at it. - Add support for PAE.
* MFC r269565:hselasky2014-08-131-1/+1
| | | | Rename driver name a bit to avoid unit number confusion in dmesg.
* MFC: r267321marius2014-06-231-2/+3
| | | | | | | | | Avoid the USB device disconnected and controller shutdown clutter on system shutdown by putting the former under !rebooting and turning the latter into debug messages. Reviewed by: hps Sponsored by: Bally Wulff Games & Entertainment GmbH
* MFC r267240:hselasky2014-06-111-1/+7
| | | | | | | | | Resolve a deadlock setting the USB configuration index from userspace on USB HUBs by moving the code into the USB explore threads. The deadlock happens because child devices of the USB HUB don't have the expected reference count when called from outside the explore thread. Only the HUB device itself, which the IOCTL interface locks, gets the correct reference count.
* MFC r267212:hselasky2014-06-101-2/+2
| | | | Make WITNESS happy by giving USB mutexes different names.
* MFC r265358, r265427, r265777, r265783,hselasky2014-05-231-0/+4
| | | | | | | | | | r265806, r265872, r266012 and r266394: - Multiple DWC OTG host mode related fixes, improvements and optimisations. - Add full support for ISOCHRONOUS transfers to the DWC OTG driver. - Use the interrupt filter to handle basic USB FIFO interrupts. - Fixed unbalanced unlock in case of "dwc_otg_init_fifo()" failure. - Add common spinlock to the USB bus structure.
* MFC r259023 and r259095:hselasky2013-12-191-3/+56
| | | | | Improve the XHCI command timeout recovery handling code. Fix some typos while at it.
* Add convenience wrapper functions to run callbacks in the context of thehselasky2013-04-231-0/+25
| | | | USB explore thread.
* Resolve a LOR after r246616. Protect control requests using the USB devicehselasky2013-02-131-6/+12
| | | | | | | | | enumeration lock. Make sure all callers of usbd_enum_lock() check the return value. Remove the control transfer specific lock. Bump the FreeBSD version number, hence external USB modules may need to be recompiled due to a USB device structure change. MFC after: 1 week
* Add defines to more easily allow a single threaded version of the FreeBSDhselasky2013-02-051-28/+30
| | | | USB stack. This is useful for non-kernel purposes, like the loader.
* Use DEVMETHOD_END macro defined in sys/bus.h instead of {0, 0} sentinel on ↵sbz2013-01-301-1/+2
| | | | | | | device_method_t arrays Reviewed by: cognet Approved by: cognet
* Modify the FreeBSD USB kernel code so that it can be compiled directlyhselasky2013-01-301-1/+18
| | | | | | | | | | | | | | | | | | | | | | into the FreeBSD boot loader, typically for non-USB aware BIOSes, EFI systems or embedded platforms. This is also useful for out of the system compilation of the FreeBSD USB stack for various purposes. The USB kernel files can now optionally include a global header file which should include all needed definitions required to compile the FreeBSD USB stack. When the global USB header file is included, no other USB header files will be included by default. Add new file containing the USB stack configuration for the FreeBSD loader build. Replace some __FBSDID()'s by /* $FreeBSD$ */ comments. Now all USB files follow the same style. Use cases: - console in loader via USB - loading kernel via USB Discussed with: Hiroki Sato, hrs @ EuroBSDCon
* Add missing CTLFLAG_TUN flag to tunable sysctls in USB stack.hselasky2012-10-261-1/+1
| | | | | | | | Rearrange the tunables and belonging sysctl declarations, so that they are next to eachother. Submitted by: n_hibma @ MFC after: 1 week
* Add support for DWC OTG.hselasky2012-09-091-0/+3
|
* Make sure that the USB system suspend event is executed synchronouslyhselasky2012-03-031-2/+21
| | | | | | | | | and not asynchronously. This fixes problems related to USB system suspend and resume. It is assumed that we are always allowed to sleep from the device_suspend() method. MFC after: 1 week Submitted by: jkim
* Make sure we probe and attach the root HUB afterhselasky2012-01-021-0/+8
| | | | | | resume else no devices will appear again. MFC after: 1 day
* - Enable usbus on octusbgonzo2011-12-241-0/+1
|
* Make the recently added "no_shutdown_wait" sysctl writeable.hselasky2011-12-191-1/+1
| | | | | Suggested by: avg @ MFC after: 3 days
* Add code to wait for USB shutdown to be executed at system shutdown.hselasky2011-12-191-1/+15
| | | | | | Add sysctl which can be used to skip this waiting. MFC after: 3 days
* Add missing unlock of USB controller's lock, whenhselasky2011-12-191-0/+12
| | | | | | | doing shutdown, suspend and resume. Suggested by: avg @ MFC after: 3 days
* Implement better support for USB controller suspend and resume.hselasky2011-12-141-16/+231
| | | | | | | | | | 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
* Mark all SYSCTL_NODEs static that have no corresponding SYSCTL_DECLs.ed2011-11-071-1/+1
| | | | | | The SYSCTL_NODE macro defines a list that stores all child-elements of that node. If there's no SYSCTL_DECL macro anywhere else, there's no reason why it shouldn't be static.
* - Correct USB 3.0 wire-speed to 5.0Gbpshselasky2011-02-261-1/+1
| | | | | MFC after: 3 days Approved by: thompsa (mentor)
* Minor cleanup:hselasky2011-02-091-4/+4
| | | | | | | | - use device_printf() instead of printf() to give more accurate warnings. - use memcpy() instead of bcopy(). - add missing #if's for non-FreeBSD compilation. Approved by: thompsa (mentor)
* Make USB packet filtering code optional.hselasky2011-01-181-2/+4
| | | | Approved by: thompsa (mentor)
* Remove unneeded includes of <sys/linker_set.h>. Other headers that usejhb2011-01-111-1/+0
| | | | | | it internally contain nested includes. Reviewed by: bde
* Removes a unused function `usb_bus_find'.weongyo2010-11-251-26/+0
|
* Handles the unit number correctly that the previous commit had a problemweongyo2010-11-251-4/+4
| | | | | | | | (wrong unit number for a host controller) when the module is load / unloaded repeatly. Attaching the USB pf is moved to usbus device's attach. Pointed by: yongari
* Removes all duplicated code with BPF that it's greatly simplified andweongyo2010-11-241-1/+1
| | | | | | | take all benefits whenever BPF code is improved. Pointed by: jkim Reviewed by: thompsa
* Adds a USB packet filter feature to the stack that it could captureweongyo2010-11-221-0/+32
| | | | | | | | | 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
* This commit adds full support for USB 3.0 devices in host and devicehselasky2010-10-041-0/+6
| | | | | | | | | | | | | | | | mode in the USB core. The patch mostly consists of updating the USB HUB code to support USB 3.0 HUBs. This patch also add some more USB controller methods to support more active-alike USB controllers like the XHCI which needs to be informed about various device state events. USB 3.0 HUBs are not tested yet, due to lack of hardware, but are believed to work. After this update the initial device descriptor is only read twice when we know that the bMaxPacketSize is too small for a single packet transfer of this descriptor. Approved by: thompsa (mentor)
* Add missing DRIVER_MODULE() entry for the musbotg driver.hselasky2010-10-041-0/+4
| | | | | | Add some more comments. Approved by: thompsa (mentor)
* The root mount hold reference was not released on USB controllerhselasky2010-10-041-8/+14
| | | | | | attach failures during boot. Fix this. Approved by: thompsa (mentor)
* Add missing ifdefs for usb power saving support.thompsa2010-05-121-1/+4
| | | | Submitted by: Hans Petter Selasky
* Wrap the proc wakeup special case for ddb in ifdef DDB.thompsa2010-03-111-0/+6
| | | | Submitted by: Giovanni Trematerra
* Remove overuse of exclamation marks in kernel printfs, there mere fact athompsa2009-11-261-3/+3
| | | | | | message has been printed is enough to get someones attention. Also remove the line number for DPRINTF/DPRINTFN, it already prints the funtion name and a unique message.
* MFp4 @ 168387thompsa2009-09-281-4/+2
| | | | | | | | | | | | | | | | - clean up USB detach logic. There seems to be some problems detaching multiple USB HUBs connected in series from the root. - after this patch the rule is: 1) Always use device_detach() on the USB HUB first. 2) Never just device_delete_child() on the USB HUB, because that function will traverse to all the device leaves and free them first, and then the USB stack will free the devices twice which doesn't work very well. - make sure the did DMA delay gets set after the timeout has elapsed to make logic more clear. There is no functional difference. Submitted by: Hans Petter Selasky
* - allow disabling "root_mount_hold()" byalfred2009-08-241-73/+29
| | | | | | | setting a sysctl/tunable at boot - remove some redundant initial explore code Submitted by: hps
* Temporarily revert the new-bus locking for 8.0 release. It will bejhb2009-08-201-9/+21
| | | | | | reintroduced after HEAD is reopened for commits by re@. Approved by: re (kib), attilio
* Make the newbus subsystem Giant free by adding the new newbus sxlock.attilio2009-08-021-21/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The newbus lock is responsible for protecting newbus internIal structures, device states and devclass flags. It is necessary to hold it when all such datas are accessed. For the other operations, softc locking should ensure enough protection to avoid races. Newbus lock is automatically held when virtual operations on the device and bus are invoked when loading the driver or when the suspend/resume take place. For other 'spourious' operations trying to access/modify the newbus topology, newbus lock needs to be automatically acquired and dropped. For the moment Giant is also acquired in some key point (modules subsystem) in order to avoid problems before the 8.0 release as module handlers could make assumptions about it. This Giant locking should go just after the release happens. Please keep in mind that the public interface can be expanded in order to provide more support, if there are really necessities at some point and also some bugs could arise as long as the patch needs a bit of further testing. Bump __FreeBSD_version in order to reflect the newbus lock introduction. Reviewed by: ed, hps, jhb, imp, mav, scottl No answer by: ariff, thompsa, yongari Tested by: pho, G. Trematerra <giovanni dot trematerra at gmail dot com>, Brandon Gooch <jamesbrandongooch at gmail dot com> Sponsored by: Yahoo! Incorporated Approved by: re (ksmith)
* USB controller:alfred2009-07-301-2/+9
| | | | | | | - allow disabling "root_mount_hold()" by setting "hw.usb.no_boot_wait" sysctl Submitted by: hps Approved by: re
* - Make struct usb_xfer opaque so that drivers can not access the internalsthompsa2009-06-231-3/+22
| | | | - Reduce the number of headers needed for a usb driver, the common case is just usb.h and usbdi.h
* s/usb2_/usb_|usbd_/ on all function names for the USB stack.thompsa2009-06-151-99/+99
|
* Revert the size_t part of the last commit for the moment, this blows up thethompsa2009-05-301-3/+3
| | | | USB_ADD_BYTES macro.
* Fix function arguments were previously they matched the typedef by accident.thompsa2009-05-291-3/+3
|
* s/usb2_/usb_/ on all typedefs for the USB stack.thompsa2009-05-291-4/+4
|
* s/usb2_/usb_/ on all C structs for the USB stack.thompsa2009-05-281-27/+27
|
* Rename the usb sysctl tree from hw.usb2.* back to hw.usb.*.thompsa2009-05-211-2/+2
| | | | Submitted by: Hans Petter Selasky
* Use enums for speed and rev data types.thompsa2009-05-211-1/+1
|
OpenPOWER on IntegriCloud