| 366 | } |
| 367 | |
| 368 | IOService* USBToolBox::probe(IOService* provider, SInt32* score) { |
| 369 | DEBUGLOG("%s: probe start", provider->getName()); |
| 370 | |
| 371 | if (OSDynamicCast(IOPCIDevice, provider)) { |
| 372 | // We are attached to the PCI device |
| 373 | this->pciDevice = provider; |
| 374 | } else if (checkClassHierarchy(provider, "AppleUSBHostController")) { |
| 375 | // We are already attached to the instance |
| 376 | this->controllerInstance = provider; |
| 377 | this->controllerInstance->retain(); |
| 378 | this->pciDevice = this->controllerInstance->getParentEntry(gIOServicePlane); // Should not be released by the caller. |
| 379 | if (!(this->pciDevice)) { |
| 380 | DEBUGLOG("%s: No parent PCI device!", provider->getName()); |
| 381 | return NULL; |
| 382 | } |
| 383 | } else { |
| 384 | DEBUGLOG("%s: Unknown provider class %s!", provider->getName(), provider->getMetaClass()->getClassName()); |
| 385 | return NULL; |
| 386 | } |
| 387 | |
| 388 | if (checkKernelArgument(bootargOff) || checkProperty(propertyOff)) { |
| 389 | SYSTEMLOGPROV("disable argument specified, exiting"); |
| 390 | return NULL; |
| 391 | } |
| 392 | |
| 393 | this->pciDevice->setProperty("UTB Version", versionString); |
| 394 | |
| 395 | removeACPIPorts(); |
| 396 | |
| 397 | if (!(this->controllerInstance)) { |
| 398 | this->controllerInstance = getControllerViaMatching(); |
| 399 | } |
| 400 | if (!(this->controllerInstance)) { |
| 401 | SYSTEMLOGPROV("Failed to obtain via matching in probe, will try during start"); |
| 402 | } else { |
| 403 | mergeProperties(); |
| 404 | DEBUGLOGPROV("Probe early finish"); |
| 405 | return NULL; |
| 406 | } |
| 407 | DEBUGLOGPROV("Probe end"); |
| 408 | return super::probe(provider, score); |
| 409 | } |
| 410 | |
| 411 | bool USBToolBox::matchingCallback(OSDictionary* matchingDict, IOService* newService, IONotifier* notifier) { |
| 412 | DEBUGLOGPROV("controller callback start"); |
nothing calls this directly
no outgoing calls
no test coverage detected