e1000_82541.c (218588) | e1000_82541.c (228386) |
---|---|
1/****************************************************************************** 2 | 1/****************************************************************************** 2 |
3 Copyright (c) 2001-2010, Intel Corporation | 3 Copyright (c) 2001-2011, 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 9 1. Redistributions of source code must retain the above copyright notice, 10 this list of conditions and the following disclaimer. 11 --- 13 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******************************************************************************/ | 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 9 1. Redistributions of source code must retain the above copyright notice, 10 this list of conditions and the following disclaimer. 11 --- 13 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 218588 2011-02-12 00:07:40Z jfv $*/ | 33/*$FreeBSD: head/sys/dev/e1000/e1000_82541.c 228386 2011-12-10 06:55:02Z 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 --- 253 unchanged lines hidden (view full) --- 295/** 296 * e1000_reset_hw_82541 - Reset hardware 297 * @hw: pointer to the HW structure 298 * 299 * This resets the hardware into a known state. 300 **/ 301static s32 e1000_reset_hw_82541(struct e1000_hw *hw) 302{ | 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 --- 253 unchanged lines hidden (view full) --- 295/** 296 * e1000_reset_hw_82541 - Reset hardware 297 * @hw: pointer to the HW structure 298 * 299 * This resets the hardware into a known state. 300 **/ 301static s32 e1000_reset_hw_82541(struct e1000_hw *hw) 302{ |
303 u32 ledctl, ctrl, manc; | 303 u32 ledctl, ctrl, icr, manc; |
304 305 DEBUGFUNC("e1000_reset_hw_82541"); 306 307 DEBUGOUT("Masking off all interrupts\n"); 308 E1000_WRITE_REG(hw, E1000_IMC, 0xFFFFFFFF); 309 310 E1000_WRITE_REG(hw, E1000_RCTL, 0); 311 E1000_WRITE_REG(hw, E1000_TCTL, E1000_TCTL_PSP); --- 47 unchanged lines hidden (view full) --- 359 E1000_WRITE_REG(hw, E1000_LEDCTL, ledctl); 360 } 361 362 /* Once again, mask the interrupts */ 363 DEBUGOUT("Masking off all interrupts\n"); 364 E1000_WRITE_REG(hw, E1000_IMC, 0xFFFFFFFF); 365 366 /* Clear any pending interrupt events. */ | 304 305 DEBUGFUNC("e1000_reset_hw_82541"); 306 307 DEBUGOUT("Masking off all interrupts\n"); 308 E1000_WRITE_REG(hw, E1000_IMC, 0xFFFFFFFF); 309 310 E1000_WRITE_REG(hw, E1000_RCTL, 0); 311 E1000_WRITE_REG(hw, E1000_TCTL, E1000_TCTL_PSP); --- 47 unchanged lines hidden (view full) --- 359 E1000_WRITE_REG(hw, E1000_LEDCTL, ledctl); 360 } 361 362 /* Once again, mask the interrupts */ 363 DEBUGOUT("Masking off all interrupts\n"); 364 E1000_WRITE_REG(hw, E1000_IMC, 0xFFFFFFFF); 365 366 /* Clear any pending interrupt events. */ |
367 E1000_READ_REG(hw, E1000_ICR); | 367 icr = E1000_READ_REG(hw, E1000_ICR); |
368 369 return E1000_SUCCESS; 370} 371 372/** 373 * e1000_init_hw_82541 - Initialize hardware 374 * @hw: pointer to the HW structure 375 * --- 9 unchanged lines hidden (view full) --- 385 DEBUGFUNC("e1000_init_hw_82541"); 386 387 /* Initialize identification LED */ 388 ret_val = mac->ops.id_led_init(hw); 389 if (ret_val) { 390 DEBUGOUT("Error initializing identification LED\n"); 391 /* This is not fatal and we should not stop init due to this */ 392 } | 368 369 return E1000_SUCCESS; 370} 371 372/** 373 * e1000_init_hw_82541 - Initialize hardware 374 * @hw: pointer to the HW structure 375 * --- 9 unchanged lines hidden (view full) --- 385 DEBUGFUNC("e1000_init_hw_82541"); 386 387 /* Initialize identification LED */ 388 ret_val = mac->ops.id_led_init(hw); 389 if (ret_val) { 390 DEBUGOUT("Error initializing identification LED\n"); 391 /* This is not fatal and we should not stop init due to this */ 392 } |
393 | 393 |
394 /* Storing the Speed Power Down value for later use */ 395 ret_val = hw->phy.ops.read_reg(hw, 396 IGP01E1000_GMII_FIFO, 397 &dev_spec->spd_default); 398 if (ret_val) 399 goto out; 400 401 /* Disabling VLAN filtering */ --- 142 unchanged lines hidden (view full) --- 544 545 DEBUGFUNC("e1000_setup_copper_link_82541"); 546 547 ctrl = E1000_READ_REG(hw, E1000_CTRL); 548 ctrl |= E1000_CTRL_SLU; 549 ctrl &= ~(E1000_CTRL_FRCSPD | E1000_CTRL_FRCDPX); 550 E1000_WRITE_REG(hw, E1000_CTRL, ctrl); 551 | 394 /* Storing the Speed Power Down value for later use */ 395 ret_val = hw->phy.ops.read_reg(hw, 396 IGP01E1000_GMII_FIFO, 397 &dev_spec->spd_default); 398 if (ret_val) 399 goto out; 400 401 /* Disabling VLAN filtering */ --- 142 unchanged lines hidden (view full) --- 544 545 DEBUGFUNC("e1000_setup_copper_link_82541"); 546 547 ctrl = E1000_READ_REG(hw, E1000_CTRL); 548 ctrl |= E1000_CTRL_SLU; 549 ctrl &= ~(E1000_CTRL_FRCSPD | E1000_CTRL_FRCDPX); 550 E1000_WRITE_REG(hw, E1000_CTRL, ctrl); 551 |
552 hw->phy.reset_disable = FALSE; 553 | |
554 /* Earlier revs of the IGP phy require us to force MDI. */ 555 if (hw->mac.type == e1000_82541 || hw->mac.type == e1000_82547) { 556 dev_spec->dsp_config = e1000_dsp_config_disabled; 557 phy->mdix = 1; 558 } else { 559 dev_spec->dsp_config = e1000_dsp_config_enabled; 560 } 561 --- 766 unchanged lines hidden --- | 552 /* Earlier revs of the IGP phy require us to force MDI. */ 553 if (hw->mac.type == e1000_82541 || hw->mac.type == e1000_82547) { 554 dev_spec->dsp_config = e1000_dsp_config_disabled; 555 phy->mdix = 1; 556 } else { 557 dev_spec->dsp_config = e1000_dsp_config_enabled; 558 } 559 --- 766 unchanged lines hidden --- |