mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2025-01-17 10:11:14 +00:00
Remove hard reference from netif.c to tcpip.c - avoids pulling in unnecessary code
This commit is contained in:
parent
e4d75a75ea
commit
2f7e6d0661
@ -205,15 +205,12 @@ netif_input(struct pbuf *p, struct netif *inp)
|
|||||||
* @param init callback function that initializes the interface
|
* @param init callback function that initializes the interface
|
||||||
* @param input callback function that is called to pass
|
* @param input callback function that is called to pass
|
||||||
* ingress packets up in the protocol layer stack.\n
|
* ingress packets up in the protocol layer stack.\n
|
||||||
* If a NULL pointer is supplied, a default input function is used
|
* It is recommended to use a function that passes the input directly
|
||||||
* that uses netif flags NETIF_FLAG_ETHARP and NETIF_FLAG_ETHERNET
|
* to the stack (netif_input(), NO_SYS=1 mode) or via sending a
|
||||||
* to decide whether to forward to ethernet_input() or ip_input().\n
|
* message to TCPIP thread (tcpip_input(), NO_SYS=0 mode).\n
|
||||||
* Depending on NO_SYS, a function that passes the input directly to the stack
|
* These functions use netif flags NETIF_FLAG_ETHARP and NETIF_FLAG_ETHERNET
|
||||||
* (netif_input()) or via sending a message to TCPIP thread (tcpip_input())
|
* to decide whether to forward to ethernet_input() or ip_input().
|
||||||
* is used.\n
|
* In other words, the functions only work when the netif
|
||||||
* Since the flags are usually managed by the one implementing the ethernet
|
|
||||||
* driver, the end user does not have to worry about choosing the correct
|
|
||||||
* input function here. In other words, this only works when the netif
|
|
||||||
* driver is implemented correctly!
|
* driver is implemented correctly!
|
||||||
*
|
*
|
||||||
* @return netif, or NULL if failed.
|
* @return netif, or NULL if failed.
|
||||||
@ -285,15 +282,8 @@ netif_add(struct netif *netif,
|
|||||||
/* remember netif specific state information data */
|
/* remember netif specific state information data */
|
||||||
netif->state = state;
|
netif->state = state;
|
||||||
netif->num = netif_num++;
|
netif->num = netif_num++;
|
||||||
if(input != NULL) {
|
|
||||||
netif->input = input;
|
netif->input = input;
|
||||||
} else {
|
|
||||||
#if NO_SYS
|
|
||||||
netif->input = netif_input;
|
|
||||||
#else
|
|
||||||
netif->input = tcpip_input;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
NETIF_SET_HWADDRHINT(netif, NULL);
|
NETIF_SET_HWADDRHINT(netif, NULL);
|
||||||
#if ENABLE_LOOPBACK && LWIP_LOOPBACK_MAX_PBUFS
|
#if ENABLE_LOOPBACK && LWIP_LOOPBACK_MAX_PBUFS
|
||||||
netif->loop_cnt_current = 0;
|
netif->loop_cnt_current = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user