| 428 | } |
| 429 | |
| 430 | bool USBToolBox::start(IOService *provider) { |
| 431 | DEBUGLOGPROV("start start"); |
| 432 | // If we're here we couldn't get the instance in probe |
| 433 | DEBUGLOGPROV("Trying to obtain via matching"); |
| 434 | this->controllerInstance = getControllerViaMatching(); |
| 435 | |
| 436 | if (!(this->controllerInstance)) { |
| 437 | SYSTEMLOGPROV("Failed to obtain via matching, falling back to iteration"); |
| 438 | this->controllerInstance = getControllerViaIteration(); |
| 439 | } |
| 440 | |
| 441 | if (!(this->controllerInstance)) { |
| 442 | SYSTEMLOGPROV("Failed to obtain via iteration, falling back to notification"); |
| 443 | OSDictionary* matchingDict = createMatchingDictionary(); |
| 444 | |
| 445 | if (!matchingDict) { |
| 446 | SYSTEMLOGPROV("Failed to create matching dict!"); |
| 447 | return false; |
| 448 | } |
| 449 | if (!gIOPublishNotification) { |
| 450 | SYSTEMLOGPROV("IOPublishNotification null!"); |
| 451 | OSSafeReleaseNULL(matchingDict); |
| 452 | return false; |
| 453 | } |
| 454 | // static IONotifier* addMatchingNotification(const OSSymbol* type, OSDictionary* matching, IOServiceMatchingNotificationHandler handler, void* target, void* ref = NULL, SInt32 priority = 0) |
| 455 | IONotifier* notifierStatus = addMatchingNotification(gIOMatchedNotification, matchingDict, _matchingCallback, this, matchingDict); |
| 456 | SYSTEMLOGPROV("Installed controller notifier status: %s", notifierStatus ? "successful" : "failed"); |
| 457 | } else { |
| 458 | mergeProperties(); |
| 459 | SYSTEMLOGPROV("Successfully applied properties, exiting"); |
| 460 | return false; |
| 461 | } |
| 462 | DEBUGLOGPROV("start exit"); |
| 463 | return super::start(provider); |
| 464 | } |
nothing calls this directly
no outgoing calls
no test coverage detected