mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2025-08-04 13:34:38 +08:00
Add raw_init in tcpip_init + minor changes (tabs, ident, coding style...)
This commit is contained in:
parent
d907bcd57a
commit
e0bf309bb5
@ -315,8 +315,8 @@ tcpip_thread(void *arg)
|
|||||||
#if ETHARP_TCPIP_INPUT || ETHARP_TCPIP_ETHINPUT
|
#if ETHARP_TCPIP_INPUT || ETHARP_TCPIP_ETHINPUT
|
||||||
case TCPIP_MSG_INPKT:
|
case TCPIP_MSG_INPKT:
|
||||||
LWIP_DEBUGF(TCPIP_DEBUG, ("tcpip_thread: PACKET %p\n", (void *)msg));
|
LWIP_DEBUGF(TCPIP_DEBUG, ("tcpip_thread: PACKET %p\n", (void *)msg));
|
||||||
msg->msg.inp.f(msg->msg.inp.p, msg->msg.inp.netif);
|
msg->msg.inp.f(msg->msg.inp.p, msg->msg.inp.netif);
|
||||||
memp_free(MEMP_TCPIP_MSG_INPKT, msg);
|
memp_free(MEMP_TCPIP_MSG_INPKT, msg);
|
||||||
break;
|
break;
|
||||||
#endif /* ETHARP_TCPIP_INPUT || ETHARP_TCPIP_ETHINPUT */
|
#endif /* ETHARP_TCPIP_INPUT || ETHARP_TCPIP_ETHINPUT */
|
||||||
|
|
||||||
@ -332,15 +332,15 @@ tcpip_thread(void *arg)
|
|||||||
msg->msg.cb.f(msg->msg.cb.ctx);
|
msg->msg.cb.f(msg->msg.cb.ctx);
|
||||||
memp_free(MEMP_TCPIP_MSG_API, msg);
|
memp_free(MEMP_TCPIP_MSG_API, msg);
|
||||||
break;
|
break;
|
||||||
case TCPIP_MSG_TIMEOUT:
|
case TCPIP_MSG_TIMEOUT:
|
||||||
LWIP_DEBUGF(TCPIP_DEBUG, ("tcpip_thread: TIMEOUT %p\n", (void *)msg));
|
LWIP_DEBUGF(TCPIP_DEBUG, ("tcpip_thread: TIMEOUT %p\n", (void *)msg));
|
||||||
|
|
||||||
if(msg->msg.tmo.msecs != 0xffffffff)
|
if(msg->msg.tmo.msecs != 0xffffffff)
|
||||||
sys_timeout (msg->msg.tmo.msecs, msg->msg.tmo.h, msg->msg.tmo.arg);
|
sys_timeout (msg->msg.tmo.msecs, msg->msg.tmo.h, msg->msg.tmo.arg);
|
||||||
else
|
else
|
||||||
sys_untimeout (msg->msg.tmo.h, msg->msg.tmo.arg);
|
sys_untimeout (msg->msg.tmo.h, msg->msg.tmo.arg);
|
||||||
memp_free(MEMP_TCPIP_MSG_API, msg);
|
memp_free(MEMP_TCPIP_MSG_API, msg);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -366,11 +366,11 @@ tcpip_input(struct pbuf *p, struct netif *inp)
|
|||||||
}
|
}
|
||||||
|
|
||||||
msg->type = TCPIP_MSG_INPKT;
|
msg->type = TCPIP_MSG_INPKT;
|
||||||
msg->msg.inp.f = ip_input;
|
msg->msg.inp.f = ip_input;
|
||||||
msg->msg.inp.p = p;
|
msg->msg.inp.p = p;
|
||||||
msg->msg.inp.netif = inp;
|
msg->msg.inp.netif = inp;
|
||||||
sys_mbox_post(mbox, msg);
|
sys_mbox_post(mbox, msg);
|
||||||
return ERR_OK;
|
return ERR_OK;
|
||||||
}
|
}
|
||||||
return ERR_VAL;
|
return ERR_VAL;
|
||||||
}
|
}
|
||||||
@ -381,13 +381,13 @@ tcpip_input_callback(struct pbuf *p, struct netif *inp, err_t (*f)(struct pbuf *
|
|||||||
struct tcpip_msg *msg;
|
struct tcpip_msg *msg;
|
||||||
|
|
||||||
if (mbox != SYS_MBOX_NULL) {
|
if (mbox != SYS_MBOX_NULL) {
|
||||||
msg = memp_malloc(MEMP_TCPIP_MSG_INPKT);
|
msg = memp_malloc(MEMP_TCPIP_MSG_INPKT);
|
||||||
if (msg == NULL) {
|
if (msg == NULL) {
|
||||||
return ERR_MEM;
|
return ERR_MEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
msg->type = TCPIP_MSG_INPKT;
|
msg->type = TCPIP_MSG_INPKT;
|
||||||
msg->msg.inp.f = f;
|
msg->msg.inp.f = f;
|
||||||
msg->msg.inp.p = p;
|
msg->msg.inp.p = p;
|
||||||
msg->msg.inp.netif = inp;
|
msg->msg.inp.netif = inp;
|
||||||
sys_mbox_post(mbox, msg);
|
sys_mbox_post(mbox, msg);
|
||||||
@ -570,16 +570,19 @@ tcpip_init(void (* initfunc)(void *), void *arg)
|
|||||||
#if LWIP_ARP
|
#if LWIP_ARP
|
||||||
etharp_init();
|
etharp_init();
|
||||||
#endif /* LWIP_ARP */
|
#endif /* LWIP_ARP */
|
||||||
#if LWIP_AUTOIP
|
|
||||||
autoip_init();
|
|
||||||
#endif /* LWIP_AUTOIP */
|
|
||||||
ip_init();
|
ip_init();
|
||||||
|
#if LWIP_RAW
|
||||||
|
raw_init();
|
||||||
|
#endif /* LWIP_RAW */
|
||||||
#if LWIP_UDP
|
#if LWIP_UDP
|
||||||
udp_init();
|
udp_init();
|
||||||
#endif /* LWIP_UDP */
|
#endif /* LWIP_UDP */
|
||||||
#if LWIP_TCP
|
#if LWIP_TCP
|
||||||
tcp_init();
|
tcp_init();
|
||||||
#endif /* LWIP_TCP */
|
#endif /* LWIP_TCP */
|
||||||
|
#if LWIP_AUTOIP
|
||||||
|
autoip_init();
|
||||||
|
#endif /* LWIP_AUTOIP */
|
||||||
|
|
||||||
tcpip_init_done = initfunc;
|
tcpip_init_done = initfunc;
|
||||||
tcpip_init_done_arg = arg;
|
tcpip_init_done_arg = arg;
|
||||||
|
@ -82,7 +82,7 @@ err_t raw_sendto (struct raw_pcb *pcb, struct pbuf *p, struct ip_
|
|||||||
err_t raw_send (struct raw_pcb *pcb, struct pbuf *p);
|
err_t raw_send (struct raw_pcb *pcb, struct pbuf *p);
|
||||||
|
|
||||||
/* The following functions are the lower layer interface to RAW. */
|
/* The following functions are the lower layer interface to RAW. */
|
||||||
u8_t raw_input (struct pbuf *p, struct netif *inp);
|
u8_t raw_input (struct pbuf *p, struct netif *inp);
|
||||||
void raw_init (void);
|
void raw_init (void);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
Loading…
x
Reference in New Issue
Block a user