PPP, CORE, functions ppp_set_netif_statuscallback() and ppp_set_netif_linkcallback() replaced with defines

PPP is now pointerful for a while, we don't need anymore accessor functions
for the unique PPP local and static control block. Replaced
ppp_set_netif_statuscallback() and ppp_set_netif_linkcallback() functions to
defines.

Removed pppapi_do_ppp_set_netif_statuscallback() and
pppapi_do_ppp_set_netif_linkcallback(), they were useless because
netif_set_status_callback() and netif_set_link_callback() can be
safely called while PPP status is in dead (= non open) state
and even before the PPP session is actually created at all.
This commit is contained in:
Sylvain Rochet
2015-02-24 20:33:15 +01:00
parent b4990b5bb4
commit 00bb70a62d
4 changed files with 5 additions and 105 deletions

View File

@@ -339,57 +339,4 @@ pppapi_ioctl(ppp_pcb *pcb, u8_t cmd, void *arg)
}
#if LWIP_NETIF_STATUS_CALLBACK
/**
* Call ppp_set_netif_statuscallback() inside the tcpip_thread context.
*/
static void
pppapi_do_ppp_set_netif_statuscallback(struct pppapi_msg_msg *msg)
{
ppp_set_netif_statuscallback(msg->ppp, msg->msg.netifstatuscallback.status_callback);
TCPIP_PPPAPI_ACK(msg);
}
/**
* Call ppp_set_netif_statuscallback() in a thread-safe way by running that function inside the
* tcpip_thread context.
*/
void
pppapi_set_netif_statuscallback(ppp_pcb *pcb, netif_status_callback_fn status_callback)
{
struct pppapi_msg msg;
msg.function = pppapi_do_ppp_set_netif_statuscallback;
msg.msg.ppp = pcb;
msg.msg.msg.netifstatuscallback.status_callback = status_callback;
TCPIP_PPPAPI(&msg);
}
#endif /* LWIP_NETIF_STATUS_CALLBACK */
#if LWIP_NETIF_LINK_CALLBACK
/**
* Call ppp_set_netif_linkcallback() inside the tcpip_thread context.
*/
static void
pppapi_do_ppp_set_netif_linkcallback(struct pppapi_msg_msg *msg)
{
ppp_set_netif_linkcallback(msg->ppp, msg->msg.netiflinkcallback.link_callback);
TCPIP_PPPAPI_ACK(msg);
}
/**
* Call ppp_set_netif_linkcallback() in a thread-safe way by running that function inside the
* tcpip_thread context.
*/
void
pppapi_set_netif_linkcallback(ppp_pcb *pcb, netif_status_callback_fn link_callback)
{
struct pppapi_msg msg;
msg.function = pppapi_do_ppp_set_netif_linkcallback;
msg.msg.ppp = pcb;
msg.msg.msg.netiflinkcallback.link_callback = link_callback;
TCPIP_PPPAPI(&msg);
}
#endif /* LWIP_NETIF_LINK_CALLBACK */
#endif /* LWIP_PPP_API */