Lines Matching defs:tpl
1844 tht_pkt_alloc(struct tht_softc *sc, struct tht_pkt_list *tpl, int npkts,
1851 tpl->tpl_pkts = mallocarray(npkts, sizeof(struct tht_pkt),
1854 TAILQ_INIT(&tpl->tpl_free);
1855 TAILQ_INIT(&tpl->tpl_used);
1857 pkt = &tpl->tpl_pkts[i];
1863 tht_pkt_free(sc, tpl);
1867 TAILQ_INSERT_TAIL(&tpl->tpl_free, pkt, tp_link);
1874 tht_pkt_free(struct tht_softc *sc, struct tht_pkt_list *tpl)
1879 while ((pkt = tht_pkt_get(tpl)) != NULL)
1881 free(tpl->tpl_pkts, M_DEVBUF, 0);
1882 tpl->tpl_pkts = NULL;
1886 tht_pkt_put(struct tht_pkt_list *tpl, struct tht_pkt *pkt)
1888 TAILQ_REMOVE(&tpl->tpl_used, pkt, tp_link);
1889 TAILQ_INSERT_TAIL(&tpl->tpl_free, pkt, tp_link);
1893 tht_pkt_get(struct tht_pkt_list *tpl)
1897 pkt = TAILQ_FIRST(&tpl->tpl_free);
1899 TAILQ_REMOVE(&tpl->tpl_free, pkt, tp_link);
1900 TAILQ_INSERT_TAIL(&tpl->tpl_used, pkt, tp_link);
1908 tht_pkt_used(struct tht_pkt_list *tpl)
1910 return (TAILQ_FIRST(&tpl->tpl_used));