This interface should be used to abstract low level access to networking hardware All operations receive a void *
hardware pointer which an EMAC device provides when it is registered with a stack.
More...
#include <EMAC.h>
Public Types | |
typedef mbed::Callback< void(emac_mem_buf_t *buf)> | emac_link_input_cb_t |
Callback to be register with EMAC interface and to be called for received packets. More... | |
typedef mbed::Callback< void(bool up)> | emac_link_state_change_cb_t |
Callback to be register with EMAC interface and to be called for link status changes. More... | |
Public Member Functions | |
virtual uint32_t | get_mtu_size () const =0 |
Return maximum transmission unit. More... | |
virtual uint32_t | get_align_preference () const =0 |
Gets memory buffer alignment preference. More... | |
virtual void | get_ifname (char *name, uint8_t size) const =0 |
Return interface name. More... | |
virtual uint8_t | get_hwaddr_size () const =0 |
Returns size of the underlying interface HW address size. More... | |
virtual bool | get_hwaddr (uint8_t *addr) const =0 |
Return interface-supplied HW address. More... | |
virtual void | set_hwaddr (const uint8_t *addr)=0 |
Set HW address for interface. More... | |
virtual bool | link_out (emac_mem_buf_t *buf)=0 |
Sends the packet over the link. More... | |
virtual bool | power_up ()=0 |
Initializes the HW. More... | |
virtual void | power_down ()=0 |
Deinitializes the HW. More... | |
virtual void | set_link_input_cb (emac_link_input_cb_t input_cb)=0 |
Sets a callback that needs to be called for packets received for that interface. More... | |
virtual void | set_link_state_cb (emac_link_state_change_cb_t state_cb)=0 |
Sets a callback that needs to be called on link status changes for given interface. More... | |
virtual void | add_multicast_group (const uint8_t *address)=0 |
Add device to a multicast group. More... | |
virtual void | remove_multicast_group (const uint8_t *address)=0 |
Remove device from a multicast group. More... | |
virtual void | set_all_multicast (bool all)=0 |
Request reception of all multicast packets. More... | |
virtual void | set_memory_manager (EMACMemoryManager &mem_mngr)=0 |
Sets memory manager that is used to handle memory buffers. More... | |
Static Public Member Functions | |
static EMAC & | get_default_instance () |
Return the default on-board EMAC. More... | |
This interface should be used to abstract low level access to networking hardware All operations receive a void *
hardware pointer which an EMAC device provides when it is registered with a stack.
typedef mbed::Callback<void (emac_mem_buf_t *buf)> emac_link_input_cb_t |
typedef mbed::Callback<void (bool up)> emac_link_state_change_cb_t |
|
pure virtual |
Add device to a multicast group.
address | A multicast group hardware address |
Implemented in SL_EMAC, fvp_EMAC, SMSC9220_EMAC, GD32_EMAC, Kinetis_EMAC, Kinetis_EMAC, LPC17_EMAC, LPC546XX_EMAC, NUMAKER_EMAC, RDA5981x_EMAC, RZ_A1_EMAC, STM32_EMAC, and OdinWiFiEMAC.
|
pure virtual |
Gets memory buffer alignment preference.
Gets preferred memory buffer alignment of the EMAC device. IP stack may or may not align link out memory buffer chains using the alignment.
Implemented in OdinWiFiEMAC, SL_EMAC, fvp_EMAC, SMSC9220_EMAC, GD32_EMAC, Kinetis_EMAC, Kinetis_EMAC, LPC17_EMAC, LPC546XX_EMAC, NUMAKER_EMAC, RDA5981x_EMAC, RZ_A1_EMAC, and STM32_EMAC.
|
static |
|
pure virtual |
Return interface-supplied HW address.
Copies HW address to provided memory,
addr | has to be of correct size see get_hwaddr_size |
HW address need not be provided if this interface does not have its own HW address configuration; stack will choose address from central system configuration if the function returns false and does not write to addr.
addr | HW address for underlying interface |
Implemented in SL_EMAC, fvp_EMAC, SMSC9220_EMAC, GD32_EMAC, Kinetis_EMAC, Kinetis_EMAC, LPC17_EMAC, LPC546XX_EMAC, NUMAKER_EMAC, RDA5981x_EMAC, RZ_A1_EMAC, STM32_EMAC, and OdinWiFiEMAC.
|
pure virtual |
Returns size of the underlying interface HW address size.
Implemented in SL_EMAC, fvp_EMAC, SMSC9220_EMAC, GD32_EMAC, Kinetis_EMAC, Kinetis_EMAC, LPC17_EMAC, LPC546XX_EMAC, NUMAKER_EMAC, RDA5981x_EMAC, RZ_A1_EMAC, STM32_EMAC, and OdinWiFiEMAC.
|
pure virtual |
Return interface name.
name | Pointer to where the name should be written |
size | Maximum number of character to copy |
Implemented in SL_EMAC, fvp_EMAC, SMSC9220_EMAC, GD32_EMAC, Kinetis_EMAC, Kinetis_EMAC, LPC17_EMAC, LPC546XX_EMAC, NUMAKER_EMAC, RDA5981x_EMAC, RZ_A1_EMAC, STM32_EMAC, and OdinWiFiEMAC.
|
pure virtual |
Return maximum transmission unit.
Implemented in SL_EMAC, fvp_EMAC, SMSC9220_EMAC, GD32_EMAC, Kinetis_EMAC, Kinetis_EMAC, LPC17_EMAC, LPC546XX_EMAC, OdinWiFiEMAC, NUMAKER_EMAC, RDA5981x_EMAC, RZ_A1_EMAC, and STM32_EMAC.
|
pure virtual |
Sends the packet over the link.
That can not be called from an interrupt context.
buf | Packet to be send |
Implemented in SL_EMAC, fvp_EMAC, SMSC9220_EMAC, GD32_EMAC, Kinetis_EMAC, Kinetis_EMAC, LPC17_EMAC, LPC546XX_EMAC, NUMAKER_EMAC, RDA5981x_EMAC, RZ_A1_EMAC, STM32_EMAC, and OdinWiFiEMAC.
|
pure virtual |
Deinitializes the HW.
Implemented in SL_EMAC, fvp_EMAC, SMSC9220_EMAC, GD32_EMAC, Kinetis_EMAC, Kinetis_EMAC, LPC17_EMAC, LPC546XX_EMAC, NUMAKER_EMAC, RDA5981x_EMAC, RZ_A1_EMAC, STM32_EMAC, and OdinWiFiEMAC.
|
pure virtual |
Initializes the HW.
Implemented in SL_EMAC, fvp_EMAC, SMSC9220_EMAC, GD32_EMAC, Kinetis_EMAC, Kinetis_EMAC, LPC17_EMAC, LPC546XX_EMAC, NUMAKER_EMAC, RDA5981x_EMAC, RZ_A1_EMAC, STM32_EMAC, and OdinWiFiEMAC.
|
pure virtual |
Remove device from a multicast group.
address | A multicast group hardware address |
Implemented in SL_EMAC, fvp_EMAC, SMSC9220_EMAC, GD32_EMAC, Kinetis_EMAC, Kinetis_EMAC, LPC17_EMAC, LPC546XX_EMAC, NUMAKER_EMAC, RDA5981x_EMAC, RZ_A1_EMAC, STM32_EMAC, and OdinWiFiEMAC.
|
pure virtual |
Request reception of all multicast packets.
all | True to receive all multicasts False to receive only multicasts addressed to specified groups |
Implemented in SL_EMAC, fvp_EMAC, SMSC9220_EMAC, GD32_EMAC, Kinetis_EMAC, Kinetis_EMAC, LPC17_EMAC, LPC546XX_EMAC, NUMAKER_EMAC, RDA5981x_EMAC, RZ_A1_EMAC, STM32_EMAC, and OdinWiFiEMAC.
|
pure virtual |
Set HW address for interface.
Provided address has to be of correct size, see get_hwaddr_size
Called to set the MAC address to actually use - if get_hwaddr is provided the stack would normally use that, but it could be overridden, for example for test purposes.
addr | Address to be set |
Implemented in SL_EMAC, fvp_EMAC, SMSC9220_EMAC, GD32_EMAC, Kinetis_EMAC, Kinetis_EMAC, LPC17_EMAC, LPC546XX_EMAC, NUMAKER_EMAC, RDA5981x_EMAC, RZ_A1_EMAC, STM32_EMAC, and OdinWiFiEMAC.
|
pure virtual |
Sets a callback that needs to be called for packets received for that interface.
input_cb | Function to be register as a callback |
Implemented in SL_EMAC, fvp_EMAC, SMSC9220_EMAC, GD32_EMAC, Kinetis_EMAC, Kinetis_EMAC, LPC17_EMAC, LPC546XX_EMAC, NUMAKER_EMAC, RDA5981x_EMAC, RZ_A1_EMAC, STM32_EMAC, and OdinWiFiEMAC.
|
pure virtual |
Sets a callback that needs to be called on link status changes for given interface.
state_cb | Function to be register as a callback |
Implemented in SL_EMAC, fvp_EMAC, SMSC9220_EMAC, GD32_EMAC, Kinetis_EMAC, Kinetis_EMAC, LPC17_EMAC, LPC546XX_EMAC, NUMAKER_EMAC, RDA5981x_EMAC, RZ_A1_EMAC, STM32_EMAC, and OdinWiFiEMAC.
|
pure virtual |
Sets memory manager that is used to handle memory buffers.
mem_mngr | Pointer to memory manager |
Implemented in SL_EMAC, fvp_EMAC, SMSC9220_EMAC, GD32_EMAC, Kinetis_EMAC, Kinetis_EMAC, LPC17_EMAC, LPC546XX_EMAC, NUMAKER_EMAC, RDA5981x_EMAC, RZ_A1_EMAC, STM32_EMAC, and OdinWiFiEMAC.