Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: synchronization in an ethernet driver
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: synchronization in an ethernet driver




On Dec 29, 2005, at 3:10 PM, Andrew Gallatin wrote:

I'm writing my first pure, straight-to-hardware, ethernet driver for
darwin.  I'm just wondering what serialization is provided by IOKit,
and what do I need to provide for myself.  I've read the "Network
Device Driver Programming Guide", and it only mentions locking in the
context of using a gated output queue, and it suggests that the driver
protect the enable/disable methods with a mutex.

The enable and disable method calls are always gated on the controller's work loop.


Some drivers also leverage that the enable/disable methods are called in the proper sequence across sleep wake. And a lot of the sleep/wake handling can be moved inside those methods. The networking family does a thread callout to avoid hogging the PM work loop.

What about all the other entry points to the driver?  For example, can
setPromiscuousMode() be called simultaniously from multiple threads?
Or do these calls happen in the workloop context so they are
automagically gated?  How about setMaxPacketSize()?

I recall "almost" everything is gated, with the exception of outputPacket() for performance reasons.


-Joe

_______________________________________________
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: 
 >synchronization in an ethernet 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 © 2011 Apple Inc. All rights reserved.