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.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.
Result: kIOReturnSuccess on success, otherwise an error code is returned.
Name Description filters Each bit set indicates a particular filter that should be enabled. Filter bits that are not turned on must be disabled. activeFiltersP Updated 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.
protected:
virtual void free();
Frees the IOEthernetController instance.
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.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.
Result: Drivers should return kIOReturnSuccess upon success, or an error code otherwise.
Name Description addr Pointer to a enet_addr_t where the hardware address should be written to.
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.
Result: kIOReturnSuccess. Drivers that override this method must return an appropriate return code.
Name Description filtersP Pointer to an integer that shall be updated by this method to contain the set of supported filters.
public:
virtual bool init(OSDictionary * properties);
Initialize an IOEthernetController instance.
Result: true if initialized successfully, false otherwise.
Name Description properties A property dictionary.
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.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.
Result: kIOReturnSuccess if the request was handled successfully, otherwise a error code is returned.
Name Description sender The sender of the request. request The request type. arg0 Request argument. arg1 Request argument. arg2 Request argument. arg3 Request argument.
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.
Result: kIOReturnUnsupported. Drivers that implement this method must return an appropriate return code.
Name Description addr Pointer to a enet_addr_t containing the new Ethernet address.
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.
Result: kIOReturnUnsupported. Drivers that override this method must return an appropriate return code.
Name Description addrs Pointer to a list of multicast addresses. count The number of multicast addresses in the list. May be zero if the list becomes empty.
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.
Result: kIOReturnUnsupported. Drivers that override this method must return an appropriate return code.
Name Description mode The multicast filter should be programmed to the mode specified.
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.
Result: kIOReturnUnsupported. Drivers that override this method must return an appropriate return code.
Name Description mode The promiscuous filter should be programmed to the mode specified.
© 2000 Apple Computer, Inc. (Last Updated 2/23/2000)