Jump to content

GenericUSBXHCI USB 3.0 driver for OS X with source

xHC USB 3.0

  • Please log in to reply
917 replies to this topic

#141
bisk

bisk

    InsanelyMac Protégé

  • Members
  • PipPip
  • 78 posts
And, as I suspected, the Acer TimeLineX 3830TG dies on wake the exact same way.

Only slight difference is that this notebook's screen does NOT have a quick flicker before death.

Anything further that I can try, please let me know. I am really keen on solving this.

Dump is attached.

Attached Files



#142
mac.HoBONG

mac.HoBONG

    InsanelyMac Protégé

  • Members
  • Pip
  • 11 posts
This is The Prefect Kext for USB 3.0
After download GenericUSBXHCI_1.2.1 and put it on /S/L/E repair permission with Kext Utillity.
I can Connect the Iphone 4s On this USB port and Also External Hard Drive
My Device is 0x0194 Vendor 0x1033 Nec on Dell Vostro 3350 ML 1.8.3

Thank You Very Much
:thumbsup_anim: :thumbsup_anim: :thumbsup_anim: :thumbsup_anim: :thumbsup_anim:

Tagged As Favourite

Attached Files

  • Attached File  USB3.png   141.7KB   79 downloads


#143
Anonymous03

Anonymous03

    InsanelyMac Protégé

  • Members
  • Pip
  • 13 posts

This is The Prefect Kext for USB 3.0
After download GenericUSBXHCI_1.2.1 and put it on /S/L/E repair permission with Kext Utillity.
I can Connect the Iphone 4s On this USB port and Also External Hard Drive
My Device is 0x0194 Vendor 0x1033 Nec on Dell Vostro 3350 ML 1.8.3

Thank You Very Much
:thumbsup_anim: :thumbsup_anim: :thumbsup_anim: :thumbsup_anim: :thumbsup_anim:

Tagged As Favourite


As I can see on your screenshot, extra-current on USB2.0 is not working for you too. Try

changing

IOProbeScore from 1 to -1 in

GenericUSBXHCI.kext/Contents/Info.plist and fix permission, rebuild cache. You will have proper ipad charging and faster iphone charging.



#144
Zenith432

Zenith432

    InsanelyMac Legend

  • Developers
  • 737 posts
  • Gender:Male

Try changing IOProbeScore from 1 to -1.

He's got a Renesas uPD720200a, so that's not going to do anything. This chip is rejected by AppleUSBXHCI.

Your screendumps show that you get extra current with AppleUSBXHCI, because the iPad is in fact connected to the EHCI chip on your system. I mentioned in post #134 that you can get the same result by using GenericUSBXHCI with kernel flag '-gux_defer_usb2'. With Intel Series 7, USB2 ports 1-4 can be routed to either XHCI or EHCI.

#145
Anonymous03

Anonymous03

    InsanelyMac Protégé

  • Members
  • Pip
  • 13 posts

He's got a Renesas uPD720200a, so that's not going to do anything. This chip is rejected by AppleUSBXHCI.

Your screendumps show that you get extra current with AppleUSBXHCI, because the iPad is in fact connected to the EHCI chip on your system. I mentioned in post #134 that you can get the same result by using GenericUSBXHCI with kernel flag '-gux_defer_usb2'. With Intel Series 7, USB2 ports 1-4 can be routed to either XHCI or EHCI.


So as far as I understand all usb ports on my motherboard (2 USB2.0 Intel, 2 USB3.0 Intel, 2 USB3.0 ASMedia - 6 total) routs it's USB2.0 devices to Intel EHCI chip (even in ASMedia port) that (with IOProbeScore -1) controlled by AppleUSBEHCI, correct?
And even if System Information -> USB -> Host Controller Driver says GenericUSBXHCI in fact iPad at ASMedia port really routed to Intel EHCI chip and controlled via AppleUSBEHCI driver, so extra current works in any port.

With IOProbeScore 1 all ports routs to XHCI(intel chip for intel ports, asmedia chip for asmedia ports)/EHCI chip and controlled only via GenericUSBXHCI with no extra current

Am I correct? Please correct me if I'm wrong.

