* Find data allocated for the device or if not found return first unused bbdev * data. If all structures are in use and none is used by the device return * NULL. */
| 141 | * NULL. |
| 142 | */ |
| 143 | static struct rte_bbdev_data * |
| 144 | find_bbdev_data(const char *name) |
| 145 | { |
| 146 | uint16_t data_id; |
| 147 | |
| 148 | for (data_id = 0; data_id < RTE_BBDEV_MAX_DEVS; ++data_id) { |
| 149 | if (strlen(rte_bbdev_data[data_id].name) == 0) { |
| 150 | memset(&rte_bbdev_data[data_id], 0, |
| 151 | sizeof(struct rte_bbdev_data)); |
| 152 | return &rte_bbdev_data[data_id]; |
| 153 | } else if (strncmp(rte_bbdev_data[data_id].name, name, |
| 154 | RTE_BBDEV_NAME_MAX_LEN) == 0) |
| 155 | return &rte_bbdev_data[data_id]; |
| 156 | } |
| 157 | |
| 158 | return NULL; |
| 159 | } |
| 160 | |
| 161 | /* Find lowest device id with no attached device */ |
| 162 | static uint16_t |
no test coverage detected