summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/usb_subr.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* 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
|
* place types needed by usbdevs_data.h, directly into that file so that itderaadt2007-02-281-18/+1
| | | | is consumable by anyone who includes it (matches idea in pcidevs)
* Prefer malloc over the stack for an array of 256 pointers. ok dlg@miod2006-07-171-3/+9
|
* some knf, no binary changedlg2006-07-161-68/+66
|
* get rid of ifdef __OtherBSD__ cruftdlg2006-07-161-63/+1
|
* fix typos in debug messagesmjc2006-06-261-2/+2
| | | | ok pascoe@
* Save and restore the data toggle value when a pipe to an endpointpascoe2006-05-311-1/+2
| | | | | | | | | | | | | | is closed and then reopened. This may be necessary now that we no longer clear endpoint stalls every time a pipe is opened. Previously we could assume an initial toggle value of zero because a clear-stall operation resets the device's toggle state. Derived from work in FreeBSD. This is most likely to affect devices like printers, which open pipes for short periods of time and close them again. ok dlg@
* Zero the memory allocated for subdevs[], preventing a quick trip tokrw2006-05-011-4/+5
| | | | | | | ddb>. Discovered by trying 'usbdevs -v' while a broken card reader was trying to attach. Broken device provided by Manuel Pata. ok pedro@ deraadt@
* Move contents of sys/select.h to sys/selinfo.h in preparation for amillert2005-11-211-2/+2
| | | | | userland-visible sys/select.h. Consistent with what Net and Free do. OK deraadt@, tested with full ports build by naddy@.
* Store the usb device names and vendors in more compact structures.drahn2005-10-171-18/+26
| | | | | Originally committed in 2001, backed out in a sync, now back in. saves close to 12k of kernel size. commit deraadt@
* Don't clear possibly non-existant stall condition while setting up thekrw2005-10-101-4/+1
| | | | | | | | pipe. Some devices such as some iPods react badly. Normal devices don't need it. From nathanw via NetBSD. Fixes the 2nd generation iPod mini donated by Ed Wandasiewicz. ok pascoe@
* Don't keep the devinfo string on the stack, instead use malloc/free.brad2005-08-011-2/+19
| | | | | | | | This should cure some rare stack overflows. From augustss NetBSD ok dlg@ pascoe@
* remove trailing newline in panic(9); ok millert@ and deraadt@fgsch2005-07-181-2/+2
|
* Relocate debugging printf so it describes the right thing.pascoe2005-04-211-2/+2
|
* use snprintf to avoid crossing the overflow point; ok ottoderaadt2005-04-161-3/+4
|
* change usbd_printBCD() to return number of bytes really placed or 0, notderaadt2005-04-161-2/+9
| | | | snprintf() style semantics [which people fail to grok]; ok otto
* Merge support for USB1 devices located beyond USB2 hubs, mostly from netbsd.pascoe2005-03-131-8/+25
| | | | | | | Supports bulk, control and interrupt pipes, letting USB1 keyboards and most network interfaces work when connected to a USB2 hub. ok dlg@