Lines Matching refs:lhp

357 	struct ldi_handle	*lhp, **lhpp, *retlhp;
363 lhp = kmem_zalloc(sizeof (*lhp), KM_SLEEP);
382 kmem_free(lhp, sizeof (struct ldi_handle));
387 lhp->lh_ref = 1;
388 lhp->lh_vp = vp;
389 lhp->lh_ident = ident;
391 mutex_init(lhp->lh_lock, NULL, MUTEX_DEFAULT, NULL);
395 lhp->lh_type = 0;
398 lhp->lh_type |= LH_STREAM;
400 lhp->lh_type |= LH_CBDEV;
409 lhp->lh_next = ldi_handle_hash[index];
410 ldi_handle_hash[index] = lhp;
415 (void *)lhp, (void *)ident, (void *)vp,
420 return (lhp);
424 handle_release(struct ldi_handle *lhp)
429 ASSERT(lhp != NULL);
431 index = LH_HASH(lhp->lh_vp);
436 (void *)lhp, (void *)lhp->lh_ident, (void *)lhp->lh_vp,
437 mod_major_to_name(getmajor(lhp->lh_vp->v_rdev)),
438 getminor(lhp->lh_vp->v_rdev)));
440 ASSERT(lhp->lh_ref > 0);
441 if (--lhp->lh_ref > 0) {
448 lhpp = handle_find_ref_nolock(lhp->lh_vp, lhp->lh_ident);
450 *lhpp = lhp->lh_next;
454 VN_RELE(lhp->lh_vp);
455 ident_release(lhp->lh_ident);
457 mutex_destroy(lhp->lh_lock);
459 kmem_free(lhp, sizeof (struct ldi_handle));
469 struct ldi_handle *lhp = lep->le_lhp;
471 ASSERT(lhp != NULL);
473 mutex_enter(lhp->lh_lock);
474 if (lhp->lh_events == NULL) {
475 lhp->lh_events = lep;
476 mutex_exit(lhp->lh_lock);
480 lep->le_next = lhp->lh_events;
481 lhp->lh_events->le_prev = lep;
482 lhp->lh_events = lep;
483 mutex_exit(lhp->lh_lock);
489 struct ldi_handle *lhp = lep->le_lhp;
491 ASSERT(lhp != NULL);
493 mutex_enter(lhp->lh_lock);
498 if (lhp->lh_events == lep)
499 lhp->lh_events = lep->le_next;
500 mutex_exit(lhp->lh_lock);
741 ldi_handle_t *lhp, struct ldi_ident *li)
748 ASSERT((lhp != NULL) && (li != NULL));
786 *lhp = (ldi_handle_t)nlhp;
1171 struct ldi_handle *lhp;
1180 lhp = ldi_handle_hash[i];
1181 while ((lhp != NULL) && (ret == LDI_USAGE_CONTINUE)) {
1182 lip = lhp->lh_ident;
1183 vp = lhp->lh_vp;
1188 lhp = lhp->lh_next;
1221 struct ldi_handle *lhp = (struct ldi_handle *)arg;
1226 if (lhp == NULL)
1229 vpdown = lhp->lh_vp;
1377 struct ldi_handle *lhp;
1422 lhp = handle_find(vp, (struct ldi_ident *)li);
1423 handle_release(lhp);
1597 ldi_handle_t *lhp, ldi_ident_t li)
1605 (lhp == NULL) || (lip == NULL))
1613 if ((ret = ldi_open_by_vp(&vp, flag, cr, lhp, lip)) == 0) {
1624 ldi_handle_t *lhp, ldi_ident_t li)
1632 (cr == NULL) || (lhp == NULL) || (lip == NULL))
1640 ret = ldi_open_by_vp(&vp, flag, cr, lhp, lip);
1649 int flag, cred_t *cr, ldi_handle_t *lhp, ldi_ident_t li)
1657 (lhp == NULL) || (lip == NULL))
1665 ret = ldi_open_by_vp(&vp, flag, cr, lhp, lip);
3169 struct ldi_handle *lhp = (struct ldi_handle *)lh;
3195 dev = lhp->lh_vp->v_rdev;
3196 csp = VTOCS(lhp->lh_vp);
3206 "LDI handle: %p", (void *)lhp);
3222 lhp->lh_ident->li_modname);
3250 lecp->lec_lhp = lhp;
3251 lecp->lec_dev = lhp->lh_vp->v_rdev;
3252 lecp->lec_spec = VTYP_TO_STYP(lhp->lh_vp->v_type);