Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: How to match a logical driver to a physical device
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to match a logical driver to a physical device



Hello -
As I see, you may track the driver stack in your probe() method to find the underlying IOUSBDevice object and then simply getProperty () to obtain its idVendor, idProduct.
Try something like:


IOService* YourBlockStorageDriverClass::probe (IOService *provider, SInt32 *score )
{
OSString* vendor = 0;
OSString* product = 0;
...


while (provider && provider->metaCast ("IOUSBDevice") == 0) provider = provider->getProvider ();
if (provider)
{
vendor = OSDynamicCast (OSString, provider->getProperty ("idVendor));
product = OSDynaicCast (OSString, provider->getProperty ("idProduct"));
}


	...
}


On Oct 15, 2007, at 00:34 , Thomas Tempelmann wrote:

I have made a kext that overrides a few methods of a (logical) driver of
class IOCDBlockStorageDriver.


Now I need to make sure that this driver only matches on a particular USB
device which I can either identify by its vendor and product IDs or by its
name as it appears in the IORegistry under "class IOCDMedia".


However, I do not know how to match either of these:

When I simply add the idVendor key and value to the driver's plist file, it
appears to be ignored as my driver is not of a class where this matching is
performed.


I can also overwrite the probe() function, but again I do not know how to
get to these USB device properties in order to check them.


Any hints?

Thomas

_______________________________________________ Do not post admin requests to the list. They will be ignored. Ata-scsi-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >How to match a logical driver to a physical device (From: Thomas Tempelmann <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.