Lines Matching defs:tlc

178 	struct hidbus_ivars *tlc;
185 tlc = malloc(sizeof(struct hidbus_ivars), M_DEVBUF, M_WAITOK | M_ZERO);
186 tlc->mtx = &sc->mtx;
187 device_set_ivars(child, tlc);
189 CK_STAILQ_INSERT_TAIL(&sc->tlcs, tlc, link);
384 struct hidbus_ivars *tlc = device_get_ivars(child);
386 KASSERT(tlc->refcnt == 0, ("Child device is running"));
387 tlc->mtx = &sc->mtx;
388 tlc->intr_handler = NULL;
389 tlc->flags &= ~HIDBUS_FLAG_CAN_POLL;
393 * Epoch callback indicating tlc is safe to destroy
398 struct hidbus_ivars *tlc;
400 tlc = __containerof(ctx, struct hidbus_ivars, epoch_ctx);
401 free(tlc, M_DEVBUF);
408 struct hidbus_ivars *tlc = device_get_ivars(child);
411 KASSERT(tlc->refcnt == 0, ("Child device is running"));
412 CK_STAILQ_REMOVE(&sc->tlcs, tlc, hidbus_ivars, link);
414 epoch_call(INPUT_EPOCH, hidbus_ivar_dtor, &tlc->epoch_ctx);
421 struct hidbus_ivars *tlc = device_get_ivars(child);
425 *result = tlc->index;
428 *result = tlc->usage;
431 *result = tlc->flags;
434 *result = tlc->driver_info;
437 *result = (uintptr_t)(tlc->mtx == &sc->mtx ? NULL : tlc->mtx);
449 struct hidbus_ivars *tlc = device_get_ivars(child);
453 tlc->index = value;
456 tlc->usage = value;
459 tlc->flags = value;
465 tlc->driver_info = value;
468 tlc->mtx = (struct mtx *)value == NULL ?
482 struct hidbus_ivars *tlc = device_get_ivars(child);
484 snprintf(buf, buflen, "index=%hhu", tlc->index);
493 struct hidbus_ivars *tlc = device_get_ivars(child);
498 HID_GET_USAGE_PAGE(tlc->usage), HID_GET_USAGE(tlc->usage),
511 struct hidbus_ivars *tlc = device_get_ivars(child);
516 (sc->nauto > 1 || (tlc->flags & HIDBUS_FLAG_AUTOCHILD) == 0)) {
551 struct hidbus_ivars *tlc;
563 CK_STAILQ_FOREACH(tlc, &sc->tlcs, link) {
564 if (tlc->refcnt == 0 || tlc->intr_handler == NULL)
567 if ((tlc->flags & HIDBUS_FLAG_CAN_POLL) != 0)
568 tlc->intr_handler(tlc->intr_ctx, buf, len);
570 mtx_lock(tlc->mtx);
571 tlc->intr_handler(tlc->intr_ctx, buf, len);
572 mtx_unlock(tlc->mtx);
582 struct hidbus_ivars *tlc = device_get_ivars(child);
584 tlc->intr_handler = handler;
585 tlc->intr_ctx = context;
594 struct hidbus_ivars *tlc;
600 CK_STAILQ_FOREACH(tlc, &sc->tlcs, link) {
601 refcnt += tlc->refcnt;
602 if (tlc == ivar) {
603 mtx_lock(tlc->mtx);
604 ++tlc->refcnt;
605 mtx_unlock(tlc->mtx);
620 struct hidbus_ivars *tlc;
626 CK_STAILQ_FOREACH(tlc, &sc->tlcs, link) {
627 if (tlc == ivar) {
628 mtx_lock(tlc->mtx);
629 MPASS(tlc->refcnt != 0);
630 --tlc->refcnt;
631 mtx_unlock(tlc->mtx);
633 refcnt += tlc->refcnt;