Contribute
Register

[Guide] Creating a Custom SSDT for USBInjectAll.kext

I've got 2 USB2 connectors and 2 USB3 connectors on the front of my computer.

Would it create a problem to delete the corresponding HSxx port for the USB3 connectors (in the dsl), so that only the SSxx ports of USB3 ports would be defined? This would make it very easy to keep under the 15 port limit.

It might cause problems. No idea really as I have never tested in that scenario.
And of course, those ports would then only work with USB3 devices. USB2 devices will not work because the USB2 pins on the port are not active.

One other question. Let's say the dsl contains > 15 USB ports. Can the uia_exclude in Clover be used to safely remove them?

Yes.
Using uia_exclude is the same as excluding the ports from the SSDT.

I was thinking that if > 15 ports were instantiated even momentarily before Clover excluded them,

Clover doesn't exclude anything. All work is done in USBInjectAll.kext.
 
It might cause problems. No idea really as I have never tested in that scenario.
And of course, those ports would then only work with USB3 devices. USB2 devices will not work because the USB2 pins on the port are not active.
I realize that. I rarely ever connect a USB2 device, other than a mouse or keyboard, so I would be fine not connecting any USB2 devices to a blue USB3 port.

In your dsl examples, I notice that the port number will often have gaps and the "port-count" can be much higher than the actual number of ports defined, or even the last port number defined.
Code:
"port-count", Buffer() { 26, 0, 0, 0 }, // highest port number is '20' for SS04, but this is 26?
Code:
"HS04", Package() // HS USB3 rear top
{
   "UsbConnector", 3,
   "port", Buffer() { 4, 0, 0, 0 },
},
"HS09", Package() // bluetooth
{
   "UsbConnector", 3,
   "port", Buffer() { 9, 0, 0, 0 },
},

These gaps and "port-count" higher than the number of ports declared - cause no problems?
 
I realize that. I rarely ever connect a USB2 device, other than a mouse or keyboard, so I would be fine not connecting any USB2 devices to a blue USB3 port.

In your dsl examples, I notice that the port number will often have gaps and the "port-count" can be much higher than the actual number of ports defined, or even the last port number defined.
Code:
"port-count", Buffer() { 26, 0, 0, 0 }, // highest port number is '20' for SS04, but this is 26?
Code:
"HS04", Package() // HS USB3 rear top
{
   "UsbConnector", 3,
   "port", Buffer() { 4, 0, 0, 0 },
},
"HS09", Package() // bluetooth
{
   "UsbConnector", 3,
   "port", Buffer() { 9, 0, 0, 0 },
},

These gaps and "port-count" higher than the number of ports declared - cause no problems?

The gaps are due to the excluded ports in between (the example you show has excluded 5,6,7,8).
And yes, so far I find no reason to change port-count from the count that corresponds to the xHCI controller specs.
 
hi @RehabMan
according to my DSDT, USB ports are listed as below for USB 3.0 xHCI Controller 8086_9d2f

Scope (_SB.PCI0.XHC.RHUB
SS01,SS02,SS03,SS04,SS05,SS06,SS07,SS08,SS09,SS0A,SS0B,SS0C,SS0D,SS0E,SS0F,SS10,SS11,SS12

but info.plist in your USBInjectAll for 100 series 9d2f listed USB ports as this:

HS01,HS02,HS03,HS04,HS05,HS06,HS07,HS08,HS09,HS10,SS01,SS02,SS03,SS04,SS05,SS06,USR1,USR2

so i must customize info.plist to match DSDT or no need to customization?
 

Attachments

  • DSDT - no patch.dsl
    1.1 MB · Views: 129
hi @RehabMan
according to my DSDT, USB ports are listed as below for USB 3.0 xHCI Controller 8086_9d2f

Scope (_SB.PCI0.XHC.RHUB
SS01,SS02,SS03,SS04,SS05,SS06,SS07,SS08,SS09,SS0A,SS0B,SS0C,SS0D,SS0E,SS0F,SS10,SS11,SS12

but info.plist in your USBInjectAll for 100 series 9d2f listed USB ports as this:

HS01,HS02,HS03,HS04,HS05,HS06,HS07,HS08,HS09,HS10,SS01,SS02,SS03,SS04,SS05,SS06,USR1,USR2

so i must customize info.plist to match DSDT or no need to customization?

The addresses are correct in SSDT-UIAC-ALL.dsl and the USBInjectAll Info.plist.
 
Hi @RehabMan,
My hack seems to work properly until it sleeps for an elongated period of time. At that point I open the lid to find that it rebooted during the sleep. Short sleeps work fine. But after 10 or so minutes, although it does vary; it reboots. I think it has to do with my possible incorrect USB port patching or DSDT.
According my testing, HS01 & 2 are used when USB2 devices are connected to my laptop's sole two USB3 ports. SS01 & 2 are used when USB3 devices are connected to the USB3 ports. HS04 & 5 are for the Camera & Bluetooth.
HS03 is used when a USB2 device is connected to the USB C port and SS03 when it's a USB3 device. I've created the UIAC SSDT accordingly. Please see the attached files. Thank you!
 

Attachments

  • Archive.zip
    2.3 MB · Views: 70
Last edited:
Hi @RehabMan,
My hack seems to work properly until it sleeps for an elongated period of time. At that point I open the lid to find that it rebooted during the sleep. Short sleeps work fine. But after 10 or so minutes, although it does vary; it reboots. I think it has to do with my possible incorrect USB port patching or DSDT.
According my testing, HS01 & 2 are used when USB2 devices are connected to my laptop's sole two USB3 ports. SS01 & 2 are used when USB3 devices are connected to the USB3 ports. HS04 & 5 are for the Camera & Bluetooth.
HS03 is used when a USB2 device is connected to the USB C port and SS03 when it's a USB3 device. I've created the UIAC SSDT accordingly. Please see the attached files. Thank you!

MacBookPro14,2 is a poor choice. Try MacBookPro14,1 instead.
Make sure you disabled hibernation.

You have a very complex ACPI hotpatch and several questionable/unknown kexts installed. I'm not going to get into debugging that here.

Your USB configuration is wrong. USB3 (HSxx and SSxx) should be marked UsbConnector=3. I don't know why you're using UsbConnector=2. According to the ACPI spec, it means "ExpressCard".
 
Rehabman, I'm trying to map all the USB ports but when I use USBInjectAll kext, anything I plug into USB 3.0 ports results in a message "USB accessory needs power". When I remove the kext, USB 3.0 drives mount just fine but then I do not see any changes in IORegistryExplorer when I plug and unplug the drive. What could be causing this?

Also in your screenshots, I see there's an entry for XHC which I do not see in my IOreg, is that normal?
 
Rehabman, I'm trying to map all the USB ports but when I use USBInjectAll kext, anything I plug into USB 3.0 ports results in a message "USB accessory needs power". When I remove the kext, USB 3.0 drives mount just fine but then I do not see any changes in IORegistryExplorer when I plug and unplug the drive. What could be causing this?

Also in your screenshots, I see there's an entry for XHC which I do not see in my IOreg, is that normal?

You did not attach any "Problem Reporting" files, therefore no idea.
Read post #1, "Problem Reporting".
 
Back
Top