e1000_manage.c (203049) | e1000_manage.c (205869) |
---|---|
1/****************************************************************************** 2 3 Copyright (c) 2001-2010, 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-2010, 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_manage.c 203049 2010-01-26 22:32:22Z jfv $*/ | 33/*$FreeBSD: head/sys/dev/e1000/e1000_manage.c 205869 2010-03-29 23:36:34Z jfv $*/ |
34 35#include "e1000_api.h" 36 37static u8 e1000_calculate_checksum(u8 *buffer, u32 length); 38 39/** 40 * e1000_calculate_checksum - Calculate checksum for buffer 41 * @buffer: pointer to EEPROM --- 31 unchanged lines hidden (view full) --- 73s32 e1000_mng_enable_host_if_generic(struct e1000_hw *hw) 74{ 75 u32 hicr; 76 s32 ret_val = E1000_SUCCESS; 77 u8 i; 78 79 DEBUGFUNC("e1000_mng_enable_host_if_generic"); 80 | 34 35#include "e1000_api.h" 36 37static u8 e1000_calculate_checksum(u8 *buffer, u32 length); 38 39/** 40 * e1000_calculate_checksum - Calculate checksum for buffer 41 * @buffer: pointer to EEPROM --- 31 unchanged lines hidden (view full) --- 73s32 e1000_mng_enable_host_if_generic(struct e1000_hw *hw) 74{ 75 u32 hicr; 76 s32 ret_val = E1000_SUCCESS; 77 u8 i; 78 79 DEBUGFUNC("e1000_mng_enable_host_if_generic"); 80 |
81 if (!(hw->mac.arc_subsystem_valid)) { 82 DEBUGOUT("ARC subsystem not valid.\n"); 83 ret_val = -E1000_ERR_HOST_INTERFACE_COMMAND; 84 goto out; 85 } 86 |
|
81 /* Check that the host interface is enabled. */ 82 hicr = E1000_READ_REG(hw, E1000_HICR); 83 if ((hicr & E1000_HICR_EN) == 0) { 84 DEBUGOUT("E1000_HOST_EN bit disabled.\n"); 85 ret_val = -E1000_ERR_HOST_INTERFACE_COMMAND; 86 goto out; 87 } 88 /* check the previous command is completed */ --- 271 unchanged lines hidden (view full) --- 360 if (!hw->mac.asf_firmware_present) 361 goto out; 362 363 manc = E1000_READ_REG(hw, E1000_MANC); 364 365 if (!(manc & E1000_MANC_RCV_TCO_EN)) 366 goto out; 367 | 87 /* Check that the host interface is enabled. */ 88 hicr = E1000_READ_REG(hw, E1000_HICR); 89 if ((hicr & E1000_HICR_EN) == 0) { 90 DEBUGOUT("E1000_HOST_EN bit disabled.\n"); 91 ret_val = -E1000_ERR_HOST_INTERFACE_COMMAND; 92 goto out; 93 } 94 /* check the previous command is completed */ --- 271 unchanged lines hidden (view full) --- 366 if (!hw->mac.asf_firmware_present) 367 goto out; 368 369 manc = E1000_READ_REG(hw, E1000_MANC); 370 371 if (!(manc & E1000_MANC_RCV_TCO_EN)) 372 goto out; 373 |
368 if (hw->mac.arc_subsystem_valid) { | 374 if (hw->mac.has_fwsm) { |
369 fwsm = E1000_READ_REG(hw, E1000_FWSM); 370 factps = E1000_READ_REG(hw, E1000_FACTPS); 371 372 if (!(factps & E1000_FACTPS_MNGCG) && 373 ((fwsm & E1000_FWSM_MODE_MASK) == 374 (e1000_mng_mode_pt << E1000_FWSM_MODE_SHIFT))) { 375 ret_val = TRUE; 376 goto out; 377 } | 375 fwsm = E1000_READ_REG(hw, E1000_FWSM); 376 factps = E1000_READ_REG(hw, E1000_FACTPS); 377 378 if (!(factps & E1000_FACTPS_MNGCG) && 379 ((fwsm & E1000_FWSM_MODE_MASK) == 380 (e1000_mng_mode_pt << E1000_FWSM_MODE_SHIFT))) { 381 ret_val = TRUE; 382 goto out; 383 } |
378 } else { 379 if ((manc & E1000_MANC_SMBUS_EN) && 380 !(manc & E1000_MANC_ASF_EN)) { | 384 } else if ((hw->mac.type == e1000_82574) || 385 (hw->mac.type == e1000_82583)) { 386 u16 data; 387 388 factps = E1000_READ_REG(hw, E1000_FACTPS); 389 e1000_read_nvm(hw, NVM_INIT_CONTROL2_REG, 1, &data); 390 391 if (!(factps & E1000_FACTPS_MNGCG) && 392 ((data & E1000_NVM_INIT_CTRL2_MNGM) == 393 (e1000_mng_mode_pt << 13))) { |
381 ret_val = TRUE; 382 goto out; 383 } | 394 ret_val = TRUE; 395 goto out; 396 } |
397 } else if ((manc & E1000_MANC_SMBUS_EN) && 398 !(manc & E1000_MANC_ASF_EN)) { 399 ret_val = TRUE; 400 goto out; |
|
384 } 385 386out: 387 return ret_val; 388} 389 | 401 } 402 403out: 404 return ret_val; 405} 406 |