summaryrefslogtreecommitdiff
path: root/sys/dev/usb/usb_subr.c
Commit message (Collapse)AuthorAgeFilesLines
* Pull in the most recent version of usb_quirks.h and propagate the necessaryNick Hibma2001-07-051-170/+118
| | | | | | | | | changes to the various files. Also, pull in most of the current usb_subr.c file. Notes: svn path=/head/; revision=79309
* Undo previous commit. <machine/clock.h> is needed for the prototypeNick Hibma2000-10-161-0/+1
| | | | | | | for DELAY(). Notes: svn path=/head/; revision=67218
* Remove unneeded #include <machine/clock.h>Poul-Henning Kamp2000-10-151-1/+0
| | | | Notes: svn path=/head/; revision=67164
* From NetBSD:Nick Hibma2000-08-131-22/+49
| | | | | | | | | | | | | | | | | Make it possible to move a device to its unconfigured state by using config #0. Add some comments. Change error reporting in port reset function. usbd_devinfo_vp(): search the know devs array also if the device doesn't return product description (e.g. Kye's Genius NetScroll mouse returns vendor, but not product); the strings returned by device are still preferred to those in the array, though Notes: svn path=/head/; revision=64619
* Remove __P prototypes to reduce diffs between the NetBSD and FreeBSDNick Hibma2000-07-171-9/+9
| | | | | | | versions. Notes: svn path=/head/; revision=63319
* Change Lennart's e-mail address.Nick Hibma2000-05-141-1/+1
| | | | Notes: svn path=/head/; revision=60545
* OpenBSD has a broken debugger that does not grok static. Use aNick Hibma2000-04-031-12/+12
| | | | | | | | | #define Static static that the OpenBSD folks can define it to be empty if they like. Notes: svn path=/head/; revision=58986
* Don't use tsleep when cold booting. It is called before bus->use_pollingNick Hibma2000-02-061-1/+1
| | | | | | | | | | | | | is initialised by usb_init. This might solve problems with some controllers not being initiliased properly, because a delay was effectively a tsleep that returned immediately. Approved by: jhk Notes: svn path=/head/; revision=57011
* More USB ethernet tweaks:Bill Paul2000-01-201-25/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Sync ohci, uhci and usbdi modules with NetBSD in order to obtain the following improvements: o New USBD_NO_TSLEEP flag can be used in place of UQ_NO_TSLEEP quirk. This allows drivers to specify busy waiting only for certain transfers (namely control transfers for reading/writing registers and stuff). o New USBD_FORCE_SHORT_XFER flag can be used to deal with devices like the ADMtek Pegasus that sense the end of bulk OUT transfers in a special way (if a transfer is exactly a multiple of 64 bytes in size, you need to send an extra empty packet to terminate the transfer). o usbd_open_pipe_intr() now accepts an interval argument which can be used to change the rate at which the interrupt callback routine is invoked. Specifying USBD_DEFAULT_INTERVAL uses the value specified in the device's config data, but drivers can override it if needed. - Change if_aue to use USBD_FORCE_SHORT_XFER for packet transmissions. - Change if_aue, if_kue and if_cue to use USBD_NO_TSLEEP for all control transfers. We no longer force the non-tsleep hack for bulk transfers since these are done asynchronously anyway. - Removed quirk entry fiddling from if_aue and if_kue since we don't need it anymore now that we have the USBD_NO_TSLEEP flag. - Tweak ulpt, uhid, ums and ukbd drivers to use the new arg to usbd_open_pipe_intr(). - Add a flag to the softc struct in the ethernet drivers to indicate when a device has been detached, and use this flag to perform tests to prevent the drivers from trying to do control transfers if this is the case. This is necessary because calling if_detach() with INET6 enabled will eventually result in a call to the driver's ioctl() routine to delete the multicast groups on the interface, which will result in attempts to perform control transfers. (It's possible this also happens even without INET6 support enabled.) This is pointless since we know that if the detach method has been called, the hardware has been unplugged. - Changed watchdog timeout routines to just call the driver init routines to initialize the device states without trying to close and re-open the pipes. This is partly because we don't want to frob things at interrupt context, but also because this doesn't seem to work right and I don't want to panic the system just because a USB device may have stopped responding. - Fix aue_rxeof() to be a little smarter about detecting when a double transfer is needed. Unfortunately, the design of the chip makes it hard to get this exactly right. Hopefully, this will go away once either Nick or Lennart finds the bug in the uhci driver that makes this ugly hack necessary. - Also sync usbdevs with NetBSD. Notes: svn path=/head/; revision=56318
* Remove the 'ivars' arguement to device_add_child() andMatthew N. Dodd1999-12-031-3/+5
| | | | | | | | | | | | | | | | | | | device_add_child_ordered(). 'ivars' may now be set using the device_set_ivars() function. This makes it easier for us to change how arbitrary data structures are associated with a device_t. Eventually we won't be modifying device_t to add additional pointers for ivars, softc data etc. Despite my best efforts I've probably forgotten something so let me know if this breaks anything. I've been running with this change for months and its been quite involved actually isolating all the changes from the rest of the local changes in my tree. Reviewed by: peter, dfr Notes: svn path=/head/; revision=54073
* Add devnames, the device names the drivers attached to for usbd.Nick Hibma1999-11-281-14/+42
| | | | | | | | 0 -> NULL changes. Add realloc (for OpenBSD) Notes: svn path=/head/; revision=53852
* Addition of new fields to the usb_devinfo struct to enable the newNick Hibma1999-11-211-3/+9
| | | | | | | | | | | | | | | | | | | | | and shiny usbd daemon to handle events. usb_port.h: - Add a macro to retrieve the unit number from a USBBASEDEVICE usb.h, usb_subr.c: - Add fields to the device_info struct. usb_subr.c: - Fill in the new fields. - Remove the notification of the event up a bit to make sure all the information is still available to fill the usb_devinfo struct. This requires recompilation of usbdevs (src/usr.sbin/usbdevs) and the ezdownload/ezupload (ports/misc/ezload) utilities in any case. Notes: svn path=/head/; revision=53515
* Synchronisation with NetBSD as of 1999/11/16:Nick Hibma1999-11-171-122/+194
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 includeNick Hibma1999-11-081-1/+1
| | | | | | | Submitted-By: phk Notes: svn path=/head/; revision=53030
* Major synchronisation with the NetBSD USB stack:Nick Hibma1999-10-071-266/+335
| | | | | | | | | | | | | | - 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
* Add comments, change variable names to make them consistent (r -> err,Nick Hibma1999-07-251-116/+125
| | | | | | | timo_handle -> timeout_handle, p -> pipe, *pipe -> *rpipe, etc.) Notes: svn path=/head/; revision=49085
* Only print the device name once, during attach (device_quiet)Nick Hibma1999-06-211-0/+2
| | | | Notes: svn path=/head/; revision=48087
* Enable attachment of multiple drivers to a single device.Nick Hibma1999-05-301-11/+16
| | | | Notes: svn path=/head/; revision=47631
* Remove feature creep: STAILQ_REMOVE_HEAD_UNTIL added it for convenienceNick Hibma1999-04-201-0/+4
| | | | | | | but we can do without it. Notes: svn path=/head/; revision=45887
* 1) Add Rockfire vendor and gamepad product (MAEKAWA Masahide)Nick Hibma1999-04-191-1/+38
| | | | | | | | | 2) Sort the list again (Roger Hardiman) 3) Reinstate a piece of code to look for a name for a device if none is found in the device itself. Notes: svn path=/head/; revision=45841
* 1) Make debugging more selective.Nick Hibma1999-04-111-95/+24
| | | | | | | | | | 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
* Cosmetical changes.Nick Hibma1999-03-221-1/+3
| | | | Notes: svn path=/head/; revision=44944
* Textual changesNick Hibma1999-01-221-3/+12
| | | | Notes: svn path=/head/; revision=43025
* Sync with NetBSD sources. Almost there. Mostly style fixes.Nick Hibma1999-01-101-13/+3
| | | | Notes: svn path=/head/; revision=42490
* Major synchronisation with NetBSD USB codeNick Hibma1999-01-071-171/+434
| | | | Notes: svn path=/head/; revision=42384
* Added Id to all filesNick Hibma1998-12-141-0/+1
| | | | Notes: svn path=/head/; revision=41783
* Updated USB kernel sources to NetBSD sources of 1998-12-09.Nick Hibma1998-12-131-29/+21
| | | | | | | | 1 bug fix and several textual changes. Preparing to feed back changes for port into NetBSD to create one source base. Notes: svn path=/head/; revision=41736
* Various bug fixes:Nick Hibma1998-12-091-2/+3
| | | | | | | | | | | 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/+880
Notes: svn path=/head/; revision=41366