Lines Matching refs:ret_val
122 s32 ret_val; in igb_check_for_link_media_swap() local
127 ret_val = phy->ops.write_reg(hw, E1000_M88E1112_PAGE_ADDR, 0); in igb_check_for_link_media_swap()
128 if (ret_val) in igb_check_for_link_media_swap()
129 return ret_val; in igb_check_for_link_media_swap()
131 ret_val = phy->ops.read_reg(hw, E1000_M88E1112_STATUS, &data); in igb_check_for_link_media_swap()
132 if (ret_val) in igb_check_for_link_media_swap()
133 return ret_val; in igb_check_for_link_media_swap()
139 ret_val = phy->ops.write_reg(hw, E1000_M88E1112_PAGE_ADDR, 1); in igb_check_for_link_media_swap()
140 if (ret_val) in igb_check_for_link_media_swap()
141 return ret_val; in igb_check_for_link_media_swap()
143 ret_val = phy->ops.read_reg(hw, E1000_M88E1112_STATUS, &data); in igb_check_for_link_media_swap()
144 if (ret_val) in igb_check_for_link_media_swap()
145 return ret_val; in igb_check_for_link_media_swap()
159 ret_val = phy->ops.write_reg(hw, E1000_M88E1112_PAGE_ADDR, 0); in igb_check_for_link_media_swap()
160 if (ret_val) in igb_check_for_link_media_swap()
161 return ret_val; in igb_check_for_link_media_swap()
166 ret_val = phy->ops.write_reg(hw, E1000_M88E1112_PAGE_ADDR, 0); in igb_check_for_link_media_swap()
167 if (ret_val) in igb_check_for_link_media_swap()
168 return ret_val; in igb_check_for_link_media_swap()
181 s32 ret_val = 0; in igb_init_phy_params_82575() local
228 ret_val = igb_get_phy_id_82575(hw); in igb_init_phy_params_82575()
229 if (ret_val) in igb_init_phy_params_82575()
230 return ret_val; in igb_init_phy_params_82575()
252 ret_val = phy->ops.write_reg(hw, in igb_init_phy_params_82575()
255 if (ret_val) in igb_init_phy_params_82575()
258 ret_val = phy->ops.read_reg(hw, in igb_init_phy_params_82575()
261 if (ret_val) in igb_init_phy_params_82575()
272 ret_val = igb_initialize_M88E1512_phy(hw); in igb_init_phy_params_82575()
273 if (ret_val) in igb_init_phy_params_82575()
277 ret_val = igb_initialize_M88E1543_phy(hw); in igb_init_phy_params_82575()
278 if (ret_val) in igb_init_phy_params_82575()
314 ret_val = -E1000_ERR_PHY; in igb_init_phy_params_82575()
319 return ret_val; in igb_init_phy_params_82575()
492 s32 ret_val = E1000_ERR_CONFIG; in igb_set_sfp_media_type_82575() local
508 ret_val = igb_read_sfp_data_byte(hw, in igb_set_sfp_media_type_82575()
511 if (ret_val == 0) in igb_set_sfp_media_type_82575()
516 if (ret_val != 0) in igb_set_sfp_media_type_82575()
519 ret_val = igb_read_sfp_data_byte(hw, in igb_set_sfp_media_type_82575()
522 if (ret_val != 0) in igb_set_sfp_media_type_82575()
545 ret_val = 0; in igb_set_sfp_media_type_82575()
549 return ret_val; in igb_set_sfp_media_type_82575()
556 s32 ret_val; in igb_get_invariants_82575() local
642 ret_val = igb_set_sfp_media_type_82575(hw); in igb_get_invariants_82575()
643 if ((ret_val != 0) || in igb_get_invariants_82575()
674 ret_val = igb_init_mac_params_82575(hw); in igb_get_invariants_82575()
675 if (ret_val) in igb_get_invariants_82575()
679 ret_val = igb_init_nvm_params_82575(hw); in igb_get_invariants_82575()
683 ret_val = igb_init_nvm_params_i210(hw); in igb_get_invariants_82575()
689 if (ret_val) in igb_get_invariants_82575()
703 ret_val = igb_init_phy_params_82575(hw); in igb_get_invariants_82575()
706 return ret_val; in igb_get_invariants_82575()
763 s32 ret_val = -E1000_ERR_PARAM; in igb_read_phy_reg_sgmii_82575() local
770 ret_val = hw->phy.ops.acquire(hw); in igb_read_phy_reg_sgmii_82575()
771 if (ret_val) in igb_read_phy_reg_sgmii_82575()
774 ret_val = igb_read_phy_reg_i2c(hw, offset, data); in igb_read_phy_reg_sgmii_82575()
779 return ret_val; in igb_read_phy_reg_sgmii_82575()
794 s32 ret_val = -E1000_ERR_PARAM; in igb_write_phy_reg_sgmii_82575() local
802 ret_val = hw->phy.ops.acquire(hw); in igb_write_phy_reg_sgmii_82575()
803 if (ret_val) in igb_write_phy_reg_sgmii_82575()
806 ret_val = igb_write_phy_reg_i2c(hw, offset, data); in igb_write_phy_reg_sgmii_82575()
811 return ret_val; in igb_write_phy_reg_sgmii_82575()
824 s32 ret_val = 0; in igb_get_phy_id_82575() local
841 ret_val = igb_get_phy_id(hw); in igb_get_phy_id_82575()
863 ret_val = -E1000_ERR_PHY; in igb_get_phy_id_82575()
866 ret_val = igb_get_phy_id(hw); in igb_get_phy_id_82575()
880 ret_val = igb_read_phy_reg_sgmii_82575(hw, PHY_ID1, &phy_id); in igb_get_phy_id_82575()
881 if (ret_val == 0) { in igb_get_phy_id_82575()
897 ret_val = -E1000_ERR_PHY; in igb_get_phy_id_82575()
900 ret_val = igb_get_phy_id(hw); in igb_get_phy_id_82575()
907 return ret_val; in igb_get_phy_id_82575()
919 s32 ret_val; in igb_phy_hw_reset_sgmii_82575() local
930 ret_val = hw->phy.ops.write_reg(hw, 0x1B, 0x8084); in igb_phy_hw_reset_sgmii_82575()
931 if (ret_val) in igb_phy_hw_reset_sgmii_82575()
934 ret_val = igb_phy_sw_reset(hw); in igb_phy_hw_reset_sgmii_82575()
935 if (ret_val) in igb_phy_hw_reset_sgmii_82575()
939 ret_val = igb_initialize_M88E1512_phy(hw); in igb_phy_hw_reset_sgmii_82575()
941 ret_val = igb_initialize_M88E1543_phy(hw); in igb_phy_hw_reset_sgmii_82575()
943 return ret_val; in igb_phy_hw_reset_sgmii_82575()
962 s32 ret_val; in igb_set_d0_lplu_state_82575() local
965 ret_val = phy->ops.read_reg(hw, IGP02E1000_PHY_POWER_MGMT, &data); in igb_set_d0_lplu_state_82575()
966 if (ret_val) in igb_set_d0_lplu_state_82575()
971 ret_val = phy->ops.write_reg(hw, IGP02E1000_PHY_POWER_MGMT, in igb_set_d0_lplu_state_82575()
973 if (ret_val) in igb_set_d0_lplu_state_82575()
977 ret_val = phy->ops.read_reg(hw, IGP01E1000_PHY_PORT_CONFIG, in igb_set_d0_lplu_state_82575()
980 ret_val = phy->ops.write_reg(hw, IGP01E1000_PHY_PORT_CONFIG, in igb_set_d0_lplu_state_82575()
982 if (ret_val) in igb_set_d0_lplu_state_82575()
986 ret_val = phy->ops.write_reg(hw, IGP02E1000_PHY_POWER_MGMT, in igb_set_d0_lplu_state_82575()
994 ret_val = phy->ops.read_reg(hw, in igb_set_d0_lplu_state_82575()
996 if (ret_val) in igb_set_d0_lplu_state_82575()
1000 ret_val = phy->ops.write_reg(hw, in igb_set_d0_lplu_state_82575()
1002 if (ret_val) in igb_set_d0_lplu_state_82575()
1005 ret_val = phy->ops.read_reg(hw, in igb_set_d0_lplu_state_82575()
1007 if (ret_val) in igb_set_d0_lplu_state_82575()
1011 ret_val = phy->ops.write_reg(hw, in igb_set_d0_lplu_state_82575()
1013 if (ret_val) in igb_set_d0_lplu_state_82575()
1019 return ret_val; in igb_set_d0_lplu_state_82575()
1119 s32 ret_val; in igb_acquire_nvm_82575() local
1121 ret_val = hw->mac.ops.acquire_swfw_sync(hw, E1000_SWFW_EEP_SM); in igb_acquire_nvm_82575()
1122 if (ret_val) in igb_acquire_nvm_82575()
1125 ret_val = igb_acquire_nvm(hw); in igb_acquire_nvm_82575()
1127 if (ret_val) in igb_acquire_nvm_82575()
1131 return ret_val; in igb_acquire_nvm_82575()
1160 s32 ret_val = 0; in igb_acquire_swfw_sync_82575() local
1165 ret_val = -E1000_ERR_SWFW_SYNC; in igb_acquire_swfw_sync_82575()
1183 ret_val = -E1000_ERR_SWFW_SYNC; in igb_acquire_swfw_sync_82575()
1193 return ret_val; in igb_acquire_swfw_sync_82575()
1270 s32 ret_val; in igb_get_link_up_info_82575() local
1273 ret_val = igb_get_pcs_speed_and_duplex_82575(hw, speed, in igb_get_link_up_info_82575()
1276 ret_val = igb_get_speed_and_duplex_copper(hw, speed, in igb_get_link_up_info_82575()
1279 return ret_val; in igb_get_link_up_info_82575()
1291 s32 ret_val; in igb_check_for_link_82575() local
1295 ret_val = igb_get_pcs_speed_and_duplex_82575(hw, &speed, in igb_check_for_link_82575()
1308 ret_val = igb_config_fc_after_link_up(hw); in igb_check_for_link_82575()
1309 if (ret_val) in igb_check_for_link_82575()
1312 ret_val = igb_check_for_copper_link(hw); in igb_check_for_link_82575()
1315 return ret_val; in igb_check_for_link_82575()
1452 s32 ret_val; in igb_reset_hw_82575() local
1457 ret_val = igb_disable_pcie_master(hw); in igb_reset_hw_82575()
1458 if (ret_val) in igb_reset_hw_82575()
1462 ret_val = igb_set_pcie_completion_timeout(hw); in igb_reset_hw_82575()
1463 if (ret_val) in igb_reset_hw_82575()
1480 ret_val = igb_get_auto_rd_done(hw); in igb_reset_hw_82575()
1481 if (ret_val) { in igb_reset_hw_82575()
1498 ret_val = igb_check_alt_mac_addr(hw); in igb_reset_hw_82575()
1500 return ret_val; in igb_reset_hw_82575()
1512 s32 ret_val; in igb_init_hw_82575() local
1517 ret_val = igb_pll_workaround_i210(hw); in igb_init_hw_82575()
1518 if (ret_val) in igb_init_hw_82575()
1519 return ret_val; in igb_init_hw_82575()
1523 ret_val = igb_id_led_init(hw); in igb_init_hw_82575()
1524 if (ret_val) { in igb_init_hw_82575()
1547 ret_val = igb_setup_link(hw); in igb_init_hw_82575()
1555 return ret_val; in igb_init_hw_82575()
1569 s32 ret_val; in igb_setup_copper_link_82575() local
1591 ret_val = igb_setup_serdes_link_82575(hw); in igb_setup_copper_link_82575()
1592 if (ret_val) in igb_setup_copper_link_82575()
1599 ret_val = hw->phy.ops.reset(hw); in igb_setup_copper_link_82575()
1600 if (ret_val) { in igb_setup_copper_link_82575()
1614 ret_val = igb_copper_link_setup_m88_gen2(hw); in igb_setup_copper_link_82575()
1617 ret_val = igb_copper_link_setup_m88(hw); in igb_setup_copper_link_82575()
1622 ret_val = igb_copper_link_setup_igp(hw); in igb_setup_copper_link_82575()
1625 ret_val = igb_copper_link_setup_82580(hw); in igb_setup_copper_link_82575()
1628 ret_val = 0; in igb_setup_copper_link_82575()
1631 ret_val = -E1000_ERR_PHY; in igb_setup_copper_link_82575()
1635 if (ret_val) in igb_setup_copper_link_82575()
1638 ret_val = igb_setup_copper_link(hw); in igb_setup_copper_link_82575()
1640 return ret_val; in igb_setup_copper_link_82575()
1656 s32 ret_val = 0; in igb_setup_serdes_link_82575() local
1661 return ret_val; in igb_setup_serdes_link_82575()
1709 ret_val = hw->nvm.ops.read(hw, NVM_COMPAT, 1, &data); in igb_setup_serdes_link_82575()
1710 if (ret_val) { in igb_setup_serdes_link_82575()
1712 return ret_val; in igb_setup_serdes_link_82575()
1782 return ret_val; in igb_setup_serdes_link_82575()
1841 s32 ret_val = 0; in igb_read_mac_addr_82575() local
1847 ret_val = igb_check_alt_mac_addr(hw); in igb_read_mac_addr_82575()
1848 if (ret_val) in igb_read_mac_addr_82575()
1851 ret_val = igb_read_mac_addr(hw); in igb_read_mac_addr_82575()
1854 return ret_val; in igb_read_mac_addr_82575()
2024 s32 ret_val = 0; in igb_set_pcie_completion_timeout() local
2043 ret_val = igb_read_pcie_cap_reg(hw, PCIE_DEVICE_CONTROL2, in igb_set_pcie_completion_timeout()
2045 if (ret_val) in igb_set_pcie_completion_timeout()
2050 ret_val = igb_write_pcie_cap_reg(hw, PCIE_DEVICE_CONTROL2, in igb_set_pcie_completion_timeout()
2057 return ret_val; in igb_set_pcie_completion_timeout()
2165 s32 ret_val; in igb_read_phy_reg_82580() local
2167 ret_val = hw->phy.ops.acquire(hw); in igb_read_phy_reg_82580()
2168 if (ret_val) in igb_read_phy_reg_82580()
2171 ret_val = igb_read_phy_reg_mdic(hw, offset, data); in igb_read_phy_reg_82580()
2176 return ret_val; in igb_read_phy_reg_82580()
2189 s32 ret_val; in igb_write_phy_reg_82580() local
2192 ret_val = hw->phy.ops.acquire(hw); in igb_write_phy_reg_82580()
2193 if (ret_val) in igb_write_phy_reg_82580()
2196 ret_val = igb_write_phy_reg_mdic(hw, offset, data); in igb_write_phy_reg_82580()
2201 return ret_val; in igb_write_phy_reg_82580()
2214 s32 ret_val = 0; in igb_reset_mdicnfg_82580() local
2223 ret_val = hw->nvm.ops.read(hw, NVM_INIT_CONTROL3_PORT_A + in igb_reset_mdicnfg_82580()
2226 if (ret_val) { in igb_reset_mdicnfg_82580()
2238 return ret_val; in igb_reset_mdicnfg_82580()
2250 s32 ret_val = 0; in igb_reset_hw_82580() local
2270 ret_val = igb_disable_pcie_master(hw); in igb_reset_hw_82580()
2271 if (ret_val) in igb_reset_hw_82580()
2300 ret_val = igb_get_auto_rd_done(hw); in igb_reset_hw_82580()
2301 if (ret_val) { in igb_reset_hw_82580()
2316 ret_val = igb_reset_mdicnfg_82580(hw); in igb_reset_hw_82580()
2317 if (ret_val) in igb_reset_hw_82580()
2321 ret_val = igb_check_alt_mac_addr(hw); in igb_reset_hw_82580()
2327 return ret_val; in igb_reset_hw_82580()
2342 u16 ret_val = 0; in igb_rxpbs_adjust_82580() local
2345 ret_val = e1000_82580_rxpbs_table[data]; in igb_rxpbs_adjust_82580()
2347 return ret_val; in igb_rxpbs_adjust_82580()
2362 s32 ret_val = 0; in igb_validate_nvm_checksum_with_offset() local
2367 ret_val = hw->nvm.ops.read(hw, i, 1, &nvm_data); in igb_validate_nvm_checksum_with_offset()
2368 if (ret_val) { in igb_validate_nvm_checksum_with_offset()
2377 ret_val = -E1000_ERR_NVM; in igb_validate_nvm_checksum_with_offset()
2382 return ret_val; in igb_validate_nvm_checksum_with_offset()
2397 s32 ret_val; in igb_update_nvm_checksum_with_offset() local
2402 ret_val = hw->nvm.ops.read(hw, i, 1, &nvm_data); in igb_update_nvm_checksum_with_offset()
2403 if (ret_val) { in igb_update_nvm_checksum_with_offset()
2410 ret_val = hw->nvm.ops.write(hw, (NVM_CHECKSUM_REG + offset), 1, in igb_update_nvm_checksum_with_offset()
2412 if (ret_val) in igb_update_nvm_checksum_with_offset()
2416 return ret_val; in igb_update_nvm_checksum_with_offset()
2429 s32 ret_val = 0; in igb_validate_nvm_checksum_82580() local
2434 ret_val = hw->nvm.ops.read(hw, NVM_COMPATIBILITY_REG_3, 1, &nvm_data); in igb_validate_nvm_checksum_82580()
2435 if (ret_val) { in igb_validate_nvm_checksum_82580()
2449 ret_val = igb_validate_nvm_checksum_with_offset(hw, in igb_validate_nvm_checksum_82580()
2451 if (ret_val != 0) in igb_validate_nvm_checksum_82580()
2456 return ret_val; in igb_validate_nvm_checksum_82580()
2469 s32 ret_val; in igb_update_nvm_checksum_82580() local
2473 ret_val = hw->nvm.ops.read(hw, NVM_COMPATIBILITY_REG_3, 1, &nvm_data); in igb_update_nvm_checksum_82580()
2474 if (ret_val) { in igb_update_nvm_checksum_82580()
2482 ret_val = hw->nvm.ops.write(hw, NVM_COMPATIBILITY_REG_3, 1, in igb_update_nvm_checksum_82580()
2484 if (ret_val) { in igb_update_nvm_checksum_82580()
2492 ret_val = igb_update_nvm_checksum_with_offset(hw, nvm_offset); in igb_update_nvm_checksum_82580()
2493 if (ret_val) in igb_update_nvm_checksum_82580()
2498 return ret_val; in igb_update_nvm_checksum_82580()
2511 s32 ret_val = 0; in igb_validate_nvm_checksum_i350() local
2517 ret_val = igb_validate_nvm_checksum_with_offset(hw, in igb_validate_nvm_checksum_i350()
2519 if (ret_val != 0) in igb_validate_nvm_checksum_i350()
2524 return ret_val; in igb_validate_nvm_checksum_i350()
2537 s32 ret_val = 0; in igb_update_nvm_checksum_i350() local
2543 ret_val = igb_update_nvm_checksum_with_offset(hw, nvm_offset); in igb_update_nvm_checksum_i350()
2544 if (ret_val != 0) in igb_update_nvm_checksum_i350()
2549 return ret_val; in igb_update_nvm_checksum_i350()
2562 s32 ret_val = 0; in __igb_access_emi_reg() local
2564 ret_val = hw->phy.ops.write_reg(hw, E1000_EMIADD, address); in __igb_access_emi_reg()
2565 if (ret_val) in __igb_access_emi_reg()
2566 return ret_val; in __igb_access_emi_reg()
2569 ret_val = hw->phy.ops.read_reg(hw, E1000_EMIDATA, data); in __igb_access_emi_reg()
2571 ret_val = hw->phy.ops.write_reg(hw, E1000_EMIDATA, *data); in __igb_access_emi_reg()
2573 return ret_val; in __igb_access_emi_reg()
2655 s32 ret_val = 0; in igb_set_eee_i354() local
2665 ret_val = phy->ops.write_reg(hw, E1000_M88E1543_PAGE_ADDR, 18); in igb_set_eee_i354()
2666 if (ret_val) in igb_set_eee_i354()
2669 ret_val = phy->ops.read_reg(hw, E1000_M88E1543_EEE_CTRL_1, in igb_set_eee_i354()
2671 if (ret_val) in igb_set_eee_i354()
2675 ret_val = phy->ops.write_reg(hw, E1000_M88E1543_EEE_CTRL_1, in igb_set_eee_i354()
2677 if (ret_val) in igb_set_eee_i354()
2681 ret_val = phy->ops.write_reg(hw, E1000_M88E1543_PAGE_ADDR, 0); in igb_set_eee_i354()
2682 if (ret_val) in igb_set_eee_i354()
2686 ret_val = igb_read_xmdio_reg(hw, E1000_EEE_ADV_ADDR_I354, in igb_set_eee_i354()
2689 if (ret_val) in igb_set_eee_i354()
2702 ret_val = igb_write_xmdio_reg(hw, E1000_EEE_ADV_ADDR_I354, in igb_set_eee_i354()
2707 ret_val = igb_read_xmdio_reg(hw, E1000_EEE_ADV_ADDR_I354, in igb_set_eee_i354()
2710 if (ret_val) in igb_set_eee_i354()
2715 ret_val = igb_write_xmdio_reg(hw, E1000_EEE_ADV_ADDR_I354, in igb_set_eee_i354()
2721 return ret_val; in igb_set_eee_i354()
2735 s32 ret_val = 0; in igb_get_eee_status_i354() local
2744 ret_val = igb_read_xmdio_reg(hw, E1000_PCS_STATUS_ADDR_I354, in igb_get_eee_status_i354()
2747 if (ret_val) in igb_get_eee_status_i354()
2754 return ret_val; in igb_get_eee_status_i354()