ETHFW API Guide
ethremotecfg_virtport.h File Reference

Introduction

This file contains the type definitions and helper macros for Ethernet Firmware's Virtual Port.

Go to the source code of this file.

Enumerations

enum  EthRemoteCfg_VirtPort {
  ETHREMOTECFG_SWITCH_PORT_0, ETHREMOTECFG_SWITCH_PORT_1, ETHREMOTECFG_SWITCH_PORT_2, ETHREMOTECFG_SWITCH_PORT_3,
  ETHREMOTECFG_SWITCH_PORT_LAST = ETHREMOTECFG_SWITCH_PORT_3, ETHREMOTECFG_MAC_PORT_1, ETHREMOTECFG_MAC_PORT_2, ETHREMOTECFG_MAC_PORT_3,
  ETHREMOTECFG_MAC_PORT_4, ETHREMOTECFG_MAC_PORT_5, ETHREMOTECFG_MAC_PORT_6, ETHREMOTECFG_MAC_PORT_7,
  ETHREMOTECFG_MAC_PORT_8, ETHREMOTECFG_MAC_PORT_LAST = ETHREMOTECFG_MAC_PORT_8
}
 Virtual port id. More...
 

Functions

static bool EthRemoteCfg_isSwitchPort (EthRemoteCfg_VirtPort portId)
 Check whether port is a virtual switch port or not. More...
 
static bool EthRemoteCfg_isMacPort (EthRemoteCfg_VirtPort portId)
 Check whether port is a virtual MAC port or not. More...
 
static uint32_t EthRemoteCfg_getPortNum (EthRemoteCfg_VirtPort portId)
 Get virtual port number. More...
 
static Enet_MacPort EthRemoteCfg_getMacPort (EthRemoteCfg_VirtPort portId)
 Get Enet MAC port number corresponding to a virtual port id. More...
 

Enumeration Type Documentation

◆ EthRemoteCfg_VirtPort

Virtual port id.

Enumerator
ETHREMOTECFG_SWITCH_PORT_0 

Virtual switch port 0.

ETHREMOTECFG_SWITCH_PORT_1 

Virtual switch port 1.

ETHREMOTECFG_SWITCH_PORT_2 

Virtual switch port 2.

ETHREMOTECFG_SWITCH_PORT_3 

Virtual switch port 3.

ETHREMOTECFG_SWITCH_PORT_LAST 

Last virtual switch port id.

ETHREMOTECFG_MAC_PORT_1 

Virtual MAC port 1.

ETHREMOTECFG_MAC_PORT_2 

Virtual MAC port 2.

ETHREMOTECFG_MAC_PORT_3 

Virtual MAC port 3.

ETHREMOTECFG_MAC_PORT_4 

Virtual MAC port 4.

ETHREMOTECFG_MAC_PORT_5 

Virtual MAC port 5.

ETHREMOTECFG_MAC_PORT_6 

Virtual MAC port 6.

ETHREMOTECFG_MAC_PORT_7 

Virtual MAC port 7.

ETHREMOTECFG_MAC_PORT_8 

Virtual MAC port 8.

ETHREMOTECFG_MAC_PORT_LAST 

Last virtual MAC port id.

Function Documentation

◆ EthRemoteCfg_isSwitchPort()

static bool EthRemoteCfg_isSwitchPort ( EthRemoteCfg_VirtPort  portId)
static

Check whether port is a virtual switch port or not.

Parameters
portId[in] Virtual port id.
Returns
true if virtual switch port, false otherwise.

◆ EthRemoteCfg_isMacPort()

static bool EthRemoteCfg_isMacPort ( EthRemoteCfg_VirtPort  portId)
static

Check whether port is a virtual MAC port or not.

Parameters
portId[in] Virtual port id.
Returns
true if virtual MAC port, false otherwise.

◆ EthRemoteCfg_getPortNum()

static uint32_t EthRemoteCfg_getPortNum ( EthRemoteCfg_VirtPort  portId)
static

Get virtual port number.

Gets the port number of a virtual port. Virtual switch ports numbers are 0-relative and virtual MAC ports are 1-relative.

Parameters
portId[in] Virtual port id.
Returns
Port number.

◆ EthRemoteCfg_getMacPort()

static Enet_MacPort EthRemoteCfg_getMacPort ( EthRemoteCfg_VirtPort  portId)
static

Get Enet MAC port number corresponding to a virtual port id.

Gets the Enet MAC port number corresponding to a virtual MAC port. It will return ENET_MAC_PORT_INV for virtual switch ports.

The returned value of this function could be used as is to populate the port number used for TX directed packets.

Parameters
portIdVirtual port id.
Returns
Enet MAC port number for virtual MAC ports, ENET_MAC_PORT_INV for virtual switch ports.