Contribute
Register

USB port limit patch for 14.1, 14.2, 14.3

Joined
May 27, 2016
Messages
53
Mac
iMac
Classic Mac
PowerBook
This following patch allows root hub port limit over 0xf to 0x3f.

Patch 1
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/).

Patch 2
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

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:
Joined
Apr 18, 2011
Messages
159
Motherboard
Lenovo ThinkCentre M900 SFF
CPU
i5-6600
Graphics
GT 1030
Same for 14.2?
 
Joined
Nov 19, 2017
Messages
31
Motherboard
MSI X299 SLI Plus
CPU
i7-7820X
Graphics
Vega 64
Mac
iMac
Mobile Phone
iOS
Well done!It works on my MSI X299 SLI Plus
 
Joined
Aug 13, 2017
Messages
119
Motherboard
Z370P D3
CPU
i5-8400
Graphics
UHD 630 + MSI GTX 710 2GB
Mac
iMac
Mobile Phone
Android, iOS, Other
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

Joined
May 27, 2016
Messages
53
Mac
iMac
Classic Mac
PowerBook
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!
 
Top