Deleted Added
full compact
e1000_82541.c (194865) e1000_82541.c (200243)
1/******************************************************************************
2
3 Copyright (c) 2001-2009, Intel Corporation
4 All rights reserved.
5
6 Redistribution and use in source and binary forms, with or without
7 modification, are permitted provided that the following conditions are met:
8

--- 16 unchanged lines hidden (view full) ---

25 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30 POSSIBILITY OF SUCH DAMAGE.
31
32******************************************************************************/
1/******************************************************************************
2
3 Copyright (c) 2001-2009, Intel Corporation
4 All rights reserved.
5
6 Redistribution and use in source and binary forms, with or without
7 modification, are permitted provided that the following conditions are met:
8

--- 16 unchanged lines hidden (view full) ---

25 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30 POSSIBILITY OF SUCH DAMAGE.
31
32******************************************************************************/
33/*$FreeBSD: head/sys/dev/e1000/e1000_82541.c 194865 2009-06-24 17:41:29Z jfv $*/
33/*$FreeBSD: head/sys/dev/e1000/e1000_82541.c 200243 2009-12-08 01:07:44Z jfv $*/
34
35/*
36 * 82541EI Gigabit Ethernet Controller
37 * 82541ER Gigabit Ethernet Controller
38 * 82541GI Gigabit Ethernet Controller
39 * 82541PI Gigabit Ethernet Controller
40 * 82547EI Gigabit Ethernet Controller
41 * 82547GI Gigabit Ethernet Controller

--- 12 unchanged lines hidden (view full) ---

54static s32 e1000_setup_copper_link_82541(struct e1000_hw *hw);
55static s32 e1000_check_for_link_82541(struct e1000_hw *hw);
56static s32 e1000_get_cable_length_igp_82541(struct e1000_hw *hw);
57static s32 e1000_set_d3_lplu_state_82541(struct e1000_hw *hw,
58 bool active);
59static s32 e1000_setup_led_82541(struct e1000_hw *hw);
60static s32 e1000_cleanup_led_82541(struct e1000_hw *hw);
61static void e1000_clear_hw_cntrs_82541(struct e1000_hw *hw);
34
35/*
36 * 82541EI Gigabit Ethernet Controller
37 * 82541ER Gigabit Ethernet Controller
38 * 82541GI Gigabit Ethernet Controller
39 * 82541PI Gigabit Ethernet Controller
40 * 82547EI Gigabit Ethernet Controller
41 * 82547GI Gigabit Ethernet Controller

--- 12 unchanged lines hidden (view full) ---

54static s32 e1000_setup_copper_link_82541(struct e1000_hw *hw);
55static s32 e1000_check_for_link_82541(struct e1000_hw *hw);
56static s32 e1000_get_cable_length_igp_82541(struct e1000_hw *hw);
57static s32 e1000_set_d3_lplu_state_82541(struct e1000_hw *hw,
58 bool active);
59static s32 e1000_setup_led_82541(struct e1000_hw *hw);
60static s32 e1000_cleanup_led_82541(struct e1000_hw *hw);
61static void e1000_clear_hw_cntrs_82541(struct e1000_hw *hw);
62static s32 e1000_read_mac_addr_82541(struct e1000_hw *hw);
62static s32 e1000_config_dsp_after_link_change_82541(struct e1000_hw *hw,
63 bool link_up);
64static s32 e1000_phy_init_script_82541(struct e1000_hw *hw);
65static void e1000_power_down_phy_copper_82541(struct e1000_hw *hw);
66
67static const u16 e1000_igp_cable_length_table[] =
68 { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
69 5, 10, 10, 10, 10, 10, 10, 10, 20, 20, 20, 20, 20, 25, 25, 25,

--- 186 unchanged lines hidden (view full) ---

256 /* multicast address update */
257 mac->ops.update_mc_addr_list = e1000_update_mc_addr_list_generic;
258 /* writing VFTA */
259 mac->ops.write_vfta = e1000_write_vfta_generic;
260 /* clearing VFTA */
261 mac->ops.clear_vfta = e1000_clear_vfta_generic;
262 /* setting MTA */
263 mac->ops.mta_set = e1000_mta_set_generic;
63static s32 e1000_config_dsp_after_link_change_82541(struct e1000_hw *hw,
64 bool link_up);
65static s32 e1000_phy_init_script_82541(struct e1000_hw *hw);
66static void e1000_power_down_phy_copper_82541(struct e1000_hw *hw);
67
68static const u16 e1000_igp_cable_length_table[] =
69 { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
70 5, 10, 10, 10, 10, 10, 10, 10, 20, 20, 20, 20, 20, 25, 25, 25,

--- 186 unchanged lines hidden (view full) ---

257 /* multicast address update */
258 mac->ops.update_mc_addr_list = e1000_update_mc_addr_list_generic;
259 /* writing VFTA */
260 mac->ops.write_vfta = e1000_write_vfta_generic;
261 /* clearing VFTA */
262 mac->ops.clear_vfta = e1000_clear_vfta_generic;
263 /* setting MTA */
264 mac->ops.mta_set = e1000_mta_set_generic;
265 /* read mac address */
266 mac->ops.read_mac_addr = e1000_read_mac_addr_82541;
264 /* ID LED init */
265 mac->ops.id_led_init = e1000_id_led_init_generic;
266 /* setup LED */
267 mac->ops.setup_led = e1000_setup_led_82541;
268 /* cleanup LED */
269 mac->ops.cleanup_led = e1000_cleanup_led_82541;
270 /* turn on/off LED */
271 mac->ops.led_on = e1000_led_on_generic;

--- 1015 unchanged lines hidden (view full) ---

1287 E1000_READ_REG(hw, E1000_CEXTERR);
1288 E1000_READ_REG(hw, E1000_TSCTC);
1289 E1000_READ_REG(hw, E1000_TSCTFC);
1290
1291 E1000_READ_REG(hw, E1000_MGTPRC);
1292 E1000_READ_REG(hw, E1000_MGTPDC);
1293 E1000_READ_REG(hw, E1000_MGTPTC);
1294}
267 /* ID LED init */
268 mac->ops.id_led_init = e1000_id_led_init_generic;
269 /* setup LED */
270 mac->ops.setup_led = e1000_setup_led_82541;
271 /* cleanup LED */
272 mac->ops.cleanup_led = e1000_cleanup_led_82541;
273 /* turn on/off LED */
274 mac->ops.led_on = e1000_led_on_generic;

