| 2590 | }; |
| 2591 | |
| 2592 | static struct cpfl_adapter_ext * |
| 2593 | cpfl_find_adapter_ext(struct rte_pci_device *pci_dev) |
| 2594 | { |
| 2595 | struct cpfl_adapter_ext *adapter; |
| 2596 | int found = 0; |
| 2597 | |
| 2598 | if (pci_dev == NULL) |
| 2599 | return NULL; |
| 2600 | |
| 2601 | rte_spinlock_lock(&cpfl_adapter_lock); |
| 2602 | TAILQ_FOREACH(adapter, &cpfl_adapter_list, next) { |
| 2603 | if (strncmp(adapter->name, pci_dev->device.name, PCI_PRI_STR_SIZE) == 0) { |
| 2604 | found = 1; |
| 2605 | break; |
| 2606 | } |
| 2607 | } |
| 2608 | rte_spinlock_unlock(&cpfl_adapter_lock); |
| 2609 | |
| 2610 | if (found == 0) |
| 2611 | return NULL; |
| 2612 | |
| 2613 | return adapter; |
| 2614 | } |
| 2615 | |
| 2616 | static void |
| 2617 | cpfl_adapter_ext_deinit(struct cpfl_adapter_ext *adapter) |
no test coverage detected