| 176 | } |
| 177 | |
| 178 | IORegistryEntry* USBToolBox::getControllerViaIteration() { |
| 179 | OSIterator* iterator = pciDevice->getChildIterator(gIOServicePlane); |
| 180 | if (!iterator) { |
| 181 | SYSTEMLOGPROV("Failed to create IOService iterator!"); |
| 182 | return NULL; |
| 183 | } |
| 184 | |
| 185 | IORegistryEntry* controller = NULL; |
| 186 | |
| 187 | DEBUGLOGPROV("Starting iteration over IOService plane"); |
| 188 | while (IORegistryEntry* entry = OSDynamicCast(IORegistryEntry, iterator->getNextObject())) { |
| 189 | // DEBUGLOGPROV("Object name is %s with class %s", entry->getName(), entry->getMetaClass()->getClassName()); |
| 190 | if (checkClassHierarchy(entry, "AppleUSBHostController")) { |
| 191 | // This is it |
| 192 | DEBUGLOGPROV("%s is AppleUSBHostController instance", entry->getName()); |
| 193 | // Retain before we exit iterator to prevent any races. |
| 194 | entry->retain(); |
| 195 | controller = entry; |
| 196 | break; |
| 197 | } |
| 198 | } |
| 199 | DEBUGLOGPROV("Iteration over IOService plane finished"); |
| 200 | OSSafeReleaseNULL(iterator); |
| 201 | |
| 202 | return controller; |
| 203 | } |
| 204 | |
| 205 | void USBToolBox::deleteProperty(IORegistryEntry* entry, const char* property) { |
| 206 | if (entry->getProperty(property)) { |
nothing calls this directly
no outgoing calls
no test coverage detected