summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/controller/xhci.c
Commit message (Collapse)AuthorAgeFilesLines
* - Move the remainder of host controller capability registers reading frommarius2015-07-271-64/+60
| | | | | | | | | | | | xhci_start_controller() to xhci_init(). These values don't change at run- time so there's no point of acquiring them on every USB_HW_POWER_RESUME instead of only once during initialization. In r276717, reading the first couple of registers in question already had been moved as a prerequisite for the changes in that revision. - Identify ASMedia ASM1042A controllers. - Use NULL instead of 0 for pointers. MFC after: 3 days
* Add quirk to disable 64-bit XHCI DMA after r276717.hselasky2015-03-021-4/+9
| | | | | Requested by: Gary Jennejohn <gljennjohn@gmail.com> MFC after: 3 days
* Ensure that the XHCI driver will refresh the control endpoint settingshselasky2015-02-241-0/+7
| | | | | | | when re-enumerating a FULL speed device. Else the wrong max packet setting might be used when trying to re-enumerate a FULL speed device. MFC after: 3 days
* Fix DMA address casts. Regression issue after r278279.hselasky2015-02-091-2/+2
| | | | MFC after: 3 days
* Section 3.2.9 in the XHCI specification about control transfers sayshselasky2015-02-021-1/+11
| | | | | | | | | that we should use a normal-TRB if there are more TRBs extending the data-stage TRB. Add a dedicated state bit to the internal USB transfer flags to handle this case. Reported by: Kohji Okuno <okuno.kohji@jp.panasonic.com> MFC after: 1 week
* Add 64-bit DMA support in the XHCI controller driver.hselasky2015-01-051-41/+51
| | | | | | | - Fix some comments and whitespace while at it. MFC after: 1 month Submitted by: marius@
* Add missed flushing of data which can happen when "xhci_configure_mask()"hselasky2014-12-301-4/+9
| | | | | | | | is called from "xhci_configure_reset_endpoint()". Ensure the 3-strikes error feature is always enabled except for ISOCHRONOUS transfers. MFC after: 1 week Suggested by: marius@
* Make sure we always set the maximum number of valid contexts.hselasky2014-10-021-7/+10
| | | | MFC after: 3 days
* Set default cycle state in case of early interrupts.hselasky2014-10-011-0/+4
| | | | MFC after: 3 days
* Some XHCI hardware requires dropping the endpoint context beforehselasky2014-09-221-1/+8
| | | | | | | adding it again. MFC after: 3 days Submitted by: Kohji Okuno <okuno.kohji@jp.panasonic.com>
* Split the XHCI TRB allocations into smaller parts, so that we don'thselasky2014-07-261-18/+18
| | | | | | | end up allocating contiguous busdma buffers above PAGE_SIZE bytes. MFC after: 1 week Tested by: Ruslan Bukin <br@bsdpad.com>
* Pull in r267961 and r267973 again. Fix for issues reported will follow.hselasky2014-06-281-8/+4
|
* Revert r267961, r267973:gjb2014-06-271-4/+8
| | | | | | | | | | 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-8/+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
* - Fix a bug where the TLBPC value was forced to being odd for INhselasky2014-05-221-11/+5
| | | | | | | | | | direction isochronous transfers. - Remove setting of fields which does not belong to the respective TRBs. These fields are currently set as zero and this is more a cosmetic change. MFC after: 3 days Submitted by: Horse Ma <HMa@wyse.com>
* Setting the IMOD value below 0x3F8 can cause IRQ lockups in the Intelhselasky2014-04-271-1/+5
| | | | | | | LynxPoint USB 3.0 controllers found in MacBookPro 2013's. MFC after: 2 days Tested by: Huang Wen Hui <huanghwh@gmail.com>
* Fix for infinite XHCI reset loops when the set address USB request fails.hselasky2014-04-091-2/+14
| | | | MFC after: 2 days
* Fix minor logical error in the XHCI driver. Set correct SETUP packethselasky2014-02-141-1/+2
| | | | | | | direction value. MFC after: 2 days Reported by: Horse Ma <HMa@wyse.com>
* Optimise interrupt logic. Technically writing a zero to the XHCI USBhselasky2014-01-111-5/+5
| | | | | | | status register has no effect. Can happen when the interrupt vector is shared. MFC after: 1 week
* Force clearing of event ring interrupts. The "Intel Lynx Point" XHCIhselasky2014-01-111-0/+7
| | | | | | | | controller found in the MBP2013 has been observed to not work properly unless this operation is performed. MFC after: 1 week Tested by: Huang Wen Hui <huanghwh@gmail.com>
* Check the XHCI event ring regardless of the XHCI status registerhselasky2014-01-071-7/+2
| | | | | | | | | value. The "Intel Lynx Point" XHCI controller found in the MBP2013 has been observed to not always set the event interrupt bit while there are events to consume in the event ring. MFC after: 1 week Tested by: Huang Wen Hui <huanghwh@gmail.com>
* Minor correction for the XHCI reset logic.hselasky2014-01-021-2/+2
| | | | | MFC after: 1 week Found by: Horse Ma <HMa@wyse.com>
* Fix regression issue after r259248:hselasky2013-12-161-0/+2
| | | | | | | | Some Intel XHCI controlles timeout processing so-called "TRBs" when the final LINK TRB of a so-called "TD" has the CHAIN-BIT set. MFC after: 1 week Tested by: glebius @
* Set chain bit correctly. This will fix some problems sending andhselasky2013-12-121-2/+11
| | | | | | | | receiving Zero Length Packets, ZLPs. See comment in code for more information. MFC after: 1 week Reported by: Kohji Okuno <okuno.kohji@jp.panasonic.com>
* USB method structures for USB controllers and USB pipes should behselasky2013-12-111-3/+3
| | | | | constant and does not need to be modified. This also saves a small amount of RAM.
* Improve the XHCI command timeout recovery handling code.hselasky2013-12-061-18/+79
| | | | MFC after: 1 week
* Comply to the XHCI specification. Certain input context fields shouldhselasky2013-11-251-1/+5
| | | | | | always be zero. MFC after: 1 week
* Improve XHCI stability. When a command timeout happens, the commandhselasky2013-10-181-0/+19
| | | | | | | should be aborted else the command queue can stop. Refer to section "4.6.1.2" of the XHCI specification. MFC after: 1 week
* Stability fixes for Intel LynxPoint XHCI controllers. Disable XHCI porthselasky2013-09-211-14/+32
| | | | | | | | | | routing if we get certain errors. Poll for command completion upon command timeouts. The XHCI error events might not generate interrupts. MFC after: 1 week Reported by: Daniel Gerzo <danger@rulez.sk>, Antonis Anastasiadis <anastasiadis@datalive.gr> PR: usb/181159 Approved by: re (gjb)
* Revert parts of r245132 and r245175. We don't need to write to thehselasky2013-09-071-10/+0
| | | | | | | | IMAN register to clear the pending interrupt status bits. This patch tries to solve problems seen on the MacBook Air, as reported by Johannes Lundberg <johannes@brilliantservice.co.jp> MFC after: 1 week
* Disable USB 3.0 streams mode by default, hence not all XHCI chipsetshselasky2013-09-071-2/+9
| | | | implement it to avoid undefined behaviour.
* Fix an XHCI regression:hselasky2013-07-211-11/+9
| | | | | | | | | | | | | The Block Event Interrupts, BEI, feature does not work like expected with the Renesas XHCI chipsets. Revert feature. While at it correct the TD SIZE computation in case of Zero Length Packet, ZLP, in the end of a multi frame USB transfer. MFC after: 1 week PR: usb/180726
* Fix some recent regression issues:hselasky2013-06-071-47/+55
| | | | | | | | | | | | | 1) Only multi-TD isochronous transfers should use NORMAL type after specific type as per XHCI specification. 2) BEI bit is only available in NORMAL and ISOCHRONOUS TRB types. Don't use this bit for other types to avoid hardware asserts. Reserved bits should be don't care though ... MFC after: 1 week PR: usb/179342
* Add support for polling the XHCI interrupt handler whenhselasky2013-06-071-0/+14
| | | | | | | | | | the regular interrupt handler is not working properly or in case of MSI interrupts which are not yet supported. Remove interrupt setup code for FreeBSD versions older than 700031. MFC after: 1 week PR: usb/179342
* Correct the TD size computation. npkt should reflect the number of packetshselasky2013-06-021-2/+6
| | | | | | | remaining after the current TRB has been executed. Refer to section 4.11.2.4 of the XHCI specification for USB. MFC after: 1 week
* Correct TRB type for multi TRB transfers of non-NORMAL type, like isochronous.hselasky2013-06-021-6/+14
| | | | | | | Only the first TRB should be markes as special. Subsequent ones should be marked as NORMAL. Optimise away TD first variable. MFC after: 1 week
* Block event interrupts when we don't need it as soon as possible.hselasky2013-06-021-9/+24
| | | | | | | Typically this feature is used for isochronous transfers. This reduces the amount of XHCI interrupting. MFC after: 1 week
* Don't set the start ISOC ASAP bit for non-isochronous TRBs.hselasky2013-06-021-5/+8
| | | | MFC after: 1 week
* Correct some XHCI streams mode transfer handling found by code inspection.hselasky2013-06-021-18/+36
| | | | | | | The existing streams mode support is not working and has not been tested due to lack of hardware which supports the given feature. MFC after: 1 week
* Add descriptive comment.hselasky2013-04-231-0/+6
|
* Fix spelling.hselasky2013-03-201-1/+2
|
* Add defines to more easily allow a single threaded version of the FreeBSDhselasky2013-02-051-9/+2
| | | | USB stack. This is useful for non-kernel purposes, like the loader.
* Do not unnecessarily split a string literal, becausehselasky2013-01-301-2/+2
| | | | | | splitting it makes it hard to grep. Submitted by: Christoph Mallon
* 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
* Add missing NULL pointer check.hselasky2013-01-301-0/+6
| | | | | Reported by: Lars Engels MFC after: 1 week
* Shave off another register write to save some morehselasky2013-01-081-12/+17
| | | | | | | | microseconds of PCI access time. Tested by: sos @ Submitted by: sos @ MFC after: 1 week
* Optimise the XHCI interrupt handling.hselasky2013-01-071-2/+6
| | | | | | | | | | | This patch will save CPU time when the XHCI interrupt is shared with other devices. Only check event rings when interrupt bits are set. Otherwise would indicate hiding possible hardware fault(s). Tested by: sos @ Submitted by: sos @ MFC after: 1 week
* - Add support for Etron EJ168 USB 3.0 Host Controllers.hselasky2012-12-011-19/+51
| | | | | | | | | | | | | This brand of controllers expects that the number of contexts specified in the input slot context points to an active endpoint context, else it refuses to operate. - Ring the correct doorbell when streams mode is used. - Wrap one or two long lines. Tested by: Markus Pfeiffer (DragonFlyBSD) MFC after: 1 week
* Add missing CTLFLAG_TUN flag to tunable sysctls in USB stack.hselasky2012-10-261-4/+3
| | | | | | | | Rearrange the tunables and belonging sysctl declarations, so that they are next to eachother. Submitted by: n_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
OpenPOWER on IntegriCloud