- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

# emac_drv.h File Reference

EMAC Driver Interface between the EMAC CSL and Network Application. More...

## Data Structures

struct | EMAC_PKT_DESC_T
| EMAC packet descriptor data structure. More...
struct | EMAC_CHAN_MAC_ADDR_tag
| This structure is used to for the driver to return the application the channel/MAC address configuration when an EMAC port is opened. More...
struct | EMAC_OPEN_CONFIG_INFO_tag
| EMAC open configuration data structure. More...
struct | EMAC_CONFIG_INFO_tag
| EMAC configuration data structure. More...
struct | EMAC_STATISTICS_tag
| The statistics structure is used to retrieve the current count of various packet events in the system. These values represent the delta values from the last time the statistics were read. More...
struct | EMAC_LINK_INFO_tag
| EMAC statistics and link status data structure. More...

## Defines

#define | EMAC_PKT_FLAG_SOP 0x80000000u
#define | EMAC_PKT_FLAG_EOP 0x40000000u
#define | EMAC_MAC_ADDR_LENTH 6
| This structure defines the 6 byte MAC address structure.
#define | EMAC_MAX_NUM_PHY_ADDR 32
| Maximum number of phy address.
#define | EMAC_PKTFLT_NOTHING 0
#define | EMAC_PKTFLT_DIRECT 1
#define | EMAC_PKTFLT_BROADCAST 2
#define | EMAC_PKTFLT_MULTICAST 3
#define | EMAC_PKTFLT_ALLMULTICAST 4
#define | EMAC_PKTFLT_ALL 5
#define | EMAC_LINKSTATUS_NOLINK 0
#define | EMAC_LINKSTATUS_HD10 1
#define | EMAC_LINKSTATUS_FD10 2
#define | EMAC_LINKSTATUS_HD100 3
#define | EMAC_LINKSTATUS_FD100 4
#define | EMAC_LINKSTATUS_FD1000 5

## Typedefs

typedef void | EMAC_RX_PKT_CALLBACK_FN_T (Uint32 port_num, EMAC_PKT_DESC_T *p_desc)
| This function is used to call back the network application when a packet is received.
typedef EMAC_PKT_DESC_T * | EMAC_ALLOC_PKT_CALLBACK_FN_T (Uint32 port_num, Uint32 pkt_size)
| This function is used to call back the network application to allocate a packet descriptor with packet buffer allocated from the application packet queue.
typedef void | EMAC_FREE_PKT_CALLBACK_FN_T (Uint32 port_num, EMAC_PKT_DESC_T *p_desc)
| This function is used to call back the network application to free a packet descriptor to the application packet queue.
typedef EMAC_CHAN_MAC_ADDR_tag | EMAC_CHAN_MAC_ADDR_T
| This structure is used to for the driver to return the application the channel/MAC address configuration when an EMAC port is opened.
typedef EMAC_OPEN_CONFIG_INFO_tag | EMAC_OPEN_CONFIG_INFO_T
| EMAC open configuration data structure.
typedef Uint32 | EMAC_PKT_FILTER_T
| Packet Filtering.
typedef EMAC_CONFIG_INFO_tag | EMAC_CONFIG_INFO_T
| EMAC configuration data structure.
typedef EMAC_STATISTICS_tag | EMAC_STATISTICS_T
| The statistics structure is used to retrieve the current count of various packet events in the system. These values represent the delta values from the last time the statistics were read.
typedef Uint32 | EMAC_LINK_STATUS_T
| ENUM type of EMAC port link status.
typedef EMAC_LINK_INFO_tag | EMAC_LINK_INFO_T
| EMAC statistics and link status data structure.

## Enumerations

enum | EMAC_DRV_ERR_E { EMAC_DRV_RESULT_OK = 0, EMAC_DRV_RESULT_GENERAL_ERR = -1, EMAC_DRV_RESULT_INVALID_PORT = -2, EMAC_DRV_RESULT_NO_CHAN_AVAIL = -3, EMAC_DRV_RESULT_NO_MEM_AVAIL = -4, EMAC_DRV_RESULT_OPEN_PORT_ERR = -5, EMAC_DRV_RESULT_CLOSE_PORT_ERR = -6, EMAC_DRV_RESULT_CONFIG_PORT_ERR = -7,
EMAC_DRV_RESULT_SEND_ERR = -8, EMAC_DRV_RESULT_POLL_ERR = -9, EMAC_DRV_RESULT_GET_STATS_ERR = -10, EMAC_DRV_RESULT_ISR_ERR = -11
}
| Definitions for Gauss CSL. ENUM type of EMAC driver API funciton result. More...

