summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/usb.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* Remove config_activate() and DVACT_ACTIVATE. PCMCIA's the only thingmatthew2011-07-031-3/+1
| | | | | | | | that's ever used it, and it's long since been changed to use DVACT_{QUIESCE,SUSPEND,RESUME} instead. ok deraadt@, dlg@; miod@ also agreed with this idea when I brought it up a few weeks ago
* remove horrible abuse of kthread_create_deferred(9). this was beingjakemsr2011-04-281-46/+36
| | | | | | | | | | | | used to "do things later" and was potentially sleeping in swapper context. the latter is really bad, because it might never wake up. instead, move the things that usb_first_explore() was doing to the first run of the explore task. since tasks are run in a kthread, they are in process context and ok to sleep. fixes boot hang noticed by jsg@, which mikeb@ debugged and found usb_first_explore() to be sleeping swapper context
* bring back changes in usb.c revision 1.73jakemsr2011-02-091-46/+111
| | | | | | | | | | | | | | | | 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-85/+34
| | | | this is causing problems with suspend/resume for some people.
* * merge 'onqueue' and 'running' members of struct usb_task intojakemsr2011-02-041-34/+85
| | | | | | | | | | 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-241/+1
| | | | | | them from userland, and nothing in the kernel uses them. ok krw@, miod@
* * add 'udi_serial' to struct usb_device_info.jakemsr2011-01-151-1/+21
| | | | | | | * 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
* * check that the root hub has been configured before trying tojakemsr2010-12-061-9/+11
| | | | | | free it's resources * use usbd_is_dying() instead of directly checking the device's bus dying flag
* create another kthread to run xfer abort tasks. xfer abort tasks cannotjakemsr2010-10-231-22/+89
| | | | | | | | | | | 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-2/+25
| | | | | | | | | | | | | | | * 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.
* add a 'dying' flag to struct usbd_bus. use this to signify the busjakemsr2010-09-231-12/+15
| | | | | | | | | is dying, instead of setting a flag in struct usb_softc. as usbd_device_handle has a pointer to the usbd_bus it's attached to, usb devices, and functions they run or functions run on their behalf, can now easily check if their bus is dying. use this to stop usbd_do_request* from running and the usb task thread from adding new tasks when a device's bus is dying.
* instead of waiting the full power-up-to-power-steady time for rootjakemsr2010-09-231-3/+12
| | | | | | | hubs before their first port explore, check how long it's actually been since power up and only wait as necessary. saves a little time on boot, especially now that explore tasks are serialized. ok yuo@
* instead of running usb_explore() from individual kthreads for eachjakemsr2010-09-231-107/+123
| | | | | | | USB bus, make usb_explore() a usb_task. reduces races during normal USB device detach, since now usb_tasks and detach happen in the same process. ok yuo@, matthew@ helped with the task thread loop
* rename usb_discover to usb_explore for consistency.jakemsr2010-09-231-7/+7
| | | | OK krw
* In xxactivate() DVACT_DEACTIVATE, when calling a series of config_deactivate()deraadt2010-08-311-5/+7
| | | | | | for sub-devices, return the last error return value instead of |'ing the failures together and creating some value that is non-0 (bravo!) but potentially loses the specific error value...
* Every selwakeup() should have a matching KNOTE() (even if kqueue isn'tnicm2009-11-091-2/+1
| | | | | | | | | | supported it doesn't do any harm), so put the KNOTE() in selwakeup() itself and remove it from any occurences where both are used, except one for kqueue itself and one in sys_pipe.c (where the selwakeup is under a PIPE_SEL flag). Based on a diff from tedu. ok deraadt
* Get rid of __HAVE_GENERIC_SOFT_INTERRUPTS now that all our platforms support it.kettenis2009-11-041-9/+2
| | | | ok jsing@, miod@
* Add missing KNOTE() calls after selwakeup(), until we decide if the KNOTE()deraadt2009-10-311-1/+2
| | | | | | | calls can go directly into selwakeup() safely long discussion with nicm, murmers of consent from tedu and miod, noone else seems to care of kqueue is busted as long as it makes their sockets move data fast... pretty sad.
* Get rid of devact enum, substitute it with an int and coresponding defines.pirofti2009-10-131-3/+3
| | | | | | This is needed for the addition of further suspend/resume actions. Okay deraadt@, marco@.
* assign ehcidebug to USB_DEBUG ioctl argument.yuo2008-12-091-4/+16
| | | | | | | add priv check to the ioctl. only root priv should access these debug flags. ok deraadt@
* 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@
* Replace the USB_USE_SOFTINTR macro with __HAVE_GENERIC_SOFT_INTTERUPTSmbalmer2007-06-151-19/+3
| | | | | | | | (which was used to define USB_USE_SOFTINTR). No binary changes. ok dlg, mk.
* Remove the definition and usage of the USB_DECLARE_DRIVER_CLASS andmbalmer2007-06-141-2/+17
| | | | | | | | USB_DECLARE_DRIVER macros. No binary change. ok dlg.
* Apply some KNF after the recent removal of macros and type definitions.mbalmer2007-06-131-5/+5
| | | | | | No binary change. ok ray.
* Remove the definition and use of the device_ptr_t which was a struct device *.mbalmer2007-06-121-4/+4
| | | | | | No binary change. ok mk.
* Remove the usb_proc_ptr type definition, which was really a 'struct proc *'mbalmer2007-06-111-8/+8
| | | | | | | | only. No binary change. ok mk.
* Remove the USB_GET_SC_OPEN macro. There is a double check for sc == NULL inmbalmer2007-06-111-2/+6
| | | | | | | | ulpt.c, I am aware of that and it will be changed later. No binary change. ok mk.
* Remove the definition and use of the USB_GET_SC macro, no binary change.mbalmer2007-06-111-2/+2
| | | | ok mk.
* More USB cleanup: In usb_port.h, get rid of the sel_klist #definemk2007-06-111-3/+3
| | | | | | | (which was there twice without gcc complaining) and update all uses of it. ok jsg mbalmer
* Get rid of the USBDEVPTRNAME macro.mbalmer2007-06-101-2/+2
| | | | | | No binary change. ok jsg.
* Remove the definition and use of USBDEVUNIT.mbalmer2007-06-101-3/+3
| | | | ok jsg.
* Remove the definition and use of the USBDEVNAME macro.mbalmer2007-06-101-5/+5
| | | | | | | (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 definition and use of the USBDEV macro. It only created confusionmbalmer2007-06-101-2/+2
| | | | | | | | and the address of it's argument: USBDEV(sc->sc_dev) yields &sc->sc_dev. No binary changes. ok jsg.
* Remove definitions and usage of usb_callout and related macros. These macrosmbalmer2007-06-101-6/+8
| | | | | | | | were used as a layer of confusion^Wabstraction around the timeout(9) API. No binary change. ok jsg.
* Mechanical removal of USBBASEDEVICE. No binary change.mk2007-06-061-2/+2
| | | | | | Tested by thib and myself. ok mbalmer jsg
* Remove the "Static" declaration of many functions. It was defined to be emptymbalmer2007-06-051-22/+22
| | | | | | | 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.
* Last part of FreeBSD/NetBSD sepcific code removal.mbalmer2007-06-041-17/+1
| | | | ok jsg@
* Farewell USB_{ATTACH,MATCH,DETACH}* you will not be missed.jsg2007-05-271-8/+8
| | | | ok deraadt@ krw@ mbalmer@
* Remove logprintf macrojsg2007-05-211-3/+3
|
* Reapplication of rev 1.36.pascoe2007-03-221-1/+7
| | | | | | | | | Wait the stable power delay on a USB hub only once per hub (not per port), and defer the delay for root hubs until the host controller event thread starts, permitting some concurrency. Speeds up the boot process dramatically when you have lots of host controllers. ok dlg@
* Backout pascoe@'s last USB change because it page faults at attachmentmglocker2007-03-181-7/+1
| | | | | | | | | time. Chris; Get your shiz fixed and tested for the next time. We have better todo then wasting our time by backing out untested stuff. OK deraadt, OK ckuethe
* Wait the stable power delay on a USB hub only once per hub (not per port),pascoe2007-03-181-1/+7
| | | | | | | | and defer the delay for root hubs until the host controller event thread starts, permitting some concurrency. Speeds up the boot process dramatically when you have lots of host controllers. ok dlg@
* poll errors should be POLLERR, not some random E valuetedu2006-11-011-2/+2
| | | | from alexandre ratchov. ok claudio
* get rid of the usb_port.h macros that wrap our kthread create functions.dlg2006-09-181-13/+10
| | | | looks ok pascoe@
* In a drivers activate() entry point, if on DVACT_DEACTIVATE it doesmiod2006-06-231-2/+2
| | | | | | something, then it MUST return zero on DVACT_ACTIVATE, not EOPNOTSUPP; this very popular bug has been cut and pasted a lot of times... ok deraadt@ mickey@
* 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@.
* make all usb1 controllers sleep until all the usb2 controllers have probeddlg2005-10-111-1/+16
| | | | | | | | | and handed over any usb1 devices to the companion. without this usb1 devices didnt appear till after root was mounted, which is frustrating if you want to use a usb keyboard to enter the root device. tested by kettenis@ and drahn@ ok drahn@ go for it deraadt@
* better way to do the reattachement of a devicedlg2004-12-121-1/+10
|
* put "do { } while (0)" wrappers on all the debug maroc functionsderaadt2004-07-081-3/+3
|
* This moves access to wall and uptime variables in MI code,tholo2004-06-241-4/+4
| | | | | | | | | | | | | | encapsulating all such access into wall-defined functions that makes sure locking is done as needed. It also cleans up some uses of wall time vs. uptime some places, but there is sure to be more of these needed as well, particularily in MD code. Also, many current calls to microtime() should probably be changed to getmicrotime(), or to the {,get}microuptime() versions. ok art@ deraadt@ aaron@ matthieu@ beck@ sturm@ millert@ others "Oh, that is not your problem!" from miod@