57 |
(void)arg; |
(void)arg; |
58 |
|
|
59 |
tcp_tmr(); |
tcp_tmr(); |
60 |
if(tcp_active_pcbs || tcp_tw_pcbs) { |
if (tcp_active_pcbs || tcp_tw_pcbs) { |
61 |
sys_timeout(TCP_TMR_INTERVAL, tcpip_tcp_timer, NULL); |
sys_timeout(TCP_TMR_INTERVAL, tcpip_tcp_timer, NULL); |
62 |
} else { |
} else { |
63 |
tcpip_tcp_timer_active = 0; |
tcpip_tcp_timer_active = 0; |
67 |
void |
void |
68 |
tcp_timer_needed(void) |
tcp_timer_needed(void) |
69 |
{ |
{ |
70 |
if(!tcpip_tcp_timer_active && (tcp_active_pcbs || tcp_tw_pcbs)) { |
if (!tcpip_tcp_timer_active && (tcp_active_pcbs || tcp_tw_pcbs)) { |
71 |
tcpip_tcp_timer_active = 1; |
tcpip_tcp_timer_active = 1; |
72 |
sys_timeout(TCP_TMR_INTERVAL, tcpip_tcp_timer, NULL); |
sys_timeout(TCP_TMR_INTERVAL, tcpip_tcp_timer, NULL); |
73 |
} |
} |
88 |
#if LWIP_TCP |
#if LWIP_TCP |
89 |
tcp_init(); |
tcp_init(); |
90 |
#endif |
#endif |
91 |
if(tcpip_init_done != NULL) { |
if (tcpip_init_done != NULL) { |
92 |
tcpip_init_done(tcpip_init_done_arg); |
tcpip_init_done(tcpip_init_done_arg); |
93 |
} |
} |
94 |
|
|
95 |
while(1) { /* MAIN Loop */ |
while (1) { /* MAIN Loop */ |
96 |
sys_mbox_fetch(mbox, (void *)&msg); |
sys_mbox_fetch(mbox, (void *)&msg); |
97 |
switch(msg->type) { |
switch (msg->type) { |
98 |
case TCPIP_MSG_API: |
case TCPIP_MSG_API: |
99 |
DEBUGF(TCPIP_DEBUG, ("tcpip_thread: API message %p\n", (void *)msg)); |
DEBUGF(TCPIP_DEBUG, ("tcpip_thread: API message %p\n", (void *)msg)); |
100 |
api_msg_input(msg->msg.apimsg); |
api_msg_input(msg->msg.apimsg); |
120 |
struct tcpip_msg *msg; |
struct tcpip_msg *msg; |
121 |
|
|
122 |
msg = memp_mallocp(MEMP_TCPIP_MSG); |
msg = memp_mallocp(MEMP_TCPIP_MSG); |
123 |
if(msg == NULL) { |
if (msg == NULL) { |
124 |
pbuf_free(p); |
pbuf_free(p); |
125 |
return ERR_MEM; |
return ERR_MEM; |
126 |
} |
} |
138 |
struct tcpip_msg *msg; |
struct tcpip_msg *msg; |
139 |
|
|
140 |
msg = memp_mallocp(MEMP_TCPIP_MSG); |
msg = memp_mallocp(MEMP_TCPIP_MSG); |
141 |
if(msg == NULL) { |
if (msg == NULL) { |
142 |
return ERR_MEM; |
return ERR_MEM; |
143 |
} |
} |
144 |
|
|
154 |
{ |
{ |
155 |
struct tcpip_msg *msg; |
struct tcpip_msg *msg; |
156 |
msg = memp_mallocp(MEMP_TCPIP_MSG); |
msg = memp_mallocp(MEMP_TCPIP_MSG); |
157 |
if(msg == NULL) { |
if (msg == NULL) { |
158 |
memp_free(MEMP_API_MSG, apimsg); |
memp_free(MEMP_API_MSG, apimsg); |
159 |
return; |
return; |
160 |
} |
} |