summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/usb_subr.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* Make sure to close the default pipe before re-opening it when we wantmpi2014-02-091-3/+3
| | | | | to update the address and packet length, fixes a memory leak introduced in revision 1.96.
* Do not allow to unconfigure a device by setting the configurationmpi2014-02-091-4/+1
| | | | | | | | number 0, leaving its descriptors pointing to NULL. There's a lot of code in our stack that assumes that the various descriptors are always valid and changing this would be too much work for the moment. Fix an issue reported by Thomas Pfaff, thanks!
* Remove a hack to update the address and packet length for every devicempi2014-01-151-2/+19
| | | | | | | | | request and instead re-open the default pipe with updated values when attaching a new device, adapted from FreeBSD r162977. This fixes a problem where the controller could have cached the previous values and would fail to get the device descriptor, leaving the device unrecognized with a message like: "device problem, disabling port n".
* Kill matchlvl usage throughout the usb stack.pirofti2013-11-191-13/+1
| | | | | | Allows us to move forward on cleaning. Okay mpi@
* Remove a layer of abstraction for fetching a configuration descriptor.mpi2013-11-021-7/+10
|
* Unswap address and configuration value arguments in a debug printf.mpi2013-08-211-3/+3
|
* Remove bogus and useless refcounting of usbd pipes that could lead tompi2013-08-131-2/+1
| | | | | | | memory leaks and abort the pipe if requests are still pending because most of our drivers don't do anything if usbd_close_pipe() fails. ok miod@
* These functions should only used in the usb-autoconf glue, do not exposempi2013-08-081-1/+4
| | | | them.
* Use the same functions to abort and close the control pipe of a devicempi2013-08-081-14/+5
| | | | | as for every other pipes instead of having another function calling the host controller method.
* Get rid of various 'typedef struct' definitions and use plain structuremglocker2013-04-151-39/+40
| | | | | | | | | 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@
* Merge usbd_get_device_desc() into the only function using them.mpi2013-04-101-2/+3
| | | | ok mglocker@
* Merge usb_devinfo* helper functions into usbd_print(), nothing else usempi2013-04-101-20/+5
| | | | | | them. ok ratchov@, mglocker@
* There's no need for usbd_get_config_desc_full() so just call usbd_get_desc()mpi2013-04-091-2/+2
| | | | | | | directly this also makes it easier to understand which function actually generates IO. ok mglocker@
* Make ugen_get_cdesc() a generic function by renaming it to usbd_get_cdesc()mglocker2013-04-011-1/+35
| | | | | | and move it to usb_subr.c. OK mpi@
* proc.h is way too much header for usb to handle.tedu2013-03-281-2/+1
|
* No need for two similar functions to free/remove USB device descriptors.mpi2013-03-161-26/+16
|
* Set the usb(4) unit number as bus number. This fixes a possiblempi2012-05-151-2/+2
| | | | | | | conflict where machines with two controllers with the same unit number (i.e. ehci0 and uhci0) would have reported to buses 0. ok miod@
* Remove usb_event_cookie_t type and instances of it found in various structs;miod2012-01-081-5/+1
| | | | leftover from the "usb event" stuff removal. Diff from Tobias Ulmer.
* garbage collect "usb events". without /dev/usb there is no way to accessjakemsr2011-01-251-4/+1
| | | | | | 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-23/+34
| | | | | | | | | | | | | 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 'udi_serial' to struct usb_device_info.jakemsr2011-01-151-1/+5
| | | | | | | * fill 'udi_serial' with the serial number in usbd_fill_deviceinfo(). * add compatability ioctl/struct so old binaries continue to work. discussed with deraadt and miod
* - use nitems()jasper2010-12-171-2/+2
| | | | ok jakemsr@
* don't delay if the device is dyingjakemsr2010-12-151-1/+4
| | | | ok krw@
* call config_deactivate() before config_detach() when detaching devices.jakemsr2010-12-061-1/+5
|
* tsleep on a static and private handle, since our goal is to not bederaadt2010-09-241-2/+5
| | | | | | | woken up by a wakeup, but only by the actual timeout expiry. On architectures which share a kva upage area between processes, we would not want an accidental wakeup (too short). discussed with various
* cap device's speed to the parent's one if higher. from FreeBSD.fgsch2009-01-141-1/+12
| | | | krw@ miod@ ok.
* change a device descriptor get logic during the enumeration process.yuo2008-11-241-7/+37
| | | | | | | | | | | | Some device could not handle the device descriptor request with short bLength (less than the device descriptor size(18 byte)). To handle such kind of devices, add complemental request loop to current logic. (memo: and I also found a device which can not response to any device descriptor request. It always returns only 8 byte-length head of the descriptor for 1st query. This is the reason why the device descriptor loop of this usb subsystem start with 8-byte length query.)
* revert part of rev. 1.65 where we set the address earlier. this seemsfgsch2008-08-031-24/+16
| | | | to cause issues as per netbsd pr/39023. deraadt@ yuo@ ok.
* When getting the string descriptors, fetch 2 bytes (size and type) first,fgsch2008-07-281-3/+3
| | | | | | | | and then the whole string based on the returned size, not just one byte. The Lexar card reader kindly loaned by Denis Doroshenko (denis dot doroshenko at gmail.com) it's happy now, and after further inspection it's what other OSs do. Discussed with yuo@. krw@ yuo@ ok.
* add usb2.0 to usb1.1(ohci/uchi) handover request to usb subsystem.yuo2008-06-291-1/+51
| | | | | | | | | | | add new quirk entry for uvideo which is required isoc transfer. Some usb2.0 devices use isochronous transfer but current usb subsystem does not support isoc transfer in ehci(usb2.0) bus. This patch introduce new psuedo usb hub request UHF_PORT_DISOWN_TO_1_1 to handover the device to ehci to usb1.1 bus(ohci or uhci). ok mglocker@ deraadt@ fgsch@
* 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@
* print vendor and product in hexa on debug.fgsch2008-06-211-2/+2
|
* do not leak memory if there is no power source. code is ifdef USB_DEBUG.fgsch2008-05-191-2/+3
|
* try a few times before giving up while getting the device descriptor. iffgsch2008-05-191-19/+30
| | | | | | | | | it fails, reset the port and try again. this seems to fix some devices that would punt with "device problem, disabling port" otherwise. from augustss@netbsd with some change as per discussion with theo. set the address before getting the descriptor. from peterbu at bemac dot com via netbsd kern/24716. tested by many.
* improve/repair locator printing; ok jsgderaadt2007-11-041-4/+4
|
* treat usb vendor/product names as a locator, and have usbd_print handle it,deraadt2007-10-111-20/+14
| | | | | | so that it shows up before the :. as a result, all the usb devices do not need to have name printing code anymore. all this now works and prints nicely because usbd_probe_and_attach() is serialized. ok kettenis
* serialize usbd_probe_and_attach(); only let one usb device be match'd andderaadt2007-10-111-14/+31
| | | | attached at a time; ok kettenis
* Simpliest memset(,0,) -> M_ZERO changes. One (caddr *) cast removal,krw2007-10-061-3/+2
| | | | | otherwise just adding M_ZERO to malloc() and removing the immediately adjacent memset(,0,).
* KNFgilles2007-09-111-2/+2
| | | | prompted and "much better" by marco@, ok pyr@
* add string length arguments to some functions, and do not copy a stringderaadt2007-09-091-27/+31
| | | | buffer to itself; checked by jsg and kettenis and others
* more M_ZERO conversions; ok krw@.fgsch2007-09-091-3/+2
|
* no need to say in two ways "a set of usb devices went away"; ok by a fewderaadt2007-07-211-6/+5
|
* Remove the definition and use of the device_ptr_t which was a struct device *.mbalmer2007-06-121-7/+7
| | | | | | No binary change. ok mk.
* Remove the definiton and usage of the USB_DO_ATTACH macro. It was a wrappermbalmer2007-06-111-4/+4
| | | | | | around a single function only and it did not even use all of it's arguments. ok jsg.
* Get rid of the USBDEVPTRNAME macro.mbalmer2007-06-101-6/+6
| | | | | | No binary change. ok jsg.
* Remove the definition and use of USBDEVUNIT.mbalmer2007-06-101-2/+2
| | | | ok jsg.
* Remove the definition and use of the USBDEVNAME macro.mbalmer2007-06-101-3/+3
| | | | | | | (This might look easy, but it was a big diff. Thanks to dlg and especially jsg for looking over it; we found at least four mistakes in the initial diff.) ok jsg.
* Remove the "Static" declaration of many functions. It was defined to be emptymbalmer2007-06-051-15/+15
| | | | | | | and it was not consistently used. It was confusing as it suggested these functions were static, which they were not. discussed with dlg and jsg, ok jsg.
* delete two extra lines which are not needed because that is how stringsderaadt2007-06-031-3/+1
| | | | actually work, surprise surprise; ok claudio cnst
* Remove logprintf macrojsg2007-05-211-3/+3
|