Lines Matching refs:tep

1205 tl_refhold(tl_endpt_t *tep)  in tl_refhold()  argument
1207 atomic_inc_32(&tep->te_refcnt); in tl_refhold()
1211 tl_refrele(tl_endpt_t *tep) in tl_refrele() argument
1213 ASSERT(tep->te_refcnt != 0); in tl_refrele()
1215 if (atomic_dec_32_nv(&tep->te_refcnt) == 0) in tl_refrele()
1216 tl_free(tep); in tl_refrele()
1223 tl_endpt_t *tep = buf; in tl_constructor() local
1225 bzero(tep, sizeof (tl_endpt_t)); in tl_constructor()
1226 mutex_init(&tep->te_closelock, NULL, MUTEX_DEFAULT, NULL); in tl_constructor()
1227 cv_init(&tep->te_closecv, NULL, CV_DEFAULT, NULL); in tl_constructor()
1228 mutex_init(&tep->te_srv_lock, NULL, MUTEX_DEFAULT, NULL); in tl_constructor()
1229 cv_init(&tep->te_srv_cv, NULL, CV_DEFAULT, NULL); in tl_constructor()
1230 mutex_init(&tep->te_ser_lock, NULL, MUTEX_DEFAULT, NULL); in tl_constructor()
1239 tl_endpt_t *tep = buf; in tl_destructor() local
1241 mutex_destroy(&tep->te_closelock); in tl_destructor()
1242 cv_destroy(&tep->te_closecv); in tl_destructor()
1243 mutex_destroy(&tep->te_srv_lock); in tl_destructor()
1244 cv_destroy(&tep->te_srv_cv); in tl_destructor()
1245 mutex_destroy(&tep->te_ser_lock); in tl_destructor()
1249 tl_free(tl_endpt_t *tep) in tl_free() argument
1251 ASSERT(tep->te_refcnt == 0); in tl_free()
1252 ASSERT(tep->te_transport != NULL); in tl_free()
1253 ASSERT(tep->te_rq == NULL); in tl_free()
1254 ASSERT(tep->te_wq == NULL); in tl_free()
1255 ASSERT(tep->te_ser != NULL); in tl_free()
1256 ASSERT(tep->te_ser_count == 0); in tl_free()
1257 ASSERT(!(tep->te_flag & TL_ADDRHASHED)); in tl_free()
1259 if (IS_SOCKET(tep)) { in tl_free()
1260 ASSERT(tep->te_alen == TL_SOUX_ADDRLEN); in tl_free()
1261 ASSERT(tep->te_abuf == &tep->te_uxaddr); in tl_free()
1262 ASSERT(tep->te_vp == (void *)(uintptr_t)tep->te_minor); in tl_free()
1263 ASSERT(tep->te_magic == SOU_MAGIC_IMPLICIT); in tl_free()
1264 } else if (tep->te_abuf != NULL) { in tl_free()
1265 kmem_free(tep->te_abuf, tep->te_alen); in tl_free()
1266 tep->te_alen = -1; /* uninitialized */ in tl_free()
1267 tep->te_abuf = NULL; in tl_free()
1269 ASSERT(tep->te_alen == -1); in tl_free()
1272 id_free(tl_minors, tep->te_minor); in tl_free()
1273 ASSERT(tep->te_credp == NULL); in tl_free()
1275 if (tep->te_hash_hndl != NULL) in tl_free()
1276 mod_hash_cancel(tep->te_addrhash, &tep->te_hash_hndl); in tl_free()
1278 if (IS_COTS(tep)) { in tl_free()
1279 TL_REMOVE_PEER(tep->te_conp); in tl_free()
1280 TL_REMOVE_PEER(tep->te_oconp); in tl_free()
1281 tl_serializer_refrele(tep->te_ser); in tl_free()
1282 tep->te_ser = NULL; in tl_free()
1283 ASSERT(tep->te_nicon == 0); in tl_free()
1284 ASSERT(list_head(&tep->te_iconp) == NULL); in tl_free()
1286 ASSERT(tep->te_lastep == NULL); in tl_free()
1287 ASSERT(list_head(&tep->te_flowlist) == NULL); in tl_free()
1288 ASSERT(tep->te_flowq == NULL); in tl_free()
1291 ASSERT(tep->te_bufcid == 0); in tl_free()
1292 ASSERT(tep->te_timoutid == 0); in tl_free()
1293 bzero(&tep->te_ap, sizeof (tep->te_ap)); in tl_free()
1294 tep->te_acceptor_id = 0; in tl_free()
1296 ASSERT(tep->te_closewait == 0); in tl_free()
1297 ASSERT(!tep->te_rsrv_active); in tl_free()
1298 ASSERT(!tep->te_wsrv_active); in tl_free()
1299 tep->te_closing = 0; in tl_free()
1300 tep->te_nowsrv = B_FALSE; in tl_free()
1301 tep->te_flag = 0; in tl_free()
1303 kmem_cache_free(tl_cache, tep); in tl_free()
1350 tl_serializer_enter(tl_endpt_t *tep, tlproc_t tlproc, mblk_t *mp) in tl_serializer_enter() argument
1352 if (IS_COTS(tep)) { in tl_serializer_enter()
1353 mutex_enter(&tep->te_ser_lock); in tl_serializer_enter()
1354 tep->te_ser_count++; in tl_serializer_enter()
1355 mutex_exit(&tep->te_ser_lock); in tl_serializer_enter()
1357 serializer_enter(tep->te_serializer, (srproc_t *)tlproc, mp, tep); in tl_serializer_enter()
1365 tl_serializer_exit(tl_endpt_t *tep) in tl_serializer_exit() argument
1367 if (IS_COTS(tep)) { in tl_serializer_exit()
1368 mutex_enter(&tep->te_ser_lock); in tl_serializer_exit()
1369 ASSERT(tep->te_ser_count != 0); in tl_serializer_exit()
1370 tep->te_ser_count--; in tl_serializer_exit()
1371 mutex_exit(&tep->te_ser_lock); in tl_serializer_exit()
1452 tl_noclose(tl_endpt_t *tep) in tl_noclose() argument
1456 mutex_enter(&tep->te_closelock); in tl_noclose()
1457 if (!tep->te_closing) { in tl_noclose()
1458 ASSERT(tep->te_closewait == 0); in tl_noclose()
1459 tep->te_closewait++; in tl_noclose()
1462 mutex_exit(&tep->te_closelock); in tl_noclose()
1470 tl_closeok(tl_endpt_t *tep) in tl_closeok() argument
1472 ASSERT(tep->te_closewait > 0); in tl_closeok()
1473 mutex_enter(&tep->te_closelock); in tl_closeok()
1474 ASSERT(tep->te_closewait == 1); in tl_closeok()
1475 tep->te_closewait--; in tl_closeok()
1476 cv_signal(&tep->te_closecv); in tl_closeok()
1477 mutex_exit(&tep->te_closelock); in tl_closeok()
1487 tl_endpt_t *tep; in tl_open() local
1517 tep = kmem_cache_alloc(tl_cache, KM_SLEEP); in tl_open()
1518 tep->te_refcnt = 1; in tl_open()
1519 tep->te_cpid = curproc->p_pid; in tl_open()
1520 rq->q_ptr = WR(rq)->q_ptr = tep; in tl_open()
1521 tep->te_state = TS_UNBND; in tl_open()
1522 tep->te_credp = credp; in tl_open()
1524 tep->te_zoneid = getzoneid(); in tl_open()
1526 tep->te_flag = minor & TL_MINOR_MASK; in tl_open()
1527 tep->te_transport = &tl_transports[minor]; in tl_open()
1528 tep->te_minor = (minor_t)inst_minor; in tl_open()
1531 (void) mod_hash_reserve(tep->te_addrhash, &tep->te_hash_hndl); in tl_open()
1534 if (IS_COTS(tep)) { in tl_open()
1536 tep->te_ser = tl_serializer_alloc(KM_SLEEP); in tl_open()
1539 list_create(&tep->te_iconp, sizeof (tl_icon_t), in tl_open()
1541 tep->te_qlen = 0; in tl_open()
1542 tep->te_nicon = 0; in tl_open()
1543 tep->te_oconp = NULL; in tl_open()
1544 tep->te_conp = NULL; in tl_open()
1547 tep->te_ser = tep->te_transport->tr_serializer; in tl_open()
1548 bzero(&tep->te_flows, sizeof (list_node_t)); in tl_open()
1550 list_create(&tep->te_flowlist, sizeof (tl_endpt_t), in tl_open()
1552 tep->te_flowq = NULL; in tl_open()
1553 tep->te_lastep = NULL; in tl_open()
1558 if (IS_SOCKET(tep)) { in tl_open()
1560 tep->te_alen = TL_SOUX_ADDRLEN; in tl_open()
1561 tep->te_abuf = &tep->te_uxaddr; in tl_open()
1562 tep->te_vp = (void *)(uintptr_t)tep->te_minor; in tl_open()
1563 tep->te_magic = SOU_MAGIC_IMPLICIT; in tl_open()
1565 tep->te_alen = -1; in tl_open()
1566 tep->te_abuf = NULL; in tl_open()
1570 *devp = makedevice(getmajor(*devp), tep->te_minor); in tl_open()
1572 tep->te_rq = rq; in tl_open()
1573 tep->te_wq = WR(rq); in tl_open()
1576 if (IS_SOCKET(tep)) in tl_open()
1577 tep->te_acceptor_id = tep->te_minor; in tl_open()
1579 tep->te_acceptor_id = (t_uscalar_t)rq; in tl_open()
1581 tep->te_acceptor_id = tep->te_minor; in tl_open()
1591 (void) mod_hash_insert(tep->te_transport->tr_ai_hash, in tl_open()
1592 (mod_hash_key_t)(uintptr_t)tep->te_acceptor_id, in tl_open()
1593 (mod_hash_val_t)tep); in tl_open()
1602 tl_endpt_t *tep = (tl_endpt_t *)rq->q_ptr; in tl_close() local
1604 queue_t *wq = tep->te_wq; in tl_close()
1612 rc = mod_hash_remove(tep->te_transport->tr_ai_hash, in tl_close()
1613 (mod_hash_key_t)(uintptr_t)tep->te_acceptor_id, in tl_close()
1615 ASSERT(rc == 0 && tep == elp); in tl_close()
1616 if ((rc != 0) || (tep != elp)) { in tl_close()
1617 (void) (STRLOG(TL_ID, tep->te_minor, 1, in tl_close()
1625 mutex_enter(&tep->te_closelock); in tl_close()
1626 while (tep->te_closewait) in tl_close()
1627 cv_wait(&tep->te_closecv, &tep->te_closelock); in tl_close()
1628 tep->te_closing = B_TRUE; in tl_close()
1633 tep->te_closewait = 1; in tl_close()
1634 tep->te_nowsrv = B_FALSE; in tl_close()
1635 mutex_exit(&tep->te_closelock); in tl_close()
1641 tl_serializer_enter(tep, tl_close_ser, &tep->te_closemp); in tl_close()
1646 mutex_enter(&tep->te_closelock); in tl_close()
1647 while (tep->te_closewait) in tl_close()
1648 cv_wait(&tep->te_closecv, &tep->te_closelock); in tl_close()
1649 mutex_exit(&tep->te_closelock); in tl_close()
1653 if (tep->te_bufcid) { in tl_close()
1654 qunbufcall(rq, tep->te_bufcid); in tl_close()
1655 tep->te_bufcid = 0; in tl_close()
1657 if (tep->te_timoutid) { in tl_close()
1658 (void) quntimeout(rq, tep->te_timoutid); in tl_close()
1659 tep->te_timoutid = 0; in tl_close()
1673 ASSERT(tep->te_closewait == 0); in tl_close()
1674 if (IS_COTS(tep)) in tl_close()
1675 tep->te_closewait = 1; in tl_close()
1677 tl_refhold(tep); in tl_close()
1679 tl_serializer_enter(tep, tl_close_finish_ser, &tep->te_closemp); in tl_close()
1685 if (IS_COTS(tep)) { in tl_close()
1686 mutex_enter(&tep->te_closelock); in tl_close()
1687 while (tep->te_closewait) in tl_close()
1688 cv_wait(&tep->te_closecv, &tep->te_closelock); in tl_close()
1689 mutex_exit(&tep->te_closelock); in tl_close()
1692 crfree(tep->te_credp); in tl_close()
1693 tep->te_credp = NULL; in tl_close()
1694 tep->te_wq = NULL; in tl_close()
1695 tl_refrele(tep); in tl_close()
1712 tl_close_ser(mblk_t *mp, tl_endpt_t *tep) in tl_close_ser() argument
1714 ASSERT(tep->te_closing); in tl_close_ser()
1715 ASSERT(tep->te_closewait == 1); in tl_close_ser()
1716 ASSERT(!(tep->te_flag & TL_CLOSE_SER)); in tl_close_ser()
1718 tep->te_flag |= TL_CLOSE_SER; in tl_close_ser()
1724 if (tep->te_wq->q_first && (IS_CLTS(tep) || IS_COTSORD(tep))) { in tl_close_ser()
1725 tl_wsrv_ser(NULL, tep); in tl_close_ser()
1729 tl_addr_unbind(tep); in tl_close_ser()
1735 if (IS_COTS(tep) && !IS_SOCKET(tep)) { in tl_close_ser()
1736 tl_endpt_t *peer_tep = tep->te_conp; in tl_close_ser()
1738 tep->te_wq->q_next = NULL; in tl_close_ser()
1743 tep->te_rq = NULL; in tl_close_ser()
1746 tl_closeok(tep); in tl_close_ser()
1747 tl_serializer_exit(tep); in tl_close_ser()
1758 tl_close_finish_ser(mblk_t *mp, tl_endpt_t *tep) in tl_close_finish_ser() argument
1760 ASSERT(tep->te_closing); in tl_close_finish_ser()
1761 IMPLY(IS_CLTS(tep), tep->te_closewait == 0); in tl_close_finish_ser()
1762 IMPLY(IS_COTS(tep), tep->te_closewait == 1); in tl_close_finish_ser()
1764 tep->te_state = -1; /* Uninitialized */ in tl_close_finish_ser()
1765 if (IS_COTS(tep)) { in tl_close_finish_ser()
1766 tl_co_unconnect(tep); in tl_close_finish_ser()
1769 TL_REMOVE_PEER(tep->te_lastep); in tl_close_finish_ser()
1774 tl_cl_backenable(tep); in tl_close_finish_ser()
1775 if (tep->te_flowq != NULL) { in tl_close_finish_ser()
1776 list_remove(&(tep->te_flowq->te_flowlist), tep); in tl_close_finish_ser()
1777 tep->te_flowq = NULL; in tl_close_finish_ser()
1781 tl_serializer_exit(tep); in tl_close_finish_ser()
1782 if (IS_COTS(tep)) in tl_close_finish_ser()
1783 tl_closeok(tep); in tl_close_finish_ser()
1785 tl_refrele(tep); in tl_close_finish_ser()
1797 tl_endpt_t *tep = (tl_endpt_t *)wq->q_ptr; in tl_wput() local
1805 if (IS_CLTS(tep)) { in tl_wput()
1806 (void) (STRLOG(TL_ID, tep->te_minor, 1, in tl_wput()
1850 (void) (STRLOG(TL_ID, tep->te_minor, 1, in tl_wput()
1877 if (IS_CLTS(tep)) { in tl_wput()
1890 if (IS_COTS(tep) || in tl_wput()
1895 if ((tep->te_state == TS_IDLE) && !wq->q_first) { in tl_wput()
1921 (void) (STRLOG(TL_ID, tep->te_minor, 1, in tl_wput()
1929 tl_capability_req(mp, tep); in tl_wput()
1939 (void) (STRLOG(TL_ID, tep->te_minor, 1, in tl_wput()
1947 (void) (STRLOG(TL_ID, tep->te_minor, 1, SL_TRACE | SL_ERROR, in tl_wput()
1957 tl_refhold(tep); in tl_wput()
1958 tl_serializer_enter(tep, tl_proc, mp); in tl_wput()
1966 tl_putq_ser(mblk_t *mp, tl_endpt_t *tep) in tl_putq_ser() argument
1968 if (tep->te_closing) { in tl_putq_ser()
1969 tl_wput_ser(mp, tep); in tl_putq_ser()
1971 TL_PUTQ(tep, mp); in tl_putq_ser()
1972 tl_serializer_exit(tep); in tl_putq_ser()
1973 tl_refrele(tep); in tl_putq_ser()
1979 tl_wput_common_ser(mblk_t *mp, tl_endpt_t *tep) in tl_wput_common_ser() argument
1985 tl_data(mp, tep); in tl_wput_common_ser()
1988 tl_do_proto(mp, tep); in tl_wput_common_ser()
2000 tl_wput_ser(mblk_t *mp, tl_endpt_t *tep) in tl_wput_ser() argument
2002 tl_wput_common_ser(mp, tep); in tl_wput_ser()
2003 tl_serializer_exit(tep); in tl_wput_ser()
2004 tl_refrele(tep); in tl_wput_ser()
2011 tl_wput_data_ser(mblk_t *mp, tl_endpt_t *tep) in tl_wput_data_ser() argument
2013 tl_endpt_t *peer_tep = tep->te_conp; in tl_wput_data_ser()
2017 ASSERT(IS_COTS(tep)); in tl_wput_data_ser()
2019 IMPLY(peer_tep, tep->te_serializer == peer_tep->te_serializer); in tl_wput_data_ser()
2026 ((tep->te_state == TS_DATA_XFER) || in tl_wput_data_ser()
2027 (tep->te_state == TS_WREQ_ORDREL)) && in tl_wput_data_ser()
2028 (tep->te_wq != NULL) && in tl_wput_data_ser()
2029 (tep->te_wq->q_first == NULL) && in tl_wput_data_ser()
2034 (canputnext(peer_rq) || tep->te_closing)) { in tl_wput_data_ser()
2036 } else if (tep->te_closing) { in tl_wput_data_ser()
2043 if ((tep->te_wq != NULL) && in tl_wput_data_ser()
2044 ((tep->te_state == TS_DATA_XFER) || in tl_wput_data_ser()
2045 (tep->te_state == TS_WREQ_ORDREL))) { in tl_wput_data_ser()
2046 TL_PUTQ(tep, mp); in tl_wput_data_ser()
2051 TL_PUTQ(tep, mp); in tl_wput_data_ser()
2054 tl_serializer_exit(tep); in tl_wput_data_ser()
2055 tl_refrele(tep); in tl_wput_data_ser()
2069 tl_endpt_t *tep = (tl_endpt_t *)wq->q_ptr; in tl_wsrv() local
2071 while ((wq->q_first != NULL) && !tep->te_nowsrv) { in tl_wsrv()
2072 mutex_enter(&tep->te_srv_lock); in tl_wsrv()
2073 ASSERT(tep->te_wsrv_active == B_FALSE); in tl_wsrv()
2074 tep->te_wsrv_active = B_TRUE; in tl_wsrv()
2075 mutex_exit(&tep->te_srv_lock); in tl_wsrv()
2077 tl_serializer_enter(tep, tl_wsrv_ser, &tep->te_wsrvmp); in tl_wsrv()
2082 mutex_enter(&tep->te_srv_lock); in tl_wsrv()
2083 while (tep->te_wsrv_active) { in tl_wsrv()
2084 cv_wait(&tep->te_srv_cv, &tep->te_srv_lock); in tl_wsrv()
2086 cv_signal(&tep->te_srv_cv); in tl_wsrv()
2087 mutex_exit(&tep->te_srv_lock); in tl_wsrv()
2098 tl_wsrv_ser(mblk_t *ser_mp, tl_endpt_t *tep) in tl_wsrv_ser() argument
2101 queue_t *wq = tep->te_wq; in tl_wsrv_ser()
2104 while (!tep->te_nowsrv && (mp = getq(wq)) != NULL) { in tl_wsrv_ser()
2105 tl_wput_common_ser(mp, tep); in tl_wsrv_ser()
2121 mutex_enter(&tep->te_srv_lock); in tl_wsrv_ser()
2122 ASSERT(tep->te_wsrv_active); in tl_wsrv_ser()
2123 tep->te_wsrv_active = B_FALSE; in tl_wsrv_ser()
2124 cv_signal(&tep->te_srv_cv); in tl_wsrv_ser()
2125 mutex_exit(&tep->te_srv_lock); in tl_wsrv_ser()
2126 tl_serializer_exit(tep); in tl_wsrv_ser()
2141 tl_endpt_t *tep = (tl_endpt_t *)rq->q_ptr; in tl_rsrv() local
2144 ASSERT(tep->te_rsrv_active == 0); in tl_rsrv()
2146 tep->te_rsrv_active = B_TRUE; in tl_rsrv()
2147 tl_serializer_enter(tep, tl_rsrv_ser, &tep->te_rsrvmp); in tl_rsrv()
2151 mutex_enter(&tep->te_srv_lock); in tl_rsrv()
2152 while (tep->te_rsrv_active) { in tl_rsrv()
2153 cv_wait(&tep->te_srv_cv, &tep->te_srv_lock); in tl_rsrv()
2155 cv_signal(&tep->te_srv_cv); in tl_rsrv()
2156 mutex_exit(&tep->te_srv_lock); in tl_rsrv()
2162 tl_rsrv_ser(mblk_t *mp, tl_endpt_t *tep) in tl_rsrv_ser() argument
2166 if (IS_CLTS(tep) && tep->te_state == TS_IDLE) { in tl_rsrv_ser()
2167 tl_cl_backenable(tep); in tl_rsrv_ser()
2169 IS_COTS(tep) && in tl_rsrv_ser()
2170 ((peer_tep = tep->te_conp) != NULL) && in tl_rsrv_ser()
2172 ((tep->te_state == TS_DATA_XFER) || in tl_rsrv_ser()
2173 (tep->te_state == TS_WIND_ORDREL)|| in tl_rsrv_ser()
2174 (tep->te_state == TS_WREQ_ORDREL))) { in tl_rsrv_ser()
2181 mutex_enter(&tep->te_srv_lock); in tl_rsrv_ser()
2182 ASSERT(tep->te_rsrv_active); in tl_rsrv_ser()
2183 tep->te_rsrv_active = B_FALSE; in tl_rsrv_ser()
2184 cv_signal(&tep->te_srv_cv); in tl_rsrv_ser()
2185 mutex_exit(&tep->te_srv_lock); in tl_rsrv_ser()
2186 tl_serializer_exit(tep); in tl_rsrv_ser()
2193 tl_do_proto(mblk_t *mp, tl_endpt_t *tep) in tl_do_proto() argument
2203 tl_unbind(mp, tep); in tl_do_proto()
2207 tl_addr_req(mp, tep); in tl_do_proto()
2212 if (IS_CLTS(tep)) { in tl_do_proto()
2213 tl_merror(tep->te_wq, mp, EPROTO); in tl_do_proto()
2216 tl_conn_res(mp, tep); in tl_do_proto()
2220 if (IS_CLTS(tep)) { in tl_do_proto()
2221 tl_merror(tep->te_wq, mp, EPROTO); in tl_do_proto()
2224 tl_discon_req(mp, tep); in tl_do_proto()
2228 if (IS_CLTS(tep)) { in tl_do_proto()
2229 tl_merror(tep->te_wq, mp, EPROTO); in tl_do_proto()
2232 tl_data(mp, tep); in tl_do_proto()
2236 if (IS_CLTS(tep)) { in tl_do_proto()
2237 tl_merror(tep->te_wq, mp, EPROTO); in tl_do_proto()
2240 tl_data(mp, tep); in tl_do_proto()
2244 if (IS_CLTS(tep)) { in tl_do_proto()
2245 tl_merror(tep->te_wq, mp, EPROTO); in tl_do_proto()
2248 tl_exdata(mp, tep); in tl_do_proto()
2252 if (!IS_COTSORD(tep)) { in tl_do_proto()
2253 tl_merror(tep->te_wq, mp, EPROTO); in tl_do_proto()
2256 tl_ordrel(mp, tep); in tl_do_proto()
2260 if (IS_COTS(tep)) { in tl_do_proto()
2261 tl_merror(tep->te_wq, mp, EPROTO); in tl_do_proto()
2264 tl_unitdata(mp, tep); in tl_do_proto()
2268 tl_merror(tep->te_wq, mp, EPROTO); in tl_do_proto()
2278 tl_do_ioctl_ser(mblk_t *mp, tl_endpt_t *tep) in tl_do_ioctl_ser() argument
2280 if (!tep->te_closing) in tl_do_ioctl_ser()
2281 tl_do_ioctl(mp, tep); in tl_do_ioctl_ser()
2285 tl_serializer_exit(tep); in tl_do_ioctl_ser()
2286 tl_refrele(tep); in tl_do_ioctl_ser()
2290 tl_do_ioctl(mblk_t *mp, tl_endpt_t *tep) in tl_do_ioctl() argument
2294 queue_t *wq = tep->te_wq; in tl_do_ioctl()
2315 if (IS_SOCKET(tep) || (tep->te_flag & otheropt)) { in tl_do_ioctl()
2335 tep->te_flag |= thisopt; in tl_do_ioctl()
2337 tep->te_flag &= ~thisopt; in tl_do_ioctl()
2411 tl_bind_ser(mblk_t *mp, tl_endpt_t *tep) in tl_bind_ser() argument
2413 if (!tep->te_closing) in tl_bind_ser()
2414 tl_bind(mp, tep); in tl_bind_ser()
2418 tl_serializer_exit(tep); in tl_bind_ser()
2419 tl_refrele(tep); in tl_bind_ser()
2427 tl_bind(mblk_t *mp, tl_endpt_t *tep) in tl_bind() argument
2429 queue_t *wq = tep->te_wq; in tl_bind()
2441 t_scalar_t save_state = tep->te_state; in tl_bind()
2443 if (tep->te_state != TS_UNBND) { in tl_bind()
2444 (void) (STRLOG(TL_ID, tep->te_minor, 1, in tl_bind()
2447 tep->te_state)); in tl_bind()
2458 tep->te_state = nextstate[TE_BIND_REQ][tep->te_state]; in tl_bind()
2467 if (IS_COTS(tep)) { in tl_bind()
2477 if ((tep->te_hash_hndl == NULL) && in tl_bind()
2478 ((tep->te_flag & TL_ADDRHASHED) == 0) && in tl_bind()
2479 mod_hash_reserve_nosleep(tep->te_addrhash, in tl_bind()
2480 &tep->te_hash_hndl) != 0) { in tl_bind()
2489 if (IS_SOCKET(tep)) { in tl_bind()
2495 (void) (STRLOG(TL_ID, tep->te_minor, in tl_bind()
2498 tep->te_state = nextstate[TE_ERROR_ACK][tep->te_state]; in tl_bind()
2510 (void) (STRLOG(TL_ID, tep->te_minor, in tl_bind()
2513 tep->te_state = nextstate[TE_ERROR_ACK][tep->te_state]; in tl_bind()
2520 (void) (STRLOG(TL_ID, tep->te_minor, in tl_bind()
2523 tep->te_state = nextstate[TE_ERROR_ACK][tep->te_state]; in tl_bind()
2530 (void) (STRLOG(TL_ID, tep->te_minor, in tl_bind()
2533 tep->te_state = nextstate[TE_ERROR_ACK][tep->te_state]; in tl_bind()
2542 (void) (STRLOG(TL_ID, tep->te_minor, in tl_bind()
2545 tep->te_state = nextstate[TE_ERROR_ACK][tep->te_state]; in tl_bind()
2551 (void) (STRLOG(TL_ID, tep->te_minor, in tl_bind()
2554 tep->te_state = nextstate[TE_ERROR_ACK][tep->te_state]; in tl_bind()
2566 (void) (STRLOG(TL_ID, tep->te_minor, in tl_bind()
2577 if (IS_SOCKET(tep)) { in tl_bind()
2587 if (tep->te_flag & TL_ADDRHASHED) { in tl_bind()
2588 ASSERT(IS_COTS(tep) && tep->te_qlen == 0); in tl_bind()
2589 if (tep->te_vp == ux_addr.soua_vp) in tl_bind()
2592 tl_addr_unbind(tep); in tl_bind()
2599 rc = mod_hash_insert_reserve(tep->te_addrhash, in tl_bind()
2601 (mod_hash_val_t)tep, tep->te_hash_hndl); in tl_bind()
2610 (void) (STRLOG(TL_ID, tep->te_minor, 1, in tl_bind()
2618 tep->te_uxaddr = ux_addr; in tl_bind()
2619 tep->te_flag |= TL_ADDRHASHED; in tl_bind()
2620 tep->te_hash_hndl = NULL; in tl_bind()
2626 if (!tl_get_any_addr(tep, NULL)) { in tl_bind()
2627 (void) (STRLOG(TL_ID, tep->te_minor, in tl_bind()
2638 addr_req.ta_zoneid = tep->te_zoneid; in tl_bind()
2640 tep->te_abuf = kmem_zalloc((size_t)alen, KM_NOSLEEP); in tl_bind()
2641 if (tep->te_abuf == NULL) { in tl_bind()
2646 bcopy(addr_req.ta_abuf, tep->te_abuf, addr_req.ta_alen); in tl_bind()
2647 tep->te_alen = alen; in tl_bind()
2649 if (mod_hash_insert_reserve(tep->te_addrhash, in tl_bind()
2650 (mod_hash_key_t)&tep->te_ap, (mod_hash_val_t)tep, in tl_bind()
2651 tep->te_hash_hndl) != 0) { in tl_bind()
2658 (void) (STRLOG(TL_ID, tep->te_minor, 1, in tl_bind()
2670 if (!tl_get_any_addr(tep, &addr_req)) { in tl_bind()
2671 (void) (STRLOG(TL_ID, tep->te_minor, 1, in tl_bind()
2679 tep->te_flag |= TL_ADDRHASHED; in tl_bind()
2680 tep->te_hash_hndl = NULL; in tl_bind()
2684 ASSERT(tep->te_alen >= 0); in tl_bind()
2690 basize = sizeof (struct T_bind_ack) + tep->te_alen; in tl_bind()
2693 (void) (STRLOG(TL_ID, tep->te_minor, 1, SL_TRACE | SL_ERROR, in tl_bind()
2698 tl_addr_unbind(tep); in tl_bind()
2699 tep->te_state = TS_UNBND; in tl_bind()
2709 b_ack->ADDR_length = tep->te_alen; in tl_bind()
2712 bcopy(tep->te_abuf, addr_startp, tep->te_alen); in tl_bind()
2714 if (IS_COTS(tep)) { in tl_bind()
2715 tep->te_qlen = qlen; in tl_bind()
2717 tep->te_flag |= TL_LISTENER; in tl_bind()
2720 tep->te_state = nextstate[TE_BIND_ACK][tep->te_state]; in tl_bind()
2733 tep->te_state = save_state; in tl_bind()
2737 tep->te_state = nextstate[TE_ERROR_ACK][tep->te_state]; in tl_bind()
2746 tl_unbind(mblk_t *mp, tl_endpt_t *tep) in tl_unbind() argument
2751 if (tep->te_closing) { in tl_unbind()
2756 wq = tep->te_wq; in tl_unbind()
2775 if (tep->te_state != TS_IDLE) { in tl_unbind()
2776 (void) (STRLOG(TL_ID, tep->te_minor, 1, in tl_unbind()
2779 tep->te_state)); in tl_unbind()
2783 tep->te_state = nextstate[TE_UNBIND_REQ][tep->te_state]; in tl_unbind()
2792 if (!IS_SOCKET(tep) || !IS_CLTS(tep) || tep->te_qlen != 0 || in tl_unbind()
2793 tep->te_magic != SOU_MAGIC_EXPLICIT) { in tl_unbind()
2800 tl_addr_unbind(tep); in tl_unbind()
2803 tep->te_state = nextstate[TE_OK_ACK1][tep->te_state]; in tl_unbind()
2825 tl_endpt_t *tep; in tl_optmgmt() local
2830 tep = (tl_endpt_t *)wq->q_ptr; in tl_optmgmt()
2848 if (!IS_SOCKET(tep) && tep->te_state != TS_IDLE && in tl_optmgmt()
2855 (void) (STRLOG(TL_ID, tep->te_minor, 1, in tl_optmgmt()
2858 tep->te_state)); in tl_optmgmt()
2894 tl_endpt_t *tep = (tl_endpt_t *)wq->q_ptr; in tl_conn_req() local
2905 ASSERT(IS_COTS(tep)); in tl_conn_req()
2907 if (tep->te_closing) { in tl_conn_req()
2928 if (tep->te_state != TS_IDLE) { in tl_conn_req()
2929 (void) (STRLOG(TL_ID, tep->te_minor, 1, in tl_conn_req()
2932 tep->te_state)); in tl_conn_req()
2944 (void) (STRLOG(TL_ID, tep->te_minor, 1, SL_TRACE | SL_ERROR, in tl_conn_req()
2957 if (IS_SOCKET(tep)) { in tl_conn_req()
2962 (void) (STRLOG(TL_ID, tep->te_minor, in tl_conn_req()
2972 (void) (STRLOG(TL_ID, tep->te_minor, in tl_conn_req()
2984 (void) (STRLOG(TL_ID, tep->te_minor, 1, in tl_conn_req()
2994 (void) (STRLOG(TL_ID, tep->te_minor, 1, in tl_conn_req()
3010 (void) (STRLOG(TL_ID, tep->te_minor, 3, in tl_conn_req()
3020 (void) (STRLOG(TL_ID, tep->te_minor, 1, in tl_conn_req()
3033 if (!tl_noclose(tep)) { in tl_conn_req()
3034 (void) (STRLOG(TL_ID, tep->te_minor, 1, SL_TRACE | SL_ERROR, in tl_conn_req()
3041 tep->te_state = nextstate[TE_CONN_REQ][tep->te_state]; in tl_conn_req()
3049 dst.ta_zoneid = tep->te_zoneid; in tl_conn_req()
3054 peer_tep = (IS_SOCKET(tep) ? in tl_conn_req()
3055 tl_sock_find_peer(tep, &ux_addr) : in tl_conn_req()
3056 tl_find_peer(tep, &dst)); in tl_conn_req()
3059 (void) (STRLOG(TL_ID, tep->te_minor, 1, SL_TRACE | SL_ERROR, in tl_conn_req()
3067 (void) (STRLOG(TL_ID, tep->te_minor, 2, SL_TRACE, in tl_conn_req()
3079 tep->te_state = nextstate[TE_OK_ACK1][tep->te_state]; in tl_conn_req()
3080 tl_ok_ack(tep->te_wq, ackmp, T_CONN_REQ); in tl_conn_req()
3081 tl_closeok(tep); in tl_conn_req()
3092 tep->te_state = TS_IDLE; in tl_conn_req()
3096 putnext(tep->te_rq, dimp); in tl_conn_req()
3108 tl_serializer_refrele(tep->te_ser); in tl_conn_req()
3109 tep->te_ser = peer_tep->te_ser; in tl_conn_req()
3110 ASSERT(tep->te_oconp == NULL); in tl_conn_req()
3111 tep->te_oconp = peer_tep; in tl_conn_req()
3116 tl_closeok(tep); in tl_conn_req()
3125 tl_refhold(tep); in tl_conn_req()
3126 tl_serializer_enter(tep, tl_conn_req_ser, mp); in tl_conn_req()
3133 tl_conn_req_ser(mblk_t *mp, tl_endpt_t *tep) in tl_conn_req_ser() argument
3136 tl_endpt_t *peer_tep = tep->te_oconp; in tl_conn_req_ser()
3151 if (tep->te_closing) { in tl_conn_req_ser()
3152 TL_UNCONNECT(tep->te_oconp); in tl_conn_req_ser()
3153 tl_serializer_exit(tep); in tl_conn_req_ser()
3154 tl_refrele(tep); in tl_conn_req_ser()
3159 wq = tep->te_wq; in tl_conn_req_ser()
3160 tep->te_flag |= TL_EAGER; in tl_conn_req_ser()
3174 (void) (STRLOG(TL_ID, tep->te_minor, 2, SL_TRACE | SL_ERROR, in tl_conn_req_ser()
3177 TL_UNCONNECT(tep->te_oconp); in tl_conn_req_ser()
3180 tl_serializer_exit(tep); in tl_conn_req_ser()
3181 tl_refrele(tep); in tl_conn_req_ser()
3206 ci_msz = sizeof (struct T_conn_ind) + tep->te_alen; in tl_conn_req_ser()
3219 tep->te_state = TS_IDLE; in tl_conn_req_ser()
3222 TL_UNCONNECT(tep->te_oconp); in tl_conn_req_ser()
3223 tl_serializer_exit(tep); in tl_conn_req_ser()
3224 tl_refrele(tep); in tl_conn_req_ser()
3231 if (IS_SOCKET(tep) && !tl_disable_early_connect) { in tl_conn_req_ser()
3243 tep->te_state = TS_IDLE; in tl_conn_req_ser()
3248 TL_UNCONNECT(tep->te_oconp); in tl_conn_req_ser()
3249 tl_serializer_exit(tep); in tl_conn_req_ser()
3250 tl_refrele(tep); in tl_conn_req_ser()
3262 tep->te_state = TS_IDLE; in tl_conn_req_ser()
3268 TL_UNCONNECT(tep->te_oconp); in tl_conn_req_ser()
3269 tl_serializer_exit(tep); in tl_conn_req_ser()
3270 tl_refrele(tep); in tl_conn_req_ser()
3279 tep->te_state = TS_IDLE; in tl_conn_req_ser()
3285 TL_UNCONNECT(tep->te_oconp); in tl_conn_req_ser()
3286 tl_serializer_exit(tep); in tl_conn_req_ser()
3287 tl_refrele(tep); in tl_conn_req_ser()
3300 tep->te_state = nextstate[TE_OK_ACK1][tep->te_state]; in tl_conn_req_ser()
3318 (void) (STRLOG(TL_ID, tep->te_minor, 3, SL_TRACE | SL_ERROR, in tl_conn_req_ser()
3321 TL_UNCONNECT(tep->te_oconp); in tl_conn_req_ser()
3322 tl_serializer_exit(tep); in tl_conn_req_ser()
3323 tl_refrele(tep); in tl_conn_req_ser()
3336 ci->SRC_length = tep->te_alen; in tl_conn_req_ser()
3337 ci->SEQ_number = tep->te_seqno; in tl_conn_req_ser()
3340 bcopy(tep->te_abuf, addr_startp, tep->te_alen); in tl_conn_req_ser()
3369 tip->ti_tep = tep; in tl_conn_req_ser()
3370 tip->ti_seqno = tep->te_seqno; in tl_conn_req_ser()
3385 tep->te_state = nextstate[TE_CONN_CON][tep->te_state]; in tl_conn_req_ser()
3387 putnext(tep->te_rq, confmp); in tl_conn_req_ser()
3395 ASSERT(tep->te_refcnt >= 2); in tl_conn_req_ser()
3397 tl_serializer_exit(tep); in tl_conn_req_ser()
3413 tl_conn_res(mblk_t *mp, tl_endpt_t *tep) in tl_conn_res() argument
3431 ASSERT(IS_COTS(tep)); in tl_conn_res()
3433 if (tep->te_closing) { in tl_conn_res()
3438 wq = tep->te_wq; in tl_conn_res()
3462 if (tep->te_state != TS_WRES_CIND) { in tl_conn_res()
3463 (void) (STRLOG(TL_ID, tep->te_minor, 1, in tl_conn_res()
3466 tep->te_state)); in tl_conn_res()
3478 (void) (STRLOG(TL_ID, tep->te_minor, 1, SL_TRACE | SL_ERROR, in tl_conn_res()
3487 (void) (STRLOG(TL_ID, tep->te_minor, 1, SL_TRACE | SL_ERROR, in tl_conn_res()
3498 (void) (STRLOG(TL_ID, tep->te_minor, 1, SL_TRACE | SL_ERROR, in tl_conn_res()
3505 tep->te_state = nextstate[TE_CONN_RES][tep->te_state]; in tl_conn_res()
3506 ASSERT(tep->te_state == TS_WACK_CRES); in tl_conn_res()
3510 (void) (STRLOG(TL_ID, tep->te_minor, 2, SL_TRACE | SL_ERROR, in tl_conn_res()
3512 tep->te_state = nextstate[TE_ERROR_ACK][tep->te_state]; in tl_conn_res()
3521 if (mod_hash_find_cb(tep->te_transport->tr_ai_hash, in tl_conn_res()
3524 (void) (STRLOG(TL_ID, tep->te_minor, 2, SL_TRACE | SL_ERROR, in tl_conn_res()
3526 tep->te_state = nextstate[TE_ERROR_ACK][tep->te_state]; in tl_conn_res()
3536 (void) (STRLOG(TL_ID, tep->te_minor, 2, SL_TRACE | SL_ERROR, in tl_conn_res()
3538 tep->te_state = nextstate[TE_ERROR_ACK][tep->te_state]; in tl_conn_res()
3552 if ((tep != acc_ep) && (acc_ep->te_state != TS_IDLE)) { in tl_conn_res()
3553 (void) (STRLOG(TL_ID, tep->te_minor, 2, SL_TRACE | SL_ERROR, in tl_conn_res()
3556 tep->te_state = nextstate[TE_ERROR_ACK][tep->te_state]; in tl_conn_res()
3569 if ((tep == acc_ep) && (tep->te_nicon > 1)) { in tl_conn_res()
3570 (void) (STRLOG(TL_ID, tep->te_minor, 3, SL_TRACE | SL_ERROR, in tl_conn_res()
3572 tep->te_state = nextstate[TE_ERROR_ACK][tep->te_state]; in tl_conn_res()
3586 tip = tl_icon_find(tep, cres->SEQ_number); in tl_conn_res()
3588 (void) (STRLOG(TL_ID, tep->te_minor, 2, SL_TRACE | SL_ERROR, in tl_conn_res()
3590 tep->te_state = nextstate[TE_ERROR_ACK][tep->te_state]; in tl_conn_res()
3661 (void) (STRLOG(TL_ID, tep->te_minor, 2, SL_TRACE, in tl_conn_res()
3691 tep->te_state = TS_WRES_CIND; in tl_conn_res()
3706 if (tep->te_nicon == 1) { in tl_conn_res()
3707 if (tep == acc_ep) in tl_conn_res()
3708 tep->te_state = nextstate[TE_OK_ACK2][tep->te_state]; in tl_conn_res()
3710 tep->te_state = nextstate[TE_OK_ACK3][tep->te_state]; in tl_conn_res()
3712 tep->te_state = nextstate[TE_OK_ACK4][tep->te_state]; in tl_conn_res()
3727 (void) (STRLOG(TL_ID, tep->te_minor, 3, in tl_conn_res()
3749 tep->te_state = TS_IDLE; in tl_conn_res()
3764 if (tep != acc_ep) in tl_conn_res()
3779 tl_freetip(tep, tip); in tl_conn_res()
3807 (void) (STRLOG(TL_ID, tep->te_minor, 3, in tl_conn_res()
3862 ASSERT(cl_ep->te_ser == tep->te_ser); in tl_conn_res()
3897 tl_freetip(tep, tip); in tl_conn_res()
3907 if (!IS_SOCKET(tep)) { in tl_conn_res()
3946 tl_discon_req(mblk_t *mp, tl_endpt_t *tep) in tl_discon_req() argument
3951 tl_endpt_t *peer_tep = tep->te_conp; in tl_discon_req()
3952 tl_endpt_t *srv_tep = tep->te_oconp; in tl_discon_req()
3959 if (tep->te_closing) { in tl_discon_req()
3965 TL_UNCONNECT(tep->te_conp); in tl_discon_req()
3969 TL_UNCONNECT(tep->te_oconp); in tl_discon_req()
3973 wq = tep->te_wq; in tl_discon_req()
3997 save_state = new_state = tep->te_state; in tl_discon_req()
4000 (void) (STRLOG(TL_ID, tep->te_minor, 1, in tl_discon_req()
4003 tep->te_state)); in tl_discon_req()
4012 new_state = nextstate[TE_DISCON_REQ][tep->te_state]; in tl_discon_req()
4016 (void) (STRLOG(TL_ID, tep->te_minor, 1, SL_TRACE | SL_ERROR, in tl_discon_req()
4018 tep->te_state = nextstate[TE_ERROR_ACK][new_state]; in tl_discon_req()
4028 if (tep->te_nicon > 0) { /* server */ in tl_discon_req()
4033 tip = tl_icon_find(tep, dr->SEQ_number); in tl_discon_req()
4035 (void) (STRLOG(TL_ID, tep->te_minor, 2, in tl_discon_req()
4038 tep->te_state = nextstate[TE_ERROR_ACK][new_state]; in tl_discon_req()
4067 if (tep->te_nicon == 0) { in tl_discon_req()
4070 if (tep->te_nicon == 1) in tl_discon_req()
4079 if ((tep->te_nicon <= 1) && in tl_discon_req()
4091 if (tep->te_nicon > 0) { /* listener */ in tl_discon_req()
4097 (void) (STRLOG(TL_ID, tep->te_minor, 2, in tl_discon_req()
4100 tep->te_state = new_state; in tl_discon_req()
4121 tl_freetip(tep, tip); in tl_discon_req()
4122 } else if ((peer_tep = tep->te_oconp) != NULL) { /* client */ in tl_discon_req()
4128 (void) (STRLOG(TL_ID, tep->te_minor, 2, in tl_discon_req()
4131 tep->te_state = new_state; in tl_discon_req()
4139 di->SEQ_number = tep->te_seqno; in tl_discon_req()
4148 if (IS_SOCKET(tep) && !tl_disable_early_connect) { in tl_discon_req()
4155 tl_icon_queuemsg(peer_tep, tep->te_seqno, dimp); in tl_discon_req()
4164 new_state = tep->te_state; in tl_discon_req()
4167 tip = tl_icon_find(peer_tep, tep->te_seqno); in tl_discon_req()
4169 ASSERT(tep == tip->ti_tep); in tl_discon_req()
4181 ASSERT(tep->te_oconp != NULL); in tl_discon_req()
4182 TL_UNCONNECT(tep->te_oconp); in tl_discon_req()
4184 } else if ((peer_tep = tep->te_conp) != NULL) { /* connected! */ in tl_discon_req()
4186 (void) (STRLOG(TL_ID, tep->te_minor, 2, in tl_discon_req()
4189 tep->te_state = new_state; in tl_discon_req()
4200 tep->te_state = new_state; in tl_discon_req()
4206 tep->te_state = new_state; in tl_discon_req()
4235 if (tep->te_conp) { /* disconnect pointers if connected */ in tl_discon_req()
4251 if (!IS_SOCKET(tep)) { in tl_discon_req()
4255 tep->te_wq->q_next = NULL; in tl_discon_req()
4258 TL_UNCONNECT(tep->te_conp); in tl_discon_req()
4263 tl_addr_req_ser(mblk_t *mp, tl_endpt_t *tep) in tl_addr_req_ser() argument
4265 if (!tep->te_closing) in tl_addr_req_ser()
4266 tl_addr_req(mp, tep); in tl_addr_req_ser()
4270 tl_serializer_exit(tep); in tl_addr_req_ser()
4271 tl_refrele(tep); in tl_addr_req_ser()
4275 tl_addr_req(mblk_t *mp, tl_endpt_t *tep) in tl_addr_req() argument
4282 if (tep->te_closing) { in tl_addr_req()
4287 wq = tep->te_wq; in tl_addr_req()
4294 if (IS_CLTS(tep) || in tl_addr_req()
4295 (tep->te_state > TS_WREQ_ORDREL) || in tl_addr_req()
4296 (tep->te_state < TS_DATA_XFER)) { in tl_addr_req()
4302 if (tep->te_state >= TS_IDLE) in tl_addr_req()
4304 ack_sz += tep->te_alen; in tl_addr_req()
4307 (void) (STRLOG(TL_ID, tep->te_minor, 1, in tl_addr_req()
4322 if (tep->te_state >= TS_IDLE) { in tl_addr_req()
4324 taa->LOCADDR_length = tep->te_alen; in tl_addr_req()
4327 bcopy(tep->te_abuf, ackmp->b_wptr, in tl_addr_req()
4328 tep->te_alen); in tl_addr_req()
4329 ackmp->b_wptr += tep->te_alen; in tl_addr_req()
4335 ASSERT(tep->te_state == TS_DATA_XFER || in tl_addr_req()
4336 tep->te_state == TS_WIND_ORDREL || in tl_addr_req()
4337 tep->te_state == TS_WREQ_ORDREL); in tl_addr_req()
4339 tl_connected_cots_addr_req(mp, tep); in tl_addr_req()
4345 tl_connected_cots_addr_req(mblk_t *mp, tl_endpt_t *tep) in tl_connected_cots_addr_req() argument
4347 tl_endpt_t *peer_tep = tep->te_conp; in tl_connected_cots_addr_req()
4353 if (tep->te_closing) { in tl_connected_cots_addr_req()
4359 tl_error_ack(tep->te_wq, mp, TSYSERR, ECONNRESET, T_ADDR_REQ); in tl_connected_cots_addr_req()
4363 ASSERT(tep->te_state >= TS_IDLE); in tl_connected_cots_addr_req()
4366 ack_sz += T_ALIGN(tep->te_alen); in tl_connected_cots_addr_req()
4371 (void) (STRLOG(TL_ID, tep->te_minor, 1, SL_TRACE | SL_ERROR, in tl_connected_cots_addr_req()
4373 tl_memrecover(tep->te_wq, mp, ack_sz); in tl_connected_cots_addr_req()
4380 taa->LOCADDR_length = tep->te_alen; in tl_connected_cots_addr_req()
4385 bcopy(tep->te_abuf, addr_startp, in tl_connected_cots_addr_req()
4386 tep->te_alen); in tl_connected_cots_addr_req()
4398 putnext(tep->te_rq, ackmp); in tl_connected_cots_addr_req()
4402 tl_copy_info(struct T_info_ack *ia, tl_endpt_t *tep) in tl_copy_info() argument
4404 if (IS_CLTS(tep)) { in tl_copy_info()
4409 if (IS_COTSORD(tep)) in tl_copy_info()
4413 ia->CURRENT_state = tep->te_state; in tl_copy_info()
4421 tl_capability_req(mblk_t *mp, tl_endpt_t *tep) in tl_capability_req() argument
4427 if (tep->te_closing) { in tl_capability_req()
4437 (void) (STRLOG(TL_ID, tep->te_minor, 1, SL_TRACE | SL_ERROR, in tl_capability_req()
4439 tl_memrecover(tep->te_wq, mp, in tl_capability_req()
4448 tl_copy_info(&tcap->INFO_ack, tep); in tl_capability_req()
4453 tcap->ACCEPTOR_id = tep->te_acceptor_id; in tl_capability_req()
4457 putnext(tep->te_rq, ackmp); in tl_capability_req()
4461 tl_info_req_ser(mblk_t *mp, tl_endpt_t *tep) in tl_info_req_ser() argument
4463 if (!tep->te_closing) in tl_info_req_ser()
4464 tl_info_req(mp, tep); in tl_info_req_ser()
4468 tl_serializer_exit(tep); in tl_info_req_ser()
4469 tl_refrele(tep); in tl_info_req_ser()
4473 tl_info_req(mblk_t *mp, tl_endpt_t *tep) in tl_info_req() argument
4480 (void) (STRLOG(TL_ID, tep->te_minor, 1, SL_TRACE | SL_ERROR, in tl_info_req()
4482 tl_memrecover(tep->te_wq, mp, sizeof (struct T_info_ack)); in tl_info_req()
4489 tl_copy_info((struct T_info_ack *)ackmp->b_rptr, tep); in tl_info_req()
4494 putnext(tep->te_rq, ackmp); in tl_info_req()
4502 tl_data(mblk_t *mp, tl_endpt_t *tep) in tl_data() argument
4504 queue_t *wq = tep->te_wq; in tl_data()
4509 boolean_t closing = tep->te_closing; in tl_data()
4511 if (IS_CLTS(tep)) { in tl_data()
4512 (void) (STRLOG(TL_ID, tep->te_minor, 2, in tl_data()
4529 (tep->te_state != TS_DATA_XFER) && in tl_data()
4530 (tep->te_state != TS_WREQ_ORDREL)) { in tl_data()
4538 (void) (STRLOG(TL_ID, tep->te_minor, 1, in tl_data()
4548 (msz < sizeof (struct T_optdata_req) || !IS_SOCKET(tep))) { in tl_data()
4549 (void) (STRLOG(TL_ID, tep->te_minor, 1, in tl_data()
4564 switch (tep->te_state) { in tl_data()
4570 (void) (STRLOG(TL_ID, tep->te_minor, 3, SL_TRACE | SL_ERROR, in tl_data()
4576 if (tep->te_conp != NULL) in tl_data()
4579 if (tep->te_oconp == NULL) { in tl_data()
4597 (void) (STRLOG(TL_ID, tep->te_minor, 1, in tl_data()
4600 TL_PUTBQ(tep, mp); in tl_data()
4614 tl_icon_queuemsg(tep->te_oconp, tep->te_seqno, mp); in tl_data()
4618 if (tep->te_conp == NULL) { in tl_data()
4625 (void) (STRLOG(TL_ID, tep->te_minor, 3, in tl_data()
4628 tl_discon_ind(tep, 0); in tl_data()
4635 (void) (STRLOG(TL_ID, tep->te_minor, 1, SL_TRACE | SL_ERROR, in tl_data()
4648 if (((peer_tep = tep->te_conp) == NULL) || peer_tep->te_closing) { in tl_data()
4651 (void) (STRLOG(TL_ID, tep->te_minor, 3, SL_TRACE, in tl_data()
4656 ASSERT(tep->te_serializer == peer_tep->te_serializer); in tl_data()
4665 TL_PUTBQ(tep, mp); in tl_data()
4678 (void) (STRLOG(TL_ID, tep->te_minor, 1, SL_TRACE | SL_ERROR, in tl_data()
4703 tl_exdata(mblk_t *mp, tl_endpt_t *tep) in tl_exdata() argument
4705 queue_t *wq = tep->te_wq; in tl_exdata()
4710 boolean_t closing = tep->te_closing; in tl_exdata()
4713 (void) (STRLOG(TL_ID, tep->te_minor, 1, SL_TRACE | SL_ERROR, in tl_exdata()
4729 (tep->te_state != TS_DATA_XFER) && in tl_exdata()
4730 (tep->te_state != TS_WREQ_ORDREL)) { in tl_exdata()
4738 switch (tep->te_state) { in tl_exdata()
4744 (void) (STRLOG(TL_ID, tep->te_minor, 3, SL_TRACE | SL_ERROR, in tl_exdata()
4750 if (tep->te_conp != NULL) in tl_exdata()
4753 if (tep->te_oconp == NULL) { in tl_exdata()
4771 (void) (STRLOG(TL_ID, tep->te_minor, 1, in tl_exdata()
4774 TL_PUTBQ(tep, mp); in tl_exdata()
4777 (void) (STRLOG(TL_ID, tep->te_minor, 1, SL_TRACE | SL_ERROR, in tl_exdata()
4780 tl_icon_queuemsg(tep->te_oconp, tep->te_seqno, mp); in tl_exdata()
4784 if (tep->te_conp == NULL) { in tl_exdata()
4791 (void) (STRLOG(TL_ID, tep->te_minor, 3, in tl_exdata()
4794 tl_discon_ind(tep, 0); in tl_exdata()
4800 (void) (STRLOG(TL_ID, tep->te_minor, 1, in tl_exdata()
4803 tep->te_state)); in tl_exdata()
4815 if (((peer_tep = tep->te_conp) == NULL) || peer_tep->te_closing) { in tl_exdata()
4818 (void) (STRLOG(TL_ID, tep->te_minor, 3, SL_TRACE, in tl_exdata()
4831 TL_PUTBQ(tep, mp); in tl_exdata()
4844 (void) (STRLOG(TL_ID, tep->te_minor, 1, SL_TRACE | SL_ERROR, in tl_exdata()
4867 tl_ordrel(mblk_t *mp, tl_endpt_t *tep) in tl_ordrel() argument
4869 queue_t *wq = tep->te_wq; in tl_ordrel()
4874 boolean_t closing = tep->te_closing; in tl_ordrel()
4877 (void) (STRLOG(TL_ID, tep->te_minor, 1, SL_TRACE | SL_ERROR, in tl_ordrel()
4890 switch (tep->te_state) { in tl_ordrel()
4894 if (tep->te_conp != NULL) in tl_ordrel()
4897 if (tep->te_oconp == NULL) in tl_ordrel()
4910 (void) (STRLOG(TL_ID, tep->te_minor, 1, in tl_ordrel()
4913 TL_PUTBQ(tep, mp); in tl_ordrel()
4916 (void) (STRLOG(TL_ID, tep->te_minor, 1, SL_TRACE | SL_ERROR, in tl_ordrel()
4919 (void) tl_icon_queuemsg(tep->te_oconp, tep->te_seqno, mp); in tl_ordrel()
4923 (void) (STRLOG(TL_ID, tep->te_minor, 1, in tl_ordrel()
4926 tep->te_state)); in tl_ordrel()
4934 tep->te_state = nextstate[TE_ORDREL_REQ][tep->te_state]; in tl_ordrel()
4939 if (((peer_tep = tep->te_conp) == NULL) || peer_tep->te_closing) { in tl_ordrel()
4941 (void) (STRLOG(TL_ID, tep->te_minor, 3, SL_TRACE, in tl_ordrel()
4955 TL_PUTBQ(tep, mp); in tl_ordrel()
4968 (void) (STRLOG(TL_ID, tep->te_minor, 1, SL_TRACE | SL_ERROR, in tl_ordrel()
4979 (void) (STRLOG(TL_ID, tep->te_minor, 3, SL_TRACE, in tl_ordrel()
4996 tl_endpt_t *tep; in tl_uderr() local
5005 tep = (tl_endpt_t *)wq->q_ptr; in tl_uderr()
5017 (void) (STRLOG(TL_ID, tep->te_minor, 3, SL_TRACE | SL_ERROR, in tl_uderr()
5058 tep->te_state = nextstate[TE_UDERROR_IND][tep->te_state]; in tl_uderr()
5064 tl_unitdata_ser(mblk_t *mp, tl_endpt_t *tep) in tl_unitdata_ser() argument
5066 queue_t *wq = tep->te_wq; in tl_unitdata_ser()
5068 if (!tep->te_closing && (wq->q_first != NULL)) { in tl_unitdata_ser()
5069 TL_PUTQ(tep, mp); in tl_unitdata_ser()
5071 if (tep->te_rq != NULL) in tl_unitdata_ser()
5072 tl_unitdata(mp, tep); in tl_unitdata_ser()
5077 tl_serializer_exit(tep); in tl_unitdata_ser()
5078 tl_refrele(tep); in tl_unitdata_ser()
5087 tl_unitdata(mblk_t *mp, tl_endpt_t *tep) in tl_unitdata() argument
5089 queue_t *wq = tep->te_wq; in tl_unitdata()
5108 if (tep->te_state != TS_IDLE) { in tl_unitdata()
5109 (void) (STRLOG(TL_ID, tep->te_minor, 1, in tl_unitdata()
5126 (void) (STRLOG(TL_ID, tep->te_minor, 1, SL_TRACE | SL_ERROR, in tl_unitdata()
5138 if (IS_SOCKET(tep)) { in tl_unitdata()
5144 (void) (STRLOG(TL_ID, tep->te_minor, in tl_unitdata()
5156 (void) (STRLOG(TL_ID, tep->te_minor, in tl_unitdata()
5172 (void) (STRLOG(TL_ID, tep->te_minor, 1, in tl_unitdata()
5181 if (alen == 0 || (olen != 0 && !IS_SOCKET(tep))) { in tl_unitdata()
5182 (void) (STRLOG(TL_ID, tep->te_minor, 3, SL_TRACE | SL_ERROR, in tl_unitdata()
5194 (void) (STRLOG(TL_ID, tep->te_minor, 3, SL_TRACE | SL_ERROR, in tl_unitdata()
5203 destaddr.ta_zoneid = tep->te_zoneid; in tl_unitdata()
5210 peer_tep = tep->te_lastep; in tl_unitdata()
5219 peer_tep = (IS_SOCKET(tep) ? in tl_unitdata()
5220 tl_sock_find_peer(tep, &ux_addr) : in tl_unitdata()
5221 tl_find_peer(tep, &destaddr)); in tl_unitdata()
5224 (void) (STRLOG(TL_ID, tep->te_minor, 3, in tl_unitdata()
5234 if (tep->te_lastep != NULL) in tl_unitdata()
5235 tl_refrele(tep->te_lastep); in tl_unitdata()
5237 tep->te_lastep = peer_tep; in tl_unitdata()
5241 (void) (STRLOG(TL_ID, tep->te_minor, 1, SL_TRACE | SL_ERROR, in tl_unitdata()
5254 if (!canputnext(peer_tep->te_rq) && !(tep->te_closing)) { in tl_unitdata()
5256 if (tep->te_flowq != NULL) { in tl_unitdata()
5257 list_remove(&tep->te_flowq->te_flowlist, tep); in tl_unitdata()
5259 list_insert_head(&peer_tep->te_flowlist, tep); in tl_unitdata()
5260 tep->te_flowq = peer_tep; in tl_unitdata()
5261 TL_PUTBQ(tep, mp); in tl_unitdata()
5292 ui_sz = T_ALIGN(sizeof (struct T_unitdata_ind) + tep->te_alen) + olen; in tl_unitdata()
5312 if (msz >= ui_sz && alen >= tep->te_alen && in tl_unitdata()
5319 udind->SRC_length = tep->te_alen; in tl_unitdata()
5321 bcopy(tep->te_abuf, addr_startp, tep->te_alen); in tl_unitdata()
5323 } else if (MBLKSIZE(mp) >= reuse_mb_sz && alen >= tep->te_alen && in tl_unitdata()
5333 udind->SRC_length = tep->te_alen; in tl_unitdata()
5335 bcopy(tep->te_abuf, addr_startp, tep->te_alen); in tl_unitdata()
5365 (void) (STRLOG(TL_ID, tep->te_minor, 4, SL_TRACE, in tl_unitdata()
5379 udind->SRC_length = tep->te_alen; in tl_unitdata()
5381 bcopy(tep->te_abuf, addr_startp, tep->te_alen); in tl_unitdata()
5428 tl_find_peer(tl_endpt_t *tep, tl_addr_t *ap) in tl_find_peer() argument
5431 int rc = mod_hash_find_cb(tep->te_addrhash, (mod_hash_key_t)ap, in tl_find_peer()
5434 ASSERT(!IS_SOCKET(tep)); in tl_find_peer()
5437 ASSERT(ap->ta_zoneid == tep->te_zoneid); in tl_find_peer()
5441 (tep->te_zoneid == peer_tep->te_zoneid) && in tl_find_peer()
5442 (tep->te_transport == peer_tep->te_transport)); in tl_find_peer()
5458 tl_sock_find_peer(tl_endpt_t *tep, soux_addr_t *ux_addr) in tl_sock_find_peer() argument
5462 tep->te_aihash : tep->te_addrhash; in tl_sock_find_peer()
5466 ASSERT(IS_SOCKET(tep)); in tl_sock_find_peer()
5468 IMPLY(rc == 0, (tep->te_transport == peer_tep->te_transport)); in tl_sock_find_peer()
5480 if ((peer_tep->te_zoneid != tep->te_zoneid) && in tl_sock_find_peer()
5508 tl_get_any_addr(tl_endpt_t *tep, tl_addr_t *req) in tl_get_any_addr() argument
5513 ASSERT(tep->te_hash_hndl != NULL); in tl_get_any_addr()
5514 ASSERT(!IS_SOCKET(tep)); in tl_get_any_addr()
5516 if (tep->te_hash_hndl == NULL) in tl_get_any_addr()
5527 ASSERT(tep->te_zoneid == req->ta_zoneid); in tl_get_any_addr()
5530 if (tep->te_alen < alen) { in tl_get_any_addr()
5540 if (tep->te_alen > 0) in tl_get_any_addr()
5541 kmem_free(tep->te_abuf, tep->te_alen); in tl_get_any_addr()
5543 tep->te_alen = alen; in tl_get_any_addr()
5544 tep->te_abuf = abuf; in tl_get_any_addr()
5550 bcopy(req->ta_abuf, tep->te_abuf, (size_t)req->ta_alen); in tl_get_any_addr()
5556 bcopy(&tep->te_minor, tep->te_abuf, sizeof (uint32_t)); in tl_get_any_addr()
5559 if (mod_hash_insert_reserve(tep->te_addrhash, in tl_get_any_addr()
5560 (mod_hash_key_t)&tep->te_ap, (mod_hash_val_t)tep, in tl_get_any_addr()
5561 tep->te_hash_hndl) == 0) { in tl_get_any_addr()
5565 tep->te_flag |= TL_ADDRHASHED; in tl_get_any_addr()
5566 tep->te_hash_hndl = NULL; in tl_get_any_addr()
5573 bcopy(&tep->te_defaddr, tep->te_abuf, sizeof (uint32_t)); in tl_get_any_addr()
5574 atomic_inc_32(&tep->te_defaddr); in tl_get_any_addr()
5600 tl_cl_backenable(tl_endpt_t *tep) in tl_cl_backenable() argument
5602 list_t *l = &tep->te_flowlist; in tl_cl_backenable()
5605 ASSERT(IS_CLTS(tep)); in tl_cl_backenable()
5608 ASSERT(tep->te_ser == elp->te_ser); in tl_cl_backenable()
5609 ASSERT(elp->te_flowq == tep); in tl_cl_backenable()
5621 tl_co_unconnect(tl_endpt_t *tep) in tl_co_unconnect() argument
5623 tl_endpt_t *peer_tep = tep->te_conp; in tl_co_unconnect()
5624 tl_endpt_t *srv_tep = tep->te_oconp; in tl_co_unconnect()
5630 ASSERT(IS_COTS(tep)); in tl_co_unconnect()
5635 TL_UNCONNECT(tep->te_conp); in tl_co_unconnect()
5639 TL_UNCONNECT(tep->te_oconp); in tl_co_unconnect()
5643 if (tep->te_nicon > 0) { in tl_co_unconnect()
5644 l = &tep->te_iconp; in tl_co_unconnect()
5652 while (tep->te_nicon > 0) { in tl_co_unconnect()
5657 tl_freetip(tep, tip); in tl_co_unconnect()
5667 tl_freetip(tep, tip); in tl_co_unconnect()
5678 (void) (STRLOG(TL_ID, tep->te_minor, 3, in tl_co_unconnect()
5683 tl_freetip(tep, tip); in tl_co_unconnect()
5691 if (IS_SOCKET(tep) && !tl_disable_early_connect && in tl_co_unconnect()
5693 !tl_icon_hasprim(srv_tep, tep->te_seqno, T_ORDREL_IND)) { in tl_co_unconnect()
5703 d_mp = tl_discon_ind_alloc(ECONNRESET, tep->te_seqno); in tl_co_unconnect()
5706 (void) (STRLOG(TL_ID, tep->te_minor, 3, in tl_co_unconnect()
5709 TL_UNCONNECT(tep->te_oconp); in tl_co_unconnect()
5720 if (IS_SOCKET(tep) && !tl_disable_early_connect) { in tl_co_unconnect()
5724 tl_icon_queuemsg(srv_tep, tep->te_seqno, d_mp); in tl_co_unconnect()
5726 tip = tl_icon_find(srv_tep, tep->te_seqno); in tl_co_unconnect()
5730 ASSERT(tep == tip->ti_tep); in tl_co_unconnect()
5731 ASSERT(tep->te_ser == srv_tep->te_ser); in tl_co_unconnect()
5749 TL_UNCONNECT(tep->te_oconp); in tl_co_unconnect()
5760 ASSERT(tep->te_ser == peer_tep->te_ser); in tl_co_unconnect()
5767 (void) (STRLOG(TL_ID, tep->te_minor, 3, SL_TRACE, in tl_co_unconnect()
5773 (void) (STRLOG(TL_ID, tep->te_minor, 3, in tl_co_unconnect()
5800 (void) (STRLOG(TL_ID, tep->te_minor, 3, in tl_co_unconnect()
5803 tep->te_state)); in tl_co_unconnect()
5806 (void) (STRLOG(TL_ID, tep->te_minor, 3, in tl_co_unconnect()
5808 "tl_co_unconnect: state %d", tep->te_state)); in tl_co_unconnect()
5816 if (tep->te_closing) { in tl_co_unconnect()
5817 peer_tep = tep->te_conp; in tl_co_unconnect()
5819 TL_REMOVE_PEER(tep->te_conp); in tl_co_unconnect()
5830 tl_discon_ind(tl_endpt_t *tep, uint32_t reason) in tl_discon_ind() argument
5834 if (tep->te_closing) in tl_discon_ind()
5840 flushq(tep->te_rq, FLUSHDATA); in tl_discon_ind()
5841 (void) putnextctl1(tep->te_rq, M_FLUSH, FLUSHRW); in tl_discon_ind()
5846 d_mp = tl_discon_ind_alloc(reason, tep->te_seqno); in tl_discon_ind()
5848 (void) (STRLOG(TL_ID, tep->te_minor, 3, SL_TRACE | SL_ERROR, in tl_discon_ind()
5852 tep->te_state = TS_IDLE; in tl_discon_ind()
5853 putnext(tep->te_rq, d_mp); in tl_discon_ind()
5903 tl_icon_find(tl_endpt_t *tep, t_scalar_t seqno) in tl_icon_find() argument
5905 list_t *l = &tep->te_iconp; in tl_icon_find()
5922 tl_icon_queuemsg(tl_endpt_t *tep, t_scalar_t seqno, mblk_t *nmp) in tl_icon_queuemsg() argument
5933 tip = tl_icon_find(tep, seqno); in tl_icon_queuemsg()
5974 tl_icon_hasprim(tl_endpt_t *tep, t_scalar_t seqno, t_scalar_t prim) in tl_icon_hasprim() argument
5976 tl_icon_t *tip = tl_icon_find(tep, seqno); in tl_icon_hasprim()
5994 tl_icon_sendmsgs(tl_endpt_t *tep, mblk_t **mpp) in tl_icon_sendmsgs() argument
5999 if (tep->te_closing) { in tl_icon_sendmsgs()
6004 ASSERT(tep->te_state == TS_DATA_XFER); in tl_icon_sendmsgs()
6005 ASSERT(tep->te_rq->q_first == NULL); in tl_icon_sendmsgs()
6017 putnext(tep->te_rq, mp); in tl_icon_sendmsgs()
6026 putnext(tep->te_rq, mp); in tl_icon_sendmsgs()
6029 tep->te_state = nextstate[TE_ORDREL_IND] in tl_icon_sendmsgs()
6030 [tep->te_state]; in tl_icon_sendmsgs()
6031 putnext(tep->te_rq, mp); in tl_icon_sendmsgs()
6034 tep->te_state = TS_IDLE; in tl_icon_sendmsgs()
6035 putnext(tep->te_rq, mp); in tl_icon_sendmsgs()
6076 tl_endpt_t *tep = (tl_endpt_t *)wq->q_ptr; in tl_merror() local
6078 if (tep->te_closing) { in tl_merror()
6083 (void) (STRLOG(TL_ID, tep->te_minor, 1, in tl_merror()
6085 "tl_merror: tep=%p, err=%d", (void *)tep, error)); in tl_merror()
6092 if (IS_COTS(tep)) { in tl_merror()
6094 tl_co_unconnect(tep); in tl_merror()
6105 (void) (STRLOG(TL_ID, tep->te_minor, 1, in tl_merror()
6118 (void) putnextctl1(tep->te_rq, M_ERROR, error); in tl_merror()
6176 tl_endpt_t *tep; in tl_get_opt() local
6179 tep = (tl_endpt_t *)wq->q_ptr; in tl_get_opt()
6189 if (!IS_SOCKET(tep)) in tl_get_opt()
6195 *valp = (tep->te_flag & TL_SOCKUCRED) != 0; in tl_get_opt()
6225 tl_endpt_t *tep; in tl_set_opt() local
6227 tep = (tl_endpt_t *)wq->q_ptr; in tl_set_opt()
6237 if (!IS_SOCKET(tep)) { in tl_set_opt()
6252 if (!IS_CLTS(tep)) { in tl_set_opt()
6257 tep->te_flag &= ~TL_SOCKUCRED; in tl_set_opt()
6259 tep->te_flag |= TL_SOCKUCRED; in tl_set_opt()
6277 (void) (STRLOG(TL_ID, tep->te_minor, 1, in tl_set_opt()
6292 tl_endpt_t *tep = (tl_endpt_t *)wq->q_ptr; in tl_timer() local
6294 ASSERT(tep); in tl_timer()
6296 tep->te_timoutid = 0; in tl_timer()
6310 tl_endpt_t *tep = (tl_endpt_t *)wq->q_ptr; in tl_buffer() local
6312 ASSERT(tep); in tl_buffer()
6314 tep->te_bufcid = 0; in tl_buffer()
6315 tep->te_nowsrv = B_FALSE; in tl_buffer()
6328 tl_endpt_t *tep; in tl_memrecover() local
6330 tep = (tl_endpt_t *)wq->q_ptr; in tl_memrecover()
6332 if (tep->te_closing) { in tl_memrecover()
6340 if (tep->te_bufcid || tep->te_timoutid) { in tl_memrecover()
6341 (void) (STRLOG(TL_ID, tep->te_minor, 1, SL_TRACE | SL_ERROR, in tl_memrecover()
6346 tep->te_bufcid = qbufcall(wq, size, BPRI_MED, tl_buffer, wq); in tl_memrecover()
6347 if (tep->te_bufcid == NULL) { in tl_memrecover()
6348 tep->te_timoutid = qtimeout(wq, tl_timer, wq, in tl_memrecover()
6354 tl_freetip(tl_endpt_t *tep, tl_icon_t *tip) in tl_freetip() argument
6366 list_remove(&tep->te_iconp, tip); in tl_freetip()
6368 tep->te_nicon--; in tl_freetip()
6375 tl_addr_unbind(tl_endpt_t *tep) in tl_addr_unbind() argument
6379 if (tep->te_flag & TL_ADDRHASHED) { in tl_addr_unbind()
6380 if (IS_SOCKET(tep)) { in tl_addr_unbind()
6381 (void) mod_hash_remove(tep->te_addrhash, in tl_addr_unbind()
6382 (mod_hash_key_t)tep->te_vp, in tl_addr_unbind()
6384 tep->te_vp = (void *)(uintptr_t)tep->te_minor; in tl_addr_unbind()
6385 tep->te_magic = SOU_MAGIC_IMPLICIT; in tl_addr_unbind()
6387 (void) mod_hash_remove(tep->te_addrhash, in tl_addr_unbind()
6388 (mod_hash_key_t)&tep->te_ap, in tl_addr_unbind()
6390 (void) kmem_free(tep->te_abuf, tep->te_alen); in tl_addr_unbind()
6391 tep->te_alen = -1; in tl_addr_unbind()
6392 tep->te_abuf = NULL; in tl_addr_unbind()
6394 tep->te_flag &= ~TL_ADDRHASHED; in tl_addr_unbind()