summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/usb_util.c
Commit message (Collapse)AuthorAgeFilesLines
* MFC r305421:hselasky2016-09-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | | Resolve deadlock between device_detach() and usbd_do_request_flags() by reviving the SX control request lock and refining which lock protects the common scratch area in "struct usb_device". The SX control request lock was removed by r246759 because it caused a lock order reversal with the USB enumeration lock inside usbd_transfer_setup() as a function of r246616. It was thought that reducing the number of locks would resolve the LOR, but because some USB device drivers use usbd_do_request_flags() inside callback functions, like in taskqueues, a deadlock may occur when these are drained from device_detach(). By restoring the SX control request lock usbd_do_request_flags() is allowed to complete its execution when a USB device driver is detaching. By using the SX control request lock to protect the scratch area, the LOR introduced by r246616 is also resolved. Bump the FreeBSD version while at it to force recompilation of all USB kernel modules. Found by: avos@
* - Move scratch data from the USB bus structure to the USB device structurehselasky2013-02-101-7/+15
| | | | | | | | | | 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
* Modify the FreeBSD USB kernel code so that it can be compiled directlyhselasky2013-01-301-0/+4
| | | | | | | | | | | | | | | | | | | | | | 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
* Simplify the usb_pause_mtx() function by factoring out the generic partshselasky2011-11-191-20/+8
| | | | | | | | | to the kernel's pause() function. The pause() function can now be used when cold != 0. Also assert that the timeout in system ticks must be positive. Suggested by: Bruce Evans MFC after: 1 week
* Move the device_delete_all_children() function from usb_util.chselasky2011-11-191-25/+0
| | | | | | | | to kern/subr_bus.c. Simplify this function so that it no longer depends on malloc() to execute. Identify a few other places where it makes sense to use device_delete_all_children(). MFC after: 1 week
* Remove unneeded includes of <sys/linker_set.h>. Other headers that usejhb2011-01-111-1/+0
| | | | | | it internally contain nested includes. Reviewed by: bde
* - 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-12/+12
|
* Remove usb2_cv_* and just use the kernel condvar implementation, it was neededthompsa2009-06-151-103/+0
| | | | | earlier since condition variables didnt work with Giant but this was fixed 10 months ago.
* s/usb2_/usb_/ on all typedefs for the USB stack.thompsa2009-05-291-1/+1
|
* s/usb2_/usb_/ on all C structs for the USB stack.thompsa2009-05-281-4/+4
|
* Allocate the usb serial, manufacturer and product strings rather than use charthompsa2009-05-271-4/+0
| | | | arrays in the usb_device struct. This also eliminates USB_HAVE_STRINGS.
* Fix compile with USB_HAVE_BUSDMA/USB_HAVE_UGEN/USB_HAVE_STRINGS.thompsa2009-03-201-2/+0
| | | | Submitted by: Hans Petter Selasky
* MFp4 //depot/projects/usb@159446thompsa2009-03-201-14/+0
| | | | | | Remove unused and depreciated function: usb2_get_devid(). Submitted by: Hans Petter Selasky
* MFp4 //depot/projects/usb@159392thompsa2009-03-201-2/+10
| | | | | | Add ifdefs for making parts of usb conditional. Submitted by: Hans Petter Selasky
* MFp4 //depot/projects/usb @159430thompsa2009-03-201-1/+0
| | | | | | | | | | - Move tunable defines into usb_core.h and dependancy towards usb_defs.h - Leave hardcoded defines in "usb_defs.h". - Allow overriding all tunable defines. - Add more customisable typedefs. - Correct maximum device number. Submitted by: Hans Petter Selasky
* Move the new USB stack into its new home.thompsa2009-02-231-0/+346
OpenPOWER on IntegriCloud