Can't find Interface Descriptor
Can't find Interface Descriptor
- Subject: Can't find Interface Descriptor
- From: Ness Joumaa <email@hidden>
- Date: Sun, 30 Jan 2005 19:33:41 -0700
Hi,
I'm writing a driver that drives a USB composite device. This driver is based on the methods that the CDC examples used. Now, when the driver tries to find a useable interface descriptor, it cannot find any that matched my IOUSBFindInterfaceRequest request but IOUSBFindInterfaceRequest matches exactly what USB Prober said about my composite device, so there shouldn't have been a problem finding the interface at all:
Alternate Setting 0
Interface Class: 255 (Vendor-specific)
Interface Subclass; 0 (Vendor-specific)
Interface Protocol 0
Here is my code:
bool
com_ProjectNitro_driver_NitroWireless::initDevice(UInt8 numConfigs)
{
IOUSBFindInterfaceRequest req;
const IOUSBConfigurationDescriptor *cd = NULL;
IOUSBInterfaceDescriptor *intf = NULL;
IOReturn ior = kIOReturnSuccess;
UInt8 cval;
UInt8 config = 0;
bool goodconfig = false;
IOLog("com_ProjectNitro_driver_NitroWireless::initDevice\n");
// find a configuration and use it
0;cval<numConfigs;cval++)
{
cd = nub->GetFullConfigurationDescriptor(cval);
if(!cd)
{
IOLog("com_ProjectNitro_driver_NitroWireless::initDevice - Error getting full configuration descriptor\n");
}
else
{
// matches exactly what USB Prober says about my device
req.bInterfaceClass = kUSBVendorSpecificClass;
req.bInterfaceSubClass = 0;
req.bInterfaceProtocol = 255;
req.bAlternateSetting = 0;
ior = nub->FindNextInterfaceDescriptor(cd, intf, &req, &intf);
if(ior == kIOReturnSuccess)
{
if(intf)
{
IOLog("com_ProjectNitro_driver_NitroWireless::initDevice - Interface descriptor found\n");
config = cd->bConfigurationValue;
goodconfig = true;
/* we have one good interface to work with, no need
to search for more. */
break;
}
else
{
IOLog("com_ProjectNitro_driver_NitroWireless::initDevice - uhh, what? The interface was null\n");
}
}
else
{
IOLog("com_ProjectNitro_driver_NitroWireless::initDevice - No interface descriptor on this configuration\n");
}
}
}
// set the configuration
if(goodconfig)
{
ior = nub->SetConfiguration(this, config);
if(ior != kIOReturnSuccess)
{
IOLog("com_ProjectNitro_driver_NitroWireless::initDevice - SetConfiguration error\n");
goodconfig = false;
}
}
else
{
return false;
}
return goodconfig;
}
Sorry if you do not understand what I'm saying, I'm having a hard time explaining this myself.
--ness _______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden