| 4721 | } |
| 4722 | |
| 4723 | static int bnxt_map_pci_bars(struct rte_eth_dev *eth_dev) |
| 4724 | { |
| 4725 | struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev); |
| 4726 | struct bnxt *bp = eth_dev->data->dev_private; |
| 4727 | |
| 4728 | /* enable device (incl. PCI PM wakeup), and bus-mastering */ |
| 4729 | bp->bar0 = (void *)pci_dev->mem_resource[0].addr; |
| 4730 | bp->doorbell_base = (void *)pci_dev->mem_resource[2].addr; |
| 4731 | if (!bp->bar0 || !bp->doorbell_base) { |
| 4732 | PMD_DRV_LOG(ERR, "Unable to access Hardware\n"); |
| 4733 | return -ENODEV; |
| 4734 | } |
| 4735 | |
| 4736 | bp->eth_dev = eth_dev; |
| 4737 | bp->pdev = pci_dev; |
| 4738 | |
| 4739 | return 0; |
| 4740 | } |
| 4741 | |
| 4742 | static int bnxt_alloc_ctx_mem_blk(struct bnxt *bp, |
| 4743 | struct bnxt_ctx_pg_info *ctx_pg, |