Lines Matching refs:phy

82 	struct e1000_phy_info *phy = &hw->phy;  in igb_get_phy_id()  local
86 ret_val = phy->ops.read_reg(hw, PHY_ID1, &phy_id); in igb_get_phy_id()
90 phy->id = (u32)(phy_id << 16); in igb_get_phy_id()
92 ret_val = phy->ops.read_reg(hw, PHY_ID2, &phy_id); in igb_get_phy_id()
96 phy->id |= (u32)(phy_id & PHY_REVISION_MASK); in igb_get_phy_id()
97 phy->revision = (u32)(phy_id & ~PHY_REVISION_MASK); in igb_get_phy_id()
113 if (!(hw->phy.ops.write_reg)) in igb_phy_reset_dsp()
116 ret_val = hw->phy.ops.write_reg(hw, M88E1000_PHY_GEN_CONTROL, 0xC1); in igb_phy_reset_dsp()
120 ret_val = hw->phy.ops.write_reg(hw, M88E1000_PHY_GEN_CONTROL, 0); in igb_phy_reset_dsp()
137 struct e1000_phy_info *phy = &hw->phy; in igb_read_phy_reg_mdic() local
152 (phy->addr << E1000_MDIC_PHY_SHIFT) | in igb_read_phy_reg_mdic()
193 struct e1000_phy_info *phy = &hw->phy; in igb_write_phy_reg_mdic() local
209 (phy->addr << E1000_MDIC_PHY_SHIFT) | in igb_write_phy_reg_mdic()
250 struct e1000_phy_info *phy = &hw->phy; in igb_read_phy_reg_i2c() local
258 (phy->addr << E1000_I2CCMD_PHY_ADDR_SHIFT) | in igb_read_phy_reg_i2c()
295 struct e1000_phy_info *phy = &hw->phy; in igb_write_phy_reg_i2c() local
300 if ((hw->phy.addr == 0) || (hw->phy.addr > 7)) { in igb_write_phy_reg_i2c()
302 hw->phy.addr); in igb_write_phy_reg_i2c()
314 (phy->addr << E1000_I2CCMD_PHY_ADDR_SHIFT) | in igb_write_phy_reg_i2c()
406 if (!(hw->phy.ops.acquire)) in igb_read_phy_reg_igp()
409 ret_val = hw->phy.ops.acquire(hw); in igb_read_phy_reg_igp()
418 hw->phy.ops.release(hw); in igb_read_phy_reg_igp()
426 hw->phy.ops.release(hw); in igb_read_phy_reg_igp()
445 if (!(hw->phy.ops.acquire)) in igb_write_phy_reg_igp()
448 ret_val = hw->phy.ops.acquire(hw); in igb_write_phy_reg_igp()
457 hw->phy.ops.release(hw); in igb_write_phy_reg_igp()
465 hw->phy.ops.release(hw); in igb_write_phy_reg_igp()
479 struct e1000_phy_info *phy = &hw->phy; in igb_copper_link_setup_82580() local
483 if (phy->reset_disable) { in igb_copper_link_setup_82580()
488 if (phy->type == e1000_phy_82580) { in igb_copper_link_setup_82580()
489 ret_val = hw->phy.ops.reset(hw); in igb_copper_link_setup_82580()
497 ret_val = phy->ops.read_reg(hw, I82580_CFG_REG, &phy_data); in igb_copper_link_setup_82580()
506 ret_val = phy->ops.write_reg(hw, I82580_CFG_REG, phy_data); in igb_copper_link_setup_82580()
511 ret_val = phy->ops.read_reg(hw, I82580_PHY_CTRL_2, &phy_data); in igb_copper_link_setup_82580()
520 switch (hw->phy.mdix) { in igb_copper_link_setup_82580()
531 ret_val = hw->phy.ops.write_reg(hw, I82580_PHY_CTRL_2, phy_data); in igb_copper_link_setup_82580()
546 struct e1000_phy_info *phy = &hw->phy; in igb_copper_link_setup_m88() local
550 if (phy->reset_disable) { in igb_copper_link_setup_m88()
556 ret_val = phy->ops.read_reg(hw, M88E1000_PHY_SPEC_CTRL, &phy_data); in igb_copper_link_setup_m88()
571 switch (phy->mdix) { in igb_copper_link_setup_m88()
594 if (phy->disable_polarity_correction == 1) in igb_copper_link_setup_m88()
597 ret_val = phy->ops.write_reg(hw, M88E1000_PHY_SPEC_CTRL, phy_data); in igb_copper_link_setup_m88()
601 if (phy->revision < E1000_REVISION_4) { in igb_copper_link_setup_m88()
605 ret_val = phy->ops.read_reg(hw, M88E1000_EXT_PHY_SPEC_CTRL, in igb_copper_link_setup_m88()
612 if ((phy->revision == E1000_REVISION_2) && in igb_copper_link_setup_m88()
613 (phy->id == M88E1111_I_PHY_ID)) { in igb_copper_link_setup_m88()
624 ret_val = phy->ops.write_reg(hw, M88E1000_EXT_PHY_SPEC_CTRL, in igb_copper_link_setup_m88()
650 struct e1000_phy_info *phy = &hw->phy; in igb_copper_link_setup_m88_gen2() local
654 if (phy->reset_disable) in igb_copper_link_setup_m88_gen2()
658 ret_val = phy->ops.read_reg(hw, M88E1000_PHY_SPEC_CTRL, &phy_data); in igb_copper_link_setup_m88_gen2()
671 switch (phy->mdix) { in igb_copper_link_setup_m88_gen2()
680 if (phy->id != M88E1112_E_PHY_ID) { in igb_copper_link_setup_m88_gen2()
697 if (phy->disable_polarity_correction == 1) in igb_copper_link_setup_m88_gen2()
701 if (phy->id == M88E1543_E_PHY_ID) { in igb_copper_link_setup_m88_gen2()
704 phy->ops.write_reg(hw, M88E1000_PHY_SPEC_CTRL, phy_data); in igb_copper_link_setup_m88_gen2()
719 ret_val = phy->ops.write_reg(hw, M88E1000_PHY_SPEC_CTRL, phy_data); in igb_copper_link_setup_m88_gen2()
745 struct e1000_phy_info *phy = &hw->phy; in igb_copper_link_setup_igp() local
749 if (phy->reset_disable) { in igb_copper_link_setup_igp()
754 ret_val = phy->ops.reset(hw); in igb_copper_link_setup_igp()
768 if (phy->type == e1000_phy_igp) { in igb_copper_link_setup_igp()
770 if (phy->ops.set_d3_lplu_state) in igb_copper_link_setup_igp()
771 ret_val = phy->ops.set_d3_lplu_state(hw, false); in igb_copper_link_setup_igp()
779 ret_val = phy->ops.set_d0_lplu_state(hw, false); in igb_copper_link_setup_igp()
785 ret_val = phy->ops.read_reg(hw, IGP01E1000_PHY_PORT_CTRL, &data); in igb_copper_link_setup_igp()
791 switch (phy->mdix) { in igb_copper_link_setup_igp()
803 ret_val = phy->ops.write_reg(hw, IGP01E1000_PHY_PORT_CTRL, data); in igb_copper_link_setup_igp()
813 if (phy->autoneg_advertised == ADVERTISE_1000_FULL) { in igb_copper_link_setup_igp()
815 ret_val = phy->ops.read_reg(hw, in igb_copper_link_setup_igp()
822 ret_val = phy->ops.write_reg(hw, in igb_copper_link_setup_igp()
829 ret_val = phy->ops.read_reg(hw, PHY_1000T_CTRL, &data); in igb_copper_link_setup_igp()
834 ret_val = phy->ops.write_reg(hw, PHY_1000T_CTRL, data); in igb_copper_link_setup_igp()
839 ret_val = phy->ops.read_reg(hw, PHY_1000T_CTRL, &data); in igb_copper_link_setup_igp()
844 phy->original_ms_type = (data & CR_1000T_MS_ENABLE) ? in igb_copper_link_setup_igp()
850 switch (phy->ms_type) { in igb_copper_link_setup_igp()
863 ret_val = phy->ops.write_reg(hw, PHY_1000T_CTRL, data); in igb_copper_link_setup_igp()
883 struct e1000_phy_info *phy = &hw->phy; in igb_copper_link_autoneg() local
890 phy->autoneg_advertised &= phy->autoneg_mask; in igb_copper_link_autoneg()
895 if (phy->autoneg_advertised == 0) in igb_copper_link_autoneg()
896 phy->autoneg_advertised = phy->autoneg_mask; in igb_copper_link_autoneg()
909 ret_val = phy->ops.read_reg(hw, PHY_CONTROL, &phy_ctrl); in igb_copper_link_autoneg()
914 ret_val = phy->ops.write_reg(hw, PHY_CONTROL, phy_ctrl); in igb_copper_link_autoneg()
921 if (phy->autoneg_wait_to_complete) { in igb_copper_link_autoneg()
946 struct e1000_phy_info *phy = &hw->phy; in igb_phy_setup_autoneg() local
951 phy->autoneg_advertised &= phy->autoneg_mask; in igb_phy_setup_autoneg()
954 ret_val = phy->ops.read_reg(hw, PHY_AUTONEG_ADV, &mii_autoneg_adv_reg); in igb_phy_setup_autoneg()
958 if (phy->autoneg_mask & ADVERTISE_1000_FULL) { in igb_phy_setup_autoneg()
960 ret_val = phy->ops.read_reg(hw, PHY_1000T_CTRL, in igb_phy_setup_autoneg()
983 hw_dbg("autoneg_advertised %x\n", phy->autoneg_advertised); in igb_phy_setup_autoneg()
986 if (phy->autoneg_advertised & ADVERTISE_10_HALF) { in igb_phy_setup_autoneg()
992 if (phy->autoneg_advertised & ADVERTISE_10_FULL) { in igb_phy_setup_autoneg()
998 if (phy->autoneg_advertised & ADVERTISE_100_HALF) { in igb_phy_setup_autoneg()
1004 if (phy->autoneg_advertised & ADVERTISE_100_FULL) { in igb_phy_setup_autoneg()
1010 if (phy->autoneg_advertised & ADVERTISE_1000_HALF) in igb_phy_setup_autoneg()
1014 if (phy->autoneg_advertised & ADVERTISE_1000_FULL) { in igb_phy_setup_autoneg()
1074 ret_val = phy->ops.write_reg(hw, PHY_AUTONEG_ADV, mii_autoneg_adv_reg); in igb_phy_setup_autoneg()
1080 if (phy->autoneg_mask & ADVERTISE_1000_FULL) { in igb_phy_setup_autoneg()
1081 ret_val = phy->ops.write_reg(hw, in igb_phy_setup_autoneg()
1118 ret_val = hw->phy.ops.force_speed_duplex(hw); in igb_setup_copper_link()
1154 struct e1000_phy_info *phy = &hw->phy; in igb_phy_force_speed_duplex_igp() local
1159 ret_val = phy->ops.read_reg(hw, PHY_CONTROL, &phy_data); in igb_phy_force_speed_duplex_igp()
1165 ret_val = phy->ops.write_reg(hw, PHY_CONTROL, phy_data); in igb_phy_force_speed_duplex_igp()
1172 ret_val = phy->ops.read_reg(hw, IGP01E1000_PHY_PORT_CTRL, &phy_data); in igb_phy_force_speed_duplex_igp()
1179 ret_val = phy->ops.write_reg(hw, IGP01E1000_PHY_PORT_CTRL, phy_data); in igb_phy_force_speed_duplex_igp()
1187 if (phy->autoneg_wait_to_complete) { in igb_phy_force_speed_duplex_igp()
1219 struct e1000_phy_info *phy = &hw->phy; in igb_phy_force_speed_duplex_m88() local
1225 if (phy->type != e1000_phy_i210) { in igb_phy_force_speed_duplex_m88()
1229 ret_val = phy->ops.read_reg(hw, M88E1000_PHY_SPEC_CTRL, in igb_phy_force_speed_duplex_m88()
1235 ret_val = phy->ops.write_reg(hw, M88E1000_PHY_SPEC_CTRL, in igb_phy_force_speed_duplex_m88()
1243 ret_val = phy->ops.read_reg(hw, PHY_CONTROL, &phy_data); in igb_phy_force_speed_duplex_m88()
1249 ret_val = phy->ops.write_reg(hw, PHY_CONTROL, phy_data); in igb_phy_force_speed_duplex_m88()
1258 if (phy->autoneg_wait_to_complete) { in igb_phy_force_speed_duplex_m88()
1268 switch (hw->phy.id) { in igb_phy_force_speed_duplex_m88()
1275 if (hw->phy.type != e1000_phy_m88) in igb_phy_force_speed_duplex_m88()
1285 ret_val = phy->ops.write_reg(hw, in igb_phy_force_speed_duplex_m88()
1303 if (hw->phy.type != e1000_phy_m88 || in igb_phy_force_speed_duplex_m88()
1304 hw->phy.id == I347AT4_E_PHY_ID || in igb_phy_force_speed_duplex_m88()
1305 hw->phy.id == M88E1112_E_PHY_ID || in igb_phy_force_speed_duplex_m88()
1306 hw->phy.id == I210_I_PHY_ID) in igb_phy_force_speed_duplex_m88()
1309 ret_val = phy->ops.read_reg(hw, M88E1000_EXT_PHY_SPEC_CTRL, &phy_data); in igb_phy_force_speed_duplex_m88()
1318 ret_val = phy->ops.write_reg(hw, M88E1000_EXT_PHY_SPEC_CTRL, phy_data); in igb_phy_force_speed_duplex_m88()
1325 ret_val = phy->ops.read_reg(hw, M88E1000_PHY_SPEC_CTRL, &phy_data); in igb_phy_force_speed_duplex_m88()
1330 ret_val = phy->ops.write_reg(hw, M88E1000_PHY_SPEC_CTRL, phy_data); in igb_phy_force_speed_duplex_m88()
1413 struct e1000_phy_info *phy = &hw->phy; in igb_set_d3_lplu_state() local
1417 if (!(hw->phy.ops.read_reg)) in igb_set_d3_lplu_state()
1420 ret_val = phy->ops.read_reg(hw, IGP02E1000_PHY_POWER_MGMT, &data); in igb_set_d3_lplu_state()
1426 ret_val = phy->ops.write_reg(hw, IGP02E1000_PHY_POWER_MGMT, in igb_set_d3_lplu_state()
1435 if (phy->smart_speed == e1000_smart_speed_on) { in igb_set_d3_lplu_state()
1436 ret_val = phy->ops.read_reg(hw, in igb_set_d3_lplu_state()
1443 ret_val = phy->ops.write_reg(hw, in igb_set_d3_lplu_state()
1448 } else if (phy->smart_speed == e1000_smart_speed_off) { in igb_set_d3_lplu_state()
1449 ret_val = phy->ops.read_reg(hw, in igb_set_d3_lplu_state()
1456 ret_val = phy->ops.write_reg(hw, in igb_set_d3_lplu_state()
1462 } else if ((phy->autoneg_advertised == E1000_ALL_SPEED_DUPLEX) || in igb_set_d3_lplu_state()
1463 (phy->autoneg_advertised == E1000_ALL_NOT_GIG) || in igb_set_d3_lplu_state()
1464 (phy->autoneg_advertised == E1000_ALL_10_SPEED)) { in igb_set_d3_lplu_state()
1466 ret_val = phy->ops.write_reg(hw, IGP02E1000_PHY_POWER_MGMT, in igb_set_d3_lplu_state()
1472 ret_val = phy->ops.read_reg(hw, IGP01E1000_PHY_PORT_CONFIG, in igb_set_d3_lplu_state()
1478 ret_val = phy->ops.write_reg(hw, IGP01E1000_PHY_PORT_CONFIG, in igb_set_d3_lplu_state()
1496 struct e1000_phy_info *phy = &hw->phy; in igb_check_downshift() local
1500 switch (phy->type) { in igb_check_downshift()
1515 phy->speed_downgraded = false; in igb_check_downshift()
1520 ret_val = phy->ops.read_reg(hw, offset, &phy_data); in igb_check_downshift()
1523 phy->speed_downgraded = (phy_data & mask) ? true : false; in igb_check_downshift()
1539 struct e1000_phy_info *phy = &hw->phy; in igb_check_polarity_m88() local
1543 ret_val = phy->ops.read_reg(hw, M88E1000_PHY_SPEC_STATUS, &data); in igb_check_polarity_m88()
1546 phy->cable_polarity = (data & M88E1000_PSSR_REV_POLARITY) in igb_check_polarity_m88()
1564 struct e1000_phy_info *phy = &hw->phy; in igb_check_polarity_igp() local
1571 ret_val = phy->ops.read_reg(hw, IGP01E1000_PHY_PORT_STATUS, &data); in igb_check_polarity_igp()
1587 ret_val = phy->ops.read_reg(hw, offset, &data); in igb_check_polarity_igp()
1590 phy->cable_polarity = (data & mask) in igb_check_polarity_igp()
1612 ret_val = hw->phy.ops.read_reg(hw, PHY_STATUS, &phy_status); in igb_wait_autoneg()
1615 ret_val = hw->phy.ops.read_reg(hw, PHY_STATUS, &phy_status); in igb_wait_autoneg()
1649 ret_val = hw->phy.ops.read_reg(hw, PHY_STATUS, &phy_status); in igb_phy_has_link()
1660 ret_val = hw->phy.ops.read_reg(hw, PHY_STATUS, &phy_status); in igb_phy_has_link()
1693 struct e1000_phy_info *phy = &hw->phy; in igb_get_cable_length_m88() local
1697 ret_val = phy->ops.read_reg(hw, M88E1000_PHY_SPEC_STATUS, &phy_data); in igb_get_cable_length_m88()
1708 phy->min_cable_length = e1000_m88_cable_length_table[index]; in igb_get_cable_length_m88()
1709 phy->max_cable_length = e1000_m88_cable_length_table[index + 1]; in igb_get_cable_length_m88()
1711 phy->cable_length = (phy->min_cable_length + phy->max_cable_length) / 2; in igb_get_cable_length_m88()
1719 struct e1000_phy_info *phy = &hw->phy; in igb_get_cable_length_m88_gen2() local
1723 switch (hw->phy.id) { in igb_get_cable_length_m88_gen2()
1726 ret_val = phy->ops.read_reg(hw, (0x7 << GS40G_PAGE_SHIFT) + in igb_get_cable_length_m88_gen2()
1727 (I347AT4_PCDL + phy->addr), in igb_get_cable_length_m88_gen2()
1733 ret_val = phy->ops.read_reg(hw, (0x7 << GS40G_PAGE_SHIFT) + in igb_get_cable_length_m88_gen2()
1741 phy->min_cable_length = phy_data / (is_cm ? 100 : 1); in igb_get_cable_length_m88_gen2()
1742 phy->max_cable_length = phy_data / (is_cm ? 100 : 1); in igb_get_cable_length_m88_gen2()
1743 phy->cable_length = phy_data / (is_cm ? 100 : 1); in igb_get_cable_length_m88_gen2()
1748 ret_val = phy->ops.read_reg(hw, I347AT4_PAGE_SELECT, in igb_get_cable_length_m88_gen2()
1753 ret_val = phy->ops.write_reg(hw, I347AT4_PAGE_SELECT, 0x07); in igb_get_cable_length_m88_gen2()
1758 ret_val = phy->ops.read_reg(hw, (I347AT4_PCDL + phy->addr), in igb_get_cable_length_m88_gen2()
1764 ret_val = phy->ops.read_reg(hw, I347AT4_PCDC, &phy_data2); in igb_get_cable_length_m88_gen2()
1771 phy->min_cable_length = phy_data / (is_cm ? 100 : 1); in igb_get_cable_length_m88_gen2()
1772 phy->max_cable_length = phy_data / (is_cm ? 100 : 1); in igb_get_cable_length_m88_gen2()
1773 phy->cable_length = phy_data / (is_cm ? 100 : 1); in igb_get_cable_length_m88_gen2()
1776 ret_val = phy->ops.write_reg(hw, I347AT4_PAGE_SELECT, in igb_get_cable_length_m88_gen2()
1783 ret_val = phy->ops.read_reg(hw, I347AT4_PAGE_SELECT, in igb_get_cable_length_m88_gen2()
1788 ret_val = phy->ops.write_reg(hw, I347AT4_PAGE_SELECT, 0x05); in igb_get_cable_length_m88_gen2()
1792 ret_val = phy->ops.read_reg(hw, M88E1112_VCT_DSP_DISTANCE, in igb_get_cable_length_m88_gen2()
1804 phy->min_cable_length = e1000_m88_cable_length_table[index]; in igb_get_cable_length_m88_gen2()
1805 phy->max_cable_length = e1000_m88_cable_length_table[index + 1]; in igb_get_cable_length_m88_gen2()
1807 phy->cable_length = (phy->min_cable_length + in igb_get_cable_length_m88_gen2()
1808 phy->max_cable_length) / 2; in igb_get_cable_length_m88_gen2()
1811 ret_val = phy->ops.write_reg(hw, I347AT4_PAGE_SELECT, in igb_get_cable_length_m88_gen2()
1839 struct e1000_phy_info *phy = &hw->phy; in igb_get_cable_length_igp_2() local
1853 ret_val = phy->ops.read_reg(hw, agc_reg_array[i], &phy_data); in igb_get_cable_length_igp_2()
1888 phy->min_cable_length = ((agc_value - IGP02E1000_AGC_RANGE) > 0) ? in igb_get_cable_length_igp_2()
1890 phy->max_cable_length = agc_value + IGP02E1000_AGC_RANGE; in igb_get_cable_length_igp_2()
1892 phy->cable_length = (phy->min_cable_length + phy->max_cable_length) / 2; in igb_get_cable_length_igp_2()
1910 struct e1000_phy_info *phy = &hw->phy; in igb_get_phy_info_m88() local
1915 if (phy->media_type != e1000_media_type_copper) { in igb_get_phy_info_m88()
1931 ret_val = phy->ops.read_reg(hw, M88E1000_PHY_SPEC_CTRL, &phy_data); in igb_get_phy_info_m88()
1935 phy->polarity_correction = (phy_data & M88E1000_PSCR_POLARITY_REVERSAL) in igb_get_phy_info_m88()
1942 ret_val = phy->ops.read_reg(hw, M88E1000_PHY_SPEC_STATUS, &phy_data); in igb_get_phy_info_m88()
1946 phy->is_mdix = (phy_data & M88E1000_PSSR_MDIX) ? true : false; in igb_get_phy_info_m88()
1949 ret_val = phy->ops.get_cable_length(hw); in igb_get_phy_info_m88()
1953 ret_val = phy->ops.read_reg(hw, PHY_1000T_STATUS, &phy_data); in igb_get_phy_info_m88()
1957 phy->local_rx = (phy_data & SR_1000T_LOCAL_RX_STATUS) in igb_get_phy_info_m88()
1961 phy->remote_rx = (phy_data & SR_1000T_REMOTE_RX_STATUS) in igb_get_phy_info_m88()
1966 phy->cable_length = E1000_CABLE_LENGTH_UNDEFINED; in igb_get_phy_info_m88()
1967 phy->local_rx = e1000_1000t_rx_status_undefined; in igb_get_phy_info_m88()
1968 phy->remote_rx = e1000_1000t_rx_status_undefined; in igb_get_phy_info_m88()
1986 struct e1000_phy_info *phy = &hw->phy; in igb_get_phy_info_igp() local
2001 phy->polarity_correction = true; in igb_get_phy_info_igp()
2007 ret_val = phy->ops.read_reg(hw, IGP01E1000_PHY_PORT_STATUS, &data); in igb_get_phy_info_igp()
2011 phy->is_mdix = (data & IGP01E1000_PSSR_MDIX) ? true : false; in igb_get_phy_info_igp()
2015 ret_val = phy->ops.get_cable_length(hw); in igb_get_phy_info_igp()
2019 ret_val = phy->ops.read_reg(hw, PHY_1000T_STATUS, &data); in igb_get_phy_info_igp()
2023 phy->local_rx = (data & SR_1000T_LOCAL_RX_STATUS) in igb_get_phy_info_igp()
2027 phy->remote_rx = (data & SR_1000T_REMOTE_RX_STATUS) in igb_get_phy_info_igp()
2031 phy->cable_length = E1000_CABLE_LENGTH_UNDEFINED; in igb_get_phy_info_igp()
2032 phy->local_rx = e1000_1000t_rx_status_undefined; in igb_get_phy_info_igp()
2033 phy->remote_rx = e1000_1000t_rx_status_undefined; in igb_get_phy_info_igp()
2052 if (!(hw->phy.ops.read_reg)) in igb_phy_sw_reset()
2055 ret_val = hw->phy.ops.read_reg(hw, PHY_CONTROL, &phy_ctrl); in igb_phy_sw_reset()
2060 ret_val = hw->phy.ops.write_reg(hw, PHY_CONTROL, phy_ctrl); in igb_phy_sw_reset()
2081 struct e1000_phy_info *phy = &hw->phy; in igb_phy_hw_reset() local
2091 ret_val = phy->ops.acquire(hw); in igb_phy_hw_reset()
2099 udelay(phy->reset_delay_us); in igb_phy_hw_reset()
2106 phy->ops.release(hw); in igb_phy_hw_reset()
2108 ret_val = phy->ops.get_cfg_done(hw); in igb_phy_hw_reset()
2126 hw->phy.ops.write_reg(hw, 0x2F5B, 0x9018); in igb_phy_init_script_igp3()
2128 hw->phy.ops.write_reg(hw, 0x2F52, 0x0000); in igb_phy_init_script_igp3()
2130 hw->phy.ops.write_reg(hw, 0x2FB1, 0x8B24); in igb_phy_init_script_igp3()
2132 hw->phy.ops.write_reg(hw, 0x2FB2, 0xF8F0); in igb_phy_init_script_igp3()
2134 hw->phy.ops.write_reg(hw, 0x2010, 0x10B0); in igb_phy_init_script_igp3()
2136 hw->phy.ops.write_reg(hw, 0x2011, 0x0000); in igb_phy_init_script_igp3()
2138 hw->phy.ops.write_reg(hw, 0x20DD, 0x249A); in igb_phy_init_script_igp3()
2140 hw->phy.ops.write_reg(hw, 0x20DE, 0x00D3); in igb_phy_init_script_igp3()
2142 hw->phy.ops.write_reg(hw, 0x28B4, 0x04CE); in igb_phy_init_script_igp3()
2144 hw->phy.ops.write_reg(hw, 0x2F70, 0x29E4); in igb_phy_init_script_igp3()
2146 hw->phy.ops.write_reg(hw, 0x0000, 0x0140); in igb_phy_init_script_igp3()
2148 hw->phy.ops.write_reg(hw, 0x1F30, 0x1606); in igb_phy_init_script_igp3()
2150 hw->phy.ops.write_reg(hw, 0x1F31, 0xB814); in igb_phy_init_script_igp3()
2152 hw->phy.ops.write_reg(hw, 0x1F35, 0x002A); in igb_phy_init_script_igp3()
2154 hw->phy.ops.write_reg(hw, 0x1F3E, 0x0067); in igb_phy_init_script_igp3()
2156 hw->phy.ops.write_reg(hw, 0x1F54, 0x0065); in igb_phy_init_script_igp3()
2158 hw->phy.ops.write_reg(hw, 0x1F55, 0x002A); in igb_phy_init_script_igp3()
2160 hw->phy.ops.write_reg(hw, 0x1F56, 0x002A); in igb_phy_init_script_igp3()
2162 hw->phy.ops.write_reg(hw, 0x1F72, 0x3FB0); in igb_phy_init_script_igp3()
2164 hw->phy.ops.write_reg(hw, 0x1F76, 0xC0FF); in igb_phy_init_script_igp3()
2166 hw->phy.ops.write_reg(hw, 0x1F77, 0x1DEC); in igb_phy_init_script_igp3()
2168 hw->phy.ops.write_reg(hw, 0x1F78, 0xF9EF); in igb_phy_init_script_igp3()
2170 hw->phy.ops.write_reg(hw, 0x1F79, 0x0210); in igb_phy_init_script_igp3()
2172 hw->phy.ops.write_reg(hw, 0x1895, 0x0003); in igb_phy_init_script_igp3()
2174 hw->phy.ops.write_reg(hw, 0x1796, 0x0008); in igb_phy_init_script_igp3()
2176 hw->phy.ops.write_reg(hw, 0x1798, 0xD008); in igb_phy_init_script_igp3()
2180 hw->phy.ops.write_reg(hw, 0x1898, 0xD918); in igb_phy_init_script_igp3()
2182 hw->phy.ops.write_reg(hw, 0x187A, 0x0800); in igb_phy_init_script_igp3()
2186 hw->phy.ops.write_reg(hw, 0x0019, 0x008D); in igb_phy_init_script_igp3()
2188 hw->phy.ops.write_reg(hw, 0x001B, 0x2080); in igb_phy_init_script_igp3()
2190 hw->phy.ops.write_reg(hw, 0x0014, 0x0045); in igb_phy_init_script_igp3()
2192 hw->phy.ops.write_reg(hw, 0x0000, 0x1340); in igb_phy_init_script_igp3()
2209 hw->phy.ops.read_reg(hw, PHY_CONTROL, &mii_reg); in igb_power_up_phy_copper()
2211 hw->phy.ops.write_reg(hw, PHY_CONTROL, mii_reg); in igb_power_up_phy_copper()
2226 hw->phy.ops.read_reg(hw, PHY_CONTROL, &mii_reg); in igb_power_down_phy_copper()
2228 hw->phy.ops.write_reg(hw, PHY_CONTROL, mii_reg); in igb_power_down_phy_copper()
2242 struct e1000_phy_info *phy = &hw->phy; in igb_check_polarity_82580() local
2247 ret_val = phy->ops.read_reg(hw, I82580_PHY_STATUS_2, &data); in igb_check_polarity_82580()
2250 phy->cable_polarity = (data & I82580_PHY_STATUS2_REV_POLARITY) in igb_check_polarity_82580()
2267 struct e1000_phy_info *phy = &hw->phy; in igb_phy_force_speed_duplex_82580() local
2272 ret_val = phy->ops.read_reg(hw, PHY_CONTROL, &phy_data); in igb_phy_force_speed_duplex_82580()
2278 ret_val = phy->ops.write_reg(hw, PHY_CONTROL, phy_data); in igb_phy_force_speed_duplex_82580()
2285 ret_val = phy->ops.read_reg(hw, I82580_PHY_CTRL_2, &phy_data); in igb_phy_force_speed_duplex_82580()
2291 ret_val = phy->ops.write_reg(hw, I82580_PHY_CTRL_2, phy_data); in igb_phy_force_speed_duplex_82580()
2299 if (phy->autoneg_wait_to_complete) { in igb_phy_force_speed_duplex_82580()
2330 struct e1000_phy_info *phy = &hw->phy; in igb_get_phy_info_82580() local
2345 phy->polarity_correction = true; in igb_get_phy_info_82580()
2351 ret_val = phy->ops.read_reg(hw, I82580_PHY_STATUS_2, &data); in igb_get_phy_info_82580()
2355 phy->is_mdix = (data & I82580_PHY_STATUS2_MDIX) ? true : false; in igb_get_phy_info_82580()
2359 ret_val = hw->phy.ops.get_cable_length(hw); in igb_get_phy_info_82580()
2363 ret_val = phy->ops.read_reg(hw, PHY_1000T_STATUS, &data); in igb_get_phy_info_82580()
2367 phy->local_rx = (data & SR_1000T_LOCAL_RX_STATUS) in igb_get_phy_info_82580()
2371 phy->remote_rx = (data & SR_1000T_REMOTE_RX_STATUS) in igb_get_phy_info_82580()
2375 phy->cable_length = E1000_CABLE_LENGTH_UNDEFINED; in igb_get_phy_info_82580()
2376 phy->local_rx = e1000_1000t_rx_status_undefined; in igb_get_phy_info_82580()
2377 phy->remote_rx = e1000_1000t_rx_status_undefined; in igb_get_phy_info_82580()
2393 struct e1000_phy_info *phy = &hw->phy; in igb_get_cable_length_82580() local
2397 ret_val = phy->ops.read_reg(hw, I82580_PHY_DIAG_STATUS, &phy_data); in igb_get_cable_length_82580()
2407 phy->cable_length = length; in igb_get_cable_length_82580()
2429 ret_val = hw->phy.ops.acquire(hw); in igb_write_phy_reg_gs40g()
2439 hw->phy.ops.release(hw); in igb_write_phy_reg_gs40g()
2459 ret_val = hw->phy.ops.acquire(hw); in igb_read_phy_reg_gs40g()
2469 hw->phy.ops.release(hw); in igb_read_phy_reg_gs40g()
2485 ret_val = hw->phy.ops.read_reg(hw, PHY_1000T_CTRL, &phy_data); in igb_set_master_slave_mode()
2490 hw->phy.original_ms_type = (phy_data & CR_1000T_MS_ENABLE) ? in igb_set_master_slave_mode()
2495 switch (hw->phy.ms_type) { in igb_set_master_slave_mode()
2510 return hw->phy.ops.write_reg(hw, PHY_1000T_CTRL, phy_data); in igb_set_master_slave_mode()