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.
tcDspNetPhy::tcDspNetPhy | ( | void * | apAddress | ) | [protected] |
Basic tcDspNetPhy constructor. This function creates the Phy interface class and initializes thread safe mutex's for it.
tcDspNetPhy::~tcDspNetPhy | ( | ) | [protected] |
Destructor. Typically not reached.
tcDspNetPhy * tcDspNetPhy::GetSpecificPhy | ( | void * | apAddress | ) | [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.
teNetPhyType tcDspNetPhy::GetPhyType | ( | unsigned int | anPhyAddr = 0xFFFFFFFF |
) | [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.
bool tcDspNetPhy::LinkUp | ( | unsigned int | anPhyAddr = 0xFFFFFFFF |
) | [virtual] |
This routine returns whether or not the ethernet link is up. Register.
Reimplemented in tcDspPhyMicrelKS8995.
unsigned short tcDspNetPhy::GetMIIRegister | ( | unsigned int | anRegAddr, | |
unsigned int | anPhyAddr = 0xFFFFFFFF | |||
) | [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) |
int tcDspNetPhy::SetMIIRegister | ( | unsigned int | anRegAddr, | |
unsigned int | anValue, | |||
unsigned int | anPhyAddr = 0xFFFFFFFF | |||
) | [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) |
bool tcDspNetPhy::GetPhyStatus | ( | tsNetPhyStatus & | arPhyStatus, | |
unsigned int | anPhyAddr = 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 tcDspPhyBroadcomBCM5221, tcDspPhyCrystalLanCS8952, tcDspPhyMicrelKS8995, and tcDspPhyNational83848.
virtual const char* tcDspNetPhy::GetPhyName | ( | void | ) | [inline, virtual] |
Reimplemented in tcDspPhyBroadcomBCM5221, tcDspPhyCrystalLanCS8952, tcDspPhyMicrelKS8995, and tcDspPhyNational83848.
virtual bool tcDspNetPhy::Initialize | ( | void | ) | [inline, virtual] |
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 tcDspPhyBroadcomBCM5221, tcDspPhyCrystalLanCS8952, tcDspPhyMicrelKS8995, and tcDspPhyNational83848.
unsigned int tcDspNetPhy::mnTicksPerMSec = CLK_countspms() / CLK_getprd() [static] |
Conversion from low res clock ticks to msecs.
unsigned int* tcDspNetPhy::mpBaseAddr [protected] |
pointer to the tcNetDrvr class address
unsigned int tcDspNetPhy::mnPhyAddr [protected] |
the PHY address being controlled
LCK_Handle tcDspNetPhy::mhMutex [protected] |
used for serialization