summaryrefslogtreecommitdiff
path: root/sys/dev/usb/usb.c
Commit message (Collapse)AuthorAgeFilesLines
* Pull in the most recent version of usb_quirks.h and propagate the necessaryNick Hibma2001-07-051-2/+2
| | | | | | | | | changes to the various files. Also, pull in most of the current usb_subr.c file. Notes: svn path=/head/; revision=79309
* Activate the kthread mechanism for doing usb bus discovery. This meansPeter Wemm2001-06-061-46/+46
| | | | | | | | | | | | | | | | | | | | | | | | that device add/remove will work without usbd running. usbd is still used for execing stuff, but that is all now. Ideally it could be replaced by a devd some day. Until now, usbd had to be running so that the USB_DISCOVER ioctl could be called to walk the tree when an attachment status change was noticed. Among the changes: - when a detach happens, remove any pending 'attach' messages or the system suffers from whiplash from exec moused / kill moused loops if you do lots of attach/detach and later start usbd. - tweaks related to kthread differences - disable the select handler for the old interface (never return success). I have not removed it yet or old usbd's will abort. That can get removed later once usbd is cleaned up and things have stabilized for a few weeks. - get Giant in the kthread. - a couple of minor potential bug fixes (usb_nevents vs malloc failure etc) Pre-approved by: n_hibma (ages and ages ago) Notes: svn path=/head/; revision=77839
* Undo part of the tangle of having sys/lock.h and sys/mutex.h included inMark Murray2001-05-011-0/+2
| | | | | | | | | | | | | | other "system" header files. Also help the deprecation of lockmgr.h by making it a sub-include of sys/lock.h and removing sys/lockmgr.h form kernel .c files. Sort sys/*.h includes where possible in affected files. OK'ed by: bde (with reservations) Notes: svn path=/head/; revision=76166
* Send the remains (such as I have located) of "block major numbers" toPoul-Henning Kamp2001-03-261-1/+0
| | | | | | | the bit-bucket. Notes: svn path=/head/; revision=74810
* Grab the process lock while calling psignal and before calling psignal.John Baldwin2001-03-071-2/+5
| | | | Notes: svn path=/head/; revision=73929
* Change default devfs permissions to the ones in MAKEDEV.Nick Hibma2001-02-191-2/+2
| | | | | | | Suggested by: rwatson Notes: svn path=/head/; revision=72703
* select() DKI is now in <sys/selinfo.h>.Garrett Wollman2001-01-091-0/+4
| | | | Notes: svn path=/head/; revision=70834
* Finally make the module dependencies work. kern_linker.c now allowsNick Hibma2000-08-041-6/+9
| | | | | | | | | | | modules to depend on modules in the same file (uhub depends on usb) or even on themselves (usb on usb, makes the define in usb_port.h a lot less convoluted). Use ANSI prototypes. Notes: svn path=/head/; revision=64250
* Make the module dependencies actually work.Nick Hibma2000-06-151-2/+1
| | | | | | | | | | Specifying 'umass_load="YES"' in /boot/loader.conf or doing a 'kldload umass' now loads usb.ko automagically. Prodded by: green Notes: svn path=/head/; revision=61705
* Back out the previous change to the queue(3) interface.Jake Burkholder2000-05-261-2/+2
| | | | | | | | | It was not discussed and should probably not happen. Requested by: msmith and others Notes: svn path=/head/; revision=60938
* Change the way that the queue(3) structures are declared; don't assume thatJake Burkholder2000-05-231-2/+2
| | | | | | | | | | | the type argument to *_HEAD and *_ENTRY is a struct. Suggested by: phk Reviewed by: phk Approved by: mdodd Notes: svn path=/head/; revision=60833
* Change Lennart's e-mail address.Nick Hibma2000-05-141-1/+1
| | | | Notes: svn path=/head/; revision=60545
* Use the new and shiny module versioning. This enables you to load theNick Hibma2000-05-081-0/+2
| | | | | | | | | | | | ums driver (mouse) and get the usb driver at the same time. This also shows that MODULE_VERSION(usb, 1); MODULE_DEPEND(usb, usb, 1, 1, 1); in the same module in one source file works. Notes: svn path=/head/; revision=60202
* Increase the debugging level on a printf.Nick Hibma2000-05-071-1/+1
| | | | Notes: svn path=/head/; revision=60177
* OpenBSD has a broken debugger that does not grok static. Use aNick Hibma2000-04-031-10/+10
| | | | | | | | | #define Static static that the OpenBSD folks can define it to be empty if they like. Notes: svn path=/head/; revision=58986
* Add support for DEVICE_SUSPEND, DEVICE_RESUME and DEVICE_SHUTDOWNNick Hibma2000-01-201-1/+5
| | | | | | | | | | | | | methods for USB devices. However: with none of the devices I have here suspend seems to work properly. This is probably a bug in uhci_power which I still have to look at. Prodded and pushed by: Christopher Masto <chris@netmonger.net> Notes: svn path=/head/; revision=56348
* Fix the 'usb0: USB revision unknown, not supported' people have been seeingNick Hibma1999-12-031-2/+0
| | | | | | | | | | | by identifying the version in the PCI drivers. The OHCI driver just presets this to 1.0 as it is not specified in the PCI registers anywhere. This should be revisited once USB 2.0 is in wide spread use. Notes: svn path=/head/; revision=54050
* Woops, it seems to fail initialisation. Disabled while I am figuring outNick Hibma1999-11-281-0/+2
| | | | | | | | | how to get the USB revision from the OHCI controller. Now where did I leave that spec? ... Notes: svn path=/head/; revision=53862
* Add USB revision strings and numbers.Nick Hibma1999-11-281-10/+32
| | | | Notes: svn path=/head/; revision=53849
* Enclosed the arguments of binary and in brackets.Nick Hibma1999-11-211-5/+7
| | | | Notes: svn path=/head/; revision=53513
* Make the event creation workNick Hibma1999-11-191-16/+26
| | | | | | | | | - Create the /dev/usb event queue device node. - Add usbread to the cdevsw. - Also hide the many minor() behind a USBUNIT macro. Notes: svn path=/head/; revision=53423
* Synchronisation with NetBSD as of 1999/11/16:Nick Hibma1999-11-171-118/+331
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Cleaning up the code: - Declare many functions static - Change variable names to make them more self explanatory - Change usbd_request_handle -> usbd_xfer_handle - Syntactical changes - Remove some unused code - Other KNF changes Interrupt context handling - Change delay to usbd_delay_ms were possible (takes polling mode into account) - Change detection mechanism for interrupt context Add support for pre-allocation DMA-able memory by device driver Add preliminary support for isochronous to the UHCI driver (not for OHCI yet). usb.c, uhci.c, ohci.c - Initial attempt at detachable USB host controllers - Handle the use_polling flag with a lttle more care and only set it if we are cold booting. usb.c, uhci.c ohci.c, usbdi.c usbdi_util.c usb_subr.c - Make sure an aborted pipe is marked as not running. - Start queued request in the right order. - Insert some more DIAGNOSTIC sanity checks. - Remove (almost) unused definitions USBD_XFER_OUT and USBD_XFER_IN. usb.c, usb_subr.c - Add an event mechanism so that a userland process can watch devices come and go. ohci.c - Handle the case when a USB transfer is so long that it crosses two page (4K) boundaries. OHCI cannot do that with a single TD so we make a chain. ulpt.c - Use a bigger buffer when transferring data. - Pre-allocate the DMA buffer. This makes the driver slightly more efficient. - Comment out the GET_DEVICE_ID code, because for some unknown reason it causes printing to fail sometimes. usb.h - Add a macro to extract the isoc type. - Add a macro to check whether the routine has been entered after splusb and if not, complain. usbdi.c - Fix a glitch in dequeueing and aborting requests on interrupt pipes. - Add a flag in the request to determine if the data copying is done by the driver or the usbdi layer. Notes: svn path=/head/; revision=53313
* Remove superfluous header file includes.Nick Hibma1999-11-081-1/+1
| | | | | | | Pushed-By: phk Notes: svn path=/head/; revision=53027
* Remove a debugging printf.Nick Hibma1999-10-071-2/+0
| | | | Notes: svn path=/head/; revision=51999
* Major synchronisation with the NetBSD USB stack:Nick Hibma1999-10-071-75/+138
| | | | | | | | | | | | | | - Some cleanup and improvements in the uhci and ohci drivers - Support for plugging and unplugging devices improved - Now available is bulk transport over OHCI controllers - Resume and suspend have been temporarily been disabled again. Proper support for it is available in the uhci.c and ohci.c files but I have not yet spent the brain cycles to use it. - OpenBSD now uses the USB stack as well - Add FreeBSD tags Notes: svn path=/head/; revision=51991
* Remove five now unused fields from struct cdevsw. They should neverPoul-Henning Kamp1999-09-251-5/+0
| | | | | | | | | | | have been there in the first place. A GENERIC kernel shrinks almost 1k. Add a slightly different safetybelt under nostop for tty drivers. Add some missing FreeBSD tags Notes: svn path=/head/; revision=51658
* Add comments, change variable names to make them consistent (r -> err,Nick Hibma1999-07-251-9/+10
| | | | | | | timo_handle -> timeout_handle, p -> pipe, *pipe -> *rpipe, etc.) Notes: svn path=/head/; revision=49085
* USB stopped working as of the recent cdevsw cleanup. This fixes that.Nick Hibma1999-06-011-1/+1
| | | | Notes: svn path=/head/; revision=47656
* This commit should be a extensive NO-OP:Poul-Henning Kamp1999-05-301-4/+19
| | | | | | | | | | | | | | | | Reformat and initialize correctly all "struct cdevsw". Initialize the d_maj and d_bmaj fields. The d_reset field was not removed, although it is never used. I used a program to do most of this, so all the files now use the same consistent format. Please keep it that way. Vinum and i4b not modified, patches emailed to respective authors. Notes: svn path=/head/; revision=47625
* Enclose .hcidebug in '#ifdef N.HCI'Nick Hibma1999-04-201-6/+20
| | | | Notes: svn path=/head/; revision=45880
* Bring the 'new-bus' to the i386. This extensively changes the way thePeter Wemm1999-04-161-1/+2
| | | | | | | | | | | | | | | | | | | | | i386 platform boots, it is no longer ISA-centric, and is fully dynamic. Most old drivers compile and run without modification via 'compatability shims' to enable a smoother transition. eisa, isapnp and pccard* are not yet using the new resource manager. Once fully converted, all drivers will be loadable, including PCI and ISA. (Some other changes appear to have snuck in, including a port of Soren's ATA driver to the Alpha. Soren, back this out if you need to.) This is a checkpoint of work-in-progress, but is quite functional. The bulk of the work was done over the last few years by Doug Rabson and Garrett Wollman. Approved by: core Notes: svn path=/head/; revision=45720
* 1) Make debugging more selective.Nick Hibma1999-04-111-4/+3
| | | | | | | | | | 2) create function usbd_errstr which turns a usbd_status into a sensible error message 3) Change the printf in DPRINTF to logprintf which is a define for log(KERN_DEBUG, x) Notes: svn path=/head/; revision=45604
* Textual changesNick Hibma1999-01-221-7/+2
| | | | Notes: svn path=/head/; revision=43025
* Changed 'xxxdebug = 0' to '...= 1' (Brian Feldman)Nick Hibma1999-01-131-4/+4
| | | | Notes: svn path=/head/; revision=42609
* Sync with NetBSD sources. Almost there. Mostly style fixes.Nick Hibma1999-01-101-4/+5
| | | | Notes: svn path=/head/; revision=42490
* Major synchronisation with NetBSD USB codeNick Hibma1999-01-071-245/+58
| | | | Notes: svn path=/head/; revision=42384
* Added Id to all filesNick Hibma1998-12-141-0/+1
| | | | Notes: svn path=/head/; revision=41783
* Various bug fixes:Nick Hibma1998-12-091-1/+1
| | | | | | | | | | | 1) Removed 'emulation' of bitmaps in printfs, FreeBSD seems to have caught up on that one 2) Fixed a few bugs in the timeout/timo timeout variables 3) First attempt at fixing a bug mentioned by Kazu: uhci_run is not able start/stop his USB host on his motherboard. Notes: svn path=/head/; revision=41625
* Initial commit of ported NetBSD USB stackNick Hibma1998-11-261-0/+603
Notes: svn path=/head/; revision=41366