Mailing Lists: Apple Mailing Lists

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

Re: query on multiple pci adapter suppport



On Nov 5, 2003, at 3:09 AM, Prakash George Mathew wrote:

Does MAC OS X IOKit support driving multiple PCI adapters of same kind with
one driver?

Yes, and it's a lot easier to do than in other OSs where the driver framework is not object oriented.

Essentially, IOKit will create an instance of the class that each driver kext's info.plist "passes" via the passive matching phase. That instance is already paired with a particular PCI device represented by the IOService *provider. Add to this C++ class-static member data and you've got the best of both worlds: a clean OOD model where there's once instance per device and yet all of the instances can share some data if needed.

You can also participate in this device-instance matching process if desired. This is cool if your hardware has minor variants (steps) that mandate some differences in how they are handled. You can factor the driver class into a base class with all the common parts and subclasses that know the differences. In probe() you can instantiate a specific subclass to return.

Having fought with these issues in monolithic, non-OO driver architectures I can't stress enough how cool IOKit is.

Best regards,
Michael Cashwell
_______________________________________________
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.