IOEthernetController



Member Functions

allocateNetworkInterface

protected:

virtual IONetworkInterface * allocateNetworkInterface();

Allocates and returns a new IOEthernetInterface instance. The controller class from each family must implement this method inherited from IONetworkController to return the corresponding interface object when attachNetworkInterface() is called. Subclasses of IOEthernetController (Ethernet drivers) would have little need to override this implementation.

Result: A newly allocated and initialized IONetworkInterface instance.

enablePacketFilters

protected:

virtual IOReturn enablePacketFilters(UInt32 filters, UInt32 * activeFiltersP);

Called by interface object to change the set of packet filters that should be enabled by the controller. The implementation in IOEthernetController will trap any changes to multicast or promiscuous filters and convert the changes into a filter mode for setMulticastMode() and setPromiscuousMode() methods. This is done strictly as a convenience for drivers, which may choose to override this method to handle the filter changes directly. Unicast and Broadcast filters are assumed to be always enabled, and no driver intervention is required.

Parameters

NameDescription
filtersEach bit set indicates a particular filter that should be enabled. Filter bits that are not turned on must be disabled.
activeFiltersPUpdated by this method to reflect the real set of active filters. Ideally, it should be the same as the set specified by the first argument.
Result: kIOReturnSuccess on success, otherwise an error code is returned.

free

protected:

virtual void free();

Frees the IOEthernetController instance.


getFamilyFeatureSet

public:

virtual UInt32 getFamilyFeatureSet() const;

Get the Ethernet feature sets supported by the controller. Ethernet controller drivers may override this method and return a mask of supported feature sets.

Result: IOEthernetController will always return 0.

getHardwareAddress

protected:

virtual IOReturn getHardwareAddress(enet_addr_t * addr) = 0;

Get the controller's hardware address. Ethernet drivers must implement this method, by reading the address from hardware and writing it to the buffer provided.

Parameters

NameDescription
addrPointer to a enet_addr_t where the hardware address should be written to.
Result: Drivers should return kIOReturnSuccess upon success, or an error code otherwise.

getPacketFilters

protected:

virtual IOReturn getPacketFilters(UInt32 * filtersP);

Returns all the packet filters supported by the controller. See IONetworkController for the list of packet filters. This method will perform a bitwise OR of kIOPacketFilterUnicast, kIOPacketFilterBroadcast, kIOPacketFilterMulticast, kIOPacketFilterPromiscuous, and write the result using the provided pointer. Drivers that support a different set of filters should override this method.

Parameters

NameDescription
filtersPPointer to an integer that shall be updated by this method to contain the set of supported filters.
Result: kIOReturnSuccess. Drivers that override this method must return an appropriate return code.

init

public:

virtual bool init(OSDictionary * properties);

Initialize an IOEthernetController instance.

Parameters

NameDescription
propertiesA property dictionary.
Result: true if initialized successfully, false otherwise.

publishCapabilities

protected:

virtual bool publishCapabilities();

Publish Ethernet specific properties to the property table. For instance, getHardwareAddress() is called to fetch the hardware address. This method is called by the superclass and should not be called by drivers.

Result: true if all required properties were discovered and published without errors, false otherwise.

requestHandler

public:

virtual IOReturn requestHandler(OSObject * sender, UInt32 request, void * arg0 = 0, void * arg1 = 0, void * arg2 = 0, void * arg3 = 0);

Overrides the requestHandler() inherited from IONetworkController to handle Ethernet specific requests sent from our clients. Requests not handled are passed to the superclass.

Parameters

NameDescription
senderThe sender of the request.
requestThe request type.
arg0Request argument.
arg1Request argument.
arg2Request argument.
arg3Request argument.
Result: kIOReturnSuccess if the request was handled successfully, otherwise a error code is returned.

setHardwareAddress

protected:

virtual IOReturn setHardwareAddress(const enet_addr_t * addr);

Called when a client wishes to change the station address used by the controller's hardware filter. Implementation of this method is optional.

Parameters

NameDescription
addrPointer to a enet_addr_t containing the new Ethernet address.
Result: kIOReturnUnsupported. Drivers that implement this method must return an appropriate return code.

setMulticastList

protected:

virtual IOReturn setMulticastList(enet_addr_t * addrs, UInt count);

Called when the list of multicast addresses in the interface object attached to the controller is changed. Drivers that supports multicasting should override this method and update the hardware filter using the provided address list. A count of the number of addresses in the list is also provided. This count will be zero when the list becomes empty. Perfect multicast filtering is preferred if supported by the hardware. If the number of multicast addresses in the list exceed the limit imposed by the hardware, or if perfect filtering is not supported, then ideally the hardware should be programmed to perform imperfect filtering, perhaps through a hash table built by the driver. This method may be called only if getPacketFilters() reports that kIOPacketFilterMulticast is supported.

Parameters

NameDescription
addrsPointer to a list of multicast addresses.
countThe number of multicast addresses in the list. May be zero if the list becomes empty.
Result: kIOReturnUnsupported. Drivers that override this method must return an appropriate return code.

setMulticastMode

protected:

virtual IOReturn setMulticastMode(IOEnetMulticastMode mode);

Called by enablePacketFilters() when the controller's multicast filter mode should be changed. See IOEnetMulticastMode for the list of defined modes.

Parameters

NameDescription
modeThe multicast filter should be programmed to the mode specified.
Result: kIOReturnUnsupported. Drivers that override this method must return an appropriate return code.

setPromiscuousMode

protected:

virtual IOReturn setPromiscuousMode(IOEnetPromiscuousMode mode);

Called by enablePacketFilters() when the controller's promiscuous filter mode should be changed. See IOEnetPromiscuousMode for the list of defined modes.

Parameters

NameDescription
modeThe promiscuous filter should be programmed to the mode specified.
Result: kIOReturnUnsupported. Drivers that override this method must return an appropriate return code.

© 2000 Apple Computer, Inc. — (Last Updated 2/23/2000)