# csl_emac.h File Reference

EMAC CSL Implementation on DSP side. More...

`#include <csl.h>`
`#include <ti/csl/csl_types.h>`
`#include <ti/csl/csl_error.h>`
`#include <cslr_emac.h>`
`#include <cslr_ectl.h>`
`#include <ti/csl/cslr.h>`
`#include <ti/csl/soc.h>`
`#include <ti/csl/cslr_mdio.h>`
`#include <ti/csl/cslr_device.h>`

## Data Structures

struct | _EMAC_Pkt
| EMACObjects EMAC Objects. More...
struct | _pktq
| Packet Queue. More...
struct | _EMAC_DescCh
| Transmit/Receive Descriptor Channel Structure. More...
struct | _EMAC_ChannelInfo
| Transmit/Receive Channel info Structure. More...
struct | _EMAC_AddrConfig
| MAC addresses configuration Structure. More...
struct | _EMAC_Core_Config
| EMAC_Core_Config. More...
struct | _EMAC_Common_Config
| EMAC_Common_Config. More...
struct | _EMAC_Config
| EMAC_Config. More...
struct | _EMAC_Status
| EMAC_Status. More...
struct | _EMAC_Statistics
| EMAC_Statistics. More...
struct | _EMAC_Core
| EMAC Core Instance Structure. More...
struct | _EMAC_Device
| EMAC Main Device Instance Structure. More...

## Defines

#define | EMAC_REGS ((CSL_EmacRegs *)CSL_EMAC_0_REGS)
#define | ECTL_REGS ((CSL_EctlRegs *)CSL_ECTL_0_REGS)
#define | EMAC_PKT_FLAGS_SOP 0x80000000u
| EMACPktFlags Packet Buffer Flags set in Flags.
#define | EMAC_PKT_FLAGS_EOP 0x40000000u
#define | EMAC_PKT_FLAGS_HASCRC 0x04000000u
| RecvPktFlags Receive Packet flags.
#define | EMAC_PKT_FLAGS_JABBER 0x02000000u
#define | EMAC_PKT_FLAGS_OVERSIZE 0x01000000u
#define | EMAC_PKT_FLAGS_FRAGMENT 0x00800000u
#define | EMAC_PKT_FLAGS_UNDERSIZED 0x00400000u
#define | EMAC_PKT_FLAGS_CONTROL 0x00200000u
#define | EMAC_PKT_FLAGS_OVERRUN 0x00100000u
#define | EMAC_PKT_FLAGS_CODEERROR 0x00080000u
#define | EMAC_PKT_FLAGS_ALIGNERROR 0x00040000u
#define | EMAC_PKT_FLAGS_CRCERROR 0x00020000u
#define | EMAC_PKT_FLAGS_NOMATCH 0x00010000u
#define | EMAC_CONFIG_MODEFLG_CHPRIORITY 0x00001
| CfgModeFlags Configuration Mode Flags.
#define | EMAC_CONFIG_MODEFLG_MACLOOPBACK 0x00002
#define | EMAC_CONFIG_MODEFLG_RXCRC 0x00004
#define | EMAC_CONFIG_MODEFLG_TXCRC 0x00008
#define | EMAC_CONFIG_MODEFLG_PASSERROR 0x00010
#define | EMAC_CONFIG_MODEFLG_PASSCONTROL 0x00020
#define | EMAC_CONFIG_MODEFLG_PASSALL 0x00040
#define | EMAC_CONFIG_MODEFLG_RXQOS 0x00080
#define | EMAC_CONFIG_MODEFLG_RXNOCHAIN 0x00100
#define | EMAC_CONFIG_MODEFLG_RXOFFLENBLOCK 0x00200
#define | EMAC_CONFIG_MODEFLG_RXOWNERSHIP 0x00400
#define | EMAC_CONFIG_MODEFLG_RXFIFOFLOWCNTL 0x00800
#define | EMAC_CONFIG_MODEFLG_CMDIDLE 0x01000
#define | EMAC_CONFIG_MODEFLG_TXSHORTGAPEN 0x02000
#define | EMAC_CONFIG_MODEFLG_TXPACE 0x04000
#define | EMAC_CONFIG_MODEFLG_TXFLOWCNTL 0x08000
#define | EMAC_CONFIG_MODEFLG_RXBUFFERFLOWCNTL 0x10000
#define | EMAC_CONFIG_MODEFLG_FULLDUPLEX 0x20000
#define | EMAC_CONFIG_MODEFLG_GIGABIT 0x40000
#define | EMAC_CONFIG_MODEFLG_EXTEN 0x80000
#define | EMAC_CONFIG_MODEFLAG_GIGFORCE 0x100000
#define | EMAC_CONFIG_MODEFLG_GMIIEN 0x800000
#define | EMAC_DESC_BASE_L2 0x00001
| Descriptor memory selection Flags.
#define | EMAC_DESC_BASE_CPPI 0x00002
#define | EMAC_DESC_BASE_DDR 0x00004
#define | EMAC_TEARDOWN_CHANNEL(x) (1 << x)
#define | EMAC_RXFILTER_NOTHING 0
| PktFiltering Packet Filtering.
#define | EMAC_RXFILTER_DIRECT 1
#define | EMAC_RXFILTER_BROADCAST 2
#define | EMAC_RXFILTER_MULTICAST 3
#define | EMAC_RXFILTER_ALLMULTICAST 4
#define | EMAC_RXFILTER_ALL 5
#define | EMAC_ERROR_ALREADY 1
| ErrCodes STANDARD ERROR CODES.
#define | EMAC_ERROR_NOTREADY 2
#define | EMAC_ERROR_DEVICE 3
#define | EMAC_ERROR_INVALID 4
#define | EMAC_ERROR_BADPACKET 5
#define | EMAC_ERROR_MACFATAL 6
#define | EMAC_DEVMAGIC 0x0aceface
#define | EMAC_NUMSTATS 36
#define | CSL_EMAC_NUMCHANNELS 8
#define | CSL_EMAC_NUMCORES 1
#define | CSL_EMAC_NUMMACADDRS 32

