Lines Matching refs:rscp
115 spin_lock_init(&rdev_p->rscp->qpid_fifo_lock); in cxio_init_qpid_fifo()
117 if (kfifo_alloc(&rdev_p->rscp->qpid_fifo, T3_MAX_NUM_QP * sizeof(u32), in cxio_init_qpid_fifo()
123 kfifo_in(&rdev_p->rscp->qpid_fifo, in cxio_init_qpid_fifo()
145 struct cxio_hal_resource *rscp; in cxio_hal_init_resource() local
147 rscp = kmalloc(sizeof(*rscp), GFP_KERNEL); in cxio_hal_init_resource()
148 if (!rscp) in cxio_hal_init_resource()
150 rdev_p->rscp = rscp; in cxio_hal_init_resource()
151 err = cxio_init_resource_fifo_random(&rscp->tpt_fifo, in cxio_hal_init_resource()
152 &rscp->tpt_fifo_lock, in cxio_hal_init_resource()
159 err = cxio_init_resource_fifo(&rscp->cqid_fifo, &rscp->cqid_fifo_lock, in cxio_hal_init_resource()
163 err = cxio_init_resource_fifo(&rscp->pdid_fifo, &rscp->pdid_fifo_lock, in cxio_hal_init_resource()
169 kfifo_free(&rscp->cqid_fifo); in cxio_hal_init_resource()
171 kfifo_free(&rscp->qpid_fifo); in cxio_hal_init_resource()
173 kfifo_free(&rscp->tpt_fifo); in cxio_hal_init_resource()
198 u32 cxio_hal_get_stag(struct cxio_hal_resource *rscp) in cxio_hal_get_stag() argument
200 return cxio_hal_get_resource(&rscp->tpt_fifo, &rscp->tpt_fifo_lock); in cxio_hal_get_stag()
203 void cxio_hal_put_stag(struct cxio_hal_resource *rscp, u32 stag) in cxio_hal_put_stag() argument
205 cxio_hal_put_resource(&rscp->tpt_fifo, &rscp->tpt_fifo_lock, stag); in cxio_hal_put_stag()
208 u32 cxio_hal_get_qpid(struct cxio_hal_resource *rscp) in cxio_hal_get_qpid() argument
210 u32 qpid = cxio_hal_get_resource(&rscp->qpid_fifo, in cxio_hal_get_qpid()
211 &rscp->qpid_fifo_lock); in cxio_hal_get_qpid()
216 void cxio_hal_put_qpid(struct cxio_hal_resource *rscp, u32 qpid) in cxio_hal_put_qpid() argument
219 cxio_hal_put_resource(&rscp->qpid_fifo, &rscp->qpid_fifo_lock, qpid); in cxio_hal_put_qpid()
222 u32 cxio_hal_get_cqid(struct cxio_hal_resource *rscp) in cxio_hal_get_cqid() argument
224 return cxio_hal_get_resource(&rscp->cqid_fifo, &rscp->cqid_fifo_lock); in cxio_hal_get_cqid()
227 void cxio_hal_put_cqid(struct cxio_hal_resource *rscp, u32 cqid) in cxio_hal_put_cqid() argument
229 cxio_hal_put_resource(&rscp->cqid_fifo, &rscp->cqid_fifo_lock, cqid); in cxio_hal_put_cqid()
232 u32 cxio_hal_get_pdid(struct cxio_hal_resource *rscp) in cxio_hal_get_pdid() argument
234 return cxio_hal_get_resource(&rscp->pdid_fifo, &rscp->pdid_fifo_lock); in cxio_hal_get_pdid()
237 void cxio_hal_put_pdid(struct cxio_hal_resource *rscp, u32 pdid) in cxio_hal_put_pdid() argument
239 cxio_hal_put_resource(&rscp->pdid_fifo, &rscp->pdid_fifo_lock, pdid); in cxio_hal_put_pdid()
242 void cxio_hal_destroy_resource(struct cxio_hal_resource *rscp) in cxio_hal_destroy_resource() argument
244 kfifo_free(&rscp->tpt_fifo); in cxio_hal_destroy_resource()
245 kfifo_free(&rscp->cqid_fifo); in cxio_hal_destroy_resource()
246 kfifo_free(&rscp->qpid_fifo); in cxio_hal_destroy_resource()
247 kfifo_free(&rscp->pdid_fifo); in cxio_hal_destroy_resource()
248 kfree(rscp); in cxio_hal_destroy_resource()