Attached Files



#146
Zenith432

Zenith432

    InsanelyMac Legend

  • Developers
  • 737 posts
  • Gender:Male

Am I correct? Please correct me if I'm wrong.

Please run 'ioreg -l' (in a Terminal) with your system exactly like in the last screenshot (with 1600mA extra current on any port), and msg me the text dump. This will help me figure out how to enable extra current. Thanks.

Edit: The extra-current errors are resolved. I uploaded v1.2.2 that fixes this.

Edited by Zenith432, 02 June 2013 - 12:49 PM.


#147
Rampage Dev

Rampage Dev

    InsanelyMac Deity

  • Members
  • PipPipPipPipPipPipPipPipPipPip
  • 2,280 posts
  • Gender:Male
  • Interests:AKern@RampageDev.com

Rampage Dev: The message
indicates the xhci controller in stalled. The KP later is in Apple's code (AppleUSBHub), probably because the controller is stalled and returning errors AppleUSBHub doesn't process well. I'll need to see a xhcdump of the controller state. Maybe with no connected devices it won't KP so xhcdump can be recorded.

68x: Usually it's because auxillary power is not supplied to the xhci chip during sleep.


Finally got the dump from the user.

CAPS

MEGATRON:~ <USER>$ xhcdump caps
Found a device of class GenericUSBXHCI: IOService:/AppleACPIPlatformExpert/PCI0@0/AppleACPIPCI/PEX3@1C,3/IOPCI2PCIBridge/ASMX@0/GenericUSBXHCI
Vendor 0x1b21, Device 0x1042, Revision 0
CapLength  32
HCIVersion 0x96
MaxSlots 32, MaxIntrs 8, Rsvd(1) 0, MaxPorts 4
IST 1 microframes, ERST Max 32768, Rsvd(2) 0x17, SPR Y, Max Scratchpad Bufs 16
U1 Device Exit Latency 0, Rsvd(3) 0, U2 Device Exit Latency 0
AC64 N, BNC N, CSZ N, PPC N, PIND N, LHRC N, LTC N, NSS Y, Rsvd(4) 0x1, MaxPSASize 65536
  xHC Extended Cap ID 1, Specific 0
    Legacy CTLSTS 0x40010000
  xHC Extended Cap ID 2, Specific 0x300
    Supported Protocol Name 0x20425355 PortOffset 1 PortCount 2 ProtocolDefined 0
  xHC Extended Cap ID 2, Specific 0x200
    Supported Protocol Name 0x20425355 PortOffset 3 PortCount 2 ProtocolDefined 0x1
DBOff  0x1800
RTSOff 0x1000
PageSize 4096
Using MSI

Found a device of class GenericUSBXHCI: IOService:/AppleACPIPlatformExpert/PCI0@0/AppleACPIPCI/PEX2@1C,2/IOPCI2PCIBridge/pci1b21,1042@0/GenericUSBXHCI
Vendor 0x1b21, Device 0x1042, Revision 0
CapLength  32
HCIVersion 0x96
MaxSlots 32, MaxIntrs 8, Rsvd(1) 0, MaxPorts 4
IST 1 microframes, ERST Max 32768, Rsvd(2) 0x17, SPR Y, Max Scratchpad Bufs 16
U1 Device Exit Latency 0, Rsvd(3) 0, U2 Device Exit Latency 0
AC64 N, BNC N, CSZ N, PPC N, PIND N, LHRC N, LTC N, NSS Y, Rsvd(4) 0x1, MaxPSASize 65536
  xHC Extended Cap ID 1, Specific 0
    Legacy CTLSTS 0x40010000
  xHC Extended Cap ID 2, Specific 0x300
    Supported Protocol Name 0x20425355 PortOffset 1 PortCount 2 ProtocolDefined 0
  xHC Extended Cap ID 2, Specific 0x200
    Supported Protocol Name 0x20425355 PortOffset 3 PortCount 2 ProtocolDefined 0x1
DBOff  0x1800
RTSOff 0x1000
PageSize 4096
Using MSI

RUNNING

