| 1418 | }; |
| 1419 | |
| 1420 | int |
| 1421 | sfc_hw_switch_id_init(struct sfc_adapter *sa, |
| 1422 | struct sfc_hw_switch_id **idp) |
| 1423 | { |
| 1424 | efx_nic_board_info_t board_info; |
| 1425 | struct sfc_hw_switch_id *id; |
| 1426 | int rc; |
| 1427 | |
| 1428 | if (idp == NULL) |
| 1429 | return EINVAL; |
| 1430 | |
| 1431 | id = rte_zmalloc("sfc_hw_switch_id", sizeof(*id), 0); |
| 1432 | if (id == NULL) |
| 1433 | return ENOMEM; |
| 1434 | |
| 1435 | rc = efx_nic_get_board_info(sa->nic, &board_info); |
| 1436 | if (rc != 0) |
| 1437 | return rc; |
| 1438 | |
| 1439 | memcpy(id->board_sn, board_info.enbi_serial, sizeof(id->board_sn)); |
| 1440 | |
| 1441 | *idp = id; |
| 1442 | |
| 1443 | return 0; |
| 1444 | } |
| 1445 | |
| 1446 | void |
| 1447 | sfc_hw_switch_id_fini(__rte_unused struct sfc_adapter *sa, |
no test coverage detected