--- 1015 unchanged lines hidden (view full) ---

1290 E1000_READ_REG(hw, E1000_CEXTERR);
1291 E1000_READ_REG(hw, E1000_TSCTC);
1292 E1000_READ_REG(hw, E1000_TSCTFC);
1293
1294 E1000_READ_REG(hw, E1000_MGTPRC);
1295 E1000_READ_REG(hw, E1000_MGTPDC);
1296 E1000_READ_REG(hw, E1000_MGTPTC);
1297}
1298
1299/**
1300 * e1000_read_mac_addr_82541 - Read device MAC address
1301 * @hw: pointer to the HW structure
1302 *
1303 * Reads the device MAC address from the EEPROM and stores the value.
1304 **/
1305static s32 e1000_read_mac_addr_82541(struct e1000_hw *hw)
1306{
1307 s32 ret_val = E1000_SUCCESS;
1308 u16 offset, nvm_data, i;
1309
1310 DEBUGFUNC("e1000_read_mac_addr");
1311
1312 for (i = 0; i < ETH_ADDR_LEN; i += 2) {
1313 offset = i >> 1;
1314 ret_val = hw->nvm.ops.read(hw, offset, 1, &nvm_data);
1315 if (ret_val) {
1316 DEBUGOUT("NVM Read Error\n");
1317 goto out;
1318 }
1319 hw->mac.perm_addr[i] = (u8)(nvm_data & 0xFF);
1320 hw->mac.perm_addr[i+1] = (u8)(nvm_data >> 8);
1321 }
1322
1323 for (i = 0; i < ETH_ADDR_LEN; i++)
1324 hw->mac.addr[i] = hw->mac.perm_addr[i];
1325
1326out:
1327 return ret_val;
1328}
1329