MityDSP Documentation Index
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes
tcDspNetPhy Class Reference

Class abstraction for Ethernet PHY interface customization. More...

#include <DspNetPhy.h>

Inheritance diagram for tcDspNetPhy:
tcDspPhyBroadcomBCM5221 tcDspPhyCrystalLanCS8952 tcDspPhyMicrelKS8995 tcDspPhyNational83848

List of all members.

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 tcDspNetPhyGetSpecificPhy (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

Detailed Description

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.


Constructor & Destructor Documentation

tcDspNetPhy::tcDspNetPhy ( void *  apAddress)
protected

Basic tcDspNetPhy constructor. This function creates the Phy interface class and initializes thread safe mutex's for it.

Parameters:
[in]apAddressthe base address of the associated tcNetDrvr MityDSP FPGA interface
tcDspNetPhy::~tcDspNetPhy ( )
protected

Destructor. Typically not reached.


Member Function Documentation

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.

Parameters:
[in]apAddressthe base address of the associated tcNetDrvr MityDSP FPGA interface
Returns:
pointer to a tcDspNetPhy (or derived) controlling object
teNetPhyType tcDspNetPhy::GetPhyType ( unsigned int  anPhyAddr = 0xFFFFFFFF)
virtual

This routine is used to get the type of PHY in use.

Returns:
Enumeration representing one of the known PHY types, or eePhyUnknown.
unsigned int tcDspNetPhy::PhyProbe ( )

This routine probes for valid MII manufacturer registers.

Returns:
Returns register offset (default: 1)
bool tcDspNetPhy::LinkUp ( unsigned int  anPhyAddr = 0xFFFFFFFF)
virtual

This routine returns whether or not the ethernet link is up. Register.

Returns:
Boolean indicating whether or not link is up.

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.

Parameters:
[in]anRegAddrThe offset to the desired MII register
[in]anPhyAddrThe address of the PHY (default:0)
Returns:
MII Register contents.
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.

Parameters:
[in]anRegAddrThe offset to the desired MII register
[in]anValueValue to write to the register.
[in]anPhyAddrThe address of the PHY (default:0xFFFFFFFF)
Returns:
0.
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.

Note:
the speed and duplex status cannot be determined from a base MII status word and are left at Unknown.
Parameters:
[out]arPhyStatusstructure to update
[in]anPhyAddraddress of the Phy (or 0xFFFFFFFF to probe)
Returns:
true if successful

Reimplemented in tcDspPhyMicrelKS8995, tcDspPhyBroadcomBCM5221, tcDspPhyCrystalLanCS8952, and tcDspPhyNational83848.

virtual const char* tcDspNetPhy::GetPhyName ( void  )
inlinevirtual
virtual bool tcDspNetPhy::Initialize ( void  )
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.

Returns:
true on success

Reimplemented in tcDspPhyMicrelKS8995, tcDspPhyBroadcomBCM5221, tcDspPhyCrystalLanCS8952, and tcDspPhyNational83848.


Member Data Documentation

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


  
Generated on Mon Apr 22 2013 11:33:33 for MityDSP Net by  Doxygen Version 1.8.1.1
Copyright © 2009, Critical Link LLC, All rights reserved.