Lines Matching refs:pd
171 int pd; member
348 pppRecvWakeup(int pd) in pppRecvWakeup() argument
350 PPPDEBUG(LOG_DEBUG, ("pppRecvWakeup: unit %d\n", pd)); in pppRecvWakeup()
351 if (pppControl[pd].openFlag != 0) { in pppRecvWakeup()
352 sio_read_abort(pppControl[pd].fd); in pppRecvWakeup()
359 pppLinkTerminated(int pd) in pppLinkTerminated() argument
361 PPPDEBUG(LOG_DEBUG, ("pppLinkTerminated: unit %d\n", pd)); in pppLinkTerminated()
364 if (pppControl[pd].ethif) { in pppLinkTerminated()
365 pppoe_disconnect(pppControl[pd].pppoe_sc); in pppLinkTerminated()
372 pppRecvWakeup(pd); in pppLinkTerminated()
374 pc = &pppControl[pd]; in pppLinkTerminated()
376 …PPPDEBUG(LOG_DEBUG, ("pppLinkTerminated: unit %d: linkStatusCB=%p errCode=%d\n", pd, pc->linkStatu… in pppLinkTerminated()
388 pppLinkDown(int pd) in pppLinkDown() argument
390 PPPDEBUG(LOG_DEBUG, ("pppLinkDown: unit %d\n", pd)); in pppLinkDown()
393 if (pppControl[pd].ethif) { in pppLinkDown()
394 pppoe_disconnect(pppControl[pd].pppoe_sc); in pppLinkDown()
399 pppRecvWakeup(pd); in pppLinkDown()
406 pppStart(int pd) in pppStart() argument
408 PPPDEBUG(LOG_DEBUG, ("pppStart: unit %d\n", pd)); in pppStart()
409 lcp_lowerup(pd); in pppStart()
410 lcp_open(pd); /* Start protocol */ in pppStart()
416 pppStop(int pd) in pppStop() argument
418 PPPDEBUG(LOG_DEBUG, ("pppStop: unit %d\n", pd)); in pppStop()
419 lcp_close(pd, "User request"); in pppStop()
424 pppHup(int pd) in pppHup() argument
426 PPPDEBUG(LOG_DEBUG, ("pppHupCB: unit %d\n", pd)); in pppHup()
427 lcp_lowerdown(pd); in pppHup()
428 link_terminated(pd); in pppHup()
540 int pd; in pppOverSerialOpen() local
549 for (pd = 0; pd < NUM_PPP && pppControl[pd].openFlag != 0; pd++); in pppOverSerialOpen()
551 if (pd >= NUM_PPP) { in pppOverSerialOpen()
552 pd = PPPERR_OPEN; in pppOverSerialOpen()
554 pc = &pppControl[pd]; in pppOverSerialOpen()
559 pc->rx.pd = pd; in pppOverSerialOpen()
582 PPPDEBUG(LOG_INFO, ("pppOverSerialOpen: unit %d: Connecting\n", pd)); in pppOverSerialOpen()
583 pppStart(pd); in pppOverSerialOpen()
589 return pd; in pppOverSerialOpen()
594 static void pppOverEthernetLinkStatusCB(int pd, int up);
597 pppOverEthernetClose(int pd) in pppOverEthernetClose() argument
599 PPPControl* pc = &pppControl[pd]; in pppOverEthernetClose()
602 lcp_close(pd, NULL); in pppOverEthernetClose()
611 int pd; in pppOverEthernetOpen() local
623 for (pd = 0; pd < NUM_PPP && pppControl[pd].openFlag != 0; pd++); in pppOverEthernetOpen()
624 if (pd >= NUM_PPP) { in pppOverEthernetOpen()
625 pd = PPPERR_OPEN; in pppOverEthernetOpen()
627 pc = &pppControl[pd]; in pppOverEthernetOpen()
635 lcp_wantoptions[pd].mru = PPPOE_MAXMTU; in pppOverEthernetOpen()
636 lcp_wantoptions[pd].neg_asyncmap = 0; in pppOverEthernetOpen()
637 lcp_wantoptions[pd].neg_pcompression = 0; in pppOverEthernetOpen()
638 lcp_wantoptions[pd].neg_accompression = 0; in pppOverEthernetOpen()
640 lcp_allowoptions[pd].mru = PPPOE_MAXMTU; in pppOverEthernetOpen()
641 lcp_allowoptions[pd].neg_asyncmap = 0; in pppOverEthernetOpen()
642 lcp_allowoptions[pd].neg_pcompression = 0; in pppOverEthernetOpen()
643 lcp_allowoptions[pd].neg_accompression = 0; in pppOverEthernetOpen()
645 if(pppoe_create(ethif, pd, pppOverEthernetLinkStatusCB, &pc->pppoe_sc) != ERR_OK) { in pppOverEthernetOpen()
653 return pd; in pppOverEthernetOpen()
662 pppClose(int pd) in pppClose() argument
664 PPPControl *pc = &pppControl[pd]; in pppClose()
672 PPPDEBUG(LOG_DEBUG, ("pppClose: unit %d kill_link -> pppStop\n", pd)); in pppClose()
675 pppStop(pd); in pppClose()
680 PPPDEBUG(LOG_DEBUG, ("pppClose: unit %d kill_link -> pppStop\n", pd)); in pppClose()
683 pppStop(pd); in pppClose()
685 pppRecvWakeup(pd); in pppClose()
695 pppSigHUP(int pd) in pppSigHUP() argument
697 PPPDEBUG(LOG_DEBUG, ("pppSigHUP: unit %d sig_hup -> pppHupCB\n", pd)); in pppSigHUP()
698 pppHup(pd); in pppSigHUP()
766 pppifOutputOverEthernet(int pd, struct pbuf *p) in pppifOutputOverEthernet() argument
768 PPPControl *pc = &pppControl[pd]; in pppifOutputOverEthernet()
812 int pd = (int)(size_t)netif->state; in pppifOutput() local
813 PPPControl *pc = &pppControl[pd]; in pppifOutput()
826 if (pd < 0 || pd >= NUM_PPP || !pc->openFlag || !pb) { in pppifOutput()
828 pd, PPP_IP, pb)); in pppifOutput()
836 if (lcp_phase[pd] == PHASE_DEAD) { in pppifOutput()
837 PPPDEBUG(LOG_ERR, ("pppifOutput[%d]: link not up\n", pd)); in pppifOutput()
846 return pppifOutputOverEthernet(pd, pb); in pppifOutput()
854 PPPDEBUG(LOG_WARNING, ("pppifOutput[%d]: first alloc fail\n", pd)); in pppifOutput()
879 PPPDEBUG(LOG_WARNING, ("pppifOutput[%d]: bad IP packet\n", pd)); in pppifOutput()
941 pd, protocol)); in pppifOutput()
950 PPPDEBUG(LOG_INFO, ("pppifOutput[%d]: proto=0x%"X16_F"\n", pd, protocol)); in pppifOutput()
961 pppIOCtl(int pd, int cmd, void *arg) in pppIOCtl() argument
963 PPPControl *pc = &pppControl[pd]; in pppIOCtl()
966 if (pd < 0 || pd >= NUM_PPP) { in pppIOCtl()
1013 pppMTU(int pd) in pppMTU() argument
1015 PPPControl *pc = &pppControl[pd]; in pppMTU()
1019 if (pd < 0 || pd >= NUM_PPP || !pc->openFlag) { in pppMTU()
1030 pppWriteOverEthernet(int pd, const u_char *s, int n) in pppWriteOverEthernet() argument
1032 PPPControl *pc = &pppControl[pd]; in pppWriteOverEthernet()
1073 pppWrite(int pd, const u_char *s, int n) in pppWrite() argument
1075 PPPControl *pc = &pppControl[pd]; in pppWrite()
1084 return pppWriteOverEthernet(pd, s, n); in pppWrite()
1129 ("pppWrite[%d]: Alloc err - dropping pbuf len=%d\n", pd, headMB->len)); in pppWrite()
1138 PPPDEBUG(LOG_INFO, ("pppWrite[%d]: len=%d\n", pd, headMB->len)); in pppWrite()
1299 sifvjcomp(int pd, int vjcomp, u8_t cidcomp, u8_t maxcid) in sifvjcomp() argument
1302 PPPControl *pc = &pppControl[pd]; in sifvjcomp()
1310 LWIP_UNUSED_ARG(pd); in sifvjcomp()
1342 sifup(int pd) in sifup() argument
1344 PPPControl *pc = &pppControl[pd]; in sifup()
1347 if (pd < 0 || pd >= NUM_PPP || !pc->openFlag) { in sifup()
1349 PPPDEBUG(LOG_WARNING, ("sifup[%d]: bad parms\n", pd)); in sifup()
1353 &pc->addrs.his_ipaddr, (void *)(size_t)pd, pppifNetifInit, ip_input)) { in sifup()
1358 …PPPDEBUG(LOG_DEBUG, ("sifup: unit %d: linkStatusCB=%p errCode=%d\n", pd, pc->linkStatusCB, pc->err… in sifup()
1364 PPPDEBUG(LOG_ERR, ("sifup[%d]: netif_add failed\n", pd)); in sifup()
1387 sifdown(int pd) in sifdown() argument
1389 PPPControl *pc = &pppControl[pd]; in sifdown()
1392 if (pd < 0 || pd >= NUM_PPP || !pc->openFlag) { in sifdown()
1394 PPPDEBUG(LOG_WARNING, ("sifdown[%d]: bad parms\n", pd)); in sifdown()
1400 …PPPDEBUG(LOG_DEBUG, ("sifdown: unit %d: linkStatusCB=%p errCode=%d\n", pd, pc->linkStatusCB, pc->e… in sifdown()
1418 sifaddr( int pd, u32_t o, u32_t h, u32_t m, u32_t ns1, u32_t ns2) in sifaddr() argument
1420 PPPControl *pc = &pppControl[pd]; in sifaddr()
1423 if (pd < 0 || pd >= NUM_PPP || !pc->openFlag) { in sifaddr()
1425 PPPDEBUG(LOG_WARNING, ("sifup[%d]: bad parms\n", pd)); in sifaddr()
1444 cifaddr( int pd, u32_t o, u32_t h) in cifaddr() argument
1446 PPPControl *pc = &pppControl[pd]; in cifaddr()
1451 if (pd < 0 || pd >= NUM_PPP || !pc->openFlag) { in cifaddr()
1453 PPPDEBUG(LOG_WARNING, ("sifup[%d]: bad parms\n", pd)); in cifaddr()
1468 sifdefaultroute(int pd, u32_t l, u32_t g) in sifdefaultroute() argument
1470 PPPControl *pc = &pppControl[pd]; in sifdefaultroute()
1476 if (pd < 0 || pd >= NUM_PPP || !pc->openFlag) { in sifdefaultroute()
1478 PPPDEBUG(LOG_WARNING, ("sifup[%d]: bad parms\n", pd)); in sifdefaultroute()
1492 cifdefaultroute(int pd, u32_t l, u32_t g) in cifdefaultroute() argument
1494 PPPControl *pc = &pppControl[pd]; in cifdefaultroute()
1500 if (pd < 0 || pd >= NUM_PPP || !pc->openFlag) { in cifdefaultroute()
1502 PPPDEBUG(LOG_WARNING, ("sifup[%d]: bad parms\n", pd)); in cifdefaultroute()
1523 while (lcp_phase[pcrx->pd] != PHASE_DEAD) { in pppInputThread()
1538 pppOverEthernetInitFailed(int pd) in pppOverEthernetInitFailed() argument
1542 pppHup(pd); in pppOverEthernetInitFailed()
1543 pppStop(pd); in pppOverEthernetInitFailed()
1545 pc = &pppControl[pd]; in pppOverEthernetInitFailed()
1555 pppOverEthernetLinkStatusCB(int pd, int up) in pppOverEthernetLinkStatusCB() argument
1558 PPPDEBUG(LOG_INFO, ("pppOverEthernetLinkStatusCB: unit %d: Connecting\n", pd)); in pppOverEthernetLinkStatusCB()
1559 pppStart(pd); in pppOverEthernetLinkStatusCB()
1561 pppOverEthernetInitFailed(pd); in pppOverEthernetLinkStatusCB()
1607 int pd; in pppInput() local
1609 pd = ((struct pppInputHeader *)nb->payload)->unit; in pppInput()
1618 snmp_inc_ifinucastpkts(&pppControl[pd].netif); in pppInput()
1619 snmp_add_ifinoctets(&pppControl[pd].netif, nb->tot_len); in pppInput()
1626 if((lcp_phase[pd] <= PHASE_AUTHENTICATE) && (protocol != PPP_LCP)) { in pppInput()
1628 (lcp_phase[pd] != PHASE_AUTHENTICATE)) { in pppInput()
1629 …PDEBUG(LOG_INFO, ("pppInput: discarding proto 0x%"X16_F" in phase %d\n", protocol, lcp_phase[pd])); in pppInput()
1637 PPPDEBUG(LOG_INFO, ("pppInput[%d]: vj_comp in pbuf len=%d\n", pd, nb->len)); in pppInput()
1642 if ((vj_uncompress_tcp(&nb, &pppControl[pd].vjComp) >= 0) && (pppControl[pd].netif.input)) { in pppInput()
1643 pppControl[pd].netif.input(nb, &pppControl[pd].netif); in pppInput()
1647 PPPDEBUG(LOG_WARNING, ("pppInput[%d]: Dropping VJ compressed\n", pd)); in pppInput()
1650 PPPDEBUG(LOG_INFO, ("pppInput[%d]: drop VJ Comp in %d:%s\n", pd, nb->len, nb->payload)); in pppInput()
1656 PPPDEBUG(LOG_INFO, ("pppInput[%d]: vj_un in pbuf len=%d\n", pd, nb->len)); in pppInput()
1661 if ((vj_uncompress_uncomp(nb, &pppControl[pd].vjComp) >= 0) && pppControl[pd].netif.input) { in pppInput()
1662 pppControl[pd].netif.input(nb, &pppControl[pd].netif); in pppInput()
1666 PPPDEBUG(LOG_WARNING, ("pppInput[%d]: Dropping VJ uncompressed\n", pd)); in pppInput()
1671 pd, nb->len, LWIP_MIN(nb->len * 2, 40), nb->payload)); in pppInput()
1676 PPPDEBUG(LOG_INFO, ("pppInput[%d]: ip in pbuf len=%d\n", pd, nb->len)); in pppInput()
1677 if (pppControl[pd].netif.input) { in pppInput()
1678 pppControl[pd].netif.input(nb, &pppControl[pd].netif); in pppInput()
1692 PPPDEBUG(LOG_INFO, ("pppInput[%d]: %s len=%d\n", pd, protp->name, nb->len)); in pppInput()
1694 (*protp->input)(pd, nb->payload, nb->len); in pppInput()
1695 PPPDEBUG(LOG_DETAIL, ("pppInput[%d]: packet processed\n", pd)); in pppInput()
1701 …PPPDEBUG(LOG_INFO, ("pppInput[%d]: rejecting unsupported proto 0x%"X16_F" len=%d\n", pd, protocol,… in pppInput()
1710 lcp_sprotrej(pd, nb->payload, nb->len); in pppInput()
1717 snmp_inc_ifindiscards(&pppControl[pd].netif); in pppInput()
1755 vj_uncompress_err(&pppControl[pcrx->pd].vjComp); in pppDrop()
1759 snmp_inc_ifindiscards(&pppControl[pcrx->pd].netif); in pppDrop()
1771 pppos_input(int pd, u_char* data, int len) in pppos_input() argument
1773 pppInProc(&pppControl[pd].rx, data, len); in pppos_input()
1788 PPPDEBUG(LOG_DEBUG, ("pppInProc[%d]: got %d bytes\n", pcrx->pd, l)); in pppInProc()
1813 pcrx->pd, pcrx->inState)); in pppInProc()
1820 pcrx->pd, pcrx->inFCS, pcrx->inProtocol)); in pppInProc()
1851 … PPPDEBUG(LOG_ERR, ("pppInProc[%d]: tcpip_callback() failed, dropping packet\n", pcrx->pd)); in pppInProc()
1854 snmp_inc_ifindiscards(&pppControl[pcrx->pd].netif); in pppInProc()
1869 ("pppInProc[%d]: Dropping ACCM char <%d>\n", pcrx->pd, curChar)); in pppInProc()
1910 ("pppInProc[%d]: Invalid control <%d>\n", pcrx->pd, curChar)); in pppInProc()
1946 PPPDEBUG(LOG_ERR, ("pppInProc[%d]: NO FREE MBUFS!\n", pcrx->pd)); in pppInProc()
1955 pih->unit = pcrx->pd; in pppInProc()
1980 pppInProcOverEthernet(int pd, struct pbuf *pb) in pppInProcOverEthernet() argument
2000 pih->unit = pd; in pppInProcOverEthernet()
2009 snmp_inc_ifindiscards(&pppControl[pd].netif); in pppInProcOverEthernet()
2024 ppp_set_netif_statuscallback(int pd, netif_status_callback_fn status_callback) in ppp_set_netif_statuscallback() argument
2026 netif_set_status_callback(&pppControl[pd].netif, status_callback); in ppp_set_netif_statuscallback()
2039 ppp_set_netif_linkcallback(int pd, netif_status_callback_fn link_callback) in ppp_set_netif_linkcallback() argument
2041 netif_set_link_callback(&pppControl[pd].netif, link_callback); in ppp_set_netif_linkcallback()