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

@@ -99,16 +99,6 @@ struct pppapi_msg_msg {
u8_t cmd;
void *arg;
} ioctl;
#if LWIP_NETIF_STATUS_CALLBACK
struct {
netif_status_callback_fn status_callback;
} netifstatuscallback;
#endif /* LWIP_NETIF_STATUS_CALLBACK */
#if LWIP_NETIF_LINK_CALLBACK
struct {
netif_status_callback_fn link_callback;
} netiflinkcallback;
#endif /* LWIP_NETIF_LINK_CALLBACK */
} msg;
};
@@ -140,12 +130,6 @@ err_t pppapi_open(ppp_pcb *pcb, u16_t holdoff);
err_t pppapi_close(ppp_pcb *pcb, u8_t nocarrier);
err_t pppapi_free(ppp_pcb *pcb);
err_t pppapi_ioctl(ppp_pcb *pcb, u8_t cmd, void *arg);
#if LWIP_NETIF_STATUS_CALLBACK
void pppapi_set_netif_statuscallback(ppp_pcb *pcb, netif_status_callback_fn status_callback);
#endif /* LWIP_NETIF_STATUS_CALLBACK */
#if LWIP_NETIF_LINK_CALLBACK
void pppapi_set_netif_linkcallback(ppp_pcb *pcb, netif_status_callback_fn link_callback);
#endif /* LWIP_NETIF_LINK_CALLBACK */
#ifdef __cplusplus
}

View File

@@ -521,14 +521,13 @@ err_t ppp_ioctl(ppp_pcb *pcb, u8_t cmd, void *arg);
/* Get the PPP addresses */
#define ppp_addrs(ppp) (&(ppp)->addrs)
#if LWIP_NETIF_STATUS_CALLBACK
/* Set an lwIP-style status-callback for the selected PPP device */
void ppp_set_netif_statuscallback(ppp_pcb *pcb, netif_status_callback_fn status_callback);
#endif /* LWIP_NETIF_STATUS_CALLBACK */
#if LWIP_NETIF_LINK_CALLBACK
#define ppp_set_netif_statuscallback(ppp, status_cb) \
netif_set_status_callback(ppp->netif, status_cb);
/* Set an lwIP-style link-callback for the selected PPP device */
void ppp_set_netif_linkcallback(ppp_pcb *pcb, netif_status_callback_fn link_callback);
#endif /* LWIP_NETIF_LINK_CALLBACK */
#define ppp_set_netif_linkcallback(ppp, link_cb) \
netif_set_link_callback(ppp->netif, link_cb);
#endif /* PPP_H */