summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/usb.c
Commit message (Collapse)AuthorAgeFilesLines
...
* Merge from NetBSD.joe2002-01-281-16/+41
| | | | | | | | | | | | | | | | | | | | uhub.c: revision 1.37 usb.4: revision 1.30 usb.c: revision 1.38 usb.h: revision 1.40 usb_port.h: revision 1.21 usb_subr.c: revision 1.65 usbdi.h: revision 1.40 Split the attach/detach events up into device, driver and controller attach and detach events. The commit message from NetBSD was: date: 2000/02/02 07:34:00; author: augustss; state: Exp; Change the USB event mechanism to include more information about devices and drivers. Partly from FreeBSD. Also rework usbd to take these new event types into account.
* Back out the last commit. I committed the wrong file by accident.joe2002-01-261-39/+14
| | | | | The commit message wasn't relevant to that change. This code will be committed later.
* Rearrange the code in USB_DETACH, so that it's like NetBSD's.joe2002-01-261-14/+39
| | | | No functional change.
* Merge from NetBSD:joe2002-01-261-0/+6
| | | | | | | | | | usb.c: revision 1.39 revision 1.39 date: 2000/02/22 11:30:56; author: augustss; lines: +7 -1 Prepare a little for having USB interrupt processing done outside the hard interrupt level (in a thread or a softintr). No real soft processing done yet.
* Merge from NetBSD:joe2002-01-261-1/+1
| | | | | | | | | | usb.c: revision 1.41 revision 1.41 date: 2000/03/16 00:46:38; author: augustss; lines: +2 -2 Make the USB event queue longer. Mine overflows before the (user-land) event handler has started. But then I have about 25 devices connected. :)
* Merge from NetBSD:joe2002-01-241-5/+18
| | | | | | | | | | | | | | | | | | usb.c: -r1.35 - 1.37 usb_port.h: tiny bit of -r1.26 + an extra bit in the FreeBSD config section. revision 1.37 date: 2000/01/24 18:35:51; author: thorpej; state: Exp; lines: +7 -1 Use config_pending. ---------------------------- revision 1.36 date: 1999/12/22 23:54:09; author: augustss; state: Exp; lines: +2 -2 Use the flags `locator' to govern if devices are detected early or late during cold boot. ---------------------------- revision 1.35 date: 1999/12/20 02:12:23; author: augustss; state: Exp; lines: +8 -5 Make sure tsleep() is not called during cold boot.
* Revert uio.uio_td back to uio.uio_procp, using a #define in usb_port tojoe2002-01-021-2/+2
| | | | do the right thing on -current.
* Sync with NetBSD. Non-functional changes that bring this filejoe2002-01-021-55/+25
| | | | | | closer to the NetBSD version. Reviewed by: md5
* Sync usb.h with NetBSD, apart from usb_device_info.speed, whichjoe2002-01-021-4/+4
| | | | | requires logic changes. For now leave it as usb_device_info.lowspeed. It will get addressed when the usb.c code is sync'd.
* NetBSD have introduced usb_proc_ptr for us (they'll be needing it soon too)joe2002-01-021-11/+11
| | | | to hide the distinction between struct proc and struct thread.
* Use the passed in thread to selrecord() instead of curthread.jhb2001-09-211-1/+1
|
* KSE Milestone 2julian2001-09-121-12/+12
| | | | | | | | | | | | | | Note ALL MODULES MUST BE RECOMPILED make the kernel aware that there are smaller units of scheduling than the process. (but only allow one thread per process at this time). This is functionally equivalent to teh previousl -current except that there is a thread associated with each process. Sorry john! (your next MFC will be a doosie!) Reviewed by: peter@freebsd.org, dillon@freebsd.org X-MFC after: ha ha ha ha
* Pull in the most recent version of usb_quirks.h and propagate the necessaryn_hibma2001-07-051-2/+2
| | | | | | changes to the various files. Also, pull in most of the current usb_subr.c file.
* Activate the kthread mechanism for doing usb bus discovery. This meanspeter2001-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)
* Undo part of the tangle of having sys/lock.h and sys/mutex.h included inmarkm2001-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)
* Send the remains (such as I have located) of "block major numbers" tophk2001-03-261-1/+0
| | | | the bit-bucket.
* Grab the process lock while calling psignal and before calling psignal.jhb2001-03-071-2/+5
|
* Change default devfs permissions to the ones in MAKEDEV.n_hibma2001-02-191-2/+2
| | | | Suggested by: rwatson
* select() DKI is now in <sys/selinfo.h>.wollman2001-01-091-0/+4
|
* Finally make the module dependencies work. kern_linker.c now allowsn_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.
* Make the module dependencies actually work.n_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
* Back out the previous change to the queue(3) interface.jake2000-05-261-2/+2
| | | | | | It was not discussed and should probably not happen. Requested by: msmith and others
* Change the way that the queue(3) structures are declared; don't assume thatjake2000-05-231-2/+2
| | | | | | | | the type argument to *_HEAD and *_ENTRY is a struct. Suggested by: phk Reviewed by: phk Approved by: mdodd
* Change Lennart's e-mail address.n_hibma2000-05-141-1/+1
|
* Use the new and shiny module versioning. This enables you to load then_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.
* Increase the debugging level on a printf.n_hibma2000-05-071-1/+1
|
* OpenBSD has a broken debugger that does not grok static. Use an_hibma2000-04-031-10/+10
| | | | | | #define Static static that the OpenBSD folks can define it to be empty if they like.
* Add support for DEVICE_SUSPEND, DEVICE_RESUME and DEVICE_SHUTDOWNn_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>
* Fix the 'usb0: USB revision unknown, not supported' people have been seeingn_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.
* Woops, it seems to fail initialisation. Disabled while I am figuring outn_hibma1999-11-281-0/+2
| | | | | | how to get the USB revision from the OHCI controller. Now where did I leave that spec? ...
* Add USB revision strings and numbers.n_hibma1999-11-281-10/+32
|
* Enclosed the arguments of binary and in brackets.n_hibma1999-11-211-5/+7
|
* Make the event creation workn_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.
* Synchronisation with NetBSD as of 1999/11/16:n_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.
* Remove superfluous header file includes.n_hibma1999-11-081-1/+1
| | | | Pushed-By: phk
* Remove a debugging printf.n_hibma1999-10-071-2/+0
|
* Major synchronisation with the NetBSD USB stack:n_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
* Remove five now unused fields from struct cdevsw. They should neverphk1999-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
* Add comments, change variable names to make them consistent (r -> err,n_hibma1999-07-251-9/+10
| | | | timo_handle -> timeout_handle, p -> pipe, *pipe -> *rpipe, etc.)
* USB stopped working as of the recent cdevsw cleanup. This fixes that.n_hibma1999-06-011-1/+1
|
* This commit should be a extensive NO-OP:phk1999-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.
* Enclose .hcidebug in '#ifdef N.HCI'n_hibma1999-04-201-6/+20
|
* Bring the 'new-bus' to the i386. This extensively changes the way thepeter1999-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
* 1) Make debugging more selective.n_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)
* Textual changesn_hibma1999-01-221-7/+2
|
* Changed 'xxxdebug = 0' to '...= 1' (Brian Feldman)n_hibma1999-01-131-4/+4
|
* Sync with NetBSD sources. Almost there. Mostly style fixes.n_hibma1999-01-101-4/+5
|
* Major synchronisation with NetBSD USB coden_hibma1999-01-071-245/+58
|
* Added Id to all filesn_hibma1998-12-141-0/+1
|
* Various bug fixes:n_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.
OpenPOWER on IntegriCloud