| 144 | } |
| 145 | |
| 146 | bool USBDeviceShim::findFirstInterface(USBInterfaceShim* shim) |
| 147 | { |
| 148 | DebugLog("USBDeviceShim::findFirstInterface\n"); |
| 149 | |
| 150 | OSIterator* iterator = m_pDevice->getChildIterator(gIOServicePlane); |
| 151 | |
| 152 | if (!iterator) |
| 153 | return false; |
| 154 | |
| 155 | while (OSObject* candidate = iterator->getNextObject()) |
| 156 | { |
| 157 | if (IOUSBHostInterface* interface = OSDynamicCast(IOUSBHostInterface, candidate)) |
| 158 | { |
| 159 | //if (interface->getInterfaceDescriptor()->bInterfaceClass != kUSBHubClass) |
| 160 | { |
| 161 | shim->setInterface(interface); |
| 162 | break; |
| 163 | } |
| 164 | } |
| 165 | } |
| 166 | |
| 167 | iterator->release(); |
| 168 | |
| 169 | DebugLog("getValidatedInterface returns %p\n", shim->getValidatedInterface()); |
| 170 | return shim->getValidatedInterface() != NULL; |
| 171 | } |
| 172 | |
| 173 | bool USBDeviceShim::open(IOService *forClient, IOOptionBits options, void *arg) |
| 174 | { |
nothing calls this directly
no test coverage detected