Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: Multiple Services provided by a single driver
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Multiple Services provided by a single driver



The func1 and func2 nubs should each be tabbed over to the right by one since they are clients of the multifunction driver (their provider).

(IOPCIDevice - nub)
-> (IOService derived - multifunction driver) [creates func1 and func2 nubs, attaches, and registerService]
-> (IOService derived - func1 nub)
-> (IOService derived - func1 driver) [matching to possibly another kext]
-> (IOService derived - func2 nub)
-> (IOService derived - func2 driver) [matching to possibly yet another kext]
In either case, how do IOUserClient derived objects get created for func1 and func2 drivers?


On 8-Apr-05, at 2:04 PM, Anthony Malizia wrote:

I was trying to summarize the general case, not necessarily John's example.
(IOPCIDevice - nub)
-> (IOService derived - multifunction driver) [creates func1 and func2 nubs, attaches, and registerService]
-> (IOService derived - func1 nub)
-> (IOService derived - func1 driver) [matching to possibly another kext]
-> (IOService derived - func2 nub)
-> (IOService derived - func2 driver) [matching to possibly yet another kext]
Or?
(IOPCIDevice - nub)
-> (IOService derived - multifunction driver) [creates func1 and func2 drivers, attaches, and registerService]
-> (IOService derived - func1 driver) [must be in same kext as multifunction driver?]
-> (IOService derived - func2 driver) [must be in same kext as multifunction driver?]
What about user clients? How do they get created and attached?
Thanks again.
On 8-Apr-05, at 1:17 PM, Dean Reece wrote:
Actually, they can be either nubs OR complete drivers. The way you decide which it use depends on where the support for the next layer up comes from. In the multi-slot flash reader example, the objects being published are IOMedia nubs, and they get registered for matching and IOKit takes over and does the rest. In this case, you don't want to provide the higher-layers of functionality in your driver; you want IOKit to find the best consumer for your services and wire everything up.
In a case where your kext is providing the functionality and there is no reason to use IOKit matching to find the best consumer, then you can directly instantiate the desired driver object, then attach() it and start() it. This is done in the Apple16X50Serial driver for multi-UART devices: A bus controller matches against the physical device (PCI or PCCard) and creates a UART driver object for each UART it finds (up to 4 in the current implementation). Of course, these UART driver object(s) register for matching and are consumed by IOSerialFamily, so these objects are both drivers and nubs.
Cheers,
- 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

 _______________________________________________
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: 
 >Re: Multiple Services provided by a single driver (From: "John Baldwin" <email@hidden>)
 >Re: Multiple Services provided by a single driver (From: Garth Cummings <email@hidden>)
 >Re: Multiple Services provided by a single driver (From: Anthony Malizia <email@hidden>)
 >Re: Multiple Services provided by a single driver (From: Anthony Malizia <email@hidden>)
 >Re: Multiple Services provided by a single driver (From: Garth Cummings <email@hidden>)
 >Re: Multiple Services provided by a single driver (From: Dean Reece <email@hidden>)
 >Re: Multiple Services provided by a single driver (From: Anthony Malizia <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.