mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2025-04-09 21:44:21 +00:00
removed unit from ppp_ioctl()
This commit is contained in:
parent
3a30e5bf78
commit
81a0fd782f
@ -361,7 +361,7 @@ int ppp_over_serial_open(ppp_pcb *pcb, sio_fd_t fd, ppp_link_status_cb_fn link_s
|
|||||||
sys_thread_new(PPP_THREAD_NAME, ppp_input_thread, (void*)&pcb->rx, PPP_THREAD_STACKSIZE, PPP_THREAD_PRIO);
|
sys_thread_new(PPP_THREAD_NAME, ppp_input_thread, (void*)&pcb->rx, PPP_THREAD_STACKSIZE, PPP_THREAD_PRIO);
|
||||||
#endif /* PPP_INPROC_OWNTHREAD */
|
#endif /* PPP_INPROC_OWNTHREAD */
|
||||||
|
|
||||||
return pcb->unit;
|
return PPPERR_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -413,7 +413,7 @@ int ppp_over_ethernet_open(ppp_pcb *pcb, struct netif *ethif, const char *servic
|
|||||||
}
|
}
|
||||||
|
|
||||||
pppoe_connect(pcb->pppoe_sc);
|
pppoe_connect(pcb->pppoe_sc);
|
||||||
return pcb->unit;
|
return PPPERR_NONE;
|
||||||
}
|
}
|
||||||
#endif /* PPPOE_SUPPORT */
|
#endif /* PPPOE_SUPPORT */
|
||||||
|
|
||||||
@ -1105,49 +1105,50 @@ static err_t ppp_netif_output_over_ethernet(ppp_pcb *pcb, struct pbuf *p) {
|
|||||||
int
|
int
|
||||||
ppp_ioctl(ppp_pcb *pcb, int cmd, void *arg)
|
ppp_ioctl(ppp_pcb *pcb, int cmd, void *arg)
|
||||||
{
|
{
|
||||||
int st = 0;
|
if(NULL == pcb)
|
||||||
|
return PPPERR_PARAM;
|
||||||
|
|
||||||
if (pcb->unit < 0 || pcb->unit >= NUM_PPP) {
|
switch(cmd) {
|
||||||
st = PPPERR_PARAM;
|
|
||||||
} else {
|
|
||||||
switch(cmd) {
|
|
||||||
case PPPCTLG_UPSTATUS: /* Get the PPP up status. */
|
case PPPCTLG_UPSTATUS: /* Get the PPP up status. */
|
||||||
if (arg) {
|
if (arg) {
|
||||||
*(int *)arg = (int)(pcb->if_up);
|
*(int *)arg = (int)(pcb->if_up);
|
||||||
} else {
|
return PPPERR_NONE;
|
||||||
st = PPPERR_PARAM;
|
|
||||||
}
|
}
|
||||||
|
return PPPERR_PARAM;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PPPCTLS_ERRCODE: /* Set the PPP error code. */
|
case PPPCTLS_ERRCODE: /* Set the PPP error code. */
|
||||||
if (arg) {
|
if (arg) {
|
||||||
pcb->err_code = *(int *)arg;
|
pcb->err_code = *(int *)arg;
|
||||||
} else {
|
return PPPERR_NONE;
|
||||||
st = PPPERR_PARAM;
|
|
||||||
}
|
}
|
||||||
|
return PPPERR_PARAM;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PPPCTLG_ERRCODE: /* Get the PPP error code. */
|
case PPPCTLG_ERRCODE: /* Get the PPP error code. */
|
||||||
if (arg) {
|
if (arg) {
|
||||||
*(int *)arg = (int)(pcb->err_code);
|
*(int *)arg = (int)(pcb->err_code);
|
||||||
} else {
|
return PPPERR_NONE;
|
||||||
st = PPPERR_PARAM;
|
|
||||||
}
|
}
|
||||||
|
return PPPERR_PARAM;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
#if PPPOS_SUPPORT
|
#if PPPOS_SUPPORT
|
||||||
case PPPCTLG_FD: /* Get the fd associated with the ppp */
|
case PPPCTLG_FD: /* Get the fd associated with the ppp */
|
||||||
if (arg) {
|
if (arg) {
|
||||||
*(sio_fd_t *)arg = pcb->fd;
|
*(sio_fd_t *)arg = pcb->fd;
|
||||||
} else {
|
return PPPERR_NONE;
|
||||||
st = PPPERR_PARAM;
|
|
||||||
}
|
}
|
||||||
|
return PPPERR_PARAM;
|
||||||
break;
|
break;
|
||||||
#endif /* PPPOS_SUPPORT */
|
#endif /* PPPOS_SUPPORT */
|
||||||
|
|
||||||
default:
|
default:
|
||||||
st = PPPERR_PARAM;
|
return PPPERR_PARAM;
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return st;
|
return PPPERR_PARAM;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user