summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/usb_subr.c
Commit message (Collapse)AuthorAgeFilesLines
...
* Change Lennart's e-mail address.n_hibma2000-05-141-1/+1
|
* OpenBSD has a broken debugger that does not grok static. Use an_hibma2000-04-031-12/+12
| | | | | | #define Static static that the OpenBSD folks can define it to be empty if they like.
* Don't use tsleep when cold booting. It is called before bus->use_pollingn_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
* More USB ethernet tweaks:wpaul2000-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.
* Remove the 'ivars' arguement to device_add_child() andmdodd1999-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
* Add devnames, the device names the drivers attached to for usbd.n_hibma1999-11-281-14/+42
| | | | | 0 -> NULL changes. Add realloc (for OpenBSD)
* Addition of new fields to the usb_devinfo struct to enable the newn_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.
* Synchronisation with NetBSD as of 1999/11/16:n_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.
* remove superfluous header includen_hibma1999-11-081-1/+1
| | | | Submitted-By: phk
* Major synchronisation with the NetBSD USB stack:n_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
* Add comments, change variable names to make them consistent (r -> err,n_hibma1999-07-251-116/+125
| | | | timo_handle -> timeout_handle, p -> pipe, *pipe -> *rpipe, etc.)
* Only print the device name once, during attach (device_quiet)n_hibma1999-06-211-0/+2
|
* Enable attachment of multiple drivers to a single device.n_hibma1999-05-301-11/+16
|
* Remove feature creep: STAILQ_REMOVE_HEAD_UNTIL added it for conveniencen_hibma1999-04-201-0/+4
| | | | but we can do without it.
* 1) Add Rockfire vendor and gamepad product (MAEKAWA Masahide)n_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.
* 1) Make debugging more selective.n_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)
* Cosmetical changes.n_hibma1999-03-221-1/+3
|
* Textual changesn_hibma1999-01-221-3/+12
|
* Sync with NetBSD sources. Almost there. Mostly style fixes.n_hibma1999-01-101-13/+3
|
* Major synchronisation with NetBSD USB coden_hibma1999-01-071-171/+434
|
* Added Id to all filesn_hibma1998-12-141-0/+1
|
* Updated USB kernel sources to NetBSD sources of 1998-12-09.n_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.
* Various bug fixes:n_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.
* Initial commit of ported NetBSD USB stackn_hibma1998-11-261-0/+880
OpenPOWER on IntegriCloud