ADC Home > Reference Library > Reference > Darwin > Kernel Framework Reference
|
IONetworkMedium |
Inherits from: | |
Declared In: |
An object that encapsulates information about a network medium (i.e. 10Base-T, or 100Base-T Full Duplex).
The main purpose of this object is for a network driver to advertise its media capability, through a collection of IONetworkMedium objects stored in a dictionary in its property table. IONetworkMedium supports serialization, and will encode its properties in the form of a dictionary to the serialization stream when instructed. This will allow a user-space application to browse the set of media types supported by the controller.
Adds an IONetworkMedium object to a dictionary.
Frees the IONetworkMedium object.
Finds a medium object from a dictionary with a given index.
Finds a medium object from a dictionary with a given type.
Initializes an IONetworkMedium object.
Tests for equality between two IONetworkMedium objects.
Tests for equality between a IONetworkMedium object and an OSObject.
Factory method that allocates and initializes an IONetworkMedium object.
Creates a name that describes a medium type.
Removes an IONetworkMedium object from a dictionary.
Serializes the IONetworkMedium object.
addMedium |
Adds an IONetworkMedium object to a dictionary.
public
static bool addMedium( OSDictionary *dict, const IONetworkMedium * medium);
dict
An OSDictionary object where the medium object should be added as a new entry.
medium
The IONetworkMedium object to add to the dictionary.
Returns true on success, false otherwise.
A helper function to add an IONetworkMedium object to a given dictionary. The name of the medium is used as the key for the new dictionary entry.
free |
Frees the IONetworkMedium object.
protected
virtual void free();
getFlags |
public
virtual UInt32 getFlags() const;
Returns the medium flags.
getIndex |
public
virtual UInt32 getIndex() const;
Returns the assigned medium index.
getKey |
public
virtual const OSSymbol * getKey() const;
Returns the key to use for this medium object. This key should be used when this object is added to a dictionary. Same as getName().
getMediumWithIndex |
Finds a medium object from a dictionary with a given index.
public
static IONetworkMedium * getMediumWithIndex( const OSDictionary * dict, UInt32 index, UInt32 mask = 0);
dict
The dictionary to look for a matching entry.
index
Search for an entry with the given index.
mask
The don't care bits in index. Defaults to 0, which implies that a perfect match is desired.
Returns the first matching IONetworkMedium entry found, or 0 if no match was found.
This method iterates through a dictionary and returns an IONetworkMedium entry with the given index. An optional mask supplies the don't care bits.
getMediumWithType |
Finds a medium object from a dictionary with a given type.
public
static IONetworkMedium * getMediumWithType( const OSDictionary * dict, IOMediumType type, IOMediumType mask = 0);
dict
The dictionary to look for a matching entry.
type
Search for an entry with this type.
mask
The don't care bits in IOMediumType. Defaults to 0, which implies that a perfect match is desired.
Returns the first matching IONetworkMedium entry found, or 0 if no match was found.
This method iterates through a dictionary and returns an IONetworkMedium entry with the given type. An optional mask supplies the don't care bits.
getName |
public
virtual const OSSymbol * getName() const;
Returns the name assigned to this medium object.
getSpeed |
public
virtual UInt64 getSpeed() const;
Returns the maximum link speed supported by this medium.
getType |
public
virtual IOMediumType getType() const;
Returns the medium type assigned to this medium object.
init |
Initializes an IONetworkMedium object.
public
virtual bool init( IOMediumType type, UInt64 speed, UInt32 flags = 0, UInt32 index = 0, const char * name = 0);
type
The medium type, this value is encoded with bits defined in IONetworkMedium.h.
speed
The maximum (or the only) link speed supported over this medium in units of bits per second.
flags
An optional flag for the medium object. See IONetworkMedium.h for defined flags.
index
An optional index number assigned by the owner. Drivers can use this to store an index to a media table in the driver, or it may map to a driver-defined media type.
name
An optional name assigned to this medium object. If 0, then a name will be created based on the medium type by calling IONetworkMedium::nameForType(). Since the name of the medium is used as a key when inserted into a dictionary, the name chosen must be unique within the scope of the owner.
Returns true on success, false otherwise.
isEqualTo(const IONetworkMedium *) |
Tests for equality between two IONetworkMedium objects.
public
virtual bool isEqualTo( const IONetworkMedium * medium) const;
medium
An IONetworkMedium to test against the IONetworkMedium object being called.
Returns true if equal, false otherwise.
Two IONetworkMedium objects are considered equal if they have similar properties assigned to them during initialization.
isEqualTo(const OSMetaClassBase *) |
Tests for equality between a IONetworkMedium object and an OSObject.
public
virtual bool isEqualTo( const OSMetaClassBase * obj) const;
obj
An OSObject to test against an IONetworkMedium object.
Returns true if equal, false otherwise.
The OSObject is considered equal to the IONetworkMedium object if the OSObject is an IONetworkMedium, and they have similar properties assigned to them during initialization.
medium |
Factory method that allocates and initializes an IONetworkMedium object.
public
static IONetworkMedium * medium( IOMediumType type, UInt64 speed, UInt32 flags = 0, UInt32 index = 0, const char * name = 0);
type
The medium type, this value is encoded with bits defined in IONetworkMedium.h.
speed
The maximum (or the only) link speed supported over this medium in units of bits per second.
flags
An optional flag for the medium object. See IONetworkMedium.h for defined flags.
index
An optional index number assigned by the owner. Drivers can use this to store an index to a media table in the driver, or it may map to a driver-defined media type.
name
An optional name assigned to this medium object. If 0, then a name will be created based on the medium type by calling IONetworkMedium::nameForType(). Since the name of the medium is used as a key when inserted into a dictionary, the name chosen must be unique within the scope of the owner.
Returns an IONetworkMedium instance on success, or 0 otherwise.
nameForType |
Creates a name that describes a medium type.
public
static const OSSymbol * nameForType(IOMediumType type);
type
A medium type. See IONetworkMedium.h for type encoding.
Returns an OSSymbol object is created based on the type provided.
Given a medium type, creates an OSymbol object that describes the medium type. There is a 1-to-1 mapping between the medium type, and the medium name created by this method. The caller is responsible for releasing the OSSymbol object returned.
removeMedium |
Removes an IONetworkMedium object from a dictionary.
public
static void removeMedium( OSDictionary *dict, const IONetworkMedium * medium);
dict
The OSDictionary object where the medium object should be removed from.
medium
The name of this medium object is used as the key.
A helper function to remove an entry in a dictionary.
serialize |
Serializes the IONetworkMedium object.
public
virtual bool serialize( OSSerialize *s) const;
s
An OSSerialize object.
Returns true on success, false otherwise.
A dictionary is created containing the properties assigned to this medium object, and this dictionary is then serialized using the OSSerialize object provided.
_reserved |
protected
ExpansionData *_reserved;
Reserved for future use. (Internal use only)
reserved |
protected
ExpansionData *_reserved;
Reserved for future use. (Internal use only)
|
Last Updated: 2008-12-19