Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Function NameDescription
NetIF_Add()Add a network device and hardware as a network interface.

Files

net_if.h/net_if.c

Prototype

Arguments

if_api

Pointer to the desired link-layer API for this network interface and device hardware. In most cases, the desired link-layer interface will point to the Ethernet API, NetIF_API_Ether (see also section L16-1(1)).

dev_api

Pointer to the desired device driver API for this network interface (see also section 5-3-3 “Adding an Ethernet Interface” and section 5-4-2 “Adding a Wireless Interface”).

dev_bsp

Pointer to the specific device's BSP interface for this network interface (see also Chapter 6, “Network Board Support Package”).

dev_cfg

Pointer to a configuration structure used to configure the device hardware for the specific network interface (see also Chapter 5, “Network Interface Configuration”).

phy_api

Pointer to an optional physical layer device driver API for this network interface. In most cases, the generic physical layer device API will be used, NetPhy_API_Generic, but for Ethernet devices that have non-MII or non-RMII compliant physical layer components, another device-specific physical layer device driver API may be necessary. See also section 7-4 “Ethernet PHY API Implementation”.

phy_cfg

Pointer to a configuration structure used to configure the physical layer hardware for the specific network interface (see also section 5-3-2 “Ethernet PHY Configuration”).

perr

Pointer to variable that will receive the return error code from this function:

NET_IF_ERR_NONE
NET_IF_ERR_NULL_PTR
NET_IF_ERR_INVALID_IF
NET_IF_ERR_INVALID_CFG
NET_IF_ERR_NONE_AVAIL
NET_BUF_ERR_POOL_INIT
NET_BUF_ERR_INVALID_POOL_TYPE
NET_BUF_ERR_INVALID_POOL_ADDR
NET_BUF_ERR_INVALID_POOL_SIZE
NET_BUF_ERR_INVALID_POOL_QTY
NET_BUF_ERR_INVALID_SIZE
NET_OS_ERR_INIT_DEV_TX_RDY
NET_OS_ERR_INIT_DEV_TX_RDY_NAME
NET_OS_ERR_LOCK

Returned Value

Network interface number, if device and hardware successfully added;

NET_IF_NBR_NONE, otherwise.

Required Configuration

None.

Notes / Warnings

The first network interface added and started is the default interface used for all default communication. See also section C-12-1 and section C-12-2.

Both physical layer API and configuration parameters must ,either be specified or passed NULL pointers.

Additional error codes may be returned by the specific interface or device driver.

...

NetIF_AddrHW_Get()Get network interface’s hardware address.
NetIF_AddrHW_IsValid()Validate a network interface hardware address.
NetIF_AddrHW_Set()Set network interface’s hardware address.
NetIF_CfgPerfMonPeriod()Configure the network interface Performance Monitor Handler timeout.
NetIF_CfgPhyLinkPeriod()Configure network interface Physical Link State Handler timeout.
NetIF_GetRxDataAlignPtr()Get an aligned pointer into a receive application data buffer.
NetIF_GetTxDataAlignPtr()Get an aligned pointer into a transmit application data buffer.
NetIF_GetExtAvailCtr()Get number of external interface configured.
NetIF_GetNbrBaseCfgd()Get the base ID of the first external interface.
NetIF_IO_Ctrl()Handle network interface and/or device specific (I/O) control(s).
NetIF_IsEn()Validate network interface as enabled.
NetIF_IsEnCfgd()Validate configured network interface as enabled.
NetIF_ISR_Handler()Handle a network interface’s device interrupts.
NetIF_IsValid()Validate network interface number.
NetIF_IsValidCfgd()Validate configured network interface number.
NetIF_LinkStateGet()Get network interface’s last known physical link state.
NetIF_LinkStateSubscribe()Subscribe to get notified when an interface link state changes.
NetIF_LinkStateUnsubscribe()Unsubscribe to get notified when interface link state changes.
NetIF_LinkStateWaitUntilUp()Wait for a network interface's physical link state to be  UP .
NetIF_MTU_Get()Get network interface’s MTU.
NetIF_MTU_Set()Set network interface’s MTU.
NetIF_Start()Start a network interface.
NetIF_Stop()Stop a network interface.