Added PPPoE support and various PPP improvements.

This commit is contained in:
marcbou
2007-08-16 18:12:20 +00:00
parent a6ca9aa306
commit 931fcfd0f5
14 changed files with 1805 additions and 75 deletions

View File

@@ -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