Usage: xhcdump <caps | running | slots | endpoints <slot#> | bandwidth | options>
  caps - dumps cap regs
  running - dumps running regs
  slots - dumps active device slots
  endpoints <slot#> - dumps active endpoints on slot
  bandwidth - dumps bandwidth for root hub ports
  options - dumps kernel flags supported by kext
MEGATRON:~     <USER>$ xhcdump running
Found a device of class GenericUSBXHCI: IOService:/AppleACPIPlatformExpert/PCI0@0/AppleACPIPCI/PEX3@1C,3/IOPCI2PCIBridge/ASMX@0/GenericUSBXHCI
USBCmd RS Y HCRST N INTE Y HSEE N LHCRST N CSS N CRS N EWE Y EU3S N
USBSts HCH N HSE N EINT Y PCD N SSS N RSS N SRE N CNR N HCE N
DNCtrl 0xffff
CRCr CRR Y
Config 32
MFIndex 8643
Last Time Sync xHC 196608 milliseconds <-> CPU 198066108757 nanoseconds
# Configured Endpoints 2
# Interrupts: Total 224, Serviced 224, Inactive 0, Offline 0
Port   1 PortSC CCS Y PED Y OCA N PR N
		   PLS U0 PP Y Speed Super PIC Off LWS N
		   CSC N PEC N WRC N OCC N PRC N PLC N CEC N CAS N
		   WCE Y WDE Y WOE Y DR N WPR N
		 PortPmsc U1 0 U2 0 FLA N PortLi LEC 0
Port   2 PortSC CCS N PED N OCA N PR N
		   PLS RxDetect PP Y Speed Unknown PIC Off LWS N
		   CSC N PEC N WRC N OCC N PRC N PLC N CEC N CAS N
		   WCE Y WDE Y WOE Y DR N WPR N
		 PortPmsc U1 0 U2 0 FLA N PortLi LEC 0
Port   3 PortSC CCS Y PED Y OCA N PR N
		   PLS U0 PP Y Speed High PIC Off LWS N
		   CSC N PEC N WRC N OCC N PRC N PLC N CEC N CAS N
		   WCE Y WDE Y WOE Y DR N WPR N
		 PortPmsc L1S Invalid RWE N HIRD 50 us L1Slot 0 HLE N TestMode Disabled
Port   4 PortSC CCS N PED N OCA N PR N
		   PLS RxDetect PP Y Speed Unknown PIC Off LWS N
		   CSC N PEC N WRC N OCC N PRC N PLC N CEC N CAS N
		   WCE Y WDE Y WOE Y DR N WPR N
		 PortPmsc L1S Invalid RWE N HIRD 50 us L1Slot 0 HLE N TestMode Disabled
Interrupter 0 iman IP N imod I 40000 ns C 0 ns erstsz 1 erdp DESI 0 EHB N

Found a device of class GenericUSBXHCI: IOService:/AppleACPIPlatformExpert/PCI0@0/AppleACPIPCI/PEX2@1C,2/IOPCI2PCIBridge/pci1b21,1042@0/GenericUSBXHCI
USBCmd RS Y HCRST N INTE Y HSEE N LHCRST N CSS N CRS N EWE Y EU3S N
USBSts HCH N HSE N EINT Y PCD N SSS N RSS N SRE N CNR N HCE N
DNCtrl 0xffff
CRCr CRR N
Config 32
MFIndex 8408
Last Time Sync xHC 196608 milliseconds <-> CPU 198095776282 nanoseconds
# Configured Endpoints 0
# Interrupts: Total 96, Serviced 96, Inactive 0, Offline 0
Port   1 PortSC CCS N PED N OCA N PR N
		   PLS RxDetect PP Y Speed Unknown PIC Off LWS N
		   CSC N PEC N WRC N OCC N PRC N PLC N CEC N CAS N
		   WCE Y WDE Y WOE Y DR N WPR N
		 PortPmsc U1 0 U2 0 FLA N PortLi LEC 0
Port   2 PortSC CCS N PED N OCA N PR N
		   PLS RxDetect PP Y Speed Unknown PIC Off LWS N
		   CSC N PEC N WRC N OCC N PRC N PLC N CEC N CAS N
		   WCE Y WDE Y WOE Y DR N WPR N
		 PortPmsc U1 0 U2 0 FLA N PortLi LEC 0
