This function gets the FW version along with the * capabilities(MAX and current) of the function, vnic, * error recovery, phy and other chip related info */
| 5272 | * error recovery, phy and other chip related info |
| 5273 | */ |
| 5274 | static int bnxt_get_config(struct bnxt *bp) |
| 5275 | { |
| 5276 | uint16_t mtu; |
| 5277 | int rc = 0; |
| 5278 | |
| 5279 | bp->fw_cap = 0; |
| 5280 | |
| 5281 | rc = bnxt_map_hcomm_fw_status_reg(bp); |
| 5282 | if (rc) |
| 5283 | return rc; |
| 5284 | |
| 5285 | rc = bnxt_hwrm_ver_get(bp, DFLT_HWRM_CMD_TIMEOUT); |
| 5286 | if (rc) { |
| 5287 | bnxt_check_fw_status(bp); |
| 5288 | return rc; |
| 5289 | } |
| 5290 | |
| 5291 | rc = bnxt_hwrm_func_reset(bp); |
| 5292 | if (rc) |
| 5293 | return -EIO; |
| 5294 | |
| 5295 | rc = bnxt_hwrm_vnic_qcaps(bp); |
| 5296 | if (rc) |
| 5297 | return rc; |
| 5298 | |
| 5299 | rc = bnxt_hwrm_queue_qportcfg(bp); |
| 5300 | if (rc) |
| 5301 | return rc; |
| 5302 | |
| 5303 | /* Get the MAX capabilities for this function. |
| 5304 | * This function also allocates context memory for TQM rings and |
| 5305 | * informs the firmware about this allocated backing store memory. |
| 5306 | */ |
| 5307 | rc = bnxt_hwrm_func_qcaps(bp); |
| 5308 | if (rc) |
| 5309 | return rc; |
| 5310 | |
| 5311 | rc = bnxt_hwrm_func_qcfg(bp, &mtu); |
| 5312 | if (rc) |
| 5313 | return rc; |
| 5314 | |
| 5315 | bnxt_hwrm_port_mac_qcfg(bp); |
| 5316 | |
| 5317 | bnxt_hwrm_parent_pf_qcfg(bp); |
| 5318 | |
| 5319 | bnxt_hwrm_port_phy_qcaps(bp); |
| 5320 | |
| 5321 | bnxt_alloc_error_recovery_info(bp); |
| 5322 | /* Get the adapter error recovery support info */ |
| 5323 | rc = bnxt_hwrm_error_recovery_qcfg(bp); |
| 5324 | if (rc) |
| 5325 | bp->fw_cap &= ~BNXT_FW_CAP_ERROR_RECOVERY; |
| 5326 | |
| 5327 | bnxt_hwrm_port_led_qcaps(bp); |
| 5328 | |
| 5329 | return 0; |
| 5330 | } |
| 5331 |
no test coverage detected