mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2026-05-18 22:26:41 +08:00
Added PPPoE support and various PPP improvements.
This commit is contained in:
@@ -328,6 +328,14 @@ tcpip_thread(void *arg)
|
||||
msg->msg.cb.f(msg->msg.cb.ctx);
|
||||
memp_free(MEMP_TCPIP_MSG, msg);
|
||||
break;
|
||||
case TCPIP_MSG_TIMEOUT:
|
||||
LWIP_DEBUGF(TCPIP_DEBUG, ("tcpip_thread: TIMEOUT %p\n", (void *)msg));
|
||||
|
||||
if(msg->msg.tmo.msecs != 0xffffffff)
|
||||
sys_timeout (msg->msg.tmo.msecs, msg->msg.tmo.h, msg->msg.tmo.arg);
|
||||
else
|
||||
sys_untimeout (msg->msg.tmo.h, msg->msg.tmo.arg);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -420,6 +428,27 @@ tcpip_callback(void (*f)(void *ctx), void *ctx)
|
||||
return ERR_VAL;
|
||||
}
|
||||
|
||||
err_t
|
||||
tcpip_timeout(u32_t msecs, sys_timeout_handler h, void *arg)
|
||||
{
|
||||
struct tcpip_msg *msg;
|
||||
|
||||
if (mbox != SYS_MBOX_NULL) {
|
||||
msg = memp_malloc(MEMP_TCPIP_MSG);
|
||||
if (msg == NULL) {
|
||||
return ERR_MEM;
|
||||
}
|
||||
|
||||
msg->type = TCPIP_MSG_TIMEOUT;
|
||||
msg->msg.tmo.msecs = msecs;
|
||||
msg->msg.tmo.h = h;
|
||||
msg->msg.tmo.arg = arg;
|
||||
sys_mbox_post(mbox, msg);
|
||||
return ERR_OK;
|
||||
}
|
||||
return ERR_VAL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Call the lower part of a netconn_* function
|
||||
* This function is then running in the thread context
|
||||
|
||||
Reference in New Issue
Block a user