Port   3 PortSC CCS N PED N OCA N PR N
		   PLS RxDetect PP Y Speed Unknown PIC Off LWS N
		   CSC N PEC N WRC N OCC N PRC N PLC N CEC N CAS N
		   WCE Y WDE Y WOE Y DR N WPR N
		 PortPmsc L1S Invalid RWE N HIRD 50 us L1Slot 0 HLE N TestMode Disabled
Port   4 PortSC CCS N PED N OCA N PR N
		   PLS RxDetect PP Y Speed Unknown PIC Off LWS N
		   CSC N PEC N WRC N OCC N PRC N PLC N CEC N CAS N
		   WCE Y WDE Y WOE Y DR N WPR N
		 PortPmsc L1S Invalid RWE N HIRD 50 us L1Slot 0 HLE N TestMode Disabled
Interrupter 0 iman IP N imod I 40000 ns C 0 ns erstsz 1 erdp DESI 0 EHB N

SLOTS

MEGATRON:~ <USER>$ xhcdump slots
Found a device of class GenericUSBXHCI: IOService:/AppleACPIPlatformExpert/PCI0@0/AppleACPIPCI/PEX3@1C,3/IOPCI2PCIBridge/ASMX@0/GenericUSBXHCI
Slot 1, Device Address 1
  State Configured
  Route String 0
  Speed High, Last Endpoint 3
  Hub Y, # Ports 4, MTT N, TTT 32 FS bit times
  RH Port #3, Interrupter 0, Max Exit Latency 0 us

Found a device of class GenericUSBXHCI: IOService:/AppleACPIPlatformExpert/PCI0@0/AppleACPIPCI/PEX2@1C,2/IOPCI2PCIBridge/pci1b21,1042@0/GenericUSBXHCI

ENDPOINTS

MEGATRON:~ <USER>$ xhcdump endpoints
Usage: xhcdump <caps | running | slots | endpoints <slot#> | bandwidth | options>
  caps - dumps cap regs
  running - dumps running regs
  slots - dumps active device slots
  endpoints <slot#> - dumps active endpoints on slot
  bandwidth - dumps bandwidth for root hub ports
  options - dumps kernel flags supported by kext

BANDWIDTH

MEGATRON:~ <USER>$ xhcdump bandwidth
Found a device of class GenericUSBXHCI: IOService:/AppleACPIPlatformExpert/PCI0@0/AppleACPIPCI/PEX3@1C,3/IOPCI2PCIBridge/ASMX@0/GenericUSBXHCI
GetPortBandwidth for RootHub, speed 0 returned 0xe00002c9
GetPortBandwidth for RootHub, speed 1 returned 0xe00002c9
GetPortBandwidth for RootHub, speed 2 returned 0xe00002c9
GetPortBandwidth for RootHub, speed 3 returned 0xe00002c9

Found a device of class GenericUSBXHCI: IOService:/AppleACPIPlatformExpert/PCI0@0/AppleACPIPCI/PEX2@1C,2/IOPCI2PCIBridge/pci1b21,1042@0/GenericUSBXHCI
Bandwidth for RootHub, Speed 0
  0  0  90  90
Bandwidth for RootHub, Speed 1
  0  0  90  90
Bandwidth for RootHub, Speed 2
  0  0  80  80
Bandwidth for RootHub, Speed 3
  90  90  0  0


#148
Maniac10

Maniac10

    InsanelyMac Deity

  • Members
  • PipPipPipPipPipPipPipPipPipPip
  • 1,978 posts
  • Gender:Not Telling

Edit: The extra-current errors are resolved. I uploaded v1.2.2 that fixes this.


Is this right? The current values seems too high.

Attached File  currents.png   105.97KB   51 downloads

#149
Zenith432

Zenith432

    InsanelyMac Legend

  • Developers
  • 737 posts
  • Gender:Male

Is this right? The current values seems too high.

