|
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
Hi Dean -
Thanks, Jim
On Feb 13, 2007, at 12:49 AM, Jim Wintermyre wrote:Our driver supports multiple physical instance of our PCI/PCIe device. Normally, kextload loads the driver for every instance of our device; similarly, kextunload unloads every instance of the driver.
Is there any way to kextload the driver for only a specific physical device instance, i.e. load it for card A but not for card B? Similarly, is there any way to kextunload only a specific instance of the driver?
When a kext is loaded, all IOService objects that are currently unmatched will be evaluated to see if the new driver can drive them. An instance of your class will be created for each matching nub. When you kextunload a kext, the kernel will "terminate" all instance of classes that the kext owns - the actual unload occurs only once the class instance counts go down to 0.
There is no way to say "this kext should only be matched on this nub". The kext itself can be smart enough to fail any matches it doesn't want, but there is no way to restrict the matching process from outside the kext. Also, if a kext declines to match, I don't think it'll get a second chance on that nub till the next reboot (though I haven't looked at those matching rules in a long time).
As for unloading, an in-kernel function can send "terminate" messages to individual drivers, independent of a kextunload, but there isn't a programmatic way to do that from user-space that I'm aware of.
Are you trying to use this for debugging, or do you want to do this in a production environment?
- Dean
_______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-drivers mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
| References: | |
| >kextload/unload and multiple devices (From: Jim Wintermyre <email@hidden>) | |
| >Re: kextload/unload and multiple devices (From: Dean Reece <email@hidden>) |
| Home | Archives | Terms/Conditions | Contact | RSS | Lists | About |
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.