device_probe.py: Add UHCI detection

This commit is contained in:
Mykola Grymalyuk
2022-01-24 11:08:04 -07:00
parent 18f9e05792
commit 3ffe8c5142
3 changed files with 44 additions and 0 deletions
+15
View File
@@ -173,6 +173,10 @@ class EHCIController(PCIDevice):
class OHCIController(PCIDevice):
CLASS_CODE: ClassVar[int] = 0x0c0310
@dataclass
class UHCIController(PCIDevice):
CLASS_CODE: ClassVar[int] = 0x0c0300
@dataclass
class NVIDIA(GPU):
VENDOR_ID: ClassVar[int] = 0x10DE
@@ -451,6 +455,14 @@ class Computer:
None,
)[1]
)
uhci_controllers = ioreg.ioiterator_to_list(
ioreg.IOServiceGetMatchingServices(
ioreg.kIOMasterPortDefault,
{"IOProviderClass": "IOPCIDevice", "IOPropertyMatch": [{"class-code": binascii.a2b_hex(utilities.hexswap(hex(UHCIController.CLASS_CODE)[2:].zfill(8)))}]},
None,
)[1]
)
for device in xhci_controllers:
self.usb_controllers.append(XHCIController.from_ioregistry(device))
ioreg.IOObjectRelease(device)
@@ -460,6 +472,9 @@ class Computer:
for device in ohci_controllers:
self.usb_controllers.append(OHCIController.from_ioregistry(device))
ioreg.IOObjectRelease(device)
for device in uhci_controllers:
self.usb_controllers.append(UHCIController.from_ioregistry(device))
ioreg.IOObjectRelease(device)
def storage_probe(self):
+1
View File
@@ -13,6 +13,7 @@ def validate(settings):
example_data.iMac.iMac81_Stock,
example_data.iMac.iMac112_Stock,
example_data.iMac.iMac122_Upgraded,
example_data.iMac.iMac122_Upgraded_Nvidia,
example_data.iMac.iMac151_Stock,
example_data.MacPro.MacPro31_Stock,
example_data.MacPro.MacPro31_Upgrade,