Lines Matching refs:rxb
68 * have to be made before the rxb is released back to the kmem_cache.
73 struct rxbuf *rxb;
77 rxb = kmem_cache_alloc(cache, kmflags);
78 if (rxb != NULL) {
79 rxb->ref_cnt = ref_cnt;
80 rxb->cache = cache;
83 return (rxb);
87 * This is normally called via the rxb's freefunc, when an mblk referencing the
88 * rxb is freed.
91 rxbuf_free(struct rxbuf *rxb)
93 if (atomic_dec_uint_nv(&rxb->ref_cnt) == 0)
94 kmem_cache_free(rxb->cache, rxb);
100 struct rxbuf *rxb = arg1;
114 &rxb->dhdl);
118 rc = ddi_dma_mem_alloc(rxb->dhdl, p->buf_size, &p->acc_attr_rx,
119 DDI_DMA_STREAMING, callback, 0, &rxb->va, &real_len, &rxb->ahdl);
125 rc = ddi_dma_addr_bind_handle(rxb->dhdl, NULL, rxb->va, p->buf_size,
142 rxb->ref_cnt = 0;
143 rxb->buf_size = p->buf_size;
144 rxb->freefunc.free_arg = (caddr_t)rxb;
145 rxb->freefunc.free_func = rxbuf_free;
146 rxb->ba = cookie.dmac_laddress;
150 fail3: (void) ddi_dma_unbind_handle(rxb->dhdl);
151 fail2: ddi_dma_mem_free(&rxb->ahdl);
152 fail1: ddi_dma_free_handle(&rxb->dhdl);
160 struct rxbuf *rxb = arg1;
162 (void) ddi_dma_unbind_handle(rxb->dhdl);
163 ddi_dma_mem_free(&rxb->ahdl);
164 ddi_dma_free_handle(&rxb->dhdl);