Ethernet interface header file. More...
#include "lwip/err.h"#include "lwip/netif.h"

Go to the source code of this file.
Functions | |
| uint8_t | ethernetif_is_init (void) |
| Check whether the Ethernet hardware has been initialized. | |
| err_t | ethernetif_init (struct netif *netif) |
| LwIP network interface initialization callback. | |
| void | ethernetif_input (struct netif *netif) |
| Read one received frame from the MAC and pass it to LwIP. | |
| void | ethernetif_set_link (struct netif *netif) |
| Poll the PHY and update the LwIP link state of the interface. | |
| void | ethernetif_update_config (struct netif *netif) |
| Apply the PHY auto-negotiation result to the MAC. | |
| void | ethernetif_notify_conn_changed (struct netif *netif) |
| Notify the user that the link status has changed. | |
| void | ethernetif_set_mac_addr (const uint8_t *mac) |
| Set the MAC address used by the driver. | |
| void | ethernetif_get_mac_addr (uint8_t *mac) |
| Copy the MAC address used by the driver. | |
Ethernet interface header file.
Redistribution and use in source and binary forms, with or without modification, are permitted, provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
| void ethernetif_get_mac_addr | ( | uint8_t * | mac | ) |
Copy the MAC address used by the driver.
| mac | Buffer of at least 6 bytes that receives the address. Nothing is copied if NULL. |
| err_t ethernetif_init | ( | struct netif * | netif | ) |
LwIP network interface initialization callback.
Sets the interface name, the output functions and initializes the Ethernet hardware. Pass it to netif_add().
| netif | The LwIP network interface to initialize. |
| void ethernetif_input | ( | struct netif * | netif | ) |
Read one received frame from the MAC and pass it to LwIP.
Does nothing when no frame is available. If netif->input() fails, the frame is dropped.
| netif | The LwIP network interface. |
| uint8_t ethernetif_is_init | ( | void | ) |
Check whether the Ethernet hardware has been initialized.
| void ethernetif_notify_conn_changed | ( | struct netif * | netif | ) |
Notify the user that the link status has changed.
Weak function. The default implementation does nothing, and user code can override it.
| netif | The LwIP network interface. Not used by the default implementation. |
| void ethernetif_set_link | ( | struct netif * | netif | ) |
Poll the PHY and update the LwIP link state of the interface.
The link is set down when the PHY reports a link-change interrupt, and up when the PHY reports a linked state. With LWIP_IGMP, IGMP is started on the first link-up.
| netif | The LwIP network interface. |
| void ethernetif_set_mac_addr | ( | const uint8_t * | mac | ) |
Set the MAC address used by the driver.
Call it before ethernetif_init(). The address is copied only while the driver is not initialized.
| mac | 6-byte MAC address. Ignored if NULL. |
| void ethernetif_update_config | ( | struct netif * | netif | ) |
Apply the PHY auto-negotiation result to the MAC.
Restarts the MAC with the negotiated duplex and speed, or stops the MAC when the link is down. If auto-negotiation is disabled or has not completed, the configured duplex and speed are used. Calls ethernetif_notify_conn_changed() at the end. Call it when the link status changes.
| netif | The LwIP network interface. |