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...
|
virtual uint32_t | get_mtu_size () const =0 |
| Return maximum transmission unit.
|
|
virtual uint32_t | get_align_preference () const =0 |
| Gets memory buffer alignment preference.
|
|
virtual void | get_ifname (char *name, uint8_t size) const =0 |
| Return interface name.
|
|
virtual uint8_t | get_hwaddr_size () const =0 |
| Returns size of the underlying interface HW address size.
|
|
virtual bool | get_hwaddr (uint8_t *addr) const =0 |
| Return interface-supplied HW address.
|
|
virtual void | set_hwaddr (const uint8_t *addr)=0 |
| Set HW address for interface.
|
|
virtual bool | link_out (emac_mem_buf_t *buf)=0 |
| Sends the packet over the link.
|
|
virtual bool | power_up ()=0 |
| Initializes the HW.
|
|
virtual void | power_down ()=0 |
| Deinitializes the HW.
|
|
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 this interface.
|
|
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.
|
|
virtual void | add_multicast_group (const uint8_t *address)=0 |
| Add device to a multicast group.
|
|
virtual void | remove_multicast_group (const uint8_t *address)=0 |
| Remove device from a multicast group.
|
|
virtual void | set_all_multicast (bool all)=0 |
| Request reception of all multicast packets.
|
|
virtual void | set_memory_manager (EMACMemoryManager &mem_mngr)=0 |
| Sets memory manager that is used to handle memory buffers.
|
|
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.
Definition at line 33 of file EMAC.h.
virtual bool get_hwaddr |
( |
uint8_t * |
addr | ) |
const |
|
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.
- Parameters
-
addr | HW address for underlying interface |
- Returns
- true if HW address is available
Implemented in EMW3080B_EMAC, and WICED_EMAC.
virtual void set_hwaddr |
( |
const uint8_t * |
addr | ) |
|
|
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.
- Parameters
-
Implemented in EMW3080B_EMAC, and WICED_EMAC.
Sets a callback that needs to be called for packets received for this interface.
Note that the callback function will contain appropriate locking such that it may be called from any OS thread. However, it shall not be called from an interrupt.
Also note that the callback will take ownership of the passed packet and must free it in all cases.
- Parameters
-
input_cb | Function to be registered as a callback |
Implemented in EMW3080B_EMAC, and WICED_EMAC.