Lines Matching +full:auto +full:- +full:detects

1 // SPDX-License-Identifier: GPL-2.0
2 /* Copyright(c) 1999 - 2018 Intel Corporation. */
36 * e1000e_check_reset_block_generic - Check if PHY reset is blocked
53 * e1000e_get_phy_id - Retrieve the PHY ID and revision
61 struct e1000_phy_info *phy = &hw->phy; in e1000e_get_phy_id()
66 if (!phy->ops.read_reg) in e1000e_get_phy_id()
74 phy->id = (u32)(phy_id << 16); in e1000e_get_phy_id()
80 phy->id |= (u32)(phy_id & PHY_REVISION_MASK); in e1000e_get_phy_id()
81 phy->revision = (u32)(phy_id & ~PHY_REVISION_MASK); in e1000e_get_phy_id()
83 if (phy->id != 0 && phy->id != PHY_REVISION_MASK) in e1000e_get_phy_id()
93 * e1000e_phy_reset_dsp - Reset PHY DSP
110 * e1000e_read_phy_reg_mdic - Read MDI control register
120 struct e1000_phy_info *phy = &hw->phy; in e1000e_read_phy_reg_mdic()
125 return -E1000_ERR_PARAM; in e1000e_read_phy_reg_mdic()
128 /* Set up Op-code, Phy Address, and register offset in the MDI in e1000e_read_phy_reg_mdic()
133 (phy->addr << E1000_MDIC_PHY_SHIFT) | in e1000e_read_phy_reg_mdic()
150 return -E1000_ERR_PHY; in e1000e_read_phy_reg_mdic()
154 return -E1000_ERR_PHY; in e1000e_read_phy_reg_mdic()
157 e_dbg("MDI Read offset error - requested %d, returned %d\n", in e1000e_read_phy_reg_mdic()
160 return -E1000_ERR_PHY; in e1000e_read_phy_reg_mdic()
167 if (hw->mac.type == e1000_pch2lan) in e1000e_read_phy_reg_mdic()
174 * e1000e_write_phy_reg_mdic - Write MDI control register
183 struct e1000_phy_info *phy = &hw->phy; in e1000e_write_phy_reg_mdic()
188 return -E1000_ERR_PARAM; in e1000e_write_phy_reg_mdic()
191 /* Set up Op-code, Phy Address, and register offset in the MDI in e1000e_write_phy_reg_mdic()
197 (phy->addr << E1000_MDIC_PHY_SHIFT) | in e1000e_write_phy_reg_mdic()
214 return -E1000_ERR_PHY; in e1000e_write_phy_reg_mdic()
218 return -E1000_ERR_PHY; in e1000e_write_phy_reg_mdic()
221 e_dbg("MDI Write offset error - requested %d, returned %d\n", in e1000e_write_phy_reg_mdic()
224 return -E1000_ERR_PHY; in e1000e_write_phy_reg_mdic()
230 if (hw->mac.type == e1000_pch2lan) in e1000e_write_phy_reg_mdic()
237 * e1000e_read_phy_reg_m88 - Read m88 PHY register
250 ret_val = hw->phy.ops.acquire(hw); in e1000e_read_phy_reg_m88()
257 hw->phy.ops.release(hw); in e1000e_read_phy_reg_m88()
263 * e1000e_write_phy_reg_m88 - Write m88 PHY register
275 ret_val = hw->phy.ops.acquire(hw); in e1000e_write_phy_reg_m88()
282 hw->phy.ops.release(hw); in e1000e_write_phy_reg_m88()
288 * e1000_set_page_igp - Set page as on IGP-like PHY(s)
300 hw->phy.addr = 1; in e1000_set_page_igp()
306 * __e1000e_read_phy_reg_igp - Read igp PHY register
322 if (!hw->phy.ops.acquire) in __e1000e_read_phy_reg_igp()
325 ret_val = hw->phy.ops.acquire(hw); in __e1000e_read_phy_reg_igp()
339 hw->phy.ops.release(hw); in __e1000e_read_phy_reg_igp()
345 * e1000e_read_phy_reg_igp - Read igp PHY register
360 * e1000e_read_phy_reg_igp_locked - Read igp PHY register
374 * e1000e_write_phy_reg_igp - Write igp PHY register
389 if (!hw->phy.ops.acquire) in __e1000e_write_phy_reg_igp()
392 ret_val = hw->phy.ops.acquire(hw); in __e1000e_write_phy_reg_igp()
405 hw->phy.ops.release(hw); in __e1000e_write_phy_reg_igp()
411 * e1000e_write_phy_reg_igp - Write igp PHY register
425 * e1000e_write_phy_reg_igp_locked - Write igp PHY register
439 * __e1000_read_kmrn_reg - Read kumeran register
457 if (!hw->phy.ops.acquire) in __e1000_read_kmrn_reg()
460 ret_val = hw->phy.ops.acquire(hw); in __e1000_read_kmrn_reg()
476 hw->phy.ops.release(hw); in __e1000_read_kmrn_reg()
482 * e1000e_read_kmrn_reg - Read kumeran register
497 * e1000e_read_kmrn_reg_locked - Read kumeran register
512 * __e1000_write_kmrn_reg - Write kumeran register
530 if (!hw->phy.ops.acquire) in __e1000_write_kmrn_reg()
533 ret_val = hw->phy.ops.acquire(hw); in __e1000_write_kmrn_reg()
546 hw->phy.ops.release(hw); in __e1000_write_kmrn_reg()
552 * e1000e_write_kmrn_reg - Write kumeran register
566 * e1000e_write_kmrn_reg_locked - Write kumeran register
580 * e1000_set_master_slave_mode - Setup PHY for Master/slave mode
596 hw->phy.original_ms_type = (phy_data & CTL1000_ENABLE_MASTER) ? in e1000_set_master_slave_mode()
600 switch (hw->phy.ms_type) { in e1000_set_master_slave_mode()
619 * e1000_copper_link_setup_82577 - Setup 82577 PHY for copper link
622 * Sets up Carrier-sense on Transmit and downshift values.
629 /* Enable CRS on Tx. This must be set for half-duplex operation. */ in e1000_copper_link_setup_82577()
649 * 0 - Auto (default) in e1000_copper_link_setup_82577()
650 * 1 - MDI mode in e1000_copper_link_setup_82577()
651 * 2 - MDI-X mode in e1000_copper_link_setup_82577()
653 switch (hw->phy.mdix) { in e1000_copper_link_setup_82577()
672 * e1000e_copper_link_setup_m88 - Setup m88 PHY's for copper link
675 * Sets up MDI/MDI-X and polarity for m88 PHY's. If necessary, transmit clock
680 struct e1000_phy_info *phy = &hw->phy; in e1000e_copper_link_setup_m88()
684 /* Enable CRS on Tx. This must be set for half-duplex operation. */ in e1000e_copper_link_setup_m88()
690 if (phy->type != e1000_phy_bm) in e1000e_copper_link_setup_m88()
694 * MDI/MDI-X = 0 (default) in e1000e_copper_link_setup_m88()
695 * 0 - Auto for all speeds in e1000e_copper_link_setup_m88()
696 * 1 - MDI mode in e1000e_copper_link_setup_m88()
697 * 2 - MDI-X mode in e1000e_copper_link_setup_m88()
698 * 3 - Auto for 1000Base-T only (MDI-X for 10/100Base-T modes) in e1000e_copper_link_setup_m88()
702 switch (phy->mdix) { in e1000e_copper_link_setup_m88()
721 * 0 - Disabled in e1000e_copper_link_setup_m88()
722 * 1 - Enabled in e1000e_copper_link_setup_m88()
725 if (phy->disable_polarity_correction) in e1000e_copper_link_setup_m88()
729 if (phy->type == e1000_phy_bm) { in e1000e_copper_link_setup_m88()
731 if (phy->id == BME1000_E_PHY_ID_R2) { in e1000e_copper_link_setup_m88()
738 ret_val = phy->ops.commit(hw); in e1000e_copper_link_setup_m88()
752 if ((phy->type == e1000_phy_m88) && in e1000e_copper_link_setup_m88()
753 (phy->revision < E1000_REVISION_4) && in e1000e_copper_link_setup_m88()
754 (phy->id != BME1000_E_PHY_ID_R2)) { in e1000e_copper_link_setup_m88()
764 if ((phy->revision == 2) && (phy->id == M88E1111_I_PHY_ID)) { in e1000e_copper_link_setup_m88()
765 /* 82573L PHY - set the downshift counter to 5x. */ in e1000e_copper_link_setup_m88()
780 if ((phy->type == e1000_phy_bm) && (phy->id == BME1000_E_PHY_ID_R2)) { in e1000e_copper_link_setup_m88()
793 if (phy->ops.commit) { in e1000e_copper_link_setup_m88()
794 ret_val = phy->ops.commit(hw); in e1000e_copper_link_setup_m88()
801 if (phy->type == e1000_phy_82578) { in e1000e_copper_link_setup_m88()
806 /* 82578 PHY - set the downshift count to 1x. */ in e1000e_copper_link_setup_m88()
818 * e1000e_copper_link_setup_igp - Setup igp PHY's for copper link
821 * Sets up LPLU, MDI/MDI-X, polarity, Smartspeed and Master/Slave config for
826 struct e1000_phy_info *phy = &hw->phy; in e1000e_copper_link_setup_igp()
842 if (hw->phy.ops.set_d0_lplu_state) { in e1000e_copper_link_setup_igp()
843 ret_val = hw->phy.ops.set_d0_lplu_state(hw, false); in e1000e_copper_link_setup_igp()
849 /* Configure mdi-mdix settings */ in e1000e_copper_link_setup_igp()
856 switch (phy->mdix) { in e1000e_copper_link_setup_igp()
872 /* set auto-master slave resolution settings */ in e1000e_copper_link_setup_igp()
873 if (hw->mac.autoneg) { in e1000e_copper_link_setup_igp()
875 * should disable SmartSpeed and enable Auto MasterSlave in e1000e_copper_link_setup_igp()
878 if (phy->autoneg_advertised == ADVERTISE_1000_FULL) { in e1000e_copper_link_setup_igp()
891 /* Set auto Master/Slave resolution process */ in e1000e_copper_link_setup_igp()
909 * e1000_phy_setup_autoneg - Configure PHY for auto-negotiation
912 * Reads the MII auto-neg advertisement register and/or the 1000T control
913 * register and if the PHY is already setup for auto-negotiation, then
915 * the appropriate values for the wanted auto-negotiation.
919 struct e1000_phy_info *phy = &hw->phy; in e1000_phy_setup_autoneg()
924 phy->autoneg_advertised &= phy->autoneg_mask; in e1000_phy_setup_autoneg()
926 /* Read the MII Auto-Neg Advertisement Register (Address 4). */ in e1000_phy_setup_autoneg()
931 if (phy->autoneg_mask & ADVERTISE_1000_FULL) { in e1000_phy_setup_autoneg()
932 /* Read the MII 1000Base-T Control Register (Address 9). */ in e1000_phy_setup_autoneg()
945 /* First we clear all the 10/100 mb speed bits in the Auto-Neg in e1000_phy_setup_autoneg()
947 * the 1000Base-T Control Register (Address 9). in e1000_phy_setup_autoneg()
954 e_dbg("autoneg_advertised %x\n", phy->autoneg_advertised); in e1000_phy_setup_autoneg()
957 if (phy->autoneg_advertised & ADVERTISE_10_HALF) { in e1000_phy_setup_autoneg()
963 if (phy->autoneg_advertised & ADVERTISE_10_FULL) { in e1000_phy_setup_autoneg()
969 if (phy->autoneg_advertised & ADVERTISE_100_HALF) { in e1000_phy_setup_autoneg()
975 if (phy->autoneg_advertised & ADVERTISE_100_FULL) { in e1000_phy_setup_autoneg()
981 if (phy->autoneg_advertised & ADVERTISE_1000_HALF) in e1000_phy_setup_autoneg()
985 if (phy->autoneg_advertised & ADVERTISE_1000_FULL) { in e1000_phy_setup_autoneg()
992 * auto-negotiation is enabled, then software will have to set the in e1000_phy_setup_autoneg()
993 * "PAUSE" bits to the correct value in the Auto-Negotiation in e1000_phy_setup_autoneg()
994 * Advertisement Register (MII_ADVERTISE) and re-start auto- in e1000_phy_setup_autoneg()
1007 switch (hw->fc.current_mode) { in e1000_phy_setup_autoneg()
1010 * software over-ride. in e1000_phy_setup_autoneg()
1017 * disabled, by a software over-ride. in e1000_phy_setup_autoneg()
1030 * disabled, by a software over-ride. in e1000_phy_setup_autoneg()
1037 * over-ride. in e1000_phy_setup_autoneg()
1044 return -E1000_ERR_CONFIG; in e1000_phy_setup_autoneg()
1051 e_dbg("Auto-Neg Advertising %x\n", mii_autoneg_adv_reg); in e1000_phy_setup_autoneg()
1053 if (phy->autoneg_mask & ADVERTISE_1000_FULL) in e1000_phy_setup_autoneg()
1060 * e1000_copper_link_autoneg - Setup/Enable autoneg for copper link
1070 struct e1000_phy_info *phy = &hw->phy; in e1000_copper_link_autoneg()
1077 phy->autoneg_advertised &= phy->autoneg_mask; in e1000_copper_link_autoneg()
1082 if (!phy->autoneg_advertised) in e1000_copper_link_autoneg()
1083 phy->autoneg_advertised = phy->autoneg_mask; in e1000_copper_link_autoneg()
1085 e_dbg("Reconfiguring auto-neg advertisement params\n"); in e1000_copper_link_autoneg()
1088 e_dbg("Error Setting up Auto-Negotiation\n"); in e1000_copper_link_autoneg()
1091 e_dbg("Restarting Auto-Neg\n"); in e1000_copper_link_autoneg()
1093 /* Restart auto-negotiation by setting the Auto Neg Enable bit and in e1000_copper_link_autoneg()
1094 * the Auto Neg Restart bit in the PHY control register. in e1000_copper_link_autoneg()
1105 /* Does the user want to wait for Auto-Neg to complete here, or in e1000_copper_link_autoneg()
1108 if (phy->autoneg_wait_to_complete) { in e1000_copper_link_autoneg()
1116 hw->mac.get_link_status = true; in e1000_copper_link_autoneg()
1122 * e1000e_setup_copper_link - Configure copper link settings
1125 * Calls the appropriate function to configure the link for auto-neg or forced
1128 * not established, we return -E1000_ERR_PHY (-2).
1135 if (hw->mac.autoneg) { in e1000e_setup_copper_link()
1147 ret_val = hw->phy.ops.force_speed_duplex(hw); in e1000e_setup_copper_link()
1164 hw->mac.ops.config_collision_dist(hw); in e1000e_setup_copper_link()
1174 * e1000e_phy_force_speed_duplex_igp - Force speed/duplex for igp PHY
1178 * auto-crossover to force MDI manually. Waits for link and returns
1179 * successful if link up is successful, else -E1000_ERR_PHY (-2).
1183 struct e1000_phy_info *phy = &hw->phy; in e1000e_phy_force_speed_duplex_igp()
1198 /* Clear Auto-Crossover to force MDI manually. IGP requires MDI in e1000e_phy_force_speed_duplex_igp()
1216 if (phy->autoneg_wait_to_complete) { in e1000e_phy_force_speed_duplex_igp()
1236 * e1000e_phy_force_speed_duplex_m88 - Force speed/duplex for m88 PHY
1240 * auto-crossover to force MDI manually. Resets the PHY to commit the
1247 struct e1000_phy_info *phy = &hw->phy; in e1000e_phy_force_speed_duplex_m88()
1252 /* Clear Auto-Crossover to force MDI manually. M88E1000 requires MDI in e1000e_phy_force_speed_duplex_m88()
1277 if (hw->phy.ops.commit) { in e1000e_phy_force_speed_duplex_m88()
1278 ret_val = hw->phy.ops.commit(hw); in e1000e_phy_force_speed_duplex_m88()
1283 if (phy->autoneg_wait_to_complete) { in e1000e_phy_force_speed_duplex_m88()
1292 if (hw->phy.type != e1000_phy_m88) { in e1000e_phy_force_speed_duplex_m88()
1315 if (hw->phy.type != e1000_phy_m88) in e1000e_phy_force_speed_duplex_m88()
1322 /* Resetting the phy means we need to re-force TX_CLK in the in e1000e_phy_force_speed_duplex_m88()
1331 /* In addition, we must re-enable CRS on Tx for both half and full in e1000e_phy_force_speed_duplex_m88()
1345 * e1000_phy_force_speed_duplex_ife - Force PHY speed & duplex
1354 struct e1000_phy_info *phy = &hw->phy; in e1000_phy_force_speed_duplex_ife()
1369 /* Disable MDI-X support for 10/100 */ in e1000_phy_force_speed_duplex_ife()
1385 if (phy->autoneg_wait_to_complete) { in e1000_phy_force_speed_duplex_ife()
1407 * e1000e_phy_force_speed_duplex_setup - Configure forced PHY speed/duplex
1412 * control, force speed/duplex on the MAC, disable auto speed detection,
1413 * disable auto-negotiation, configure duplex, configure speed, configure
1420 struct e1000_mac_info *mac = &hw->mac; in e1000e_phy_force_speed_duplex_setup()
1424 hw->fc.current_mode = e1000_fc_none; in e1000e_phy_force_speed_duplex_setup()
1431 /* Disable Auto Speed Detection */ in e1000e_phy_force_speed_duplex_setup()
1438 if (mac->forced_speed_duplex & E1000_ALL_HALF_DUPLEX) { in e1000e_phy_force_speed_duplex_setup()
1449 if (mac->forced_speed_duplex & E1000_ALL_100_SPEED) { in e1000e_phy_force_speed_duplex_setup()
1460 hw->mac.ops.config_collision_dist(hw); in e1000e_phy_force_speed_duplex_setup()
1466 * e1000e_set_d3_lplu_state - Sets low power link up state for D3
1481 struct e1000_phy_info *phy = &hw->phy; in e1000e_set_d3_lplu_state()
1499 if (phy->smart_speed == e1000_smart_speed_on) { in e1000e_set_d3_lplu_state()
1510 } else if (phy->smart_speed == e1000_smart_speed_off) { in e1000e_set_d3_lplu_state()
1522 } else if ((phy->autoneg_advertised == E1000_ALL_SPEED_DUPLEX) || in e1000e_set_d3_lplu_state()
1523 (phy->autoneg_advertised == E1000_ALL_NOT_GIG) || in e1000e_set_d3_lplu_state()
1524 (phy->autoneg_advertised == E1000_ALL_10_SPEED)) { in e1000e_set_d3_lplu_state()
1543 * e1000e_check_downshift - Checks whether a downshift in speed occurred
1552 struct e1000_phy_info *phy = &hw->phy; in e1000e_check_downshift()
1556 switch (phy->type) { in e1000e_check_downshift()
1571 phy->speed_downgraded = false; in e1000e_check_downshift()
1578 phy->speed_downgraded = !!(phy_data & mask); in e1000e_check_downshift()
1584 * e1000_check_polarity_m88 - Checks the polarity.
1587 * Success returns 0, Failure returns -E1000_ERR_PHY (-2)
1593 struct e1000_phy_info *phy = &hw->phy; in e1000_check_polarity_m88()
1600 phy->cable_polarity = ((data & M88E1000_PSSR_REV_POLARITY) in e1000_check_polarity_m88()
1608 * e1000_check_polarity_igp - Checks the polarity.
1611 * Success returns 0, Failure returns -E1000_ERR_PHY (-2)
1618 struct e1000_phy_info *phy = &hw->phy; in e1000_check_polarity_igp()
1644 phy->cable_polarity = ((data & mask) in e1000_check_polarity_igp()
1652 * e1000_check_polarity_ife - Check cable polarity for IFE PHY
1659 struct e1000_phy_info *phy = &hw->phy; in e1000_check_polarity_ife()
1665 if (phy->polarity_correction) { in e1000_check_polarity_ife()
1676 phy->cable_polarity = ((phy_data & mask) in e1000_check_polarity_ife()
1684 * e1000_wait_autoneg - Wait for auto-neg completion
1687 * Waits for auto-negotiation to complete or for the auto-negotiation time
1696 for (i = PHY_AUTO_NEG_LIMIT; i > 0; i--) { in e1000_wait_autoneg()
1708 /* PHY_AUTO_NEG_TIME expiration doesn't guarantee auto-negotiation in e1000_wait_autoneg()
1715 * e1000e_phy_has_link_generic - Polls PHY for link
1763 * e1000e_get_cable_length_m88 - Determine cable length for m88 PHY
1772 * 1 50 - 80 meters
1773 * 2 80 - 110 meters
1774 * 3 110 - 140 meters
1779 struct e1000_phy_info *phy = &hw->phy; in e1000e_get_cable_length_m88()
1790 if (index >= M88E1000_CABLE_LENGTH_TABLE_SIZE - 1) in e1000e_get_cable_length_m88()
1791 return -E1000_ERR_PHY; in e1000e_get_cable_length_m88()
1793 phy->min_cable_length = e1000_m88_cable_length_table[index]; in e1000e_get_cable_length_m88()
1794 phy->max_cable_length = e1000_m88_cable_length_table[index + 1]; in e1000e_get_cable_length_m88()
1796 phy->cable_length = (phy->min_cable_length + phy->max_cable_length) / 2; in e1000e_get_cable_length_m88()
1802 * e1000e_get_cable_length_igp_2 - Determine cable length for igp2 PHY
1814 struct e1000_phy_info *phy = &hw->phy; in e1000e_get_cable_length_igp_2()
1818 u16 min_agc_index = IGP02E1000_CABLE_LENGTH_TABLE_SIZE - 1; in e1000e_get_cable_length_igp_2()
1843 return -E1000_ERR_PHY; in e1000e_get_cable_length_igp_2()
1856 agc_value -= (e1000_igp_2_cable_length_table[min_agc_index] + in e1000e_get_cable_length_igp_2()
1858 agc_value /= (IGP02E1000_PHY_CHANNEL_NUM - 2); in e1000e_get_cable_length_igp_2()
1860 /* Calculate cable length with the error range of +/- 10 meters. */ in e1000e_get_cable_length_igp_2()
1861 phy->min_cable_length = (((agc_value - IGP02E1000_AGC_RANGE) > 0) ? in e1000e_get_cable_length_igp_2()
1862 (agc_value - IGP02E1000_AGC_RANGE) : 0); in e1000e_get_cable_length_igp_2()
1863 phy->max_cable_length = agc_value + IGP02E1000_AGC_RANGE; in e1000e_get_cable_length_igp_2()
1865 phy->cable_length = (phy->min_cable_length + phy->max_cable_length) / 2; in e1000e_get_cable_length_igp_2()
1871 * e1000e_get_phy_info_m88 - Retrieve PHY information
1876 * determine the polarity and 10base-T extended distance. Read the PHY
1882 struct e1000_phy_info *phy = &hw->phy; in e1000e_get_phy_info_m88()
1887 if (phy->media_type != e1000_media_type_copper) { in e1000e_get_phy_info_m88()
1889 return -E1000_ERR_CONFIG; in e1000e_get_phy_info_m88()
1898 return -E1000_ERR_CONFIG; in e1000e_get_phy_info_m88()
1905 phy->polarity_correction = !!(phy_data & in e1000e_get_phy_info_m88()
1916 phy->is_mdix = !!(phy_data & M88E1000_PSSR_MDIX); in e1000e_get_phy_info_m88()
1919 ret_val = hw->phy.ops.get_cable_length(hw); in e1000e_get_phy_info_m88()
1927 phy->local_rx = (phy_data & LPA_1000LOCALRXOK) in e1000e_get_phy_info_m88()
1930 phy->remote_rx = (phy_data & LPA_1000REMRXOK) in e1000e_get_phy_info_m88()
1934 phy->cable_length = E1000_CABLE_LENGTH_UNDEFINED; in e1000e_get_phy_info_m88()
1935 phy->local_rx = e1000_1000t_rx_status_undefined; in e1000e_get_phy_info_m88()
1936 phy->remote_rx = e1000_1000t_rx_status_undefined; in e1000e_get_phy_info_m88()
1943 * e1000e_get_phy_info_igp - Retrieve igp PHY information
1947 * set/determine 10base-T extended distance and polarity correction. Read
1953 struct e1000_phy_info *phy = &hw->phy; in e1000e_get_phy_info_igp()
1964 return -E1000_ERR_CONFIG; in e1000e_get_phy_info_igp()
1967 phy->polarity_correction = true; in e1000e_get_phy_info_igp()
1977 phy->is_mdix = !!(data & IGP01E1000_PSSR_MDIX); in e1000e_get_phy_info_igp()
1981 ret_val = phy->ops.get_cable_length(hw); in e1000e_get_phy_info_igp()
1989 phy->local_rx = (data & LPA_1000LOCALRXOK) in e1000e_get_phy_info_igp()
1992 phy->remote_rx = (data & LPA_1000REMRXOK) in e1000e_get_phy_info_igp()
1995 phy->cable_length = E1000_CABLE_LENGTH_UNDEFINED; in e1000e_get_phy_info_igp()
1996 phy->local_rx = e1000_1000t_rx_status_undefined; in e1000e_get_phy_info_igp()
1997 phy->remote_rx = e1000_1000t_rx_status_undefined; in e1000e_get_phy_info_igp()
2004 * e1000_get_phy_info_ife - Retrieves various IFE PHY states
2011 struct e1000_phy_info *phy = &hw->phy; in e1000_get_phy_info_ife()
2022 return -E1000_ERR_CONFIG; in e1000_get_phy_info_ife()
2028 phy->polarity_correction = !(data & IFE_PSC_AUTO_POLARITY_DISABLE); in e1000_get_phy_info_ife()
2030 if (phy->polarity_correction) { in e1000_get_phy_info_ife()
2036 phy->cable_polarity = ((data & IFE_PSC_FORCE_POLARITY) in e1000_get_phy_info_ife()
2045 phy->is_mdix = !!(data & IFE_PMC_MDIX_STATUS); in e1000_get_phy_info_ife()
2048 phy->cable_length = E1000_CABLE_LENGTH_UNDEFINED; in e1000_get_phy_info_ife()
2049 phy->local_rx = e1000_1000t_rx_status_undefined; in e1000_get_phy_info_ife()
2050 phy->remote_rx = e1000_1000t_rx_status_undefined; in e1000_get_phy_info_ife()
2056 * e1000e_phy_sw_reset - PHY software reset
2082 * e1000e_phy_hw_reset_generic - PHY hardware reset
2092 struct e1000_phy_info *phy = &hw->phy; in e1000e_phy_hw_reset_generic()
2096 if (phy->ops.check_reset_block) { in e1000e_phy_hw_reset_generic()
2097 ret_val = phy->ops.check_reset_block(hw); in e1000e_phy_hw_reset_generic()
2102 ret_val = phy->ops.acquire(hw); in e1000e_phy_hw_reset_generic()
2110 udelay(phy->reset_delay_us); in e1000e_phy_hw_reset_generic()
2117 phy->ops.release(hw); in e1000e_phy_hw_reset_generic()
2119 return phy->ops.get_cfg_done(hw); in e1000e_phy_hw_reset_generic()
2123 * e1000e_get_cfg_done_generic - Generic configuration done
2126 * Generic function to wait 10 milli-seconds for configuration to complete
2137 * e1000e_phy_init_script_igp3 - Inits the IGP3 PHY
2147 /* Enable rise/fall, 10-mode work in class-A */ in e1000e_phy_init_script_igp3()
2205 /* Enable LPLU and disable AN to 1000 in non-D0a states, in e1000e_phy_init_script_igp3()
2220 * e1000e_get_phy_type_from_id - Get PHY type from id
2274 * e1000e_determine_phy_address - Determines PHY address.
2287 hw->phy.id = phy_type; in e1000e_determine_phy_address()
2290 hw->phy.addr = phy_addr; in e1000e_determine_phy_address()
2295 phy_type = e1000e_get_phy_type_from_id(hw->phy.id); in e1000e_determine_phy_address()
2297 /* If phy_type is valid, break - we found our in e1000e_determine_phy_address()
2308 return -E1000_ERR_PHY_TYPE; in e1000e_determine_phy_address()
2312 * e1000_get_phy_addr_for_bm_page - Retrieve PHY page address
2329 * e1000e_write_phy_reg_bm - Write BM PHY register
2342 ret_val = hw->phy.ops.acquire(hw); in e1000e_write_phy_reg_bm()
2353 hw->phy.addr = e1000_get_phy_addr_for_bm_page(page, offset); in e1000e_write_phy_reg_bm()
2362 if (hw->phy.addr == 1) { in e1000e_write_phy_reg_bm()
2381 hw->phy.ops.release(hw); in e1000e_write_phy_reg_bm()
2386 * e1000e_read_phy_reg_bm - Read BM PHY register
2400 ret_val = hw->phy.ops.acquire(hw); in e1000e_read_phy_reg_bm()
2411 hw->phy.addr = e1000_get_phy_addr_for_bm_page(page, offset); in e1000e_read_phy_reg_bm()
2420 if (hw->phy.addr == 1) { in e1000e_read_phy_reg_bm()
2438 hw->phy.ops.release(hw); in e1000e_read_phy_reg_bm()
2443 * e1000e_read_phy_reg_bm2 - Read BM PHY register
2457 ret_val = hw->phy.ops.acquire(hw); in e1000e_read_phy_reg_bm2()
2468 hw->phy.addr = 1; in e1000e_read_phy_reg_bm2()
2482 hw->phy.ops.release(hw); in e1000e_read_phy_reg_bm2()
2487 * e1000e_write_phy_reg_bm2 - Write BM PHY register
2500 ret_val = hw->phy.ops.acquire(hw); in e1000e_write_phy_reg_bm2()
2511 hw->phy.addr = 1; in e1000e_write_phy_reg_bm2()
2526 hw->phy.ops.release(hw); in e1000e_write_phy_reg_bm2()
2531 * e1000_enable_phy_wakeup_reg_access_bm - enable access to BM wakeup registers
2544 hw->phy.addr = 1; in e1000_enable_phy_wakeup_reg_access_bm()
2574 /* Select Host Wakeup Registers page - caller now able to write in e1000_enable_phy_wakeup_reg_access_bm()
2581 * e1000_disable_phy_wakeup_reg_access_bm - disable access to BM wakeup regs
2612 * e1000_access_phy_wakeup_reg_bm - Read/write BM PHY wakeup register
2645 if ((hw->mac.type == e1000_pchlan) && in e1000_access_phy_wakeup_reg_bm()
2690 * e1000_power_up_phy_copper - Restore copper link in case of PHY power down
2708 * e1000_power_down_phy_copper - Restore copper link in case of PHY power down
2727 * __e1000_read_phy_reg_hv - Read HV PHY register
2744 u32 phy_addr = hw->phy.addr = e1000_get_phy_addr_for_hv_page(page); in __e1000_read_phy_reg_hv()
2747 ret_val = hw->phy.ops.acquire(hw); in __e1000_read_phy_reg_hv()
2774 hw->phy.addr = phy_addr; in __e1000_read_phy_reg_hv()
2787 hw->phy.ops.release(hw); in __e1000_read_phy_reg_hv()
2793 * e1000_read_phy_reg_hv - Read HV PHY register
2808 * e1000_read_phy_reg_hv_locked - Read HV PHY register
2822 * e1000_read_phy_reg_page_hv - Read HV PHY register
2836 * __e1000_write_phy_reg_hv - Write HV PHY register
2852 u32 phy_addr = hw->phy.addr = e1000_get_phy_addr_for_hv_page(page); in __e1000_write_phy_reg_hv()
2855 ret_val = hw->phy.ops.acquire(hw); in __e1000_write_phy_reg_hv()
2880 if ((hw->phy.type == e1000_phy_82578) && in __e1000_write_phy_reg_hv()
2881 (hw->phy.revision >= 1) && in __e1000_write_phy_reg_hv()
2882 (hw->phy.addr == 2) && in __e1000_write_phy_reg_hv()
2898 hw->phy.addr = phy_addr; in __e1000_write_phy_reg_hv()
2913 hw->phy.ops.release(hw); in __e1000_write_phy_reg_hv()
2919 * e1000_write_phy_reg_hv - Write HV PHY register
2933 * e1000_write_phy_reg_hv_locked - Write HV PHY register
2947 * e1000_write_phy_reg_page_hv - Write HV PHY register
2961 * e1000_get_phy_addr_for_hv_page - Get PHY address based on page
2975 * e1000_access_phy_debug_regs_hv - Read HV PHY vendor specific high registers
2994 addr_reg = ((hw->phy.type == e1000_phy_82578) ? in e1000_access_phy_debug_regs_hv()
2999 hw->phy.addr = 2; in e1000_access_phy_debug_regs_hv()
3021 * e1000_link_stall_workaround_hv - Si workaround
3029 * packet buffer after the PHY detects link up.
3036 if (hw->phy.type != e1000_phy_82578) in e1000_link_stall_workaround_hv()
3069 * e1000_check_polarity_82577 - Checks the polarity.
3072 * Success returns 0, Failure returns -E1000_ERR_PHY (-2)
3078 struct e1000_phy_info *phy = &hw->phy; in e1000_check_polarity_82577()
3085 phy->cable_polarity = ((data & I82577_PHY_STATUS2_REV_POLARITY) in e1000_check_polarity_82577()
3093 * e1000_phy_force_speed_duplex_82577 - Force speed/duplex for I82577 PHY
3100 struct e1000_phy_info *phy = &hw->phy; in e1000_phy_force_speed_duplex_82577()
3117 if (phy->autoneg_wait_to_complete) { in e1000_phy_force_speed_duplex_82577()
3137 * e1000_get_phy_info_82577 - Retrieve I82577 PHY information
3141 * set/determine 10base-T extended distance and polarity correction. Read
3147 struct e1000_phy_info *phy = &hw->phy; in e1000_get_phy_info_82577()
3158 return -E1000_ERR_CONFIG; in e1000_get_phy_info_82577()
3161 phy->polarity_correction = true; in e1000_get_phy_info_82577()
3171 phy->is_mdix = !!(data & I82577_PHY_STATUS2_MDIX); in e1000_get_phy_info_82577()
3175 ret_val = hw->phy.ops.get_cable_length(hw); in e1000_get_phy_info_82577()
3183 phy->local_rx = (data & LPA_1000LOCALRXOK) in e1000_get_phy_info_82577()
3186 phy->remote_rx = (data & LPA_1000REMRXOK) in e1000_get_phy_info_82577()
3189 phy->cable_length = E1000_CABLE_LENGTH_UNDEFINED; in e1000_get_phy_info_82577()
3190 phy->local_rx = e1000_1000t_rx_status_undefined; in e1000_get_phy_info_82577()
3191 phy->remote_rx = e1000_1000t_rx_status_undefined; in e1000_get_phy_info_82577()
3198 * e1000_get_cable_length_82577 - Determine cable length for 82577 PHY
3206 struct e1000_phy_info *phy = &hw->phy; in e1000_get_cable_length_82577()
3218 return -E1000_ERR_PHY; in e1000_get_cable_length_82577()
3220 phy->cable_length = length; in e1000_get_cable_length_82577()