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
229 ret_val = igb_get_phy_id_82575(hw); in igb_init_phy_params_82575()
230 if (ret_val) in igb_init_phy_params_82575()
231 return ret_val; in igb_init_phy_params_82575()
253 ret_val = phy->ops.write_reg(hw, in igb_init_phy_params_82575()
256 if (ret_val) in igb_init_phy_params_82575()
259 ret_val = phy->ops.read_reg(hw, in igb_init_phy_params_82575()
262 if (ret_val) in igb_init_phy_params_82575()
273 ret_val = igb_initialize_M88E1512_phy(hw); in igb_init_phy_params_82575()
274 if (ret_val) in igb_init_phy_params_82575()
278 ret_val = igb_initialize_M88E1543_phy(hw); in igb_init_phy_params_82575()
279 if (ret_val) in igb_init_phy_params_82575()
315 ret_val = -E1000_ERR_PHY; in igb_init_phy_params_82575()
320 return ret_val; in igb_init_phy_params_82575()
494 s32 ret_val = E1000_ERR_CONFIG; in igb_set_sfp_media_type_82575() local
510 ret_val = igb_read_sfp_data_byte(hw, in igb_set_sfp_media_type_82575()
513 if (ret_val == 0) in igb_set_sfp_media_type_82575()
518 if (ret_val != 0) in igb_set_sfp_media_type_82575()
521 ret_val = igb_read_sfp_data_byte(hw, in igb_set_sfp_media_type_82575()
524 if (ret_val != 0) in igb_set_sfp_media_type_82575()
547 ret_val = 0; in igb_set_sfp_media_type_82575()
551 return ret_val; in igb_set_sfp_media_type_82575()
558 s32 ret_val; in igb_get_invariants_82575() local
644 ret_val = igb_set_sfp_media_type_82575(hw); in igb_get_invariants_82575()
645 if ((ret_val != 0) || in igb_get_invariants_82575()
676 ret_val = igb_init_mac_params_82575(hw); in igb_get_invariants_82575()
677 if (ret_val) in igb_get_invariants_82575()
681 ret_val = igb_init_nvm_params_82575(hw); in igb_get_invariants_82575()
685 ret_val = igb_init_nvm_params_i210(hw); in igb_get_invariants_82575()
691 if (ret_val) in igb_get_invariants_82575()
705 ret_val = igb_init_phy_params_82575(hw); in igb_get_invariants_82575()
708 return ret_val; in igb_get_invariants_82575()
765 s32 ret_val = -E1000_ERR_PARAM; in igb_read_phy_reg_sgmii_82575() local
772 ret_val = hw->phy.ops.acquire(hw); in igb_read_phy_reg_sgmii_82575()
773 if (ret_val) in igb_read_phy_reg_sgmii_82575()
776 ret_val = igb_read_phy_reg_i2c(hw, offset, data); in igb_read_phy_reg_sgmii_82575()
781 return ret_val; in igb_read_phy_reg_sgmii_82575()
796 s32 ret_val = -E1000_ERR_PARAM; in igb_write_phy_reg_sgmii_82575() local
804 ret_val = hw->phy.ops.acquire(hw); in igb_write_phy_reg_sgmii_82575()
805 if (ret_val) in igb_write_phy_reg_sgmii_82575()
808 ret_val = igb_write_phy_reg_i2c(hw, offset, data); in igb_write_phy_reg_sgmii_82575()
813 return ret_val; in igb_write_phy_reg_sgmii_82575()
826 s32 ret_val = 0; in igb_get_phy_id_82575() local
843 ret_val = igb_get_phy_id(hw); in igb_get_phy_id_82575()
865 ret_val = -E1000_ERR_PHY; in igb_get_phy_id_82575()
868 ret_val = igb_get_phy_id(hw); in igb_get_phy_id_82575()
882 ret_val = igb_read_phy_reg_sgmii_82575(hw, PHY_ID1, &phy_id); in igb_get_phy_id_82575()
883 if (ret_val == 0) { in igb_get_phy_id_82575()
899 ret_val = -E1000_ERR_PHY; in igb_get_phy_id_82575()
902 ret_val = igb_get_phy_id(hw); in igb_get_phy_id_82575()
909 return ret_val; in igb_get_phy_id_82575()
921 s32 ret_val; in igb_phy_hw_reset_sgmii_82575() local
932 ret_val = hw->phy.ops.write_reg(hw, 0x1B, 0x8084); in igb_phy_hw_reset_sgmii_82575()
933 if (ret_val) in igb_phy_hw_reset_sgmii_82575()
936 ret_val = igb_phy_sw_reset(hw); in igb_phy_hw_reset_sgmii_82575()
937 if (ret_val) in igb_phy_hw_reset_sgmii_82575()
941 ret_val = igb_initialize_M88E1512_phy(hw); in igb_phy_hw_reset_sgmii_82575()
943 ret_val = igb_initialize_M88E1543_phy(hw); in igb_phy_hw_reset_sgmii_82575()
945 return ret_val; in igb_phy_hw_reset_sgmii_82575()
964 s32 ret_val; in igb_set_d0_lplu_state_82575() local
967 ret_val = phy->ops.read_reg(hw, IGP02E1000_PHY_POWER_MGMT, &data); in igb_set_d0_lplu_state_82575()
968 if (ret_val) in igb_set_d0_lplu_state_82575()
973 ret_val = phy->ops.write_reg(hw, IGP02E1000_PHY_POWER_MGMT, in igb_set_d0_lplu_state_82575()
975 if (ret_val) in igb_set_d0_lplu_state_82575()
979 ret_val = phy->ops.read_reg(hw, IGP01E1000_PHY_PORT_CONFIG, in igb_set_d0_lplu_state_82575()
982 ret_val = phy->ops.write_reg(hw, IGP01E1000_PHY_PORT_CONFIG, in igb_set_d0_lplu_state_82575()
984 if (ret_val) in igb_set_d0_lplu_state_82575()
988 ret_val = phy->ops.write_reg(hw, IGP02E1000_PHY_POWER_MGMT, in igb_set_d0_lplu_state_82575()
996 ret_val = phy->ops.read_reg(hw, in igb_set_d0_lplu_state_82575()
998 if (ret_val) in igb_set_d0_lplu_state_82575()
1002 ret_val = phy->ops.write_reg(hw, in igb_set_d0_lplu_state_82575()
1004 if (ret_val) in igb_set_d0_lplu_state_82575()
1007 ret_val = phy->ops.read_reg(hw, in igb_set_d0_lplu_state_82575()
1009 if (ret_val) in igb_set_d0_lplu_state_82575()
1013 ret_val = phy->ops.write_reg(hw, in igb_set_d0_lplu_state_82575()
1015 if (ret_val) in igb_set_d0_lplu_state_82575()
1021 return ret_val; in igb_set_d0_lplu_state_82575()
1121 s32 ret_val; in igb_acquire_nvm_82575() local
1123 ret_val = hw->mac.ops.acquire_swfw_sync(hw, E1000_SWFW_EEP_SM); in igb_acquire_nvm_82575()
1124 if (ret_val) in igb_acquire_nvm_82575()
1127 ret_val = igb_acquire_nvm(hw); in igb_acquire_nvm_82575()
1129 if (ret_val) in igb_acquire_nvm_82575()
1133 return ret_val; in igb_acquire_nvm_82575()
1162 s32 ret_val = 0; in igb_acquire_swfw_sync_82575() local
1167 ret_val = -E1000_ERR_SWFW_SYNC; in igb_acquire_swfw_sync_82575()
1185 ret_val = -E1000_ERR_SWFW_SYNC; in igb_acquire_swfw_sync_82575()
1195 return ret_val; in igb_acquire_swfw_sync_82575()
1272 s32 ret_val; in igb_get_link_up_info_82575() local
1275 ret_val = igb_get_pcs_speed_and_duplex_82575(hw, speed, in igb_get_link_up_info_82575()
1278 ret_val = igb_get_speed_and_duplex_copper(hw, speed, in igb_get_link_up_info_82575()
1281 return ret_val; in igb_get_link_up_info_82575()
1293 s32 ret_val; in igb_check_for_link_82575() local
1297 ret_val = igb_get_pcs_speed_and_duplex_82575(hw, &speed, in igb_check_for_link_82575()
1310 ret_val = igb_config_fc_after_link_up(hw); in igb_check_for_link_82575()
1311 if (ret_val) in igb_check_for_link_82575()
1314 ret_val = igb_check_for_copper_link(hw); in igb_check_for_link_82575()
1317 return ret_val; in igb_check_for_link_82575()
1454 s32 ret_val; in igb_reset_hw_82575() local
1459 ret_val = igb_disable_pcie_master(hw); in igb_reset_hw_82575()
1460 if (ret_val) in igb_reset_hw_82575()
1464 ret_val = igb_set_pcie_completion_timeout(hw); in igb_reset_hw_82575()
1465 if (ret_val) in igb_reset_hw_82575()
1482 ret_val = igb_get_auto_rd_done(hw); in igb_reset_hw_82575()
1483 if (ret_val) { in igb_reset_hw_82575()
1500 ret_val = igb_check_alt_mac_addr(hw); in igb_reset_hw_82575()
1502 return ret_val; in igb_reset_hw_82575()
1514 s32 ret_val; in igb_init_hw_82575() local
1519 ret_val = igb_pll_workaround_i210(hw); in igb_init_hw_82575()
1520 if (ret_val) in igb_init_hw_82575()
1521 return ret_val; in igb_init_hw_82575()
1525 ret_val = igb_id_led_init(hw); in igb_init_hw_82575()
1526 if (ret_val) { in igb_init_hw_82575()
1549 ret_val = igb_setup_link(hw); in igb_init_hw_82575()
1557 return ret_val; in igb_init_hw_82575()
1571 s32 ret_val; in igb_setup_copper_link_82575() local
1593 ret_val = igb_setup_serdes_link_82575(hw); in igb_setup_copper_link_82575()
1594 if (ret_val) in igb_setup_copper_link_82575()
1601 ret_val = hw->phy.ops.reset(hw); in igb_setup_copper_link_82575()
1602 if (ret_val) { in igb_setup_copper_link_82575()
1616 ret_val = igb_copper_link_setup_m88_gen2(hw); in igb_setup_copper_link_82575()
1619 ret_val = igb_copper_link_setup_m88(hw); in igb_setup_copper_link_82575()
1624 ret_val = igb_copper_link_setup_igp(hw); in igb_setup_copper_link_82575()
1627 ret_val = igb_copper_link_setup_82580(hw); in igb_setup_copper_link_82575()
1630 ret_val = 0; in igb_setup_copper_link_82575()
1633 ret_val = -E1000_ERR_PHY; in igb_setup_copper_link_82575()
1637 if (ret_val) in igb_setup_copper_link_82575()
1640 ret_val = igb_setup_copper_link(hw); in igb_setup_copper_link_82575()
1642 return ret_val; in igb_setup_copper_link_82575()
1658 s32 ret_val = 0; in igb_setup_serdes_link_82575() local
1663 return ret_val; in igb_setup_serdes_link_82575()
1711 ret_val = hw->nvm.ops.read(hw, NVM_COMPAT, 1, &data); in igb_setup_serdes_link_82575()
1712 if (ret_val) { in igb_setup_serdes_link_82575()
1714 return ret_val; in igb_setup_serdes_link_82575()
1784 return ret_val; in igb_setup_serdes_link_82575()
1843 s32 ret_val = 0; in igb_read_mac_addr_82575() local
1849 ret_val = igb_check_alt_mac_addr(hw); in igb_read_mac_addr_82575()
1850 if (ret_val) in igb_read_mac_addr_82575()
1853 ret_val = igb_read_mac_addr(hw); in igb_read_mac_addr_82575()
1856 return ret_val; in igb_read_mac_addr_82575()
2026 s32 ret_val = 0; in igb_set_pcie_completion_timeout() local
2045 ret_val = igb_read_pcie_cap_reg(hw, PCIE_DEVICE_CONTROL2, in igb_set_pcie_completion_timeout()
2047 if (ret_val) in igb_set_pcie_completion_timeout()
2052 ret_val = igb_write_pcie_cap_reg(hw, PCIE_DEVICE_CONTROL2, in igb_set_pcie_completion_timeout()
2059 return ret_val; in igb_set_pcie_completion_timeout()
2167 s32 ret_val; in igb_read_phy_reg_82580() local
2169 ret_val = hw->phy.ops.acquire(hw); in igb_read_phy_reg_82580()
2170 if (ret_val) in igb_read_phy_reg_82580()
2173 ret_val = igb_read_phy_reg_mdic(hw, offset, data); in igb_read_phy_reg_82580()
2178 return ret_val; in igb_read_phy_reg_82580()
2191 s32 ret_val; in igb_write_phy_reg_82580() local
2194 ret_val = hw->phy.ops.acquire(hw); in igb_write_phy_reg_82580()
2195 if (ret_val) in igb_write_phy_reg_82580()
2198 ret_val = igb_write_phy_reg_mdic(hw, offset, data); in igb_write_phy_reg_82580()
2203 return ret_val; in igb_write_phy_reg_82580()
2216 s32 ret_val = 0; in igb_reset_mdicnfg_82580() local
2225 ret_val = hw->nvm.ops.read(hw, NVM_INIT_CONTROL3_PORT_A + in igb_reset_mdicnfg_82580()
2228 if (ret_val) { in igb_reset_mdicnfg_82580()
2240 return ret_val; in igb_reset_mdicnfg_82580()
2252 s32 ret_val = 0; in igb_reset_hw_82580() local
2272 ret_val = igb_disable_pcie_master(hw); in igb_reset_hw_82580()
2273 if (ret_val) in igb_reset_hw_82580()
2302 ret_val = igb_get_auto_rd_done(hw); in igb_reset_hw_82580()
2303 if (ret_val) { in igb_reset_hw_82580()
2318 ret_val = igb_reset_mdicnfg_82580(hw); in igb_reset_hw_82580()
2319 if (ret_val) in igb_reset_hw_82580()
2323 ret_val = igb_check_alt_mac_addr(hw); in igb_reset_hw_82580()
2329 return ret_val; in igb_reset_hw_82580()
2344 u16 ret_val = 0; in igb_rxpbs_adjust_82580() local
2347 ret_val = e1000_82580_rxpbs_table[data]; in igb_rxpbs_adjust_82580()
2349 return ret_val; in igb_rxpbs_adjust_82580()
2364 s32 ret_val = 0; in igb_validate_nvm_checksum_with_offset() local
2369 ret_val = hw->nvm.ops.read(hw, i, 1, &nvm_data); in igb_validate_nvm_checksum_with_offset()
2370 if (ret_val) { in igb_validate_nvm_checksum_with_offset()
2379 ret_val = -E1000_ERR_NVM; in igb_validate_nvm_checksum_with_offset()
2384 return ret_val; in igb_validate_nvm_checksum_with_offset()
2399 s32 ret_val; in igb_update_nvm_checksum_with_offset() local
2404 ret_val = hw->nvm.ops.read(hw, i, 1, &nvm_data); in igb_update_nvm_checksum_with_offset()
2405 if (ret_val) { in igb_update_nvm_checksum_with_offset()
2412 ret_val = hw->nvm.ops.write(hw, (NVM_CHECKSUM_REG + offset), 1, in igb_update_nvm_checksum_with_offset()
2414 if (ret_val) in igb_update_nvm_checksum_with_offset()
2418 return ret_val; in igb_update_nvm_checksum_with_offset()
2431 s32 ret_val = 0; in igb_validate_nvm_checksum_82580() local
2436 ret_val = hw->nvm.ops.read(hw, NVM_COMPATIBILITY_REG_3, 1, &nvm_data); in igb_validate_nvm_checksum_82580()
2437 if (ret_val) { in igb_validate_nvm_checksum_82580()
2451 ret_val = igb_validate_nvm_checksum_with_offset(hw, in igb_validate_nvm_checksum_82580()
2453 if (ret_val != 0) in igb_validate_nvm_checksum_82580()
2458 return ret_val; in igb_validate_nvm_checksum_82580()
2471 s32 ret_val; in igb_update_nvm_checksum_82580() local
2475 ret_val = hw->nvm.ops.read(hw, NVM_COMPATIBILITY_REG_3, 1, &nvm_data); in igb_update_nvm_checksum_82580()
2476 if (ret_val) { in igb_update_nvm_checksum_82580()
2484 ret_val = hw->nvm.ops.write(hw, NVM_COMPATIBILITY_REG_3, 1, in igb_update_nvm_checksum_82580()
2486 if (ret_val) { in igb_update_nvm_checksum_82580()
2494 ret_val = igb_update_nvm_checksum_with_offset(hw, nvm_offset); in igb_update_nvm_checksum_82580()
2495 if (ret_val) in igb_update_nvm_checksum_82580()
2500 return ret_val; in igb_update_nvm_checksum_82580()
2513 s32 ret_val = 0; in igb_validate_nvm_checksum_i350() local
2519 ret_val = igb_validate_nvm_checksum_with_offset(hw, in igb_validate_nvm_checksum_i350()
2521 if (ret_val != 0) in igb_validate_nvm_checksum_i350()
2526 return ret_val; in igb_validate_nvm_checksum_i350()
2539 s32 ret_val = 0; in igb_update_nvm_checksum_i350() local
2545 ret_val = igb_update_nvm_checksum_with_offset(hw, nvm_offset); in igb_update_nvm_checksum_i350()
2546 if (ret_val != 0) in igb_update_nvm_checksum_i350()
2551 return ret_val; in igb_update_nvm_checksum_i350()
2564 s32 ret_val = 0; in __igb_access_emi_reg() local
2566 ret_val = hw->phy.ops.write_reg(hw, E1000_EMIADD, address); in __igb_access_emi_reg()
2567 if (ret_val) in __igb_access_emi_reg()
2568 return ret_val; in __igb_access_emi_reg()
2571 ret_val = hw->phy.ops.read_reg(hw, E1000_EMIDATA, data); in __igb_access_emi_reg()
2573 ret_val = hw->phy.ops.write_reg(hw, E1000_EMIDATA, *data); in __igb_access_emi_reg()
2575 return ret_val; in __igb_access_emi_reg()
2657 s32 ret_val = 0; in igb_set_eee_i354() local
2667 ret_val = phy->ops.write_reg(hw, E1000_M88E1543_PAGE_ADDR, 18); in igb_set_eee_i354()
2668 if (ret_val) in igb_set_eee_i354()
2671 ret_val = phy->ops.read_reg(hw, E1000_M88E1543_EEE_CTRL_1, in igb_set_eee_i354()
2673 if (ret_val) in igb_set_eee_i354()
2677 ret_val = phy->ops.write_reg(hw, E1000_M88E1543_EEE_CTRL_1, in igb_set_eee_i354()
2679 if (ret_val) in igb_set_eee_i354()
2683 ret_val = phy->ops.write_reg(hw, E1000_M88E1543_PAGE_ADDR, 0); in igb_set_eee_i354()
2684 if (ret_val) in igb_set_eee_i354()
2688 ret_val = igb_read_xmdio_reg(hw, E1000_EEE_ADV_ADDR_I354, in igb_set_eee_i354()
2691 if (ret_val) in igb_set_eee_i354()
2704 ret_val = igb_write_xmdio_reg(hw, E1000_EEE_ADV_ADDR_I354, in igb_set_eee_i354()
2709 ret_val = igb_read_xmdio_reg(hw, E1000_EEE_ADV_ADDR_I354, in igb_set_eee_i354()
2712 if (ret_val) in igb_set_eee_i354()
2717 ret_val = igb_write_xmdio_reg(hw, E1000_EEE_ADV_ADDR_I354, in igb_set_eee_i354()
2723 return ret_val; in igb_set_eee_i354()
2737 s32 ret_val = 0; in igb_get_eee_status_i354() local
2746 ret_val = igb_read_xmdio_reg(hw, E1000_PCS_STATUS_ADDR_I354, in igb_get_eee_status_i354()
2749 if (ret_val) in igb_get_eee_status_i354()
2756 return ret_val; in igb_get_eee_status_i354()