summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/usbdi.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Simplify/refactor the way vendor/product/serial informations arelandry2018-05-011-2/+2
| | | | | | | | | | | | | | | | | | gathered from usb devices. Cache them early in usbd_new_device() instead of querying the device several times (the content wont change anyway) and uselessly generating usb traffic (which could conflict with other access..) The heuristic stays the same, first look in the device descriptor, then try to match against usb_known_vendors/usb_known_products, then fallback to use the idVendor/idProduct codes. Remove the now useless 'usedev' parameter from usbd_fill_deviceinfo(). Tested from bsd & bsd.rd. suggested by and ok mpi@
* Use splraise() rather than splsoftnet() which is going away.mpi2017-05-151-4/+5
|
* Replace remaining SPLUSBCHECK by a splsoftassert(IPL_SOFTUSB).mpi2017-05-151-7/+1
| | | | USB is the last real user of IPL_SOFTNET.
* Convert uiomovei to uiomove. Fixes a few integer truncations along thestefan2016-03-031-2/+2
| | | | | | way. ok natano@
* usbd_{endpoint,interface}_count() are no longer used and die.mpi2015-07-101-3/+1
|
* Reduce the number of intermediate buffers by pre-allocating DMA buffersmpi2015-01-221-3/+3
| | | | | | | in the report functions instead of letting the stack do it magically for us. Reviewed and tested by David Higgs, thanks!
* Add an asynchronous version of uhidev_get_report(), from David Higgsmpi2015-01-091-2/+2
| | | | | | | with some tweaks. Nothing use it for the moment, but upcoming upd(4) improvements need it.
* Since USB xfer pools are accessed in interrupt context, initialize themmpi2014-08-101-3/+5
| | | | with the correct ipl to prevent your CPU from locking against itself.
* We already have three identical copies of the *hci_str() function,mpi2014-03-071-1/+3
| | | | | so merge them into usbd_str() to not introduce other copies with the upcoming HC drivers.
* Add include guards.mpi2014-03-061-1/+6
|
* Kill matchlvl usage throughout the usb stack.pirofti2013-11-191-2/+1
| | | | | | Allows us to move forward on cleaning. Okay mpi@
* Clean-up usbd_abort_pipe() usage.pirofti2013-11-151-2/+2
| | | | | | | This function never fails. So change it's return type to void and adjust the copy-pasted callers that were checking the return. "If it compiles, ok" mpi@
* Polling is done per controller not per interface.pirofti2013-11-131-4/+2
| | | | | | | | | The controllers are linked through device->bus so the iface is redundant. So fixing usbd_dopoll() to take the device as argument and making usbd_interface2device_handle() private (for now) inside usbdi_util. Tested and okay mpi@
* Make usbd_free_xfer return void, since no callers use the return value.jeremy2013-11-061-2/+2
| | | | OK mpi@
* Begin conversion of USB stack to return int instead of usbd_status,jeremy2013-11-021-3/+3
| | | | | | | | | | starting with usbd_endpoint_count and usbd_interface_count. usbd_status should only be used to indicate the status of a USB transfer, it should not be used for generic error codes. Idea from and much hand-holding by mpi@ OK mpi@
* usbd_pipe2device_handle() is not used, should not be used and die.mpi2013-10-311-2/+1
|
* Unify and document usbd_transfer(9).mpi2013-09-201-1/+2
| | | | | | | | | | | Get rid of the badly named usbd_bulk_transfer() and usbd_intr_transfer() they were two identical wrappers to submit a synchronous transfer. Now all synchronous transfers are submited using usbd_setup_xfer(9) and usbd_transfer(9) explicitly using the USBD_CATCH flag when signals must be checked. Previous version ok'd by mglocker@, with subtle inputs from miod@
* Remove unused and ambiguous usbd_get_interface() function.mpi2013-04-261-2/+1
|
* Remove bogus comments.mpi2013-04-261-4/+2
|
* Rename three functions in usbdi.c to their right prefix (usb_* to usbd_*).mglocker2013-04-261-5/+5
| | | | ok mpi@
* Remove unused usbd_get_buffer() function.mpi2013-04-191-2/+1
|
* Move over function prototypes from ubsdi.h to usb.c which just get usedmglocker2013-04-181-4/+1
| | | | | | there. Some spacing while here. Suggested and ok mpi@
* Get rid of various 'typedef struct' definitions and use plain structuremglocker2013-04-151-75/+73
| | | | | | | | | definitions instead. We don't change usb.h for now to stay compatible with userland. Tested by mpi@ on macppc and myself on i386. ok mpi@
* Instead of using a wrapper around usbd_transfer() when submitting ampi2013-04-121-2/+1
| | | | | | | transfer synchronously just pass the USBD_SYNCHRONOUS flag like any other flags when creating a transfer. ok sthen@, mglocker@
* Merge usb_devinfo* helper functions into usbd_print(), nothing else usempi2013-04-101-4/+1
| | | | | | them. ok ratchov@, mglocker@
* When submitting a request the device's default pipe is alwaysmpi2013-04-091-4/+1
| | | | | | | used, so do not pretend to support a different one and get rid of the unused usbd_do_request_flags_pipe() function. ok mglocker@
* Add new ioctl's USB_DEVICE_GET_CDESC and USB_DEVICE_GET_FDESC to usb(4).mglocker2013-04-081-1/+3
| | | | | | | Those are the equivalents for ugen(4)'s USB_GET_CONFIG_DESC and USB_GET_FULL_DESC. Help and OK mpi@, jmc@
* Make ugen_get_cdesc() a generic function by renaming it to usbd_get_cdesc()mglocker2013-04-011-1/+2
| | | | | | and move it to usb_subr.c. OK mpi@
* bring back changes in usb.c revision 1.73jakemsr2011-02-091-6/+10
| | | | | | | | | | | | | | | | date: 2011/02/04 08:21:39; author: jakemsr; state: Exp; lines: +85 -34 * merge 'onqueue' and 'running' members of struct usb_task into a new member, 'state'. * add new function 'usb_wait_task()', which waits for queued or running usb_tasks to complete. * in the USB_DEVICEINFO ioctl, fill struct usb_device_info in a usb_task, thereby avoiding races against driver attach/detach. but this time make the state a bitmask, since it is valid to be added to the task queue while the task is running. also be more careful about waking up the task when state changes. ok miod@
* revert usb.c to r1.72, and all subsequent changes that depend on it.jakemsr2011-02-091-12/+6
| | | | this is causing problems with suspend/resume for some people.
* * merge 'onqueue' and 'running' members of struct usb_task intojakemsr2011-02-041-6/+12
| | | | | | | | | | a new member, 'state'. * add new function 'usb_wait_task()', which waits for queued or running usb_tasks to complete. * in the USB_DEVICEINFO ioctl, fill struct usb_device_info in a usb_task, thereby avoiding races against driver attach/detach. ok miod@
* garbage collect "usb events". without /dev/usb there is no way to accessjakemsr2011-01-251-6/+3
| | | | | | them from userland, and nothing in the kernel uses them. ok krw@, miod@
* * instead of NULLing pointers to interface descriptors in the uaa, markjakemsr2011-01-161-1/+5
| | | | | | | | | | | | | interfaces as being claimed in the usbd_device's copy of the interface descriptors * allow ugen(4) to be attached if there are unused interfaces in a configuration that has had drivers attached * make ugen(4) aware that it may be sharing a device with (an)other driver(s), and if so: * do not let ugen(4) change the configuration * do not let ugen(4) access the already claimed interfaces discussed with deraadt and miod
* * add a process reference counting variable to struct usbd_devicejakemsr2010-12-301-1/+5
| | | | | | * add functions to increment and decrement the reference count, and a function to wait until the reference count is zero ok martynas@
* * add dying flag to struct usbd_devicejakemsr2010-12-061-1/+4
| | | | | | | | | * add usbd_deactivate(), which should be use to set the dying flag in struct usbd_device * add usbd_is_dying(), which can be used to check if either the device or the associated bus dying flag has been set * use usbd_is_dying() to check if the deivce or bus is dying before issuing transfers or requests
* create another kthread to run xfer abort tasks. xfer abort tasks cannotjakemsr2010-10-231-2/+11
| | | | | | | | | | | be run from the generic task kthread, because xfers that need to be aborted block newly queued tasks from running (i.e. the xfer to be aborted blocks the abort of that task). as there are now three types of usb tasks, add an argument to usb_init_task() and another member to struct usb_task to specify the task type. fixes boot hangs that are showing up because we now use usb tasks to attach/detach usb devices.
* add two members to struct usb_taskjakemsr2010-09-231-4/+7
| | | | | | | | | | | | | | | * usbd_device_handle dev - the device responsible for the task. use this to not run the task if the device's hub is dying. * int running - a flag to be set when the task is running. add usb_rem_wait_task(), a wrapper for usb_rem_task() that waits for the task to complete if the task is already running. s/usb_rem_task/usb_rem_wait_task/ in usb_detach(). probably most drivers using usb_tasks should do this as well. although device attach/detach is serialized in normal cases, in the special case where the usb bus is hotpluggable (like cardbus/pcmcia), devices are not detached in the task thread.
* Get rid of __HAVE_GENERIC_SOFT_INTERRUPTS now that all our platforms support it.kettenis2009-11-041-10/+1
| | | | ok jsing@, miod@
* Disable SPLUSBCHECK for now, as these turn out to be harmful on sparc64.miod2009-09-231-1/+9
|
* Reinstate SPLUSBCHECK checks (DIAGNOSTIC-only), but implemented as splassert(),miod2009-08-301-1/+3
| | | | | | | which is exactly what it was trying to do. Tested on all *hci controllers with a bunch of usb devices by at least ckuethe@ and I.
* First pass at removing clauses 3 and 4 from NetBSD licenses.ray2008-06-261-8/+1
| | | | | | | | | Not sure what's more surprising: how long it took for NetBSD to catch up to the rest of the BSDs (including UCB), or the amount of code that NetBSD has claimed for itself without attributing to the actual authors. OK deraadt@
* KNF, especially re-indent prototypes. No binary change.mbalmer2007-06-181-34/+28
| | | | ok dlg.
* Replace the USB_USE_SOFTINTR macro with __HAVE_GENERIC_SOFT_INTTERUPTSmbalmer2007-06-151-6/+2
| | | | | | | | (which was used to define USB_USE_SOFTINTR). No binary changes. ok dlg, mk.
* Remove the definition and use of the device_ptr_t which was a struct device *.mbalmer2007-06-121-2/+2
| | | | | | No binary change. ok mk.
* Kill some #if define(__OtherBSD__). OK dlg@claudio2007-05-291-30/+1
|
* add iterators for usb descriptors. from Tony Lambris and Staffan Ulfberg.dlg2005-09-201-1/+9
|
* Don't keep the devinfo string on the stack, instead use malloc/free.brad2005-08-011-2/+6
| | | | | | | | This should cure some rare stack overflows. From augustss NetBSD ok dlg@ pascoe@
* backout the original method of reattaching a usb device now that we havedlg2004-12-121-2/+1
| | | | something better and more flexible to use.
* ugly ugly hack to allow a usb device to do a full reset of the port duringdlg2004-11-081-1/+2
| | | | | | | | | attach. this is required by atu (atmel based usb wireless) devices. something better will be done, but we need it for now to work on atu. ok deraadt@
* Sync USB code with NetBSD.nate2003-07-081-33/+34
| | | | This includes numerous fixes and paves the way for usb 2.0 support.