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()
167 s32 ret_val; in igc_phy_hw_reset() local
170 ret_val = igc_check_reset_block(hw); in igc_phy_hw_reset()
171 if (ret_val) { in igc_phy_hw_reset()
172 ret_val = 0; in igc_phy_hw_reset()
176 ret_val = phy->ops.acquire(hw); in igc_phy_hw_reset()
177 if (ret_val) in igc_phy_hw_reset()
207 return ret_val; in igc_phy_hw_reset()
225 s32 ret_val; in igc_phy_setup_autoneg() local
230 ret_val = phy->ops.read_reg(hw, PHY_AUTONEG_ADV, &mii_autoneg_adv_reg); in igc_phy_setup_autoneg()
231 if (ret_val) in igc_phy_setup_autoneg()
232 return ret_val; in igc_phy_setup_autoneg()
236 ret_val = phy->ops.read_reg(hw, PHY_1000T_CTRL, in igc_phy_setup_autoneg()
238 if (ret_val) in igc_phy_setup_autoneg()
239 return ret_val; in igc_phy_setup_autoneg()
244 ret_val = phy->ops.read_reg(hw, (STANDARD_AN_REG_MASK << in igc_phy_setup_autoneg()
249 if (ret_val) in igc_phy_setup_autoneg()
250 return ret_val; in igc_phy_setup_autoneg()
372 ret_val = phy->ops.write_reg(hw, PHY_AUTONEG_ADV, mii_autoneg_adv_reg); in igc_phy_setup_autoneg()
373 if (ret_val) in igc_phy_setup_autoneg()
374 return ret_val; in igc_phy_setup_autoneg()
379 ret_val = phy->ops.write_reg(hw, PHY_1000T_CTRL, in igc_phy_setup_autoneg()
383 ret_val = phy->ops.write_reg(hw, in igc_phy_setup_autoneg()
389 return ret_val; in igc_phy_setup_autoneg()
402 s32 ret_val = 0; in igc_wait_autoneg() local
406 ret_val = hw->phy.ops.read_reg(hw, PHY_STATUS, &phy_status); in igc_wait_autoneg()
407 if (ret_val) in igc_wait_autoneg()
409 ret_val = hw->phy.ops.read_reg(hw, PHY_STATUS, &phy_status); in igc_wait_autoneg()
410 if (ret_val) in igc_wait_autoneg()
420 return ret_val; in igc_wait_autoneg()
436 s32 ret_val; in igc_copper_link_autoneg() local
450 ret_val = igc_phy_setup_autoneg(hw); in igc_copper_link_autoneg()
451 if (ret_val) { in igc_copper_link_autoneg()
460 ret_val = phy->ops.read_reg(hw, PHY_CONTROL, &phy_ctrl); in igc_copper_link_autoneg()
461 if (ret_val) in igc_copper_link_autoneg()
465 ret_val = phy->ops.write_reg(hw, PHY_CONTROL, phy_ctrl); in igc_copper_link_autoneg()
466 if (ret_val) in igc_copper_link_autoneg()
473 ret_val = igc_wait_autoneg(hw); in igc_copper_link_autoneg()
474 if (ret_val) { in igc_copper_link_autoneg()
483 return ret_val; in igc_copper_link_autoneg()
497 s32 ret_val = 0; in igc_setup_copper_link() local
504 ret_val = igc_copper_link_autoneg(hw); in igc_setup_copper_link()
505 if (ret_val) in igc_setup_copper_link()
512 ret_val = hw->phy.ops.force_speed_duplex(hw); in igc_setup_copper_link()
513 if (ret_val) { in igc_setup_copper_link()
522 ret_val = igc_phy_has_link(hw, COPPER_LINK_UP_LIMIT, 10, &link); in igc_setup_copper_link()
523 if (ret_val) in igc_setup_copper_link()
529 ret_val = igc_config_fc_after_link_up(hw); in igc_setup_copper_link()
535 return ret_val; in igc_setup_copper_link()
551 s32 ret_val = 0; in igc_read_phy_reg_mdic() local
555 ret_val = -IGC_ERR_PARAM; in igc_read_phy_reg_mdic()
581 ret_val = -IGC_ERR_PHY; in igc_read_phy_reg_mdic()
586 ret_val = -IGC_ERR_PHY; in igc_read_phy_reg_mdic()
592 return ret_val; in igc_read_phy_reg_mdic()
607 s32 ret_val = 0; in igc_write_phy_reg_mdic() local
611 ret_val = -IGC_ERR_PARAM; in igc_write_phy_reg_mdic()
638 ret_val = -IGC_ERR_PHY; in igc_write_phy_reg_mdic()
643 ret_val = -IGC_ERR_PHY; in igc_write_phy_reg_mdic()
648 return ret_val; in igc_write_phy_reg_mdic()
662 s32 ret_val; in __igc_access_xmdio_reg() local
664 ret_val = hw->phy.ops.write_reg(hw, IGC_MMDAC, dev_addr); in __igc_access_xmdio_reg()
665 if (ret_val) in __igc_access_xmdio_reg()
666 return ret_val; in __igc_access_xmdio_reg()
668 ret_val = hw->phy.ops.write_reg(hw, IGC_MMDAAD, address); in __igc_access_xmdio_reg()
669 if (ret_val) in __igc_access_xmdio_reg()
670 return ret_val; in __igc_access_xmdio_reg()
672 ret_val = hw->phy.ops.write_reg(hw, IGC_MMDAC, IGC_MMDAC_FUNC_DATA | in __igc_access_xmdio_reg()
674 if (ret_val) in __igc_access_xmdio_reg()
675 return ret_val; in __igc_access_xmdio_reg()
678 ret_val = hw->phy.ops.read_reg(hw, IGC_MMDAAD, data); in __igc_access_xmdio_reg()
680 ret_val = hw->phy.ops.write_reg(hw, IGC_MMDAAD, *data); in __igc_access_xmdio_reg()
681 if (ret_val) in __igc_access_xmdio_reg()
682 return ret_val; in __igc_access_xmdio_reg()
685 ret_val = hw->phy.ops.write_reg(hw, IGC_MMDAC, 0); in __igc_access_xmdio_reg()
686 if (ret_val) in __igc_access_xmdio_reg()
687 return ret_val; in __igc_access_xmdio_reg()
689 return ret_val; in __igc_access_xmdio_reg()
730 s32 ret_val; in igc_write_phy_reg_gpy() local
735 ret_val = hw->phy.ops.acquire(hw); in igc_write_phy_reg_gpy()
736 if (ret_val) in igc_write_phy_reg_gpy()
737 return ret_val; in igc_write_phy_reg_gpy()
738 ret_val = igc_write_phy_reg_mdic(hw, offset, data); in igc_write_phy_reg_gpy()
741 ret_val = igc_write_xmdio_reg(hw, (u16)offset, dev_addr, in igc_write_phy_reg_gpy()
745 return ret_val; in igc_write_phy_reg_gpy()
761 s32 ret_val; in igc_read_phy_reg_gpy() local
766 ret_val = hw->phy.ops.acquire(hw); in igc_read_phy_reg_gpy()
767 if (ret_val) in igc_read_phy_reg_gpy()
768 return ret_val; in igc_read_phy_reg_gpy()
769 ret_val = igc_read_phy_reg_mdic(hw, offset, data); in igc_read_phy_reg_gpy()
772 ret_val = igc_read_xmdio_reg(hw, (u16)offset, dev_addr, in igc_read_phy_reg_gpy()
776 return ret_val; in igc_read_phy_reg_gpy()
787 u16 ret_val; in igc_read_phy_fw_version() local
790 ret_val = phy->ops.read_reg(hw, IGC_GPHY_VERSION, &gphy_version); in igc_read_phy_fw_version()
791 if (ret_val) in igc_read_phy_fw_version()