• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/drivers/net/igb/

Lines Matching refs:hw

34 static s32  igb_phy_setup_autoneg(struct e1000_hw *hw);
35 static void igb_phy_force_speed_duplex_setup(struct e1000_hw *hw,
37 static s32 igb_wait_autoneg(struct e1000_hw *hw);
61 * @hw: pointer to the HW structure
67 s32 igb_check_reset_block(struct e1000_hw *hw)
79 * @hw: pointer to the HW structure
84 s32 igb_get_phy_id(struct e1000_hw *hw)
86 struct e1000_phy_info *phy = &hw->phy;
90 ret_val = phy->ops.read_reg(hw, PHY_ID1, &phy_id);
96 ret_val = phy->ops.read_reg(hw, PHY_ID2, &phy_id);
109 * @hw: pointer to the HW structure
113 static s32 igb_phy_reset_dsp(struct e1000_hw *hw)
117 if (!(hw->phy.ops.write_reg))
120 ret_val = hw->phy.ops.write_reg(hw, M88E1000_PHY_GEN_CONTROL, 0xC1);
124 ret_val = hw->phy.ops.write_reg(hw, M88E1000_PHY_GEN_CONTROL, 0);
132 * @hw: pointer to the HW structure
139 s32 igb_read_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 *data)
141 struct e1000_phy_info *phy = &hw->phy;
191 * @hw: pointer to the HW structure
197 s32 igb_write_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 data)
199 struct e1000_phy_info *phy = &hw->phy;
249 * @hw: pointer to the HW structure
256 s32 igb_read_phy_reg_i2c(struct e1000_hw *hw, u32 offset, u16 *data)
258 struct e1000_phy_info *phy = &hw->phy;
297 * @hw: pointer to the HW structure
303 s32 igb_write_phy_reg_i2c(struct e1000_hw *hw, u32 offset, u16 data)
305 struct e1000_phy_info *phy = &hw->phy;
346 * @hw: pointer to the HW structure
354 s32 igb_read_phy_reg_igp(struct e1000_hw *hw, u32 offset, u16 *data)
358 if (!(hw->phy.ops.acquire))
361 ret_val = hw->phy.ops.acquire(hw);
366 ret_val = igb_write_phy_reg_mdic(hw,
370 hw->phy.ops.release(hw);
375 ret_val = igb_read_phy_reg_mdic(hw, MAX_PHY_REG_ADDRESS & offset,
378 hw->phy.ops.release(hw);
386 * @hw: pointer to the HW structure
393 s32 igb_write_phy_reg_igp(struct e1000_hw *hw, u32 offset, u16 data)
397 if (!(hw->phy.ops.acquire))
400 ret_val = hw->phy.ops.acquire(hw);
405 ret_val = igb_write_phy_reg_mdic(hw,
409 hw->phy.ops.release(hw);
414 ret_val = igb_write_phy_reg_mdic(hw, MAX_PHY_REG_ADDRESS & offset,
417 hw->phy.ops.release(hw);
425 * @hw: pointer to the HW structure
429 s32 igb_copper_link_setup_82580(struct e1000_hw *hw)
431 struct e1000_phy_info *phy = &hw->phy;
442 ret_val = hw->phy.ops.reset(hw);
450 ret_val = phy->ops.read_reg(hw, I82580_CFG_REG, &phy_data);
459 ret_val = phy->ops.write_reg(hw, I82580_CFG_REG, phy_data);
467 * @hw: pointer to the HW structure
472 s32 igb_copper_link_setup_m88(struct e1000_hw *hw)
474 struct e1000_phy_info *phy = &hw->phy;
484 ret_val = phy->ops.read_reg(hw, M88E1000_PHY_SPEC_CTRL, &phy_data);
527 ret_val = phy->ops.write_reg(hw, M88E1000_PHY_SPEC_CTRL, phy_data);
536 ret_val = phy->ops.read_reg(hw, M88E1000_EXT_PHY_SPEC_CTRL,
555 ret_val = phy->ops.write_reg(hw, M88E1000_EXT_PHY_SPEC_CTRL,
562 ret_val = igb_phy_sw_reset(hw);
574 * @hw: pointer to the HW structure
579 s32 igb_copper_link_setup_igp(struct e1000_hw *hw)
581 struct e1000_phy_info *phy = &hw->phy;
590 ret_val = phy->ops.reset(hw);
609 ret_val = phy->ops.set_d3_lplu_state(hw, false);
617 ret_val = phy->ops.set_d0_lplu_state(hw, false);
623 ret_val = phy->ops.read_reg(hw, IGP01E1000_PHY_PORT_CTRL, &data);
641 ret_val = phy->ops.write_reg(hw, IGP01E1000_PHY_PORT_CTRL, data);
646 if (hw->mac.autoneg) {
654 ret_val = phy->ops.read_reg(hw,
661 ret_val = phy->ops.write_reg(hw,
668 ret_val = phy->ops.read_reg(hw, PHY_1000T_CTRL, &data);
673 ret_val = phy->ops.write_reg(hw, PHY_1000T_CTRL, data);
678 ret_val = phy->ops.read_reg(hw, PHY_1000T_CTRL, &data);
702 ret_val = phy->ops.write_reg(hw, PHY_1000T_CTRL, data);
713 * @hw: pointer to the HW structure
720 static s32 igb_copper_link_autoneg(struct e1000_hw *hw)
722 struct e1000_phy_info *phy = &hw->phy;
740 ret_val = igb_phy_setup_autoneg(hw);
751 ret_val = phy->ops.read_reg(hw, PHY_CONTROL, &phy_ctrl);
756 ret_val = phy->ops.write_reg(hw, PHY_CONTROL, phy_ctrl);
765 ret_val = igb_wait_autoneg(hw);
773 hw->mac.get_link_status = true;
781 * @hw: pointer to the HW structure
788 static s32 igb_phy_setup_autoneg(struct e1000_hw *hw)
790 struct e1000_phy_info *phy = &hw->phy;
798 ret_val = phy->ops.read_reg(hw, PHY_AUTONEG_ADV, &mii_autoneg_adv_reg);
804 ret_val = phy->ops.read_reg(hw, PHY_1000T_CTRL,
883 switch (hw->fc.current_mode) {
900 * hw's ability to send PAUSE frames.
925 ret_val = phy->ops.write_reg(hw, PHY_AUTONEG_ADV, mii_autoneg_adv_reg);
932 ret_val = phy->ops.write_reg(hw,
945 * @hw: pointer to the HW structure
952 s32 igb_setup_copper_link(struct e1000_hw *hw)
958 if (hw->mac.autoneg) {
963 ret_val = igb_copper_link_autoneg(hw);
972 ret_val = hw->phy.ops.force_speed_duplex(hw);
983 ret_val = igb_phy_has_link(hw,
992 igb_config_collision_dist(hw);
993 ret_val = igb_config_fc_after_link_up(hw);
1004 * @hw: pointer to the HW structure
1010 s32 igb_phy_force_speed_duplex_igp(struct e1000_hw *hw)
1012 struct e1000_phy_info *phy = &hw->phy;
1017 ret_val = phy->ops.read_reg(hw, PHY_CONTROL, &phy_data);
1021 igb_phy_force_speed_duplex_setup(hw, &phy_data);
1023 ret_val = phy->ops.write_reg(hw, PHY_CONTROL, phy_data);
1031 ret_val = phy->ops.read_reg(hw, IGP01E1000_PHY_PORT_CTRL, &phy_data);
1038 ret_val = phy->ops.write_reg(hw, IGP01E1000_PHY_PORT_CTRL, phy_data);
1049 ret_val = igb_phy_has_link(hw,
1060 ret_val = igb_phy_has_link(hw,
1074 * @hw: pointer to the HW structure
1082 s32 igb_phy_force_speed_duplex_m88(struct e1000_hw *hw)
1084 struct e1000_phy_info *phy = &hw->phy;
1093 ret_val = phy->ops.read_reg(hw, M88E1000_PHY_SPEC_CTRL, &phy_data);
1098 ret_val = phy->ops.write_reg(hw, M88E1000_PHY_SPEC_CTRL, phy_data);
1104 ret_val = phy->ops.read_reg(hw, PHY_CONTROL, &phy_data);
1108 igb_phy_force_speed_duplex_setup(hw, &phy_data);
1110 ret_val = phy->ops.write_reg(hw, PHY_CONTROL, phy_data);
1115 ret_val = igb_phy_sw_reset(hw);
1122 ret_val = igb_phy_has_link(hw, PHY_FORCE_LIMIT, 100000, &link);
1131 ret_val = phy->ops.write_reg(hw,
1136 ret_val = igb_phy_reset_dsp(hw);
1142 ret_val = igb_phy_has_link(hw, PHY_FORCE_LIMIT,
1148 ret_val = phy->ops.read_reg(hw, M88E1000_EXT_PHY_SPEC_CTRL, &phy_data);
1158 ret_val = phy->ops.write_reg(hw, M88E1000_EXT_PHY_SPEC_CTRL, phy_data);
1166 ret_val = phy->ops.read_reg(hw, M88E1000_PHY_SPEC_CTRL, &phy_data);
1171 ret_val = phy->ops.write_reg(hw, M88E1000_PHY_SPEC_CTRL, phy_data);
1179 * @hw: pointer to the HW structure
1189 static void igb_phy_force_speed_duplex_setup(struct e1000_hw *hw,
1192 struct e1000_mac_info *mac = &hw->mac;
1196 hw->fc.current_mode = e1000_fc_none;
1233 igb_config_collision_dist(hw);
1240 * @hw: pointer to the HW structure
1252 s32 igb_set_d3_lplu_state(struct e1000_hw *hw, bool active)
1254 struct e1000_phy_info *phy = &hw->phy;
1258 if (!(hw->phy.ops.read_reg))
1261 ret_val = phy->ops.read_reg(hw, IGP02E1000_PHY_POWER_MGMT, &data);
1267 ret_val = phy->ops.write_reg(hw, IGP02E1000_PHY_POWER_MGMT,
1278 ret_val = phy->ops.read_reg(hw,
1285 ret_val = phy->ops.write_reg(hw,
1291 ret_val = phy->ops.read_reg(hw,
1298 ret_val = phy->ops.write_reg(hw,
1308 ret_val = phy->ops.write_reg(hw, IGP02E1000_PHY_POWER_MGMT,
1314 ret_val = phy->ops.read_reg(hw, IGP01E1000_PHY_PORT_CONFIG,
1320 ret_val = phy->ops.write_reg(hw, IGP01E1000_PHY_PORT_CONFIG,
1330 * @hw: pointer to the HW structure
1336 s32 igb_check_downshift(struct e1000_hw *hw)
1338 struct e1000_phy_info *phy = &hw->phy;
1361 ret_val = phy->ops.read_reg(hw, offset, &phy_data);
1372 * @hw: pointer to the HW structure
1378 static s32 igb_check_polarity_m88(struct e1000_hw *hw)
1380 struct e1000_phy_info *phy = &hw->phy;
1384 ret_val = phy->ops.read_reg(hw, M88E1000_PHY_SPEC_STATUS, &data);
1396 * @hw: pointer to the HW structure
1403 static s32 igb_check_polarity_igp(struct e1000_hw *hw)
1405 struct e1000_phy_info *phy = &hw->phy;
1413 ret_val = phy->ops.read_reg(hw, IGP01E1000_PHY_PORT_STATUS, &data);
1430 ret_val = phy->ops.read_reg(hw, offset, &data);
1443 * @hw: pointer to the HW structure
1448 static s32 igb_wait_autoneg(struct e1000_hw *hw)
1455 ret_val = hw->phy.ops.read_reg(hw, PHY_STATUS, &phy_status);
1458 ret_val = hw->phy.ops.read_reg(hw, PHY_STATUS, &phy_status);
1475 * @hw: pointer to the HW structure
1482 s32 igb_phy_has_link(struct e1000_hw *hw, u32 iterations,
1494 ret_val = hw->phy.ops.read_reg(hw, PHY_STATUS, &phy_status);
1503 ret_val = hw->phy.ops.read_reg(hw, PHY_STATUS, &phy_status);
1521 * @hw: pointer to the HW structure
1534 s32 igb_get_cable_length_m88(struct e1000_hw *hw)
1536 struct e1000_phy_info *phy = &hw->phy;
1540 ret_val = phy->ops.read_reg(hw, M88E1000_PHY_SPEC_STATUS, &phy_data);
1562 * @hw: pointer to the HW structure
1571 s32 igb_get_cable_length_igp_2(struct e1000_hw *hw)
1573 struct e1000_phy_info *phy = &hw->phy;
1586 ret_val = phy->ops.read_reg(hw, agc_reg_array[i], &phy_data);
1634 * @hw: pointer to the HW structure
1642 s32 igb_get_phy_info_m88(struct e1000_hw *hw)
1644 struct e1000_phy_info *phy = &hw->phy;
1655 ret_val = igb_phy_has_link(hw, 1, 0, &link);
1665 ret_val = phy->ops.read_reg(hw, M88E1000_PHY_SPEC_CTRL, &phy_data);
1672 ret_val = igb_check_polarity_m88(hw);
1676 ret_val = phy->ops.read_reg(hw, M88E1000_PHY_SPEC_STATUS, &phy_data);
1683 ret_val = phy->ops.get_cable_length(hw);
1687 ret_val = phy->ops.read_reg(hw, PHY_1000T_STATUS, &phy_data);
1711 * @hw: pointer to the HW structure
1718 s32 igb_get_phy_info_igp(struct e1000_hw *hw)
1720 struct e1000_phy_info *phy = &hw->phy;
1725 ret_val = igb_phy_has_link(hw, 1, 0, &link);
1737 ret_val = igb_check_polarity_igp(hw);
1741 ret_val = phy->ops.read_reg(hw, IGP01E1000_PHY_PORT_STATUS, &data);
1749 ret_val = phy->ops.get_cable_length(hw);
1753 ret_val = phy->ops.read_reg(hw, PHY_1000T_STATUS, &data);
1776 * @hw: pointer to the HW structure
1781 s32 igb_phy_sw_reset(struct e1000_hw *hw)
1786 if (!(hw->phy.ops.read_reg))
1789 ret_val = hw->phy.ops.read_reg(hw, PHY_CONTROL, &phy_ctrl);
1794 ret_val = hw->phy.ops.write_reg(hw, PHY_CONTROL, phy_ctrl);
1806 * @hw: pointer to the HW structure
1813 s32 igb_phy_hw_reset(struct e1000_hw *hw)
1815 struct e1000_phy_info *phy = &hw->phy;
1819 ret_val = igb_check_reset_block(hw);
1825 ret_val = phy->ops.acquire(hw);
1840 phy->ops.release(hw);
1842 ret_val = phy->ops.get_cfg_done(hw);
1850 * @hw: pointer to the HW structure
1854 s32 igb_phy_init_script_igp3(struct e1000_hw *hw)
1860 hw->phy.ops.write_reg(hw, 0x2F5B, 0x9018);
1862 hw->phy.ops.write_reg(hw, 0x2F52, 0x0000);
1864 hw->phy.ops.write_reg(hw, 0x2FB1, 0x8B24);
1866 hw->phy.ops.write_reg(hw, 0x2FB2, 0xF8F0);
1868 hw->phy.ops.write_reg(hw, 0x2010, 0x10B0);
1870 hw->phy.ops.write_reg(hw, 0x2011, 0x0000);
1872 hw->phy.ops.write_reg(hw, 0x20DD, 0x249A);
1874 hw->phy.ops.write_reg(hw, 0x20DE, 0x00D3);
1876 hw->phy.ops.write_reg(hw, 0x28B4, 0x04CE);
1878 hw->phy.ops.write_reg(hw, 0x2F70, 0x29E4);
1880 hw->phy.ops.write_reg(hw, 0x0000, 0x0140);
1882 hw->phy.ops.write_reg(hw, 0x1F30, 0x1606);
1884 hw->phy.ops.write_reg(hw, 0x1F31, 0xB814);
1886 hw->phy.ops.write_reg(hw, 0x1F35, 0x002A);
1888 hw->phy.ops.write_reg(hw, 0x1F3E, 0x0067);
1890 hw->phy.ops.write_reg(hw, 0x1F54, 0x0065);
1892 hw->phy.ops.write_reg(hw, 0x1F55, 0x002A);
1894 hw->phy.ops.write_reg(hw, 0x1F56, 0x002A);
1896 hw->phy.ops.write_reg(hw, 0x1F72, 0x3FB0);
1898 hw->phy.ops.write_reg(hw, 0x1F76, 0xC0FF);
1900 hw->phy.ops.write_reg(hw, 0x1F77, 0x1DEC);
1902 hw->phy.ops.write_reg(hw, 0x1F78, 0xF9EF);
1904 hw->phy.ops.write_reg(hw, 0x1F79, 0x0210);
1906 hw->phy.ops.write_reg(hw, 0x1895, 0x0003);
1908 hw->phy.ops.write_reg(hw, 0x1796, 0x0008);
1910 hw->phy.ops.write_reg(hw, 0x1798, 0xD008);
1915 hw->phy.ops.write_reg(hw, 0x1898, 0xD918);
1917 hw->phy.ops.write_reg(hw, 0x187A, 0x0800);
1922 hw->phy.ops.write_reg(hw, 0x0019, 0x008D);
1924 hw->phy.ops.write_reg(hw, 0x001B, 0x2080);
1926 hw->phy.ops.write_reg(hw, 0x0014, 0x0045);
1928 hw->phy.ops.write_reg(hw, 0x0000, 0x1340);
1935 * @hw: pointer to the HW structure
1940 void igb_power_up_phy_copper(struct e1000_hw *hw)
1945 hw->phy.ops.read_reg(hw, PHY_CONTROL, &mii_reg);
1947 hw->phy.ops.write_reg(hw, PHY_CONTROL, mii_reg);
1952 * @hw: pointer to the HW structure
1957 void igb_power_down_phy_copper(struct e1000_hw *hw)
1962 hw->phy.ops.read_reg(hw, PHY_CONTROL, &mii_reg);
1964 hw->phy.ops.write_reg(hw, PHY_CONTROL, mii_reg);
1970 * @hw: pointer to the HW structure
1976 static s32 igb_check_polarity_82580(struct e1000_hw *hw)
1978 struct e1000_phy_info *phy = &hw->phy;
1983 ret_val = phy->ops.read_reg(hw, I82580_PHY_STATUS_2, &data);
1995 * @hw: pointer to the HW structure
2001 s32 igb_phy_force_speed_duplex_82580(struct e1000_hw *hw)
2003 struct e1000_phy_info *phy = &hw->phy;
2009 ret_val = phy->ops.read_reg(hw, PHY_CONTROL, &phy_data);
2013 igb_phy_force_speed_duplex_setup(hw, &phy_data);
2015 ret_val = phy->ops.write_reg(hw, PHY_CONTROL, phy_data);
2023 ret_val = phy->ops.read_reg(hw, I82580_PHY_CTRL_2, &phy_data);
2030 ret_val = phy->ops.write_reg(hw, I82580_PHY_CTRL_2, phy_data);
2041 ret_val = igb_phy_has_link(hw,
2052 ret_val = igb_phy_has_link(hw,
2066 * @hw: pointer to the HW structure
2073 s32 igb_get_phy_info_82580(struct e1000_hw *hw)
2075 struct e1000_phy_info *phy = &hw->phy;
2081 ret_val = igb_phy_has_link(hw, 1, 0, &link);
2093 ret_val = igb_check_polarity_82580(hw);
2097 ret_val = phy->ops.read_reg(hw, I82580_PHY_STATUS_2, &data);
2105 ret_val = hw->phy.ops.get_cable_length(hw);
2109 ret_val = phy->ops.read_reg(hw, PHY_1000T_STATUS, &data);
2132 * @hw: pointer to the HW structure
2137 s32 igb_get_cable_length_82580(struct e1000_hw *hw)
2139 struct e1000_phy_info *phy = &hw->phy;
2144 ret_val = phy->ops.read_reg(hw, I82580_PHY_DIAG_STATUS, &phy_data);