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.
Result: true on success, false otherwise.
Name Description dict An OSDictionary object where the medium object should be added. medium The IONetworkMedium object to be added to the dictionary.
protected:
virtual void free();
Free the IONetworkMedium instance.
public:
virtual UInt32 getData() const;
Result: The assigned token.
public:
virtual void getDescriptor(IOMediumDescriptor * descP) const;
Name Description descP The IOMediumDescriptor structure associated with the instance is copied to a structure provided by the caller.
public:
virtual UInt32 getFlags() const;
Result: The medium flags.
public:
virtual const OSSymbol * getKey() const;
Result: The key for this instance. Same as getName().
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.
Result: The matching IONetworkMedium entry, 0 if no match was found.
Name Description dict The dictionary to look for a match. match An IOMediumDescriptor structure containing the matching fields. mask An IOMediumDescriptor structure containing the matching mask. Bits set are used for matching, while cleared bits are don't care bits.
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.
Result: The matching IONetworkMedium entry, 0 if no match was found.
Name Description dict The dictionary to look for a match. type The medium data to search for. mask The don't care bits in data. Defaults to 0, which means all bits must match.
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.
Result: The matching IONetworkMedium entry, 0 if no match was found.
Name Description dict The dictionary to look for a match. type The medium type to search for. mask The don't care bits in IOMediumType. Defaults to 0, which means all bits must match.
public:
virtual const OSSymbol * getName() const;
Result: The name for this instance.
public:
virtual UInt64 getSpeed() const;
Result: The maximum medium speed.
public:
virtual IOMediumType getType() const;
Result: The assigned medium type.
public:
virtual bool init(IOMediumType type, UInt64 speed, UInt32 flags = 0, UInt32 data = 0, const char * name = 0);
Initialize the IONetworkMedium instance.
Result: true on success, false otherwise.
Name Description type The medium type, the fields are encoded with bits defined in IONetworkMedium.h. speed The maximum link speed supported over this medium in units of bits per second. flags An optional flag for the medium object. No flags are currently defined. data An arbitrary 32-bit token assigned by the caller. name An optional name assigned to this medium object. If 0, then a name will be created based on the medium type given.
public:
virtual bool isEqualTo(const IONetworkMedium * medium) const;
Result: true if equal, false otherwise.
Name Description medium An IONetworkMedium to test against the receiver of this method. Two IONetworkMedium objects are considered equal if they have the same name.
public:
virtual bool isEqualTo(const OSObject * obj) const;
Result: true if equal, false otherwise.
Name Description obj An 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.
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.
Result: An IONetworkMedium instance on success, or 0 otherwise.
Name Description type See init(). speed See init(). flags See init(). data See init(). name See init().
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.
Result: An OSSymbol created from the type provided.
Name Description type A medium type.
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.
Name Description dict An OSDictionary object where the medium object should be removed from. medium The name of this medium object is used as the removal key.
public:
virtual bool serialize(OSSerialize * s) const;
Create an OSData containing an IOMediumDescriptor structure (not copied), and ask the OSData to serialize.
Result: true on success, false otherwise.
Name Description s An OSSerialize object to handle the serialization.
© 2000 Apple Computer, Inc. (Last Updated 2/23/2000)