It's right. You can inject these values on your own to the xHC PCI devices via DSDT.
  • AAPL,current-available - max current per port (integer)
  • AAPL,current-extra - total available extra current for all ports in system (integer)
  • AAPL,max-port-current-in-sleep - max current per port in sleep (integer)
  • AAPL,current-extra-in-sleep - total available extra current for all ports in system during sleep (integer)
The defaults are high so requests for extra current succeed :)

Finally got the dump from the user.

These dumps show the xHC is operating normally before the offending device is inserted. There is one connected USB3 hub, but I assume it's a different device that does work. So it must be something about the offending device's descriptors that's causing the problem. There are a couple of things about the KP dump in post #122
  • That msg with WaitForCMD Timeout - I added more info to that in 1.2.2 that would help me better determine where it's coming from. So if the user could rerun the KP with 1.2.2 and upload the panic log that would help.
  • It shows IOUSBFamily v5.6.0, which is from some beta build of 10.8.4. I don't have the binaries (or sources) for this IOUSBFamily, so I can't locate the point of crash. It's possible (in theory) that changes in the UIM interface in 10.8.4beta introduced some new incompatibility that's partially responsible for the KP. If you could either try the offending device on 10.8.3 (with kext v1.2.2), or upload the binary of IOUSBFamily being used for me, that would help.
  • Does the offending device cause the KP when connected via the USB3 hub, when connected directly to the root hub, or both?


#150
Maniac10

Maniac10

    InsanelyMac Deity

  • Members
  • PipPipPipPipPipPipPipPipPipPip
  • 1,978 posts
  • Gender:Not Telling

It's right. You can inject these values on your own to the xHC PCI devices via DSDT.

  • AAPL,current-available - max current per port (integer)
  • AAPL,current-extra - total available extra current for all ports in system (integer)
  • AAPL,max-port-current-in-sleep - max current per port in sleep (integer)
  • AAPL,current-extra-in-sleep - total available extra current for all ports in system during sleep (integer)
The defaults are high so requests for extra current succeed :)


No need to touch the DSDT, I trust your judgement. I just thought current-extra and current-extra-in-sleep values (0x18e70) were too high compared to the ones in most USB patches (0xa8c-0x834) <- Are these other values correct?

#151
Zenith432

Zenith432

    InsanelyMac Legend

  • Developers
  • 737 posts
  • Gender:Male

to the ones in most USB patches (0xa8c-0x834) <- Are these other values correct?

These values are enough to charge one iPhone - but if you want to charge 50 iPhones... :D

#152
DZLK

DZLK

    InsanelyMac Protégé

  • Members
  • Pip
  • 6 posts
Zenith432, please
Can you make build for OS 10.6.8?

#153
Zenith432

Zenith432

    InsanelyMac Legend

  • Developers
  • 737 posts
  • Gender:Male
Rampage Dev: I checked the crash log from #122 with IOUSBFamily 5.6.0, and it shows the crash to be a pagefault from a call to IOSleep in AppleUSBHub::CheckForActivePorts. It's inexplicable. Probably caused by some memory corruption.

#154
Rampage Dev

Rampage Dev

    InsanelyMac Deity

  • Members
  • PipPipPipPipPipPipPipPipPipPip
  • 2,280 posts
  • Gender:Male
  • Interests:AKern@RampageDev.com

Rampage Dev: I checked the crash log from #122 with IOUSBFamily 5.6.0, and it shows the crash to be a pagefault from a call to IOSleep in AppleUSBHub::CheckForActivePorts. It's inexplicable. Probably caused by some memory corruption.


This issue happens on 70% of Asus x79 boards and would really like to fix it. It only started with ML. Lion it worked fine with the older solutions. Thanks.

#155
Zenith432

Zenith432

    InsanelyMac Legend

  • Developers
  • 737 posts
  • Gender:Male

This issue happens on 70% of Asus x79 boards and would really like to fix it. It only started with ML.

Have the user retry with v1.2.3. If the problem still recurs - have the user boot with kernel-flag 'gux_log=2', and then upload the contents of syslog from the point the device is inserted onward. Thanks.

#156
Micky1979

Micky1979

    I realized that I am lucky

  • Retired
  • 4,864 posts
  • Gender:Male
  • Location:a 100m dal Tevere, vicino a Peppe
