Lines Matching defs:phy
61 struct e1000_phy_info *phy = &hw->phy;
66 if (!phy->ops.read_reg)
74 phy->id = (u32)(phy_id << 16);
80 phy->id |= (u32)(phy_id & PHY_REVISION_MASK);
81 phy->revision = (u32)(phy_id & ~PHY_REVISION_MASK);
83 if (phy->id != 0 && phy->id != PHY_REVISION_MASK)
120 struct e1000_phy_info *phy = &hw->phy;
133 (phy->addr << E1000_MDIC_PHY_SHIFT) |
183 struct e1000_phy_info *phy = &hw->phy;
197 (phy->addr << E1000_MDIC_PHY_SHIFT) |
250 ret_val = hw->phy.ops.acquire(hw);
257 hw->phy.ops.release(hw);
275 ret_val = hw->phy.ops.acquire(hw);
282 hw->phy.ops.release(hw);
293 * already acquired. Note, this function sets phy.addr to 1 so the caller
300 hw->phy.addr = 1;
322 if (!hw->phy.ops.acquire)
325 ret_val = hw->phy.ops.acquire(hw);
339 hw->phy.ops.release(hw);
389 if (!hw->phy.ops.acquire)
392 ret_val = hw->phy.ops.acquire(hw);
405 hw->phy.ops.release(hw);
457 if (!hw->phy.ops.acquire)
460 ret_val = hw->phy.ops.acquire(hw);
476 hw->phy.ops.release(hw);
530 if (!hw->phy.ops.acquire)
533 ret_val = hw->phy.ops.acquire(hw);
546 hw->phy.ops.release(hw);
596 hw->phy.original_ms_type = (phy_data & CTL1000_ENABLE_MASTER) ?
600 switch (hw->phy.ms_type) {
653 switch (hw->phy.mdix) {
680 struct e1000_phy_info *phy = &hw->phy;
690 if (phy->type != e1000_phy_bm)
702 switch (phy->mdix) {
725 if (phy->disable_polarity_correction)
729 if (phy->type == e1000_phy_bm) {
731 if (phy->id == BME1000_E_PHY_ID_R2) {
738 ret_val = phy->ops.commit(hw);
752 if ((phy->type == e1000_phy_m88) &&
753 (phy->revision < E1000_REVISION_4) &&
754 (phy->id != BME1000_E_PHY_ID_R2)) {
764 if ((phy->revision == 2) && (phy->id == M88E1111_I_PHY_ID)) {
780 if ((phy->type == e1000_phy_bm) && (phy->id == BME1000_E_PHY_ID_R2)) {
793 if (phy->ops.commit) {
794 ret_val = phy->ops.commit(hw);
801 if (phy->type == e1000_phy_82578) {
826 struct e1000_phy_info *phy = &hw->phy;
842 if (hw->phy.ops.set_d0_lplu_state) {
843 ret_val = hw->phy.ops.set_d0_lplu_state(hw, false);
856 switch (phy->mdix) {
878 if (phy->autoneg_advertised == ADVERTISE_1000_FULL) {
919 struct e1000_phy_info *phy = &hw->phy;
924 phy->autoneg_advertised &= phy->autoneg_mask;
931 if (phy->autoneg_mask & ADVERTISE_1000_FULL) {
954 e_dbg("autoneg_advertised %x\n", phy->autoneg_advertised);
957 if (phy->autoneg_advertised & ADVERTISE_10_HALF) {
963 if (phy->autoneg_advertised & ADVERTISE_10_FULL) {
969 if (phy->autoneg_advertised & ADVERTISE_100_HALF) {
975 if (phy->autoneg_advertised & ADVERTISE_100_FULL) {
981 if (phy->autoneg_advertised & ADVERTISE_1000_HALF)
985 if (phy->autoneg_advertised & ADVERTISE_1000_FULL) {
1053 if (phy->autoneg_mask & ADVERTISE_1000_FULL)
1070 struct e1000_phy_info *phy = &hw->phy;
1077 phy->autoneg_advertised &= phy->autoneg_mask;
1082 if (!phy->autoneg_advertised)
1083 phy->autoneg_advertised = phy->autoneg_mask;
1108 if (phy->autoneg_wait_to_complete) {
1147 ret_val = hw->phy.ops.force_speed_duplex(hw);
1183 struct e1000_phy_info *phy = &hw->phy;
1216 if (phy->autoneg_wait_to_complete) {
1217 e_dbg("Waiting for forced speed/duplex link on IGP phy.\n");
1247 struct e1000_phy_info *phy = &hw->phy;
1276 /* Reset the phy to commit changes. */
1277 if (hw->phy.ops.commit) {
1278 ret_val = hw->phy.ops.commit(hw);
1283 if (phy->autoneg_wait_to_complete) {
1284 e_dbg("Waiting for forced speed/duplex link on M88 phy.\n");
1292 if (hw->phy.type != e1000_phy_m88) {
1315 if (hw->phy.type != e1000_phy_m88)
1322 /* Resetting the phy means we need to re-force TX_CLK in the
1354 struct e1000_phy_info *phy = &hw->phy;
1385 if (phy->autoneg_wait_to_complete) {
1386 e_dbg("Waiting for forced speed/duplex link on IFE phy.\n");
1434 /* Disable autoneg on the phy */
1481 struct e1000_phy_info *phy = &hw->phy;
1499 if (phy->smart_speed == e1000_smart_speed_on) {
1510 } else if (phy->smart_speed == e1000_smart_speed_off) {
1522 } else if ((phy->autoneg_advertised == E1000_ALL_SPEED_DUPLEX) ||
1523 (phy->autoneg_advertised == E1000_ALL_NOT_GIG) ||
1524 (phy->autoneg_advertised == E1000_ALL_10_SPEED)) {
1552 struct e1000_phy_info *phy = &hw->phy;
1556 switch (phy->type) {
1571 phy->speed_downgraded = false;
1578 phy->speed_downgraded = !!(phy_data & mask);
1593 struct e1000_phy_info *phy = &hw->phy;
1600 phy->cable_polarity = ((data & M88E1000_PSSR_REV_POLARITY)
1618 struct e1000_phy_info *phy = &hw->phy;
1644 phy->cable_polarity = ((data & mask)
1659 struct e1000_phy_info *phy = &hw->phy;
1665 if (phy->polarity_correction) {
1676 phy->cable_polarity = ((phy_data & mask)
1779 struct e1000_phy_info *phy = &hw->phy;
1793 phy->min_cable_length = e1000_m88_cable_length_table[index];
1794 phy->max_cable_length = e1000_m88_cable_length_table[index + 1];
1796 phy->cable_length = (phy->min_cable_length + phy->max_cable_length) / 2;
1814 struct e1000_phy_info *phy = &hw->phy;
1861 phy->min_cable_length = (((agc_value - IGP02E1000_AGC_RANGE) > 0) ?
1863 phy->max_cable_length = agc_value + IGP02E1000_AGC_RANGE;
1865 phy->cable_length = (phy->min_cable_length + phy->max_cable_length) / 2;
1882 struct e1000_phy_info *phy = &hw->phy;
1887 if (phy->media_type != e1000_media_type_copper) {
1905 phy->polarity_correction = !!(phy_data &
1916 phy->is_mdix = !!(phy_data & M88E1000_PSSR_MDIX);
1919 ret_val = hw->phy.ops.get_cable_length(hw);
1927 phy->local_rx = (phy_data & LPA_1000LOCALRXOK)
1930 phy->remote_rx = (phy_data & LPA_1000REMRXOK)
1934 phy->cable_length = E1000_CABLE_LENGTH_UNDEFINED;
1935 phy->local_rx = e1000_1000t_rx_status_undefined;
1936 phy->remote_rx = e1000_1000t_rx_status_undefined;
1953 struct e1000_phy_info *phy = &hw->phy;
1967 phy->polarity_correction = true;
1977 phy->is_mdix = !!(data & IGP01E1000_PSSR_MDIX);
1981 ret_val = phy->ops.get_cable_length(hw);
1989 phy->local_rx = (data & LPA_1000LOCALRXOK)
1992 phy->remote_rx = (data & LPA_1000REMRXOK)
1995 phy->cable_length = E1000_CABLE_LENGTH_UNDEFINED;
1996 phy->local_rx = e1000_1000t_rx_status_undefined;
1997 phy->remote_rx = e1000_1000t_rx_status_undefined;
2007 * Populates "phy" structure with various feature states.
2011 struct e1000_phy_info *phy = &hw->phy;
2028 phy->polarity_correction = !(data & IFE_PSC_AUTO_POLARITY_DISABLE);
2030 if (phy->polarity_correction) {
2036 phy->cable_polarity = ((data & IFE_PSC_FORCE_POLARITY)
2045 phy->is_mdix = !!(data & IFE_PMC_MDIX_STATUS);
2048 phy->cable_length = E1000_CABLE_LENGTH_UNDEFINED;
2049 phy->local_rx = e1000_1000t_rx_status_undefined;
2050 phy->remote_rx = e1000_1000t_rx_status_undefined;
2092 struct e1000_phy_info *phy = &hw->phy;
2096 if (phy->ops.check_reset_block) {
2097 ret_val = phy->ops.check_reset_block(hw);
2102 ret_val = phy->ops.acquire(hw);
2110 udelay(phy->reset_delay_us);
2117 phy->ops.release(hw);
2119 return phy->ops.get_cfg_done(hw);
2221 * @phy_id: phy_id read from the phy
2223 * Returns the phy type from the id.
2287 hw->phy.id = phy_type;
2290 hw->phy.addr = phy_addr;
2295 phy_type = e1000e_get_phy_type_from_id(hw->phy.id);
2316 * Returns the phy address for the page requested.
2342 ret_val = hw->phy.ops.acquire(hw);
2353 hw->phy.addr = e1000_get_phy_addr_for_bm_page(page, offset);
2358 /* Page select is register 31 for phy address 1 and 22 for
2359 * phy address 2 and 3. Page select is shifted only for
2360 * phy address 1.
2362 if (hw->phy.addr == 1) {
2381 hw->phy.ops.release(hw);
2400 ret_val = hw->phy.ops.acquire(hw);
2411 hw->phy.addr = e1000_get_phy_addr_for_bm_page(page, offset);
2416 /* Page select is register 31 for phy address 1 and 22 for
2417 * phy address 2 and 3. Page select is shifted only for
2418 * phy address 1.
2420 if (hw->phy.addr == 1) {
2438 hw->phy.ops.release(hw);
2457 ret_val = hw->phy.ops.acquire(hw);
2468 hw->phy.addr = 1;
2482 hw->phy.ops.release(hw);
2500 ret_val = hw->phy.ops.acquire(hw);
2511 hw->phy.addr = 1;
2526 hw->phy.ops.release(hw);
2543 /* All page select, port ctrl and wakeup registers use phy address 1 */
2544 hw->phy.addr = 1;
2744 u32 phy_addr = hw->phy.addr = e1000_get_phy_addr_for_hv_page(page);
2747 ret_val = hw->phy.ops.acquire(hw);
2774 hw->phy.addr = phy_addr;
2787 hw->phy.ops.release(hw);
2852 u32 phy_addr = hw->phy.addr = e1000_get_phy_addr_for_hv_page(page);
2855 ret_val = hw->phy.ops.acquire(hw);
2880 if ((hw->phy.type == e1000_phy_82578) &&
2881 (hw->phy.revision >= 1) &&
2882 (hw->phy.addr == 2) &&
2898 hw->phy.addr = phy_addr;
2913 hw->phy.ops.release(hw);
2993 /* This takes care of the difference with desktop vs mobile phy */
2994 addr_reg = ((hw->phy.type == e1000_phy_82578) ?
2998 /* All operations in this function are phy address 2 */
2999 hw->phy.addr = 2;
3036 if (hw->phy.type != e1000_phy_82578)
3078 struct e1000_phy_info *phy = &hw->phy;
3085 phy->cable_polarity = ((data & I82577_PHY_STATUS2_REV_POLARITY)
3100 struct e1000_phy_info *phy = &hw->phy;
3117 if (phy->autoneg_wait_to_complete) {
3118 e_dbg("Waiting for forced speed/duplex link on 82577 phy\n");
3147 struct e1000_phy_info *phy = &hw->phy;
3161 phy->polarity_correction = true;
3171 phy->is_mdix = !!(data & I82577_PHY_STATUS2_MDIX);
3175 ret_val = hw->phy.ops.get_cable_length(hw);
3183 phy->local_rx = (data & LPA_1000LOCALRXOK)
3186 phy->remote_rx = (data & LPA_1000REMRXOK)
3189 phy->cable_length = E1000_CABLE_LENGTH_UNDEFINED;
3190 phy->local_rx = e1000_1000t_rx_status_undefined;
3191 phy->remote_rx = e1000_1000t_rx_status_undefined;
3206 struct e1000_phy_info *phy = &hw->phy;
3220 phy->cable_length = length;