Deleted Added
full compact
e1000_manage.c (185353) e1000_manage.c (200243)
1/******************************************************************************
2
1/******************************************************************************
2
3 Copyright (c) 2001-2008, Intel Corporation
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
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_manage.c 185353 2008-11-26 23:57:23Z jfv $*/
33/*$FreeBSD: head/sys/dev/e1000/e1000_manage.c 200243 2009-12-08 01:07:44Z 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

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

118
119 fwsm = E1000_READ_REG(hw, E1000_FWSM);
120
121 return (fwsm & E1000_FWSM_MODE_MASK) ==
122 (E1000_MNG_IAMT_MODE << E1000_FWSM_MODE_SHIFT);
123}
124
125/**
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

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

118
119 fwsm = E1000_READ_REG(hw, E1000_FWSM);
120
121 return (fwsm & E1000_FWSM_MODE_MASK) ==
122 (E1000_MNG_IAMT_MODE << E1000_FWSM_MODE_SHIFT);
123}
124
125/**
126 * e1000_enable_tx_pkt_filtering_generic - Enable packet filtering on TX
126 * e1000_enable_tx_pkt_filtering_generic - Enable packet filtering on Tx
127 * @hw: pointer to the HW structure
128 *
129 * Enables packet filtering on transmit packets if manageability is enabled
130 * and host interface is enabled.
131 **/
132bool e1000_enable_tx_pkt_filtering_generic(struct e1000_hw *hw)
133{
134 struct e1000_host_mng_dhcp_cookie *hdr = &hw->mng_cookie;

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

154 if (ret_val != E1000_SUCCESS) {
155 tx_filter = FALSE;
156 goto out;
157 }
158
159 /* Read in the header. Length and offset are in dwords. */
160 len = E1000_MNG_DHCP_COOKIE_LENGTH >> 2;
161 offset = E1000_MNG_DHCP_COOKIE_OFFSET >> 2;
127 * @hw: pointer to the HW structure
128 *
129 * Enables packet filtering on transmit packets if manageability is enabled
130 * and host interface is enabled.
131 **/
132bool e1000_enable_tx_pkt_filtering_generic(struct e1000_hw *hw)
133{
134 struct e1000_host_mng_dhcp_cookie *hdr = &hw->mng_cookie;

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

154 if (ret_val != E1000_SUCCESS) {
155 tx_filter = FALSE;
156 goto out;
157 }
158
159 /* Read in the header. Length and offset are in dwords. */
160 len = E1000_MNG_DHCP_COOKIE_LENGTH >> 2;
161 offset = E1000_MNG_DHCP_COOKIE_OFFSET >> 2;
162 for (i = 0; i < len; i++) {
163 *(buffer + i) = E1000_READ_REG_ARRAY_DWORD(hw,
164 E1000_HOST_IF,
162 for (i = 0; i < len; i++)
163 *(buffer + i) = E1000_READ_REG_ARRAY_DWORD(hw, E1000_HOST_IF,
165 offset + i);
164 offset + i);
166 }
167 hdr_csum = hdr->checksum;
168 hdr->checksum = 0;
169 csum = e1000_calculate_checksum((u8 *)hdr,
170 E1000_MNG_DHCP_COOKIE_LENGTH);
171 /*
172 * If either the checksums or signature don't match, then
173 * the cookie area isn't considered valid, in which case we
174 * take the safe route of assuming Tx filtering is enabled.

--- 216 unchanged lines hidden ---
165 hdr_csum = hdr->checksum;
166 hdr->checksum = 0;
167 csum = e1000_calculate_checksum((u8 *)hdr,
168 E1000_MNG_DHCP_COOKIE_LENGTH);
169 /*
170 * If either the checksums or signature don't match, then
171 * the cookie area isn't considered valid, in which case we
172 * take the safe route of assuming Tx filtering is enabled.

--- 216 unchanged lines hidden ---