Hello Zenith432,

GenericUSBXHCI.kext v1.23 added in Pandora Beta2 (will be released within a few days..), and this is the Pandora's log with automatic xhcdump included:

Attached File  Pandora's box 06-05-13_2104.html.zip   10.28KB   17 downloads

dump done after waking from sleep (the dump is always done, but only if GenericUSBXHCI.kext is loaded), everything looks super! ;)

I hope that log you pleasure, and any tips are welcome!
Thank you for this kext!

Micky1979

#157
quendiljt

quendiljt

    InsanelyMac Protégé

  • Members
  • Pip
  • 3 posts
Hi Zenith,

First off, thanks a ton for developing this driver.

I'm running 10.8.4 with a gigabyte MB with an Etron EJ168 chip, and I've installed V1.23 of the kext. USB 2.0 devices work fine, and my USB 3.0 thumb drive (I don't have a self-powered USB 3.0 drive) shows up in system information with a max speed of 5 GB/S. However, when using it, (1) I seem to get only USB 2.0 speeds (as determined by Blackmagic disk test) and (2) after copying a file back and forth 2-3 times, the next transfer will stall, and then the drive will eject with an error but immediately remount. It then works fine again for a few copies before crashing again.

I found this message (similar to one from post 149?) in the system logs:

6/5/13 12:20:49.000 PM kernel[0]: WaitForCMD: Timeout waiting for command completion (opcode 0xf), 100ms

. Also this one, which appears a few times before the drive remounts:

6/5/13 12:14:12.000 PM kernel[0]: USBF: 313.290 [0xffffff8020105000] The IOUSBFamily is having trouble enumerating a USB device that has been plugged in. It will keep retrying. (Port 2 of Hub at 0xbc800000)

.

I've attached the caps and running dumps from xhcdump, run right after one of the spontaneous ejects and remounts.
Let me know if you need any more info, and thanks again for your hard work (and help :-)).

—Q

Attached Files



#158
Zenith432

Zenith432

    InsanelyMac Legend

  • Developers
  • 737 posts
  • Gender:Male
quendiljt: This behavior indicates the drive is defective. Are you able to use it when connected to an EHCI port, or under any other OS?
The WaitForCMD error means one of the endpoints is stalled, it's trying to stop it, but times out stopping it. The USB stack has a sequence of steps responding to device errors, and that's what you're seeing.
You can do 'xhcdump slots', and then 'xhcdump endpoints #', where # is the slot number where this drive is connected. This will list the endpoint configurations - to see if there's anything unusual about them. However, the USB stack just takes the endpoint configurations as reported by the device descriptors on the device itself - so it's likely just a defective drive.

#159
quendiljt

quendiljt

    InsanelyMac Protégé

  • Members
  • Pip
  • 3 posts
Hi Zenith,

I borrowed a USB 3.0 external HD from work, and it worked fine, so I guess it was my thumb drive after all. Sorry about that :blush: . That said, my thumb drive seems to work fine in USB 3.0 ports on a Windows 8 machines and in my MacBook Air. I'll just get a new thumb drive anyway.

I've attached the output of xhcdump endpoints in case you're interested.

Thanks again for your help!

Attached Files



#160
Zenith432

Zenith432

    InsanelyMac Legend

  • Developers
  • 737 posts
  • Gender:Male

I've attached the output of xhcdump endpoints in case you're interested.

The endpoint configuration in the dump is normal.
It could be a combination of the Etron controller + chipset in thumbdrive. I found a report of a similar problem.
Looked at the Linux code, and there's an Etron-quirk related to transfers. However, the code in GenericUSBXHCI doesn't need this quirk as it already works right. So the bottom line is if the transfers between Etron controller and thumbdrive were completing successfully - you wouldn't be experiencing this. The data transfers are either being aborted short with errors or timing out.

PS: you could try updating firmware if it's not already the latest.






2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users

© 2017 InsanelyMac  |   News  |   Forum  |   Downloads  |   OSx86 Wiki  |   Designed by Ed Gain  |   Logo by irfan  |   Privacy Policy