Functions



addMedium

public:

static bool addMedium(OSDictionary * dict, const IONetworkMedium * medium);

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.

Parameters

NameDescription
dictAn OSDictionary object where the medium object should be added.
mediumThe IONetworkMedium object to be added to the dictionary.
Result: true on success, false otherwise.

free

protected:

virtual void free();

Free the IONetworkMedium instance.


getData

public:

virtual UInt32 getData() const;

Result: The assigned token.

getDescriptor

public:

virtual void getDescriptor(IOMediumDescriptor * descP) const;

Parameters

NameDescription
descPThe IOMediumDescriptor structure associated with the instance is copied to a structure provided by the caller.

getFlags

public:

virtual UInt32 getFlags() const;

Result: The medium flags.

getKey

public:

virtual const OSSymbol * getKey() const;

Result: The key for this instance. Same as getName().

getMedium

public:

static IONetworkMedium * getMedium(OSDictionary * dict, IOMediumDescriptor * match, IOMediumDescriptor * mask);

Iterate through a dictionary and return an IONetworkMedium entry that satisfies the matching criteria. Returns 0 if there is no match. Also see getMediumWithType() and getMediumWithData() that are built on top of this method.

Parameters

NameDescription
dictThe dictionary to look for a match.
matchAn IOMediumDescriptor structure containing the matching fields.
maskAn IOMediumDescriptor structure containing the matching mask. Bits set are used for matching, while cleared bits are don't care bits.
Result: The matching IONetworkMedium entry, 0 if no match was found.

getMediumWithData

public:

static IONetworkMedium * getMediumWithData(OSDictionary * dict, UInt32 data, UInt32 mask = 0);

Iterate through a dictionary and return an IONetworkMedium entry with the given data. A optional mask supplies the don't care bits.

Parameters

NameDescription
dictThe dictionary to look for a match.
typeThe medium data to search for.
maskThe don't care bits in data. Defaults to 0, which means all bits must match.
Result: The matching IONetworkMedium entry, 0 if no match was found.

getMediumWithType

public:

static IONetworkMedium * getMediumWithType(OSDictionary * dict, IOMediumType type, IOMediumType mask = 0);

Iterate through a dictionary and return an IONetworkMedium entry with the given type. A optional mask supplies the don't care bits.

Parameters

NameDescription
dictThe dictionary to look for a match.
typeThe medium type to search for.
maskThe don't care bits in IOMediumType. Defaults to 0, which means all bits must match.
Result: The matching IONetworkMedium entry, 0 if no match was found.

getName

public:

virtual const OSSymbol * getName() const;

Result: The name for this instance.

getSpeed

public:

virtual UInt64 getSpeed() const;

Result: The maximum medium speed.

getType

public:

virtual IOMediumType getType() const;

Result: The assigned medium type.

init

public:

virtual bool init(IOMediumType type, UInt64 speed, UInt32 flags = 0, UInt32 data = 0, const char * name = 0);

Initialize the IONetworkMedium instance.

Parameters

NameDescription
typeThe medium type, the fields are encoded with bits defined in IONetworkMedium.h.
speedThe maximum link speed supported over this medium in units of bits per second.
flagsAn optional flag for the medium object. No flags are currently defined.
dataAn arbitrary 32-bit token assigned by the caller.
nameAn optional name assigned to this medium object. If 0, then a name will be created based on the medium type given.
Result: true on success, false otherwise.

isEqualTo

public:

virtual bool isEqualTo(const IONetworkMedium * medium) const;

Parameters

NameDescription
mediumAn IONetworkMedium to test against the receiver of this method. Two IONetworkMedium objects are considered equal if they have the same name.
Result: true if equal, false otherwise.

isEqualTo

public:

virtual bool isEqualTo(const OSObject * obj) const;

Parameters

NameDescription
objAn OSObject to test against the receiver of this method. The object is considered equal if it is an IONetworkMedium, and it has the same name as the receiver.
Result: true if equal, false otherwise.

medium

public:

static IONetworkMedium * medium(IOMediumType type, UInt64 speed, UInt32 flags = 0, UInt32 data = 0, const char * name = 0);

Factory method that will construct and initialize an IONetworkMedium instance.

Parameters

NameDescription
typeSee init().
speedSee init().
flagsSee init().
dataSee init().
nameSee init().
Result: An IONetworkMedium instance on success, or 0 otherwise.

nameForType

public:

static const OSSymbol * nameForType(IOMediumType type);

Given a medium type, create an unique OSymbol name for the medium. The caller is responsible for releasing the OSSymbol instance returned.

Parameters

NameDescription
typeA medium type.
Result: An OSSymbol created from the type provided.

removeMedium

public:

static void removeMedium(OSDictionary * dict, const IONetworkMedium * medium);

A helper function to remove an entry in a dictionary with a key which matches the name of the IONetworkMedium object provided.

Parameters

NameDescription
dictAn OSDictionary object where the medium object should be removed from.
mediumThe name of this medium object is used as the removal key.

serialize

public:

virtual bool serialize(OSSerialize * s) const;

Create an OSData containing an IOMediumDescriptor structure (not copied), and ask the OSData to serialize.

Parameters

NameDescription
sAn OSSerialize object to handle the serialization.
Result: true on success, false otherwise.

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