* ice_init_hw - main hardware initialization routine * @hw: pointer to the hardware structure */
| 1022 | * @hw: pointer to the hardware structure |
| 1023 | */ |
| 1024 | enum ice_status ice_init_hw(struct ice_hw *hw) |
| 1025 | { |
| 1026 | struct ice_aqc_get_phy_caps_data *pcaps; |
| 1027 | enum ice_status status; |
| 1028 | u16 mac_buf_len; |
| 1029 | void *mac_buf; |
| 1030 | |
| 1031 | ice_debug(hw, ICE_DBG_TRACE, "%s\n", __func__); |
| 1032 | |
| 1033 | /* Set MAC type based on DeviceID */ |
| 1034 | status = ice_set_mac_type(hw); |
| 1035 | if (status) |
| 1036 | return status; |
| 1037 | |
| 1038 | hw->pf_id = (u8)(rd32(hw, PF_FUNC_RID) & |
| 1039 | PF_FUNC_RID_FUNCTION_NUMBER_M) >> |
| 1040 | PF_FUNC_RID_FUNCTION_NUMBER_S; |
| 1041 | |
| 1042 | status = ice_reset(hw, ICE_RESET_PFR); |
| 1043 | if (status) |
| 1044 | return status; |
| 1045 | |
| 1046 | ice_get_itr_intrl_gran(hw); |
| 1047 | |
| 1048 | status = ice_create_all_ctrlq(hw); |
| 1049 | if (status) |
| 1050 | goto err_unroll_cqinit; |
| 1051 | |
| 1052 | status = ice_init_nvm(hw); |
| 1053 | if (status) |
| 1054 | goto err_unroll_cqinit; |
| 1055 | |
| 1056 | if (ice_get_fw_mode(hw) == ICE_FW_MODE_ROLLBACK) |
| 1057 | ice_print_rollback_msg(hw); |
| 1058 | |
| 1059 | status = ice_clear_pf_cfg(hw); |
| 1060 | if (status) |
| 1061 | goto err_unroll_cqinit; |
| 1062 | |
| 1063 | /* Set bit to enable Flow Director filters */ |
| 1064 | wr32(hw, PFQF_FD_ENA, PFQF_FD_ENA_FD_ENA_M); |
| 1065 | INIT_LIST_HEAD(&hw->fdir_list_head); |
| 1066 | |
| 1067 | ice_clear_pxe_mode(hw); |
| 1068 | |
| 1069 | status = ice_get_caps(hw); |
| 1070 | if (status) |
| 1071 | goto err_unroll_cqinit; |
| 1072 | |
| 1073 | hw->port_info = (struct ice_port_info *) |
| 1074 | ice_malloc(hw, sizeof(*hw->port_info)); |
| 1075 | if (!hw->port_info) { |
| 1076 | status = ICE_ERR_NO_MEMORY; |
| 1077 | goto err_unroll_cqinit; |
| 1078 | } |
| 1079 | |
| 1080 | /* set the back pointer to HW */ |
| 1081 | hw->port_info->hw = hw; |
no test coverage detected