Lines Matching refs:tiptr

64 static void _t_free_lookbufs(struct _ti_user *tiptr);
66 static int _t_cbuf_alloc(struct _ti_user *tiptr, char **retbuf);
67 static int _t_rbuf_alloc(struct _ti_user *tiptr, char **retbuf);
69 static int _t_alloc_bufs(int fd, struct _ti_user *tiptr,
81 struct _ti_user *tiptr;
91 tiptr = find_tilink(fd);
93 if (tiptr != NULL)
94 return (tiptr);
155 tiptr = _t_create(fd, NULL, api_semantics, NULL);
156 if (tiptr == NULL) {
171 return (tiptr);
216 struct _ti_user *tiptr,
225 assert(MUTEX_HELD(&tiptr->ti_lock));
227 cbuf_size = tiptr->ti_ctlsize;
228 dbuf_size = tiptr->ti_rcvsize;
242 if (tiptr->ti_lookcnt > 0) { /* something already on looklist */
247 assert(tiptr->ti_servtype != T_CLTS);
249 if (*(t_scalar_t *)tiptr->ti_lookbufs.tl_lookcbuf ==
254 _t_free_looklist_head(tiptr);
258 tlbs = &tiptr->ti_lookbufs;
259 if (tiptr->ti_lookcnt > 0) {
269 assert(tiptr->ti_lookcnt == listcount);
303 tiptr->ti_lookcnt++;
309 * Assumes tiptr->ti_lock held and this threads signals blocked
313 _t_is_event(int fd, struct _ti_user *tiptr)
317 assert(MUTEX_HELD(&tiptr->ti_lock));
323 if ((retval > 0) || (tiptr->ti_lookcnt > 0)) {
332 * assumes tiptr->ti_lock held in MT case
335 _t_is_ok(int fd, struct _ti_user *tiptr, t_scalar_t type)
345 assert(MUTEX_HELD(&tiptr->ti_lock));
350 if (_t_acquire_ctlbuf(tiptr, &ctlbuf, &didalloc) < 0)
355 if (_t_acquire_databuf(tiptr, &databuf, &didralloc) < 0) {
359 tiptr->ti_ctlbuf = ctlbuf.buf;
419 tiptr->ti_ctlbuf = ctlbuf.buf;
423 tiptr->ti_rcvbuf = databuf.buf;
462 tiptr->ti_ctlbuf = ctlbuf.buf;
466 tiptr->ti_rcvbuf = databuf.buf;
505 _t_alloc_bufs(int fd, struct _ti_user *tiptr, struct T_info_ack *tsap)
573 tiptr->ti_rcvsize = size1;
574 tiptr->ti_rcvbuf = rcvbuf;
575 tiptr->ti_ctlsize = size2;
576 tiptr->ti_ctlbuf = ctlbuf;
583 tiptr->ti_lookbufs.tl_lookclen = 0;
584 tiptr->ti_lookbufs.tl_lookcbuf = lookcbuf;
585 tiptr->ti_lookbufs.tl_lookdlen = 0;
586 tiptr->ti_lookbufs.tl_lookdbuf = lookdbuf;
621 _t_reinit_tiptr(struct _ti_user *tiptr)
634 tiptr->ti_flags = 0;
635 tiptr->ti_rcvsize = 0;
636 tiptr->ti_rcvbuf = NULL;
637 tiptr->ti_ctlsize = 0;
638 tiptr->ti_ctlbuf = NULL;
639 tiptr->ti_lookbufs.tl_lookdbuf = NULL;
640 tiptr->ti_lookbufs.tl_lookcbuf = NULL;
641 tiptr->ti_lookbufs.tl_lookdlen = 0;
642 tiptr->ti_lookbufs.tl_lookclen = 0;
643 tiptr->ti_lookbufs.tl_next = NULL;
644 tiptr->ti_maxpsz = 0;
645 tiptr->ti_tsdusize = 0;
646 tiptr->ti_etsdusize = 0;
647 tiptr->ti_cdatasize = 0;
648 tiptr->ti_ddatasize = 0;
649 tiptr->ti_servtype = 0;
650 tiptr->ti_lookcnt = 0;
651 tiptr->ti_state = 0;
652 tiptr->ti_ocnt = 0;
653 tiptr->ti_prov_flag = 0;
654 tiptr->ti_qlen = 0;
676 struct _ti_user *tiptr;
724 if ((tiptr = malloc(sizeof (*tiptr))) == NULL)
730 _t_reinit_tiptr(tiptr);
731 prevptr->ti_next = tiptr;
732 tiptr->ti_prev = prevptr;
737 if ((tiptr = malloc(sizeof (*tiptr))) == NULL)
739 _t_reinit_tiptr(tiptr);
740 hash_bucket[x] = tiptr;
741 tiptr->ti_prev = NULL;
743 tiptr->ti_next = NULL;
744 tiptr->ti_fd = s;
745 tiptr->ti_rdev = stbuf.st_rdev;
746 tiptr->ti_ino = stbuf.st_ino;
747 (void) mutex_init(&tiptr->ti_lock, USYNC_THREAD, NULL);
748 return (tiptr);
834 * *tiptr is returned
1189 _t_cbuf_alloc(struct _ti_user *tiptr, char **retbuf)
1193 assert(MUTEX_HELD(&tiptr->ti_lock));
1194 size2 = tiptr->ti_ctlsize; /* same size as default ctlbuf */
1208 _t_rbuf_alloc(struct _ti_user *tiptr, char **retbuf)
1212 assert(MUTEX_HELD(&tiptr->ti_lock));
1213 size1 = tiptr->ti_rcvsize; /* same size as default rcvbuf */
1226 _t_free_lookbufs(struct _ti_user *tiptr)
1238 assert(MUTEX_HELD(&tiptr->ti_lock) || MUTEX_HELD(&_ti_userlock));
1243 head_tlbs = &tiptr->ti_lookbufs;
1276 _t_free_looklist_head(struct _ti_user *tiptr)
1280 tlbs = &tiptr->ti_lookbufs;
1303 tiptr->ti_lookcnt--;
1304 assert(tiptr->ti_lookcnt > 0);
1310 assert(tiptr->ti_lookcnt == 1);
1311 tiptr->ti_lookcnt = 0;
1320 _t_flush_lookevents(struct _ti_user *tiptr)
1328 assert(MUTEX_HELD(&tiptr->ti_lock));
1329 tiptr->ti_lookcnt = 0;
1333 tlbs = tiptr->ti_lookbufs.tl_next;
1334 tiptr->ti_lookbufs.tl_next = NULL;
1355 struct _ti_user *tiptr,
1362 if (tiptr->ti_ctlbuf) {
1363 ctlbufp->buf = tiptr->ti_ctlbuf;
1364 tiptr->ti_ctlbuf = NULL;
1365 ctlbufp->maxlen = tiptr->ti_ctlsize;
1368 * tiptr->ti_ctlbuf is in use
1371 if ((ctlbufp->maxlen = _t_cbuf_alloc(tiptr,
1395 struct _ti_user *tiptr,
1402 if (tiptr->ti_rcvbuf) {
1403 assert(tiptr->ti_rcvsize != 0);
1404 databufp->buf = tiptr->ti_rcvbuf;
1405 tiptr->ti_rcvbuf = NULL;
1406 databufp->maxlen = tiptr->ti_rcvsize;
1407 } else if (tiptr->ti_rcvsize == 0) {
1412 * tiptr->ti_rcvbuf is in use
1415 if ((databufp->maxlen = _t_rbuf_alloc(tiptr,
1634 _t_do_postconn_sync(int fd, struct _ti_user *tiptr)
1698 tiptr->ti_maxpsz = tiap->TIDU_size;
1700 tiptr->ti_tsdusize = tiap->TSDU_size;
1702 tiptr->ti_etsdusize = tiap->ETSDU_size;
1704 tiptr->ti_cdatasize = tiap->CDATA_size;
1706 tiptr->ti_ddatasize = tiap->DDATA_size;
1707 tiptr->ti_prov_flag = tiap->PROVIDER_flag;