| 69 | } |
| 70 | |
| 71 | void* |
| 72 | timvf_bar(uint8_t vfid, uint8_t bar) |
| 73 | { |
| 74 | uint16_t global_domain = octeontx_get_global_domain(); |
| 75 | struct timvf_res *res = NULL; |
| 76 | int i; |
| 77 | |
| 78 | if (rte_eal_process_type() != RTE_PROC_PRIMARY) |
| 79 | return NULL; |
| 80 | |
| 81 | for (i = 0; i < tdev.total_timvfs; i++) { |
| 82 | if (tdev.rings[i].domain != global_domain) |
| 83 | continue; |
| 84 | if (tdev.rings[i].vfid == vfid) |
| 85 | res = &tdev.rings[i]; |
| 86 | |
| 87 | } |
| 88 | |
| 89 | if (res == NULL) |
| 90 | return NULL; |
| 91 | |
| 92 | switch (bar) { |
| 93 | case 0: |
| 94 | return res->bar0; |
| 95 | case 4: |
| 96 | return res->bar4; |
| 97 | default: |
| 98 | return NULL; |
| 99 | } |
| 100 | } |
| 101 | |
| 102 | static int |
| 103 | timvf_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev) |
no test coverage detected