| 1140 | } |
| 1141 | |
| 1142 | static int |
| 1143 | sfc_get_fw_variant(struct sfc_adapter *sa, efx_fw_variant_t *efv) |
| 1144 | { |
| 1145 | efx_nic_fw_info_t enfi; |
| 1146 | int rc; |
| 1147 | |
| 1148 | rc = efx_nic_get_fw_version(sa->nic, &enfi); |
| 1149 | if (rc != 0) |
| 1150 | return rc; |
| 1151 | else if (!enfi.enfi_dpcpu_fw_ids_valid) |
| 1152 | return ENOTSUP; |
| 1153 | |
| 1154 | /* |
| 1155 | * Firmware variant can be uniquely identified by the RxDPCPU |
| 1156 | * firmware id |
| 1157 | */ |
| 1158 | switch (enfi.enfi_rx_dpcpu_fw_id) { |
| 1159 | case EFX_RXDP_FULL_FEATURED_FW_ID: |
| 1160 | *efv = EFX_FW_VARIANT_FULL_FEATURED; |
| 1161 | break; |
| 1162 | |
| 1163 | case EFX_RXDP_LOW_LATENCY_FW_ID: |
| 1164 | *efv = EFX_FW_VARIANT_LOW_LATENCY; |
| 1165 | break; |
| 1166 | |
| 1167 | case EFX_RXDP_PACKED_STREAM_FW_ID: |
| 1168 | *efv = EFX_FW_VARIANT_PACKED_STREAM; |
| 1169 | break; |
| 1170 | |
| 1171 | case EFX_RXDP_DPDK_FW_ID: |
| 1172 | *efv = EFX_FW_VARIANT_DPDK; |
| 1173 | break; |
| 1174 | |
| 1175 | default: |
| 1176 | /* |
| 1177 | * Other firmware variants are not considered, since they are |
| 1178 | * not supported in the device parameters |
| 1179 | */ |
| 1180 | *efv = EFX_FW_VARIANT_DONT_CARE; |
| 1181 | break; |
| 1182 | } |
| 1183 | |
| 1184 | return 0; |
| 1185 | } |
| 1186 | |
| 1187 | static const char * |
| 1188 | sfc_fw_variant2str(efx_fw_variant_t efv) |
no test coverage detected