## Functions

const char * | emac_get_version (void)
| Retrieves the version string.
EMAC_DRV_ERR_E | emac_open (Uint32 port_num, EMAC_OPEN_CONFIG_INFO_T *p_config)
EMAC_DRV_ERR_E | emac_close (Uint32 port_num)
EMAC_DRV_ERR_E | emac_config (Uint32 port_num, EMAC_CONFIG_INFO_T *p_config)
EMAC_DRV_ERR_E | emac_send (Uint32 port_num, EMAC_PKT_DESC_T *p_desc)
EMAC_DRV_ERR_E | emac_poll (Uint32 port_num, EMAC_LINK_INFO_T *p_info)
EMAC_DRV_ERR_E | emac_get_stats (Uint32 port_num, EMAC_STATISTICS_T *p_stats)
EMAC_DRV_ERR_E | emac_int_service (Uint32 port_num, Bool rx_flag)

## Detailed Description

EMAC Driver Interface between the EMAC CSL and Network Application.

## Define Documentation

#define EMAC_LINKSTATUS_FD10 2

Link Status: Full Duplex 10Mbps

#define EMAC_LINKSTATUS_FD100 4

Link Status: Full Duplex 100Mbps

#define EMAC_LINKSTATUS_FD1000 5

Link Status: Full Duplex 1000Mbps

#define EMAC_LINKSTATUS_HD10 1

Link Status: Half Duplex 10Mbps

#define EMAC_LINKSTATUS_HD100 3

Link Status: Half Duplex 100Mbps

#define EMAC_LINKSTATUS_NOLINK 0

Link Status: No Link

#define EMAC_PKT_FLAG_EOP 0x40000000u

End of packet

#define EMAC_PKT_FLAG_SOP 0x80000000u

Start of packet

#define EMAC_PKTFLT_ALL 5

Receive filter set to receive All packets

#define EMAC_PKTFLT_ALLMULTICAST 4

Receive filter set to receive alll Mcast/Bcast/Ucast packets

#define EMAC_PKTFLT_BROADCAST 2

Receive filter set to receive broadcast/unitcast packets

#define EMAC_PKTFLT_DIRECT 1

Receive filter set to receive direct unitcast packets

#define EMAC_PKTFLT_MULTICAST 3

Receive filter set to receive multicast/broadcast/unitcast packets

#define EMAC_PKTFLT_NOTHING 0

Receive filter set to receive no packets

## Typedef Documentation

typedef Uint32 EMAC_PKT_FILTER_T

Packet Filtering.

Receive Packet Filtering Settings

## Enumeration Type Documentation

enum EMAC_DRV_ERR_E

Definitions for Gauss CSL. ENUM type of EMAC driver API funciton result.

Enumerator:

  EMAC_DRV_RESULT_OK | Success
  EMAC_DRV_RESULT_GENERAL_ERR | An unspecified error
  EMAC_DRV_RESULT_INVALID_PORT | Invalid EMAC port number error
  EMAC_DRV_RESULT_NO_CHAN_AVAIL | No channel available error
  EMAC_DRV_RESULT_NO_MEM_AVAIL | Out of memory error
  EMAC_DRV_RESULT_OPEN_PORT_ERR | Open EMAC port error
  EMAC_DRV_RESULT_CLOSE_PORT_ERR | Close EMAC port error
  EMAC_DRV_RESULT_CONFIG_PORT_ERR | Config EMAC port error
  EMAC_DRV_RESULT_SEND_ERR | Send packet error
  EMAC_DRV_RESULT_POLL_ERR | Poll link status error
  EMAC_DRV_RESULT_GET_STATS_ERR | Poll stats error
  EMAC_DRV_RESULT_ISR_ERR | Interrupt service error

Copyright 2012, Texas Instruments Incorporated