MCPcopy Create free account
hub / github.com/acidanthera/BrcmPatchRAM / findFirstInterface

Method findFirstInterface

BrcmPatchRAM/USBHostDeviceShim.cpp:146–171  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

144}
145
146bool 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
173bool USBDeviceShim::open(IOService *forClient, IOOptionBits options, void *arg)
174{

Callers

nothing calls this directly

Calls 2

getValidatedInterfaceMethod · 0.80
setInterfaceMethod · 0.45

Tested by

no test coverage detected