Lines Matching refs:dpit
629 int bnxt_qplib_alloc_dpi(struct bnxt_qplib_dpi_tbl *dpit, in bnxt_qplib_alloc_dpi() argument
635 bit_num = find_first_bit(dpit->tbl, dpit->max); in bnxt_qplib_alloc_dpi()
636 if (bit_num == dpit->max) in bnxt_qplib_alloc_dpi()
640 clear_bit(bit_num, dpit->tbl); in bnxt_qplib_alloc_dpi()
641 dpit->app_tbl[bit_num] = app; in bnxt_qplib_alloc_dpi()
644 dpi->dbr = dpit->dbr_bar_reg_iomem + (bit_num * PAGE_SIZE); in bnxt_qplib_alloc_dpi()
645 dpi->umdbr = dpit->unmapped_dbr + (bit_num * PAGE_SIZE); in bnxt_qplib_alloc_dpi()
651 struct bnxt_qplib_dpi_tbl *dpit, in bnxt_qplib_dealloc_dpi() argument
654 if (dpi->dpi >= dpit->max) { in bnxt_qplib_dealloc_dpi()
658 if (test_and_set_bit(dpi->dpi, dpit->tbl)) { in bnxt_qplib_dealloc_dpi()
663 if (dpit->app_tbl) in bnxt_qplib_dealloc_dpi()
664 dpit->app_tbl[dpi->dpi] = NULL; in bnxt_qplib_dealloc_dpi()
671 struct bnxt_qplib_dpi_tbl *dpit) in bnxt_qplib_free_dpi_tbl() argument
673 kfree(dpit->tbl); in bnxt_qplib_free_dpi_tbl()
674 kfree(dpit->app_tbl); in bnxt_qplib_free_dpi_tbl()
675 if (dpit->dbr_bar_reg_iomem) in bnxt_qplib_free_dpi_tbl()
676 pci_iounmap(res->pdev, dpit->dbr_bar_reg_iomem); in bnxt_qplib_free_dpi_tbl()
677 memset(dpit, 0, sizeof(*dpit)); in bnxt_qplib_free_dpi_tbl()
681 struct bnxt_qplib_dpi_tbl *dpit, in bnxt_qplib_alloc_dpi_tbl() argument
688 if (dpit->dbr_bar_reg_iomem) { in bnxt_qplib_alloc_dpi_tbl()
707 dpit->dbr_bar_reg_iomem = ioremap_nocache(bar_reg_base + dbr_offset, in bnxt_qplib_alloc_dpi_tbl()
709 if (!dpit->dbr_bar_reg_iomem) { in bnxt_qplib_alloc_dpi_tbl()
715 dpit->unmapped_dbr = bar_reg_base + dbr_offset; in bnxt_qplib_alloc_dpi_tbl()
716 dpit->max = dbr_len / PAGE_SIZE; in bnxt_qplib_alloc_dpi_tbl()
718 dpit->app_tbl = kcalloc(dpit->max, sizeof(void *), GFP_KERNEL); in bnxt_qplib_alloc_dpi_tbl()
719 if (!dpit->app_tbl) in bnxt_qplib_alloc_dpi_tbl()
722 bytes = dpit->max >> 3; in bnxt_qplib_alloc_dpi_tbl()
726 dpit->tbl = kmalloc(bytes, GFP_KERNEL); in bnxt_qplib_alloc_dpi_tbl()
727 if (!dpit->tbl) { in bnxt_qplib_alloc_dpi_tbl()
728 kfree(dpit->app_tbl); in bnxt_qplib_alloc_dpi_tbl()
729 dpit->app_tbl = NULL; in bnxt_qplib_alloc_dpi_tbl()
733 memset((u8 *)dpit->tbl, 0xFF, bytes); in bnxt_qplib_alloc_dpi_tbl()
738 pci_iounmap(res->pdev, dpit->dbr_bar_reg_iomem); in bnxt_qplib_alloc_dpi_tbl()