Lines Matching refs:tll
106 #define KLINCR(vn) KINCR(tll, tll_kstats, vn)
107 #define KLDECR(vn) KDECR(tll, tll_kstats, vn)
447 tunll_t *tll; in sppptun_open() local
454 tll = kmem_zalloc(sizeof (tunll_t), KM_SLEEP); in sppptun_open()
456 tll->tll_index = tunll_index++; in sppptun_open()
458 tll->tll_wq = WR(q); in sppptun_open()
459 tll->tll_zoneid = crgetzoneid(credp); in sppptun_open()
462 insque(&tll->tll_next, tunll_list.q_back); in sppptun_open()
463 q->q_ptr = WR(q)->q_ptr = tll; in sppptun_open()
465 tll->tll_style = PTS_PPPOE; in sppptun_open()
466 tll->tll_alen = sizeof (tll->tll_lcladdr.pta_pppoe); in sppptun_open()
468 tll->tll_ksp = kstat_setup((kstat_named_t *)&tll->tll_kstats, in sppptun_open()
470 tll->tll_index); in sppptun_open()
488 (void) snprintf(tll->tll_name, sizeof (tll->tll_name), in sppptun_open()
489 PPP_TUN_NAME "%d", tll->tll_index); in sppptun_open()
491 (void) snprintf(tll->tll_name, sizeof (tll->tll_name), in sppptun_open()
492 "%s:tun%d", cp, tll->tll_index); in sppptun_open()
590 tunll_t *tll = (tunll_t *)arg; in tclvm_remove_tll() local
599 if (tcl->tcl_data_tll == tll && tcl->tcl_rq != NULL) { in tclvm_remove_tll()
605 if (tcl->tcl_ctrl_tll == tll) in tclvm_remove_tll()
609 if (tcl->tcl_ctrl_tll == tll) { in tclvm_remove_tll()
610 send_control(tcl, tll, PTCA_UNPLUMB, tcl); in tclvm_remove_tll()
632 tunll_t *tll; in sppptun_close() local
638 tll = qptr; in sppptun_close()
639 if (!(tll->tll_flags & TLLF_NOTLOWER)) { in sppptun_close()
644 vmem_walk(tcl_minor_arena, VMEM_ALLOC, tclvm_remove_tll, tll); in sppptun_close()
647 if ((tcl = tll->tll_defcl) != NULL) in sppptun_close()
648 send_control(NULL, tll, PTCA_UNPLUMB, tcl); in sppptun_close()
650 tll->tll_flags |= TLLF_CLOSING; in sppptun_close()
651 while (!(tll->tll_flags & TLLF_CLOSE_DONE)) { in sppptun_close()
652 qenable(tll->tll_wq); in sppptun_close()
653 qwait(tll->tll_wq); in sppptun_close()
655 tll->tll_error = 0; in sppptun_close()
656 while (!(tll->tll_flags & TLLF_SHUTDOWN_DONE)) { in sppptun_close()
657 if (!qwait_sig(tll->tll_wq)) in sppptun_close()
663 tll->tll_wq = NULL; in sppptun_close()
664 remque(&tll->tll_next); in sppptun_close()
665 err = tll->tll_error; in sppptun_close()
666 if (tll->tll_ksp != NULL) in sppptun_close()
667 kstat_delete(tll->tll_ksp); in sppptun_close()
668 kmem_free(tll, sizeof (*tll)); in sppptun_close()
680 tll = TO_TLL(tunll_list.q_forw); in sppptun_close()
681 while (tll != TO_TLL(&tunll_list)) { in sppptun_close()
682 if (tll->tll_defcl == tcl) in sppptun_close()
683 tll->tll_defcl = NULL; in sppptun_close()
684 if (tll->tll_lastcl == tcl) in sppptun_close()
685 tll->tll_lastcl = NULL; in sppptun_close()
686 tll = TO_TLL(tll->tll_next); in sppptun_close()
692 (tll = tcl->tcl_ctrl_tll) != NULL && in sppptun_close()
693 tll->tll_defcl != NULL) { in sppptun_close()
694 send_control(tcl, tll, PTCA_DISCONNECT, in sppptun_close()
695 tll->tll_defcl); in sppptun_close()
699 if ((tll = tcl->tcl_data_tll) != NULL) { in sppptun_close()
702 if ((tll = tcl->tcl_ctrl_tll) != NULL) { in sppptun_close()
787 tunll_t *tll; in sppptun_outpkt() local
811 tll = tcl->tcl_data_tll; in sppptun_outpkt()
855 tll = tcl->tcl_ctrl_tll; in sppptun_outpkt()
860 send_control(tcl, tll, PTCA_BADCTRL, tcl); in sppptun_outpkt()
866 if (tll == NULL || (lowerq = tll->tll_wq) == NULL) { in sppptun_outpkt()
868 tunll_t *, tll, mblk_t *, mp); in sppptun_outpkt()
869 send_control(tcl, tll, PTCA_UNPLUMB, tcl); in sppptun_outpkt()
887 tunll_t *, tll, mblk_t *, mp); in sppptun_outpkt()
901 if (tll->tll_alen != 0 && in sppptun_outpkt()
902 bcmp(&tcl->tcl_address, &tll->tll_lcladdr, in sppptun_outpkt()
903 tll->tll_alen) == 0) in sppptun_outpkt()
905 switch (tll->tll_style) { in sppptun_outpkt()
932 edestp->type = tll->tll_sap; in sppptun_outpkt()
956 if (bcmp(&ptc->ptc_address, &tll->tll_lcladdr, tll->tll_alen) in sppptun_outpkt()
960 switch (tll->tll_style) { in sppptun_outpkt()
982 edestp->type = tll->tll_sap; in sppptun_outpkt()
1063 save_for_close(tunll_t *tll, mblk_t *mp) in save_for_close() argument
1067 if ((onc = tll->tll_onclose) == NULL) in save_for_close()
1068 tll->tll_onclose = mp; in save_for_close()
1085 tunll_t *tll; in tll_lookup_on_name() local
1087 tll = TO_TLL(tunll_list.q_forw); in tll_lookup_on_name()
1088 for (; tll != TO_TLL(&tunll_list); tll = TO_TLL(tll->tll_next)) in tll_lookup_on_name()
1089 if (tll->tll_zoneid == zoneid && in tll_lookup_on_name()
1090 strcmp(dname, tll->tll_name) == 0) in tll_lookup_on_name()
1091 return (tll); in tll_lookup_on_name()
1113 tunll_t *tll; in sppptun_inner_ioctl() local
1124 tll = q->q_ptr; in sppptun_inner_ioctl()
1125 if (tll->tll_flags & TLLF_NOTLOWER) { in sppptun_inner_ioctl()
1126 tcl = (tuncl_t *)tll; in sppptun_inner_ioctl()
1127 tll = NULL; in sppptun_inner_ioctl()
1130 DTRACE_PROBE3(sppptun__ioctl, tuncl_t *, tcl, tunll_t *, tll, in sppptun_inner_ioctl()
1168 if (tll == NULL || mp->b_cont == NULL || in sppptun_inner_ioctl()
1178 tll = tll_lookup_on_name(ptn->ptn_name, tll->tll_zoneid); in sppptun_inner_ioctl()
1179 if (tll != NULL) { in sppptun_inner_ioctl()
1183 tll = (tunll_t *)q->q_ptr; in sppptun_inner_ioctl()
1184 (void) strcpy(tll->tll_name, ptn->ptn_name); in sppptun_inner_ioctl()
1196 tll = tll_lookup_on_name(pti->pti_name, in sppptun_inner_ioctl()
1197 tcl == NULL ? tll->tll_zoneid : tcl->tcl_zoneid); in sppptun_inner_ioctl()
1198 if (tll == NULL) { in sppptun_inner_ioctl()
1207 pti->pti_muxid = tll->tll_muxid; in sppptun_inner_ioctl()
1208 pti->pti_style = tll->tll_style; in sppptun_inner_ioctl()
1212 tll->tll_muxid = pti->pti_muxid; in sppptun_inner_ioctl()
1213 tll->tll_style = pti->pti_style; in sppptun_inner_ioctl()
1214 switch (tll->tll_style) { in sppptun_inner_ioctl()
1216 tll->tll_alen = sizeof (tll->tll_lcladdr.pta_pppoe); in sppptun_inner_ioctl()
1223 save_for_close(tll, mptmp); in sppptun_inner_ioctl()
1230 save_for_close(tll, mptmp); in sppptun_inner_ioctl()
1233 tll->tll_style = PTS_NONE; in sppptun_inner_ioctl()
1234 tll->tll_alen = 0; in sppptun_inner_ioctl()
1246 zoneid = tcl == NULL ? tll->tll_zoneid : tcl->tcl_zoneid; in sppptun_inner_ioctl()
1249 tll = TO_TLL(tunll_list.q_forw); in sppptun_inner_ioctl()
1250 while (tll != TO_TLL(&tunll_list)) { in sppptun_inner_ioctl()
1251 if (tll->tll_zoneid == zoneid && --i < 0) in sppptun_inner_ioctl()
1253 tll = TO_TLL(tll->tll_next); in sppptun_inner_ioctl()
1255 if (tll != TO_TLL(&tunll_list)) { in sppptun_inner_ioctl()
1256 bcopy(tll->tll_name, ptn->ptn_name, in sppptun_inner_ioctl()
1266 if (tll == NULL || mp->b_cont == NULL) { in sppptun_inner_ioctl()
1271 pap = &tll->tll_lcladdr; in sppptun_inner_ioctl()
1272 len = tll->tll_alen; in sppptun_inner_ioctl()
1388 tll = tll_lookup_on_name(ptn->ptn_name, tcl->tcl_zoneid); in sppptun_inner_ioctl()
1389 if (tll == NULL) { in sppptun_inner_ioctl()
1393 if (tll->tll_style != tcl->tcl_style) { in sppptun_inner_ioctl()
1407 tcl->tcl_data_tll = tll; in sppptun_inner_ioctl()
1409 if (tll->tll_defcl != NULL && tll->tll_defcl != tcl) { in sppptun_inner_ioctl()
1413 tll->tll_defcl = tcl; in sppptun_inner_ioctl()
1418 tcl->tcl_ctrl_tll = tll; in sppptun_inner_ioctl()
1424 tcl->tcl_ctrl_tll = tll; in sppptun_inner_ioctl()
1445 tll = tcl->tcl_data_tll; in sppptun_inner_ioctl()
1447 tll = tcl->tcl_ctrl_tll; in sppptun_inner_ioctl()
1448 if (tll == NULL) in sppptun_inner_ioctl()
1451 bcopy(tll->tll_name, ptn->ptn_name, in sppptun_inner_ioctl()
1466 tll = tll_lookup_on_name(ptn->ptn_name, tcl->tcl_zoneid); in sppptun_inner_ioctl()
1467 if (tll == NULL || tll->tll_defcl != tcl) { in sppptun_inner_ioctl()
1471 tll->tll_defcl = NULL; in sppptun_inner_ioctl()
1476 if (tll == NULL || mp->b_cont == NULL || in sppptun_inner_ioctl()
1482 tll->tll_sap = *(uint_t *)mp->b_cont->b_rptr; in sppptun_inner_ioctl()
1514 tunll_t *tll; in sppptun_ioctl() local
1567 tll = (tunll_t *)q->q_ptr; in sppptun_ioctl()
1568 if (!(tll->tll_flags & TLLF_NOTLOWER)) { in sppptun_ioctl()
1685 message_send(tunll_t *tll, mblk_t *mp) in message_send() argument
1689 if (tll->tll_msg_pending) { in message_send()
1691 mpp = &tll->tll_msg_deferred; in message_send()
1697 tll->tll_msg_pending = 1; in message_send()
1698 putnext(tll->tll_wq, mp); in message_send()
1706 message_done(tunll_t *tll) in message_done() argument
1710 ASSERT(tll->tll_msg_pending); in message_done()
1711 tll->tll_msg_pending = 0; in message_done()
1712 mp = tll->tll_msg_deferred; in message_done()
1714 tll->tll_msg_deferred = mp->b_next; in message_done()
1716 tll->tll_msg_pending = 1; in message_done()
1717 putnext(tll->tll_wq, mp); in message_done()
1727 tll_close_req(tunll_t *tll) in tll_close_req() argument
1731 if ((mb = tll->tll_onclose) == NULL) in tll_close_req()
1732 tll->tll_flags |= TLLF_SHUTDOWN_DONE; in tll_close_req()
1734 tll->tll_onclose = NULL; in tll_close_req()
1738 message_send(tll, mb); in tll_close_req()
1753 tunll_t *tll = arg; in tclvm_backenable() local
1761 if ((tcl->tcl_data_tll == tll || in tclvm_backenable()
1762 tcl->tcl_ctrl_tll == tll) && in tclvm_backenable()
1792 tunll_t *tll = (tunll_t *)tcl; in sppptun_uwsrv() local
1794 if ((tll->tll_flags & (TLLF_CLOSING|TLLF_CLOSE_DONE)) == in sppptun_uwsrv()
1796 tll->tll_error = tll_close_req(tll); in sppptun_uwsrv()
1797 tll->tll_flags |= TLLF_CLOSE_DONE; in sppptun_uwsrv()
1805 tll); in sppptun_uwsrv()
1906 tunll_t *tll = q->q_ptr; in urput_dlpi() local
1920 message_done(tll); in urput_dlpi()
1923 message_done(tll); in urput_dlpi()
1924 tll->tll_error = err; in urput_dlpi()
1925 tll->tll_flags |= TLLF_SHUTDOWN_DONE; in urput_dlpi()
1928 message_done(tll); in urput_dlpi()
1933 message_done(tll); in urput_dlpi()
1934 tll->tll_error = err; in urput_dlpi()
1940 message_done(tll); in urput_dlpi()
1944 message_done(tll); in urput_dlpi()
1955 message_done(tll); in urput_dlpi()
1958 tll->tll_flags |= TLLF_SHUTDOWN_DONE; in urput_dlpi()
1961 message_done(tll); in urput_dlpi()
1972 tunll_t *tll; member
2009 ((!poedat->isdata && tcl->tcl_ctrl_tll == poedat->tll) || in tclvm_pppoe_search()
2010 (poedat->isdata && tcl->tcl_data_tll == poedat->tll)) && in tclvm_pppoe_search()
2073 tunll_t *tll; in sppptun_recv() local
2087 tll = q->q_ptr; in sppptun_recv()
2088 ASSERT(!(tll->tll_flags & TLLF_NOTLOWER)); in sppptun_recv()
2091 switch (tll->tll_style) { in sppptun_recv()
2112 tcl = tll->tll_defcl; in sppptun_recv()
2149 (!isdata && tcl->tcl_ctrl_tll != tll) || in sppptun_recv()
2150 (isdata && tcl->tcl_data_tll != tll) || in sppptun_recv()
2154 tcl = tll->tll_lastcl; in sppptun_recv()
2156 (!isdata && tcl->tcl_ctrl_tll != tll) || in sppptun_recv()
2157 (isdata && tcl->tcl_data_tll != tll) || in sppptun_recv()
2170 poedat.tll = tll; in sppptun_recv()
2178 tll->tll_lastcl = tcl; in sppptun_recv()
2206 if (tcl->tcl_data_tll == tll && isdata) { in sppptun_recv()
2230 if (isdata || tcl->tcl_ctrl_tll != tll || in sppptun_recv()
2231 (mnew = make_control(tcl, tll, PTCA_CONTROL, tcl)) == in sppptun_recv()
2267 tunll_t *tll; in sppptun_urput() local
2270 tll = q->q_ptr; in sppptun_urput()
2271 ASSERT(!(tll->tll_flags & TLLF_NOTLOWER)); in sppptun_urput()
2286 switch (tll->tll_style) { in sppptun_urput()
2322 tll->tll_lcladdr.pta_pppoe.ptma_mac); in sppptun_urput()