Class abstraction for Ethernet PHY interface customization. More...
#include <DspNetPhy.h>
Public Member Functions | |
virtual teNetPhyType | GetPhyType (unsigned int anPhyAddr=0xFFFFFFFF) |
unsigned int | PhyProbe () |
virtual bool | LinkUp (unsigned int anPhyAddr=0xFFFFFFFF) |
virtual unsigned short | GetMIIRegister (unsigned int anRegAddr, unsigned int anPhyAddr=0xFFFFFFFF) |
virtual int | SetMIIRegister (unsigned int anRegAddr, unsigned int anValue, unsigned int anPhyAddr=0xFFFFFFFF) |
virtual bool | GetPhyStatus (tsNetPhyStatus &arPhyStatus, unsigned int anPhyAddr=0xFFFFFFFF) |
virtual const char * | GetPhyName (void) |
virtual bool | Initialize (void) |
Static Public Member Functions | |
static tcDspNetPhy * | GetSpecificPhy (void *apAddress) |
Static Public Attributes | |
static unsigned int | mnTicksPerMSec = CLK_countspms() / CLK_getprd() |
Conversion from low res clock ticks to msecs. |
Protected Member Functions | |
tcDspNetPhy (void *apAddress) | |
~tcDspNetPhy () |
Protected Attributes | |
unsigned int * | mpBaseAddr |
pointer to the tcNetDrvr class address | |
unsigned int | mnPhyAddr |
the PHY address being controlled | |
LCK_Handle | mhMutex |
used for serialization |
Class abstraction for Ethernet PHY interface customization.
The tcDspNetPhy class provides a common, extensible interface to ethernet PHY devices. This class allows handling of PHY specific control and status gathering via (by default) an provided MDIO interface or may be extended to use other interface mechanisms to provide similar capability.
Control over PHY specific features such as VLAN configuration, link parameter modification, etc., is achieved through this interface.
|
protected |
Basic tcDspNetPhy constructor. This function creates the Phy interface class and initializes thread safe mutex's for it.
|
protected |
Destructor. Typically not reached.
|
static |
PHY controller object factory. This is a static method that may be used to construct a specific PHY interface class that supports all of the features of the PHY. If no custom interface class is found for the detected PHY type, then a basic tcDspNetPhy object is returned.
|
virtual |
This routine is used to get the type of PHY in use.
unsigned int tcDspNetPhy::PhyProbe | ( | ) |
This routine probes for valid MII manufacturer registers.
|
virtual |
This routine returns whether or not the ethernet link is up. Register.
Reimplemented in tcDspPhyMicrelKS8995.
|
virtual |
This routine is used to read the current value stored in an MII Register.
[in] | anRegAddr | The offset to the desired MII register |
[in] | anPhyAddr | The address of the PHY (default:0) |
|
virtual |
This routine is used to set the specified 16-bit value to an MII Register.
[in] | anRegAddr | The offset to the desired MII register |
[in] | anValue | Value to write to the register. |
[in] | anPhyAddr | The address of the PHY (default:0xFFFFFFFF) |
|
virtual |
Get the basic PHY status of a connected device from the standard MII status word.
[out] | arPhyStatus | structure to update |
[in] | anPhyAddr | address of the Phy (or 0xFFFFFFFF to probe) |
Reimplemented in tcDspPhyMicrelKS8995, tcDspPhyBroadcomBCM5221, tcDspPhyCrystalLanCS8952, and tcDspPhyNational83848.
|
inlinevirtual |
Reimplemented in tcDspPhyMicrelKS8995, tcDspPhyBroadcomBCM5221, tcDspPhyCrystalLanCS8952, and tcDspPhyNational83848.
|
inlinevirtual |
This method is called by a tcDspNetdrvr instance while opening the EMAC interface for use. This routine should return true if there are no errors. Classes should re-implement this if specific MDIO or other intialization commands are necessary prior to operation of the device.
Reimplemented in tcDspPhyMicrelKS8995, tcDspPhyBroadcomBCM5221, tcDspPhyCrystalLanCS8952, and tcDspPhyNational83848.
|
static |
Conversion from low res clock ticks to msecs.
|
protected |
pointer to the tcNetDrvr class address
|
protected |
the PHY address being controlled
|
protected |
used for serialization