Lines Matching refs:dpit
706 struct bnxt_qplib_dpi_tbl *dpit = &res->dpi_tbl; in bnxt_qplib_alloc_dpi() local
711 reg = &dpit->wcreg; in bnxt_qplib_alloc_dpi()
714 bit_num = find_first_bit(dpit->tbl, dpit->max); in bnxt_qplib_alloc_dpi()
715 if (bit_num == dpit->max) { in bnxt_qplib_alloc_dpi()
721 clear_bit(bit_num, dpit->tbl); in bnxt_qplib_alloc_dpi()
722 dpit->app_tbl[bit_num] = app; in bnxt_qplib_alloc_dpi()
725 dpi->dpi = bit_num + (reg->offset - dpit->ucreg.offset) / PAGE_SIZE; in bnxt_qplib_alloc_dpi()
733 dpi->umdbr = dpit->ucreg.bar_base + in bnxt_qplib_alloc_dpi()
734 dpit->ucreg.offset + bit_num * PAGE_SIZE; in bnxt_qplib_alloc_dpi()
735 dpi->dbr = dpit->priv_db; in bnxt_qplib_alloc_dpi()
755 struct bnxt_qplib_dpi_tbl *dpit = &res->dpi_tbl; in bnxt_qplib_dealloc_dpi() local
761 if (test_and_set_bit(dpi->bit, dpit->tbl)) { in bnxt_qplib_dealloc_dpi()
768 if (dpit->app_tbl) in bnxt_qplib_dealloc_dpi()
769 dpit->app_tbl[dpi->bit] = NULL; in bnxt_qplib_dealloc_dpi()
776 struct bnxt_qplib_dpi_tbl *dpit) in bnxt_qplib_free_dpi_tbl() argument
778 kfree(dpit->tbl); in bnxt_qplib_free_dpi_tbl()
779 kfree(dpit->app_tbl); in bnxt_qplib_free_dpi_tbl()
780 dpit->tbl = NULL; in bnxt_qplib_free_dpi_tbl()
781 dpit->app_tbl = NULL; in bnxt_qplib_free_dpi_tbl()
782 dpit->max = 0; in bnxt_qplib_free_dpi_tbl()
788 struct bnxt_qplib_dpi_tbl *dpit; in bnxt_qplib_alloc_dpi_tbl() local
794 dpit = &res->dpi_tbl; in bnxt_qplib_alloc_dpi_tbl()
795 reg = &dpit->wcreg; in bnxt_qplib_alloc_dpi_tbl()
800 dpit->ucreg.offset = dbr_offset; in bnxt_qplib_alloc_dpi_tbl()
801 dpit->wcreg.offset = dbr_offset; in bnxt_qplib_alloc_dpi_tbl()
805 dpit->max = (bar_len - reg->offset) / PAGE_SIZE; in bnxt_qplib_alloc_dpi_tbl()
807 dpit->max = min_t(u32, dpit->max, dev_attr->max_dpi); in bnxt_qplib_alloc_dpi_tbl()
809 dpit->app_tbl = kcalloc(dpit->max, sizeof(void *), GFP_KERNEL); in bnxt_qplib_alloc_dpi_tbl()
810 if (!dpit->app_tbl) in bnxt_qplib_alloc_dpi_tbl()
813 bytes = dpit->max >> 3; in bnxt_qplib_alloc_dpi_tbl()
817 dpit->tbl = kmalloc(bytes, GFP_KERNEL); in bnxt_qplib_alloc_dpi_tbl()
818 if (!dpit->tbl) { in bnxt_qplib_alloc_dpi_tbl()
819 kfree(dpit->app_tbl); in bnxt_qplib_alloc_dpi_tbl()
820 dpit->app_tbl = NULL; in bnxt_qplib_alloc_dpi_tbl()
824 memset((u8 *)dpit->tbl, 0xFF, bytes); in bnxt_qplib_alloc_dpi_tbl()
826 dpit->priv_db = dpit->ucreg.bar_reg + dpit->ucreg.offset; in bnxt_qplib_alloc_dpi_tbl()