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: How to define new ioctl commands for a Network Controller?



On Nov 24, 2003, at 1:16 PM, Jim Hunter wrote:
I have a need to define driver-dependant ioctl commands for an IOKit
ethernet driver I am developing, but the IOKit interface doesn't seem
to propagate unknown ioctl commands down to the driver.

You're approaching in from the wrong direction.

To handle new ioctls, define a subclass of IONetworkInterface (or IOEthernetInterface, or whatever you'd normally use for your driver). That subclass should implement performCommand(), which should handle your interface-specific ioctls and then pass anything else *up* to its superclass's performCommand() method. The fact that the some commands are delegated to the IONetworkController subclass associated with the interface is an implementation detail--ioctls are really directed towards the interface class.

I hope I'm just missing something here, but if that is not the case, then my
workaround might be to define an EthernetInterface subclass for the sole purpose
of overriding its performCommand() method so that it will pass unknown ioctl
commands down to the driver (the default method in EthernetInterface calls its
NetworkController superclass). I will try this workaround.

I think you are mixing up the controller and interface class hierarchies. IOEthernetInterface is not a subclass of IONetworkController, it's a subclass of IONetworkInterface.

However, it seems to me that the IOKit scheme should be extended to allow a
network driver to receive custom ioctl commands.

It does--you just have to subclass the interface as well as the controller.

Roughly speaking the interface class defines the driver's API to the networking stack, and the controller class defines how it talks to the hardware. Factoring these apart is nice, since many drivers only need to deal with the latter.


Amanda Walker
_______________________________________________
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.

References: 
 >How to define new ioctl commands for a Network Controller? (From: Jim Hunter <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.