| 334 | } |
| 335 | |
| 336 | void USBToolBox::removeACPIPorts() { |
| 337 | if (!(checkKernelArgument(bootargAcpiOff) || checkProperty(propertyAcpiOff))) { |
| 338 | const IORegistryPlane* acpiPlane = IORegistryEntry::getPlane("IOACPIPlane"); |
| 339 | |
| 340 | if (!acpiPlane) { |
| 341 | SYSTEMLOGPROV("Could not get ACPI plane!"); |
| 342 | return; |
| 343 | } |
| 344 | |
| 345 | IORegistryEntry* acpiEntry = OSDynamicCast(IORegistryEntry, pciDevice->getProperty("acpi-device")); |
| 346 | |
| 347 | if (acpiEntry) { |
| 348 | if (OSIterator* acpiIterator = acpiEntry->getChildIterator(acpiPlane)) { |
| 349 | DEBUGLOGPROV("Starting iteration over ACPI plane"); |
| 350 | while (IORegistryEntry* entry = OSDynamicCast(IORegistryEntry, acpiIterator->getNextObject())) { |
| 351 | DEBUGLOGPROV("Object name is %s, detatching", entry->getName()); |
| 352 | entry->detachAll(acpiPlane); |
| 353 | } |
| 354 | DEBUGLOGPROV("Iteration over ACPI plane finished"); |
| 355 | acpiEntry->setProperty("ACPI removed by USBToolBox", true); |
| 356 | OSSafeReleaseNULL(acpiIterator); |
| 357 | } else { |
| 358 | SYSTEMLOGPROV("Failed to create ACPI iterator!"); |
| 359 | } |
| 360 | } else { |
| 361 | SYSTEMLOGPROV("Failed to get ACPI entry or none available"); |
| 362 | } |
| 363 | } else { |
| 364 | SYSTEMLOGPROV("ACPI fixup disabled, continuing"); |
| 365 | } |
| 366 | } |
| 367 | |
| 368 | IOService* USBToolBox::probe(IOService* provider, SInt32* score) { |
| 369 | DEBUGLOG("%s: probe start", provider->getName()); |
nothing calls this directly
no outgoing calls
no test coverage detected