Lines Matching refs:ret_val

34 	s32 ret_val = 0;  in igc_get_phy_id()  local
37 ret_val = phy->ops.read_reg(hw, PHY_ID1, &phy_id); in igc_get_phy_id()
38 if (ret_val) in igc_get_phy_id()
43 ret_val = phy->ops.read_reg(hw, PHY_ID2, &phy_id); in igc_get_phy_id()
44 if (ret_val) in igc_get_phy_id()
51 return ret_val; in igc_get_phy_id()
67 s32 ret_val = 0; in igc_phy_has_link() local
74 ret_val = hw->phy.ops.read_reg(hw, PHY_STATUS, &phy_status); in igc_phy_has_link()
75 if (ret_val && usec_interval > 0) { in igc_phy_has_link()
85 ret_val = hw->phy.ops.read_reg(hw, PHY_STATUS, &phy_status); in igc_phy_has_link()
86 if (ret_val) in igc_phy_has_link()
98 return ret_val; in igc_phy_has_link()
151 s32 ret_val; in igc_check_downshift() local
158 ret_val = 0; in igc_check_downshift()
161 return ret_val; in igc_check_downshift()
177 s32 ret_val; in igc_phy_hw_reset() local
180 ret_val = igc_check_reset_block(hw); in igc_phy_hw_reset()
181 if (ret_val) { in igc_phy_hw_reset()
182 ret_val = 0; in igc_phy_hw_reset()
186 ret_val = phy->ops.acquire(hw); in igc_phy_hw_reset()
187 if (ret_val) in igc_phy_hw_reset()
217 return ret_val; in igc_phy_hw_reset()
235 s32 ret_val; in igc_phy_setup_autoneg() local
240 ret_val = phy->ops.read_reg(hw, PHY_AUTONEG_ADV, &mii_autoneg_adv_reg); in igc_phy_setup_autoneg()
241 if (ret_val) in igc_phy_setup_autoneg()
242 return ret_val; in igc_phy_setup_autoneg()
246 ret_val = phy->ops.read_reg(hw, PHY_1000T_CTRL, in igc_phy_setup_autoneg()
248 if (ret_val) in igc_phy_setup_autoneg()
249 return ret_val; in igc_phy_setup_autoneg()
254 ret_val = phy->ops.read_reg(hw, (STANDARD_AN_REG_MASK << in igc_phy_setup_autoneg()
259 if (ret_val) in igc_phy_setup_autoneg()
260 return ret_val; in igc_phy_setup_autoneg()
382 ret_val = phy->ops.write_reg(hw, PHY_AUTONEG_ADV, mii_autoneg_adv_reg); in igc_phy_setup_autoneg()
383 if (ret_val) in igc_phy_setup_autoneg()
384 return ret_val; in igc_phy_setup_autoneg()
389 ret_val = phy->ops.write_reg(hw, PHY_1000T_CTRL, in igc_phy_setup_autoneg()
393 ret_val = phy->ops.write_reg(hw, in igc_phy_setup_autoneg()
399 return ret_val; in igc_phy_setup_autoneg()
412 s32 ret_val = 0; in igc_wait_autoneg() local
416 ret_val = hw->phy.ops.read_reg(hw, PHY_STATUS, &phy_status); in igc_wait_autoneg()
417 if (ret_val) in igc_wait_autoneg()
419 ret_val = hw->phy.ops.read_reg(hw, PHY_STATUS, &phy_status); in igc_wait_autoneg()
420 if (ret_val) in igc_wait_autoneg()
430 return ret_val; in igc_wait_autoneg()
446 s32 ret_val; in igc_copper_link_autoneg() local
460 ret_val = igc_phy_setup_autoneg(hw); in igc_copper_link_autoneg()
461 if (ret_val) { in igc_copper_link_autoneg()
470 ret_val = phy->ops.read_reg(hw, PHY_CONTROL, &phy_ctrl); in igc_copper_link_autoneg()
471 if (ret_val) in igc_copper_link_autoneg()
475 ret_val = phy->ops.write_reg(hw, PHY_CONTROL, phy_ctrl); in igc_copper_link_autoneg()
476 if (ret_val) in igc_copper_link_autoneg()
483 ret_val = igc_wait_autoneg(hw); in igc_copper_link_autoneg()
484 if (ret_val) { in igc_copper_link_autoneg()
493 return ret_val; in igc_copper_link_autoneg()
507 s32 ret_val = 0; in igc_setup_copper_link() local
514 ret_val = igc_copper_link_autoneg(hw); in igc_setup_copper_link()
515 if (ret_val) in igc_setup_copper_link()
522 ret_val = hw->phy.ops.force_speed_duplex(hw); in igc_setup_copper_link()
523 if (ret_val) { in igc_setup_copper_link()
532 ret_val = igc_phy_has_link(hw, COPPER_LINK_UP_LIMIT, 10, &link); in igc_setup_copper_link()
533 if (ret_val) in igc_setup_copper_link()
539 ret_val = igc_config_fc_after_link_up(hw); in igc_setup_copper_link()
545 return ret_val; in igc_setup_copper_link()
561 s32 ret_val = 0; in igc_read_phy_reg_mdic() local
565 ret_val = -IGC_ERR_PARAM; in igc_read_phy_reg_mdic()
591 ret_val = -IGC_ERR_PHY; in igc_read_phy_reg_mdic()
596 ret_val = -IGC_ERR_PHY; in igc_read_phy_reg_mdic()
602 return ret_val; in igc_read_phy_reg_mdic()
617 s32 ret_val = 0; in igc_write_phy_reg_mdic() local
621 ret_val = -IGC_ERR_PARAM; in igc_write_phy_reg_mdic()
648 ret_val = -IGC_ERR_PHY; in igc_write_phy_reg_mdic()
653 ret_val = -IGC_ERR_PHY; in igc_write_phy_reg_mdic()
658 return ret_val; in igc_write_phy_reg_mdic()
672 s32 ret_val; in __igc_access_xmdio_reg() local
674 ret_val = hw->phy.ops.write_reg(hw, IGC_MMDAC, dev_addr); in __igc_access_xmdio_reg()
675 if (ret_val) in __igc_access_xmdio_reg()
676 return ret_val; in __igc_access_xmdio_reg()
678 ret_val = hw->phy.ops.write_reg(hw, IGC_MMDAAD, address); in __igc_access_xmdio_reg()
679 if (ret_val) in __igc_access_xmdio_reg()
680 return ret_val; in __igc_access_xmdio_reg()
682 ret_val = hw->phy.ops.write_reg(hw, IGC_MMDAC, IGC_MMDAC_FUNC_DATA | in __igc_access_xmdio_reg()
684 if (ret_val) in __igc_access_xmdio_reg()
685 return ret_val; in __igc_access_xmdio_reg()
688 ret_val = hw->phy.ops.read_reg(hw, IGC_MMDAAD, data); in __igc_access_xmdio_reg()
690 ret_val = hw->phy.ops.write_reg(hw, IGC_MMDAAD, *data); in __igc_access_xmdio_reg()
691 if (ret_val) in __igc_access_xmdio_reg()
692 return ret_val; in __igc_access_xmdio_reg()
695 ret_val = hw->phy.ops.write_reg(hw, IGC_MMDAC, 0); in __igc_access_xmdio_reg()
696 if (ret_val) in __igc_access_xmdio_reg()
697 return ret_val; in __igc_access_xmdio_reg()
699 return ret_val; in __igc_access_xmdio_reg()
740 s32 ret_val; in igc_write_phy_reg_gpy() local
745 ret_val = hw->phy.ops.acquire(hw); in igc_write_phy_reg_gpy()
746 if (ret_val) in igc_write_phy_reg_gpy()
747 return ret_val; in igc_write_phy_reg_gpy()
748 ret_val = igc_write_phy_reg_mdic(hw, offset, data); in igc_write_phy_reg_gpy()
749 if (ret_val) in igc_write_phy_reg_gpy()
750 return ret_val; in igc_write_phy_reg_gpy()
753 ret_val = igc_write_xmdio_reg(hw, (u16)offset, dev_addr, in igc_write_phy_reg_gpy()
757 return ret_val; in igc_write_phy_reg_gpy()
773 s32 ret_val; in igc_read_phy_reg_gpy() local
778 ret_val = hw->phy.ops.acquire(hw); in igc_read_phy_reg_gpy()
779 if (ret_val) in igc_read_phy_reg_gpy()
780 return ret_val; in igc_read_phy_reg_gpy()
781 ret_val = igc_read_phy_reg_mdic(hw, offset, data); in igc_read_phy_reg_gpy()
782 if (ret_val) in igc_read_phy_reg_gpy()
783 return ret_val; in igc_read_phy_reg_gpy()
786 ret_val = igc_read_xmdio_reg(hw, (u16)offset, dev_addr, in igc_read_phy_reg_gpy()
790 return ret_val; in igc_read_phy_reg_gpy()
801 u16 ret_val; in igc_read_phy_fw_version() local
804 ret_val = phy->ops.read_reg(hw, IGC_GPHY_VERSION, &gphy_version); in igc_read_phy_fw_version()
805 if (ret_val) in igc_read_phy_fw_version()