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: matching for a shim driver



On Thu, 16 Sep 2004, Andrew Gallatin wrote:
>
> John Dalgliesh writes:
>
>  > For this kind of multiprotocol driver it would definitely be the easiest,
>  > and the name IOMatchCategory even makes sense - are you matching on the
>  > 'Ethernet' part of your driver of the 'Serial' part of it, etc.
>  >
>  > Of course the number 1 reason for me would be that you don't have to write
>  > any code at all! The only change to your (master's) start routine is to
>  > call 'registerService', and the protocol drivers get automagically matched
>  > and started with you as their provider - a quick metacast and they can
>  > call any (public) functions in your class they like. You don't have to
>  > make up an interface in the nub ... or leap over it to get to the real
>  > provider.
>  >
>
> This sounds great to me!  The less code, the better.  And I was
> planning totally separate kexts too.    But I'm still confounded.

Whether or not you have different kexts isn't really related to which
scheme you use - you can put as many classes and personality dicts into
the one kext as you like. The best reason to have a separate kext IMHO is
if the drivers are really separable.

> Lets say I want to use IOMatchCategory with string as "mx_ether".
> How do I export this from the master driver such that the ethernet
> driver can match on it?  Do I add something to the master's
> Info.plist?  Do I pass an argument to registerService()?

No AFAIK the driver that is matched to doesn't have to do anything at all.
The IOKit system just makes sure there is no more than one matched
IOService for each match category. I can't remember if I've actually tried
this but from memory that's how it works. Give it a go - it shouldn't take
long to try out :)

> I'm pretty sure that I want to have the matching section of
> the client look something like this:
>
> 	<key>IOKitPersonalities</key>
> 	<dict>
> 		<key>mx_ether</key>
> 		<dict>
> 			<key>CFBundleIdentifier</key>
> 			<string>com.Myricom.iokit.mx_ether</string>
> 			<key>IOClass</key>
> 			<string>mx_ether</string>
> 			<key>IOMatchCategory</key>
> 			<string>mx_ether</string>
> 			<key>IOProviderClass</key>
> 			<string>mx_driver</string>
> 		</dict>
> 	</dict>

Looks good to me.

> For reference, the existing Info.plist of the master driver is below:
>
<snip>

Looks good.

> Thanks (and sorry to be a moron..)

I think there's just lots of ways to do it. I'll be very interested to
read what others think of my suggestions/reasoning too :)

> Drew

{P^/
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-drivers mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/darwin-drivers/email@hidden

This email sent to email@hidden

References: 
 >matching for a shim driver (From: Andrew Gallatin <email@hidden>)
 >Re: matching for a shim driver (From: Godfrey van der Linden <email@hidden>)
 >Re: matching for a shim driver (From: Andrew Gallatin <email@hidden>)
 >Re: matching for a shim driver (From: Godfrey van der Linden <email@hidden>)
 >Re: matching for a shim driver (From: John Dalgliesh <email@hidden>)
 >Re: matching for a shim driver (From: Andrew Gallatin <email@hidden>)



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.