ADC Home > Reference Library > Reference > Hardware & Drivers > I/O Kit Framework Reference
|
IOEthernetInterface |
Inherits from: | |
Declared In: |
The Ethernet interface object.
An Ethernet controller driver, that is a subclass of IOEthernetController, will instantiate an object of this class when the driver calls the attachInterface() method. This interface object will then vend an Ethernet interface to DLIL, and manage the connection between the controller driver and the upper networking layers. Drivers will seldom need to subclass IOEthernetInterface.
Handles a notification that the network controller servicing this interface object has transitioned to a new power state.
A notification that the interface has opened the network controller.
Handles a notification that the network controller servicing this interface object is about to transition to a new power state.
A notification that the interface will close the network controller.
Frees the IOEthernetInterface instance.
Returns a string containing the prefix to use when creating a BSD name for this interface.
Initializes an IOEthernetInterface instance.
Handles an ioctl command sent to the Ethernet interface.
Handles a request to set Ethernet interface properties from kernel or non-kernel clients.
controllerDidChangePowerState |
Handles a notification that the network controller servicing this interface object has transitioned to a new power state.
protected
virtual IOReturn controllerDidChangePowerState( IONetworkController *controller, IOPMPowerFlags flags, UInt32 stateNumber, IOService *policyMaker);
controller
The network controller object.
flags
Flags that describe the capability of the controller in the new power state.
stateNumber
An index to a state in the network controller's power state array that the controller has switched to.
policyMaker
A reference to the network controller's policy-maker, and is also the originator of this notification.
Always returns kIOReturnSuccess.
If the controller did transition to a usable state, and it was previously disabled due to a previous power change, then it is re-enabled.
controllerDidOpen |
A notification that the interface has opened the network controller.
protected
virtual bool controllerDidOpen( IONetworkController *controller);
controller
The controller object that was opened.
Returns true on success, false otherwise. Returning false will cause the controller to be closed, and any pending client opens to be rejected.
This method will be called by IONetworkInterface after a network controller has accepted an open from this interface object. IOEthernetInterface will first call the implementation in its superclass, then inspect the controller through properties published in the registry. This method is called with the arbitration lock held.
controllerWillChangePowerState |
Handles a notification that the network controller servicing this interface object is about to transition to a new power state.
protected
virtual IOReturn controllerWillChangePowerState( IONetworkController *controller, IOPMPowerFlags flags, UInt32 stateNumber, IOService *policyMaker);
controller
The network controller object.
flags
Flags that describe the capability of the controller in the new power state.
stateNumber
An index to a state in the network controller's power state array that the controller is switching to.
policyMaker
A reference to the network controller's policy-maker, and is also the originator of this notification.
Always returns kIOReturnSuccess.
If the controller is about to transition to an unusable state, and it is currently enabled, then the disable() method on the controller is called.
controllerWillClose |
A notification that the interface will close the network controller.
protected
virtual void controllerWillClose( IONetworkController *controller);
controller
The controller that is about to be closed.
This method will simply call super to propagate the method call. This method is called with the arbitration lock held.
free |
Frees the IOEthernetInterface instance.
protected
virtual void free();
The memory allocated for the arpcom structure is released, followed by a call to super::free().
getNamePrefix |
Returns a string containing the prefix to use when creating a BSD name for this interface.
public
virtual const char * getNamePrefix() const;
Returns a pointer to a constant C string "en". Therefore, Ethernet interfaces will be registered with BSD as en0, en1, etc.
The BSD name for each interface object is created by concatenating a string returned by this method, with an unique unit number assigned by IONetworkStack.
init |
Initializes an IOEthernetInterface instance.
public
virtual bool init( IONetworkController *controller );
controller
A network controller object that will service the interface object being initialized.
Returns true on success, false otherwise.
Instance variables are initialized, and an arpcom structure is allocated.
performCommand |
Handles an ioctl command sent to the Ethernet interface.
protected
virtual SInt32 performCommand( IONetworkController *controller, UInt32 cmd, void *arg0, void *arg1);
controller
The controller object.
cmd
The ioctl command code.
arg0
Command argument 0. Generally a pointer to an ifnet structure associated with the interface.
arg1
Command argument 1.
Returns a BSD return value defined in bsd/sys/errno.h.
This method handles socket ioctl commands sent to the Ethernet interface from DLIL. Commands recognized and processed by this method are SIOCSIFADDR, SIOCSIFFLAGS, SIOCADDMULTI, and SIOCDELMULTI. Other commands are passed to the superclass.
setProperties |
Handles a request to set Ethernet interface properties from kernel or non-kernel clients.
public
virtual IOReturn setProperties( OSObject *properties );
properties
An OSDictionary containing a collection of properties.
Returns kIOReturnUnsupported if the interface did not recognize any of the properties provided. Otherwise, the return code will be kIOReturnSuccess to indicate no errors, or an IOReturn error code to indicate that an error occurred while handling one of the properties.
For non-kernel clients, the preferred access mechanism is through a user client connection.
_reserved |
private
ExpansionData * _reserved;
Reserved for future use. (Internal use only)
reserved |
private
ExpansionData * _reserved;
Reserved for future use. (Internal use only)
|
Last Updated: 2009-02-23