MityDSP Documentation Index
Public Member Functions | Protected Attributes
tcDspPhyMicrelKS8995 Class Reference

Controller Class for Micrel Managed Switch. More...

#include <DspPhyMicrelKS8995.h>

Inheritance diagram for tcDspPhyMicrelKS8995:
tcDspNetPhy

List of all members.

Public Member Functions

 tcDspPhyMicrelKS8995 (void *apAddress)
 tcDspPhyMicrelKS8995 (void *apAddress, MityDSP::tcDspSpi *apSpi)
virtual ~tcDspPhyMicrelKS8995 ()
bool Initialize (void)
virtual const char * GetPhyName (void)
virtual bool LinkUp (unsigned int anPhyAddr=0xFFFFFFFF)
virtual bool GetPhyStatus (tsNetPhyStatus &arPhyStatus, unsigned int anPhyAddr=0xFFFFFFFF)
void SetSpi (MityDSP::tcDspSpi *apSpi)
void WriteSpiRegister (unsigned char anRegister, unsigned char anData)
bool ReadSpiRegister (unsigned char anRegister, unsigned char &anData)
bool SetVlanTableEntry (int anEntry, unsigned short anVID, char anPortMemberMask)
bool StartSwitch ()
bool SetTagInsertion (int anPort, bool abEnable)
bool SetTagRemoval (int anPort, bool abEnable)
bool SetPriorityEnable (int anPort, bool abEnable)
bool SetPortVlanMembership (int anPort, char anMembershipMask)
bool SetPortIngressVlanFilter (int anPort, bool abEnable)
bool SetPortDefaultVID (int anPort, unsigned short anVid)
bool EnableVlan ()
- Public Member Functions inherited from tcDspNetPhy
virtual teNetPhyType GetPhyType (unsigned int anPhyAddr=0xFFFFFFFF)
unsigned int PhyProbe ()
virtual unsigned short GetMIIRegister (unsigned int anRegAddr, unsigned int anPhyAddr=0xFFFFFFFF)
virtual int SetMIIRegister (unsigned int anRegAddr, unsigned int anValue, unsigned int anPhyAddr=0xFFFFFFFF)

Protected Attributes

MityDSP::tcDspSpi * mpSpi
 pointer to the SPI interface on the chip
- Protected Attributes inherited from tcDspNetPhy
unsigned int * mpBaseAddr
 pointer to the tcNetDrvr class address
unsigned int mnPhyAddr
 the PHY address being controlled
LCK_Handle mhMutex
 used for serialization

Additional Inherited Members

- Static Public Member Functions inherited from tcDspNetPhy
static tcDspNetPhyGetSpecificPhy (void *apAddress)
- Static Public Attributes inherited from tcDspNetPhy
static unsigned int mnTicksPerMSec = CLK_countspms() / CLK_getprd()
 Conversion from low res clock ticks to msecs.
- Protected Member Functions inherited from tcDspNetPhy
 tcDspNetPhy (void *apAddress)
 ~tcDspNetPhy ()

Detailed Description

Controller Class for Micrel Managed Switch.

This class provides PHY interface control over the Micrl KS8995 managed switch. This class includes methods to control the VLAN settings of the interface port.

This class requires access to a tcDspSpi interface which is connected to the management SPI port of the device.


Constructor & Destructor Documentation

tcDspPhyMicrelKS8995::tcDspPhyMicrelKS8995 ( void *  apAddress)
tcDspPhyMicrelKS8995::tcDspPhyMicrelKS8995 ( void *  apAddress,
MityDSP::tcDspSpi *  apSpi 
)
Parameters:
[in]apAddresspointer to MityDSP EMAC core base address
[in]apSpipointer to SPI management Device (may be NULL)
tcDspPhyMicrelKS8995::~tcDspPhyMicrelKS8995 ( )
virtual

Destructor. Typically not reached.


Member Function Documentation

bool tcDspPhyMicrelKS8995::Initialize ( void  )
virtual

Initialize the PHY. This will issue the SPI command on the management interface to take the part out of isolation mode.

Returns:
true

Reimplemented from tcDspNetPhy.

virtual const char* tcDspPhyMicrelKS8995::GetPhyName ( void  )
inlinevirtual

Reimplemented from tcDspNetPhy.

bool tcDspPhyMicrelKS8995::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 from tcDspNetPhy.

bool tcDspPhyMicrelKS8995::GetPhyStatus ( tsNetPhyStatus arPhyStatus,
unsigned int  anPhyAddr = 0xFFFFFFFF 
)
virtual

Reads the status of one of the 5 phy ports

Parameters:
[in]arPhyStatus
[in]anPhyAddrfor the Micrel Switch, can range from 1 (default) to 5
Returns:
true if the status was updated correctly

Reimplemented from tcDspNetPhy.

void tcDspPhyMicrelKS8995::SetSpi ( MityDSP::tcDspSpi *  apSpi)

Sets the management SPI interface and configures the clocking modes.

Parameters:
[in]apSpipointer to SPI management Device (may be NULL)
void tcDspPhyMicrelKS8995::WriteSpiRegister ( unsigned char  anRegister,
unsigned char  anData 
)
bool tcDspPhyMicrelKS8995::ReadSpiRegister ( unsigned char  anRegister,
unsigned char &  anData 
)
bool tcDspPhyMicrelKS8995::SetVlanTableEntry ( int  anEntry,
unsigned short  anVID,
char  anPortMemberMask 
)
bool tcDspPhyMicrelKS8995::StartSwitch ( )
bool tcDspPhyMicrelKS8995::SetTagInsertion ( int  anPort,
bool  abEnable 
)
bool tcDspPhyMicrelKS8995::SetTagRemoval ( int  anPort,
bool  abEnable 
)
bool tcDspPhyMicrelKS8995::SetPriorityEnable ( int  anPort,
bool  abEnable 
)
bool tcDspPhyMicrelKS8995::SetPortVlanMembership ( int  anPort,
char  anMembershipMask 
)
bool tcDspPhyMicrelKS8995::SetPortIngressVlanFilter ( int  anPort,
bool  abEnable 
)
bool tcDspPhyMicrelKS8995::SetPortDefaultVID ( int  anPort,
unsigned short  anVid 
)
bool tcDspPhyMicrelKS8995::EnableVlan ( )
Note:
VLan table must be set up prior to enabling the VLAN

Member Data Documentation

MityDSP::tcDspSpi* tcDspPhyMicrelKS8995::mpSpi
protected

pointer to the SPI interface on the chip


  
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.