summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/controller/ehci.c
Commit message (Collapse)AuthorAgeFilesLines
* Remove unused defines.n_hibma2014-08-051-2/+2
| | | | | | | | Fix some device_printf's that were missing '\n' at the end or had speling errors. PR: 145319 Submitted by: rozhuk.im gmail.com
* Pull in r267961 and r267973 again. Fix for issues reported will follow.hselasky2014-06-281-9/+4
|
* Revert r267961, r267973:gjb2014-06-271-4/+9
| | | | | | | | | | These changes prevent sysctl(8) from returning proper output, such as: 1) no output from sysctl(8) 2) erroneously returning ENOMEM with tools like truss(1) or uname(1) truss: can not get etype: Cannot allocate memory
* Extend the meaning of the CTLFLAG_TUN flag to automatically check ifhselasky2014-06-271-9/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | there is an environment variable which shall initialize the SYSCTL during early boot. This works for all SYSCTL types both statically and dynamically created ones, except for the SYSCTL NODE type and SYSCTLs which belong to VNETs. A new flag, CTLFLAG_NOFETCH, has been added to be used in the case a tunable sysctl has a custom initialisation function allowing the sysctl to still be marked as a tunable. The kernel SYSCTL API is mostly the same, with a few exceptions for some special operations like iterating childrens of a static/extern SYSCTL node. This operation should probably be made into a factored out common macro, hence some device drivers use this. The reason for changing the SYSCTL API was the need for a SYSCTL parent OID pointer and not only the SYSCTL parent OID list pointer in order to quickly generate the sysctl path. The motivation behind this patch is to avoid parameter loading cludges inside the OFED driver subsystem. Instead of adding special code to the OFED driver subsystem to post-load tunables into dynamically created sysctls, we generalize this in the kernel. Other changes: - Corrected a possibly incorrect sysctl name from "hw.cbb.intr_mask" to "hw.pcic.intr_mask". - Removed redundant TUNABLE statements throughout the kernel. - Some minor code rewrites in connection to removing not needed TUNABLE statements. - Added a missing SYSCTL_DECL(). - Wrapped two very long lines. - Avoid malloc()/free() inside sysctl string handling, in case it is called to initialize a sysctl from a tunable, hence malloc()/free() is not ready when sysctls from the sysctl dataset are registered. - Bumped FreeBSD version to indicate SYSCTL API change. MFC after: 2 weeks Sponsored by: Mellanox Technologies
* Issue doorbell twice before finally freeing the DMA descriptors. Thishselasky2014-02-121-8/+54
| | | | | | | | | should fix DMA descriptor caching issues seen with the EHCI controller found in Google Chromebook C720 during removal and insertion of USB devices. MFC after: 1 week Reported by: Matthew Dillon at DragonFlyBSD
* Wait a bit more before we free any EHCI DMA descriptors. Some USBhselasky2014-01-221-1/+1
| | | | | | controllers need more time than others. MFC after: 1 week
* Separate I/O errors from reception of STALL PID.hselasky2014-01-131-3/+10
| | | | MFC after: 1 week
* Make sure reserved fields of the EHCI DMA descriptors are not dirtyhselasky2014-01-121-3/+26
| | | | | | after previous transfers. MFC after: 1 week
* USB method structures for USB controllers and USB pipes should behselasky2013-12-111-17/+17
| | | | | constant and does not need to be modified. This also saves a small amount of RAM.
* Correct an EHCI register write.hselasky2013-08-121-1/+1
| | | | | MFC after: 1 week Reported by: aseem.jolly@gmail.com
* Revert r251023 until a more proper solution is foundhselasky2013-05-281-19/+0
| | | | | | for ATI based USB controllers. MFC after: 1 week
* Workaround for for a problem seen with ATI Technologies EHCIhselasky2013-05-271-0/+19
| | | | | | | | | | | | | | | | controller hardware most likely present on UHCI chipsets aswell. The bug manifests itself when issuing isochronous transfers and bulk transfers towards the same device simultaneously. From time to time it happens that either the completion IRQ was missing or that the completion IRQ was happening before the ITD/SITD was completely written back to memory. The workaround assumes that double buffered isochronous transfers are used, and that a second interrupt is generated at the beginning of the next isochronous transfer to complete the previous one. Possibly skipping the interrupt at the last isochronous frame is possible, but will then break single buffered isochronous transfers. For now we can live with some extra interrupts. MFC after: 1 week
* Modify the FreeBSD USB kernel code so that it can be compiled directlyhselasky2013-01-301-3/+6
| | | | | | | | | | | | | | | | | | | | | | into the FreeBSD boot loader, typically for non-USB aware BIOSes, EFI systems or embedded platforms. This is also useful for out of the system compilation of the FreeBSD USB stack for various purposes. The USB kernel files can now optionally include a global header file which should include all needed definitions required to compile the FreeBSD USB stack. When the global USB header file is included, no other USB header files will be included by default. Add new file containing the USB stack configuration for the FreeBSD loader build. Replace some __FBSDID()'s by /* $FreeBSD$ */ comments. Now all USB files follow the same style. Use cases: - console in loader via USB - loading kernel via USB Discussed with: Hiroki Sato, hrs @ EuroBSDCon
* Allow using the embedded EHCI host controller in Freescale SoCsmarcel2012-11-031-6/+10
| | | | by adding the missing bits. See ehci_fsl.c for their use.
* Add missing CTLFLAG_TUN flag to tunable sysctls in USB stack.hselasky2012-10-261-8/+8
| | | | | | | | Rearrange the tunables and belonging sysctl declarations, so that they are next to eachother. Submitted by: n_hibma @ MFC after: 1 week
* Make several timing parameters of the USB enumeration sequence tuneable.hselasky2012-10-241-1/+1
| | | | | | | | | | | Also update the port reset time from 250ms to 50ms. Some USB devices have a hard limit in hardware at 222ms for the port reset time and will not enumerate unless this delay is closer to the usb.org defined value. This patch can fix enumeration with some USB devices. Tested by: Guido van Rooij Submitted by: Nick Hibma MFC after: 1 week
* Inherit USB mode from RootHUB port where the USB device is connected.hselasky2012-10-011-4/+0
| | | | | | | Only RootHUB ports can be dual mode. Disallow OTG ports on external HUBs. This simplifies some checks in the USB controller drivers. MFC after: 1 week
* Make sure the EHCI bandwidth allocation algorithmhselasky2012-05-031-0/+18
| | | | | | for FULL speed SPLIT transactions works fully. MFC after: 1 week
* Add support for Multi-TT mode of modern USB HUBs.hselasky2012-04-291-25/+16
| | | | | | | | | | This will give you more bandwidth for isochronous FULL speed applications connected through a High Speed HUB. This patch has been tested with XHCI and EHCI. MFC after: 1 week
* Fix compiler warnings, mostly signed issues,hselasky2012-04-021-7/+2
| | | | | | when USB modules are compiled with WARNS=9. MFC after: 1 weeks
* Implement better support for USB controller suspend and resume.hselasky2011-12-141-166/+86
| | | | | | | | | | This patch should remove the need for kldunload of USB controller drivers at suspend and kldload of USB controller drivers at resume. This patch also fixes some build issues in avr32dci.c MFC after: 2 weeks
* Style change.hselasky2011-11-121-1/+1
| | | | | | | | | | | | - Make it easier to port the USB code to other platforms by only using one set of memory functions for clearing and copying memory. None of the memory copies are overlapping. This means using bcopy() is not required. - Fix a compile warning when USB_HAVE_BUSDMA=0 - Add missing semicolon in avr32dci. - Update some comments. MFC after: 1 week
* Mark all SYSCTL_NODEs static that have no corresponding SYSCTL_DECLs.ed2011-11-071-1/+1
| | | | | | The SYSCTL_NODE macro defines a list that stores all child-elements of that node. If there's no SYSCTL_DECL macro anywhere else, there's no reason why it shouldn't be static.
* Fix for missing EHCI datatoggle change case.hselasky2011-04-261-0/+2
| | | | | | Reported by: Mike Tancsa MFC after: 3 days Approved by: thompsa (mentor)
* Fix initialisation order with regard to debug prints.hselasky2011-03-251-2/+2
| | | | | | Reported by: Luiz Otavio O Souza MFC after: 14 days Approved by: thompsa (mentor)
* Fix typo.hselasky2011-03-241-1/+1
| | | | | | Reported by: Garrett Cooper MFC after: 14 days Approved by: thompsa (mentor)
* Comply with style(9).hselasky2011-03-231-4/+4
| | | | | | Reported by: gavin MFC after: 14 days Approved by: thompsa (mentor)
* - Bugfix: Fix a EHCI hardware race, where the hardware computed data togglehselasky2011-03-211-3/+25
| | | | | | | | value is updated after that we read it in the queue-head. This patch can fix problems with BULK timeouts. The issue was found on a Nvidia chipset. MFC after: 14 days Approved by: thompsa (mentor)
* Remove unneeded includes of <sys/linker_set.h>. Other headers that usejhb2011-01-111-1/+0
| | | | | | it internally contain nested includes. Reviewed by: bde
* The EHCI_CAPLENGTH and EHCI_HCIVERSION registers are actually sub-registersnwhitehorn2010-10-251-2/+2
| | | | | | | within the first 4 bytes of the EHCI memory space. For controllers that use big-endian MMIO, reading them with 1- and 2-byte reads would then return the wrong values. Instead, read the combined register with a 4-byte read and mask out the interesting quantities.
* Revert most of r197682 (EHCI Hardware BUG workaround). Implementhselasky2010-10-141-40/+48
| | | | | | | | | | proper solution which is to not use the TERMINATE pointer, but rather link to a halted TD. The initial fix was due to a misunderstanding about how the EHCI hardware works. Thanks to Alan Stern for clearing this up. This patch can increase mass storage read performance significantly when the IRQ rate is less than 8000 IRQ/s. Approved by: thompsa (mentor)
* Avoid using endless retransmission at EHCI hardware level, hence this hidehselasky2010-10-141-1/+2
| | | | | | | errors from the applications. Only use endless retransmission while in the non-addressed state on a High-Speed device. Approved by: thompsa (mentor)
* Correct EHCI root HUB interface descriptor.hselasky2010-10-141-2/+1
| | | | Approved by: thompsa (mentor)
* Correct EHCI port register read.hselasky2010-10-141-1/+1
| | | | Approved by: thompsa (mentor)
* Change argument for usbd_get_dma_delay() from USB bus to USB device, somethompsa2010-09-021-1/+1
| | | | | | | embedded hardware needs to know exactly which device is in question before it exactly can decide the required delay. Submitted by: Hans Petter Selasky
* Add support for LOW speed BULK transfers. This mode is not recommended by thethompsa2010-06-221-3/+1
| | | | | | USB 2.0 standard, though some USB devices use it anyway. Submitted by: Hans Petter Selasky
* Back out r203140 which was causing problems when the first and the lastthompsa2010-05-121-9/+20
| | | | | | | | | | microframe slot was not in the smask. The problem was that the EHCI driver was then thinking that the transfer was immediately complete in some cases. Which could lead to freeze-like situations, which can be recovered by unplugging the USB device. Reported by: Richard Kolkovich Submitted by: Hans Petter Selasky
* Change USB_DEBUG to #ifdef and allow it to be turned off. Previously this hadthompsa2010-04-221-19/+19
| | | | | | the illusion of a tunable setting but was always turned on regardless. MFC after: 1 week
* Disable the use of the IAAD usb doorbell on NVidia controllers as it can causethompsa2010-02-091-0/+19
| | | | | | the hardware to stall. Submitted by: Hans Petter Selasky
* Optimise EHCI ISOC HS done check.thompsa2010-01-291-10/+7
| | | | Submitted by: Hans Petter Selasky
* Actually disable interrupts in ehci_detach().thompsa2009-11-231-1/+1
| | | | Reviewed by: HPS
* Provide tunables for some of the usb sysctls that affect boot behaviour.thompsa2009-11-221-0/+3
| | | | Submitted by: Andriy Gapon
* Improve High Speed slot allocation mechanism by moving the computation to thethompsa2009-11-221-47/+12
| | | | | | endpoint rather than per xfer and provide functions around get/free of resources. Submitted by: Hans Petter Selasky
* improve support for high speed isochronous endpoints which does not run 1:1,thompsa2009-11-081-27/+66
| | | | | | but needs intervalling 1:2, 1:4 or 1:8 Submitted by: Hans Petter Selasky
* Integrate lost interrupts patch from the old USB stack.thompsa2009-11-081-4/+36
| | | | | | | | | | | | | | | Some EHCI chips from VIA / ATI seem to trigger interrupts before writing back the qTD status, or miss signalling occasionally under heavy load. If the host machine is too fast, we can miss transaction completion - when we scan the active list the transaction still seems to be active. This generally exhibits itself as a umass stall that never recovers. We work around this behaviour by setting up this callback after any softintr that completes with transactions still pending, giving us another chance to check for completion after the writeback has taken place Submitted by: Alexander Nedotsuko MFC after: 3 days
* Workaround buggy BIOS code in USB regard. By doing the BIOS to OS handover forthompsa2009-10-151-0/+1
| | | | | | | | | all host controllers at the same time, we avoid problems where the BIOS will actually write to the USB registers of all the USB host controllers every time we handover one of them, and consequently reset the OS programmed values. Submitted by: avg Reviewed by: jhb
* EHCI Hardware BUG workaroundthompsa2009-10-011-21/+57
| | | | | | | | | | | | | | | | | The EHCI HW can use the qtd_next field instead of qtd_altnext when a short packet is received. This contradicts what is stated in the EHCI datasheet. Also the total-bytes field in the status field of the following TD gets corrupted upon reception of a short packet! We work this around in software by not queueing more than one job/TD at a time of up to 16Kbytes! The bug has been seen on multiple INTEL based EHCI chips. Other vendors have not been tested yet. - Applications using /dev/usb/X.Y.Z, where Z is non-zero are affected, but not applications using LibUSB v0.1, v1.2 and v2.0. - Mass Storage (umass) is affected. Submitted by: Hans Petter Selasky MFC after: 3 days
* Simplify logic around setting EHCI_QH_DTC and expand some htohc32(temp.sc, 0)thompsa2009-09-281-19/+15
| | | | | | statements to zero. Submitted by: Hans Petter Selasky
* USB CORE:alfred2009-07-301-0/+1
| | | | | | | | | | | - Add minimum polling support to drive UMASS and UKBD in case of panic. - Add extra check to ukbd probe to fix problem about mouse devices attaching like keyboards. - P4 ID: 166148 Submitted by: hps Approved by: re
* - Make struct usb_xfer opaque so that drivers can not access the internalsthompsa2009-06-231-3/+22
| | | | - Reduce the number of headers needed for a usb driver, the common case is just usb.h and usbdi.h
OpenPOWER on IntegriCloud