Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

adding driver personalities dynamically



Hello,

I am porting a pci driver to macosx that supports a very large number of
devices. This list of devices is configurable on other os's and we want to
maintain that behaviour on macosx (meaning we want to not use the
info.plist to do our matching). So i have found the IOCatalogue's
functions: addDrivers and removeDrivers, but unfortunately I don't seem to
be getting matched to my devices (i have successfully tried hardcoding the
info into the info.plist).

this is the general idea of what i do for adding....

OSArray * personalityArray = OSArray::withCapacity(1);
OSString * ioClass = OSString::withCString("my_pci_driver_class_name");
OSString * ioProvider = OSString::withCString("IOPCIDevice");

// create a personality for the device
OSDictionary * personality = OSDictionary::withCapacity(3);
OSString * ioPCIMatch = OSString::withCString("DDDDVVVV DDDDVVVV");
// if i wanted to match against two different devices

personality->setObject("IOClass", ioClass);
personality->setObject("IOProviderClass", ioProvider);
personality->setObject("IOPCIPrimaryMatch", ioPCIMatch);

// append personality to end of array
personalityArray->setObject(personality);

bool result = gIOCatalogue->addDrivers(personalityArray, false);

// clean up
personalityArray->release();
personality->release();
ioClass->release();
ioProvider->release();
ioPCIMatch->release();


now i have tried passing true in the above call to addDrivers but that
didn't seem to work (by the way addDrivers has been returning true). So
then i came up
with calling gIOCatalogue->startMatching() like so...

OSDictionary * personality = OSDictionary::withCapacity(1);
OSString * ioProvider = OSString::withCString("IOPCIDevice");
personality->setObject("IOProviderClass", ioProvider);

bool result = startMatching(personality);

ioProviderClass->release();
personaltiy->release();

So anyway, even though i think i am doing everything right (a foolish
assumption indeed) i am not getting my device to match against my driver.
Does anyone have experience using these calls successfully? Or is there a
better way to get around this problem of needing to have dynamic device
matching personalities?

Thanks

Aaron
_______________________________________________
darwin-drivers mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-drivers
Do not post admin requests to the list. They will be ignored.



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

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.