summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/usb_request.c
Commit message (Collapse)AuthorAgeFilesLines
* MFC r260588 and r260589:hselasky2014-01-241-3/+24
| | | | | | | | | | - Separate I/O errors from reception of STALL PID. - Implement better error recovery for Transaction Translators, TTs, found in High Speed USB HUBs which translate from High Speed USB into FULL or LOW speed USB. In some rare cases SPLIT transactions might get lost, which might leave the TT in an unknown state. Whenever we detect such an error try to issue either a clear TT buffer request, or if that is not possible reset the whole TT.
* - Try to fix build of 32-bit compatibility USB support for FreeBSD andhselasky2013-08-121-1/+0
| | | | | | | | | | | Linux targets without breaking the existing IOCTL API. - Remove some not-needed header file inclusions. - Wrap a long line. MFC after: 1 week Reported by: Damjan Jovanovic <damjan.jov@gmail.com>
* - Add more defines to limit USB memory usage and number of allocationshselasky2013-05-031-5/+43
| | | | | | | | in reduced memory systems. - Split allocation and freeing of the configuration descriptor into a separate function, so that the configuration descriptor can be made fixed size to save memory allocations. This applies for both device and host mode.
* Add some defines to limit USB memory usage in reduced memory systems.hselasky2013-05-031-6/+8
|
* Fix typo.hselasky2013-03-131-2/+2
|
* - Make quirk for reading device descriptor from broken USB devices.hselasky2013-03-131-19/+33
| | | | | | | | | | | Else they won't enumerate at all: hw.usb.full_ddesc=1 - Reduce the USB descriptor read timeout from 1000ms to 500ms. Typical value for LOW speed devices is 50-100ms. - Enumerate USB device a maximum of 3 times when a port connection change event is detected, before giving up. MFC after: 1 month
* Resolve a LOR after r246616. Protect control requests using the USB devicehselasky2013-02-131-16/+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
* Fix some nits.hselasky2013-02-051-2/+0
|
* 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
* Make several timing parameters of the USB enumeration sequence tuneable.hselasky2012-10-241-73/+7
| | | | | | | | | | | Also update the port reset time from 250ms to 50ms. Some USB devices have a hard limit in hardware at 222ms for the port reset time and will not enumerate unless this delay is closer to the usb.org defined value. This patch can fix enumeration with some USB devices. Tested by: Guido van Rooij Submitted by: Nick Hibma MFC after: 1 week
* Fix typo.hselasky2012-09-201-1/+1
|
* Add support for the so-called streams feature of BULK endpointshselasky2012-08-121-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | in SUPER-speed mode, USB 3.0. This feature has not been tested yet, due to lack of hardware. This feature is useful when implementing protocols like UASP, USB attached SCSI which promises higher USB mass storage throughput. This patch also implements support for hardware processing of endpoints for increased performance. The switching to hardware processing of an endpoint is done via a callback to the USB controller driver. The stream feature is implemented like a variant of a hardware USB protocol. USB controller drivers implementing device mode needs to be updated to implement the new "xfer_stall" USB controller method and remove the "xfer" argument from the "set_stall" method. The API's toward existing USB drivers are preserved. To setup a USB transfer in stream mode, set the "stream_id" field of the USB config structure to the desired value. The maximum number of BULK streams is currently hardcoded and limited to 8 via a define in usb_freebsd.h. All USB drivers should be re-compiled after this change. LibUSB will be updated next week to support streams mode. A new IOCTL to setup BULK streams as already been implemented. The ugen device nodes currently only supports stream ID zero. The FreeBSD version has been bumped. MFC after: 2 weeks
* Fix compiler warnings, mostly signed issues,hselasky2012-04-021-1/+1
| | | | | | when USB modules are compiled with WARNS=9. MFC after: 1 weeks
* Add definitions and structures for USB 2.0 Link Power Management, LPM.hselasky2012-04-021-0/+54
| | | | MFC after: 2 weeks
* Improve support for USB 3.0 HUBs. In certain states wehselasky2012-01-131-18/+56
| | | | | | should do a warm reset instead of the default reset. MFC after: 5 days
* - Try to fix support for USB 3.0 HUBs.hselasky2012-01-121-0/+24
| | | | | | - Try to fix support for USB 3.0 suspend and resume. MFC after: 1 week
* Style change.hselasky2011-11-121-1/+1
| | | | | | | | | | | | - Make it easier to port the USB code to other platforms by only using one set of memory functions for clearing and copying memory. None of the memory copies are overlapping. This means using bcopy() is not required. - Fix a compile warning when USB_HAVE_BUSDMA=0 - Add missing semicolon in avr32dci. - Update some comments. MFC after: 1 week
* Add sysctl to not reset the device on clear stall failures, tohselasky2011-08-191-1/+13
| | | | | | | temporarily mitigate problems with VMs. Approved by: re (kib) MFC after: 1 week
* Do not block zero report ID. It is correct value for devices with singlemav2011-08-091-1/+1
| | | | | | | | | ID. This fixes USB_SET_IMMED call (synchronous operation) of the uhid(4) driver on devices with single report ID. Reviewed by: hselasky Approved by: re (kib) MFC after: 1 week
* Fix for VirtualBox 4.x and other virtual machines that failhselasky2011-07-161-7/+28
| | | | | | to generate a port reset change event. MFC after: 1 weeks
* Improve enumeration of Low- and Full-speed devices connected through ahselasky2011-06-061-1/+99
| | | | | | | | | High-speed USB HUB by resetting the transaction translator (TT) before trying re-enumeration. Also when clear-stall fails multiple times try a re-enumeration. Suggested by: Trevor Blackwell MFC after: 14 days
* Remove unneeded includes of <sys/linker_set.h>. Other headers that usejhb2011-01-111-1/+0
| | | | | | it internally contain nested includes. Reviewed by: bde
* Re-add a status check which sneaked out during r214804.hselasky2010-12-071-0/+4
| | | | | | | | This change can fix some USB error messages showing up during bootup. MFC after: 3 days Approved by: thompsa (mentor)
* Add code to warm reset a USB 3.0 port.hselasky2010-11-041-4/+97
| | | | Approved by: thompsa (mentor)
* This commit adds full support for USB 3.0 devices in host and devicehselasky2010-10-041-24/+187
| | | | | | | | | | | | | | | | 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 more strict USB string filtering.hselasky2010-10-041-6/+13
| | | | Approved by: thompsa (mentor)
* Reduce diffs to p4.thompsa2010-05-121-24/+163
| | | | | | | Add test code for delaying or failing usb control requests, disabled by default under ifdef USB_REQ_DEBUG. Submitted by: Hans Petter Selasky
* If a USB device is suspended and a USB set config request is issued when thethompsa2010-05-121-6/+18
| | | | | | | | | | USB enumeration lock is locked, then the USB stack fails to resume the device because locking the USB enumeration lock is part of the resume procedure. To solve this issue a new lock is introduced which only protects the suspend and resume callbacks, which can be dropped inside the usbd_do_request_flags() function, to allow suspend and resume during so-called enumeration operations. Submitted by: Hans Petter Selasky
* Use a more obvious prefix for the USB control (endpoint 0) transfers ratherthompsa2010-04-221-2/+2
| | | | than default_*.
* Properly name the sxlocks, mutexes and condvars.thompsa2010-04-221-4/+4
|
* Change USB_DEBUG to #ifdef and allow it to be turned off. Previously this hadthompsa2010-04-221-6/+6
| | | | | | the illusion of a tunable setting but was always turned on regardless. MFC after: 1 week
* Remove overuse of exclamation marks in kernel printfs, there mere fact athompsa2009-11-261-2/+2
| | | | | | 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.
* USB core:alfred2009-07-301-4/+4
| | | | | | | | | | | | | | | - add support for defragging of written device data. - improve handling of alternate settings in device side mode. - correct return value from usbd_get_no_alts() function. - reported by: HPS - P4 ID: 166156, 166168 - report USB device release information to devd and pnpinfo. - reported by: MIHIRA Sanpei Yoshiro - P4 ID: 166221 Submitted by: hps Approved by: re
* - Make struct usb_xfer opaque so that drivers can not access the internalsthompsa2009-06-231-9/+29
| | | | - 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-152/+152
|
* Remove usb2_cv_* and just use the kernel condvar implementation, it was neededthompsa2009-06-151-2/+2
| | | | | earlier since condition variables didnt work with Giant but this was fixed 10 months ago.
* Rename usb pipes to endpoints as it better represents what they are, and structthompsa2009-06-071-25/+25
| | | | usb_pipe may be used for a different purpose later on.
* Reorgansise the logic for tranversing the pipe list.thompsa2009-06-021-9/+9
| | | | Submitted by: Hans Petter Selasky
* s/usb2_/usb_/ on all typedefs for the USB stack.thompsa2009-05-291-48/+48
|
* s/usb2_/usb_/ on all C structs for the USB stack.thompsa2009-05-281-86/+86
|
* Rename the usb sysctl tree from hw.usb2.* back to hw.usb.*.thompsa2009-05-211-3/+3
| | | | Submitted by: Hans Petter Selasky
* - rename usb2_mode to usb_mode [1]thompsa2009-05-211-2/+2
| | | | | | - change variable types to use the enum Submitted by: Hans Petter Selasky [1]
* Track the usb device state as its powered on, addressed and configured. This ↵thompsa2009-04-251-0/+6
| | | | | | | | | helps to avoid touching the device when it is not going to respond and would otherwise timeout. Implement the suspend tracking as a udev state too.
* MFp4 //depot/projects/usb@160930thompsa2009-04-221-56/+59
| | | | | | | 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
* Provide a better commit log for r190735, forced by making a whitespace change.thompsa2009-04-061-1/+1
| | | | | | | | | | | | 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
* MFp4 //depot/projects/usb@159948thompsa2009-04-051-5/+8
| | | | | | Add more debugging output on enumeration failures. Submitted by: Hans Petter Selasky
* MFp4 //depot/projects/usb@159922thompsa2009-04-051-6/+58
| | | | | | | 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
* MFp4 //depot/projects/usb@159909thompsa2009-04-051-6/+7
| | | | | | | | | | | | | - make usb2_power_mask_t 16-bit - remove "usb2_config_sub" structure from "usb2_config". To compensate for this "usb2_config" has a new field called "usb_mode" which select for which mode the current xfer entry is active. Options are: a) Device mode only b) Host mode only (default-by-zero) c) Both modes. This change was scripted using the following sed script: "s/\.mh\././g". - the standard packet size table in "usb_transfer.c" is now a function, hence the code for the function uses less memory than the table itself. Submitted by: Hans Petter Selasky
* MFp4 //depot/projects/usb@159871thompsa2009-04-051-3/+4
| | | | | | | | - bugfixes after the memory usage reduction patch - Use "udev->pipes_max" instead of USB_EP_MAX - Use correct "bmRequestType" for getting the config descriptor. Submitted by: Hans Petter Selasky
* MFp4 //depot/projects/usb@159811thompsa2009-04-051-0/+34
| | | | | | First patch in a series of memory save patches. Submitted by: Hans Petter Selasky
OpenPOWER on IntegriCloud