Up to [DragonFly] / src / sys / bus / usb
Request diff between arbitrary revisions
Keyword substitution: kv
Default branch: MAIN
Nuke the code specific to NetBSD/OpenBSD/FreeBSD at first. I doubt anyone will update these pieces and I don't intend to review macros for all platforms. There is the chance though that I might kill something which should stay in the code in form "TODO: port it to DF". So, please review and kick me.
Sync USB support (host controller part) with FreeBSD6. Following changes on FreeBSD-CURRENT(by firstname.lastname@example.org) are merged: ehci.c rev 1.52 ohci.c rev 1.167 uhci.c rev 1.172 usb.c rev 1.111 usbdi.h rev 1.61 "Use a different task queue for host controller and peripheral driver tasks. Since the host controllers rely on tasks to process transfer timeouts, if a synchronous transfer from a driver was invoked from a task and timed out, it would never complete because the single task thread was stuck performing the synchronous transfer so couldn't process the timeout." As of this commit, only following kernel APIs are changed: - usbd_get_string_desc() takes one more argument which returns the actual size of the string description. - usb_add_task() takes one more argument. The extra arguemnt is used to specify to which task queue the task should be added. There is two task queues defined, one for peripheral driver (USB_TASKQ_DRIVER), one for host controller (USB_TASKQ_HC). ugen(4) is adapted according to the above kernel API changes. Thank all of the folks for their work on the USB support. Tested-by: swildner@, vbd@, joerg@(1.6 backport), Max Herrgard <email@example.com> # Though VT6202 is supported by ehci(4), I still have problems with this # chip, even with the updated ehci(4).
Synchronise with NetBSD: ehci.c: v1.74: Add suspend/resume support. v1.75: Fix typo: compolicated. v1.76: A little portability stuff (lockmgr -> usb_lockmgr) v1.78: add interrupt transfers v1.79: use DPRINTF instead of a printf ehcireg.h: 1.18: Fix EHCI_HCS_P_INDICATOR usb_port.h: NetBSD/OpenBSD specific things, lockmgr->usb_lockmgr..
Sync with NetBSD: PR/23128: Although the dma descriptors are limited to any 4G address range, the data is not, using extra area in the dma descriptors to define a 64 bit address. This is described in appendix B of the EHCI 1.0 spec from the URL in the file dev/usb/ehci.c. With a 64 bit address capable controller these upper address values must be set, the current driver does not do this.
Bring EHCI up-to-date with NetBSD. The most serious fixes are 1.53, 1.55, 1.56, and 1.64. revision 1.67 Fix a byte order error. (note: was already previously ported to DFly) revision 1.66 Fix an endianness problem (EHCI_NULL was being double-swapped). revision 1.65 Make one message dependent on ohcidebug, so it doesn't interfere with polled operation; e.g. when entering a root device or in DDB. revision 1.64 Further cleanup of toggle handling. Now that we use EHCI_QH_DTC, we don't need to fiddle with the TOGGLE bit in the overlay descriptor, so minimize how much we fuss with it. revision 1.63 Fix an error in a debug printf(). revision 1.62 Adjust a couple of comments to make it clear WTF is going on. revision 1.61 revision 1.60 Remove comment about the data toggle being borked. revision 1.59 As the ehci_idone() now uses the variable `epipe' unconditionally, always declare it (in other words, make this file compile w/o EHCI_DEBUG). revision 1.58 Fix a stupid bug in ehci_check_intr() that caused use to try to complete a transaction that was still running. Now ehci can handle multiple devices being active at once. revision 1.57 Oops. Remove a couple of printf()s. revision 1.56 Failure to properly mask off UE_DIR_IN from the endpoint address was causing OHCI_ED_FORMAT_ISO and EHCI_QH_HRECL to get set spuriously, causing rather interesting lossage. Suddenly I get MUCH better performance with ehci... revision 1.55 Set the data toggle correctly, and use EHCI_QTD_DTC. This fixes problems with my ALi-based drive enclosure (it works now, rather than failing to attach). Also seems to work with a GL811-based enclosure and an ASUS enclosure with a CD-RW, on both Intel and NEC controllers. Note: The ALi enclosure is currently very SLOW, due to some issue with taking too long to notice that the QTD is complete. This requires more investigation. revision 1.54 branches: 1.54.2; Michael van Elst reports his USB2 disk works stable after latest Chuck's ehci.c changes, so remove the item from TODO. revision 1.53 in ehci_softintr() when looping over the active xfers, save the next pointer before calling ehci_check_intr(), since that will free the xfer structure if the xfer is complete. revision 1.52 add list of known issues, from Lennart Augustsson and Michael van Elst revision 1.51 Use the correct wValue to get hub desriptors. Also, make wValue checks of root hub codes less strict.
Add defined(__FreeBSD__) and defined(__DragonFly__) where appropriate
Bring in the entire FreeBSD-5 USB infrastructure. As of this commit my USB camera, Hard Drive, Mouse, and Sony memory key all work and I can even unplug and replug them in without crashing the port. Not all drivers and subsystems compile as of this commit, but the ones that do not are very close.