Contribute
Register

USB port limit patch for 14.1, 14.2, 14.3, 14.5,14.6

Joined
May 27, 2016
Messages
84
Motherboard
Asus x99 Delux II
CPU
i7 6950
Graphics
Radeon VII
Mac
  1. iMac
Classic Mac
  1. PowerBook
This following patch allows root hub port limit over 0xf to 0x3f.

Patch 1
Comment: USB port limit patch 10.14.x (credit ydeng)
Name: IOUSBHostFamily
Find: c20200e0 83fb0f
Replace: c20200e0 83fb3f

This need to be used together with AppleUSBXHCI patch published elsewhere (https://www.tonymacx86.com/threads/solved-mojave-10-14-1-update-lost-usb-3-0.264125/).

Patch 2
Comment: USB Port limit patch 10.14.1, 10.14.2,10.14.3
Name: com.apple.driver.usb.AppleUSBXHCI
Find: 00 00 83 FB 0F 0F 83 8F 04 00 00
Replace: 00 00 83 FB 3F 0F 83 8F 04 00 00

Patch 2
Comment: USB Port limit patch 10.14.5,10.14.6
Name: com.apple.driver.usb.AppleUSBXHCI
Find: 4183ff0f 0f839404 0000
Replace: 4183ff3f 0f839404 0000

Mojave 14.1 has an additional check in AppleUSBHostPort::setPortLocation to limit maximum number of ports to 0xf.

__text:0000000000015CC6 test ebx, ebx; port number passed in the argument, zero for root hub ports
__text:0000000000015CC8 jnz short loc_15CD2
__text:0000000000015CCA mov ebx, [r12+0D0h] ; port id from port property
__text:0000000000015CD2 loc_15CD2:
__text:0000000000015CD2 mov r14d, 0E00002C2h
__text:0000000000015CD8 cmp ebx, 0Fh ; check port id is not above 0xf
__text:0000000000015CDB ja loc_160F7

Patch 3
One more to fix port names: https://www.tonymacx86.com/threads/usb-port-limit-patch-for-14-1-14-2-14-3.268893/#post-1888473
 
Last edited:
Same for 14.2?
 
one more to fix port names:

Comment: USB port name 10.14.x (credit ydeng)
Name: IOUSBHostFamily
Find: 83 E3 0F D3 E3 41 09 DF
Replace: 83 E3 3F D3 E3 41 09 DF
 

Attachments

  • Screen Shot 2019-01-12 at 5.56.39 PM.png
    Screen Shot 2019-01-12 at 5.56.39 PM.png
    249.1 KB · Views: 2,799
Last edited:
Well done!It works on my MSI X299 SLI Plus
 
This following patch allows root hub port limit over 0xf to 0x3f.

Comment: USB port limit patch 10.14.1 10.14.2 (credit ydeng)
Name: IOUSBHostFamily
Find: 00e0 83fb 0f0f 8716 0400
Replace: 00e0 83fb 3f0f 8716 0400

This need to be used together with AppleUSBXHCI patch published elsewhere (https://www.tonymacx86.com/threads/solved-mojave-10-14-1-update-lost-usb-3-0.264125/).

Comment: USB Port limit patch 10.14.1, 10.14.2
Name: com.apple.driver.usb.AppleUSBXHCI
Find: 00 00 83 FB 0F 0F 83 8F 04 00 00
Replace: 00 00 83 FB 3F 0F 83 8F 04 00 00

Mojave 14.1 has an additional check in AppleUSBHostPort::setPortLocation to limit maximum number of ports to 0xf.

__text:0000000000015CC6 test ebx, ebx; port number passed in the argument, zero for root hub ports
__text:0000000000015CC8 jnz short loc_15CD2
__text:0000000000015CCA mov ebx, [r12+0D0h] ; port id from port property
__text:0000000000015CD2 loc_15CD2:
__text:0000000000015CD2 mov r14d, 0E00002C2h
__text:0000000000015CD8 cmp ebx, 0Fh ; check port id is not above 0xf
__text:0000000000015CDB ja loc_160F7
Works like a charm from 10.13.4 Thanks :clap:
 

Attachments

  • Screenshot 2019-01-23 at 18.31.13.png
    Screenshot 2019-01-23 at 18.31.13.png
    162.6 KB · Views: 2,338
Some people say there might be memory error by allowing port number to go above 15. That is not true because AppleUSBXHCI actually read hardware registers to allocate memory, for example activeDeviceSet is constructed from Max Device Slots value in HCSPARAMS1. Port limit checks can be safely removed. People might wonder why the first place to limit ports is in AppleUSBXHCI not AppleUSBXHCIPCI. Well, AppleUSBXHCIPCI constructs ports property and calls super class (AppleUSBXHCI) method to enumerate ports. If ports property is defined, only ports listed will be constructed. If no such property exists, AppleUSBXHCI goes through all capabilities defined in the controller. That means by deleting all ACPI USB port definitions, all ports will be enumerated!
 
Back
Top