## Typedefs

typedef struct _EMAC_Pkt | EMAC_Pkt
| EMACObjects EMAC Objects.
typedef struct _pktq | PKTQ
| Packet Queue.
typedef struct _EMAC_DescCh | EMAC_DescCh
| Transmit/Receive Descriptor Channel Structure.
typedef struct _EMAC_ChannelInfo | EMAC_ChannelInfo
| Transmit/Receive Channel info Structure.
typedef struct _EMAC_AddrConfig | EMAC_AddrConfig
| MAC addresses configuration Structure.
typedef struct _EMAC_Core_Config | EMAC_Core_Config
| EMAC_Core_Config.
typedef struct _EMAC_Common_Config | EMAC_Common_Config
| EMAC_Common_Config.
typedef struct _EMAC_Config | EMAC_Config
| EMAC_Config.
typedef struct _EMAC_Status | EMAC_Status
| EMAC_Status.
typedef struct _EMAC_Statistics | EMAC_Statistics
| EMAC_Statistics.
typedef struct _EMAC_Core | EMAC_Core
| EMAC Core Instance Structure.
typedef struct _EMAC_Device | EMAC_Device
| EMAC Main Device Instance Structure.

## Functions

Uint32 | EMAC_enumerate (void)
| EMACInterfaces EMAC Interfaces.
Uint32 | EMAC_open (int instNum, Handle hApplication, EMAC_Config *pEMACConfig, Handle hEMAC, Handle hCore)
Uint32 | EMAC_commonInit (int instNum, EMAC_Common_Config *pEMACCommonConfig, Handle hEMAC)
Uint32 | EMAC_coreInit (Handle hEMAC, Handle hApplication, EMAC_Core_Config *pEMACCoreConfig, Handle hCore)
Uint32 | EMAC_commonDeInit (Handle hEMAC)
Uint32 | EMAC_coreDeInit (Handle hEMAC)
Uint32 | EMAC_close (Handle hEMAC)
Uint32 | EMAC_getStatus (Handle hEMAC, EMAC_Status *pStatus)
Uint32 | EMAC_setReceiveFilter (Handle hEMAC, Uint32 ReceiveFilter, Uint8 masterChannel)
Uint32 | EMAC_getReceiveFilter (Handle hEMAC, Uint32 *pReceiveFilter)
Uint32 | EMAC_getStatistics (Handle hEMAC, EMAC_Statistics *pStatistics)
Uint32 | EMAC_setMulticast (Handle hEMAC, Uint32 AddrCnt, Uint8 *pMCastList)
Uint32 | EMAC_sendPacket (Handle hEMAC, EMAC_Pkt *pPkt)
Uint32 | EMAC_RxServiceCheck (Handle hEMAC)
Uint32 | EMAC_TxServiceCheck (Handle hEMAC)
Uint32 | EMAC_timerTick (Handle hEMAC)

## Detailed Description

EMAC CSL Implementation on DSP side.

============================================================================

PATH: $(CSLPATH)\inc

NOTE: When used in an multitasking environment, no EMAC function may be called while another EMAC function is operating on the same device handle in another thread. It is the responsibility of the application to assure adherence to this restriction.

## Define Documentation

#define ECTL_REGS ((CSL_EctlRegs *)CSL_ECTL_0_REGS)

EMAC Control Module registers

#define EMAC_REGS ((CSL_EmacRegs *)CSL_EMAC_0_REGS)

EMAC Module registers

Copyright 2012, Texas Instruments Incorporated