1 diff -Nru vanilla/drivers/net/igb/e1000_82575.c linux-i686-2.6.22/drivers/net/igb/e1000_82575.c
2 --- vanilla/drivers/net/igb/e1000_82575.c 1969-12-31 19:00:00.000000000 -0500
3 +++ linux-i686-2.6.22/drivers/net/igb/e1000_82575.c 2009-07-16 19:25:22.000000000 -0400
5 +/*******************************************************************************
7 + Intel(R) Gigabit Ethernet Linux driver
8 + Copyright(c) 2007-2008 Intel Corporation.
10 + This program is free software; you can redistribute it and/or modify it
11 + under the terms and conditions of the GNU General Public License,
12 + version 2, as published by the Free Software Foundation.
14 + This program is distributed in the hope it will be useful, but WITHOUT
15 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16 + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
19 + You should have received a copy of the GNU General Public License along with
20 + this program; if not, write to the Free Software Foundation, Inc.,
21 + 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
23 + The full GNU General Public License is included in this distribution in
24 + the file called "COPYING".
26 + Contact Information:
27 + e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
28 + Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
30 +*******************************************************************************/
33 + * 82575EB Gigabit Network Connection
34 + * 82575EB Gigabit Backplane Connection
35 + * 82575GB Gigabit Network Connection
36 + * 82576 Gigabit Network Connection
39 +#include "e1000_api.h"
41 +static s32 e1000_init_phy_params_82575(struct e1000_hw *hw);
42 +static s32 e1000_init_nvm_params_82575(struct e1000_hw *hw);
43 +static s32 e1000_init_mac_params_82575(struct e1000_hw *hw);
44 +static s32 e1000_acquire_phy_82575(struct e1000_hw *hw);
45 +static void e1000_release_phy_82575(struct e1000_hw *hw);
46 +static s32 e1000_acquire_nvm_82575(struct e1000_hw *hw);
47 +static void e1000_release_nvm_82575(struct e1000_hw *hw);
48 +static s32 e1000_check_for_link_82575(struct e1000_hw *hw);
49 +static s32 e1000_get_cfg_done_82575(struct e1000_hw *hw);
50 +static s32 e1000_get_link_up_info_82575(struct e1000_hw *hw, u16 *speed,
52 +static s32 e1000_init_hw_82575(struct e1000_hw *hw);
53 +static s32 e1000_phy_hw_reset_sgmii_82575(struct e1000_hw *hw);
54 +static s32 e1000_read_phy_reg_sgmii_82575(struct e1000_hw *hw, u32 offset,
56 +static s32 e1000_reset_hw_82575(struct e1000_hw *hw);
57 +static s32 e1000_set_d0_lplu_state_82575(struct e1000_hw *hw,
59 +static s32 e1000_setup_copper_link_82575(struct e1000_hw *hw);
60 +static s32 e1000_setup_fiber_serdes_link_82575(struct e1000_hw *hw);
61 +static s32 e1000_valid_led_default_82575(struct e1000_hw *hw, u16 *data);
62 +static s32 e1000_write_phy_reg_sgmii_82575(struct e1000_hw *hw,
63 + u32 offset, u16 data);
64 +static void e1000_clear_hw_cntrs_82575(struct e1000_hw *hw);
65 +static s32 e1000_acquire_swfw_sync_82575(struct e1000_hw *hw, u16 mask);
66 +static s32 e1000_configure_pcs_link_82575(struct e1000_hw *hw);
67 +static s32 e1000_get_pcs_speed_and_duplex_82575(struct e1000_hw *hw,
68 + u16 *speed, u16 *duplex);
69 +static s32 e1000_get_phy_id_82575(struct e1000_hw *hw);
70 +static void e1000_release_swfw_sync_82575(struct e1000_hw *hw, u16 mask);
71 +static bool e1000_sgmii_active_82575(struct e1000_hw *hw);
72 +static s32 e1000_reset_init_script_82575(struct e1000_hw *hw);
73 +static s32 e1000_read_mac_addr_82575(struct e1000_hw *hw);
74 +static void e1000_power_down_phy_copper_82575(struct e1000_hw *hw);
76 +static void e1000_init_rx_addrs_82575(struct e1000_hw *hw, u16 rar_count);
77 +static void e1000_update_mc_addr_list_82575(struct e1000_hw *hw,
78 + u8 *mc_addr_list, u32 mc_addr_count,
79 + u32 rar_used_count, u32 rar_count);
80 +void e1000_shutdown_fiber_serdes_link_82575(struct e1000_hw *hw);
83 + * e1000_init_phy_params_82575 - Init PHY func ptrs.
84 + * @hw: pointer to the HW structure
86 +static s32 e1000_init_phy_params_82575(struct e1000_hw *hw)
88 + struct e1000_phy_info *phy = &hw->phy;
89 + s32 ret_val = E1000_SUCCESS;
91 + DEBUGFUNC("e1000_init_phy_params_82575");
93 + if (hw->phy.media_type != e1000_media_type_copper) {
94 + phy->type = e1000_phy_none;
97 + phy->ops.power_up = e1000_power_up_phy_copper;
98 + phy->ops.power_down = e1000_power_down_phy_copper_82575;
101 + phy->autoneg_mask = AUTONEG_ADVERTISE_SPEED_DEFAULT;
102 + phy->reset_delay_us = 100;
104 + phy->ops.acquire = e1000_acquire_phy_82575;
105 + phy->ops.check_reset_block = e1000_check_reset_block_generic;
106 + phy->ops.commit = e1000_phy_sw_reset_generic;
107 + phy->ops.get_cfg_done = e1000_get_cfg_done_82575;
108 + phy->ops.release = e1000_release_phy_82575;
110 + if (e1000_sgmii_active_82575(hw)) {
111 + phy->ops.reset = e1000_phy_hw_reset_sgmii_82575;
112 + phy->ops.read_reg = e1000_read_phy_reg_sgmii_82575;
113 + phy->ops.write_reg = e1000_write_phy_reg_sgmii_82575;
115 + phy->ops.reset = e1000_phy_hw_reset_generic;
116 + phy->ops.read_reg = e1000_read_phy_reg_igp;
117 + phy->ops.write_reg = e1000_write_phy_reg_igp;
120 + /* Set phy->phy_addr and phy->id. */
121 + ret_val = e1000_get_phy_id_82575(hw);
123 + /* Verify phy id and set remaining function pointers */
125 + case M88E1111_I_PHY_ID:
126 + phy->type = e1000_phy_m88;
127 + phy->ops.check_polarity = e1000_check_polarity_m88;
128 + phy->ops.get_info = e1000_get_phy_info_m88;
129 + phy->ops.get_cable_length = e1000_get_cable_length_m88;
130 + phy->ops.force_speed_duplex = e1000_phy_force_speed_duplex_m88;
132 + case IGP03E1000_E_PHY_ID:
133 + case IGP04E1000_E_PHY_ID:
134 + phy->type = e1000_phy_igp_3;
135 + phy->ops.check_polarity = e1000_check_polarity_igp;
136 + phy->ops.get_info = e1000_get_phy_info_igp;
137 + phy->ops.get_cable_length = e1000_get_cable_length_igp_2;
138 + phy->ops.force_speed_duplex = e1000_phy_force_speed_duplex_igp;
139 + phy->ops.set_d0_lplu_state = e1000_set_d0_lplu_state_82575;
140 + phy->ops.set_d3_lplu_state = e1000_set_d3_lplu_state_generic;
143 + ret_val = -E1000_ERR_PHY;
152 + * e1000_init_nvm_params_82575 - Init NVM func ptrs.
153 + * @hw: pointer to the HW structure
155 +static s32 e1000_init_nvm_params_82575(struct e1000_hw *hw)
157 + struct e1000_nvm_info *nvm = &hw->nvm;
158 + u32 eecd = E1000_READ_REG(hw, E1000_EECD);
161 + DEBUGFUNC("e1000_init_nvm_params_82575");
163 + nvm->opcode_bits = 8;
164 + nvm->delay_usec = 1;
165 + switch (nvm->override) {
166 + case e1000_nvm_override_spi_large:
167 + nvm->page_size = 32;
168 + nvm->address_bits = 16;
170 + case e1000_nvm_override_spi_small:
171 + nvm->page_size = 8;
172 + nvm->address_bits = 8;
175 + nvm->page_size = eecd & E1000_EECD_ADDR_BITS ? 32 : 8;
176 + nvm->address_bits = eecd & E1000_EECD_ADDR_BITS ? 16 : 8;
180 + nvm->type = e1000_nvm_eeprom_spi;
182 + size = (u16)((eecd & E1000_EECD_SIZE_EX_MASK) >>
183 + E1000_EECD_SIZE_EX_SHIFT);
186 + * Added to a constant, "size" becomes the left-shift value
187 + * for setting word_size.
189 + size += NVM_WORD_SIZE_BASE_SHIFT;
191 + /* EEPROM access above 16k is unsupported */
194 + nvm->word_size = 1 << size;
196 + /* Function Pointers */
197 + nvm->ops.acquire = e1000_acquire_nvm_82575;
198 + nvm->ops.read = e1000_read_nvm_eerd;
199 + nvm->ops.release = e1000_release_nvm_82575;
200 + nvm->ops.update = e1000_update_nvm_checksum_generic;
201 + nvm->ops.valid_led_default = e1000_valid_led_default_82575;
202 + nvm->ops.validate = e1000_validate_nvm_checksum_generic;
203 + nvm->ops.write = e1000_write_nvm_spi;
205 + return E1000_SUCCESS;
209 + * e1000_init_mac_params_82575 - Init MAC func ptrs.
210 + * @hw: pointer to the HW structure
212 +static s32 e1000_init_mac_params_82575(struct e1000_hw *hw)
214 + struct e1000_mac_info *mac = &hw->mac;
215 + struct e1000_dev_spec_82575 *dev_spec = &hw->dev_spec._82575;
218 + DEBUGFUNC("e1000_init_mac_params_82575");
220 + /* Set media type */
222 + * The 82575 uses bits 22:23 for link mode. The mode can be changed
223 + * based on the EEPROM. We cannot rely upon device ID. There
224 + * is no distinguishable difference between fiber and internal
225 + * SerDes mode on the 82575. There can be an external PHY attached
226 + * on the SGMII interface. For this, we'll set sgmii_active to true.
228 + hw->phy.media_type = e1000_media_type_copper;
229 + dev_spec->sgmii_active = false;
231 + ctrl_ext = E1000_READ_REG(hw, E1000_CTRL_EXT);
232 + if ((ctrl_ext & E1000_CTRL_EXT_LINK_MODE_MASK) ==
233 + E1000_CTRL_EXT_LINK_MODE_PCIE_SERDES) {
234 + hw->phy.media_type = e1000_media_type_internal_serdes;
235 + ctrl_ext |= E1000_CTRL_I2C_ENA;
236 + } else if (ctrl_ext & E1000_CTRL_EXT_LINK_MODE_SGMII) {
237 + dev_spec->sgmii_active = true;
238 + ctrl_ext |= E1000_CTRL_I2C_ENA;
240 + ctrl_ext &= ~E1000_CTRL_I2C_ENA;
242 + E1000_WRITE_REG(hw, E1000_CTRL_EXT, ctrl_ext);
244 + /* Set mta register count */
245 + mac->mta_reg_count = 128;
246 + /* Set rar entry count */
247 + mac->rar_entry_count = E1000_RAR_ENTRIES_82575;
248 + if (mac->type == e1000_82576)
249 + mac->rar_entry_count = E1000_RAR_ENTRIES_82576;
250 + /* Set if part includes ASF firmware */
251 + mac->asf_firmware_present = true;
252 + /* Set if manageability features are enabled. */
253 + mac->arc_subsystem_valid =
254 + (E1000_READ_REG(hw, E1000_FWSM) & E1000_FWSM_MODE_MASK)
257 + /* Function pointers */
259 + /* bus type/speed/width */
260 + mac->ops.get_bus_info = e1000_get_bus_info_pcie_generic;
262 + mac->ops.reset_hw = e1000_reset_hw_82575;
263 + /* hw initialization */
264 + mac->ops.init_hw = e1000_init_hw_82575;
266 + mac->ops.setup_link = e1000_setup_link_generic;
267 + /* physical interface link setup */
268 + mac->ops.setup_physical_interface =
269 + (hw->phy.media_type == e1000_media_type_copper)
270 + ? e1000_setup_copper_link_82575
271 + : e1000_setup_fiber_serdes_link_82575;
272 + /* physical interface shutdown */
273 + mac->ops.shutdown_serdes = e1000_shutdown_fiber_serdes_link_82575;
274 + /* check for link */
275 + mac->ops.check_for_link = e1000_check_for_link_82575;
276 + /* receive address register setting */
277 + mac->ops.rar_set = e1000_rar_set_generic;
278 + /* read mac address */
279 + mac->ops.read_mac_addr = e1000_read_mac_addr_82575;
280 + /* multicast address update */
281 + mac->ops.update_mc_addr_list = e1000_update_mc_addr_list_82575;
283 + mac->ops.write_vfta = e1000_write_vfta_generic;
284 + /* clearing VFTA */
285 + mac->ops.clear_vfta = e1000_clear_vfta_generic;
287 + mac->ops.mta_set = e1000_mta_set_generic;
289 + mac->ops.blink_led = e1000_blink_led_generic;
291 + mac->ops.setup_led = e1000_setup_led_generic;
293 + mac->ops.cleanup_led = e1000_cleanup_led_generic;
294 + /* turn on/off LED */
295 + mac->ops.led_on = e1000_led_on_generic;
296 + mac->ops.led_off = e1000_led_off_generic;
297 + /* clear hardware counters */
298 + mac->ops.clear_hw_cntrs = e1000_clear_hw_cntrs_82575;
300 + mac->ops.get_link_up_info = e1000_get_link_up_info_82575;
302 + return E1000_SUCCESS;
306 + * e1000_init_function_pointers_82575 - Init func ptrs.
307 + * @hw: pointer to the HW structure
309 + * Called to initialize all function pointers and parameters.
311 +void e1000_init_function_pointers_82575(struct e1000_hw *hw)
313 + DEBUGFUNC("e1000_init_function_pointers_82575");
315 + hw->mac.ops.init_params = e1000_init_mac_params_82575;
316 + hw->nvm.ops.init_params = e1000_init_nvm_params_82575;
317 + hw->phy.ops.init_params = e1000_init_phy_params_82575;
321 + * e1000_acquire_phy_82575 - Acquire rights to access PHY
322 + * @hw: pointer to the HW structure
324 + * Acquire access rights to the correct PHY.
326 +static s32 e1000_acquire_phy_82575(struct e1000_hw *hw)
330 + DEBUGFUNC("e1000_acquire_phy_82575");
332 + mask = hw->bus.func ? E1000_SWFW_PHY1_SM : E1000_SWFW_PHY0_SM;
334 + return e1000_acquire_swfw_sync_82575(hw, mask);
338 + * e1000_release_phy_82575 - Release rights to access PHY
339 + * @hw: pointer to the HW structure
341 + * A wrapper to release access rights to the correct PHY.
343 +static void e1000_release_phy_82575(struct e1000_hw *hw)
347 + DEBUGFUNC("e1000_release_phy_82575");
349 + mask = hw->bus.func ? E1000_SWFW_PHY1_SM : E1000_SWFW_PHY0_SM;
350 + e1000_release_swfw_sync_82575(hw, mask);
354 + * e1000_read_phy_reg_sgmii_82575 - Read PHY register using sgmii
355 + * @hw: pointer to the HW structure
356 + * @offset: register offset to be read
357 + * @data: pointer to the read data
359 + * Reads the PHY register at offset using the serial gigabit media independent
360 + * interface and stores the retrieved information in data.
362 +static s32 e1000_read_phy_reg_sgmii_82575(struct e1000_hw *hw, u32 offset,
365 + struct e1000_phy_info *phy = &hw->phy;
368 + DEBUGFUNC("e1000_read_phy_reg_sgmii_82575");
370 + if (offset > E1000_MAX_SGMII_PHY_REG_ADDR) {
371 + DEBUGOUT1("PHY Address %u is out of range\n", offset);
372 + return -E1000_ERR_PARAM;
376 + * Set up Op-code, Phy Address, and register address in the I2CCMD
377 + * register. The MAC will take care of interfacing with the
378 + * PHY to retrieve the desired data.
380 + i2ccmd = ((offset << E1000_I2CCMD_REG_ADDR_SHIFT) |
381 + (phy->addr << E1000_I2CCMD_PHY_ADDR_SHIFT) |
382 + (E1000_I2CCMD_OPCODE_READ));
384 + E1000_WRITE_REG(hw, E1000_I2CCMD, i2ccmd);
386 + /* Poll the ready bit to see if the I2C read completed */
387 + for (i = 0; i < E1000_I2CCMD_PHY_TIMEOUT; i++) {
389 + i2ccmd = E1000_READ_REG(hw, E1000_I2CCMD);
390 + if (i2ccmd & E1000_I2CCMD_READY)
393 + if (!(i2ccmd & E1000_I2CCMD_READY)) {
394 + DEBUGOUT("I2CCMD Read did not complete\n");
395 + return -E1000_ERR_PHY;
397 + if (i2ccmd & E1000_I2CCMD_ERROR) {
398 + DEBUGOUT("I2CCMD Error bit set\n");
399 + return -E1000_ERR_PHY;
402 + /* Need to byte-swap the 16-bit value. */
403 + *data = ((i2ccmd >> 8) & 0x00FF) | ((i2ccmd << 8) & 0xFF00);
405 + return E1000_SUCCESS;
409 + * e1000_write_phy_reg_sgmii_82575 - Write PHY register using sgmii
410 + * @hw: pointer to the HW structure
411 + * @offset: register offset to write to
412 + * @data: data to write at register offset
414 + * Writes the data to PHY register at the offset using the serial gigabit
415 + * media independent interface.
417 +static s32 e1000_write_phy_reg_sgmii_82575(struct e1000_hw *hw, u32 offset,
420 + struct e1000_phy_info *phy = &hw->phy;
422 + u16 phy_data_swapped;
424 + DEBUGFUNC("e1000_write_phy_reg_sgmii_82575");
426 + if (offset > E1000_MAX_SGMII_PHY_REG_ADDR) {
427 + DEBUGOUT1("PHY Address %d is out of range\n", offset);
428 + return -E1000_ERR_PARAM;
431 + /* Swap the data bytes for the I2C interface */
432 + phy_data_swapped = ((data >> 8) & 0x00FF) | ((data << 8) & 0xFF00);
435 + * Set up Op-code, Phy Address, and register address in the I2CCMD
436 + * register. The MAC will take care of interfacing with the
437 + * PHY to retrieve the desired data.
439 + i2ccmd = ((offset << E1000_I2CCMD_REG_ADDR_SHIFT) |
440 + (phy->addr << E1000_I2CCMD_PHY_ADDR_SHIFT) |
441 + E1000_I2CCMD_OPCODE_WRITE |
444 + E1000_WRITE_REG(hw, E1000_I2CCMD, i2ccmd);
446 + /* Poll the ready bit to see if the I2C read completed */
447 + for (i = 0; i < E1000_I2CCMD_PHY_TIMEOUT; i++) {
449 + i2ccmd = E1000_READ_REG(hw, E1000_I2CCMD);
450 + if (i2ccmd & E1000_I2CCMD_READY)
453 + if (!(i2ccmd & E1000_I2CCMD_READY)) {
454 + DEBUGOUT("I2CCMD Write did not complete\n");
455 + return -E1000_ERR_PHY;
457 + if (i2ccmd & E1000_I2CCMD_ERROR) {
458 + DEBUGOUT("I2CCMD Error bit set\n");
459 + return -E1000_ERR_PHY;
462 + return E1000_SUCCESS;
466 + * e1000_get_phy_id_82575 - Retrieve PHY addr and id
467 + * @hw: pointer to the HW structure
469 + * Retrieves the PHY address and ID for both PHY's which do and do not use
472 +static s32 e1000_get_phy_id_82575(struct e1000_hw *hw)
474 + struct e1000_phy_info *phy = &hw->phy;
475 + s32 ret_val = E1000_SUCCESS;
478 + DEBUGFUNC("e1000_get_phy_id_82575");
481 + * For SGMII PHYs, we try the list of possible addresses until
482 + * we find one that works. For non-SGMII PHYs
483 + * (e.g. integrated copper PHYs), an address of 1 should
484 + * work. The result of this function should mean phy->phy_addr
485 + * and phy->id are set correctly.
487 + if (!(e1000_sgmii_active_82575(hw))) {
489 + ret_val = e1000_get_phy_id(hw);
494 + * The address field in the I2CCMD register is 3 bits and 0 is invalid.
495 + * Therefore, we need to test 1-7
497 + for (phy->addr = 1; phy->addr < 8; phy->addr++) {
498 + ret_val = e1000_read_phy_reg_sgmii_82575(hw, PHY_ID1, &phy_id);
499 + if (ret_val == E1000_SUCCESS) {
500 + DEBUGOUT2("Vendor ID 0x%08X read at address %u\n",
504 + * At the time of this writing, The M88 part is
505 + * the only supported SGMII PHY product.
507 + if (phy_id == M88_VENDOR)
510 + DEBUGOUT1("PHY address %u was unreadable\n",
515 + /* A valid PHY type couldn't be found. */
516 + if (phy->addr == 8) {
518 + ret_val = -E1000_ERR_PHY;
522 + ret_val = e1000_get_phy_id(hw);
529 + * e1000_phy_hw_reset_sgmii_82575 - Performs a PHY reset
530 + * @hw: pointer to the HW structure
532 + * Resets the PHY using the serial gigabit media independent interface.
534 +static s32 e1000_phy_hw_reset_sgmii_82575(struct e1000_hw *hw)
536 + s32 ret_val = E1000_SUCCESS;
538 + DEBUGFUNC("e1000_phy_hw_reset_sgmii_82575");
541 + * This isn't a true "hard" reset, but is the only reset
542 + * available to us at this time.
545 + DEBUGOUT("Soft resetting SGMII attached PHY...\n");
547 + if (!(hw->phy.ops.write_reg))
551 + * SFP documentation requires the following to configure the SPF module
552 + * to work on SGMII. No further documentation is given.
554 + ret_val = hw->phy.ops.write_reg(hw, 0x1B, 0x8084);
558 + ret_val = hw->phy.ops.commit(hw);
565 + * e1000_set_d0_lplu_state_82575 - Set Low Power Linkup D0 state
566 + * @hw: pointer to the HW structure
567 + * @active: true to enable LPLU, false to disable
569 + * Sets the LPLU D0 state according to the active flag. When
570 + * activating LPLU this function also disables smart speed
571 + * and vice versa. LPLU will not be activated unless the
572 + * device autonegotiation advertisement meets standards of
573 + * either 10 or 10/100 or 10/100/1000 at all duplexes.
574 + * This is a function pointer entry point only called by
575 + * PHY setup routines.
577 +static s32 e1000_set_d0_lplu_state_82575(struct e1000_hw *hw, bool active)
579 + struct e1000_phy_info *phy = &hw->phy;
580 + s32 ret_val = E1000_SUCCESS;
583 + DEBUGFUNC("e1000_set_d0_lplu_state_82575");
585 + if (!(hw->phy.ops.read_reg))
588 + ret_val = phy->ops.read_reg(hw, IGP02E1000_PHY_POWER_MGMT, &data);
593 + data |= IGP02E1000_PM_D0_LPLU;
594 + ret_val = phy->ops.write_reg(hw, IGP02E1000_PHY_POWER_MGMT,
599 + /* When LPLU is enabled, we should disable SmartSpeed */
600 + ret_val = phy->ops.read_reg(hw, IGP01E1000_PHY_PORT_CONFIG,
602 + data &= ~IGP01E1000_PSCFR_SMART_SPEED;
603 + ret_val = phy->ops.write_reg(hw, IGP01E1000_PHY_PORT_CONFIG,
608 + data &= ~IGP02E1000_PM_D0_LPLU;
609 + ret_val = phy->ops.write_reg(hw, IGP02E1000_PHY_POWER_MGMT,
612 + * LPLU and SmartSpeed are mutually exclusive. LPLU is used
613 + * during Dx states where the power conservation is most
614 + * important. During driver activity we should enable
615 + * SmartSpeed, so performance is maintained.
617 + if (phy->smart_speed == e1000_smart_speed_on) {
618 + ret_val = phy->ops.read_reg(hw,
619 + IGP01E1000_PHY_PORT_CONFIG,
624 + data |= IGP01E1000_PSCFR_SMART_SPEED;
625 + ret_val = phy->ops.write_reg(hw,
626 + IGP01E1000_PHY_PORT_CONFIG,
630 + } else if (phy->smart_speed == e1000_smart_speed_off) {
631 + ret_val = phy->ops.read_reg(hw,
632 + IGP01E1000_PHY_PORT_CONFIG,
637 + data &= ~IGP01E1000_PSCFR_SMART_SPEED;
638 + ret_val = phy->ops.write_reg(hw,
639 + IGP01E1000_PHY_PORT_CONFIG,
651 + * e1000_acquire_nvm_82575 - Request for access to EEPROM
652 + * @hw: pointer to the HW structure
654 + * Acquire the necessary semaphores for exclusive access to the EEPROM.
655 + * Set the EEPROM access request bit and wait for EEPROM access grant bit.
656 + * Return successful if access grant bit set, else clear the request for
657 + * EEPROM access and return -E1000_ERR_NVM (-1).
659 +static s32 e1000_acquire_nvm_82575(struct e1000_hw *hw)
663 + DEBUGFUNC("e1000_acquire_nvm_82575");
665 + ret_val = e1000_acquire_swfw_sync_82575(hw, E1000_SWFW_EEP_SM);
669 + ret_val = e1000_acquire_nvm_generic(hw);
672 + e1000_release_swfw_sync_82575(hw, E1000_SWFW_EEP_SM);
679 + * e1000_release_nvm_82575 - Release exclusive access to EEPROM
680 + * @hw: pointer to the HW structure
682 + * Stop any current commands to the EEPROM and clear the EEPROM request bit,
683 + * then release the semaphores acquired.
685 +static void e1000_release_nvm_82575(struct e1000_hw *hw)
687 + DEBUGFUNC("e1000_release_nvm_82575");
689 + e1000_release_nvm_generic(hw);
690 + e1000_release_swfw_sync_82575(hw, E1000_SWFW_EEP_SM);
694 + * e1000_acquire_swfw_sync_82575 - Acquire SW/FW semaphore
695 + * @hw: pointer to the HW structure
696 + * @mask: specifies which semaphore to acquire
698 + * Acquire the SW/FW semaphore to access the PHY or NVM. The mask
699 + * will also specify which port we're acquiring the lock for.
701 +static s32 e1000_acquire_swfw_sync_82575(struct e1000_hw *hw, u16 mask)
705 + u32 fwmask = mask << 16;
706 + s32 ret_val = E1000_SUCCESS;
707 + s32 i = 0, timeout = 200; /* FIXME: find real value to use here */
709 + DEBUGFUNC("e1000_acquire_swfw_sync_82575");
711 + while (i < timeout) {
712 + if (e1000_get_hw_semaphore_generic(hw)) {
713 + ret_val = -E1000_ERR_SWFW_SYNC;
717 + swfw_sync = E1000_READ_REG(hw, E1000_SW_FW_SYNC);
718 + if (!(swfw_sync & (fwmask | swmask)))
722 + * Firmware currently using resource (fwmask)
723 + * or other software thread using resource (swmask)
725 + e1000_put_hw_semaphore_generic(hw);
730 + if (i == timeout) {
731 + DEBUGOUT("Driver can't access resource, SW_FW_SYNC timeout.\n");
732 + ret_val = -E1000_ERR_SWFW_SYNC;
736 + swfw_sync |= swmask;
737 + E1000_WRITE_REG(hw, E1000_SW_FW_SYNC, swfw_sync);
739 + e1000_put_hw_semaphore_generic(hw);
746 + * e1000_release_swfw_sync_82575 - Release SW/FW semaphore
747 + * @hw: pointer to the HW structure
748 + * @mask: specifies which semaphore to acquire
750 + * Release the SW/FW semaphore used to access the PHY or NVM. The mask
751 + * will also specify which port we're releasing the lock for.
753 +static void e1000_release_swfw_sync_82575(struct e1000_hw *hw, u16 mask)
757 + DEBUGFUNC("e1000_release_swfw_sync_82575");
759 + while (e1000_get_hw_semaphore_generic(hw) != E1000_SUCCESS);
762 + swfw_sync = E1000_READ_REG(hw, E1000_SW_FW_SYNC);
763 + swfw_sync &= ~mask;
764 + E1000_WRITE_REG(hw, E1000_SW_FW_SYNC, swfw_sync);
766 + e1000_put_hw_semaphore_generic(hw);
770 + * e1000_get_cfg_done_82575 - Read config done bit
771 + * @hw: pointer to the HW structure
773 + * Read the management control register for the config done bit for
774 + * completion status. NOTE: silicon which is EEPROM-less will fail trying
775 + * to read the config done bit, so an error is *ONLY* logged and returns
776 + * E1000_SUCCESS. If we were to return with error, EEPROM-less silicon
777 + * would not be able to be reset or change link.
779 +static s32 e1000_get_cfg_done_82575(struct e1000_hw *hw)
781 + s32 timeout = PHY_CFG_TIMEOUT;
782 + s32 ret_val = E1000_SUCCESS;
783 + u32 mask = E1000_NVM_CFG_DONE_PORT_0;
785 + DEBUGFUNC("e1000_get_cfg_done_82575");
787 + if (hw->bus.func == 1)
788 + mask = E1000_NVM_CFG_DONE_PORT_1;
791 + if (E1000_READ_REG(hw, E1000_EEMNGCTL) & mask)
797 + DEBUGOUT("MNG configuration cycle has not completed.\n");
800 + /* If EEPROM is not marked present, init the PHY manually */
801 + if (((E1000_READ_REG(hw, E1000_EECD) & E1000_EECD_PRES) == 0) &&
802 + (hw->phy.type == e1000_phy_igp_3)) {
803 + e1000_phy_init_script_igp3(hw);
810 + * e1000_get_link_up_info_82575 - Get link speed/duplex info
811 + * @hw: pointer to the HW structure
812 + * @speed: stores the current speed
813 + * @duplex: stores the current duplex
815 + * This is a wrapper function, if using the serial gigabit media independent
816 + * interface, use PCS to retrieve the link speed and duplex information.
817 + * Otherwise, use the generic function to get the link speed and duplex info.
819 +static s32 e1000_get_link_up_info_82575(struct e1000_hw *hw, u16 *speed,
824 + DEBUGFUNC("e1000_get_link_up_info_82575");
826 + if (hw->phy.media_type != e1000_media_type_copper ||
827 + e1000_sgmii_active_82575(hw)) {
828 + ret_val = e1000_get_pcs_speed_and_duplex_82575(hw, speed,
831 + ret_val = e1000_get_speed_and_duplex_copper_generic(hw, speed,
839 + * e1000_check_for_link_82575 - Check for link
840 + * @hw: pointer to the HW structure
842 + * If sgmii is enabled, then use the pcs register to determine link, otherwise
843 + * use the generic interface for determining link.
845 +static s32 e1000_check_for_link_82575(struct e1000_hw *hw)
850 + DEBUGFUNC("e1000_check_for_link_82575");
852 + /* SGMII link check is done through the PCS register. */
853 + if ((hw->phy.media_type != e1000_media_type_copper) ||
854 + (e1000_sgmii_active_82575(hw)))
855 + ret_val = e1000_get_pcs_speed_and_duplex_82575(hw, &speed,
858 + ret_val = e1000_check_for_copper_link_generic(hw);
864 + * e1000_get_pcs_speed_and_duplex_82575 - Retrieve current speed/duplex
865 + * @hw: pointer to the HW structure
866 + * @speed: stores the current speed
867 + * @duplex: stores the current duplex
869 + * Using the physical coding sub-layer (PCS), retrieve the current speed and
870 + * duplex, then store the values in the pointers provided.
872 +static s32 e1000_get_pcs_speed_and_duplex_82575(struct e1000_hw *hw,
873 + u16 *speed, u16 *duplex)
875 + struct e1000_mac_info *mac = &hw->mac;
878 + DEBUGFUNC("e1000_get_pcs_speed_and_duplex_82575");
880 + /* Set up defaults for the return values of this function */
881 + mac->serdes_has_link = false;
886 + * Read the PCS Status register for link state. For non-copper mode,
887 + * the status register is not accurate. The PCS status register is
890 + pcs = E1000_READ_REG(hw, E1000_PCS_LSTAT);
893 + * The link up bit determines when link is up on autoneg. The sync ok
894 + * gets set once both sides sync up and agree upon link. Stable link
895 + * can be determined by checking for both link up and link sync ok
897 + if ((pcs & E1000_PCS_LSTS_LINK_OK) && (pcs & E1000_PCS_LSTS_SYNK_OK)) {
898 + mac->serdes_has_link = true;
900 + /* Detect and store PCS speed */
901 + if (pcs & E1000_PCS_LSTS_SPEED_1000) {
902 + *speed = SPEED_1000;
903 + } else if (pcs & E1000_PCS_LSTS_SPEED_100) {
904 + *speed = SPEED_100;
909 + /* Detect and store PCS duplex */
910 + if (pcs & E1000_PCS_LSTS_DUPLEX_FULL) {
911 + *duplex = FULL_DUPLEX;
913 + *duplex = HALF_DUPLEX;
917 + return E1000_SUCCESS;
921 + * e1000_init_rx_addrs_82575 - Initialize receive address's
922 + * @hw: pointer to the HW structure
923 + * @rar_count: receive address registers
925 + * Setups the receive address registers by setting the base receive address
926 + * register to the devices MAC address and clearing all the other receive
927 + * address registers to 0.
929 +static void e1000_init_rx_addrs_82575(struct e1000_hw *hw, u16 rar_count)
932 + u8 addr[6] = {0,0,0,0,0,0};
934 + * This function is essentially the same as that of
935 + * e1000_init_rx_addrs_generic. However it also takes care
936 + * of the special case where the register offset of the
937 + * second set of RARs begins elsewhere. This is implicitly taken care by
938 + * function e1000_rar_set_generic.
941 + DEBUGFUNC("e1000_init_rx_addrs_82575");
943 + /* Setup the receive address */
944 + DEBUGOUT("Programming MAC Address into RAR[0]\n");
945 + hw->mac.ops.rar_set(hw, hw->mac.addr, 0);
947 + /* Zero out the other (rar_entry_count - 1) receive addresses */
948 + DEBUGOUT1("Clearing RAR[1-%u]\n", rar_count-1);
949 + for (i = 1; i < rar_count; i++) {
950 + hw->mac.ops.rar_set(hw, addr, i);
955 + * e1000_update_mc_addr_list_82575 - Update Multicast addresses
956 + * @hw: pointer to the HW structure
957 + * @mc_addr_list: array of multicast addresses to program
958 + * @mc_addr_count: number of multicast addresses to program
959 + * @rar_used_count: the first RAR register free to program
960 + * @rar_count: total number of supported Receive Address Registers
962 + * Updates the Receive Address Registers and Multicast Table Array.
963 + * The caller must have a packed mc_addr_list of multicast addresses.
964 + * The parameter rar_count will usually be hw->mac.rar_entry_count
965 + * unless there are workarounds that change this.
967 +static void e1000_update_mc_addr_list_82575(struct e1000_hw *hw,
968 + u8 *mc_addr_list, u32 mc_addr_count,
969 + u32 rar_used_count, u32 rar_count)
973 + u8 addr[6] = {0,0,0,0,0,0};
975 + * This function is essentially the same as that of
976 + * e1000_update_mc_addr_list_generic. However it also takes care
977 + * of the special case where the register offset of the
978 + * second set of RARs begins elsewhere. This is implicitly taken care by
979 + * function e1000_rar_set_generic.
982 + DEBUGFUNC("e1000_update_mc_addr_list_82575");
985 + * Load the first set of multicast addresses into the exact
986 + * filters (RAR). If there are not enough to fill the RAR
987 + * array, clear the filters.
989 + for (i = rar_used_count; i < rar_count; i++) {
990 + if (mc_addr_count) {
991 + e1000_rar_set_generic(hw, mc_addr_list, i);
993 + mc_addr_list += ETH_ADDR_LEN;
995 + e1000_rar_set_generic(hw, addr, i);
999 + /* Clear the old settings from the MTA */
1000 + DEBUGOUT("Clearing MTA\n");
1001 + for (i = 0; i < hw->mac.mta_reg_count; i++) {
1002 + E1000_WRITE_REG_ARRAY(hw, E1000_MTA, i, 0);
1003 + E1000_WRITE_FLUSH(hw);
1006 + /* Load any remaining multicast addresses into the hash table. */
1007 + for (; mc_addr_count > 0; mc_addr_count--) {
1008 + hash_value = e1000_hash_mc_addr(hw, mc_addr_list);
1009 + DEBUGOUT1("Hash value = 0x%03X\n", hash_value);
1010 + hw->mac.ops.mta_set(hw, hash_value);
1011 + mc_addr_list += ETH_ADDR_LEN;
1016 + * e1000_shutdown_fiber_serdes_link_82575 - Remove link during power down
1017 + * @hw: pointer to the HW structure
1019 + * In the case of fiber serdes shut down optics and PCS on driver unload
1020 + * when management pass thru is not enabled.
1022 +void e1000_shutdown_fiber_serdes_link_82575(struct e1000_hw *hw)
1025 + u16 eeprom_data = 0;
1027 + if (hw->mac.type != e1000_82576 ||
1028 + (hw->phy.media_type != e1000_media_type_fiber &&
1029 + hw->phy.media_type != e1000_media_type_internal_serdes))
1032 + if (hw->bus.func == 0)
1033 + hw->nvm.ops.read(hw, NVM_INIT_CONTROL3_PORT_A, 1, &eeprom_data);
1036 + * If APM is not enabled in the EEPROM and management interface is
1037 + * not enabled, then power down.
1039 + if (!(eeprom_data & E1000_NVM_APME_82575) &&
1040 + !e1000_enable_mng_pass_thru(hw)) {
1041 + /* Disable PCS to turn off link */
1042 + reg = E1000_READ_REG(hw, E1000_PCS_CFG0);
1043 + reg &= ~E1000_PCS_CFG_PCS_EN;
1044 + E1000_WRITE_REG(hw, E1000_PCS_CFG0, reg);
1046 + /* shutdown the laser */
1047 + reg = E1000_READ_REG(hw, E1000_CTRL_EXT);
1048 + reg |= E1000_CTRL_EXT_SDP7_DATA;
1049 + E1000_WRITE_REG(hw, E1000_CTRL_EXT, reg);
1051 + /* flush the write to verfiy completion */
1052 + E1000_WRITE_FLUSH(hw);
1060 + * e1000_reset_hw_82575 - Reset hardware
1061 + * @hw: pointer to the HW structure
1063 + * This resets the hardware into a known state.
1065 +static s32 e1000_reset_hw_82575(struct e1000_hw *hw)
1070 + DEBUGFUNC("e1000_reset_hw_82575");
1073 + * Prevent the PCI-E bus from sticking if there is no TLP connection
1074 + * on the last TLP read/write transaction when MAC is reset.
1076 + ret_val = e1000_disable_pcie_master_generic(hw);
1078 + DEBUGOUT("PCI-E Master disable polling has failed.\n");
1081 + DEBUGOUT("Masking off all interrupts\n");
1082 + E1000_WRITE_REG(hw, E1000_IMC, 0xffffffff);
1084 + E1000_WRITE_REG(hw, E1000_RCTL, 0);
1085 + E1000_WRITE_REG(hw, E1000_TCTL, E1000_TCTL_PSP);
1086 + E1000_WRITE_FLUSH(hw);
1090 + ctrl = E1000_READ_REG(hw, E1000_CTRL);
1092 + DEBUGOUT("Issuing a global reset to MAC\n");
1093 + E1000_WRITE_REG(hw, E1000_CTRL, ctrl | E1000_CTRL_RST);
1095 + ret_val = e1000_get_auto_rd_done_generic(hw);
1098 + * When auto config read does not complete, do not
1099 + * return with an error. This can happen in situations
1100 + * where there is no eeprom and prevents getting link.
1102 + DEBUGOUT("Auto Read Done did not complete\n");
1105 + /* If EEPROM is not present, run manual init scripts */
1106 + if ((E1000_READ_REG(hw, E1000_EECD) & E1000_EECD_PRES) == 0)
1107 + e1000_reset_init_script_82575(hw);
1109 + /* Clear any pending interrupt events. */
1110 + E1000_WRITE_REG(hw, E1000_IMC, 0xffffffff);
1111 + icr = E1000_READ_REG(hw, E1000_ICR);
1113 + e1000_check_alt_mac_addr_generic(hw);
1119 + * e1000_init_hw_82575 - Initialize hardware
1120 + * @hw: pointer to the HW structure
1122 + * This inits the hardware readying it for operation.
1124 +static s32 e1000_init_hw_82575(struct e1000_hw *hw)
1126 + struct e1000_mac_info *mac = &hw->mac;
1128 + u16 i, rar_count = mac->rar_entry_count;
1130 + DEBUGFUNC("e1000_init_hw_82575");
1132 + /* Initialize identification LED */
1133 + ret_val = e1000_id_led_init_generic(hw);
1135 + DEBUGOUT("Error initializing identification LED\n");
1136 + /* This is not fatal and we should not stop init due to this */
1139 + /* Disabling VLAN filtering */
1140 + DEBUGOUT("Initializing the IEEE VLAN\n");
1141 + mac->ops.clear_vfta(hw);
1143 + /* Setup the receive address */
1144 + e1000_init_rx_addrs_82575(hw, rar_count);
1145 + /* Zero out the Multicast HASH table */
1146 + DEBUGOUT("Zeroing the MTA\n");
1147 + for (i = 0; i < mac->mta_reg_count; i++)
1148 + E1000_WRITE_REG_ARRAY(hw, E1000_MTA, i, 0);
1150 + /* Setup link and flow control */
1151 + ret_val = mac->ops.setup_link(hw);
1154 + * Clear all of the statistics registers (clear on read). It is
1155 + * important that we do this after we have tried to establish link
1156 + * because the symbol error count will increment wildly if there
1159 + e1000_clear_hw_cntrs_82575(hw);
1165 + * e1000_setup_copper_link_82575 - Configure copper link settings
1166 + * @hw: pointer to the HW structure
1168 + * Configures the link for auto-neg or forced speed and duplex. Then we check
1169 + * for link, once link is established calls to configure collision distance
1170 + * and flow control are called.
1172 +static s32 e1000_setup_copper_link_82575(struct e1000_hw *hw)
1174 + u32 ctrl, led_ctrl;
1178 + DEBUGFUNC("e1000_setup_copper_link_82575");
1180 + ctrl = E1000_READ_REG(hw, E1000_CTRL);
1181 + ctrl |= E1000_CTRL_SLU;
1182 + ctrl &= ~(E1000_CTRL_FRCSPD | E1000_CTRL_FRCDPX);
1183 + E1000_WRITE_REG(hw, E1000_CTRL, ctrl);
1185 + switch (hw->phy.type) {
1186 + case e1000_phy_m88:
1187 + ret_val = e1000_copper_link_setup_m88(hw);
1189 + case e1000_phy_igp_3:
1190 + ret_val = e1000_copper_link_setup_igp(hw);
1191 + /* Setup activity LED */
1192 + led_ctrl = E1000_READ_REG(hw, E1000_LEDCTL);
1193 + led_ctrl &= IGP_ACTIVITY_LED_MASK;
1194 + led_ctrl |= (IGP_ACTIVITY_LED_ENABLE | IGP_LED3_MODE);
1195 + E1000_WRITE_REG(hw, E1000_LEDCTL, led_ctrl);
1198 + ret_val = -E1000_ERR_PHY;
1205 + if (hw->mac.autoneg) {
1207 + * Setup autoneg and flow control advertisement
1208 + * and perform autonegotiation.
1210 + ret_val = e1000_copper_link_autoneg(hw);
1215 + * PHY will be set to 10H, 10F, 100H or 100F
1216 + * depending on user settings.
1218 + DEBUGOUT("Forcing Speed and Duplex\n");
1219 + ret_val = hw->phy.ops.force_speed_duplex(hw);
1221 + DEBUGOUT("Error Forcing Speed and Duplex\n");
1226 + ret_val = e1000_configure_pcs_link_82575(hw);
1231 + * Check link status. Wait up to 100 microseconds for link to become
1234 + ret_val = e1000_phy_has_link_generic(hw,
1235 + COPPER_LINK_UP_LIMIT,
1242 + DEBUGOUT("Valid link established!!!\n");
1243 + /* Config the MAC and PHY after link is up */
1244 + e1000_config_collision_dist_generic(hw);
1245 + ret_val = e1000_config_fc_after_link_up_generic(hw);
1247 + DEBUGOUT("Unable to establish link!!!\n");
1255 + * e1000_setup_fiber_serdes_link_82575 - Setup link for fiber/serdes
1256 + * @hw: pointer to the HW structure
1258 + * Configures speed and duplex for fiber and serdes links.
1260 +static s32 e1000_setup_fiber_serdes_link_82575(struct e1000_hw *hw)
1264 + DEBUGFUNC("e1000_setup_fiber_serdes_link_82575");
1267 + * On the 82575, SerDes loopback mode persists until it is
1268 + * explicitly turned off or a power cycle is performed. A read to
1269 + * the register does not indicate its status. Therefore, we ensure
1270 + * loopback mode is disabled during initialization.
1272 + E1000_WRITE_REG(hw, E1000_SCTL, E1000_SCTL_DISABLE_SERDES_LOOPBACK);
1274 + /* Force link up, set 1gb, set both sw defined pins */
1275 + reg = E1000_READ_REG(hw, E1000_CTRL);
1276 + reg |= E1000_CTRL_SLU |
1277 + E1000_CTRL_SPD_1000 |
1278 + E1000_CTRL_FRCSPD |
1279 + E1000_CTRL_SWDPIN0 |
1280 + E1000_CTRL_SWDPIN1;
1281 + E1000_WRITE_REG(hw, E1000_CTRL, reg);
1283 + /* Power on phy for 82576 fiber adapters */
1284 + if (hw->mac.type == e1000_82576) {
1285 + reg = E1000_READ_REG(hw, E1000_CTRL_EXT);
1286 + reg &= ~E1000_CTRL_EXT_SDP7_DATA;
1287 + E1000_WRITE_REG(hw, E1000_CTRL_EXT, reg);
1290 + /* Set switch control to serdes energy detect */
1291 + reg = E1000_READ_REG(hw, E1000_CONNSW);
1292 + reg |= E1000_CONNSW_ENRGSRC;
1293 + E1000_WRITE_REG(hw, E1000_CONNSW, reg);
1296 + * New SerDes mode allows for forcing speed or autonegotiating speed
1297 + * at 1gb. Autoneg should be default set by most drivers. This is the
1298 + * mode that will be compatible with older link partners and switches.
1299 + * However, both are supported by the hardware and some drivers/tools.
1301 + reg = E1000_READ_REG(hw, E1000_PCS_LCTL);
1303 + reg &= ~(E1000_PCS_LCTL_AN_ENABLE | E1000_PCS_LCTL_FLV_LINK_UP |
1304 + E1000_PCS_LCTL_FSD | E1000_PCS_LCTL_FORCE_LINK);
1306 + if (hw->mac.autoneg) {
1307 + /* Set PCS register for autoneg */
1308 + reg |= E1000_PCS_LCTL_FSV_1000 | /* Force 1000 */
1309 + E1000_PCS_LCTL_FDV_FULL | /* SerDes Full duplex */
1310 + E1000_PCS_LCTL_AN_ENABLE | /* Enable Autoneg */
1311 + E1000_PCS_LCTL_AN_RESTART; /* Restart autoneg */
1312 + DEBUGOUT1("Configuring Autoneg; PCS_LCTL = 0x%08X\n", reg);
1314 + /* Set PCS register for forced speed */
1315 + reg |= E1000_PCS_LCTL_FLV_LINK_UP | /* Force link up */
1316 + E1000_PCS_LCTL_FSV_1000 | /* Force 1000 */
1317 + E1000_PCS_LCTL_FDV_FULL | /* SerDes Full duplex */
1318 + E1000_PCS_LCTL_FSD | /* Force Speed */
1319 + E1000_PCS_LCTL_FORCE_LINK; /* Force Link */
1320 + DEBUGOUT1("Configuring Forced Link; PCS_LCTL = 0x%08X\n", reg);
1323 + if (hw->mac.type == e1000_82576) {
1324 + reg |= E1000_PCS_LCTL_FORCE_FCTRL;
1325 + e1000_force_mac_fc_generic(hw);
1328 + E1000_WRITE_REG(hw, E1000_PCS_LCTL, reg);
1330 + return E1000_SUCCESS;
1334 + * e1000_valid_led_default_82575 - Verify a valid default LED config
1335 + * @hw: pointer to the HW structure
1336 + * @data: pointer to the NVM (EEPROM)
1338 + * Read the EEPROM for the current default LED configuration. If the
1339 + * LED configuration is not valid, set to a valid LED configuration.
1341 +static s32 e1000_valid_led_default_82575(struct e1000_hw *hw, u16 *data)
1345 + DEBUGFUNC("e1000_valid_led_default_82575");
1347 + ret_val = hw->nvm.ops.read(hw, NVM_ID_LED_SETTINGS, 1, data);
1349 + DEBUGOUT("NVM Read Error\n");
1353 + if (*data == ID_LED_RESERVED_0000 || *data == ID_LED_RESERVED_FFFF) {
1354 + switch(hw->phy.media_type) {
1355 + case e1000_media_type_fiber:
1356 + case e1000_media_type_internal_serdes:
1357 + *data = ID_LED_DEFAULT_82575_SERDES;
1359 + case e1000_media_type_copper:
1361 + *data = ID_LED_DEFAULT;
1370 + * e1000_configure_pcs_link_82575 - Configure PCS link
1371 + * @hw: pointer to the HW structure
1373 + * Configure the physical coding sub-layer (PCS) link. The PCS link is
1374 + * only used on copper connections where the serialized gigabit media
1375 + * independent interface (sgmii) is being used. Configures the link
1376 + * for auto-negotiation or forces speed/duplex.
1378 +static s32 e1000_configure_pcs_link_82575(struct e1000_hw *hw)
1380 + struct e1000_mac_info *mac = &hw->mac;
1383 + DEBUGFUNC("e1000_configure_pcs_link_82575");
1385 + if (hw->phy.media_type != e1000_media_type_copper ||
1386 + !(e1000_sgmii_active_82575(hw)))
1389 + /* For SGMII, we need to issue a PCS autoneg restart */
1390 + reg = E1000_READ_REG(hw, E1000_PCS_LCTL);
1392 + /* AN time out should be disabled for SGMII mode */
1393 + reg &= ~(E1000_PCS_LCTL_AN_TIMEOUT);
1395 + if (mac->autoneg) {
1396 + /* Make sure forced speed and force link are not set */
1397 + reg &= ~(E1000_PCS_LCTL_FSD | E1000_PCS_LCTL_FORCE_LINK);
1400 + * The PHY should be setup prior to calling this function.
1401 + * All we need to do is restart autoneg and enable autoneg.
1403 + reg |= E1000_PCS_LCTL_AN_RESTART | E1000_PCS_LCTL_AN_ENABLE;
1405 + /* Set PCS register for forced speed */
1407 + /* Turn off bits for full duplex, speed, and autoneg */
1408 + reg &= ~(E1000_PCS_LCTL_FSV_1000 |
1409 + E1000_PCS_LCTL_FSV_100 |
1410 + E1000_PCS_LCTL_FDV_FULL |
1411 + E1000_PCS_LCTL_AN_ENABLE);
1413 + /* Check for duplex first */
1414 + if (mac->forced_speed_duplex & E1000_ALL_FULL_DUPLEX)
1415 + reg |= E1000_PCS_LCTL_FDV_FULL;
1417 + /* Now set speed */
1418 + if (mac->forced_speed_duplex & E1000_ALL_100_SPEED)
1419 + reg |= E1000_PCS_LCTL_FSV_100;
1421 + /* Force speed and force link */
1422 + reg |= E1000_PCS_LCTL_FSD |
1423 + E1000_PCS_LCTL_FORCE_LINK |
1424 + E1000_PCS_LCTL_FLV_LINK_UP;
1426 + DEBUGOUT1("Wrote 0x%08X to PCS_LCTL to configure forced link\n",
1429 + E1000_WRITE_REG(hw, E1000_PCS_LCTL, reg);
1432 + return E1000_SUCCESS;
1436 + * e1000_sgmii_active_82575 - Return sgmii state
1437 + * @hw: pointer to the HW structure
1439 + * 82575 silicon has a serialized gigabit media independent interface (sgmii)
1440 + * which can be enabled for use in the embedded applications. Simply
1441 + * return the current state of the sgmii interface.
1443 +static bool e1000_sgmii_active_82575(struct e1000_hw *hw)
1445 + struct e1000_dev_spec_82575 *dev_spec = &hw->dev_spec._82575;
1447 + DEBUGFUNC("e1000_sgmii_active_82575");
1449 + if (hw->mac.type != e1000_82575 && hw->mac.type != e1000_82576)
1452 + return dev_spec->sgmii_active;
1456 + * e1000_reset_init_script_82575 - Inits HW defaults after reset
1457 + * @hw: pointer to the HW structure
1459 + * Inits recommended HW defaults after a reset when there is no EEPROM
1460 + * detected. This is only for the 82575.
1462 +static s32 e1000_reset_init_script_82575(struct e1000_hw* hw)
1464 + DEBUGFUNC("e1000_reset_init_script_82575");
1466 + if (hw->mac.type == e1000_82575) {
1467 + DEBUGOUT("Running reset init script for 82575\n");
1468 + /* SerDes configuration via SERDESCTRL */
1469 + e1000_write_8bit_ctrl_reg_generic(hw, E1000_SCTL, 0x00, 0x0C);
1470 + e1000_write_8bit_ctrl_reg_generic(hw, E1000_SCTL, 0x01, 0x78);
1471 + e1000_write_8bit_ctrl_reg_generic(hw, E1000_SCTL, 0x1B, 0x23);
1472 + e1000_write_8bit_ctrl_reg_generic(hw, E1000_SCTL, 0x23, 0x15);
1474 + /* CCM configuration via CCMCTL register */
1475 + e1000_write_8bit_ctrl_reg_generic(hw, E1000_CCMCTL, 0x14, 0x00);
1476 + e1000_write_8bit_ctrl_reg_generic(hw, E1000_CCMCTL, 0x10, 0x00);
1478 + /* PCIe lanes configuration */
1479 + e1000_write_8bit_ctrl_reg_generic(hw, E1000_GIOCTL, 0x00, 0xEC);
1480 + e1000_write_8bit_ctrl_reg_generic(hw, E1000_GIOCTL, 0x61, 0xDF);
1481 + e1000_write_8bit_ctrl_reg_generic(hw, E1000_GIOCTL, 0x34, 0x05);
1482 + e1000_write_8bit_ctrl_reg_generic(hw, E1000_GIOCTL, 0x2F, 0x81);
1484 + /* PCIe PLL Configuration */
1485 + e1000_write_8bit_ctrl_reg_generic(hw, E1000_SCCTL, 0x02, 0x47);
1486 + e1000_write_8bit_ctrl_reg_generic(hw, E1000_SCCTL, 0x14, 0x00);
1487 + e1000_write_8bit_ctrl_reg_generic(hw, E1000_SCCTL, 0x10, 0x00);
1490 + return E1000_SUCCESS;
1494 + * e1000_read_mac_addr_82575 - Read device MAC address
1495 + * @hw: pointer to the HW structure
1497 +static s32 e1000_read_mac_addr_82575(struct e1000_hw *hw)
1499 + s32 ret_val = E1000_SUCCESS;
1501 + DEBUGFUNC("e1000_read_mac_addr_82575");
1502 + if (e1000_check_alt_mac_addr_generic(hw))
1503 + ret_val = e1000_read_mac_addr_generic(hw);
1509 + * e1000_power_down_phy_copper_82575 - Remove link during PHY power down
1510 + * @hw: pointer to the HW structure
1512 + * In the case of a PHY power down to save power, or to turn off link during a
1513 + * driver unload, or wake on lan is not enabled, remove the link.
1515 +static void e1000_power_down_phy_copper_82575(struct e1000_hw *hw)
1517 + struct e1000_phy_info *phy = &hw->phy;
1518 + struct e1000_mac_info *mac = &hw->mac;
1520 + if (!(phy->ops.check_reset_block))
1523 + /* If the management interface is not enabled, then power down */
1524 + if (!(mac->ops.check_mng_mode(hw) || phy->ops.check_reset_block(hw)))
1525 + e1000_power_down_phy_copper(hw);
1531 + * e1000_clear_hw_cntrs_82575 - Clear device specific hardware counters
1532 + * @hw: pointer to the HW structure
1534 + * Clears the hardware counters by reading the counter registers.
1536 +static void e1000_clear_hw_cntrs_82575(struct e1000_hw *hw)
1538 + volatile u32 temp;
1540 + DEBUGFUNC("e1000_clear_hw_cntrs_82575");
1542 + e1000_clear_hw_cntrs_base_generic(hw);
1544 + temp = E1000_READ_REG(hw, E1000_PRC64);
1545 + temp = E1000_READ_REG(hw, E1000_PRC127);
1546 + temp = E1000_READ_REG(hw, E1000_PRC255);
1547 + temp = E1000_READ_REG(hw, E1000_PRC511);
1548 + temp = E1000_READ_REG(hw, E1000_PRC1023);
1549 + temp = E1000_READ_REG(hw, E1000_PRC1522);
1550 + temp = E1000_READ_REG(hw, E1000_PTC64);
1551 + temp = E1000_READ_REG(hw, E1000_PTC127);
1552 + temp = E1000_READ_REG(hw, E1000_PTC255);
1553 + temp = E1000_READ_REG(hw, E1000_PTC511);
1554 + temp = E1000_READ_REG(hw, E1000_PTC1023);
1555 + temp = E1000_READ_REG(hw, E1000_PTC1522);
1557 + temp = E1000_READ_REG(hw, E1000_ALGNERRC);
1558 + temp = E1000_READ_REG(hw, E1000_RXERRC);
1559 + temp = E1000_READ_REG(hw, E1000_TNCRS);
1560 + temp = E1000_READ_REG(hw, E1000_CEXTERR);
1561 + temp = E1000_READ_REG(hw, E1000_TSCTC);
1562 + temp = E1000_READ_REG(hw, E1000_TSCTFC);
1564 + temp = E1000_READ_REG(hw, E1000_MGTPRC);
1565 + temp = E1000_READ_REG(hw, E1000_MGTPDC);
1566 + temp = E1000_READ_REG(hw, E1000_MGTPTC);
1568 + temp = E1000_READ_REG(hw, E1000_IAC);
1569 + temp = E1000_READ_REG(hw, E1000_ICRXOC);
1571 + temp = E1000_READ_REG(hw, E1000_ICRXPTC);
1572 + temp = E1000_READ_REG(hw, E1000_ICRXATC);
1573 + temp = E1000_READ_REG(hw, E1000_ICTXPTC);
1574 + temp = E1000_READ_REG(hw, E1000_ICTXATC);
1575 + temp = E1000_READ_REG(hw, E1000_ICTXQEC);
1576 + temp = E1000_READ_REG(hw, E1000_ICTXQMTC);
1577 + temp = E1000_READ_REG(hw, E1000_ICRXDMTC);
1579 + temp = E1000_READ_REG(hw, E1000_CBTMPC);
1580 + temp = E1000_READ_REG(hw, E1000_HTDPMC);
1581 + temp = E1000_READ_REG(hw, E1000_CBRMPC);
1582 + temp = E1000_READ_REG(hw, E1000_RPTHC);
1583 + temp = E1000_READ_REG(hw, E1000_HGPTC);
1584 + temp = E1000_READ_REG(hw, E1000_HTCBDPC);
1585 + temp = E1000_READ_REG(hw, E1000_HGORCL);
1586 + temp = E1000_READ_REG(hw, E1000_HGORCH);
1587 + temp = E1000_READ_REG(hw, E1000_HGOTCL);
1588 + temp = E1000_READ_REG(hw, E1000_HGOTCH);
1589 + temp = E1000_READ_REG(hw, E1000_LENERRS);
1591 + /* This register should not be read in copper configurations */
1592 + if (hw->phy.media_type == e1000_media_type_internal_serdes)
1593 + temp = E1000_READ_REG(hw, E1000_SCVPC);
1596 + * e1000_rx_fifo_flush_82575 - Clean rx fifo after RX enable
1597 + * @hw: pointer to the HW structure
1599 + * After rx enable if managability is enabled then there is likely some
1600 + * bad data at the start of the fifo and possibly in the DMA fifo. This
1601 + * function clears the fifos and flushes any packets that came in as rx was
1604 +void e1000_rx_fifo_flush_82575(struct e1000_hw *hw)
1606 + u32 rctl, rlpml, rxdctl[4], rfctl, temp_rctl, rx_enabled;
1609 + DEBUGFUNC("e1000_rx_fifo_workaround_82575");
1610 + if (hw->mac.type != e1000_82575 ||
1611 + !(E1000_READ_REG(hw, E1000_MANC) & E1000_MANC_RCV_TCO_EN))
1614 + /* Disable all RX queues */
1615 + for (i = 0; i < 4; i++) {
1616 + rxdctl[i] = E1000_READ_REG(hw, E1000_RXDCTL(i));
1617 + E1000_WRITE_REG(hw, E1000_RXDCTL(i),
1618 + rxdctl[i] & ~E1000_RXDCTL_QUEUE_ENABLE);
1620 + /* Poll all queues to verify they have shut down */
1621 + for (ms_wait = 0; ms_wait < 10; ms_wait++) {
1624 + for (i = 0; i < 4; i++)
1625 + rx_enabled |= E1000_READ_REG(hw, E1000_RXDCTL(i));
1626 + if (!(rx_enabled & E1000_RXDCTL_QUEUE_ENABLE))
1630 + if (ms_wait == 10)
1631 + DEBUGOUT("Queue disable timed out after 10ms\n");
1633 + /* Clear RLPML, RCTL.SBP, RFCTL.LEF, and set RCTL.LPE so that all
1634 + * incoming packets are rejected. Set enable and wait 2ms so that
1635 + * any packet that was coming in as RCTL.EN was set is flushed
1637 + rfctl = E1000_READ_REG(hw, E1000_RFCTL);
1638 + E1000_WRITE_REG(hw, E1000_RFCTL, rfctl & ~E1000_RFCTL_LEF);
1640 + rlpml = E1000_READ_REG(hw, E1000_RLPML);
1641 + E1000_WRITE_REG(hw, E1000_RLPML, 0);
1643 + rctl = E1000_READ_REG(hw, E1000_RCTL);
1644 + temp_rctl = rctl & ~(E1000_RCTL_EN | E1000_RCTL_SBP);
1645 + temp_rctl |= E1000_RCTL_LPE;
1647 + E1000_WRITE_REG(hw, E1000_RCTL, temp_rctl);
1648 + E1000_WRITE_REG(hw, E1000_RCTL, temp_rctl | E1000_RCTL_EN);
1649 + E1000_WRITE_FLUSH(hw);
1652 + /* Enable RX queues that were previously enabled and restore our
1655 + for (i = 0; i < 4; i++)
1656 + E1000_WRITE_REG(hw, E1000_RXDCTL(i), rxdctl[i]);
1657 + E1000_WRITE_REG(hw, E1000_RCTL, rctl);
1658 + E1000_WRITE_FLUSH(hw);
1660 + E1000_WRITE_REG(hw, E1000_RLPML, rlpml);
1661 + E1000_WRITE_REG(hw, E1000_RFCTL, rfctl);
1663 + /* Flush receive errors generated by workaround */
1664 + E1000_READ_REG(hw, E1000_ROC);
1665 + E1000_READ_REG(hw, E1000_RNBC);
1666 + E1000_READ_REG(hw, E1000_MPC);
1668 diff -Nru vanilla/drivers/net/igb/e1000_82575.h linux-i686-2.6.22/drivers/net/igb/e1000_82575.h
1669 --- vanilla/drivers/net/igb/e1000_82575.h 1969-12-31 19:00:00.000000000 -0500
1670 +++ linux-i686-2.6.22/drivers/net/igb/e1000_82575.h 2009-07-16 19:25:22.000000000 -0400
1672 +/*******************************************************************************
1674 + Intel(R) Gigabit Ethernet Linux driver
1675 + Copyright(c) 2007-2008 Intel Corporation.
1677 + This program is free software; you can redistribute it and/or modify it
1678 + under the terms and conditions of the GNU General Public License,
1679 + version 2, as published by the Free Software Foundation.
1681 + This program is distributed in the hope it will be useful, but WITHOUT
1682 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1683 + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
1686 + You should have received a copy of the GNU General Public License along with
1687 + this program; if not, write to the Free Software Foundation, Inc.,
1688 + 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
1690 + The full GNU General Public License is included in this distribution in
1691 + the file called "COPYING".
1693 + Contact Information:
1694 + e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
1695 + Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
1697 +*******************************************************************************/
1699 +#ifndef _E1000_82575_H_
1700 +#define _E1000_82575_H_
1702 +#define ID_LED_DEFAULT_82575_SERDES ((ID_LED_DEF1_DEF2 << 12) | \
1703 + (ID_LED_DEF1_DEF2 << 8) | \
1704 + (ID_LED_DEF1_DEF2 << 4) | \
1705 + (ID_LED_OFF1_ON2))
1707 + * Receive Address Register Count
1708 + * Number of high/low register pairs in the RAR. The RAR (Receive Address
1709 + * Registers) holds the directed and multicast addresses that we monitor.
1710 + * These entries are also used for MAC-based filtering.
1713 + * For 82576, there are an additional set of RARs that begin at an offset
1714 + * separate from the first set of RARs.
1716 +#define E1000_RAR_ENTRIES_82575 16
1717 +#define E1000_RAR_ENTRIES_82576 24
1719 +struct e1000_adv_data_desc {
1720 + u64 buffer_addr; /* Address of the descriptor's data buffer */
1724 + u32 datalen :16; /* Data buffer length */
1726 + u32 dtyp :4; /* Descriptor type */
1727 + u32 dcmd :8; /* Descriptor command */
1733 + u32 status :4; /* Descriptor status */
1735 + u32 popts :6; /* Packet Options */
1736 + u32 paylen :18; /* Payload length */
1741 +#define E1000_TXD_DTYP_ADV_C 0x2 /* Advanced Context Descriptor */
1742 +#define E1000_TXD_DTYP_ADV_D 0x3 /* Advanced Data Descriptor */
1743 +#define E1000_ADV_TXD_CMD_DEXT 0x20 /* Descriptor extension (0 = legacy) */
1744 +#define E1000_ADV_TUCMD_IPV4 0x2 /* IP Packet Type: 1=IPv4 */
1745 +#define E1000_ADV_TUCMD_IPV6 0x0 /* IP Packet Type: 0=IPv6 */
1746 +#define E1000_ADV_TUCMD_L4T_UDP 0x0 /* L4 Packet TYPE of UDP */
1747 +#define E1000_ADV_TUCMD_L4T_TCP 0x4 /* L4 Packet TYPE of TCP */
1748 +#define E1000_ADV_TUCMD_MKRREQ 0x10 /* Indicates markers are required */
1749 +#define E1000_ADV_DCMD_EOP 0x1 /* End of Packet */
1750 +#define E1000_ADV_DCMD_IFCS 0x2 /* Insert FCS (Ethernet CRC) */
1751 +#define E1000_ADV_DCMD_RS 0x8 /* Report Status */
1752 +#define E1000_ADV_DCMD_VLE 0x40 /* Add VLAN tag */
1753 +#define E1000_ADV_DCMD_TSE 0x80 /* TCP Seg enable */
1754 +/* Extended Device Control */
1755 +#define E1000_CTRL_EXT_NSICR 0x00000001 /* Disable Intr Clear all on read */
1757 +struct e1000_adv_context_desc {
1782 +/* SRRCTL bit definitions */
1783 +#define E1000_SRRCTL_BSIZEPKT_SHIFT 10 /* Shift _right_ */
1784 +#define E1000_SRRCTL_BSIZEHDRSIZE_MASK 0x00000F00
1785 +#define E1000_SRRCTL_BSIZEHDRSIZE_SHIFT 2 /* Shift _left_ */
1786 +#define E1000_SRRCTL_DESCTYPE_LEGACY 0x00000000
1787 +#define E1000_SRRCTL_DESCTYPE_ADV_ONEBUF 0x02000000
1788 +#define E1000_SRRCTL_DESCTYPE_HDR_SPLIT 0x04000000
1789 +#define E1000_SRRCTL_DESCTYPE_HDR_SPLIT_ALWAYS 0x0A000000
1790 +#define E1000_SRRCTL_DESCTYPE_HDR_REPLICATION 0x06000000
1791 +#define E1000_SRRCTL_DESCTYPE_HDR_REPLICATION_LARGE_PKT 0x08000000
1792 +#define E1000_SRRCTL_DESCTYPE_MASK 0x0E000000
1794 +#define E1000_SRRCTL_BSIZEPKT_MASK 0x0000007F
1795 +#define E1000_SRRCTL_BSIZEHDR_MASK 0x00003F00
1797 +#define E1000_TX_HEAD_WB_ENABLE 0x1
1798 +#define E1000_TX_SEQNUM_WB_ENABLE 0x2
1800 +#define E1000_MRQC_ENABLE_RSS_4Q 0x00000002
1801 +#define E1000_MRQC_ENABLE_VMDQ 0x00000003
1802 +#define E1000_MRQC_RSS_FIELD_IPV4_UDP 0x00400000
1803 +#define E1000_MRQC_RSS_FIELD_IPV6_UDP 0x00800000
1804 +#define E1000_MRQC_RSS_FIELD_IPV6_UDP_EX 0x01000000
1806 +#define E1000_VMRCTL_MIRROR_PORT_SHIFT 8
1807 +#define E1000_VMRCTL_MIRROR_DSTPORT_MASK (7 << E1000_VMRCTL_MIRROR_PORT_SHIFT)
1808 +#define E1000_VMRCTL_POOL_MIRROR_ENABLE (1 << 0)
1809 +#define E1000_VMRCTL_UPLINK_MIRROR_ENABLE (1 << 1)
1810 +#define E1000_VMRCTL_DOWNLINK_MIRROR_ENABLE (1 << 2)
1812 +#define E1000_EICR_TX_QUEUE ( \
1813 + E1000_EICR_TX_QUEUE0 | \
1814 + E1000_EICR_TX_QUEUE1 | \
1815 + E1000_EICR_TX_QUEUE2 | \
1816 + E1000_EICR_TX_QUEUE3)
1818 +#define E1000_EICR_RX_QUEUE ( \
1819 + E1000_EICR_RX_QUEUE0 | \
1820 + E1000_EICR_RX_QUEUE1 | \
1821 + E1000_EICR_RX_QUEUE2 | \
1822 + E1000_EICR_RX_QUEUE3)
1824 +#define E1000_EIMS_RX_QUEUE E1000_EICR_RX_QUEUE
1825 +#define E1000_EIMS_TX_QUEUE E1000_EICR_TX_QUEUE
1827 +#define EIMS_ENABLE_MASK ( \
1828 + E1000_EIMS_RX_QUEUE | \
1829 + E1000_EIMS_TX_QUEUE | \
1830 + E1000_EIMS_TCP_TIMER | \
1833 +/* Immediate Interrupt Rx (A.K.A. Low Latency Interrupt) */
1834 +#define E1000_IMIR_PORT_IM_EN 0x00010000 /* TCP port enable */
1835 +#define E1000_IMIR_PORT_BP 0x00020000 /* TCP port check bypass */
1836 +#define E1000_IMIREXT_SIZE_BP 0x00001000 /* Packet size bypass */
1837 +#define E1000_IMIREXT_CTRL_URG 0x00002000 /* Check URG bit in header */
1838 +#define E1000_IMIREXT_CTRL_ACK 0x00004000 /* Check ACK bit in header */
1839 +#define E1000_IMIREXT_CTRL_PSH 0x00008000 /* Check PSH bit in header */
1840 +#define E1000_IMIREXT_CTRL_RST 0x00010000 /* Check RST bit in header */
1841 +#define E1000_IMIREXT_CTRL_SYN 0x00020000 /* Check SYN bit in header */
1842 +#define E1000_IMIREXT_CTRL_FIN 0x00040000 /* Check FIN bit in header */
1843 +#define E1000_IMIREXT_CTRL_BP 0x00080000 /* Bypass check of ctrl bits */
1845 +/* Receive Descriptor - Advanced */
1846 +union e1000_adv_rx_desc {
1848 + u64 pkt_addr; /* Packet buffer address */
1849 + u64 hdr_addr; /* Header buffer address */
1856 + u16 pkt_info; /* RSS type, Packet type */
1857 + u16 hdr_info; /* Split Header,
1858 + * header buffer length */
1862 + u32 rss; /* RSS Hash */
1864 + u16 ip_id; /* IP id */
1865 + u16 csum; /* Packet Checksum */
1870 + u32 status_error; /* ext status/error */
1871 + u16 length; /* Packet length */
1872 + u16 vlan; /* VLAN tag */
1874 + } wb; /* writeback */
1877 +#define E1000_RXDADV_RSSTYPE_MASK 0x0000F000
1878 +#define E1000_RXDADV_RSSTYPE_SHIFT 12
1879 +#define E1000_RXDADV_HDRBUFLEN_MASK 0x7FE0
1880 +#define E1000_RXDADV_HDRBUFLEN_SHIFT 5
1881 +#define E1000_RXDADV_SPLITHEADER_EN 0x00001000
1882 +#define E1000_RXDADV_SPH 0x8000
1883 +#define E1000_RXDADV_ERR_HBO 0x00800000
1885 +/* RSS Hash results */
1886 +#define E1000_RXDADV_RSSTYPE_NONE 0x00000000
1887 +#define E1000_RXDADV_RSSTYPE_IPV4_TCP 0x00000001
1888 +#define E1000_RXDADV_RSSTYPE_IPV4 0x00000002
1889 +#define E1000_RXDADV_RSSTYPE_IPV6_TCP 0x00000003
1890 +#define E1000_RXDADV_RSSTYPE_IPV6_EX 0x00000004
1891 +#define E1000_RXDADV_RSSTYPE_IPV6 0x00000005
1892 +#define E1000_RXDADV_RSSTYPE_IPV6_TCP_EX 0x00000006
1893 +#define E1000_RXDADV_RSSTYPE_IPV4_UDP 0x00000007
1894 +#define E1000_RXDADV_RSSTYPE_IPV6_UDP 0x00000008
1895 +#define E1000_RXDADV_RSSTYPE_IPV6_UDP_EX 0x00000009
1897 +/* RSS Packet Types as indicated in the receive descriptor */
1898 +#define E1000_RXDADV_PKTTYPE_NONE 0x00000000
1899 +#define E1000_RXDADV_PKTTYPE_IPV4 0x00000010 /* IPV4 hdr present */
1900 +#define E1000_RXDADV_PKTTYPE_IPV4_EX 0x00000020 /* IPV4 hdr + extensions */
1901 +#define E1000_RXDADV_PKTTYPE_IPV6 0x00000040 /* IPV6 hdr present */
1902 +#define E1000_RXDADV_PKTTYPE_IPV6_EX 0x00000080 /* IPV6 hdr + extensions */
1903 +#define E1000_RXDADV_PKTTYPE_TCP 0x00000100 /* TCP hdr present */
1904 +#define E1000_RXDADV_PKTTYPE_UDP 0x00000200 /* UDP hdr present */
1905 +#define E1000_RXDADV_PKTTYPE_SCTP 0x00000400 /* SCTP hdr present */
1906 +#define E1000_RXDADV_PKTTYPE_NFS 0x00000800 /* NFS hdr present */
1908 +#define E1000_RXDADV_PKTTYPE_IPSEC_ESP 0x00001000 /* IPSec ESP */
1909 +#define E1000_RXDADV_PKTTYPE_IPSEC_AH 0x00002000 /* IPSec AH */
1910 +#define E1000_RXDADV_PKTTYPE_LINKSEC 0x00004000 /* LinkSec Encap */
1911 +#define E1000_RXDADV_PKTTYPE_ETQF 0x00008000 /* PKTTYPE is ETQF index */
1912 +#define E1000_RXDADV_PKTTYPE_ETQF_MASK 0x00000070 /* ETQF has 8 indices */
1913 +#define E1000_RXDADV_PKTTYPE_ETQF_SHIFT 4 /* Right-shift 4 bits */
1915 +/* LinkSec results */
1916 +/* Security Processing bit Indication */
1917 +#define E1000_RXDADV_LNKSEC_STATUS_SECP 0x00020000
1918 +#define E1000_RXDADV_LNKSEC_ERROR_BIT_MASK 0x18000000
1919 +#define E1000_RXDADV_LNKSEC_ERROR_NO_SA_MATCH 0x08000000
1920 +#define E1000_RXDADV_LNKSEC_ERROR_REPLAY_ERROR 0x10000000
1921 +#define E1000_RXDADV_LNKSEC_ERROR_BAD_SIG 0x18000000
1923 +#define E1000_RXDADV_IPSEC_STATUS_SECP 0x00020000
1924 +#define E1000_RXDADV_IPSEC_ERROR_BIT_MASK 0x18000000
1925 +#define E1000_RXDADV_IPSEC_ERROR_INVALID_PROTOCOL 0x08000000
1926 +#define E1000_RXDADV_IPSEC_ERROR_INVALID_LENGTH 0x10000000
1927 +#define E1000_RXDADV_IPSEC_ERROR_AUTHENTICATION_FAILED 0x18000000
1929 +/* Transmit Descriptor - Advanced */
1930 +union e1000_adv_tx_desc {
1932 + u64 buffer_addr; /* Address of descriptor's data buf */
1934 + u32 olinfo_status;
1937 + u64 rsvd; /* Reserved */
1943 +/* Adv Transmit Descriptor Config Masks */
1944 +#define E1000_ADVTXD_DTYP_CTXT 0x00200000 /* Advanced Context Descriptor */
1945 +#define E1000_ADVTXD_DTYP_DATA 0x00300000 /* Advanced Data Descriptor */
1946 +#define E1000_ADVTXD_DCMD_EOP 0x01000000 /* End of Packet */
1947 +#define E1000_ADVTXD_DCMD_IFCS 0x02000000 /* Insert FCS (Ethernet CRC) */
1948 +#define E1000_ADVTXD_DCMD_RS 0x08000000 /* Report Status */
1949 +#define E1000_ADVTXD_DCMD_DDTYP_ISCSI 0x10000000 /* DDP hdr type or iSCSI */
1950 +#define E1000_ADVTXD_DCMD_DEXT 0x20000000 /* Descriptor extension (1=Adv) */
1951 +#define E1000_ADVTXD_DCMD_VLE 0x40000000 /* VLAN pkt enable */
1952 +#define E1000_ADVTXD_DCMD_TSE 0x80000000 /* TCP Seg enable */
1953 +#define E1000_ADVTXD_MAC_LINKSEC 0x00040000 /* Apply LinkSec on packet */
1954 +#define E1000_ADVTXD_MAC_TSTAMP 0x00080000 /* IEEE1588 Timestamp packet */
1955 +#define E1000_ADVTXD_STAT_SN_CRC 0x00000002 /* NXTSEQ/SEED present in WB */
1956 +#define E1000_ADVTXD_IDX_SHIFT 4 /* Adv desc Index shift */
1957 +#define E1000_ADVTXD_POPTS_ISCO_1ST 0x00000000 /* 1st TSO of iSCSI PDU */
1958 +#define E1000_ADVTXD_POPTS_ISCO_MDL 0x00000800 /* Middle TSO of iSCSI PDU */
1959 +#define E1000_ADVTXD_POPTS_ISCO_LAST 0x00001000 /* Last TSO of iSCSI PDU */
1960 +#define E1000_ADVTXD_POPTS_ISCO_FULL 0x00001800 /* 1st&Last TSO-full iSCSI PDU*/
1961 +#define E1000_ADVTXD_POPTS_IPSEC 0x00000400 /* IPSec offload request */
1962 +#define E1000_ADVTXD_PAYLEN_SHIFT 14 /* Adv desc PAYLEN shift */
1964 +/* Context descriptors */
1965 +struct e1000_adv_tx_context_desc {
1966 + u32 vlan_macip_lens;
1968 + u32 type_tucmd_mlhl;
1969 + u32 mss_l4len_idx;
1972 +#define E1000_ADVTXD_MACLEN_SHIFT 9 /* Adv ctxt desc mac len shift */
1973 +#define E1000_ADVTXD_VLAN_SHIFT 16 /* Adv ctxt vlan tag shift */
1974 +#define E1000_ADVTXD_TUCMD_IPV4 0x00000400 /* IP Packet Type: 1=IPv4 */
1975 +#define E1000_ADVTXD_TUCMD_IPV6 0x00000000 /* IP Packet Type: 0=IPv6 */
1976 +#define E1000_ADVTXD_TUCMD_L4T_UDP 0x00000000 /* L4 Packet TYPE of UDP */
1977 +#define E1000_ADVTXD_TUCMD_L4T_TCP 0x00000800 /* L4 Packet TYPE of TCP */
1978 +#define E1000_ADVTXD_TUCMD_IPSEC_TYPE_ESP 0x00002000 /* IPSec Type ESP */
1979 +/* IPSec Encrypt Enable for ESP */
1980 +#define E1000_ADVTXD_TUCMD_IPSEC_ENCRYPT_EN 0x00004000
1981 +#define E1000_ADVTXD_TUCMD_MKRREQ 0x00002000 /* Req requires Markers and CRC */
1982 +#define E1000_ADVTXD_L4LEN_SHIFT 8 /* Adv ctxt L4LEN shift */
1983 +#define E1000_ADVTXD_MSS_SHIFT 16 /* Adv ctxt MSS shift */
1984 +/* Adv ctxt IPSec SA IDX mask */
1985 +#define E1000_ADVTXD_IPSEC_SA_INDEX_MASK 0x000000FF
1986 +/* Adv ctxt IPSec ESP len mask */
1987 +#define E1000_ADVTXD_IPSEC_ESP_LEN_MASK 0x000000FF
1989 +/* Additional Transmit Descriptor Control definitions */
1990 +#define E1000_TXDCTL_QUEUE_ENABLE 0x02000000 /* Enable specific Tx Queue */
1991 +#define E1000_TXDCTL_SWFLSH 0x04000000 /* Tx Desc. write-back flushing */
1992 +/* Tx Queue Arbitration Priority 0=low, 1=high */
1993 +#define E1000_TXDCTL_PRIORITY 0x08000000
1995 +/* Additional Receive Descriptor Control definitions */
1996 +#define E1000_RXDCTL_QUEUE_ENABLE 0x02000000 /* Enable specific Rx Queue */
1997 +#define E1000_RXDCTL_SWFLSH 0x04000000 /* Rx Desc. write-back flushing */
1999 +/* Direct Cache Access (DCA) definitions */
2000 +#define E1000_DCA_CTRL_DCA_ENABLE 0x00000000 /* DCA Enable */
2001 +#define E1000_DCA_CTRL_DCA_DISABLE 0x00000001 /* DCA Disable */
2003 +#define E1000_DCA_CTRL_DCA_MODE_CB1 0x00 /* DCA Mode CB1 */
2004 +#define E1000_DCA_CTRL_DCA_MODE_CB2 0x02 /* DCA Mode CB2 */
2006 +#define E1000_DCA_RXCTRL_CPUID_MASK 0x0000001F /* Rx CPUID Mask */
2007 +#define E1000_DCA_RXCTRL_DESC_DCA_EN (1 << 5) /* DCA Rx Desc enable */
2008 +#define E1000_DCA_RXCTRL_HEAD_DCA_EN (1 << 6) /* DCA Rx Desc header enable */
2009 +#define E1000_DCA_RXCTRL_DATA_DCA_EN (1 << 7) /* DCA Rx Desc payload enable */
2011 +#define E1000_DCA_TXCTRL_CPUID_MASK 0x0000001F /* Tx CPUID Mask */
2012 +#define E1000_DCA_TXCTRL_DESC_DCA_EN (1 << 5) /* DCA Tx Desc enable */
2013 +#define E1000_DCA_TXCTRL_TX_WB_RO_EN (1 << 11) /* Tx Desc writeback RO bit */
2015 +/* Additional DCA related definitions, note change in position of CPUID */
2016 +#define E1000_DCA_TXCTRL_CPUID_MASK_82576 0xFF000000 /* Tx CPUID Mask */
2017 +#define E1000_DCA_RXCTRL_CPUID_MASK_82576 0xFF000000 /* Rx CPUID Mask */
2018 +#define E1000_DCA_TXCTRL_CPUID_SHIFT 24 /* Tx CPUID now in the last byte */
2019 +#define E1000_DCA_RXCTRL_CPUID_SHIFT 24 /* Rx CPUID now in the last byte */
2021 +/* Additional interrupt register bit definitions */
2022 +#define E1000_ICR_LSECPNS 0x00000020 /* PN threshold - server */
2023 +#define E1000_IMS_LSECPNS E1000_ICR_LSECPNS /* PN threshold - server */
2024 +#define E1000_ICS_LSECPNS E1000_ICR_LSECPNS /* PN threshold - server */
2026 +/* ETQF register bit definitions */
2027 +#define E1000_ETQF_FILTER_ENABLE (1 << 26)
2028 +#define E1000_ETQF_IMM_INT (1 << 29)
2030 + * ETQF filter list: one static filter per filter consumer. This is
2031 + * to avoid filter collisions later. Add new filters
2034 + * Current filters:
2035 + * EAPOL 802.1x (0x888e): Filter 0
2037 +#define E1000_ETQF_FILTER_EAPOL 0
2039 +#define E1000_NVM_APME_82575 0x0400
2040 +#define MAX_NUM_VFS 8
2042 +#define E1000_DTXSWC_MAC_SPOOF_MASK 0x000000FF /* Per VF MAC spoof control */
2043 +#define E1000_DTXSWC_VLAN_SPOOF_MASK 0x0000FF00 /* Per VF VLAN spoof control */
2044 +#define E1000_DTXSWC_LLE_MASK 0x00FF0000 /* Per VF Local LB enables */
2045 +#define E1000_DTXSWC_VMDQ_LOOPBACK_EN (1 << 31) /* global VF LB enable */
2047 +/* Easy defines for setting default pool, would normally be left a zero */
2048 +#define E1000_VT_CTL_DEFAULT_POOL_SHIFT 7
2049 +#define E1000_VT_CTL_DEFAULT_POOL_MASK (0x7 << E1000_VT_CTL_DEFAULT_POOL_SHIFT)
2051 +/* Other useful VMD_CTL register defines */
2052 +#define E1000_VT_CTL_IGNORE_MAC (1 << 28)
2053 +#define E1000_VT_CTL_DISABLE_DEF_POOL (1 << 29)
2054 +#define E1000_VT_CTL_VM_REPL_EN (1 << 30)
2056 +/* Per VM Offload register setup */
2057 +#define E1000_VMOLR_LPE 0x00010000 /* Accept Long packet */
2058 +#define E1000_VMOLR_AUPE 0x01000000 /* Accept untagged packets */
2059 +#define E1000_VMOLR_BAM 0x08000000 /* Accept Broadcast packets */
2060 +#define E1000_VMOLR_MPME 0x10000000 /* Multicast promiscuous mode */
2061 +#define E1000_VMOLR_STRVLAN 0x40000000 /* Vlan stripping enable */
2063 +#define E1000_V2PMAILBOX_REQ 0x00000001 /* Request for PF Ready bit */
2064 +#define E1000_V2PMAILBOX_ACK 0x00000002 /* Ack PF message received */
2065 +#define E1000_V2PMAILBOX_VFU 0x00000004 /* VF owns the mailbox buffer */
2066 +#define E1000_V2PMAILBOX_PFU 0x00000008 /* PF owns the mailbox buffer */
2067 +#define E1000_V2PMAILBOX_PFSTS 0x00000010 /* PF wrote a message in the MB */
2068 +#define E1000_V2PMAILBOX_PFACK 0x00000020 /* PF ack the previous VF msg */
2069 +#define E1000_V2PMAILBOX_RSTI 0x00000040 /* PF has reset indication */
2071 +#define E1000_P2VMAILBOX_STS 0x00000001 /* Initiate message send to VF */
2072 +#define E1000_P2VMAILBOX_ACK 0x00000002 /* Ack message recv'd from VF */
2073 +#define E1000_P2VMAILBOX_VFU 0x00000004 /* VF owns the mailbox buffer */
2074 +#define E1000_P2VMAILBOX_PFU 0x00000008 /* PF owns the mailbox buffer */
2075 +#define E1000_P2VMAILBOX_RVFU 0x00000010 /* Reset VFU - used when VF stuck */
2077 +#define E1000_VFMAILBOX_SIZE 16 /* 16 32 bit words - 64 bytes */
2079 +/* If it's a E1000_VF_* msg then it originates in the VF and is sent to the
2080 + * PF. The reverse is true if it is E1000_PF_*.
2081 + * Message ACK's are the value or'd with 0xF0000000
2083 +#define E1000_VT_MSGTYPE_ACK 0xF0000000 /* Messages below or'd with
2084 + * this are the ACK */
2085 +#define E1000_VT_MSGTYPE_NACK 0xFF000000 /* Messages below or'd with
2086 + * this are the NACK */
2087 +#define E1000_VT_MSGINFO_SHIFT 16
2088 +/* bits 23:16 are used for exra info for certain messages */
2089 +#define E1000_VT_MSGINFO_MASK (0xFF << E1000_VT_MSGINFO_SHIFT)
2091 +#define E1000_VF_MSGTYPE_REQ_MAC 1 /* VF needs to know its MAC */
2092 +#define E1000_VF_MSGTYPE_VFLR 2 /* VF notifies VFLR to PF */
2093 +#define E1000_VF_SET_MULTICAST 3 /* VF requests PF to set MC addr */
2094 +#define E1000_VF_SET_VLAN 4 /* VF requests PF to set VLAN */
2096 +/* Add 100h to all PF msgs, leaves room for up to 255 discrete message types
2097 + * from VF to PF - way more than we'll ever need */
2098 +#define E1000_PF_MSGTYPE_RESET (1 + 0x100) /* PF notifies global reset
2099 + * imminent to VF */
2100 +#define E1000_PF_MSGTYPE_LSC (2 + 0x100) /* PF notifies VF of LSC... VF
2101 + * will see extra msg info for
2104 +#define E1000_PF_MSG_LSCDOWN (1 << E1000_VT_MSGINFO_SHIFT)
2105 +#define E1000_PF_MSG_LSCUP (2 << E1000_VT_MSGINFO_SHIFT)
2107 +s32 e1000_send_mail_to_pf_vf(struct e1000_hw *hw, u32 *msg,
2109 +s32 e1000_receive_mail_from_pf_vf(struct e1000_hw *hw,
2110 + u32 *msg, s16 size);
2111 +s32 e1000_send_mail_to_vf(struct e1000_hw *hw, u32 *msg,
2112 + u32 vf_number, s16 size);
2113 +s32 e1000_receive_mail_from_vf(struct e1000_hw *hw, u32 *msg,
2114 + u32 vf_number, s16 size);
2115 +void e1000_vmdq_loopback_enable_vf(struct e1000_hw *hw);
2116 +void e1000_vmdq_loopback_disable_vf(struct e1000_hw *hw);
2117 +void e1000_vmdq_replication_enable_vf(struct e1000_hw *hw, u32 enables);
2118 +void e1000_vmdq_replication_disable_vf(struct e1000_hw *hw);
2119 +bool e1000_check_for_pf_ack_vf(struct e1000_hw *hw);
2120 +bool e1000_check_for_pf_mail_vf(struct e1000_hw *hw, u32*);
2124 Binary files vanilla/drivers/net/igb/e1000_82575.o and linux-i686-2.6.22/drivers/net/igb/e1000_82575.o differ
2125 diff -Nru vanilla/drivers/net/igb/.e1000_82575.o.cmd linux-i686-2.6.22/drivers/net/igb/.e1000_82575.o.cmd
2126 --- vanilla/drivers/net/igb/.e1000_82575.o.cmd 1969-12-31 19:00:00.000000000 -0500
2127 +++ linux-i686-2.6.22/drivers/net/igb/.e1000_82575.o.cmd 2009-07-16 19:52:19.000000000 -0400
2129 +cmd_drivers/net/igb/e1000_82575.o := gcc -m32 -Wp,-MD,drivers/net/igb/.e1000_82575.o.d -nostdinc -isystem /usr/lib/gcc/i386-redhat-linux/4.1.2/include -D__KERNEL__ -Iinclude -include include/linux/autoconf.h -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Os -pipe -msoft-float -mregparm=3 -freg-struct-return -mpreferred-stack-boundary=2 -march=i686 -mtune=generic -ffreestanding -maccumulate-outgoing-args -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -Iinclude/asm-i386/mach-generic -Iinclude/asm-i386/mach-default -fno-omit-frame-pointer -fno-optimize-sibling-calls -g -fno-stack-protector -Wdeclaration-after-statement -Wno-pointer-sign -DMODULE -D"KBUILD_STR(s)=\#s" -D"KBUILD_BASENAME=KBUILD_STR(e1000_82575)" -D"KBUILD_MODNAME=KBUILD_STR(igb)" -c -o drivers/net/igb/.tmp_e1000_82575.o drivers/net/igb/e1000_82575.c
2131 +deps_drivers/net/igb/e1000_82575.o := \
2132 + drivers/net/igb/e1000_82575.c \
2133 + drivers/net/igb/e1000_api.h \
2134 + drivers/net/igb/e1000_hw.h \
2135 + drivers/net/igb/e1000_osdep.h \
2136 + include/linux/pci.h \
2137 + $(wildcard include/config/pci/msi.h) \
2138 + $(wildcard include/config/pci.h) \
2139 + $(wildcard include/config/ht/irq.h) \
2140 + $(wildcard include/config/pci/domains.h) \
2141 + include/linux/pci_regs.h \
2142 + include/linux/mod_devicetable.h \
2143 + include/linux/types.h \
2144 + $(wildcard include/config/uid16.h) \
2145 + $(wildcard include/config/lbd.h) \
2146 + $(wildcard include/config/lsf.h) \
2147 + $(wildcard include/config/resources/64bit.h) \
2148 + include/linux/posix_types.h \
2149 + include/linux/stddef.h \
2150 + include/linux/compiler.h \
2151 + $(wildcard include/config/enable/must/check.h) \
2152 + include/linux/compiler-gcc4.h \
2153 + $(wildcard include/config/forced/inlining.h) \
2154 + include/linux/compiler-gcc.h \
2155 + include/asm/posix_types.h \
2156 + include/asm/types.h \
2157 + $(wildcard include/config/highmem64g.h) \
2158 + include/linux/ioport.h \
2159 + include/linux/list.h \
2160 + $(wildcard include/config/debug/list.h) \
2161 + include/linux/poison.h \
2162 + include/linux/prefetch.h \
2163 + include/asm/processor.h \
2164 + $(wildcard include/config/smp.h) \
2165 + $(wildcard include/config/x86/ht.h) \
2166 + $(wildcard include/config/paravirt.h) \
2167 + $(wildcard include/config/mk8.h) \
2168 + $(wildcard include/config/mk7.h) \
2169 + include/asm/vm86.h \
2170 + $(wildcard include/config/vm86.h) \
2171 + include/asm/ptrace.h \
2172 + include/asm/ptrace-abi.h \
2173 + include/asm/segment.h \
2174 + include/asm/math_emu.h \
2175 + include/asm/sigcontext.h \
2176 + include/asm/page.h \
2177 + $(wildcard include/config/x86/use/3dnow.h) \
2178 + $(wildcard include/config/x86/pae.h) \
2179 + $(wildcard include/config/hugetlb/page.h) \
2180 + $(wildcard include/config/highmem4g.h) \
2181 + $(wildcard include/config/page/offset.h) \
2182 + $(wildcard include/config/flatmem.h) \
2183 + include/asm-generic/pgtable-nopmd.h \
2184 + include/asm-generic/pgtable-nopud.h \
2185 + include/asm-generic/memory_model.h \
2186 + $(wildcard include/config/discontigmem.h) \
2187 + $(wildcard include/config/sparsemem.h) \
2188 + $(wildcard include/config/out/of/line/pfn/to/page.h) \
2189 + include/asm-generic/page.h \
2190 + include/asm/cpufeature.h \
2191 + include/linux/bitops.h \
2192 + include/asm/bitops.h \
2193 + include/asm/alternative.h \
2194 + include/asm-generic/bitops/sched.h \
2195 + include/asm-generic/bitops/hweight.h \
2196 + include/asm-generic/bitops/fls64.h \
2197 + include/asm-generic/bitops/ext2-non-atomic.h \
2198 + include/asm-generic/bitops/le.h \
2199 + include/asm/byteorder.h \
2200 + $(wildcard include/config/x86/bswap.h) \
2201 + include/linux/byteorder/little_endian.h \
2202 + include/linux/byteorder/swab.h \
2203 + include/linux/byteorder/generic.h \
2204 + include/asm-generic/bitops/minix.h \
2205 + include/asm/required-features.h \
2206 + $(wildcard include/config/x86/minimum/cpu.h) \
2207 + $(wildcard include/config/x86/cmov.h) \
2208 + $(wildcard include/config/x86/cmpxchg64.h) \
2209 + include/asm/msr.h \
2210 + include/asm/msr-index.h \
2211 + include/asm/errno.h \
2212 + include/asm-generic/errno.h \
2213 + include/asm-generic/errno-base.h \
2214 + include/linux/errno.h \
2215 + include/asm/system.h \
2216 + $(wildcard include/config/x86/oostore.h) \
2217 + include/linux/kernel.h \
2218 + $(wildcard include/config/preempt/voluntary.h) \
2219 + $(wildcard include/config/debug/spinlock/sleep.h) \
2220 + $(wildcard include/config/printk.h) \
2221 + $(wildcard include/config/numa.h) \
2222 + /usr/lib/gcc/i386-redhat-linux/4.1.2/include/stdarg.h \
2223 + include/linux/linkage.h \
2224 + include/asm/linkage.h \
2225 + $(wildcard include/config/x86/alignment/16.h) \
2226 + include/linux/log2.h \
2227 + $(wildcard include/config/arch/has/ilog2/u32.h) \
2228 + $(wildcard include/config/arch/has/ilog2/u64.h) \
2229 + include/asm/bug.h \
2230 + $(wildcard include/config/bug.h) \
2231 + $(wildcard include/config/debug/bugverbose.h) \
2232 + include/asm-generic/bug.h \
2233 + $(wildcard include/config/generic/bug.h) \
2234 + include/asm/cmpxchg.h \
2235 + $(wildcard include/config/x86/cmpxchg.h) \
2236 + include/linux/irqflags.h \
2237 + $(wildcard include/config/trace/irqflags.h) \
2238 + $(wildcard include/config/trace/irqflags/support.h) \
2239 + $(wildcard include/config/x86.h) \
2240 + include/asm/irqflags.h \
2241 + include/asm/processor-flags.h \
2242 + include/linux/cache.h \
2243 + include/asm/cache.h \
2244 + $(wildcard include/config/x86/l1/cache/shift.h) \
2245 + include/linux/threads.h \
2246 + $(wildcard include/config/nr/cpus.h) \
2247 + $(wildcard include/config/base/small.h) \
2248 + include/asm/percpu.h \
2249 + include/linux/cpumask.h \
2250 + $(wildcard include/config/hotplug/cpu.h) \
2251 + include/linux/bitmap.h \
2252 + include/linux/string.h \
2253 + include/asm/string.h \
2254 + include/linux/init.h \
2255 + $(wildcard include/config/modules.h) \
2256 + $(wildcard include/config/hotplug.h) \
2257 + $(wildcard include/config/memory/hotplug.h) \
2258 + $(wildcard include/config/acpi/hotplug/memory.h) \
2259 + include/asm/atomic.h \
2260 + $(wildcard include/config/m386.h) \
2261 + include/asm-generic/atomic.h \
2262 + include/linux/device.h \
2263 + $(wildcard include/config/debug/devres.h) \
2264 + include/linux/kobject.h \
2265 + include/linux/sysfs.h \
2266 + $(wildcard include/config/sysfs.h) \
2267 + include/linux/spinlock.h \
2268 + $(wildcard include/config/debug/spinlock.h) \
2269 + $(wildcard include/config/preempt.h) \
2270 + $(wildcard include/config/debug/lock/alloc.h) \
2271 + include/linux/preempt.h \
2272 + $(wildcard include/config/debug/preempt.h) \
2273 + include/linux/thread_info.h \
2274 + include/asm/thread_info.h \
2275 + $(wildcard include/config/4kstacks.h) \
2276 + $(wildcard include/config/debug/stack/usage.h) \
2277 + include/linux/stringify.h \
2278 + include/linux/bottom_half.h \
2279 + include/linux/spinlock_types.h \
2280 + include/linux/lockdep.h \
2281 + $(wildcard include/config/lockdep.h) \
2282 + $(wildcard include/config/generic/hardirqs.h) \
2283 + $(wildcard include/config/prove/locking.h) \
2284 + include/asm/spinlock_types.h \
2285 + include/asm/spinlock.h \
2286 + $(wildcard include/config/x86/ppro/fence.h) \
2287 + include/asm/rwlock.h \
2288 + include/linux/spinlock_api_smp.h \
2289 + include/linux/kref.h \
2290 + include/linux/wait.h \
2291 + include/asm/current.h \
2292 + include/linux/klist.h \
2293 + include/linux/completion.h \
2294 + include/linux/module.h \
2295 + $(wildcard include/config/modversions.h) \
2296 + $(wildcard include/config/unused/symbols.h) \
2297 + $(wildcard include/config/module/unload.h) \
2298 + $(wildcard include/config/kallsyms.h) \
2299 + include/linux/stat.h \
2300 + include/asm/stat.h \
2301 + include/linux/time.h \
2302 + include/linux/seqlock.h \
2303 + include/linux/vs_time.h \
2304 + $(wildcard include/config/vserver/vtime.h) \
2305 + include/linux/kmod.h \
2306 + $(wildcard include/config/kmod.h) \
2307 + include/linux/elf.h \
2308 + include/linux/auxvec.h \
2309 + include/asm/auxvec.h \
2310 + include/linux/elf-em.h \
2311 + include/asm/elf.h \
2312 + include/asm/user.h \
2313 + include/asm/desc.h \
2314 + include/asm/ldt.h \
2315 + include/linux/smp.h \
2316 + include/asm/smp.h \
2317 + $(wildcard include/config/x86/local/apic.h) \
2318 + $(wildcard include/config/x86/io/apic.h) \
2319 + include/asm/mpspec.h \
2320 + $(wildcard include/config/acpi.h) \
2321 + include/asm/mpspec_def.h \
2322 + include/asm-i386/mach-generic/mach_mpspec.h \
2323 + include/asm/apic.h \
2324 + $(wildcard include/config/x86/good/apic.h) \
2325 + include/linux/pm.h \
2326 + $(wildcard include/config/pm.h) \
2327 + include/linux/delay.h \
2328 + include/asm/delay.h \
2329 + include/asm/fixmap.h \
2330 + $(wildcard include/config/highmem.h) \
2331 + $(wildcard include/config/x86/visws/apic.h) \
2332 + $(wildcard include/config/x86/f00f/bug.h) \
2333 + $(wildcard include/config/x86/cyclone/timer.h) \
2334 + $(wildcard include/config/pci/mmconfig.h) \
2335 + include/asm/acpi.h \
2336 + $(wildcard include/config/acpi/sleep.h) \
2337 + include/acpi/pdc_intel.h \
2338 + include/asm/apicdef.h \
2339 + include/asm/kmap_types.h \
2340 + $(wildcard include/config/debug/highmem.h) \
2341 + include/asm/io_apic.h \
2342 + include/asm-i386/mach-generic/mach_apicdef.h \
2343 + include/asm/genapic.h \
2344 + include/linux/percpu.h \
2345 + include/linux/slab.h \
2346 + $(wildcard include/config/slab/debug.h) \
2347 + $(wildcard include/config/slab.h) \
2348 + $(wildcard include/config/slub.h) \
2349 + $(wildcard include/config/debug/slab.h) \
2350 + include/linux/gfp.h \
2351 + $(wildcard include/config/zone/dma.h) \
2352 + $(wildcard include/config/zone/dma32.h) \
2353 + include/linux/mmzone.h \
2354 + $(wildcard include/config/force/max/zoneorder.h) \
2355 + $(wildcard include/config/arch/populates/node/map.h) \
2356 + $(wildcard include/config/flat/node/mem/map.h) \
2357 + $(wildcard include/config/have/memory/present.h) \
2358 + $(wildcard include/config/need/node/memmap/size.h) \
2359 + $(wildcard include/config/need/multiple/nodes.h) \
2360 + $(wildcard include/config/have/arch/early/pfn/to/nid.h) \
2361 + $(wildcard include/config/sparsemem/extreme.h) \
2362 + $(wildcard include/config/nodes/span/other/nodes.h) \
2363 + $(wildcard include/config/holes/in/zone.h) \
2364 + include/linux/numa.h \
2365 + $(wildcard include/config/nodes/shift.h) \
2366 + include/linux/nodemask.h \
2367 + include/linux/memory_hotplug.h \
2368 + $(wildcard include/config/have/arch/nodedata/extension.h) \
2369 + include/linux/notifier.h \
2370 + include/linux/mutex.h \
2371 + $(wildcard include/config/debug/mutexes.h) \
2372 + $(wildcard include/config/chopstix.h) \
2373 + include/linux/rwsem.h \
2374 + $(wildcard include/config/rwsem/generic/spinlock.h) \
2375 + include/asm/rwsem.h \
2376 + include/linux/srcu.h \
2377 + include/linux/topology.h \
2378 + $(wildcard include/config/sched/smt.h) \
2379 + $(wildcard include/config/sched/mc.h) \
2380 + include/asm/topology.h \
2381 + include/asm-generic/topology.h \
2382 + include/linux/slab_def.h \
2383 + include/linux/kmalloc_sizes.h \
2384 + include/asm/mmu.h \
2385 + include/asm/semaphore.h \
2386 + include/linux/moduleparam.h \
2387 + include/asm/local.h \
2388 + include/asm/module.h \
2389 + $(wildcard include/config/m486.h) \
2390 + $(wildcard include/config/m586.h) \
2391 + $(wildcard include/config/m586tsc.h) \
2392 + $(wildcard include/config/m586mmx.h) \
2393 + $(wildcard include/config/mcore2.h) \
2394 + $(wildcard include/config/m686.h) \
2395 + $(wildcard include/config/mpentiumii.h) \
2396 + $(wildcard include/config/mpentiumiii.h) \
2397 + $(wildcard include/config/mpentiumm.h) \
2398 + $(wildcard include/config/mpentium4.h) \
2399 + $(wildcard include/config/mk6.h) \
2400 + $(wildcard include/config/x86/elan.h) \
2401 + $(wildcard include/config/mcrusoe.h) \
2402 + $(wildcard include/config/mefficeon.h) \
2403 + $(wildcard include/config/mwinchipc6.h) \
2404 + $(wildcard include/config/mwinchip2.h) \
2405 + $(wildcard include/config/mwinchip3d.h) \
2406 + $(wildcard include/config/mcyrixiii.h) \
2407 + $(wildcard include/config/mviac3/2.h) \
2408 + $(wildcard include/config/mviac7.h) \
2409 + $(wildcard include/config/mgeodegx1.h) \
2410 + $(wildcard include/config/mgeode/lx.h) \
2411 + include/asm/device.h \
2412 + include/linux/pci_ids.h \
2413 + include/linux/dmapool.h \
2414 + include/asm/io.h \
2415 + $(wildcard include/config/x86/numaq.h) \
2416 + include/asm-generic/iomap.h \
2417 + include/linux/vmalloc.h \
2418 + include/asm/scatterlist.h \
2419 + include/asm/pci.h \
2420 + include/linux/mm.h \
2421 + $(wildcard include/config/sysctl.h) \
2422 + $(wildcard include/config/mmu.h) \
2423 + $(wildcard include/config/stack/growsup.h) \
2424 + $(wildcard include/config/debug/vm.h) \
2425 + $(wildcard include/config/shmem.h) \
2426 + $(wildcard include/config/split/ptlock/cpus.h) \
2427 + $(wildcard include/config/ia64.h) \
2428 + $(wildcard include/config/proc/fs.h) \
2429 + $(wildcard include/config/debug/pagealloc.h) \
2430 + include/linux/capability.h \
2431 + include/linux/rbtree.h \
2432 + include/linux/prio_tree.h \
2433 + include/linux/fs.h \
2434 + $(wildcard include/config/dnotify.h) \
2435 + $(wildcard include/config/vserver/cowbl.h) \
2436 + $(wildcard include/config/quota.h) \
2437 + $(wildcard include/config/inotify.h) \
2438 + $(wildcard include/config/security.h) \
2439 + $(wildcard include/config/epoll.h) \
2440 + $(wildcard include/config/auditsyscall.h) \
2441 + $(wildcard include/config/block.h) \
2442 + $(wildcard include/config/fs/xip.h) \
2443 + $(wildcard include/config/migration.h) \
2444 + include/linux/limits.h \
2445 + include/linux/ioctl.h \
2446 + include/asm/ioctl.h \
2447 + include/asm-generic/ioctl.h \
2448 + include/linux/kdev_t.h \
2449 + include/linux/dcache.h \
2450 + $(wildcard include/config/profiling.h) \
2451 + include/linux/rcupdate.h \
2452 + include/linux/namei.h \
2453 + include/linux/radix-tree.h \
2454 + include/linux/pid.h \
2455 + include/linux/quota.h \
2456 + include/linux/dqblk_xfs.h \
2457 + include/linux/dqblk_v1.h \
2458 + include/linux/dqblk_v2.h \
2459 + include/linux/nfs_fs_i.h \
2460 + include/linux/nfs.h \
2461 + include/linux/sunrpc/msg_prot.h \
2462 + include/linux/fcntl.h \
2463 + include/asm/fcntl.h \
2464 + include/asm-generic/fcntl.h \
2465 + $(wildcard include/config/64bit.h) \
2466 + include/linux/err.h \
2467 + include/linux/debug_locks.h \
2468 + $(wildcard include/config/debug/locking/api/selftests.h) \
2469 + include/linux/backing-dev.h \
2470 + include/linux/mm_types.h \
2471 + include/asm/pgtable.h \
2472 + $(wildcard include/config/highpte.h) \
2473 + include/asm/paravirt.h \
2474 + include/asm/pgtable-2level-defs.h \
2475 + include/asm/pgtable-2level.h \
2476 + include/asm-generic/pgtable.h \
2477 + include/linux/page-flags.h \
2478 + $(wildcard include/config/s390.h) \
2479 + $(wildcard include/config/swap.h) \
2480 + include/linux/vmstat.h \
2481 + $(wildcard include/config/vm/event/counters.h) \
2482 + include/asm-generic/pci-dma-compat.h \
2483 + include/linux/dma-mapping.h \
2484 + include/asm/dma-mapping.h \
2485 + include/asm-generic/pci.h \
2486 + include/linux/interrupt.h \
2487 + $(wildcard include/config/high/res/timers.h) \
2488 + $(wildcard include/config/generic/irq/probe.h) \
2489 + include/linux/irqreturn.h \
2490 + include/linux/hardirq.h \
2491 + $(wildcard include/config/preempt/bkl.h) \
2492 + $(wildcard include/config/virt/cpu/accounting.h) \
2493 + include/linux/smp_lock.h \
2494 + $(wildcard include/config/lock/kernel.h) \
2495 + include/linux/sched.h \
2496 + $(wildcard include/config/no/hz.h) \
2497 + $(wildcard include/config/detect/softlockup.h) \
2498 + $(wildcard include/config/keys.h) \
2499 + $(wildcard include/config/bsd/process/acct.h) \
2500 + $(wildcard include/config/taskstats.h) \
2501 + $(wildcard include/config/inotify/user.h) \
2502 + $(wildcard include/config/schedstats.h) \
2503 + $(wildcard include/config/task/delay/acct.h) \
2504 + $(wildcard include/config/blk/dev/io/trace.h) \
2505 + $(wildcard include/config/cc/stackprotector.h) \
2506 + $(wildcard include/config/sysvipc.h) \
2507 + $(wildcard include/config/rt/mutexes.h) \
2508 + $(wildcard include/config/task/xacct.h) \
2509 + $(wildcard include/config/cpusets.h) \
2510 + $(wildcard include/config/compat.h) \
2511 + $(wildcard include/config/fault/injection.h) \
2512 + include/asm/param.h \
2513 + $(wildcard include/config/hz.h) \
2514 + include/linux/timex.h \
2515 + $(wildcard include/config/time/interpolation.h) \
2516 + include/asm/timex.h \
2517 + include/asm/tsc.h \
2518 + $(wildcard include/config/x86/tsc.h) \
2519 + $(wildcard include/config/x86/generic.h) \
2520 + include/linux/jiffies.h \
2521 + include/linux/calc64.h \
2522 + include/asm/div64.h \
2523 + include/asm/cputime.h \
2524 + include/asm-generic/cputime.h \
2525 + include/linux/sem.h \
2526 + include/linux/ipc.h \
2527 + $(wildcard include/config/ipc/ns.h) \
2528 + include/asm/ipcbuf.h \
2529 + include/asm/sembuf.h \
2530 + include/linux/signal.h \
2531 + include/asm/signal.h \
2532 + include/asm-generic/signal.h \
2533 + include/asm/siginfo.h \
2534 + include/asm-generic/siginfo.h \
2535 + include/linux/securebits.h \
2536 + include/linux/fs_struct.h \
2537 + include/linux/seccomp.h \
2538 + $(wildcard include/config/seccomp.h) \
2539 + include/linux/futex.h \
2540 + $(wildcard include/config/futex.h) \
2541 + include/linux/rtmutex.h \
2542 + $(wildcard include/config/debug/rt/mutexes.h) \
2543 + include/linux/plist.h \
2544 + $(wildcard include/config/debug/pi/list.h) \
2545 + include/linux/param.h \
2546 + include/linux/resource.h \
2547 + include/asm/resource.h \
2548 + include/asm-generic/resource.h \
2549 + include/linux/timer.h \
2550 + $(wildcard include/config/timer/stats.h) \
2551 + include/linux/ktime.h \
2552 + $(wildcard include/config/ktime/scalar.h) \
2553 + include/linux/hrtimer.h \
2554 + include/linux/task_io_accounting.h \
2555 + $(wildcard include/config/task/io/accounting.h) \
2556 + include/linux/aio.h \
2557 + include/linux/workqueue.h \
2558 + include/linux/aio_abi.h \
2559 + include/linux/uio.h \
2560 + include/asm/hardirq.h \
2561 + include/linux/irq.h \
2562 + $(wildcard include/config/irq/per/cpu.h) \
2563 + $(wildcard include/config/irq/release/method.h) \
2564 + $(wildcard include/config/generic/pending/irq.h) \
2565 + $(wildcard include/config/irqbalance.h) \
2566 + $(wildcard include/config/auto/irq/affinity.h) \
2567 + $(wildcard include/config/generic/hardirqs/no//do/irq.h) \
2568 + include/asm/irq.h \
2569 + include/asm-i386/mach-default/irq_vectors.h \
2570 + include/asm-i386/mach-default/irq_vectors_limits.h \
2571 + include/asm/irq_regs.h \
2572 + include/asm/hw_irq.h \
2573 + include/linux/profile.h \
2574 + include/asm/sections.h \
2575 + include/asm-generic/sections.h \
2576 + include/linux/irq_cpustat.h \
2577 + include/linux/if_ether.h \
2578 + include/linux/skbuff.h \
2579 + $(wildcard include/config/nf/conntrack.h) \
2580 + $(wildcard include/config/bridge/netfilter.h) \
2581 + $(wildcard include/config/vlan/8021q.h) \
2582 + $(wildcard include/config/net/sched.h) \
2583 + $(wildcard include/config/net/cls/act.h) \
2584 + $(wildcard include/config/net/dma.h) \
2585 + $(wildcard include/config/network/secmark.h) \
2586 + include/linux/net.h \
2587 + include/asm/socket.h \
2588 + include/asm/sockios.h \
2589 + include/linux/random.h \
2590 + include/linux/sysctl.h \
2591 + $(wildcard include/config/icmp/ipod.h) \
2592 + $(wildcard include/config/web100/net100.h) \
2593 + $(wildcard include/config/web100/stats.h) \
2594 + include/linux/textsearch.h \
2595 + include/net/checksum.h \
2596 + include/asm/uaccess.h \
2597 + $(wildcard include/config/x86/intel/usercopy.h) \
2598 + $(wildcard include/config/x86/wp/works/ok.h) \
2599 + include/asm/checksum.h \
2600 + include/linux/in6.h \
2601 + include/linux/dmaengine.h \
2602 + $(wildcard include/config/dma/engine.h) \
2603 + drivers/net/igb/kcompat.h \
2604 + $(wildcard include/config/e1000/napi.h) \
2605 + $(wildcard include/config/e1000e/napi.h) \
2606 + $(wildcard include/config/ixgb/napi.h) \
2607 + $(wildcard include/config/e1000/disable/packet/split.h) \
2608 + $(wildcard include/config/igb/disable/packet/split.h) \
2609 + $(wildcard include/config/net/poll/controller.h) \
2610 + $(wildcard include/config/space/len.h) \
2611 + $(wildcard include/config/netpoll.h) \
2612 + $(wildcard include/config/netdevices/multiqueue.h) \
2613 + include/linux/version.h \
2614 + include/linux/netdevice.h \
2615 + $(wildcard include/config/ax25.h) \
2616 + $(wildcard include/config/tr.h) \
2617 + $(wildcard include/config/net/ipip.h) \
2618 + $(wildcard include/config/net/ipgre.h) \
2619 + $(wildcard include/config/ipv6/sit.h) \
2620 + $(wildcard include/config/ipv6/tunnel.h) \
2621 + $(wildcard include/config/wireless/ext.h) \
2622 + $(wildcard include/config/netpoll/trap.h) \
2623 + include/linux/if.h \
2624 + include/linux/socket.h \
2625 + include/linux/sockios.h \
2626 + include/linux/hdlc/ioctl.h \
2627 + include/linux/if_packet.h \
2628 + include/linux/etherdevice.h \
2629 + include/linux/in.h \
2630 + include/linux/ip.h \
2631 + include/linux/udp.h \
2632 + include/net/inet_sock.h \
2633 + $(wildcard include/config/ipv6.h) \
2634 + include/linux/jhash.h \
2635 + include/net/flow.h \
2636 + $(wildcard include/config/ipv6/mip6.h) \
2637 + include/net/sock.h \
2638 + $(wildcard include/config/security/network.h) \
2639 + include/linux/security.h \
2640 + $(wildcard include/config/security/network/xfrm.h) \
2641 + include/linux/binfmts.h \
2642 + include/linux/shm.h \
2643 + include/asm/shmparam.h \
2644 + include/asm/shmbuf.h \
2645 + include/linux/msg.h \
2646 + include/asm/msgbuf.h \
2647 + include/linux/key.h \
2648 + include/linux/xfrm.h \
2649 + include/linux/filter.h \
2650 + include/net/dst.h \
2651 + $(wildcard include/config/net/cls/route.h) \
2652 + $(wildcard include/config/xfrm.h) \
2653 + include/linux/rtnetlink.h \
2654 + include/linux/netlink.h \
2655 + include/linux/if_link.h \
2656 + include/linux/if_addr.h \
2657 + include/linux/neighbour.h \
2658 + include/net/neighbour.h \
2659 + include/linux/seq_file.h \
2660 + include/net/rtnetlink.h \
2661 + include/net/netlink.h \
2662 + include/net/request_sock.h \
2663 + include/linux/mii.h \
2664 + include/linux/latency.h \
2665 + drivers/net/igb/e1000_regs.h \
2666 + drivers/net/igb/e1000_defines.h \
2667 + $(wildcard include/config/res.h) \
2668 + $(wildcard include/config/fault.h) \
2669 + drivers/net/igb/e1000_mac.h \
2670 + drivers/net/igb/e1000_phy.h \
2671 + drivers/net/igb/e1000_nvm.h \
2672 + drivers/net/igb/e1000_manage.h \
2673 + drivers/net/igb/e1000_82575.h \
2675 +drivers/net/igb/e1000_82575.o: $(deps_drivers/net/igb/e1000_82575.o)
2677 +$(deps_drivers/net/igb/e1000_82575.o):
2678 diff -Nru vanilla/drivers/net/igb/e1000_api.c linux-i686-2.6.22/drivers/net/igb/e1000_api.c
2679 --- vanilla/drivers/net/igb/e1000_api.c 1969-12-31 19:00:00.000000000 -0500
2680 +++ linux-i686-2.6.22/drivers/net/igb/e1000_api.c 2009-07-16 19:25:22.000000000 -0400
2682 +/*******************************************************************************
2684 + Intel(R) Gigabit Ethernet Linux driver
2685 + Copyright(c) 2007-2008 Intel Corporation.
2687 + This program is free software; you can redistribute it and/or modify it
2688 + under the terms and conditions of the GNU General Public License,
2689 + version 2, as published by the Free Software Foundation.
2691 + This program is distributed in the hope it will be useful, but WITHOUT
2692 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
2693 + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
2696 + You should have received a copy of the GNU General Public License along with
2697 + this program; if not, write to the Free Software Foundation, Inc.,
2698 + 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
2700 + The full GNU General Public License is included in this distribution in
2701 + the file called "COPYING".
2703 + Contact Information:
2704 + e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
2705 + Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
2707 +*******************************************************************************/
2709 +#include "e1000_api.h"
2712 + * e1000_init_mac_params - Initialize MAC function pointers
2713 + * @hw: pointer to the HW structure
2715 + * This function initializes the function pointers for the MAC
2716 + * set of functions. Called by drivers or by e1000_setup_init_funcs.
2718 +s32 e1000_init_mac_params(struct e1000_hw *hw)
2720 + s32 ret_val = E1000_SUCCESS;
2722 + if (hw->mac.ops.init_params) {
2723 + ret_val = hw->mac.ops.init_params(hw);
2725 + DEBUGOUT("MAC Initialization Error\n");
2729 + DEBUGOUT("mac.init_mac_params was NULL\n");
2730 + ret_val = -E1000_ERR_CONFIG;
2738 + * e1000_init_nvm_params - Initialize NVM function pointers
2739 + * @hw: pointer to the HW structure
2741 + * This function initializes the function pointers for the NVM
2742 + * set of functions. Called by drivers or by e1000_setup_init_funcs.
2744 +s32 e1000_init_nvm_params(struct e1000_hw *hw)
2746 + s32 ret_val = E1000_SUCCESS;
2748 + if (hw->nvm.ops.init_params) {
2749 + ret_val = hw->nvm.ops.init_params(hw);
2751 + DEBUGOUT("NVM Initialization Error\n");
2755 + DEBUGOUT("nvm.init_nvm_params was NULL\n");
2756 + ret_val = -E1000_ERR_CONFIG;
2764 + * e1000_init_phy_params - Initialize PHY function pointers
2765 + * @hw: pointer to the HW structure
2767 + * This function initializes the function pointers for the PHY
2768 + * set of functions. Called by drivers or by e1000_setup_init_funcs.
2770 +s32 e1000_init_phy_params(struct e1000_hw *hw)
2772 + s32 ret_val = E1000_SUCCESS;
2774 + if (hw->phy.ops.init_params) {
2775 + ret_val = hw->phy.ops.init_params(hw);
2777 + DEBUGOUT("PHY Initialization Error\n");
2781 + DEBUGOUT("phy.init_phy_params was NULL\n");
2782 + ret_val = -E1000_ERR_CONFIG;
2790 + * e1000_set_mac_type - Sets MAC type
2791 + * @hw: pointer to the HW structure
2793 + * This function sets the mac type of the adapter based on the
2794 + * device ID stored in the hw structure.
2795 + * MUST BE FIRST FUNCTION CALLED (explicitly or through
2796 + * e1000_setup_init_funcs()).
2798 +s32 e1000_set_mac_type(struct e1000_hw *hw)
2800 + struct e1000_mac_info *mac = &hw->mac;
2801 + s32 ret_val = E1000_SUCCESS;
2803 + DEBUGFUNC("e1000_set_mac_type");
2805 + switch (hw->device_id) {
2806 + case E1000_DEV_ID_82575EB_COPPER:
2807 + case E1000_DEV_ID_82575EB_FIBER_SERDES:
2808 + case E1000_DEV_ID_82575GB_QUAD_COPPER:
2809 + mac->type = e1000_82575;
2811 + case E1000_DEV_ID_82576:
2812 + case E1000_DEV_ID_82576_FIBER:
2813 + case E1000_DEV_ID_82576_SERDES:
2814 + mac->type = e1000_82576;
2817 + /* Should never have loaded on this device */
2818 + ret_val = -E1000_ERR_MAC_INIT;
2826 + * e1000_setup_init_funcs - Initializes function pointers
2827 + * @hw: pointer to the HW structure
2828 + * @init_device: true will initialize the rest of the function pointers
2829 + * getting the device ready for use. false will only set
2830 + * MAC type and the function pointers for the other init
2831 + * functions. Passing false will not generate any hardware
2832 + * reads or writes.
2834 + * This function must be called by a driver in order to use the rest
2835 + * of the 'shared' code files. Called by drivers only.
2837 +s32 e1000_setup_init_funcs(struct e1000_hw *hw, bool init_device)
2841 + /* Can't do much good without knowing the MAC type. */
2842 + ret_val = e1000_set_mac_type(hw);
2844 + DEBUGOUT("ERROR: MAC type could not be set properly.\n");
2848 + if (!hw->hw_addr) {
2849 + DEBUGOUT("ERROR: Registers not mapped\n");
2850 + ret_val = -E1000_ERR_CONFIG;
2855 + * Init function pointers to generic implementations. We do this first
2856 + * allowing a driver module to override it afterward.
2858 + e1000_init_mac_ops_generic(hw);
2859 + e1000_init_nvm_ops_generic(hw);
2862 + * Set up the init function pointers. These are functions within the
2863 + * adapter family file that sets up function pointers for the rest of
2864 + * the functions in that family.
2866 + switch (hw->mac.type) {
2869 + e1000_init_function_pointers_82575(hw);
2872 + DEBUGOUT("Hardware not supported\n");
2873 + ret_val = -E1000_ERR_CONFIG;
2878 + * Initialize the rest of the function pointers. These require some
2879 + * register reads/writes in some cases.
2881 + if (!(ret_val) && init_device) {
2882 + ret_val = e1000_init_mac_params(hw);
2886 + ret_val = e1000_init_nvm_params(hw);
2890 + ret_val = e1000_init_phy_params(hw);
2901 + * e1000_get_bus_info - Obtain bus information for adapter
2902 + * @hw: pointer to the HW structure
2904 + * This will obtain information about the HW bus for which the
2905 + * adapter is attached and stores it in the hw structure. This is a
2906 + * function pointer entry point called by drivers.
2908 +s32 e1000_get_bus_info(struct e1000_hw *hw)
2910 + if (hw->mac.ops.get_bus_info)
2911 + return hw->mac.ops.get_bus_info(hw);
2913 + return E1000_SUCCESS;
2917 + * e1000_clear_vfta - Clear VLAN filter table
2918 + * @hw: pointer to the HW structure
2920 + * This clears the VLAN filter table on the adapter. This is a function
2921 + * pointer entry point called by drivers.
2923 +void e1000_clear_vfta(struct e1000_hw *hw)
2925 + if (hw->mac.ops.clear_vfta)
2926 + hw->mac.ops.clear_vfta(hw);
2930 + * e1000_write_vfta - Write value to VLAN filter table
2931 + * @hw: pointer to the HW structure
2932 + * @offset: the 32-bit offset in which to write the value to.
2933 + * @value: the 32-bit value to write at location offset.
2935 + * This writes a 32-bit value to a 32-bit offset in the VLAN filter
2936 + * table. This is a function pointer entry point called by drivers.
2938 +void e1000_write_vfta(struct e1000_hw *hw, u32 offset, u32 value)
2940 + if (hw->mac.ops.write_vfta)
2941 + hw->mac.ops.write_vfta(hw, offset, value);
2945 + * e1000_update_mc_addr_list - Update Multicast addresses
2946 + * @hw: pointer to the HW structure
2947 + * @mc_addr_list: array of multicast addresses to program
2948 + * @mc_addr_count: number of multicast addresses to program
2949 + * @rar_used_count: the first RAR register free to program
2950 + * @rar_count: total number of supported Receive Address Registers
2952 + * Updates the Receive Address Registers and Multicast Table Array.
2953 + * The caller must have a packed mc_addr_list of multicast addresses.
2954 + * The parameter rar_count will usually be hw->mac.rar_entry_count
2955 + * unless there are workarounds that change this. Currently no func pointer
2956 + * exists and all implementations are handled in the generic version of this
2959 +void e1000_update_mc_addr_list(struct e1000_hw *hw, u8 *mc_addr_list,
2960 + u32 mc_addr_count, u32 rar_used_count,
2963 + if (hw->mac.ops.update_mc_addr_list)
2964 + hw->mac.ops.update_mc_addr_list(hw,
2972 + * e1000_force_mac_fc - Force MAC flow control
2973 + * @hw: pointer to the HW structure
2975 + * Force the MAC's flow control settings. Currently no func pointer exists
2976 + * and all implementations are handled in the generic version of this
2979 +s32 e1000_force_mac_fc(struct e1000_hw *hw)
2981 + return e1000_force_mac_fc_generic(hw);
2985 + * e1000_check_for_link - Check/Store link connection
2986 + * @hw: pointer to the HW structure
2988 + * This checks the link condition of the adapter and stores the
2989 + * results in the hw->mac structure. This is a function pointer entry
2990 + * point called by drivers.
2992 +s32 e1000_check_for_link(struct e1000_hw *hw)
2994 + if (hw->mac.ops.check_for_link)
2995 + return hw->mac.ops.check_for_link(hw);
2997 + return -E1000_ERR_CONFIG;
3001 + * e1000_check_mng_mode - Check management mode
3002 + * @hw: pointer to the HW structure
3004 + * This checks if the adapter has manageability enabled.
3005 + * This is a function pointer entry point called by drivers.
3007 +bool e1000_check_mng_mode(struct e1000_hw *hw)
3009 + if (hw->mac.ops.check_mng_mode)
3010 + return hw->mac.ops.check_mng_mode(hw);
3016 + * e1000_mng_write_dhcp_info - Writes DHCP info to host interface
3017 + * @hw: pointer to the HW structure
3018 + * @buffer: pointer to the host interface
3019 + * @length: size of the buffer
3021 + * Writes the DHCP information to the host interface.
3023 +s32 e1000_mng_write_dhcp_info(struct e1000_hw *hw, u8 *buffer, u16 length)
3025 + return e1000_mng_write_dhcp_info_generic(hw, buffer, length);
3029 + * e1000_reset_hw - Reset hardware
3030 + * @hw: pointer to the HW structure
3032 + * This resets the hardware into a known state. This is a function pointer
3033 + * entry point called by drivers.
3035 +s32 e1000_reset_hw(struct e1000_hw *hw)
3037 + if (hw->mac.ops.reset_hw)
3038 + return hw->mac.ops.reset_hw(hw);
3040 + return -E1000_ERR_CONFIG;
3044 + * e1000_init_hw - Initialize hardware
3045 + * @hw: pointer to the HW structure
3047 + * This inits the hardware readying it for operation. This is a function
3048 + * pointer entry point called by drivers.
3050 +s32 e1000_init_hw(struct e1000_hw *hw)
3052 + if (hw->mac.ops.init_hw)
3053 + return hw->mac.ops.init_hw(hw);
3055 + return -E1000_ERR_CONFIG;
3059 + * e1000_setup_link - Configures link and flow control
3060 + * @hw: pointer to the HW structure
3062 + * This configures link and flow control settings for the adapter. This
3063 + * is a function pointer entry point called by drivers. While modules can
3064 + * also call this, they probably call their own version of this function.
3066 +s32 e1000_setup_link(struct e1000_hw *hw)
3068 + if (hw->mac.ops.setup_link)
3069 + return hw->mac.ops.setup_link(hw);
3071 + return -E1000_ERR_CONFIG;
3075 + * e1000_get_speed_and_duplex - Returns current speed and duplex
3076 + * @hw: pointer to the HW structure
3077 + * @speed: pointer to a 16-bit value to store the speed
3078 + * @duplex: pointer to a 16-bit value to store the duplex.
3080 + * This returns the speed and duplex of the adapter in the two 'out'
3081 + * variables passed in. This is a function pointer entry point called
3084 +s32 e1000_get_speed_and_duplex(struct e1000_hw *hw, u16 *speed, u16 *duplex)
3086 + if (hw->mac.ops.get_link_up_info)
3087 + return hw->mac.ops.get_link_up_info(hw, speed, duplex);
3089 + return -E1000_ERR_CONFIG;
3093 + * e1000_setup_led - Configures SW controllable LED
3094 + * @hw: pointer to the HW structure
3096 + * This prepares the SW controllable LED for use and saves the current state
3097 + * of the LED so it can be later restored. This is a function pointer entry
3098 + * point called by drivers.
3100 +s32 e1000_setup_led(struct e1000_hw *hw)
3102 + if (hw->mac.ops.setup_led)
3103 + return hw->mac.ops.setup_led(hw);
3105 + return E1000_SUCCESS;
3109 + * e1000_cleanup_led - Restores SW controllable LED
3110 + * @hw: pointer to the HW structure
3112 + * This restores the SW controllable LED to the value saved off by
3113 + * e1000_setup_led. This is a function pointer entry point called by drivers.
3115 +s32 e1000_cleanup_led(struct e1000_hw *hw)
3117 + if (hw->mac.ops.cleanup_led)
3118 + return hw->mac.ops.cleanup_led(hw);
3120 + return E1000_SUCCESS;
3124 + * e1000_blink_led - Blink SW controllable LED
3125 + * @hw: pointer to the HW structure
3127 + * This starts the adapter LED blinking. Request the LED to be setup first
3128 + * and cleaned up after. This is a function pointer entry point called by
3131 +s32 e1000_blink_led(struct e1000_hw *hw)
3133 + if (hw->mac.ops.blink_led)
3134 + return hw->mac.ops.blink_led(hw);
3136 + return E1000_SUCCESS;
3140 + * e1000_led_on - Turn on SW controllable LED
3141 + * @hw: pointer to the HW structure
3143 + * Turns the SW defined LED on. This is a function pointer entry point
3144 + * called by drivers.
3146 +s32 e1000_led_on(struct e1000_hw *hw)
3148 + if (hw->mac.ops.led_on)
3149 + return hw->mac.ops.led_on(hw);
3151 + return E1000_SUCCESS;
3155 + * e1000_led_off - Turn off SW controllable LED
3156 + * @hw: pointer to the HW structure
3158 + * Turns the SW defined LED off. This is a function pointer entry point
3159 + * called by drivers.
3161 +s32 e1000_led_off(struct e1000_hw *hw)
3163 + if (hw->mac.ops.led_off)
3164 + return hw->mac.ops.led_off(hw);
3166 + return E1000_SUCCESS;
3170 + * e1000_reset_adaptive - Reset adaptive IFS
3171 + * @hw: pointer to the HW structure
3173 + * Resets the adaptive IFS. Currently no func pointer exists and all
3174 + * implementations are handled in the generic version of this function.
3176 +void e1000_reset_adaptive(struct e1000_hw *hw)
3178 + e1000_reset_adaptive_generic(hw);
3182 + * e1000_update_adaptive - Update adaptive IFS
3183 + * @hw: pointer to the HW structure
3185 + * Updates adapter IFS. Currently no func pointer exists and all
3186 + * implementations are handled in the generic version of this function.
3188 +void e1000_update_adaptive(struct e1000_hw *hw)
3190 + e1000_update_adaptive_generic(hw);
3194 + * e1000_disable_pcie_master - Disable PCI-Express master access
3195 + * @hw: pointer to the HW structure
3197 + * Disables PCI-Express master access and verifies there are no pending
3198 + * requests. Currently no func pointer exists and all implementations are
3199 + * handled in the generic version of this function.
3201 +s32 e1000_disable_pcie_master(struct e1000_hw *hw)
3203 + return e1000_disable_pcie_master_generic(hw);
3207 + * e1000_config_collision_dist - Configure collision distance
3208 + * @hw: pointer to the HW structure
3210 + * Configures the collision distance to the default value and is used
3211 + * during link setup.
3213 +void e1000_config_collision_dist(struct e1000_hw *hw)
3215 + if (hw->mac.ops.config_collision_dist)
3216 + hw->mac.ops.config_collision_dist(hw);
3220 + * e1000_rar_set - Sets a receive address register
3221 + * @hw: pointer to the HW structure
3222 + * @addr: address to set the RAR to
3223 + * @index: the RAR to set
3225 + * Sets a Receive Address Register (RAR) to the specified address.
3227 +void e1000_rar_set(struct e1000_hw *hw, u8 *addr, u32 index)
3229 + if (hw->mac.ops.rar_set)
3230 + hw->mac.ops.rar_set(hw, addr, index);
3234 + * e1000_validate_mdi_setting - Ensures valid MDI/MDIX SW state
3235 + * @hw: pointer to the HW structure
3237 + * Ensures that the MDI/MDIX SW state is valid.
3239 +s32 e1000_validate_mdi_setting(struct e1000_hw *hw)
3241 + if (hw->mac.ops.validate_mdi_setting)
3242 + return hw->mac.ops.validate_mdi_setting(hw);
3244 + return E1000_SUCCESS;
3248 + * e1000_mta_set - Sets multicast table bit
3249 + * @hw: pointer to the HW structure
3250 + * @hash_value: Multicast hash value.
3252 + * This sets the bit in the multicast table corresponding to the
3253 + * hash value. This is a function pointer entry point called by drivers.
3255 +void e1000_mta_set(struct e1000_hw *hw, u32 hash_value)
3257 + if (hw->mac.ops.mta_set)
3258 + hw->mac.ops.mta_set(hw, hash_value);
3262 + * e1000_hash_mc_addr - Determines address location in multicast table
3263 + * @hw: pointer to the HW structure
3264 + * @mc_addr: Multicast address to hash.
3266 + * This hashes an address to determine its location in the multicast
3267 + * table. Currently no func pointer exists and all implementations
3268 + * are handled in the generic version of this function.
3270 +u32 e1000_hash_mc_addr(struct e1000_hw *hw, u8 *mc_addr)
3272 + return e1000_hash_mc_addr_generic(hw, mc_addr);
3276 + * e1000_enable_tx_pkt_filtering - Enable packet filtering on TX
3277 + * @hw: pointer to the HW structure
3279 + * Enables packet filtering on transmit packets if manageability is enabled
3280 + * and host interface is enabled.
3281 + * Currently no func pointer exists and all implementations are handled in the
3282 + * generic version of this function.
3284 +bool e1000_enable_tx_pkt_filtering(struct e1000_hw *hw)
3286 + return e1000_enable_tx_pkt_filtering_generic(hw);
3290 + * e1000_mng_host_if_write - Writes to the manageability host interface
3291 + * @hw: pointer to the HW structure
3292 + * @buffer: pointer to the host interface buffer
3293 + * @length: size of the buffer
3294 + * @offset: location in the buffer to write to
3295 + * @sum: sum of the data (not checksum)
3297 + * This function writes the buffer content at the offset given on the host if.
3298 + * It also does alignment considerations to do the writes in most efficient
3299 + * way. Also fills up the sum of the buffer in *buffer parameter.
3301 +s32 e1000_mng_host_if_write(struct e1000_hw * hw, u8 *buffer, u16 length,
3302 + u16 offset, u8 *sum)
3304 + if (hw->mac.ops.mng_host_if_write)
3305 + return hw->mac.ops.mng_host_if_write(hw, buffer, length,
3308 + return E1000_NOT_IMPLEMENTED;
3312 + * e1000_mng_write_cmd_header - Writes manageability command header
3313 + * @hw: pointer to the HW structure
3314 + * @hdr: pointer to the host interface command header
3316 + * Writes the command header after does the checksum calculation.
3318 +s32 e1000_mng_write_cmd_header(struct e1000_hw *hw,
3319 + struct e1000_host_mng_command_header *hdr)
3321 + if (hw->mac.ops.mng_write_cmd_header)
3322 + return hw->mac.ops.mng_write_cmd_header(hw, hdr);
3324 + return E1000_NOT_IMPLEMENTED;
3328 + * e1000_mng_enable_host_if - Checks host interface is enabled
3329 + * @hw: pointer to the HW structure
3331 + * Returns E1000_success upon success, else E1000_ERR_HOST_INTERFACE_COMMAND
3333 + * This function checks whether the HOST IF is enabled for command operation
3334 + * and also checks whether the previous command is completed. It busy waits
3335 + * in case of previous command is not completed.
3337 +s32 e1000_mng_enable_host_if(struct e1000_hw * hw)
3339 + if (hw->mac.ops.mng_enable_host_if)
3340 + return hw->mac.ops.mng_enable_host_if(hw);
3342 + return E1000_NOT_IMPLEMENTED;
3346 + * e1000_wait_autoneg - Waits for autonegotiation completion
3347 + * @hw: pointer to the HW structure
3349 + * Waits for autoneg to complete. Currently no func pointer exists and all
3350 + * implementations are handled in the generic version of this function.
3352 +s32 e1000_wait_autoneg(struct e1000_hw *hw)
3354 + if (hw->mac.ops.wait_autoneg)
3355 + return hw->mac.ops.wait_autoneg(hw);
3357 + return E1000_SUCCESS;
3361 + * e1000_check_reset_block - Verifies PHY can be reset
3362 + * @hw: pointer to the HW structure
3364 + * Checks if the PHY is in a state that can be reset or if manageability
3365 + * has it tied up. This is a function pointer entry point called by drivers.
3367 +s32 e1000_check_reset_block(struct e1000_hw *hw)
3369 + if (hw->phy.ops.check_reset_block)
3370 + return hw->phy.ops.check_reset_block(hw);
3372 + return E1000_SUCCESS;
3376 + * e1000_read_phy_reg - Reads PHY register
3377 + * @hw: pointer to the HW structure
3378 + * @offset: the register to read
3379 + * @data: the buffer to store the 16-bit read.
3381 + * Reads the PHY register and returns the value in data.
3382 + * This is a function pointer entry point called by drivers.
3384 +s32 e1000_read_phy_reg(struct e1000_hw *hw, u32 offset, u16 *data)
3386 + if (hw->phy.ops.read_reg)
3387 + return hw->phy.ops.read_reg(hw, offset, data);
3389 + return E1000_SUCCESS;
3393 + * e1000_write_phy_reg - Writes PHY register
3394 + * @hw: pointer to the HW structure
3395 + * @offset: the register to write
3396 + * @data: the value to write.
3398 + * Writes the PHY register at offset with the value in data.
3399 + * This is a function pointer entry point called by drivers.
3401 +s32 e1000_write_phy_reg(struct e1000_hw *hw, u32 offset, u16 data)
3403 + if (hw->phy.ops.write_reg)
3404 + return hw->phy.ops.write_reg(hw, offset, data);
3406 + return E1000_SUCCESS;
3410 + * e1000_release_phy - Generic release PHY
3411 + * @hw: pointer to the HW structure
3413 + * Return if silicon family does not require a semaphore when accessing the
3416 +void e1000_release_phy(struct e1000_hw *hw)
3418 + if (hw->phy.ops.release)
3419 + hw->phy.ops.release(hw);
3423 + * e1000_acquire_phy - Generic acquire PHY
3424 + * @hw: pointer to the HW structure
3426 + * Return success if silicon family does not require a semaphore when
3427 + * accessing the PHY.
3429 +s32 e1000_acquire_phy(struct e1000_hw *hw)
3431 + if (hw->phy.ops.acquire)
3432 + return hw->phy.ops.acquire(hw);
3434 + return E1000_SUCCESS;
3438 + * e1000_read_kmrn_reg - Reads register using Kumeran interface
3439 + * @hw: pointer to the HW structure
3440 + * @offset: the register to read
3441 + * @data: the location to store the 16-bit value read.
3443 + * Reads a register out of the Kumeran interface. Currently no func pointer
3444 + * exists and all implementations are handled in the generic version of
3447 +s32 e1000_read_kmrn_reg(struct e1000_hw *hw, u32 offset, u16 *data)
3449 + return e1000_read_kmrn_reg_generic(hw, offset, data);
3453 + * e1000_write_kmrn_reg - Writes register using Kumeran interface
3454 + * @hw: pointer to the HW structure
3455 + * @offset: the register to write
3456 + * @data: the value to write.
3458 + * Writes a register to the Kumeran interface. Currently no func pointer
3459 + * exists and all implementations are handled in the generic version of
3462 +s32 e1000_write_kmrn_reg(struct e1000_hw *hw, u32 offset, u16 data)
3464 + return e1000_write_kmrn_reg_generic(hw, offset, data);
3468 + * e1000_get_cable_length - Retrieves cable length estimation
3469 + * @hw: pointer to the HW structure
3471 + * This function estimates the cable length and stores them in
3472 + * hw->phy.min_length and hw->phy.max_length. This is a function pointer
3473 + * entry point called by drivers.
3475 +s32 e1000_get_cable_length(struct e1000_hw *hw)
3477 + if (hw->phy.ops.get_cable_length)
3478 + return hw->phy.ops.get_cable_length(hw);
3480 + return E1000_SUCCESS;
3484 + * e1000_get_phy_info - Retrieves PHY information from registers
3485 + * @hw: pointer to the HW structure
3487 + * This function gets some information from various PHY registers and
3488 + * populates hw->phy values with it. This is a function pointer entry
3489 + * point called by drivers.
3491 +s32 e1000_get_phy_info(struct e1000_hw *hw)
3493 + if (hw->phy.ops.get_info)
3494 + return hw->phy.ops.get_info(hw);
3496 + return E1000_SUCCESS;
3500 + * e1000_phy_hw_reset - Hard PHY reset
3501 + * @hw: pointer to the HW structure
3503 + * Performs a hard PHY reset. This is a function pointer entry point called
3506 +s32 e1000_phy_hw_reset(struct e1000_hw *hw)
3508 + if (hw->phy.ops.reset)
3509 + return hw->phy.ops.reset(hw);
3511 + return E1000_SUCCESS;
3515 + * e1000_phy_commit - Soft PHY reset
3516 + * @hw: pointer to the HW structure
3518 + * Performs a soft PHY reset on those that apply. This is a function pointer
3519 + * entry point called by drivers.
3521 +s32 e1000_phy_commit(struct e1000_hw *hw)
3523 + if (hw->phy.ops.commit)
3524 + return hw->phy.ops.commit(hw);
3526 + return E1000_SUCCESS;
3530 + * e1000_set_d0_lplu_state - Sets low power link up state for D0
3531 + * @hw: pointer to the HW structure
3532 + * @active: boolean used to enable/disable lplu
3534 + * Success returns 0, Failure returns 1
3536 + * The low power link up (lplu) state is set to the power management level D0
3537 + * and SmartSpeed is disabled when active is true, else clear lplu for D0
3538 + * and enable Smartspeed. LPLU and Smartspeed are mutually exclusive. LPLU
3539 + * is used during Dx states where the power conservation is most important.
3540 + * During driver activity, SmartSpeed should be enabled so performance is
3541 + * maintained. This is a function pointer entry point called by drivers.
3543 +s32 e1000_set_d0_lplu_state(struct e1000_hw *hw, bool active)
3545 + if (hw->phy.ops.set_d0_lplu_state)
3546 + return hw->phy.ops.set_d0_lplu_state(hw, active);
3548 + return E1000_SUCCESS;
3552 + * e1000_set_d3_lplu_state - Sets low power link up state for D3
3553 + * @hw: pointer to the HW structure
3554 + * @active: boolean used to enable/disable lplu
3556 + * Success returns 0, Failure returns 1
3558 + * The low power link up (lplu) state is set to the power management level D3
3559 + * and SmartSpeed is disabled when active is true, else clear lplu for D3
3560 + * and enable Smartspeed. LPLU and Smartspeed are mutually exclusive. LPLU
3561 + * is used during Dx states where the power conservation is most important.
3562 + * During driver activity, SmartSpeed should be enabled so performance is
3563 + * maintained. This is a function pointer entry point called by drivers.
3565 +s32 e1000_set_d3_lplu_state(struct e1000_hw *hw, bool active)
3567 + if (hw->phy.ops.set_d3_lplu_state)
3568 + return hw->phy.ops.set_d3_lplu_state(hw, active);
3570 + return E1000_SUCCESS;
3574 + * e1000_read_mac_addr - Reads MAC address
3575 + * @hw: pointer to the HW structure
3577 + * Reads the MAC address out of the adapter and stores it in the HW structure.
3578 + * Currently no func pointer exists and all implementations are handled in the
3579 + * generic version of this function.
3581 +s32 e1000_read_mac_addr(struct e1000_hw *hw)
3583 + if (hw->mac.ops.read_mac_addr)
3584 + return hw->mac.ops.read_mac_addr(hw);
3586 + return e1000_read_mac_addr_generic(hw);
3590 + * e1000_read_pba_num - Read device part number
3591 + * @hw: pointer to the HW structure
3592 + * @pba_num: pointer to device part number
3594 + * Reads the product board assembly (PBA) number from the EEPROM and stores
3595 + * the value in pba_num.
3596 + * Currently no func pointer exists and all implementations are handled in the
3597 + * generic version of this function.
3599 +s32 e1000_read_pba_num(struct e1000_hw *hw, u32 *pba_num)
3601 + return e1000_read_pba_num_generic(hw, pba_num);
3605 + * e1000_validate_nvm_checksum - Verifies NVM (EEPROM) checksum
3606 + * @hw: pointer to the HW structure
3608 + * Validates the NVM checksum is correct. This is a function pointer entry
3609 + * point called by drivers.
3611 +s32 e1000_validate_nvm_checksum(struct e1000_hw *hw)
3613 + if (hw->nvm.ops.validate)
3614 + return hw->nvm.ops.validate(hw);
3616 + return -E1000_ERR_CONFIG;
3620 + * e1000_update_nvm_checksum - Updates NVM (EEPROM) checksum
3621 + * @hw: pointer to the HW structure
3623 + * Updates the NVM checksum. Currently no func pointer exists and all
3624 + * implementations are handled in the generic version of this function.
3626 +s32 e1000_update_nvm_checksum(struct e1000_hw *hw)
3628 + if (hw->nvm.ops.update)
3629 + return hw->nvm.ops.update(hw);
3631 + return -E1000_ERR_CONFIG;
3635 + * e1000_reload_nvm - Reloads EEPROM
3636 + * @hw: pointer to the HW structure
3638 + * Reloads the EEPROM by setting the "Reinitialize from EEPROM" bit in the
3639 + * extended control register.
3641 +void e1000_reload_nvm(struct e1000_hw *hw)
3643 + if (hw->nvm.ops.reload)
3644 + hw->nvm.ops.reload(hw);
3648 + * e1000_read_nvm - Reads NVM (EEPROM)
3649 + * @hw: pointer to the HW structure
3650 + * @offset: the word offset to read
3651 + * @words: number of 16-bit words to read
3652 + * @data: pointer to the properly sized buffer for the data.
3654 + * Reads 16-bit chunks of data from the NVM (EEPROM). This is a function
3655 + * pointer entry point called by drivers.
3657 +s32 e1000_read_nvm(struct e1000_hw *hw, u16 offset, u16 words, u16 *data)
3659 + if (hw->nvm.ops.read)
3660 + return hw->nvm.ops.read(hw, offset, words, data);
3662 + return -E1000_ERR_CONFIG;
3666 + * e1000_write_nvm - Writes to NVM (EEPROM)
3667 + * @hw: pointer to the HW structure
3668 + * @offset: the word offset to read
3669 + * @words: number of 16-bit words to write
3670 + * @data: pointer to the properly sized buffer for the data.
3672 + * Writes 16-bit chunks of data to the NVM (EEPROM). This is a function
3673 + * pointer entry point called by drivers.
3675 +s32 e1000_write_nvm(struct e1000_hw *hw, u16 offset, u16 words, u16 *data)
3677 + if (hw->nvm.ops.write)
3678 + return hw->nvm.ops.write(hw, offset, words, data);
3680 + return E1000_SUCCESS;
3684 + * e1000_write_8bit_ctrl_reg - Writes 8bit Control register
3685 + * @hw: pointer to the HW structure
3686 + * @reg: 32bit register offset
3687 + * @offset: the register to write
3688 + * @data: the value to write.
3690 + * Writes the PHY register at offset with the value in data.
3691 + * This is a function pointer entry point called by drivers.
3693 +s32 e1000_write_8bit_ctrl_reg(struct e1000_hw *hw, u32 reg, u32 offset,
3696 + return e1000_write_8bit_ctrl_reg_generic(hw, reg, offset, data);
3700 + * e1000_power_up_phy - Restores link in case of PHY power down
3701 + * @hw: pointer to the HW structure
3703 + * The phy may be powered down to save power, to turn off link when the
3704 + * driver is unloaded, or wake on lan is not enabled (among others).
3706 +void e1000_power_up_phy(struct e1000_hw *hw)
3708 + if (hw->phy.ops.power_up)
3709 + hw->phy.ops.power_up(hw);
3711 + e1000_setup_link(hw);
3715 + * e1000_power_down_phy - Power down PHY
3716 + * @hw: pointer to the HW structure
3718 + * The phy may be powered down to save power, to turn off link when the
3719 + * driver is unloaded, or wake on lan is not enabled (among others).
3721 +void e1000_power_down_phy(struct e1000_hw *hw)
3723 + if (hw->phy.ops.power_down)
3724 + hw->phy.ops.power_down(hw);
3728 + * e1000_shutdown_fiber_serdes_link - Remove link during power down
3729 + * @hw: pointer to the HW structure
3731 + * Shutdown the optics and PCS on driver unload.
3733 +void e1000_shutdown_fiber_serdes_link(struct e1000_hw *hw)
3735 + if (hw->mac.ops.shutdown_serdes)
3736 + hw->mac.ops.shutdown_serdes(hw);
3739 diff -Nru vanilla/drivers/net/igb/e1000_api.h linux-i686-2.6.22/drivers/net/igb/e1000_api.h
3740 --- vanilla/drivers/net/igb/e1000_api.h 1969-12-31 19:00:00.000000000 -0500
3741 +++ linux-i686-2.6.22/drivers/net/igb/e1000_api.h 2009-07-16 19:25:22.000000000 -0400
3743 +/*******************************************************************************
3745 + Intel(R) Gigabit Ethernet Linux driver
3746 + Copyright(c) 2007-2008 Intel Corporation.
3748 + This program is free software; you can redistribute it and/or modify it
3749 + under the terms and conditions of the GNU General Public License,
3750 + version 2, as published by the Free Software Foundation.
3752 + This program is distributed in the hope it will be useful, but WITHOUT
3753 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
3754 + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
3757 + You should have received a copy of the GNU General Public License along with
3758 + this program; if not, write to the Free Software Foundation, Inc.,
3759 + 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
3761 + The full GNU General Public License is included in this distribution in
3762 + the file called "COPYING".
3764 + Contact Information:
3765 + e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
3766 + Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
3768 +*******************************************************************************/
3770 +#ifndef _E1000_API_H_
3771 +#define _E1000_API_H_
3773 +#include "e1000_hw.h"
3775 +extern void e1000_init_function_pointers_82575(struct e1000_hw *hw);
3776 +extern void e1000_rx_fifo_flush_82575(struct e1000_hw *hw);
3777 +extern void e1000_init_function_pointers_vf(struct e1000_hw *hw);
3778 +extern void e1000_shutdown_fiber_serdes_link(struct e1000_hw *hw);
3780 +s32 e1000_set_mac_type(struct e1000_hw *hw);
3781 +s32 e1000_setup_init_funcs(struct e1000_hw *hw, bool init_device);
3782 +s32 e1000_init_mac_params(struct e1000_hw *hw);
3783 +s32 e1000_init_nvm_params(struct e1000_hw *hw);
3784 +s32 e1000_init_phy_params(struct e1000_hw *hw);
3785 +s32 e1000_get_bus_info(struct e1000_hw *hw);
3786 +void e1000_clear_vfta(struct e1000_hw *hw);
3787 +void e1000_write_vfta(struct e1000_hw *hw, u32 offset, u32 value);
3788 +s32 e1000_force_mac_fc(struct e1000_hw *hw);
3789 +s32 e1000_check_for_link(struct e1000_hw *hw);
3790 +s32 e1000_reset_hw(struct e1000_hw *hw);
3791 +s32 e1000_init_hw(struct e1000_hw *hw);
3792 +s32 e1000_setup_link(struct e1000_hw *hw);
3793 +s32 e1000_get_speed_and_duplex(struct e1000_hw *hw, u16 *speed,
3795 +s32 e1000_disable_pcie_master(struct e1000_hw *hw);
3796 +void e1000_config_collision_dist(struct e1000_hw *hw);
3797 +void e1000_rar_set(struct e1000_hw *hw, u8 *addr, u32 index);
3798 +void e1000_mta_set(struct e1000_hw *hw, u32 hash_value);
3799 +u32 e1000_hash_mc_addr(struct e1000_hw *hw, u8 *mc_addr);
3800 +void e1000_update_mc_addr_list(struct e1000_hw *hw,
3801 + u8 *mc_addr_list, u32 mc_addr_count,
3802 + u32 rar_used_count, u32 rar_count);
3803 +s32 e1000_setup_led(struct e1000_hw *hw);
3804 +s32 e1000_cleanup_led(struct e1000_hw *hw);
3805 +s32 e1000_check_reset_block(struct e1000_hw *hw);
3806 +s32 e1000_blink_led(struct e1000_hw *hw);
3807 +s32 e1000_led_on(struct e1000_hw *hw);
3808 +s32 e1000_led_off(struct e1000_hw *hw);
3809 +void e1000_reset_adaptive(struct e1000_hw *hw);
3810 +void e1000_update_adaptive(struct e1000_hw *hw);
3811 +s32 e1000_get_cable_length(struct e1000_hw *hw);
3812 +s32 e1000_validate_mdi_setting(struct e1000_hw *hw);
3813 +s32 e1000_read_phy_reg(struct e1000_hw *hw, u32 offset, u16 *data);
3814 +s32 e1000_write_phy_reg(struct e1000_hw *hw, u32 offset, u16 data);
3815 +s32 e1000_write_8bit_ctrl_reg(struct e1000_hw *hw, u32 reg,
3816 + u32 offset, u8 data);
3817 +s32 e1000_get_phy_info(struct e1000_hw *hw);
3818 +void e1000_release_phy(struct e1000_hw *hw);
3819 +s32 e1000_acquire_phy(struct e1000_hw *hw);
3820 +s32 e1000_phy_hw_reset(struct e1000_hw *hw);
3821 +s32 e1000_phy_commit(struct e1000_hw *hw);
3822 +void e1000_power_up_phy(struct e1000_hw *hw);
3823 +void e1000_power_down_phy(struct e1000_hw *hw);
3824 +s32 e1000_read_mac_addr(struct e1000_hw *hw);
3825 +s32 e1000_read_pba_num(struct e1000_hw *hw, u32 *part_num);
3826 +void e1000_reload_nvm(struct e1000_hw *hw);
3827 +s32 e1000_update_nvm_checksum(struct e1000_hw *hw);
3828 +s32 e1000_validate_nvm_checksum(struct e1000_hw *hw);
3829 +s32 e1000_read_nvm(struct e1000_hw *hw, u16 offset, u16 words, u16 *data);
3830 +s32 e1000_read_kmrn_reg(struct e1000_hw *hw, u32 offset, u16 *data);
3831 +s32 e1000_write_kmrn_reg(struct e1000_hw *hw, u32 offset, u16 data);
3832 +s32 e1000_write_nvm(struct e1000_hw *hw, u16 offset, u16 words,
3834 +s32 e1000_wait_autoneg(struct e1000_hw *hw);
3835 +s32 e1000_set_d3_lplu_state(struct e1000_hw *hw, bool active);
3836 +s32 e1000_set_d0_lplu_state(struct e1000_hw *hw, bool active);
3837 +bool e1000_check_mng_mode(struct e1000_hw *hw);
3838 +bool e1000_enable_tx_pkt_filtering(struct e1000_hw *hw);
3839 +s32 e1000_mng_enable_host_if(struct e1000_hw *hw);
3840 +s32 e1000_mng_host_if_write(struct e1000_hw *hw,
3841 + u8 *buffer, u16 length, u16 offset, u8 *sum);
3842 +s32 e1000_mng_write_cmd_header(struct e1000_hw *hw,
3843 + struct e1000_host_mng_command_header *hdr);
3844 +s32 e1000_mng_write_dhcp_info(struct e1000_hw * hw,
3845 + u8 *buffer, u16 length);
3848 + * TBI_ACCEPT macro definition:
3850 + * This macro requires:
3851 + * adapter = a pointer to struct e1000_hw
3852 + * status = the 8 bit status field of the Rx descriptor with EOP set
3853 + * error = the 8 bit error field of the Rx descriptor with EOP set
3854 + * length = the sum of all the length fields of the Rx descriptors that
3855 + * make up the current frame
3856 + * last_byte = the last byte of the frame DMAed by the hardware
3857 + * max_frame_length = the maximum frame length we want to accept.
3858 + * min_frame_length = the minimum frame length we want to accept.
3860 + * This macro is a conditional that should be used in the interrupt
3861 + * handler's Rx processing routine when RxErrors have been detected.
3865 + * if (TBI_ACCEPT) {
3866 + * accept_frame = true;
3867 + * e1000_tbi_adjust_stats(adapter, MacAddress);
3870 + * accept_frame = false;
3875 +/* The carrier extension symbol, as received by the NIC. */
3876 +#define CARRIER_EXTENSION 0x0F
3878 +#define TBI_ACCEPT(a, status, errors, length, last_byte, min_frame_size, max_frame_size) \
3879 + (e1000_tbi_sbp_enabled_82543(a) && \
3880 + (((errors) & E1000_RXD_ERR_FRAME_ERR_MASK) == E1000_RXD_ERR_CE) && \
3881 + ((last_byte) == CARRIER_EXTENSION) && \
3882 + (((status) & E1000_RXD_STAT_VP) ? \
3883 + (((length) > (min_frame_size - VLAN_TAG_SIZE)) && \
3884 + ((length) <= (max_frame_size + 1))) : \
3885 + (((length) > min_frame_size) && \
3886 + ((length) <= (max_frame_size + VLAN_TAG_SIZE + 1)))))
3889 Binary files vanilla/drivers/net/igb/e1000_api.o and linux-i686-2.6.22/drivers/net/igb/e1000_api.o differ
3890 diff -Nru vanilla/drivers/net/igb/.e1000_api.o.cmd linux-i686-2.6.22/drivers/net/igb/.e1000_api.o.cmd
3891 --- vanilla/drivers/net/igb/.e1000_api.o.cmd 1969-12-31 19:00:00.000000000 -0500
3892 +++ linux-i686-2.6.22/drivers/net/igb/.e1000_api.o.cmd 2009-07-16 19:53:45.000000000 -0400
3894 +cmd_drivers/net/igb/e1000_api.o := gcc -m32 -Wp,-MD,drivers/net/igb/.e1000_api.o.d -nostdinc -isystem /usr/lib/gcc/i386-redhat-linux/4.1.2/include -D__KERNEL__ -Iinclude -include include/linux/autoconf.h -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Os -pipe -msoft-float -mregparm=3 -freg-struct-return -mpreferred-stack-boundary=2 -march=i686 -mtune=generic -ffreestanding -maccumulate-outgoing-args -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -Iinclude/asm-i386/mach-generic -Iinclude/asm-i386/mach-default -fno-omit-frame-pointer -fno-optimize-sibling-calls -g -fno-stack-protector -Wdeclaration-after-statement -Wno-pointer-sign -DMODULE -D"KBUILD_STR(s)=\#s" -D"KBUILD_BASENAME=KBUILD_STR(e1000_api)" -D"KBUILD_MODNAME=KBUILD_STR(igb)" -c -o drivers/net/igb/.tmp_e1000_api.o drivers/net/igb/e1000_api.c
3896 +deps_drivers/net/igb/e1000_api.o := \
3897 + drivers/net/igb/e1000_api.c \
3898 + drivers/net/igb/e1000_api.h \
3899 + drivers/net/igb/e1000_hw.h \
3900 + drivers/net/igb/e1000_osdep.h \
3901 + include/linux/pci.h \
3902 + $(wildcard include/config/pci/msi.h) \
3903 + $(wildcard include/config/pci.h) \
3904 + $(wildcard include/config/ht/irq.h) \
3905 + $(wildcard include/config/pci/domains.h) \
3906 + include/linux/pci_regs.h \
3907 + include/linux/mod_devicetable.h \
3908 + include/linux/types.h \
3909 + $(wildcard include/config/uid16.h) \
3910 + $(wildcard include/config/lbd.h) \
3911 + $(wildcard include/config/lsf.h) \
3912 + $(wildcard include/config/resources/64bit.h) \
3913 + include/linux/posix_types.h \
3914 + include/linux/stddef.h \
3915 + include/linux/compiler.h \
3916 + $(wildcard include/config/enable/must/check.h) \
3917 + include/linux/compiler-gcc4.h \
3918 + $(wildcard include/config/forced/inlining.h) \
3919 + include/linux/compiler-gcc.h \
3920 + include/asm/posix_types.h \
3921 + include/asm/types.h \
3922 + $(wildcard include/config/highmem64g.h) \
3923 + include/linux/ioport.h \
3924 + include/linux/list.h \
3925 + $(wildcard include/config/debug/list.h) \
3926 + include/linux/poison.h \
3927 + include/linux/prefetch.h \
3928 + include/asm/processor.h \
3929 + $(wildcard include/config/smp.h) \
3930 + $(wildcard include/config/x86/ht.h) \
3931 + $(wildcard include/config/paravirt.h) \
3932 + $(wildcard include/config/mk8.h) \
3933 + $(wildcard include/config/mk7.h) \
3934 + include/asm/vm86.h \
3935 + $(wildcard include/config/vm86.h) \
3936 + include/asm/ptrace.h \
3937 + include/asm/ptrace-abi.h \
3938 + include/asm/segment.h \
3939 + include/asm/math_emu.h \
3940 + include/asm/sigcontext.h \
3941 + include/asm/page.h \
3942 + $(wildcard include/config/x86/use/3dnow.h) \
3943 + $(wildcard include/config/x86/pae.h) \
3944 + $(wildcard include/config/hugetlb/page.h) \
3945 + $(wildcard include/config/highmem4g.h) \
3946 + $(wildcard include/config/page/offset.h) \
3947 + $(wildcard include/config/flatmem.h) \
3948 + include/asm-generic/pgtable-nopmd.h \
3949 + include/asm-generic/pgtable-nopud.h \
3950 + include/asm-generic/memory_model.h \
3951 + $(wildcard include/config/discontigmem.h) \
3952 + $(wildcard include/config/sparsemem.h) \
3953 + $(wildcard include/config/out/of/line/pfn/to/page.h) \
3954 + include/asm-generic/page.h \
3955 + include/asm/cpufeature.h \
3956 + include/linux/bitops.h \
3957 + include/asm/bitops.h \
3958 + include/asm/alternative.h \
3959 + include/asm-generic/bitops/sched.h \
3960 + include/asm-generic/bitops/hweight.h \
3961 + include/asm-generic/bitops/fls64.h \
3962 + include/asm-generic/bitops/ext2-non-atomic.h \
3963 + include/asm-generic/bitops/le.h \
3964 + include/asm/byteorder.h \
3965 + $(wildcard include/config/x86/bswap.h) \
3966 + include/linux/byteorder/little_endian.h \
3967 + include/linux/byteorder/swab.h \
3968 + include/linux/byteorder/generic.h \
3969 + include/asm-generic/bitops/minix.h \
3970 + include/asm/required-features.h \
3971 + $(wildcard include/config/x86/minimum/cpu.h) \
3972 + $(wildcard include/config/x86/cmov.h) \
3973 + $(wildcard include/config/x86/cmpxchg64.h) \
3974 + include/asm/msr.h \
3975 + include/asm/msr-index.h \
3976 + include/asm/errno.h \
3977 + include/asm-generic/errno.h \
3978 + include/asm-generic/errno-base.h \
3979 + include/linux/errno.h \
3980 + include/asm/system.h \
3981 + $(wildcard include/config/x86/oostore.h) \
3982 + include/linux/kernel.h \
3983 + $(wildcard include/config/preempt/voluntary.h) \
3984 + $(wildcard include/config/debug/spinlock/sleep.h) \
3985 + $(wildcard include/config/printk.h) \
3986 + $(wildcard include/config/numa.h) \
3987 + /usr/lib/gcc/i386-redhat-linux/4.1.2/include/stdarg.h \
3988 + include/linux/linkage.h \
3989 + include/asm/linkage.h \
3990 + $(wildcard include/config/x86/alignment/16.h) \
3991 + include/linux/log2.h \
3992 + $(wildcard include/config/arch/has/ilog2/u32.h) \
3993 + $(wildcard include/config/arch/has/ilog2/u64.h) \
3994 + include/asm/bug.h \
3995 + $(wildcard include/config/bug.h) \
3996 + $(wildcard include/config/debug/bugverbose.h) \
3997 + include/asm-generic/bug.h \
3998 + $(wildcard include/config/generic/bug.h) \
3999 + include/asm/cmpxchg.h \
4000 + $(wildcard include/config/x86/cmpxchg.h) \
4001 + include/linux/irqflags.h \
4002 + $(wildcard include/config/trace/irqflags.h) \
4003 + $(wildcard include/config/trace/irqflags/support.h) \
4004 + $(wildcard include/config/x86.h) \
4005 + include/asm/irqflags.h \
4006 + include/asm/processor-flags.h \
4007 + include/linux/cache.h \
4008 + include/asm/cache.h \
4009 + $(wildcard include/config/x86/l1/cache/shift.h) \
4010 + include/linux/threads.h \
4011 + $(wildcard include/config/nr/cpus.h) \
4012 + $(wildcard include/config/base/small.h) \
4013 + include/asm/percpu.h \
4014 + include/linux/cpumask.h \
4015 + $(wildcard include/config/hotplug/cpu.h) \
4016 + include/linux/bitmap.h \
4017 + include/linux/string.h \
4018 + include/asm/string.h \
4019 + include/linux/init.h \
4020 + $(wildcard include/config/modules.h) \
4021 + $(wildcard include/config/hotplug.h) \
4022 + $(wildcard include/config/memory/hotplug.h) \
4023 + $(wildcard include/config/acpi/hotplug/memory.h) \
4024 + include/asm/atomic.h \
4025 + $(wildcard include/config/m386.h) \
4026 + include/asm-generic/atomic.h \
4027 + include/linux/device.h \
4028 + $(wildcard include/config/debug/devres.h) \
4029 + include/linux/kobject.h \
4030 + include/linux/sysfs.h \
4031 + $(wildcard include/config/sysfs.h) \
4032 + include/linux/spinlock.h \
4033 + $(wildcard include/config/debug/spinlock.h) \
4034 + $(wildcard include/config/preempt.h) \
4035 + $(wildcard include/config/debug/lock/alloc.h) \
4036 + include/linux/preempt.h \
4037 + $(wildcard include/config/debug/preempt.h) \
4038 + include/linux/thread_info.h \
4039 + include/asm/thread_info.h \
4040 + $(wildcard include/config/4kstacks.h) \
4041 + $(wildcard include/config/debug/stack/usage.h) \
4042 + include/linux/stringify.h \
4043 + include/linux/bottom_half.h \
4044 + include/linux/spinlock_types.h \
4045 + include/linux/lockdep.h \
4046 + $(wildcard include/config/lockdep.h) \
4047 + $(wildcard include/config/generic/hardirqs.h) \
4048 + $(wildcard include/config/prove/locking.h) \
4049 + include/asm/spinlock_types.h \
4050 + include/asm/spinlock.h \
4051 + $(wildcard include/config/x86/ppro/fence.h) \
4052 + include/asm/rwlock.h \
4053 + include/linux/spinlock_api_smp.h \
4054 + include/linux/kref.h \
4055 + include/linux/wait.h \
4056 + include/asm/current.h \
4057 + include/linux/klist.h \
4058 + include/linux/completion.h \
4059 + include/linux/module.h \
4060 + $(wildcard include/config/modversions.h) \
4061 + $(wildcard include/config/unused/symbols.h) \
4062 + $(wildcard include/config/module/unload.h) \
4063 + $(wildcard include/config/kallsyms.h) \
4064 + include/linux/stat.h \
4065 + include/asm/stat.h \
4066 + include/linux/time.h \
4067 + include/linux/seqlock.h \
4068 + include/linux/vs_time.h \
4069 + $(wildcard include/config/vserver/vtime.h) \
4070 + include/linux/kmod.h \
4071 + $(wildcard include/config/kmod.h) \
4072 + include/linux/elf.h \
4073 + include/linux/auxvec.h \
4074 + include/asm/auxvec.h \
4075 + include/linux/elf-em.h \
4076 + include/asm/elf.h \
4077 + include/asm/user.h \
4078 + include/asm/desc.h \
4079 + include/asm/ldt.h \
4080 + include/linux/smp.h \
4081 + include/asm/smp.h \
4082 + $(wildcard include/config/x86/local/apic.h) \
4083 + $(wildcard include/config/x86/io/apic.h) \
4084 + include/asm/mpspec.h \
4085 + $(wildcard include/config/acpi.h) \
4086 + include/asm/mpspec_def.h \
4087 + include/asm-i386/mach-generic/mach_mpspec.h \
4088 + include/asm/apic.h \
4089 + $(wildcard include/config/x86/good/apic.h) \
4090 + include/linux/pm.h \
4091 + $(wildcard include/config/pm.h) \
4092 + include/linux/delay.h \
4093 + include/asm/delay.h \
4094 + include/asm/fixmap.h \
4095 + $(wildcard include/config/highmem.h) \
4096 + $(wildcard include/config/x86/visws/apic.h) \
4097 + $(wildcard include/config/x86/f00f/bug.h) \
4098 + $(wildcard include/config/x86/cyclone/timer.h) \
4099 + $(wildcard include/config/pci/mmconfig.h) \
4100 + include/asm/acpi.h \
4101 + $(wildcard include/config/acpi/sleep.h) \
4102 + include/acpi/pdc_intel.h \
4103 + include/asm/apicdef.h \
4104 + include/asm/kmap_types.h \
4105 + $(wildcard include/config/debug/highmem.h) \
4106 + include/asm/io_apic.h \
4107 + include/asm-i386/mach-generic/mach_apicdef.h \
4108 + include/asm/genapic.h \
4109 + include/linux/percpu.h \
4110 + include/linux/slab.h \
4111 + $(wildcard include/config/slab/debug.h) \
4112 + $(wildcard include/config/slab.h) \
4113 + $(wildcard include/config/slub.h) \
4114 + $(wildcard include/config/debug/slab.h) \
4115 + include/linux/gfp.h \
4116 + $(wildcard include/config/zone/dma.h) \
4117 + $(wildcard include/config/zone/dma32.h) \
4118 + include/linux/mmzone.h \
4119 + $(wildcard include/config/force/max/zoneorder.h) \
4120 + $(wildcard include/config/arch/populates/node/map.h) \
4121 + $(wildcard include/config/flat/node/mem/map.h) \
4122 + $(wildcard include/config/have/memory/present.h) \
4123 + $(wildcard include/config/need/node/memmap/size.h) \
4124 + $(wildcard include/config/need/multiple/nodes.h) \
4125 + $(wildcard include/config/have/arch/early/pfn/to/nid.h) \
4126 + $(wildcard include/config/sparsemem/extreme.h) \
4127 + $(wildcard include/config/nodes/span/other/nodes.h) \
4128 + $(wildcard include/config/holes/in/zone.h) \
4129 + include/linux/numa.h \
4130 + $(wildcard include/config/nodes/shift.h) \
4131 + include/linux/nodemask.h \
4132 + include/linux/memory_hotplug.h \
4133 + $(wildcard include/config/have/arch/nodedata/extension.h) \
4134 + include/linux/notifier.h \
4135 + include/linux/mutex.h \
4136 + $(wildcard include/config/debug/mutexes.h) \
4137 + $(wildcard include/config/chopstix.h) \
4138 + include/linux/rwsem.h \
4139 + $(wildcard include/config/rwsem/generic/spinlock.h) \
4140 + include/asm/rwsem.h \
4141 + include/linux/srcu.h \
4142 + include/linux/topology.h \
4143 + $(wildcard include/config/sched/smt.h) \
4144 + $(wildcard include/config/sched/mc.h) \
4145 + include/asm/topology.h \
4146 + include/asm-generic/topology.h \
4147 + include/linux/slab_def.h \
4148 + include/linux/kmalloc_sizes.h \
4149 + include/asm/mmu.h \
4150 + include/asm/semaphore.h \
4151 + include/linux/moduleparam.h \
4152 + include/asm/local.h \
4153 + include/asm/module.h \
4154 + $(wildcard include/config/m486.h) \
4155 + $(wildcard include/config/m586.h) \
4156 + $(wildcard include/config/m586tsc.h) \
4157 + $(wildcard include/config/m586mmx.h) \
4158 + $(wildcard include/config/mcore2.h) \
4159 + $(wildcard include/config/m686.h) \
4160 + $(wildcard include/config/mpentiumii.h) \
4161 + $(wildcard include/config/mpentiumiii.h) \
4162 + $(wildcard include/config/mpentiumm.h) \
4163 + $(wildcard include/config/mpentium4.h) \
4164 + $(wildcard include/config/mk6.h) \
4165 + $(wildcard include/config/x86/elan.h) \
4166 + $(wildcard include/config/mcrusoe.h) \
4167 + $(wildcard include/config/mefficeon.h) \
4168 + $(wildcard include/config/mwinchipc6.h) \
4169 + $(wildcard include/config/mwinchip2.h) \
4170 + $(wildcard include/config/mwinchip3d.h) \
4171 + $(wildcard include/config/mcyrixiii.h) \
4172 + $(wildcard include/config/mviac3/2.h) \
4173 + $(wildcard include/config/mviac7.h) \
4174 + $(wildcard include/config/mgeodegx1.h) \
4175 + $(wildcard include/config/mgeode/lx.h) \
4176 + include/asm/device.h \
4177 + include/linux/pci_ids.h \
4178 + include/linux/dmapool.h \
4179 + include/asm/io.h \
4180 + $(wildcard include/config/x86/numaq.h) \
4181 + include/asm-generic/iomap.h \
4182 + include/linux/vmalloc.h \
4183 + include/asm/scatterlist.h \
4184 + include/asm/pci.h \
4185 + include/linux/mm.h \
4186 + $(wildcard include/config/sysctl.h) \
4187 + $(wildcard include/config/mmu.h) \
4188 + $(wildcard include/config/stack/growsup.h) \
4189 + $(wildcard include/config/debug/vm.h) \
4190 + $(wildcard include/config/shmem.h) \
4191 + $(wildcard include/config/split/ptlock/cpus.h) \
4192 + $(wildcard include/config/ia64.h) \
4193 + $(wildcard include/config/proc/fs.h) \
4194 + $(wildcard include/config/debug/pagealloc.h) \
4195 + include/linux/capability.h \
4196 + include/linux/rbtree.h \
4197 + include/linux/prio_tree.h \
4198 + include/linux/fs.h \
4199 + $(wildcard include/config/dnotify.h) \
4200 + $(wildcard include/config/vserver/cowbl.h) \
4201 + $(wildcard include/config/quota.h) \
4202 + $(wildcard include/config/inotify.h) \
4203 + $(wildcard include/config/security.h) \
4204 + $(wildcard include/config/epoll.h) \
4205 + $(wildcard include/config/auditsyscall.h) \
4206 + $(wildcard include/config/block.h) \
4207 + $(wildcard include/config/fs/xip.h) \
4208 + $(wildcard include/config/migration.h) \
4209 + include/linux/limits.h \
4210 + include/linux/ioctl.h \
4211 + include/asm/ioctl.h \
4212 + include/asm-generic/ioctl.h \
4213 + include/linux/kdev_t.h \
4214 + include/linux/dcache.h \
4215 + $(wildcard include/config/profiling.h) \
4216 + include/linux/rcupdate.h \
4217 + include/linux/namei.h \
4218 + include/linux/radix-tree.h \
4219 + include/linux/pid.h \
4220 + include/linux/quota.h \
4221 + include/linux/dqblk_xfs.h \
4222 + include/linux/dqblk_v1.h \
4223 + include/linux/dqblk_v2.h \
4224 + include/linux/nfs_fs_i.h \
4225 + include/linux/nfs.h \
4226 + include/linux/sunrpc/msg_prot.h \
4227 + include/linux/fcntl.h \
4228 + include/asm/fcntl.h \
4229 + include/asm-generic/fcntl.h \
4230 + $(wildcard include/config/64bit.h) \
4231 + include/linux/err.h \
4232 + include/linux/debug_locks.h \
4233 + $(wildcard include/config/debug/locking/api/selftests.h) \
4234 + include/linux/backing-dev.h \
4235 + include/linux/mm_types.h \
4236 + include/asm/pgtable.h \
4237 + $(wildcard include/config/highpte.h) \
4238 + include/asm/paravirt.h \
4239 + include/asm/pgtable-2level-defs.h \
4240 + include/asm/pgtable-2level.h \
4241 + include/asm-generic/pgtable.h \
4242 + include/linux/page-flags.h \
4243 + $(wildcard include/config/s390.h) \
4244 + $(wildcard include/config/swap.h) \
4245 + include/linux/vmstat.h \
4246 + $(wildcard include/config/vm/event/counters.h) \
4247 + include/asm-generic/pci-dma-compat.h \
4248 + include/linux/dma-mapping.h \
4249 + include/asm/dma-mapping.h \
4250 + include/asm-generic/pci.h \
4251 + include/linux/interrupt.h \
4252 + $(wildcard include/config/high/res/timers.h) \
4253 + $(wildcard include/config/generic/irq/probe.h) \
4254 + include/linux/irqreturn.h \
4255 + include/linux/hardirq.h \
4256 + $(wildcard include/config/preempt/bkl.h) \
4257 + $(wildcard include/config/virt/cpu/accounting.h) \
4258 + include/linux/smp_lock.h \
4259 + $(wildcard include/config/lock/kernel.h) \
4260 + include/linux/sched.h \
4261 + $(wildcard include/config/no/hz.h) \
4262 + $(wildcard include/config/detect/softlockup.h) \
4263 + $(wildcard include/config/keys.h) \
4264 + $(wildcard include/config/bsd/process/acct.h) \
4265 + $(wildcard include/config/taskstats.h) \
4266 + $(wildcard include/config/inotify/user.h) \
4267 + $(wildcard include/config/schedstats.h) \
4268 + $(wildcard include/config/task/delay/acct.h) \
4269 + $(wildcard include/config/blk/dev/io/trace.h) \
4270 + $(wildcard include/config/cc/stackprotector.h) \
4271 + $(wildcard include/config/sysvipc.h) \
4272 + $(wildcard include/config/rt/mutexes.h) \
4273 + $(wildcard include/config/task/xacct.h) \
4274 + $(wildcard include/config/cpusets.h) \
4275 + $(wildcard include/config/compat.h) \
4276 + $(wildcard include/config/fault/injection.h) \
4277 + include/asm/param.h \
4278 + $(wildcard include/config/hz.h) \
4279 + include/linux/timex.h \
4280 + $(wildcard include/config/time/interpolation.h) \
4281 + include/asm/timex.h \
4282 + include/asm/tsc.h \
4283 + $(wildcard include/config/x86/tsc.h) \
4284 + $(wildcard include/config/x86/generic.h) \
4285 + include/linux/jiffies.h \
4286 + include/linux/calc64.h \
4287 + include/asm/div64.h \
4288 + include/asm/cputime.h \
4289 + include/asm-generic/cputime.h \
4290 + include/linux/sem.h \
4291 + include/linux/ipc.h \
4292 + $(wildcard include/config/ipc/ns.h) \
4293 + include/asm/ipcbuf.h \
4294 + include/asm/sembuf.h \
4295 + include/linux/signal.h \
4296 + include/asm/signal.h \
4297 + include/asm-generic/signal.h \
4298 + include/asm/siginfo.h \
4299 + include/asm-generic/siginfo.h \
4300 + include/linux/securebits.h \
4301 + include/linux/fs_struct.h \
4302 + include/linux/seccomp.h \
4303 + $(wildcard include/config/seccomp.h) \
4304 + include/linux/futex.h \
4305 + $(wildcard include/config/futex.h) \
4306 + include/linux/rtmutex.h \
4307 + $(wildcard include/config/debug/rt/mutexes.h) \
4308 + include/linux/plist.h \
4309 + $(wildcard include/config/debug/pi/list.h) \
4310 + include/linux/param.h \
4311 + include/linux/resource.h \
4312 + include/asm/resource.h \
4313 + include/asm-generic/resource.h \
4314 + include/linux/timer.h \
4315 + $(wildcard include/config/timer/stats.h) \
4316 + include/linux/ktime.h \
4317 + $(wildcard include/config/ktime/scalar.h) \
4318 + include/linux/hrtimer.h \
4319 + include/linux/task_io_accounting.h \
4320 + $(wildcard include/config/task/io/accounting.h) \
4321 + include/linux/aio.h \
4322 + include/linux/workqueue.h \
4323 + include/linux/aio_abi.h \
4324 + include/linux/uio.h \
4325 + include/asm/hardirq.h \
4326 + include/linux/irq.h \
4327 + $(wildcard include/config/irq/per/cpu.h) \
4328 + $(wildcard include/config/irq/release/method.h) \
4329 + $(wildcard include/config/generic/pending/irq.h) \
4330 + $(wildcard include/config/irqbalance.h) \
4331 + $(wildcard include/config/auto/irq/affinity.h) \
4332 + $(wildcard include/config/generic/hardirqs/no//do/irq.h) \
4333 + include/asm/irq.h \
4334 + include/asm-i386/mach-default/irq_vectors.h \
4335 + include/asm-i386/mach-default/irq_vectors_limits.h \
4336 + include/asm/irq_regs.h \
4337 + include/asm/hw_irq.h \
4338 + include/linux/profile.h \
4339 + include/asm/sections.h \
4340 + include/asm-generic/sections.h \
4341 + include/linux/irq_cpustat.h \
4342 + include/linux/if_ether.h \
4343 + include/linux/skbuff.h \
4344 + $(wildcard include/config/nf/conntrack.h) \
4345 + $(wildcard include/config/bridge/netfilter.h) \
4346 + $(wildcard include/config/vlan/8021q.h) \
4347 + $(wildcard include/config/net/sched.h) \
4348 + $(wildcard include/config/net/cls/act.h) \
4349 + $(wildcard include/config/net/dma.h) \
4350 + $(wildcard include/config/network/secmark.h) \
4351 + include/linux/net.h \
4352 + include/asm/socket.h \
4353 + include/asm/sockios.h \
4354 + include/linux/random.h \
4355 + include/linux/sysctl.h \
4356 + $(wildcard include/config/icmp/ipod.h) \
4357 + $(wildcard include/config/web100/net100.h) \
4358 + $(wildcard include/config/web100/stats.h) \
4359 + include/linux/textsearch.h \
4360 + include/net/checksum.h \
4361 + include/asm/uaccess.h \
4362 + $(wildcard include/config/x86/intel/usercopy.h) \
4363 + $(wildcard include/config/x86/wp/works/ok.h) \
4364 + include/asm/checksum.h \
4365 + include/linux/in6.h \
4366 + include/linux/dmaengine.h \
4367 + $(wildcard include/config/dma/engine.h) \
4368 + drivers/net/igb/kcompat.h \
4369 + $(wildcard include/config/e1000/napi.h) \
4370 + $(wildcard include/config/e1000e/napi.h) \
4371 + $(wildcard include/config/ixgb/napi.h) \
4372 + $(wildcard include/config/e1000/disable/packet/split.h) \
4373 + $(wildcard include/config/igb/disable/packet/split.h) \
4374 + $(wildcard include/config/net/poll/controller.h) \
4375 + $(wildcard include/config/space/len.h) \
4376 + $(wildcard include/config/netpoll.h) \
4377 + $(wildcard include/config/netdevices/multiqueue.h) \
4378 + include/linux/version.h \
4379 + include/linux/netdevice.h \
4380 + $(wildcard include/config/ax25.h) \
4381 + $(wildcard include/config/tr.h) \
4382 + $(wildcard include/config/net/ipip.h) \
4383 + $(wildcard include/config/net/ipgre.h) \
4384 + $(wildcard include/config/ipv6/sit.h) \
4385 + $(wildcard include/config/ipv6/tunnel.h) \
4386 + $(wildcard include/config/wireless/ext.h) \
4387 + $(wildcard include/config/netpoll/trap.h) \
4388 + include/linux/if.h \
4389 + include/linux/socket.h \
4390 + include/linux/sockios.h \
4391 + include/linux/hdlc/ioctl.h \
4392 + include/linux/if_packet.h \
4393 + include/linux/etherdevice.h \
4394 + include/linux/in.h \
4395 + include/linux/ip.h \
4396 + include/linux/udp.h \
4397 + include/net/inet_sock.h \
4398 + $(wildcard include/config/ipv6.h) \
4399 + include/linux/jhash.h \
4400 + include/net/flow.h \
4401 + $(wildcard include/config/ipv6/mip6.h) \
4402 + include/net/sock.h \
4403 + $(wildcard include/config/security/network.h) \
4404 + include/linux/security.h \
4405 + $(wildcard include/config/security/network/xfrm.h) \
4406 + include/linux/binfmts.h \
4407 + include/linux/shm.h \
4408 + include/asm/shmparam.h \
4409 + include/asm/shmbuf.h \
4410 + include/linux/msg.h \
4411 + include/asm/msgbuf.h \
4412 + include/linux/key.h \
4413 + include/linux/xfrm.h \
4414 + include/linux/filter.h \
4415 + include/net/dst.h \
4416 + $(wildcard include/config/net/cls/route.h) \
4417 + $(wildcard include/config/xfrm.h) \
4418 + include/linux/rtnetlink.h \
4419 + include/linux/netlink.h \
4420 + include/linux/if_link.h \
4421 + include/linux/if_addr.h \
4422 + include/linux/neighbour.h \
4423 + include/net/neighbour.h \
4424 + include/linux/seq_file.h \
4425 + include/net/rtnetlink.h \
4426 + include/net/netlink.h \
4427 + include/net/request_sock.h \
4428 + include/linux/mii.h \
4429 + include/linux/latency.h \
4430 + drivers/net/igb/e1000_regs.h \
4431 + drivers/net/igb/e1000_defines.h \
4432 + $(wildcard include/config/res.h) \
4433 + $(wildcard include/config/fault.h) \
4434 + drivers/net/igb/e1000_mac.h \
4435 + drivers/net/igb/e1000_phy.h \
4436 + drivers/net/igb/e1000_nvm.h \
4437 + drivers/net/igb/e1000_manage.h \
4438 + drivers/net/igb/e1000_82575.h \
4440 +drivers/net/igb/e1000_api.o: $(deps_drivers/net/igb/e1000_api.o)
4442 +$(deps_drivers/net/igb/e1000_api.o):
4443 diff -Nru vanilla/drivers/net/igb/e1000_defines.h linux-i686-2.6.22/drivers/net/igb/e1000_defines.h
4444 --- vanilla/drivers/net/igb/e1000_defines.h 1969-12-31 19:00:00.000000000 -0500
4445 +++ linux-i686-2.6.22/drivers/net/igb/e1000_defines.h 2009-07-16 19:25:22.000000000 -0400
4447 +/*******************************************************************************
4449 + Intel(R) Gigabit Ethernet Linux driver
4450 + Copyright(c) 2007-2008 Intel Corporation.
4452 + This program is free software; you can redistribute it and/or modify it
4453 + under the terms and conditions of the GNU General Public License,
4454 + version 2, as published by the Free Software Foundation.
4456 + This program is distributed in the hope it will be useful, but WITHOUT
4457 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
4458 + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
4461 + You should have received a copy of the GNU General Public License along with
4462 + this program; if not, write to the Free Software Foundation, Inc.,
4463 + 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
4465 + The full GNU General Public License is included in this distribution in
4466 + the file called "COPYING".
4468 + Contact Information:
4469 + e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
4470 + Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
4472 +*******************************************************************************/
4474 +#ifndef _E1000_DEFINES_H_
4475 +#define _E1000_DEFINES_H_
4477 +/* Number of Transmit and Receive Descriptors must be a multiple of 8 */
4478 +#define REQ_TX_DESCRIPTOR_MULTIPLE 8
4479 +#define REQ_RX_DESCRIPTOR_MULTIPLE 8
4481 +/* Definitions for power management and wakeup registers */
4482 +/* Wake Up Control */
4483 +#define E1000_WUC_APME 0x00000001 /* APM Enable */
4484 +#define E1000_WUC_PME_EN 0x00000002 /* PME Enable */
4485 +#define E1000_WUC_PME_STATUS 0x00000004 /* PME Status */
4486 +#define E1000_WUC_APMPME 0x00000008 /* Assert PME on APM Wakeup */
4487 +#define E1000_WUC_LSCWE 0x00000010 /* Link Status wake up enable */
4488 +#define E1000_WUC_LSCWO 0x00000020 /* Link Status wake up override */
4489 +#define E1000_WUC_SPM 0x80000000 /* Enable SPM */
4490 +#define E1000_WUC_PHY_WAKE 0x00000100 /* if PHY supports wakeup */
4492 +/* Wake Up Filter Control */
4493 +#define E1000_WUFC_LNKC 0x00000001 /* Link Status Change Wakeup Enable */
4494 +#define E1000_WUFC_MAG 0x00000002 /* Magic Packet Wakeup Enable */
4495 +#define E1000_WUFC_EX 0x00000004 /* Directed Exact Wakeup Enable */
4496 +#define E1000_WUFC_MC 0x00000008 /* Directed Multicast Wakeup Enable */
4497 +#define E1000_WUFC_BC 0x00000010 /* Broadcast Wakeup Enable */
4498 +#define E1000_WUFC_ARP 0x00000020 /* ARP Request Packet Wakeup Enable */
4499 +#define E1000_WUFC_IPV4 0x00000040 /* Directed IPv4 Packet Wakeup Enable */
4500 +#define E1000_WUFC_IPV6 0x00000080 /* Directed IPv6 Packet Wakeup Enable */
4501 +#define E1000_WUFC_IGNORE_TCO 0x00008000 /* Ignore WakeOn TCO packets */
4502 +#define E1000_WUFC_FLX0 0x00010000 /* Flexible Filter 0 Enable */
4503 +#define E1000_WUFC_FLX1 0x00020000 /* Flexible Filter 1 Enable */
4504 +#define E1000_WUFC_FLX2 0x00040000 /* Flexible Filter 2 Enable */
4505 +#define E1000_WUFC_FLX3 0x00080000 /* Flexible Filter 3 Enable */
4506 +#define E1000_WUFC_FLX4 0x00100000 /* Flexible Filter 4 Enable */
4507 +#define E1000_WUFC_FLX5 0x00200000 /* Flexible Filter 5 Enable */
4508 +#define E1000_WUFC_ALL_FILTERS 0x000F00FF /* Mask for all wakeup filters */
4509 +#define E1000_WUFC_FLX_OFFSET 16 /* Offset to the Flexible Filters bits */
4510 +#define E1000_WUFC_FLX_FILTERS 0x000F0000 /* Mask for the 4 flexible filters */
4512 + * For 82576 to utilize Extended filter masks in addition to
4513 + * existing (filter) masks
4515 +#define E1000_WUFC_EXT_FLX_FILTERS 0x00300000 /* Ext. FLX filter mask */
4517 +/* Wake Up Status */
4518 +#define E1000_WUS_LNKC E1000_WUFC_LNKC
4519 +#define E1000_WUS_MAG E1000_WUFC_MAG
4520 +#define E1000_WUS_EX E1000_WUFC_EX
4521 +#define E1000_WUS_MC E1000_WUFC_MC
4522 +#define E1000_WUS_BC E1000_WUFC_BC
4523 +#define E1000_WUS_ARP E1000_WUFC_ARP
4524 +#define E1000_WUS_IPV4 E1000_WUFC_IPV4
4525 +#define E1000_WUS_IPV6 E1000_WUFC_IPV6
4526 +#define E1000_WUS_FLX0 E1000_WUFC_FLX0
4527 +#define E1000_WUS_FLX1 E1000_WUFC_FLX1
4528 +#define E1000_WUS_FLX2 E1000_WUFC_FLX2
4529 +#define E1000_WUS_FLX3 E1000_WUFC_FLX3
4530 +#define E1000_WUS_FLX_FILTERS E1000_WUFC_FLX_FILTERS
4532 +/* Wake Up Packet Length */
4533 +#define E1000_WUPL_LENGTH_MASK 0x0FFF /* Only the lower 12 bits are valid */
4535 +/* Four Flexible Filters are supported */
4536 +#define E1000_FLEXIBLE_FILTER_COUNT_MAX 4
4537 +/* Two Extended Flexible Filters are supported (82576) */
4538 +#define E1000_EXT_FLEXIBLE_FILTER_COUNT_MAX 2
4539 +#define E1000_FHFT_LENGTH_OFFSET 0xFC /* Length byte in FHFT */
4540 +#define E1000_FHFT_LENGTH_MASK 0x0FF /* Length in lower byte */
4542 +/* Each Flexible Filter is at most 128 (0x80) bytes in length */
4543 +#define E1000_FLEXIBLE_FILTER_SIZE_MAX 128
4545 +#define E1000_FFLT_SIZE E1000_FLEXIBLE_FILTER_COUNT_MAX
4546 +#define E1000_FFMT_SIZE E1000_FLEXIBLE_FILTER_SIZE_MAX
4547 +#define E1000_FFVT_SIZE E1000_FLEXIBLE_FILTER_SIZE_MAX
4549 +/* Extended Device Control */
4550 +#define E1000_CTRL_EXT_GPI0_EN 0x00000001 /* Maps SDP4 to GPI0 */
4551 +#define E1000_CTRL_EXT_GPI1_EN 0x00000002 /* Maps SDP5 to GPI1 */
4552 +#define E1000_CTRL_EXT_PHYINT_EN E1000_CTRL_EXT_GPI1_EN
4553 +#define E1000_CTRL_EXT_GPI2_EN 0x00000004 /* Maps SDP6 to GPI2 */
4554 +#define E1000_CTRL_EXT_GPI3_EN 0x00000008 /* Maps SDP7 to GPI3 */
4555 +/* Reserved (bits 4,5) in >= 82575 */
4556 +#define E1000_CTRL_EXT_SDP4_DATA 0x00000010 /* Value of SW Definable Pin 4 */
4557 +#define E1000_CTRL_EXT_SDP5_DATA 0x00000020 /* Value of SW Definable Pin 5 */
4558 +#define E1000_CTRL_EXT_PHY_INT E1000_CTRL_EXT_SDP5_DATA
4559 +#define E1000_CTRL_EXT_SDP6_DATA 0x00000040 /* Value of SW Definable Pin 6 */
4560 +#define E1000_CTRL_EXT_SDP7_DATA 0x00000080 /* Value of SW Definable Pin 7 */
4561 +/* SDP 4/5 (bits 8,9) are reserved in >= 82575 */
4562 +#define E1000_CTRL_EXT_SDP4_DIR 0x00000100 /* Direction of SDP4 0=in 1=out */
4563 +#define E1000_CTRL_EXT_SDP5_DIR 0x00000200 /* Direction of SDP5 0=in 1=out */
4564 +#define E1000_CTRL_EXT_SDP6_DIR 0x00000400 /* Direction of SDP6 0=in 1=out */
4565 +#define E1000_CTRL_EXT_SDP7_DIR 0x00000800 /* Direction of SDP7 0=in 1=out */
4566 +#define E1000_CTRL_EXT_ASDCHK 0x00001000 /* Initiate an ASD sequence */
4567 +#define E1000_CTRL_EXT_EE_RST 0x00002000 /* Reinitialize from EEPROM */
4568 +#define E1000_CTRL_EXT_IPS 0x00004000 /* Invert Power State */
4569 +/* Physical Func Reset Done Indication */
4570 +#define E1000_CTRL_EXT_PFRSTD 0x00004000
4571 +#define E1000_CTRL_EXT_SPD_BYPS 0x00008000 /* Speed Select Bypass */
4572 +#define E1000_CTRL_EXT_RO_DIS 0x00020000 /* Relaxed Ordering disable */
4573 +#define E1000_CTRL_EXT_LINK_MODE_MASK 0x00C00000
4574 +#define E1000_CTRL_EXT_LINK_MODE_GMII 0x00000000
4575 +#define E1000_CTRL_EXT_LINK_MODE_TBI 0x00C00000
4576 +#define E1000_CTRL_EXT_LINK_MODE_KMRN 0x00000000
4577 +#define E1000_CTRL_EXT_LINK_MODE_PCIE_SERDES 0x00C00000
4578 +#define E1000_CTRL_EXT_LINK_MODE_PCIX_SERDES 0x00800000
4579 +#define E1000_CTRL_EXT_LINK_MODE_SGMII 0x00800000
4580 +#define E1000_CTRL_EXT_EIAME 0x01000000
4581 +#define E1000_CTRL_EXT_IRCA 0x00000001
4582 +#define E1000_CTRL_EXT_WR_WMARK_MASK 0x03000000
4583 +#define E1000_CTRL_EXT_WR_WMARK_256 0x00000000
4584 +#define E1000_CTRL_EXT_WR_WMARK_320 0x01000000
4585 +#define E1000_CTRL_EXT_WR_WMARK_384 0x02000000
4586 +#define E1000_CTRL_EXT_WR_WMARK_448 0x03000000
4587 +#define E1000_CTRL_EXT_CANC 0x04000000 /* Interrupt delay cancellation */
4588 +#define E1000_CTRL_EXT_DRV_LOAD 0x10000000 /* Driver loaded bit for FW */
4589 +/* IAME enable bit (27) was removed in >= 82575 */
4590 +#define E1000_CTRL_EXT_IAME 0x08000000 /* Interrupt acknowledge Auto-mask */
4591 +#define E1000_CTRL_EXT_INT_TIMER_CLR 0x20000000 /* Clear Interrupt timers after IMS clear */
4592 +#define E1000_CRTL_EXT_PB_PAREN 0x01000000 /* packet buffer parity error detection enabled */
4593 +#define E1000_CTRL_EXT_DF_PAREN 0x02000000 /* descriptor FIFO parity error detection enable */
4594 +#define E1000_CTRL_EXT_GHOST_PAREN 0x40000000
4595 +#define E1000_CTRL_EXT_PBA_CLR 0x80000000 /* PBA Clear */
4596 +#define E1000_I2CCMD_REG_ADDR_SHIFT 16
4597 +#define E1000_I2CCMD_REG_ADDR 0x00FF0000
4598 +#define E1000_I2CCMD_PHY_ADDR_SHIFT 24
4599 +#define E1000_I2CCMD_PHY_ADDR 0x07000000
4600 +#define E1000_I2CCMD_OPCODE_READ 0x08000000
4601 +#define E1000_I2CCMD_OPCODE_WRITE 0x00000000
4602 +#define E1000_I2CCMD_RESET 0x10000000
4603 +#define E1000_I2CCMD_READY 0x20000000
4604 +#define E1000_I2CCMD_INTERRUPT_ENA 0x40000000
4605 +#define E1000_I2CCMD_ERROR 0x80000000
4606 +#define E1000_MAX_SGMII_PHY_REG_ADDR 255
4607 +#define E1000_I2CCMD_PHY_TIMEOUT 200
4608 +#define E1000_IVAR_VALID 0x80
4609 +#define E1000_GPIE_NSICR 0x00000001
4610 +#define E1000_GPIE_MSIX_MODE 0x00000010
4611 +#define E1000_GPIE_EIAME 0x40000000
4612 +#define E1000_GPIE_PBA 0x80000000
4614 +/* Receive Descriptor bit definitions */
4615 +#define E1000_RXD_STAT_DD 0x01 /* Descriptor Done */
4616 +#define E1000_RXD_STAT_EOP 0x02 /* End of Packet */
4617 +#define E1000_RXD_STAT_IXSM 0x04 /* Ignore checksum */
4618 +#define E1000_RXD_STAT_VP 0x08 /* IEEE VLAN Packet */
4619 +#define E1000_RXD_STAT_UDPCS 0x10 /* UDP xsum calculated */
4620 +#define E1000_RXD_STAT_TCPCS 0x20 /* TCP xsum calculated */
4621 +#define E1000_RXD_STAT_IPCS 0x40 /* IP xsum calculated */
4622 +#define E1000_RXD_STAT_PIF 0x80 /* passed in-exact filter */
4623 +#define E1000_RXD_STAT_CRCV 0x100 /* Speculative CRC Valid */
4624 +#define E1000_RXD_STAT_IPIDV 0x200 /* IP identification valid */
4625 +#define E1000_RXD_STAT_UDPV 0x400 /* Valid UDP checksum */
4626 +#define E1000_RXD_STAT_DYNINT 0x800 /* Pkt caused INT via DYNINT */
4627 +#define E1000_RXD_STAT_ACK 0x8000 /* ACK Packet indication */
4628 +#define E1000_RXD_ERR_CE 0x01 /* CRC Error */
4629 +#define E1000_RXD_ERR_SE 0x02 /* Symbol Error */
4630 +#define E1000_RXD_ERR_SEQ 0x04 /* Sequence Error */
4631 +#define E1000_RXD_ERR_CXE 0x10 /* Carrier Extension Error */
4632 +#define E1000_RXD_ERR_TCPE 0x20 /* TCP/UDP Checksum Error */
4633 +#define E1000_RXD_ERR_IPE 0x40 /* IP Checksum Error */
4634 +#define E1000_RXD_ERR_RXE 0x80 /* Rx Data Error */
4635 +#define E1000_RXD_SPC_VLAN_MASK 0x0FFF /* VLAN ID is in lower 12 bits */
4636 +#define E1000_RXD_SPC_PRI_MASK 0xE000 /* Priority is in upper 3 bits */
4637 +#define E1000_RXD_SPC_PRI_SHIFT 13
4638 +#define E1000_RXD_SPC_CFI_MASK 0x1000 /* CFI is bit 12 */
4639 +#define E1000_RXD_SPC_CFI_SHIFT 12
4641 +#define E1000_RXDEXT_STATERR_CE 0x01000000
4642 +#define E1000_RXDEXT_STATERR_SE 0x02000000
4643 +#define E1000_RXDEXT_STATERR_SEQ 0x04000000
4644 +#define E1000_RXDEXT_STATERR_CXE 0x10000000
4645 +#define E1000_RXDEXT_STATERR_TCPE 0x20000000
4646 +#define E1000_RXDEXT_STATERR_IPE 0x40000000
4647 +#define E1000_RXDEXT_STATERR_RXE 0x80000000
4649 +/* mask to determine if packets should be dropped due to frame errors */
4650 +#define E1000_RXD_ERR_FRAME_ERR_MASK ( \
4651 + E1000_RXD_ERR_CE | \
4652 + E1000_RXD_ERR_SE | \
4653 + E1000_RXD_ERR_SEQ | \
4654 + E1000_RXD_ERR_CXE | \
4655 + E1000_RXD_ERR_RXE)
4657 +/* Same mask, but for extended and packet split descriptors */
4658 +#define E1000_RXDEXT_ERR_FRAME_ERR_MASK ( \
4659 + E1000_RXDEXT_STATERR_CE | \
4660 + E1000_RXDEXT_STATERR_SE | \
4661 + E1000_RXDEXT_STATERR_SEQ | \
4662 + E1000_RXDEXT_STATERR_CXE | \
4663 + E1000_RXDEXT_STATERR_RXE)
4665 +#define E1000_MRQC_ENABLE_MASK 0x00000007
4666 +#define E1000_MRQC_ENABLE_RSS_2Q 0x00000001
4667 +#define E1000_MRQC_ENABLE_RSS_INT 0x00000004
4668 +#define E1000_MRQC_RSS_FIELD_MASK 0xFFFF0000
4669 +#define E1000_MRQC_RSS_FIELD_IPV4_TCP 0x00010000
4670 +#define E1000_MRQC_RSS_FIELD_IPV4 0x00020000
4671 +#define E1000_MRQC_RSS_FIELD_IPV6_TCP_EX 0x00040000
4672 +#define E1000_MRQC_RSS_FIELD_IPV6_EX 0x00080000
4673 +#define E1000_MRQC_RSS_FIELD_IPV6 0x00100000
4674 +#define E1000_MRQC_RSS_FIELD_IPV6_TCP 0x00200000
4676 +#define E1000_RXDPS_HDRSTAT_HDRSP 0x00008000
4677 +#define E1000_RXDPS_HDRSTAT_HDRLEN_MASK 0x000003FF
4679 +/* Management Control */
4680 +#define E1000_MANC_SMBUS_EN 0x00000001 /* SMBus Enabled - RO */
4681 +#define E1000_MANC_ASF_EN 0x00000002 /* ASF Enabled - RO */
4682 +#define E1000_MANC_R_ON_FORCE 0x00000004 /* Reset on Force TCO - RO */
4683 +#define E1000_MANC_RMCP_EN 0x00000100 /* Enable RCMP 026Fh Filtering */
4684 +#define E1000_MANC_0298_EN 0x00000200 /* Enable RCMP 0298h Filtering */
4685 +#define E1000_MANC_IPV4_EN 0x00000400 /* Enable IPv4 */
4686 +#define E1000_MANC_IPV6_EN 0x00000800 /* Enable IPv6 */
4687 +#define E1000_MANC_SNAP_EN 0x00001000 /* Accept LLC/SNAP */
4688 +#define E1000_MANC_ARP_EN 0x00002000 /* Enable ARP Request Filtering */
4689 +/* Enable Neighbor Discovery Filtering */
4690 +#define E1000_MANC_NEIGHBOR_EN 0x00004000
4691 +#define E1000_MANC_ARP_RES_EN 0x00008000 /* Enable ARP response Filtering */
4692 +#define E1000_MANC_TCO_RESET 0x00010000 /* TCO Reset Occurred */
4693 +#define E1000_MANC_RCV_TCO_EN 0x00020000 /* Receive TCO Packets Enabled */
4694 +#define E1000_MANC_REPORT_STATUS 0x00040000 /* Status Reporting Enabled */
4695 +#define E1000_MANC_RCV_ALL 0x00080000 /* Receive All Enabled */
4696 +#define E1000_MANC_BLK_PHY_RST_ON_IDE 0x00040000 /* Block phy resets */
4697 +/* Enable MAC address filtering */
4698 +#define E1000_MANC_EN_MAC_ADDR_FILTER 0x00100000
4699 +/* Enable MNG packets to host memory */
4700 +#define E1000_MANC_EN_MNG2HOST 0x00200000
4701 +/* Enable IP address filtering */
4702 +#define E1000_MANC_EN_IP_ADDR_FILTER 0x00400000
4703 +#define E1000_MANC_EN_XSUM_FILTER 0x00800000 /* Enable checksum filtering */
4704 +#define E1000_MANC_BR_EN 0x01000000 /* Enable broadcast filtering */
4705 +#define E1000_MANC_SMB_REQ 0x01000000 /* SMBus Request */
4706 +#define E1000_MANC_SMB_GNT 0x02000000 /* SMBus Grant */
4707 +#define E1000_MANC_SMB_CLK_IN 0x04000000 /* SMBus Clock In */
4708 +#define E1000_MANC_SMB_DATA_IN 0x08000000 /* SMBus Data In */
4709 +#define E1000_MANC_SMB_DATA_OUT 0x10000000 /* SMBus Data Out */
4710 +#define E1000_MANC_SMB_CLK_OUT 0x20000000 /* SMBus Clock Out */
4712 +#define E1000_MANC_SMB_DATA_OUT_SHIFT 28 /* SMBus Data Out Shift */
4713 +#define E1000_MANC_SMB_CLK_OUT_SHIFT 29 /* SMBus Clock Out Shift */
4715 +/* Receive Control */
4716 +#define E1000_RCTL_RST 0x00000001 /* Software reset */
4717 +#define E1000_RCTL_EN 0x00000002 /* enable */
4718 +#define E1000_RCTL_SBP 0x00000004 /* store bad packet */
4719 +#define E1000_RCTL_UPE 0x00000008 /* unicast promiscuous enable */
4720 +#define E1000_RCTL_MPE 0x00000010 /* multicast promiscuous enab */
4721 +#define E1000_RCTL_LPE 0x00000020 /* long packet enable */
4722 +#define E1000_RCTL_LBM_NO 0x00000000 /* no loopback mode */
4723 +#define E1000_RCTL_LBM_MAC 0x00000040 /* MAC loopback mode */
4724 +#define E1000_RCTL_LBM_SLP 0x00000080 /* serial link loopback mode */
4725 +#define E1000_RCTL_LBM_TCVR 0x000000C0 /* tcvr loopback mode */
4726 +#define E1000_RCTL_DTYP_MASK 0x00000C00 /* Descriptor type mask */
4727 +#define E1000_RCTL_DTYP_PS 0x00000400 /* Packet Split descriptor */
4728 +#define E1000_RCTL_RDMTS_HALF 0x00000000 /* rx desc min threshold size */
4729 +#define E1000_RCTL_RDMTS_QUAT 0x00000100 /* rx desc min threshold size */
4730 +#define E1000_RCTL_RDMTS_EIGTH 0x00000200 /* rx desc min threshold size */
4731 +#define E1000_RCTL_MO_SHIFT 12 /* multicast offset shift */
4732 +#define E1000_RCTL_MO_0 0x00000000 /* multicast offset 11:0 */
4733 +#define E1000_RCTL_MO_1 0x00001000 /* multicast offset 12:1 */
4734 +#define E1000_RCTL_MO_2 0x00002000 /* multicast offset 13:2 */
4735 +#define E1000_RCTL_MO_3 0x00003000 /* multicast offset 15:4 */
4736 +#define E1000_RCTL_MDR 0x00004000 /* multicast desc ring 0 */
4737 +#define E1000_RCTL_BAM 0x00008000 /* broadcast enable */
4738 +/* these buffer sizes are valid if E1000_RCTL_BSEX is 0 */
4739 +#define E1000_RCTL_SZ_2048 0x00000000 /* rx buffer size 2048 */
4740 +#define E1000_RCTL_SZ_1024 0x00010000 /* rx buffer size 1024 */
4741 +#define E1000_RCTL_SZ_512 0x00020000 /* rx buffer size 512 */
4742 +#define E1000_RCTL_SZ_256 0x00030000 /* rx buffer size 256 */
4743 +/* these buffer sizes are valid if E1000_RCTL_BSEX is 1 */
4744 +#define E1000_RCTL_SZ_16384 0x00010000 /* rx buffer size 16384 */
4745 +#define E1000_RCTL_SZ_8192 0x00020000 /* rx buffer size 8192 */
4746 +#define E1000_RCTL_SZ_4096 0x00030000 /* rx buffer size 4096 */
4747 +#define E1000_RCTL_VFE 0x00040000 /* vlan filter enable */
4748 +#define E1000_RCTL_CFIEN 0x00080000 /* canonical form enable */
4749 +#define E1000_RCTL_CFI 0x00100000 /* canonical form indicator */
4750 +#define E1000_RCTL_DPF 0x00400000 /* discard pause frames */
4751 +#define E1000_RCTL_PMCF 0x00800000 /* pass MAC control frames */
4752 +#define E1000_RCTL_BSEX 0x02000000 /* Buffer size extension */
4753 +#define E1000_RCTL_SECRC 0x04000000 /* Strip Ethernet CRC */
4754 +#define E1000_RCTL_FLXBUF_MASK 0x78000000 /* Flexible buffer size */
4755 +#define E1000_RCTL_FLXBUF_SHIFT 27 /* Flexible buffer shift */
4758 + * Use byte values for the following shift parameters
4760 + * psrctl |= (((ROUNDUP(value0, 128) >> E1000_PSRCTL_BSIZE0_SHIFT) &
4761 + * E1000_PSRCTL_BSIZE0_MASK) |
4762 + * ((ROUNDUP(value1, 1024) >> E1000_PSRCTL_BSIZE1_SHIFT) &
4763 + * E1000_PSRCTL_BSIZE1_MASK) |
4764 + * ((ROUNDUP(value2, 1024) << E1000_PSRCTL_BSIZE2_SHIFT) &
4765 + * E1000_PSRCTL_BSIZE2_MASK) |
4766 + * ((ROUNDUP(value3, 1024) << E1000_PSRCTL_BSIZE3_SHIFT) |;
4767 + * E1000_PSRCTL_BSIZE3_MASK))
4768 + * where value0 = [128..16256], default=256
4769 + * value1 = [1024..64512], default=4096
4770 + * value2 = [0..64512], default=4096
4771 + * value3 = [0..64512], default=0
4774 +#define E1000_PSRCTL_BSIZE0_MASK 0x0000007F
4775 +#define E1000_PSRCTL_BSIZE1_MASK 0x00003F00
4776 +#define E1000_PSRCTL_BSIZE2_MASK 0x003F0000
4777 +#define E1000_PSRCTL_BSIZE3_MASK 0x3F000000
4779 +#define E1000_PSRCTL_BSIZE0_SHIFT 7 /* Shift _right_ 7 */
4780 +#define E1000_PSRCTL_BSIZE1_SHIFT 2 /* Shift _right_ 2 */
4781 +#define E1000_PSRCTL_BSIZE2_SHIFT 6 /* Shift _left_ 6 */
4782 +#define E1000_PSRCTL_BSIZE3_SHIFT 14 /* Shift _left_ 14 */
4784 +/* SWFW_SYNC Definitions */
4785 +#define E1000_SWFW_EEP_SM 0x1
4786 +#define E1000_SWFW_PHY0_SM 0x2
4787 +#define E1000_SWFW_PHY1_SM 0x4
4788 +#define E1000_SWFW_CSR_SM 0x8
4790 +/* FACTPS Definitions */
4791 +#define E1000_FACTPS_LFS 0x40000000 /* LAN Function Select */
4792 +/* Device Control */
4793 +#define E1000_CTRL_FD 0x00000001 /* Full duplex.0=half; 1=full */
4794 +#define E1000_CTRL_BEM 0x00000002 /* Endian Mode.0=little,1=big */
4795 +#define E1000_CTRL_PRIOR 0x00000004 /* Priority on PCI. 0=rx,1=fair */
4796 +#define E1000_CTRL_GIO_MASTER_DISABLE 0x00000004 /*Blocks new Master requests */
4797 +#define E1000_CTRL_LRST 0x00000008 /* Link reset. 0=normal,1=reset */
4798 +#define E1000_CTRL_TME 0x00000010 /* Test mode. 0=normal,1=test */
4799 +#define E1000_CTRL_SLE 0x00000020 /* Serial Link on 0=dis,1=en */
4800 +#define E1000_CTRL_ASDE 0x00000020 /* Auto-speed detect enable */
4801 +#define E1000_CTRL_SLU 0x00000040 /* Set link up (Force Link) */
4802 +#define E1000_CTRL_ILOS 0x00000080 /* Invert Loss-Of Signal */
4803 +#define E1000_CTRL_SPD_SEL 0x00000300 /* Speed Select Mask */
4804 +#define E1000_CTRL_SPD_10 0x00000000 /* Force 10Mb */
4805 +#define E1000_CTRL_SPD_100 0x00000100 /* Force 100Mb */
4806 +#define E1000_CTRL_SPD_1000 0x00000200 /* Force 1Gb */
4807 +#define E1000_CTRL_BEM32 0x00000400 /* Big Endian 32 mode */
4808 +#define E1000_CTRL_FRCSPD 0x00000800 /* Force Speed */
4809 +#define E1000_CTRL_FRCDPX 0x00001000 /* Force Duplex */
4810 +#define E1000_CTRL_D_UD_EN 0x00002000 /* Dock/Undock enable */
4811 +#define E1000_CTRL_D_UD_POLARITY 0x00004000 /* Defined polarity of Dock/Undock indication in SDP[0] */
4812 +#define E1000_CTRL_FORCE_PHY_RESET 0x00008000 /* Reset both PHY ports, through PHYRST_N pin */
4813 +#define E1000_CTRL_EXT_LINK_EN 0x00010000 /* enable link status from external LINK_0 and LINK_1 pins */
4814 +#define E1000_CTRL_SWDPIN0 0x00040000 /* SWDPIN 0 value */
4815 +#define E1000_CTRL_SWDPIN1 0x00080000 /* SWDPIN 1 value */
4816 +#define E1000_CTRL_SWDPIN2 0x00100000 /* SWDPIN 2 value */
4817 +#define E1000_CTRL_SWDPIN3 0x00200000 /* SWDPIN 3 value */
4818 +#define E1000_CTRL_SWDPIO0 0x00400000 /* SWDPIN 0 Input or output */
4819 +#define E1000_CTRL_SWDPIO1 0x00800000 /* SWDPIN 1 input or output */
4820 +#define E1000_CTRL_SWDPIO2 0x01000000 /* SWDPIN 2 input or output */
4821 +#define E1000_CTRL_SWDPIO3 0x02000000 /* SWDPIN 3 input or output */
4822 +#define E1000_CTRL_RST 0x04000000 /* Global reset */
4823 +#define E1000_CTRL_RFCE 0x08000000 /* Receive Flow Control enable */
4824 +#define E1000_CTRL_TFCE 0x10000000 /* Transmit flow control enable */
4825 +#define E1000_CTRL_RTE 0x20000000 /* Routing tag enable */
4826 +#define E1000_CTRL_VME 0x40000000 /* IEEE VLAN mode enable */
4827 +#define E1000_CTRL_PHY_RST 0x80000000 /* PHY Reset */
4828 +#define E1000_CTRL_SW2FW_INT 0x02000000 /* Initiate an interrupt to manageability engine */
4829 +#define E1000_CTRL_I2C_ENA 0x02000000 /* I2C enable */
4832 + * Bit definitions for the Management Data IO (MDIO) and Management Data
4833 + * Clock (MDC) pins in the Device Control Register.
4835 +#define E1000_CTRL_PHY_RESET_DIR E1000_CTRL_SWDPIO0
4836 +#define E1000_CTRL_PHY_RESET E1000_CTRL_SWDPIN0
4837 +#define E1000_CTRL_MDIO_DIR E1000_CTRL_SWDPIO2
4838 +#define E1000_CTRL_MDIO E1000_CTRL_SWDPIN2
4839 +#define E1000_CTRL_MDC_DIR E1000_CTRL_SWDPIO3
4840 +#define E1000_CTRL_MDC E1000_CTRL_SWDPIN3
4841 +#define E1000_CTRL_PHY_RESET_DIR4 E1000_CTRL_EXT_SDP4_DIR
4842 +#define E1000_CTRL_PHY_RESET4 E1000_CTRL_EXT_SDP4_DATA
4844 +#define E1000_CONNSW_ENRGSRC 0x4
4845 +#define E1000_PCS_CFG_PCS_EN 8
4846 +#define E1000_PCS_LCTL_FLV_LINK_UP 1
4847 +#define E1000_PCS_LCTL_FSV_10 0
4848 +#define E1000_PCS_LCTL_FSV_100 2
4849 +#define E1000_PCS_LCTL_FSV_1000 4
4850 +#define E1000_PCS_LCTL_FDV_FULL 8
4851 +#define E1000_PCS_LCTL_FSD 0x10
4852 +#define E1000_PCS_LCTL_FORCE_LINK 0x20
4853 +#define E1000_PCS_LCTL_LOW_LINK_LATCH 0x40
4854 +#define E1000_PCS_LCTL_FORCE_FCTRL 0x80
4855 +#define E1000_PCS_LCTL_AN_ENABLE 0x10000
4856 +#define E1000_PCS_LCTL_AN_RESTART 0x20000
4857 +#define E1000_PCS_LCTL_AN_TIMEOUT 0x40000
4858 +#define E1000_PCS_LCTL_AN_SGMII_BYPASS 0x80000
4859 +#define E1000_PCS_LCTL_AN_SGMII_TRIGGER 0x100000
4860 +#define E1000_PCS_LCTL_FAST_LINK_TIMER 0x1000000
4861 +#define E1000_PCS_LCTL_LINK_OK_FIX 0x2000000
4862 +#define E1000_PCS_LCTL_CRS_ON_NI 0x4000000
4863 +#define E1000_ENABLE_SERDES_LOOPBACK 0x0410
4865 +#define E1000_PCS_LSTS_LINK_OK 1
4866 +#define E1000_PCS_LSTS_SPEED_10 0
4867 +#define E1000_PCS_LSTS_SPEED_100 2
4868 +#define E1000_PCS_LSTS_SPEED_1000 4
4869 +#define E1000_PCS_LSTS_DUPLEX_FULL 8
4870 +#define E1000_PCS_LSTS_SYNK_OK 0x10
4871 +#define E1000_PCS_LSTS_AN_COMPLETE 0x10000
4872 +#define E1000_PCS_LSTS_AN_PAGE_RX 0x20000
4873 +#define E1000_PCS_LSTS_AN_TIMED_OUT 0x40000
4874 +#define E1000_PCS_LSTS_AN_REMOTE_FAULT 0x80000
4875 +#define E1000_PCS_LSTS_AN_ERROR_RWS 0x100000
4877 +/* Device Status */
4878 +#define E1000_STATUS_FD 0x00000001 /* Full duplex.0=half,1=full */
4879 +#define E1000_STATUS_LU 0x00000002 /* Link up.0=no,1=link */
4880 +#define E1000_STATUS_FUNC_MASK 0x0000000C /* PCI Function Mask */
4881 +#define E1000_STATUS_FUNC_SHIFT 2
4882 +#define E1000_STATUS_FUNC_0 0x00000000 /* Function 0 */
4883 +#define E1000_STATUS_FUNC_1 0x00000004 /* Function 1 */
4884 +#define E1000_STATUS_TXOFF 0x00000010 /* transmission paused */
4885 +#define E1000_STATUS_TBIMODE 0x00000020 /* TBI mode */
4886 +#define E1000_STATUS_SPEED_MASK 0x000000C0
4887 +#define E1000_STATUS_SPEED_10 0x00000000 /* Speed 10Mb/s */
4888 +#define E1000_STATUS_SPEED_100 0x00000040 /* Speed 100Mb/s */
4889 +#define E1000_STATUS_SPEED_1000 0x00000080 /* Speed 1000Mb/s */
4890 +#define E1000_STATUS_LAN_INIT_DONE 0x00000200 /* Lan Init Completion by NVM */
4891 +#define E1000_STATUS_ASDV 0x00000300 /* Auto speed detect value */
4892 +#define E1000_STATUS_DOCK_CI 0x00000800 /* Change in Dock/Undock state. Clear on write '0'. */
4893 +#define E1000_STATUS_GIO_MASTER_ENABLE 0x00080000 /* Status of Master requests. */
4894 +#define E1000_STATUS_MTXCKOK 0x00000400 /* MTX clock running OK */
4895 +#define E1000_STATUS_PCI66 0x00000800 /* In 66Mhz slot */
4896 +#define E1000_STATUS_BUS64 0x00001000 /* In 64 bit slot */
4897 +#define E1000_STATUS_PCIX_MODE 0x00002000 /* PCI-X mode */
4898 +#define E1000_STATUS_PCIX_SPEED 0x0000C000 /* PCI-X bus speed */
4899 +#define E1000_STATUS_BMC_SKU_0 0x00100000 /* BMC USB redirect disabled */
4900 +#define E1000_STATUS_BMC_SKU_1 0x00200000 /* BMC SRAM disabled */
4901 +#define E1000_STATUS_BMC_SKU_2 0x00400000 /* BMC SDRAM disabled */
4902 +#define E1000_STATUS_BMC_CRYPTO 0x00800000 /* BMC crypto disabled */
4903 +#define E1000_STATUS_BMC_LITE 0x01000000 /* BMC external code execution disabled */
4904 +#define E1000_STATUS_RGMII_ENABLE 0x02000000 /* RGMII disabled */
4905 +#define E1000_STATUS_FUSE_8 0x04000000
4906 +#define E1000_STATUS_FUSE_9 0x08000000
4907 +#define E1000_STATUS_SERDES0_DIS 0x10000000 /* SERDES disabled on port 0 */
4908 +#define E1000_STATUS_SERDES1_DIS 0x20000000 /* SERDES disabled on port 1 */
4910 +/* Constants used to interpret the masked PCI-X bus speed. */
4911 +#define E1000_STATUS_PCIX_SPEED_66 0x00000000 /* PCI-X bus speed 50-66 MHz */
4912 +#define E1000_STATUS_PCIX_SPEED_100 0x00004000 /* PCI-X bus speed 66-100 MHz */
4913 +#define E1000_STATUS_PCIX_SPEED_133 0x00008000 /* PCI-X bus speed 100-133 MHz */
4915 +#define SPEED_10 10
4916 +#define SPEED_100 100
4917 +#define SPEED_1000 1000
4918 +#define HALF_DUPLEX 1
4919 +#define FULL_DUPLEX 2
4921 +#define PHY_FORCE_TIME 20
4923 +#define ADVERTISE_10_HALF 0x0001
4924 +#define ADVERTISE_10_FULL 0x0002
4925 +#define ADVERTISE_100_HALF 0x0004
4926 +#define ADVERTISE_100_FULL 0x0008
4927 +#define ADVERTISE_1000_HALF 0x0010 /* Not used, just FYI */
4928 +#define ADVERTISE_1000_FULL 0x0020
4930 +/* 1000/H is not supported, nor spec-compliant. */
4931 +#define E1000_ALL_SPEED_DUPLEX ( ADVERTISE_10_HALF | ADVERTISE_10_FULL | \
4932 + ADVERTISE_100_HALF | ADVERTISE_100_FULL | \
4933 + ADVERTISE_1000_FULL)
4934 +#define E1000_ALL_NOT_GIG ( ADVERTISE_10_HALF | ADVERTISE_10_FULL | \
4935 + ADVERTISE_100_HALF | ADVERTISE_100_FULL)
4936 +#define E1000_ALL_100_SPEED (ADVERTISE_100_HALF | ADVERTISE_100_FULL)
4937 +#define E1000_ALL_10_SPEED (ADVERTISE_10_HALF | ADVERTISE_10_FULL)
4938 +#define E1000_ALL_FULL_DUPLEX (ADVERTISE_10_FULL | ADVERTISE_100_FULL | \
4939 + ADVERTISE_1000_FULL)
4940 +#define E1000_ALL_HALF_DUPLEX (ADVERTISE_10_HALF | ADVERTISE_100_HALF)
4942 +#define AUTONEG_ADVERTISE_SPEED_DEFAULT E1000_ALL_SPEED_DUPLEX
4945 +#define E1000_LEDCTL_LED0_MODE_MASK 0x0000000F
4946 +#define E1000_LEDCTL_LED0_MODE_SHIFT 0
4947 +#define E1000_LEDCTL_LED0_BLINK_RATE 0x00000020
4948 +#define E1000_LEDCTL_LED0_IVRT 0x00000040
4949 +#define E1000_LEDCTL_LED0_BLINK 0x00000080
4950 +#define E1000_LEDCTL_LED1_MODE_MASK 0x00000F00
4951 +#define E1000_LEDCTL_LED1_MODE_SHIFT 8
4952 +#define E1000_LEDCTL_LED1_BLINK_RATE 0x00002000
4953 +#define E1000_LEDCTL_LED1_IVRT 0x00004000
4954 +#define E1000_LEDCTL_LED1_BLINK 0x00008000
4955 +#define E1000_LEDCTL_LED2_MODE_MASK 0x000F0000
4956 +#define E1000_LEDCTL_LED2_MODE_SHIFT 16
4957 +#define E1000_LEDCTL_LED2_BLINK_RATE 0x00200000
4958 +#define E1000_LEDCTL_LED2_IVRT 0x00400000
4959 +#define E1000_LEDCTL_LED2_BLINK 0x00800000
4960 +#define E1000_LEDCTL_LED3_MODE_MASK 0x0F000000
4961 +#define E1000_LEDCTL_LED3_MODE_SHIFT 24
4962 +#define E1000_LEDCTL_LED3_BLINK_RATE 0x20000000
4963 +#define E1000_LEDCTL_LED3_IVRT 0x40000000
4964 +#define E1000_LEDCTL_LED3_BLINK 0x80000000
4966 +#define E1000_LEDCTL_MODE_LINK_10_1000 0x0
4967 +#define E1000_LEDCTL_MODE_LINK_100_1000 0x1
4968 +#define E1000_LEDCTL_MODE_LINK_UP 0x2
4969 +#define E1000_LEDCTL_MODE_ACTIVITY 0x3
4970 +#define E1000_LEDCTL_MODE_LINK_ACTIVITY 0x4
4971 +#define E1000_LEDCTL_MODE_LINK_10 0x5
4972 +#define E1000_LEDCTL_MODE_LINK_100 0x6
4973 +#define E1000_LEDCTL_MODE_LINK_1000 0x7
4974 +#define E1000_LEDCTL_MODE_PCIX_MODE 0x8
4975 +#define E1000_LEDCTL_MODE_FULL_DUPLEX 0x9
4976 +#define E1000_LEDCTL_MODE_COLLISION 0xA
4977 +#define E1000_LEDCTL_MODE_BUS_SPEED 0xB
4978 +#define E1000_LEDCTL_MODE_BUS_SIZE 0xC
4979 +#define E1000_LEDCTL_MODE_PAUSED 0xD
4980 +#define E1000_LEDCTL_MODE_LED_ON 0xE
4981 +#define E1000_LEDCTL_MODE_LED_OFF 0xF
4983 +/* Transmit Descriptor bit definitions */
4984 +#define E1000_TXD_DTYP_D 0x00100000 /* Data Descriptor */
4985 +#define E1000_TXD_DTYP_C 0x00000000 /* Context Descriptor */
4986 +#define E1000_TXD_POPTS_SHIFT 8 /* POPTS shift */
4987 +#define E1000_TXD_POPTS_IXSM 0x01 /* Insert IP checksum */
4988 +#define E1000_TXD_POPTS_TXSM 0x02 /* Insert TCP/UDP checksum */
4989 +#define E1000_TXD_CMD_EOP 0x01000000 /* End of Packet */
4990 +#define E1000_TXD_CMD_IFCS 0x02000000 /* Insert FCS (Ethernet CRC) */
4991 +#define E1000_TXD_CMD_IC 0x04000000 /* Insert Checksum */
4992 +#define E1000_TXD_CMD_RS 0x08000000 /* Report Status */
4993 +#define E1000_TXD_CMD_RPS 0x10000000 /* Report Packet Sent */
4994 +#define E1000_TXD_CMD_DEXT 0x20000000 /* Descriptor extension (0 = legacy) */
4995 +#define E1000_TXD_CMD_VLE 0x40000000 /* Add VLAN tag */
4996 +#define E1000_TXD_CMD_IDE 0x80000000 /* Enable Tidv register */
4997 +#define E1000_TXD_STAT_DD 0x00000001 /* Descriptor Done */
4998 +#define E1000_TXD_STAT_EC 0x00000002 /* Excess Collisions */
4999 +#define E1000_TXD_STAT_LC 0x00000004 /* Late Collisions */
5000 +#define E1000_TXD_STAT_TU 0x00000008 /* Transmit underrun */
5001 +#define E1000_TXD_CMD_TCP 0x01000000 /* TCP packet */
5002 +#define E1000_TXD_CMD_IP 0x02000000 /* IP packet */
5003 +#define E1000_TXD_CMD_TSE 0x04000000 /* TCP Seg enable */
5004 +#define E1000_TXD_STAT_TC 0x00000004 /* Tx Underrun */
5005 +/* Extended desc bits for Linksec and timesync */
5007 +/* Transmit Control */
5008 +#define E1000_TCTL_RST 0x00000001 /* software reset */
5009 +#define E1000_TCTL_EN 0x00000002 /* enable tx */
5010 +#define E1000_TCTL_BCE 0x00000004 /* busy check enable */
5011 +#define E1000_TCTL_PSP 0x00000008 /* pad short packets */
5012 +#define E1000_TCTL_CT 0x00000ff0 /* collision threshold */
5013 +#define E1000_TCTL_COLD 0x003ff000 /* collision distance */
5014 +#define E1000_TCTL_SWXOFF 0x00400000 /* SW Xoff transmission */
5015 +#define E1000_TCTL_PBE 0x00800000 /* Packet Burst Enable */
5016 +#define E1000_TCTL_RTLC 0x01000000 /* Re-transmit on late collision */
5017 +#define E1000_TCTL_NRTU 0x02000000 /* No Re-transmit on underrun */
5018 +#define E1000_TCTL_MULR 0x10000000 /* Multiple request support */
5020 +/* Transmit Arbitration Count */
5021 +#define E1000_TARC0_ENABLE 0x00000400 /* Enable Tx Queue 0 */
5023 +/* SerDes Control */
5024 +#define E1000_SCTL_DISABLE_SERDES_LOOPBACK 0x0400
5026 +/* Receive Checksum Control */
5027 +#define E1000_RXCSUM_PCSS_MASK 0x000000FF /* Packet Checksum Start */
5028 +#define E1000_RXCSUM_IPOFL 0x00000100 /* IPv4 checksum offload */
5029 +#define E1000_RXCSUM_TUOFL 0x00000200 /* TCP / UDP checksum offload */
5030 +#define E1000_RXCSUM_IPV6OFL 0x00000400 /* IPv6 checksum offload */
5031 +#define E1000_RXCSUM_CRCOFL 0x00000800 /* CRC32 offload enable */
5032 +#define E1000_RXCSUM_IPPCSE 0x00001000 /* IP payload checksum enable */
5033 +#define E1000_RXCSUM_PCSD 0x00002000 /* packet checksum disabled */
5035 +/* Header split receive */
5036 +#define E1000_RFCTL_ISCSI_DIS 0x00000001
5037 +#define E1000_RFCTL_ISCSI_DWC_MASK 0x0000003E
5038 +#define E1000_RFCTL_ISCSI_DWC_SHIFT 1
5039 +#define E1000_RFCTL_NFSW_DIS 0x00000040
5040 +#define E1000_RFCTL_NFSR_DIS 0x00000080
5041 +#define E1000_RFCTL_NFS_VER_MASK 0x00000300
5042 +#define E1000_RFCTL_NFS_VER_SHIFT 8
5043 +#define E1000_RFCTL_IPV6_DIS 0x00000400
5044 +#define E1000_RFCTL_IPV6_XSUM_DIS 0x00000800
5045 +#define E1000_RFCTL_ACK_DIS 0x00001000
5046 +#define E1000_RFCTL_ACKD_DIS 0x00002000
5047 +#define E1000_RFCTL_IPFRSP_DIS 0x00004000
5048 +#define E1000_RFCTL_EXTEN 0x00008000
5049 +#define E1000_RFCTL_IPV6_EX_DIS 0x00010000
5050 +#define E1000_RFCTL_NEW_IPV6_EXT_DIS 0x00020000
5051 +#define E1000_RFCTL_LEF 0x00040000
5053 +/* Collision related configuration parameters */
5054 +#define E1000_COLLISION_THRESHOLD 15
5055 +#define E1000_CT_SHIFT 4
5056 +#define E1000_COLLISION_DISTANCE 63
5057 +#define E1000_COLD_SHIFT 12
5059 +/* Default values for the transmit IPG register */
5060 +#define DEFAULT_82543_TIPG_IPGT_FIBER 9
5061 +#define DEFAULT_82543_TIPG_IPGT_COPPER 8
5063 +#define E1000_TIPG_IPGT_MASK 0x000003FF
5064 +#define E1000_TIPG_IPGR1_MASK 0x000FFC00
5065 +#define E1000_TIPG_IPGR2_MASK 0x3FF00000
5067 +#define DEFAULT_82543_TIPG_IPGR1 8
5068 +#define E1000_TIPG_IPGR1_SHIFT 10
5070 +#define DEFAULT_82543_TIPG_IPGR2 6
5071 +#define DEFAULT_80003ES2LAN_TIPG_IPGR2 7
5072 +#define E1000_TIPG_IPGR2_SHIFT 20
5074 +/* Ethertype field values */
5075 +#define ETHERNET_IEEE_VLAN_TYPE 0x8100 /* 802.3ac packet */
5077 +#define ETHERNET_FCS_SIZE 4
5078 +#define MAX_JUMBO_FRAME_SIZE 0x3F00
5080 +/* Extended Configuration Control and Size */
5081 +#define E1000_EXTCNF_CTRL_MDIO_SW_OWNERSHIP 0x00000020
5082 +#define E1000_EXTCNF_CTRL_LCD_WRITE_ENABLE 0x00000001
5083 +#define E1000_EXTCNF_CTRL_SWFLAG 0x00000020
5084 +#define E1000_EXTCNF_SIZE_EXT_PCIE_LENGTH_MASK 0x00FF0000
5085 +#define E1000_EXTCNF_SIZE_EXT_PCIE_LENGTH_SHIFT 16
5086 +#define E1000_EXTCNF_CTRL_EXT_CNF_POINTER_MASK 0x0FFF0000
5087 +#define E1000_EXTCNF_CTRL_EXT_CNF_POINTER_SHIFT 16
5089 +#define E1000_PHY_CTRL_SPD_EN 0x00000001
5090 +#define E1000_PHY_CTRL_D0A_LPLU 0x00000002
5091 +#define E1000_PHY_CTRL_NOND0A_LPLU 0x00000004
5092 +#define E1000_PHY_CTRL_NOND0A_GBE_DISABLE 0x00000008
5093 +#define E1000_PHY_CTRL_GBE_DISABLE 0x00000040
5095 +#define E1000_KABGTXD_BGSQLBIAS 0x00050000
5097 +/* PBA constants */
5098 +#define E1000_PBA_6K 0x0006 /* 6KB */
5099 +#define E1000_PBA_8K 0x0008 /* 8KB */
5100 +#define E1000_PBA_12K 0x000C /* 12KB */
5101 +#define E1000_PBA_16K 0x0010 /* 16KB */
5102 +#define E1000_PBA_20K 0x0014
5103 +#define E1000_PBA_22K 0x0016
5104 +#define E1000_PBA_24K 0x0018
5105 +#define E1000_PBA_30K 0x001E
5106 +#define E1000_PBA_32K 0x0020
5107 +#define E1000_PBA_34K 0x0022
5108 +#define E1000_PBA_38K 0x0026
5109 +#define E1000_PBA_40K 0x0028
5110 +#define E1000_PBA_48K 0x0030 /* 48KB */
5111 +#define E1000_PBA_64K 0x0040 /* 64KB */
5113 +#define E1000_PBS_16K E1000_PBA_16K
5114 +#define E1000_PBS_24K E1000_PBA_24K
5118 +#define IFS_RATIO 4
5119 +#define IFS_STEP 10
5120 +#define MIN_NUM_XMITS 1000
5122 +/* SW Semaphore Register */
5123 +#define E1000_SWSM_SMBI 0x00000001 /* Driver Semaphore bit */
5124 +#define E1000_SWSM_SWESMBI 0x00000002 /* FW Semaphore bit */
5125 +#define E1000_SWSM_WMNG 0x00000004 /* Wake MNG Clock */
5126 +#define E1000_SWSM_DRV_LOAD 0x00000008 /* Driver Loaded Bit */
5128 +/* Interrupt Cause Read */
5129 +#define E1000_ICR_TXDW 0x00000001 /* Transmit desc written back */
5130 +#define E1000_ICR_TXQE 0x00000002 /* Transmit Queue empty */
5131 +#define E1000_ICR_LSC 0x00000004 /* Link Status Change */
5132 +#define E1000_ICR_RXSEQ 0x00000008 /* rx sequence error */
5133 +#define E1000_ICR_RXDMT0 0x00000010 /* rx desc min. threshold (0) */
5134 +#define E1000_ICR_RXO 0x00000040 /* rx overrun */
5135 +#define E1000_ICR_RXT0 0x00000080 /* rx timer intr (ring 0) */
5136 +#define E1000_ICR_VMMB 0x00000100 /* VM MB event */
5137 +#define E1000_ICR_MDAC 0x00000200 /* MDIO access complete */
5138 +#define E1000_ICR_RXCFG 0x00000400 /* Rx /c/ ordered set */
5139 +#define E1000_ICR_GPI_EN0 0x00000800 /* GP Int 0 */
5140 +#define E1000_ICR_GPI_EN1 0x00001000 /* GP Int 1 */
5141 +#define E1000_ICR_GPI_EN2 0x00002000 /* GP Int 2 */
5142 +#define E1000_ICR_GPI_EN3 0x00004000 /* GP Int 3 */
5143 +#define E1000_ICR_TXD_LOW 0x00008000
5144 +#define E1000_ICR_SRPD 0x00010000
5145 +#define E1000_ICR_ACK 0x00020000 /* Receive Ack frame */
5146 +#define E1000_ICR_MNG 0x00040000 /* Manageability event */
5147 +#define E1000_ICR_DOCK 0x00080000 /* Dock/Undock */
5148 +#define E1000_ICR_INT_ASSERTED 0x80000000 /* If this bit asserted, the driver should claim the interrupt */
5149 +#define E1000_ICR_RXD_FIFO_PAR0 0x00100000 /* queue 0 Rx descriptor FIFO parity error */
5150 +#define E1000_ICR_TXD_FIFO_PAR0 0x00200000 /* queue 0 Tx descriptor FIFO parity error */
5151 +#define E1000_ICR_HOST_ARB_PAR 0x00400000 /* host arb read buffer parity error */
5152 +#define E1000_ICR_PB_PAR 0x00800000 /* packet buffer parity error */
5153 +#define E1000_ICR_RXD_FIFO_PAR1 0x01000000 /* queue 1 Rx descriptor FIFO parity error */
5154 +#define E1000_ICR_TXD_FIFO_PAR1 0x02000000 /* queue 1 Tx descriptor FIFO parity error */
5155 +#define E1000_ICR_ALL_PARITY 0x03F00000 /* all parity error bits */
5156 +#define E1000_ICR_DSW 0x00000020 /* FW changed the status of DISSW bit in the FWSM */
5157 +#define E1000_ICR_PHYINT 0x00001000 /* LAN connected device generates an interrupt */
5158 +#define E1000_ICR_EPRST 0x00100000 /* ME hardware reset occurs */
5160 +/* Extended Interrupt Cause Read */
5161 +#define E1000_EICR_RX_QUEUE0 0x00000001 /* Rx Queue 0 Interrupt */
5162 +#define E1000_EICR_RX_QUEUE1 0x00000002 /* Rx Queue 1 Interrupt */
5163 +#define E1000_EICR_RX_QUEUE2 0x00000004 /* Rx Queue 2 Interrupt */
5164 +#define E1000_EICR_RX_QUEUE3 0x00000008 /* Rx Queue 3 Interrupt */
5165 +#define E1000_EICR_TX_QUEUE0 0x00000100 /* Tx Queue 0 Interrupt */
5166 +#define E1000_EICR_TX_QUEUE1 0x00000200 /* Tx Queue 1 Interrupt */
5167 +#define E1000_EICR_TX_QUEUE2 0x00000400 /* Tx Queue 2 Interrupt */
5168 +#define E1000_EICR_TX_QUEUE3 0x00000800 /* Tx Queue 3 Interrupt */
5169 +#define E1000_EICR_TCP_TIMER 0x40000000 /* TCP Timer */
5170 +#define E1000_EICR_OTHER 0x80000000 /* Interrupt Cause Active */
5172 +#define E1000_TCPTIMER_KS 0x00000100 /* KickStart */
5173 +#define E1000_TCPTIMER_COUNT_ENABLE 0x00000200 /* Count Enable */
5174 +#define E1000_TCPTIMER_COUNT_FINISH 0x00000400 /* Count finish */
5175 +#define E1000_TCPTIMER_LOOP 0x00000800 /* Loop */
5178 + * This defines the bits that are set in the Interrupt Mask
5179 + * Set/Read Register. Each bit is documented below:
5180 + * o RXDMT0 = Receive Descriptor Minimum Threshold hit (ring 0)
5181 + * o RXSEQ = Receive Sequence Error
5183 +#define POLL_IMS_ENABLE_MASK ( \
5184 + E1000_IMS_RXDMT0 | \
5188 + * This defines the bits that are set in the Interrupt Mask
5189 + * Set/Read Register. Each bit is documented below:
5190 + * o RXT0 = Receiver Timer Interrupt (ring 0)
5191 + * o TXDW = Transmit Descriptor Written Back
5192 + * o RXDMT0 = Receive Descriptor Minimum Threshold hit (ring 0)
5193 + * o RXSEQ = Receive Sequence Error
5194 + * o LSC = Link Status Change
5196 +#define IMS_ENABLE_MASK ( \
5197 + E1000_IMS_RXT0 | \
5198 + E1000_IMS_TXDW | \
5199 + E1000_IMS_RXDMT0 | \
5200 + E1000_IMS_RXSEQ | \
5203 +/* Interrupt Mask Set */
5204 +#define E1000_IMS_TXDW E1000_ICR_TXDW /* Transmit desc written back */
5205 +#define E1000_IMS_TXQE E1000_ICR_TXQE /* Transmit Queue empty */
5206 +#define E1000_IMS_LSC E1000_ICR_LSC /* Link Status Change */
5207 +#define E1000_IMS_VMMB E1000_ICR_VMMB /* Mail box activity */
5208 +#define E1000_IMS_RXSEQ E1000_ICR_RXSEQ /* rx sequence error */
5209 +#define E1000_IMS_RXDMT0 E1000_ICR_RXDMT0 /* rx desc min. threshold */
5210 +#define E1000_IMS_RXO E1000_ICR_RXO /* rx overrun */
5211 +#define E1000_IMS_RXT0 E1000_ICR_RXT0 /* rx timer intr */
5212 +#define E1000_IMS_MDAC E1000_ICR_MDAC /* MDIO access complete */
5213 +#define E1000_IMS_RXCFG E1000_ICR_RXCFG /* Rx /c/ ordered set */
5214 +#define E1000_IMS_GPI_EN0 E1000_ICR_GPI_EN0 /* GP Int 0 */
5215 +#define E1000_IMS_GPI_EN1 E1000_ICR_GPI_EN1 /* GP Int 1 */
5216 +#define E1000_IMS_GPI_EN2 E1000_ICR_GPI_EN2 /* GP Int 2 */
5217 +#define E1000_IMS_GPI_EN3 E1000_ICR_GPI_EN3 /* GP Int 3 */
5218 +#define E1000_IMS_TXD_LOW E1000_ICR_TXD_LOW
5219 +#define E1000_IMS_SRPD E1000_ICR_SRPD
5220 +#define E1000_IMS_ACK E1000_ICR_ACK /* Receive Ack frame */
5221 +#define E1000_IMS_MNG E1000_ICR_MNG /* Manageability event */
5222 +#define E1000_IMS_DOCK E1000_ICR_DOCK /* Dock/Undock */
5223 +#define E1000_IMS_RXD_FIFO_PAR0 E1000_ICR_RXD_FIFO_PAR0 /* queue 0 Rx descriptor FIFO parity error */
5224 +#define E1000_IMS_TXD_FIFO_PAR0 E1000_ICR_TXD_FIFO_PAR0 /* queue 0 Tx descriptor FIFO parity error */
5225 +#define E1000_IMS_HOST_ARB_PAR E1000_ICR_HOST_ARB_PAR /* host arb read buffer parity error */
5226 +#define E1000_IMS_PB_PAR E1000_ICR_PB_PAR /* packet buffer parity error */
5227 +#define E1000_IMS_RXD_FIFO_PAR1 E1000_ICR_RXD_FIFO_PAR1 /* queue 1 Rx descriptor FIFO parity error */
5228 +#define E1000_IMS_TXD_FIFO_PAR1 E1000_ICR_TXD_FIFO_PAR1 /* queue 1 Tx descriptor FIFO parity error */
5229 +#define E1000_IMS_DSW E1000_ICR_DSW
5230 +#define E1000_IMS_PHYINT E1000_ICR_PHYINT
5231 +#define E1000_IMS_EPRST E1000_ICR_EPRST
5233 +/* Extended Interrupt Mask Set */
5234 +#define E1000_EIMS_RX_QUEUE0 E1000_EICR_RX_QUEUE0 /* Rx Queue 0 Interrupt */
5235 +#define E1000_EIMS_RX_QUEUE1 E1000_EICR_RX_QUEUE1 /* Rx Queue 1 Interrupt */
5236 +#define E1000_EIMS_RX_QUEUE2 E1000_EICR_RX_QUEUE2 /* Rx Queue 2 Interrupt */
5237 +#define E1000_EIMS_RX_QUEUE3 E1000_EICR_RX_QUEUE3 /* Rx Queue 3 Interrupt */
5238 +#define E1000_EIMS_TX_QUEUE0 E1000_EICR_TX_QUEUE0 /* Tx Queue 0 Interrupt */
5239 +#define E1000_EIMS_TX_QUEUE1 E1000_EICR_TX_QUEUE1 /* Tx Queue 1 Interrupt */
5240 +#define E1000_EIMS_TX_QUEUE2 E1000_EICR_TX_QUEUE2 /* Tx Queue 2 Interrupt */
5241 +#define E1000_EIMS_TX_QUEUE3 E1000_EICR_TX_QUEUE3 /* Tx Queue 3 Interrupt */
5242 +#define E1000_EIMS_TCP_TIMER E1000_EICR_TCP_TIMER /* TCP Timer */
5243 +#define E1000_EIMS_OTHER E1000_EICR_OTHER /* Interrupt Cause Active */
5245 +/* Interrupt Cause Set */
5246 +#define E1000_ICS_TXDW E1000_ICR_TXDW /* Transmit desc written back */
5247 +#define E1000_ICS_TXQE E1000_ICR_TXQE /* Transmit Queue empty */
5248 +#define E1000_ICS_LSC E1000_ICR_LSC /* Link Status Change */
5249 +#define E1000_ICS_RXSEQ E1000_ICR_RXSEQ /* rx sequence error */
5250 +#define E1000_ICS_RXDMT0 E1000_ICR_RXDMT0 /* rx desc min. threshold */
5251 +#define E1000_ICS_RXO E1000_ICR_RXO /* rx overrun */
5252 +#define E1000_ICS_RXT0 E1000_ICR_RXT0 /* rx timer intr */
5253 +#define E1000_ICS_MDAC E1000_ICR_MDAC /* MDIO access complete */
5254 +#define E1000_ICS_RXCFG E1000_ICR_RXCFG /* Rx /c/ ordered set */
5255 +#define E1000_ICS_GPI_EN0 E1000_ICR_GPI_EN0 /* GP Int 0 */
5256 +#define E1000_ICS_GPI_EN1 E1000_ICR_GPI_EN1 /* GP Int 1 */
5257 +#define E1000_ICS_GPI_EN2 E1000_ICR_GPI_EN2 /* GP Int 2 */
5258 +#define E1000_ICS_GPI_EN3 E1000_ICR_GPI_EN3 /* GP Int 3 */
5259 +#define E1000_ICS_TXD_LOW E1000_ICR_TXD_LOW
5260 +#define E1000_ICS_SRPD E1000_ICR_SRPD
5261 +#define E1000_ICS_ACK E1000_ICR_ACK /* Receive Ack frame */
5262 +#define E1000_ICS_MNG E1000_ICR_MNG /* Manageability event */
5263 +#define E1000_ICS_DOCK E1000_ICR_DOCK /* Dock/Undock */
5264 +#define E1000_ICS_RXD_FIFO_PAR0 E1000_ICR_RXD_FIFO_PAR0 /* queue 0 Rx descriptor FIFO parity error */
5265 +#define E1000_ICS_TXD_FIFO_PAR0 E1000_ICR_TXD_FIFO_PAR0 /* queue 0 Tx descriptor FIFO parity error */
5266 +#define E1000_ICS_HOST_ARB_PAR E1000_ICR_HOST_ARB_PAR /* host arb read buffer parity error */
5267 +#define E1000_ICS_PB_PAR E1000_ICR_PB_PAR /* packet buffer parity error */
5268 +#define E1000_ICS_RXD_FIFO_PAR1 E1000_ICR_RXD_FIFO_PAR1 /* queue 1 Rx descriptor FIFO parity error */
5269 +#define E1000_ICS_TXD_FIFO_PAR1 E1000_ICR_TXD_FIFO_PAR1 /* queue 1 Tx descriptor FIFO parity error */
5270 +#define E1000_ICS_DSW E1000_ICR_DSW
5271 +#define E1000_ICS_PHYINT E1000_ICR_PHYINT
5272 +#define E1000_ICS_EPRST E1000_ICR_EPRST
5274 +/* Extended Interrupt Cause Set */
5275 +#define E1000_EICS_RX_QUEUE0 E1000_EICR_RX_QUEUE0 /* Rx Queue 0 Interrupt */
5276 +#define E1000_EICS_RX_QUEUE1 E1000_EICR_RX_QUEUE1 /* Rx Queue 1 Interrupt */
5277 +#define E1000_EICS_RX_QUEUE2 E1000_EICR_RX_QUEUE2 /* Rx Queue 2 Interrupt */
5278 +#define E1000_EICS_RX_QUEUE3 E1000_EICR_RX_QUEUE3 /* Rx Queue 3 Interrupt */
5279 +#define E1000_EICS_TX_QUEUE0 E1000_EICR_TX_QUEUE0 /* Tx Queue 0 Interrupt */
5280 +#define E1000_EICS_TX_QUEUE1 E1000_EICR_TX_QUEUE1 /* Tx Queue 1 Interrupt */
5281 +#define E1000_EICS_TX_QUEUE2 E1000_EICR_TX_QUEUE2 /* Tx Queue 2 Interrupt */
5282 +#define E1000_EICS_TX_QUEUE3 E1000_EICR_TX_QUEUE3 /* Tx Queue 3 Interrupt */
5283 +#define E1000_EICS_TCP_TIMER E1000_EICR_TCP_TIMER /* TCP Timer */
5284 +#define E1000_EICS_OTHER E1000_EICR_OTHER /* Interrupt Cause Active */
5286 +/* Transmit Descriptor Control */
5287 +#define E1000_TXDCTL_PTHRESH 0x0000003F /* TXDCTL Prefetch Threshold */
5288 +#define E1000_TXDCTL_HTHRESH 0x00003F00 /* TXDCTL Host Threshold */
5289 +#define E1000_TXDCTL_WTHRESH 0x003F0000 /* TXDCTL Writeback Threshold */
5290 +#define E1000_TXDCTL_GRAN 0x01000000 /* TXDCTL Granularity */
5291 +#define E1000_TXDCTL_LWTHRESH 0xFE000000 /* TXDCTL Low Threshold */
5292 +#define E1000_TXDCTL_FULL_TX_DESC_WB 0x01010000 /* GRAN=1, WTHRESH=1 */
5293 +#define E1000_TXDCTL_MAX_TX_DESC_PREFETCH 0x0100001F /* GRAN=1, PTHRESH=31 */
5294 +/* Enable the counting of descriptors still to be processed. */
5295 +#define E1000_TXDCTL_COUNT_DESC 0x00400000
5297 +/* Flow Control Constants */
5298 +#define FLOW_CONTROL_ADDRESS_LOW 0x00C28001
5299 +#define FLOW_CONTROL_ADDRESS_HIGH 0x00000100
5300 +#define FLOW_CONTROL_TYPE 0x8808
5302 +/* 802.1q VLAN Packet Size */
5303 +#define VLAN_TAG_SIZE 4 /* 802.3ac tag (not DMA'd) */
5304 +#define E1000_VLAN_FILTER_TBL_SIZE 128 /* VLAN Filter Table (4096 bits) */
5306 +/* Receive Address */
5308 + * Number of high/low register pairs in the RAR. The RAR (Receive Address
5309 + * Registers) holds the directed and multicast addresses that we monitor.
5310 + * Technically, we have 16 spots. However, we reserve one of these spots
5311 + * (RAR[15]) for our directed address used by controllers with
5312 + * manageability enabled, allowing us room for 15 multicast addresses.
5314 +#define E1000_RAR_ENTRIES 15
5315 +#define E1000_RAH_AV 0x80000000 /* Receive descriptor valid */
5318 +#define E1000_SUCCESS 0
5319 +#define E1000_ERR_NVM 1
5320 +#define E1000_ERR_PHY 2
5321 +#define E1000_ERR_CONFIG 3
5322 +#define E1000_ERR_PARAM 4
5323 +#define E1000_ERR_MAC_INIT 5
5324 +#define E1000_ERR_PHY_TYPE 6
5325 +#define E1000_ERR_RESET 9
5326 +#define E1000_ERR_MASTER_REQUESTS_PENDING 10
5327 +#define E1000_ERR_HOST_INTERFACE_COMMAND 11
5328 +#define E1000_BLK_PHY_RESET 12
5329 +#define E1000_ERR_SWFW_SYNC 13
5330 +#define E1000_NOT_IMPLEMENTED 14
5332 +/* Loop limit on how long we wait for auto-negotiation to complete */
5333 +#define FIBER_LINK_UP_LIMIT 50
5334 +#define COPPER_LINK_UP_LIMIT 10
5335 +#define PHY_AUTO_NEG_LIMIT 45
5336 +#define PHY_FORCE_LIMIT 20
5337 +/* Number of 100 microseconds we wait for PCI Express master disable */
5338 +#define MASTER_DISABLE_TIMEOUT 800
5339 +/* Number of milliseconds we wait for PHY configuration done after MAC reset */
5340 +#define PHY_CFG_TIMEOUT 100
5341 +/* Number of 2 milliseconds we wait for acquiring MDIO ownership. */
5342 +#define MDIO_OWNERSHIP_TIMEOUT 10
5343 +/* Number of milliseconds for NVM auto read done after MAC reset. */
5344 +#define AUTO_READ_DONE_TIMEOUT 10
5347 +#define E1000_FCRTH_RTH 0x0000FFF8 /* Mask Bits[15:3] for RTH */
5348 +#define E1000_FCRTH_XFCE 0x80000000 /* External Flow Control Enable */
5349 +#define E1000_FCRTL_RTL 0x0000FFF8 /* Mask Bits[15:3] for RTL */
5350 +#define E1000_FCRTL_XONE 0x80000000 /* Enable XON frame transmission */
5352 +/* Transmit Configuration Word */
5353 +#define E1000_TXCW_FD 0x00000020 /* TXCW full duplex */
5354 +#define E1000_TXCW_HD 0x00000040 /* TXCW half duplex */
5355 +#define E1000_TXCW_PAUSE 0x00000080 /* TXCW sym pause request */
5356 +#define E1000_TXCW_ASM_DIR 0x00000100 /* TXCW astm pause direction */
5357 +#define E1000_TXCW_PAUSE_MASK 0x00000180 /* TXCW pause request mask */
5358 +#define E1000_TXCW_RF 0x00003000 /* TXCW remote fault */
5359 +#define E1000_TXCW_NP 0x00008000 /* TXCW next page */
5360 +#define E1000_TXCW_CW 0x0000ffff /* TxConfigWord mask */
5361 +#define E1000_TXCW_TXC 0x40000000 /* Transmit Config control */
5362 +#define E1000_TXCW_ANE 0x80000000 /* Auto-neg enable */
5364 +/* Receive Configuration Word */
5365 +#define E1000_RXCW_CW 0x0000ffff /* RxConfigWord mask */
5366 +#define E1000_RXCW_NC 0x04000000 /* Receive config no carrier */
5367 +#define E1000_RXCW_IV 0x08000000 /* Receive config invalid */
5368 +#define E1000_RXCW_CC 0x10000000 /* Receive config change */
5369 +#define E1000_RXCW_C 0x20000000 /* Receive config */
5370 +#define E1000_RXCW_SYNCH 0x40000000 /* Receive config synch */
5371 +#define E1000_RXCW_ANC 0x80000000 /* Auto-neg complete */
5373 +/* PCI Express Control */
5374 +#define E1000_GCR_RXD_NO_SNOOP 0x00000001
5375 +#define E1000_GCR_RXDSCW_NO_SNOOP 0x00000002
5376 +#define E1000_GCR_RXDSCR_NO_SNOOP 0x00000004
5377 +#define E1000_GCR_TXD_NO_SNOOP 0x00000008
5378 +#define E1000_GCR_TXDSCW_NO_SNOOP 0x00000010
5379 +#define E1000_GCR_TXDSCR_NO_SNOOP 0x00000020
5381 +#define PCIE_NO_SNOOP_ALL (E1000_GCR_RXD_NO_SNOOP | \
5382 + E1000_GCR_RXDSCW_NO_SNOOP | \
5383 + E1000_GCR_RXDSCR_NO_SNOOP | \
5384 + E1000_GCR_TXD_NO_SNOOP | \
5385 + E1000_GCR_TXDSCW_NO_SNOOP | \
5386 + E1000_GCR_TXDSCR_NO_SNOOP)
5388 +/* PHY Control Register */
5389 +#define MII_CR_SPEED_SELECT_MSB 0x0040 /* bits 6,13: 10=1000, 01=100, 00=10 */
5390 +#define MII_CR_COLL_TEST_ENABLE 0x0080 /* Collision test enable */
5391 +#define MII_CR_FULL_DUPLEX 0x0100 /* FDX =1, half duplex =0 */
5392 +#define MII_CR_RESTART_AUTO_NEG 0x0200 /* Restart auto negotiation */
5393 +#define MII_CR_ISOLATE 0x0400 /* Isolate PHY from MII */
5394 +#define MII_CR_POWER_DOWN 0x0800 /* Power down */
5395 +#define MII_CR_AUTO_NEG_EN 0x1000 /* Auto Neg Enable */
5396 +#define MII_CR_SPEED_SELECT_LSB 0x2000 /* bits 6,13: 10=1000, 01=100, 00=10 */
5397 +#define MII_CR_LOOPBACK 0x4000 /* 0 = normal, 1 = loopback */
5398 +#define MII_CR_RESET 0x8000 /* 0 = normal, 1 = PHY reset */
5399 +#define MII_CR_SPEED_1000 0x0040
5400 +#define MII_CR_SPEED_100 0x2000
5401 +#define MII_CR_SPEED_10 0x0000
5403 +/* PHY Status Register */
5404 +#define MII_SR_EXTENDED_CAPS 0x0001 /* Extended register capabilities */
5405 +#define MII_SR_JABBER_DETECT 0x0002 /* Jabber Detected */
5406 +#define MII_SR_LINK_STATUS 0x0004 /* Link Status 1 = link */
5407 +#define MII_SR_AUTONEG_CAPS 0x0008 /* Auto Neg Capable */
5408 +#define MII_SR_REMOTE_FAULT 0x0010 /* Remote Fault Detect */
5409 +#define MII_SR_AUTONEG_COMPLETE 0x0020 /* Auto Neg Complete */
5410 +#define MII_SR_PREAMBLE_SUPPRESS 0x0040 /* Preamble may be suppressed */
5411 +#define MII_SR_EXTENDED_STATUS 0x0100 /* Ext. status info in Reg 0x0F */
5412 +#define MII_SR_100T2_HD_CAPS 0x0200 /* 100T2 Half Duplex Capable */
5413 +#define MII_SR_100T2_FD_CAPS 0x0400 /* 100T2 Full Duplex Capable */
5414 +#define MII_SR_10T_HD_CAPS 0x0800 /* 10T Half Duplex Capable */
5415 +#define MII_SR_10T_FD_CAPS 0x1000 /* 10T Full Duplex Capable */
5416 +#define MII_SR_100X_HD_CAPS 0x2000 /* 100X Half Duplex Capable */
5417 +#define MII_SR_100X_FD_CAPS 0x4000 /* 100X Full Duplex Capable */
5418 +#define MII_SR_100T4_CAPS 0x8000 /* 100T4 Capable */
5420 +/* Autoneg Advertisement Register */
5421 +#define NWAY_AR_SELECTOR_FIELD 0x0001 /* indicates IEEE 802.3 CSMA/CD */
5422 +#define NWAY_AR_10T_HD_CAPS 0x0020 /* 10T Half Duplex Capable */
5423 +#define NWAY_AR_10T_FD_CAPS 0x0040 /* 10T Full Duplex Capable */
5424 +#define NWAY_AR_100TX_HD_CAPS 0x0080 /* 100TX Half Duplex Capable */
5425 +#define NWAY_AR_100TX_FD_CAPS 0x0100 /* 100TX Full Duplex Capable */
5426 +#define NWAY_AR_100T4_CAPS 0x0200 /* 100T4 Capable */
5427 +#define NWAY_AR_PAUSE 0x0400 /* Pause operation desired */
5428 +#define NWAY_AR_ASM_DIR 0x0800 /* Asymmetric Pause Direction bit */
5429 +#define NWAY_AR_REMOTE_FAULT 0x2000 /* Remote Fault detected */
5430 +#define NWAY_AR_NEXT_PAGE 0x8000 /* Next Page ability supported */
5432 +/* Link Partner Ability Register (Base Page) */
5433 +#define NWAY_LPAR_SELECTOR_FIELD 0x0000 /* LP protocol selector field */
5434 +#define NWAY_LPAR_10T_HD_CAPS 0x0020 /* LP is 10T Half Duplex Capable */
5435 +#define NWAY_LPAR_10T_FD_CAPS 0x0040 /* LP is 10T Full Duplex Capable */
5436 +#define NWAY_LPAR_100TX_HD_CAPS 0x0080 /* LP is 100TX Half Duplex Capable */
5437 +#define NWAY_LPAR_100TX_FD_CAPS 0x0100 /* LP is 100TX Full Duplex Capable */
5438 +#define NWAY_LPAR_100T4_CAPS 0x0200 /* LP is 100T4 Capable */
5439 +#define NWAY_LPAR_PAUSE 0x0400 /* LP Pause operation desired */
5440 +#define NWAY_LPAR_ASM_DIR 0x0800 /* LP Asymmetric Pause Direction bit */
5441 +#define NWAY_LPAR_REMOTE_FAULT 0x2000 /* LP has detected Remote Fault */
5442 +#define NWAY_LPAR_ACKNOWLEDGE 0x4000 /* LP has rx'd link code word */
5443 +#define NWAY_LPAR_NEXT_PAGE 0x8000 /* Next Page ability supported */
5445 +/* Autoneg Expansion Register */
5446 +#define NWAY_ER_LP_NWAY_CAPS 0x0001 /* LP has Auto Neg Capability */
5447 +#define NWAY_ER_PAGE_RXD 0x0002 /* LP is 10T Half Duplex Capable */
5448 +#define NWAY_ER_NEXT_PAGE_CAPS 0x0004 /* LP is 10T Full Duplex Capable */
5449 +#define NWAY_ER_LP_NEXT_PAGE_CAPS 0x0008 /* LP is 100TX Half Duplex Capable */
5450 +#define NWAY_ER_PAR_DETECT_FAULT 0x0010 /* LP is 100TX Full Duplex Capable */
5452 +/* 1000BASE-T Control Register */
5453 +#define CR_1000T_ASYM_PAUSE 0x0080 /* Advertise asymmetric pause bit */
5454 +#define CR_1000T_HD_CAPS 0x0100 /* Advertise 1000T HD capability */
5455 +#define CR_1000T_FD_CAPS 0x0200 /* Advertise 1000T FD capability */
5456 +#define CR_1000T_REPEATER_DTE 0x0400 /* 1=Repeater/switch device port */
5457 + /* 0=DTE device */
5458 +#define CR_1000T_MS_VALUE 0x0800 /* 1=Configure PHY as Master */
5459 + /* 0=Configure PHY as Slave */
5460 +#define CR_1000T_MS_ENABLE 0x1000 /* 1=Master/Slave manual config value */
5461 + /* 0=Automatic Master/Slave config */
5462 +#define CR_1000T_TEST_MODE_NORMAL 0x0000 /* Normal Operation */
5463 +#define CR_1000T_TEST_MODE_1 0x2000 /* Transmit Waveform test */
5464 +#define CR_1000T_TEST_MODE_2 0x4000 /* Master Transmit Jitter test */
5465 +#define CR_1000T_TEST_MODE_3 0x6000 /* Slave Transmit Jitter test */
5466 +#define CR_1000T_TEST_MODE_4 0x8000 /* Transmitter Distortion test */
5468 +/* 1000BASE-T Status Register */
5469 +#define SR_1000T_IDLE_ERROR_CNT 0x00FF /* Num idle errors since last read */
5470 +#define SR_1000T_ASYM_PAUSE_DIR 0x0100 /* LP asymmetric pause direction bit */
5471 +#define SR_1000T_LP_HD_CAPS 0x0400 /* LP is 1000T HD capable */
5472 +#define SR_1000T_LP_FD_CAPS 0x0800 /* LP is 1000T FD capable */
5473 +#define SR_1000T_REMOTE_RX_STATUS 0x1000 /* Remote receiver OK */
5474 +#define SR_1000T_LOCAL_RX_STATUS 0x2000 /* Local receiver OK */
5475 +#define SR_1000T_MS_CONFIG_RES 0x4000 /* 1=Local Tx is Master, 0=Slave */
5476 +#define SR_1000T_MS_CONFIG_FAULT 0x8000 /* Master/Slave config fault */
5478 +#define SR_1000T_PHY_EXCESSIVE_IDLE_ERR_COUNT 5
5480 +/* PHY 1000 MII Register/Bit Definitions */
5481 +/* PHY Registers defined by IEEE */
5482 +#define PHY_CONTROL 0x00 /* Control Register */
5483 +#define PHY_STATUS 0x01 /* Status Register */
5484 +#define PHY_ID1 0x02 /* Phy Id Reg (word 1) */
5485 +#define PHY_ID2 0x03 /* Phy Id Reg (word 2) */
5486 +#define PHY_AUTONEG_ADV 0x04 /* Autoneg Advertisement */
5487 +#define PHY_LP_ABILITY 0x05 /* Link Partner Ability (Base Page) */
5488 +#define PHY_AUTONEG_EXP 0x06 /* Autoneg Expansion Reg */
5489 +#define PHY_NEXT_PAGE_TX 0x07 /* Next Page Tx */
5490 +#define PHY_LP_NEXT_PAGE 0x08 /* Link Partner Next Page */
5491 +#define PHY_1000T_CTRL 0x09 /* 1000Base-T Control Reg */
5492 +#define PHY_1000T_STATUS 0x0A /* 1000Base-T Status Reg */
5493 +#define PHY_EXT_STATUS 0x0F /* Extended Status Reg */
5496 +#define E1000_EECD_SK 0x00000001 /* NVM Clock */
5497 +#define E1000_EECD_CS 0x00000002 /* NVM Chip Select */
5498 +#define E1000_EECD_DI 0x00000004 /* NVM Data In */
5499 +#define E1000_EECD_DO 0x00000008 /* NVM Data Out */
5500 +#define E1000_EECD_FWE_MASK 0x00000030
5501 +#define E1000_EECD_FWE_DIS 0x00000010 /* Disable FLASH writes */
5502 +#define E1000_EECD_FWE_EN 0x00000020 /* Enable FLASH writes */
5503 +#define E1000_EECD_FWE_SHIFT 4
5504 +#define E1000_EECD_REQ 0x00000040 /* NVM Access Request */
5505 +#define E1000_EECD_GNT 0x00000080 /* NVM Access Grant */
5506 +#define E1000_EECD_PRES 0x00000100 /* NVM Present */
5507 +#define E1000_EECD_SIZE 0x00000200 /* NVM Size (0=64 word 1=256 word) */
5508 +/* NVM Addressing bits based on type 0=small, 1=large */
5509 +#define E1000_EECD_ADDR_BITS 0x00000400
5510 +#define E1000_EECD_TYPE 0x00002000 /* NVM Type (1-SPI, 0-Microwire) */
5511 +#define E1000_NVM_GRANT_ATTEMPTS 1000 /* NVM # attempts to gain grant */
5512 +#define E1000_EECD_AUTO_RD 0x00000200 /* NVM Auto Read done */
5513 +#define E1000_EECD_SIZE_EX_MASK 0x00007800 /* NVM Size */
5514 +#define E1000_EECD_SIZE_EX_SHIFT 11
5515 +#define E1000_EECD_NVADDS 0x00018000 /* NVM Address Size */
5516 +#define E1000_EECD_SELSHAD 0x00020000 /* Select Shadow RAM */
5517 +#define E1000_EECD_INITSRAM 0x00040000 /* Initialize Shadow RAM */
5518 +#define E1000_EECD_FLUPD 0x00080000 /* Update FLASH */
5519 +#define E1000_EECD_AUPDEN 0x00100000 /* Enable Autonomous FLASH update */
5520 +#define E1000_EECD_SHADV 0x00200000 /* Shadow RAM Data Valid */
5521 +#define E1000_EECD_SEC1VAL 0x00400000 /* Sector One Valid */
5522 +#define E1000_EECD_SECVAL_SHIFT 22
5524 +#define E1000_NVM_SWDPIN0 0x0001 /* SWDPIN 0 NVM Value */
5525 +#define E1000_NVM_LED_LOGIC 0x0020 /* Led Logic Word */
5526 +#define E1000_NVM_RW_REG_DATA 16 /* Offset to data in NVM read/write registers */
5527 +#define E1000_NVM_RW_REG_DONE 2 /* Offset to READ/WRITE done bit */
5528 +#define E1000_NVM_RW_REG_START 1 /* Start operation */
5529 +#define E1000_NVM_RW_ADDR_SHIFT 2 /* Shift to the address bits */
5530 +#define E1000_NVM_POLL_WRITE 1 /* Flag for polling for write complete */
5531 +#define E1000_NVM_POLL_READ 0 /* Flag for polling for read complete */
5532 +#define E1000_FLASH_UPDATES 2000
5534 +/* NVM Word Offsets */
5535 +#define NVM_COMPAT 0x0003
5536 +#define NVM_ID_LED_SETTINGS 0x0004
5537 +#define NVM_VERSION 0x0005
5538 +#define NVM_SERDES_AMPLITUDE 0x0006 /* For SERDES output amplitude adjustment. */
5539 +#define NVM_PHY_CLASS_WORD 0x0007
5540 +#define NVM_INIT_CONTROL1_REG 0x000A
5541 +#define NVM_INIT_CONTROL2_REG 0x000F
5542 +#define NVM_SWDEF_PINS_CTRL_PORT_1 0x0010
5543 +#define NVM_INIT_CONTROL3_PORT_B 0x0014
5544 +#define NVM_INIT_3GIO_3 0x001A
5545 +#define NVM_SWDEF_PINS_CTRL_PORT_0 0x0020
5546 +#define NVM_INIT_CONTROL3_PORT_A 0x0024
5547 +#define NVM_CFG 0x0012
5548 +#define NVM_FLASH_VERSION 0x0032
5549 +#define NVM_ALT_MAC_ADDR_PTR 0x0037
5550 +#define NVM_CHECKSUM_REG 0x003F
5552 +#define E1000_NVM_CFG_DONE_PORT_0 0x40000 /* MNG config cycle done */
5553 +#define E1000_NVM_CFG_DONE_PORT_1 0x80000 /* ...for second port */
5555 +/* Mask bits for fields in Word 0x0f of the NVM */
5556 +#define NVM_WORD0F_PAUSE_MASK 0x3000
5557 +#define NVM_WORD0F_PAUSE 0x1000
5558 +#define NVM_WORD0F_ASM_DIR 0x2000
5559 +#define NVM_WORD0F_ANE 0x0800
5560 +#define NVM_WORD0F_SWPDIO_EXT_MASK 0x00F0
5561 +#define NVM_WORD0F_LPLU 0x0001
5563 +/* Mask bits for fields in Word 0x1a of the NVM */
5564 +#define NVM_WORD1A_ASPM_MASK 0x000C
5566 +/* For checksumming, the sum of all words in the NVM should equal 0xBABA. */
5567 +#define NVM_SUM 0xBABA
5569 +#define NVM_MAC_ADDR_OFFSET 0
5570 +#define NVM_PBA_OFFSET_0 8
5571 +#define NVM_PBA_OFFSET_1 9
5572 +#define NVM_RESERVED_WORD 0xFFFF
5573 +#define NVM_PHY_CLASS_A 0x8000
5574 +#define NVM_SERDES_AMPLITUDE_MASK 0x000F
5575 +#define NVM_SIZE_MASK 0x1C00
5576 +#define NVM_SIZE_SHIFT 10
5577 +#define NVM_WORD_SIZE_BASE_SHIFT 6
5578 +#define NVM_SWDPIO_EXT_SHIFT 4
5580 +/* NVM Commands - SPI */
5581 +#define NVM_MAX_RETRY_SPI 5000 /* Max wait of 5ms, for RDY signal */
5582 +#define NVM_READ_OPCODE_SPI 0x03 /* NVM read opcode */
5583 +#define NVM_WRITE_OPCODE_SPI 0x02 /* NVM write opcode */
5584 +#define NVM_A8_OPCODE_SPI 0x08 /* opcode bit-3 = address bit-8 */
5585 +#define NVM_WREN_OPCODE_SPI 0x06 /* NVM set Write Enable latch */
5586 +#define NVM_WRDI_OPCODE_SPI 0x04 /* NVM reset Write Enable latch */
5587 +#define NVM_RDSR_OPCODE_SPI 0x05 /* NVM read Status register */
5588 +#define NVM_WRSR_OPCODE_SPI 0x01 /* NVM write Status register */
5590 +/* SPI NVM Status Register */
5591 +#define NVM_STATUS_RDY_SPI 0x01
5592 +#define NVM_STATUS_WEN_SPI 0x02
5593 +#define NVM_STATUS_BP0_SPI 0x04
5594 +#define NVM_STATUS_BP1_SPI 0x08
5595 +#define NVM_STATUS_WPEN_SPI 0x80
5597 +/* Word definitions for ID LED Settings */
5598 +#define ID_LED_RESERVED_0000 0x0000
5599 +#define ID_LED_RESERVED_FFFF 0xFFFF
5600 +#define ID_LED_DEFAULT ((ID_LED_OFF1_ON2 << 12) | \
5601 + (ID_LED_OFF1_OFF2 << 8) | \
5602 + (ID_LED_DEF1_DEF2 << 4) | \
5603 + (ID_LED_DEF1_DEF2))
5604 +#define ID_LED_DEF1_DEF2 0x1
5605 +#define ID_LED_DEF1_ON2 0x2
5606 +#define ID_LED_DEF1_OFF2 0x3
5607 +#define ID_LED_ON1_DEF2 0x4
5608 +#define ID_LED_ON1_ON2 0x5
5609 +#define ID_LED_ON1_OFF2 0x6
5610 +#define ID_LED_OFF1_DEF2 0x7
5611 +#define ID_LED_OFF1_ON2 0x8
5612 +#define ID_LED_OFF1_OFF2 0x9
5614 +#define IGP_ACTIVITY_LED_MASK 0xFFFFF0FF
5615 +#define IGP_ACTIVITY_LED_ENABLE 0x0300
5616 +#define IGP_LED3_MODE 0x07000000
5618 +/* PCI/PCI-X/PCI-EX Config space */
5619 +#define PCI_HEADER_TYPE_REGISTER 0x0E
5620 +#define PCIE_LINK_STATUS 0x12
5622 +#define PCI_HEADER_TYPE_MULTIFUNC 0x80
5623 +#define PCIE_LINK_WIDTH_MASK 0x3F0
5624 +#define PCIE_LINK_WIDTH_SHIFT 4
5626 +#ifndef ETH_ADDR_LEN
5627 +#define ETH_ADDR_LEN 6
5630 +#define PHY_REVISION_MASK 0xFFFFFFF0
5631 +#define MAX_PHY_REG_ADDRESS 0x1F /* 5 bit address bus (0-0x1F) */
5632 +#define MAX_PHY_MULTI_PAGE_REG 0xF
5634 +/* Bit definitions for valid PHY IDs. */
5639 +#define M88E1000_E_PHY_ID 0x01410C50
5640 +#define M88E1000_I_PHY_ID 0x01410C30
5641 +#define M88E1011_I_PHY_ID 0x01410C20
5642 +#define IGP01E1000_I_PHY_ID 0x02A80380
5643 +#define M88E1011_I_REV_4 0x04
5644 +#define M88E1111_I_PHY_ID 0x01410CC0
5645 +#define GG82563_E_PHY_ID 0x01410CA0
5646 +#define IGP03E1000_E_PHY_ID 0x02A80390
5647 +#define IFE_E_PHY_ID 0x02A80330
5648 +#define IFE_PLUS_E_PHY_ID 0x02A80320
5649 +#define IFE_C_E_PHY_ID 0x02A80310
5650 +#define IGP04E1000_E_PHY_ID 0x02A80391
5651 +#define M88_VENDOR 0x0141
5653 +/* M88E1000 Specific Registers */
5654 +#define M88E1000_PHY_SPEC_CTRL 0x10 /* PHY Specific Control Register */
5655 +#define M88E1000_PHY_SPEC_STATUS 0x11 /* PHY Specific Status Register */
5656 +#define M88E1000_INT_ENABLE 0x12 /* Interrupt Enable Register */
5657 +#define M88E1000_INT_STATUS 0x13 /* Interrupt Status Register */
5658 +#define M88E1000_EXT_PHY_SPEC_CTRL 0x14 /* Extended PHY Specific Control */
5659 +#define M88E1000_RX_ERR_CNTR 0x15 /* Receive Error Counter */
5661 +#define M88E1000_PHY_EXT_CTRL 0x1A /* PHY extend control register */
5662 +#define M88E1000_PHY_PAGE_SELECT 0x1D /* Reg 29 for page number setting */
5663 +#define M88E1000_PHY_GEN_CONTROL 0x1E /* Its meaning depends on reg 29 */
5664 +#define M88E1000_PHY_VCO_REG_BIT8 0x100 /* Bits 8 & 11 are adjusted for */
5665 +#define M88E1000_PHY_VCO_REG_BIT11 0x800 /* improved BER performance */
5667 +/* M88E1000 PHY Specific Control Register */
5668 +#define M88E1000_PSCR_JABBER_DISABLE 0x0001 /* 1=Jabber Function disabled */
5669 +#define M88E1000_PSCR_POLARITY_REVERSAL 0x0002 /* 1=Polarity Reversal enabled */
5670 +#define M88E1000_PSCR_SQE_TEST 0x0004 /* 1=SQE Test enabled */
5671 +/* 1=CLK125 low, 0=CLK125 toggling */
5672 +#define M88E1000_PSCR_CLK125_DISABLE 0x0010
5673 +#define M88E1000_PSCR_MDI_MANUAL_MODE 0x0000 /* MDI Crossover Mode bits 6:5 */
5674 + /* Manual MDI configuration */
5675 +#define M88E1000_PSCR_MDIX_MANUAL_MODE 0x0020 /* Manual MDIX configuration */
5676 +/* 1000BASE-T: Auto crossover, 100BASE-TX/10BASE-T: MDI Mode */
5677 +#define M88E1000_PSCR_AUTO_X_1000T 0x0040
5678 +/* Auto crossover enabled all speeds */
5679 +#define M88E1000_PSCR_AUTO_X_MODE 0x0060
5681 + * 1=Enable Extended 10BASE-T distance (Lower 10BASE-T Rx Threshold
5682 + * 0=Normal 10BASE-T Rx Threshold
5684 +#define M88E1000_PSCR_EN_10BT_EXT_DIST 0x0080
5685 +/* 1=5-bit interface in 100BASE-TX, 0=MII interface in 100BASE-TX */
5686 +#define M88E1000_PSCR_MII_5BIT_ENABLE 0x0100
5687 +#define M88E1000_PSCR_SCRAMBLER_DISABLE 0x0200 /* 1=Scrambler disable */
5688 +#define M88E1000_PSCR_FORCE_LINK_GOOD 0x0400 /* 1=Force link good */
5689 +#define M88E1000_PSCR_ASSERT_CRS_ON_TX 0x0800 /* 1=Assert CRS on Transmit */
5691 +/* M88E1000 PHY Specific Status Register */
5692 +#define M88E1000_PSSR_JABBER 0x0001 /* 1=Jabber */
5693 +#define M88E1000_PSSR_REV_POLARITY 0x0002 /* 1=Polarity reversed */
5694 +#define M88E1000_PSSR_DOWNSHIFT 0x0020 /* 1=Downshifted */
5695 +#define M88E1000_PSSR_MDIX 0x0040 /* 1=MDIX; 0=MDI */
5703 +#define M88E1000_PSSR_CABLE_LENGTH 0x0380
5704 +#define M88E1000_PSSR_LINK 0x0400 /* 1=Link up, 0=Link down */
5705 +#define M88E1000_PSSR_SPD_DPLX_RESOLVED 0x0800 /* 1=Speed & Duplex resolved */
5706 +#define M88E1000_PSSR_PAGE_RCVD 0x1000 /* 1=Page received */
5707 +#define M88E1000_PSSR_DPLX 0x2000 /* 1=Duplex 0=Half Duplex */
5708 +#define M88E1000_PSSR_SPEED 0xC000 /* Speed, bits 14:15 */
5709 +#define M88E1000_PSSR_10MBS 0x0000 /* 00=10Mbs */
5710 +#define M88E1000_PSSR_100MBS 0x4000 /* 01=100Mbs */
5711 +#define M88E1000_PSSR_1000MBS 0x8000 /* 10=1000Mbs */
5713 +#define M88E1000_PSSR_CABLE_LENGTH_SHIFT 7
5715 +/* M88E1000 Extended PHY Specific Control Register */
5716 +#define M88E1000_EPSCR_FIBER_LOOPBACK 0x4000 /* 1=Fiber loopback */
5718 + * 1 = Lost lock detect enabled.
5719 + * Will assert lost lock and bring
5720 + * link down if idle not seen
5721 + * within 1ms in 1000BASE-T
5723 +#define M88E1000_EPSCR_DOWN_NO_IDLE 0x8000
5725 + * Number of times we will attempt to autonegotiate before downshifting if we
5728 +#define M88E1000_EPSCR_MASTER_DOWNSHIFT_MASK 0x0C00
5729 +#define M88E1000_EPSCR_MASTER_DOWNSHIFT_1X 0x0000
5730 +#define M88E1000_EPSCR_MASTER_DOWNSHIFT_2X 0x0400
5731 +#define M88E1000_EPSCR_MASTER_DOWNSHIFT_3X 0x0800
5732 +#define M88E1000_EPSCR_MASTER_DOWNSHIFT_4X 0x0C00
5734 + * Number of times we will attempt to autonegotiate before downshifting if we
5737 +#define M88E1000_EPSCR_SLAVE_DOWNSHIFT_MASK 0x0300
5738 +#define M88E1000_EPSCR_SLAVE_DOWNSHIFT_DIS 0x0000
5739 +#define M88E1000_EPSCR_SLAVE_DOWNSHIFT_1X 0x0100
5740 +#define M88E1000_EPSCR_SLAVE_DOWNSHIFT_2X 0x0200
5741 +#define M88E1000_EPSCR_SLAVE_DOWNSHIFT_3X 0x0300
5742 +#define M88E1000_EPSCR_TX_CLK_2_5 0x0060 /* 2.5 MHz TX_CLK */
5743 +#define M88E1000_EPSCR_TX_CLK_25 0x0070 /* 25 MHz TX_CLK */
5744 +#define M88E1000_EPSCR_TX_CLK_0 0x0000 /* NO TX_CLK */
5746 +/* M88EC018 Rev 2 specific DownShift settings */
5747 +#define M88EC018_EPSCR_DOWNSHIFT_COUNTER_MASK 0x0E00
5748 +#define M88EC018_EPSCR_DOWNSHIFT_COUNTER_1X 0x0000
5749 +#define M88EC018_EPSCR_DOWNSHIFT_COUNTER_2X 0x0200
5750 +#define M88EC018_EPSCR_DOWNSHIFT_COUNTER_3X 0x0400
5751 +#define M88EC018_EPSCR_DOWNSHIFT_COUNTER_4X 0x0600
5752 +#define M88EC018_EPSCR_DOWNSHIFT_COUNTER_5X 0x0800
5753 +#define M88EC018_EPSCR_DOWNSHIFT_COUNTER_6X 0x0A00
5754 +#define M88EC018_EPSCR_DOWNSHIFT_COUNTER_7X 0x0C00
5755 +#define M88EC018_EPSCR_DOWNSHIFT_COUNTER_8X 0x0E00
5760 + * 4-0: register offset
5762 +#define GG82563_PAGE_SHIFT 5
5763 +#define GG82563_REG(page, reg) \
5764 + (((page) << GG82563_PAGE_SHIFT) | ((reg) & MAX_PHY_REG_ADDRESS))
5765 +#define GG82563_MIN_ALT_REG 30
5767 +/* GG82563 Specific Registers */
5768 +#define GG82563_PHY_SPEC_CTRL \
5769 + GG82563_REG(0, 16) /* PHY Specific Control */
5770 +#define GG82563_PHY_SPEC_STATUS \
5771 + GG82563_REG(0, 17) /* PHY Specific Status */
5772 +#define GG82563_PHY_INT_ENABLE \
5773 + GG82563_REG(0, 18) /* Interrupt Enable */
5774 +#define GG82563_PHY_SPEC_STATUS_2 \
5775 + GG82563_REG(0, 19) /* PHY Specific Status 2 */
5776 +#define GG82563_PHY_RX_ERR_CNTR \
5777 + GG82563_REG(0, 21) /* Receive Error Counter */
5778 +#define GG82563_PHY_PAGE_SELECT \
5779 + GG82563_REG(0, 22) /* Page Select */
5780 +#define GG82563_PHY_SPEC_CTRL_2 \
5781 + GG82563_REG(0, 26) /* PHY Specific Control 2 */
5782 +#define GG82563_PHY_PAGE_SELECT_ALT \
5783 + GG82563_REG(0, 29) /* Alternate Page Select */
5784 +#define GG82563_PHY_TEST_CLK_CTRL \
5785 + GG82563_REG(0, 30) /* Test Clock Control (use reg. 29 to select) */
5787 +#define GG82563_PHY_MAC_SPEC_CTRL \
5788 + GG82563_REG(2, 21) /* MAC Specific Control Register */
5789 +#define GG82563_PHY_MAC_SPEC_CTRL_2 \
5790 + GG82563_REG(2, 26) /* MAC Specific Control 2 */
5792 +#define GG82563_PHY_DSP_DISTANCE \
5793 + GG82563_REG(5, 26) /* DSP Distance */
5795 +/* Page 193 - Port Control Registers */
5796 +#define GG82563_PHY_KMRN_MODE_CTRL \
5797 + GG82563_REG(193, 16) /* Kumeran Mode Control */
5798 +#define GG82563_PHY_PORT_RESET \
5799 + GG82563_REG(193, 17) /* Port Reset */
5800 +#define GG82563_PHY_REVISION_ID \
5801 + GG82563_REG(193, 18) /* Revision ID */
5802 +#define GG82563_PHY_DEVICE_ID \
5803 + GG82563_REG(193, 19) /* Device ID */
5804 +#define GG82563_PHY_PWR_MGMT_CTRL \
5805 + GG82563_REG(193, 20) /* Power Management Control */
5806 +#define GG82563_PHY_RATE_ADAPT_CTRL \
5807 + GG82563_REG(193, 25) /* Rate Adaptation Control */
5809 +/* Page 194 - KMRN Registers */
5810 +#define GG82563_PHY_KMRN_FIFO_CTRL_STAT \
5811 + GG82563_REG(194, 16) /* FIFO's Control/Status */
5812 +#define GG82563_PHY_KMRN_CTRL \
5813 + GG82563_REG(194, 17) /* Control */
5814 +#define GG82563_PHY_INBAND_CTRL \
5815 + GG82563_REG(194, 18) /* Inband Control */
5816 +#define GG82563_PHY_KMRN_DIAGNOSTIC \
5817 + GG82563_REG(194, 19) /* Diagnostic */
5818 +#define GG82563_PHY_ACK_TIMEOUTS \
5819 + GG82563_REG(194, 20) /* Acknowledge Timeouts */
5820 +#define GG82563_PHY_ADV_ABILITY \
5821 + GG82563_REG(194, 21) /* Advertised Ability */
5822 +#define GG82563_PHY_LINK_PARTNER_ADV_ABILITY \
5823 + GG82563_REG(194, 23) /* Link Partner Advertised Ability */
5824 +#define GG82563_PHY_ADV_NEXT_PAGE \
5825 + GG82563_REG(194, 24) /* Advertised Next Page */
5826 +#define GG82563_PHY_LINK_PARTNER_ADV_NEXT_PAGE \
5827 + GG82563_REG(194, 25) /* Link Partner Advertised Next page */
5828 +#define GG82563_PHY_KMRN_MISC \
5829 + GG82563_REG(194, 26) /* Misc. */
5832 +#define E1000_MDIC_DATA_MASK 0x0000FFFF
5833 +#define E1000_MDIC_REG_MASK 0x001F0000
5834 +#define E1000_MDIC_REG_SHIFT 16
5835 +#define E1000_MDIC_PHY_MASK 0x03E00000
5836 +#define E1000_MDIC_PHY_SHIFT 21
5837 +#define E1000_MDIC_OP_WRITE 0x04000000
5838 +#define E1000_MDIC_OP_READ 0x08000000
5839 +#define E1000_MDIC_READY 0x10000000
5840 +#define E1000_MDIC_INT_EN 0x20000000
5841 +#define E1000_MDIC_ERROR 0x40000000
5843 +/* SerDes Control */
5844 +#define E1000_GEN_CTL_READY 0x80000000
5845 +#define E1000_GEN_CTL_ADDRESS_SHIFT 8
5846 +#define E1000_GEN_POLL_TIMEOUT 640
5848 +/* LinkSec register fields */
5849 +#define E1000_LSECTXCAP_SUM_MASK 0x00FF0000
5850 +#define E1000_LSECTXCAP_SUM_SHIFT 16
5851 +#define E1000_LSECRXCAP_SUM_MASK 0x00FF0000
5852 +#define E1000_LSECRXCAP_SUM_SHIFT 16
5854 +#define E1000_LSECTXCTRL_EN_MASK 0x00000003
5855 +#define E1000_LSECTXCTRL_DISABLE 0x0
5856 +#define E1000_LSECTXCTRL_AUTH 0x1
5857 +#define E1000_LSECTXCTRL_AUTH_ENCRYPT 0x2
5858 +#define E1000_LSECTXCTRL_AISCI 0x00000020
5859 +#define E1000_LSECTXCTRL_PNTHRSH_MASK 0xFFFFFF00
5860 +#define E1000_LSECTXCTRL_RSV_MASK 0x000000D8
5862 +#define E1000_LSECRXCTRL_EN_MASK 0x0000000C
5863 +#define E1000_LSECRXCTRL_EN_SHIFT 2
5864 +#define E1000_LSECRXCTRL_DISABLE 0x0
5865 +#define E1000_LSECRXCTRL_CHECK 0x1
5866 +#define E1000_LSECRXCTRL_STRICT 0x2
5867 +#define E1000_LSECRXCTRL_DROP 0x3
5868 +#define E1000_LSECRXCTRL_PLSH 0x00000040
5869 +#define E1000_LSECRXCTRL_RP 0x00000080
5870 +#define E1000_LSECRXCTRL_RSV_MASK 0xFFFFFF33
5872 +#endif /* _E1000_DEFINES_H_ */
5873 diff -Nru vanilla/drivers/net/igb/e1000_hw.h linux-i686-2.6.22/drivers/net/igb/e1000_hw.h
5874 --- vanilla/drivers/net/igb/e1000_hw.h 1969-12-31 19:00:00.000000000 -0500
5875 +++ linux-i686-2.6.22/drivers/net/igb/e1000_hw.h 2009-07-16 19:25:22.000000000 -0400
5877 +/*******************************************************************************
5879 + Intel(R) Gigabit Ethernet Linux driver
5880 + Copyright(c) 2007-2008 Intel Corporation.
5882 + This program is free software; you can redistribute it and/or modify it
5883 + under the terms and conditions of the GNU General Public License,
5884 + version 2, as published by the Free Software Foundation.
5886 + This program is distributed in the hope it will be useful, but WITHOUT
5887 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
5888 + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
5891 + You should have received a copy of the GNU General Public License along with
5892 + this program; if not, write to the Free Software Foundation, Inc.,
5893 + 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
5895 + The full GNU General Public License is included in this distribution in
5896 + the file called "COPYING".
5898 + Contact Information:
5899 + e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
5900 + Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
5902 +*******************************************************************************/
5904 +#ifndef _E1000_HW_H_
5905 +#define _E1000_HW_H_
5907 +#include "e1000_osdep.h"
5908 +#include "e1000_regs.h"
5909 +#include "e1000_defines.h"
5913 +#define E1000_DEV_ID_82576 0x10C9
5914 +#define E1000_DEV_ID_82576_FIBER 0x10E6
5915 +#define E1000_DEV_ID_82576_SERDES 0x10E7
5916 +#define E1000_DEV_ID_82575EB_COPPER 0x10A7
5917 +#define E1000_DEV_ID_82575EB_FIBER_SERDES 0x10A9
5918 +#define E1000_DEV_ID_82575GB_QUAD_COPPER 0x10D6
5919 +#define E1000_REVISION_0 0
5920 +#define E1000_REVISION_1 1
5921 +#define E1000_REVISION_2 2
5922 +#define E1000_REVISION_3 3
5923 +#define E1000_REVISION_4 4
5925 +#define E1000_FUNC_0 0
5926 +#define E1000_FUNC_1 1
5928 +enum e1000_mac_type {
5929 + e1000_undefined = 0,
5932 + e1000_num_macs /* List is 1-based, so subtract 1 for true count. */
5935 +enum e1000_media_type {
5936 + e1000_media_type_unknown = 0,
5937 + e1000_media_type_copper = 1,
5938 + e1000_media_type_fiber = 2,
5939 + e1000_media_type_internal_serdes = 3,
5940 + e1000_num_media_types
5943 +enum e1000_nvm_type {
5944 + e1000_nvm_unknown = 0,
5946 + e1000_nvm_eeprom_spi,
5947 + e1000_nvm_flash_hw,
5948 + e1000_nvm_flash_sw
5951 +enum e1000_nvm_override {
5952 + e1000_nvm_override_none = 0,
5953 + e1000_nvm_override_spi_small,
5954 + e1000_nvm_override_spi_large,
5957 +enum e1000_phy_type {
5958 + e1000_phy_unknown = 0,
5963 + e1000_phy_gg82563,
5969 +enum e1000_bus_type {
5970 + e1000_bus_type_unknown = 0,
5971 + e1000_bus_type_pci,
5972 + e1000_bus_type_pcix,
5973 + e1000_bus_type_pci_express,
5974 + e1000_bus_type_reserved
5977 +enum e1000_bus_speed {
5978 + e1000_bus_speed_unknown = 0,
5979 + e1000_bus_speed_33,
5980 + e1000_bus_speed_66,
5981 + e1000_bus_speed_100,
5982 + e1000_bus_speed_120,
5983 + e1000_bus_speed_133,
5984 + e1000_bus_speed_2500,
5985 + e1000_bus_speed_5000,
5986 + e1000_bus_speed_reserved
5989 +enum e1000_bus_width {
5990 + e1000_bus_width_unknown = 0,
5991 + e1000_bus_width_pcie_x1,
5992 + e1000_bus_width_pcie_x2,
5993 + e1000_bus_width_pcie_x4 = 4,
5994 + e1000_bus_width_pcie_x8 = 8,
5995 + e1000_bus_width_32,
5996 + e1000_bus_width_64,
5997 + e1000_bus_width_reserved
6000 +enum e1000_1000t_rx_status {
6001 + e1000_1000t_rx_status_not_ok = 0,
6002 + e1000_1000t_rx_status_ok,
6003 + e1000_1000t_rx_status_undefined = 0xFF
6006 +enum e1000_rev_polarity {
6007 + e1000_rev_polarity_normal = 0,
6008 + e1000_rev_polarity_reversed,
6009 + e1000_rev_polarity_undefined = 0xFF
6012 +enum e1000_fc_type {
6013 + e1000_fc_none = 0,
6014 + e1000_fc_rx_pause,
6015 + e1000_fc_tx_pause,
6017 + e1000_fc_default = 0xFF
6020 +enum e1000_ms_type {
6021 + e1000_ms_hw_default = 0,
6022 + e1000_ms_force_master,
6023 + e1000_ms_force_slave,
6027 +enum e1000_smart_speed {
6028 + e1000_smart_speed_default = 0,
6029 + e1000_smart_speed_on,
6030 + e1000_smart_speed_off
6033 +/* Receive Descriptor */
6034 +struct e1000_rx_desc {
6035 + __le64 buffer_addr; /* Address of the descriptor's data buffer */
6036 + __le16 length; /* Length of data DMAed into data buffer */
6037 + __le16 csum; /* Packet checksum */
6038 + u8 status; /* Descriptor status */
6039 + u8 errors; /* Descriptor Errors */
6043 +/* Receive Descriptor - Extended */
6044 +union e1000_rx_desc_extended {
6046 + __le64 buffer_addr;
6051 + __le32 mrq; /* Multiple Rx Queues */
6053 + __le32 rss; /* RSS Hash */
6055 + __le16 ip_id; /* IP id */
6056 + __le16 csum; /* Packet Checksum */
6061 + __le32 status_error; /* ext status/error */
6063 + __le16 vlan; /* VLAN tag */
6065 + } wb; /* writeback */
6068 +#define MAX_PS_BUFFERS 4
6069 +/* Receive Descriptor - Packet Split */
6070 +union e1000_rx_desc_packet_split {
6072 + /* one buffer for protocol header(s), three data buffers */
6073 + __le64 buffer_addr[MAX_PS_BUFFERS];
6077 + __le32 mrq; /* Multiple Rx Queues */
6079 + __le32 rss; /* RSS Hash */
6081 + __le16 ip_id; /* IP id */
6082 + __le16 csum; /* Packet Checksum */
6087 + __le32 status_error; /* ext status/error */
6088 + __le16 length0; /* length of buffer 0 */
6089 + __le16 vlan; /* VLAN tag */
6092 + __le16 header_status;
6093 + __le16 length[3]; /* length of buffers 1-3 */
6096 + } wb; /* writeback */
6099 +/* Transmit Descriptor */
6100 +struct e1000_tx_desc {
6101 + __le64 buffer_addr; /* Address of the descriptor's data buffer */
6105 + __le16 length; /* Data buffer length */
6106 + u8 cso; /* Checksum offset */
6107 + u8 cmd; /* Descriptor control */
6113 + u8 status; /* Descriptor status */
6114 + u8 css; /* Checksum start */
6120 +/* Offload Context Descriptor */
6121 +struct e1000_context_desc {
6125 + u8 ipcss; /* IP checksum start */
6126 + u8 ipcso; /* IP checksum offset */
6127 + __le16 ipcse; /* IP checksum end */
6131 + __le32 tcp_config;
6133 + u8 tucss; /* TCP checksum start */
6134 + u8 tucso; /* TCP checksum offset */
6135 + __le16 tucse; /* TCP checksum end */
6138 + __le32 cmd_and_length;
6142 + u8 status; /* Descriptor status */
6143 + u8 hdr_len; /* Header length */
6144 + __le16 mss; /* Maximum segment size */
6149 +/* Offload data descriptor */
6150 +struct e1000_data_desc {
6151 + __le64 buffer_addr; /* Address of the descriptor's buffer address */
6155 + __le16 length; /* Data buffer length */
6163 + u8 status; /* Descriptor status */
6164 + u8 popts; /* Packet Options */
6170 +/* Statistics counters collected by the MAC */
6171 +struct e1000_hw_stats {
6249 +struct e1000_phy_stats {
6251 + u32 receive_errors;
6254 +struct e1000_host_mng_dhcp_cookie {
6265 +/* Host Interface "Rev 1" */
6266 +struct e1000_host_command_header {
6268 + u8 command_length;
6269 + u8 command_options;
6273 +#define E1000_HI_MAX_DATA_LENGTH 252
6274 +struct e1000_host_command_info {
6275 + struct e1000_host_command_header command_header;
6276 + u8 command_data[E1000_HI_MAX_DATA_LENGTH];
6279 +/* Host Interface "Rev 2" */
6280 +struct e1000_host_mng_command_header {
6285 + u16 command_length;
6288 +#define E1000_HI_MAX_MNG_DATA_LENGTH 0x6F8
6289 +struct e1000_host_mng_command_info {
6290 + struct e1000_host_mng_command_header command_header;
6291 + u8 command_data[E1000_HI_MAX_MNG_DATA_LENGTH];
6294 +#include "e1000_mac.h"
6295 +#include "e1000_phy.h"
6296 +#include "e1000_nvm.h"
6297 +#include "e1000_manage.h"
6299 +struct e1000_mac_operations {
6300 + /* Function pointers for the MAC. */
6301 + s32 (*init_params)(struct e1000_hw *);
6302 + s32 (*blink_led)(struct e1000_hw *);
6303 + s32 (*check_for_link)(struct e1000_hw *);
6304 + bool (*check_mng_mode)(struct e1000_hw *hw);
6305 + s32 (*cleanup_led)(struct e1000_hw *);
6306 + void (*clear_hw_cntrs)(struct e1000_hw *);
6307 + void (*clear_vfta)(struct e1000_hw *);
6308 + s32 (*get_bus_info)(struct e1000_hw *);
6309 + s32 (*get_link_up_info)(struct e1000_hw *, u16 *, u16 *);
6310 + s32 (*led_on)(struct e1000_hw *);
6311 + s32 (*led_off)(struct e1000_hw *);
6312 + void (*update_mc_addr_list)(struct e1000_hw *, u8 *, u32, u32, u32);
6313 + s32 (*reset_hw)(struct e1000_hw *);
6314 + s32 (*init_hw)(struct e1000_hw *);
6315 + void (*shutdown_serdes)(struct e1000_hw *);
6316 + s32 (*setup_link)(struct e1000_hw *);
6317 + s32 (*setup_physical_interface)(struct e1000_hw *);
6318 + s32 (*setup_led)(struct e1000_hw *);
6319 + void (*write_vfta)(struct e1000_hw *, u32, u32);
6320 + void (*mta_set)(struct e1000_hw *, u32);
6321 + void (*config_collision_dist)(struct e1000_hw*);
6322 + void (*rar_set)(struct e1000_hw*, u8*, u32);
6323 + s32 (*read_mac_addr)(struct e1000_hw*);
6324 + s32 (*validate_mdi_setting)(struct e1000_hw*);
6325 + s32 (*mng_host_if_write)(struct e1000_hw*, u8*, u16, u16, u8*);
6326 + s32 (*mng_write_cmd_header)(struct e1000_hw *hw,
6327 + struct e1000_host_mng_command_header*);
6328 + s32 (*mng_enable_host_if)(struct e1000_hw*);
6329 + s32 (*wait_autoneg)(struct e1000_hw*);
6332 +struct e1000_phy_operations {
6333 + s32 (*init_params)(struct e1000_hw *);
6334 + s32 (*acquire)(struct e1000_hw *);
6335 + s32 (*check_polarity)(struct e1000_hw *);
6336 + s32 (*check_reset_block)(struct e1000_hw *);
6337 + s32 (*commit)(struct e1000_hw *);
6338 + s32 (*force_speed_duplex)(struct e1000_hw *);
6339 + s32 (*get_cfg_done)(struct e1000_hw *hw);
6340 + s32 (*get_cable_length)(struct e1000_hw *);
6341 + s32 (*get_info)(struct e1000_hw *);
6342 + s32 (*read_reg)(struct e1000_hw *, u32, u16 *);
6343 + void (*release)(struct e1000_hw *);
6344 + s32 (*reset)(struct e1000_hw *);
6345 + s32 (*set_d0_lplu_state)(struct e1000_hw *, bool);
6346 + s32 (*set_d3_lplu_state)(struct e1000_hw *, bool);
6347 + s32 (*write_reg)(struct e1000_hw *, u32, u16);
6348 + void (*power_up)(struct e1000_hw *);
6349 + void (*power_down)(struct e1000_hw *);
6352 +struct e1000_nvm_operations {
6353 + s32 (*init_params)(struct e1000_hw *);
6354 + s32 (*acquire)(struct e1000_hw *);
6355 + s32 (*read)(struct e1000_hw *, u16, u16, u16 *);
6356 + void (*release)(struct e1000_hw *);
6357 + void (*reload)(struct e1000_hw *);
6358 + s32 (*update)(struct e1000_hw *);
6359 + s32 (*valid_led_default)(struct e1000_hw *, u16 *);
6360 + s32 (*validate)(struct e1000_hw *);
6361 + s32 (*write)(struct e1000_hw *, u16, u16, u16 *);
6364 +struct e1000_mac_info {
6365 + struct e1000_mac_operations ops;
6369 + enum e1000_mac_type type;
6371 + u32 collision_delta;
6372 + u32 ledctl_default;
6375 + u32 mc_filter_type;
6376 + u32 tx_packet_delta;
6379 + u16 current_ifs_val;
6383 + u16 ifs_step_size;
6384 + u16 mta_reg_count;
6385 + u16 rar_entry_count;
6387 + u8 forced_speed_duplex;
6389 + bool adaptive_ifs;
6390 + bool arc_subsystem_valid;
6391 + bool asf_firmware_present;
6393 + bool autoneg_failed;
6394 + bool get_link_status;
6396 + bool serdes_has_link;
6397 + bool tx_pkt_filtering;
6400 +struct e1000_phy_info {
6401 + struct e1000_phy_operations ops;
6402 + enum e1000_phy_type type;
6404 + enum e1000_1000t_rx_status local_rx;
6405 + enum e1000_1000t_rx_status remote_rx;
6406 + enum e1000_ms_type ms_type;
6407 + enum e1000_ms_type original_ms_type;
6408 + enum e1000_rev_polarity cable_polarity;
6409 + enum e1000_smart_speed smart_speed;
6413 + u32 reset_delay_us; /* in usec */
6416 + enum e1000_media_type media_type;
6418 + u16 autoneg_advertised;
6421 + u16 max_cable_length;
6422 + u16 min_cable_length;
6426 + bool disable_polarity_correction;
6428 + bool polarity_correction;
6429 + bool reset_disable;
6430 + bool speed_downgraded;
6431 + bool autoneg_wait_to_complete;
6434 +struct e1000_nvm_info {
6435 + struct e1000_nvm_operations ops;
6436 + enum e1000_nvm_type type;
6437 + enum e1000_nvm_override override;
6439 + u32 flash_bank_size;
6440 + u32 flash_base_addr;
6449 +struct e1000_bus_info {
6450 + enum e1000_bus_type type;
6451 + enum e1000_bus_speed speed;
6452 + enum e1000_bus_width width;
6458 +struct e1000_fc_info {
6459 + u32 high_water; /* Flow control high-water mark */
6460 + u32 low_water; /* Flow control low-water mark */
6461 + u16 pause_time; /* Flow control pause timer */
6462 + bool send_xon; /* Flow control send XON */
6463 + bool strict_ieee; /* Strict IEEE mode */
6464 + enum e1000_fc_type type; /* Type of flow control */
6465 + enum e1000_fc_type original_type;
6468 +struct e1000_dev_spec_82575 {
6469 + bool sgmii_active;
6472 +struct e1000_dev_spec_vf {
6479 + u8 __iomem *hw_addr;
6480 + u8 __iomem *flash_address;
6481 + unsigned long io_base;
6483 + struct e1000_mac_info mac;
6484 + struct e1000_fc_info fc;
6485 + struct e1000_phy_info phy;
6486 + struct e1000_nvm_info nvm;
6487 + struct e1000_bus_info bus;
6488 + struct e1000_host_mng_dhcp_cookie mng_cookie;
6491 + struct e1000_dev_spec_82575 _82575;
6492 + struct e1000_dev_spec_vf vf;
6496 + u16 subsystem_vendor_id;
6497 + u16 subsystem_device_id;
6503 +#include "e1000_82575.h"
6505 +/* These functions must be implemented by drivers */
6506 +s32 e1000_read_pcie_cap_reg(struct e1000_hw *hw, u32 reg, u16 *value);
6507 +void e1000_read_pci_cfg(struct e1000_hw *hw, u32 reg, u16 *value);
6510 diff -Nru vanilla/drivers/net/igb/e1000_mac.c linux-i686-2.6.22/drivers/net/igb/e1000_mac.c
6511 --- vanilla/drivers/net/igb/e1000_mac.c 1969-12-31 19:00:00.000000000 -0500
6512 +++ linux-i686-2.6.22/drivers/net/igb/e1000_mac.c 2009-07-16 19:25:22.000000000 -0400
6514 +/*******************************************************************************
6516 + Intel(R) Gigabit Ethernet Linux driver
6517 + Copyright(c) 2007-2008 Intel Corporation.
6519 + This program is free software; you can redistribute it and/or modify it
6520 + under the terms and conditions of the GNU General Public License,
6521 + version 2, as published by the Free Software Foundation.
6523 + This program is distributed in the hope it will be useful, but WITHOUT
6524 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
6525 + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
6528 + You should have received a copy of the GNU General Public License along with
6529 + this program; if not, write to the Free Software Foundation, Inc.,
6530 + 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
6532 + The full GNU General Public License is included in this distribution in
6533 + the file called "COPYING".
6535 + Contact Information:
6536 + e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
6537 + Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
6539 +*******************************************************************************/
6541 +#include "e1000_api.h"
6543 +static s32 e1000_set_default_fc_generic(struct e1000_hw *hw);
6544 +static s32 e1000_commit_fc_settings_generic(struct e1000_hw *hw);
6545 +static s32 e1000_poll_fiber_serdes_link_generic(struct e1000_hw *hw);
6546 +static s32 e1000_validate_mdi_setting_generic(struct e1000_hw *hw);
6549 + * e1000_init_mac_ops_generic - Initialize MAC function pointers
6550 + * @hw: pointer to the HW structure
6552 + * Setups up the function pointers to no-op functions
6554 +void e1000_init_mac_ops_generic(struct e1000_hw *hw)
6556 + struct e1000_mac_info *mac = &hw->mac;
6557 + DEBUGFUNC("e1000_init_mac_ops_generic");
6559 + /* General Setup */
6560 + mac->ops.read_mac_addr = e1000_read_mac_addr_generic;
6561 + mac->ops.config_collision_dist = e1000_config_collision_dist_generic;
6563 + mac->ops.wait_autoneg = e1000_wait_autoneg_generic;
6565 + mac->ops.mng_host_if_write = e1000_mng_host_if_write_generic;
6566 + mac->ops.mng_write_cmd_header = e1000_mng_write_cmd_header_generic;
6567 + mac->ops.mng_enable_host_if = e1000_mng_enable_host_if_generic;
6568 + /* VLAN, MC, etc. */
6569 + mac->ops.rar_set = e1000_rar_set_generic;
6570 + mac->ops.validate_mdi_setting = e1000_validate_mdi_setting_generic;
6574 + * e1000_get_bus_info_pcie_generic - Get PCIe bus information
6575 + * @hw: pointer to the HW structure
6577 + * Determines and stores the system bus information for a particular
6578 + * network interface. The following bus information is determined and stored:
6579 + * bus speed, bus width, type (PCIe), and PCIe function.
6581 +s32 e1000_get_bus_info_pcie_generic(struct e1000_hw *hw)
6583 + struct e1000_bus_info *bus = &hw->bus;
6586 + u16 pcie_link_status, pci_header_type;
6588 + DEBUGFUNC("e1000_get_bus_info_pcie_generic");
6590 + bus->type = e1000_bus_type_pci_express;
6591 + bus->speed = e1000_bus_speed_2500;
6593 + ret_val = e1000_read_pcie_cap_reg(hw,
6595 + &pcie_link_status);
6597 + bus->width = e1000_bus_width_unknown;
6599 + bus->width = (enum e1000_bus_width)((pcie_link_status &
6600 + PCIE_LINK_WIDTH_MASK) >>
6601 + PCIE_LINK_WIDTH_SHIFT);
6603 + e1000_read_pci_cfg(hw, PCI_HEADER_TYPE_REGISTER, &pci_header_type);
6604 + if (pci_header_type & PCI_HEADER_TYPE_MULTIFUNC) {
6605 + status = E1000_READ_REG(hw, E1000_STATUS);
6606 + bus->func = (status & E1000_STATUS_FUNC_MASK)
6607 + >> E1000_STATUS_FUNC_SHIFT;
6612 + return E1000_SUCCESS;
6616 + * e1000_clear_vfta_generic - Clear VLAN filter table
6617 + * @hw: pointer to the HW structure
6619 + * Clears the register array which contains the VLAN filter table by
6620 + * setting all the values to 0.
6622 +void e1000_clear_vfta_generic(struct e1000_hw *hw)
6626 + DEBUGFUNC("e1000_clear_vfta_generic");
6628 + for (offset = 0; offset < E1000_VLAN_FILTER_TBL_SIZE; offset++) {
6629 + E1000_WRITE_REG_ARRAY(hw, E1000_VFTA, offset, 0);
6630 + E1000_WRITE_FLUSH(hw);
6635 + * e1000_write_vfta_generic - Write value to VLAN filter table
6636 + * @hw: pointer to the HW structure
6637 + * @offset: register offset in VLAN filter table
6638 + * @value: register value written to VLAN filter table
6640 + * Writes value at the given offset in the register array which stores
6641 + * the VLAN filter table.
6643 +void e1000_write_vfta_generic(struct e1000_hw *hw, u32 offset, u32 value)
6645 + DEBUGFUNC("e1000_write_vfta_generic");
6647 + E1000_WRITE_REG_ARRAY(hw, E1000_VFTA, offset, value);
6648 + E1000_WRITE_FLUSH(hw);
6652 + * e1000_init_rx_addrs_generic - Initialize receive address's
6653 + * @hw: pointer to the HW structure
6654 + * @rar_count: receive address registers
6656 + * Setups the receive address registers by setting the base receive address
6657 + * register to the devices MAC address and clearing all the other receive
6658 + * address registers to 0.
6660 +void e1000_init_rx_addrs_generic(struct e1000_hw *hw, u16 rar_count)
6664 + DEBUGFUNC("e1000_init_rx_addrs_generic");
6666 + /* Setup the receive address */
6667 + DEBUGOUT("Programming MAC Address into RAR[0]\n");
6669 + hw->mac.ops.rar_set(hw, hw->mac.addr, 0);
6671 + /* Zero out the other (rar_entry_count - 1) receive addresses */
6672 + DEBUGOUT1("Clearing RAR[1-%u]\n", rar_count-1);
6673 + for (i = 1; i < rar_count; i++) {
6674 + E1000_WRITE_REG_ARRAY(hw, E1000_RA, (i << 1), 0);
6675 + E1000_WRITE_FLUSH(hw);
6676 + E1000_WRITE_REG_ARRAY(hw, E1000_RA, ((i << 1) + 1), 0);
6677 + E1000_WRITE_FLUSH(hw);
6682 + * e1000_check_alt_mac_addr_generic - Check for alternate MAC addr
6683 + * @hw: pointer to the HW structure
6685 + * Checks the nvm for an alternate MAC address. An alternate MAC address
6686 + * can be setup by pre-boot software and must be treated like a permanent
6687 + * address and must override the actual permanent MAC address. If an
6688 + * alternate MAC address is found it is saved in the hw struct and
6689 + * programmed into RAR0 and the function returns success, otherwise the
6690 + * function returns an error.
6692 +s32 e1000_check_alt_mac_addr_generic(struct e1000_hw *hw)
6695 + s32 ret_val = E1000_SUCCESS;
6696 + u16 offset, nvm_alt_mac_addr_offset, nvm_data;
6697 + u8 alt_mac_addr[ETH_ADDR_LEN];
6699 + DEBUGFUNC("e1000_check_alt_mac_addr_generic");
6701 + ret_val = hw->nvm.ops.read(hw, NVM_ALT_MAC_ADDR_PTR, 1,
6702 + &nvm_alt_mac_addr_offset);
6704 + DEBUGOUT("NVM Read Error\n");
6708 + if (nvm_alt_mac_addr_offset == 0xFFFF) {
6709 + ret_val = -(E1000_NOT_IMPLEMENTED);
6713 + if (hw->bus.func == E1000_FUNC_1)
6714 + nvm_alt_mac_addr_offset += ETH_ADDR_LEN/sizeof(u16);
6716 + for (i = 0; i < ETH_ADDR_LEN; i += 2) {
6717 + offset = nvm_alt_mac_addr_offset + (i >> 1);
6718 + ret_val = hw->nvm.ops.read(hw, offset, 1, &nvm_data);
6720 + DEBUGOUT("NVM Read Error\n");
6724 + alt_mac_addr[i] = (u8)(nvm_data & 0xFF);
6725 + alt_mac_addr[i + 1] = (u8)(nvm_data >> 8);
6728 + /* if multicast bit is set, the alternate address will not be used */
6729 + if (alt_mac_addr[0] & 0x01) {
6730 + ret_val = -(E1000_NOT_IMPLEMENTED);
6734 + for (i = 0; i < ETH_ADDR_LEN; i++)
6735 + hw->mac.addr[i] = hw->mac.perm_addr[i] = alt_mac_addr[i];
6737 + hw->mac.ops.rar_set(hw, hw->mac.perm_addr, 0);
6744 + * e1000_rar_set_generic - Set receive address register
6745 + * @hw: pointer to the HW structure
6746 + * @addr: pointer to the receive address
6747 + * @index: receive address array register
6749 + * Sets the receive address array register at index to the address passed
6752 +void e1000_rar_set_generic(struct e1000_hw *hw, u8 *addr, u32 index)
6754 + u32 rar_low, rar_high;
6756 + DEBUGFUNC("e1000_rar_set_generic");
6759 + * HW expects these in little endian so we reverse the byte order
6760 + * from network order (big endian) to little endian
6762 + rar_low = ((u32) addr[0] |
6763 + ((u32) addr[1] << 8) |
6764 + ((u32) addr[2] << 16) | ((u32) addr[3] << 24));
6766 + rar_high = ((u32) addr[4] | ((u32) addr[5] << 8));
6768 + /* If MAC address zero, no need to set the AV bit */
6769 + if (rar_low || rar_high)
6770 + rar_high |= E1000_RAH_AV;
6772 + E1000_WRITE_REG(hw, E1000_RAL(index), rar_low);
6773 + E1000_WRITE_REG(hw, E1000_RAH(index), rar_high);
6777 + * e1000_mta_set_generic - Set multicast filter table address
6778 + * @hw: pointer to the HW structure
6779 + * @hash_value: determines the MTA register and bit to set
6781 + * The multicast table address is a register array of 32-bit registers.
6782 + * The hash_value is used to determine what register the bit is in, the
6783 + * current value is read, the new bit is OR'd in and the new value is
6784 + * written back into the register.
6786 +void e1000_mta_set_generic(struct e1000_hw *hw, u32 hash_value)
6788 + u32 hash_bit, hash_reg, mta;
6790 + DEBUGFUNC("e1000_mta_set_generic");
6792 + * The MTA is a register array of 32-bit registers. It is
6793 + * treated like an array of (32*mta_reg_count) bits. We want to
6794 + * set bit BitArray[hash_value]. So we figure out what register
6795 + * the bit is in, read it, OR in the new bit, then write
6796 + * back the new value. The (hw->mac.mta_reg_count - 1) serves as a
6797 + * mask to bits 31:5 of the hash value which gives us the
6798 + * register we're modifying. The hash bit within that register
6799 + * is determined by the lower 5 bits of the hash value.
6801 + hash_reg = (hash_value >> 5) & (hw->mac.mta_reg_count - 1);
6802 + hash_bit = hash_value & 0x1F;
6804 + mta = E1000_READ_REG_ARRAY(hw, E1000_MTA, hash_reg);
6806 + mta |= (1 << hash_bit);
6808 + E1000_WRITE_REG_ARRAY(hw, E1000_MTA, hash_reg, mta);
6809 + E1000_WRITE_FLUSH(hw);
6813 + * e1000_update_mc_addr_list_generic - Update Multicast addresses
6814 + * @hw: pointer to the HW structure
6815 + * @mc_addr_list: array of multicast addresses to program
6816 + * @mc_addr_count: number of multicast addresses to program
6817 + * @rar_used_count: the first RAR register free to program
6818 + * @rar_count: total number of supported Receive Address Registers
6820 + * Updates the Receive Address Registers and Multicast Table Array.
6821 + * The caller must have a packed mc_addr_list of multicast addresses.
6822 + * The parameter rar_count will usually be hw->mac.rar_entry_count
6823 + * unless there are workarounds that change this.
6825 +void e1000_update_mc_addr_list_generic(struct e1000_hw *hw,
6826 + u8 *mc_addr_list, u32 mc_addr_count,
6827 + u32 rar_used_count, u32 rar_count)
6832 + DEBUGFUNC("e1000_update_mc_addr_list_generic");
6835 + * Load the first set of multicast addresses into the exact
6836 + * filters (RAR). If there are not enough to fill the RAR
6837 + * array, clear the filters.
6839 + for (i = rar_used_count; i < rar_count; i++) {
6840 + if (mc_addr_count) {
6841 + hw->mac.ops.rar_set(hw, mc_addr_list, i);
6843 + mc_addr_list += ETH_ADDR_LEN;
6845 + E1000_WRITE_REG_ARRAY(hw, E1000_RA, i << 1, 0);
6846 + E1000_WRITE_FLUSH(hw);
6847 + E1000_WRITE_REG_ARRAY(hw, E1000_RA, (i << 1) + 1, 0);
6848 + E1000_WRITE_FLUSH(hw);
6852 + /* Clear the old settings from the MTA */
6853 + DEBUGOUT("Clearing MTA\n");
6854 + for (i = 0; i < hw->mac.mta_reg_count; i++) {
6855 + E1000_WRITE_REG_ARRAY(hw, E1000_MTA, i, 0);
6856 + E1000_WRITE_FLUSH(hw);
6859 + /* Load any remaining multicast addresses into the hash table. */
6860 + for (; mc_addr_count > 0; mc_addr_count--) {
6861 + hash_value = e1000_hash_mc_addr_generic(hw, mc_addr_list);
6862 + DEBUGOUT1("Hash value = 0x%03X\n", hash_value);
6863 + hw->mac.ops.mta_set(hw, hash_value);
6864 + mc_addr_list += ETH_ADDR_LEN;
6869 + * e1000_hash_mc_addr_generic - Generate a multicast hash value
6870 + * @hw: pointer to the HW structure
6871 + * @mc_addr: pointer to a multicast address
6873 + * Generates a multicast address hash value which is used to determine
6874 + * the multicast filter table array address and new table value. See
6875 + * e1000_mta_set_generic()
6877 +u32 e1000_hash_mc_addr_generic(struct e1000_hw *hw, u8 *mc_addr)
6879 + u32 hash_value, hash_mask;
6882 + DEBUGFUNC("e1000_hash_mc_addr_generic");
6884 + /* Register count multiplied by bits per register */
6885 + hash_mask = (hw->mac.mta_reg_count * 32) - 1;
6888 + * For a mc_filter_type of 0, bit_shift is the number of left-shifts
6889 + * where 0xFF would still fall within the hash mask.
6891 + while (hash_mask >> bit_shift != 0xFF)
6895 + * The portion of the address that is used for the hash table
6896 + * is determined by the mc_filter_type setting.
6897 + * The algorithm is such that there is a total of 8 bits of shifting.
6898 + * The bit_shift for a mc_filter_type of 0 represents the number of
6899 + * left-shifts where the MSB of mc_addr[5] would still fall within
6900 + * the hash_mask. Case 0 does this exactly. Since there are a total
6901 + * of 8 bits of shifting, then mc_addr[4] will shift right the
6902 + * remaining number of bits. Thus 8 - bit_shift. The rest of the
6903 + * cases are a variation of this algorithm...essentially raising the
6904 + * number of bits to shift mc_addr[5] left, while still keeping the
6905 + * 8-bit shifting total.
6907 + * For example, given the following Destination MAC Address and an
6908 + * mta register count of 128 (thus a 4096-bit vector and 0xFFF mask),
6909 + * we can see that the bit_shift for case 0 is 4. These are the hash
6910 + * values resulting from each mc_filter_type...
6911 + * [0] [1] [2] [3] [4] [5]
6912 + * 01 AA 00 12 34 56
6915 + * case 0: hash_value = ((0x34 >> 4) | (0x56 << 4)) & 0xFFF = 0x563
6916 + * case 1: hash_value = ((0x34 >> 3) | (0x56 << 5)) & 0xFFF = 0xAC6
6917 + * case 2: hash_value = ((0x34 >> 2) | (0x56 << 6)) & 0xFFF = 0x163
6918 + * case 3: hash_value = ((0x34 >> 0) | (0x56 << 8)) & 0xFFF = 0x634
6920 + switch (hw->mac.mc_filter_type) {
6935 + hash_value = hash_mask & (((mc_addr[4] >> (8 - bit_shift)) |
6936 + (((u16) mc_addr[5]) << bit_shift)));
6938 + return hash_value;
6942 + * e1000_clear_hw_cntrs_base_generic - Clear base hardware counters
6943 + * @hw: pointer to the HW structure
6945 + * Clears the base hardware counters by reading the counter registers.
6947 +void e1000_clear_hw_cntrs_base_generic(struct e1000_hw *hw)
6949 + volatile u32 temp;
6951 + DEBUGFUNC("e1000_clear_hw_cntrs_base_generic");
6953 + temp = E1000_READ_REG(hw, E1000_CRCERRS);
6954 + temp = E1000_READ_REG(hw, E1000_SYMERRS);
6955 + temp = E1000_READ_REG(hw, E1000_MPC);
6956 + temp = E1000_READ_REG(hw, E1000_SCC);
6957 + temp = E1000_READ_REG(hw, E1000_ECOL);
6958 + temp = E1000_READ_REG(hw, E1000_MCC);
6959 + temp = E1000_READ_REG(hw, E1000_LATECOL);
6960 + temp = E1000_READ_REG(hw, E1000_COLC);
6961 + temp = E1000_READ_REG(hw, E1000_DC);
6962 + temp = E1000_READ_REG(hw, E1000_SEC);
6963 + temp = E1000_READ_REG(hw, E1000_RLEC);
6964 + temp = E1000_READ_REG(hw, E1000_XONRXC);
6965 + temp = E1000_READ_REG(hw, E1000_XONTXC);
6966 + temp = E1000_READ_REG(hw, E1000_XOFFRXC);
6967 + temp = E1000_READ_REG(hw, E1000_XOFFTXC);
6968 + temp = E1000_READ_REG(hw, E1000_FCRUC);
6969 + temp = E1000_READ_REG(hw, E1000_GPRC);
6970 + temp = E1000_READ_REG(hw, E1000_BPRC);
6971 + temp = E1000_READ_REG(hw, E1000_MPRC);
6972 + temp = E1000_READ_REG(hw, E1000_GPTC);
6973 + temp = E1000_READ_REG(hw, E1000_GORCL);
6974 + temp = E1000_READ_REG(hw, E1000_GORCH);
6975 + temp = E1000_READ_REG(hw, E1000_GOTCL);
6976 + temp = E1000_READ_REG(hw, E1000_GOTCH);
6977 + temp = E1000_READ_REG(hw, E1000_RNBC);
6978 + temp = E1000_READ_REG(hw, E1000_RUC);
6979 + temp = E1000_READ_REG(hw, E1000_RFC);
6980 + temp = E1000_READ_REG(hw, E1000_ROC);
6981 + temp = E1000_READ_REG(hw, E1000_RJC);
6982 + temp = E1000_READ_REG(hw, E1000_TORL);
6983 + temp = E1000_READ_REG(hw, E1000_TORH);
6984 + temp = E1000_READ_REG(hw, E1000_TOTL);
6985 + temp = E1000_READ_REG(hw, E1000_TOTH);
6986 + temp = E1000_READ_REG(hw, E1000_TPR);
6987 + temp = E1000_READ_REG(hw, E1000_TPT);
6988 + temp = E1000_READ_REG(hw, E1000_MPTC);
6989 + temp = E1000_READ_REG(hw, E1000_BPTC);
6993 + * e1000_check_for_copper_link_generic - Check for link (Copper)
6994 + * @hw: pointer to the HW structure
6996 + * Checks to see of the link status of the hardware has changed. If a
6997 + * change in link status has been detected, then we read the PHY registers
6998 + * to get the current speed/duplex if link exists.
7000 +s32 e1000_check_for_copper_link_generic(struct e1000_hw *hw)
7002 + struct e1000_mac_info *mac = &hw->mac;
7006 + DEBUGFUNC("e1000_check_for_copper_link");
7009 + * We only want to go out to the PHY registers to see if Auto-Neg
7010 + * has completed and/or if our link status has changed. The
7011 + * get_link_status flag is set upon receiving a Link Status
7012 + * Change or Rx Sequence Error interrupt.
7014 + if (!mac->get_link_status) {
7015 + ret_val = E1000_SUCCESS;
7020 + * First we want to see if the MII Status Register reports
7021 + * link. If so, then we want to get the current speed/duplex
7024 + ret_val = e1000_phy_has_link_generic(hw, 1, 0, &link);
7029 + goto out; /* No link detected */
7031 + mac->get_link_status = false;
7034 + * Check if there was DownShift, must be checked
7035 + * immediately after link-up
7037 + e1000_check_downshift_generic(hw);
7040 + * If we are forcing speed/duplex, then we simply return since
7041 + * we have already determined whether we have link or not.
7043 + if (!mac->autoneg) {
7044 + ret_val = -E1000_ERR_CONFIG;
7049 + * Auto-Neg is enabled. Auto Speed Detection takes care
7050 + * of MAC speed/duplex configuration. So we only need to
7051 + * configure Collision Distance in the MAC.
7053 + e1000_config_collision_dist_generic(hw);
7056 + * Configure Flow Control now that Auto-Neg has completed.
7057 + * First, we need to restore the desired flow control
7058 + * settings because we may have had to re-autoneg with a
7059 + * different link partner.
7061 + ret_val = e1000_config_fc_after_link_up_generic(hw);
7063 + DEBUGOUT("Error configuring flow control\n");
7071 + * e1000_check_for_fiber_link_generic - Check for link (Fiber)
7072 + * @hw: pointer to the HW structure
7074 + * Checks for link up on the hardware. If link is not up and we have
7075 + * a signal, then we need to force link up.
7077 +s32 e1000_check_for_fiber_link_generic(struct e1000_hw *hw)
7079 + struct e1000_mac_info *mac = &hw->mac;
7083 + s32 ret_val = E1000_SUCCESS;
7085 + DEBUGFUNC("e1000_check_for_fiber_link_generic");
7087 + ctrl = E1000_READ_REG(hw, E1000_CTRL);
7088 + status = E1000_READ_REG(hw, E1000_STATUS);
7089 + rxcw = E1000_READ_REG(hw, E1000_RXCW);
7092 + * If we don't have link (auto-negotiation failed or link partner
7093 + * cannot auto-negotiate), the cable is plugged in (we have signal),
7094 + * and our link partner is not trying to auto-negotiate with us (we
7095 + * are receiving idles or data), we need to force link up. We also
7096 + * need to give auto-negotiation time to complete, in case the cable
7097 + * was just plugged in. The autoneg_failed flag does this.
7099 + /* (ctrl & E1000_CTRL_SWDPIN1) == 1 == have signal */
7100 + if ((ctrl & E1000_CTRL_SWDPIN1) && (!(status & E1000_STATUS_LU)) &&
7101 + (!(rxcw & E1000_RXCW_C))) {
7102 + if (mac->autoneg_failed == 0) {
7103 + mac->autoneg_failed = 1;
7106 + DEBUGOUT("NOT RXing /C/, disable AutoNeg and force link.\n");
7108 + /* Disable auto-negotiation in the TXCW register */
7109 + E1000_WRITE_REG(hw, E1000_TXCW, (mac->txcw & ~E1000_TXCW_ANE));
7111 + /* Force link-up and also force full-duplex. */
7112 + ctrl = E1000_READ_REG(hw, E1000_CTRL);
7113 + ctrl |= (E1000_CTRL_SLU | E1000_CTRL_FD);
7114 + E1000_WRITE_REG(hw, E1000_CTRL, ctrl);
7116 + /* Configure Flow Control after forcing link up. */
7117 + ret_val = e1000_config_fc_after_link_up_generic(hw);
7119 + DEBUGOUT("Error configuring flow control\n");
7122 + } else if ((ctrl & E1000_CTRL_SLU) && (rxcw & E1000_RXCW_C)) {
7124 + * If we are forcing link and we are receiving /C/ ordered
7125 + * sets, re-enable auto-negotiation in the TXCW register
7126 + * and disable forced link in the Device Control register
7127 + * in an attempt to auto-negotiate with our link partner.
7129 + DEBUGOUT("RXing /C/, enable AutoNeg and stop forcing link.\n");
7130 + E1000_WRITE_REG(hw, E1000_TXCW, mac->txcw);
7131 + E1000_WRITE_REG(hw, E1000_CTRL, (ctrl & ~E1000_CTRL_SLU));
7133 + mac->serdes_has_link = true;
7141 + * e1000_check_for_serdes_link_generic - Check for link (Serdes)
7142 + * @hw: pointer to the HW structure
7144 + * Checks for link up on the hardware. If link is not up and we have
7145 + * a signal, then we need to force link up.
7147 +s32 e1000_check_for_serdes_link_generic(struct e1000_hw *hw)
7149 + struct e1000_mac_info *mac = &hw->mac;
7153 + s32 ret_val = E1000_SUCCESS;
7155 + DEBUGFUNC("e1000_check_for_serdes_link_generic");
7157 + ctrl = E1000_READ_REG(hw, E1000_CTRL);
7158 + status = E1000_READ_REG(hw, E1000_STATUS);
7159 + rxcw = E1000_READ_REG(hw, E1000_RXCW);
7162 + * If we don't have link (auto-negotiation failed or link partner
7163 + * cannot auto-negotiate), and our link partner is not trying to
7164 + * auto-negotiate with us (we are receiving idles or data),
7165 + * we need to force link up. We also need to give auto-negotiation
7166 + * time to complete.
7168 + /* (ctrl & E1000_CTRL_SWDPIN1) == 1 == have signal */
7169 + if ((!(status & E1000_STATUS_LU)) && (!(rxcw & E1000_RXCW_C))) {
7170 + if (mac->autoneg_failed == 0) {
7171 + mac->autoneg_failed = 1;
7174 + DEBUGOUT("NOT RXing /C/, disable AutoNeg and force link.\n");
7176 + /* Disable auto-negotiation in the TXCW register */
7177 + E1000_WRITE_REG(hw, E1000_TXCW, (mac->txcw & ~E1000_TXCW_ANE));
7179 + /* Force link-up and also force full-duplex. */
7180 + ctrl = E1000_READ_REG(hw, E1000_CTRL);
7181 + ctrl |= (E1000_CTRL_SLU | E1000_CTRL_FD);
7182 + E1000_WRITE_REG(hw, E1000_CTRL, ctrl);
7184 + /* Configure Flow Control after forcing link up. */
7185 + ret_val = e1000_config_fc_after_link_up_generic(hw);
7187 + DEBUGOUT("Error configuring flow control\n");
7190 + } else if ((ctrl & E1000_CTRL_SLU) && (rxcw & E1000_RXCW_C)) {
7192 + * If we are forcing link and we are receiving /C/ ordered
7193 + * sets, re-enable auto-negotiation in the TXCW register
7194 + * and disable forced link in the Device Control register
7195 + * in an attempt to auto-negotiate with our link partner.
7197 + DEBUGOUT("RXing /C/, enable AutoNeg and stop forcing link.\n");
7198 + E1000_WRITE_REG(hw, E1000_TXCW, mac->txcw);
7199 + E1000_WRITE_REG(hw, E1000_CTRL, (ctrl & ~E1000_CTRL_SLU));
7201 + mac->serdes_has_link = true;
7202 + } else if (!(E1000_TXCW_ANE & E1000_READ_REG(hw, E1000_TXCW))) {
7204 + * If we force link for non-auto-negotiation switch, check
7205 + * link status based on MAC synchronization for internal
7206 + * serdes media type.
7208 + /* SYNCH bit and IV bit are sticky. */
7210 + rxcw = E1000_READ_REG(hw, E1000_RXCW);
7211 + if (rxcw & E1000_RXCW_SYNCH) {
7212 + if (!(rxcw & E1000_RXCW_IV)) {
7213 + mac->serdes_has_link = true;
7214 + DEBUGOUT("SERDES: Link up - forced.\n");
7217 + mac->serdes_has_link = false;
7218 + DEBUGOUT("SERDES: Link down - force failed.\n");
7222 + if (E1000_TXCW_ANE & E1000_READ_REG(hw, E1000_TXCW)) {
7223 + status = E1000_READ_REG(hw, E1000_STATUS);
7224 + if (status & E1000_STATUS_LU) {
7225 + /* SYNCH bit and IV bit are sticky, so reread rxcw. */
7227 + rxcw = E1000_READ_REG(hw, E1000_RXCW);
7228 + if (rxcw & E1000_RXCW_SYNCH) {
7229 + if (!(rxcw & E1000_RXCW_IV)) {
7230 + mac->serdes_has_link = true;
7231 + DEBUGOUT("SERDES: Link up - autoneg "
7232 + "completed sucessfully.\n");
7234 + mac->serdes_has_link = false;
7235 + DEBUGOUT("SERDES: Link down - invalid"
7236 + "codewords detected in autoneg.\n");
7239 + mac->serdes_has_link = false;
7240 + DEBUGOUT("SERDES: Link down - no sync.\n");
7243 + mac->serdes_has_link = false;
7244 + DEBUGOUT("SERDES: Link down - autoneg failed\n");
7253 + * e1000_setup_link_generic - Setup flow control and link settings
7254 + * @hw: pointer to the HW structure
7256 + * Determines which flow control settings to use, then configures flow
7257 + * control. Calls the appropriate media-specific link configuration
7258 + * function. Assuming the adapter has a valid link partner, a valid link
7259 + * should be established. Assumes the hardware has previously been reset
7260 + * and the transmitter and receiver are not enabled.
7262 +s32 e1000_setup_link_generic(struct e1000_hw *hw)
7264 + s32 ret_val = E1000_SUCCESS;
7266 + DEBUGFUNC("e1000_setup_link_generic");
7269 + * In the case of the phy reset being blocked, we already have a link.
7270 + * We do not need to set it up again.
7272 + if (hw->phy.ops.check_reset_block)
7273 + if (hw->phy.ops.check_reset_block(hw))
7277 + * If flow control is set to default, set flow control based on
7278 + * the EEPROM flow control settings.
7280 + if (hw->fc.type == e1000_fc_default) {
7281 + ret_val = e1000_set_default_fc_generic(hw);
7287 + * We want to save off the original Flow Control configuration just
7288 + * in case we get disconnected and then reconnected into a different
7289 + * hub or switch with different Flow Control capabilities.
7291 + hw->fc.original_type = hw->fc.type;
7293 + DEBUGOUT1("After fix-ups FlowControl is now = %x\n", hw->fc.type);
7295 + /* Call the necessary media_type subroutine to configure the link. */
7296 + ret_val = hw->mac.ops.setup_physical_interface(hw);
7301 + * Initialize the flow control address, type, and PAUSE timer
7302 + * registers to their default values. This is done even if flow
7303 + * control is disabled, because it does not hurt anything to
7304 + * initialize these registers.
7306 + DEBUGOUT("Initializing the Flow Control address, type and timer regs\n");
7307 + E1000_WRITE_REG(hw, E1000_FCT, FLOW_CONTROL_TYPE);
7308 + E1000_WRITE_REG(hw, E1000_FCAH, FLOW_CONTROL_ADDRESS_HIGH);
7309 + E1000_WRITE_REG(hw, E1000_FCAL, FLOW_CONTROL_ADDRESS_LOW);
7311 + E1000_WRITE_REG(hw, E1000_FCTTV, hw->fc.pause_time);
7313 + ret_val = e1000_set_fc_watermarks_generic(hw);
7320 + * e1000_setup_fiber_serdes_link_generic - Setup link for fiber/serdes
7321 + * @hw: pointer to the HW structure
7323 + * Configures collision distance and flow control for fiber and serdes
7324 + * links. Upon successful setup, poll for link.
7326 +s32 e1000_setup_fiber_serdes_link_generic(struct e1000_hw *hw)
7329 + s32 ret_val = E1000_SUCCESS;
7331 + DEBUGFUNC("e1000_setup_fiber_serdes_link_generic");
7333 + ctrl = E1000_READ_REG(hw, E1000_CTRL);
7335 + /* Take the link out of reset */
7336 + ctrl &= ~E1000_CTRL_LRST;
7338 + e1000_config_collision_dist_generic(hw);
7340 + ret_val = e1000_commit_fc_settings_generic(hw);
7345 + * Since auto-negotiation is enabled, take the link out of reset (the
7346 + * link will be in reset, because we previously reset the chip). This
7347 + * will restart auto-negotiation. If auto-negotiation is successful
7348 + * then the link-up status bit will be set and the flow control enable
7349 + * bits (RFCE and TFCE) will be set according to their negotiated value.
7351 + DEBUGOUT("Auto-negotiation enabled\n");
7353 + E1000_WRITE_REG(hw, E1000_CTRL, ctrl);
7354 + E1000_WRITE_FLUSH(hw);
7358 + * For these adapters, the SW definable pin 1 is set when the optics
7359 + * detect a signal. If we have a signal, then poll for a "Link-Up"
7362 + if (hw->phy.media_type == e1000_media_type_internal_serdes ||
7363 + (E1000_READ_REG(hw, E1000_CTRL) & E1000_CTRL_SWDPIN1)) {
7364 + ret_val = e1000_poll_fiber_serdes_link_generic(hw);
7366 + DEBUGOUT("No signal detected\n");
7374 + * e1000_config_collision_dist_generic - Configure collision distance
7375 + * @hw: pointer to the HW structure
7377 + * Configures the collision distance to the default value and is used
7378 + * during link setup. Currently no func pointer exists and all
7379 + * implementations are handled in the generic version of this function.
7381 +void e1000_config_collision_dist_generic(struct e1000_hw *hw)
7385 + DEBUGFUNC("e1000_config_collision_dist_generic");
7387 + tctl = E1000_READ_REG(hw, E1000_TCTL);
7389 + tctl &= ~E1000_TCTL_COLD;
7390 + tctl |= E1000_COLLISION_DISTANCE << E1000_COLD_SHIFT;
7392 + E1000_WRITE_REG(hw, E1000_TCTL, tctl);
7393 + E1000_WRITE_FLUSH(hw);
7397 + * e1000_poll_fiber_serdes_link_generic - Poll for link up
7398 + * @hw: pointer to the HW structure
7400 + * Polls for link up by reading the status register, if link fails to come
7401 + * up with auto-negotiation, then the link is forced if a signal is detected.
7403 +s32 e1000_poll_fiber_serdes_link_generic(struct e1000_hw *hw)
7405 + struct e1000_mac_info *mac = &hw->mac;
7407 + s32 ret_val = E1000_SUCCESS;
7409 + DEBUGFUNC("e1000_poll_fiber_serdes_link_generic");
7412 + * If we have a signal (the cable is plugged in, or assumed true for
7413 + * serdes media) then poll for a "Link-Up" indication in the Device
7414 + * Status Register. Time-out if a link isn't seen in 500 milliseconds
7415 + * seconds (Auto-negotiation should complete in less than 500
7416 + * milliseconds even if the other end is doing it in SW).
7418 + for (i = 0; i < FIBER_LINK_UP_LIMIT; i++) {
7420 + status = E1000_READ_REG(hw, E1000_STATUS);
7421 + if (status & E1000_STATUS_LU)
7424 + if (i == FIBER_LINK_UP_LIMIT) {
7425 + DEBUGOUT("Never got a valid link from auto-neg!!!\n");
7426 + mac->autoneg_failed = 1;
7428 + * AutoNeg failed to achieve a link, so we'll call
7429 + * mac->check_for_link. This routine will force the
7430 + * link up if we detect a signal. This will allow us to
7431 + * communicate with non-autonegotiating link partners.
7433 + ret_val = hw->mac.ops.check_for_link(hw);
7435 + DEBUGOUT("Error while checking for link\n");
7438 + mac->autoneg_failed = 0;
7440 + mac->autoneg_failed = 0;
7441 + DEBUGOUT("Valid Link Found\n");
7449 + * e1000_commit_fc_settings_generic - Configure flow control
7450 + * @hw: pointer to the HW structure
7452 + * Write the flow control settings to the Transmit Config Word Register (TXCW)
7453 + * base on the flow control settings in e1000_mac_info.
7455 +static s32 e1000_commit_fc_settings_generic(struct e1000_hw *hw)
7457 + struct e1000_mac_info *mac = &hw->mac;
7459 + s32 ret_val = E1000_SUCCESS;
7461 + DEBUGFUNC("e1000_commit_fc_settings_generic");
7464 + * Check for a software override of the flow control settings, and
7465 + * setup the device accordingly. If auto-negotiation is enabled, then
7466 + * software will have to set the "PAUSE" bits to the correct value in
7467 + * the Transmit Config Word Register (TXCW) and re-start auto-
7468 + * negotiation. However, if auto-negotiation is disabled, then
7469 + * software will have to manually configure the two flow control enable
7470 + * bits in the CTRL register.
7472 + * The possible values of the "fc" parameter are:
7473 + * 0: Flow control is completely disabled
7474 + * 1: Rx flow control is enabled (we can receive pause frames,
7475 + * but not send pause frames).
7476 + * 2: Tx flow control is enabled (we can send pause frames but we
7477 + * do not support receiving pause frames).
7478 + * 3: Both Rx and Tx flow control (symmetric) are enabled.
7480 + switch (hw->fc.type) {
7481 + case e1000_fc_none:
7482 + /* Flow control completely disabled by a software over-ride. */
7483 + txcw = (E1000_TXCW_ANE | E1000_TXCW_FD);
7485 + case e1000_fc_rx_pause:
7487 + * Rx Flow control is enabled and Tx Flow control is disabled
7488 + * by a software over-ride. Since there really isn't a way to
7489 + * advertise that we are capable of Rx Pause ONLY, we will
7490 + * advertise that we support both symmetric and asymmetric RX
7491 + * PAUSE. Later, we will disable the adapter's ability to send
7494 + txcw = (E1000_TXCW_ANE | E1000_TXCW_FD | E1000_TXCW_PAUSE_MASK);
7496 + case e1000_fc_tx_pause:
7498 + * Tx Flow control is enabled, and Rx Flow control is disabled,
7499 + * by a software over-ride.
7501 + txcw = (E1000_TXCW_ANE | E1000_TXCW_FD | E1000_TXCW_ASM_DIR);
7503 + case e1000_fc_full:
7505 + * Flow control (both Rx and Tx) is enabled by a software
7508 + txcw = (E1000_TXCW_ANE | E1000_TXCW_FD | E1000_TXCW_PAUSE_MASK);
7511 + DEBUGOUT("Flow control param set incorrectly\n");
7512 + ret_val = -E1000_ERR_CONFIG;
7517 + E1000_WRITE_REG(hw, E1000_TXCW, txcw);
7525 + * e1000_set_fc_watermarks_generic - Set flow control high/low watermarks
7526 + * @hw: pointer to the HW structure
7528 + * Sets the flow control high/low threshold (watermark) registers. If
7529 + * flow control XON frame transmission is enabled, then set XON frame
7530 + * transmission as well.
7532 +s32 e1000_set_fc_watermarks_generic(struct e1000_hw *hw)
7534 + s32 ret_val = E1000_SUCCESS;
7535 + u32 fcrtl = 0, fcrth = 0;
7537 + DEBUGFUNC("e1000_set_fc_watermarks_generic");
7540 + * Set the flow control receive threshold registers. Normally,
7541 + * these registers will be set to a default threshold that may be
7542 + * adjusted later by the driver's runtime code. However, if the
7543 + * ability to transmit pause frames is not enabled, then these
7544 + * registers will be set to 0.
7546 + if (hw->fc.type & e1000_fc_tx_pause) {
7548 + * We need to set up the Receive Threshold high and low water
7549 + * marks as well as (optionally) enabling the transmission of
7552 + fcrtl = hw->fc.low_water;
7553 + if (hw->fc.send_xon)
7554 + fcrtl |= E1000_FCRTL_XONE;
7556 + fcrth = hw->fc.high_water;
7558 + E1000_WRITE_REG(hw, E1000_FCRTL, fcrtl);
7559 + E1000_WRITE_REG(hw, E1000_FCRTH, fcrth);
7565 + * e1000_set_default_fc_generic - Set flow control default values
7566 + * @hw: pointer to the HW structure
7568 + * Read the EEPROM for the default values for flow control and store the
7571 +static s32 e1000_set_default_fc_generic(struct e1000_hw *hw)
7573 + s32 ret_val = E1000_SUCCESS;
7576 + DEBUGFUNC("e1000_set_default_fc_generic");
7579 + * Read and store word 0x0F of the EEPROM. This word contains bits
7580 + * that determine the hardware's default PAUSE (flow control) mode,
7581 + * a bit that determines whether the HW defaults to enabling or
7582 + * disabling auto-negotiation, and the direction of the
7583 + * SW defined pins. If there is no SW over-ride of the flow
7584 + * control setting, then the variable hw->fc will
7585 + * be initialized based on a value in the EEPROM.
7587 + ret_val = hw->nvm.ops.read(hw, NVM_INIT_CONTROL2_REG, 1, &nvm_data);
7590 + DEBUGOUT("NVM Read Error\n");
7594 + if ((nvm_data & NVM_WORD0F_PAUSE_MASK) == 0)
7595 + hw->fc.type = e1000_fc_none;
7596 + else if ((nvm_data & NVM_WORD0F_PAUSE_MASK) ==
7597 + NVM_WORD0F_ASM_DIR)
7598 + hw->fc.type = e1000_fc_tx_pause;
7600 + hw->fc.type = e1000_fc_full;
7607 + * e1000_force_mac_fc_generic - Force the MAC's flow control settings
7608 + * @hw: pointer to the HW structure
7610 + * Force the MAC's flow control settings. Sets the TFCE and RFCE bits in the
7611 + * device control register to reflect the adapter settings. TFCE and RFCE
7612 + * need to be explicitly set by software when a copper PHY is used because
7613 + * autonegotiation is managed by the PHY rather than the MAC. Software must
7614 + * also configure these bits when link is forced on a fiber connection.
7616 +s32 e1000_force_mac_fc_generic(struct e1000_hw *hw)
7619 + s32 ret_val = E1000_SUCCESS;
7621 + DEBUGFUNC("e1000_force_mac_fc_generic");
7623 + ctrl = E1000_READ_REG(hw, E1000_CTRL);
7626 + * Because we didn't get link via the internal auto-negotiation
7627 + * mechanism (we either forced link or we got link via PHY
7628 + * auto-neg), we have to manually enable/disable transmit an
7629 + * receive flow control.
7631 + * The "Case" statement below enables/disable flow control
7632 + * according to the "hw->fc.type" parameter.
7634 + * The possible values of the "fc" parameter are:
7635 + * 0: Flow control is completely disabled
7636 + * 1: Rx flow control is enabled (we can receive pause
7637 + * frames but not send pause frames).
7638 + * 2: Tx flow control is enabled (we can send pause frames
7639 + * frames but we do not receive pause frames).
7640 + * 3: Both Rx and Tx flow control (symmetric) is enabled.
7641 + * other: No other values should be possible at this point.
7643 + DEBUGOUT1("hw->fc.type = %u\n", hw->fc.type);
7645 + switch (hw->fc.type) {
7646 + case e1000_fc_none:
7647 + ctrl &= (~(E1000_CTRL_TFCE | E1000_CTRL_RFCE));
7649 + case e1000_fc_rx_pause:
7650 + ctrl &= (~E1000_CTRL_TFCE);
7651 + ctrl |= E1000_CTRL_RFCE;
7653 + case e1000_fc_tx_pause:
7654 + ctrl &= (~E1000_CTRL_RFCE);
7655 + ctrl |= E1000_CTRL_TFCE;
7657 + case e1000_fc_full:
7658 + ctrl |= (E1000_CTRL_TFCE | E1000_CTRL_RFCE);
7661 + DEBUGOUT("Flow control param set incorrectly\n");
7662 + ret_val = -E1000_ERR_CONFIG;
7666 + E1000_WRITE_REG(hw, E1000_CTRL, ctrl);
7673 + * e1000_config_fc_after_link_up_generic - Configures flow control after link
7674 + * @hw: pointer to the HW structure
7676 + * Checks the status of auto-negotiation after link up to ensure that the
7677 + * speed and duplex were not forced. If the link needed to be forced, then
7678 + * flow control needs to be forced also. If auto-negotiation is enabled
7679 + * and did not fail, then we configure flow control based on our link
7682 +s32 e1000_config_fc_after_link_up_generic(struct e1000_hw *hw)
7684 + struct e1000_mac_info *mac = &hw->mac;
7685 + s32 ret_val = E1000_SUCCESS;
7686 + u16 mii_status_reg, mii_nway_adv_reg, mii_nway_lp_ability_reg;
7687 + u16 speed, duplex;
7689 + DEBUGFUNC("e1000_config_fc_after_link_up_generic");
7692 + * Check for the case where we have fiber media and auto-neg failed
7693 + * so we had to force link. In this case, we need to force the
7694 + * configuration of the MAC to match the "fc" parameter.
7696 + if (mac->autoneg_failed) {
7697 + if (hw->phy.media_type == e1000_media_type_fiber ||
7698 + hw->phy.media_type == e1000_media_type_internal_serdes)
7699 + ret_val = e1000_force_mac_fc_generic(hw);
7701 + if (hw->phy.media_type == e1000_media_type_copper)
7702 + ret_val = e1000_force_mac_fc_generic(hw);
7706 + DEBUGOUT("Error forcing flow control settings\n");
7711 + * Check for the case where we have copper media and auto-neg is
7712 + * enabled. In this case, we need to check and see if Auto-Neg
7713 + * has completed, and if so, how the PHY and link partner has
7714 + * flow control configured.
7716 + if ((hw->phy.media_type == e1000_media_type_copper) && mac->autoneg) {
7718 + * Read the MII Status Register and check to see if AutoNeg
7719 + * has completed. We read this twice because this reg has
7720 + * some "sticky" (latched) bits.
7722 + ret_val = hw->phy.ops.read_reg(hw, PHY_STATUS, &mii_status_reg);
7725 + ret_val = hw->phy.ops.read_reg(hw, PHY_STATUS, &mii_status_reg);
7729 + if (!(mii_status_reg & MII_SR_AUTONEG_COMPLETE)) {
7730 + DEBUGOUT("Copper PHY and Auto Neg "
7731 + "has not completed.\n");
7736 + * The AutoNeg process has completed, so we now need to
7737 + * read both the Auto Negotiation Advertisement
7738 + * Register (Address 4) and the Auto_Negotiation Base
7739 + * Page Ability Register (Address 5) to determine how
7740 + * flow control was negotiated.
7742 + ret_val = hw->phy.ops.read_reg(hw, PHY_AUTONEG_ADV,
7743 + &mii_nway_adv_reg);
7746 + ret_val = hw->phy.ops.read_reg(hw, PHY_LP_ABILITY,
7747 + &mii_nway_lp_ability_reg);
7752 + * Two bits in the Auto Negotiation Advertisement Register
7753 + * (Address 4) and two bits in the Auto Negotiation Base
7754 + * Page Ability Register (Address 5) determine flow control
7755 + * for both the PHY and the link partner. The following
7756 + * table, taken out of the IEEE 802.3ab/D6.0 dated March 25,
7757 + * 1999, describes these PAUSE resolution bits and how flow
7758 + * control is determined based upon these settings.
7759 + * NOTE: DC = Don't Care
7761 + * LOCAL DEVICE | LINK PARTNER
7762 + * PAUSE | ASM_DIR | PAUSE | ASM_DIR | NIC Resolution
7763 + *-------|---------|-------|---------|--------------------
7764 + * 0 | 0 | DC | DC | e1000_fc_none
7765 + * 0 | 1 | 0 | DC | e1000_fc_none
7766 + * 0 | 1 | 1 | 0 | e1000_fc_none
7767 + * 0 | 1 | 1 | 1 | e1000_fc_tx_pause
7768 + * 1 | 0 | 0 | DC | e1000_fc_none
7769 + * 1 | DC | 1 | DC | e1000_fc_full
7770 + * 1 | 1 | 0 | 0 | e1000_fc_none
7771 + * 1 | 1 | 0 | 1 | e1000_fc_rx_pause
7773 + * Are both PAUSE bits set to 1? If so, this implies
7774 + * Symmetric Flow Control is enabled at both ends. The
7775 + * ASM_DIR bits are irrelevant per the spec.
7777 + * For Symmetric Flow Control:
7779 + * LOCAL DEVICE | LINK PARTNER
7780 + * PAUSE | ASM_DIR | PAUSE | ASM_DIR | Result
7781 + *-------|---------|-------|---------|--------------------
7782 + * 1 | DC | 1 | DC | E1000_fc_full
7785 + if ((mii_nway_adv_reg & NWAY_AR_PAUSE) &&
7786 + (mii_nway_lp_ability_reg & NWAY_LPAR_PAUSE)) {
7788 + * Now we need to check if the user selected Rx ONLY
7789 + * of pause frames. In this case, we had to advertise
7790 + * FULL flow control because we could not advertise RX
7791 + * ONLY. Hence, we must now check to see if we need to
7792 + * turn OFF the TRANSMISSION of PAUSE frames.
7794 + if (hw->fc.original_type == e1000_fc_full) {
7795 + hw->fc.type = e1000_fc_full;
7796 + DEBUGOUT("Flow Control = FULL.\r\n");
7798 + hw->fc.type = e1000_fc_rx_pause;
7799 + DEBUGOUT("Flow Control = "
7800 + "RX PAUSE frames only.\r\n");
7804 + * For receiving PAUSE frames ONLY.
7806 + * LOCAL DEVICE | LINK PARTNER
7807 + * PAUSE | ASM_DIR | PAUSE | ASM_DIR | Result
7808 + *-------|---------|-------|---------|--------------------
7809 + * 0 | 1 | 1 | 1 | e1000_fc_tx_pause
7811 + else if (!(mii_nway_adv_reg & NWAY_AR_PAUSE) &&
7812 + (mii_nway_adv_reg & NWAY_AR_ASM_DIR) &&
7813 + (mii_nway_lp_ability_reg & NWAY_LPAR_PAUSE) &&
7814 + (mii_nway_lp_ability_reg & NWAY_LPAR_ASM_DIR)) {
7815 + hw->fc.type = e1000_fc_tx_pause;
7816 + DEBUGOUT("Flow Control = TX PAUSE frames only.\r\n");
7819 + * For transmitting PAUSE frames ONLY.
7821 + * LOCAL DEVICE | LINK PARTNER
7822 + * PAUSE | ASM_DIR | PAUSE | ASM_DIR | Result
7823 + *-------|---------|-------|---------|--------------------
7824 + * 1 | 1 | 0 | 1 | e1000_fc_rx_pause
7826 + else if ((mii_nway_adv_reg & NWAY_AR_PAUSE) &&
7827 + (mii_nway_adv_reg & NWAY_AR_ASM_DIR) &&
7828 + !(mii_nway_lp_ability_reg & NWAY_LPAR_PAUSE) &&
7829 + (mii_nway_lp_ability_reg & NWAY_LPAR_ASM_DIR)) {
7830 + hw->fc.type = e1000_fc_rx_pause;
7831 + DEBUGOUT("Flow Control = RX PAUSE frames only.\r\n");
7834 + * Per the IEEE spec, at this point flow control
7835 + * should be disabled.
7837 + hw->fc.type = e1000_fc_none;
7838 + DEBUGOUT("Flow Control = NONE.\r\n");
7842 + * Now we need to do one last check... If we auto-
7843 + * negotiated to HALF DUPLEX, flow control should not be
7844 + * enabled per IEEE 802.3 spec.
7846 + ret_val = mac->ops.get_link_up_info(hw, &speed, &duplex);
7848 + DEBUGOUT("Error getting link speed and duplex\n");
7852 + if (duplex == HALF_DUPLEX)
7853 + hw->fc.type = e1000_fc_none;
7856 + * Now we call a subroutine to actually force the MAC
7857 + * controller to use the correct flow control settings.
7859 + ret_val = e1000_force_mac_fc_generic(hw);
7861 + DEBUGOUT("Error forcing flow control settings\n");
7871 + * e1000_get_speed_and_duplex_copper_generic - Retrieve current speed/duplex
7872 + * @hw: pointer to the HW structure
7873 + * @speed: stores the current speed
7874 + * @duplex: stores the current duplex
7876 + * Read the status register for the current speed/duplex and store the current
7877 + * speed and duplex for copper connections.
7879 +s32 e1000_get_speed_and_duplex_copper_generic(struct e1000_hw *hw, u16 *speed,
7884 + DEBUGFUNC("e1000_get_speed_and_duplex_copper_generic");
7886 + status = E1000_READ_REG(hw, E1000_STATUS);
7887 + if (status & E1000_STATUS_SPEED_1000) {
7888 + *speed = SPEED_1000;
7889 + DEBUGOUT("1000 Mbs, ");
7890 + } else if (status & E1000_STATUS_SPEED_100) {
7891 + *speed = SPEED_100;
7892 + DEBUGOUT("100 Mbs, ");
7894 + *speed = SPEED_10;
7895 + DEBUGOUT("10 Mbs, ");
7898 + if (status & E1000_STATUS_FD) {
7899 + *duplex = FULL_DUPLEX;
7900 + DEBUGOUT("Full Duplex\n");
7902 + *duplex = HALF_DUPLEX;
7903 + DEBUGOUT("Half Duplex\n");
7906 + return E1000_SUCCESS;
7910 + * e1000_get_speed_and_duplex_fiber_generic - Retrieve current speed/duplex
7911 + * @hw: pointer to the HW structure
7912 + * @speed: stores the current speed
7913 + * @duplex: stores the current duplex
7915 + * Sets the speed and duplex to gigabit full duplex (the only possible option)
7916 + * for fiber/serdes links.
7918 +s32 e1000_get_speed_and_duplex_fiber_serdes_generic(struct e1000_hw *hw,
7919 + u16 *speed, u16 *duplex)
7921 + DEBUGFUNC("e1000_get_speed_and_duplex_fiber_serdes_generic");
7923 + *speed = SPEED_1000;
7924 + *duplex = FULL_DUPLEX;
7926 + return E1000_SUCCESS;
7930 + * e1000_get_hw_semaphore_generic - Acquire hardware semaphore
7931 + * @hw: pointer to the HW structure
7933 + * Acquire the HW semaphore to access the PHY or NVM
7935 +s32 e1000_get_hw_semaphore_generic(struct e1000_hw *hw)
7938 + s32 ret_val = E1000_SUCCESS;
7939 + s32 timeout = hw->nvm.word_size + 1;
7942 + DEBUGFUNC("e1000_get_hw_semaphore_generic");
7944 + /* Get the SW semaphore */
7945 + while (i < timeout) {
7946 + swsm = E1000_READ_REG(hw, E1000_SWSM);
7947 + if (!(swsm & E1000_SWSM_SMBI))
7954 + if (i == timeout) {
7955 + DEBUGOUT("Driver can't access device - SMBI bit is set.\n");
7956 + ret_val = -E1000_ERR_NVM;
7960 + /* Get the FW semaphore. */
7961 + for (i = 0; i < timeout; i++) {
7962 + swsm = E1000_READ_REG(hw, E1000_SWSM);
7963 + E1000_WRITE_REG(hw, E1000_SWSM, swsm | E1000_SWSM_SWESMBI);
7965 + /* Semaphore acquired if bit latched */
7966 + if (E1000_READ_REG(hw, E1000_SWSM) & E1000_SWSM_SWESMBI)
7972 + if (i == timeout) {
7973 + /* Release semaphores */
7974 + e1000_put_hw_semaphore_generic(hw);
7975 + DEBUGOUT("Driver can't access the NVM\n");
7976 + ret_val = -E1000_ERR_NVM;
7985 + * e1000_put_hw_semaphore_generic - Release hardware semaphore
7986 + * @hw: pointer to the HW structure
7988 + * Release hardware semaphore used to access the PHY or NVM
7990 +void e1000_put_hw_semaphore_generic(struct e1000_hw *hw)
7994 + DEBUGFUNC("e1000_put_hw_semaphore_generic");
7996 + swsm = E1000_READ_REG(hw, E1000_SWSM);
7998 + swsm &= ~(E1000_SWSM_SMBI | E1000_SWSM_SWESMBI);
8000 + E1000_WRITE_REG(hw, E1000_SWSM, swsm);
8004 + * e1000_get_auto_rd_done_generic - Check for auto read completion
8005 + * @hw: pointer to the HW structure
8007 + * Check EEPROM for Auto Read done bit.
8009 +s32 e1000_get_auto_rd_done_generic(struct e1000_hw *hw)
8012 + s32 ret_val = E1000_SUCCESS;
8014 + DEBUGFUNC("e1000_get_auto_rd_done_generic");
8016 + while (i < AUTO_READ_DONE_TIMEOUT) {
8017 + if (E1000_READ_REG(hw, E1000_EECD) & E1000_EECD_AUTO_RD)
8023 + if (i == AUTO_READ_DONE_TIMEOUT) {
8024 + DEBUGOUT("Auto read by HW from NVM has not completed.\n");
8025 + ret_val = -E1000_ERR_RESET;
8034 + * e1000_valid_led_default_generic - Verify a valid default LED config
8035 + * @hw: pointer to the HW structure
8036 + * @data: pointer to the NVM (EEPROM)
8038 + * Read the EEPROM for the current default LED configuration. If the
8039 + * LED configuration is not valid, set to a valid LED configuration.
8041 +s32 e1000_valid_led_default_generic(struct e1000_hw *hw, u16 *data)
8045 + DEBUGFUNC("e1000_valid_led_default_generic");
8047 + ret_val = hw->nvm.ops.read(hw, NVM_ID_LED_SETTINGS, 1, data);
8049 + DEBUGOUT("NVM Read Error\n");
8053 + if (*data == ID_LED_RESERVED_0000 || *data == ID_LED_RESERVED_FFFF)
8054 + *data = ID_LED_DEFAULT;
8061 + * e1000_id_led_init_generic -
8062 + * @hw: pointer to the HW structure
8065 +s32 e1000_id_led_init_generic(struct e1000_hw * hw)
8067 + struct e1000_mac_info *mac = &hw->mac;
8069 + const u32 ledctl_mask = 0x000000FF;
8070 + const u32 ledctl_on = E1000_LEDCTL_MODE_LED_ON;
8071 + const u32 ledctl_off = E1000_LEDCTL_MODE_LED_OFF;
8072 + u16 data, i, temp;
8073 + const u16 led_mask = 0x0F;
8075 + DEBUGFUNC("e1000_id_led_init_generic");
8077 + ret_val = hw->nvm.ops.valid_led_default(hw, &data);
8081 + mac->ledctl_default = E1000_READ_REG(hw, E1000_LEDCTL);
8082 + mac->ledctl_mode1 = mac->ledctl_default;
8083 + mac->ledctl_mode2 = mac->ledctl_default;
8085 + for (i = 0; i < 4; i++) {
8086 + temp = (data >> (i << 2)) & led_mask;
8088 + case ID_LED_ON1_DEF2:
8089 + case ID_LED_ON1_ON2:
8090 + case ID_LED_ON1_OFF2:
8091 + mac->ledctl_mode1 &= ~(ledctl_mask << (i << 3));
8092 + mac->ledctl_mode1 |= ledctl_on << (i << 3);
8094 + case ID_LED_OFF1_DEF2:
8095 + case ID_LED_OFF1_ON2:
8096 + case ID_LED_OFF1_OFF2:
8097 + mac->ledctl_mode1 &= ~(ledctl_mask << (i << 3));
8098 + mac->ledctl_mode1 |= ledctl_off << (i << 3);
8105 + case ID_LED_DEF1_ON2:
8106 + case ID_LED_ON1_ON2:
8107 + case ID_LED_OFF1_ON2:
8108 + mac->ledctl_mode2 &= ~(ledctl_mask << (i << 3));
8109 + mac->ledctl_mode2 |= ledctl_on << (i << 3);
8111 + case ID_LED_DEF1_OFF2:
8112 + case ID_LED_ON1_OFF2:
8113 + case ID_LED_OFF1_OFF2:
8114 + mac->ledctl_mode2 &= ~(ledctl_mask << (i << 3));
8115 + mac->ledctl_mode2 |= ledctl_off << (i << 3);
8128 + * e1000_setup_led_generic - Configures SW controllable LED
8129 + * @hw: pointer to the HW structure
8131 + * This prepares the SW controllable LED for use and saves the current state
8132 + * of the LED so it can be later restored.
8134 +s32 e1000_setup_led_generic(struct e1000_hw *hw)
8137 + s32 ret_val = E1000_SUCCESS;
8139 + DEBUGFUNC("e1000_setup_led_generic");
8141 + if (hw->mac.ops.setup_led != e1000_setup_led_generic) {
8142 + ret_val = -E1000_ERR_CONFIG;
8146 + if (hw->phy.media_type == e1000_media_type_fiber) {
8147 + ledctl = E1000_READ_REG(hw, E1000_LEDCTL);
8148 + hw->mac.ledctl_default = ledctl;
8149 + /* Turn off LED0 */
8150 + ledctl &= ~(E1000_LEDCTL_LED0_IVRT |
8151 + E1000_LEDCTL_LED0_BLINK |
8152 + E1000_LEDCTL_LED0_MODE_MASK);
8153 + ledctl |= (E1000_LEDCTL_MODE_LED_OFF <<
8154 + E1000_LEDCTL_LED0_MODE_SHIFT);
8155 + E1000_WRITE_REG(hw, E1000_LEDCTL, ledctl);
8156 + } else if (hw->phy.media_type == e1000_media_type_copper) {
8157 + E1000_WRITE_REG(hw, E1000_LEDCTL, hw->mac.ledctl_mode1);
8165 + * e1000_cleanup_led_generic - Set LED config to default operation
8166 + * @hw: pointer to the HW structure
8168 + * Remove the current LED configuration and set the LED configuration
8169 + * to the default value, saved from the EEPROM.
8171 +s32 e1000_cleanup_led_generic(struct e1000_hw *hw)
8173 + s32 ret_val = E1000_SUCCESS;
8175 + DEBUGFUNC("e1000_cleanup_led_generic");
8177 + if (hw->mac.ops.cleanup_led != e1000_cleanup_led_generic) {
8178 + ret_val = -E1000_ERR_CONFIG;
8182 + E1000_WRITE_REG(hw, E1000_LEDCTL, hw->mac.ledctl_default);
8189 + * e1000_blink_led_generic - Blink LED
8190 + * @hw: pointer to the HW structure
8192 + * Blink the LEDs which are set to be on.
8194 +s32 e1000_blink_led_generic(struct e1000_hw *hw)
8196 + u32 ledctl_blink = 0;
8199 + DEBUGFUNC("e1000_blink_led_generic");
8201 + if (hw->phy.media_type == e1000_media_type_fiber) {
8202 + /* always blink LED0 for PCI-E fiber */
8203 + ledctl_blink = E1000_LEDCTL_LED0_BLINK |
8204 + (E1000_LEDCTL_MODE_LED_ON << E1000_LEDCTL_LED0_MODE_SHIFT);
8207 + * set the blink bit for each LED that's "on" (0x0E)
8210 + ledctl_blink = hw->mac.ledctl_mode2;
8211 + for (i = 0; i < 4; i++)
8212 + if (((hw->mac.ledctl_mode2 >> (i * 8)) & 0xFF) ==
8213 + E1000_LEDCTL_MODE_LED_ON)
8214 + ledctl_blink |= (E1000_LEDCTL_LED0_BLINK <<
8218 + E1000_WRITE_REG(hw, E1000_LEDCTL, ledctl_blink);
8220 + return E1000_SUCCESS;
8224 + * e1000_led_on_generic - Turn LED on
8225 + * @hw: pointer to the HW structure
8229 +s32 e1000_led_on_generic(struct e1000_hw *hw)
8233 + DEBUGFUNC("e1000_led_on_generic");
8235 + switch (hw->phy.media_type) {
8236 + case e1000_media_type_fiber:
8237 + ctrl = E1000_READ_REG(hw, E1000_CTRL);
8238 + ctrl &= ~E1000_CTRL_SWDPIN0;
8239 + ctrl |= E1000_CTRL_SWDPIO0;
8240 + E1000_WRITE_REG(hw, E1000_CTRL, ctrl);
8242 + case e1000_media_type_copper:
8243 + E1000_WRITE_REG(hw, E1000_LEDCTL, hw->mac.ledctl_mode2);
8249 + return E1000_SUCCESS;
8253 + * e1000_led_off_generic - Turn LED off
8254 + * @hw: pointer to the HW structure
8258 +s32 e1000_led_off_generic(struct e1000_hw *hw)
8262 + DEBUGFUNC("e1000_led_off_generic");
8264 + switch (hw->phy.media_type) {
8265 + case e1000_media_type_fiber:
8266 + ctrl = E1000_READ_REG(hw, E1000_CTRL);
8267 + ctrl |= E1000_CTRL_SWDPIN0;
8268 + ctrl |= E1000_CTRL_SWDPIO0;
8269 + E1000_WRITE_REG(hw, E1000_CTRL, ctrl);
8271 + case e1000_media_type_copper:
8272 + E1000_WRITE_REG(hw, E1000_LEDCTL, hw->mac.ledctl_mode1);
8278 + return E1000_SUCCESS;
8282 + * e1000_set_pcie_no_snoop_generic - Set PCI-express capabilities
8283 + * @hw: pointer to the HW structure
8284 + * @no_snoop: bitmap of snoop events
8286 + * Set the PCI-express register to snoop for events enabled in 'no_snoop'.
8288 +void e1000_set_pcie_no_snoop_generic(struct e1000_hw *hw, u32 no_snoop)
8292 + DEBUGFUNC("e1000_set_pcie_no_snoop_generic");
8294 + if (hw->bus.type != e1000_bus_type_pci_express)
8298 + gcr = E1000_READ_REG(hw, E1000_GCR);
8299 + gcr &= ~(PCIE_NO_SNOOP_ALL);
8301 + E1000_WRITE_REG(hw, E1000_GCR, gcr);
8308 + * e1000_disable_pcie_master_generic - Disables PCI-express master access
8309 + * @hw: pointer to the HW structure
8311 + * Returns 0 (E1000_SUCCESS) if successful, else returns -10
8312 + * (-E1000_ERR_MASTER_REQUESTS_PENDING) if master disable bit has not caused
8313 + * the master requests to be disabled.
8315 + * Disables PCI-Express master access and verifies there are no pending
8318 +s32 e1000_disable_pcie_master_generic(struct e1000_hw *hw)
8321 + s32 timeout = MASTER_DISABLE_TIMEOUT;
8322 + s32 ret_val = E1000_SUCCESS;
8324 + DEBUGFUNC("e1000_disable_pcie_master_generic");
8326 + if (hw->bus.type != e1000_bus_type_pci_express)
8329 + ctrl = E1000_READ_REG(hw, E1000_CTRL);
8330 + ctrl |= E1000_CTRL_GIO_MASTER_DISABLE;
8331 + E1000_WRITE_REG(hw, E1000_CTRL, ctrl);
8334 + if (!(E1000_READ_REG(hw, E1000_STATUS) &
8335 + E1000_STATUS_GIO_MASTER_ENABLE))
8342 + DEBUGOUT("Master requests are pending.\n");
8343 + ret_val = -E1000_ERR_MASTER_REQUESTS_PENDING;
8352 + * e1000_reset_adaptive_generic - Reset Adaptive Interframe Spacing
8353 + * @hw: pointer to the HW structure
8355 + * Reset the Adaptive Interframe Spacing throttle to default values.
8357 +void e1000_reset_adaptive_generic(struct e1000_hw *hw)
8359 + struct e1000_mac_info *mac = &hw->mac;
8361 + DEBUGFUNC("e1000_reset_adaptive_generic");
8363 + if (!mac->adaptive_ifs) {
8364 + DEBUGOUT("Not in Adaptive IFS mode!\n");
8368 + mac->current_ifs_val = 0;
8369 + mac->ifs_min_val = IFS_MIN;
8370 + mac->ifs_max_val = IFS_MAX;
8371 + mac->ifs_step_size = IFS_STEP;
8372 + mac->ifs_ratio = IFS_RATIO;
8374 + mac->in_ifs_mode = false;
8375 + E1000_WRITE_REG(hw, E1000_AIT, 0);
8381 + * e1000_update_adaptive_generic - Update Adaptive Interframe Spacing
8382 + * @hw: pointer to the HW structure
8384 + * Update the Adaptive Interframe Spacing Throttle value based on the
8385 + * time between transmitted packets and time between collisions.
8387 +void e1000_update_adaptive_generic(struct e1000_hw *hw)
8389 + struct e1000_mac_info *mac = &hw->mac;
8391 + DEBUGFUNC("e1000_update_adaptive_generic");
8393 + if (!mac->adaptive_ifs) {
8394 + DEBUGOUT("Not in Adaptive IFS mode!\n");
8398 + if ((mac->collision_delta * mac->ifs_ratio) > mac->tx_packet_delta) {
8399 + if (mac->tx_packet_delta > MIN_NUM_XMITS) {
8400 + mac->in_ifs_mode = true;
8401 + if (mac->current_ifs_val < mac->ifs_max_val) {
8402 + if (!mac->current_ifs_val)
8403 + mac->current_ifs_val = mac->ifs_min_val;
8405 + mac->current_ifs_val +=
8406 + mac->ifs_step_size;
8407 + E1000_WRITE_REG(hw, E1000_AIT, mac->current_ifs_val);
8411 + if (mac->in_ifs_mode &&
8412 + (mac->tx_packet_delta <= MIN_NUM_XMITS)) {
8413 + mac->current_ifs_val = 0;
8414 + mac->in_ifs_mode = false;
8415 + E1000_WRITE_REG(hw, E1000_AIT, 0);
8423 + * e1000_validate_mdi_setting_generic - Verify MDI/MDIx settings
8424 + * @hw: pointer to the HW structure
8426 + * Verify that when not using auto-negotiation that MDI/MDIx is correctly
8427 + * set, which is forced to MDI mode only.
8429 +s32 e1000_validate_mdi_setting_generic(struct e1000_hw *hw)
8431 + s32 ret_val = E1000_SUCCESS;
8433 + DEBUGFUNC("e1000_validate_mdi_setting_generic");
8435 + if (!hw->mac.autoneg && (hw->phy.mdix == 0 || hw->phy.mdix == 3)) {
8436 + DEBUGOUT("Invalid MDI setting detected\n");
8438 + ret_val = -E1000_ERR_CONFIG;
8447 + * e1000_write_8bit_ctrl_reg_generic - Write a 8bit CTRL register
8448 + * @hw: pointer to the HW structure
8449 + * @reg: 32bit register offset such as E1000_SCTL
8450 + * @offset: register offset to write to
8451 + * @data: data to write at register offset
8453 + * Writes an address/data control type register. There are several of these
8454 + * and they all have the format address << 8 | data and bit 31 is polled for
8457 +s32 e1000_write_8bit_ctrl_reg_generic(struct e1000_hw *hw, u32 reg,
8458 + u32 offset, u8 data)
8460 + u32 i, regvalue = 0;
8461 + s32 ret_val = E1000_SUCCESS;
8463 + DEBUGFUNC("e1000_write_8bit_ctrl_reg_generic");
8465 + /* Set up the address and data */
8466 + regvalue = ((u32)data) | (offset << E1000_GEN_CTL_ADDRESS_SHIFT);
8467 + E1000_WRITE_REG(hw, reg, regvalue);
8469 + /* Poll the ready bit to see if the MDI read completed */
8470 + for (i = 0; i < E1000_GEN_POLL_TIMEOUT; i++) {
8472 + regvalue = E1000_READ_REG(hw, reg);
8473 + if (regvalue & E1000_GEN_CTL_READY)
8476 + if (!(regvalue & E1000_GEN_CTL_READY)) {
8477 + DEBUGOUT1("Reg %08x did not indicate ready\n", reg);
8478 + ret_val = -E1000_ERR_PHY;
8485 diff -Nru vanilla/drivers/net/igb/e1000_mac.h linux-i686-2.6.22/drivers/net/igb/e1000_mac.h
8486 --- vanilla/drivers/net/igb/e1000_mac.h 1969-12-31 19:00:00.000000000 -0500
8487 +++ linux-i686-2.6.22/drivers/net/igb/e1000_mac.h 2009-07-16 19:25:22.000000000 -0400
8489 +/*******************************************************************************
8491 + Intel(R) Gigabit Ethernet Linux driver
8492 + Copyright(c) 2007-2008 Intel Corporation.
8494 + This program is free software; you can redistribute it and/or modify it
8495 + under the terms and conditions of the GNU General Public License,
8496 + version 2, as published by the Free Software Foundation.
8498 + This program is distributed in the hope it will be useful, but WITHOUT
8499 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
8500 + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
8503 + You should have received a copy of the GNU General Public License along with
8504 + this program; if not, write to the Free Software Foundation, Inc.,
8505 + 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
8507 + The full GNU General Public License is included in this distribution in
8508 + the file called "COPYING".
8510 + Contact Information:
8511 + e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
8512 + Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
8514 +*******************************************************************************/
8516 +#ifndef _E1000_MAC_H_
8517 +#define _E1000_MAC_H_
8520 + * Functions that should not be called directly from drivers but can be used
8521 + * by other files in this 'shared code'
8523 +void e1000_init_mac_ops_generic(struct e1000_hw *hw);
8524 +s32 e1000_blink_led_generic(struct e1000_hw *hw);
8525 +s32 e1000_check_for_copper_link_generic(struct e1000_hw *hw);
8526 +s32 e1000_check_for_fiber_link_generic(struct e1000_hw *hw);
8527 +s32 e1000_check_for_serdes_link_generic(struct e1000_hw *hw);
8528 +s32 e1000_cleanup_led_generic(struct e1000_hw *hw);
8529 +s32 e1000_config_fc_after_link_up_generic(struct e1000_hw *hw);
8530 +s32 e1000_disable_pcie_master_generic(struct e1000_hw *hw);
8531 +s32 e1000_force_mac_fc_generic(struct e1000_hw *hw);
8532 +s32 e1000_get_auto_rd_done_generic(struct e1000_hw *hw);
8533 +s32 e1000_get_bus_info_pcie_generic(struct e1000_hw *hw);
8534 +s32 e1000_get_hw_semaphore_generic(struct e1000_hw *hw);
8535 +s32 e1000_get_speed_and_duplex_copper_generic(struct e1000_hw *hw, u16 *speed,
8537 +s32 e1000_get_speed_and_duplex_fiber_serdes_generic(struct e1000_hw *hw,
8538 + u16 *speed, u16 *duplex);
8539 +s32 e1000_id_led_init_generic(struct e1000_hw *hw);
8540 +s32 e1000_led_on_generic(struct e1000_hw *hw);
8541 +s32 e1000_led_off_generic(struct e1000_hw *hw);
8542 +void e1000_update_mc_addr_list_generic(struct e1000_hw *hw,
8543 + u8 *mc_addr_list, u32 mc_addr_count,
8544 + u32 rar_used_count, u32 rar_count);
8545 +s32 e1000_set_fc_watermarks_generic(struct e1000_hw *hw);
8546 +s32 e1000_setup_fiber_serdes_link_generic(struct e1000_hw *hw);
8547 +s32 e1000_setup_led_generic(struct e1000_hw *hw);
8548 +s32 e1000_setup_link_generic(struct e1000_hw *hw);
8549 +s32 e1000_write_8bit_ctrl_reg_generic(struct e1000_hw *hw, u32 reg,
8550 + u32 offset, u8 data);
8552 +u32 e1000_hash_mc_addr_generic(struct e1000_hw *hw, u8 *mc_addr);
8554 +void e1000_clear_hw_cntrs_base_generic(struct e1000_hw *hw);
8555 +void e1000_clear_vfta_generic(struct e1000_hw *hw);
8556 +void e1000_config_collision_dist_generic(struct e1000_hw *hw);
8557 +void e1000_init_rx_addrs_generic(struct e1000_hw *hw, u16 rar_count);
8558 +void e1000_mta_set_generic(struct e1000_hw *hw, u32 hash_value);
8559 +void e1000_pcix_mmrbc_workaround_generic(struct e1000_hw *hw);
8560 +void e1000_put_hw_semaphore_generic(struct e1000_hw *hw);
8561 +void e1000_rar_set_generic(struct e1000_hw *hw, u8 *addr, u32 index);
8562 +s32 e1000_check_alt_mac_addr_generic(struct e1000_hw *hw);
8563 +void e1000_reset_adaptive_generic(struct e1000_hw *hw);
8564 +void e1000_set_pcie_no_snoop_generic(struct e1000_hw *hw, u32 no_snoop);
8565 +void e1000_update_adaptive_generic(struct e1000_hw *hw);
8566 +void e1000_write_vfta_generic(struct e1000_hw *hw, u32 offset, u32 value);
8569 Binary files vanilla/drivers/net/igb/e1000_mac.o and linux-i686-2.6.22/drivers/net/igb/e1000_mac.o differ
8570 diff -Nru vanilla/drivers/net/igb/.e1000_mac.o.cmd linux-i686-2.6.22/drivers/net/igb/.e1000_mac.o.cmd
8571 --- vanilla/drivers/net/igb/.e1000_mac.o.cmd 1969-12-31 19:00:00.000000000 -0500
8572 +++ linux-i686-2.6.22/drivers/net/igb/.e1000_mac.o.cmd 2009-07-16 19:53:41.000000000 -0400
8574 +cmd_drivers/net/igb/e1000_mac.o := gcc -m32 -Wp,-MD,drivers/net/igb/.e1000_mac.o.d -nostdinc -isystem /usr/lib/gcc/i386-redhat-linux/4.1.2/include -D__KERNEL__ -Iinclude -include include/linux/autoconf.h -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Os -pipe -msoft-float -mregparm=3 -freg-struct-return -mpreferred-stack-boundary=2 -march=i686 -mtune=generic -ffreestanding -maccumulate-outgoing-args -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -Iinclude/asm-i386/mach-generic -Iinclude/asm-i386/mach-default -fno-omit-frame-pointer -fno-optimize-sibling-calls -g -fno-stack-protector -Wdeclaration-after-statement -Wno-pointer-sign -DMODULE -D"KBUILD_STR(s)=\#s" -D"KBUILD_BASENAME=KBUILD_STR(e1000_mac)" -D"KBUILD_MODNAME=KBUILD_STR(igb)" -c -o drivers/net/igb/.tmp_e1000_mac.o drivers/net/igb/e1000_mac.c
8576 +deps_drivers/net/igb/e1000_mac.o := \
8577 + drivers/net/igb/e1000_mac.c \
8578 + drivers/net/igb/e1000_api.h \
8579 + drivers/net/igb/e1000_hw.h \
8580 + drivers/net/igb/e1000_osdep.h \
8581 + include/linux/pci.h \
8582 + $(wildcard include/config/pci/msi.h) \
8583 + $(wildcard include/config/pci.h) \
8584 + $(wildcard include/config/ht/irq.h) \
8585 + $(wildcard include/config/pci/domains.h) \
8586 + include/linux/pci_regs.h \
8587 + include/linux/mod_devicetable.h \
8588 + include/linux/types.h \
8589 + $(wildcard include/config/uid16.h) \
8590 + $(wildcard include/config/lbd.h) \
8591 + $(wildcard include/config/lsf.h) \
8592 + $(wildcard include/config/resources/64bit.h) \
8593 + include/linux/posix_types.h \
8594 + include/linux/stddef.h \
8595 + include/linux/compiler.h \
8596 + $(wildcard include/config/enable/must/check.h) \
8597 + include/linux/compiler-gcc4.h \
8598 + $(wildcard include/config/forced/inlining.h) \
8599 + include/linux/compiler-gcc.h \
8600 + include/asm/posix_types.h \
8601 + include/asm/types.h \
8602 + $(wildcard include/config/highmem64g.h) \
8603 + include/linux/ioport.h \
8604 + include/linux/list.h \
8605 + $(wildcard include/config/debug/list.h) \
8606 + include/linux/poison.h \
8607 + include/linux/prefetch.h \
8608 + include/asm/processor.h \
8609 + $(wildcard include/config/smp.h) \
8610 + $(wildcard include/config/x86/ht.h) \
8611 + $(wildcard include/config/paravirt.h) \
8612 + $(wildcard include/config/mk8.h) \
8613 + $(wildcard include/config/mk7.h) \
8614 + include/asm/vm86.h \
8615 + $(wildcard include/config/vm86.h) \
8616 + include/asm/ptrace.h \
8617 + include/asm/ptrace-abi.h \
8618 + include/asm/segment.h \
8619 + include/asm/math_emu.h \
8620 + include/asm/sigcontext.h \
8621 + include/asm/page.h \
8622 + $(wildcard include/config/x86/use/3dnow.h) \
8623 + $(wildcard include/config/x86/pae.h) \
8624 + $(wildcard include/config/hugetlb/page.h) \
8625 + $(wildcard include/config/highmem4g.h) \
8626 + $(wildcard include/config/page/offset.h) \
8627 + $(wildcard include/config/flatmem.h) \
8628 + include/asm-generic/pgtable-nopmd.h \
8629 + include/asm-generic/pgtable-nopud.h \
8630 + include/asm-generic/memory_model.h \
8631 + $(wildcard include/config/discontigmem.h) \
8632 + $(wildcard include/config/sparsemem.h) \
8633 + $(wildcard include/config/out/of/line/pfn/to/page.h) \
8634 + include/asm-generic/page.h \
8635 + include/asm/cpufeature.h \
8636 + include/linux/bitops.h \
8637 + include/asm/bitops.h \
8638 + include/asm/alternative.h \
8639 + include/asm-generic/bitops/sched.h \
8640 + include/asm-generic/bitops/hweight.h \
8641 + include/asm-generic/bitops/fls64.h \
8642 + include/asm-generic/bitops/ext2-non-atomic.h \
8643 + include/asm-generic/bitops/le.h \
8644 + include/asm/byteorder.h \
8645 + $(wildcard include/config/x86/bswap.h) \
8646 + include/linux/byteorder/little_endian.h \
8647 + include/linux/byteorder/swab.h \
8648 + include/linux/byteorder/generic.h \
8649 + include/asm-generic/bitops/minix.h \
8650 + include/asm/required-features.h \
8651 + $(wildcard include/config/x86/minimum/cpu.h) \
8652 + $(wildcard include/config/x86/cmov.h) \
8653 + $(wildcard include/config/x86/cmpxchg64.h) \
8654 + include/asm/msr.h \
8655 + include/asm/msr-index.h \
8656 + include/asm/errno.h \
8657 + include/asm-generic/errno.h \
8658 + include/asm-generic/errno-base.h \
8659 + include/linux/errno.h \
8660 + include/asm/system.h \
8661 + $(wildcard include/config/x86/oostore.h) \
8662 + include/linux/kernel.h \
8663 + $(wildcard include/config/preempt/voluntary.h) \
8664 + $(wildcard include/config/debug/spinlock/sleep.h) \
8665 + $(wildcard include/config/printk.h) \
8666 + $(wildcard include/config/numa.h) \
8667 + /usr/lib/gcc/i386-redhat-linux/4.1.2/include/stdarg.h \
8668 + include/linux/linkage.h \
8669 + include/asm/linkage.h \
8670 + $(wildcard include/config/x86/alignment/16.h) \
8671 + include/linux/log2.h \
8672 + $(wildcard include/config/arch/has/ilog2/u32.h) \
8673 + $(wildcard include/config/arch/has/ilog2/u64.h) \
8674 + include/asm/bug.h \
8675 + $(wildcard include/config/bug.h) \
8676 + $(wildcard include/config/debug/bugverbose.h) \
8677 + include/asm-generic/bug.h \
8678 + $(wildcard include/config/generic/bug.h) \
8679 + include/asm/cmpxchg.h \
8680 + $(wildcard include/config/x86/cmpxchg.h) \
8681 + include/linux/irqflags.h \
8682 + $(wildcard include/config/trace/irqflags.h) \
8683 + $(wildcard include/config/trace/irqflags/support.h) \
8684 + $(wildcard include/config/x86.h) \
8685 + include/asm/irqflags.h \
8686 + include/asm/processor-flags.h \
8687 + include/linux/cache.h \
8688 + include/asm/cache.h \
8689 + $(wildcard include/config/x86/l1/cache/shift.h) \
8690 + include/linux/threads.h \
8691 + $(wildcard include/config/nr/cpus.h) \
8692 + $(wildcard include/config/base/small.h) \
8693 + include/asm/percpu.h \
8694 + include/linux/cpumask.h \
8695 + $(wildcard include/config/hotplug/cpu.h) \
8696 + include/linux/bitmap.h \
8697 + include/linux/string.h \
8698 + include/asm/string.h \
8699 + include/linux/init.h \
8700 + $(wildcard include/config/modules.h) \
8701 + $(wildcard include/config/hotplug.h) \
8702 + $(wildcard include/config/memory/hotplug.h) \
8703 + $(wildcard include/config/acpi/hotplug/memory.h) \
8704 + include/asm/atomic.h \
8705 + $(wildcard include/config/m386.h) \
8706 + include/asm-generic/atomic.h \
8707 + include/linux/device.h \
8708 + $(wildcard include/config/debug/devres.h) \
8709 + include/linux/kobject.h \
8710 + include/linux/sysfs.h \
8711 + $(wildcard include/config/sysfs.h) \
8712 + include/linux/spinlock.h \
8713 + $(wildcard include/config/debug/spinlock.h) \
8714 + $(wildcard include/config/preempt.h) \
8715 + $(wildcard include/config/debug/lock/alloc.h) \
8716 + include/linux/preempt.h \
8717 + $(wildcard include/config/debug/preempt.h) \
8718 + include/linux/thread_info.h \
8719 + include/asm/thread_info.h \
8720 + $(wildcard include/config/4kstacks.h) \
8721 + $(wildcard include/config/debug/stack/usage.h) \
8722 + include/linux/stringify.h \
8723 + include/linux/bottom_half.h \
8724 + include/linux/spinlock_types.h \
8725 + include/linux/lockdep.h \
8726 + $(wildcard include/config/lockdep.h) \
8727 + $(wildcard include/config/generic/hardirqs.h) \
8728 + $(wildcard include/config/prove/locking.h) \
8729 + include/asm/spinlock_types.h \
8730 + include/asm/spinlock.h \
8731 + $(wildcard include/config/x86/ppro/fence.h) \
8732 + include/asm/rwlock.h \
8733 + include/linux/spinlock_api_smp.h \
8734 + include/linux/kref.h \
8735 + include/linux/wait.h \
8736 + include/asm/current.h \
8737 + include/linux/klist.h \
8738 + include/linux/completion.h \
8739 + include/linux/module.h \
8740 + $(wildcard include/config/modversions.h) \
8741 + $(wildcard include/config/unused/symbols.h) \
8742 + $(wildcard include/config/module/unload.h) \
8743 + $(wildcard include/config/kallsyms.h) \
8744 + include/linux/stat.h \
8745 + include/asm/stat.h \
8746 + include/linux/time.h \
8747 + include/linux/seqlock.h \
8748 + include/linux/vs_time.h \
8749 + $(wildcard include/config/vserver/vtime.h) \
8750 + include/linux/kmod.h \
8751 + $(wildcard include/config/kmod.h) \
8752 + include/linux/elf.h \
8753 + include/linux/auxvec.h \
8754 + include/asm/auxvec.h \
8755 + include/linux/elf-em.h \
8756 + include/asm/elf.h \
8757 + include/asm/user.h \
8758 + include/asm/desc.h \
8759 + include/asm/ldt.h \
8760 + include/linux/smp.h \
8761 + include/asm/smp.h \
8762 + $(wildcard include/config/x86/local/apic.h) \
8763 + $(wildcard include/config/x86/io/apic.h) \
8764 + include/asm/mpspec.h \
8765 + $(wildcard include/config/acpi.h) \
8766 + include/asm/mpspec_def.h \
8767 + include/asm-i386/mach-generic/mach_mpspec.h \
8768 + include/asm/apic.h \
8769 + $(wildcard include/config/x86/good/apic.h) \
8770 + include/linux/pm.h \
8771 + $(wildcard include/config/pm.h) \
8772 + include/linux/delay.h \
8773 + include/asm/delay.h \
8774 + include/asm/fixmap.h \
8775 + $(wildcard include/config/highmem.h) \
8776 + $(wildcard include/config/x86/visws/apic.h) \
8777 + $(wildcard include/config/x86/f00f/bug.h) \
8778 + $(wildcard include/config/x86/cyclone/timer.h) \
8779 + $(wildcard include/config/pci/mmconfig.h) \
8780 + include/asm/acpi.h \
8781 + $(wildcard include/config/acpi/sleep.h) \
8782 + include/acpi/pdc_intel.h \
8783 + include/asm/apicdef.h \
8784 + include/asm/kmap_types.h \
8785 + $(wildcard include/config/debug/highmem.h) \
8786 + include/asm/io_apic.h \
8787 + include/asm-i386/mach-generic/mach_apicdef.h \
8788 + include/asm/genapic.h \
8789 + include/linux/percpu.h \
8790 + include/linux/slab.h \
8791 + $(wildcard include/config/slab/debug.h) \
8792 + $(wildcard include/config/slab.h) \
8793 + $(wildcard include/config/slub.h) \
8794 + $(wildcard include/config/debug/slab.h) \
8795 + include/linux/gfp.h \
8796 + $(wildcard include/config/zone/dma.h) \
8797 + $(wildcard include/config/zone/dma32.h) \
8798 + include/linux/mmzone.h \
8799 + $(wildcard include/config/force/max/zoneorder.h) \
8800 + $(wildcard include/config/arch/populates/node/map.h) \
8801 + $(wildcard include/config/flat/node/mem/map.h) \
8802 + $(wildcard include/config/have/memory/present.h) \
8803 + $(wildcard include/config/need/node/memmap/size.h) \
8804 + $(wildcard include/config/need/multiple/nodes.h) \
8805 + $(wildcard include/config/have/arch/early/pfn/to/nid.h) \
8806 + $(wildcard include/config/sparsemem/extreme.h) \
8807 + $(wildcard include/config/nodes/span/other/nodes.h) \
8808 + $(wildcard include/config/holes/in/zone.h) \
8809 + include/linux/numa.h \
8810 + $(wildcard include/config/nodes/shift.h) \
8811 + include/linux/nodemask.h \
8812 + include/linux/memory_hotplug.h \
8813 + $(wildcard include/config/have/arch/nodedata/extension.h) \
8814 + include/linux/notifier.h \
8815 + include/linux/mutex.h \
8816 + $(wildcard include/config/debug/mutexes.h) \
8817 + $(wildcard include/config/chopstix.h) \
8818 + include/linux/rwsem.h \
8819 + $(wildcard include/config/rwsem/generic/spinlock.h) \
8820 + include/asm/rwsem.h \
8821 + include/linux/srcu.h \
8822 + include/linux/topology.h \
8823 + $(wildcard include/config/sched/smt.h) \
8824 + $(wildcard include/config/sched/mc.h) \
8825 + include/asm/topology.h \
8826 + include/asm-generic/topology.h \
8827 + include/linux/slab_def.h \
8828 + include/linux/kmalloc_sizes.h \
8829 + include/asm/mmu.h \
8830 + include/asm/semaphore.h \
8831 + include/linux/moduleparam.h \
8832 + include/asm/local.h \
8833 + include/asm/module.h \
8834 + $(wildcard include/config/m486.h) \
8835 + $(wildcard include/config/m586.h) \
8836 + $(wildcard include/config/m586tsc.h) \
8837 + $(wildcard include/config/m586mmx.h) \
8838 + $(wildcard include/config/mcore2.h) \
8839 + $(wildcard include/config/m686.h) \
8840 + $(wildcard include/config/mpentiumii.h) \
8841 + $(wildcard include/config/mpentiumiii.h) \
8842 + $(wildcard include/config/mpentiumm.h) \
8843 + $(wildcard include/config/mpentium4.h) \
8844 + $(wildcard include/config/mk6.h) \
8845 + $(wildcard include/config/x86/elan.h) \
8846 + $(wildcard include/config/mcrusoe.h) \
8847 + $(wildcard include/config/mefficeon.h) \
8848 + $(wildcard include/config/mwinchipc6.h) \
8849 + $(wildcard include/config/mwinchip2.h) \
8850 + $(wildcard include/config/mwinchip3d.h) \
8851 + $(wildcard include/config/mcyrixiii.h) \
8852 + $(wildcard include/config/mviac3/2.h) \
8853 + $(wildcard include/config/mviac7.h) \
8854 + $(wildcard include/config/mgeodegx1.h) \
8855 + $(wildcard include/config/mgeode/lx.h) \
8856 + include/asm/device.h \
8857 + include/linux/pci_ids.h \
8858 + include/linux/dmapool.h \
8859 + include/asm/io.h \
8860 + $(wildcard include/config/x86/numaq.h) \
8861 + include/asm-generic/iomap.h \
8862 + include/linux/vmalloc.h \
8863 + include/asm/scatterlist.h \
8864 + include/asm/pci.h \
8865 + include/linux/mm.h \
8866 + $(wildcard include/config/sysctl.h) \
8867 + $(wildcard include/config/mmu.h) \
8868 + $(wildcard include/config/stack/growsup.h) \
8869 + $(wildcard include/config/debug/vm.h) \
8870 + $(wildcard include/config/shmem.h) \
8871 + $(wildcard include/config/split/ptlock/cpus.h) \
8872 + $(wildcard include/config/ia64.h) \
8873 + $(wildcard include/config/proc/fs.h) \
8874 + $(wildcard include/config/debug/pagealloc.h) \
8875 + include/linux/capability.h \
8876 + include/linux/rbtree.h \
8877 + include/linux/prio_tree.h \
8878 + include/linux/fs.h \
8879 + $(wildcard include/config/dnotify.h) \
8880 + $(wildcard include/config/vserver/cowbl.h) \
8881 + $(wildcard include/config/quota.h) \
8882 + $(wildcard include/config/inotify.h) \
8883 + $(wildcard include/config/security.h) \
8884 + $(wildcard include/config/epoll.h) \
8885 + $(wildcard include/config/auditsyscall.h) \
8886 + $(wildcard include/config/block.h) \
8887 + $(wildcard include/config/fs/xip.h) \
8888 + $(wildcard include/config/migration.h) \
8889 + include/linux/limits.h \
8890 + include/linux/ioctl.h \
8891 + include/asm/ioctl.h \
8892 + include/asm-generic/ioctl.h \
8893 + include/linux/kdev_t.h \
8894 + include/linux/dcache.h \
8895 + $(wildcard include/config/profiling.h) \
8896 + include/linux/rcupdate.h \
8897 + include/linux/namei.h \
8898 + include/linux/radix-tree.h \
8899 + include/linux/pid.h \
8900 + include/linux/quota.h \
8901 + include/linux/dqblk_xfs.h \
8902 + include/linux/dqblk_v1.h \
8903 + include/linux/dqblk_v2.h \
8904 + include/linux/nfs_fs_i.h \
8905 + include/linux/nfs.h \
8906 + include/linux/sunrpc/msg_prot.h \
8907 + include/linux/fcntl.h \
8908 + include/asm/fcntl.h \
8909 + include/asm-generic/fcntl.h \
8910 + $(wildcard include/config/64bit.h) \
8911 + include/linux/err.h \
8912 + include/linux/debug_locks.h \
8913 + $(wildcard include/config/debug/locking/api/selftests.h) \
8914 + include/linux/backing-dev.h \
8915 + include/linux/mm_types.h \
8916 + include/asm/pgtable.h \
8917 + $(wildcard include/config/highpte.h) \
8918 + include/asm/paravirt.h \
8919 + include/asm/pgtable-2level-defs.h \
8920 + include/asm/pgtable-2level.h \
8921 + include/asm-generic/pgtable.h \
8922 + include/linux/page-flags.h \
8923 + $(wildcard include/config/s390.h) \
8924 + $(wildcard include/config/swap.h) \
8925 + include/linux/vmstat.h \
8926 + $(wildcard include/config/vm/event/counters.h) \
8927 + include/asm-generic/pci-dma-compat.h \
8928 + include/linux/dma-mapping.h \
8929 + include/asm/dma-mapping.h \
8930 + include/asm-generic/pci.h \
8931 + include/linux/interrupt.h \
8932 + $(wildcard include/config/high/res/timers.h) \
8933 + $(wildcard include/config/generic/irq/probe.h) \
8934 + include/linux/irqreturn.h \
8935 + include/linux/hardirq.h \
8936 + $(wildcard include/config/preempt/bkl.h) \
8937 + $(wildcard include/config/virt/cpu/accounting.h) \
8938 + include/linux/smp_lock.h \
8939 + $(wildcard include/config/lock/kernel.h) \
8940 + include/linux/sched.h \
8941 + $(wildcard include/config/no/hz.h) \
8942 + $(wildcard include/config/detect/softlockup.h) \
8943 + $(wildcard include/config/keys.h) \
8944 + $(wildcard include/config/bsd/process/acct.h) \
8945 + $(wildcard include/config/taskstats.h) \
8946 + $(wildcard include/config/inotify/user.h) \
8947 + $(wildcard include/config/schedstats.h) \
8948 + $(wildcard include/config/task/delay/acct.h) \
8949 + $(wildcard include/config/blk/dev/io/trace.h) \
8950 + $(wildcard include/config/cc/stackprotector.h) \
8951 + $(wildcard include/config/sysvipc.h) \
8952 + $(wildcard include/config/rt/mutexes.h) \
8953 + $(wildcard include/config/task/xacct.h) \
8954 + $(wildcard include/config/cpusets.h) \
8955 + $(wildcard include/config/compat.h) \
8956 + $(wildcard include/config/fault/injection.h) \
8957 + include/asm/param.h \
8958 + $(wildcard include/config/hz.h) \
8959 + include/linux/timex.h \
8960 + $(wildcard include/config/time/interpolation.h) \
8961 + include/asm/timex.h \
8962 + include/asm/tsc.h \
8963 + $(wildcard include/config/x86/tsc.h) \
8964 + $(wildcard include/config/x86/generic.h) \
8965 + include/linux/jiffies.h \
8966 + include/linux/calc64.h \
8967 + include/asm/div64.h \
8968 + include/asm/cputime.h \
8969 + include/asm-generic/cputime.h \
8970 + include/linux/sem.h \
8971 + include/linux/ipc.h \
8972 + $(wildcard include/config/ipc/ns.h) \
8973 + include/asm/ipcbuf.h \
8974 + include/asm/sembuf.h \
8975 + include/linux/signal.h \
8976 + include/asm/signal.h \
8977 + include/asm-generic/signal.h \
8978 + include/asm/siginfo.h \
8979 + include/asm-generic/siginfo.h \
8980 + include/linux/securebits.h \
8981 + include/linux/fs_struct.h \
8982 + include/linux/seccomp.h \
8983 + $(wildcard include/config/seccomp.h) \
8984 + include/linux/futex.h \
8985 + $(wildcard include/config/futex.h) \
8986 + include/linux/rtmutex.h \
8987 + $(wildcard include/config/debug/rt/mutexes.h) \
8988 + include/linux/plist.h \
8989 + $(wildcard include/config/debug/pi/list.h) \
8990 + include/linux/param.h \
8991 + include/linux/resource.h \
8992 + include/asm/resource.h \
8993 + include/asm-generic/resource.h \
8994 + include/linux/timer.h \
8995 + $(wildcard include/config/timer/stats.h) \
8996 + include/linux/ktime.h \
8997 + $(wildcard include/config/ktime/scalar.h) \
8998 + include/linux/hrtimer.h \
8999 + include/linux/task_io_accounting.h \
9000 + $(wildcard include/config/task/io/accounting.h) \
9001 + include/linux/aio.h \
9002 + include/linux/workqueue.h \
9003 + include/linux/aio_abi.h \
9004 + include/linux/uio.h \
9005 + include/asm/hardirq.h \
9006 + include/linux/irq.h \
9007 + $(wildcard include/config/irq/per/cpu.h) \
9008 + $(wildcard include/config/irq/release/method.h) \
9009 + $(wildcard include/config/generic/pending/irq.h) \
9010 + $(wildcard include/config/irqbalance.h) \
9011 + $(wildcard include/config/auto/irq/affinity.h) \
9012 + $(wildcard include/config/generic/hardirqs/no//do/irq.h) \
9013 + include/asm/irq.h \
9014 + include/asm-i386/mach-default/irq_vectors.h \
9015 + include/asm-i386/mach-default/irq_vectors_limits.h \
9016 + include/asm/irq_regs.h \
9017 + include/asm/hw_irq.h \
9018 + include/linux/profile.h \
9019 + include/asm/sections.h \
9020 + include/asm-generic/sections.h \
9021 + include/linux/irq_cpustat.h \
9022 + include/linux/if_ether.h \
9023 + include/linux/skbuff.h \
9024 + $(wildcard include/config/nf/conntrack.h) \
9025 + $(wildcard include/config/bridge/netfilter.h) \
9026 + $(wildcard include/config/vlan/8021q.h) \
9027 + $(wildcard include/config/net/sched.h) \
9028 + $(wildcard include/config/net/cls/act.h) \
9029 + $(wildcard include/config/net/dma.h) \
9030 + $(wildcard include/config/network/secmark.h) \
9031 + include/linux/net.h \
9032 + include/asm/socket.h \
9033 + include/asm/sockios.h \
9034 + include/linux/random.h \
9035 + include/linux/sysctl.h \
9036 + $(wildcard include/config/icmp/ipod.h) \
9037 + $(wildcard include/config/web100/net100.h) \
9038 + $(wildcard include/config/web100/stats.h) \
9039 + include/linux/textsearch.h \
9040 + include/net/checksum.h \
9041 + include/asm/uaccess.h \
9042 + $(wildcard include/config/x86/intel/usercopy.h) \
9043 + $(wildcard include/config/x86/wp/works/ok.h) \
9044 + include/asm/checksum.h \
9045 + include/linux/in6.h \
9046 + include/linux/dmaengine.h \
9047 + $(wildcard include/config/dma/engine.h) \
9048 + drivers/net/igb/kcompat.h \
9049 + $(wildcard include/config/e1000/napi.h) \
9050 + $(wildcard include/config/e1000e/napi.h) \
9051 + $(wildcard include/config/ixgb/napi.h) \
9052 + $(wildcard include/config/e1000/disable/packet/split.h) \
9053 + $(wildcard include/config/igb/disable/packet/split.h) \
9054 + $(wildcard include/config/net/poll/controller.h) \
9055 + $(wildcard include/config/space/len.h) \
9056 + $(wildcard include/config/netpoll.h) \
9057 + $(wildcard include/config/netdevices/multiqueue.h) \
9058 + include/linux/version.h \
9059 + include/linux/netdevice.h \
9060 + $(wildcard include/config/ax25.h) \
9061 + $(wildcard include/config/tr.h) \
9062 + $(wildcard include/config/net/ipip.h) \
9063 + $(wildcard include/config/net/ipgre.h) \
9064 + $(wildcard include/config/ipv6/sit.h) \
9065 + $(wildcard include/config/ipv6/tunnel.h) \
9066 + $(wildcard include/config/wireless/ext.h) \
9067 + $(wildcard include/config/netpoll/trap.h) \
9068 + include/linux/if.h \
9069 + include/linux/socket.h \
9070 + include/linux/sockios.h \
9071 + include/linux/hdlc/ioctl.h \
9072 + include/linux/if_packet.h \
9073 + include/linux/etherdevice.h \
9074 + include/linux/in.h \
9075 + include/linux/ip.h \
9076 + include/linux/udp.h \
9077 + include/net/inet_sock.h \
9078 + $(wildcard include/config/ipv6.h) \
9079 + include/linux/jhash.h \
9080 + include/net/flow.h \
9081 + $(wildcard include/config/ipv6/mip6.h) \
9082 + include/net/sock.h \
9083 + $(wildcard include/config/security/network.h) \
9084 + include/linux/security.h \
9085 + $(wildcard include/config/security/network/xfrm.h) \
9086 + include/linux/binfmts.h \
9087 + include/linux/shm.h \
9088 + include/asm/shmparam.h \
9089 + include/asm/shmbuf.h \
9090 + include/linux/msg.h \
9091 + include/asm/msgbuf.h \
9092 + include/linux/key.h \
9093 + include/linux/xfrm.h \
9094 + include/linux/filter.h \
9095 + include/net/dst.h \
9096 + $(wildcard include/config/net/cls/route.h) \
9097 + $(wildcard include/config/xfrm.h) \
9098 + include/linux/rtnetlink.h \
9099 + include/linux/netlink.h \
9100 + include/linux/if_link.h \
9101 + include/linux/if_addr.h \
9102 + include/linux/neighbour.h \
9103 + include/net/neighbour.h \
9104 + include/linux/seq_file.h \
9105 + include/net/rtnetlink.h \
9106 + include/net/netlink.h \
9107 + include/net/request_sock.h \
9108 + include/linux/mii.h \
9109 + include/linux/latency.h \
9110 + drivers/net/igb/e1000_regs.h \
9111 + drivers/net/igb/e1000_defines.h \
9112 + $(wildcard include/config/res.h) \
9113 + $(wildcard include/config/fault.h) \
9114 + drivers/net/igb/e1000_mac.h \
9115 + drivers/net/igb/e1000_phy.h \
9116 + drivers/net/igb/e1000_nvm.h \
9117 + drivers/net/igb/e1000_manage.h \
9118 + drivers/net/igb/e1000_82575.h \
9120 +drivers/net/igb/e1000_mac.o: $(deps_drivers/net/igb/e1000_mac.o)
9122 +$(deps_drivers/net/igb/e1000_mac.o):
9123 diff -Nru vanilla/drivers/net/igb/e1000_manage.c linux-i686-2.6.22/drivers/net/igb/e1000_manage.c
9124 --- vanilla/drivers/net/igb/e1000_manage.c 1969-12-31 19:00:00.000000000 -0500
9125 +++ linux-i686-2.6.22/drivers/net/igb/e1000_manage.c 2009-07-16 19:25:22.000000000 -0400
9127 +/*******************************************************************************
9129 + Intel(R) Gigabit Ethernet Linux driver
9130 + Copyright(c) 2007-2008 Intel Corporation.
9132 + This program is free software; you can redistribute it and/or modify it
9133 + under the terms and conditions of the GNU General Public License,
9134 + version 2, as published by the Free Software Foundation.
9136 + This program is distributed in the hope it will be useful, but WITHOUT
9137 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
9138 + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
9141 + You should have received a copy of the GNU General Public License along with
9142 + this program; if not, write to the Free Software Foundation, Inc.,
9143 + 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
9145 + The full GNU General Public License is included in this distribution in
9146 + the file called "COPYING".
9148 + Contact Information:
9149 + e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
9150 + Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
9152 +*******************************************************************************/
9154 +#include "e1000_api.h"
9156 +static u8 e1000_calculate_checksum(u8 *buffer, u32 length);
9159 + * e1000_calculate_checksum - Calculate checksum for buffer
9160 + * @buffer: pointer to EEPROM
9161 + * @length: size of EEPROM to calculate a checksum for
9163 + * Calculates the checksum for some buffer on a specified length. The
9164 + * checksum calculated is returned.
9166 +static u8 e1000_calculate_checksum(u8 *buffer, u32 length)
9171 + DEBUGFUNC("e1000_calculate_checksum");
9176 + for (i = 0; i < length; i++)
9179 + return (u8) (0 - sum);
9183 + * e1000_mng_enable_host_if_generic - Checks host interface is enabled
9184 + * @hw: pointer to the HW structure
9186 + * Returns E1000_success upon success, else E1000_ERR_HOST_INTERFACE_COMMAND
9188 + * This function checks whether the HOST IF is enabled for command operation
9189 + * and also checks whether the previous command is completed. It busy waits
9190 + * in case of previous command is not completed.
9192 +s32 e1000_mng_enable_host_if_generic(struct e1000_hw * hw)
9195 + s32 ret_val = E1000_SUCCESS;
9198 + DEBUGFUNC("e1000_mng_enable_host_if_generic");
9200 + /* Check that the host interface is enabled. */
9201 + hicr = E1000_READ_REG(hw, E1000_HICR);
9202 + if ((hicr & E1000_HICR_EN) == 0) {
9203 + DEBUGOUT("E1000_HOST_EN bit disabled.\n");
9204 + ret_val = -E1000_ERR_HOST_INTERFACE_COMMAND;
9207 + /* check the previous command is completed */
9208 + for (i = 0; i < E1000_MNG_DHCP_COMMAND_TIMEOUT; i++) {
9209 + hicr = E1000_READ_REG(hw, E1000_HICR);
9210 + if (!(hicr & E1000_HICR_C))
9212 + msec_delay_irq(1);
9215 + if (i == E1000_MNG_DHCP_COMMAND_TIMEOUT) {
9216 + DEBUGOUT("Previous command timeout failed .\n");
9217 + ret_val = -E1000_ERR_HOST_INTERFACE_COMMAND;
9226 + * e1000_check_mng_mode_generic - Generic check management mode
9227 + * @hw: pointer to the HW structure
9229 + * Reads the firmware semaphore register and returns true (>0) if
9230 + * manageability is enabled, else false (0).
9232 +bool e1000_check_mng_mode_generic(struct e1000_hw *hw)
9236 + DEBUGFUNC("e1000_check_mng_mode_generic");
9238 + fwsm = E1000_READ_REG(hw, E1000_FWSM);
9240 + return (fwsm & E1000_FWSM_MODE_MASK) ==
9241 + (E1000_MNG_IAMT_MODE << E1000_FWSM_MODE_SHIFT);
9245 + * e1000_enable_tx_pkt_filtering_generic - Enable packet filtering on TX
9246 + * @hw: pointer to the HW structure
9248 + * Enables packet filtering on transmit packets if manageability is enabled
9249 + * and host interface is enabled.
9251 +bool e1000_enable_tx_pkt_filtering_generic(struct e1000_hw *hw)
9253 + struct e1000_host_mng_dhcp_cookie *hdr = &hw->mng_cookie;
9254 + u32 *buffer = (u32 *)&hw->mng_cookie;
9256 + s32 ret_val, hdr_csum, csum;
9258 + bool tx_filter = true;
9260 + DEBUGFUNC("e1000_enable_tx_pkt_filtering_generic");
9262 + /* No manageability, no filtering */
9263 + if (!hw->mac.ops.check_mng_mode(hw)) {
9264 + tx_filter = false;
9269 + * If we can't read from the host interface for whatever
9270 + * reason, disable filtering.
9272 + ret_val = hw->mac.ops.mng_enable_host_if(hw);
9273 + if (ret_val != E1000_SUCCESS) {
9274 + tx_filter = false;
9278 + /* Read in the header. Length and offset are in dwords. */
9279 + len = E1000_MNG_DHCP_COOKIE_LENGTH >> 2;
9280 + offset = E1000_MNG_DHCP_COOKIE_OFFSET >> 2;
9281 + for (i = 0; i < len; i++) {
9282 + *(buffer + i) = E1000_READ_REG_ARRAY_DWORD(hw,
9286 + hdr_csum = hdr->checksum;
9287 + hdr->checksum = 0;
9288 + csum = e1000_calculate_checksum((u8 *)hdr,
9289 + E1000_MNG_DHCP_COOKIE_LENGTH);
9291 + * If either the checksums or signature don't match, then
9292 + * the cookie area isn't considered valid, in which case we
9293 + * take the safe route of assuming Tx filtering is enabled.
9295 + if (hdr_csum != csum)
9297 + if (hdr->signature != E1000_IAMT_SIGNATURE)
9300 + /* Cookie area is valid, make the final check for filtering. */
9301 + if (!(hdr->status & E1000_MNG_DHCP_COOKIE_STATUS_PARSING))
9302 + tx_filter = false;
9305 + hw->mac.tx_pkt_filtering = tx_filter;
9310 + * e1000_mng_write_dhcp_info_generic - Writes DHCP info to host interface
9311 + * @hw: pointer to the HW structure
9312 + * @buffer: pointer to the host interface
9313 + * @length: size of the buffer
9315 + * Writes the DHCP information to the host interface.
9317 +s32 e1000_mng_write_dhcp_info_generic(struct e1000_hw * hw, u8 *buffer,
9320 + struct e1000_host_mng_command_header hdr;
9324 + DEBUGFUNC("e1000_mng_write_dhcp_info_generic");
9326 + hdr.command_id = E1000_MNG_DHCP_TX_PAYLOAD_CMD;
9327 + hdr.command_length = length;
9328 + hdr.reserved1 = 0;
9329 + hdr.reserved2 = 0;
9332 + /* Enable the host interface */
9333 + ret_val = hw->mac.ops.mng_enable_host_if(hw);
9337 + /* Populate the host interface with the contents of "buffer". */
9338 + ret_val = hw->mac.ops.mng_host_if_write(hw, buffer, length,
9339 + sizeof(hdr), &(hdr.checksum));
9343 + /* Write the manageability command header */
9344 + ret_val = hw->mac.ops.mng_write_cmd_header(hw, &hdr);
9348 + /* Tell the ARC a new command is pending. */
9349 + hicr = E1000_READ_REG(hw, E1000_HICR);
9350 + E1000_WRITE_REG(hw, E1000_HICR, hicr | E1000_HICR_C);
9357 + * e1000_mng_write_cmd_header_generic - Writes manageability command header
9358 + * @hw: pointer to the HW structure
9359 + * @hdr: pointer to the host interface command header
9361 + * Writes the command header after does the checksum calculation.
9363 +s32 e1000_mng_write_cmd_header_generic(struct e1000_hw * hw,
9364 + struct e1000_host_mng_command_header * hdr)
9366 + u16 i, length = sizeof(struct e1000_host_mng_command_header);
9368 + DEBUGFUNC("e1000_mng_write_cmd_header_generic");
9370 + /* Write the whole command header structure with new checksum. */
9372 + hdr->checksum = e1000_calculate_checksum((u8 *)hdr, length);
9375 + /* Write the relevant command block into the ram area. */
9376 + for (i = 0; i < length; i++) {
9377 + E1000_WRITE_REG_ARRAY_DWORD(hw, E1000_HOST_IF, i,
9378 + *((u32 *) hdr + i));
9379 + E1000_WRITE_FLUSH(hw);
9382 + return E1000_SUCCESS;
9386 + * e1000_mng_host_if_write_generic - Write to the manageability host interface
9387 + * @hw: pointer to the HW structure
9388 + * @buffer: pointer to the host interface buffer
9389 + * @length: size of the buffer
9390 + * @offset: location in the buffer to write to
9391 + * @sum: sum of the data (not checksum)
9393 + * This function writes the buffer content at the offset given on the host if.
9394 + * It also does alignment considerations to do the writes in most efficient
9395 + * way. Also fills up the sum of the buffer in *buffer parameter.
9397 +s32 e1000_mng_host_if_write_generic(struct e1000_hw * hw, u8 *buffer,
9398 + u16 length, u16 offset, u8 *sum)
9401 + u8 *bufptr = buffer;
9403 + s32 ret_val = E1000_SUCCESS;
9404 + u16 remaining, i, j, prev_bytes;
9406 + DEBUGFUNC("e1000_mng_host_if_write_generic");
9408 + /* sum = only sum of the data and it is not checksum */
9410 + if (length == 0 || offset + length > E1000_HI_MAX_MNG_DATA_LENGTH) {
9411 + ret_val = -E1000_ERR_PARAM;
9415 + tmp = (u8 *)&data;
9416 + prev_bytes = offset & 0x3;
9420 + data = E1000_READ_REG_ARRAY_DWORD(hw, E1000_HOST_IF, offset);
9421 + for (j = prev_bytes; j < sizeof(u32); j++) {
9422 + *(tmp + j) = *bufptr++;
9423 + *sum += *(tmp + j);
9425 + E1000_WRITE_REG_ARRAY_DWORD(hw, E1000_HOST_IF, offset, data);
9426 + length -= j - prev_bytes;
9430 + remaining = length & 0x3;
9431 + length -= remaining;
9433 + /* Calculate length in DWORDs */
9437 + * The device driver writes the relevant command block into the
9440 + for (i = 0; i < length; i++) {
9441 + for (j = 0; j < sizeof(u32); j++) {
9442 + *(tmp + j) = *bufptr++;
9443 + *sum += *(tmp + j);
9446 + E1000_WRITE_REG_ARRAY_DWORD(hw, E1000_HOST_IF, offset + i, data);
9449 + for (j = 0; j < sizeof(u32); j++) {
9450 + if (j < remaining)
9451 + *(tmp + j) = *bufptr++;
9455 + *sum += *(tmp + j);
9457 + E1000_WRITE_REG_ARRAY_DWORD(hw, E1000_HOST_IF, offset + i, data);
9465 + * e1000_enable_mng_pass_thru - Enable processing of ARP's
9466 + * @hw: pointer to the HW structure
9468 + * Verifies the hardware needs to allow ARPs to be processed by the host.
9470 +bool e1000_enable_mng_pass_thru(struct e1000_hw *hw)
9474 + bool ret_val = false;
9476 + DEBUGFUNC("e1000_enable_mng_pass_thru");
9478 + if (!hw->mac.asf_firmware_present)
9481 + manc = E1000_READ_REG(hw, E1000_MANC);
9483 + if (!(manc & E1000_MANC_RCV_TCO_EN) ||
9484 + !(manc & E1000_MANC_EN_MAC_ADDR_FILTER))
9487 + if (hw->mac.arc_subsystem_valid) {
9488 + fwsm = E1000_READ_REG(hw, E1000_FWSM);
9489 + factps = E1000_READ_REG(hw, E1000_FACTPS);
9491 + if (!(factps & E1000_FACTPS_MNGCG) &&
9492 + ((fwsm & E1000_FWSM_MODE_MASK) ==
9493 + (e1000_mng_mode_pt << E1000_FWSM_MODE_SHIFT))) {
9498 + if ((manc & E1000_MANC_SMBUS_EN) &&
9499 + !(manc & E1000_MANC_ASF_EN)) {
9509 diff -Nru vanilla/drivers/net/igb/e1000_manage.h linux-i686-2.6.22/drivers/net/igb/e1000_manage.h
9510 --- vanilla/drivers/net/igb/e1000_manage.h 1969-12-31 19:00:00.000000000 -0500
9511 +++ linux-i686-2.6.22/drivers/net/igb/e1000_manage.h 2009-07-16 19:25:22.000000000 -0400
9513 +/*******************************************************************************
9515 + Intel(R) Gigabit Ethernet Linux driver
9516 + Copyright(c) 2007-2008 Intel Corporation.
9518 + This program is free software; you can redistribute it and/or modify it
9519 + under the terms and conditions of the GNU General Public License,
9520 + version 2, as published by the Free Software Foundation.
9522 + This program is distributed in the hope it will be useful, but WITHOUT
9523 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
9524 + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
9527 + You should have received a copy of the GNU General Public License along with
9528 + this program; if not, write to the Free Software Foundation, Inc.,
9529 + 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
9531 + The full GNU General Public License is included in this distribution in
9532 + the file called "COPYING".
9534 + Contact Information:
9535 + e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
9536 + Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
9538 +*******************************************************************************/
9540 +#ifndef _E1000_MANAGE_H_
9541 +#define _E1000_MANAGE_H_
9543 +bool e1000_check_mng_mode_generic(struct e1000_hw *hw);
9544 +bool e1000_enable_tx_pkt_filtering_generic(struct e1000_hw *hw);
9545 +s32 e1000_mng_enable_host_if_generic(struct e1000_hw *hw);
9546 +s32 e1000_mng_host_if_write_generic(struct e1000_hw *hw, u8 *buffer,
9547 + u16 length, u16 offset, u8 *sum);
9548 +s32 e1000_mng_write_cmd_header_generic(struct e1000_hw *hw,
9549 + struct e1000_host_mng_command_header *hdr);
9550 +s32 e1000_mng_write_dhcp_info_generic(struct e1000_hw *hw,
9551 + u8 *buffer, u16 length);
9552 +bool e1000_enable_mng_pass_thru(struct e1000_hw *hw);
9554 +enum e1000_mng_mode {
9555 + e1000_mng_mode_none = 0,
9556 + e1000_mng_mode_asf,
9557 + e1000_mng_mode_pt,
9558 + e1000_mng_mode_ipmi,
9559 + e1000_mng_mode_host_if_only
9562 +#define E1000_FACTPS_MNGCG 0x20000000
9564 +#define E1000_FWSM_MODE_MASK 0xE
9565 +#define E1000_FWSM_MODE_SHIFT 1
9567 +#define E1000_MNG_IAMT_MODE 0x3
9568 +#define E1000_MNG_DHCP_COOKIE_LENGTH 0x10
9569 +#define E1000_MNG_DHCP_COOKIE_OFFSET 0x6F0
9570 +#define E1000_MNG_DHCP_COMMAND_TIMEOUT 10
9571 +#define E1000_MNG_DHCP_TX_PAYLOAD_CMD 64
9572 +#define E1000_MNG_DHCP_COOKIE_STATUS_PARSING 0x1
9573 +#define E1000_MNG_DHCP_COOKIE_STATUS_VLAN 0x2
9575 +#define E1000_VFTA_ENTRY_SHIFT 5
9576 +#define E1000_VFTA_ENTRY_MASK 0x7F
9577 +#define E1000_VFTA_ENTRY_BIT_SHIFT_MASK 0x1F
9579 +#define E1000_HI_MAX_BLOCK_BYTE_LENGTH 1792 /* Num of bytes in range */
9580 +#define E1000_HI_MAX_BLOCK_DWORD_LENGTH 448 /* Num of dwords in range */
9581 +#define E1000_HI_COMMAND_TIMEOUT 500 /* Process HI command limit */
9583 +#define E1000_HICR_EN 0x01 /* Enable bit - RO */
9584 +/* Driver sets this bit when done to put command in RAM */
9585 +#define E1000_HICR_C 0x02
9586 +#define E1000_HICR_SV 0x04 /* Status Validity */
9587 +#define E1000_HICR_FW_RESET_ENABLE 0x40
9588 +#define E1000_HICR_FW_RESET 0x80
9590 +/* Intel(R) Active Management Technology signature */
9591 +#define E1000_IAMT_SIGNATURE 0x544D4149
9594 Binary files vanilla/drivers/net/igb/e1000_manage.o and linux-i686-2.6.22/drivers/net/igb/e1000_manage.o differ
9595 diff -Nru vanilla/drivers/net/igb/.e1000_manage.o.cmd linux-i686-2.6.22/drivers/net/igb/.e1000_manage.o.cmd
9596 --- vanilla/drivers/net/igb/.e1000_manage.o.cmd 1969-12-31 19:00:00.000000000 -0500
9597 +++ linux-i686-2.6.22/drivers/net/igb/.e1000_manage.o.cmd 2009-07-16 19:53:43.000000000 -0400
9599 +cmd_drivers/net/igb/e1000_manage.o := gcc -m32 -Wp,-MD,drivers/net/igb/.e1000_manage.o.d -nostdinc -isystem /usr/lib/gcc/i386-redhat-linux/4.1.2/include -D__KERNEL__ -Iinclude -include include/linux/autoconf.h -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Os -pipe -msoft-float -mregparm=3 -freg-struct-return -mpreferred-stack-boundary=2 -march=i686 -mtune=generic -ffreestanding -maccumulate-outgoing-args -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -Iinclude/asm-i386/mach-generic -Iinclude/asm-i386/mach-default -fno-omit-frame-pointer -fno-optimize-sibling-calls -g -fno-stack-protector -Wdeclaration-after-statement -Wno-pointer-sign -DMODULE -D"KBUILD_STR(s)=\#s" -D"KBUILD_BASENAME=KBUILD_STR(e1000_manage)" -D"KBUILD_MODNAME=KBUILD_STR(igb)" -c -o drivers/net/igb/.tmp_e1000_manage.o drivers/net/igb/e1000_manage.c
9601 +deps_drivers/net/igb/e1000_manage.o := \
9602 + drivers/net/igb/e1000_manage.c \
9603 + drivers/net/igb/e1000_api.h \
9604 + drivers/net/igb/e1000_hw.h \
9605 + drivers/net/igb/e1000_osdep.h \
9606 + include/linux/pci.h \
9607 + $(wildcard include/config/pci/msi.h) \
9608 + $(wildcard include/config/pci.h) \
9609 + $(wildcard include/config/ht/irq.h) \
9610 + $(wildcard include/config/pci/domains.h) \
9611 + include/linux/pci_regs.h \
9612 + include/linux/mod_devicetable.h \
9613 + include/linux/types.h \
9614 + $(wildcard include/config/uid16.h) \
9615 + $(wildcard include/config/lbd.h) \
9616 + $(wildcard include/config/lsf.h) \
9617 + $(wildcard include/config/resources/64bit.h) \
9618 + include/linux/posix_types.h \
9619 + include/linux/stddef.h \
9620 + include/linux/compiler.h \
9621 + $(wildcard include/config/enable/must/check.h) \
9622 + include/linux/compiler-gcc4.h \
9623 + $(wildcard include/config/forced/inlining.h) \
9624 + include/linux/compiler-gcc.h \
9625 + include/asm/posix_types.h \
9626 + include/asm/types.h \
9627 + $(wildcard include/config/highmem64g.h) \
9628 + include/linux/ioport.h \
9629 + include/linux/list.h \
9630 + $(wildcard include/config/debug/list.h) \
9631 + include/linux/poison.h \
9632 + include/linux/prefetch.h \
9633 + include/asm/processor.h \
9634 + $(wildcard include/config/smp.h) \
9635 + $(wildcard include/config/x86/ht.h) \
9636 + $(wildcard include/config/paravirt.h) \
9637 + $(wildcard include/config/mk8.h) \
9638 + $(wildcard include/config/mk7.h) \
9639 + include/asm/vm86.h \
9640 + $(wildcard include/config/vm86.h) \
9641 + include/asm/ptrace.h \
9642 + include/asm/ptrace-abi.h \
9643 + include/asm/segment.h \
9644 + include/asm/math_emu.h \
9645 + include/asm/sigcontext.h \
9646 + include/asm/page.h \
9647 + $(wildcard include/config/x86/use/3dnow.h) \
9648 + $(wildcard include/config/x86/pae.h) \
9649 + $(wildcard include/config/hugetlb/page.h) \
9650 + $(wildcard include/config/highmem4g.h) \
9651 + $(wildcard include/config/page/offset.h) \
9652 + $(wildcard include/config/flatmem.h) \
9653 + include/asm-generic/pgtable-nopmd.h \
9654 + include/asm-generic/pgtable-nopud.h \
9655 + include/asm-generic/memory_model.h \
9656 + $(wildcard include/config/discontigmem.h) \
9657 + $(wildcard include/config/sparsemem.h) \
9658 + $(wildcard include/config/out/of/line/pfn/to/page.h) \
9659 + include/asm-generic/page.h \
9660 + include/asm/cpufeature.h \
9661 + include/linux/bitops.h \
9662 + include/asm/bitops.h \
9663 + include/asm/alternative.h \
9664 + include/asm-generic/bitops/sched.h \
9665 + include/asm-generic/bitops/hweight.h \
9666 + include/asm-generic/bitops/fls64.h \
9667 + include/asm-generic/bitops/ext2-non-atomic.h \
9668 + include/asm-generic/bitops/le.h \
9669 + include/asm/byteorder.h \
9670 + $(wildcard include/config/x86/bswap.h) \
9671 + include/linux/byteorder/little_endian.h \
9672 + include/linux/byteorder/swab.h \
9673 + include/linux/byteorder/generic.h \
9674 + include/asm-generic/bitops/minix.h \
9675 + include/asm/required-features.h \
9676 + $(wildcard include/config/x86/minimum/cpu.h) \
9677 + $(wildcard include/config/x86/cmov.h) \
9678 + $(wildcard include/config/x86/cmpxchg64.h) \
9679 + include/asm/msr.h \
9680 + include/asm/msr-index.h \
9681 + include/asm/errno.h \
9682 + include/asm-generic/errno.h \
9683 + include/asm-generic/errno-base.h \
9684 + include/linux/errno.h \
9685 + include/asm/system.h \
9686 + $(wildcard include/config/x86/oostore.h) \
9687 + include/linux/kernel.h \
9688 + $(wildcard include/config/preempt/voluntary.h) \
9689 + $(wildcard include/config/debug/spinlock/sleep.h) \
9690 + $(wildcard include/config/printk.h) \
9691 + $(wildcard include/config/numa.h) \
9692 + /usr/lib/gcc/i386-redhat-linux/4.1.2/include/stdarg.h \
9693 + include/linux/linkage.h \
9694 + include/asm/linkage.h \
9695 + $(wildcard include/config/x86/alignment/16.h) \
9696 + include/linux/log2.h \
9697 + $(wildcard include/config/arch/has/ilog2/u32.h) \
9698 + $(wildcard include/config/arch/has/ilog2/u64.h) \
9699 + include/asm/bug.h \
9700 + $(wildcard include/config/bug.h) \
9701 + $(wildcard include/config/debug/bugverbose.h) \
9702 + include/asm-generic/bug.h \
9703 + $(wildcard include/config/generic/bug.h) \
9704 + include/asm/cmpxchg.h \
9705 + $(wildcard include/config/x86/cmpxchg.h) \
9706 + include/linux/irqflags.h \
9707 + $(wildcard include/config/trace/irqflags.h) \
9708 + $(wildcard include/config/trace/irqflags/support.h) \
9709 + $(wildcard include/config/x86.h) \
9710 + include/asm/irqflags.h \
9711 + include/asm/processor-flags.h \
9712 + include/linux/cache.h \
9713 + include/asm/cache.h \
9714 + $(wildcard include/config/x86/l1/cache/shift.h) \
9715 + include/linux/threads.h \
9716 + $(wildcard include/config/nr/cpus.h) \
9717 + $(wildcard include/config/base/small.h) \
9718 + include/asm/percpu.h \
9719 + include/linux/cpumask.h \
9720 + $(wildcard include/config/hotplug/cpu.h) \
9721 + include/linux/bitmap.h \
9722 + include/linux/string.h \
9723 + include/asm/string.h \
9724 + include/linux/init.h \
9725 + $(wildcard include/config/modules.h) \
9726 + $(wildcard include/config/hotplug.h) \
9727 + $(wildcard include/config/memory/hotplug.h) \
9728 + $(wildcard include/config/acpi/hotplug/memory.h) \
9729 + include/asm/atomic.h \
9730 + $(wildcard include/config/m386.h) \
9731 + include/asm-generic/atomic.h \
9732 + include/linux/device.h \
9733 + $(wildcard include/config/debug/devres.h) \
9734 + include/linux/kobject.h \
9735 + include/linux/sysfs.h \
9736 + $(wildcard include/config/sysfs.h) \
9737 + include/linux/spinlock.h \
9738 + $(wildcard include/config/debug/spinlock.h) \
9739 + $(wildcard include/config/preempt.h) \
9740 + $(wildcard include/config/debug/lock/alloc.h) \
9741 + include/linux/preempt.h \
9742 + $(wildcard include/config/debug/preempt.h) \
9743 + include/linux/thread_info.h \
9744 + include/asm/thread_info.h \
9745 + $(wildcard include/config/4kstacks.h) \
9746 + $(wildcard include/config/debug/stack/usage.h) \
9747 + include/linux/stringify.h \
9748 + include/linux/bottom_half.h \
9749 + include/linux/spinlock_types.h \
9750 + include/linux/lockdep.h \
9751 + $(wildcard include/config/lockdep.h) \
9752 + $(wildcard include/config/generic/hardirqs.h) \
9753 + $(wildcard include/config/prove/locking.h) \
9754 + include/asm/spinlock_types.h \
9755 + include/asm/spinlock.h \
9756 + $(wildcard include/config/x86/ppro/fence.h) \
9757 + include/asm/rwlock.h \
9758 + include/linux/spinlock_api_smp.h \
9759 + include/linux/kref.h \
9760 + include/linux/wait.h \
9761 + include/asm/current.h \
9762 + include/linux/klist.h \
9763 + include/linux/completion.h \
9764 + include/linux/module.h \
9765 + $(wildcard include/config/modversions.h) \
9766 + $(wildcard include/config/unused/symbols.h) \
9767 + $(wildcard include/config/module/unload.h) \
9768 + $(wildcard include/config/kallsyms.h) \
9769 + include/linux/stat.h \
9770 + include/asm/stat.h \
9771 + include/linux/time.h \
9772 + include/linux/seqlock.h \
9773 + include/linux/vs_time.h \
9774 + $(wildcard include/config/vserver/vtime.h) \
9775 + include/linux/kmod.h \
9776 + $(wildcard include/config/kmod.h) \
9777 + include/linux/elf.h \
9778 + include/linux/auxvec.h \
9779 + include/asm/auxvec.h \
9780 + include/linux/elf-em.h \
9781 + include/asm/elf.h \
9782 + include/asm/user.h \
9783 + include/asm/desc.h \
9784 + include/asm/ldt.h \
9785 + include/linux/smp.h \
9786 + include/asm/smp.h \
9787 + $(wildcard include/config/x86/local/apic.h) \
9788 + $(wildcard include/config/x86/io/apic.h) \
9789 + include/asm/mpspec.h \
9790 + $(wildcard include/config/acpi.h) \
9791 + include/asm/mpspec_def.h \
9792 + include/asm-i386/mach-generic/mach_mpspec.h \
9793 + include/asm/apic.h \
9794 + $(wildcard include/config/x86/good/apic.h) \
9795 + include/linux/pm.h \
9796 + $(wildcard include/config/pm.h) \
9797 + include/linux/delay.h \
9798 + include/asm/delay.h \
9799 + include/asm/fixmap.h \
9800 + $(wildcard include/config/highmem.h) \
9801 + $(wildcard include/config/x86/visws/apic.h) \
9802 + $(wildcard include/config/x86/f00f/bug.h) \
9803 + $(wildcard include/config/x86/cyclone/timer.h) \
9804 + $(wildcard include/config/pci/mmconfig.h) \
9805 + include/asm/acpi.h \
9806 + $(wildcard include/config/acpi/sleep.h) \
9807 + include/acpi/pdc_intel.h \
9808 + include/asm/apicdef.h \
9809 + include/asm/kmap_types.h \
9810 + $(wildcard include/config/debug/highmem.h) \
9811 + include/asm/io_apic.h \
9812 + include/asm-i386/mach-generic/mach_apicdef.h \
9813 + include/asm/genapic.h \
9814 + include/linux/percpu.h \
9815 + include/linux/slab.h \
9816 + $(wildcard include/config/slab/debug.h) \
9817 + $(wildcard include/config/slab.h) \
9818 + $(wildcard include/config/slub.h) \
9819 + $(wildcard include/config/debug/slab.h) \
9820 + include/linux/gfp.h \
9821 + $(wildcard include/config/zone/dma.h) \
9822 + $(wildcard include/config/zone/dma32.h) \
9823 + include/linux/mmzone.h \
9824 + $(wildcard include/config/force/max/zoneorder.h) \
9825 + $(wildcard include/config/arch/populates/node/map.h) \
9826 + $(wildcard include/config/flat/node/mem/map.h) \
9827 + $(wildcard include/config/have/memory/present.h) \
9828 + $(wildcard include/config/need/node/memmap/size.h) \
9829 + $(wildcard include/config/need/multiple/nodes.h) \
9830 + $(wildcard include/config/have/arch/early/pfn/to/nid.h) \
9831 + $(wildcard include/config/sparsemem/extreme.h) \
9832 + $(wildcard include/config/nodes/span/other/nodes.h) \
9833 + $(wildcard include/config/holes/in/zone.h) \
9834 + include/linux/numa.h \
9835 + $(wildcard include/config/nodes/shift.h) \
9836 + include/linux/nodemask.h \
9837 + include/linux/memory_hotplug.h \
9838 + $(wildcard include/config/have/arch/nodedata/extension.h) \
9839 + include/linux/notifier.h \
9840 + include/linux/mutex.h \
9841 + $(wildcard include/config/debug/mutexes.h) \
9842 + $(wildcard include/config/chopstix.h) \
9843 + include/linux/rwsem.h \
9844 + $(wildcard include/config/rwsem/generic/spinlock.h) \
9845 + include/asm/rwsem.h \
9846 + include/linux/srcu.h \
9847 + include/linux/topology.h \
9848 + $(wildcard include/config/sched/smt.h) \
9849 + $(wildcard include/config/sched/mc.h) \
9850 + include/asm/topology.h \
9851 + include/asm-generic/topology.h \
9852 + include/linux/slab_def.h \
9853 + include/linux/kmalloc_sizes.h \
9854 + include/asm/mmu.h \
9855 + include/asm/semaphore.h \
9856 + include/linux/moduleparam.h \
9857 + include/asm/local.h \
9858 + include/asm/module.h \
9859 + $(wildcard include/config/m486.h) \
9860 + $(wildcard include/config/m586.h) \
9861 + $(wildcard include/config/m586tsc.h) \
9862 + $(wildcard include/config/m586mmx.h) \
9863 + $(wildcard include/config/mcore2.h) \
9864 + $(wildcard include/config/m686.h) \
9865 + $(wildcard include/config/mpentiumii.h) \
9866 + $(wildcard include/config/mpentiumiii.h) \
9867 + $(wildcard include/config/mpentiumm.h) \
9868 + $(wildcard include/config/mpentium4.h) \
9869 + $(wildcard include/config/mk6.h) \
9870 + $(wildcard include/config/x86/elan.h) \
9871 + $(wildcard include/config/mcrusoe.h) \
9872 + $(wildcard include/config/mefficeon.h) \
9873 + $(wildcard include/config/mwinchipc6.h) \
9874 + $(wildcard include/config/mwinchip2.h) \
9875 + $(wildcard include/config/mwinchip3d.h) \
9876 + $(wildcard include/config/mcyrixiii.h) \
9877 + $(wildcard include/config/mviac3/2.h) \
9878 + $(wildcard include/config/mviac7.h) \
9879 + $(wildcard include/config/mgeodegx1.h) \
9880 + $(wildcard include/config/mgeode/lx.h) \
9881 + include/asm/device.h \
9882 + include/linux/pci_ids.h \
9883 + include/linux/dmapool.h \
9884 + include/asm/io.h \
9885 + $(wildcard include/config/x86/numaq.h) \
9886 + include/asm-generic/iomap.h \
9887 + include/linux/vmalloc.h \
9888 + include/asm/scatterlist.h \
9889 + include/asm/pci.h \
9890 + include/linux/mm.h \
9891 + $(wildcard include/config/sysctl.h) \
9892 + $(wildcard include/config/mmu.h) \
9893 + $(wildcard include/config/stack/growsup.h) \
9894 + $(wildcard include/config/debug/vm.h) \
9895 + $(wildcard include/config/shmem.h) \
9896 + $(wildcard include/config/split/ptlock/cpus.h) \
9897 + $(wildcard include/config/ia64.h) \
9898 + $(wildcard include/config/proc/fs.h) \
9899 + $(wildcard include/config/debug/pagealloc.h) \
9900 + include/linux/capability.h \
9901 + include/linux/rbtree.h \
9902 + include/linux/prio_tree.h \
9903 + include/linux/fs.h \
9904 + $(wildcard include/config/dnotify.h) \
9905 + $(wildcard include/config/vserver/cowbl.h) \
9906 + $(wildcard include/config/quota.h) \
9907 + $(wildcard include/config/inotify.h) \
9908 + $(wildcard include/config/security.h) \
9909 + $(wildcard include/config/epoll.h) \
9910 + $(wildcard include/config/auditsyscall.h) \
9911 + $(wildcard include/config/block.h) \
9912 + $(wildcard include/config/fs/xip.h) \
9913 + $(wildcard include/config/migration.h) \
9914 + include/linux/limits.h \
9915 + include/linux/ioctl.h \
9916 + include/asm/ioctl.h \
9917 + include/asm-generic/ioctl.h \
9918 + include/linux/kdev_t.h \
9919 + include/linux/dcache.h \
9920 + $(wildcard include/config/profiling.h) \
9921 + include/linux/rcupdate.h \
9922 + include/linux/namei.h \
9923 + include/linux/radix-tree.h \
9924 + include/linux/pid.h \
9925 + include/linux/quota.h \
9926 + include/linux/dqblk_xfs.h \
9927 + include/linux/dqblk_v1.h \
9928 + include/linux/dqblk_v2.h \
9929 + include/linux/nfs_fs_i.h \
9930 + include/linux/nfs.h \
9931 + include/linux/sunrpc/msg_prot.h \
9932 + include/linux/fcntl.h \
9933 + include/asm/fcntl.h \
9934 + include/asm-generic/fcntl.h \
9935 + $(wildcard include/config/64bit.h) \
9936 + include/linux/err.h \
9937 + include/linux/debug_locks.h \
9938 + $(wildcard include/config/debug/locking/api/selftests.h) \
9939 + include/linux/backing-dev.h \
9940 + include/linux/mm_types.h \
9941 + include/asm/pgtable.h \
9942 + $(wildcard include/config/highpte.h) \
9943 + include/asm/paravirt.h \
9944 + include/asm/pgtable-2level-defs.h \
9945 + include/asm/pgtable-2level.h \
9946 + include/asm-generic/pgtable.h \
9947 + include/linux/page-flags.h \
9948 + $(wildcard include/config/s390.h) \
9949 + $(wildcard include/config/swap.h) \
9950 + include/linux/vmstat.h \
9951 + $(wildcard include/config/vm/event/counters.h) \
9952 + include/asm-generic/pci-dma-compat.h \
9953 + include/linux/dma-mapping.h \
9954 + include/asm/dma-mapping.h \
9955 + include/asm-generic/pci.h \
9956 + include/linux/interrupt.h \
9957 + $(wildcard include/config/high/res/timers.h) \
9958 + $(wildcard include/config/generic/irq/probe.h) \
9959 + include/linux/irqreturn.h \
9960 + include/linux/hardirq.h \
9961 + $(wildcard include/config/preempt/bkl.h) \
9962 + $(wildcard include/config/virt/cpu/accounting.h) \
9963 + include/linux/smp_lock.h \
9964 + $(wildcard include/config/lock/kernel.h) \
9965 + include/linux/sched.h \
9966 + $(wildcard include/config/no/hz.h) \
9967 + $(wildcard include/config/detect/softlockup.h) \
9968 + $(wildcard include/config/keys.h) \
9969 + $(wildcard include/config/bsd/process/acct.h) \
9970 + $(wildcard include/config/taskstats.h) \
9971 + $(wildcard include/config/inotify/user.h) \
9972 + $(wildcard include/config/schedstats.h) \
9973 + $(wildcard include/config/task/delay/acct.h) \
9974 + $(wildcard include/config/blk/dev/io/trace.h) \
9975 + $(wildcard include/config/cc/stackprotector.h) \
9976 + $(wildcard include/config/sysvipc.h) \
9977 + $(wildcard include/config/rt/mutexes.h) \
9978 + $(wildcard include/config/task/xacct.h) \
9979 + $(wildcard include/config/cpusets.h) \
9980 + $(wildcard include/config/compat.h) \
9981 + $(wildcard include/config/fault/injection.h) \
9982 + include/asm/param.h \
9983 + $(wildcard include/config/hz.h) \
9984 + include/linux/timex.h \
9985 + $(wildcard include/config/time/interpolation.h) \
9986 + include/asm/timex.h \
9987 + include/asm/tsc.h \
9988 + $(wildcard include/config/x86/tsc.h) \
9989 + $(wildcard include/config/x86/generic.h) \
9990 + include/linux/jiffies.h \
9991 + include/linux/calc64.h \
9992 + include/asm/div64.h \
9993 + include/asm/cputime.h \
9994 + include/asm-generic/cputime.h \
9995 + include/linux/sem.h \
9996 + include/linux/ipc.h \
9997 + $(wildcard include/config/ipc/ns.h) \
9998 + include/asm/ipcbuf.h \
9999 + include/asm/sembuf.h \
10000 + include/linux/signal.h \
10001 + include/asm/signal.h \
10002 + include/asm-generic/signal.h \
10003 + include/asm/siginfo.h \
10004 + include/asm-generic/siginfo.h \
10005 + include/linux/securebits.h \
10006 + include/linux/fs_struct.h \
10007 + include/linux/seccomp.h \
10008 + $(wildcard include/config/seccomp.h) \
10009 + include/linux/futex.h \
10010 + $(wildcard include/config/futex.h) \
10011 + include/linux/rtmutex.h \
10012 + $(wildcard include/config/debug/rt/mutexes.h) \
10013 + include/linux/plist.h \
10014 + $(wildcard include/config/debug/pi/list.h) \
10015 + include/linux/param.h \
10016 + include/linux/resource.h \
10017 + include/asm/resource.h \
10018 + include/asm-generic/resource.h \
10019 + include/linux/timer.h \
10020 + $(wildcard include/config/timer/stats.h) \
10021 + include/linux/ktime.h \
10022 + $(wildcard include/config/ktime/scalar.h) \
10023 + include/linux/hrtimer.h \
10024 + include/linux/task_io_accounting.h \
10025 + $(wildcard include/config/task/io/accounting.h) \
10026 + include/linux/aio.h \
10027 + include/linux/workqueue.h \
10028 + include/linux/aio_abi.h \
10029 + include/linux/uio.h \
10030 + include/asm/hardirq.h \
10031 + include/linux/irq.h \
10032 + $(wildcard include/config/irq/per/cpu.h) \
10033 + $(wildcard include/config/irq/release/method.h) \
10034 + $(wildcard include/config/generic/pending/irq.h) \
10035 + $(wildcard include/config/irqbalance.h) \
10036 + $(wildcard include/config/auto/irq/affinity.h) \
10037 + $(wildcard include/config/generic/hardirqs/no//do/irq.h) \
10038 + include/asm/irq.h \
10039 + include/asm-i386/mach-default/irq_vectors.h \
10040 + include/asm-i386/mach-default/irq_vectors_limits.h \
10041 + include/asm/irq_regs.h \
10042 + include/asm/hw_irq.h \
10043 + include/linux/profile.h \
10044 + include/asm/sections.h \
10045 + include/asm-generic/sections.h \
10046 + include/linux/irq_cpustat.h \
10047 + include/linux/if_ether.h \
10048 + include/linux/skbuff.h \
10049 + $(wildcard include/config/nf/conntrack.h) \
10050 + $(wildcard include/config/bridge/netfilter.h) \
10051 + $(wildcard include/config/vlan/8021q.h) \
10052 + $(wildcard include/config/net/sched.h) \
10053 + $(wildcard include/config/net/cls/act.h) \
10054 + $(wildcard include/config/net/dma.h) \
10055 + $(wildcard include/config/network/secmark.h) \
10056 + include/linux/net.h \
10057 + include/asm/socket.h \
10058 + include/asm/sockios.h \
10059 + include/linux/random.h \
10060 + include/linux/sysctl.h \
10061 + $(wildcard include/config/icmp/ipod.h) \
10062 + $(wildcard include/config/web100/net100.h) \
10063 + $(wildcard include/config/web100/stats.h) \
10064 + include/linux/textsearch.h \
10065 + include/net/checksum.h \
10066 + include/asm/uaccess.h \
10067 + $(wildcard include/config/x86/intel/usercopy.h) \
10068 + $(wildcard include/config/x86/wp/works/ok.h) \
10069 + include/asm/checksum.h \
10070 + include/linux/in6.h \
10071 + include/linux/dmaengine.h \
10072 + $(wildcard include/config/dma/engine.h) \
10073 + drivers/net/igb/kcompat.h \
10074 + $(wildcard include/config/e1000/napi.h) \
10075 + $(wildcard include/config/e1000e/napi.h) \
10076 + $(wildcard include/config/ixgb/napi.h) \
10077 + $(wildcard include/config/e1000/disable/packet/split.h) \
10078 + $(wildcard include/config/igb/disable/packet/split.h) \
10079 + $(wildcard include/config/net/poll/controller.h) \
10080 + $(wildcard include/config/space/len.h) \
10081 + $(wildcard include/config/netpoll.h) \
10082 + $(wildcard include/config/netdevices/multiqueue.h) \
10083 + include/linux/version.h \
10084 + include/linux/netdevice.h \
10085 + $(wildcard include/config/ax25.h) \
10086 + $(wildcard include/config/tr.h) \
10087 + $(wildcard include/config/net/ipip.h) \
10088 + $(wildcard include/config/net/ipgre.h) \
10089 + $(wildcard include/config/ipv6/sit.h) \
10090 + $(wildcard include/config/ipv6/tunnel.h) \
10091 + $(wildcard include/config/wireless/ext.h) \
10092 + $(wildcard include/config/netpoll/trap.h) \
10093 + include/linux/if.h \
10094 + include/linux/socket.h \
10095 + include/linux/sockios.h \
10096 + include/linux/hdlc/ioctl.h \
10097 + include/linux/if_packet.h \
10098 + include/linux/etherdevice.h \
10099 + include/linux/in.h \
10100 + include/linux/ip.h \
10101 + include/linux/udp.h \
10102 + include/net/inet_sock.h \
10103 + $(wildcard include/config/ipv6.h) \
10104 + include/linux/jhash.h \
10105 + include/net/flow.h \
10106 + $(wildcard include/config/ipv6/mip6.h) \
10107 + include/net/sock.h \
10108 + $(wildcard include/config/security/network.h) \
10109 + include/linux/security.h \
10110 + $(wildcard include/config/security/network/xfrm.h) \
10111 + include/linux/binfmts.h \
10112 + include/linux/shm.h \
10113 + include/asm/shmparam.h \
10114 + include/asm/shmbuf.h \
10115 + include/linux/msg.h \
10116 + include/asm/msgbuf.h \
10117 + include/linux/key.h \
10118 + include/linux/xfrm.h \
10119 + include/linux/filter.h \
10120 + include/net/dst.h \
10121 + $(wildcard include/config/net/cls/route.h) \
10122 + $(wildcard include/config/xfrm.h) \
10123 + include/linux/rtnetlink.h \
10124 + include/linux/netlink.h \
10125 + include/linux/if_link.h \
10126 + include/linux/if_addr.h \
10127 + include/linux/neighbour.h \
10128 + include/net/neighbour.h \
10129 + include/linux/seq_file.h \
10130 + include/net/rtnetlink.h \
10131 + include/net/netlink.h \
10132 + include/net/request_sock.h \
10133 + include/linux/mii.h \
10134 + include/linux/latency.h \
10135 + drivers/net/igb/e1000_regs.h \
10136 + drivers/net/igb/e1000_defines.h \
10137 + $(wildcard include/config/res.h) \
10138 + $(wildcard include/config/fault.h) \
10139 + drivers/net/igb/e1000_mac.h \
10140 + drivers/net/igb/e1000_phy.h \
10141 + drivers/net/igb/e1000_nvm.h \
10142 + drivers/net/igb/e1000_manage.h \
10143 + drivers/net/igb/e1000_82575.h \
10145 +drivers/net/igb/e1000_manage.o: $(deps_drivers/net/igb/e1000_manage.o)
10147 +$(deps_drivers/net/igb/e1000_manage.o):
10148 diff -Nru vanilla/drivers/net/igb/e1000_nvm.c linux-i686-2.6.22/drivers/net/igb/e1000_nvm.c
10149 --- vanilla/drivers/net/igb/e1000_nvm.c 1969-12-31 19:00:00.000000000 -0500
10150 +++ linux-i686-2.6.22/drivers/net/igb/e1000_nvm.c 2009-07-16 19:25:22.000000000 -0400
10152 +/*******************************************************************************
10154 + Intel(R) Gigabit Ethernet Linux driver
10155 + Copyright(c) 2007-2008 Intel Corporation.
10157 + This program is free software; you can redistribute it and/or modify it
10158 + under the terms and conditions of the GNU General Public License,
10159 + version 2, as published by the Free Software Foundation.
10161 + This program is distributed in the hope it will be useful, but WITHOUT
10162 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10163 + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
10166 + You should have received a copy of the GNU General Public License along with
10167 + this program; if not, write to the Free Software Foundation, Inc.,
10168 + 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
10170 + The full GNU General Public License is included in this distribution in
10171 + the file called "COPYING".
10173 + Contact Information:
10174 + e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
10175 + Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
10177 +*******************************************************************************/
10179 +#include "e1000_api.h"
10181 +static void e1000_stop_nvm(struct e1000_hw *hw);
10182 +static void e1000_reload_nvm_generic(struct e1000_hw *hw);
10185 + * e1000_init_nvm_ops_generic - Initialize NVM function pointers
10186 + * @hw: pointer to the HW structure
10188 + * Setups up the function pointers to no-op functions
10190 +void e1000_init_nvm_ops_generic(struct e1000_hw *hw)
10192 + struct e1000_nvm_info *nvm = &hw->nvm;
10193 + DEBUGFUNC("e1000_init_nvm_ops_generic");
10195 + /* Initialize function pointers */
10196 + nvm->ops.reload = e1000_reload_nvm_generic;
10200 + * e1000_raise_eec_clk - Raise EEPROM clock
10201 + * @hw: pointer to the HW structure
10202 + * @eecd: pointer to the EEPROM
10204 + * Enable/Raise the EEPROM clock bit.
10206 +static void e1000_raise_eec_clk(struct e1000_hw *hw, u32 *eecd)
10208 + *eecd = *eecd | E1000_EECD_SK;
10209 + E1000_WRITE_REG(hw, E1000_EECD, *eecd);
10210 + E1000_WRITE_FLUSH(hw);
10211 + usec_delay(hw->nvm.delay_usec);
10215 + * e1000_lower_eec_clk - Lower EEPROM clock
10216 + * @hw: pointer to the HW structure
10217 + * @eecd: pointer to the EEPROM
10219 + * Clear/Lower the EEPROM clock bit.
10221 +static void e1000_lower_eec_clk(struct e1000_hw *hw, u32 *eecd)
10223 + *eecd = *eecd & ~E1000_EECD_SK;
10224 + E1000_WRITE_REG(hw, E1000_EECD, *eecd);
10225 + E1000_WRITE_FLUSH(hw);
10226 + usec_delay(hw->nvm.delay_usec);
10230 + * e1000_shift_out_eec_bits - Shift data bits our to the EEPROM
10231 + * @hw: pointer to the HW structure
10232 + * @data: data to send to the EEPROM
10233 + * @count: number of bits to shift out
10235 + * We need to shift 'count' bits out to the EEPROM. So, the value in the
10236 + * "data" parameter will be shifted out to the EEPROM one bit at a time.
10237 + * In order to do this, "data" must be broken down into bits.
10239 +static void e1000_shift_out_eec_bits(struct e1000_hw *hw, u16 data, u16 count)
10241 + struct e1000_nvm_info *nvm = &hw->nvm;
10242 + u32 eecd = E1000_READ_REG(hw, E1000_EECD);
10245 + DEBUGFUNC("e1000_shift_out_eec_bits");
10247 + mask = 0x01 << (count - 1);
10248 + if (nvm->type == e1000_nvm_eeprom_spi)
10249 + eecd |= E1000_EECD_DO;
10252 + eecd &= ~E1000_EECD_DI;
10255 + eecd |= E1000_EECD_DI;
10257 + E1000_WRITE_REG(hw, E1000_EECD, eecd);
10258 + E1000_WRITE_FLUSH(hw);
10260 + usec_delay(nvm->delay_usec);
10262 + e1000_raise_eec_clk(hw, &eecd);
10263 + e1000_lower_eec_clk(hw, &eecd);
10268 + eecd &= ~E1000_EECD_DI;
10269 + E1000_WRITE_REG(hw, E1000_EECD, eecd);
10273 + * e1000_shift_in_eec_bits - Shift data bits in from the EEPROM
10274 + * @hw: pointer to the HW structure
10275 + * @count: number of bits to shift in
10277 + * In order to read a register from the EEPROM, we need to shift 'count' bits
10278 + * in from the EEPROM. Bits are "shifted in" by raising the clock input to
10279 + * the EEPROM (setting the SK bit), and then reading the value of the data out
10280 + * "DO" bit. During this "shifting in" process the data in "DI" bit should
10281 + * always be clear.
10283 +static u16 e1000_shift_in_eec_bits(struct e1000_hw *hw, u16 count)
10289 + DEBUGFUNC("e1000_shift_in_eec_bits");
10291 + eecd = E1000_READ_REG(hw, E1000_EECD);
10293 + eecd &= ~(E1000_EECD_DO | E1000_EECD_DI);
10296 + for (i = 0; i < count; i++) {
10298 + e1000_raise_eec_clk(hw, &eecd);
10300 + eecd = E1000_READ_REG(hw, E1000_EECD);
10302 + eecd &= ~E1000_EECD_DI;
10303 + if (eecd & E1000_EECD_DO)
10306 + e1000_lower_eec_clk(hw, &eecd);
10313 + * e1000_poll_eerd_eewr_done - Poll for EEPROM read/write completion
10314 + * @hw: pointer to the HW structure
10315 + * @ee_reg: EEPROM flag for polling
10317 + * Polls the EEPROM status bit for either read or write completion based
10318 + * upon the value of 'ee_reg'.
10320 +s32 e1000_poll_eerd_eewr_done(struct e1000_hw *hw, int ee_reg)
10322 + u32 attempts = 100000;
10324 + s32 ret_val = -E1000_ERR_NVM;
10326 + DEBUGFUNC("e1000_poll_eerd_eewr_done");
10328 + for (i = 0; i < attempts; i++) {
10329 + if (ee_reg == E1000_NVM_POLL_READ)
10330 + reg = E1000_READ_REG(hw, E1000_EERD);
10332 + reg = E1000_READ_REG(hw, E1000_EEWR);
10334 + if (reg & E1000_NVM_RW_REG_DONE) {
10335 + ret_val = E1000_SUCCESS;
10346 + * e1000_acquire_nvm_generic - Generic request for access to EEPROM
10347 + * @hw: pointer to the HW structure
10349 + * Set the EEPROM access request bit and wait for EEPROM access grant bit.
10350 + * Return successful if access grant bit set, else clear the request for
10351 + * EEPROM access and return -E1000_ERR_NVM (-1).
10353 +s32 e1000_acquire_nvm_generic(struct e1000_hw *hw)
10355 + u32 eecd = E1000_READ_REG(hw, E1000_EECD);
10356 + s32 timeout = E1000_NVM_GRANT_ATTEMPTS;
10357 + s32 ret_val = E1000_SUCCESS;
10359 + DEBUGFUNC("e1000_acquire_nvm_generic");
10361 + E1000_WRITE_REG(hw, E1000_EECD, eecd | E1000_EECD_REQ);
10362 + eecd = E1000_READ_REG(hw, E1000_EECD);
10364 + while (timeout) {
10365 + if (eecd & E1000_EECD_GNT)
10368 + eecd = E1000_READ_REG(hw, E1000_EECD);
10373 + eecd &= ~E1000_EECD_REQ;
10374 + E1000_WRITE_REG(hw, E1000_EECD, eecd);
10375 + DEBUGOUT("Could not acquire NVM grant\n");
10376 + ret_val = -E1000_ERR_NVM;
10383 + * e1000_standby_nvm - Return EEPROM to standby state
10384 + * @hw: pointer to the HW structure
10386 + * Return the EEPROM to a standby state.
10388 +static void e1000_standby_nvm(struct e1000_hw *hw)
10390 + struct e1000_nvm_info *nvm = &hw->nvm;
10391 + u32 eecd = E1000_READ_REG(hw, E1000_EECD);
10393 + DEBUGFUNC("e1000_standby_nvm");
10395 + if (nvm->type == e1000_nvm_eeprom_spi) {
10396 + /* Toggle CS to flush commands */
10397 + eecd |= E1000_EECD_CS;
10398 + E1000_WRITE_REG(hw, E1000_EECD, eecd);
10399 + E1000_WRITE_FLUSH(hw);
10400 + usec_delay(nvm->delay_usec);
10401 + eecd &= ~E1000_EECD_CS;
10402 + E1000_WRITE_REG(hw, E1000_EECD, eecd);
10403 + E1000_WRITE_FLUSH(hw);
10404 + usec_delay(nvm->delay_usec);
10409 + * e1000_stop_nvm - Terminate EEPROM command
10410 + * @hw: pointer to the HW structure
10412 + * Terminates the current command by inverting the EEPROM's chip select pin.
10414 +static void e1000_stop_nvm(struct e1000_hw *hw)
10418 + DEBUGFUNC("e1000_stop_nvm");
10420 + eecd = E1000_READ_REG(hw, E1000_EECD);
10421 + if (hw->nvm.type == e1000_nvm_eeprom_spi) {
10422 + /* Pull CS high */
10423 + eecd |= E1000_EECD_CS;
10424 + e1000_lower_eec_clk(hw, &eecd);
10429 + * e1000_release_nvm_generic - Release exclusive access to EEPROM
10430 + * @hw: pointer to the HW structure
10432 + * Stop any current commands to the EEPROM and clear the EEPROM request bit.
10434 +void e1000_release_nvm_generic(struct e1000_hw *hw)
10438 + DEBUGFUNC("e1000_release_nvm_generic");
10440 + e1000_stop_nvm(hw);
10442 + eecd = E1000_READ_REG(hw, E1000_EECD);
10443 + eecd &= ~E1000_EECD_REQ;
10444 + E1000_WRITE_REG(hw, E1000_EECD, eecd);
10448 + * e1000_ready_nvm_eeprom - Prepares EEPROM for read/write
10449 + * @hw: pointer to the HW structure
10451 + * Setups the EEPROM for reading and writing.
10453 +static s32 e1000_ready_nvm_eeprom(struct e1000_hw *hw)
10455 + struct e1000_nvm_info *nvm = &hw->nvm;
10456 + u32 eecd = E1000_READ_REG(hw, E1000_EECD);
10457 + s32 ret_val = E1000_SUCCESS;
10461 + DEBUGFUNC("e1000_ready_nvm_eeprom");
10463 + if (nvm->type == e1000_nvm_eeprom_spi) {
10464 + /* Clear SK and CS */
10465 + eecd &= ~(E1000_EECD_CS | E1000_EECD_SK);
10466 + E1000_WRITE_REG(hw, E1000_EECD, eecd);
10468 + timeout = NVM_MAX_RETRY_SPI;
10471 + * Read "Status Register" repeatedly until the LSB is cleared.
10472 + * The EEPROM will signal that the command has been completed
10473 + * by clearing bit 0 of the internal status register. If it's
10474 + * not cleared within 'timeout', then error out.
10476 + while (timeout) {
10477 + e1000_shift_out_eec_bits(hw, NVM_RDSR_OPCODE_SPI,
10478 + hw->nvm.opcode_bits);
10479 + spi_stat_reg = (u8)e1000_shift_in_eec_bits(hw, 8);
10480 + if (!(spi_stat_reg & NVM_STATUS_RDY_SPI))
10484 + e1000_standby_nvm(hw);
10489 + DEBUGOUT("SPI NVM Status error\n");
10490 + ret_val = -E1000_ERR_NVM;
10500 + * e1000_read_nvm_eerd - Reads EEPROM using EERD register
10501 + * @hw: pointer to the HW structure
10502 + * @offset: offset of word in the EEPROM to read
10503 + * @words: number of words to read
10504 + * @data: word read from the EEPROM
10506 + * Reads a 16 bit word from the EEPROM using the EERD register.
10508 +s32 e1000_read_nvm_eerd(struct e1000_hw *hw, u16 offset, u16 words, u16 *data)
10510 + struct e1000_nvm_info *nvm = &hw->nvm;
10512 + s32 ret_val = E1000_SUCCESS;
10514 + DEBUGFUNC("e1000_read_nvm_eerd");
10517 + * A check for invalid values: offset too large, too many words,
10518 + * too many words for the offset, and not enough words.
10520 + if ((offset >= nvm->word_size) || (words > (nvm->word_size - offset)) ||
10522 + DEBUGOUT("nvm parameter(s) out of bounds\n");
10523 + ret_val = -E1000_ERR_NVM;
10527 + for (i = 0; i < words; i++) {
10528 + eerd = ((offset+i) << E1000_NVM_RW_ADDR_SHIFT) +
10529 + E1000_NVM_RW_REG_START;
10531 + E1000_WRITE_REG(hw, E1000_EERD, eerd);
10532 + ret_val = e1000_poll_eerd_eewr_done(hw, E1000_NVM_POLL_READ);
10536 + data[i] = (E1000_READ_REG(hw, E1000_EERD) >>
10537 + E1000_NVM_RW_REG_DATA);
10545 + * e1000_write_nvm_spi - Write to EEPROM using SPI
10546 + * @hw: pointer to the HW structure
10547 + * @offset: offset within the EEPROM to be written to
10548 + * @words: number of words to write
10549 + * @data: 16 bit word(s) to be written to the EEPROM
10551 + * Writes data to EEPROM at offset using SPI interface.
10553 + * If e1000_update_nvm_checksum is not called after this function , the
10554 + * EEPROM will most likely contain an invalid checksum.
10556 +s32 e1000_write_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data)
10558 + struct e1000_nvm_info *nvm = &hw->nvm;
10562 + DEBUGFUNC("e1000_write_nvm_spi");
10565 + * A check for invalid values: offset too large, too many words,
10566 + * and not enough words.
10568 + if ((offset >= nvm->word_size) || (words > (nvm->word_size - offset)) ||
10570 + DEBUGOUT("nvm parameter(s) out of bounds\n");
10571 + ret_val = -E1000_ERR_NVM;
10575 + ret_val = nvm->ops.acquire(hw);
10579 + while (widx < words) {
10580 + u8 write_opcode = NVM_WRITE_OPCODE_SPI;
10582 + ret_val = e1000_ready_nvm_eeprom(hw);
10586 + e1000_standby_nvm(hw);
10588 + /* Send the WRITE ENABLE command (8 bit opcode) */
10589 + e1000_shift_out_eec_bits(hw, NVM_WREN_OPCODE_SPI,
10590 + nvm->opcode_bits);
10592 + e1000_standby_nvm(hw);
10595 + * Some SPI eeproms use the 8th address bit embedded in the
10598 + if ((nvm->address_bits == 8) && (offset >= 128))
10599 + write_opcode |= NVM_A8_OPCODE_SPI;
10601 + /* Send the Write command (8-bit opcode + addr) */
10602 + e1000_shift_out_eec_bits(hw, write_opcode, nvm->opcode_bits);
10603 + e1000_shift_out_eec_bits(hw, (u16)((offset + widx) * 2),
10604 + nvm->address_bits);
10606 + /* Loop to allow for up to whole page write of eeprom */
10607 + while (widx < words) {
10608 + u16 word_out = data[widx];
10609 + word_out = (word_out >> 8) | (word_out << 8);
10610 + e1000_shift_out_eec_bits(hw, word_out, 16);
10613 + if ((((offset + widx) * 2) % nvm->page_size) == 0) {
10614 + e1000_standby_nvm(hw);
10622 + nvm->ops.release(hw);
10629 + * e1000_read_pba_num_generic - Read device part number
10630 + * @hw: pointer to the HW structure
10631 + * @pba_num: pointer to device part number
10633 + * Reads the product board assembly (PBA) number from the EEPROM and stores
10634 + * the value in pba_num.
10636 +s32 e1000_read_pba_num_generic(struct e1000_hw *hw, u32 *pba_num)
10641 + DEBUGFUNC("e1000_read_pba_num_generic");
10643 + ret_val = hw->nvm.ops.read(hw, NVM_PBA_OFFSET_0, 1, &nvm_data);
10645 + DEBUGOUT("NVM Read Error\n");
10648 + *pba_num = (u32)(nvm_data << 16);
10650 + ret_val = hw->nvm.ops.read(hw, NVM_PBA_OFFSET_1, 1, &nvm_data);
10652 + DEBUGOUT("NVM Read Error\n");
10655 + *pba_num |= nvm_data;
10662 + * e1000_read_mac_addr_generic - Read device MAC address
10663 + * @hw: pointer to the HW structure
10665 + * Reads the device MAC address from the EEPROM and stores the value.
10666 + * Since devices with two ports use the same EEPROM, we increment the
10667 + * last bit in the MAC address for the second port.
10669 +s32 e1000_read_mac_addr_generic(struct e1000_hw *hw)
10671 + s32 ret_val = E1000_SUCCESS;
10672 + u16 offset, nvm_data, i;
10674 + DEBUGFUNC("e1000_read_mac_addr");
10676 + for (i = 0; i < ETH_ADDR_LEN; i += 2) {
10678 + ret_val = hw->nvm.ops.read(hw, offset, 1, &nvm_data);
10680 + DEBUGOUT("NVM Read Error\n");
10683 + hw->mac.perm_addr[i] = (u8)(nvm_data & 0xFF);
10684 + hw->mac.perm_addr[i+1] = (u8)(nvm_data >> 8);
10687 + /* Flip last bit of mac address if we're on second port */
10688 + if (hw->bus.func == E1000_FUNC_1)
10689 + hw->mac.perm_addr[5] ^= 1;
10691 + for (i = 0; i < ETH_ADDR_LEN; i++)
10692 + hw->mac.addr[i] = hw->mac.perm_addr[i];
10699 + * e1000_validate_nvm_checksum_generic - Validate EEPROM checksum
10700 + * @hw: pointer to the HW structure
10702 + * Calculates the EEPROM checksum by reading/adding each word of the EEPROM
10703 + * and then verifies that the sum of the EEPROM is equal to 0xBABA.
10705 +s32 e1000_validate_nvm_checksum_generic(struct e1000_hw *hw)
10707 + s32 ret_val = E1000_SUCCESS;
10708 + u16 checksum = 0;
10711 + DEBUGFUNC("e1000_validate_nvm_checksum_generic");
10713 + for (i = 0; i < (NVM_CHECKSUM_REG + 1); i++) {
10714 + ret_val = hw->nvm.ops.read(hw, i, 1, &nvm_data);
10716 + DEBUGOUT("NVM Read Error\n");
10719 + checksum += nvm_data;
10722 + if (checksum != (u16) NVM_SUM) {
10723 + DEBUGOUT("NVM Checksum Invalid\n");
10724 + ret_val = -E1000_ERR_NVM;
10733 + * e1000_update_nvm_checksum_generic - Update EEPROM checksum
10734 + * @hw: pointer to the HW structure
10736 + * Updates the EEPROM checksum by reading/adding each word of the EEPROM
10737 + * up to the checksum. Then calculates the EEPROM checksum and writes the
10738 + * value to the EEPROM.
10740 +s32 e1000_update_nvm_checksum_generic(struct e1000_hw *hw)
10743 + u16 checksum = 0;
10746 + DEBUGFUNC("e1000_update_nvm_checksum");
10748 + for (i = 0; i < NVM_CHECKSUM_REG; i++) {
10749 + ret_val = hw->nvm.ops.read(hw, i, 1, &nvm_data);
10751 + DEBUGOUT("NVM Read Error while updating checksum.\n");
10754 + checksum += nvm_data;
10756 + checksum = (u16) NVM_SUM - checksum;
10757 + ret_val = hw->nvm.ops.write(hw, NVM_CHECKSUM_REG, 1, &checksum);
10759 + DEBUGOUT("NVM Write Error while updating checksum.\n");
10767 + * e1000_reload_nvm_generic - Reloads EEPROM
10768 + * @hw: pointer to the HW structure
10770 + * Reloads the EEPROM by setting the "Reinitialize from EEPROM" bit in the
10771 + * extended control register.
10773 +static void e1000_reload_nvm_generic(struct e1000_hw *hw)
10777 + DEBUGFUNC("e1000_reload_nvm_generic");
10780 + ctrl_ext = E1000_READ_REG(hw, E1000_CTRL_EXT);
10781 + ctrl_ext |= E1000_CTRL_EXT_EE_RST;
10782 + E1000_WRITE_REG(hw, E1000_CTRL_EXT, ctrl_ext);
10783 + E1000_WRITE_FLUSH(hw);
10786 diff -Nru vanilla/drivers/net/igb/e1000_nvm.h linux-i686-2.6.22/drivers/net/igb/e1000_nvm.h
10787 --- vanilla/drivers/net/igb/e1000_nvm.h 1969-12-31 19:00:00.000000000 -0500
10788 +++ linux-i686-2.6.22/drivers/net/igb/e1000_nvm.h 2009-07-16 19:25:22.000000000 -0400
10790 +/*******************************************************************************
10792 + Intel(R) Gigabit Ethernet Linux driver
10793 + Copyright(c) 2007-2008 Intel Corporation.
10795 + This program is free software; you can redistribute it and/or modify it
10796 + under the terms and conditions of the GNU General Public License,
10797 + version 2, as published by the Free Software Foundation.
10799 + This program is distributed in the hope it will be useful, but WITHOUT
10800 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10801 + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
10804 + You should have received a copy of the GNU General Public License along with
10805 + this program; if not, write to the Free Software Foundation, Inc.,
10806 + 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
10808 + The full GNU General Public License is included in this distribution in
10809 + the file called "COPYING".
10811 + Contact Information:
10812 + e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
10813 + Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
10815 +*******************************************************************************/
10817 +#ifndef _E1000_NVM_H_
10818 +#define _E1000_NVM_H_
10820 +void e1000_init_nvm_ops_generic(struct e1000_hw *hw);
10821 +s32 e1000_acquire_nvm_generic(struct e1000_hw *hw);
10823 +s32 e1000_poll_eerd_eewr_done(struct e1000_hw *hw, int ee_reg);
10824 +s32 e1000_read_mac_addr_generic(struct e1000_hw *hw);
10825 +s32 e1000_read_pba_num_generic(struct e1000_hw *hw, u32 *pba_num);
10826 +s32 e1000_read_nvm_eerd(struct e1000_hw *hw, u16 offset, u16 words,
10828 +s32 e1000_valid_led_default_generic(struct e1000_hw *hw, u16 *data);
10829 +s32 e1000_validate_nvm_checksum_generic(struct e1000_hw *hw);
10830 +s32 e1000_write_nvm_eewr(struct e1000_hw *hw, u16 offset,
10831 + u16 words, u16 *data);
10832 +s32 e1000_write_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words,
10834 +s32 e1000_update_nvm_checksum_generic(struct e1000_hw *hw);
10835 +void e1000_release_nvm_generic(struct e1000_hw *hw);
10837 +#define E1000_STM_OPCODE 0xDB00
10840 Binary files vanilla/drivers/net/igb/e1000_nvm.o and linux-i686-2.6.22/drivers/net/igb/e1000_nvm.o differ
10841 diff -Nru vanilla/drivers/net/igb/.e1000_nvm.o.cmd linux-i686-2.6.22/drivers/net/igb/.e1000_nvm.o.cmd
10842 --- vanilla/drivers/net/igb/.e1000_nvm.o.cmd 1969-12-31 19:00:00.000000000 -0500
10843 +++ linux-i686-2.6.22/drivers/net/igb/.e1000_nvm.o.cmd 2009-07-16 19:53:42.000000000 -0400
10845 +cmd_drivers/net/igb/e1000_nvm.o := gcc -m32 -Wp,-MD,drivers/net/igb/.e1000_nvm.o.d -nostdinc -isystem /usr/lib/gcc/i386-redhat-linux/4.1.2/include -D__KERNEL__ -Iinclude -include include/linux/autoconf.h -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Os -pipe -msoft-float -mregparm=3 -freg-struct-return -mpreferred-stack-boundary=2 -march=i686 -mtune=generic -ffreestanding -maccumulate-outgoing-args -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -Iinclude/asm-i386/mach-generic -Iinclude/asm-i386/mach-default -fno-omit-frame-pointer -fno-optimize-sibling-calls -g -fno-stack-protector -Wdeclaration-after-statement -Wno-pointer-sign -DMODULE -D"KBUILD_STR(s)=\#s" -D"KBUILD_BASENAME=KBUILD_STR(e1000_nvm)" -D"KBUILD_MODNAME=KBUILD_STR(igb)" -c -o drivers/net/igb/.tmp_e1000_nvm.o drivers/net/igb/e1000_nvm.c
10847 +deps_drivers/net/igb/e1000_nvm.o := \
10848 + drivers/net/igb/e1000_nvm.c \
10849 + drivers/net/igb/e1000_api.h \
10850 + drivers/net/igb/e1000_hw.h \
10851 + drivers/net/igb/e1000_osdep.h \
10852 + include/linux/pci.h \
10853 + $(wildcard include/config/pci/msi.h) \
10854 + $(wildcard include/config/pci.h) \
10855 + $(wildcard include/config/ht/irq.h) \
10856 + $(wildcard include/config/pci/domains.h) \
10857 + include/linux/pci_regs.h \
10858 + include/linux/mod_devicetable.h \
10859 + include/linux/types.h \
10860 + $(wildcard include/config/uid16.h) \
10861 + $(wildcard include/config/lbd.h) \
10862 + $(wildcard include/config/lsf.h) \
10863 + $(wildcard include/config/resources/64bit.h) \
10864 + include/linux/posix_types.h \
10865 + include/linux/stddef.h \
10866 + include/linux/compiler.h \
10867 + $(wildcard include/config/enable/must/check.h) \
10868 + include/linux/compiler-gcc4.h \
10869 + $(wildcard include/config/forced/inlining.h) \
10870 + include/linux/compiler-gcc.h \
10871 + include/asm/posix_types.h \
10872 + include/asm/types.h \
10873 + $(wildcard include/config/highmem64g.h) \
10874 + include/linux/ioport.h \
10875 + include/linux/list.h \
10876 + $(wildcard include/config/debug/list.h) \
10877 + include/linux/poison.h \
10878 + include/linux/prefetch.h \
10879 + include/asm/processor.h \
10880 + $(wildcard include/config/smp.h) \
10881 + $(wildcard include/config/x86/ht.h) \
10882 + $(wildcard include/config/paravirt.h) \
10883 + $(wildcard include/config/mk8.h) \
10884 + $(wildcard include/config/mk7.h) \
10885 + include/asm/vm86.h \
10886 + $(wildcard include/config/vm86.h) \
10887 + include/asm/ptrace.h \
10888 + include/asm/ptrace-abi.h \
10889 + include/asm/segment.h \
10890 + include/asm/math_emu.h \
10891 + include/asm/sigcontext.h \
10892 + include/asm/page.h \
10893 + $(wildcard include/config/x86/use/3dnow.h) \
10894 + $(wildcard include/config/x86/pae.h) \
10895 + $(wildcard include/config/hugetlb/page.h) \
10896 + $(wildcard include/config/highmem4g.h) \
10897 + $(wildcard include/config/page/offset.h) \
10898 + $(wildcard include/config/flatmem.h) \
10899 + include/asm-generic/pgtable-nopmd.h \
10900 + include/asm-generic/pgtable-nopud.h \
10901 + include/asm-generic/memory_model.h \
10902 + $(wildcard include/config/discontigmem.h) \
10903 + $(wildcard include/config/sparsemem.h) \
10904 + $(wildcard include/config/out/of/line/pfn/to/page.h) \
10905 + include/asm-generic/page.h \
10906 + include/asm/cpufeature.h \
10907 + include/linux/bitops.h \
10908 + include/asm/bitops.h \
10909 + include/asm/alternative.h \
10910 + include/asm-generic/bitops/sched.h \
10911 + include/asm-generic/bitops/hweight.h \
10912 + include/asm-generic/bitops/fls64.h \
10913 + include/asm-generic/bitops/ext2-non-atomic.h \
10914 + include/asm-generic/bitops/le.h \
10915 + include/asm/byteorder.h \
10916 + $(wildcard include/config/x86/bswap.h) \
10917 + include/linux/byteorder/little_endian.h \
10918 + include/linux/byteorder/swab.h \
10919 + include/linux/byteorder/generic.h \
10920 + include/asm-generic/bitops/minix.h \
10921 + include/asm/required-features.h \
10922 + $(wildcard include/config/x86/minimum/cpu.h) \
10923 + $(wildcard include/config/x86/cmov.h) \
10924 + $(wildcard include/config/x86/cmpxchg64.h) \
10925 + include/asm/msr.h \
10926 + include/asm/msr-index.h \
10927 + include/asm/errno.h \
10928 + include/asm-generic/errno.h \
10929 + include/asm-generic/errno-base.h \
10930 + include/linux/errno.h \
10931 + include/asm/system.h \
10932 + $(wildcard include/config/x86/oostore.h) \
10933 + include/linux/kernel.h \
10934 + $(wildcard include/config/preempt/voluntary.h) \
10935 + $(wildcard include/config/debug/spinlock/sleep.h) \
10936 + $(wildcard include/config/printk.h) \
10937 + $(wildcard include/config/numa.h) \
10938 + /usr/lib/gcc/i386-redhat-linux/4.1.2/include/stdarg.h \
10939 + include/linux/linkage.h \
10940 + include/asm/linkage.h \
10941 + $(wildcard include/config/x86/alignment/16.h) \
10942 + include/linux/log2.h \
10943 + $(wildcard include/config/arch/has/ilog2/u32.h) \
10944 + $(wildcard include/config/arch/has/ilog2/u64.h) \
10945 + include/asm/bug.h \
10946 + $(wildcard include/config/bug.h) \
10947 + $(wildcard include/config/debug/bugverbose.h) \
10948 + include/asm-generic/bug.h \
10949 + $(wildcard include/config/generic/bug.h) \
10950 + include/asm/cmpxchg.h \
10951 + $(wildcard include/config/x86/cmpxchg.h) \
10952 + include/linux/irqflags.h \
10953 + $(wildcard include/config/trace/irqflags.h) \
10954 + $(wildcard include/config/trace/irqflags/support.h) \
10955 + $(wildcard include/config/x86.h) \
10956 + include/asm/irqflags.h \
10957 + include/asm/processor-flags.h \
10958 + include/linux/cache.h \
10959 + include/asm/cache.h \
10960 + $(wildcard include/config/x86/l1/cache/shift.h) \
10961 + include/linux/threads.h \
10962 + $(wildcard include/config/nr/cpus.h) \
10963 + $(wildcard include/config/base/small.h) \
10964 + include/asm/percpu.h \
10965 + include/linux/cpumask.h \
10966 + $(wildcard include/config/hotplug/cpu.h) \
10967 + include/linux/bitmap.h \
10968 + include/linux/string.h \
10969 + include/asm/string.h \
10970 + include/linux/init.h \
10971 + $(wildcard include/config/modules.h) \
10972 + $(wildcard include/config/hotplug.h) \
10973 + $(wildcard include/config/memory/hotplug.h) \
10974 + $(wildcard include/config/acpi/hotplug/memory.h) \
10975 + include/asm/atomic.h \
10976 + $(wildcard include/config/m386.h) \
10977 + include/asm-generic/atomic.h \
10978 + include/linux/device.h \
10979 + $(wildcard include/config/debug/devres.h) \
10980 + include/linux/kobject.h \
10981 + include/linux/sysfs.h \
10982 + $(wildcard include/config/sysfs.h) \
10983 + include/linux/spinlock.h \
10984 + $(wildcard include/config/debug/spinlock.h) \
10985 + $(wildcard include/config/preempt.h) \
10986 + $(wildcard include/config/debug/lock/alloc.h) \
10987 + include/linux/preempt.h \
10988 + $(wildcard include/config/debug/preempt.h) \
10989 + include/linux/thread_info.h \
10990 + include/asm/thread_info.h \
10991 + $(wildcard include/config/4kstacks.h) \
10992 + $(wildcard include/config/debug/stack/usage.h) \
10993 + include/linux/stringify.h \
10994 + include/linux/bottom_half.h \
10995 + include/linux/spinlock_types.h \
10996 + include/linux/lockdep.h \
10997 + $(wildcard include/config/lockdep.h) \
10998 + $(wildcard include/config/generic/hardirqs.h) \
10999 + $(wildcard include/config/prove/locking.h) \
11000 + include/asm/spinlock_types.h \
11001 + include/asm/spinlock.h \
11002 + $(wildcard include/config/x86/ppro/fence.h) \
11003 + include/asm/rwlock.h \
11004 + include/linux/spinlock_api_smp.h \
11005 + include/linux/kref.h \
11006 + include/linux/wait.h \
11007 + include/asm/current.h \
11008 + include/linux/klist.h \
11009 + include/linux/completion.h \
11010 + include/linux/module.h \
11011 + $(wildcard include/config/modversions.h) \
11012 + $(wildcard include/config/unused/symbols.h) \
11013 + $(wildcard include/config/module/unload.h) \
11014 + $(wildcard include/config/kallsyms.h) \
11015 + include/linux/stat.h \
11016 + include/asm/stat.h \
11017 + include/linux/time.h \
11018 + include/linux/seqlock.h \
11019 + include/linux/vs_time.h \
11020 + $(wildcard include/config/vserver/vtime.h) \
11021 + include/linux/kmod.h \
11022 + $(wildcard include/config/kmod.h) \
11023 + include/linux/elf.h \
11024 + include/linux/auxvec.h \
11025 + include/asm/auxvec.h \
11026 + include/linux/elf-em.h \
11027 + include/asm/elf.h \
11028 + include/asm/user.h \
11029 + include/asm/desc.h \
11030 + include/asm/ldt.h \
11031 + include/linux/smp.h \
11032 + include/asm/smp.h \
11033 + $(wildcard include/config/x86/local/apic.h) \
11034 + $(wildcard include/config/x86/io/apic.h) \
11035 + include/asm/mpspec.h \
11036 + $(wildcard include/config/acpi.h) \
11037 + include/asm/mpspec_def.h \
11038 + include/asm-i386/mach-generic/mach_mpspec.h \
11039 + include/asm/apic.h \
11040 + $(wildcard include/config/x86/good/apic.h) \
11041 + include/linux/pm.h \
11042 + $(wildcard include/config/pm.h) \
11043 + include/linux/delay.h \
11044 + include/asm/delay.h \
11045 + include/asm/fixmap.h \
11046 + $(wildcard include/config/highmem.h) \
11047 + $(wildcard include/config/x86/visws/apic.h) \
11048 + $(wildcard include/config/x86/f00f/bug.h) \
11049 + $(wildcard include/config/x86/cyclone/timer.h) \
11050 + $(wildcard include/config/pci/mmconfig.h) \
11051 + include/asm/acpi.h \
11052 + $(wildcard include/config/acpi/sleep.h) \
11053 + include/acpi/pdc_intel.h \
11054 + include/asm/apicdef.h \
11055 + include/asm/kmap_types.h \
11056 + $(wildcard include/config/debug/highmem.h) \
11057 + include/asm/io_apic.h \
11058 + include/asm-i386/mach-generic/mach_apicdef.h \
11059 + include/asm/genapic.h \
11060 + include/linux/percpu.h \
11061 + include/linux/slab.h \
11062 + $(wildcard include/config/slab/debug.h) \
11063 + $(wildcard include/config/slab.h) \
11064 + $(wildcard include/config/slub.h) \
11065 + $(wildcard include/config/debug/slab.h) \
11066 + include/linux/gfp.h \
11067 + $(wildcard include/config/zone/dma.h) \
11068 + $(wildcard include/config/zone/dma32.h) \
11069 + include/linux/mmzone.h \
11070 + $(wildcard include/config/force/max/zoneorder.h) \
11071 + $(wildcard include/config/arch/populates/node/map.h) \
11072 + $(wildcard include/config/flat/node/mem/map.h) \
11073 + $(wildcard include/config/have/memory/present.h) \
11074 + $(wildcard include/config/need/node/memmap/size.h) \
11075 + $(wildcard include/config/need/multiple/nodes.h) \
11076 + $(wildcard include/config/have/arch/early/pfn/to/nid.h) \
11077 + $(wildcard include/config/sparsemem/extreme.h) \
11078 + $(wildcard include/config/nodes/span/other/nodes.h) \
11079 + $(wildcard include/config/holes/in/zone.h) \
11080 + include/linux/numa.h \
11081 + $(wildcard include/config/nodes/shift.h) \
11082 + include/linux/nodemask.h \
11083 + include/linux/memory_hotplug.h \
11084 + $(wildcard include/config/have/arch/nodedata/extension.h) \
11085 + include/linux/notifier.h \
11086 + include/linux/mutex.h \
11087 + $(wildcard include/config/debug/mutexes.h) \
11088 + $(wildcard include/config/chopstix.h) \
11089 + include/linux/rwsem.h \
11090 + $(wildcard include/config/rwsem/generic/spinlock.h) \
11091 + include/asm/rwsem.h \
11092 + include/linux/srcu.h \
11093 + include/linux/topology.h \
11094 + $(wildcard include/config/sched/smt.h) \
11095 + $(wildcard include/config/sched/mc.h) \
11096 + include/asm/topology.h \
11097 + include/asm-generic/topology.h \
11098 + include/linux/slab_def.h \
11099 + include/linux/kmalloc_sizes.h \
11100 + include/asm/mmu.h \
11101 + include/asm/semaphore.h \
11102 + include/linux/moduleparam.h \
11103 + include/asm/local.h \
11104 + include/asm/module.h \
11105 + $(wildcard include/config/m486.h) \
11106 + $(wildcard include/config/m586.h) \
11107 + $(wildcard include/config/m586tsc.h) \
11108 + $(wildcard include/config/m586mmx.h) \
11109 + $(wildcard include/config/mcore2.h) \
11110 + $(wildcard include/config/m686.h) \
11111 + $(wildcard include/config/mpentiumii.h) \
11112 + $(wildcard include/config/mpentiumiii.h) \
11113 + $(wildcard include/config/mpentiumm.h) \
11114 + $(wildcard include/config/mpentium4.h) \
11115 + $(wildcard include/config/mk6.h) \
11116 + $(wildcard include/config/x86/elan.h) \
11117 + $(wildcard include/config/mcrusoe.h) \
11118 + $(wildcard include/config/mefficeon.h) \
11119 + $(wildcard include/config/mwinchipc6.h) \
11120 + $(wildcard include/config/mwinchip2.h) \
11121 + $(wildcard include/config/mwinchip3d.h) \
11122 + $(wildcard include/config/mcyrixiii.h) \
11123 + $(wildcard include/config/mviac3/2.h) \
11124 + $(wildcard include/config/mviac7.h) \
11125 + $(wildcard include/config/mgeodegx1.h) \
11126 + $(wildcard include/config/mgeode/lx.h) \
11127 + include/asm/device.h \
11128 + include/linux/pci_ids.h \
11129 + include/linux/dmapool.h \
11130 + include/asm/io.h \
11131 + $(wildcard include/config/x86/numaq.h) \
11132 + include/asm-generic/iomap.h \
11133 + include/linux/vmalloc.h \
11134 + include/asm/scatterlist.h \
11135 + include/asm/pci.h \
11136 + include/linux/mm.h \
11137 + $(wildcard include/config/sysctl.h) \
11138 + $(wildcard include/config/mmu.h) \
11139 + $(wildcard include/config/stack/growsup.h) \
11140 + $(wildcard include/config/debug/vm.h) \
11141 + $(wildcard include/config/shmem.h) \
11142 + $(wildcard include/config/split/ptlock/cpus.h) \
11143 + $(wildcard include/config/ia64.h) \
11144 + $(wildcard include/config/proc/fs.h) \
11145 + $(wildcard include/config/debug/pagealloc.h) \
11146 + include/linux/capability.h \
11147 + include/linux/rbtree.h \
11148 + include/linux/prio_tree.h \
11149 + include/linux/fs.h \
11150 + $(wildcard include/config/dnotify.h) \
11151 + $(wildcard include/config/vserver/cowbl.h) \
11152 + $(wildcard include/config/quota.h) \
11153 + $(wildcard include/config/inotify.h) \
11154 + $(wildcard include/config/security.h) \
11155 + $(wildcard include/config/epoll.h) \
11156 + $(wildcard include/config/auditsyscall.h) \
11157 + $(wildcard include/config/block.h) \
11158 + $(wildcard include/config/fs/xip.h) \
11159 + $(wildcard include/config/migration.h) \
11160 + include/linux/limits.h \
11161 + include/linux/ioctl.h \
11162 + include/asm/ioctl.h \
11163 + include/asm-generic/ioctl.h \
11164 + include/linux/kdev_t.h \
11165 + include/linux/dcache.h \
11166 + $(wildcard include/config/profiling.h) \
11167 + include/linux/rcupdate.h \
11168 + include/linux/namei.h \
11169 + include/linux/radix-tree.h \
11170 + include/linux/pid.h \
11171 + include/linux/quota.h \
11172 + include/linux/dqblk_xfs.h \
11173 + include/linux/dqblk_v1.h \
11174 + include/linux/dqblk_v2.h \
11175 + include/linux/nfs_fs_i.h \
11176 + include/linux/nfs.h \
11177 + include/linux/sunrpc/msg_prot.h \
11178 + include/linux/fcntl.h \
11179 + include/asm/fcntl.h \
11180 + include/asm-generic/fcntl.h \
11181 + $(wildcard include/config/64bit.h) \
11182 + include/linux/err.h \
11183 + include/linux/debug_locks.h \
11184 + $(wildcard include/config/debug/locking/api/selftests.h) \
11185 + include/linux/backing-dev.h \
11186 + include/linux/mm_types.h \
11187 + include/asm/pgtable.h \
11188 + $(wildcard include/config/highpte.h) \
11189 + include/asm/paravirt.h \
11190 + include/asm/pgtable-2level-defs.h \
11191 + include/asm/pgtable-2level.h \
11192 + include/asm-generic/pgtable.h \
11193 + include/linux/page-flags.h \
11194 + $(wildcard include/config/s390.h) \
11195 + $(wildcard include/config/swap.h) \
11196 + include/linux/vmstat.h \
11197 + $(wildcard include/config/vm/event/counters.h) \
11198 + include/asm-generic/pci-dma-compat.h \
11199 + include/linux/dma-mapping.h \
11200 + include/asm/dma-mapping.h \
11201 + include/asm-generic/pci.h \
11202 + include/linux/interrupt.h \
11203 + $(wildcard include/config/high/res/timers.h) \
11204 + $(wildcard include/config/generic/irq/probe.h) \
11205 + include/linux/irqreturn.h \
11206 + include/linux/hardirq.h \
11207 + $(wildcard include/config/preempt/bkl.h) \
11208 + $(wildcard include/config/virt/cpu/accounting.h) \
11209 + include/linux/smp_lock.h \
11210 + $(wildcard include/config/lock/kernel.h) \
11211 + include/linux/sched.h \
11212 + $(wildcard include/config/no/hz.h) \
11213 + $(wildcard include/config/detect/softlockup.h) \
11214 + $(wildcard include/config/keys.h) \
11215 + $(wildcard include/config/bsd/process/acct.h) \
11216 + $(wildcard include/config/taskstats.h) \
11217 + $(wildcard include/config/inotify/user.h) \
11218 + $(wildcard include/config/schedstats.h) \
11219 + $(wildcard include/config/task/delay/acct.h) \
11220 + $(wildcard include/config/blk/dev/io/trace.h) \
11221 + $(wildcard include/config/cc/stackprotector.h) \
11222 + $(wildcard include/config/sysvipc.h) \
11223 + $(wildcard include/config/rt/mutexes.h) \
11224 + $(wildcard include/config/task/xacct.h) \
11225 + $(wildcard include/config/cpusets.h) \
11226 + $(wildcard include/config/compat.h) \
11227 + $(wildcard include/config/fault/injection.h) \
11228 + include/asm/param.h \
11229 + $(wildcard include/config/hz.h) \
11230 + include/linux/timex.h \
11231 + $(wildcard include/config/time/interpolation.h) \
11232 + include/asm/timex.h \
11233 + include/asm/tsc.h \
11234 + $(wildcard include/config/x86/tsc.h) \
11235 + $(wildcard include/config/x86/generic.h) \
11236 + include/linux/jiffies.h \
11237 + include/linux/calc64.h \
11238 + include/asm/div64.h \
11239 + include/asm/cputime.h \
11240 + include/asm-generic/cputime.h \
11241 + include/linux/sem.h \
11242 + include/linux/ipc.h \
11243 + $(wildcard include/config/ipc/ns.h) \
11244 + include/asm/ipcbuf.h \
11245 + include/asm/sembuf.h \
11246 + include/linux/signal.h \
11247 + include/asm/signal.h \
11248 + include/asm-generic/signal.h \
11249 + include/asm/siginfo.h \
11250 + include/asm-generic/siginfo.h \
11251 + include/linux/securebits.h \
11252 + include/linux/fs_struct.h \
11253 + include/linux/seccomp.h \
11254 + $(wildcard include/config/seccomp.h) \
11255 + include/linux/futex.h \
11256 + $(wildcard include/config/futex.h) \
11257 + include/linux/rtmutex.h \
11258 + $(wildcard include/config/debug/rt/mutexes.h) \
11259 + include/linux/plist.h \
11260 + $(wildcard include/config/debug/pi/list.h) \
11261 + include/linux/param.h \
11262 + include/linux/resource.h \
11263 + include/asm/resource.h \
11264 + include/asm-generic/resource.h \
11265 + include/linux/timer.h \
11266 + $(wildcard include/config/timer/stats.h) \
11267 + include/linux/ktime.h \
11268 + $(wildcard include/config/ktime/scalar.h) \
11269 + include/linux/hrtimer.h \
11270 + include/linux/task_io_accounting.h \
11271 + $(wildcard include/config/task/io/accounting.h) \
11272 + include/linux/aio.h \
11273 + include/linux/workqueue.h \
11274 + include/linux/aio_abi.h \
11275 + include/linux/uio.h \
11276 + include/asm/hardirq.h \
11277 + include/linux/irq.h \
11278 + $(wildcard include/config/irq/per/cpu.h) \
11279 + $(wildcard include/config/irq/release/method.h) \
11280 + $(wildcard include/config/generic/pending/irq.h) \
11281 + $(wildcard include/config/irqbalance.h) \
11282 + $(wildcard include/config/auto/irq/affinity.h) \
11283 + $(wildcard include/config/generic/hardirqs/no//do/irq.h) \
11284 + include/asm/irq.h \
11285 + include/asm-i386/mach-default/irq_vectors.h \
11286 + include/asm-i386/mach-default/irq_vectors_limits.h \
11287 + include/asm/irq_regs.h \
11288 + include/asm/hw_irq.h \
11289 + include/linux/profile.h \
11290 + include/asm/sections.h \
11291 + include/asm-generic/sections.h \
11292 + include/linux/irq_cpustat.h \
11293 + include/linux/if_ether.h \
11294 + include/linux/skbuff.h \
11295 + $(wildcard include/config/nf/conntrack.h) \
11296 + $(wildcard include/config/bridge/netfilter.h) \
11297 + $(wildcard include/config/vlan/8021q.h) \
11298 + $(wildcard include/config/net/sched.h) \
11299 + $(wildcard include/config/net/cls/act.h) \
11300 + $(wildcard include/config/net/dma.h) \
11301 + $(wildcard include/config/network/secmark.h) \
11302 + include/linux/net.h \
11303 + include/asm/socket.h \
11304 + include/asm/sockios.h \
11305 + include/linux/random.h \
11306 + include/linux/sysctl.h \
11307 + $(wildcard include/config/icmp/ipod.h) \
11308 + $(wildcard include/config/web100/net100.h) \
11309 + $(wildcard include/config/web100/stats.h) \
11310 + include/linux/textsearch.h \
11311 + include/net/checksum.h \
11312 + include/asm/uaccess.h \
11313 + $(wildcard include/config/x86/intel/usercopy.h) \
11314 + $(wildcard include/config/x86/wp/works/ok.h) \
11315 + include/asm/checksum.h \
11316 + include/linux/in6.h \
11317 + include/linux/dmaengine.h \
11318 + $(wildcard include/config/dma/engine.h) \
11319 + drivers/net/igb/kcompat.h \
11320 + $(wildcard include/config/e1000/napi.h) \
11321 + $(wildcard include/config/e1000e/napi.h) \
11322 + $(wildcard include/config/ixgb/napi.h) \
11323 + $(wildcard include/config/e1000/disable/packet/split.h) \
11324 + $(wildcard include/config/igb/disable/packet/split.h) \
11325 + $(wildcard include/config/net/poll/controller.h) \
11326 + $(wildcard include/config/space/len.h) \
11327 + $(wildcard include/config/netpoll.h) \
11328 + $(wildcard include/config/netdevices/multiqueue.h) \
11329 + include/linux/version.h \
11330 + include/linux/netdevice.h \
11331 + $(wildcard include/config/ax25.h) \
11332 + $(wildcard include/config/tr.h) \
11333 + $(wildcard include/config/net/ipip.h) \
11334 + $(wildcard include/config/net/ipgre.h) \
11335 + $(wildcard include/config/ipv6/sit.h) \
11336 + $(wildcard include/config/ipv6/tunnel.h) \
11337 + $(wildcard include/config/wireless/ext.h) \
11338 + $(wildcard include/config/netpoll/trap.h) \
11339 + include/linux/if.h \
11340 + include/linux/socket.h \
11341 + include/linux/sockios.h \
11342 + include/linux/hdlc/ioctl.h \
11343 + include/linux/if_packet.h \
11344 + include/linux/etherdevice.h \
11345 + include/linux/in.h \
11346 + include/linux/ip.h \
11347 + include/linux/udp.h \
11348 + include/net/inet_sock.h \
11349 + $(wildcard include/config/ipv6.h) \
11350 + include/linux/jhash.h \
11351 + include/net/flow.h \
11352 + $(wildcard include/config/ipv6/mip6.h) \
11353 + include/net/sock.h \
11354 + $(wildcard include/config/security/network.h) \
11355 + include/linux/security.h \
11356 + $(wildcard include/config/security/network/xfrm.h) \
11357 + include/linux/binfmts.h \
11358 + include/linux/shm.h \
11359 + include/asm/shmparam.h \
11360 + include/asm/shmbuf.h \
11361 + include/linux/msg.h \
11362 + include/asm/msgbuf.h \
11363 + include/linux/key.h \
11364 + include/linux/xfrm.h \
11365 + include/linux/filter.h \
11366 + include/net/dst.h \
11367 + $(wildcard include/config/net/cls/route.h) \
11368 + $(wildcard include/config/xfrm.h) \
11369 + include/linux/rtnetlink.h \
11370 + include/linux/netlink.h \
11371 + include/linux/if_link.h \
11372 + include/linux/if_addr.h \
11373 + include/linux/neighbour.h \
11374 + include/net/neighbour.h \
11375 + include/linux/seq_file.h \
11376 + include/net/rtnetlink.h \
11377 + include/net/netlink.h \
11378 + include/net/request_sock.h \
11379 + include/linux/mii.h \
11380 + include/linux/latency.h \
11381 + drivers/net/igb/e1000_regs.h \
11382 + drivers/net/igb/e1000_defines.h \
11383 + $(wildcard include/config/res.h) \
11384 + $(wildcard include/config/fault.h) \
11385 + drivers/net/igb/e1000_mac.h \
11386 + drivers/net/igb/e1000_phy.h \
11387 + drivers/net/igb/e1000_nvm.h \
11388 + drivers/net/igb/e1000_manage.h \
11389 + drivers/net/igb/e1000_82575.h \
11391 +drivers/net/igb/e1000_nvm.o: $(deps_drivers/net/igb/e1000_nvm.o)
11393 +$(deps_drivers/net/igb/e1000_nvm.o):
11394 diff -Nru vanilla/drivers/net/igb/e1000_osdep.h linux-i686-2.6.22/drivers/net/igb/e1000_osdep.h
11395 --- vanilla/drivers/net/igb/e1000_osdep.h 1969-12-31 19:00:00.000000000 -0500
11396 +++ linux-i686-2.6.22/drivers/net/igb/e1000_osdep.h 2009-07-16 19:25:22.000000000 -0400
11398 +/*******************************************************************************
11400 + Intel(R) Gigabit Ethernet Linux driver
11401 + Copyright(c) 2007-2008 Intel Corporation.
11403 + This program is free software; you can redistribute it and/or modify it
11404 + under the terms and conditions of the GNU General Public License,
11405 + version 2, as published by the Free Software Foundation.
11407 + This program is distributed in the hope it will be useful, but WITHOUT
11408 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11409 + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11412 + You should have received a copy of the GNU General Public License along with
11413 + this program; if not, write to the Free Software Foundation, Inc.,
11414 + 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
11416 + The full GNU General Public License is included in this distribution in
11417 + the file called "COPYING".
11419 + Contact Information:
11420 + e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
11421 + Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
11423 +*******************************************************************************/
11426 +/* glue for the OS independent part of e1000
11427 + * includes register access macros
11430 +#ifndef _E1000_OSDEP_H_
11431 +#define _E1000_OSDEP_H_
11433 +#include <linux/pci.h>
11434 +#include <linux/delay.h>
11435 +#include <linux/interrupt.h>
11436 +#include <linux/if_ether.h>
11437 +#include <linux/sched.h>
11438 +#include "kcompat.h"
11440 +#define usec_delay(x) udelay(x)
11441 +#ifndef msec_delay
11442 +#define msec_delay(x) do { if (in_interrupt()) { \
11443 + /* Don't mdelay in interrupt context! */ \
11449 +/* Some workarounds require millisecond delays and are run during interrupt
11450 + * context. Most notably, when establishing link, the phy may need tweaking
11451 + * but cannot process phy register reads/writes faster than millisecond
11452 + * intervals...and we establish link due to a "link status change" interrupt.
11454 +#define msec_delay_irq(x) mdelay(x)
11457 +#define PCI_COMMAND_REGISTER PCI_COMMAND
11458 +#define CMD_MEM_WRT_INVALIDATE PCI_COMMAND_INVALIDATE
11459 +#define ETH_ADDR_LEN ETH_ALEN
11461 +#ifdef __BIG_ENDIAN
11462 +#define E1000_BIG_ENDIAN __BIG_ENDIAN
11466 +#define DEBUGOUT(S)
11467 +#define DEBUGOUT1(S, A...)
11469 +#define DEBUGFUNC(F) DEBUGOUT(F "\n")
11470 +#define DEBUGOUT2 DEBUGOUT1
11471 +#define DEBUGOUT3 DEBUGOUT2
11472 +#define DEBUGOUT7 DEBUGOUT3
11474 +#define E1000_REGISTER(a, reg) reg
11476 +#define E1000_WRITE_REG(a, reg, value) ( \
11477 + writel((value), ((a)->hw_addr + E1000_REGISTER(a, reg))))
11479 +#define E1000_READ_REG(a, reg) (readl((a)->hw_addr + E1000_REGISTER(a, reg)))
11481 +#define E1000_WRITE_REG_ARRAY(a, reg, offset, value) ( \
11482 + writel((value), ((a)->hw_addr + E1000_REGISTER(a, reg) + ((offset) << 2))))
11484 +#define E1000_READ_REG_ARRAY(a, reg, offset) ( \
11485 + readl((a)->hw_addr + E1000_REGISTER(a, reg) + ((offset) << 2)))
11487 +#define E1000_READ_REG_ARRAY_DWORD E1000_READ_REG_ARRAY
11488 +#define E1000_WRITE_REG_ARRAY_DWORD E1000_WRITE_REG_ARRAY
11490 +#define E1000_WRITE_REG_ARRAY_WORD(a, reg, offset, value) ( \
11491 + writew((value), ((a)->hw_addr + E1000_REGISTER(a, reg) + ((offset) << 1))))
11493 +#define E1000_READ_REG_ARRAY_WORD(a, reg, offset) ( \
11494 + readw((a)->hw_addr + E1000_REGISTER(a, reg) + ((offset) << 1)))
11496 +#define E1000_WRITE_REG_ARRAY_BYTE(a, reg, offset, value) ( \
11497 + writeb((value), ((a)->hw_addr + E1000_REGISTER(a, reg) + (offset))))
11499 +#define E1000_READ_REG_ARRAY_BYTE(a, reg, offset) ( \
11500 + readb((a)->hw_addr + E1000_REGISTER(a, reg) + (offset)))
11502 +#define E1000_WRITE_REG_IO(a, reg, offset) do { \
11503 + outl(reg, ((a)->io_base)); \
11504 + outl(offset, ((a)->io_base + 4)); } while (0)
11506 +#define E1000_WRITE_FLUSH(a) E1000_READ_REG(a, E1000_STATUS)
11508 +#define E1000_WRITE_FLASH_REG(a, reg, value) ( \
11509 + writel((value), ((a)->flash_address + reg)))
11511 +#define E1000_WRITE_FLASH_REG16(a, reg, value) ( \
11512 + writew((value), ((a)->flash_address + reg)))
11514 +#define E1000_READ_FLASH_REG(a, reg) (readl((a)->flash_address + reg))
11516 +#define E1000_READ_FLASH_REG16(a, reg) (readw((a)->flash_address + reg))
11518 +#endif /* _E1000_OSDEP_H_ */
11519 diff -Nru vanilla/drivers/net/igb/e1000_phy.c linux-i686-2.6.22/drivers/net/igb/e1000_phy.c
11520 --- vanilla/drivers/net/igb/e1000_phy.c 1969-12-31 19:00:00.000000000 -0500
11521 +++ linux-i686-2.6.22/drivers/net/igb/e1000_phy.c 2009-07-16 19:25:22.000000000 -0400
11523 +/*******************************************************************************
11525 + Intel(R) Gigabit Ethernet Linux driver
11526 + Copyright(c) 2007-2008 Intel Corporation.
11528 + This program is free software; you can redistribute it and/or modify it
11529 + under the terms and conditions of the GNU General Public License,
11530 + version 2, as published by the Free Software Foundation.
11532 + This program is distributed in the hope it will be useful, but WITHOUT
11533 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11534 + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11537 + You should have received a copy of the GNU General Public License along with
11538 + this program; if not, write to the Free Software Foundation, Inc.,
11539 + 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
11541 + The full GNU General Public License is included in this distribution in
11542 + the file called "COPYING".
11544 + Contact Information:
11545 + e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
11546 + Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
11548 +*******************************************************************************/
11550 +#include "e1000_api.h"
11552 +static s32 e1000_phy_setup_autoneg(struct e1000_hw *hw);
11553 +/* Cable length tables */
11554 +static const u16 e1000_m88_cable_length_table[] =
11555 + { 0, 50, 80, 110, 140, 140, E1000_CABLE_LENGTH_UNDEFINED };
11556 +#define M88E1000_CABLE_LENGTH_TABLE_SIZE \
11557 + (sizeof(e1000_m88_cable_length_table) / \
11558 + sizeof(e1000_m88_cable_length_table[0]))
11560 +static const u16 e1000_igp_2_cable_length_table[] =
11561 + { 0, 0, 0, 0, 0, 0, 0, 0, 3, 5, 8, 11, 13, 16, 18, 21,
11562 + 0, 0, 0, 3, 6, 10, 13, 16, 19, 23, 26, 29, 32, 35, 38, 41,
11563 + 6, 10, 14, 18, 22, 26, 30, 33, 37, 41, 44, 48, 51, 54, 58, 61,
11564 + 21, 26, 31, 35, 40, 44, 49, 53, 57, 61, 65, 68, 72, 75, 79, 82,
11565 + 40, 45, 51, 56, 61, 66, 70, 75, 79, 83, 87, 91, 94, 98, 101, 104,
11566 + 60, 66, 72, 77, 82, 87, 92, 96, 100, 104, 108, 111, 114, 117, 119, 121,
11567 + 83, 89, 95, 100, 105, 109, 113, 116, 119, 122, 124,
11568 + 104, 109, 114, 118, 121, 124};
11569 +#define IGP02E1000_CABLE_LENGTH_TABLE_SIZE \
11570 + (sizeof(e1000_igp_2_cable_length_table) / \
11571 + sizeof(e1000_igp_2_cable_length_table[0]))
11574 + * e1000_check_reset_block_generic - Check if PHY reset is blocked
11575 + * @hw: pointer to the HW structure
11577 + * Read the PHY management control register and check whether a PHY reset
11578 + * is blocked. If a reset is not blocked return E1000_SUCCESS, otherwise
11579 + * return E1000_BLK_PHY_RESET (12).
11581 +s32 e1000_check_reset_block_generic(struct e1000_hw *hw)
11585 + DEBUGFUNC("e1000_check_reset_block");
11587 + manc = E1000_READ_REG(hw, E1000_MANC);
11589 + return (manc & E1000_MANC_BLK_PHY_RST_ON_IDE) ?
11590 + E1000_BLK_PHY_RESET : E1000_SUCCESS;
11594 + * e1000_get_phy_id - Retrieve the PHY ID and revision
11595 + * @hw: pointer to the HW structure
11597 + * Reads the PHY registers and stores the PHY ID and possibly the PHY
11598 + * revision in the hardware structure.
11600 +s32 e1000_get_phy_id(struct e1000_hw *hw)
11602 + struct e1000_phy_info *phy = &hw->phy;
11603 + s32 ret_val = E1000_SUCCESS;
11606 + DEBUGFUNC("e1000_get_phy_id");
11608 + if (!(phy->ops.read_reg))
11611 + ret_val = phy->ops.read_reg(hw, PHY_ID1, &phy_id);
11615 + phy->id = (u32)(phy_id << 16);
11617 + ret_val = phy->ops.read_reg(hw, PHY_ID2, &phy_id);
11621 + phy->id |= (u32)(phy_id & PHY_REVISION_MASK);
11622 + phy->revision = (u32)(phy_id & ~PHY_REVISION_MASK);
11629 + * e1000_phy_reset_dsp_generic - Reset PHY DSP
11630 + * @hw: pointer to the HW structure
11632 + * Reset the digital signal processor.
11634 +s32 e1000_phy_reset_dsp_generic(struct e1000_hw *hw)
11636 + s32 ret_val = E1000_SUCCESS;
11638 + DEBUGFUNC("e1000_phy_reset_dsp_generic");
11640 + if (!(hw->phy.ops.write_reg))
11643 + ret_val = hw->phy.ops.write_reg(hw, M88E1000_PHY_GEN_CONTROL, 0xC1);
11647 + ret_val = hw->phy.ops.write_reg(hw, M88E1000_PHY_GEN_CONTROL, 0);
11654 + * e1000_read_phy_reg_mdic - Read MDI control register
11655 + * @hw: pointer to the HW structure
11656 + * @offset: register offset to be read
11657 + * @data: pointer to the read data
11659 + * Reads the MDI control register in the PHY at offset and stores the
11660 + * information read to data.
11662 +s32 e1000_read_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 *data)
11664 + struct e1000_phy_info *phy = &hw->phy;
11666 + s32 ret_val = E1000_SUCCESS;
11668 + DEBUGFUNC("e1000_read_phy_reg_mdic");
11671 + * Set up Op-code, Phy Address, and register offset in the MDI
11672 + * Control register. The MAC will take care of interfacing with the
11673 + * PHY to retrieve the desired data.
11675 + mdic = ((offset << E1000_MDIC_REG_SHIFT) |
11676 + (phy->addr << E1000_MDIC_PHY_SHIFT) |
11677 + (E1000_MDIC_OP_READ));
11679 + E1000_WRITE_REG(hw, E1000_MDIC, mdic);
11682 + * Poll the ready bit to see if the MDI read completed
11683 + * Increasing the time out as testing showed failures with
11684 + * the lower time out
11686 + for (i = 0; i < (E1000_GEN_POLL_TIMEOUT * 3); i++) {
11688 + mdic = E1000_READ_REG(hw, E1000_MDIC);
11689 + if (mdic & E1000_MDIC_READY)
11692 + if (!(mdic & E1000_MDIC_READY)) {
11693 + DEBUGOUT("MDI Read did not complete\n");
11694 + ret_val = -E1000_ERR_PHY;
11697 + if (mdic & E1000_MDIC_ERROR) {
11698 + DEBUGOUT("MDI Error\n");
11699 + ret_val = -E1000_ERR_PHY;
11702 + *data = (u16) mdic;
11709 + * e1000_write_phy_reg_mdic - Write MDI control register
11710 + * @hw: pointer to the HW structure
11711 + * @offset: register offset to write to
11712 + * @data: data to write to register at offset
11714 + * Writes data to MDI control register in the PHY at offset.
11716 +s32 e1000_write_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 data)
11718 + struct e1000_phy_info *phy = &hw->phy;
11720 + s32 ret_val = E1000_SUCCESS;
11722 + DEBUGFUNC("e1000_write_phy_reg_mdic");
11725 + * Set up Op-code, Phy Address, and register offset in the MDI
11726 + * Control register. The MAC will take care of interfacing with the
11727 + * PHY to retrieve the desired data.
11729 + mdic = (((u32)data) |
11730 + (offset << E1000_MDIC_REG_SHIFT) |
11731 + (phy->addr << E1000_MDIC_PHY_SHIFT) |
11732 + (E1000_MDIC_OP_WRITE));
11734 + E1000_WRITE_REG(hw, E1000_MDIC, mdic);
11737 + * Poll the ready bit to see if the MDI read completed
11738 + * Increasing the time out as testing showed failures with
11739 + * the lower time out
11741 + for (i = 0; i < (E1000_GEN_POLL_TIMEOUT * 3); i++) {
11743 + mdic = E1000_READ_REG(hw, E1000_MDIC);
11744 + if (mdic & E1000_MDIC_READY)
11747 + if (!(mdic & E1000_MDIC_READY)) {
11748 + DEBUGOUT("MDI Write did not complete\n");
11749 + ret_val = -E1000_ERR_PHY;
11752 + if (mdic & E1000_MDIC_ERROR) {
11753 + DEBUGOUT("MDI Error\n");
11754 + ret_val = -E1000_ERR_PHY;
11763 + * e1000_read_phy_reg_m88 - Read m88 PHY register
11764 + * @hw: pointer to the HW structure
11765 + * @offset: register offset to be read
11766 + * @data: pointer to the read data
11768 + * Acquires semaphore, if necessary, then reads the PHY register at offset
11769 + * and storing the retrieved information in data. Release any acquired
11770 + * semaphores before exiting.
11772 +s32 e1000_read_phy_reg_m88(struct e1000_hw *hw, u32 offset, u16 *data)
11774 + s32 ret_val = E1000_SUCCESS;
11776 + DEBUGFUNC("e1000_read_phy_reg_m88");
11778 + if (!(hw->phy.ops.acquire))
11781 + ret_val = hw->phy.ops.acquire(hw);
11785 + ret_val = e1000_read_phy_reg_mdic(hw, MAX_PHY_REG_ADDRESS & offset,
11788 + hw->phy.ops.release(hw);
11795 + * e1000_write_phy_reg_m88 - Write m88 PHY register
11796 + * @hw: pointer to the HW structure
11797 + * @offset: register offset to write to
11798 + * @data: data to write at register offset
11800 + * Acquires semaphore, if necessary, then writes the data to PHY register
11801 + * at the offset. Release any acquired semaphores before exiting.
11803 +s32 e1000_write_phy_reg_m88(struct e1000_hw *hw, u32 offset, u16 data)
11805 + s32 ret_val = E1000_SUCCESS;
11807 + DEBUGFUNC("e1000_write_phy_reg_m88");
11809 + if (!(hw->phy.ops.acquire))
11812 + ret_val = hw->phy.ops.acquire(hw);
11816 + ret_val = e1000_write_phy_reg_mdic(hw, MAX_PHY_REG_ADDRESS & offset,
11819 + hw->phy.ops.release(hw);
11826 + * e1000_read_phy_reg_igp - Read igp PHY register
11827 + * @hw: pointer to the HW structure
11828 + * @offset: register offset to be read
11829 + * @data: pointer to the read data
11831 + * Acquires semaphore, if necessary, then reads the PHY register at offset
11832 + * and storing the retrieved information in data. Release any acquired
11833 + * semaphores before exiting.
11835 +s32 e1000_read_phy_reg_igp(struct e1000_hw *hw, u32 offset, u16 *data)
11837 + s32 ret_val = E1000_SUCCESS;
11839 + DEBUGFUNC("e1000_read_phy_reg_igp");
11841 + if (!(hw->phy.ops.acquire))
11844 + ret_val = hw->phy.ops.acquire(hw);
11848 + if (offset > MAX_PHY_MULTI_PAGE_REG) {
11849 + ret_val = e1000_write_phy_reg_mdic(hw,
11850 + IGP01E1000_PHY_PAGE_SELECT,
11853 + hw->phy.ops.release(hw);
11858 + ret_val = e1000_read_phy_reg_mdic(hw, MAX_PHY_REG_ADDRESS & offset,
11861 + hw->phy.ops.release(hw);
11868 + * e1000_write_phy_reg_igp - Write igp PHY register
11869 + * @hw: pointer to the HW structure
11870 + * @offset: register offset to write to
11871 + * @data: data to write at register offset
11873 + * Acquires semaphore, if necessary, then writes the data to PHY register
11874 + * at the offset. Release any acquired semaphores before exiting.
11876 +s32 e1000_write_phy_reg_igp(struct e1000_hw *hw, u32 offset, u16 data)
11878 + s32 ret_val = E1000_SUCCESS;
11880 + DEBUGFUNC("e1000_write_phy_reg_igp");
11882 + if (!(hw->phy.ops.acquire))
11885 + ret_val = hw->phy.ops.acquire(hw);
11889 + if (offset > MAX_PHY_MULTI_PAGE_REG) {
11890 + ret_val = e1000_write_phy_reg_mdic(hw,
11891 + IGP01E1000_PHY_PAGE_SELECT,
11894 + hw->phy.ops.release(hw);
11899 + ret_val = e1000_write_phy_reg_mdic(hw, MAX_PHY_REG_ADDRESS & offset,
11902 + hw->phy.ops.release(hw);
11909 + * e1000_read_kmrn_reg_generic - Read kumeran register
11910 + * @hw: pointer to the HW structure
11911 + * @offset: register offset to be read
11912 + * @data: pointer to the read data
11914 + * Acquires semaphore, if necessary. Then reads the PHY register at offset
11915 + * using the kumeran interface. The information retrieved is stored in data.
11916 + * Release any acquired semaphores before exiting.
11918 +s32 e1000_read_kmrn_reg_generic(struct e1000_hw *hw, u32 offset, u16 *data)
11921 + s32 ret_val = E1000_SUCCESS;
11923 + DEBUGFUNC("e1000_read_kmrn_reg_generic");
11925 + if (!(hw->phy.ops.acquire))
11928 + ret_val = hw->phy.ops.acquire(hw);
11932 + kmrnctrlsta = ((offset << E1000_KMRNCTRLSTA_OFFSET_SHIFT) &
11933 + E1000_KMRNCTRLSTA_OFFSET) | E1000_KMRNCTRLSTA_REN;
11934 + E1000_WRITE_REG(hw, E1000_KMRNCTRLSTA, kmrnctrlsta);
11938 + kmrnctrlsta = E1000_READ_REG(hw, E1000_KMRNCTRLSTA);
11939 + *data = (u16)kmrnctrlsta;
11941 + hw->phy.ops.release(hw);
11948 + * e1000_write_kmrn_reg_generic - Write kumeran register
11949 + * @hw: pointer to the HW structure
11950 + * @offset: register offset to write to
11951 + * @data: data to write at register offset
11953 + * Acquires semaphore, if necessary. Then write the data to PHY register
11954 + * at the offset using the kumeran interface. Release any acquired semaphores
11955 + * before exiting.
11957 +s32 e1000_write_kmrn_reg_generic(struct e1000_hw *hw, u32 offset, u16 data)
11960 + s32 ret_val = E1000_SUCCESS;
11962 + DEBUGFUNC("e1000_write_kmrn_reg_generic");
11964 + if (!(hw->phy.ops.acquire))
11967 + ret_val = hw->phy.ops.acquire(hw);
11971 + kmrnctrlsta = ((offset << E1000_KMRNCTRLSTA_OFFSET_SHIFT) &
11972 + E1000_KMRNCTRLSTA_OFFSET) | data;
11973 + E1000_WRITE_REG(hw, E1000_KMRNCTRLSTA, kmrnctrlsta);
11976 + hw->phy.ops.release(hw);
11983 + * e1000_copper_link_setup_m88 - Setup m88 PHY's for copper link
11984 + * @hw: pointer to the HW structure
11986 + * Sets up MDI/MDI-X and polarity for m88 PHY's. If necessary, transmit clock
11987 + * and downshift values are set also.
11989 +s32 e1000_copper_link_setup_m88(struct e1000_hw *hw)
11991 + struct e1000_phy_info *phy = &hw->phy;
11995 + DEBUGFUNC("e1000_copper_link_setup_m88");
11997 + if (phy->reset_disable) {
11998 + ret_val = E1000_SUCCESS;
12002 + /* Enable CRS on TX. This must be set for half-duplex operation. */
12003 + ret_val = phy->ops.read_reg(hw, M88E1000_PHY_SPEC_CTRL, &phy_data);
12007 + phy_data |= M88E1000_PSCR_ASSERT_CRS_ON_TX;
12011 + * MDI/MDI-X = 0 (default)
12012 + * 0 - Auto for all speeds
12015 + * 3 - Auto for 1000Base-T only (MDI-X for 10/100Base-T modes)
12017 + phy_data &= ~M88E1000_PSCR_AUTO_X_MODE;
12019 + switch (phy->mdix) {
12021 + phy_data |= M88E1000_PSCR_MDI_MANUAL_MODE;
12024 + phy_data |= M88E1000_PSCR_MDIX_MANUAL_MODE;
12027 + phy_data |= M88E1000_PSCR_AUTO_X_1000T;
12031 + phy_data |= M88E1000_PSCR_AUTO_X_MODE;
12037 + * disable_polarity_correction = 0 (default)
12038 + * Automatic Correction for Reversed Cable Polarity
12042 + phy_data &= ~M88E1000_PSCR_POLARITY_REVERSAL;
12043 + if (phy->disable_polarity_correction == 1)
12044 + phy_data |= M88E1000_PSCR_POLARITY_REVERSAL;
12046 + ret_val = phy->ops.write_reg(hw, M88E1000_PHY_SPEC_CTRL, phy_data);
12050 + if (phy->revision < E1000_REVISION_4) {
12052 + * Force TX_CLK in the Extended PHY Specific Control Register
12053 + * to 25MHz clock.
12055 + ret_val = phy->ops.read_reg(hw, M88E1000_EXT_PHY_SPEC_CTRL,
12060 + phy_data |= M88E1000_EPSCR_TX_CLK_25;
12062 + if ((phy->revision == E1000_REVISION_2) &&
12063 + (phy->id == M88E1111_I_PHY_ID)) {
12064 + /* 82573L PHY - set the downshift counter to 5x. */
12065 + phy_data &= ~M88EC018_EPSCR_DOWNSHIFT_COUNTER_MASK;
12066 + phy_data |= M88EC018_EPSCR_DOWNSHIFT_COUNTER_5X;
12068 + /* Configure Master and Slave downshift values */
12069 + phy_data &= ~(M88E1000_EPSCR_MASTER_DOWNSHIFT_MASK |
12070 + M88E1000_EPSCR_SLAVE_DOWNSHIFT_MASK);
12071 + phy_data |= (M88E1000_EPSCR_MASTER_DOWNSHIFT_1X |
12072 + M88E1000_EPSCR_SLAVE_DOWNSHIFT_1X);
12074 + ret_val = phy->ops.write_reg(hw, M88E1000_EXT_PHY_SPEC_CTRL,
12080 + /* Commit the changes. */
12081 + ret_val = phy->ops.commit(hw);
12083 + DEBUGOUT("Error committing the PHY changes\n");
12092 + * e1000_copper_link_setup_igp - Setup igp PHY's for copper link
12093 + * @hw: pointer to the HW structure
12095 + * Sets up LPLU, MDI/MDI-X, polarity, Smartspeed and Master/Slave config for
12098 +s32 e1000_copper_link_setup_igp(struct e1000_hw *hw)
12100 + struct e1000_phy_info *phy = &hw->phy;
12104 + DEBUGFUNC("e1000_copper_link_setup_igp");
12106 + if (phy->reset_disable) {
12107 + ret_val = E1000_SUCCESS;
12111 + ret_val = hw->phy.ops.reset(hw);
12113 + DEBUGOUT("Error resetting the PHY.\n");
12118 + * Wait 100ms for MAC to configure PHY from NVM settings, to avoid
12119 + * timeout issues when LFS is enabled.
12124 + * The NVM settings will configure LPLU in D3 for
12127 + if (phy->type == e1000_phy_igp) {
12128 + /* disable lplu d3 during driver init */
12129 + ret_val = hw->phy.ops.set_d3_lplu_state(hw, false);
12131 + DEBUGOUT("Error Disabling LPLU D3\n");
12136 + /* disable lplu d0 during driver init */
12137 + if (hw->phy.ops.set_d0_lplu_state) {
12138 + ret_val = hw->phy.ops.set_d0_lplu_state(hw, false);
12140 + DEBUGOUT("Error Disabling LPLU D0\n");
12144 + /* Configure mdi-mdix settings */
12145 + ret_val = phy->ops.read_reg(hw, IGP01E1000_PHY_PORT_CTRL, &data);
12149 + data &= ~IGP01E1000_PSCR_AUTO_MDIX;
12151 + switch (phy->mdix) {
12153 + data &= ~IGP01E1000_PSCR_FORCE_MDI_MDIX;
12156 + data |= IGP01E1000_PSCR_FORCE_MDI_MDIX;
12160 + data |= IGP01E1000_PSCR_AUTO_MDIX;
12163 + ret_val = phy->ops.write_reg(hw, IGP01E1000_PHY_PORT_CTRL, data);
12167 + /* set auto-master slave resolution settings */
12168 + if (hw->mac.autoneg) {
12170 + * when autonegotiation advertisement is only 1000Mbps then we
12171 + * should disable SmartSpeed and enable Auto MasterSlave
12172 + * resolution as hardware default.
12174 + if (phy->autoneg_advertised == ADVERTISE_1000_FULL) {
12175 + /* Disable SmartSpeed */
12176 + ret_val = phy->ops.read_reg(hw,
12177 + IGP01E1000_PHY_PORT_CONFIG,
12182 + data &= ~IGP01E1000_PSCFR_SMART_SPEED;
12183 + ret_val = phy->ops.write_reg(hw,
12184 + IGP01E1000_PHY_PORT_CONFIG,
12189 + /* Set auto Master/Slave resolution process */
12190 + ret_val = phy->ops.read_reg(hw, PHY_1000T_CTRL, &data);
12194 + data &= ~CR_1000T_MS_ENABLE;
12195 + ret_val = phy->ops.write_reg(hw, PHY_1000T_CTRL, data);
12200 + ret_val = phy->ops.read_reg(hw, PHY_1000T_CTRL, &data);
12204 + /* load defaults for future use */
12205 + phy->original_ms_type = (data & CR_1000T_MS_ENABLE) ?
12206 + ((data & CR_1000T_MS_VALUE) ?
12207 + e1000_ms_force_master :
12208 + e1000_ms_force_slave) :
12211 + switch (phy->ms_type) {
12212 + case e1000_ms_force_master:
12213 + data |= (CR_1000T_MS_ENABLE | CR_1000T_MS_VALUE);
12215 + case e1000_ms_force_slave:
12216 + data |= CR_1000T_MS_ENABLE;
12217 + data &= ~(CR_1000T_MS_VALUE);
12219 + case e1000_ms_auto:
12220 + data &= ~CR_1000T_MS_ENABLE;
12224 + ret_val = phy->ops.write_reg(hw, PHY_1000T_CTRL, data);
12234 + * e1000_copper_link_autoneg - Setup/Enable autoneg for copper link
12235 + * @hw: pointer to the HW structure
12237 + * Performs initial bounds checking on autoneg advertisement parameter, then
12238 + * configure to advertise the full capability. Setup the PHY to autoneg
12239 + * and restart the negotiation process between the link partner. If
12240 + * autoneg_wait_to_complete, then wait for autoneg to complete before exiting.
12242 +s32 e1000_copper_link_autoneg(struct e1000_hw *hw)
12244 + struct e1000_phy_info *phy = &hw->phy;
12248 + DEBUGFUNC("e1000_copper_link_autoneg");
12251 + * Perform some bounds checking on the autoneg advertisement
12254 + phy->autoneg_advertised &= phy->autoneg_mask;
12257 + * If autoneg_advertised is zero, we assume it was not defaulted
12258 + * by the calling code so we set to advertise full capability.
12260 + if (phy->autoneg_advertised == 0)
12261 + phy->autoneg_advertised = phy->autoneg_mask;
12263 + DEBUGOUT("Reconfiguring auto-neg advertisement params\n");
12264 + ret_val = e1000_phy_setup_autoneg(hw);
12266 + DEBUGOUT("Error Setting up Auto-Negotiation\n");
12269 + DEBUGOUT("Restarting Auto-Neg\n");
12272 + * Restart auto-negotiation by setting the Auto Neg Enable bit and
12273 + * the Auto Neg Restart bit in the PHY control register.
12275 + ret_val = phy->ops.read_reg(hw, PHY_CONTROL, &phy_ctrl);
12279 + phy_ctrl |= (MII_CR_AUTO_NEG_EN | MII_CR_RESTART_AUTO_NEG);
12280 + ret_val = phy->ops.write_reg(hw, PHY_CONTROL, phy_ctrl);
12285 + * Does the user want to wait for Auto-Neg to complete here, or
12286 + * check at a later time (for example, callback routine).
12288 + if (phy->autoneg_wait_to_complete) {
12289 + ret_val = hw->mac.ops.wait_autoneg(hw);
12291 + DEBUGOUT("Error while waiting for "
12292 + "autoneg to complete\n");
12297 + hw->mac.get_link_status = true;
12304 + * e1000_phy_setup_autoneg - Configure PHY for auto-negotiation
12305 + * @hw: pointer to the HW structure
12307 + * Reads the MII auto-neg advertisement register and/or the 1000T control
12308 + * register and if the PHY is already setup for auto-negotiation, then
12309 + * return successful. Otherwise, setup advertisement and flow control to
12310 + * the appropriate values for the wanted auto-negotiation.
12312 +static s32 e1000_phy_setup_autoneg(struct e1000_hw *hw)
12314 + struct e1000_phy_info *phy = &hw->phy;
12316 + u16 mii_autoneg_adv_reg;
12317 + u16 mii_1000t_ctrl_reg = 0;
12319 + DEBUGFUNC("e1000_phy_setup_autoneg");
12321 + phy->autoneg_advertised &= phy->autoneg_mask;
12323 + /* Read the MII Auto-Neg Advertisement Register (Address 4). */
12324 + ret_val = phy->ops.read_reg(hw, PHY_AUTONEG_ADV, &mii_autoneg_adv_reg);
12328 + if (phy->autoneg_mask & ADVERTISE_1000_FULL) {
12329 + /* Read the MII 1000Base-T Control Register (Address 9). */
12330 + ret_val = phy->ops.read_reg(hw, PHY_1000T_CTRL,
12331 + &mii_1000t_ctrl_reg);
12337 + * Need to parse both autoneg_advertised and fc and set up
12338 + * the appropriate PHY registers. First we will parse for
12339 + * autoneg_advertised software override. Since we can advertise
12340 + * a plethora of combinations, we need to check each bit
12345 + * First we clear all the 10/100 mb speed bits in the Auto-Neg
12346 + * Advertisement Register (Address 4) and the 1000 mb speed bits in
12347 + * the 1000Base-T Control Register (Address 9).
12349 + mii_autoneg_adv_reg &= ~(NWAY_AR_100TX_FD_CAPS |
12350 + NWAY_AR_100TX_HD_CAPS |
12351 + NWAY_AR_10T_FD_CAPS |
12352 + NWAY_AR_10T_HD_CAPS);
12353 + mii_1000t_ctrl_reg &= ~(CR_1000T_HD_CAPS | CR_1000T_FD_CAPS);
12355 + DEBUGOUT1("autoneg_advertised %x\n", phy->autoneg_advertised);
12357 + /* Do we want to advertise 10 Mb Half Duplex? */
12358 + if (phy->autoneg_advertised & ADVERTISE_10_HALF) {
12359 + DEBUGOUT("Advertise 10mb Half duplex\n");
12360 + mii_autoneg_adv_reg |= NWAY_AR_10T_HD_CAPS;
12363 + /* Do we want to advertise 10 Mb Full Duplex? */
12364 + if (phy->autoneg_advertised & ADVERTISE_10_FULL) {
12365 + DEBUGOUT("Advertise 10mb Full duplex\n");
12366 + mii_autoneg_adv_reg |= NWAY_AR_10T_FD_CAPS;
12369 + /* Do we want to advertise 100 Mb Half Duplex? */
12370 + if (phy->autoneg_advertised & ADVERTISE_100_HALF) {
12371 + DEBUGOUT("Advertise 100mb Half duplex\n");
12372 + mii_autoneg_adv_reg |= NWAY_AR_100TX_HD_CAPS;
12375 + /* Do we want to advertise 100 Mb Full Duplex? */
12376 + if (phy->autoneg_advertised & ADVERTISE_100_FULL) {
12377 + DEBUGOUT("Advertise 100mb Full duplex\n");
12378 + mii_autoneg_adv_reg |= NWAY_AR_100TX_FD_CAPS;
12381 + /* We do not allow the Phy to advertise 1000 Mb Half Duplex */
12382 + if (phy->autoneg_advertised & ADVERTISE_1000_HALF)
12383 + DEBUGOUT("Advertise 1000mb Half duplex request denied!\n");
12385 + /* Do we want to advertise 1000 Mb Full Duplex? */
12386 + if (phy->autoneg_advertised & ADVERTISE_1000_FULL) {
12387 + DEBUGOUT("Advertise 1000mb Full duplex\n");
12388 + mii_1000t_ctrl_reg |= CR_1000T_FD_CAPS;
12392 + * Check for a software override of the flow control settings, and
12393 + * setup the PHY advertisement registers accordingly. If
12394 + * auto-negotiation is enabled, then software will have to set the
12395 + * "PAUSE" bits to the correct value in the Auto-Negotiation
12396 + * Advertisement Register (PHY_AUTONEG_ADV) and re-start auto-
12399 + * The possible values of the "fc" parameter are:
12400 + * 0: Flow control is completely disabled
12401 + * 1: Rx flow control is enabled (we can receive pause frames
12402 + * but not send pause frames).
12403 + * 2: Tx flow control is enabled (we can send pause frames
12404 + * but we do not support receiving pause frames).
12405 + * 3: Both Rx and Tx flow control (symmetric) are enabled.
12406 + * other: No software override. The flow control configuration
12407 + * in the EEPROM is used.
12409 + switch (hw->fc.type) {
12410 + case e1000_fc_none:
12412 + * Flow control (Rx & Tx) is completely disabled by a
12413 + * software over-ride.
12415 + mii_autoneg_adv_reg &= ~(NWAY_AR_ASM_DIR | NWAY_AR_PAUSE);
12417 + case e1000_fc_rx_pause:
12419 + * Rx Flow control is enabled, and Tx Flow control is
12420 + * disabled, by a software over-ride.
12422 + * Since there really isn't a way to advertise that we are
12423 + * capable of Rx Pause ONLY, we will advertise that we
12424 + * support both symmetric and asymmetric Rx PAUSE. Later
12425 + * (in e1000_config_fc_after_link_up) we will disable the
12426 + * hw's ability to send PAUSE frames.
12428 + mii_autoneg_adv_reg |= (NWAY_AR_ASM_DIR | NWAY_AR_PAUSE);
12430 + case e1000_fc_tx_pause:
12432 + * Tx Flow control is enabled, and Rx Flow control is
12433 + * disabled, by a software over-ride.
12435 + mii_autoneg_adv_reg |= NWAY_AR_ASM_DIR;
12436 + mii_autoneg_adv_reg &= ~NWAY_AR_PAUSE;
12438 + case e1000_fc_full:
12440 + * Flow control (both Rx and Tx) is enabled by a software
12443 + mii_autoneg_adv_reg |= (NWAY_AR_ASM_DIR | NWAY_AR_PAUSE);
12446 + DEBUGOUT("Flow control param set incorrectly\n");
12447 + ret_val = -E1000_ERR_CONFIG;
12451 + ret_val = phy->ops.write_reg(hw, PHY_AUTONEG_ADV, mii_autoneg_adv_reg);
12455 + DEBUGOUT1("Auto-Neg Advertising %x\n", mii_autoneg_adv_reg);
12457 + if (phy->autoneg_mask & ADVERTISE_1000_FULL) {
12458 + ret_val = phy->ops.write_reg(hw,
12460 + mii_1000t_ctrl_reg);
12470 + * e1000_setup_copper_link_generic - Configure copper link settings
12471 + * @hw: pointer to the HW structure
12473 + * Calls the appropriate function to configure the link for auto-neg or forced
12474 + * speed and duplex. Then we check for link, once link is established calls
12475 + * to configure collision distance and flow control are called. If link is
12476 + * not established, we return -E1000_ERR_PHY (-2).
12478 +s32 e1000_setup_copper_link_generic(struct e1000_hw *hw)
12483 + DEBUGFUNC("e1000_setup_copper_link_generic");
12485 + if (hw->mac.autoneg) {
12487 + * Setup autoneg and flow control advertisement and perform
12488 + * autonegotiation.
12490 + ret_val = e1000_copper_link_autoneg(hw);
12495 + * PHY will be set to 10H, 10F, 100H or 100F
12496 + * depending on user settings.
12498 + DEBUGOUT("Forcing Speed and Duplex\n");
12499 + ret_val = hw->phy.ops.force_speed_duplex(hw);
12501 + DEBUGOUT("Error Forcing Speed and Duplex\n");
12507 + * Check link status. Wait up to 100 microseconds for link to become
12510 + ret_val = e1000_phy_has_link_generic(hw,
12511 + COPPER_LINK_UP_LIMIT,
12518 + DEBUGOUT("Valid link established!!!\n");
12519 + e1000_config_collision_dist_generic(hw);
12520 + ret_val = e1000_config_fc_after_link_up_generic(hw);
12522 + DEBUGOUT("Unable to establish link!!!\n");
12530 + * e1000_phy_force_speed_duplex_igp - Force speed/duplex for igp PHY
12531 + * @hw: pointer to the HW structure
12533 + * Calls the PHY setup function to force speed and duplex. Clears the
12534 + * auto-crossover to force MDI manually. Waits for link and returns
12535 + * successful if link up is successful, else -E1000_ERR_PHY (-2).
12537 +s32 e1000_phy_force_speed_duplex_igp(struct e1000_hw *hw)
12539 + struct e1000_phy_info *phy = &hw->phy;
12544 + DEBUGFUNC("e1000_phy_force_speed_duplex_igp");
12546 + ret_val = phy->ops.read_reg(hw, PHY_CONTROL, &phy_data);
12550 + e1000_phy_force_speed_duplex_setup(hw, &phy_data);
12552 + ret_val = phy->ops.write_reg(hw, PHY_CONTROL, phy_data);
12557 + * Clear Auto-Crossover to force MDI manually. IGP requires MDI
12558 + * forced whenever speed and duplex are forced.
12560 + ret_val = phy->ops.read_reg(hw, IGP01E1000_PHY_PORT_CTRL, &phy_data);
12564 + phy_data &= ~IGP01E1000_PSCR_AUTO_MDIX;
12565 + phy_data &= ~IGP01E1000_PSCR_FORCE_MDI_MDIX;
12567 + ret_val = phy->ops.write_reg(hw, IGP01E1000_PHY_PORT_CTRL, phy_data);
12571 + DEBUGOUT1("IGP PSCR: %X\n", phy_data);
12575 + if (phy->autoneg_wait_to_complete) {
12576 + DEBUGOUT("Waiting for forced speed/duplex link on IGP phy.\n");
12578 + ret_val = e1000_phy_has_link_generic(hw,
12586 + DEBUGOUT("Link taking longer than expected.\n");
12588 + /* Try once more */
12589 + ret_val = e1000_phy_has_link_generic(hw,
12602 + * e1000_phy_force_speed_duplex_m88 - Force speed/duplex for m88 PHY
12603 + * @hw: pointer to the HW structure
12605 + * Calls the PHY setup function to force speed and duplex. Clears the
12606 + * auto-crossover to force MDI manually. Resets the PHY to commit the
12607 + * changes. If time expires while waiting for link up, we reset the DSP.
12608 + * After reset, TX_CLK and CRS on Tx must be set. Return successful upon
12609 + * successful completion, else return corresponding error code.
12611 +s32 e1000_phy_force_speed_duplex_m88(struct e1000_hw *hw)
12613 + struct e1000_phy_info *phy = &hw->phy;
12618 + DEBUGFUNC("e1000_phy_force_speed_duplex_m88");
12621 + * Clear Auto-Crossover to force MDI manually. M88E1000 requires MDI
12622 + * forced whenever speed and duplex are forced.
12624 + ret_val = phy->ops.read_reg(hw, M88E1000_PHY_SPEC_CTRL, &phy_data);
12628 + phy_data &= ~M88E1000_PSCR_AUTO_X_MODE;
12629 + ret_val = phy->ops.write_reg(hw, M88E1000_PHY_SPEC_CTRL, phy_data);
12633 + DEBUGOUT1("M88E1000 PSCR: %X\n", phy_data);
12635 + ret_val = phy->ops.read_reg(hw, PHY_CONTROL, &phy_data);
12639 + e1000_phy_force_speed_duplex_setup(hw, &phy_data);
12641 + ret_val = phy->ops.write_reg(hw, PHY_CONTROL, phy_data);
12645 + /* Reset the phy to commit changes. */
12646 + ret_val = hw->phy.ops.commit(hw);
12650 + if (phy->autoneg_wait_to_complete) {
12651 + DEBUGOUT("Waiting for forced speed/duplex link on M88 phy.\n");
12653 + ret_val = e1000_phy_has_link_generic(hw, PHY_FORCE_LIMIT,
12660 + * We didn't get link.
12661 + * Reset the DSP and cross our fingers.
12663 + ret_val = phy->ops.write_reg(hw,
12664 + M88E1000_PHY_PAGE_SELECT,
12668 + ret_val = e1000_phy_reset_dsp_generic(hw);
12673 + /* Try once more */
12674 + ret_val = e1000_phy_has_link_generic(hw, PHY_FORCE_LIMIT,
12680 + ret_val = phy->ops.read_reg(hw, M88E1000_EXT_PHY_SPEC_CTRL, &phy_data);
12685 + * Resetting the phy means we need to re-force TX_CLK in the
12686 + * Extended PHY Specific Control Register to 25MHz clock from
12687 + * the reset value of 2.5MHz.
12689 + phy_data |= M88E1000_EPSCR_TX_CLK_25;
12690 + ret_val = phy->ops.write_reg(hw, M88E1000_EXT_PHY_SPEC_CTRL, phy_data);
12695 + * In addition, we must re-enable CRS on Tx for both half and full
12698 + ret_val = phy->ops.read_reg(hw, M88E1000_PHY_SPEC_CTRL, &phy_data);
12702 + phy_data |= M88E1000_PSCR_ASSERT_CRS_ON_TX;
12703 + ret_val = phy->ops.write_reg(hw, M88E1000_PHY_SPEC_CTRL, phy_data);
12710 + * e1000_phy_force_speed_duplex_setup - Configure forced PHY speed/duplex
12711 + * @hw: pointer to the HW structure
12712 + * @phy_ctrl: pointer to current value of PHY_CONTROL
12714 + * Forces speed and duplex on the PHY by doing the following: disable flow
12715 + * control, force speed/duplex on the MAC, disable auto speed detection,
12716 + * disable auto-negotiation, configure duplex, configure speed, configure
12717 + * the collision distance, write configuration to CTRL register. The
12718 + * caller must write to the PHY_CONTROL register for these settings to
12721 +void e1000_phy_force_speed_duplex_setup(struct e1000_hw *hw, u16 *phy_ctrl)
12723 + struct e1000_mac_info *mac = &hw->mac;
12726 + DEBUGFUNC("e1000_phy_force_speed_duplex_setup");
12728 + /* Turn off flow control when forcing speed/duplex */
12729 + hw->fc.type = e1000_fc_none;
12731 + /* Force speed/duplex on the mac */
12732 + ctrl = E1000_READ_REG(hw, E1000_CTRL);
12733 + ctrl |= (E1000_CTRL_FRCSPD | E1000_CTRL_FRCDPX);
12734 + ctrl &= ~E1000_CTRL_SPD_SEL;
12736 + /* Disable Auto Speed Detection */
12737 + ctrl &= ~E1000_CTRL_ASDE;
12739 + /* Disable autoneg on the phy */
12740 + *phy_ctrl &= ~MII_CR_AUTO_NEG_EN;
12742 + /* Forcing Full or Half Duplex? */
12743 + if (mac->forced_speed_duplex & E1000_ALL_HALF_DUPLEX) {
12744 + ctrl &= ~E1000_CTRL_FD;
12745 + *phy_ctrl &= ~MII_CR_FULL_DUPLEX;
12746 + DEBUGOUT("Half Duplex\n");
12748 + ctrl |= E1000_CTRL_FD;
12749 + *phy_ctrl |= MII_CR_FULL_DUPLEX;
12750 + DEBUGOUT("Full Duplex\n");
12753 + /* Forcing 10mb or 100mb? */
12754 + if (mac->forced_speed_duplex & E1000_ALL_100_SPEED) {
12755 + ctrl |= E1000_CTRL_SPD_100;
12756 + *phy_ctrl |= MII_CR_SPEED_100;
12757 + *phy_ctrl &= ~(MII_CR_SPEED_1000 | MII_CR_SPEED_10);
12758 + DEBUGOUT("Forcing 100mb\n");
12760 + ctrl &= ~(E1000_CTRL_SPD_1000 | E1000_CTRL_SPD_100);
12761 + *phy_ctrl |= MII_CR_SPEED_10;
12762 + *phy_ctrl &= ~(MII_CR_SPEED_1000 | MII_CR_SPEED_100);
12763 + DEBUGOUT("Forcing 10mb\n");
12766 + e1000_config_collision_dist_generic(hw);
12768 + E1000_WRITE_REG(hw, E1000_CTRL, ctrl);
12772 + * e1000_set_d3_lplu_state_generic - Sets low power link up state for D3
12773 + * @hw: pointer to the HW structure
12774 + * @active: boolean used to enable/disable lplu
12776 + * Success returns 0, Failure returns 1
12778 + * The low power link up (lplu) state is set to the power management level D3
12779 + * and SmartSpeed is disabled when active is true, else clear lplu for D3
12780 + * and enable Smartspeed. LPLU and Smartspeed are mutually exclusive. LPLU
12781 + * is used during Dx states where the power conservation is most important.
12782 + * During driver activity, SmartSpeed should be enabled so performance is
12785 +s32 e1000_set_d3_lplu_state_generic(struct e1000_hw *hw, bool active)
12787 + struct e1000_phy_info *phy = &hw->phy;
12788 + s32 ret_val = E1000_SUCCESS;
12791 + DEBUGFUNC("e1000_set_d3_lplu_state_generic");
12793 + if (!(hw->phy.ops.read_reg))
12796 + ret_val = phy->ops.read_reg(hw, IGP02E1000_PHY_POWER_MGMT, &data);
12801 + data &= ~IGP02E1000_PM_D3_LPLU;
12802 + ret_val = phy->ops.write_reg(hw, IGP02E1000_PHY_POWER_MGMT,
12807 + * LPLU and SmartSpeed are mutually exclusive. LPLU is used
12808 + * during Dx states where the power conservation is most
12809 + * important. During driver activity we should enable
12810 + * SmartSpeed, so performance is maintained.
12812 + if (phy->smart_speed == e1000_smart_speed_on) {
12813 + ret_val = phy->ops.read_reg(hw,
12814 + IGP01E1000_PHY_PORT_CONFIG,
12819 + data |= IGP01E1000_PSCFR_SMART_SPEED;
12820 + ret_val = phy->ops.write_reg(hw,
12821 + IGP01E1000_PHY_PORT_CONFIG,
12825 + } else if (phy->smart_speed == e1000_smart_speed_off) {
12826 + ret_val = phy->ops.read_reg(hw,
12827 + IGP01E1000_PHY_PORT_CONFIG,
12832 + data &= ~IGP01E1000_PSCFR_SMART_SPEED;
12833 + ret_val = phy->ops.write_reg(hw,
12834 + IGP01E1000_PHY_PORT_CONFIG,
12839 + } else if ((phy->autoneg_advertised == E1000_ALL_SPEED_DUPLEX) ||
12840 + (phy->autoneg_advertised == E1000_ALL_NOT_GIG) ||
12841 + (phy->autoneg_advertised == E1000_ALL_10_SPEED)) {
12842 + data |= IGP02E1000_PM_D3_LPLU;
12843 + ret_val = phy->ops.write_reg(hw, IGP02E1000_PHY_POWER_MGMT,
12848 + /* When LPLU is enabled, we should disable SmartSpeed */
12849 + ret_val = phy->ops.read_reg(hw, IGP01E1000_PHY_PORT_CONFIG,
12854 + data &= ~IGP01E1000_PSCFR_SMART_SPEED;
12855 + ret_val = phy->ops.write_reg(hw, IGP01E1000_PHY_PORT_CONFIG,
12864 + * e1000_check_downshift_generic - Checks whether a downshift in speed occurred
12865 + * @hw: pointer to the HW structure
12867 + * Success returns 0, Failure returns 1
12869 + * A downshift is detected by querying the PHY link health.
12871 +s32 e1000_check_downshift_generic(struct e1000_hw *hw)
12873 + struct e1000_phy_info *phy = &hw->phy;
12875 + u16 phy_data, offset, mask;
12877 + DEBUGFUNC("e1000_check_downshift_generic");
12879 + switch (phy->type) {
12880 + case e1000_phy_m88:
12881 + case e1000_phy_gg82563:
12882 + offset = M88E1000_PHY_SPEC_STATUS;
12883 + mask = M88E1000_PSSR_DOWNSHIFT;
12885 + case e1000_phy_igp_2:
12886 + case e1000_phy_igp:
12887 + case e1000_phy_igp_3:
12888 + offset = IGP01E1000_PHY_LINK_HEALTH;
12889 + mask = IGP01E1000_PLHR_SS_DOWNGRADE;
12892 + /* speed downshift not supported */
12893 + phy->speed_downgraded = false;
12894 + ret_val = E1000_SUCCESS;
12898 + ret_val = phy->ops.read_reg(hw, offset, &phy_data);
12901 + phy->speed_downgraded = (phy_data & mask) ? true : false;
12908 + * e1000_check_polarity_m88 - Checks the polarity.
12909 + * @hw: pointer to the HW structure
12911 + * Success returns 0, Failure returns -E1000_ERR_PHY (-2)
12913 + * Polarity is determined based on the PHY specific status register.
12915 +s32 e1000_check_polarity_m88(struct e1000_hw *hw)
12917 + struct e1000_phy_info *phy = &hw->phy;
12921 + DEBUGFUNC("e1000_check_polarity_m88");
12923 + ret_val = phy->ops.read_reg(hw, M88E1000_PHY_SPEC_STATUS, &data);
12926 + phy->cable_polarity = (data & M88E1000_PSSR_REV_POLARITY)
12927 + ? e1000_rev_polarity_reversed
12928 + : e1000_rev_polarity_normal;
12934 + * e1000_check_polarity_igp - Checks the polarity.
12935 + * @hw: pointer to the HW structure
12937 + * Success returns 0, Failure returns -E1000_ERR_PHY (-2)
12939 + * Polarity is determined based on the PHY port status register, and the
12940 + * current speed (since there is no polarity at 100Mbps).
12942 +s32 e1000_check_polarity_igp(struct e1000_hw *hw)
12944 + struct e1000_phy_info *phy = &hw->phy;
12946 + u16 data, offset, mask;
12948 + DEBUGFUNC("e1000_check_polarity_igp");
12951 + * Polarity is determined based on the speed of
12952 + * our connection.
12954 + ret_val = phy->ops.read_reg(hw, IGP01E1000_PHY_PORT_STATUS, &data);
12958 + if ((data & IGP01E1000_PSSR_SPEED_MASK) ==
12959 + IGP01E1000_PSSR_SPEED_1000MBPS) {
12960 + offset = IGP01E1000_PHY_PCS_INIT_REG;
12961 + mask = IGP01E1000_PHY_POLARITY_MASK;
12964 + * This really only applies to 10Mbps since
12965 + * there is no polarity for 100Mbps (always 0).
12967 + offset = IGP01E1000_PHY_PORT_STATUS;
12968 + mask = IGP01E1000_PSSR_POLARITY_REVERSED;
12971 + ret_val = phy->ops.read_reg(hw, offset, &data);
12974 + phy->cable_polarity = (data & mask)
12975 + ? e1000_rev_polarity_reversed
12976 + : e1000_rev_polarity_normal;
12983 + * e1000_wait_autoneg_generic - Wait for auto-neg completion
12984 + * @hw: pointer to the HW structure
12986 + * Waits for auto-negotiation to complete or for the auto-negotiation time
12987 + * limit to expire, which ever happens first.
12989 +s32 e1000_wait_autoneg_generic(struct e1000_hw *hw)
12991 + s32 ret_val = E1000_SUCCESS;
12992 + u16 i, phy_status;
12994 + DEBUGFUNC("e1000_wait_autoneg_generic");
12996 + if (!(hw->phy.ops.read_reg))
12997 + return E1000_SUCCESS;
12999 + /* Break after autoneg completes or PHY_AUTO_NEG_LIMIT expires. */
13000 + for (i = PHY_AUTO_NEG_LIMIT; i > 0; i--) {
13001 + ret_val = hw->phy.ops.read_reg(hw, PHY_STATUS, &phy_status);
13004 + ret_val = hw->phy.ops.read_reg(hw, PHY_STATUS, &phy_status);
13007 + if (phy_status & MII_SR_AUTONEG_COMPLETE)
13013 + * PHY_AUTO_NEG_TIME expiration doesn't guarantee auto-negotiation
13020 + * e1000_phy_has_link_generic - Polls PHY for link
13021 + * @hw: pointer to the HW structure
13022 + * @iterations: number of times to poll for link
13023 + * @usec_interval: delay between polling attempts
13024 + * @success: pointer to whether polling was successful or not
13026 + * Polls the PHY status register for link, 'iterations' number of times.
13028 +s32 e1000_phy_has_link_generic(struct e1000_hw *hw, u32 iterations,
13029 + u32 usec_interval, bool *success)
13031 + s32 ret_val = E1000_SUCCESS;
13032 + u16 i, phy_status;
13034 + DEBUGFUNC("e1000_phy_has_link_generic");
13036 + if (!(hw->phy.ops.read_reg))
13037 + return E1000_SUCCESS;
13039 + for (i = 0; i < iterations; i++) {
13041 + * Some PHYs require the PHY_STATUS register to be read
13042 + * twice due to the link bit being sticky. No harm doing
13043 + * it across the board.
13045 + ret_val = hw->phy.ops.read_reg(hw, PHY_STATUS, &phy_status);
13048 + ret_val = hw->phy.ops.read_reg(hw, PHY_STATUS, &phy_status);
13051 + if (phy_status & MII_SR_LINK_STATUS)
13053 + if (usec_interval >= 1000)
13054 + msec_delay_irq(usec_interval/1000);
13056 + usec_delay(usec_interval);
13059 + *success = (i < iterations) ? true : false;
13065 + * e1000_get_cable_length_m88 - Determine cable length for m88 PHY
13066 + * @hw: pointer to the HW structure
13068 + * Reads the PHY specific status register to retrieve the cable length
13069 + * information. The cable length is determined by averaging the minimum and
13070 + * maximum values to get the "average" cable length. The m88 PHY has four
13071 + * possible cable length values, which are:
13072 + * Register Value Cable Length
13074 + * 1 50 - 80 meters
13075 + * 2 80 - 110 meters
13076 + * 3 110 - 140 meters
13079 +s32 e1000_get_cable_length_m88(struct e1000_hw *hw)
13081 + struct e1000_phy_info *phy = &hw->phy;
13083 + u16 phy_data, index;
13085 + DEBUGFUNC("e1000_get_cable_length_m88");
13087 + ret_val = phy->ops.read_reg(hw, M88E1000_PHY_SPEC_STATUS, &phy_data);
13091 + index = (phy_data & M88E1000_PSSR_CABLE_LENGTH) >>
13092 + M88E1000_PSSR_CABLE_LENGTH_SHIFT;
13093 + phy->min_cable_length = e1000_m88_cable_length_table[index];
13094 + phy->max_cable_length = e1000_m88_cable_length_table[index+1];
13096 + phy->cable_length = (phy->min_cable_length + phy->max_cable_length) / 2;
13103 + * e1000_get_cable_length_igp_2 - Determine cable length for igp2 PHY
13104 + * @hw: pointer to the HW structure
13106 + * The automatic gain control (agc) normalizes the amplitude of the
13107 + * received signal, adjusting for the attenuation produced by the
13108 + * cable. By reading the AGC registers, which represent the
13109 + * combination of coarse and fine gain value, the value can be put
13110 + * into a lookup table to obtain the approximate cable length
13111 + * for each channel.
13113 +s32 e1000_get_cable_length_igp_2(struct e1000_hw *hw)
13115 + struct e1000_phy_info *phy = &hw->phy;
13116 + s32 ret_val = E1000_SUCCESS;
13117 + u16 phy_data, i, agc_value = 0;
13118 + u16 cur_agc_index, max_agc_index = 0;
13119 + u16 min_agc_index = IGP02E1000_CABLE_LENGTH_TABLE_SIZE - 1;
13120 + u16 agc_reg_array[IGP02E1000_PHY_CHANNEL_NUM] =
13121 + {IGP02E1000_PHY_AGC_A,
13122 + IGP02E1000_PHY_AGC_B,
13123 + IGP02E1000_PHY_AGC_C,
13124 + IGP02E1000_PHY_AGC_D};
13126 + DEBUGFUNC("e1000_get_cable_length_igp_2");
13128 + /* Read the AGC registers for all channels */
13129 + for (i = 0; i < IGP02E1000_PHY_CHANNEL_NUM; i++) {
13130 + ret_val = phy->ops.read_reg(hw, agc_reg_array[i], &phy_data);
13135 + * Getting bits 15:9, which represent the combination of
13136 + * coarse and fine gain values. The result is a number
13137 + * that can be put into the lookup table to obtain the
13138 + * approximate cable length.
13140 + cur_agc_index = (phy_data >> IGP02E1000_AGC_LENGTH_SHIFT) &
13141 + IGP02E1000_AGC_LENGTH_MASK;
13143 + /* Array index bound check. */
13144 + if ((cur_agc_index >= IGP02E1000_CABLE_LENGTH_TABLE_SIZE) ||
13145 + (cur_agc_index == 0)) {
13146 + ret_val = -E1000_ERR_PHY;
13150 + /* Remove min & max AGC values from calculation. */
13151 + if (e1000_igp_2_cable_length_table[min_agc_index] >
13152 + e1000_igp_2_cable_length_table[cur_agc_index])
13153 + min_agc_index = cur_agc_index;
13154 + if (e1000_igp_2_cable_length_table[max_agc_index] <
13155 + e1000_igp_2_cable_length_table[cur_agc_index])
13156 + max_agc_index = cur_agc_index;
13158 + agc_value += e1000_igp_2_cable_length_table[cur_agc_index];
13161 + agc_value -= (e1000_igp_2_cable_length_table[min_agc_index] +
13162 + e1000_igp_2_cable_length_table[max_agc_index]);
13163 + agc_value /= (IGP02E1000_PHY_CHANNEL_NUM - 2);
13165 + /* Calculate cable length with the error range of +/- 10 meters. */
13166 + phy->min_cable_length = ((agc_value - IGP02E1000_AGC_RANGE) > 0) ?
13167 + (agc_value - IGP02E1000_AGC_RANGE) : 0;
13168 + phy->max_cable_length = agc_value + IGP02E1000_AGC_RANGE;
13170 + phy->cable_length = (phy->min_cable_length + phy->max_cable_length) / 2;
13177 + * e1000_get_phy_info_m88 - Retrieve PHY information
13178 + * @hw: pointer to the HW structure
13180 + * Valid for only copper links. Read the PHY status register (sticky read)
13181 + * to verify that link is up. Read the PHY special control register to
13182 + * determine the polarity and 10base-T extended distance. Read the PHY
13183 + * special status register to determine MDI/MDIx and current speed. If
13184 + * speed is 1000, then determine cable length, local and remote receiver.
13186 +s32 e1000_get_phy_info_m88(struct e1000_hw *hw)
13188 + struct e1000_phy_info *phy = &hw->phy;
13193 + DEBUGFUNC("e1000_get_phy_info_m88");
13195 + if (hw->phy.media_type != e1000_media_type_copper) {
13196 + DEBUGOUT("Phy info is only valid for copper media\n");
13197 + ret_val = -E1000_ERR_CONFIG;
13201 + ret_val = e1000_phy_has_link_generic(hw, 1, 0, &link);
13206 + DEBUGOUT("Phy info is only valid if link is up\n");
13207 + ret_val = -E1000_ERR_CONFIG;
13211 + ret_val = phy->ops.read_reg(hw, M88E1000_PHY_SPEC_CTRL, &phy_data);
13215 + phy->polarity_correction = (phy_data & M88E1000_PSCR_POLARITY_REVERSAL)
13218 + ret_val = e1000_check_polarity_m88(hw);
13222 + ret_val = phy->ops.read_reg(hw, M88E1000_PHY_SPEC_STATUS, &phy_data);
13226 + phy->is_mdix = (phy_data & M88E1000_PSSR_MDIX) ? true : false;
13228 + if ((phy_data & M88E1000_PSSR_SPEED) == M88E1000_PSSR_1000MBS) {
13229 + ret_val = hw->phy.ops.get_cable_length(hw);
13233 + ret_val = phy->ops.read_reg(hw, PHY_1000T_STATUS, &phy_data);
13237 + phy->local_rx = (phy_data & SR_1000T_LOCAL_RX_STATUS)
13238 + ? e1000_1000t_rx_status_ok
13239 + : e1000_1000t_rx_status_not_ok;
13241 + phy->remote_rx = (phy_data & SR_1000T_REMOTE_RX_STATUS)
13242 + ? e1000_1000t_rx_status_ok
13243 + : e1000_1000t_rx_status_not_ok;
13245 + /* Set values to "undefined" */
13246 + phy->cable_length = E1000_CABLE_LENGTH_UNDEFINED;
13247 + phy->local_rx = e1000_1000t_rx_status_undefined;
13248 + phy->remote_rx = e1000_1000t_rx_status_undefined;
13256 + * e1000_get_phy_info_igp - Retrieve igp PHY information
13257 + * @hw: pointer to the HW structure
13259 + * Read PHY status to determine if link is up. If link is up, then
13260 + * set/determine 10base-T extended distance and polarity correction. Read
13261 + * PHY port status to determine MDI/MDIx and speed. Based on the speed,
13262 + * determine on the cable length, local and remote receiver.
13264 +s32 e1000_get_phy_info_igp(struct e1000_hw *hw)
13266 + struct e1000_phy_info *phy = &hw->phy;
13271 + DEBUGFUNC("e1000_get_phy_info_igp");
13273 + ret_val = e1000_phy_has_link_generic(hw, 1, 0, &link);
13278 + DEBUGOUT("Phy info is only valid if link is up\n");
13279 + ret_val = -E1000_ERR_CONFIG;
13283 + phy->polarity_correction = true;
13285 + ret_val = e1000_check_polarity_igp(hw);
13289 + ret_val = phy->ops.read_reg(hw, IGP01E1000_PHY_PORT_STATUS, &data);
13293 + phy->is_mdix = (data & IGP01E1000_PSSR_MDIX) ? true : false;
13295 + if ((data & IGP01E1000_PSSR_SPEED_MASK) ==
13296 + IGP01E1000_PSSR_SPEED_1000MBPS) {
13297 + ret_val = hw->phy.ops.get_cable_length(hw);
13301 + ret_val = phy->ops.read_reg(hw, PHY_1000T_STATUS, &data);
13305 + phy->local_rx = (data & SR_1000T_LOCAL_RX_STATUS)
13306 + ? e1000_1000t_rx_status_ok
13307 + : e1000_1000t_rx_status_not_ok;
13309 + phy->remote_rx = (data & SR_1000T_REMOTE_RX_STATUS)
13310 + ? e1000_1000t_rx_status_ok
13311 + : e1000_1000t_rx_status_not_ok;
13313 + phy->cable_length = E1000_CABLE_LENGTH_UNDEFINED;
13314 + phy->local_rx = e1000_1000t_rx_status_undefined;
13315 + phy->remote_rx = e1000_1000t_rx_status_undefined;
13323 + * e1000_phy_sw_reset_generic - PHY software reset
13324 + * @hw: pointer to the HW structure
13326 + * Does a software reset of the PHY by reading the PHY control register and
13327 + * setting/write the control register reset bit to the PHY.
13329 +s32 e1000_phy_sw_reset_generic(struct e1000_hw *hw)
13331 + s32 ret_val = E1000_SUCCESS;
13334 + DEBUGFUNC("e1000_phy_sw_reset_generic");
13336 + if (!(hw->phy.ops.read_reg))
13339 + ret_val = hw->phy.ops.read_reg(hw, PHY_CONTROL, &phy_ctrl);
13343 + phy_ctrl |= MII_CR_RESET;
13344 + ret_val = hw->phy.ops.write_reg(hw, PHY_CONTROL, phy_ctrl);
13355 + * e1000_phy_hw_reset_generic - PHY hardware reset
13356 + * @hw: pointer to the HW structure
13358 + * Verify the reset block is not blocking us from resetting. Acquire
13359 + * semaphore (if necessary) and read/set/write the device control reset
13360 + * bit in the PHY. Wait the appropriate delay time for the device to
13361 + * reset and release the semaphore (if necessary).
13363 +s32 e1000_phy_hw_reset_generic(struct e1000_hw *hw)
13365 + struct e1000_phy_info *phy = &hw->phy;
13366 + s32 ret_val = E1000_SUCCESS;
13369 + DEBUGFUNC("e1000_phy_hw_reset_generic");
13371 + ret_val = phy->ops.check_reset_block(hw);
13373 + ret_val = E1000_SUCCESS;
13377 + ret_val = phy->ops.acquire(hw);
13381 + ctrl = E1000_READ_REG(hw, E1000_CTRL);
13382 + E1000_WRITE_REG(hw, E1000_CTRL, ctrl | E1000_CTRL_PHY_RST);
13383 + E1000_WRITE_FLUSH(hw);
13385 + usec_delay(phy->reset_delay_us);
13387 + E1000_WRITE_REG(hw, E1000_CTRL, ctrl);
13388 + E1000_WRITE_FLUSH(hw);
13392 + phy->ops.release(hw);
13394 + ret_val = phy->ops.get_cfg_done(hw);
13401 + * e1000_get_cfg_done_generic - Generic configuration done
13402 + * @hw: pointer to the HW structure
13404 + * Generic function to wait 10 milli-seconds for configuration to complete
13405 + * and return success.
13407 +s32 e1000_get_cfg_done_generic(struct e1000_hw *hw)
13409 + DEBUGFUNC("e1000_get_cfg_done_generic");
13411 + msec_delay_irq(10);
13413 + return E1000_SUCCESS;
13417 + * e1000_phy_init_script_igp3 - Inits the IGP3 PHY
13418 + * @hw: pointer to the HW structure
13420 + * Initializes a Intel Gigabit PHY3 when an EEPROM is not present.
13422 +s32 e1000_phy_init_script_igp3(struct e1000_hw *hw)
13424 + DEBUGOUT("Running IGP 3 PHY init script\n");
13426 + /* PHY init IGP 3 */
13427 + /* Enable rise/fall, 10-mode work in class-A */
13428 + hw->phy.ops.write_reg(hw, 0x2F5B, 0x9018);
13429 + /* Remove all caps from Replica path filter */
13430 + hw->phy.ops.write_reg(hw, 0x2F52, 0x0000);
13431 + /* Bias trimming for ADC, AFE and Driver (Default) */
13432 + hw->phy.ops.write_reg(hw, 0x2FB1, 0x8B24);
13433 + /* Increase Hybrid poly bias */
13434 + hw->phy.ops.write_reg(hw, 0x2FB2, 0xF8F0);
13435 + /* Add 4% to Tx amplitude in Gig mode */
13436 + hw->phy.ops.write_reg(hw, 0x2010, 0x10B0);
13437 + /* Disable trimming (TTT) */
13438 + hw->phy.ops.write_reg(hw, 0x2011, 0x0000);
13439 + /* Poly DC correction to 94.6% + 2% for all channels */
13440 + hw->phy.ops.write_reg(hw, 0x20DD, 0x249A);
13441 + /* ABS DC correction to 95.9% */
13442 + hw->phy.ops.write_reg(hw, 0x20DE, 0x00D3);
13443 + /* BG temp curve trim */
13444 + hw->phy.ops.write_reg(hw, 0x28B4, 0x04CE);
13445 + /* Increasing ADC OPAMP stage 1 currents to max */
13446 + hw->phy.ops.write_reg(hw, 0x2F70, 0x29E4);
13447 + /* Force 1000 ( required for enabling PHY regs configuration) */
13448 + hw->phy.ops.write_reg(hw, 0x0000, 0x0140);
13449 + /* Set upd_freq to 6 */
13450 + hw->phy.ops.write_reg(hw, 0x1F30, 0x1606);
13451 + /* Disable NPDFE */
13452 + hw->phy.ops.write_reg(hw, 0x1F31, 0xB814);
13453 + /* Disable adaptive fixed FFE (Default) */
13454 + hw->phy.ops.write_reg(hw, 0x1F35, 0x002A);
13455 + /* Enable FFE hysteresis */
13456 + hw->phy.ops.write_reg(hw, 0x1F3E, 0x0067);
13457 + /* Fixed FFE for short cable lengths */
13458 + hw->phy.ops.write_reg(hw, 0x1F54, 0x0065);
13459 + /* Fixed FFE for medium cable lengths */
13460 + hw->phy.ops.write_reg(hw, 0x1F55, 0x002A);
13461 + /* Fixed FFE for long cable lengths */
13462 + hw->phy.ops.write_reg(hw, 0x1F56, 0x002A);
13463 + /* Enable Adaptive Clip Threshold */
13464 + hw->phy.ops.write_reg(hw, 0x1F72, 0x3FB0);
13465 + /* AHT reset limit to 1 */
13466 + hw->phy.ops.write_reg(hw, 0x1F76, 0xC0FF);
13467 + /* Set AHT master delay to 127 msec */
13468 + hw->phy.ops.write_reg(hw, 0x1F77, 0x1DEC);
13469 + /* Set scan bits for AHT */
13470 + hw->phy.ops.write_reg(hw, 0x1F78, 0xF9EF);
13471 + /* Set AHT Preset bits */
13472 + hw->phy.ops.write_reg(hw, 0x1F79, 0x0210);
13473 + /* Change integ_factor of channel A to 3 */
13474 + hw->phy.ops.write_reg(hw, 0x1895, 0x0003);
13475 + /* Change prop_factor of channels BCD to 8 */
13476 + hw->phy.ops.write_reg(hw, 0x1796, 0x0008);
13477 + /* Change cg_icount + enable integbp for channels BCD */
13478 + hw->phy.ops.write_reg(hw, 0x1798, 0xD008);
13480 + * Change cg_icount + enable integbp + change prop_factor_master
13481 + * to 8 for channel A
13483 + hw->phy.ops.write_reg(hw, 0x1898, 0xD918);
13484 + /* Disable AHT in Slave mode on channel A */
13485 + hw->phy.ops.write_reg(hw, 0x187A, 0x0800);
13487 + * Enable LPLU and disable AN to 1000 in non-D0a states,
13490 + hw->phy.ops.write_reg(hw, 0x0019, 0x008D);
13491 + /* Enable restart AN on an1000_dis change */
13492 + hw->phy.ops.write_reg(hw, 0x001B, 0x2080);
13493 + /* Enable wh_fifo read clock in 10/100 modes */
13494 + hw->phy.ops.write_reg(hw, 0x0014, 0x0045);
13495 + /* Restart AN, Speed selection is 1000 */
13496 + hw->phy.ops.write_reg(hw, 0x0000, 0x1340);
13498 + return E1000_SUCCESS;
13502 + * e1000_get_phy_type_from_id - Get PHY type from id
13503 + * @phy_id: phy_id read from the phy
13505 + * Returns the phy type from the id.
13507 +enum e1000_phy_type e1000_get_phy_type_from_id(u32 phy_id)
13509 + enum e1000_phy_type phy_type = e1000_phy_unknown;
13511 + switch (phy_id) {
13512 + case M88E1000_I_PHY_ID:
13513 + case M88E1000_E_PHY_ID:
13514 + case M88E1111_I_PHY_ID:
13515 + case M88E1011_I_PHY_ID:
13516 + phy_type = e1000_phy_m88;
13518 + case IGP01E1000_I_PHY_ID: /* IGP 1 & 2 share this */
13519 + phy_type = e1000_phy_igp_2;
13521 + case GG82563_E_PHY_ID:
13522 + phy_type = e1000_phy_gg82563;
13524 + case IGP03E1000_E_PHY_ID:
13525 + phy_type = e1000_phy_igp_3;
13527 + case IFE_E_PHY_ID:
13528 + case IFE_PLUS_E_PHY_ID:
13529 + case IFE_C_E_PHY_ID:
13530 + phy_type = e1000_phy_ife;
13533 + phy_type = e1000_phy_unknown;
13540 + * e1000_power_up_phy_copper - Restore copper link in case of PHY power down
13541 + * @hw: pointer to the HW structure
13543 + * In the case of a PHY power down to save power, or to turn off link during a
13544 + * driver unload, or wake on lan is not enabled, restore the link to previous
13547 +void e1000_power_up_phy_copper(struct e1000_hw *hw)
13551 + /* The PHY will retain its settings across a power down/up cycle */
13552 + hw->phy.ops.read_reg(hw, PHY_CONTROL, &mii_reg);
13553 + mii_reg &= ~MII_CR_POWER_DOWN;
13554 + hw->phy.ops.write_reg(hw, PHY_CONTROL, mii_reg);
13558 + * e1000_power_down_phy_copper - Restore copper link in case of PHY power down
13559 + * @hw: pointer to the HW structure
13561 + * In the case of a PHY power down to save power, or to turn off link during a
13562 + * driver unload, or wake on lan is not enabled, restore the link to previous
13565 +void e1000_power_down_phy_copper(struct e1000_hw *hw)
13569 + /* The PHY will retain its settings across a power down/up cycle */
13570 + hw->phy.ops.read_reg(hw, PHY_CONTROL, &mii_reg);
13571 + mii_reg |= MII_CR_POWER_DOWN;
13572 + hw->phy.ops.write_reg(hw, PHY_CONTROL, mii_reg);
13575 diff -Nru vanilla/drivers/net/igb/e1000_phy.h linux-i686-2.6.22/drivers/net/igb/e1000_phy.h
13576 --- vanilla/drivers/net/igb/e1000_phy.h 1969-12-31 19:00:00.000000000 -0500
13577 +++ linux-i686-2.6.22/drivers/net/igb/e1000_phy.h 2009-07-16 19:25:22.000000000 -0400
13579 +/*******************************************************************************
13581 + Intel(R) Gigabit Ethernet Linux driver
13582 + Copyright(c) 2007-2008 Intel Corporation.
13584 + This program is free software; you can redistribute it and/or modify it
13585 + under the terms and conditions of the GNU General Public License,
13586 + version 2, as published by the Free Software Foundation.
13588 + This program is distributed in the hope it will be useful, but WITHOUT
13589 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13590 + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13593 + You should have received a copy of the GNU General Public License along with
13594 + this program; if not, write to the Free Software Foundation, Inc.,
13595 + 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
13597 + The full GNU General Public License is included in this distribution in
13598 + the file called "COPYING".
13600 + Contact Information:
13601 + e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
13602 + Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
13604 +*******************************************************************************/
13606 +#ifndef _E1000_PHY_H_
13607 +#define _E1000_PHY_H_
13609 +void e1000_init_phy_ops_generic(struct e1000_hw *hw);
13610 +s32 e1000_check_downshift_generic(struct e1000_hw *hw);
13611 +s32 e1000_check_polarity_m88(struct e1000_hw *hw);
13612 +s32 e1000_check_polarity_igp(struct e1000_hw *hw);
13613 +s32 e1000_check_reset_block_generic(struct e1000_hw *hw);
13614 +s32 e1000_copper_link_autoneg(struct e1000_hw *hw);
13615 +s32 e1000_copper_link_setup_igp(struct e1000_hw *hw);
13616 +s32 e1000_copper_link_setup_m88(struct e1000_hw *hw);
13617 +s32 e1000_phy_force_speed_duplex_igp(struct e1000_hw *hw);
13618 +s32 e1000_phy_force_speed_duplex_m88(struct e1000_hw *hw);
13619 +s32 e1000_get_cable_length_m88(struct e1000_hw *hw);
13620 +s32 e1000_get_cable_length_igp_2(struct e1000_hw *hw);
13621 +s32 e1000_get_cfg_done_generic(struct e1000_hw *hw);
13622 +s32 e1000_get_phy_id(struct e1000_hw *hw);
13623 +s32 e1000_get_phy_info_igp(struct e1000_hw *hw);
13624 +s32 e1000_get_phy_info_m88(struct e1000_hw *hw);
13625 +s32 e1000_phy_sw_reset_generic(struct e1000_hw *hw);
13626 +void e1000_phy_force_speed_duplex_setup(struct e1000_hw *hw, u16 *phy_ctrl);
13627 +s32 e1000_phy_hw_reset_generic(struct e1000_hw *hw);
13628 +s32 e1000_phy_reset_dsp_generic(struct e1000_hw *hw);
13629 +s32 e1000_read_kmrn_reg_generic(struct e1000_hw *hw, u32 offset, u16 *data);
13630 +s32 e1000_read_phy_reg_igp(struct e1000_hw *hw, u32 offset, u16 *data);
13631 +s32 e1000_read_phy_reg_m88(struct e1000_hw *hw, u32 offset, u16 *data);
13632 +s32 e1000_set_d3_lplu_state_generic(struct e1000_hw *hw, bool active);
13633 +s32 e1000_setup_copper_link_generic(struct e1000_hw *hw);
13634 +s32 e1000_wait_autoneg_generic(struct e1000_hw *hw);
13635 +s32 e1000_write_kmrn_reg_generic(struct e1000_hw *hw, u32 offset, u16 data);
13636 +s32 e1000_write_phy_reg_igp(struct e1000_hw *hw, u32 offset, u16 data);
13637 +s32 e1000_write_phy_reg_m88(struct e1000_hw *hw, u32 offset, u16 data);
13638 +s32 e1000_phy_reset_dsp(struct e1000_hw *hw);
13639 +s32 e1000_phy_has_link_generic(struct e1000_hw *hw, u32 iterations,
13640 + u32 usec_interval, bool *success);
13641 +s32 e1000_phy_init_script_igp3(struct e1000_hw *hw);
13642 +enum e1000_phy_type e1000_get_phy_type_from_id(u32 phy_id);
13643 +void e1000_power_up_phy_copper(struct e1000_hw *hw);
13644 +void e1000_power_down_phy_copper(struct e1000_hw *hw);
13645 +s32 e1000_read_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 *data);
13646 +s32 e1000_write_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 data);
13648 +#define E1000_MAX_PHY_ADDR 4
13650 +/* IGP01E1000 Specific Registers */
13651 +#define IGP01E1000_PHY_PORT_CONFIG 0x10 /* Port Config */
13652 +#define IGP01E1000_PHY_PORT_STATUS 0x11 /* Status */
13653 +#define IGP01E1000_PHY_PORT_CTRL 0x12 /* Control */
13654 +#define IGP01E1000_PHY_LINK_HEALTH 0x13 /* PHY Link Health */
13655 +#define IGP01E1000_GMII_FIFO 0x14 /* GMII FIFO */
13656 +#define IGP01E1000_PHY_CHANNEL_QUALITY 0x15 /* PHY Channel Quality */
13657 +#define IGP02E1000_PHY_POWER_MGMT 0x19 /* Power Management */
13658 +#define IGP01E1000_PHY_PAGE_SELECT 0x1F /* Page Select */
13659 +#define BM_PHY_PAGE_SELECT 22 /* Page Select for BM */
13660 +#define IGP_PAGE_SHIFT 5
13661 +#define PHY_REG_MASK 0x1F
13663 +#define IGP01E1000_PHY_PCS_INIT_REG 0x00B4
13664 +#define IGP01E1000_PHY_POLARITY_MASK 0x0078
13666 +#define IGP01E1000_PSCR_AUTO_MDIX 0x1000
13667 +#define IGP01E1000_PSCR_FORCE_MDI_MDIX 0x2000 /* 0=MDI, 1=MDIX */
13669 +#define IGP01E1000_PSCFR_SMART_SPEED 0x0080
13671 +/* Enable flexible speed on link-up */
13672 +#define IGP01E1000_GMII_FLEX_SPD 0x0010
13673 +#define IGP01E1000_GMII_SPD 0x0020 /* Enable SPD */
13675 +#define IGP02E1000_PM_SPD 0x0001 /* Smart Power Down */
13676 +#define IGP02E1000_PM_D0_LPLU 0x0002 /* For D0a states */
13677 +#define IGP02E1000_PM_D3_LPLU 0x0004 /* For all other states */
13679 +#define IGP01E1000_PLHR_SS_DOWNGRADE 0x8000
13681 +#define IGP01E1000_PSSR_POLARITY_REVERSED 0x0002
13682 +#define IGP01E1000_PSSR_MDIX 0x0008
13683 +#define IGP01E1000_PSSR_SPEED_MASK 0xC000
13684 +#define IGP01E1000_PSSR_SPEED_1000MBPS 0xC000
13686 +#define IGP02E1000_PHY_CHANNEL_NUM 4
13687 +#define IGP02E1000_PHY_AGC_A 0x11B1
13688 +#define IGP02E1000_PHY_AGC_B 0x12B1
13689 +#define IGP02E1000_PHY_AGC_C 0x14B1
13690 +#define IGP02E1000_PHY_AGC_D 0x18B1
13692 +#define IGP02E1000_AGC_LENGTH_SHIFT 9 /* Course - 15:13, Fine - 12:9 */
13693 +#define IGP02E1000_AGC_LENGTH_MASK 0x7F
13694 +#define IGP02E1000_AGC_RANGE 15
13696 +#define IGP03E1000_PHY_MISC_CTRL 0x1B
13697 +#define IGP03E1000_PHY_MISC_DUPLEX_MANUAL_SET 0x1000 /* Manually Set Duplex */
13699 +#define E1000_CABLE_LENGTH_UNDEFINED 0xFF
13701 +#define E1000_KMRNCTRLSTA_OFFSET 0x001F0000
13702 +#define E1000_KMRNCTRLSTA_OFFSET_SHIFT 16
13703 +#define E1000_KMRNCTRLSTA_REN 0x00200000
13704 +#define E1000_KMRNCTRLSTA_DIAG_OFFSET 0x3 /* Kumeran Diagnostic */
13705 +#define E1000_KMRNCTRLSTA_DIAG_NELPBK 0x1000 /* Nearend Loopback mode */
13707 +#define IFE_PHY_EXTENDED_STATUS_CONTROL 0x10
13708 +#define IFE_PHY_SPECIAL_CONTROL 0x11 /* 100BaseTx PHY Special Control */
13709 +#define IFE_PHY_SPECIAL_CONTROL_LED 0x1B /* PHY Special and LED Control */
13710 +#define IFE_PHY_MDIX_CONTROL 0x1C /* MDI/MDI-X Control */
13712 +/* IFE PHY Extended Status Control */
13713 +#define IFE_PESC_POLARITY_REVERSED 0x0100
13715 +/* IFE PHY Special Control */
13716 +#define IFE_PSC_AUTO_POLARITY_DISABLE 0x0010
13717 +#define IFE_PSC_FORCE_POLARITY 0x0020
13718 +#define IFE_PSC_DISABLE_DYNAMIC_POWER_DOWN 0x0100
13720 +/* IFE PHY Special Control and LED Control */
13721 +#define IFE_PSCL_PROBE_MODE 0x0020
13722 +#define IFE_PSCL_PROBE_LEDS_OFF 0x0006 /* Force LEDs 0 and 2 off */
13723 +#define IFE_PSCL_PROBE_LEDS_ON 0x0007 /* Force LEDs 0 and 2 on */
13725 +/* IFE PHY MDIX Control */
13726 +#define IFE_PMC_MDIX_STATUS 0x0020 /* 1=MDI-X, 0=MDI */
13727 +#define IFE_PMC_FORCE_MDIX 0x0040 /* 1=force MDI-X, 0=force MDI */
13728 +#define IFE_PMC_AUTO_MDIX 0x0080 /* 1=enable auto MDI/MDI-X, 0=disable */
13731 Binary files vanilla/drivers/net/igb/e1000_phy.o and linux-i686-2.6.22/drivers/net/igb/e1000_phy.o differ
13732 diff -Nru vanilla/drivers/net/igb/.e1000_phy.o.cmd linux-i686-2.6.22/drivers/net/igb/.e1000_phy.o.cmd
13733 --- vanilla/drivers/net/igb/.e1000_phy.o.cmd 1969-12-31 19:00:00.000000000 -0500
13734 +++ linux-i686-2.6.22/drivers/net/igb/.e1000_phy.o.cmd 2009-07-16 19:53:43.000000000 -0400
13736 +cmd_drivers/net/igb/e1000_phy.o := gcc -m32 -Wp,-MD,drivers/net/igb/.e1000_phy.o.d -nostdinc -isystem /usr/lib/gcc/i386-redhat-linux/4.1.2/include -D__KERNEL__ -Iinclude -include include/linux/autoconf.h -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Os -pipe -msoft-float -mregparm=3 -freg-struct-return -mpreferred-stack-boundary=2 -march=i686 -mtune=generic -ffreestanding -maccumulate-outgoing-args -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -Iinclude/asm-i386/mach-generic -Iinclude/asm-i386/mach-default -fno-omit-frame-pointer -fno-optimize-sibling-calls -g -fno-stack-protector -Wdeclaration-after-statement -Wno-pointer-sign -DMODULE -D"KBUILD_STR(s)=\#s" -D"KBUILD_BASENAME=KBUILD_STR(e1000_phy)" -D"KBUILD_MODNAME=KBUILD_STR(igb)" -c -o drivers/net/igb/.tmp_e1000_phy.o drivers/net/igb/e1000_phy.c
13738 +deps_drivers/net/igb/e1000_phy.o := \
13739 + drivers/net/igb/e1000_phy.c \
13740 + drivers/net/igb/e1000_api.h \
13741 + drivers/net/igb/e1000_hw.h \
13742 + drivers/net/igb/e1000_osdep.h \
13743 + include/linux/pci.h \
13744 + $(wildcard include/config/pci/msi.h) \
13745 + $(wildcard include/config/pci.h) \
13746 + $(wildcard include/config/ht/irq.h) \
13747 + $(wildcard include/config/pci/domains.h) \
13748 + include/linux/pci_regs.h \
13749 + include/linux/mod_devicetable.h \
13750 + include/linux/types.h \
13751 + $(wildcard include/config/uid16.h) \
13752 + $(wildcard include/config/lbd.h) \
13753 + $(wildcard include/config/lsf.h) \
13754 + $(wildcard include/config/resources/64bit.h) \
13755 + include/linux/posix_types.h \
13756 + include/linux/stddef.h \
13757 + include/linux/compiler.h \
13758 + $(wildcard include/config/enable/must/check.h) \
13759 + include/linux/compiler-gcc4.h \
13760 + $(wildcard include/config/forced/inlining.h) \
13761 + include/linux/compiler-gcc.h \
13762 + include/asm/posix_types.h \
13763 + include/asm/types.h \
13764 + $(wildcard include/config/highmem64g.h) \
13765 + include/linux/ioport.h \
13766 + include/linux/list.h \
13767 + $(wildcard include/config/debug/list.h) \
13768 + include/linux/poison.h \
13769 + include/linux/prefetch.h \
13770 + include/asm/processor.h \
13771 + $(wildcard include/config/smp.h) \
13772 + $(wildcard include/config/x86/ht.h) \
13773 + $(wildcard include/config/paravirt.h) \
13774 + $(wildcard include/config/mk8.h) \
13775 + $(wildcard include/config/mk7.h) \
13776 + include/asm/vm86.h \
13777 + $(wildcard include/config/vm86.h) \
13778 + include/asm/ptrace.h \
13779 + include/asm/ptrace-abi.h \
13780 + include/asm/segment.h \
13781 + include/asm/math_emu.h \
13782 + include/asm/sigcontext.h \
13783 + include/asm/page.h \
13784 + $(wildcard include/config/x86/use/3dnow.h) \
13785 + $(wildcard include/config/x86/pae.h) \
13786 + $(wildcard include/config/hugetlb/page.h) \
13787 + $(wildcard include/config/highmem4g.h) \
13788 + $(wildcard include/config/page/offset.h) \
13789 + $(wildcard include/config/flatmem.h) \
13790 + include/asm-generic/pgtable-nopmd.h \
13791 + include/asm-generic/pgtable-nopud.h \
13792 + include/asm-generic/memory_model.h \
13793 + $(wildcard include/config/discontigmem.h) \
13794 + $(wildcard include/config/sparsemem.h) \
13795 + $(wildcard include/config/out/of/line/pfn/to/page.h) \
13796 + include/asm-generic/page.h \
13797 + include/asm/cpufeature.h \
13798 + include/linux/bitops.h \
13799 + include/asm/bitops.h \
13800 + include/asm/alternative.h \
13801 + include/asm-generic/bitops/sched.h \
13802 + include/asm-generic/bitops/hweight.h \
13803 + include/asm-generic/bitops/fls64.h \
13804 + include/asm-generic/bitops/ext2-non-atomic.h \
13805 + include/asm-generic/bitops/le.h \
13806 + include/asm/byteorder.h \
13807 + $(wildcard include/config/x86/bswap.h) \
13808 + include/linux/byteorder/little_endian.h \
13809 + include/linux/byteorder/swab.h \
13810 + include/linux/byteorder/generic.h \
13811 + include/asm-generic/bitops/minix.h \
13812 + include/asm/required-features.h \
13813 + $(wildcard include/config/x86/minimum/cpu.h) \
13814 + $(wildcard include/config/x86/cmov.h) \
13815 + $(wildcard include/config/x86/cmpxchg64.h) \
13816 + include/asm/msr.h \
13817 + include/asm/msr-index.h \
13818 + include/asm/errno.h \
13819 + include/asm-generic/errno.h \
13820 + include/asm-generic/errno-base.h \
13821 + include/linux/errno.h \
13822 + include/asm/system.h \
13823 + $(wildcard include/config/x86/oostore.h) \
13824 + include/linux/kernel.h \
13825 + $(wildcard include/config/preempt/voluntary.h) \
13826 + $(wildcard include/config/debug/spinlock/sleep.h) \
13827 + $(wildcard include/config/printk.h) \
13828 + $(wildcard include/config/numa.h) \
13829 + /usr/lib/gcc/i386-redhat-linux/4.1.2/include/stdarg.h \
13830 + include/linux/linkage.h \
13831 + include/asm/linkage.h \
13832 + $(wildcard include/config/x86/alignment/16.h) \
13833 + include/linux/log2.h \
13834 + $(wildcard include/config/arch/has/ilog2/u32.h) \
13835 + $(wildcard include/config/arch/has/ilog2/u64.h) \
13836 + include/asm/bug.h \
13837 + $(wildcard include/config/bug.h) \
13838 + $(wildcard include/config/debug/bugverbose.h) \
13839 + include/asm-generic/bug.h \
13840 + $(wildcard include/config/generic/bug.h) \
13841 + include/asm/cmpxchg.h \
13842 + $(wildcard include/config/x86/cmpxchg.h) \
13843 + include/linux/irqflags.h \
13844 + $(wildcard include/config/trace/irqflags.h) \
13845 + $(wildcard include/config/trace/irqflags/support.h) \
13846 + $(wildcard include/config/x86.h) \
13847 + include/asm/irqflags.h \
13848 + include/asm/processor-flags.h \
13849 + include/linux/cache.h \
13850 + include/asm/cache.h \
13851 + $(wildcard include/config/x86/l1/cache/shift.h) \
13852 + include/linux/threads.h \
13853 + $(wildcard include/config/nr/cpus.h) \
13854 + $(wildcard include/config/base/small.h) \
13855 + include/asm/percpu.h \
13856 + include/linux/cpumask.h \
13857 + $(wildcard include/config/hotplug/cpu.h) \
13858 + include/linux/bitmap.h \
13859 + include/linux/string.h \
13860 + include/asm/string.h \
13861 + include/linux/init.h \
13862 + $(wildcard include/config/modules.h) \
13863 + $(wildcard include/config/hotplug.h) \
13864 + $(wildcard include/config/memory/hotplug.h) \
13865 + $(wildcard include/config/acpi/hotplug/memory.h) \
13866 + include/asm/atomic.h \
13867 + $(wildcard include/config/m386.h) \
13868 + include/asm-generic/atomic.h \
13869 + include/linux/device.h \
13870 + $(wildcard include/config/debug/devres.h) \
13871 + include/linux/kobject.h \
13872 + include/linux/sysfs.h \
13873 + $(wildcard include/config/sysfs.h) \
13874 + include/linux/spinlock.h \
13875 + $(wildcard include/config/debug/spinlock.h) \
13876 + $(wildcard include/config/preempt.h) \
13877 + $(wildcard include/config/debug/lock/alloc.h) \
13878 + include/linux/preempt.h \
13879 + $(wildcard include/config/debug/preempt.h) \
13880 + include/linux/thread_info.h \
13881 + include/asm/thread_info.h \
13882 + $(wildcard include/config/4kstacks.h) \
13883 + $(wildcard include/config/debug/stack/usage.h) \
13884 + include/linux/stringify.h \
13885 + include/linux/bottom_half.h \
13886 + include/linux/spinlock_types.h \
13887 + include/linux/lockdep.h \
13888 + $(wildcard include/config/lockdep.h) \
13889 + $(wildcard include/config/generic/hardirqs.h) \
13890 + $(wildcard include/config/prove/locking.h) \
13891 + include/asm/spinlock_types.h \
13892 + include/asm/spinlock.h \
13893 + $(wildcard include/config/x86/ppro/fence.h) \
13894 + include/asm/rwlock.h \
13895 + include/linux/spinlock_api_smp.h \
13896 + include/linux/kref.h \
13897 + include/linux/wait.h \
13898 + include/asm/current.h \
13899 + include/linux/klist.h \
13900 + include/linux/completion.h \
13901 + include/linux/module.h \
13902 + $(wildcard include/config/modversions.h) \
13903 + $(wildcard include/config/unused/symbols.h) \
13904 + $(wildcard include/config/module/unload.h) \
13905 + $(wildcard include/config/kallsyms.h) \
13906 + include/linux/stat.h \
13907 + include/asm/stat.h \
13908 + include/linux/time.h \
13909 + include/linux/seqlock.h \
13910 + include/linux/vs_time.h \
13911 + $(wildcard include/config/vserver/vtime.h) \
13912 + include/linux/kmod.h \
13913 + $(wildcard include/config/kmod.h) \
13914 + include/linux/elf.h \
13915 + include/linux/auxvec.h \
13916 + include/asm/auxvec.h \
13917 + include/linux/elf-em.h \
13918 + include/asm/elf.h \
13919 + include/asm/user.h \
13920 + include/asm/desc.h \
13921 + include/asm/ldt.h \
13922 + include/linux/smp.h \
13923 + include/asm/smp.h \
13924 + $(wildcard include/config/x86/local/apic.h) \
13925 + $(wildcard include/config/x86/io/apic.h) \
13926 + include/asm/mpspec.h \
13927 + $(wildcard include/config/acpi.h) \
13928 + include/asm/mpspec_def.h \
13929 + include/asm-i386/mach-generic/mach_mpspec.h \
13930 + include/asm/apic.h \
13931 + $(wildcard include/config/x86/good/apic.h) \
13932 + include/linux/pm.h \
13933 + $(wildcard include/config/pm.h) \
13934 + include/linux/delay.h \
13935 + include/asm/delay.h \
13936 + include/asm/fixmap.h \
13937 + $(wildcard include/config/highmem.h) \
13938 + $(wildcard include/config/x86/visws/apic.h) \
13939 + $(wildcard include/config/x86/f00f/bug.h) \
13940 + $(wildcard include/config/x86/cyclone/timer.h) \
13941 + $(wildcard include/config/pci/mmconfig.h) \
13942 + include/asm/acpi.h \
13943 + $(wildcard include/config/acpi/sleep.h) \
13944 + include/acpi/pdc_intel.h \
13945 + include/asm/apicdef.h \
13946 + include/asm/kmap_types.h \
13947 + $(wildcard include/config/debug/highmem.h) \
13948 + include/asm/io_apic.h \
13949 + include/asm-i386/mach-generic/mach_apicdef.h \
13950 + include/asm/genapic.h \
13951 + include/linux/percpu.h \
13952 + include/linux/slab.h \
13953 + $(wildcard include/config/slab/debug.h) \
13954 + $(wildcard include/config/slab.h) \
13955 + $(wildcard include/config/slub.h) \
13956 + $(wildcard include/config/debug/slab.h) \
13957 + include/linux/gfp.h \
13958 + $(wildcard include/config/zone/dma.h) \
13959 + $(wildcard include/config/zone/dma32.h) \
13960 + include/linux/mmzone.h \
13961 + $(wildcard include/config/force/max/zoneorder.h) \
13962 + $(wildcard include/config/arch/populates/node/map.h) \
13963 + $(wildcard include/config/flat/node/mem/map.h) \
13964 + $(wildcard include/config/have/memory/present.h) \
13965 + $(wildcard include/config/need/node/memmap/size.h) \
13966 + $(wildcard include/config/need/multiple/nodes.h) \
13967 + $(wildcard include/config/have/arch/early/pfn/to/nid.h) \
13968 + $(wildcard include/config/sparsemem/extreme.h) \
13969 + $(wildcard include/config/nodes/span/other/nodes.h) \
13970 + $(wildcard include/config/holes/in/zone.h) \
13971 + include/linux/numa.h \
13972 + $(wildcard include/config/nodes/shift.h) \
13973 + include/linux/nodemask.h \
13974 + include/linux/memory_hotplug.h \
13975 + $(wildcard include/config/have/arch/nodedata/extension.h) \
13976 + include/linux/notifier.h \
13977 + include/linux/mutex.h \
13978 + $(wildcard include/config/debug/mutexes.h) \
13979 + $(wildcard include/config/chopstix.h) \
13980 + include/linux/rwsem.h \
13981 + $(wildcard include/config/rwsem/generic/spinlock.h) \
13982 + include/asm/rwsem.h \
13983 + include/linux/srcu.h \
13984 + include/linux/topology.h \
13985 + $(wildcard include/config/sched/smt.h) \
13986 + $(wildcard include/config/sched/mc.h) \
13987 + include/asm/topology.h \
13988 + include/asm-generic/topology.h \
13989 + include/linux/slab_def.h \
13990 + include/linux/kmalloc_sizes.h \
13991 + include/asm/mmu.h \
13992 + include/asm/semaphore.h \
13993 + include/linux/moduleparam.h \
13994 + include/asm/local.h \
13995 + include/asm/module.h \
13996 + $(wildcard include/config/m486.h) \
13997 + $(wildcard include/config/m586.h) \
13998 + $(wildcard include/config/m586tsc.h) \
13999 + $(wildcard include/config/m586mmx.h) \
14000 + $(wildcard include/config/mcore2.h) \
14001 + $(wildcard include/config/m686.h) \
14002 + $(wildcard include/config/mpentiumii.h) \
14003 + $(wildcard include/config/mpentiumiii.h) \
14004 + $(wildcard include/config/mpentiumm.h) \
14005 + $(wildcard include/config/mpentium4.h) \
14006 + $(wildcard include/config/mk6.h) \
14007 + $(wildcard include/config/x86/elan.h) \
14008 + $(wildcard include/config/mcrusoe.h) \
14009 + $(wildcard include/config/mefficeon.h) \
14010 + $(wildcard include/config/mwinchipc6.h) \
14011 + $(wildcard include/config/mwinchip2.h) \
14012 + $(wildcard include/config/mwinchip3d.h) \
14013 + $(wildcard include/config/mcyrixiii.h) \
14014 + $(wildcard include/config/mviac3/2.h) \
14015 + $(wildcard include/config/mviac7.h) \
14016 + $(wildcard include/config/mgeodegx1.h) \
14017 + $(wildcard include/config/mgeode/lx.h) \
14018 + include/asm/device.h \
14019 + include/linux/pci_ids.h \
14020 + include/linux/dmapool.h \
14021 + include/asm/io.h \
14022 + $(wildcard include/config/x86/numaq.h) \
14023 + include/asm-generic/iomap.h \
14024 + include/linux/vmalloc.h \
14025 + include/asm/scatterlist.h \
14026 + include/asm/pci.h \
14027 + include/linux/mm.h \
14028 + $(wildcard include/config/sysctl.h) \
14029 + $(wildcard include/config/mmu.h) \
14030 + $(wildcard include/config/stack/growsup.h) \
14031 + $(wildcard include/config/debug/vm.h) \
14032 + $(wildcard include/config/shmem.h) \
14033 + $(wildcard include/config/split/ptlock/cpus.h) \
14034 + $(wildcard include/config/ia64.h) \
14035 + $(wildcard include/config/proc/fs.h) \
14036 + $(wildcard include/config/debug/pagealloc.h) \
14037 + include/linux/capability.h \
14038 + include/linux/rbtree.h \
14039 + include/linux/prio_tree.h \
14040 + include/linux/fs.h \
14041 + $(wildcard include/config/dnotify.h) \
14042 + $(wildcard include/config/vserver/cowbl.h) \
14043 + $(wildcard include/config/quota.h) \
14044 + $(wildcard include/config/inotify.h) \
14045 + $(wildcard include/config/security.h) \
14046 + $(wildcard include/config/epoll.h) \
14047 + $(wildcard include/config/auditsyscall.h) \
14048 + $(wildcard include/config/block.h) \
14049 + $(wildcard include/config/fs/xip.h) \
14050 + $(wildcard include/config/migration.h) \
14051 + include/linux/limits.h \
14052 + include/linux/ioctl.h \
14053 + include/asm/ioctl.h \
14054 + include/asm-generic/ioctl.h \
14055 + include/linux/kdev_t.h \
14056 + include/linux/dcache.h \
14057 + $(wildcard include/config/profiling.h) \
14058 + include/linux/rcupdate.h \
14059 + include/linux/namei.h \
14060 + include/linux/radix-tree.h \
14061 + include/linux/pid.h \
14062 + include/linux/quota.h \
14063 + include/linux/dqblk_xfs.h \
14064 + include/linux/dqblk_v1.h \
14065 + include/linux/dqblk_v2.h \
14066 + include/linux/nfs_fs_i.h \
14067 + include/linux/nfs.h \
14068 + include/linux/sunrpc/msg_prot.h \
14069 + include/linux/fcntl.h \
14070 + include/asm/fcntl.h \
14071 + include/asm-generic/fcntl.h \
14072 + $(wildcard include/config/64bit.h) \
14073 + include/linux/err.h \
14074 + include/linux/debug_locks.h \
14075 + $(wildcard include/config/debug/locking/api/selftests.h) \
14076 + include/linux/backing-dev.h \
14077 + include/linux/mm_types.h \
14078 + include/asm/pgtable.h \
14079 + $(wildcard include/config/highpte.h) \
14080 + include/asm/paravirt.h \
14081 + include/asm/pgtable-2level-defs.h \
14082 + include/asm/pgtable-2level.h \
14083 + include/asm-generic/pgtable.h \
14084 + include/linux/page-flags.h \
14085 + $(wildcard include/config/s390.h) \
14086 + $(wildcard include/config/swap.h) \
14087 + include/linux/vmstat.h \
14088 + $(wildcard include/config/vm/event/counters.h) \
14089 + include/asm-generic/pci-dma-compat.h \
14090 + include/linux/dma-mapping.h \
14091 + include/asm/dma-mapping.h \
14092 + include/asm-generic/pci.h \
14093 + include/linux/interrupt.h \
14094 + $(wildcard include/config/high/res/timers.h) \
14095 + $(wildcard include/config/generic/irq/probe.h) \
14096 + include/linux/irqreturn.h \
14097 + include/linux/hardirq.h \
14098 + $(wildcard include/config/preempt/bkl.h) \
14099 + $(wildcard include/config/virt/cpu/accounting.h) \
14100 + include/linux/smp_lock.h \
14101 + $(wildcard include/config/lock/kernel.h) \
14102 + include/linux/sched.h \
14103 + $(wildcard include/config/no/hz.h) \
14104 + $(wildcard include/config/detect/softlockup.h) \
14105 + $(wildcard include/config/keys.h) \
14106 + $(wildcard include/config/bsd/process/acct.h) \
14107 + $(wildcard include/config/taskstats.h) \
14108 + $(wildcard include/config/inotify/user.h) \
14109 + $(wildcard include/config/schedstats.h) \
14110 + $(wildcard include/config/task/delay/acct.h) \
14111 + $(wildcard include/config/blk/dev/io/trace.h) \
14112 + $(wildcard include/config/cc/stackprotector.h) \
14113 + $(wildcard include/config/sysvipc.h) \
14114 + $(wildcard include/config/rt/mutexes.h) \
14115 + $(wildcard include/config/task/xacct.h) \
14116 + $(wildcard include/config/cpusets.h) \
14117 + $(wildcard include/config/compat.h) \
14118 + $(wildcard include/config/fault/injection.h) \
14119 + include/asm/param.h \
14120 + $(wildcard include/config/hz.h) \
14121 + include/linux/timex.h \
14122 + $(wildcard include/config/time/interpolation.h) \
14123 + include/asm/timex.h \
14124 + include/asm/tsc.h \
14125 + $(wildcard include/config/x86/tsc.h) \
14126 + $(wildcard include/config/x86/generic.h) \
14127 + include/linux/jiffies.h \
14128 + include/linux/calc64.h \
14129 + include/asm/div64.h \
14130 + include/asm/cputime.h \
14131 + include/asm-generic/cputime.h \
14132 + include/linux/sem.h \
14133 + include/linux/ipc.h \
14134 + $(wildcard include/config/ipc/ns.h) \
14135 + include/asm/ipcbuf.h \
14136 + include/asm/sembuf.h \
14137 + include/linux/signal.h \
14138 + include/asm/signal.h \
14139 + include/asm-generic/signal.h \
14140 + include/asm/siginfo.h \
14141 + include/asm-generic/siginfo.h \
14142 + include/linux/securebits.h \
14143 + include/linux/fs_struct.h \
14144 + include/linux/seccomp.h \
14145 + $(wildcard include/config/seccomp.h) \
14146 + include/linux/futex.h \
14147 + $(wildcard include/config/futex.h) \
14148 + include/linux/rtmutex.h \
14149 + $(wildcard include/config/debug/rt/mutexes.h) \
14150 + include/linux/plist.h \
14151 + $(wildcard include/config/debug/pi/list.h) \
14152 + include/linux/param.h \
14153 + include/linux/resource.h \
14154 + include/asm/resource.h \
14155 + include/asm-generic/resource.h \
14156 + include/linux/timer.h \
14157 + $(wildcard include/config/timer/stats.h) \
14158 + include/linux/ktime.h \
14159 + $(wildcard include/config/ktime/scalar.h) \
14160 + include/linux/hrtimer.h \
14161 + include/linux/task_io_accounting.h \
14162 + $(wildcard include/config/task/io/accounting.h) \
14163 + include/linux/aio.h \
14164 + include/linux/workqueue.h \
14165 + include/linux/aio_abi.h \
14166 + include/linux/uio.h \
14167 + include/asm/hardirq.h \
14168 + include/linux/irq.h \
14169 + $(wildcard include/config/irq/per/cpu.h) \
14170 + $(wildcard include/config/irq/release/method.h) \
14171 + $(wildcard include/config/generic/pending/irq.h) \
14172 + $(wildcard include/config/irqbalance.h) \
14173 + $(wildcard include/config/auto/irq/affinity.h) \
14174 + $(wildcard include/config/generic/hardirqs/no//do/irq.h) \
14175 + include/asm/irq.h \
14176 + include/asm-i386/mach-default/irq_vectors.h \
14177 + include/asm-i386/mach-default/irq_vectors_limits.h \
14178 + include/asm/irq_regs.h \
14179 + include/asm/hw_irq.h \
14180 + include/linux/profile.h \
14181 + include/asm/sections.h \
14182 + include/asm-generic/sections.h \
14183 + include/linux/irq_cpustat.h \
14184 + include/linux/if_ether.h \
14185 + include/linux/skbuff.h \
14186 + $(wildcard include/config/nf/conntrack.h) \
14187 + $(wildcard include/config/bridge/netfilter.h) \
14188 + $(wildcard include/config/vlan/8021q.h) \
14189 + $(wildcard include/config/net/sched.h) \
14190 + $(wildcard include/config/net/cls/act.h) \
14191 + $(wildcard include/config/net/dma.h) \
14192 + $(wildcard include/config/network/secmark.h) \
14193 + include/linux/net.h \
14194 + include/asm/socket.h \
14195 + include/asm/sockios.h \
14196 + include/linux/random.h \
14197 + include/linux/sysctl.h \
14198 + $(wildcard include/config/icmp/ipod.h) \
14199 + $(wildcard include/config/web100/net100.h) \
14200 + $(wildcard include/config/web100/stats.h) \
14201 + include/linux/textsearch.h \
14202 + include/net/checksum.h \
14203 + include/asm/uaccess.h \
14204 + $(wildcard include/config/x86/intel/usercopy.h) \
14205 + $(wildcard include/config/x86/wp/works/ok.h) \
14206 + include/asm/checksum.h \
14207 + include/linux/in6.h \
14208 + include/linux/dmaengine.h \
14209 + $(wildcard include/config/dma/engine.h) \
14210 + drivers/net/igb/kcompat.h \
14211 + $(wildcard include/config/e1000/napi.h) \
14212 + $(wildcard include/config/e1000e/napi.h) \
14213 + $(wildcard include/config/ixgb/napi.h) \
14214 + $(wildcard include/config/e1000/disable/packet/split.h) \
14215 + $(wildcard include/config/igb/disable/packet/split.h) \
14216 + $(wildcard include/config/net/poll/controller.h) \
14217 + $(wildcard include/config/space/len.h) \
14218 + $(wildcard include/config/netpoll.h) \
14219 + $(wildcard include/config/netdevices/multiqueue.h) \
14220 + include/linux/version.h \
14221 + include/linux/netdevice.h \
14222 + $(wildcard include/config/ax25.h) \
14223 + $(wildcard include/config/tr.h) \
14224 + $(wildcard include/config/net/ipip.h) \
14225 + $(wildcard include/config/net/ipgre.h) \
14226 + $(wildcard include/config/ipv6/sit.h) \
14227 + $(wildcard include/config/ipv6/tunnel.h) \
14228 + $(wildcard include/config/wireless/ext.h) \
14229 + $(wildcard include/config/netpoll/trap.h) \
14230 + include/linux/if.h \
14231 + include/linux/socket.h \
14232 + include/linux/sockios.h \
14233 + include/linux/hdlc/ioctl.h \
14234 + include/linux/if_packet.h \
14235 + include/linux/etherdevice.h \
14236 + include/linux/in.h \
14237 + include/linux/ip.h \
14238 + include/linux/udp.h \
14239 + include/net/inet_sock.h \
14240 + $(wildcard include/config/ipv6.h) \
14241 + include/linux/jhash.h \
14242 + include/net/flow.h \
14243 + $(wildcard include/config/ipv6/mip6.h) \
14244 + include/net/sock.h \
14245 + $(wildcard include/config/security/network.h) \
14246 + include/linux/security.h \
14247 + $(wildcard include/config/security/network/xfrm.h) \
14248 + include/linux/binfmts.h \
14249 + include/linux/shm.h \
14250 + include/asm/shmparam.h \
14251 + include/asm/shmbuf.h \
14252 + include/linux/msg.h \
14253 + include/asm/msgbuf.h \
14254 + include/linux/key.h \
14255 + include/linux/xfrm.h \
14256 + include/linux/filter.h \
14257 + include/net/dst.h \
14258 + $(wildcard include/config/net/cls/route.h) \
14259 + $(wildcard include/config/xfrm.h) \
14260 + include/linux/rtnetlink.h \
14261 + include/linux/netlink.h \
14262 + include/linux/if_link.h \
14263 + include/linux/if_addr.h \
14264 + include/linux/neighbour.h \
14265 + include/net/neighbour.h \
14266 + include/linux/seq_file.h \
14267 + include/net/rtnetlink.h \
14268 + include/net/netlink.h \
14269 + include/net/request_sock.h \
14270 + include/linux/mii.h \
14271 + include/linux/latency.h \
14272 + drivers/net/igb/e1000_regs.h \
14273 + drivers/net/igb/e1000_defines.h \
14274 + $(wildcard include/config/res.h) \
14275 + $(wildcard include/config/fault.h) \
14276 + drivers/net/igb/e1000_mac.h \
14277 + drivers/net/igb/e1000_phy.h \
14278 + drivers/net/igb/e1000_nvm.h \
14279 + drivers/net/igb/e1000_manage.h \
14280 + drivers/net/igb/e1000_82575.h \
14282 +drivers/net/igb/e1000_phy.o: $(deps_drivers/net/igb/e1000_phy.o)
14284 +$(deps_drivers/net/igb/e1000_phy.o):
14285 diff -Nru vanilla/drivers/net/igb/e1000_regs.h linux-i686-2.6.22/drivers/net/igb/e1000_regs.h
14286 --- vanilla/drivers/net/igb/e1000_regs.h 1969-12-31 19:00:00.000000000 -0500
14287 +++ linux-i686-2.6.22/drivers/net/igb/e1000_regs.h 2009-07-16 19:25:22.000000000 -0400
14289 +/*******************************************************************************
14291 + Intel(R) Gigabit Ethernet Linux driver
14292 + Copyright(c) 2007-2008 Intel Corporation.
14294 + This program is free software; you can redistribute it and/or modify it
14295 + under the terms and conditions of the GNU General Public License,
14296 + version 2, as published by the Free Software Foundation.
14298 + This program is distributed in the hope it will be useful, but WITHOUT
14299 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14300 + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14303 + You should have received a copy of the GNU General Public License along with
14304 + this program; if not, write to the Free Software Foundation, Inc.,
14305 + 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
14307 + The full GNU General Public License is included in this distribution in
14308 + the file called "COPYING".
14310 + Contact Information:
14311 + e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
14312 + Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
14314 +*******************************************************************************/
14316 +#ifndef _E1000_REGS_H_
14317 +#define _E1000_REGS_H_
14319 +#define E1000_CTRL 0x00000 /* Device Control - RW */
14320 +#define E1000_CTRL_DUP 0x00004 /* Device Control Duplicate (Shadow) - RW */
14321 +#define E1000_STATUS 0x00008 /* Device Status - RO */
14322 +#define E1000_EECD 0x00010 /* EEPROM/Flash Control - RW */
14323 +#define E1000_EERD 0x00014 /* EEPROM Read - RW */
14324 +#define E1000_CTRL_EXT 0x00018 /* Extended Device Control - RW */
14325 +#define E1000_FLA 0x0001C /* Flash Access - RW */
14326 +#define E1000_MDIC 0x00020 /* MDI Control - RW */
14327 +#define E1000_SCTL 0x00024 /* SerDes Control - RW */
14328 +#define E1000_FCAL 0x00028 /* Flow Control Address Low - RW */
14329 +#define E1000_FCAH 0x0002C /* Flow Control Address High -RW */
14330 +#define E1000_FEXTNVM 0x00028 /* Future Extended NVM - RW */
14331 +#define E1000_FCT 0x00030 /* Flow Control Type - RW */
14332 +#define E1000_CONNSW 0x00034 /* Copper/Fiber switch control - RW */
14333 +#define E1000_VET 0x00038 /* VLAN Ether Type - RW */
14334 +#define E1000_ICR 0x000C0 /* Interrupt Cause Read - R/clr */
14335 +#define E1000_ITR 0x000C4 /* Interrupt Throttling Rate - RW */
14336 +#define E1000_ICS 0x000C8 /* Interrupt Cause Set - WO */
14337 +#define E1000_IMS 0x000D0 /* Interrupt Mask Set - RW */
14338 +#define E1000_IMC 0x000D8 /* Interrupt Mask Clear - WO */
14339 +#define E1000_IAM 0x000E0 /* Interrupt Acknowledge Auto Mask */
14340 +#define E1000_RCTL 0x00100 /* Rx Control - RW */
14341 +#define E1000_FCTTV 0x00170 /* Flow Control Transmit Timer Value - RW */
14342 +#define E1000_TXCW 0x00178 /* Tx Configuration Word - RW */
14343 +#define E1000_RXCW 0x00180 /* Rx Configuration Word - RO */
14344 +#define E1000_EICR 0x01580 /* Ext. Interrupt Cause Read - R/clr */
14345 +#define E1000_EITR(_n) (0x01680 + (0x4 * (_n)))
14346 +#define E1000_EICS 0x01520 /* Ext. Interrupt Cause Set - W0 */
14347 +#define E1000_EIMS 0x01524 /* Ext. Interrupt Mask Set/Read - RW */
14348 +#define E1000_EIMC 0x01528 /* Ext. Interrupt Mask Clear - WO */
14349 +#define E1000_EIAC 0x0152C /* Ext. Interrupt Auto Clear - RW */
14350 +#define E1000_EIAM 0x01530 /* Ext. Interrupt Ack Auto Clear Mask - RW */
14351 +#define E1000_GPIE 0x01514 /* General Purpose Interrupt Enable - RW */
14352 +#define E1000_IVAR0 0x01700 /* Interrupt Vector Allocation (array) - RW */
14353 +#define E1000_IVAR_MISC 0x01740 /* IVAR for "other" causes - RW */
14354 +#define E1000_TCTL 0x00400 /* Tx Control - RW */
14355 +#define E1000_TCTL_EXT 0x00404 /* Extended Tx Control - RW */
14356 +#define E1000_TIPG 0x00410 /* Tx Inter-packet gap -RW */
14357 +#define E1000_TBT 0x00448 /* Tx Burst Timer - RW */
14358 +#define E1000_AIT 0x00458 /* Adaptive Interframe Spacing Throttle - RW */
14359 +#define E1000_LEDCTL 0x00E00 /* LED Control - RW */
14360 +#define E1000_EXTCNF_CTRL 0x00F00 /* Extended Configuration Control */
14361 +#define E1000_EXTCNF_SIZE 0x00F08 /* Extended Configuration Size */
14362 +#define E1000_PHY_CTRL 0x00F10 /* PHY Control Register in CSR */
14363 +#define E1000_PBA 0x01000 /* Packet Buffer Allocation - RW */
14364 +#define E1000_PBS 0x01008 /* Packet Buffer Size */
14365 +#define E1000_EEMNGCTL 0x01010 /* MNG EEprom Control */
14366 +#define E1000_EEARBC 0x01024 /* EEPROM Auto Read Bus Control */
14367 +#define E1000_FLASHT 0x01028 /* FLASH Timer Register */
14368 +#define E1000_EEWR 0x0102C /* EEPROM Write Register - RW */
14369 +#define E1000_FLSWCTL 0x01030 /* FLASH control register */
14370 +#define E1000_FLSWDATA 0x01034 /* FLASH data register */
14371 +#define E1000_FLSWCNT 0x01038 /* FLASH Access Counter */
14372 +#define E1000_FLOP 0x0103C /* FLASH Opcode Register */
14373 +#define E1000_I2CCMD 0x01028 /* SFPI2C Command Register - RW */
14374 +#define E1000_I2CPARAMS 0x0102C /* SFPI2C Parameters Register - RW */
14375 +#define E1000_WDSTP 0x01040 /* Watchdog Setup - RW */
14376 +#define E1000_SWDSTS 0x01044 /* SW Device Status - RW */
14377 +#define E1000_FRTIMER 0x01048 /* Free Running Timer - RW */
14378 +#define E1000_TCPTIMER 0x0104C /* TCP Timer - RW */
14379 +#define E1000_VPDDIAG 0x01060 /* VPD Diagnostic - RO */
14380 +#define E1000_ICR_V2 0x01500 /* Interrupt Cause - new location - RC */
14381 +#define E1000_ICS_V2 0x01504 /* Interrupt Cause Set - new location - WO */
14382 +#define E1000_IMS_V2 0x01508 /* Interrupt Mask Set/Read - new location - RW */
14383 +#define E1000_IMC_V2 0x0150C /* Interrupt Mask Clear - new location - WO */
14384 +#define E1000_IAM_V2 0x01510 /* Interrupt Ack Auto Mask - new location - RW */
14385 +#define E1000_ERT 0x02008 /* Early Rx Threshold - RW */
14386 +#define E1000_FCRTL 0x02160 /* Flow Control Receive Threshold Low - RW */
14387 +#define E1000_FCRTH 0x02168 /* Flow Control Receive Threshold High - RW */
14388 +#define E1000_PSRCTL 0x02170 /* Packet Split Receive Control - RW */
14389 +#define E1000_RDFPCQ(_n) (0x02430 + (0x4 * (_n)))
14390 +#define E1000_PBRTH 0x02458 /* PB Rx Arbitration Threshold - RW */
14391 +#define E1000_FCRTV 0x02460 /* Flow Control Refresh Timer Value - RW */
14392 +/* Split and Replication Rx Control - RW */
14393 +#define E1000_RDPUMB 0x025CC /* DMA Rx Descriptor uC Mailbox - RW */
14394 +#define E1000_RDPUAD 0x025D0 /* DMA Rx Descriptor uC Addr Command - RW */
14395 +#define E1000_RDPUWD 0x025D4 /* DMA Rx Descriptor uC Data Write - RW */
14396 +#define E1000_RDPURD 0x025D8 /* DMA Rx Descriptor uC Data Read - RW */
14397 +#define E1000_RDPUCTL 0x025DC /* DMA Rx Descriptor uC Control - RW */
14398 +#define E1000_PBDIAG 0x02458 /* Packet Buffer Diagnostic - RW */
14399 +#define E1000_RXPBS 0x02404 /* Rx Packet Buffer Size - RW */
14400 +#define E1000_RXCTL(_n) (0x0C014 + (0x40 * (_n)))
14401 +#define E1000_RQDPC(_n) (0x0C030 + (0x40 * (_n)))
14402 +#define E1000_TXCTL(_n) (0x0E014 + (0x40 * (_n)))
14403 +#define E1000_RDTR 0x02820 /* Rx Delay Timer - RW */
14404 +#define E1000_RADV 0x0282C /* Rx Interrupt Absolute Delay Timer - RW */
14406 + * Convenience macros
14408 + * Note: "_n" is the queue number of the register to be written to.
14411 + * E1000_RDBAL_REG(current_rx_queue)
14413 +#define E1000_RDBAL(_n) ((_n) < 4 ? (0x02800 + ((_n) * 0x100)) : (0x0C000 + ((_n) * 0x40)))
14414 +#define E1000_RDBAH(_n) ((_n) < 4 ? (0x02804 + ((_n) * 0x100)) : (0x0C004 + ((_n) * 0x40)))
14415 +#define E1000_RDLEN(_n) ((_n) < 4 ? (0x02808 + ((_n) * 0x100)) : (0x0C008 + ((_n) * 0x40)))
14416 +#define E1000_SRRCTL(_n) ((_n) < 4 ? (0x0280C + ((_n) * 0x100)) : (0x0C00C + ((_n) * 0x40)))
14417 +#define E1000_RDH(_n) ((_n) < 4 ? (0x02810 + ((_n) * 0x100)) : (0x0C010 + ((_n) * 0x40)))
14418 +#define E1000_RDT(_n) ((_n) < 4 ? (0x02818 + ((_n) * 0x100)) : (0x0C018 + ((_n) * 0x40)))
14419 +#define E1000_RXDCTL(_n) ((_n) < 4 ? (0x02828 + ((_n) * 0x100)) : (0x0C028 + ((_n) * 0x40)))
14420 +#define E1000_TDBAL(_n) ((_n) < 4 ? (0x03800 + ((_n) * 0x100)) : (0x0E000 + ((_n) * 0x40)))
14421 +#define E1000_TDBAH(_n) ((_n) < 4 ? (0x03804 + ((_n) * 0x100)) : (0x0E004 + ((_n) * 0x40)))
14422 +#define E1000_TDLEN(_n) ((_n) < 4 ? (0x03808 + ((_n) * 0x100)) : (0x0E008 + ((_n) * 0x40)))
14423 +#define E1000_TDH(_n) ((_n) < 4 ? (0x03810 + ((_n) * 0x100)) : (0x0E010 + ((_n) * 0x40)))
14424 +#define E1000_TDT(_n) ((_n) < 4 ? (0x03818 + ((_n) * 0x100)) : (0x0E018 + ((_n) * 0x40)))
14425 +#define E1000_TXDCTL(_n) ((_n) < 4 ? (0x03828 + ((_n) * 0x100)) : (0x0E028 + ((_n) * 0x40)))
14426 +#define E1000_TARC(_n) (0x03840 + (_n << 8))
14427 +#define E1000_DCA_TXCTRL(_n) (0x03814 + (_n << 8))
14428 +#define E1000_DCA_RXCTRL(_n) (0x02814 + (_n << 8))
14429 +#define E1000_TDWBAL(_n) ((_n) < 4 ? (0x03838 + ((_n) * 0x100)) : (0x0E038 + ((_n) * 0x40)))
14430 +#define E1000_TDWBAH(_n) ((_n) < 4 ? (0x0383C + ((_n) * 0x100)) : (0x0E03C + ((_n) * 0x40)))
14431 +#define E1000_RSRPD 0x02C00 /* Rx Small Packet Detect - RW */
14432 +#define E1000_RAID 0x02C08 /* Receive Ack Interrupt Delay - RW */
14433 +#define E1000_TXDMAC 0x03000 /* Tx DMA Control - RW */
14434 +#define E1000_KABGTXD 0x03004 /* AFE Band Gap Transmit Ref Data */
14435 +#define E1000_PSRTYPE(_i) (0x05480 + ((_i) * 4))
14436 +#define E1000_RAL(_i) (((_i) <= 15) ? (0x05400 + ((_i) * 8)) : (0x054E0 + ((_i - 16) * 8)))
14437 +#define E1000_RAH(_i) (((_i) <= 15) ? (0x05404 + ((_i) * 8)) : (0x054E4 + ((_i - 16) * 8)))
14438 +#define E1000_IP4AT_REG(_i) (0x05840 + ((_i) * 8))
14439 +#define E1000_IP6AT_REG(_i) (0x05880 + ((_i) * 4))
14440 +#define E1000_WUPM_REG(_i) (0x05A00 + ((_i) * 4))
14441 +#define E1000_FFMT_REG(_i) (0x09000 + ((_i) * 8))
14442 +#define E1000_FFVT_REG(_i) (0x09800 + ((_i) * 8))
14443 +#define E1000_FFLT_REG(_i) (0x05F00 + ((_i) * 8))
14444 +#define E1000_PBSLAC 0x03100 /* Packet Buffer Slave Access Control */
14445 +#define E1000_PBSLAD(_n) (0x03110 + (0x4 * (_n))) /* Packet Buffer DWORD (_n) */
14446 +#define E1000_TXPBS 0x03404 /* Tx Packet Buffer Size - RW */
14447 +#define E1000_TDFH 0x03410 /* Tx Data FIFO Head - RW */
14448 +#define E1000_TDFT 0x03418 /* Tx Data FIFO Tail - RW */
14449 +#define E1000_TDFHS 0x03420 /* Tx Data FIFO Head Saved - RW */
14450 +#define E1000_TDFTS 0x03428 /* Tx Data FIFO Tail Saved - RW */
14451 +#define E1000_TDFPC 0x03430 /* Tx Data FIFO Packet Count - RW */
14452 +#define E1000_TDPUMB 0x0357C /* DMA Tx Descriptor uC Mail Box - RW */
14453 +#define E1000_TDPUAD 0x03580 /* DMA Tx Descriptor uC Addr Command - RW */
14454 +#define E1000_TDPUWD 0x03584 /* DMA Tx Descriptor uC Data Write - RW */
14455 +#define E1000_TDPURD 0x03588 /* DMA Tx Descriptor uC Data Read - RW */
14456 +#define E1000_TDPUCTL 0x0358C /* DMA Tx Descriptor uC Control - RW */
14457 +#define E1000_DTXCTL 0x03590 /* DMA Tx Control - RW */
14458 +#define E1000_DTXTCPFLGL 0x0359C /* DMA Tx Control flag low - RW */
14459 +#define E1000_DTXTCPFLGH 0x035A0 /* DMA Tx Control flag high - RW */
14460 +#define E1000_DTXMXSZRQ 0x03540 /* DMA Tx Max Total Allow Size Requests - RW */
14461 +#define E1000_TIDV 0x03820 /* Tx Interrupt Delay Value - RW */
14462 +#define E1000_TADV 0x0382C /* Tx Interrupt Absolute Delay Val - RW */
14463 +#define E1000_TSPMT 0x03830 /* TCP Segmentation PAD & Min Threshold - RW */
14464 +#define E1000_CRCERRS 0x04000 /* CRC Error Count - R/clr */
14465 +#define E1000_ALGNERRC 0x04004 /* Alignment Error Count - R/clr */
14466 +#define E1000_SYMERRS 0x04008 /* Symbol Error Count - R/clr */
14467 +#define E1000_RXERRC 0x0400C /* Receive Error Count - R/clr */
14468 +#define E1000_MPC 0x04010 /* Missed Packet Count - R/clr */
14469 +#define E1000_SCC 0x04014 /* Single Collision Count - R/clr */
14470 +#define E1000_ECOL 0x04018 /* Excessive Collision Count - R/clr */
14471 +#define E1000_MCC 0x0401C /* Multiple Collision Count - R/clr */
14472 +#define E1000_LATECOL 0x04020 /* Late Collision Count - R/clr */
14473 +#define E1000_COLC 0x04028 /* Collision Count - R/clr */
14474 +#define E1000_DC 0x04030 /* Defer Count - R/clr */
14475 +#define E1000_TNCRS 0x04034 /* Tx-No CRS - R/clr */
14476 +#define E1000_SEC 0x04038 /* Sequence Error Count - R/clr */
14477 +#define E1000_CEXTERR 0x0403C /* Carrier Extension Error Count - R/clr */
14478 +#define E1000_RLEC 0x04040 /* Receive Length Error Count - R/clr */
14479 +#define E1000_XONRXC 0x04048 /* XON Rx Count - R/clr */
14480 +#define E1000_XONTXC 0x0404C /* XON Tx Count - R/clr */
14481 +#define E1000_XOFFRXC 0x04050 /* XOFF Rx Count - R/clr */
14482 +#define E1000_XOFFTXC 0x04054 /* XOFF Tx Count - R/clr */
14483 +#define E1000_FCRUC 0x04058 /* Flow Control Rx Unsupported Count- R/clr */
14484 +#define E1000_PRC64 0x0405C /* Packets Rx (64 bytes) - R/clr */
14485 +#define E1000_PRC127 0x04060 /* Packets Rx (65-127 bytes) - R/clr */
14486 +#define E1000_PRC255 0x04064 /* Packets Rx (128-255 bytes) - R/clr */
14487 +#define E1000_PRC511 0x04068 /* Packets Rx (255-511 bytes) - R/clr */
14488 +#define E1000_PRC1023 0x0406C /* Packets Rx (512-1023 bytes) - R/clr */
14489 +#define E1000_PRC1522 0x04070 /* Packets Rx (1024-1522 bytes) - R/clr */
14490 +#define E1000_GPRC 0x04074 /* Good Packets Rx Count - R/clr */
14491 +#define E1000_BPRC 0x04078 /* Broadcast Packets Rx Count - R/clr */
14492 +#define E1000_MPRC 0x0407C /* Multicast Packets Rx Count - R/clr */
14493 +#define E1000_GPTC 0x04080 /* Good Packets Tx Count - R/clr */
14494 +#define E1000_GORCL 0x04088 /* Good Octets Rx Count Low - R/clr */
14495 +#define E1000_GORCH 0x0408C /* Good Octets Rx Count High - R/clr */
14496 +#define E1000_GOTCL 0x04090 /* Good Octets Tx Count Low - R/clr */
14497 +#define E1000_GOTCH 0x04094 /* Good Octets Tx Count High - R/clr */
14498 +#define E1000_RNBC 0x040A0 /* Rx No Buffers Count - R/clr */
14499 +#define E1000_RUC 0x040A4 /* Rx Undersize Count - R/clr */
14500 +#define E1000_RFC 0x040A8 /* Rx Fragment Count - R/clr */
14501 +#define E1000_ROC 0x040AC /* Rx Oversize Count - R/clr */
14502 +#define E1000_RJC 0x040B0 /* Rx Jabber Count - R/clr */
14503 +#define E1000_MGTPRC 0x040B4 /* Management Packets Rx Count - R/clr */
14504 +#define E1000_MGTPDC 0x040B8 /* Management Packets Dropped Count - R/clr */
14505 +#define E1000_MGTPTC 0x040BC /* Management Packets Tx Count - R/clr */
14506 +#define E1000_TORL 0x040C0 /* Total Octets Rx Low - R/clr */
14507 +#define E1000_TORH 0x040C4 /* Total Octets Rx High - R/clr */
14508 +#define E1000_TOTL 0x040C8 /* Total Octets Tx Low - R/clr */
14509 +#define E1000_TOTH 0x040CC /* Total Octets Tx High - R/clr */
14510 +#define E1000_TPR 0x040D0 /* Total Packets Rx - R/clr */
14511 +#define E1000_TPT 0x040D4 /* Total Packets Tx - R/clr */
14512 +#define E1000_PTC64 0x040D8 /* Packets Tx (64 bytes) - R/clr */
14513 +#define E1000_PTC127 0x040DC /* Packets Tx (65-127 bytes) - R/clr */
14514 +#define E1000_PTC255 0x040E0 /* Packets Tx (128-255 bytes) - R/clr */
14515 +#define E1000_PTC511 0x040E4 /* Packets Tx (256-511 bytes) - R/clr */
14516 +#define E1000_PTC1023 0x040E8 /* Packets Tx (512-1023 bytes) - R/clr */
14517 +#define E1000_PTC1522 0x040EC /* Packets Tx (1024-1522 Bytes) - R/clr */
14518 +#define E1000_MPTC 0x040F0 /* Multicast Packets Tx Count - R/clr */
14519 +#define E1000_BPTC 0x040F4 /* Broadcast Packets Tx Count - R/clr */
14520 +#define E1000_TSCTC 0x040F8 /* TCP Segmentation Context Tx - R/clr */
14521 +#define E1000_TSCTFC 0x040FC /* TCP Segmentation Context Tx Fail - R/clr */
14522 +#define E1000_IAC 0x04100 /* Interrupt Assertion Count */
14523 +#define E1000_ICRXPTC 0x04104 /* Interrupt Cause Rx Packet Timer Expire Count */
14524 +#define E1000_ICRXATC 0x04108 /* Interrupt Cause Rx Absolute Timer Expire Count */
14525 +#define E1000_ICTXPTC 0x0410C /* Interrupt Cause Tx Packet Timer Expire Count */
14526 +#define E1000_ICTXATC 0x04110 /* Interrupt Cause Tx Absolute Timer Expire Count */
14527 +#define E1000_ICTXQEC 0x04118 /* Interrupt Cause Tx Queue Empty Count */
14528 +#define E1000_ICTXQMTC 0x0411C /* Interrupt Cause Tx Queue Minimum Threshold Count */
14529 +#define E1000_ICRXDMTC 0x04120 /* Interrupt Cause Rx Descriptor Minimum Threshold Count */
14530 +#define E1000_ICRXOC 0x04124 /* Interrupt Cause Receiver Overrun Count */
14532 +#define E1000_LSECTXUT 0x04300 /* LinkSec Tx Untagged Packet Count - OutPktsUntagged */
14533 +#define E1000_LSECTXPKTE 0x04304 /* LinkSec Encrypted Tx Packets Count - OutPktsEncrypted */
14534 +#define E1000_LSECTXPKTP 0x04308 /* LinkSec Protected Tx Packet Count - OutPktsProtected */
14535 +#define E1000_LSECTXOCTE 0x0430C /* LinkSec Encrypted Tx Octets Count - OutOctetsEncrypted */
14536 +#define E1000_LSECTXOCTP 0x04310 /* LinkSec Protected Tx Octets Count - OutOctetsProtected */
14537 +#define E1000_LSECRXUT 0x04314 /* LinkSec Untagged non-Strict Rx Packet Count - InPktsUntagged/InPktsNoTag */
14538 +#define E1000_LSECRXOCTD 0x0431C /* LinkSec Rx Octets Decrypted Count - InOctetsDecrypted */
14539 +#define E1000_LSECRXOCTV 0x04320 /* LinkSec Rx Octets Validated - InOctetsValidated */
14540 +#define E1000_LSECRXBAD 0x04324 /* LinkSec Rx Bad Tag - InPktsBadTag */
14541 +#define E1000_LSECRXNOSCI 0x04328 /* LinkSec Rx Packet No SCI Count - InPktsNoSci */
14542 +#define E1000_LSECRXUNSCI 0x0432C /* LinkSec Rx Packet Unknown SCI Count - InPktsUnknownSci */
14543 +#define E1000_LSECRXUNCH 0x04330 /* LinkSec Rx Unchecked Packets Count - InPktsUnchecked */
14544 +#define E1000_LSECRXDELAY 0x04340 /* LinkSec Rx Delayed Packet Count - InPktsDelayed */
14545 +#define E1000_LSECRXLATE 0x04350 /* LinkSec Rx Late Packets Count - InPktsLate */
14546 +#define E1000_LSECRXOK(_n) (0x04360 + (0x04 * (_n))) /* LinkSec Rx Packet OK Count - InPktsOk */
14547 +#define E1000_LSECRXINV(_n) (0x04380 + (0x04 * (_n))) /* LinkSec Rx Invalid Count - InPktsInvalid */
14548 +#define E1000_LSECRXNV(_n) (0x043A0 + (0x04 * (_n))) /* LinkSec Rx Not Valid Count - InPktsNotValid */
14549 +#define E1000_LSECRXUNSA 0x043C0 /* LinkSec Rx Unused SA Count - InPktsUnusedSa */
14550 +#define E1000_LSECRXNUSA 0x043D0 /* LinkSec Rx Not Using SA Count - InPktsNotUsingSa */
14551 +#define E1000_LSECTXCAP 0x0B000 /* LinkSec Tx Capabilities Register - RO */
14552 +#define E1000_LSECRXCAP 0x0B300 /* LinkSec Rx Capabilities Register - RO */
14553 +#define E1000_LSECTXCTRL 0x0B004 /* LinkSec Tx Control - RW */
14554 +#define E1000_LSECRXCTRL 0x0B304 /* LinkSec Rx Control - RW */
14555 +#define E1000_LSECTXSCL 0x0B008 /* LinkSec Tx SCI Low - RW */
14556 +#define E1000_LSECTXSCH 0x0B00C /* LinkSec Tx SCI High - RW */
14557 +#define E1000_LSECTXSA 0x0B010 /* LinkSec Tx SA0 - RW */
14558 +#define E1000_LSECTXPN0 0x0B018 /* LinkSec Tx SA PN 0 - RW */
14559 +#define E1000_LSECTXPN1 0x0B01C /* LinkSec Tx SA PN 1 - RW */
14560 +#define E1000_LSECRXSCL 0x0B3D0 /* LinkSec Rx SCI Low - RW */
14561 +#define E1000_LSECRXSCH 0x0B3E0 /* LinkSec Rx SCI High - RW */
14562 +#define E1000_LSECTXKEY0(_n) (0x0B020 + (0x04 * (_n))) /* LinkSec Tx 128-bit Key 0 - WO */
14563 +#define E1000_LSECTXKEY1(_n) (0x0B030 + (0x04 * (_n))) /* LinkSec Tx 128-bit Key 1 - WO */
14564 +#define E1000_LSECRXSA(_n) (0x0B310 + (0x04 * (_n))) /* LinkSec Rx SAs - RW */
14565 +#define E1000_LSECRXPN(_n) (0x0B330 + (0x04 * (_n))) /* LinkSec Rx SAs - RW */
14567 + * LinkSec Rx Keys - where _n is the SA no. and _m the 4 dwords of the 128 bit
14570 +#define E1000_LSECRXKEY(_n, _m) (0x0B350 + (0x10 * (_n)) + (0x04 * (_m)))
14572 +#define E1000_SSVPC 0x041A0 /* Switch Security Violation Packet Count */
14573 +#define E1000_IPSCTRL 0xB430 /* IpSec Control Register */
14574 +#define E1000_IPSRXCMD 0x0B408 /* IPSec Rx Command Register - RW */
14575 +#define E1000_IPSRXIDX 0x0B400 /* IPSec Rx Index - RW */
14576 +#define E1000_IPSRXIPADDR(_n) (0x0B420+ (0x04 * (_n))) /* IPSec Rx IPv4/v6 Address - RW */
14577 +#define E1000_IPSRXKEY(_n) (0x0B410 + (0x04 * (_n))) /* IPSec Rx 128-bit Key - RW */
14578 +#define E1000_IPSRXSALT 0x0B404 /* IPSec Rx Salt - RW */
14579 +#define E1000_IPSRXSPI 0x0B40C /* IPSec Rx SPI - RW */
14580 +#define E1000_IPSTXKEY(_n) (0x0B460 + (0x04 * (_n))) /* IPSec Tx 128-bit Key - RW */
14581 +#define E1000_IPSTXSALT 0x0B454 /* IPSec Tx Salt - RW */
14582 +#define E1000_IPSTXIDX 0x0B450 /* IPSec Tx SA IDX - RW */
14583 +#define E1000_PCS_CFG0 0x04200 /* PCS Configuration 0 - RW */
14584 +#define E1000_PCS_LCTL 0x04208 /* PCS Link Control - RW */
14585 +#define E1000_PCS_LSTAT 0x0420C /* PCS Link Status - RO */
14586 +#define E1000_CBTMPC 0x0402C /* Circuit Breaker Tx Packet Count */
14587 +#define E1000_HTDPMC 0x0403C /* Host Transmit Discarded Packets */
14588 +#define E1000_CBRDPC 0x04044 /* Circuit Breaker Rx Dropped Count */
14589 +#define E1000_CBRMPC 0x040FC /* Circuit Breaker Rx Packet Count */
14590 +#define E1000_RPTHC 0x04104 /* Rx Packets To Host */
14591 +#define E1000_HGPTC 0x04118 /* Host Good Packets Tx Count */
14592 +#define E1000_HTCBDPC 0x04124 /* Host Tx Circuit Breaker Dropped Count */
14593 +#define E1000_HGORCL 0x04128 /* Host Good Octets Received Count Low */
14594 +#define E1000_HGORCH 0x0412C /* Host Good Octets Received Count High */
14595 +#define E1000_HGOTCL 0x04130 /* Host Good Octets Transmit Count Low */
14596 +#define E1000_HGOTCH 0x04134 /* Host Good Octets Transmit Count High */
14597 +#define E1000_LENERRS 0x04138 /* Length Errors Count */
14598 +#define E1000_SCVPC 0x04228 /* SerDes/SGMII Code Violation Pkt Count */
14599 +#define E1000_HRMPC 0x0A018 /* Header Redirection Missed Packet Count */
14600 +#define E1000_PCS_ANADV 0x04218 /* AN advertisement - RW */
14601 +#define E1000_PCS_LPAB 0x0421C /* Link Partner Ability - RW */
14602 +#define E1000_PCS_NPTX 0x04220 /* AN Next Page Transmit - RW */
14603 +#define E1000_PCS_LPABNP 0x04224 /* Link Partner Ability Next Page - RW */
14604 +#define E1000_1GSTAT_RCV 0x04228 /* 1GSTAT Code Violation Packet Count - RW */
14605 +#define E1000_RXCSUM 0x05000 /* Rx Checksum Control - RW */
14606 +#define E1000_RLPML 0x05004 /* Rx Long Packet Max Length */
14607 +#define E1000_RFCTL 0x05008 /* Receive Filter Control*/
14608 +#define E1000_MTA 0x05200 /* Multicast Table Array - RW Array */
14609 +#define E1000_RA 0x05400 /* Receive Address - RW Array */
14610 +#define E1000_RA2 0x054E0 /* 2nd half of receive address array - RW Array */
14611 +#define E1000_VFTA 0x05600 /* VLAN Filter Table Array - RW Array */
14612 +#define E1000_VT_CTL 0x0581C /* VMDq Control - RW */
14613 +#define E1000_VFQA0 0x0B000 /* VLAN Filter Queue Array 0 - RW Array */
14614 +#define E1000_VFQA1 0x0B200 /* VLAN Filter Queue Array 1 - RW Array */
14615 +#define E1000_WUC 0x05800 /* Wakeup Control - RW */
14616 +#define E1000_WUFC 0x05808 /* Wakeup Filter Control - RW */
14617 +#define E1000_WUS 0x05810 /* Wakeup Status - RO */
14618 +#define E1000_MANC 0x05820 /* Management Control - RW */
14619 +#define E1000_IPAV 0x05838 /* IP Address Valid - RW */
14620 +#define E1000_IP4AT 0x05840 /* IPv4 Address Table - RW Array */
14621 +#define E1000_IP6AT 0x05880 /* IPv6 Address Table - RW Array */
14622 +#define E1000_WUPL 0x05900 /* Wakeup Packet Length - RW */
14623 +#define E1000_WUPM 0x05A00 /* Wakeup Packet Memory - RO A */
14624 +#define E1000_PBACL 0x05B68 /* MSIx PBA Clear - Read/Write 1's to clear */
14625 +#define E1000_FFLT 0x05F00 /* Flexible Filter Length Table - RW Array */
14626 +#define E1000_HOST_IF 0x08800 /* Host Interface */
14627 +#define E1000_FFMT 0x09000 /* Flexible Filter Mask Table - RW Array */
14628 +#define E1000_FFVT 0x09800 /* Flexible Filter Value Table - RW Array */
14629 +#define E1000_FHFT(_n) (0x09000 + (_n * 0x100)) /* Flexible Host Filter Table */
14630 +#define E1000_FHFT_EXT(_n) (0x09A00 + (_n * 0x100)) /* Ext Flexible Host Filter Table */
14633 +#define E1000_KMRNCTRLSTA 0x00034 /* MAC-PHY interface - RW */
14634 +#define E1000_MDPHYA 0x0003C /* PHY address - RW */
14635 +#define E1000_MANC2H 0x05860 /* Management Control To Host - RW */
14636 +#define E1000_SW_FW_SYNC 0x05B5C /* Software-Firmware Synchronization - RW */
14637 +#define E1000_CCMCTL 0x05B48 /* CCM Control Register */
14638 +#define E1000_GIOCTL 0x05B44 /* GIO Analog Control Register */
14639 +#define E1000_SCCTL 0x05B4C /* PCIc PLL Configuration Register */
14640 +#define E1000_GCR 0x05B00 /* PCI-Ex Control */
14641 +#define E1000_GSCL_1 0x05B10 /* PCI-Ex Statistic Control #1 */
14642 +#define E1000_GSCL_2 0x05B14 /* PCI-Ex Statistic Control #2 */
14643 +#define E1000_GSCL_3 0x05B18 /* PCI-Ex Statistic Control #3 */
14644 +#define E1000_GSCL_4 0x05B1C /* PCI-Ex Statistic Control #4 */
14645 +#define E1000_FACTPS 0x05B30 /* Function Active and Power State to MNG */
14646 +#define E1000_SWSM 0x05B50 /* SW Semaphore */
14647 +#define E1000_FWSM 0x05B54 /* FW Semaphore */
14648 +#define E1000_DCA_ID 0x05B70 /* DCA Requester ID Information - RO */
14649 +#define E1000_DCA_CTRL 0x05B74 /* DCA Control - RW */
14650 +#define E1000_FFLT_DBG 0x05F04 /* Debug Register */
14651 +#define E1000_HICR 0x08F00 /* Host Interface Control */
14653 +/* RSS registers */
14654 +#define E1000_CPUVEC 0x02C10 /* CPU Vector Register - RW */
14655 +#define E1000_MRQC 0x05818 /* Multiple Receive Control - RW */
14656 +#define E1000_IMIR(_i) (0x05A80 + ((_i) * 4)) /* Immediate Interrupt */
14657 +#define E1000_IMIREXT(_i) (0x05AA0 + ((_i) * 4)) /* Immediate Interrupt Ext*/
14658 +#define E1000_IMIRVP 0x05AC0 /* Immediate Interrupt Rx VLAN Priority - RW */
14659 +#define E1000_MSIXBM(_i) (0x01600 + ((_i) * 4)) /* MSI-X Allocation Register (_i) - RW */
14660 +#define E1000_MSIXTADD(_i) (0x0C000 + ((_i) * 0x10)) /* MSI-X Table entry addr low reg 0 - RW */
14661 +#define E1000_MSIXTUADD(_i) (0x0C004 + ((_i) * 0x10)) /* MSI-X Table entry addr upper reg 0 - RW */
14662 +#define E1000_MSIXTMSG(_i) (0x0C008 + ((_i) * 0x10)) /* MSI-X Table entry message reg 0 - RW */
14663 +#define E1000_MSIXVCTRL(_i) (0x0C00C + ((_i) * 0x10)) /* MSI-X Table entry vector ctrl reg 0 - RW */
14664 +#define E1000_MSIXPBA 0x0E000 /* MSI-X Pending bit array */
14665 +#define E1000_RETA(_i) (0x05C00 + ((_i) * 4)) /* Redirection Table - RW Array */
14666 +#define E1000_RSSRK(_i) (0x05C80 + ((_i) * 4)) /* RSS Random Key - RW Array */
14667 +#define E1000_RSSIM 0x05864 /* RSS Interrupt Mask */
14668 +#define E1000_RSSIR 0x05868 /* RSS Interrupt Request */
14669 +/* VT Registers */
14670 +#define E1000_SWPBS 0x03004 /* Switch Packet Buffer Size - RW */
14671 +#define E1000_MBVFICR 0x00C80 /* Mailbox VF Cause - RWC */
14672 +#define E1000_MBVFIMR 0x00C84 /* Mailbox VF int Mask - RW */
14673 +#define E1000_VFLRE 0x00C88 /* VF Register Events - RWC */
14674 +#define E1000_VFRE 0x00C8C /* VF Receive Enables */
14675 +#define E1000_VFTE 0x00C90 /* VF Transmit Enables */
14676 +#define E1000_QDE 0x02408 /* Queue Drop Enable - RW */
14677 +#define E1000_DTXSWC 0x03500 /* DMA Tx Switch Control - RW */
14678 +#define E1000_VLVF 0x05D00 /* VLAN Virtual Machine Filter - RW */
14679 +#define E1000_RPLOLR 0x05AF0 /* Replication Offload - RW */
14680 +#define E1000_UTA 0x0A000 /* Unicast Table Array - RW */
14681 +#define E1000_IOVTCL 0x05BBC /* IOV Control Register */
14682 +#define E1000_VMRCTL 0X05D80 /* Virtual Mirror Rule Control */
14683 +/* These act per VF so an array friendly macro is used */
14684 +#define E1000_V2PMAILBOX(_n) (0x00C40 + (4 * (_n)))
14685 +#define E1000_P2VMAILBOX(_n) (0x00C00 + (4 * (_n)))
14686 +#define E1000_VMBMEM(_n) (0x00800 + (64 * (_n)))
14687 +#define E1000_VFVMBMEM(_n) (0x00800 + (_n))
14688 +#define E1000_VMOLR(_n) (0x05AD0 + (4 * (_n)))
14690 +/* Filtering Registers */
14691 +#define E1000_SAQF(_n) (0x05980 + (4 * (_n))) /* Source Address Queue Fltr */
14692 +#define E1000_DAQF(_n) (0x059A0 + (4 * (_n))) /* Dest Address Queue Fltr */
14693 +#define E1000_SPQF(_n) (0x059C0 + (4 * (_n))) /* Source Port Queue Fltr */
14694 +#define E1000_FTQF(_n) (0x059E0 + (4 * (_n))) /* 5-tuple Queue Fltr */
14695 +#define E1000_SYNQF(_n) (0x055FC + (4 * (_n))) /* SYN Packet Queue Fltr */
14696 +#define E1000_ETQF(_n) (0x05CB0 + (4 * (_n))) /* EType Queue Fltr */
14698 +#define E1000_RTTDCS 0x3600 /* Reedtown Tx Desc plane control and status */
14699 +#define E1000_RTTPCS 0x3474 /* Reedtown Tx Packet Plane control and status */
14700 +#define E1000_RTRPCS 0x2474 /* Rx packet plane control and status */
14701 +#define E1000_RTRUP2TC 0x05AC4 /* Rx User Priority to Traffic Class */
14702 +#define E1000_RTTUP2TC 0x0418 /* Transmit User Priority to Traffic Class */
14703 +#define E1000_RTTDTCRC(_n) (0x3610 + ((_n) * 4)) /* Tx Desc plane TC Rate-scheduler config */
14704 +#define E1000_RTTPTCRC(_n) (0x3480 + ((_n) * 4)) /* Tx Packet plane TC Rate-Scheduler Config */
14705 +#define E1000_RTRPTCRC(_n) (0x2480 + ((_n) * 4)) /* Rx Packet plane TC Rate-Scheduler Config */
14706 +#define E1000_RTTDTCRS(_n) (0x3630 + ((_n) * 4)) /* Tx Desc Plane TC Rate-Scheduler Status */
14707 +#define E1000_RTTDTCRM(_n) (0x3650 + ((_n) * 4)) /* Tx Desc Plane TC Rate-Scheduler MMW */
14708 +#define E1000_RTTPTCRS(_n) (0x34A0 + ((_n) * 4)) /* Tx Packet plane TC Rate-Scheduler Status */
14709 +#define E1000_RTTPTCRM(_n) (0x34C0 + ((_n) * 4)) /* Tx Packet plane TC Rate-scheduler MMW */
14710 +#define E1000_RTRPTCRS(_n) (0x24A0 + ((_n) * 4)) /* Rx Packet plane TC Rate-Scheduler Status */
14711 +#define E1000_RTRPTCRM(_n) (0x24C0 + ((_n) * 4)) /* Rx Packet plane TC Rate-Scheduler MMW */
14712 +#define E1000_RTTDVMRM(_n) (0x3670 + ((_n) * 4)) /* Tx Desc plane VM Rate-Scheduler MMW*/
14713 +#define E1000_RTTBCNRM(_n) (0x3690 + ((_n) * 4)) /* Tx BCN Rate-Scheduler MMW */
14714 +#define E1000_RTTDQSEL 0x3604 /* Tx Desc Plane Queue Select */
14715 +#define E1000_RTTDVMRC 0x3608 /* Tx Desc Plane VM Rate-Scheduler Config */
14716 +#define E1000_RTTDVMRS 0x360C /* Tx Desc Plane VM Rate-Scheduler Status */
14717 +#define E1000_RTTBCNRC 0x36B0 /* Tx BCN Rate-Scheduler Config */
14718 +#define E1000_RTTBCNRS 0x36B4 /* Tx BCN Rate-Scheduler Status */
14719 +#define E1000_RTTBCNCR 0xB200 /* Tx BCN Control Register */
14720 +#define E1000_RTTBCNTG 0x35A4 /* Tx BCN Tagging */
14721 +#define E1000_RTTBCNCP 0xB208 /* Tx BCN Congestion point */
14722 +#define E1000_RTRBCNCR 0xB20C /* Rx BCN Control Register */
14723 +#define E1000_RTTBCNRD 0x36B8 /* Tx BCN Rate Drift */
14724 +#define E1000_PFCTOP 0x1080 /* Priority Flow Control Type and Opcode */
14725 +#define E1000_RTTBCNIDX 0xB204 /* Tx BCN Congestion Point */
14726 +#define E1000_RTTBCNACH 0x0B214 /* Tx BCN Control High */
14727 +#define E1000_RTTBCNACL 0x0B210 /* Tx BCN Control Low */
14730 diff -Nru vanilla/drivers/net/igb/igb_ethtool.c linux-i686-2.6.22/drivers/net/igb/igb_ethtool.c
14731 --- vanilla/drivers/net/igb/igb_ethtool.c 1969-12-31 19:00:00.000000000 -0500
14732 +++ linux-i686-2.6.22/drivers/net/igb/igb_ethtool.c 2009-07-16 19:25:22.000000000 -0400
14734 +/*******************************************************************************
14736 + Intel(R) Gigabit Ethernet Linux driver
14737 + Copyright(c) 2007-2008 Intel Corporation.
14739 + This program is free software; you can redistribute it and/or modify it
14740 + under the terms and conditions of the GNU General Public License,
14741 + version 2, as published by the Free Software Foundation.
14743 + This program is distributed in the hope it will be useful, but WITHOUT
14744 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14745 + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14748 + You should have received a copy of the GNU General Public License along with
14749 + this program; if not, write to the Free Software Foundation, Inc.,
14750 + 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
14752 + The full GNU General Public License is included in this distribution in
14753 + the file called "COPYING".
14755 + Contact Information:
14756 + e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
14757 + Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
14759 +*******************************************************************************/
14761 +/* ethtool support for igb */
14763 +#include <linux/netdevice.h>
14764 +#include <linux/vmalloc.h>
14766 +#ifdef SIOCETHTOOL
14767 +#include <linux/ethtool.h>
14770 +#include "igb_regtest.h"
14771 +#include <linux/if_vlan.h>
14773 +#ifdef ETHTOOL_OPS_COMPAT
14774 +#include "kcompat_ethtool.c"
14777 +#ifdef ETHTOOL_GSTATS
14778 +struct igb_stats {
14779 + char stat_string[ETH_GSTRING_LEN];
14784 +#define IGB_STAT(m) sizeof(((struct igb_adapter *)0)->m), \
14785 + offsetof(struct igb_adapter, m)
14786 +static const struct igb_stats igb_gstrings_stats[] = {
14787 + { "rx_packets", IGB_STAT(stats.gprc) },
14788 + { "tx_packets", IGB_STAT(stats.gptc) },
14789 + { "rx_bytes", IGB_STAT(stats.gorc) },
14790 + { "tx_bytes", IGB_STAT(stats.gotc) },
14791 + { "rx_broadcast", IGB_STAT(stats.bprc) },
14792 + { "tx_broadcast", IGB_STAT(stats.bptc) },
14793 + { "rx_multicast", IGB_STAT(stats.mprc) },
14794 + { "tx_multicast", IGB_STAT(stats.mptc) },
14795 + { "rx_errors", IGB_STAT(net_stats.rx_errors) },
14796 + { "tx_errors", IGB_STAT(net_stats.tx_errors) },
14797 + { "tx_dropped", IGB_STAT(net_stats.tx_dropped) },
14798 + { "multicast", IGB_STAT(stats.mprc) },
14799 + { "collisions", IGB_STAT(stats.colc) },
14800 + { "rx_length_errors", IGB_STAT(net_stats.rx_length_errors) },
14801 + { "rx_over_errors", IGB_STAT(net_stats.rx_over_errors) },
14802 + { "rx_crc_errors", IGB_STAT(stats.crcerrs) },
14803 + { "rx_frame_errors", IGB_STAT(net_stats.rx_frame_errors) },
14804 + { "rx_no_buffer_count", IGB_STAT(stats.rnbc) },
14805 + { "rx_missed_errors", IGB_STAT(stats.mpc) },
14806 + { "tx_aborted_errors", IGB_STAT(stats.ecol) },
14807 + { "tx_carrier_errors", IGB_STAT(stats.tncrs) },
14808 + { "tx_fifo_errors", IGB_STAT(net_stats.tx_fifo_errors) },
14809 + { "tx_heartbeat_errors", IGB_STAT(net_stats.tx_heartbeat_errors) },
14810 + { "tx_window_errors", IGB_STAT(stats.latecol) },
14811 + { "tx_abort_late_coll", IGB_STAT(stats.latecol) },
14812 + { "tx_deferred_ok", IGB_STAT(stats.dc) },
14813 + { "tx_single_coll_ok", IGB_STAT(stats.scc) },
14814 + { "tx_multi_coll_ok", IGB_STAT(stats.mcc) },
14815 + { "tx_timeout_count", IGB_STAT(tx_timeout_count) },
14816 + { "tx_restart_queue", IGB_STAT(restart_queue) },
14817 + { "rx_long_length_errors", IGB_STAT(stats.roc) },
14818 + { "rx_short_length_errors", IGB_STAT(stats.ruc) },
14819 + { "rx_align_errors", IGB_STAT(stats.algnerrc) },
14820 + { "tx_tcp_seg_good", IGB_STAT(stats.tsctc) },
14821 + { "tx_tcp_seg_failed", IGB_STAT(stats.tsctfc) },
14822 + { "rx_flow_control_xon", IGB_STAT(stats.xonrxc) },
14823 + { "rx_flow_control_xoff", IGB_STAT(stats.xoffrxc) },
14824 + { "tx_flow_control_xon", IGB_STAT(stats.xontxc) },
14825 + { "tx_flow_control_xoff", IGB_STAT(stats.xofftxc) },
14826 + { "rx_long_byte_count", IGB_STAT(stats.gorc) },
14827 + { "rx_csum_offload_good", IGB_STAT(hw_csum_good) },
14828 + { "rx_csum_offload_errors", IGB_STAT(hw_csum_err) },
14829 + { "rx_header_split", IGB_STAT(rx_hdr_split) },
14830 + { "low_latency_interrupt", IGB_STAT(lli_int)},
14831 + { "alloc_rx_buff_failed", IGB_STAT(alloc_rx_buff_failed) },
14832 + { "tx_smbus", IGB_STAT(stats.mgptc) },
14833 + { "rx_smbus", IGB_STAT(stats.mgprc) },
14834 + { "dropped_smbus", IGB_STAT(stats.mgpdc) },
14836 + { "lro_aggregated", IGB_STAT(lro_aggregated) },
14837 + { "lro_flushed", IGB_STAT(lro_flushed) },
14838 + { "lro_no_desc", IGB_STAT(lro_no_desc) },
14842 +#define IGB_QUEUE_STATS_LEN \
14843 + ((((struct igb_adapter *)netdev->priv)->num_rx_queues + \
14844 + ((struct igb_adapter *)netdev->priv)->num_tx_queues) * \
14845 + (sizeof(struct igb_queue_stats) / sizeof(u64)))
14846 +#define IGB_GLOBAL_STATS_LEN \
14847 + sizeof(igb_gstrings_stats) / sizeof(struct igb_stats)
14848 +#define IGB_STATS_LEN (IGB_GLOBAL_STATS_LEN + IGB_QUEUE_STATS_LEN)
14849 +#endif /* ETHTOOL_GSTATS */
14850 +#ifdef ETHTOOL_TEST
14851 +static const char igb_gstrings_test[][ETH_GSTRING_LEN] = {
14852 + "Register test (offline)", "Eeprom test (offline)",
14853 + "Interrupt test (offline)", "Loopback test (offline)",
14854 + "Link test (on/offline)"
14856 +#define IGB_TEST_LEN sizeof(igb_gstrings_test) / ETH_GSTRING_LEN
14857 +#endif /* ETHTOOL_TEST */
14859 +static int igb_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
14861 + struct igb_adapter *adapter = netdev_priv(netdev);
14862 + struct e1000_hw *hw = &adapter->hw;
14865 + if (hw->phy.media_type == e1000_media_type_copper) {
14867 + ecmd->supported = (SUPPORTED_10baseT_Half |
14868 + SUPPORTED_10baseT_Full |
14869 + SUPPORTED_100baseT_Half |
14870 + SUPPORTED_100baseT_Full |
14871 + SUPPORTED_1000baseT_Full|
14872 + SUPPORTED_Autoneg |
14874 + ecmd->advertising = ADVERTISED_TP;
14876 + if (hw->mac.autoneg == 1) {
14877 + ecmd->advertising |= ADVERTISED_Autoneg;
14878 + /* the e1000 autoneg seems to match ethtool nicely */
14879 + ecmd->advertising |= hw->phy.autoneg_advertised;
14882 + ecmd->port = PORT_TP;
14883 + ecmd->phy_address = hw->phy.addr;
14885 + ecmd->supported = (SUPPORTED_1000baseT_Full |
14886 + SUPPORTED_FIBRE |
14887 + SUPPORTED_Autoneg);
14889 + ecmd->advertising = (ADVERTISED_1000baseT_Full |
14890 + ADVERTISED_FIBRE |
14891 + ADVERTISED_Autoneg);
14893 + ecmd->port = PORT_FIBRE;
14896 + ecmd->transceiver = XCVR_INTERNAL;
14898 + status = E1000_READ_REG(hw, E1000_STATUS);
14900 + if (status & E1000_STATUS_LU) {
14902 + if ((status & E1000_STATUS_SPEED_1000) ||
14903 + hw->phy.media_type != e1000_media_type_copper)
14904 + ecmd->speed = SPEED_1000;
14905 + else if (status & E1000_STATUS_SPEED_100)
14906 + ecmd->speed = SPEED_100;
14908 + ecmd->speed = SPEED_10;
14910 + if ((status & E1000_STATUS_FD) ||
14911 + hw->phy.media_type != e1000_media_type_copper)
14912 + ecmd->duplex = DUPLEX_FULL;
14914 + ecmd->duplex = DUPLEX_HALF;
14916 + ecmd->speed = -1;
14917 + ecmd->duplex = -1;
14920 + ecmd->autoneg = ((hw->phy.media_type == e1000_media_type_fiber) ||
14921 + hw->mac.autoneg) ? AUTONEG_ENABLE : AUTONEG_DISABLE;
14925 +static int igb_set_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
14927 + struct igb_adapter *adapter = netdev_priv(netdev);
14928 + struct e1000_hw *hw = &adapter->hw;
14930 + /* When SoL/IDER sessions are active, autoneg/speed/duplex
14931 + * cannot be changed */
14932 + if (e1000_check_reset_block(hw)) {
14933 + DPRINTK(DRV, ERR, "Cannot change link characteristics "
14934 + "when SoL/IDER is active.\n");
14938 + while (test_and_set_bit(__IGB_RESETTING, &adapter->state))
14941 + if (ecmd->autoneg == AUTONEG_ENABLE) {
14942 + hw->mac.autoneg = 1;
14943 + if (hw->phy.media_type == e1000_media_type_fiber)
14944 + hw->phy.autoneg_advertised = ADVERTISED_1000baseT_Full |
14945 + ADVERTISED_FIBRE |
14946 + ADVERTISED_Autoneg;
14948 + hw->phy.autoneg_advertised = ecmd->advertising |
14950 + ADVERTISED_Autoneg;
14951 + ecmd->advertising = hw->phy.autoneg_advertised;
14952 + if (adapter->fc_autoneg)
14953 + hw->fc.original_type = e1000_fc_default;
14955 + if (igb_set_spd_dplx(adapter, ecmd->speed + ecmd->duplex)) {
14956 + clear_bit(__IGB_RESETTING, &adapter->state);
14961 + /* reset the link */
14962 + if (netif_running(adapter->netdev)) {
14963 + igb_down(adapter);
14966 + igb_reset(adapter);
14968 + clear_bit(__IGB_RESETTING, &adapter->state);
14972 +static void igb_get_pauseparam(struct net_device *netdev,
14973 + struct ethtool_pauseparam *pause)
14975 + struct igb_adapter *adapter = netdev_priv(netdev);
14976 + struct e1000_hw *hw = &adapter->hw;
14979 + (adapter->fc_autoneg ? AUTONEG_ENABLE : AUTONEG_DISABLE);
14981 + if (hw->fc.type == e1000_fc_rx_pause)
14982 + pause->rx_pause = 1;
14983 + else if (hw->fc.type == e1000_fc_tx_pause)
14984 + pause->tx_pause = 1;
14985 + else if (hw->fc.type == e1000_fc_full) {
14986 + pause->rx_pause = 1;
14987 + pause->tx_pause = 1;
14991 +static int igb_set_pauseparam(struct net_device *netdev,
14992 + struct ethtool_pauseparam *pause)
14994 + struct igb_adapter *adapter = netdev_priv(netdev);
14995 + struct e1000_hw *hw = &adapter->hw;
14998 + adapter->fc_autoneg = pause->autoneg;
15000 + while (test_and_set_bit(__IGB_RESETTING, &adapter->state))
15003 + if (pause->rx_pause && pause->tx_pause)
15004 + hw->fc.type = e1000_fc_full;
15005 + else if (pause->rx_pause && !pause->tx_pause)
15006 + hw->fc.type = e1000_fc_rx_pause;
15007 + else if (!pause->rx_pause && pause->tx_pause)
15008 + hw->fc.type = e1000_fc_tx_pause;
15009 + else if (!pause->rx_pause && !pause->tx_pause)
15010 + hw->fc.type = e1000_fc_none;
15012 + hw->fc.original_type = hw->fc.type;
15014 + /* reset the adapter/link to have settings take effect immediately and
15015 + * let our link partner know as well */
15016 + if (netif_running(adapter->netdev)) {
15017 + igb_down(adapter);
15020 + igb_reset(adapter);
15023 + clear_bit(__IGB_RESETTING, &adapter->state);
15027 +static u32 igb_get_rx_csum(struct net_device *netdev)
15029 + struct igb_adapter *adapter = netdev_priv(netdev);
15030 + return adapter->rx_csum;
15033 +static int igb_set_rx_csum(struct net_device *netdev, u32 data)
15035 + struct igb_adapter *adapter = netdev_priv(netdev);
15036 + adapter->rx_csum = data;
15041 +static u32 igb_get_tx_csum(struct net_device *netdev)
15043 + return (netdev->features & NETIF_F_IP_CSUM) != 0;
15046 +static int igb_set_tx_csum(struct net_device *netdev, u32 data)
15049 +#ifdef NETIF_F_IPV6_CSUM
15050 + netdev->features |= (NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM);
15052 + netdev->features &= ~(NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM);
15054 + netdev->features |= NETIF_F_IP_CSUM;
15056 + netdev->features &= ~NETIF_F_IP_CSUM;
15062 +#ifdef NETIF_F_TSO
15063 +static int igb_set_tso(struct net_device *netdev, u32 data)
15065 + struct igb_adapter *adapter = netdev_priv(netdev);
15067 + struct net_device *v_netdev;
15070 + netdev->features |= NETIF_F_TSO;
15071 +#ifdef NETIF_F_TSO6
15072 + netdev->features |= NETIF_F_TSO6;
15075 + netdev->features &= ~NETIF_F_TSO;
15076 +#ifdef NETIF_F_TSO6
15077 + netdev->features &= ~NETIF_F_TSO6;
15079 + /* disable TSO on all VLANs if they're present */
15080 + if (!adapter->vlgrp)
15082 + for (i = 0; i < VLAN_GROUP_ARRAY_LEN; i++) {
15083 + v_netdev = vlan_group_get_device(adapter->vlgrp, i);
15087 + v_netdev->features &= ~NETIF_F_TSO;
15088 +#ifdef NETIF_F_TSO6
15089 + v_netdev->features &= ~NETIF_F_TSO6;
15091 + vlan_group_set_device(adapter->vlgrp, i, v_netdev);
15096 + DPRINTK(PROBE, INFO, "TSO is %s\n", data ? "Enabled" : "Disabled");
15099 +#endif /* NETIF_F_TSO */
15101 +static u32 igb_get_msglevel(struct net_device *netdev)
15103 + struct igb_adapter *adapter = netdev_priv(netdev);
15104 + return adapter->msg_enable;
15107 +static void igb_set_msglevel(struct net_device *netdev, u32 data)
15109 + struct igb_adapter *adapter = netdev_priv(netdev);
15110 + adapter->msg_enable = data;
15113 +static int igb_get_regs_len(struct net_device *netdev)
15115 +#define IGB_REGS_LEN 551
15116 + return IGB_REGS_LEN * sizeof(u32);
15119 +static void igb_get_regs(struct net_device *netdev,
15120 + struct ethtool_regs *regs, void *p)
15122 + struct igb_adapter *adapter = netdev_priv(netdev);
15123 + struct e1000_hw *hw = &adapter->hw;
15124 + u32 *regs_buff = p;
15127 + memset(p, 0, IGB_REGS_LEN * sizeof(u32));
15129 + regs->version = (1 << 24) | (hw->revision_id << 16) | hw->device_id;
15131 + /* General Registers */
15132 + regs_buff[0] = E1000_READ_REG(hw, E1000_CTRL);
15133 + regs_buff[1] = E1000_READ_REG(hw, E1000_STATUS);
15134 + regs_buff[2] = E1000_READ_REG(hw, E1000_CTRL_EXT);
15135 + regs_buff[3] = E1000_READ_REG(hw, E1000_MDIC);
15136 + regs_buff[4] = E1000_READ_REG(hw, E1000_SCTL);
15137 + regs_buff[5] = E1000_READ_REG(hw, E1000_CONNSW);
15138 + regs_buff[6] = E1000_READ_REG(hw, E1000_VET);
15139 + regs_buff[7] = E1000_READ_REG(hw, E1000_LEDCTL);
15140 + regs_buff[8] = E1000_READ_REG(hw, E1000_PBA);
15141 + regs_buff[9] = E1000_READ_REG(hw, E1000_PBS);
15142 + regs_buff[10] = E1000_READ_REG(hw, E1000_FRTIMER);
15143 + regs_buff[11] = E1000_READ_REG(hw, E1000_TCPTIMER);
15145 + /* NVM Register */
15146 + regs_buff[12] = E1000_READ_REG(hw, E1000_EECD);
15149 + /* Reading EICS for EICR because they read the
15150 + * same but EICS does not clear on read */
15151 + regs_buff[13] = E1000_READ_REG(hw, E1000_EICS);
15152 + regs_buff[14] = E1000_READ_REG(hw, E1000_EICS);
15153 + regs_buff[15] = E1000_READ_REG(hw, E1000_EIMS);
15154 + regs_buff[16] = E1000_READ_REG(hw, E1000_EIMC);
15155 + regs_buff[17] = E1000_READ_REG(hw, E1000_EIAC);
15156 + regs_buff[18] = E1000_READ_REG(hw, E1000_EIAM);
15157 + /* Reading ICS for ICR because they read the
15158 + * same but ICS does not clear on read */
15159 + regs_buff[19] = E1000_READ_REG(hw, E1000_ICS);
15160 + regs_buff[20] = E1000_READ_REG(hw, E1000_ICS);
15161 + regs_buff[21] = E1000_READ_REG(hw, E1000_IMS);
15162 + regs_buff[22] = E1000_READ_REG(hw, E1000_IMC);
15163 + regs_buff[23] = E1000_READ_REG(hw, E1000_IAC);
15164 + regs_buff[24] = E1000_READ_REG(hw, E1000_IAM);
15165 + regs_buff[25] = E1000_READ_REG(hw, E1000_IMIRVP);
15167 + /* Flow Control */
15168 + regs_buff[26] = E1000_READ_REG(hw, E1000_FCAL);
15169 + regs_buff[27] = E1000_READ_REG(hw, E1000_FCAH);
15170 + regs_buff[28] = E1000_READ_REG(hw, E1000_FCTTV);
15171 + regs_buff[29] = E1000_READ_REG(hw, E1000_FCRTL);
15172 + regs_buff[30] = E1000_READ_REG(hw, E1000_FCRTH);
15173 + regs_buff[31] = E1000_READ_REG(hw, E1000_FCRTV);
15176 + regs_buff[32] = E1000_READ_REG(hw, E1000_RCTL);
15177 + regs_buff[33] = E1000_READ_REG(hw, E1000_RXCSUM);
15178 + regs_buff[34] = E1000_READ_REG(hw, E1000_RLPML);
15179 + regs_buff[35] = E1000_READ_REG(hw, E1000_RFCTL);
15180 + regs_buff[36] = E1000_READ_REG(hw, E1000_MRQC);
15181 + regs_buff[37] = E1000_READ_REG(hw, E1000_VT_CTL);
15184 + regs_buff[38] = E1000_READ_REG(hw, E1000_TCTL);
15185 + regs_buff[39] = E1000_READ_REG(hw, E1000_TCTL_EXT);
15186 + regs_buff[40] = E1000_READ_REG(hw, E1000_TIPG);
15187 + regs_buff[41] = E1000_READ_REG(hw, E1000_DTXCTL);
15190 + regs_buff[42] = E1000_READ_REG(hw, E1000_WUC);
15191 + regs_buff[43] = E1000_READ_REG(hw, E1000_WUFC);
15192 + regs_buff[44] = E1000_READ_REG(hw, E1000_WUS);
15193 + regs_buff[45] = E1000_READ_REG(hw, E1000_IPAV);
15194 + regs_buff[46] = E1000_READ_REG(hw, E1000_WUPL);
15197 + regs_buff[47] = E1000_READ_REG(hw, E1000_PCS_CFG0);
15198 + regs_buff[48] = E1000_READ_REG(hw, E1000_PCS_LCTL);
15199 + regs_buff[49] = E1000_READ_REG(hw, E1000_PCS_LSTAT);
15200 + regs_buff[50] = E1000_READ_REG(hw, E1000_PCS_ANADV);
15201 + regs_buff[51] = E1000_READ_REG(hw, E1000_PCS_LPAB);
15202 + regs_buff[52] = E1000_READ_REG(hw, E1000_PCS_NPTX);
15203 + regs_buff[53] = E1000_READ_REG(hw, E1000_PCS_LPABNP);
15206 + regs_buff[54] = adapter->stats.crcerrs;
15207 + regs_buff[55] = adapter->stats.algnerrc;
15208 + regs_buff[56] = adapter->stats.symerrs;
15209 + regs_buff[57] = adapter->stats.rxerrc;
15210 + regs_buff[58] = adapter->stats.mpc;
15211 + regs_buff[59] = adapter->stats.scc;
15212 + regs_buff[60] = adapter->stats.ecol;
15213 + regs_buff[61] = adapter->stats.mcc;
15214 + regs_buff[62] = adapter->stats.latecol;
15215 + regs_buff[63] = adapter->stats.colc;
15216 + regs_buff[64] = adapter->stats.dc;
15217 + regs_buff[65] = adapter->stats.tncrs;
15218 + regs_buff[66] = adapter->stats.sec;
15219 + regs_buff[67] = adapter->stats.htdpmc;
15220 + regs_buff[68] = adapter->stats.rlec;
15221 + regs_buff[69] = adapter->stats.xonrxc;
15222 + regs_buff[70] = adapter->stats.xontxc;
15223 + regs_buff[71] = adapter->stats.xoffrxc;
15224 + regs_buff[72] = adapter->stats.xofftxc;
15225 + regs_buff[73] = adapter->stats.fcruc;
15226 + regs_buff[74] = adapter->stats.prc64;
15227 + regs_buff[75] = adapter->stats.prc127;
15228 + regs_buff[76] = adapter->stats.prc255;
15229 + regs_buff[77] = adapter->stats.prc511;
15230 + regs_buff[78] = adapter->stats.prc1023;
15231 + regs_buff[79] = adapter->stats.prc1522;
15232 + regs_buff[80] = adapter->stats.gprc;
15233 + regs_buff[81] = adapter->stats.bprc;
15234 + regs_buff[82] = adapter->stats.mprc;
15235 + regs_buff[83] = adapter->stats.gptc;
15236 + regs_buff[84] = adapter->stats.gorc;
15237 + regs_buff[86] = adapter->stats.gotc;
15238 + regs_buff[88] = adapter->stats.rnbc;
15239 + regs_buff[89] = adapter->stats.ruc;
15240 + regs_buff[90] = adapter->stats.rfc;
15241 + regs_buff[91] = adapter->stats.roc;
15242 + regs_buff[92] = adapter->stats.rjc;
15243 + regs_buff[93] = adapter->stats.mgprc;
15244 + regs_buff[94] = adapter->stats.mgpdc;
15245 + regs_buff[95] = adapter->stats.mgptc;
15246 + regs_buff[96] = adapter->stats.tor;
15247 + regs_buff[98] = adapter->stats.tot;
15248 + regs_buff[100] = adapter->stats.tpr;
15249 + regs_buff[101] = adapter->stats.tpt;
15250 + regs_buff[102] = adapter->stats.ptc64;
15251 + regs_buff[103] = adapter->stats.ptc127;
15252 + regs_buff[104] = adapter->stats.ptc255;
15253 + regs_buff[105] = adapter->stats.ptc511;
15254 + regs_buff[106] = adapter->stats.ptc1023;
15255 + regs_buff[107] = adapter->stats.ptc1522;
15256 + regs_buff[108] = adapter->stats.mptc;
15257 + regs_buff[109] = adapter->stats.bptc;
15258 + regs_buff[110] = adapter->stats.tsctc;
15259 + regs_buff[111] = adapter->stats.iac;
15260 + regs_buff[112] = adapter->stats.rpthc;
15261 + regs_buff[113] = adapter->stats.hgptc;
15262 + regs_buff[114] = adapter->stats.hgorc;
15263 + regs_buff[116] = adapter->stats.hgotc;
15264 + regs_buff[118] = adapter->stats.lenerrs;
15265 + regs_buff[119] = adapter->stats.scvpc;
15266 + regs_buff[120] = adapter->stats.hrmpc;
15268 + for (i = 0; i < 4; i++)
15269 + regs_buff[121 + i] = E1000_READ_REG(hw, E1000_SRRCTL(i));
15270 + for (i = 0; i < 4; i++)
15271 + regs_buff[125 + i] = E1000_READ_REG(hw, E1000_PSRTYPE(i));
15272 + for (i = 0; i < 4; i++)
15273 + regs_buff[129 + i] = E1000_READ_REG(hw, E1000_RDBAL(i));
15274 + for (i = 0; i < 4; i++)
15275 + regs_buff[133 + i] = E1000_READ_REG(hw, E1000_RDBAH(i));
15276 + for (i = 0; i < 4; i++)
15277 + regs_buff[137 + i] = E1000_READ_REG(hw, E1000_RDLEN(i));
15278 + for (i = 0; i < 4; i++)
15279 + regs_buff[141 + i] = E1000_READ_REG(hw, E1000_RDH(i));
15280 + for (i = 0; i < 4; i++)
15281 + regs_buff[145 + i] = E1000_READ_REG(hw, E1000_RDT(i));
15282 + for (i = 0; i < 4; i++)
15283 + regs_buff[149 + i] = E1000_READ_REG(hw, E1000_RXDCTL(i));
15285 + for (i = 0; i < 10; i++)
15286 + regs_buff[153 + i] = E1000_READ_REG(hw, E1000_EITR(i));
15287 + for (i = 0; i < 8; i++)
15288 + regs_buff[163 + i] = E1000_READ_REG(hw, E1000_IMIR(i));
15289 + for (i = 0; i < 8; i++)
15290 + regs_buff[171 + i] = E1000_READ_REG(hw, E1000_IMIREXT(i));
15291 + for (i = 0; i < 16; i++)
15292 + regs_buff[179 + i] = E1000_READ_REG(hw, E1000_RAL(i));
15293 + for (i = 0; i < 16; i++)
15294 + regs_buff[195 + i] = E1000_READ_REG(hw, E1000_RAH(i));
15296 + for (i = 0; i < 4; i++)
15297 + regs_buff[211 + i] = E1000_READ_REG(hw, E1000_TDBAL(i));
15298 + for (i = 0; i < 4; i++)
15299 + regs_buff[215 + i] = E1000_READ_REG(hw, E1000_TDBAH(i));
15300 + for (i = 0; i < 4; i++)
15301 + regs_buff[219 + i] = E1000_READ_REG(hw, E1000_TDLEN(i));
15302 + for (i = 0; i < 4; i++)
15303 + regs_buff[223 + i] = E1000_READ_REG(hw, E1000_TDH(i));
15304 + for (i = 0; i < 4; i++)
15305 + regs_buff[227 + i] = E1000_READ_REG(hw, E1000_TDT(i));
15306 + for (i = 0; i < 4; i++)
15307 + regs_buff[231 + i] = E1000_READ_REG(hw, E1000_TXDCTL(i));
15308 + for (i = 0; i < 4; i++)
15309 + regs_buff[235 + i] = E1000_READ_REG(hw, E1000_TDWBAL(i));
15310 + for (i = 0; i < 4; i++)
15311 + regs_buff[239 + i] = E1000_READ_REG(hw, E1000_TDWBAH(i));
15312 + for (i = 0; i < 4; i++)
15313 + regs_buff[243 + i] = E1000_READ_REG(hw, E1000_DCA_TXCTRL(i));
15315 + for (i = 0; i < 4; i++)
15316 + regs_buff[247 + i] = E1000_READ_REG(hw, E1000_IP4AT_REG(i));
15317 + for (i = 0; i < 4; i++)
15318 + regs_buff[251 + i] = E1000_READ_REG(hw, E1000_IP6AT_REG(i));
15319 + for (i = 0; i < 32; i++)
15320 + regs_buff[255 + i] = E1000_READ_REG(hw, E1000_WUPM_REG(i));
15321 + for (i = 0; i < 128; i++)
15322 + regs_buff[287 + i] = E1000_READ_REG(hw, E1000_FFMT_REG(i));
15323 + for (i = 0; i < 128; i++)
15324 + regs_buff[415 + i] = E1000_READ_REG(hw, E1000_FFVT_REG(i));
15325 + for (i = 0; i < 4; i++)
15326 + regs_buff[543 + i] = E1000_READ_REG(hw, E1000_FFLT_REG(i));
15328 + regs_buff[547] = E1000_READ_REG(hw, E1000_TDFH);
15329 + regs_buff[548] = E1000_READ_REG(hw, E1000_TDFT);
15330 + regs_buff[549] = E1000_READ_REG(hw, E1000_TDFHS);
15331 + regs_buff[550] = E1000_READ_REG(hw, E1000_TDFPC);
15335 +static int igb_get_eeprom_len(struct net_device *netdev)
15337 + struct igb_adapter *adapter = netdev_priv(netdev);
15338 + return adapter->hw.nvm.word_size * 2;
15341 +static int igb_get_eeprom(struct net_device *netdev,
15342 + struct ethtool_eeprom *eeprom, u8 *bytes)
15344 + struct igb_adapter *adapter = netdev_priv(netdev);
15345 + struct e1000_hw *hw = &adapter->hw;
15346 + u16 *eeprom_buff;
15347 + int first_word, last_word;
15351 + if (eeprom->len == 0)
15354 + eeprom->magic = hw->vendor_id | (hw->device_id << 16);
15356 + first_word = eeprom->offset >> 1;
15357 + last_word = (eeprom->offset + eeprom->len - 1) >> 1;
15359 + eeprom_buff = kmalloc(sizeof(u16) *
15360 + (last_word - first_word + 1), GFP_KERNEL);
15361 + if (!eeprom_buff)
15364 + if (hw->nvm.type == e1000_nvm_eeprom_spi)
15365 + ret_val = e1000_read_nvm(hw, first_word,
15366 + last_word - first_word + 1,
15369 + for (i = 0; i < last_word - first_word + 1; i++) {
15370 + ret_val = e1000_read_nvm(hw, first_word + i, 1,
15371 + &eeprom_buff[i]);
15377 + /* Device's eeprom is always little-endian, word addressable */
15378 + for (i = 0; i < last_word - first_word + 1; i++)
15379 + le16_to_cpus(&eeprom_buff[i]);
15381 + memcpy(bytes, (u8 *)eeprom_buff + (eeprom->offset & 1),
15383 + kfree(eeprom_buff);
15388 +static int igb_set_eeprom(struct net_device *netdev,
15389 + struct ethtool_eeprom *eeprom, u8 *bytes)
15391 + struct igb_adapter *adapter = netdev_priv(netdev);
15392 + struct e1000_hw *hw = &adapter->hw;
15393 + u16 *eeprom_buff;
15395 + int max_len, first_word, last_word, ret_val = 0;
15398 + if (eeprom->len == 0)
15399 + return -EOPNOTSUPP;
15401 + if (eeprom->magic != (hw->vendor_id | (hw->device_id << 16)))
15404 + max_len = hw->nvm.word_size * 2;
15406 + first_word = eeprom->offset >> 1;
15407 + last_word = (eeprom->offset + eeprom->len - 1) >> 1;
15408 + eeprom_buff = kmalloc(max_len, GFP_KERNEL);
15409 + if (!eeprom_buff)
15412 + ptr = (void *)eeprom_buff;
15414 + if (eeprom->offset & 1) {
15415 + /* need read/modify/write of first changed EEPROM word */
15416 + /* only the second byte of the word is being modified */
15417 + ret_val = e1000_read_nvm(hw, first_word, 1,
15418 + &eeprom_buff[0]);
15421 + if (((eeprom->offset + eeprom->len) & 1) && (ret_val == 0)) {
15422 + /* need read/modify/write of last changed EEPROM word */
15423 + /* only the first byte of the word is being modified */
15424 + ret_val = e1000_read_nvm(hw, last_word, 1,
15425 + &eeprom_buff[last_word - first_word]);
15428 + /* Device's eeprom is always little-endian, word addressable */
15429 + for (i = 0; i < last_word - first_word + 1; i++)
15430 + le16_to_cpus(&eeprom_buff[i]);
15432 + memcpy(ptr, bytes, eeprom->len);
15434 + for (i = 0; i < last_word - first_word + 1; i++)
15435 + eeprom_buff[i] = cpu_to_le16(eeprom_buff[i]);
15437 + ret_val = e1000_write_nvm(hw, first_word,
15438 + last_word - first_word + 1, eeprom_buff);
15440 + /* Update the checksum over the first part of the EEPROM if needed
15441 + * and flush shadow RAM for 82573 controllers */
15442 + if ((ret_val == 0) && ((first_word <= NVM_CHECKSUM_REG)))
15443 + e1000_update_nvm_checksum(hw);
15445 + kfree(eeprom_buff);
15449 +static void igb_get_drvinfo(struct net_device *netdev,
15450 + struct ethtool_drvinfo *drvinfo)
15452 + struct igb_adapter *adapter = netdev_priv(netdev);
15453 + char firmware_version[32];
15456 + strncpy(drvinfo->driver, igb_driver_name, 32);
15457 + strncpy(drvinfo->version, igb_driver_version, 32);
15459 + /* EEPROM image version # is reported as firmware version # for
15460 + * 82575 controllers */
15461 + e1000_read_nvm(&adapter->hw, 5, 1, &eeprom_data);
15462 + sprintf(firmware_version, "%d.%d-%d",
15463 + (eeprom_data & 0xF000) >> 12,
15464 + (eeprom_data & 0x0FF0) >> 4,
15465 + eeprom_data & 0x000F);
15467 + strncpy(drvinfo->fw_version, firmware_version, 32);
15468 + strncpy(drvinfo->bus_info, pci_name(adapter->pdev), 32);
15469 + drvinfo->n_stats = IGB_STATS_LEN;
15470 + drvinfo->testinfo_len = IGB_TEST_LEN;
15471 + drvinfo->regdump_len = igb_get_regs_len(netdev);
15472 + drvinfo->eedump_len = igb_get_eeprom_len(netdev);
15475 +static void igb_get_ringparam(struct net_device *netdev,
15476 + struct ethtool_ringparam *ring)
15478 + struct igb_adapter *adapter = netdev_priv(netdev);
15479 + struct igb_ring *tx_ring = adapter->tx_ring;
15480 + struct igb_ring *rx_ring = adapter->rx_ring;
15482 + ring->rx_max_pending = IGB_MAX_RXD;
15483 + ring->tx_max_pending = IGB_MAX_TXD;
15484 + ring->rx_mini_max_pending = 0;
15485 + ring->rx_jumbo_max_pending = 0;
15486 + ring->rx_pending = rx_ring->count;
15487 + ring->tx_pending = tx_ring->count;
15488 + ring->rx_mini_pending = 0;
15489 + ring->rx_jumbo_pending = 0;
15492 +static int igb_set_ringparam(struct net_device *netdev,
15493 + struct ethtool_ringparam *ring)
15495 + struct igb_adapter *adapter = netdev_priv(netdev);
15496 + struct igb_ring *temp_ring;
15498 + u32 new_rx_count, new_tx_count;
15500 + if ((ring->rx_mini_pending) || (ring->rx_jumbo_pending))
15503 + new_rx_count = max(ring->rx_pending, (u32)IGB_MIN_RXD);
15504 + new_rx_count = min(new_rx_count, (u32)IGB_MAX_RXD);
15505 + new_rx_count = ALIGN(new_rx_count, REQ_RX_DESCRIPTOR_MULTIPLE);
15507 + new_tx_count = max(ring->tx_pending, (u32)IGB_MIN_TXD);
15508 + new_tx_count = min(new_tx_count, (u32)IGB_MAX_TXD);
15509 + new_tx_count = ALIGN(new_tx_count, REQ_TX_DESCRIPTOR_MULTIPLE);
15511 + if ((new_tx_count == adapter->tx_ring_count) &&
15512 + (new_rx_count == adapter->rx_ring_count)) {
15513 + /* nothing to do */
15517 + if (adapter->num_tx_queues > adapter->num_rx_queues)
15518 + temp_ring = vmalloc(adapter->num_tx_queues * sizeof(struct igb_ring));
15520 + temp_ring = vmalloc(adapter->num_rx_queues * sizeof(struct igb_ring));
15524 + while (test_and_set_bit(__IGB_RESETTING, &adapter->state))
15527 + if (netif_running(adapter->netdev))
15528 + igb_down(adapter);
15531 + * We can't just free everything and then setup again,
15532 + * because the ISRs in MSI-X mode get passed pointers
15533 + * to the tx and rx ring structs.
15535 + if (new_tx_count != adapter->tx_ring_count) {
15536 + memcpy(temp_ring, adapter->tx_ring,
15537 + adapter->num_tx_queues * sizeof(struct igb_ring));
15539 + for (i = 0; i < adapter->num_tx_queues; i++) {
15540 + temp_ring[i].count = new_tx_count;
15541 + err = igb_setup_tx_resources(adapter, &temp_ring[i]);
15545 + igb_free_tx_resources(&temp_ring[i]);
15551 + for (i = 0; i < adapter->num_tx_queues; i++)
15552 + igb_free_tx_resources(&adapter->tx_ring[i]);
15554 + memcpy(adapter->tx_ring, temp_ring,
15555 + adapter->num_tx_queues * sizeof(struct igb_ring));
15557 + adapter->tx_ring_count = new_tx_count;
15560 + if (new_rx_count != adapter->rx_ring->count) {
15561 + memcpy(temp_ring, adapter->rx_ring,
15562 + adapter->num_rx_queues * sizeof(struct igb_ring));
15564 + for (i = 0; i < adapter->num_rx_queues; i++) {
15565 + temp_ring[i].count = new_rx_count;
15566 + err = igb_setup_rx_resources(adapter, &temp_ring[i]);
15570 + igb_free_rx_resources(&temp_ring[i]);
15577 + for (i = 0; i < adapter->num_rx_queues; i++)
15578 + igb_free_rx_resources(&adapter->rx_ring[i]);
15580 + memcpy(adapter->rx_ring, temp_ring,
15581 + adapter->num_rx_queues * sizeof(struct igb_ring));
15583 + adapter->rx_ring_count = new_rx_count;
15588 + if (netif_running(adapter->netdev))
15591 + clear_bit(__IGB_RESETTING, &adapter->state);
15592 + vfree(temp_ring);
15596 +static bool reg_pattern_test(struct igb_adapter *adapter, u64 *data,
15597 + int reg, u32 mask, u32 write)
15599 + struct e1000_hw *hw = &adapter->hw;
15601 + static const u32 _test[] =
15602 + {0x5A5A5A5A, 0xA5A5A5A5, 0x00000000, 0xFFFFFFFF};
15603 + for (pat = 0; pat < ARRAY_SIZE(_test); pat++) {
15604 + E1000_WRITE_REG(hw, reg, (_test[pat] & write));
15605 + val = E1000_READ_REG(hw, reg);
15606 + if (val != (_test[pat] & write & mask)) {
15607 + DPRINTK(DRV, ERR, "pattern test reg %04X failed: got "
15608 + "0x%08X expected 0x%08X\n",
15609 + E1000_REGISTER(hw, reg), val,
15610 + (_test[pat] & write & mask));
15611 + *data = E1000_REGISTER(hw, reg);
15619 +static bool reg_set_and_check(struct igb_adapter *adapter, u64 *data,
15620 + int reg, u32 mask, u32 write)
15622 + struct e1000_hw *hw = &adapter->hw;
15624 + E1000_WRITE_REG(hw, reg, write & mask);
15625 + val = E1000_READ_REG(hw, reg);
15626 + if ((write & mask) != (val & mask)) {
15627 + DPRINTK(DRV, ERR, "set/check reg %04X test failed: got 0x%08X "
15628 + "expected 0x%08X\n", reg, (val & mask), (write & mask));
15629 + *data = E1000_REGISTER(hw, reg);
15636 +#define REG_PATTERN_TEST(reg, mask, write) \
15638 + if (reg_pattern_test(adapter, data, reg, mask, write)) \
15642 +#define REG_SET_AND_CHECK(reg, mask, write) \
15644 + if (reg_set_and_check(adapter, data, reg, mask, write)) \
15648 +static int igb_reg_test(struct igb_adapter *adapter, u64 *data)
15650 + struct e1000_hw *hw = &adapter->hw;
15651 + struct igb_reg_test *test;
15652 + u32 value, before, after;
15655 + toggle = 0x7FFFF3FF;
15657 + switch (adapter->hw.mac.type) {
15658 + case e1000_82576:
15659 + test = reg_test_82576;
15662 + test = reg_test_82575;
15666 + /* Because the status register is such a special case,
15667 + * we handle it separately from the rest of the register
15668 + * tests. Some bits are read-only, some toggle, and some
15669 + * are writable on newer MACs.
15671 + before = E1000_READ_REG(hw, E1000_STATUS);
15672 + value = (E1000_READ_REG(hw, E1000_STATUS) & toggle);
15673 + E1000_WRITE_REG(hw, E1000_STATUS, toggle);
15674 + after = E1000_READ_REG(hw, E1000_STATUS) & toggle;
15675 + if (value != after) {
15676 + DPRINTK(DRV, ERR, "failed STATUS register test got: "
15677 + "0x%08X expected: 0x%08X\n", after, value);
15681 + /* restore previous status */
15682 + E1000_WRITE_REG(hw, E1000_STATUS, before);
15684 + /* Perform the remainder of the register test, looping through
15685 + * the test table until we either fail or reach the null entry.
15687 + while (test->reg) {
15688 + for (i = 0; i < test->array_len; i++) {
15689 + switch (test->test_type) {
15690 + case PATTERN_TEST:
15691 + REG_PATTERN_TEST(test->reg +
15692 + (i * test->reg_offset),
15696 + case SET_READ_TEST:
15697 + REG_SET_AND_CHECK(test->reg +
15698 + (i * test->reg_offset),
15702 + case WRITE_NO_TEST:
15703 + writel(test->write,
15704 + (adapter->hw.hw_addr + test->reg)
15705 + + (i * test->reg_offset));
15707 + case TABLE32_TEST:
15708 + REG_PATTERN_TEST(test->reg + (i * 4),
15712 + case TABLE64_TEST_LO:
15713 + REG_PATTERN_TEST(test->reg + (i * 8),
15717 + case TABLE64_TEST_HI:
15718 + REG_PATTERN_TEST((test->reg + 4) + (i * 8),
15731 +static int igb_eeprom_test(struct igb_adapter *adapter, u64 *data)
15734 + u16 checksum = 0;
15738 + /* Read and add up the contents of the EEPROM */
15739 + for (i = 0; i < (NVM_CHECKSUM_REG + 1); i++) {
15740 + if ((e1000_read_nvm(&adapter->hw, i, 1, &temp)) < 0) {
15744 + checksum += temp;
15747 + /* If Checksum is not Correct return error else test passed */
15748 + if ((checksum != (u16) NVM_SUM) && !(*data))
15754 +static irqreturn_t igb_test_intr(int irq, void *data)
15756 + struct net_device *netdev = (struct net_device *) data;
15757 + struct igb_adapter *adapter = netdev_priv(netdev);
15758 + struct e1000_hw *hw = &adapter->hw;
15760 + adapter->test_icr |= E1000_READ_REG(hw, E1000_ICR);
15762 + return IRQ_HANDLED;
15765 +static int igb_intr_test(struct igb_adapter *adapter, u64 *data)
15767 + struct e1000_hw *hw = &adapter->hw;
15768 + struct net_device *netdev = adapter->netdev;
15769 + u32 mask, i=0, shared_int = TRUE;
15770 + u32 irq = adapter->pdev->irq;
15774 + /* Hook up test interrupt handler just for this test */
15775 + if (adapter->msix_entries) {
15776 + /* NOTE: we don't test MSI-X interrupts here, yet */
15778 + } else if (adapter->flags & IGB_FLAG_HAS_MSI) {
15779 + shared_int = FALSE;
15780 + if (request_irq(irq, &igb_test_intr, 0, netdev->name, netdev)) {
15784 + } else if (!request_irq(irq, &igb_test_intr, IRQF_PROBE_SHARED,
15785 + netdev->name, netdev)) {
15786 + shared_int = FALSE;
15788 + else if (request_irq(irq, &igb_test_intr, IRQF_SHARED,
15789 + netdev->name, netdev)) {
15793 + DPRINTK(HW, INFO, "testing %s interrupt\n",
15794 + (shared_int ? "shared" : "unshared"));
15796 + /* Disable all the interrupts */
15797 + E1000_WRITE_REG(hw, E1000_IMC, 0xFFFFFFFF);
15800 + /* Test each interrupt */
15801 + for (; i < 10; i++) {
15802 + /* Interrupt to test */
15805 + if (!shared_int) {
15806 + /* Disable the interrupt to be reported in
15807 + * the cause register and then force the same
15808 + * interrupt and see if one gets posted. If
15809 + * an interrupt was posted to the bus, the
15812 + adapter->test_icr = 0;
15813 + E1000_WRITE_REG(hw, E1000_IMC, ~mask & 0x00007FFF);
15814 + E1000_WRITE_REG(hw, E1000_ICS, ~mask & 0x00007FFF);
15817 + if (adapter->test_icr & mask) {
15823 + /* Enable the interrupt to be reported in
15824 + * the cause register and then force the same
15825 + * interrupt and see if one gets posted. If
15826 + * an interrupt was not posted to the bus, the
15829 + adapter->test_icr = 0;
15830 + E1000_WRITE_REG(hw, E1000_IMS, mask);
15831 + E1000_WRITE_REG(hw, E1000_ICS, mask);
15834 + if (!(adapter->test_icr & mask)) {
15839 + if (!shared_int) {
15840 + /* Disable the other interrupts to be reported in
15841 + * the cause register and then force the other
15842 + * interrupts and see if any get posted. If
15843 + * an interrupt was posted to the bus, the
15846 + adapter->test_icr = 0;
15847 + E1000_WRITE_REG(hw, E1000_IMC, ~mask & 0x00007FFF);
15848 + E1000_WRITE_REG(hw, E1000_ICS, ~mask & 0x00007FFF);
15851 + if (adapter->test_icr) {
15858 + /* Disable all the interrupts */
15859 + E1000_WRITE_REG(hw, E1000_IMC, 0xFFFFFFFF);
15862 + /* Unhook test interrupt handler */
15863 + free_irq(irq, netdev);
15868 +static void igb_free_desc_rings(struct igb_adapter *adapter)
15870 + struct igb_ring *tx_ring = &adapter->test_tx_ring;
15871 + struct igb_ring *rx_ring = &adapter->test_rx_ring;
15872 + struct pci_dev *pdev = adapter->pdev;
15875 + if (tx_ring->desc && tx_ring->buffer_info) {
15876 + for (i = 0; i < tx_ring->count; i++) {
15877 + struct igb_buffer *buf = &(tx_ring->buffer_info[i]);
15879 + pci_unmap_single(pdev, buf->dma, buf->length,
15880 + PCI_DMA_TODEVICE);
15882 + dev_kfree_skb(buf->skb);
15886 + if (rx_ring->desc && rx_ring->buffer_info) {
15887 + for (i = 0; i < rx_ring->count; i++) {
15888 + struct igb_buffer *buf = &(rx_ring->buffer_info[i]);
15890 + pci_unmap_single(pdev, buf->dma,
15891 + IGB_RXBUFFER_2048,
15892 + PCI_DMA_FROMDEVICE);
15894 + dev_kfree_skb(buf->skb);
15898 + if (tx_ring->desc) {
15899 + pci_free_consistent(pdev, tx_ring->size, tx_ring->desc,
15901 + tx_ring->desc = NULL;
15903 + if (rx_ring->desc) {
15904 + pci_free_consistent(pdev, rx_ring->size, rx_ring->desc,
15906 + rx_ring->desc = NULL;
15909 + kfree(tx_ring->buffer_info);
15910 + tx_ring->buffer_info = NULL;
15911 + kfree(rx_ring->buffer_info);
15912 + rx_ring->buffer_info = NULL;
15917 +static int igb_setup_desc_rings(struct igb_adapter *adapter)
15919 + struct e1000_hw *hw = &adapter->hw;
15920 + struct igb_ring *tx_ring = &adapter->test_tx_ring;
15921 + struct igb_ring *rx_ring = &adapter->test_rx_ring;
15922 + struct pci_dev *pdev = adapter->pdev;
15926 + /* Setup Tx descriptor ring and Tx buffers */
15928 + if (!tx_ring->count)
15929 + tx_ring->count = IGB_DEFAULT_TXD;
15931 + if (!(tx_ring->buffer_info = kcalloc(tx_ring->count,
15932 + sizeof(struct igb_buffer),
15938 + tx_ring->size = tx_ring->count * sizeof(struct e1000_tx_desc);
15939 + tx_ring->size = ALIGN(tx_ring->size, 4096);
15940 + if (!(tx_ring->desc = pci_alloc_consistent(pdev, tx_ring->size,
15941 + &tx_ring->dma))) {
15945 + tx_ring->next_to_use = tx_ring->next_to_clean = 0;
15947 + E1000_WRITE_REG(hw, E1000_TDBAL(0),
15948 + ((u64) tx_ring->dma & 0x00000000FFFFFFFF));
15949 + E1000_WRITE_REG(hw, E1000_TDBAH(0), ((u64) tx_ring->dma >> 32));
15950 + E1000_WRITE_REG(hw, E1000_TDLEN(0),
15951 + tx_ring->count * sizeof(struct e1000_tx_desc));
15952 + E1000_WRITE_REG(hw, E1000_TDH(0), 0);
15953 + E1000_WRITE_REG(hw, E1000_TDT(0), 0);
15954 + E1000_WRITE_REG(hw, E1000_TCTL,
15955 + E1000_TCTL_PSP | E1000_TCTL_EN |
15956 + E1000_COLLISION_THRESHOLD << E1000_CT_SHIFT |
15957 + E1000_COLLISION_DISTANCE << E1000_COLD_SHIFT);
15959 + for (i = 0; i < tx_ring->count; i++) {
15960 + struct e1000_tx_desc *tx_desc = E1000_TX_DESC(*tx_ring, i);
15961 + struct sk_buff *skb;
15962 + unsigned int size = 1024;
15964 + if (!(skb = alloc_skb(size, GFP_KERNEL))) {
15968 + skb_put(skb, size);
15969 + tx_ring->buffer_info[i].skb = skb;
15970 + tx_ring->buffer_info[i].length = skb->len;
15971 + tx_ring->buffer_info[i].dma =
15972 + pci_map_single(pdev, skb->data, skb->len,
15973 + PCI_DMA_TODEVICE);
15974 + tx_desc->buffer_addr = cpu_to_le64(tx_ring->buffer_info[i].dma);
15975 + tx_desc->lower.data = cpu_to_le32(skb->len);
15976 + tx_desc->lower.data |= cpu_to_le32(E1000_TXD_CMD_EOP |
15977 + E1000_TXD_CMD_IFCS |
15978 + E1000_TXD_CMD_RS);
15979 + tx_desc->upper.data = 0;
15982 + /* Setup Rx descriptor ring and Rx buffers */
15984 + if (!rx_ring->count)
15985 + rx_ring->count = IGB_DEFAULT_RXD;
15987 + if (!(rx_ring->buffer_info = kcalloc(rx_ring->count,
15988 + sizeof(struct igb_buffer),
15994 + rx_ring->size = rx_ring->count * sizeof(struct e1000_rx_desc);
15995 + if (!(rx_ring->desc = pci_alloc_consistent(pdev, rx_ring->size,
15996 + &rx_ring->dma))) {
16000 + rx_ring->next_to_use = rx_ring->next_to_clean = 0;
16002 + rctl = E1000_READ_REG(hw, E1000_RCTL);
16003 + E1000_WRITE_REG(hw, E1000_RCTL, rctl & ~E1000_RCTL_EN);
16004 + E1000_WRITE_REG(hw, E1000_RDBAL(0),
16005 + ((u64) rx_ring->dma & 0xFFFFFFFF));
16006 + E1000_WRITE_REG(hw, E1000_RDBAH(0), ((u64) rx_ring->dma >> 32));
16007 + E1000_WRITE_REG(hw, E1000_RDLEN(0), rx_ring->size);
16008 + E1000_WRITE_REG(hw, E1000_RDH(0), 0);
16009 + E1000_WRITE_REG(hw, E1000_RDT(0), 0);
16010 + rctl = E1000_RCTL_EN | E1000_RCTL_BAM | E1000_RCTL_SZ_2048 |
16011 + E1000_RCTL_LBM_NO | E1000_RCTL_RDMTS_HALF |
16012 + (hw->mac.mc_filter_type << E1000_RCTL_MO_SHIFT);
16013 + E1000_WRITE_REG(hw, E1000_RCTL, rctl);
16014 + E1000_WRITE_REG(hw, E1000_SRRCTL(0), 0);
16016 + for (i = 0; i < rx_ring->count; i++) {
16017 + struct e1000_rx_desc *rx_desc = E1000_RX_DESC(*rx_ring, i);
16018 + struct sk_buff *skb;
16020 + skb = alloc_skb(IGB_RXBUFFER_2048 + NET_IP_ALIGN,
16026 + skb_reserve(skb, NET_IP_ALIGN);
16027 + rx_ring->buffer_info[i].skb = skb;
16028 + rx_ring->buffer_info[i].dma =
16029 + pci_map_single(pdev, skb->data, IGB_RXBUFFER_2048,
16030 + PCI_DMA_FROMDEVICE);
16031 + rx_desc->buffer_addr = cpu_to_le64(rx_ring->buffer_info[i].dma);
16032 + memset(skb->data, 0x00, skb->len);
16038 + igb_free_desc_rings(adapter);
16042 +static void igb_phy_disable_receiver(struct igb_adapter *adapter)
16044 + /* Write out to PHY registers 29 and 30 to disable the Receiver. */
16045 + e1000_write_phy_reg(&adapter->hw, 29, 0x001F);
16046 + e1000_write_phy_reg(&adapter->hw, 30, 0x8FFC);
16047 + e1000_write_phy_reg(&adapter->hw, 29, 0x001A);
16048 + e1000_write_phy_reg(&adapter->hw, 30, 0x8FF0);
16051 +static int igb_integrated_phy_loopback(struct igb_adapter *adapter)
16053 + struct e1000_hw *hw = &adapter->hw;
16054 + u32 ctrl_reg = 0;
16055 + u32 stat_reg = 0;
16057 + hw->mac.autoneg = FALSE;
16059 + if (hw->phy.type == e1000_phy_m88) {
16060 + /* Auto-MDI/MDIX Off */
16061 + e1000_write_phy_reg(hw, M88E1000_PHY_SPEC_CTRL, 0x0808);
16062 + /* reset to update Auto-MDI/MDIX */
16063 + e1000_write_phy_reg(hw, PHY_CONTROL, 0x9140);
16064 + /* autoneg off */
16065 + e1000_write_phy_reg(hw, PHY_CONTROL, 0x8140);
16068 + ctrl_reg = E1000_READ_REG(hw, E1000_CTRL);
16070 + /* force 1000, set loopback */
16071 + e1000_write_phy_reg(hw, PHY_CONTROL, 0x4140);
16073 + /* Now set up the MAC to the same speed/duplex as the PHY. */
16074 + ctrl_reg = E1000_READ_REG(hw, E1000_CTRL);
16075 + ctrl_reg &= ~E1000_CTRL_SPD_SEL; /* Clear the speed sel bits */
16076 + ctrl_reg |= (E1000_CTRL_FRCSPD | /* Set the Force Speed Bit */
16077 + E1000_CTRL_FRCDPX | /* Set the Force Duplex Bit */
16078 + E1000_CTRL_SPD_1000 |/* Force Speed to 1000 */
16079 + E1000_CTRL_FD); /* Force Duplex to FULL */
16081 + if (hw->phy.media_type == e1000_media_type_copper &&
16082 + hw->phy.type == e1000_phy_m88)
16083 + ctrl_reg |= E1000_CTRL_ILOS; /* Invert Loss of Signal */
16085 + /* Set the ILOS bit on the fiber Nic if half duplex link is
16087 + stat_reg = E1000_READ_REG(hw, E1000_STATUS);
16088 + if ((stat_reg & E1000_STATUS_FD) == 0)
16089 + ctrl_reg |= (E1000_CTRL_ILOS | E1000_CTRL_SLU);
16092 + E1000_WRITE_REG(hw, E1000_CTRL, ctrl_reg);
16094 + /* Disable the receiver on the PHY so when a cable is plugged in, the
16095 + * PHY does not begin to autoneg when a cable is reconnected to the NIC.
16097 + if (hw->phy.type == e1000_phy_m88)
16098 + igb_phy_disable_receiver(adapter);
16105 +static int igb_set_phy_loopback(struct igb_adapter *adapter)
16107 + return igb_integrated_phy_loopback(adapter);
16110 +static int igb_setup_loopback_test(struct igb_adapter *adapter)
16112 + struct e1000_hw *hw = &adapter->hw;
16115 + if (hw->phy.media_type == e1000_media_type_fiber ||
16116 + hw->phy.media_type == e1000_media_type_internal_serdes) {
16118 + reg = E1000_READ_REG(hw, E1000_RCTL);
16119 + reg |= E1000_RCTL_LBM_TCVR;
16120 + E1000_WRITE_REG(hw, E1000_RCTL, reg);
16122 + E1000_WRITE_REG(hw, E1000_SCTL, E1000_ENABLE_SERDES_LOOPBACK);
16124 + reg = E1000_READ_REG(hw, E1000_CTRL);
16125 + reg &= ~(E1000_CTRL_RFCE |
16126 + E1000_CTRL_TFCE |
16127 + E1000_CTRL_LRST);
16128 + reg |= E1000_CTRL_SLU |
16130 + E1000_WRITE_REG(hw, E1000_CTRL, reg);
16132 + /* Unset switch control to serdes energy detect */
16133 + reg = E1000_READ_REG(hw, E1000_CONNSW);
16134 + reg &= ~E1000_CONNSW_ENRGSRC;
16135 + E1000_WRITE_REG(hw, E1000_CONNSW, reg);
16137 + /* Set PCS register for forced speed */
16138 + reg = E1000_READ_REG(hw, E1000_PCS_LCTL);
16139 + reg &= ~E1000_PCS_LCTL_AN_ENABLE; /* Disable Autoneg*/
16140 + reg |= E1000_PCS_LCTL_FLV_LINK_UP | /* Force link up */
16141 + E1000_PCS_LCTL_FSV_1000 | /* Force 1000 */
16142 + E1000_PCS_LCTL_FDV_FULL | /* SerDes Full duplex */
16143 + E1000_PCS_LCTL_FSD | /* Force Speed */
16144 + E1000_PCS_LCTL_FORCE_LINK; /* Force Link */
16145 + E1000_WRITE_REG(hw, E1000_PCS_LCTL, reg);
16148 + } else if (hw->phy.media_type == e1000_media_type_copper) {
16149 + return igb_set_phy_loopback(adapter);
16155 +static void igb_loopback_cleanup(struct igb_adapter *adapter)
16157 + struct e1000_hw *hw = &adapter->hw;
16161 + rctl = E1000_READ_REG(hw, E1000_RCTL);
16162 + rctl &= ~(E1000_RCTL_LBM_TCVR | E1000_RCTL_LBM_MAC);
16163 + E1000_WRITE_REG(hw, E1000_RCTL, rctl);
16165 + hw->mac.autoneg = TRUE;
16166 + e1000_read_phy_reg(hw, PHY_CONTROL, &phy_reg);
16167 + if (phy_reg & MII_CR_LOOPBACK) {
16168 + phy_reg &= ~MII_CR_LOOPBACK;
16169 + e1000_write_phy_reg(hw, PHY_CONTROL, phy_reg);
16170 + e1000_phy_commit(hw);
16174 +static void igb_create_lbtest_frame(struct sk_buff *skb,
16175 + unsigned int frame_size)
16177 + memset(skb->data, 0xFF, frame_size);
16178 + frame_size &= ~1;
16179 + memset(&skb->data[frame_size / 2], 0xAA, frame_size / 2 - 1);
16180 + memset(&skb->data[frame_size / 2 + 10], 0xBE, 1);
16181 + memset(&skb->data[frame_size / 2 + 12], 0xAF, 1);
16184 +static int igb_check_lbtest_frame(struct sk_buff *skb, unsigned int frame_size)
16186 + frame_size &= ~1;
16187 + if (*(skb->data + 3) == 0xFF) {
16188 + if ((*(skb->data + frame_size / 2 + 10) == 0xBE) &&
16189 + (*(skb->data + frame_size / 2 + 12) == 0xAF)) {
16196 +static int igb_run_loopback_test(struct igb_adapter *adapter)
16198 + struct e1000_hw *hw = &adapter->hw;
16199 + struct igb_ring *tx_ring = &adapter->test_tx_ring;
16200 + struct igb_ring *rx_ring = &adapter->test_rx_ring;
16201 + struct pci_dev *pdev = adapter->pdev;
16202 + int i, j, k, l, lc, good_cnt, ret_val=0;
16203 + unsigned long time;
16205 + E1000_WRITE_REG(hw, E1000_RDT(0), rx_ring->count - 1);
16207 + /* Calculate the loop count based on the largest descriptor ring
16208 + * The idea is to wrap the largest ring a number of times using 64
16209 + * send/receive pairs during each loop
16212 + if (rx_ring->count <= tx_ring->count)
16213 + lc = ((tx_ring->count / 64) * 2) + 1;
16215 + lc = ((rx_ring->count / 64) * 2) + 1;
16218 + for (j = 0; j <= lc; j++) { /* loop count loop */
16219 + for (i = 0; i < 64; i++) { /* send the packets */
16220 + igb_create_lbtest_frame(tx_ring->buffer_info[k].skb,
16222 + pci_dma_sync_single_for_device(pdev,
16223 + tx_ring->buffer_info[k].dma,
16224 + tx_ring->buffer_info[k].length,
16225 + PCI_DMA_TODEVICE);
16226 + if (unlikely(++k == tx_ring->count)) k = 0;
16228 + E1000_WRITE_REG(hw, E1000_TDT(0), k);
16231 + time = jiffies; /* set the start time for the receive */
16233 + do { /* receive the sent packets */
16234 + pci_dma_sync_single_for_cpu(pdev,
16235 + rx_ring->buffer_info[l].dma,
16236 + IGB_RXBUFFER_2048,
16237 + PCI_DMA_FROMDEVICE);
16239 + ret_val = igb_check_lbtest_frame(
16240 + rx_ring->buffer_info[l].skb, 1024);
16243 + if (unlikely(++l == rx_ring->count)) l = 0;
16244 + /* time + 20 msecs (200 msecs on 2.4) is more than
16245 + * enough time to complete the receives, if it's
16246 + * exceeded, break and error off
16248 + } while (good_cnt < 64 && jiffies < (time + 20));
16249 + if (good_cnt != 64) {
16250 + ret_val = 13; /* ret_val is the same as mis-compare */
16253 + if (jiffies >= (time + 20)) {
16254 + ret_val = 14; /* error code for time out error */
16257 + } /* end loop count loop */
16261 +static int igb_loopback_test(struct igb_adapter *adapter, u64 *data)
16263 + /* PHY loopback cannot be performed if SoL/IDER
16264 + * sessions are active */
16265 + if (e1000_check_reset_block(&adapter->hw)) {
16266 + DPRINTK(DRV, ERR, "Cannot do PHY loopback test "
16267 + "when SoL/IDER is active.\n");
16271 + *data = igb_setup_desc_rings(adapter);
16274 + *data = igb_setup_loopback_test(adapter);
16276 + goto err_loopback;
16277 + *data = igb_run_loopback_test(adapter);
16278 + igb_loopback_cleanup(adapter);
16281 + igb_free_desc_rings(adapter);
16286 +static int igb_link_test(struct igb_adapter *adapter, u64 *data)
16288 + struct e1000_hw *hw = &adapter->hw;
16290 + if (adapter->hw.phy.media_type == e1000_media_type_internal_serdes) {
16292 + adapter->hw.mac.serdes_has_link = FALSE;
16294 + /* On some blade server designs, link establishment
16295 + * could take as long as 2-3 minutes */
16297 + e1000_check_for_link(&adapter->hw);
16298 + if (adapter->hw.mac.serdes_has_link)
16301 + } while (i++ < 3750);
16305 + e1000_check_for_link(&adapter->hw);
16306 + if (adapter->hw.mac.autoneg)
16309 + if (!(E1000_READ_REG(hw, E1000_STATUS) & E1000_STATUS_LU))
16315 +static int igb_diag_test_count(struct net_device *netdev)
16317 + return IGB_TEST_LEN;
16320 +static void igb_diag_test(struct net_device *netdev,
16321 + struct ethtool_test *eth_test, u64 *data)
16323 + struct igb_adapter *adapter = netdev_priv(netdev);
16324 + u16 autoneg_advertised;
16325 + u8 forced_speed_duplex, autoneg;
16326 + bool if_running = netif_running(netdev);
16328 + set_bit(__IGB_TESTING, &adapter->state);
16329 + if (eth_test->flags == ETH_TEST_FL_OFFLINE) {
16330 + /* Offline tests */
16332 + /* save speed, duplex, autoneg settings */
16333 + autoneg_advertised = adapter->hw.phy.autoneg_advertised;
16334 + forced_speed_duplex = adapter->hw.mac.forced_speed_duplex;
16335 + autoneg = adapter->hw.mac.autoneg;
16337 + DPRINTK(HW, INFO, "offline testing starting\n");
16339 + /* Link test performed before hardware reset so autoneg doesn't
16340 + * interfere with test result */
16341 + if (igb_link_test(adapter, &data[4]))
16342 + eth_test->flags |= ETH_TEST_FL_FAILED;
16345 + /* indicate we're in test mode */
16346 + dev_close(netdev);
16348 + igb_reset(adapter);
16350 + if (igb_reg_test(adapter, &data[0]))
16351 + eth_test->flags |= ETH_TEST_FL_FAILED;
16353 + igb_reset(adapter);
16354 + if (igb_eeprom_test(adapter, &data[1]))
16355 + eth_test->flags |= ETH_TEST_FL_FAILED;
16357 + igb_reset(adapter);
16358 + if (igb_intr_test(adapter, &data[2]))
16359 + eth_test->flags |= ETH_TEST_FL_FAILED;
16361 + igb_reset(adapter);
16362 + if (igb_loopback_test(adapter, &data[3]))
16363 + eth_test->flags |= ETH_TEST_FL_FAILED;
16365 + /* restore speed, duplex, autoneg settings */
16366 + adapter->hw.phy.autoneg_advertised = autoneg_advertised;
16367 + adapter->hw.mac.forced_speed_duplex = forced_speed_duplex;
16368 + adapter->hw.mac.autoneg = autoneg;
16370 + /* force this routine to wait until autoneg complete/timeout */
16371 + adapter->hw.phy.autoneg_wait_to_complete = TRUE;
16372 + igb_reset(adapter);
16373 + adapter->hw.phy.autoneg_wait_to_complete = FALSE;
16375 + clear_bit(__IGB_TESTING, &adapter->state);
16377 + dev_open(netdev);
16379 + DPRINTK(HW, INFO, "online testing starting\n");
16380 + /* Online tests */
16381 + if (igb_link_test(adapter, &data[4]))
16382 + eth_test->flags |= ETH_TEST_FL_FAILED;
16384 + /* Online tests aren't run; pass by default */
16390 + clear_bit(__IGB_TESTING, &adapter->state);
16392 + msleep_interruptible(4 * 1000);
16395 +static int igb_wol_exclusion(struct igb_adapter *adapter,
16396 + struct ethtool_wolinfo *wol)
16398 + struct e1000_hw *hw = &adapter->hw;
16399 + int retval = 1; /* fail by default */
16401 + switch (hw->device_id) {
16402 + case E1000_DEV_ID_82575GB_QUAD_COPPER:
16403 + /* WoL not supported */
16404 + wol->supported = 0;
16406 + case E1000_DEV_ID_82575EB_FIBER_SERDES:
16407 + case E1000_DEV_ID_82576_FIBER:
16408 + case E1000_DEV_ID_82576_SERDES:
16409 + /* Wake events not supported on port B */
16410 + if (E1000_READ_REG(hw, E1000_STATUS) & E1000_STATUS_FUNC_1) {
16411 + wol->supported = 0;
16414 + /* return success for non excluded adapter ports */
16418 + /* dual port cards only support WoL on port A from now on
16419 + * unless it was enabled in the eeprom for port B
16420 + * so exclude FUNC_1 ports from having WoL enabled */
16421 + if (E1000_READ_REG(hw, E1000_STATUS) & E1000_STATUS_FUNC_1 &&
16422 + !adapter->eeprom_wol) {
16423 + wol->supported = 0;
16433 +static void igb_get_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)
16435 + struct igb_adapter *adapter = netdev_priv(netdev);
16437 + wol->supported = WAKE_UCAST | WAKE_MCAST |
16438 + WAKE_BCAST | WAKE_MAGIC;
16439 + wol->wolopts = 0;
16441 + /* this function will set ->supported = 0 and return 1 if wol is not
16442 + * supported by this hardware */
16443 + if (igb_wol_exclusion(adapter, wol))
16446 + /* apply any specific unsupported masks here */
16447 + switch (adapter->hw.device_id) {
16452 + if (adapter->wol & E1000_WUFC_EX)
16453 + wol->wolopts |= WAKE_UCAST;
16454 + if (adapter->wol & E1000_WUFC_MC)
16455 + wol->wolopts |= WAKE_MCAST;
16456 + if (adapter->wol & E1000_WUFC_BC)
16457 + wol->wolopts |= WAKE_BCAST;
16458 + if (adapter->wol & E1000_WUFC_MAG)
16459 + wol->wolopts |= WAKE_MAGIC;
16464 +static int igb_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)
16466 + struct igb_adapter *adapter = netdev_priv(netdev);
16467 + struct e1000_hw *hw = &adapter->hw;
16469 + if (wol->wolopts & (WAKE_PHY | WAKE_ARP | WAKE_MAGICSECURE))
16470 + return -EOPNOTSUPP;
16472 + if (igb_wol_exclusion(adapter, wol))
16473 + return wol->wolopts ? -EOPNOTSUPP : 0;
16475 + switch (hw->device_id) {
16480 + /* these settings will always override what we currently have */
16481 + adapter->wol = 0;
16483 + if (wol->wolopts & WAKE_UCAST)
16484 + adapter->wol |= E1000_WUFC_EX;
16485 + if (wol->wolopts & WAKE_MCAST)
16486 + adapter->wol |= E1000_WUFC_MC;
16487 + if (wol->wolopts & WAKE_BCAST)
16488 + adapter->wol |= E1000_WUFC_BC;
16489 + if (wol->wolopts & WAKE_MAGIC)
16490 + adapter->wol |= E1000_WUFC_MAG;
16495 +/* toggle LED 4 times per second = 2 "blinks" per second */
16496 +#define IGB_ID_INTERVAL (HZ/4)
16498 +/* bit defines for adapter->led_status */
16499 +#define IGB_LED_ON 0
16501 +static int igb_phys_id(struct net_device *netdev, u32 data)
16503 + struct igb_adapter *adapter = netdev_priv(netdev);
16504 + struct e1000_hw *hw = &adapter->hw;
16506 + if (!data || data > (u32)(MAX_SCHEDULE_TIMEOUT / HZ))
16507 + data = (u32)(MAX_SCHEDULE_TIMEOUT / HZ);
16509 + e1000_blink_led(hw);
16510 + msleep_interruptible(data * 1000);
16512 + e1000_led_off(hw);
16513 + clear_bit(IGB_LED_ON, &adapter->led_status);
16514 + e1000_cleanup_led(hw);
16519 +static int igb_set_coalesce(struct net_device *netdev,
16520 + struct ethtool_coalesce *ec)
16522 + struct igb_adapter *adapter = netdev_priv(netdev);
16523 + struct e1000_hw *hw = &adapter->hw;
16526 + if ((ec->rx_coalesce_usecs > IGB_MAX_ITR_USECS) ||
16527 + ((ec->rx_coalesce_usecs > 3) &&
16528 + (ec->rx_coalesce_usecs < IGB_MIN_ITR_USECS)) ||
16529 + (ec->rx_coalesce_usecs == 2))
16532 + /* convert to rate of irq's per second */
16533 + if (ec->rx_coalesce_usecs && ec->rx_coalesce_usecs <= 3) {
16534 + adapter->itr = IGB_START_ITR;
16535 + adapter->itr_setting = ec->rx_coalesce_usecs;
16537 + adapter->itr = ec->rx_coalesce_usecs << 2;
16538 + adapter->itr_setting = adapter->itr;
16541 + for (i = 0; i < adapter->num_rx_queues; i++)
16542 + writel(adapter->itr,
16543 + hw->hw_addr + adapter->rx_ring[i].itr_register);
16548 +static int igb_get_coalesce(struct net_device *netdev,
16549 + struct ethtool_coalesce *ec)
16551 + struct igb_adapter *adapter = netdev_priv(netdev);
16553 + if (adapter->itr_setting <= 3)
16554 + ec->rx_coalesce_usecs = adapter->itr_setting;
16556 + ec->rx_coalesce_usecs = adapter->itr_setting >> 2;
16561 +static int igb_nway_reset(struct net_device *netdev)
16563 + struct igb_adapter *adapter = netdev_priv(netdev);
16564 + if (netif_running(netdev))
16565 + igb_reinit_locked(adapter);
16569 +static int igb_get_stats_count(struct net_device *netdev)
16571 + return IGB_STATS_LEN;
16574 +static void igb_get_ethtool_stats(struct net_device *netdev,
16575 + struct ethtool_stats *stats, u64 *data)
16577 + struct igb_adapter *adapter = netdev_priv(netdev);
16579 + int stat_count = sizeof(struct igb_queue_stats) / sizeof(u64);
16583 + int aggregated = 0, flushed = 0, no_desc = 0;
16585 + for (i = 0; i < adapter->num_rx_queues; i++) {
16586 + aggregated += adapter->rx_ring[i].lro_mgr.stats.aggregated;
16587 + flushed += adapter->rx_ring[i].lro_mgr.stats.flushed;
16588 + no_desc += adapter->rx_ring[i].lro_mgr.stats.no_desc;
16590 + adapter->lro_aggregated = aggregated;
16591 + adapter->lro_flushed = flushed;
16592 + adapter->lro_no_desc = no_desc;
16595 + igb_update_stats(adapter);
16597 + for (i = 0; i < IGB_GLOBAL_STATS_LEN; i++) {
16598 + char *p = (char *)adapter+igb_gstrings_stats[i].stat_offset;
16599 + data[i] = (igb_gstrings_stats[i].sizeof_stat ==
16600 + sizeof(u64)) ? *(u64 *)p : *(u32 *)p;
16602 + for (j = 0; j < adapter->num_tx_queues; j++) {
16604 + queue_stat = (u64 *)&adapter->tx_ring[j].tx_stats;
16605 + for (k = 0; k < stat_count; k++)
16606 + data[i + k] = queue_stat[k];
16609 + for (j = 0; j < adapter->num_rx_queues; j++) {
16611 + queue_stat = (u64 *)&adapter->rx_ring[j].rx_stats;
16612 + for (k = 0; k < stat_count; k++)
16613 + data[i + k] = queue_stat[k];
16618 +static void igb_get_strings(struct net_device *netdev, u32 stringset, u8 *data)
16620 + struct igb_adapter *adapter = netdev_priv(netdev);
16624 + switch (stringset) {
16625 + case ETH_SS_TEST:
16626 + memcpy(data, *igb_gstrings_test,
16627 + IGB_TEST_LEN*ETH_GSTRING_LEN);
16629 + case ETH_SS_STATS:
16630 + for (i = 0; i < IGB_GLOBAL_STATS_LEN; i++) {
16631 + memcpy(p, igb_gstrings_stats[i].stat_string,
16632 + ETH_GSTRING_LEN);
16633 + p += ETH_GSTRING_LEN;
16635 + for (i = 0; i < adapter->num_tx_queues; i++) {
16636 + sprintf(p, "tx_queue_%u_packets", i);
16637 + p += ETH_GSTRING_LEN;
16638 + sprintf(p, "tx_queue_%u_bytes", i);
16639 + p += ETH_GSTRING_LEN;
16641 + for (i = 0; i < adapter->num_rx_queues; i++) {
16642 + sprintf(p, "rx_queue_%u_packets", i);
16643 + p += ETH_GSTRING_LEN;
16644 + sprintf(p, "rx_queue_%u_bytes", i);
16645 + p += ETH_GSTRING_LEN;
16647 +/* BUG_ON(p - data != IGB_STATS_LEN * ETH_GSTRING_LEN); */
16652 +static struct ethtool_ops igb_ethtool_ops = {
16653 + .get_settings = igb_get_settings,
16654 + .set_settings = igb_set_settings,
16655 + .get_drvinfo = igb_get_drvinfo,
16656 + .get_regs_len = igb_get_regs_len,
16657 + .get_regs = igb_get_regs,
16658 + .get_wol = igb_get_wol,
16659 + .set_wol = igb_set_wol,
16660 + .get_msglevel = igb_get_msglevel,
16661 + .set_msglevel = igb_set_msglevel,
16662 + .nway_reset = igb_nway_reset,
16663 + .get_link = ethtool_op_get_link,
16664 + .get_eeprom_len = igb_get_eeprom_len,
16665 + .get_eeprom = igb_get_eeprom,
16666 + .set_eeprom = igb_set_eeprom,
16667 + .get_ringparam = igb_get_ringparam,
16668 + .set_ringparam = igb_set_ringparam,
16669 + .get_pauseparam = igb_get_pauseparam,
16670 + .set_pauseparam = igb_set_pauseparam,
16671 + .get_rx_csum = igb_get_rx_csum,
16672 + .set_rx_csum = igb_set_rx_csum,
16673 + .get_tx_csum = igb_get_tx_csum,
16674 + .set_tx_csum = igb_set_tx_csum,
16675 + .get_sg = ethtool_op_get_sg,
16676 + .set_sg = ethtool_op_set_sg,
16677 +#ifdef NETIF_F_TSO
16678 + .get_tso = ethtool_op_get_tso,
16679 + .set_tso = igb_set_tso,
16681 + .self_test_count = igb_diag_test_count,
16682 + .self_test = igb_diag_test,
16683 + .get_strings = igb_get_strings,
16684 + .phys_id = igb_phys_id,
16685 + .get_stats_count = igb_get_stats_count,
16686 + .get_ethtool_stats = igb_get_ethtool_stats,
16687 +#ifdef ETHTOOL_GPERMADDR
16688 + .get_perm_addr = ethtool_op_get_perm_addr,
16690 + .get_coalesce = igb_get_coalesce,
16691 + .set_coalesce = igb_set_coalesce,
16694 +void igb_set_ethtool_ops(struct net_device *netdev)
16696 + SET_ETHTOOL_OPS(netdev, &igb_ethtool_ops);
16698 +#endif /* SIOCETHTOOL */
16699 Binary files vanilla/drivers/net/igb/igb_ethtool.o and linux-i686-2.6.22/drivers/net/igb/igb_ethtool.o differ
16700 diff -Nru vanilla/drivers/net/igb/.igb_ethtool.o.cmd linux-i686-2.6.22/drivers/net/igb/.igb_ethtool.o.cmd
16701 --- vanilla/drivers/net/igb/.igb_ethtool.o.cmd 1969-12-31 19:00:00.000000000 -0500
16702 +++ linux-i686-2.6.22/drivers/net/igb/.igb_ethtool.o.cmd 2009-07-16 19:53:44.000000000 -0400
16704 +cmd_drivers/net/igb/igb_ethtool.o := gcc -m32 -Wp,-MD,drivers/net/igb/.igb_ethtool.o.d -nostdinc -isystem /usr/lib/gcc/i386-redhat-linux/4.1.2/include -D__KERNEL__ -Iinclude -include include/linux/autoconf.h -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Os -pipe -msoft-float -mregparm=3 -freg-struct-return -mpreferred-stack-boundary=2 -march=i686 -mtune=generic -ffreestanding -maccumulate-outgoing-args -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -Iinclude/asm-i386/mach-generic -Iinclude/asm-i386/mach-default -fno-omit-frame-pointer -fno-optimize-sibling-calls -g -fno-stack-protector -Wdeclaration-after-statement -Wno-pointer-sign -DMODULE -D"KBUILD_STR(s)=\#s" -D"KBUILD_BASENAME=KBUILD_STR(igb_ethtool)" -D"KBUILD_MODNAME=KBUILD_STR(igb)" -c -o drivers/net/igb/.tmp_igb_ethtool.o drivers/net/igb/igb_ethtool.c
16706 +deps_drivers/net/igb/igb_ethtool.o := \
16707 + drivers/net/igb/igb_ethtool.c \
16708 + include/linux/netdevice.h \
16709 + $(wildcard include/config/ax25.h) \
16710 + $(wildcard include/config/tr.h) \
16711 + $(wildcard include/config/net/ipip.h) \
16712 + $(wildcard include/config/net/ipgre.h) \
16713 + $(wildcard include/config/ipv6/sit.h) \
16714 + $(wildcard include/config/ipv6/tunnel.h) \
16715 + $(wildcard include/config/wireless/ext.h) \
16716 + $(wildcard include/config/netpoll.h) \
16717 + $(wildcard include/config/net/poll/controller.h) \
16718 + $(wildcard include/config/netpoll/trap.h) \
16719 + $(wildcard include/config/net/dma.h) \
16720 + $(wildcard include/config/bug.h) \
16721 + $(wildcard include/config/proc/fs.h) \
16722 + include/linux/if.h \
16723 + include/linux/types.h \
16724 + $(wildcard include/config/uid16.h) \
16725 + $(wildcard include/config/lbd.h) \
16726 + $(wildcard include/config/lsf.h) \
16727 + $(wildcard include/config/resources/64bit.h) \
16728 + include/linux/posix_types.h \
16729 + include/linux/stddef.h \
16730 + include/linux/compiler.h \
16731 + $(wildcard include/config/enable/must/check.h) \
16732 + include/linux/compiler-gcc4.h \
16733 + $(wildcard include/config/forced/inlining.h) \
16734 + include/linux/compiler-gcc.h \
16735 + include/asm/posix_types.h \
16736 + include/asm/types.h \
16737 + $(wildcard include/config/highmem64g.h) \
16738 + include/linux/socket.h \
16739 + $(wildcard include/config/compat.h) \
16740 + include/asm/socket.h \
16741 + include/asm/sockios.h \
16742 + include/linux/sockios.h \
16743 + include/linux/uio.h \
16744 + include/linux/hdlc/ioctl.h \
16745 + include/linux/if_ether.h \
16746 + $(wildcard include/config/sysctl.h) \
16747 + include/linux/skbuff.h \
16748 + $(wildcard include/config/nf/conntrack.h) \
16749 + $(wildcard include/config/bridge/netfilter.h) \
16750 + $(wildcard include/config/vlan/8021q.h) \
16751 + $(wildcard include/config/net/sched.h) \
16752 + $(wildcard include/config/net/cls/act.h) \
16753 + $(wildcard include/config/network/secmark.h) \
16754 + include/linux/kernel.h \
16755 + $(wildcard include/config/preempt/voluntary.h) \
16756 + $(wildcard include/config/debug/spinlock/sleep.h) \
16757 + $(wildcard include/config/printk.h) \
16758 + $(wildcard include/config/numa.h) \
16759 + /usr/lib/gcc/i386-redhat-linux/4.1.2/include/stdarg.h \
16760 + include/linux/linkage.h \
16761 + include/asm/linkage.h \
16762 + $(wildcard include/config/x86/alignment/16.h) \
16763 + include/linux/bitops.h \
16764 + include/asm/bitops.h \
16765 + include/asm/alternative.h \
16766 + $(wildcard include/config/smp.h) \
16767 + $(wildcard include/config/paravirt.h) \
16768 + include/asm-generic/bitops/sched.h \
16769 + include/asm-generic/bitops/hweight.h \
16770 + include/asm-generic/bitops/fls64.h \
16771 + include/asm-generic/bitops/ext2-non-atomic.h \
16772 + include/asm-generic/bitops/le.h \
16773 + include/asm/byteorder.h \
16774 + $(wildcard include/config/x86/bswap.h) \
16775 + include/linux/byteorder/little_endian.h \
16776 + include/linux/byteorder/swab.h \
16777 + include/linux/byteorder/generic.h \
16778 + include/asm-generic/bitops/minix.h \
16779 + include/linux/log2.h \
16780 + $(wildcard include/config/arch/has/ilog2/u32.h) \
16781 + $(wildcard include/config/arch/has/ilog2/u64.h) \
16782 + include/asm/bug.h \
16783 + $(wildcard include/config/debug/bugverbose.h) \
16784 + include/asm-generic/bug.h \
16785 + $(wildcard include/config/generic/bug.h) \
16786 + include/linux/time.h \
16787 + include/linux/seqlock.h \
16788 + include/linux/spinlock.h \
16789 + $(wildcard include/config/debug/spinlock.h) \
16790 + $(wildcard include/config/preempt.h) \
16791 + $(wildcard include/config/debug/lock/alloc.h) \
16792 + include/linux/preempt.h \
16793 + $(wildcard include/config/debug/preempt.h) \
16794 + include/linux/thread_info.h \
16795 + include/asm/thread_info.h \
16796 + $(wildcard include/config/4kstacks.h) \
16797 + $(wildcard include/config/debug/stack/usage.h) \
16798 + include/asm/page.h \
16799 + $(wildcard include/config/x86/use/3dnow.h) \
16800 + $(wildcard include/config/x86/pae.h) \
16801 + $(wildcard include/config/hugetlb/page.h) \
16802 + $(wildcard include/config/highmem4g.h) \
16803 + $(wildcard include/config/page/offset.h) \
16804 + $(wildcard include/config/flatmem.h) \
16805 + include/asm-generic/pgtable-nopmd.h \
16806 + include/asm-generic/pgtable-nopud.h \
16807 + include/asm-generic/memory_model.h \
16808 + $(wildcard include/config/discontigmem.h) \
16809 + $(wildcard include/config/sparsemem.h) \
16810 + $(wildcard include/config/out/of/line/pfn/to/page.h) \
16811 + include/asm-generic/page.h \
16812 + include/asm/processor.h \
16813 + $(wildcard include/config/x86/ht.h) \
16814 + $(wildcard include/config/mk8.h) \
16815 + $(wildcard include/config/mk7.h) \
16816 + include/asm/vm86.h \
16817 + $(wildcard include/config/vm86.h) \
16818 + include/asm/ptrace.h \
16819 + include/asm/ptrace-abi.h \
16820 + include/asm/segment.h \
16821 + include/asm/math_emu.h \
16822 + include/asm/sigcontext.h \
16823 + include/asm/cpufeature.h \
16824 + include/asm/required-features.h \
16825 + $(wildcard include/config/x86/minimum/cpu.h) \
16826 + $(wildcard include/config/x86/cmov.h) \
16827 + $(wildcard include/config/x86/cmpxchg64.h) \
16828 + include/asm/msr.h \
16829 + include/asm/msr-index.h \
16830 + include/asm/errno.h \
16831 + include/asm-generic/errno.h \
16832 + include/asm-generic/errno-base.h \
16833 + include/linux/errno.h \
16834 + include/asm/system.h \
16835 + $(wildcard include/config/x86/oostore.h) \
16836 + include/asm/cmpxchg.h \
16837 + $(wildcard include/config/x86/cmpxchg.h) \
16838 + include/linux/irqflags.h \
16839 + $(wildcard include/config/trace/irqflags.h) \
16840 + $(wildcard include/config/trace/irqflags/support.h) \
16841 + $(wildcard include/config/x86.h) \
16842 + include/asm/irqflags.h \
16843 + include/asm/processor-flags.h \
16844 + include/linux/cache.h \
16845 + include/asm/cache.h \
16846 + $(wildcard include/config/x86/l1/cache/shift.h) \
16847 + include/linux/threads.h \
16848 + $(wildcard include/config/nr/cpus.h) \
16849 + $(wildcard include/config/base/small.h) \
16850 + include/asm/percpu.h \
16851 + include/linux/cpumask.h \
16852 + $(wildcard include/config/hotplug/cpu.h) \
16853 + include/linux/bitmap.h \
16854 + include/linux/string.h \
16855 + include/asm/string.h \
16856 + include/linux/init.h \
16857 + $(wildcard include/config/modules.h) \
16858 + $(wildcard include/config/hotplug.h) \
16859 + $(wildcard include/config/memory/hotplug.h) \
16860 + $(wildcard include/config/acpi/hotplug/memory.h) \
16861 + include/linux/stringify.h \
16862 + include/linux/bottom_half.h \
16863 + include/linux/spinlock_types.h \
16864 + include/linux/lockdep.h \
16865 + $(wildcard include/config/lockdep.h) \
16866 + $(wildcard include/config/generic/hardirqs.h) \
16867 + $(wildcard include/config/prove/locking.h) \
16868 + include/asm/spinlock_types.h \
16869 + include/asm/spinlock.h \
16870 + $(wildcard include/config/x86/ppro/fence.h) \
16871 + include/asm/atomic.h \
16872 + $(wildcard include/config/m386.h) \
16873 + include/asm-generic/atomic.h \
16874 + include/asm/rwlock.h \
16875 + include/linux/spinlock_api_smp.h \
16876 + include/linux/vs_time.h \
16877 + $(wildcard include/config/vserver/vtime.h) \
16878 + include/linux/net.h \
16879 + include/linux/wait.h \
16880 + include/linux/list.h \
16881 + $(wildcard include/config/debug/list.h) \
16882 + include/linux/poison.h \
16883 + include/linux/prefetch.h \
16884 + include/asm/current.h \
16885 + include/linux/random.h \
16886 + include/linux/ioctl.h \
16887 + include/asm/ioctl.h \
16888 + include/asm-generic/ioctl.h \
16889 + include/linux/sysctl.h \
16890 + $(wildcard include/config/icmp/ipod.h) \
16891 + $(wildcard include/config/web100/net100.h) \
16892 + $(wildcard include/config/web100/stats.h) \
16893 + include/linux/textsearch.h \
16894 + include/linux/module.h \
16895 + $(wildcard include/config/modversions.h) \
16896 + $(wildcard include/config/unused/symbols.h) \
16897 + $(wildcard include/config/module/unload.h) \
16898 + $(wildcard include/config/kallsyms.h) \
16899 + $(wildcard include/config/sysfs.h) \
16900 + include/linux/stat.h \
16901 + include/asm/stat.h \
16902 + include/linux/kmod.h \
16903 + $(wildcard include/config/kmod.h) \
16904 + include/linux/elf.h \
16905 + include/linux/auxvec.h \
16906 + include/asm/auxvec.h \
16907 + include/linux/elf-em.h \
16908 + include/asm/elf.h \
16909 + include/asm/user.h \
16910 + include/asm/desc.h \
16911 + include/asm/ldt.h \
16912 + include/linux/smp.h \
16913 + include/asm/smp.h \
16914 + $(wildcard include/config/x86/local/apic.h) \
16915 + $(wildcard include/config/x86/io/apic.h) \
16916 + include/asm/mpspec.h \
16917 + $(wildcard include/config/acpi.h) \
16918 + include/asm/mpspec_def.h \
16919 + include/asm-i386/mach-generic/mach_mpspec.h \
16920 + include/asm/apic.h \
16921 + $(wildcard include/config/x86/good/apic.h) \
16922 + include/linux/pm.h \
16923 + $(wildcard include/config/pm.h) \
16924 + include/linux/delay.h \
16925 + include/asm/delay.h \
16926 + include/asm/fixmap.h \
16927 + $(wildcard include/config/highmem.h) \
16928 + $(wildcard include/config/x86/visws/apic.h) \
16929 + $(wildcard include/config/x86/f00f/bug.h) \
16930 + $(wildcard include/config/x86/cyclone/timer.h) \
16931 + $(wildcard include/config/pci/mmconfig.h) \
16932 + include/asm/acpi.h \
16933 + $(wildcard include/config/acpi/sleep.h) \
16934 + include/acpi/pdc_intel.h \
16935 + include/asm/apicdef.h \
16936 + include/asm/kmap_types.h \
16937 + $(wildcard include/config/debug/highmem.h) \
16938 + include/asm/io_apic.h \
16939 + include/asm-i386/mach-generic/mach_apicdef.h \
16940 + include/asm/genapic.h \
16941 + include/linux/percpu.h \
16942 + include/linux/slab.h \
16943 + $(wildcard include/config/slab/debug.h) \
16944 + $(wildcard include/config/slab.h) \
16945 + $(wildcard include/config/slub.h) \
16946 + $(wildcard include/config/debug/slab.h) \
16947 + include/linux/gfp.h \
16948 + $(wildcard include/config/zone/dma.h) \
16949 + $(wildcard include/config/zone/dma32.h) \
16950 + include/linux/mmzone.h \
16951 + $(wildcard include/config/force/max/zoneorder.h) \
16952 + $(wildcard include/config/arch/populates/node/map.h) \
16953 + $(wildcard include/config/flat/node/mem/map.h) \
16954 + $(wildcard include/config/have/memory/present.h) \
16955 + $(wildcard include/config/need/node/memmap/size.h) \
16956 + $(wildcard include/config/need/multiple/nodes.h) \
16957 + $(wildcard include/config/have/arch/early/pfn/to/nid.h) \
16958 + $(wildcard include/config/sparsemem/extreme.h) \
16959 + $(wildcard include/config/nodes/span/other/nodes.h) \
16960 + $(wildcard include/config/holes/in/zone.h) \
16961 + include/linux/numa.h \
16962 + $(wildcard include/config/nodes/shift.h) \
16963 + include/linux/nodemask.h \
16964 + include/linux/memory_hotplug.h \
16965 + $(wildcard include/config/have/arch/nodedata/extension.h) \
16966 + include/linux/notifier.h \
16967 + include/linux/mutex.h \
16968 + $(wildcard include/config/debug/mutexes.h) \
16969 + $(wildcard include/config/chopstix.h) \
16970 + include/linux/rwsem.h \
16971 + $(wildcard include/config/rwsem/generic/spinlock.h) \
16972 + include/asm/rwsem.h \
16973 + include/linux/srcu.h \
16974 + include/linux/topology.h \
16975 + $(wildcard include/config/sched/smt.h) \
16976 + $(wildcard include/config/sched/mc.h) \
16977 + include/asm/topology.h \
16978 + include/asm-generic/topology.h \
16979 + include/linux/slab_def.h \
16980 + include/linux/kmalloc_sizes.h \
16981 + include/asm/mmu.h \
16982 + include/asm/semaphore.h \
16983 + include/linux/kobject.h \
16984 + include/linux/sysfs.h \
16985 + include/linux/kref.h \
16986 + include/linux/moduleparam.h \
16987 + include/asm/local.h \
16988 + include/asm/module.h \
16989 + $(wildcard include/config/m486.h) \
16990 + $(wildcard include/config/m586.h) \
16991 + $(wildcard include/config/m586tsc.h) \
16992 + $(wildcard include/config/m586mmx.h) \
16993 + $(wildcard include/config/mcore2.h) \
16994 + $(wildcard include/config/m686.h) \
16995 + $(wildcard include/config/mpentiumii.h) \
16996 + $(wildcard include/config/mpentiumiii.h) \
16997 + $(wildcard include/config/mpentiumm.h) \
16998 + $(wildcard include/config/mpentium4.h) \
16999 + $(wildcard include/config/mk6.h) \
17000 + $(wildcard include/config/x86/elan.h) \
17001 + $(wildcard include/config/mcrusoe.h) \
17002 + $(wildcard include/config/mefficeon.h) \
17003 + $(wildcard include/config/mwinchipc6.h) \
17004 + $(wildcard include/config/mwinchip2.h) \
17005 + $(wildcard include/config/mwinchip3d.h) \
17006 + $(wildcard include/config/mcyrixiii.h) \
17007 + $(wildcard include/config/mviac3/2.h) \
17008 + $(wildcard include/config/mviac7.h) \
17009 + $(wildcard include/config/mgeodegx1.h) \
17010 + $(wildcard include/config/mgeode/lx.h) \
17011 + include/linux/err.h \
17012 + include/net/checksum.h \
17013 + include/asm/uaccess.h \
17014 + $(wildcard include/config/x86/intel/usercopy.h) \
17015 + $(wildcard include/config/x86/wp/works/ok.h) \
17016 + include/asm/checksum.h \
17017 + include/linux/in6.h \
17018 + include/linux/rcupdate.h \
17019 + include/linux/dmaengine.h \
17020 + $(wildcard include/config/dma/engine.h) \
17021 + include/linux/device.h \
17022 + $(wildcard include/config/debug/devres.h) \
17023 + include/linux/ioport.h \
17024 + include/linux/klist.h \
17025 + include/linux/completion.h \
17026 + include/asm/device.h \
17027 + include/linux/hrtimer.h \
17028 + $(wildcard include/config/high/res/timers.h) \
17029 + $(wildcard include/config/timer/stats.h) \
17030 + include/linux/rbtree.h \
17031 + include/linux/ktime.h \
17032 + $(wildcard include/config/ktime/scalar.h) \
17033 + include/linux/jiffies.h \
17034 + include/linux/calc64.h \
17035 + include/asm/div64.h \
17036 + include/linux/timex.h \
17037 + $(wildcard include/config/time/interpolation.h) \
17038 + $(wildcard include/config/no/hz.h) \
17039 + include/asm/param.h \
17040 + $(wildcard include/config/hz.h) \
17041 + include/asm/timex.h \
17042 + include/asm/tsc.h \
17043 + $(wildcard include/config/x86/tsc.h) \
17044 + $(wildcard include/config/x86/generic.h) \
17045 + include/linux/if_packet.h \
17046 + include/linux/timer.h \
17047 + include/linux/interrupt.h \
17048 + $(wildcard include/config/generic/irq/probe.h) \
17049 + include/linux/irqreturn.h \
17050 + include/linux/hardirq.h \
17051 + $(wildcard include/config/preempt/bkl.h) \
17052 + $(wildcard include/config/virt/cpu/accounting.h) \
17053 + include/linux/smp_lock.h \
17054 + $(wildcard include/config/lock/kernel.h) \
17055 + include/linux/sched.h \
17056 + $(wildcard include/config/detect/softlockup.h) \
17057 + $(wildcard include/config/split/ptlock/cpus.h) \
17058 + $(wildcard include/config/keys.h) \
17059 + $(wildcard include/config/bsd/process/acct.h) \
17060 + $(wildcard include/config/taskstats.h) \
17061 + $(wildcard include/config/inotify/user.h) \
17062 + $(wildcard include/config/schedstats.h) \
17063 + $(wildcard include/config/task/delay/acct.h) \
17064 + $(wildcard include/config/blk/dev/io/trace.h) \
17065 + $(wildcard include/config/cc/stackprotector.h) \
17066 + $(wildcard include/config/sysvipc.h) \
17067 + $(wildcard include/config/rt/mutexes.h) \
17068 + $(wildcard include/config/task/xacct.h) \
17069 + $(wildcard include/config/cpusets.h) \
17070 + $(wildcard include/config/fault/injection.h) \
17071 + include/linux/capability.h \
17072 + include/asm/cputime.h \
17073 + include/asm-generic/cputime.h \
17074 + include/linux/sem.h \
17075 + include/linux/ipc.h \
17076 + $(wildcard include/config/ipc/ns.h) \
17077 + include/asm/ipcbuf.h \
17078 + include/asm/sembuf.h \
17079 + include/linux/signal.h \
17080 + include/asm/signal.h \
17081 + include/asm-generic/signal.h \
17082 + include/asm/siginfo.h \
17083 + include/asm-generic/siginfo.h \
17084 + include/linux/securebits.h \
17085 + include/linux/fs_struct.h \
17086 + include/linux/pid.h \
17087 + include/linux/seccomp.h \
17088 + $(wildcard include/config/seccomp.h) \
17089 + include/linux/futex.h \
17090 + $(wildcard include/config/futex.h) \
17091 + include/linux/rtmutex.h \
17092 + $(wildcard include/config/debug/rt/mutexes.h) \
17093 + include/linux/plist.h \
17094 + $(wildcard include/config/debug/pi/list.h) \
17095 + include/linux/param.h \
17096 + include/linux/resource.h \
17097 + include/asm/resource.h \
17098 + include/asm-generic/resource.h \
17099 + include/linux/task_io_accounting.h \
17100 + $(wildcard include/config/task/io/accounting.h) \
17101 + include/linux/aio.h \
17102 + include/linux/workqueue.h \
17103 + include/linux/aio_abi.h \
17104 + include/asm/hardirq.h \
17105 + include/linux/irq.h \
17106 + $(wildcard include/config/s390.h) \
17107 + $(wildcard include/config/irq/per/cpu.h) \
17108 + $(wildcard include/config/irq/release/method.h) \
17109 + $(wildcard include/config/generic/pending/irq.h) \
17110 + $(wildcard include/config/irqbalance.h) \
17111 + $(wildcard include/config/auto/irq/affinity.h) \
17112 + $(wildcard include/config/generic/hardirqs/no//do/irq.h) \
17113 + include/asm/irq.h \
17114 + include/asm-i386/mach-default/irq_vectors.h \
17115 + include/asm-i386/mach-default/irq_vectors_limits.h \
17116 + include/asm/irq_regs.h \
17117 + include/asm/hw_irq.h \
17118 + include/linux/profile.h \
17119 + $(wildcard include/config/profiling.h) \
17120 + include/asm/sections.h \
17121 + include/asm-generic/sections.h \
17122 + include/linux/irq_cpustat.h \
17123 + include/linux/vmalloc.h \
17124 + include/linux/ethtool.h \
17125 + drivers/net/igb/igb.h \
17126 + $(wildcard include/config/dca.h) \
17127 + $(wildcard include/config/inet/lro.h) \
17128 + $(wildcard include/config/igb/separate/tx/handler.h) \
17129 + $(wildcard include/config/igb/disable/packet/split.h) \
17130 + include/linux/pci.h \
17131 + $(wildcard include/config/pci/msi.h) \
17132 + $(wildcard include/config/pci.h) \
17133 + $(wildcard include/config/ht/irq.h) \
17134 + $(wildcard include/config/pci/domains.h) \
17135 + include/linux/pci_regs.h \
17136 + include/linux/mod_devicetable.h \
17137 + include/linux/pci_ids.h \
17138 + include/linux/dmapool.h \
17139 + include/asm/io.h \
17140 + $(wildcard include/config/x86/numaq.h) \
17141 + include/asm-generic/iomap.h \
17142 + include/asm/scatterlist.h \
17143 + include/asm/pci.h \
17144 + include/linux/mm.h \
17145 + $(wildcard include/config/mmu.h) \
17146 + $(wildcard include/config/stack/growsup.h) \
17147 + $(wildcard include/config/debug/vm.h) \
17148 + $(wildcard include/config/shmem.h) \
17149 + $(wildcard include/config/ia64.h) \
17150 + $(wildcard include/config/debug/pagealloc.h) \
17151 + include/linux/prio_tree.h \
17152 + include/linux/fs.h \
17153 + $(wildcard include/config/dnotify.h) \
17154 + $(wildcard include/config/vserver/cowbl.h) \
17155 + $(wildcard include/config/quota.h) \
17156 + $(wildcard include/config/inotify.h) \
17157 + $(wildcard include/config/security.h) \
17158 + $(wildcard include/config/epoll.h) \
17159 + $(wildcard include/config/auditsyscall.h) \
17160 + $(wildcard include/config/block.h) \
17161 + $(wildcard include/config/fs/xip.h) \
17162 + $(wildcard include/config/migration.h) \
17163 + include/linux/limits.h \
17164 + include/linux/kdev_t.h \
17165 + include/linux/dcache.h \
17166 + include/linux/namei.h \
17167 + include/linux/radix-tree.h \
17168 + include/linux/quota.h \
17169 + include/linux/dqblk_xfs.h \
17170 + include/linux/dqblk_v1.h \
17171 + include/linux/dqblk_v2.h \
17172 + include/linux/nfs_fs_i.h \
17173 + include/linux/nfs.h \
17174 + include/linux/sunrpc/msg_prot.h \
17175 + include/linux/fcntl.h \
17176 + include/asm/fcntl.h \
17177 + include/asm-generic/fcntl.h \
17178 + $(wildcard include/config/64bit.h) \
17179 + include/linux/debug_locks.h \
17180 + $(wildcard include/config/debug/locking/api/selftests.h) \
17181 + include/linux/backing-dev.h \
17182 + include/linux/mm_types.h \
17183 + include/asm/pgtable.h \
17184 + $(wildcard include/config/highpte.h) \
17185 + include/asm/paravirt.h \
17186 + include/asm/pgtable-2level-defs.h \
17187 + include/asm/pgtable-2level.h \
17188 + include/asm-generic/pgtable.h \
17189 + include/linux/page-flags.h \
17190 + $(wildcard include/config/swap.h) \
17191 + include/linux/vmstat.h \
17192 + $(wildcard include/config/vm/event/counters.h) \
17193 + include/asm-generic/pci-dma-compat.h \
17194 + include/linux/dma-mapping.h \
17195 + include/asm/dma-mapping.h \
17196 + include/asm-generic/pci.h \
17197 + drivers/net/igb/kcompat.h \
17198 + $(wildcard include/config/e1000/napi.h) \
17199 + $(wildcard include/config/e1000e/napi.h) \
17200 + $(wildcard include/config/ixgb/napi.h) \
17201 + $(wildcard include/config/e1000/disable/packet/split.h) \
17202 + $(wildcard include/config/space/len.h) \
17203 + $(wildcard include/config/netdevices/multiqueue.h) \
17204 + include/linux/version.h \
17205 + include/linux/etherdevice.h \
17206 + include/linux/in.h \
17207 + include/linux/ip.h \
17208 + include/linux/udp.h \
17209 + include/net/inet_sock.h \
17210 + $(wildcard include/config/ipv6.h) \
17211 + include/linux/jhash.h \
17212 + include/net/flow.h \
17213 + $(wildcard include/config/ipv6/mip6.h) \
17214 + include/net/sock.h \
17215 + $(wildcard include/config/security/network.h) \
17216 + include/linux/security.h \
17217 + $(wildcard include/config/security/network/xfrm.h) \
17218 + include/linux/binfmts.h \
17219 + include/linux/shm.h \
17220 + include/asm/shmparam.h \
17221 + include/asm/shmbuf.h \
17222 + include/linux/msg.h \
17223 + include/asm/msgbuf.h \
17224 + include/linux/key.h \
17225 + include/linux/xfrm.h \
17226 + include/linux/filter.h \
17227 + include/net/dst.h \
17228 + $(wildcard include/config/net/cls/route.h) \
17229 + $(wildcard include/config/xfrm.h) \
17230 + include/linux/rtnetlink.h \
17231 + include/linux/netlink.h \
17232 + include/linux/if_link.h \
17233 + include/linux/if_addr.h \
17234 + include/linux/neighbour.h \
17235 + include/net/neighbour.h \
17236 + include/linux/seq_file.h \
17237 + include/net/rtnetlink.h \
17238 + include/net/netlink.h \
17239 + include/net/request_sock.h \
17240 + include/linux/mii.h \
17241 + include/linux/latency.h \
17242 + drivers/net/igb/e1000_api.h \
17243 + drivers/net/igb/e1000_hw.h \
17244 + drivers/net/igb/e1000_osdep.h \
17245 + drivers/net/igb/e1000_regs.h \
17246 + drivers/net/igb/e1000_defines.h \
17247 + $(wildcard include/config/res.h) \
17248 + $(wildcard include/config/fault.h) \
17249 + drivers/net/igb/e1000_mac.h \
17250 + drivers/net/igb/e1000_phy.h \
17251 + drivers/net/igb/e1000_nvm.h \
17252 + drivers/net/igb/e1000_manage.h \
17253 + drivers/net/igb/e1000_82575.h \
17254 + drivers/net/igb/igb_regtest.h \
17255 + include/linux/if_vlan.h \
17257 +drivers/net/igb/igb_ethtool.o: $(deps_drivers/net/igb/igb_ethtool.o)
17259 +$(deps_drivers/net/igb/igb_ethtool.o):
17260 diff -Nru vanilla/drivers/net/igb/igb.h linux-i686-2.6.22/drivers/net/igb/igb.h
17261 --- vanilla/drivers/net/igb/igb.h 1969-12-31 19:00:00.000000000 -0500
17262 +++ linux-i686-2.6.22/drivers/net/igb/igb.h 2009-07-16 19:25:22.000000000 -0400
17264 +/*******************************************************************************
17266 + Intel(R) Gigabit Ethernet Linux driver
17267 + Copyright(c) 2007-2008 Intel Corporation.
17269 + This program is free software; you can redistribute it and/or modify it
17270 + under the terms and conditions of the GNU General Public License,
17271 + version 2, as published by the Free Software Foundation.
17273 + This program is distributed in the hope it will be useful, but WITHOUT
17274 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
17275 + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
17278 + You should have received a copy of the GNU General Public License along with
17279 + this program; if not, write to the Free Software Foundation, Inc.,
17280 + 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
17282 + The full GNU General Public License is included in this distribution in
17283 + the file called "COPYING".
17285 + Contact Information:
17286 + e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
17287 + Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
17289 +*******************************************************************************/
17292 +/* Linux PRO/1000 Ethernet Driver main header file */
17297 +#include <linux/pci.h>
17298 +#include <linux/netdevice.h>
17299 +#include <linux/vmalloc.h>
17301 +#ifdef SIOCETHTOOL
17302 +#include <linux/ethtool.h>
17305 +struct igb_adapter;
17307 +#if defined(CONFIG_DCA) || defined(CONFIG_DCA_MODULE)
17311 +#include <linux/dca.h>
17316 +#ifdef NETIF_F_LRO
17317 +#if defined(CONFIG_INET_LRO) || defined(CONFIG_INET_LRO_MODULE)
17318 +#include <linux/inet_lro.h>
17319 +#define MAX_LRO_DESCRIPTORS 8
17323 +#endif /* IGB_LRO */
17325 +#include "kcompat.h"
17327 +#include "e1000_api.h"
17328 +#include "e1000_82575.h"
17330 +#define IGB_ERR(args...) printk(KERN_ERR "igb: " args)
17332 +#define PFX "igb: "
17333 +#define DPRINTK(nlevel, klevel, fmt, args...) \
17334 + (void)((NETIF_MSG_##nlevel & adapter->msg_enable) && \
17335 + printk(KERN_##klevel PFX "%s: %s: " fmt, adapter->netdev->name, \
17336 + __FUNCTION__ , ## args))
17338 +/* Interrupt defines */
17339 +#define IGB_START_ITR 648 /* ~6000 ints/sec */
17341 +/* Interrupt modes, as used by the IntMode paramter */
17342 +#define IGB_INT_MODE_LEGACY 0
17343 +#define IGB_INT_MODE_MSI 1
17344 +#define IGB_INT_MODE_MSIX_1Q 2
17345 +#define IGB_INT_MODE_MSIX_MQ 3
17348 +/* TX/RX descriptor defines */
17349 +#define IGB_DEFAULT_TXD 256
17350 +#define IGB_MIN_TXD 80
17351 +#define IGB_MAX_TXD 4096
17353 +#define IGB_DEFAULT_RXD 256
17354 +#define IGB_MIN_RXD 80
17355 +#define IGB_MAX_RXD 4096
17357 +#define IGB_MIN_ITR_USECS 10 /* 100k irq/sec */
17358 +#define IGB_MAX_ITR_USECS 10000 /* 100 irq/sec */
17360 +/* Transmit and receive queues */
17361 +#ifndef CONFIG_IGB_SEPARATE_TX_HANDLER
17362 +#define IGB_MAX_RX_QUEUES (hw->mac.type > e1000_82575 ? 8 : 4)
17363 +#define IGB_MAX_TX_QUEUES (hw->mac.type > e1000_82575 ? 8 : 4)
17364 +#define IGB_ABS_MAX_TX_QUEUES 8
17365 +#else /* CONFIG_IGB_SEPARATE_TX_HANDLER */
17366 +#define IGB_MAX_RX_QUEUES 4
17367 +#define IGB_MAX_TX_QUEUES 4
17368 +#define IGB_ABS_MAX_TX_QUEUES 4
17369 +#endif /* CONFIG_IGB_SEPARATE_TX_HANDLER */
17371 +/* RX descriptor control thresholds.
17372 + * PTHRESH - MAC will consider prefetch if it has fewer than this number of
17373 + * descriptors available in its onboard memory.
17374 + * Setting this to 0 disables RX descriptor prefetch.
17375 + * HTHRESH - MAC will only prefetch if there are at least this many descriptors
17376 + * available in host memory.
17377 + * If PTHRESH is 0, this should also be 0.
17378 + * WTHRESH - RX descriptor writeback threshold - MAC will delay writing back
17379 + * descriptors until either it has this many to write back, or the
17380 + * ITR timer expires.
17382 +#define IGB_RX_PTHRESH 16
17383 +#define IGB_RX_HTHRESH 8
17384 +#define IGB_RX_WTHRESH 1
17386 +/* this is the size past which hardware will drop packets when setting LPE=0 */
17387 +#define MAXIMUM_ETHERNET_VLAN_SIZE 1522
17389 +/* Supported Rx Buffer Sizes */
17390 +#define IGB_RXBUFFER_128 128 /* Used for packet split */
17391 +#define IGB_RXBUFFER_256 256 /* Used for packet split */
17392 +#define IGB_RXBUFFER_512 512
17393 +#define IGB_RXBUFFER_1024 1024
17394 +#define IGB_RXBUFFER_2048 2048
17395 +#define IGB_RXBUFFER_4096 4096
17396 +#define IGB_RXBUFFER_8192 8192
17397 +#define IGB_RXBUFFER_16384 16384
17399 +/* Packet Buffer allocations */
17400 +#define IGB_PBA_BYTES_SHIFT 0xA
17401 +#define IGB_TX_HEAD_ADDR_SHIFT 7
17402 +#define IGB_PBA_TX_MASK 0xFFFF0000
17404 +#define IGB_FC_PAUSE_TIME 0x0680 /* 858 usec */
17406 +/* How many Tx Descriptors do we need to call netif_wake_queue ? */
17407 +#define IGB_TX_QUEUE_WAKE 32
17408 +/* How many Rx Buffers do we bundle into one write to the hardware ? */
17409 +#define IGB_RX_BUFFER_WRITE 16 /* Must be power of 2 */
17411 +#define AUTO_ALL_MODES 0
17412 +#define IGB_EEPROM_APME 0x0400
17414 +#ifndef IGB_MASTER_SLAVE
17415 +/* Switch to override PHY master/slave setting */
17416 +#define IGB_MASTER_SLAVE e1000_ms_hw_default
17419 +#define IGB_MNG_VLAN_NONE -1
17421 +/* wrapper around a pointer to a socket buffer,
17422 + * so a DMA handle can be stored along with the buffer */
17423 +struct igb_buffer {
17424 + struct sk_buff *skb;
17429 + unsigned long time_stamp;
17433 +#ifndef CONFIG_IGB_DISABLE_PACKET_SPLIT
17436 + struct page *page;
17438 + unsigned int page_offset;
17444 +struct igb_queue_stats {
17450 + struct igb_adapter *adapter; /* backlink */
17451 + void *desc; /* descriptor ring memory */
17452 + dma_addr_t dma; /* phys address of the ring */
17453 + unsigned int size; /* length of desc. ring in bytes */
17454 + unsigned int count; /* number of desc. in the ring */
17456 + u16 next_to_clean;
17459 + struct igb_buffer *buffer_info; /* array of buffer info structs */
17463 + u16 itr_register;
17467 + unsigned int total_bytes;
17468 + unsigned int total_packets;
17470 + char name[IFNAMSIZ + 5];
17474 + struct igb_queue_stats tx_stats;
17475 + bool detect_tx_hung;
17479 + struct igb_queue_stats rx_stats;
17480 + struct napi_struct napi;
17482 + struct igb_ring *buddy;
17484 + struct net_lro_mgr lro_mgr;
17492 +#define IGB_DESC_UNUSED(R) \
17493 + ((((R)->next_to_clean > (R)->next_to_use) ? 0 : (R)->count) + \
17494 + (R)->next_to_clean - (R)->next_to_use - 1)
17496 +#define E1000_RX_DESC_ADV(R, i) \
17497 + (&(((union e1000_adv_rx_desc *)((R).desc))[i]))
17498 +#define E1000_TX_DESC_ADV(R, i) \
17499 + (&(((union e1000_adv_tx_desc *)((R).desc))[i]))
17500 +#define E1000_TX_CTXTDESC_ADV(R, i) \
17501 + (&(((struct e1000_adv_tx_context_desc *)((R).desc))[i]))
17502 +#define E1000_GET_DESC(R, i, type) (&(((struct type *)((R).desc))[i]))
17503 +#define E1000_TX_DESC(R, i) E1000_GET_DESC(R, i, e1000_tx_desc)
17504 +#define E1000_RX_DESC(R, i) E1000_GET_DESC(R, i, e1000_rx_desc)
17506 +#define MAX_MSIX_COUNT 10
17507 +/* board specific private data structure */
17509 +struct igb_adapter {
17510 + struct timer_list watchdog_timer;
17511 + struct timer_list phy_info_timer;
17512 + struct vlan_group *vlgrp;
17515 + u32 rx_buffer_len;
17521 + unsigned int total_tx_bytes;
17522 + unsigned int total_tx_packets;
17523 + unsigned int total_rx_bytes;
17524 + unsigned int total_rx_packets;
17525 + /* Interrupt Throttle Rate */
17531 + struct work_struct reset_task;
17532 + struct work_struct watchdog_task;
17534 + u8 tx_timeout_factor;
17535 +#ifdef ETHTOOL_PHYS_ID
17536 + struct timer_list blink_timer;
17537 + unsigned long led_status;
17541 + struct igb_ring *tx_ring; /* One per active queue */
17542 + unsigned int restart_queue;
17543 + unsigned long tx_queue_len;
17545 + u32 tx_timeout_count;
17548 + struct igb_ring *rx_ring; /* One per active queue */
17549 + int num_tx_queues;
17550 + int num_rx_queues;
17553 + u64 hw_csum_good;
17554 + u64 rx_hdr_split;
17555 + u32 alloc_rx_buff_failed;
17557 + u16 rx_ps_hdr_size;
17558 + u32 max_frame_size;
17559 + u32 min_frame_size;
17562 + /* OS defined structs */
17563 + struct net_device *netdev;
17564 + struct pci_dev *pdev;
17565 + struct net_device_stats net_stats;
17567 + /* structs defined in e1000_hw.h */
17568 + struct e1000_hw hw;
17569 + struct e1000_hw_stats stats;
17570 + struct e1000_phy_info phy_info;
17571 + struct e1000_phy_stats phy_stats;
17573 +#ifdef ETHTOOL_TEST
17575 + struct igb_ring test_tx_ring;
17576 + struct igb_ring test_rx_ring;
17581 + struct msix_entry *msix_entries;
17583 + u32 eims_enable_mask;
17588 + unsigned long state;
17589 + unsigned int flags;
17591 + u32 *config_space;
17593 + struct igb_ring *multi_tx_table[IGB_ABS_MAX_TX_QUEUES];
17594 +#endif /* HAVE_TX_MQ */
17596 + unsigned int lro_max_aggr;
17597 + unsigned int lro_aggregated;
17598 + unsigned int lro_flushed;
17599 + unsigned int lro_no_desc;
17601 + unsigned int tx_ring_count;
17602 + unsigned int rx_ring_count;
17606 +#define IGB_FLAG_HAS_MSI (1 << 0)
17607 +#define IGB_FLAG_MSI_ENABLE (1 << 1)
17608 +#define IGB_FLAG_HAS_DCA (1 << 2)
17609 +#define IGB_FLAG_DCA_ENABLED (1 << 3)
17610 +#define IGB_FLAG_LLI_PUSH (1 << 4)
17611 +#define IGB_FLAG_IN_NETPOLL (1 << 5)
17612 +#define IGB_FLAG_QUAD_PORT_A (1 << 6)
17613 +#define IGB_FLAG_NEED_CTX_IDX (1 << 7)
17615 +enum e1000_state_t {
17621 +extern char igb_driver_name[];
17622 +extern char igb_driver_version[];
17624 +extern int igb_up(struct igb_adapter *);
17625 +extern void igb_down(struct igb_adapter *);
17626 +extern void igb_reinit_locked(struct igb_adapter *);
17627 +extern void igb_reset(struct igb_adapter *);
17628 +extern int igb_set_spd_dplx(struct igb_adapter *, u16);
17629 +extern int igb_setup_tx_resources(struct igb_adapter *, struct igb_ring *);
17630 +extern int igb_setup_rx_resources(struct igb_adapter *, struct igb_ring *);
17631 +extern void igb_free_tx_resources(struct igb_ring *);
17632 +extern void igb_free_rx_resources(struct igb_ring *);
17633 +extern void igb_update_stats(struct igb_adapter *);
17634 +extern void igb_set_ethtool_ops(struct net_device *);
17635 +extern void igb_check_options(struct igb_adapter *);
17636 +#ifdef ETHTOOL_OPS_COMPAT
17637 +extern int ethtool_ioctl(struct ifreq *);
17640 +#endif /* _IGB_H_ */
17641 diff -Nru vanilla/drivers/net/igb/igb_main.c linux-i686-2.6.22/drivers/net/igb/igb_main.c
17642 --- vanilla/drivers/net/igb/igb_main.c 1969-12-31 19:00:00.000000000 -0500
17643 +++ linux-i686-2.6.22/drivers/net/igb/igb_main.c 2009-07-16 19:25:22.000000000 -0400
17645 +/*******************************************************************************
17647 + Intel(R) Gigabit Ethernet Linux driver
17648 + Copyright(c) 2007-2008 Intel Corporation.
17650 + This program is free software; you can redistribute it and/or modify it
17651 + under the terms and conditions of the GNU General Public License,
17652 + version 2, as published by the Free Software Foundation.
17654 + This program is distributed in the hope it will be useful, but WITHOUT
17655 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
17656 + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
17659 + You should have received a copy of the GNU General Public License along with
17660 + this program; if not, write to the Free Software Foundation, Inc.,
17661 + 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
17663 + The full GNU General Public License is included in this distribution in
17664 + the file called "COPYING".
17666 + Contact Information:
17667 + e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
17668 + Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
17670 +*******************************************************************************/
17672 +#include <linux/module.h>
17673 +#include <linux/types.h>
17674 +#include <linux/init.h>
17675 +#include <linux/vmalloc.h>
17676 +#include <linux/pagemap.h>
17677 +#include <linux/netdevice.h>
17678 +#include <linux/tcp.h>
17679 +#ifdef NETIF_F_TSO
17680 +#include <net/checksum.h>
17681 +#ifdef NETIF_F_TSO6
17682 +#include <linux/ipv6.h>
17683 +#include <net/ip6_checksum.h>
17686 +#ifdef SIOCGMIIPHY
17687 +#include <linux/mii.h>
17689 +#ifdef SIOCETHTOOL
17690 +#include <linux/ethtool.h>
17692 +#include <linux/if_vlan.h>
17697 +#if defined(DEBUG) || defined (DEBUG_DUMP) || defined (DEBUG_ICR) || \
17698 + defined(DEBUG_ITR)
17699 +#define DRV_DEBUG "_debug"
17703 +#define DRV_HW_PERF
17705 +#define DRV_VERSION "1.3.8.6" DRV_DEBUG DRV_HW_PERF
17707 +char igb_driver_name[] = "igb";
17708 +char igb_driver_version[] = DRV_VERSION;
17709 +static const char igb_driver_string[] =
17710 + "Intel(R) Gigabit Ethernet Network Driver";
17711 +static const char igb_copyright[] = "Copyright (c) 2007-2008 Intel Corporation.";
17713 +static struct pci_device_id igb_pci_tbl[] = {
17714 + { PCI_VDEVICE(INTEL, E1000_DEV_ID_82576) },
17715 + { PCI_VDEVICE(INTEL, E1000_DEV_ID_82576_FIBER) },
17716 + { PCI_VDEVICE(INTEL, E1000_DEV_ID_82576_SERDES) },
17717 + { PCI_VDEVICE(INTEL, E1000_DEV_ID_82575EB_COPPER) },
17718 + { PCI_VDEVICE(INTEL, E1000_DEV_ID_82575EB_FIBER_SERDES) },
17719 + { PCI_VDEVICE(INTEL, E1000_DEV_ID_82575GB_QUAD_COPPER) },
17720 + /* required last entry */
17724 +MODULE_DEVICE_TABLE(pci, igb_pci_tbl);
17726 +void igb_reset(struct igb_adapter *);
17727 +static int igb_setup_all_tx_resources(struct igb_adapter *);
17728 +static int igb_setup_all_rx_resources(struct igb_adapter *);
17729 +static void igb_free_all_tx_resources(struct igb_adapter *);
17730 +static void igb_free_all_rx_resources(struct igb_adapter *);
17731 +void igb_update_stats(struct igb_adapter *);
17732 +static int igb_probe(struct pci_dev *, const struct pci_device_id *);
17733 +static void __devexit igb_remove(struct pci_dev *pdev);
17734 +static int igb_sw_init(struct igb_adapter *);
17735 +static int igb_open(struct net_device *);
17736 +static int igb_close(struct net_device *);
17737 +static void igb_configure_tx(struct igb_adapter *);
17738 +static void igb_configure_rx(struct igb_adapter *);
17739 +static void igb_setup_rctl(struct igb_adapter *);
17740 +static void igb_clean_all_tx_rings(struct igb_adapter *);
17741 +static void igb_clean_all_rx_rings(struct igb_adapter *);
17742 +static void igb_clean_tx_ring(struct igb_ring *);
17743 +static void igb_clean_rx_ring(struct igb_ring *);
17744 +static void igb_set_multi(struct net_device *);
17745 +static void igb_update_phy_info(unsigned long);
17746 +static void igb_watchdog(unsigned long);
17747 +static void igb_watchdog_task(struct work_struct *);
17748 +static int igb_xmit_frame_ring_adv(struct sk_buff *, struct net_device *,
17749 + struct igb_ring *);
17750 +static int igb_xmit_frame_adv(struct sk_buff *skb, struct net_device *);
17751 +static struct net_device_stats * igb_get_stats(struct net_device *);
17752 +static int igb_change_mtu(struct net_device *, int);
17753 +static int igb_set_mac(struct net_device *, void *);
17754 +static irqreturn_t igb_intr(int irq, void *);
17755 +static irqreturn_t igb_intr_msi(int irq, void *);
17756 +static irqreturn_t igb_msix_other(int irq, void *);
17757 +static irqreturn_t igb_msix_rx(int irq, void *);
17758 +#ifdef CONFIG_IGB_SEPARATE_TX_HANDLER
17759 +static irqreturn_t igb_msix_tx(int irq, void *);
17761 +static int igb_clean_rx_ring_msix(struct napi_struct *, int);
17763 +static void igb_update_rx_dca(struct igb_ring *);
17764 +static void igb_update_tx_dca(struct igb_ring *);
17765 +static void igb_setup_dca(struct igb_adapter *);
17766 +#endif /* IGB_DCA */
17767 +static bool igb_clean_tx_irq(struct igb_ring *);
17768 +static int igb_poll(struct napi_struct *, int);
17769 +static bool igb_clean_rx_irq_adv(struct igb_ring *, int *, int);
17770 +static void igb_alloc_rx_buffers_adv(struct igb_ring *, int);
17772 +static int igb_get_skb_hdr(struct sk_buff *skb, void **, void **, u64 *, void *);
17774 +static int igb_ioctl(struct net_device *, struct ifreq *, int cmd);
17775 +static void igb_tx_timeout(struct net_device *);
17776 +static void igb_reset_task(struct work_struct *);
17777 +static void igb_vlan_rx_register(struct net_device *, struct vlan_group *);
17778 +static void igb_vlan_rx_add_vid(struct net_device *, u16);
17779 +static void igb_vlan_rx_kill_vid(struct net_device *, u16);
17780 +static void igb_restore_vlan(struct igb_adapter *);
17782 +static int igb_suspend(struct pci_dev *, pm_message_t);
17784 +static int igb_resume(struct pci_dev *);
17786 +#ifndef USE_REBOOT_NOTIFIER
17787 +static void igb_shutdown(struct pci_dev *);
17789 +static int igb_notify_reboot(struct notifier_block *, unsigned long, void *);
17790 +static struct notifier_block igb_notifier_reboot = {
17791 + .notifier_call = igb_notify_reboot,
17797 +static int igb_notify_dca(struct notifier_block *, unsigned long, void *);
17798 +static struct notifier_block dca_notifier = {
17799 + .notifier_call = igb_notify_dca,
17805 +#ifdef CONFIG_NET_POLL_CONTROLLER
17806 +/* for netdump / net console */
17807 +static void igb_netpoll (struct net_device *);
17810 +#ifdef HAVE_PCI_ERS
17811 +static pci_ers_result_t igb_io_error_detected(struct pci_dev *,
17812 + pci_channel_state_t);
17813 +static pci_ers_result_t igb_io_slot_reset(struct pci_dev *);
17814 +static void igb_io_resume(struct pci_dev *);
17816 +static struct pci_error_handlers igb_err_handler = {
17817 + .error_detected = igb_io_error_detected,
17818 + .slot_reset = igb_io_slot_reset,
17819 + .resume = igb_io_resume,
17824 +static struct pci_driver igb_driver = {
17825 + .name = igb_driver_name,
17826 + .id_table = igb_pci_tbl,
17827 + .probe = igb_probe,
17828 + .remove = __devexit_p(igb_remove),
17830 + /* Power Managment Hooks */
17831 + .suspend = igb_suspend,
17832 + .resume = igb_resume,
17834 +#ifndef USE_REBOOT_NOTIFIER
17835 + .shutdown = igb_shutdown,
17837 +#ifdef HAVE_PCI_ERS
17838 + .err_handler = &igb_err_handler
17842 +MODULE_AUTHOR("Intel Corporation, <e1000-devel@lists.sourceforge.net>");
17843 +MODULE_DESCRIPTION("Intel(R) Gigabit Ethernet Network Driver");
17844 +MODULE_LICENSE("GPL");
17845 +MODULE_VERSION(DRV_VERSION);
17847 +static int debug = NETIF_MSG_DRV | NETIF_MSG_PROBE;
17848 +module_param(debug, int, 0);
17849 +MODULE_PARM_DESC(debug, "Debug level (0=none, ..., 16=all)");
17852 + * igb_init_module - Driver Registration Routine
17854 + * igb_init_module is the first routine called when the driver is
17855 + * loaded. All it does is register with the PCI subsystem.
17858 +static int __init igb_init_module(void)
17863 + printk(KERN_INFO "%s - version %s\n",
17864 + igb_driver_string, igb_driver_version);
17866 + printk(KERN_INFO "%s\n", igb_copyright);
17868 + ret = pci_register_driver(&igb_driver);
17869 +#ifdef USE_REBOOT_NOTIFIER
17871 + register_reboot_notifier(&igb_notifier_reboot);
17875 + dca_register_notify(&dca_notifier);
17880 +module_init(igb_init_module);
17883 + * igb_exit_module - Driver Exit Cleanup Routine
17885 + * igb_exit_module is called just before the driver is removed
17889 +static void __exit igb_exit_module(void)
17892 + dca_unregister_notify(&dca_notifier);
17894 +#ifdef USE_REBOOT_NOTIFIER
17895 + unregister_reboot_notifier(&igb_notifier_reboot);
17897 + pci_unregister_driver(&igb_driver);
17900 +module_exit(igb_exit_module);
17903 + * igb_alloc_queues - Allocate memory for all rings
17904 + * @adapter: board private structure to initialize
17906 + * We allocate one ring per queue at run-time since we don't know the
17907 + * number of queues at compile-time.
17910 +static int igb_alloc_queues(struct igb_adapter *adapter)
17914 + adapter->tx_ring = kcalloc(adapter->num_tx_queues,
17915 + sizeof(struct igb_ring), GFP_KERNEL);
17916 + if (!adapter->tx_ring)
17919 + adapter->rx_ring = kcalloc(adapter->num_rx_queues,
17920 + sizeof(struct igb_ring), GFP_KERNEL);
17921 + if (!adapter->rx_ring)
17924 + adapter->rx_ring->buddy = adapter->tx_ring;
17926 + for (i = 0; i < adapter->num_tx_queues; i++) {
17927 + struct igb_ring *ring = &(adapter->tx_ring[i]);
17928 + ring->count = adapter->tx_ring_count;
17929 + ring->adapter = adapter;
17930 + ring->queue_index = i;
17932 + for (i = 0; i < adapter->num_rx_queues; i++) {
17933 + struct igb_ring *ring = &(adapter->rx_ring[i]);
17934 + ring->count = adapter->rx_ring_count;
17935 + ring->adapter = adapter;
17936 + ring->queue_index = i;
17937 + ring->itr_register = E1000_ITR;
17938 + /* set a default napi handler for each rx_ring */
17939 + netif_napi_add(adapter->netdev, &ring->napi, igb_poll, 64);
17941 + return E1000_SUCCESS;
17944 + kfree(adapter->tx_ring);
17945 + kfree(adapter->rx_ring);
17949 +static void igb_free_queues(struct igb_adapter *adapter)
17953 + for (i = 0; i < adapter->num_rx_queues; i++)
17954 + netif_napi_del(&adapter->rx_ring[i].napi);
17956 + kfree(adapter->tx_ring);
17957 + kfree(adapter->rx_ring);
17960 +static void igb_configure_lli(struct igb_adapter *adapter)
17962 + struct e1000_hw *hw = &adapter->hw;
17965 + /* LLI should only be enabled for MSI-X or MSI interrupts */
17966 + if (!adapter->msix_entries && !(adapter->flags & IGB_FLAG_HAS_MSI))
17969 + if (adapter->lli_port) {
17970 + /* use filter 0 for port */
17971 + port = ntohs((u16)adapter->lli_port);
17972 + E1000_WRITE_REG(hw, E1000_IMIR(0),
17973 + (port | E1000_IMIR_PORT_IM_EN));
17974 + E1000_WRITE_REG(hw, E1000_IMIREXT(0),
17975 + (E1000_IMIREXT_SIZE_BP | E1000_IMIREXT_CTRL_BP));
17978 + if (adapter->flags & IGB_FLAG_LLI_PUSH) {
17979 + /* use filter 1 for push flag */
17980 + E1000_WRITE_REG(hw, E1000_IMIR(1),
17981 + (E1000_IMIR_PORT_BP | E1000_IMIR_PORT_IM_EN));
17982 + E1000_WRITE_REG(hw, E1000_IMIREXT(1),
17983 + (E1000_IMIREXT_SIZE_BP | E1000_IMIREXT_CTRL_PSH));
17986 + if (adapter->lli_size) {
17987 + /* use filter 2 for size */
17988 + E1000_WRITE_REG(hw, E1000_IMIR(2),
17989 + (E1000_IMIR_PORT_BP | E1000_IMIR_PORT_IM_EN));
17990 + E1000_WRITE_REG(hw, E1000_IMIREXT(2),
17991 + (adapter->lli_size | E1000_IMIREXT_CTRL_BP));
17996 +#define IGB_N0_QUEUE -1
17998 +static void igb_assign_vector(struct igb_adapter *adapter, int rx_queue,
17999 + int tx_queue, int msix_vector)
18002 + struct e1000_hw *hw = &adapter->hw;
18005 + switch (hw->mac.type) {
18006 + case e1000_82575:
18007 + /* The 82575 assigns vectors using a bitmask, which matches the
18008 + bitmask for the EICR/EIMS/EIMC registers. To assign one
18009 + or more queues to a vector, we write the appropriate bits
18010 + into the MSIXBM register for that vector. */
18011 + if (rx_queue > IGB_N0_QUEUE) {
18012 + msixbm = E1000_EICR_RX_QUEUE0 << rx_queue;
18013 + adapter->rx_ring[rx_queue].eims_value = msixbm;
18015 + if (tx_queue > IGB_N0_QUEUE) {
18016 + msixbm |= E1000_EICR_TX_QUEUE0 << tx_queue;
18017 + adapter->tx_ring[tx_queue].eims_value =
18018 + E1000_EICR_TX_QUEUE0 << tx_queue;
18020 + E1000_WRITE_REG_ARRAY(hw, E1000_MSIXBM(0), msix_vector, msixbm);
18022 + case e1000_82576:
18023 + /* 82576 uses a table-based method for assigning vectors.
18024 + Each queue has a single entry in the table to which we write
18025 + a vector number along with a "valid" bit. Sadly, the layout
18026 + of the table is somewhat counterintuitive. */
18027 + if (rx_queue > IGB_N0_QUEUE) {
18028 + index = (rx_queue & 0x7);
18029 + ivar = E1000_READ_REG_ARRAY(hw, E1000_IVAR0, index);
18030 + if (rx_queue < 8) {
18031 + /* vector goes into low byte of register */
18032 + ivar = ivar & 0xFFFFFF00;
18033 + ivar |= msix_vector | E1000_IVAR_VALID;
18035 + /* vector goes into third byte of register */
18036 + ivar = ivar & 0xFF00FFFF;
18037 + ivar |= (msix_vector | E1000_IVAR_VALID) << 16;
18039 + adapter->rx_ring[rx_queue].eims_value= 1 << msix_vector;
18040 + E1000_WRITE_REG_ARRAY(hw, E1000_IVAR0, index, ivar);
18042 + if (tx_queue > IGB_N0_QUEUE) {
18043 + index = (tx_queue & 0x7);
18044 + ivar = E1000_READ_REG_ARRAY(hw, E1000_IVAR0, index);
18045 + if (tx_queue < 8) {
18046 + /* vector goes into second byte of register */
18047 + ivar = ivar & 0xFFFF00FF;
18048 + ivar |= (msix_vector | E1000_IVAR_VALID) << 8;
18050 + /* vector goes into high byte of register */
18051 + ivar = ivar & 0x00FFFFFF;
18052 + ivar |= (msix_vector | E1000_IVAR_VALID) << 24;
18054 + adapter->tx_ring[tx_queue].eims_value= 1 << msix_vector;
18055 + E1000_WRITE_REG_ARRAY(hw, E1000_IVAR0, index, ivar);
18065 + * igb_configure_msix - Configure MSI-X hardware
18067 + * igb_configure_msix sets up the hardware to properly
18068 + * generate MSI-X interrupts.
18070 +static void igb_configure_msix(struct igb_adapter *adapter)
18073 + int i, vector = 0;
18074 + struct e1000_hw *hw = &adapter->hw;
18076 + adapter->eims_enable_mask = 0;
18077 + if (hw->mac.type == e1000_82576)
18078 + /* Turn on MSI-X capability first, or our settings
18079 + * won't stick. And it will take days to debug. */
18080 + E1000_WRITE_REG(hw, E1000_GPIE, E1000_GPIE_MSIX_MODE |
18081 + E1000_GPIE_PBA | E1000_GPIE_EIAME |
18082 + E1000_GPIE_NSICR);
18084 +#ifdef CONFIG_IGB_SEPARATE_TX_HANDLER
18085 + for (i = 0; i < adapter->num_tx_queues; i++) {
18086 + struct igb_ring *tx_ring = &adapter->tx_ring[i];
18087 + igb_assign_vector(adapter, IGB_N0_QUEUE, i, vector++);
18088 + adapter->eims_enable_mask |= tx_ring->eims_value;
18089 + if (tx_ring->itr_val)
18090 + writel(tx_ring->itr_val,
18091 + hw->hw_addr + tx_ring->itr_register);
18093 + writel(1, hw->hw_addr + tx_ring->itr_register);
18096 + for (i = 0; i < adapter->num_rx_queues; i++) {
18097 + struct igb_ring *rx_ring = &adapter->rx_ring[i];
18098 + rx_ring->buddy = NULL;
18099 + igb_assign_vector(adapter, i, IGB_N0_QUEUE, vector++);
18100 + adapter->eims_enable_mask |= rx_ring->eims_value;
18101 + if (rx_ring->itr_val)
18102 + writel(rx_ring->itr_val,
18103 + hw->hw_addr + rx_ring->itr_register);
18105 + writel(1, hw->hw_addr + rx_ring->itr_register);
18109 + for (i = 0; i < adapter->num_rx_queues; i++) {
18110 + struct igb_ring *rx_ring = &adapter->rx_ring[i];
18111 + if (i < adapter->num_tx_queues) {
18112 + igb_assign_vector(adapter, i, i, vector++);
18113 + rx_ring->buddy = &adapter->tx_ring[i];
18114 + rx_ring->eims_value |= adapter->tx_ring[i].eims_value;
18116 + igb_assign_vector(adapter, i, IGB_N0_QUEUE, vector++);
18118 + adapter->eims_enable_mask |= rx_ring->eims_value;
18119 + if (rx_ring->itr_val)
18120 + writel(rx_ring->itr_val,
18121 + hw->hw_addr + rx_ring->itr_register);
18123 + writel(1, hw->hw_addr + rx_ring->itr_register);
18128 + /* set vector for other causes, i.e. link changes */
18130 + switch (hw->mac.type) {
18131 + case e1000_82575:
18132 + E1000_WRITE_REG_ARRAY(hw, E1000_MSIXBM(0), vector++,
18133 + E1000_EIMS_OTHER);
18135 + tmp = E1000_READ_REG(hw, E1000_CTRL_EXT);
18136 + /* enable MSI-X PBA support*/
18137 + tmp |= E1000_CTRL_EXT_PBA_CLR;
18139 + /* Auto-Mask interrupts upon ICR read. */
18140 + tmp |= E1000_CTRL_EXT_EIAME;
18141 + tmp |= E1000_CTRL_EXT_IRCA;
18143 + E1000_WRITE_REG(hw, E1000_CTRL_EXT, tmp);
18144 + adapter->eims_enable_mask |= E1000_EIMS_OTHER;
18145 + adapter->eims_other = E1000_EIMS_OTHER;
18149 + case e1000_82576:
18150 + tmp = (vector++ | E1000_IVAR_VALID) << 8;
18151 + E1000_WRITE_REG(hw, E1000_IVAR_MISC, tmp);
18153 + adapter->eims_enable_mask = (1 << (vector)) - 1;
18154 + adapter->eims_other = 1 << (vector - 1);
18157 + /* do nothing, since nothing else supports MSI-X */
18159 + } /* switch (hw->mac.type) */
18160 + E1000_WRITE_FLUSH(hw);
18164 + * igb_request_msix - Initialize MSI-X interrupts
18166 + * igb_request_msix allocates MSI-X vectors and requests interrupts from the
18169 +static int igb_request_msix(struct igb_adapter *adapter)
18171 + struct net_device *netdev = adapter->netdev;
18172 + int i, err = 0, vector = 0;
18176 +#ifdef CONFIG_IGB_SEPARATE_TX_HANDLER
18177 + for (i = 0; i < adapter->num_tx_queues; i++) {
18178 + struct igb_ring *ring = &(adapter->tx_ring[i]);
18179 + sprintf(ring->name, "%s-tx%d", netdev->name, i);
18180 + err = request_irq(adapter->msix_entries[vector].vector,
18181 + &igb_msix_tx, 0, ring->name,
18182 + &(adapter->tx_ring[i]));
18185 + ring->itr_register = E1000_EITR(0) + (vector << 2);
18186 + ring->itr_val = 1952; /* ~2000 ints/sec */
18190 + for (i = 0; i < adapter->num_rx_queues; i++) {
18191 + struct igb_ring *ring = &(adapter->rx_ring[i]);
18192 + if (strlen(netdev->name) < (IFNAMSIZ - 5))
18193 +#ifdef CONFIG_IGB_SEPARATE_TX_HANDLER
18194 + sprintf(ring->name, "%s-rx%d", netdev->name, i);
18196 + sprintf(ring->name, "%s-Q%d", netdev->name, i);
18199 + memcpy(ring->name, netdev->name, IFNAMSIZ);
18200 + err = request_irq(adapter->msix_entries[vector].vector,
18201 + &igb_msix_rx, 0, ring->name,
18202 + &(adapter->rx_ring[i]));
18205 + ring->itr_register = E1000_EITR(0) + (vector << 2);
18206 + ring->itr_val = adapter->itr;
18207 + /* overwrite the poll routine for MSIX, we've already done
18208 + * netif_napi_add */
18209 + ring->napi.poll = &igb_clean_rx_ring_msix;
18213 + err = request_irq(adapter->msix_entries[vector].vector,
18214 + &igb_msix_other, 0, netdev->name, netdev);
18219 + igb_configure_msix(adapter);
18225 +static void igb_reset_interrupt_capability(struct igb_adapter *adapter)
18227 + if (adapter->msix_entries) {
18228 + pci_disable_msix(adapter->pdev);
18229 + kfree(adapter->msix_entries);
18230 + adapter->msix_entries = NULL;
18231 + } else if (adapter->flags & IGB_FLAG_HAS_MSI)
18232 + pci_disable_msi(adapter->pdev);
18239 + * igb_set_interrupt_capability - set MSI or MSI-X if supported
18241 + * Attempt to configure interrupts using the best available
18242 + * capabilities of the hardware and kernel.
18244 +static void igb_set_interrupt_capability(struct igb_adapter *adapter)
18250 + switch (adapter->int_mode) {
18251 + case IGB_INT_MODE_MSIX_1Q:
18252 + adapter->num_rx_queues = 1;
18253 + adapter->num_tx_queues = 1;
18254 + case IGB_INT_MODE_MSIX_MQ:
18255 +#ifdef CONFIG_IGB_SEPARATE_TX_HANDLER
18256 + numvecs = adapter->num_tx_queues + adapter->num_rx_queues + 1;
18258 + numvecs = adapter->num_rx_queues + 1;
18260 + adapter->msix_entries = kcalloc(numvecs,
18261 + sizeof(struct msix_entry),
18263 + if (adapter->msix_entries) {
18264 + for (i=0; i < numvecs; i++)
18265 + adapter->msix_entries[i].entry = i;
18267 + err = pci_enable_msix(adapter->pdev,
18268 + adapter->msix_entries, numvecs);
18272 + /* MSI-X failed, so fall through and try MSI */
18273 + DPRINTK(PROBE, WARNING, "Failed to initialize MSI-X interrupts."
18274 + " Falling back to MSI interrupts.\n");
18275 + igb_reset_interrupt_capability(adapter);
18276 + case IGB_INT_MODE_MSI:
18277 + if (!pci_enable_msi(adapter->pdev))
18278 + adapter->flags |= IGB_FLAG_HAS_MSI;
18280 + DPRINTK(PROBE, WARNING, "Failed to initialize MSI "
18281 + "interrupts. Falling back to legacy interrupts.\n");
18282 + /* Fall through */
18283 + case IGB_INT_MODE_LEGACY:
18284 + adapter->num_rx_queues = 1;
18285 + adapter->num_tx_queues = 1;
18286 + /* Don't do anything; this is system default */
18291 + /* Notify the stack of the (possibly) reduced Tx Queue count. */
18292 +#ifdef CONFIG_NETDEVICES_MULTIQUEUE
18293 + adapter->netdev->egress_subqueue_count = adapter->num_tx_queues;
18295 + adapter->netdev->real_num_tx_queues = adapter->num_tx_queues;
18303 + * igb_request_irq - initialize interrupts
18305 + * Attempts to configure interrupts using the best available
18306 + * capabilities of the hardware and kernel.
18308 +static int igb_request_irq(struct igb_adapter *adapter)
18310 + struct net_device *netdev = adapter->netdev;
18311 + struct e1000_hw *hw = &adapter->hw;
18314 + if (adapter->msix_entries) {
18315 + err = igb_request_msix(adapter);
18317 + goto request_done;
18318 + /* fall back to MSI */
18319 + igb_reset_interrupt_capability(adapter);
18320 + if (!pci_enable_msi(adapter->pdev))
18321 + adapter->flags |= IGB_FLAG_HAS_MSI;
18322 + igb_free_all_tx_resources(adapter);
18323 + igb_free_all_rx_resources(adapter);
18324 + adapter->num_rx_queues = 1;
18325 + igb_alloc_queues(adapter);
18327 + switch (hw->mac.type) {
18328 + case e1000_82575:
18329 + E1000_WRITE_REG(hw, E1000_MSIXBM(0),
18330 + (E1000_EICR_RX_QUEUE0 |
18331 + E1000_EIMS_OTHER));
18333 + case e1000_82576:
18334 + E1000_WRITE_REG(hw, E1000_IVAR0, E1000_IVAR_VALID);
18340 + if (adapter->flags & IGB_FLAG_HAS_MSI) {
18341 + err = request_irq(adapter->pdev->irq, &igb_intr_msi, 0,
18342 + netdev->name, netdev);
18344 + goto request_done;
18346 + /* fall back to legacy interrupts */
18347 + igb_reset_interrupt_capability(adapter);
18348 + adapter->flags &= ~IGB_FLAG_HAS_MSI;
18351 + err = request_irq(adapter->pdev->irq, &igb_intr, IRQF_SHARED,
18352 + netdev->name, netdev);
18355 + DPRINTK(PROBE, ERR, "Error %d getting interrupt\n", err);
18356 + goto request_done;
18363 +static void igb_free_irq(struct igb_adapter *adapter)
18365 + struct net_device *netdev = adapter->netdev;
18367 + if (adapter->msix_entries) {
18368 + int vector = 0, i;
18370 +#ifdef CONFIG_IGB_SEPARATE_TX_HANDLER
18371 + for (i = 0; i < adapter->num_tx_queues; i++)
18372 + free_irq(adapter->msix_entries[vector++].vector,
18373 + &(adapter->tx_ring[i]));
18375 + for (i = 0; i < adapter->num_rx_queues; i++)
18376 + free_irq(adapter->msix_entries[vector++].vector,
18377 + &(adapter->rx_ring[i]));
18379 + free_irq(adapter->msix_entries[vector++].vector, netdev);
18383 + free_irq(adapter->pdev->irq, netdev);
18387 + * igb_irq_disable - Mask off interrupt generation on the NIC
18388 + * @adapter: board private structure
18391 +static void igb_irq_disable(struct igb_adapter *adapter)
18393 + struct e1000_hw *hw = &adapter->hw;
18395 + if (adapter->msix_entries) {
18396 + E1000_WRITE_REG(hw, E1000_EIAM, 0);
18397 + E1000_WRITE_REG(hw, E1000_EIMC, ~0);
18398 + E1000_WRITE_REG(hw, E1000_EIAC, 0);
18401 + E1000_WRITE_REG(hw, E1000_IAM, 0);
18402 + E1000_WRITE_REG(hw, E1000_IMC, ~0);
18403 + E1000_WRITE_FLUSH(hw);
18405 + synchronize_irq(adapter->pdev->irq);
18409 + * igb_irq_enable - Enable default interrupt generation settings
18410 + * @adapter: board private structure
18413 +static void igb_irq_enable(struct igb_adapter *adapter)
18415 + struct e1000_hw *hw = &adapter->hw;
18417 + if (adapter->msix_entries) {
18418 + E1000_WRITE_REG(hw, E1000_EIAC, adapter->eims_enable_mask);
18419 + E1000_WRITE_REG(hw, E1000_EIAM, adapter->eims_enable_mask);
18420 + E1000_WRITE_REG(hw, E1000_EIMS, adapter->eims_enable_mask);
18421 + E1000_WRITE_REG(hw, E1000_IMS, E1000_IMS_LSC);
18423 + E1000_WRITE_REG(hw, E1000_IMS, IMS_ENABLE_MASK);
18424 + E1000_WRITE_REG(hw, E1000_IAM, IMS_ENABLE_MASK);
18428 +static void igb_update_mng_vlan(struct igb_adapter *adapter)
18430 + struct net_device *netdev = adapter->netdev;
18431 + u16 vid = adapter->hw.mng_cookie.vlan_id;
18432 + u16 old_vid = adapter->mng_vlan_id;
18433 + if (adapter->vlgrp) {
18434 + if (!vlan_group_get_device(adapter->vlgrp, vid)) {
18435 + if (adapter->hw.mng_cookie.status &
18436 + E1000_MNG_DHCP_COOKIE_STATUS_VLAN) {
18437 + igb_vlan_rx_add_vid(netdev, vid);
18438 + adapter->mng_vlan_id = vid;
18440 + adapter->mng_vlan_id = IGB_MNG_VLAN_NONE;
18442 + if ((old_vid != (u16)IGB_MNG_VLAN_NONE) &&
18443 + (vid != old_vid) &&
18444 + !vlan_group_get_device(adapter->vlgrp, old_vid))
18445 + igb_vlan_rx_kill_vid(netdev, old_vid);
18447 + adapter->mng_vlan_id = vid;
18452 + * igb_release_hw_control - release control of the h/w to f/w
18453 + * @adapter: address of board private structure
18455 + * igb_release_hw_control resets CTRL_EXT:DRV_LOAD bit.
18456 + * For ASF and Pass Through versions of f/w this means that the
18457 + * driver is no longer loaded.
18461 +static void igb_release_hw_control(struct igb_adapter *adapter)
18463 + struct e1000_hw *hw = &adapter->hw;
18466 + /* Let firmware take over control of h/w */
18467 + ctrl_ext = E1000_READ_REG(hw, E1000_CTRL_EXT);
18468 + E1000_WRITE_REG(hw, E1000_CTRL_EXT,
18469 + ctrl_ext & ~E1000_CTRL_EXT_DRV_LOAD);
18474 + * igb_get_hw_control - get control of the h/w from f/w
18475 + * @adapter: address of board private structure
18477 + * igb_get_hw_control sets CTRL_EXT:DRV_LOAD bit.
18478 + * For ASF and Pass Through versions of f/w this means that
18479 + * the driver is loaded.
18483 +static void igb_get_hw_control(struct igb_adapter *adapter)
18485 + struct e1000_hw *hw = &adapter->hw;
18488 + /* Let firmware know the driver has taken over */
18489 + ctrl_ext = E1000_READ_REG(hw, E1000_CTRL_EXT);
18490 + E1000_WRITE_REG(hw, E1000_CTRL_EXT,
18491 + ctrl_ext | E1000_CTRL_EXT_DRV_LOAD);
18495 + * igb_configure - configure the hardware for RX and TX
18496 + * @adapter: private board structure
18498 +static void igb_configure(struct igb_adapter *adapter)
18500 + struct net_device *netdev = adapter->netdev;
18503 + igb_get_hw_control(adapter);
18504 + igb_set_multi(netdev);
18506 + igb_restore_vlan(adapter);
18508 + igb_configure_tx(adapter);
18509 + igb_setup_rctl(adapter);
18510 + igb_configure_rx(adapter);
18512 + e1000_rx_fifo_flush_82575(&adapter->hw);
18513 +#ifdef CONFIG_NETDEVICES_MULTIQUEUE
18514 + if (adapter->num_tx_queues > 1)
18515 + netdev->features |= NETIF_F_MULTI_QUEUE;
18517 + netdev->features &= ~NETIF_F_MULTI_QUEUE;
18520 + /* call IGB_DESC_UNUSED which always leaves
18521 + * at least 1 descriptor unused to make sure
18522 + * next_to_use != next_to_clean */
18523 + for (i = 0; i < adapter->num_rx_queues; i++) {
18524 + struct igb_ring *ring = &adapter->rx_ring[i];
18525 + igb_alloc_rx_buffers_adv(ring, IGB_DESC_UNUSED(ring));
18528 + adapter->tx_queue_len = netdev->tx_queue_len;
18533 + * igb_up - Open the interface and prepare it to handle traffic
18534 + * @adapter: board private structure
18537 +int igb_up(struct igb_adapter *adapter)
18539 + struct e1000_hw *hw = &adapter->hw;
18542 + /* hardware has been reset, we need to reload some things */
18543 + igb_configure(adapter);
18545 + clear_bit(__IGB_DOWN, &adapter->state);
18547 + for (i = 0; i < adapter->num_rx_queues; i++)
18548 + napi_enable(&adapter->rx_ring[i].napi);
18549 + if (adapter->msix_entries)
18550 + igb_configure_msix(adapter);
18552 + igb_configure_lli(adapter);
18554 + /* Clear any pending interrupts. */
18555 + E1000_READ_REG(hw, E1000_ICR);
18556 + igb_irq_enable(adapter);
18558 + /* Fire a link change interrupt to start the watchdog. */
18559 + E1000_WRITE_REG(hw, E1000_ICS, E1000_ICS_LSC);
18563 +void igb_down(struct igb_adapter *adapter)
18565 + struct net_device *netdev = adapter->netdev;
18566 + struct e1000_hw *hw = &adapter->hw;
18570 + /* signal that we're down so the interrupt handler does not
18571 + * reschedule our watchdog timer */
18572 + set_bit(__IGB_DOWN, &adapter->state);
18574 + /* disable receives in the hardware */
18575 + rctl = E1000_READ_REG(hw, E1000_RCTL);
18576 + E1000_WRITE_REG(hw, E1000_RCTL, rctl & ~E1000_RCTL_EN);
18577 + /* flush and sleep below */
18579 + netif_tx_stop_all_queues(netdev);
18581 + /* disable transmits in the hardware */
18582 + tctl = E1000_READ_REG(hw, E1000_TCTL);
18583 + tctl &= ~E1000_TCTL_EN;
18584 + E1000_WRITE_REG(hw, E1000_TCTL, tctl);
18585 + /* flush both disables and wait for them to finish */
18586 + E1000_WRITE_FLUSH(hw);
18589 + for (i = 0; i < adapter->num_rx_queues; i++)
18590 + napi_disable(&adapter->rx_ring[i].napi);
18592 + igb_irq_disable(adapter);
18594 + del_timer_sync(&adapter->watchdog_timer);
18595 + del_timer_sync(&adapter->phy_info_timer);
18597 + netdev->tx_queue_len = adapter->tx_queue_len;
18598 + netif_carrier_off(netdev);
18600 + /* record the stats before reset*/
18601 + igb_update_stats(adapter);
18603 + adapter->link_speed = 0;
18604 + adapter->link_duplex = 0;
18606 +#ifdef HAVE_PCI_ERS
18607 + if (!pci_channel_offline(adapter->pdev))
18608 + igb_reset(adapter);
18610 + igb_reset(adapter);
18612 + igb_clean_all_tx_rings(adapter);
18613 + igb_clean_all_rx_rings(adapter);
18616 +void igb_reinit_locked(struct igb_adapter *adapter)
18618 + WARN_ON(in_interrupt());
18619 + while (test_and_set_bit(__IGB_RESETTING, &adapter->state))
18622 + igb_down(adapter);
18624 + clear_bit(__IGB_RESETTING, &adapter->state);
18627 +void igb_reset(struct igb_adapter *adapter)
18629 + struct e1000_hw *hw = &adapter->hw;
18630 + struct e1000_mac_info *mac = &hw->mac;
18631 + struct e1000_fc_info *fc = &hw->fc;
18632 + u32 pba = 0, tx_space, min_tx_space, min_rx_space;
18635 + /* Repartition Pba for greater than 9k mtu
18636 + * To take effect CTRL.RST is required.
18638 + if (mac->type != e1000_82576) {
18639 + pba = E1000_PBA_34K;
18642 + pba = E1000_PBA_64K;
18645 + if ((adapter->max_frame_size > ETH_FRAME_LEN + ETH_FCS_LEN) &&
18646 + (mac->type < e1000_82576)) {
18647 + /* adjust PBA for jumbo frames */
18648 + E1000_WRITE_REG(hw, E1000_PBA, pba);
18650 + /* To maintain wire speed transmits, the Tx FIFO should be
18651 + * large enough to accommodate two full transmit packets,
18652 + * rounded up to the next 1KB and expressed in KB. Likewise,
18653 + * the Rx FIFO should be large enough to accommodate at least
18654 + * one full receive packet and is similarly rounded up and
18655 + * expressed in KB. */
18656 + pba = E1000_READ_REG(hw, E1000_PBA);
18657 + /* upper 16 bits has Tx packet buffer allocation size in KB */
18658 + tx_space = pba >> 16;
18659 + /* lower 16 bits has Rx packet buffer allocation size in KB */
18661 + /* the tx fifo also stores 16 bytes of information about the tx
18662 + * but don't include ethernet FCS because hardware appends it */
18663 + min_tx_space = (adapter->max_frame_size +
18664 + sizeof(struct e1000_tx_desc) -
18665 + ETH_FCS_LEN) * 2;
18666 + min_tx_space = ALIGN(min_tx_space, 1024);
18667 + min_tx_space >>= 10;
18668 + /* software strips receive CRC, so leave room for it */
18669 + min_rx_space = adapter->max_frame_size;
18670 + min_rx_space = ALIGN(min_rx_space, 1024);
18671 + min_rx_space >>= 10;
18673 + /* If current Tx allocation is less than the min Tx FIFO size,
18674 + * and the min Tx FIFO size is less than the current Rx FIFO
18675 + * allocation, take space away from current Rx allocation */
18676 + if (tx_space < min_tx_space &&
18677 + ((min_tx_space - tx_space) < pba)) {
18678 + pba = pba - (min_tx_space - tx_space);
18680 + /* if short on rx space, rx wins and must trump tx
18682 + if (pba < min_rx_space)
18683 + pba = min_rx_space;
18685 + E1000_WRITE_REG(hw, E1000_PBA, pba);
18688 + /* flow control settings */
18689 + /* The high water mark must be low enough to fit one full frame
18690 + * (or the size used for early receive) above it in the Rx FIFO.
18691 + * Set it to the lower of:
18692 + * - 90% of the Rx FIFO size, or
18693 + * - the full Rx FIFO size minus one full frame */
18694 + hwm = min(((pba << 10) * 9 / 10),
18695 + ((pba << 10) - 2 * adapter->max_frame_size));
18697 + if (mac->type < e1000_82576) {
18698 + fc->high_water = hwm & 0xFFF8; /* 8-byte granularity */
18699 + fc->low_water = fc->high_water - 8;
18701 + fc->high_water = hwm & 0xFFF0; /* 16-byte granularity */
18702 + fc->low_water = fc->high_water - 16;
18704 + fc->pause_time = 0xFFFF;
18705 + fc->send_xon = 1;
18706 + fc->type = fc->original_type;
18708 + /* Allow time for pending master requests to run */
18709 + e1000_reset_hw(hw);
18710 + E1000_WRITE_REG(hw, E1000_WUC, 0);
18712 + if (e1000_init_hw(hw))
18713 + DPRINTK(PROBE, ERR, "Hardware Error\n");
18714 + igb_update_mng_vlan(adapter);
18716 + /* Enable h/w to recognize an 802.1Q VLAN Ethernet packet */
18717 + E1000_WRITE_REG(hw, E1000_VET, ETHERNET_IEEE_VLAN_TYPE);
18719 + e1000_get_phy_info(hw);
18723 + * igb_probe - Device Initialization Routine
18724 + * @pdev: PCI device information struct
18725 + * @ent: entry in igb_pci_tbl
18727 + * Returns 0 on success, negative on failure
18729 + * igb_probe initializes an adapter identified by a pci_dev structure.
18730 + * The OS initialization, configuring of the adapter private structure,
18731 + * and a hardware reset occur.
18734 +static int __devinit igb_probe(struct pci_dev *pdev,
18735 + const struct pci_device_id *ent)
18737 + struct net_device *netdev;
18738 + struct igb_adapter *adapter;
18739 + struct e1000_hw *hw;
18740 + struct pci_dev *us_dev;
18742 + static int cards_found = 0;
18743 + int i, err, pci_using_dac, pos;
18744 + u16 eeprom_data = 0, state = 0;
18745 + u16 eeprom_apme_mask = IGB_EEPROM_APME;
18746 + err = pci_enable_device(pdev);
18750 + pci_using_dac = 0;
18751 + err = pci_set_dma_mask(pdev, DMA_64BIT_MASK);
18753 + err = pci_set_consistent_dma_mask(pdev, DMA_64BIT_MASK);
18755 + pci_using_dac = 1;
18757 + err = pci_set_dma_mask(pdev, DMA_32BIT_MASK);
18759 + err = pci_set_consistent_dma_mask(pdev, DMA_32BIT_MASK);
18761 + IGB_ERR("No usable DMA configuration, "
18768 + /* 82575 requires that the pci-e link partner disable the L0s state */
18769 + switch (pdev->device) {
18770 + case E1000_DEV_ID_82575EB_COPPER:
18771 + case E1000_DEV_ID_82575EB_FIBER_SERDES:
18772 + case E1000_DEV_ID_82575GB_QUAD_COPPER:
18773 + us_dev = pdev->bus->self;
18774 + pos = pci_find_capability(us_dev, PCI_CAP_ID_EXP);
18776 + pci_read_config_word(us_dev, pos + PCI_EXP_LNKCTL, &state);
18777 + state &= ~PCIE_LINK_STATE_L0S;
18778 + pci_write_config_word(us_dev, pos + PCI_EXP_LNKCTL, state);
18779 + printk(KERN_INFO "Disabling ASPM L0s upstream switch "
18780 + "port %x:%x.%x\n", us_dev->bus->number,
18781 + PCI_SLOT(us_dev->devfn), PCI_FUNC(us_dev->devfn));
18787 + err = pci_request_selected_regions(pdev,
18788 + pci_select_bars(pdev,
18790 + igb_driver_name);
18792 + goto err_pci_reg;
18794 + pci_set_master(pdev);
18798 + netdev = alloc_etherdev_mq(sizeof(struct igb_adapter), IGB_ABS_MAX_TX_QUEUES);
18800 + netdev = alloc_etherdev(sizeof(struct igb_adapter));
18801 +#endif /* HAVE_TX_MQ */
18803 + goto err_alloc_etherdev;
18805 + SET_MODULE_OWNER(netdev);
18806 + SET_NETDEV_DEV(netdev, &pdev->dev);
18808 + pci_set_drvdata(pdev, netdev);
18809 + adapter = netdev_priv(netdev);
18810 + adapter->netdev = netdev;
18811 + adapter->pdev = pdev;
18812 + hw = &adapter->hw;
18813 + hw->back = adapter;
18814 + adapter->msg_enable = (1 << debug) - 1;
18816 +#ifdef HAVE_PCI_ERS
18817 + err = pci_save_state(pdev);
18819 + goto err_ioremap;
18822 + hw->hw_addr = ioremap(pci_resource_start(pdev, 0),
18823 + pci_resource_len(pdev, 0));
18824 + if (!hw->hw_addr)
18825 + goto err_ioremap;
18827 + netdev->open = &igb_open;
18828 + netdev->stop = &igb_close;
18829 + netdev->get_stats = &igb_get_stats;
18830 + netdev->set_multicast_list = &igb_set_multi;
18831 + netdev->set_mac_address = &igb_set_mac;
18832 + netdev->change_mtu = &igb_change_mtu;
18833 + netdev->do_ioctl = &igb_ioctl;
18834 + igb_set_ethtool_ops(netdev);
18835 +#ifdef HAVE_TX_TIMEOUT
18836 + netdev->tx_timeout = &igb_tx_timeout;
18837 + netdev->watchdog_timeo = 5 * HZ;
18839 + netdev->vlan_rx_register = igb_vlan_rx_register;
18840 + netdev->vlan_rx_add_vid = igb_vlan_rx_add_vid;
18841 + netdev->vlan_rx_kill_vid = igb_vlan_rx_kill_vid;
18842 +#ifdef CONFIG_NET_POLL_CONTROLLER
18843 + netdev->poll_controller = igb_netpoll;
18845 + netdev->hard_start_xmit = &igb_xmit_frame_adv;
18847 + strncpy(netdev->name, pci_name(pdev), sizeof(netdev->name) - 1);
18849 + adapter->bd_number = cards_found;
18851 + igb_check_options(adapter);
18853 + /* setup the private structure */
18854 + err = igb_sw_init(adapter);
18856 + goto err_sw_init;
18858 + e1000_get_bus_info(hw);
18861 + switch (hw->mac.type) {
18862 + case e1000_82576:
18863 + /* Fall through */
18864 + case e1000_82575:
18865 + adapter->flags |= IGB_FLAG_HAS_DCA;
18866 + adapter->flags |= IGB_FLAG_NEED_CTX_IDX;
18872 + hw->phy.autoneg_wait_to_complete = FALSE;
18873 + hw->mac.adaptive_ifs = FALSE;
18875 + /* Copper options */
18876 + if (hw->phy.media_type == e1000_media_type_copper) {
18877 + hw->phy.mdix = AUTO_ALL_MODES;
18878 + hw->phy.disable_polarity_correction = FALSE;
18879 + hw->phy.ms_type = e1000_ms_hw_default;
18882 + if (e1000_check_reset_block(hw))
18883 + DPRINTK(PROBE, INFO,
18884 + "PHY reset is blocked due to SOL/IDER session.\n");
18886 + netdev->features = NETIF_F_SG |
18887 + NETIF_F_IP_CSUM |
18888 + NETIF_F_HW_VLAN_TX |
18889 + NETIF_F_HW_VLAN_RX |
18890 + NETIF_F_HW_VLAN_FILTER;
18892 +#ifdef NETIF_F_IPV6_CSUM
18893 + netdev->features |= NETIF_F_IPV6_CSUM;
18896 +#ifdef NETIF_F_TSO
18897 + netdev->features |= NETIF_F_TSO;
18899 +#ifdef NETIF_F_TSO6
18900 + netdev->features |= NETIF_F_TSO6;
18902 +#endif /* NETIF_F_TSO */
18905 + netdev->features |= NETIF_F_LRO;
18906 +#endif /* IGB_LRO */
18908 + if (pci_using_dac)
18909 + netdev->features |= NETIF_F_HIGHDMA;
18911 + adapter->en_mng_pt = e1000_enable_mng_pass_thru(hw);
18913 + /* before reading the NVM, reset the controller to put the device in a
18914 + * known good starting state */
18915 + e1000_reset_hw(hw);
18917 + /* make sure the NVM is good */
18918 + if (e1000_validate_nvm_checksum(hw) < 0) {
18919 + DPRINTK(PROBE, ERR, "The NVM Checksum Is Not Valid\n");
18924 + /* copy the MAC address out of the NVM */
18925 + if (e1000_read_mac_addr(hw))
18926 + DPRINTK(PROBE, ERR, "NVM Read Error\n");
18927 + memcpy(netdev->dev_addr, hw->mac.addr, netdev->addr_len);
18928 +#ifdef ETHTOOL_GPERMADDR
18929 + memcpy(netdev->perm_addr, hw->mac.addr, netdev->addr_len);
18931 + if (!is_valid_ether_addr(netdev->perm_addr)) {
18933 + if (!is_valid_ether_addr(netdev->dev_addr)) {
18935 + DPRINTK(PROBE, ERR, "Invalid MAC Address\n");
18940 + init_timer(&adapter->watchdog_timer);
18941 + adapter->watchdog_timer.function = &igb_watchdog;
18942 + adapter->watchdog_timer.data = (unsigned long) adapter;
18944 + init_timer(&adapter->phy_info_timer);
18945 + adapter->phy_info_timer.function = &igb_update_phy_info;
18946 + adapter->phy_info_timer.data = (unsigned long) adapter;
18948 + INIT_WORK(&adapter->reset_task, igb_reset_task);
18949 + INIT_WORK(&adapter->watchdog_task, igb_watchdog_task);
18951 + /* Initialize link properties that are user-changeable */
18952 + adapter->fc_autoneg = true;
18953 + hw->mac.autoneg = true;
18954 + hw->phy.autoneg_advertised = 0x2f;
18956 + hw->fc.original_type = e1000_fc_default;
18957 + hw->fc.type = e1000_fc_default;
18959 + e1000_validate_mdi_setting(hw);
18961 + adapter->rx_csum = 1;
18963 + /* Initial Wake on LAN setting If APM wake is enabled in the EEPROM,
18964 + * enable the ACPI Magic Packet filter
18967 + if (hw->bus.func == 0)
18968 + e1000_read_nvm(hw, NVM_INIT_CONTROL3_PORT_A, 1, &eeprom_data);
18969 + else if(hw->bus.func == 1)
18970 + e1000_read_nvm(hw, NVM_INIT_CONTROL3_PORT_B, 1, &eeprom_data);
18972 + if (eeprom_data & eeprom_apme_mask)
18973 + adapter->eeprom_wol |= E1000_WUFC_MAG;
18975 + /* now that we have the eeprom settings, apply the special cases where
18976 + * the eeprom may be wrong or the board simply won't support wake on
18977 + * lan on a particular port */
18978 + switch (pdev->device) {
18979 + case E1000_DEV_ID_82575GB_QUAD_COPPER:
18980 + adapter->eeprom_wol = 0;
18982 + case E1000_DEV_ID_82575EB_FIBER_SERDES:
18983 + case E1000_DEV_ID_82576_FIBER:
18984 + case E1000_DEV_ID_82576_SERDES:
18985 + /* Wake events only supported on port A for dual fiber
18986 + * regardless of eeprom setting */
18987 + if (E1000_READ_REG(hw, E1000_STATUS) &
18988 + E1000_STATUS_FUNC_1)
18989 + adapter->eeprom_wol = 0;
18993 + /* initialize the wol settings based on the eeprom settings */
18994 + adapter->wol = adapter->eeprom_wol;
18996 + /* reset the hardware with the new settings */
18997 + igb_reset(adapter);
18999 + /* let the f/w know that the h/w is now under the control of the
19001 + igb_get_hw_control(adapter);
19003 + /* tell the stack to leave us alone until igb_open() is called */
19004 + netif_carrier_off(netdev);
19005 + netif_tx_stop_all_queues(netdev);
19007 + strcpy(netdev->name, "eth%d");
19008 + err = register_netdev(netdev);
19010 + goto err_register;
19013 + if (adapter->flags & IGB_FLAG_HAS_DCA) {
19014 + if (dca_add_requester(&pdev->dev) == E1000_SUCCESS) {
19015 + adapter->flags |= IGB_FLAG_DCA_ENABLED;
19016 + DPRINTK(PROBE, INFO, "DCA enabled\n");
19017 + /* Always use CB2 mode, difference is masked
19018 + * in the CB driver. */
19019 + E1000_WRITE_REG(hw, E1000_DCA_CTRL, 2);
19020 + igb_setup_dca(adapter);
19025 + DPRINTK(PROBE, INFO, "Intel(R) Gigabit Ethernet Network Connection\n");
19026 + /* print bus type/speed/width info */
19027 + DPRINTK(PROBE, INFO, "(PCIe:%s:%s) ",
19028 + ((hw->bus.speed == e1000_bus_speed_2500) ? "2.5Gb/s" : "unknown"),
19029 + ((hw->bus.width == e1000_bus_width_pcie_x4) ? "Width x4" :
19030 + (hw->bus.width == e1000_bus_width_pcie_x1) ? "Width x1" :
19033 + for (i = 0; i < 6; i++)
19034 + printk("%2.2x%c", netdev->dev_addr[i], i == 5 ? '\n' : ':');
19036 + DPRINTK(PROBE, INFO,
19037 + "Using %s interrupts. %d rx queue(s), %d tx queue(s)\n",
19038 + adapter->msix_entries ? "MSI-X" :
19039 + adapter->flags & IGB_FLAG_HAS_MSI ? "MSI" :
19041 + adapter->num_rx_queues, adapter->num_tx_queues);
19047 + igb_release_hw_control(adapter);
19049 + if (!e1000_check_reset_block(hw))
19050 + e1000_phy_hw_reset(hw);
19052 + if (hw->flash_address)
19053 + iounmap(hw->flash_address);
19055 + igb_free_queues(adapter);
19057 + iounmap(hw->hw_addr);
19059 + free_netdev(netdev);
19060 +err_alloc_etherdev:
19061 + pci_release_selected_regions(pdev,
19062 + pci_select_bars(pdev, IORESOURCE_MEM));
19065 + pci_disable_device(pdev);
19070 + * igb_remove - Device Removal Routine
19071 + * @pdev: PCI device information struct
19073 + * igb_remove is called by the PCI subsystem to alert the driver
19074 + * that it should release a PCI device. The could be caused by a
19075 + * Hot-Plug event, or because the driver is going to be removed from
19079 +static void __devexit igb_remove(struct pci_dev *pdev)
19081 + struct net_device *netdev = pci_get_drvdata(pdev);
19082 + struct igb_adapter *adapter = netdev_priv(netdev);
19083 + struct e1000_hw *hw = &adapter->hw;
19085 + /* flush_scheduled work may reschedule our watchdog task, so
19086 + * explicitly disable watchdog tasks from being rescheduled */
19087 + set_bit(__IGB_DOWN, &adapter->state);
19088 + del_timer_sync(&adapter->watchdog_timer);
19089 + del_timer_sync(&adapter->phy_info_timer);
19091 + flush_scheduled_work();
19094 + if (adapter->flags & IGB_FLAG_DCA_ENABLED) {
19095 + DPRINTK(PROBE, INFO, "DCA disabled\n");
19096 + dca_remove_requester(&pdev->dev);
19097 + adapter->flags &= ~IGB_FLAG_DCA_ENABLED;
19098 + E1000_WRITE_REG(hw, E1000_DCA_CTRL, 1);
19102 + /* Release control of h/w to f/w. If f/w is AMT enabled, this
19103 + * would have already happened in close and is redundant. */
19104 + igb_release_hw_control(adapter);
19106 + unregister_netdev(netdev);
19108 + if (!e1000_check_reset_block(hw))
19109 + e1000_phy_hw_reset(hw);
19111 + igb_reset_interrupt_capability(adapter);
19113 + igb_free_queues(adapter);
19115 + iounmap(hw->hw_addr);
19116 + if (hw->flash_address)
19117 + iounmap(adapter->hw.flash_address);
19118 + pci_release_selected_regions(pdev,
19119 + pci_select_bars(pdev, IORESOURCE_MEM));
19121 + free_netdev(netdev);
19123 + pci_disable_device(pdev);
19127 + * igb_sw_init - Initialize general software structures (struct igb_adapter)
19128 + * @adapter: board private structure to initialize
19130 + * igb_sw_init initializes the Adapter private data structure.
19131 + * Fields are initialized based on PCI device information and
19132 + * OS network device settings (MTU size).
19135 +static int __devinit igb_sw_init(struct igb_adapter *adapter)
19137 + struct e1000_hw *hw = &adapter->hw;
19138 + struct net_device *netdev = adapter->netdev;
19139 + struct pci_dev *pdev = adapter->pdev;
19141 + /* PCI config space info */
19143 + hw->vendor_id = pdev->vendor;
19144 + hw->device_id = pdev->device;
19145 + hw->subsystem_vendor_id = pdev->subsystem_vendor;
19146 + hw->subsystem_device_id = pdev->subsystem_device;
19148 + pci_read_config_byte(pdev, PCI_REVISION_ID, &hw->revision_id);
19150 + pci_read_config_word(pdev, PCI_COMMAND, &hw->bus.pci_cmd_word);
19152 + adapter->tx_ring_count = IGB_DEFAULT_TXD;
19153 + adapter->rx_ring_count = IGB_DEFAULT_RXD;
19154 + adapter->rx_buffer_len = MAXIMUM_ETHERNET_VLAN_SIZE;
19155 + adapter->rx_ps_hdr_size = 0; /* disable packet split */
19156 + adapter->max_frame_size = netdev->mtu + ETH_HLEN + ETH_FCS_LEN;
19157 + adapter->min_frame_size = ETH_ZLEN + ETH_FCS_LEN;
19159 + /* Initialize the hardware-specific values */
19160 + if (e1000_setup_init_funcs(hw, TRUE)) {
19161 + DPRINTK(PROBE, ERR, "Hardware Initialization Failure\n");
19165 + /* Number of supported queues. */
19166 + /* Having more queues than CPUs doesn't make sense. */
19167 + adapter->num_rx_queues = min((u32)IGB_MAX_RX_QUEUES, (u32)num_online_cpus());
19169 + adapter->num_tx_queues = min(IGB_MAX_TX_QUEUES, num_online_cpus());
19171 + adapter->num_tx_queues = 1;
19175 + /* This call may decrease the number of queues depending on
19176 + * interrupt mode. */
19177 + igb_set_interrupt_capability(adapter);
19179 + if (igb_alloc_queues(adapter)) {
19180 + DPRINTK(PROBE, ERR, "Unable to allocate memory for queues\n");
19184 + /* Explicitly disable IRQ since the NIC can be in any state. */
19185 + igb_irq_disable(adapter);
19187 + set_bit(__IGB_DOWN, &adapter->state);
19193 + * igb_open - Called when a network interface is made active
19194 + * @netdev: network interface device structure
19196 + * Returns 0 on success, negative value on failure
19198 + * The open entry point is called when a network interface is made
19199 + * active by the system (IFF_UP). At this point all resources needed
19200 + * for transmit and receive operations are allocated, the interrupt
19201 + * handler is registered with the OS, the watchdog timer is started,
19202 + * and the stack is notified that the interface is ready.
19205 +static int igb_open(struct net_device *netdev)
19207 + struct igb_adapter *adapter = netdev_priv(netdev);
19208 + struct e1000_hw *hw = &adapter->hw;
19212 + /* disallow open during test */
19213 + if (test_bit(__IGB_TESTING, &adapter->state))
19216 + /* allocate transmit descriptors */
19217 + err = igb_setup_all_tx_resources(adapter);
19219 + goto err_setup_tx;
19221 + /* allocate receive descriptors */
19222 + err = igb_setup_all_rx_resources(adapter);
19224 + goto err_setup_rx;
19226 + /* e1000_power_up_phy(adapter); */
19228 + adapter->mng_vlan_id = IGB_MNG_VLAN_NONE;
19229 + if ((adapter->hw.mng_cookie.status &
19230 + E1000_MNG_DHCP_COOKIE_STATUS_VLAN)) {
19231 + igb_update_mng_vlan(adapter);
19234 + /* before we allocate an interrupt, we must be ready to handle it.
19235 + * Setting DEBUG_SHIRQ in the kernel makes it fire an interrupt
19236 + * as soon as we call pci_request_irq, so we have to setup our
19237 + * clean_rx handler before we do so. */
19238 + igb_configure(adapter);
19240 + err = igb_request_irq(adapter);
19242 + goto err_req_irq;
19244 + /* From here on the code is the same as igb_up() */
19245 + clear_bit(__IGB_DOWN, &adapter->state);
19247 + for (i = 0; i < adapter->num_rx_queues; i++)
19248 + napi_enable(&adapter->rx_ring[i].napi);
19249 + igb_configure_lli(adapter);
19251 + /* Clear any pending interrupts. */
19252 + E1000_READ_REG(hw, E1000_ICR);
19254 + igb_irq_enable(adapter);
19256 + netif_tx_start_all_queues(netdev);
19258 + /* Fire a link status change interrupt to start the watchdog. */
19259 + E1000_WRITE_REG(hw, E1000_ICS, E1000_ICS_LSC);
19261 + return E1000_SUCCESS;
19264 + igb_release_hw_control(adapter);
19265 + /* e1000_power_down_phy(adapter); */
19266 + igb_free_all_rx_resources(adapter);
19268 + igb_free_all_tx_resources(adapter);
19270 + igb_reset(adapter);
19275 + * igb_close - Disables a network interface
19276 + * @netdev: network interface device structure
19278 + * Returns 0, this is not allowed to fail
19280 + * The close entry point is called when an interface is de-activated
19281 + * by the OS. The hardware is still under the driver's control, but
19282 + * needs to be disabled. A global MAC reset is issued to stop the
19283 + * hardware, and all transmit and receive resources are freed.
19286 +static int igb_close(struct net_device *netdev)
19288 + struct igb_adapter *adapter = netdev_priv(netdev);
19290 + WARN_ON(test_bit(__IGB_RESETTING, &adapter->state));
19291 + igb_down(adapter);
19293 + igb_free_irq(adapter);
19295 + igb_free_all_tx_resources(adapter);
19296 + igb_free_all_rx_resources(adapter);
19298 + /* kill manageability vlan ID if supported, but not if a vlan with
19299 + * the same ID is registered on the host OS (let 8021q kill it) */
19300 + if ((adapter->hw.mng_cookie.status &
19301 + E1000_MNG_DHCP_COOKIE_STATUS_VLAN) &&
19302 + !(adapter->vlgrp &&
19303 + vlan_group_get_device(adapter->vlgrp, adapter->mng_vlan_id)))
19304 + igb_vlan_rx_kill_vid(netdev, adapter->mng_vlan_id);
19310 + * igb_setup_tx_resources - allocate Tx resources (Descriptors)
19311 + * @adapter: board private structure
19312 + * @tx_ring: tx descriptor ring (for a specific queue) to setup
19314 + * Return 0 on success, negative on failure
19317 +int igb_setup_tx_resources(struct igb_adapter *adapter,
19318 + struct igb_ring *tx_ring)
19320 + struct pci_dev *pdev = adapter->pdev;
19323 + size = sizeof(struct igb_buffer) * tx_ring->count;
19324 + tx_ring->buffer_info = vmalloc(size);
19325 + if (!tx_ring->buffer_info)
19327 + memset(tx_ring->buffer_info, 0, size);
19329 + /* round up to nearest 4K */
19330 + tx_ring->size = tx_ring->count * sizeof(struct e1000_tx_desc)
19332 + tx_ring->size = ALIGN(tx_ring->size, 4096);
19334 + tx_ring->desc = pci_alloc_consistent(pdev, tx_ring->size,
19337 + if (!tx_ring->desc)
19340 + tx_ring->adapter = adapter;
19341 + tx_ring->next_to_use = 0;
19342 + tx_ring->next_to_clean = 0;
19346 + vfree(tx_ring->buffer_info);
19347 + DPRINTK(PROBE, ERR, "Unable to allocate memory for the transmit "
19348 + "descriptor ring\n");
19353 + * igb_setup_all_tx_resources - wrapper to allocate Tx resources
19354 + * (Descriptors) for all queues
19355 + * @adapter: board private structure
19357 + * Return 0 on success, negative on failure
19360 +static int igb_setup_all_tx_resources(struct igb_adapter *adapter)
19367 + for (i = 0; i < adapter->num_tx_queues; i++) {
19368 + err = igb_setup_tx_resources(adapter, &adapter->tx_ring[i]);
19370 + DPRINTK(PROBE, ERR,
19371 + "Allocation for Tx Queue %u failed\n", i);
19372 + for (i--; i >= 0; i--)
19373 + igb_free_tx_resources(&adapter->tx_ring[i]);
19379 + for (i = 0; i < IGB_ABS_MAX_TX_QUEUES; i++) {
19380 + r_idx = i % adapter->num_tx_queues;
19381 + adapter->multi_tx_table[i] = &adapter->tx_ring[r_idx];
19388 + * igb_configure_tx - Configure transmit Unit after Reset
19389 + * @adapter: board private structure
19391 + * Configure the Tx unit of the MAC after a reset.
19394 +static void igb_configure_tx(struct igb_adapter *adapter)
19397 + struct e1000_hw *hw = &adapter->hw;
19399 + u32 txdctl, txctrl;
19402 + for (i = 0; i < adapter->num_tx_queues; i++) {
19403 + struct igb_ring *ring = &(adapter->tx_ring[i]);
19405 + E1000_WRITE_REG(hw, E1000_TDLEN(i),
19406 + ring->count * sizeof(struct e1000_tx_desc));
19407 + tdba = ring->dma;
19408 + E1000_WRITE_REG(hw, E1000_TDBAL(i),
19409 + tdba & 0x00000000ffffffffULL);
19410 + E1000_WRITE_REG(hw, E1000_TDBAH(i), tdba >> 32);
19412 + tdwba = ring->dma + ring->count * sizeof(struct e1000_tx_desc);
19413 + tdwba |= 1; /* enable head wb */
19414 + E1000_WRITE_REG(hw, E1000_TDWBAL(i),
19415 + tdwba & 0x00000000ffffffffULL);
19416 + E1000_WRITE_REG(hw, E1000_TDWBAH(i), tdwba >> 32);
19418 + ring->head = E1000_TDH(i);
19419 + ring->tail = E1000_TDT(i);
19420 + writel(0, hw->hw_addr + ring->tail);
19421 + writel(0, hw->hw_addr + ring->head);
19422 + txdctl = E1000_READ_REG(hw, E1000_TXDCTL(i));
19423 + txdctl |= E1000_TXDCTL_QUEUE_ENABLE;
19424 + E1000_WRITE_REG(hw, E1000_TXDCTL(i), txdctl);
19426 + /* Turn off Relaxed Ordering on head write-backs. The writebacks
19427 + * MUST be delivered in order or it will completely screw up
19428 + * our bookeeping.
19430 + txctrl = E1000_READ_REG(hw, E1000_DCA_TXCTRL(i));
19431 + txctrl &= ~E1000_DCA_TXCTRL_TX_WB_RO_EN;
19432 + E1000_WRITE_REG(hw, E1000_DCA_TXCTRL(i), txctrl);
19435 + /* Use the default values for the Tx Inter Packet Gap (IPG) timer */
19437 + /* Program the Transmit Control Register */
19439 + tctl = E1000_READ_REG(hw, E1000_TCTL);
19440 + tctl &= ~E1000_TCTL_CT;
19441 + tctl |= E1000_TCTL_PSP | E1000_TCTL_RTLC |
19442 + (E1000_COLLISION_THRESHOLD << E1000_CT_SHIFT);
19444 + e1000_config_collision_dist(hw);
19446 + /* Setup Transmit Descriptor Settings for eop descriptor */
19447 + adapter->txd_cmd = E1000_TXD_CMD_EOP | E1000_TXD_CMD_RS;
19449 + /* Enable transmits */
19450 + tctl |= E1000_TCTL_EN;
19452 + E1000_WRITE_REG(hw, E1000_TCTL, tctl);
19456 + * igb_setup_rx_resources - allocate Rx resources (Descriptors)
19457 + * @adapter: board private structure
19458 + * @rx_ring: rx descriptor ring (for a specific queue) to setup
19460 + * Returns 0 on success, negative on failure
19463 +int igb_setup_rx_resources(struct igb_adapter *adapter,
19464 + struct igb_ring *rx_ring)
19466 + struct pci_dev *pdev = adapter->pdev;
19467 + int size, desc_len;
19470 + size = sizeof(struct net_lro_desc) * MAX_LRO_DESCRIPTORS;
19471 + rx_ring->lro_mgr.lro_arr = vmalloc(size);
19472 + if (!rx_ring->lro_mgr.lro_arr)
19474 + memset(rx_ring->lro_mgr.lro_arr, 0, size);
19476 +#endif /* IGB_LRO */
19477 + size = sizeof(struct igb_buffer) * rx_ring->count;
19478 + rx_ring->buffer_info = vmalloc(size);
19479 + if (!rx_ring->buffer_info)
19481 + memset(rx_ring->buffer_info, 0, size);
19483 + desc_len = sizeof(union e1000_adv_rx_desc);
19485 + /* Round up to nearest 4K */
19486 + rx_ring->size = rx_ring->count * desc_len;
19487 + rx_ring->size = ALIGN(rx_ring->size, 4096);
19489 + rx_ring->desc = pci_alloc_consistent(pdev, rx_ring->size,
19492 + if (!rx_ring->desc)
19495 + rx_ring->next_to_clean = 0;
19496 + rx_ring->next_to_use = 0;
19498 + rx_ring->adapter = adapter;
19503 + vfree(rx_ring->lro_mgr.lro_arr);
19504 + rx_ring->lro_mgr.lro_arr = NULL;
19506 + vfree(rx_ring->buffer_info);
19507 + rx_ring->buffer_info = NULL;
19508 + DPRINTK(PROBE, ERR, "Unable to allocate memory for the receive "
19509 + "descriptor ring\n");
19514 + * igb_setup_all_rx_resources - wrapper to allocate Rx resources
19515 + * (Descriptors) for all queues
19516 + * @adapter: board private structure
19518 + * Return 0 on success, negative on failure
19521 +static int igb_setup_all_rx_resources(struct igb_adapter *adapter)
19525 + for (i = 0; i < adapter->num_rx_queues; i++) {
19526 + err = igb_setup_rx_resources(adapter, &adapter->rx_ring[i]);
19528 + DPRINTK(PROBE, ERR,
19529 + "Allocation for Rx Queue %u failed\n", i);
19530 + for (i--; i >= 0; i--)
19531 + igb_free_rx_resources(&adapter->rx_ring[i]);
19540 + * igb_setup_rctl - configure the receive control registers
19541 + * @adapter: Board private structure
19543 +static void igb_setup_rctl(struct igb_adapter *adapter)
19545 + struct e1000_hw *hw = &adapter->hw;
19550 + rctl = E1000_READ_REG(hw, E1000_RCTL);
19552 + rctl &= ~(3 << E1000_RCTL_MO_SHIFT);
19554 + rctl |= E1000_RCTL_EN | E1000_RCTL_BAM |
19555 + E1000_RCTL_LBM_NO | E1000_RCTL_RDMTS_HALF |
19556 + (hw->mac.mc_filter_type << E1000_RCTL_MO_SHIFT);
19559 + * enable stripping of CRC. It's unlikely this will break BMC
19560 + * redirection as it did with e1000. Newer features require
19561 + * that the HW strips the CRC.
19563 + rctl |= E1000_RCTL_SECRC;
19565 + rctl &= ~E1000_RCTL_SBP;
19567 + if (adapter->netdev->mtu <= ETH_DATA_LEN)
19568 + rctl &= ~E1000_RCTL_LPE;
19570 + rctl |= E1000_RCTL_LPE;
19572 + if (adapter->rx_buffer_len <= IGB_RXBUFFER_2048) {
19573 + /* Setup buffer sizes */
19574 + rctl &= ~E1000_RCTL_SZ_4096;
19575 + rctl |= E1000_RCTL_BSEX;
19576 + switch (adapter->rx_buffer_len) {
19577 + case IGB_RXBUFFER_256:
19578 + rctl |= E1000_RCTL_SZ_256;
19579 + rctl &= ~E1000_RCTL_BSEX;
19581 + case IGB_RXBUFFER_512:
19582 + rctl |= E1000_RCTL_SZ_512;
19583 + rctl &= ~E1000_RCTL_BSEX;
19585 + case IGB_RXBUFFER_1024:
19586 + rctl |= E1000_RCTL_SZ_1024;
19587 + rctl &= ~E1000_RCTL_BSEX;
19589 + case IGB_RXBUFFER_2048:
19591 + rctl |= E1000_RCTL_SZ_2048;
19592 + rctl &= ~E1000_RCTL_BSEX;
19596 + rctl &= ~E1000_RCTL_BSEX;
19597 + srrctl = adapter->rx_buffer_len >> E1000_SRRCTL_BSIZEPKT_SHIFT;
19600 +#ifndef CONFIG_IGB_DISABLE_PACKET_SPLIT
19601 + /* 82575 and greater support packet-split where the protocol
19602 + * header is placed in skb->data and the packet data is
19603 + * placed in pages hanging off of skb_shinfo(skb)->nr_frags.
19604 + * In the case of a non-split, skb->data is linearly filled,
19605 + * followed by the page buffers. Therefore, skb->data is
19606 + * sized to hold the largest protocol header.
19608 + /* allocations using alloc_page take too long for regular MTU
19609 + * so only enable packet split for jumbo frames */
19610 + if (rctl & E1000_RCTL_LPE) {
19611 + adapter->rx_ps_hdr_size = IGB_RXBUFFER_128;
19612 + srrctl |= adapter->rx_ps_hdr_size <<
19613 + E1000_SRRCTL_BSIZEHDRSIZE_SHIFT;
19614 + srrctl |= E1000_SRRCTL_DESCTYPE_HDR_SPLIT_ALWAYS;
19616 +#endif /* CONFIG_IGB_DISABLE_PACKET_SPLIT */
19617 + adapter->rx_ps_hdr_size = 0;
19618 + srrctl |= E1000_SRRCTL_DESCTYPE_ADV_ONEBUF;
19619 +#ifndef CONFIG_IGB_DISABLE_PACKET_SPLIT
19621 +#endif /* CONFIG_IGB_DISABLE_PACKET_SPLIT */
19623 + for (i = 0; i < adapter->num_rx_queues; i++) {
19624 + E1000_WRITE_REG(hw, E1000_SRRCTL(i), srrctl);
19627 + E1000_WRITE_REG(hw, E1000_RCTL, rctl);
19631 + * igb_configure_rx - Configure receive Unit after Reset
19632 + * @adapter: board private structure
19634 + * Configure the Rx unit of the MAC after a reset.
19637 +static void igb_configure_rx(struct igb_adapter *adapter)
19640 + struct e1000_hw *hw = &adapter->hw;
19641 + u32 rctl, rxcsum;
19645 + /* disable receives while setting up the descriptors */
19646 + rctl = E1000_READ_REG(hw, E1000_RCTL);
19647 + E1000_WRITE_REG(hw, E1000_RCTL, rctl & ~E1000_RCTL_EN);
19648 + E1000_WRITE_FLUSH(hw);
19651 + if (adapter->itr_setting > 3) {
19652 + E1000_WRITE_REG(hw, E1000_ITR, adapter->itr);
19654 + /* Setup the HW Rx Head and Tail Descriptor Pointers and
19655 + * the Base and Length of the Rx Descriptor Ring */
19656 + for (i = 0; i < adapter->num_rx_queues; i++) {
19657 + struct igb_ring *ring = &(adapter->rx_ring[i]);
19658 + rdba = ring->dma;
19659 + E1000_WRITE_REG(hw, E1000_RDBAL(i),
19660 + rdba & 0x00000000ffffffffULL);
19661 + E1000_WRITE_REG(hw, E1000_RDBAH(i), rdba >> 32);
19662 + E1000_WRITE_REG(hw, E1000_RDLEN(i),
19663 + ring->count * sizeof(union e1000_adv_rx_desc));
19665 + ring->head = E1000_RDH(i);
19666 + ring->tail = E1000_RDT(i);
19667 + writel(0, hw->hw_addr + ring->tail);
19668 + writel(0, hw->hw_addr + ring->head);
19670 + rxdctl = E1000_READ_REG(hw, E1000_RXDCTL(i));
19671 + rxdctl |= E1000_RXDCTL_QUEUE_ENABLE;
19672 + rxdctl &= 0xFFF00000;
19673 + rxdctl |= IGB_RX_PTHRESH;
19674 + rxdctl |= IGB_RX_HTHRESH << 8;
19675 + rxdctl |= IGB_RX_WTHRESH << 16;
19676 + E1000_WRITE_REG(hw, E1000_RXDCTL(i), rxdctl);
19678 + /* Intitial LRO Settings */
19679 + ring->lro_mgr.max_aggr = adapter->lro_max_aggr;
19680 + ring->lro_mgr.max_desc = MAX_LRO_DESCRIPTORS;
19681 + ring->lro_mgr.get_skb_header = igb_get_skb_hdr;
19682 + ring->lro_mgr.features = LRO_F_NAPI | LRO_F_EXTRACT_VLAN_ID;
19683 + ring->lro_mgr.dev = adapter->netdev;
19684 + ring->lro_mgr.ip_summed = CHECKSUM_UNNECESSARY;
19685 + ring->lro_mgr.ip_summed_aggr = CHECKSUM_UNNECESSARY;
19690 + if (adapter->num_rx_queues > 1) {
19694 + union e1000_reta {
19699 + /* ugh, using random bytes here means we'll never put the same
19700 + * flow in the same rx queue */
19701 + get_random_bytes(&random[0], 40);
19703 + if (hw->mac.type >= e1000_82576)
19707 + for (j = 0; j < (32 * 4); j++) {
19708 + reta.bytes[j & 3] =
19709 + (j % adapter->num_rx_queues) << shift;
19710 + if ((j & 3) == 3) {
19711 + writel(reta.dword,
19712 + hw->hw_addr + E1000_RETA(0) + (j & ~3));
19715 + mrqc = E1000_MRQC_ENABLE_RSS_4Q;
19717 + /* Fill out hash function seeds */
19718 + for (j = 0; j < 10; j++)
19719 + E1000_WRITE_REG_ARRAY(hw, E1000_RSSRK(0), j, random[j]);
19721 + mrqc |= (E1000_MRQC_RSS_FIELD_IPV4 |
19722 + E1000_MRQC_RSS_FIELD_IPV4_TCP);
19723 + mrqc |= (E1000_MRQC_RSS_FIELD_IPV6 |
19724 + E1000_MRQC_RSS_FIELD_IPV6_TCP);
19725 + mrqc |=( E1000_MRQC_RSS_FIELD_IPV4_UDP |
19726 + E1000_MRQC_RSS_FIELD_IPV6_UDP);
19727 + mrqc |=( E1000_MRQC_RSS_FIELD_IPV6_UDP_EX |
19728 + E1000_MRQC_RSS_FIELD_IPV6_TCP_EX);
19731 + E1000_WRITE_REG(hw, E1000_MRQC, mrqc);
19733 + /* Multiqueue and raw packet checksumming are mutually
19734 + * exclusive. Note that this not the same as TCP/IP
19735 + * checksumming, which works fine. */
19736 + rxcsum = E1000_READ_REG(hw, E1000_RXCSUM);
19737 + rxcsum |= E1000_RXCSUM_PCSD;
19738 + E1000_WRITE_REG(hw, E1000_RXCSUM, rxcsum);
19740 + /* Enable Receive Checksum Offload for TCP and UDP */
19741 + rxcsum = E1000_READ_REG(hw, E1000_RXCSUM);
19742 + if (adapter->rx_csum)
19743 + rxcsum |= E1000_RXCSUM_TUOFL | E1000_RXCSUM_IPPCSE;
19745 + rxcsum &= ~E1000_RXCSUM_TUOFL;
19746 + /* don't need to clear IPPCSE as it defaults to 0 */
19747 + E1000_WRITE_REG(hw, E1000_RXCSUM, rxcsum);
19750 + if (adapter->vlgrp)
19751 + E1000_WRITE_REG(hw, E1000_RLPML,
19752 + adapter->max_frame_size + VLAN_TAG_SIZE);
19754 + E1000_WRITE_REG(hw, E1000_RLPML, adapter->max_frame_size);
19756 + /* Enable Receives */
19757 + E1000_WRITE_REG(hw, E1000_RCTL, rctl);
19761 + * igb_free_tx_resources - Free Tx Resources per Queue
19762 + * @adapter: board private structure
19763 + * @tx_ring: Tx descriptor ring for a specific queue
19765 + * Free all transmit software resources
19768 +void igb_free_tx_resources(struct igb_ring *tx_ring)
19770 + struct pci_dev *pdev = tx_ring->adapter->pdev;
19772 + igb_clean_tx_ring(tx_ring);
19774 + vfree(tx_ring->buffer_info);
19775 + tx_ring->buffer_info = NULL;
19777 + pci_free_consistent(pdev, tx_ring->size, tx_ring->desc, tx_ring->dma);
19779 + tx_ring->desc = NULL;
19783 + * igb_free_all_tx_resources - Free Tx Resources for All Queues
19784 + * @adapter: board private structure
19786 + * Free all transmit software resources
19789 +static void igb_free_all_tx_resources(struct igb_adapter *adapter)
19793 + for (i = 0; i < adapter->num_tx_queues; i++)
19794 + igb_free_tx_resources(&adapter->tx_ring[i]);
19797 +static void igb_unmap_and_free_tx_resource(struct igb_adapter *adapter,
19798 + struct igb_buffer *buffer_info)
19800 + if (buffer_info->dma) {
19801 + pci_unmap_page(adapter->pdev,
19802 + buffer_info->dma,
19803 + buffer_info->length,
19804 + PCI_DMA_TODEVICE);
19805 + buffer_info->dma = 0;
19807 + if (buffer_info->skb) {
19808 + dev_kfree_skb_any(buffer_info->skb);
19809 + buffer_info->skb = NULL;
19811 + buffer_info->time_stamp = 0;
19812 + /* buffer_info must be completely set up in the transmit path */
19816 + * igb_clean_tx_ring - Free Tx Buffers
19817 + * @adapter: board private structure
19818 + * @tx_ring: ring to be cleaned
19821 +static void igb_clean_tx_ring(struct igb_ring *tx_ring)
19823 + struct igb_adapter *adapter = tx_ring->adapter;
19824 + struct igb_buffer *buffer_info;
19825 + unsigned long size;
19828 + if (!tx_ring->buffer_info)
19830 + /* Free all the Tx ring sk_buffs */
19832 + for (i = 0; i < tx_ring->count; i++) {
19833 + buffer_info = &tx_ring->buffer_info[i];
19834 + igb_unmap_and_free_tx_resource(adapter, buffer_info);
19837 + size = sizeof(struct igb_buffer) * tx_ring->count;
19838 + memset(tx_ring->buffer_info, 0, size);
19840 + /* Zero out the descriptor ring */
19842 + memset(tx_ring->desc, 0, tx_ring->size);
19844 + tx_ring->next_to_use = 0;
19845 + tx_ring->next_to_clean = 0;
19847 + writel(0, adapter->hw.hw_addr + tx_ring->head);
19848 + writel(0, adapter->hw.hw_addr + tx_ring->tail);
19852 + * igb_clean_all_tx_rings - Free Tx Buffers for all queues
19853 + * @adapter: board private structure
19856 +static void igb_clean_all_tx_rings(struct igb_adapter *adapter)
19860 + for (i = 0; i < adapter->num_tx_queues; i++)
19861 + igb_clean_tx_ring(&adapter->tx_ring[i]);
19865 + * igb_free_rx_resources - Free Rx Resources
19866 + * @adapter: board private structure
19867 + * @rx_ring: ring to clean the resources from
19869 + * Free all receive software resources
19872 +void igb_free_rx_resources(struct igb_ring *rx_ring)
19874 + struct pci_dev *pdev = rx_ring->adapter->pdev;
19876 + igb_clean_rx_ring(rx_ring);
19878 + vfree(rx_ring->buffer_info);
19879 + rx_ring->buffer_info = NULL;
19882 + vfree(rx_ring->lro_mgr.lro_arr);
19883 + rx_ring->lro_mgr.lro_arr = NULL;
19884 +#endif /* IGB_LRO */
19886 + pci_free_consistent(pdev, rx_ring->size, rx_ring->desc, rx_ring->dma);
19888 + rx_ring->desc = NULL;
19892 + * igb_free_all_rx_resources - Free Rx Resources for All Queues
19893 + * @adapter: board private structure
19895 + * Free all receive software resources
19898 +static void igb_free_all_rx_resources(struct igb_adapter *adapter)
19902 + for (i = 0; i < adapter->num_rx_queues; i++)
19903 + igb_free_rx_resources(&adapter->rx_ring[i]);
19907 + * igb_clean_rx_ring - Free Rx Buffers per Queue
19908 + * @adapter: board private structure
19909 + * @rx_ring: ring to free buffers from
19912 +static void igb_clean_rx_ring(struct igb_ring *rx_ring)
19914 + struct igb_adapter *adapter = rx_ring->adapter;
19915 + struct igb_buffer *buffer_info;
19916 + struct pci_dev *pdev = adapter->pdev;
19917 + unsigned long size;
19920 + if (!rx_ring->buffer_info)
19922 + /* Free all the Rx ring sk_buffs */
19923 + for (i = 0; i < rx_ring->count; i++) {
19924 + buffer_info = &rx_ring->buffer_info[i];
19925 + if (buffer_info->dma) {
19926 + if (adapter->rx_ps_hdr_size){
19927 + pci_unmap_single(pdev, buffer_info->dma,
19928 + adapter->rx_ps_hdr_size,
19929 + PCI_DMA_FROMDEVICE);
19931 + pci_unmap_single(pdev, buffer_info->dma,
19932 + adapter->rx_buffer_len,
19933 + PCI_DMA_FROMDEVICE);
19935 + buffer_info->dma = 0;
19938 + if (buffer_info->skb) {
19939 + dev_kfree_skb(buffer_info->skb);
19940 + buffer_info->skb = NULL;
19942 +#ifndef CONFIG_IGB_DISABLE_PACKET_SPLIT
19943 + if (buffer_info->page) {
19944 + if (buffer_info->page_dma)
19945 + pci_unmap_page(pdev, buffer_info->page_dma,
19947 + PCI_DMA_FROMDEVICE);
19948 + put_page(buffer_info->page);
19949 + buffer_info->page = NULL;
19950 + buffer_info->page_dma = 0;
19951 + buffer_info->page_offset = 0;
19956 + size = sizeof(struct igb_buffer) * rx_ring->count;
19957 + memset(rx_ring->buffer_info, 0, size);
19959 + /* Zero out the descriptor ring */
19960 + memset(rx_ring->desc, 0, rx_ring->size);
19962 + rx_ring->next_to_clean = 0;
19963 + rx_ring->next_to_use = 0;
19965 + writel(0, adapter->hw.hw_addr + rx_ring->head);
19966 + writel(0, adapter->hw.hw_addr + rx_ring->tail);
19970 + * igb_clean_all_rx_rings - Free Rx Buffers for all queues
19971 + * @adapter: board private structure
19974 +static void igb_clean_all_rx_rings(struct igb_adapter *adapter)
19978 + for (i = 0; i < adapter->num_rx_queues; i++)
19979 + igb_clean_rx_ring(&adapter->rx_ring[i]);
19983 + * igb_set_mac - Change the Ethernet Address of the NIC
19984 + * @netdev: network interface device structure
19985 + * @p: pointer to an address structure
19987 + * Returns 0 on success, negative on failure
19990 +static int igb_set_mac(struct net_device *netdev, void *p)
19992 + struct igb_adapter *adapter = netdev_priv(netdev);
19993 + struct e1000_hw *hw = &adapter->hw;
19994 + struct sockaddr *addr = p;
19996 + if (!is_valid_ether_addr(addr->sa_data))
19997 + return -EADDRNOTAVAIL;
19999 + memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len);
20000 + memcpy(hw->mac.addr, addr->sa_data, netdev->addr_len);
20002 + e1000_rar_set(hw, hw->mac.addr, 0);
20008 + * igb_set_multi - Multicast and Promiscuous mode set
20009 + * @netdev: network interface device structure
20011 + * The set_multi entry point is called whenever the multicast address
20012 + * list or the network interface flags are updated. This routine is
20013 + * responsible for configuring the hardware for proper multicast,
20014 + * promiscuous mode, and all-multi behavior.
20017 +static void igb_set_multi(struct net_device *netdev)
20019 + struct igb_adapter *adapter = netdev_priv(netdev);
20020 + struct e1000_hw *hw = &adapter->hw;
20021 + struct e1000_mac_info *mac = &hw->mac;
20022 + struct dev_mc_list *mc_ptr;
20027 + /* Check for Promiscuous and All Multicast modes */
20029 + rctl = E1000_READ_REG(hw, E1000_RCTL);
20031 + if (netdev->flags & IFF_PROMISC) {
20032 + rctl |= (E1000_RCTL_UPE | E1000_RCTL_MPE);
20033 + rctl &= ~E1000_RCTL_VFE;
20035 + if (netdev->flags & IFF_ALLMULTI) {
20036 + rctl |= E1000_RCTL_MPE;
20037 + rctl &= ~E1000_RCTL_UPE;
20039 + rctl &= ~(E1000_RCTL_UPE | E1000_RCTL_MPE);
20040 + rctl |= E1000_RCTL_VFE;
20042 + E1000_WRITE_REG(hw, E1000_RCTL, rctl);
20044 + if (!netdev->mc_count) {
20045 + /* nothing to program, so clear mc list */
20046 + e1000_update_mc_addr_list(hw, NULL, 0, 1,
20047 + mac->rar_entry_count);
20051 + mta_list = kzalloc(netdev->mc_count * 6, GFP_ATOMIC);
20055 + /* The shared function expects a packed array of only addresses. */
20056 + mc_ptr = netdev->mc_list;
20058 + for (i = 0; i < netdev->mc_count; i++) {
20061 + memcpy(mta_list + (i*ETH_ALEN), mc_ptr->dmi_addr, ETH_ALEN);
20062 + mc_ptr = mc_ptr->next;
20064 + e1000_update_mc_addr_list(hw, mta_list, i, 1, mac->rar_entry_count);
20068 +/* Need to wait a few seconds after link up to get diagnostic information from
20071 +static void igb_update_phy_info(unsigned long data)
20073 + struct igb_adapter *adapter = (struct igb_adapter *) data;
20074 + e1000_get_phy_info(&adapter->hw);
20078 + * igb_has_link - check shared code for link and determine up/down
20079 + * @adapter: pointer to driver private info
20081 +static bool igb_has_link(struct igb_adapter *adapter)
20083 + struct e1000_hw *hw = &adapter->hw;
20084 + bool link_active = FALSE;
20087 + /* get_link_status is set on LSC (link status) interrupt or
20088 + * rx sequence error interrupt. get_link_status will stay
20089 + * false until the e1000_check_for_link establishes link
20090 + * for copper adapters ONLY
20092 + switch (hw->phy.media_type) {
20093 + case e1000_media_type_copper:
20094 + if (hw->mac.get_link_status) {
20095 + ret_val = e1000_check_for_link(hw);
20096 + link_active = !hw->mac.get_link_status;
20098 + link_active = TRUE;
20101 + case e1000_media_type_fiber:
20102 + ret_val = e1000_check_for_link(hw);
20103 + link_active = !!(E1000_READ_REG(hw, E1000_STATUS) &
20104 + E1000_STATUS_LU);
20106 + case e1000_media_type_internal_serdes:
20107 + ret_val = e1000_check_for_link(hw);
20108 + link_active = adapter->hw.mac.serdes_has_link;
20111 + case e1000_media_type_unknown:
20115 + return link_active;
20119 + * igb_watchdog - Timer Call-back
20120 + * @data: pointer to adapter cast into an unsigned long
20122 +static void igb_watchdog(unsigned long data)
20124 + struct igb_adapter *adapter = (struct igb_adapter *)data;
20125 + /* Do the rest outside of interrupt context */
20126 + schedule_work(&adapter->watchdog_task);
20129 +static void igb_watchdog_task(struct work_struct *work)
20131 + struct igb_adapter *adapter = container_of(work,
20132 + struct igb_adapter, watchdog_task);
20133 + struct e1000_hw *hw = &adapter->hw;
20134 + struct igb_ring *tx_ring = adapter->tx_ring;
20135 + struct net_device *netdev = adapter->netdev;
20140 + link = igb_has_link(adapter);
20141 + if ((netif_carrier_ok(netdev)) && link)
20145 + if (!netif_carrier_ok(netdev)) {
20147 + e1000_get_speed_and_duplex(hw, &adapter->link_speed,
20148 + &adapter->link_duplex);
20150 + ctrl = E1000_READ_REG(hw, E1000_CTRL);
20151 + DPRINTK(LINK, INFO, "NIC Link is Up %d Mbps %s, "
20152 + "Flow Control: %s\n",
20153 + adapter->link_speed,
20154 + adapter->link_duplex == FULL_DUPLEX ?
20155 + "Full Duplex" : "Half Duplex",
20156 + ((ctrl & E1000_CTRL_TFCE) && (ctrl &
20157 + E1000_CTRL_RFCE)) ? "RX/TX" : ((ctrl &
20158 + E1000_CTRL_RFCE) ? "RX" : ((ctrl &
20159 + E1000_CTRL_TFCE) ? "TX" : "None")));
20161 + /* tweak tx_queue_len according to speed/duplex and
20162 + * adjust the timeout factor */
20163 + netdev->tx_queue_len = adapter->tx_queue_len;
20164 + adapter->tx_timeout_factor = 1;
20165 + switch (adapter->link_speed) {
20167 + netdev->tx_queue_len = 10;
20168 + adapter->tx_timeout_factor = 14;
20171 + netdev->tx_queue_len = 100;
20172 + /* maybe add some timeout factor ? */
20176 + netif_carrier_on(netdev);
20177 + netif_tx_wake_all_queues(netdev);
20180 + if (netif_carrier_ok(netdev)) {
20181 + adapter->link_speed = 0;
20182 + adapter->link_duplex = 0;
20183 + DPRINTK(LINK, INFO, "NIC Link is Down\n");
20184 + netif_carrier_off(netdev);
20185 + netif_tx_stop_all_queues(netdev);
20190 + igb_update_stats(adapter);
20192 + if (!netif_carrier_ok(netdev)) {
20193 + if (IGB_DESC_UNUSED(tx_ring) + 1 < tx_ring->count) {
20194 + /* We've lost link, so the controller stops DMA,
20195 + * but we've got queued Tx work that's never going
20196 + * to get done, so reset controller to flush Tx.
20197 + * (Do the reset outside of interrupt context). */
20198 + adapter->tx_timeout_count++;
20199 + schedule_work(&adapter->reset_task);
20203 + /* Cause software interrupt to ensure rx ring is cleaned */
20204 + if (adapter->msix_entries) {
20205 + for (i = 0; i < adapter->num_rx_queues; i++)
20206 + eics |= adapter->rx_ring[i].eims_value;
20207 + E1000_WRITE_REG(hw, E1000_EICS, eics);
20209 + E1000_WRITE_REG(hw, E1000_ICS, E1000_ICS_RXDMT0);
20212 + /* Force detection of hung controller every watchdog period */
20213 + tx_ring->detect_tx_hung = TRUE;
20215 + /* Reset the timer */
20216 + if (!test_bit(__IGB_DOWN, &adapter->state))
20217 + mod_timer(&adapter->watchdog_timer,
20218 + round_jiffies(jiffies + 2 * HZ));
20221 +enum latency_range {
20222 + lowest_latency = 0,
20224 + bulk_latency = 2,
20225 + latency_invalid = 255
20230 + * igb_update_ring_itr - update the dynamic ITR value based on packet size
20232 + * Stores a new ITR value based on strictly on packet size. This
20233 + * algorithm is less sophisticated than that used in igb_update_itr,
20234 + * due to the difficulty of synchronizing statistics across multiple
20235 + * receive rings. The divisors and thresholds used by this fuction
20236 + * were determined based on theoretical maximum wire speed and testing
20237 + * data, in order to minimize response time while increasing bulk
20239 + * This functionality is controlled by the InterruptThrottleRate module
20240 + * parameter (see igb_param.c)
20241 + * NOTE: This function is called only when operating in a multiqueue
20242 + * receive environment.
20243 + * @rx_ring: pointer to ring
20245 +static void igb_update_ring_itr(struct igb_ring *rx_ring)
20247 + int new_val = rx_ring->itr_val;
20248 + int avg_wire_size = 0;
20249 + struct igb_adapter *adapter = rx_ring->adapter;
20251 + if (!rx_ring->total_packets)
20252 + goto clear_counts; /* no packets, so don't do anything */
20254 + /* For non-gigabit speeds, just fix the interrupt rate at 4000
20255 + * ints/sec - ITR timer value of 120 ticks.
20257 + if (adapter->link_speed != SPEED_1000) {
20259 + goto set_itr_val;
20261 + avg_wire_size = rx_ring->total_bytes / rx_ring->total_packets;
20262 + if (rx_ring->buddy && rx_ring->buddy->total_packets)
20263 + avg_wire_size = max(avg_wire_size,
20264 + (int)(rx_ring->buddy->total_bytes /
20265 + rx_ring->buddy->total_packets));
20266 + /* Add 24 bytes to size to account for CRC, preamble, and gap */
20267 + avg_wire_size += 24;
20269 + /* Don't starve jumbo frames */
20270 + avg_wire_size = min(avg_wire_size, 3000);
20272 + /* Give a little boost to mid-size frames */
20273 + if ((avg_wire_size > 300) && (avg_wire_size < 1200))
20274 + new_val = avg_wire_size / 3;
20276 + new_val = avg_wire_size / 2;
20279 + if (new_val != rx_ring->itr_val) {
20280 + rx_ring->itr_val = new_val;
20281 + rx_ring->set_itr = 1;
20284 + rx_ring->total_bytes = 0;
20285 + rx_ring->total_packets = 0;
20286 + if (rx_ring->buddy) {
20287 + rx_ring->buddy->total_bytes = 0;
20288 + rx_ring->buddy->total_packets = 0;
20293 + * igb_update_itr - update the dynamic ITR value based on statistics
20294 + * Stores a new ITR value based on packets and byte
20295 + * counts during the last interrupt. The advantage of per interrupt
20296 + * computation is faster updates and more accurate ITR for the current
20297 + * traffic pattern. Constants in this function were computed
20298 + * based on theoretical maximum wire speed and thresholds were set based
20299 + * on testing data as well as attempting to minimize response time
20300 + * while increasing bulk throughput.
20301 + * this functionality is controlled by the InterruptThrottleRate module
20302 + * parameter (see igb_param.c)
20303 + * NOTE: These calculations are only valid when operating in a single-
20304 + * queue environment.
20305 + * @adapter: pointer to adapter
20306 + * @itr_setting: current adapter->itr
20307 + * @packets: the number of packets during this measurement interval
20308 + * @bytes: the number of bytes during this measurement interval
20310 +static unsigned int igb_update_itr(struct igb_adapter *adapter, u16 itr_setting,
20311 + int packets, int bytes)
20313 + unsigned int retval = itr_setting;
20315 + if (packets == 0)
20316 + goto update_itr_done;
20318 + switch (itr_setting) {
20319 + case lowest_latency:
20320 + /* handle TSO and jumbo frames */
20321 + if (bytes/packets > 8000)
20322 + retval = bulk_latency;
20323 + else if ((packets < 5) && (bytes > 512)) {
20324 + retval = low_latency;
20327 + case low_latency: /* 50 usec aka 20000 ints/s */
20328 + if (bytes > 10000) {
20329 + /* this if handles the TSO accounting */
20330 + if (bytes/packets > 8000) {
20331 + retval = bulk_latency;
20332 + } else if ((packets < 10) || ((bytes/packets) > 1200)) {
20333 + retval = bulk_latency;
20334 + } else if ((packets > 35)) {
20335 + retval = lowest_latency;
20337 + } else if (bytes/packets > 2000) {
20338 + retval = bulk_latency;
20339 + } else if (packets <= 2 && bytes < 512) {
20340 + retval = lowest_latency;
20343 + case bulk_latency: /* 250 usec aka 4000 ints/s */
20344 + if (bytes > 25000) {
20345 + if (packets > 35) {
20346 + retval = low_latency;
20348 + } else if (bytes < 1500) {
20349 + retval = low_latency;
20358 +static void igb_set_itr(struct igb_adapter *adapter)
20361 + u32 new_itr = adapter->itr;
20363 + /* for non-gigabit speeds, just fix the interrupt rate at 4000 */
20364 + if (adapter->link_speed != SPEED_1000) {
20367 + goto set_itr_now;
20370 + adapter->rx_itr = igb_update_itr(adapter,
20372 + adapter->rx_ring->total_packets,
20373 + adapter->rx_ring->total_bytes);
20375 + if (adapter->rx_ring->buddy) {
20376 + adapter->tx_itr = igb_update_itr(adapter,
20378 + adapter->tx_ring->total_packets,
20379 + adapter->tx_ring->total_bytes);
20380 + current_itr = max(adapter->rx_itr, adapter->tx_itr);
20382 + current_itr = adapter->rx_itr;
20385 + /* conservative mode (itr 3) eliminates the lowest_latency setting */
20386 + if (adapter->itr_setting == 3 && current_itr == lowest_latency)
20387 + current_itr = low_latency;
20389 + switch (current_itr) {
20390 + /* counts and packets in update_itr are dependent on these numbers */
20391 + case lowest_latency:
20394 + case low_latency:
20395 + new_itr = 20000; /* aka hwitr = ~200 */
20397 + case bulk_latency:
20405 + adapter->rx_ring->total_bytes = 0;
20406 + adapter->rx_ring->total_packets = 0;
20407 + if (adapter->rx_ring->buddy) {
20408 + adapter->rx_ring->buddy->total_bytes = 0;
20409 + adapter->rx_ring->buddy->total_packets = 0;
20412 + if (new_itr != adapter->itr) {
20413 + /* this attempts to bias the interrupt rate towards Bulk
20414 + * by adding intermediate steps when interrupt rate is
20416 + new_itr = new_itr > adapter->itr ?
20417 + min(adapter->itr + (new_itr >> 2), new_itr) :
20419 + /* Don't write the value here; it resets the adapter's
20420 + * internal timer, and causes us to delay far longer than
20421 + * we should between interrupts. Instead, we write the ITR
20422 + * value at the beginning of the next interrupt so the timing
20423 + * ends up being correct.
20425 + adapter->itr = new_itr;
20426 + adapter->rx_ring->itr_val = 1000000000 / (new_itr * 256);
20427 + adapter->rx_ring->set_itr = 1;
20434 +#define IGB_TX_FLAGS_CSUM 0x00000001
20435 +#define IGB_TX_FLAGS_VLAN 0x00000002
20436 +#define IGB_TX_FLAGS_TSO 0x00000004
20437 +#define IGB_TX_FLAGS_IPV4 0x00000008
20438 +#define IGB_TX_FLAGS_VLAN_MASK 0xffff0000
20439 +#define IGB_TX_FLAGS_VLAN_SHIFT 16
20441 +static inline int igb_tso_adv(struct igb_adapter *adapter,
20442 + struct igb_ring *tx_ring,
20443 + struct sk_buff *skb, u32 tx_flags, u8 *hdr_len)
20445 +#ifdef NETIF_F_TSO
20446 + struct e1000_adv_tx_context_desc *context_desc;
20449 + struct igb_buffer *buffer_info;
20450 + u32 info = 0, tu_cmd = 0;
20451 + u32 mss_l4len_idx, l4len;
20454 + if (skb_header_cloned(skb)) {
20455 + err = pskb_expand_head(skb, 0, 0, GFP_ATOMIC);
20460 + l4len = tcp_hdrlen(skb);
20461 + *hdr_len += l4len;
20463 + if (skb->protocol == htons(ETH_P_IP)) {
20464 + struct iphdr *iph = ip_hdr(skb);
20465 + iph->tot_len = 0;
20467 + tcp_hdr(skb)->check = ~csum_tcpudp_magic(iph->saddr,
20471 +#ifdef NETIF_F_TSO6
20472 + } else if (skb_shinfo(skb)->gso_type == SKB_GSO_TCPV6) {
20473 + ipv6_hdr(skb)->payload_len = 0;
20474 + tcp_hdr(skb)->check = ~csum_ipv6_magic(&ipv6_hdr(skb)->saddr,
20475 + &ipv6_hdr(skb)->daddr,
20476 + 0, IPPROTO_TCP, 0);
20480 + i = tx_ring->next_to_use;
20482 + buffer_info = &tx_ring->buffer_info[i];
20483 + context_desc = E1000_TX_CTXTDESC_ADV(*tx_ring, i);
20484 + /* VLAN MACLEN IPLEN */
20485 + if (tx_flags & IGB_TX_FLAGS_VLAN)
20486 + info |= (tx_flags & IGB_TX_FLAGS_VLAN_MASK);
20487 + info |= (skb_network_offset(skb) << E1000_ADVTXD_MACLEN_SHIFT);
20488 + *hdr_len += skb_network_offset(skb);
20489 + info |= (skb_transport_header(skb) - skb_network_header(skb));
20490 + *hdr_len += (skb_transport_header(skb) - skb_network_header(skb));
20491 + context_desc->vlan_macip_lens = cpu_to_le32(info);
20493 + /* ADV DTYP TUCMD MKRLOC/ISCSIHEDLEN */
20494 + tu_cmd |= (E1000_TXD_CMD_DEXT | E1000_ADVTXD_DTYP_CTXT);
20496 + if (skb->protocol == htons(ETH_P_IP))
20497 + tu_cmd |= E1000_ADVTXD_TUCMD_IPV4;
20498 + tu_cmd |= E1000_ADVTXD_TUCMD_L4T_TCP;
20500 + context_desc->type_tucmd_mlhl = cpu_to_le32(tu_cmd);
20502 + /* MSS L4LEN IDX */
20503 + mss_l4len_idx = (skb_shinfo(skb)->gso_size << E1000_ADVTXD_MSS_SHIFT);
20504 + mss_l4len_idx |= (l4len << E1000_ADVTXD_L4LEN_SHIFT);
20506 + /* For 82575, context index must be unique per ring. */
20507 + if (adapter->flags & IGB_FLAG_NEED_CTX_IDX)
20508 + mss_l4len_idx |= tx_ring->queue_index << 4;
20510 + context_desc->mss_l4len_idx = cpu_to_le32(mss_l4len_idx);
20511 + context_desc->seqnum_seed = 0;
20513 + buffer_info->time_stamp = jiffies;
20514 + buffer_info->dma = 0;
20516 + if (i == tx_ring->count)
20519 + tx_ring->next_to_use = i;
20524 +#endif /* NETIF_F_TSO */
20527 +static inline bool igb_tx_csum_adv(struct igb_adapter *adapter,
20528 + struct igb_ring *tx_ring,
20529 + struct sk_buff *skb, u32 tx_flags)
20531 + struct e1000_adv_tx_context_desc *context_desc;
20533 + struct igb_buffer *buffer_info;
20534 + u32 info = 0, tu_cmd = 0;
20536 + if ((skb->ip_summed == CHECKSUM_PARTIAL) ||
20537 + (tx_flags & IGB_TX_FLAGS_VLAN)) {
20538 + i = tx_ring->next_to_use;
20539 + buffer_info = &tx_ring->buffer_info[i];
20540 + context_desc = E1000_TX_CTXTDESC_ADV(*tx_ring, i);
20542 + if (tx_flags & IGB_TX_FLAGS_VLAN)
20543 + info |= (tx_flags & IGB_TX_FLAGS_VLAN_MASK);
20545 + info |= (skb_network_offset(skb) << E1000_ADVTXD_MACLEN_SHIFT);
20546 + if (skb->ip_summed == CHECKSUM_PARTIAL)
20547 + info |= (skb_transport_header(skb) -
20548 + skb_network_header(skb));
20551 + context_desc->vlan_macip_lens = cpu_to_le32(info);
20553 + tu_cmd |= (E1000_TXD_CMD_DEXT | E1000_ADVTXD_DTYP_CTXT);
20555 + if (skb->ip_summed == CHECKSUM_PARTIAL) {
20556 + switch (skb->protocol) {
20557 + case __constant_htons(ETH_P_IP):
20558 + tu_cmd |= E1000_ADVTXD_TUCMD_IPV4;
20559 + if (ip_hdr(skb)->protocol == IPPROTO_TCP)
20560 + tu_cmd |= E1000_ADVTXD_TUCMD_L4T_TCP;
20562 +#ifdef NETIF_F_IPV6_CSUM
20563 + case __constant_htons(ETH_P_IPV6):
20564 + /* XXX what about other V6 headers?? */
20565 + if (ipv6_hdr(skb)->nexthdr == IPPROTO_TCP)
20566 + tu_cmd |= E1000_ADVTXD_TUCMD_L4T_TCP;
20570 + if (unlikely(net_ratelimit())) {
20571 + DPRINTK(PROBE, WARNING,
20572 + "partial checksum but proto=%x!\n",
20579 + context_desc->type_tucmd_mlhl = cpu_to_le32(tu_cmd);
20580 + context_desc->seqnum_seed = 0;
20581 + if (adapter->flags & IGB_FLAG_NEED_CTX_IDX)
20582 + context_desc->mss_l4len_idx =
20583 + cpu_to_le32(tx_ring->queue_index << 4);
20585 + context_desc->mss_l4len_idx = 0;
20587 + buffer_info->time_stamp = jiffies;
20588 + buffer_info->dma = 0;
20591 + if (i == tx_ring->count)
20593 + tx_ring->next_to_use = i;
20602 +#define IGB_MAX_TXD_PWR 16
20603 +#define IGB_MAX_DATA_PER_TXD (1<<IGB_MAX_TXD_PWR)
20605 +static inline int igb_tx_map_adv(struct igb_adapter *adapter,
20606 + struct igb_ring *tx_ring,
20607 + struct sk_buff *skb)
20609 + struct igb_buffer *buffer_info;
20610 + unsigned int len = skb_headlen(skb);
20611 + unsigned int count = 0, i;
20614 + i = tx_ring->next_to_use;
20616 + buffer_info = &tx_ring->buffer_info[i];
20617 + BUG_ON(len >= IGB_MAX_DATA_PER_TXD);
20618 + buffer_info->length = len;
20619 + /* set time_stamp *before* dma to help avoid a possible race */
20620 + buffer_info->time_stamp = jiffies;
20622 + buffer_info->dma =
20623 + pci_map_single(adapter->pdev, skb->data, len,
20624 + PCI_DMA_TODEVICE);
20628 + if (i == tx_ring->count)
20631 + for (f = 0; f < skb_shinfo(skb)->nr_frags; f++) {
20632 + struct skb_frag_struct *frag;
20634 + frag = &skb_shinfo(skb)->frags[f];
20635 + len = frag->size;
20637 + buffer_info = &tx_ring->buffer_info[i];
20638 + BUG_ON(len >= IGB_MAX_DATA_PER_TXD);
20639 + buffer_info->length = len;
20640 + buffer_info->time_stamp = jiffies;
20641 + buffer_info->dma =
20642 + pci_map_page(adapter->pdev,
20644 + frag->page_offset,
20646 + PCI_DMA_TODEVICE);
20650 + if (i == tx_ring->count)
20654 + i = (i == 0) ? tx_ring->count - 1 : i - 1;
20655 + tx_ring->buffer_info[i].skb = skb;
20660 +static inline void igb_tx_queue_adv(struct igb_adapter *adapter,
20661 + struct igb_ring *tx_ring,
20662 + int tx_flags, int count, u32 paylen,
20665 + union e1000_adv_tx_desc *tx_desc = NULL;
20666 + struct igb_buffer *buffer_info;
20667 + u32 olinfo_status = 0, cmd_type_len;
20670 + cmd_type_len = (E1000_ADVTXD_DTYP_DATA | E1000_ADVTXD_DCMD_IFCS |
20671 + E1000_ADVTXD_DCMD_DEXT);
20673 + if (tx_flags & IGB_TX_FLAGS_VLAN)
20674 + cmd_type_len |= E1000_ADVTXD_DCMD_VLE;
20676 + if (tx_flags & IGB_TX_FLAGS_TSO) {
20677 + cmd_type_len |= E1000_ADVTXD_DCMD_TSE;
20679 + /* insert tcp checksum */
20680 + olinfo_status |= E1000_TXD_POPTS_TXSM << 8;
20682 + /* insert ip checksum */
20683 + if (tx_flags & IGB_TX_FLAGS_IPV4)
20684 + olinfo_status |= E1000_TXD_POPTS_IXSM << 8;
20686 + } else if (tx_flags & IGB_TX_FLAGS_CSUM) {
20687 + olinfo_status |= E1000_TXD_POPTS_TXSM << 8;
20690 + if ((adapter->flags & IGB_FLAG_NEED_CTX_IDX) &&
20691 + (tx_flags & (IGB_TX_FLAGS_CSUM |
20692 + IGB_TX_FLAGS_TSO | IGB_TX_FLAGS_VLAN)))
20693 + olinfo_status |= tx_ring->queue_index << 4;
20695 + olinfo_status |= ((paylen - hdr_len) << E1000_ADVTXD_PAYLEN_SHIFT);
20697 + i = tx_ring->next_to_use;
20698 + while (count--) {
20699 + buffer_info = &tx_ring->buffer_info[i];
20700 + tx_desc = E1000_TX_DESC_ADV(*tx_ring, i);
20701 + tx_desc->read.buffer_addr = cpu_to_le64(buffer_info->dma);
20702 + tx_desc->read.cmd_type_len =
20703 + cpu_to_le32(cmd_type_len | buffer_info->length);
20704 + tx_desc->read.olinfo_status = cpu_to_le32(olinfo_status);
20706 + if (i == tx_ring->count)
20710 + tx_desc->read.cmd_type_len |= cpu_to_le32(adapter->txd_cmd);
20711 + /* Force memory writes to complete before letting h/w
20712 + * know there are new descriptors to fetch. (Only
20713 + * applicable for weak-ordered memory model archs,
20714 + * such as IA-64). */
20717 + tx_ring->next_to_use = i;
20718 + writel(i, adapter->hw.hw_addr + tx_ring->tail);
20719 + /* we need this if more than one processor can write to our tail
20720 + * at a time, it syncronizes IO on IA64/Altix systems */
20724 +static int __igb_maybe_stop_tx(struct net_device *netdev,
20725 + struct igb_ring *tx_ring, int size)
20727 + struct igb_adapter *adapter = netdev_priv(netdev);
20729 + if (netif_is_multiqueue(netdev))
20730 + netif_stop_subqueue(netdev, tx_ring->queue_index);
20732 + netif_stop_queue(netdev);
20734 + /* Herbert's original patch had:
20735 + * smp_mb__after_netif_stop_queue();
20736 + * but since that doesn't exist yet, just open code it. */
20739 + /* We need to check again in a case another CPU has just
20740 + * made room available. */
20741 + if (IGB_DESC_UNUSED(tx_ring) < size)
20744 + /* A reprieve! */
20745 + if (netif_is_multiqueue(netdev))
20746 + netif_wake_subqueue(netdev, tx_ring->queue_index);
20748 + netif_wake_queue(netdev);
20749 + ++adapter->restart_queue;
20753 +static int igb_maybe_stop_tx(struct net_device *netdev,
20754 + struct igb_ring *tx_ring, int size)
20756 + if (IGB_DESC_UNUSED(tx_ring) >= size)
20758 + return __igb_maybe_stop_tx(netdev, tx_ring, size);
20761 +#define TXD_USE_COUNT(S) (((S) >> (IGB_MAX_TXD_PWR)) + 1)
20763 +static int igb_xmit_frame_ring_adv(struct sk_buff *skb,
20764 + struct net_device *netdev,
20765 + struct igb_ring *tx_ring)
20767 + struct igb_adapter *adapter = netdev_priv(netdev);
20768 + unsigned int tx_flags = 0;
20769 + unsigned int len;
20773 + len = skb_headlen(skb);
20775 + if (test_bit(__IGB_DOWN, &adapter->state)) {
20776 + dev_kfree_skb_any(skb);
20777 + return NETDEV_TX_OK;
20780 + if (skb->len <= 0) {
20781 + dev_kfree_skb_any(skb);
20782 + return NETDEV_TX_OK;
20785 + /* need: 1 descriptor per page,
20786 + * + 2 desc gap to keep tail from touching head,
20787 + * + 1 desc for skb->data,
20788 + * + 1 desc for context descriptor,
20789 + * otherwise try next time */
20790 + if (igb_maybe_stop_tx(netdev, tx_ring, skb_shinfo(skb)->nr_frags + 4)) {
20791 + /* this is a hard error */
20792 + return NETDEV_TX_BUSY;
20796 + if (adapter->vlgrp && vlan_tx_tag_present(skb)) {
20797 + tx_flags |= IGB_TX_FLAGS_VLAN;
20798 + tx_flags |= (vlan_tx_tag_get(skb) << IGB_TX_FLAGS_VLAN_SHIFT);
20801 + if (skb->protocol == htons(ETH_P_IP))
20802 + tx_flags |= IGB_TX_FLAGS_IPV4;
20804 +#ifdef NETIF_F_TSO
20805 + tso = skb_is_gso(skb) ? igb_tso_adv(adapter, tx_ring, skb, tx_flags,
20810 + dev_kfree_skb_any(skb);
20811 + return NETDEV_TX_OK;
20815 + tx_flags |= IGB_TX_FLAGS_TSO;
20816 + } else if (igb_tx_csum_adv(adapter, tx_ring, skb, tx_flags))
20817 + if (skb->ip_summed == CHECKSUM_PARTIAL)
20818 + tx_flags |= IGB_TX_FLAGS_CSUM;
20820 + igb_tx_queue_adv(adapter, tx_ring, tx_flags,
20821 + igb_tx_map_adv(adapter, tx_ring, skb),
20822 + skb->len, hdr_len);
20824 + netdev->trans_start = jiffies;
20826 + /* Make sure there is space in the ring for the next send. */
20827 + igb_maybe_stop_tx(netdev, tx_ring, MAX_SKB_FRAGS + 4);
20829 + return NETDEV_TX_OK;
20832 +static int igb_xmit_frame_adv(struct sk_buff *skb, struct net_device *netdev)
20834 + struct igb_adapter *adapter = netdev_priv(netdev);
20835 + struct igb_ring *tx_ring;
20839 + r_idx = skb->queue_mapping & (IGB_ABS_MAX_TX_QUEUES - 1);
20840 + tx_ring = adapter->multi_tx_table[r_idx];
20842 + tx_ring = &adapter->tx_ring[0];
20846 + /* This goes back to the question of how to logically map a tx queue
20847 + * to a flow. Right now, performance is impacted slightly negatively
20848 + * if using multiple tx queues. If the stack breaks away from a
20849 + * single qdisc implementation, we can look at this again. */
20850 + return (igb_xmit_frame_ring_adv(skb, netdev, tx_ring));
20855 + * igb_tx_timeout - Respond to a Tx Hang
20856 + * @netdev: network interface device structure
20859 +static void igb_tx_timeout(struct net_device *netdev)
20861 + struct igb_adapter *adapter = netdev_priv(netdev);
20862 + struct e1000_hw *hw = &adapter->hw;
20864 + /* Do the reset outside of interrupt context */
20865 + adapter->tx_timeout_count++;
20866 + schedule_work(&adapter->reset_task);
20867 + E1000_WRITE_REG(hw, E1000_EICS, adapter->eims_enable_mask &
20868 + ~(E1000_EIMS_TCP_TIMER | E1000_EIMS_OTHER));
20871 +static void igb_reset_task(struct work_struct *work)
20873 + struct igb_adapter *adapter;
20874 + adapter = container_of(work, struct igb_adapter, reset_task);
20876 + igb_reinit_locked(adapter);
20880 + * igb_get_stats - Get System Network Statistics
20881 + * @netdev: network interface device structure
20883 + * Returns the address of the device statistics structure.
20884 + * The statistics are actually updated from the timer callback.
20887 +static struct net_device_stats *
20888 +igb_get_stats(struct net_device *netdev)
20890 + struct igb_adapter *adapter = netdev_priv(netdev);
20892 + /* only return the current stats */
20893 + return &adapter->net_stats;
20897 + * igb_change_mtu - Change the Maximum Transfer Unit
20898 + * @netdev: network interface device structure
20899 + * @new_mtu: new value for maximum frame size
20901 + * Returns 0 on success, negative on failure
20904 +static int igb_change_mtu(struct net_device *netdev, int new_mtu)
20906 + struct igb_adapter *adapter = netdev_priv(netdev);
20907 + int max_frame = new_mtu + ETH_HLEN + ETH_FCS_LEN;
20909 + if ((new_mtu < 68) || (max_frame > MAX_JUMBO_FRAME_SIZE)) {
20910 + DPRINTK(PROBE, ERR, "Invalid MTU setting\n");
20914 +#define MAX_STD_JUMBO_FRAME_SIZE 9234
20915 + if (max_frame > MAX_STD_JUMBO_FRAME_SIZE) {
20916 + DPRINTK(PROBE, ERR, "MTU > 9216 not supported.\n");
20920 + while (test_and_set_bit(__IGB_RESETTING, &adapter->state))
20923 + /* igb_down has a dependency on max_frame_size */
20924 + adapter->max_frame_size = max_frame;
20925 + if (netif_running(netdev))
20926 + igb_down(adapter);
20928 + /* NOTE: netdev_alloc_skb reserves 16 bytes, and typically NET_IP_ALIGN
20929 + * means we reserve 2 more, this pushes us to allocate from the next
20930 + * larger slab size.
20931 + * i.e. RXBUFFER_2048 --> size-4096 slab
20934 + if (max_frame <= IGB_RXBUFFER_256)
20935 + adapter->rx_buffer_len = IGB_RXBUFFER_256;
20936 + else if (max_frame <= IGB_RXBUFFER_512)
20937 + adapter->rx_buffer_len = IGB_RXBUFFER_512;
20938 + else if (max_frame <= IGB_RXBUFFER_1024)
20939 + adapter->rx_buffer_len = IGB_RXBUFFER_1024;
20940 + else if (max_frame <= IGB_RXBUFFER_2048)
20941 + adapter->rx_buffer_len = IGB_RXBUFFER_2048;
20942 +#ifndef CONFIG_IGB_DISABLE_PACKET_SPLIT
20944 +#if (PAGE_SIZE / 2) > IGB_RXBUFFER_16384
20945 + adapter->rx_buffer_len = IGB_RXBUFFER_16384;
20947 + adapter->rx_buffer_len = PAGE_SIZE / 2;
20950 + else if (max_frame <= IGB_RXBUFFER_4096)
20951 + adapter->rx_buffer_len = IGB_RXBUFFER_4096;
20952 + else if (max_frame <= IGB_RXBUFFER_8192)
20953 + adapter->rx_buffer_len = IGB_RXBUFFER_8192;
20954 + else if (max_frame <= IGB_RXBUFFER_16384)
20955 + adapter->rx_buffer_len = IGB_RXBUFFER_16384;
20957 + /* adjust allocation if LPE protects us, and we aren't using SBP */
20958 + if ((max_frame == ETH_FRAME_LEN + ETH_FCS_LEN) ||
20959 + (max_frame == MAXIMUM_ETHERNET_VLAN_SIZE))
20960 + adapter->rx_buffer_len = MAXIMUM_ETHERNET_VLAN_SIZE;
20962 + DPRINTK(PROBE, INFO, "changing MTU from %d to %d\n",
20963 + netdev->mtu, new_mtu);
20964 + netdev->mtu = new_mtu;
20966 + if (netif_running(netdev))
20969 + igb_reset(adapter);
20971 + clear_bit(__IGB_RESETTING, &adapter->state);
20977 + * igb_update_stats - Update the board statistics counters
20978 + * @adapter: board private structure
20981 +void igb_update_stats(struct igb_adapter *adapter)
20983 + struct e1000_hw *hw = &adapter->hw;
20984 +#ifdef HAVE_PCI_ERS
20985 + struct pci_dev *pdev = adapter->pdev;
20989 +#define PHY_IDLE_ERROR_COUNT_MASK 0x00FF
20992 + * Prevent stats update while adapter is being reset, or if the pci
20993 + * connection is down.
20995 + if (adapter->link_speed == 0)
20997 +#ifdef HAVE_PCI_ERS
20998 + if (pci_channel_offline(pdev))
21002 + adapter->stats.crcerrs += E1000_READ_REG(hw, E1000_CRCERRS);
21003 + adapter->stats.gprc += E1000_READ_REG(hw, E1000_GPRC);
21004 + adapter->stats.gorc += E1000_READ_REG(hw, E1000_GORCL);
21005 + E1000_READ_REG(hw, E1000_GORCH); /* clear GORCL */
21006 + adapter->stats.bprc += E1000_READ_REG(hw, E1000_BPRC);
21007 + adapter->stats.mprc += E1000_READ_REG(hw, E1000_MPRC);
21008 + adapter->stats.roc += E1000_READ_REG(hw, E1000_ROC);
21010 + adapter->stats.prc64 += E1000_READ_REG(hw, E1000_PRC64);
21011 + adapter->stats.prc127 += E1000_READ_REG(hw, E1000_PRC127);
21012 + adapter->stats.prc255 += E1000_READ_REG(hw, E1000_PRC255);
21013 + adapter->stats.prc511 += E1000_READ_REG(hw, E1000_PRC511);
21014 + adapter->stats.prc1023 += E1000_READ_REG(hw, E1000_PRC1023);
21015 + adapter->stats.prc1522 += E1000_READ_REG(hw, E1000_PRC1522);
21016 + adapter->stats.symerrs += E1000_READ_REG(hw, E1000_SYMERRS);
21017 + adapter->stats.sec += E1000_READ_REG(hw, E1000_SEC);
21019 + adapter->stats.mpc += E1000_READ_REG(hw, E1000_MPC);
21020 + adapter->stats.scc += E1000_READ_REG(hw, E1000_SCC);
21021 + adapter->stats.ecol += E1000_READ_REG(hw, E1000_ECOL);
21022 + adapter->stats.mcc += E1000_READ_REG(hw, E1000_MCC);
21023 + adapter->stats.latecol += E1000_READ_REG(hw, E1000_LATECOL);
21024 + adapter->stats.dc += E1000_READ_REG(hw, E1000_DC);
21025 + adapter->stats.rlec += E1000_READ_REG(hw, E1000_RLEC);
21026 + adapter->stats.xonrxc += E1000_READ_REG(hw, E1000_XONRXC);
21027 + adapter->stats.xontxc += E1000_READ_REG(hw, E1000_XONTXC);
21028 + adapter->stats.xoffrxc += E1000_READ_REG(hw, E1000_XOFFRXC);
21029 + adapter->stats.xofftxc += E1000_READ_REG(hw, E1000_XOFFTXC);
21030 + adapter->stats.fcruc += E1000_READ_REG(hw, E1000_FCRUC);
21031 + adapter->stats.gptc += E1000_READ_REG(hw, E1000_GPTC);
21032 + adapter->stats.gotc += E1000_READ_REG(hw, E1000_GOTCL);
21033 + E1000_READ_REG(hw, E1000_GOTCH); /* clear GOTCL */
21034 + adapter->stats.rnbc += E1000_READ_REG(hw, E1000_RNBC);
21035 + adapter->stats.ruc += E1000_READ_REG(hw, E1000_RUC);
21036 + adapter->stats.rfc += E1000_READ_REG(hw, E1000_RFC);
21037 + adapter->stats.rjc += E1000_READ_REG(hw, E1000_RJC);
21038 + adapter->stats.tor += E1000_READ_REG(hw, E1000_TORH);
21039 + adapter->stats.tot += E1000_READ_REG(hw, E1000_TOTH);
21040 + adapter->stats.tpr += E1000_READ_REG(hw, E1000_TPR);
21042 + adapter->stats.ptc64 += E1000_READ_REG(hw, E1000_PTC64);
21043 + adapter->stats.ptc127 += E1000_READ_REG(hw, E1000_PTC127);
21044 + adapter->stats.ptc255 += E1000_READ_REG(hw, E1000_PTC255);
21045 + adapter->stats.ptc511 += E1000_READ_REG(hw, E1000_PTC511);
21046 + adapter->stats.ptc1023 += E1000_READ_REG(hw, E1000_PTC1023);
21047 + adapter->stats.ptc1522 += E1000_READ_REG(hw, E1000_PTC1522);
21049 + adapter->stats.mptc += E1000_READ_REG(hw, E1000_MPTC);
21050 + adapter->stats.bptc += E1000_READ_REG(hw, E1000_BPTC);
21052 + adapter->stats.tpt += E1000_READ_REG(hw, E1000_TPT);
21053 + adapter->stats.colc += E1000_READ_REG(hw, E1000_COLC);
21055 + adapter->stats.algnerrc += E1000_READ_REG(hw, E1000_ALGNERRC);
21056 + adapter->stats.rxerrc += E1000_READ_REG(hw, E1000_RXERRC);
21057 + adapter->stats.tncrs += E1000_READ_REG(hw, E1000_TNCRS);
21058 + adapter->stats.tsctc += E1000_READ_REG(hw, E1000_TSCTC);
21059 + adapter->stats.tsctfc += E1000_READ_REG(hw, E1000_TSCTFC);
21061 + adapter->stats.iac += E1000_READ_REG(hw, E1000_IAC);
21062 + adapter->stats.icrxoc += E1000_READ_REG(hw, E1000_ICRXOC);
21063 + adapter->stats.icrxptc += E1000_READ_REG(hw, E1000_ICRXPTC);
21064 + adapter->stats.icrxatc += E1000_READ_REG(hw, E1000_ICRXATC);
21065 + adapter->stats.ictxptc += E1000_READ_REG(hw, E1000_ICTXPTC);
21066 + adapter->stats.ictxatc += E1000_READ_REG(hw, E1000_ICTXATC);
21067 + adapter->stats.ictxqec += E1000_READ_REG(hw, E1000_ICTXQEC);
21068 + adapter->stats.ictxqmtc += E1000_READ_REG(hw, E1000_ICTXQMTC);
21069 + adapter->stats.icrxdmtc += E1000_READ_REG(hw, E1000_ICRXDMTC);
21071 + /* Fill out the OS statistics structure */
21072 + adapter->net_stats.multicast = adapter->stats.mprc;
21073 + adapter->net_stats.collisions = adapter->stats.colc;
21077 + /* RLEC on some newer hardware can be incorrect so build
21078 + * our own version based on RUC and ROC */
21079 + adapter->net_stats.rx_errors = adapter->stats.rxerrc +
21080 + adapter->stats.crcerrs + adapter->stats.algnerrc +
21081 + adapter->stats.ruc + adapter->stats.roc +
21082 + adapter->stats.cexterr;
21083 + adapter->net_stats.rx_length_errors = adapter->stats.ruc +
21084 + adapter->stats.roc;
21085 + adapter->net_stats.rx_crc_errors = adapter->stats.crcerrs;
21086 + adapter->net_stats.rx_frame_errors = adapter->stats.algnerrc;
21087 + adapter->net_stats.rx_missed_errors = adapter->stats.mpc;
21090 + adapter->net_stats.tx_errors = adapter->stats.ecol +
21091 + adapter->stats.latecol;
21092 + adapter->net_stats.tx_aborted_errors = adapter->stats.ecol;
21093 + adapter->net_stats.tx_window_errors = adapter->stats.latecol;
21094 + adapter->net_stats.tx_carrier_errors = adapter->stats.tncrs;
21096 + /* Tx Dropped needs to be maintained elsewhere */
21099 + if (hw->phy.media_type == e1000_media_type_copper) {
21100 + if ((adapter->link_speed == SPEED_1000) &&
21101 + (!e1000_read_phy_reg(hw, PHY_1000T_STATUS, &phy_tmp))) {
21102 + phy_tmp &= PHY_IDLE_ERROR_COUNT_MASK;
21103 + adapter->phy_stats.idle_errors += phy_tmp;
21107 + /* Management Stats */
21108 + adapter->stats.mgptc += E1000_READ_REG(hw, E1000_MGTPTC);
21109 + adapter->stats.mgprc += E1000_READ_REG(hw, E1000_MGTPRC);
21110 + adapter->stats.mgpdc += E1000_READ_REG(hw, E1000_MGTPDC);
21113 +static irqreturn_t igb_msix_other(int irq, void *data)
21115 + struct net_device *netdev = data;
21116 + struct igb_adapter *adapter = netdev_priv(netdev);
21117 + struct e1000_hw *hw = &adapter->hw;
21119 + u32 icr = E1000_READ_REG(hw, E1000_ICR);
21120 + /* reading ICR causes bit 31 of EICR to be cleared */
21121 + if (!(icr & E1000_ICR_LSC))
21122 + goto no_link_interrupt;
21123 + hw->mac.get_link_status = 1;
21124 + /* guard against interrupt when we're going down */
21125 + if (!test_bit(__IGB_DOWN, &adapter->state))
21126 + mod_timer(&adapter->watchdog_timer, jiffies + 1);
21128 +no_link_interrupt:
21129 + E1000_WRITE_REG(hw, E1000_IMS, E1000_IMS_LSC);
21130 + E1000_WRITE_REG(hw, E1000_EIMS, adapter->eims_other);
21132 + return IRQ_HANDLED;
21136 +#ifdef CONFIG_IGB_SEPARATE_TX_HANDLER
21137 +static irqreturn_t igb_msix_tx(int irq, void *data)
21139 + struct igb_ring *tx_ring = data;
21140 + struct igb_adapter *adapter = tx_ring->adapter;
21141 + struct e1000_hw *hw = &adapter->hw;
21144 + if (adapter->flags & IGB_FLAG_DCA_ENABLED)
21145 + igb_update_tx_dca(tx_ring);
21148 + tx_ring->total_bytes = 0;
21149 + tx_ring->total_packets = 0;
21151 + /* auto mask will automatically reenable the interrupt when we write
21153 + if (!igb_clean_tx_irq(tx_ring))
21154 + /* Ring was not completely cleaned, so fire another interrupt */
21155 + E1000_WRITE_REG(hw, E1000_EICS, tx_ring->eims_value);
21157 + E1000_WRITE_REG(hw, E1000_EIMS, tx_ring->eims_value);
21159 + return IRQ_HANDLED;
21161 +#endif /* CONFIG_IGB_SEPARATE_TX_HANDLER */
21163 +static void igb_write_itr(struct igb_ring *ring)
21165 + struct e1000_hw *hw = &ring->adapter->hw;
21166 + if (ring->set_itr) {
21167 + switch(hw->mac.type) {
21168 + case e1000_82576:
21169 + E1000_WRITE_REG(hw, ring->itr_register,
21174 + E1000_WRITE_REG(hw, ring->itr_register,
21176 + (ring->itr_val << 16));
21179 + ring->set_itr = 0;
21183 +static irqreturn_t igb_msix_rx(int irq, void *data)
21185 + struct igb_ring *rx_ring = data;
21186 + struct igb_adapter *adapter = rx_ring->adapter;
21188 + igb_write_itr(rx_ring);
21189 + if (netif_rx_schedule_prep(adapter->netdev, &rx_ring->napi)) {
21190 + __netif_rx_schedule(adapter->netdev, &rx_ring->napi);
21193 + if (adapter->flags & IGB_FLAG_DCA_ENABLED)
21194 + igb_update_rx_dca(rx_ring);
21197 + return IRQ_HANDLED;
21201 +static void igb_update_rx_dca(struct igb_ring *rx_ring)
21204 + struct igb_adapter *adapter = rx_ring->adapter;
21205 + struct e1000_hw *hw = &adapter->hw;
21206 + int cpu = get_cpu();
21207 + int q = rx_ring->queue_index;
21209 + if (rx_ring->cpu != cpu) {
21210 + dca_rxctrl = E1000_READ_REG(hw, E1000_DCA_RXCTRL(q));
21211 + if (hw->mac.type == e1000_82576) {
21212 + dca_rxctrl &= ~E1000_DCA_RXCTRL_CPUID_MASK_82576;
21213 + dca_rxctrl |= dca3_get_tag(&adapter->pdev->dev, cpu) <<
21214 + E1000_DCA_RXCTRL_CPUID_SHIFT;
21216 + dca_rxctrl &= ~E1000_DCA_RXCTRL_CPUID_MASK;
21217 + dca_rxctrl |= dca3_get_tag(&adapter->pdev->dev, cpu);
21219 + dca_rxctrl |= E1000_DCA_RXCTRL_DESC_DCA_EN;
21220 + dca_rxctrl |= E1000_DCA_RXCTRL_HEAD_DCA_EN;
21221 + dca_rxctrl |= E1000_DCA_RXCTRL_DATA_DCA_EN;
21222 + E1000_WRITE_REG(hw, E1000_DCA_RXCTRL(q), dca_rxctrl);
21223 + rx_ring->cpu = cpu;
21228 +static void igb_update_tx_dca(struct igb_ring *tx_ring)
21231 + struct igb_adapter *adapter = tx_ring->adapter;
21232 + struct e1000_hw *hw = &adapter->hw;
21233 + int cpu = get_cpu();
21234 + int q = tx_ring->queue_index;
21236 + if (tx_ring->cpu != cpu) {
21237 + dca_txctrl = E1000_READ_REG(hw, E1000_DCA_TXCTRL(q));
21238 + if (hw->mac.type == e1000_82576) {
21239 + dca_txctrl &= ~E1000_DCA_TXCTRL_CPUID_MASK_82576;
21240 + dca_txctrl |= dca3_get_tag(&adapter->pdev->dev, cpu) <<
21241 + E1000_DCA_TXCTRL_CPUID_SHIFT;
21243 + dca_txctrl &= ~E1000_DCA_TXCTRL_CPUID_MASK;
21244 + dca_txctrl |= dca3_get_tag(&adapter->pdev->dev, cpu);
21246 + dca_txctrl |= E1000_DCA_TXCTRL_DESC_DCA_EN;
21247 + E1000_WRITE_REG(hw, E1000_DCA_TXCTRL(q), dca_txctrl);
21248 + tx_ring->cpu = cpu;
21253 +static void igb_setup_dca(struct igb_adapter *adapter)
21257 + if (!(adapter->flags & IGB_FLAG_DCA_ENABLED))
21260 + for (i = 0; i < adapter->num_tx_queues; i++) {
21261 + adapter->tx_ring[i].cpu = -1;
21262 + igb_update_tx_dca(&adapter->tx_ring[i]);
21264 + for (i = 0; i < adapter->num_rx_queues; i++) {
21265 + adapter->rx_ring[i].cpu = -1;
21266 + igb_update_rx_dca(&adapter->rx_ring[i]);
21270 +static int __igb_notify_dca(struct device *dev, void *data)
21272 + struct net_device *netdev = dev_get_drvdata(dev);
21273 + struct igb_adapter *adapter = netdev_priv(netdev);
21274 + struct e1000_hw *hw = &adapter->hw;
21275 + unsigned long event = *(unsigned long *)data;
21277 + if (!(adapter->flags & IGB_FLAG_HAS_DCA))
21281 + case DCA_PROVIDER_ADD:
21282 + /* if we're already enabled, don't do it again */
21283 + if (adapter->flags & IGB_FLAG_DCA_ENABLED)
21285 + adapter->flags |= IGB_FLAG_DCA_ENABLED;
21286 + /* Always use CB2 mode, difference is masked
21287 + * in the CB driver. */
21288 + E1000_WRITE_REG(hw, E1000_DCA_CTRL, 2);
21289 + if (dca_add_requester(dev) == E1000_SUCCESS) {
21290 + DPRINTK(PROBE, INFO, "DCA enabled\n");
21291 + igb_setup_dca(adapter);
21294 + /* Fall Through since DCA is disabled. */
21295 + case DCA_PROVIDER_REMOVE:
21296 + if (adapter->flags & IGB_FLAG_DCA_ENABLED) {
21297 + /* without this a class_device is left
21298 + * hanging around in the sysfs model */
21299 + dca_remove_requester(dev);
21300 + DPRINTK(PROBE, INFO, "DCA disabled\n");
21301 + adapter->flags &= ~IGB_FLAG_DCA_ENABLED;
21302 + E1000_WRITE_REG(hw, E1000_DCA_CTRL, 1);
21308 + return E1000_SUCCESS;
21311 +static int igb_notify_dca(struct notifier_block *nb, unsigned long event,
21316 + ret_val = driver_for_each_device(&igb_driver.driver, NULL, &event,
21317 + __igb_notify_dca);
21319 + return ret_val ? NOTIFY_BAD : NOTIFY_DONE;
21321 +#endif /* IGB_DCA */
21324 + * igb_intr_msi - Interrupt Handler
21325 + * @irq: interrupt number
21326 + * @data: pointer to a network interface device structure
21328 +static irqreturn_t igb_intr_msi(int irq, void *data)
21330 + struct net_device *netdev = data;
21331 + struct igb_adapter *adapter = netdev_priv(netdev);
21332 + struct e1000_hw *hw = &adapter->hw;
21333 + /* read ICR disables interrupts using IAM */
21334 + u32 icr = E1000_READ_REG(hw, E1000_ICR);
21336 + igb_write_itr(adapter->rx_ring);
21338 + if (icr & (E1000_ICR_RXSEQ | E1000_ICR_LSC)) {
21339 + hw->mac.get_link_status = 1;
21340 + if (!test_bit(__IGB_DOWN, &adapter->state))
21341 + mod_timer(&adapter->watchdog_timer, jiffies + 1);
21344 + netif_rx_schedule(netdev, &adapter->rx_ring[0].napi);
21346 + return IRQ_HANDLED;
21350 + * igb_intr - Legacy Interrupt Handler
21351 + * @irq: interrupt number
21352 + * @data: pointer to a network interface device structure
21355 +static irqreturn_t igb_intr(int irq, void *data)
21357 + struct net_device *netdev = data;
21358 + struct igb_adapter *adapter = netdev_priv(netdev);
21359 + struct e1000_hw *hw = &adapter->hw;
21360 + /* Interrupt Auto-Mask...upon reading ICR, interrupts are masked. No
21361 + * need for the IMC write */
21362 + u32 icr = E1000_READ_REG(hw, E1000_ICR);
21365 + return IRQ_NONE; /* Not our interrupt */
21367 + igb_write_itr(adapter->rx_ring);
21369 + /* IMS will not auto-mask if INT_ASSERTED is not set, and if it is
21370 + * not set, then the adapter didn't send an interrupt */
21371 + if (!(icr & E1000_ICR_INT_ASSERTED))
21374 + eicr = E1000_READ_REG(hw, E1000_EICR);
21376 + if (icr & (E1000_ICR_RXSEQ | E1000_ICR_LSC)) {
21377 + hw->mac.get_link_status = 1;
21378 + /* guard against interrupt when we're going down */
21379 + if (!test_bit(__IGB_DOWN, &adapter->state))
21380 + mod_timer(&adapter->watchdog_timer, jiffies + 1);
21383 + netif_rx_schedule(netdev, &adapter->rx_ring[0].napi);
21386 + return IRQ_HANDLED;
21390 + * igb_poll - NAPI Rx polling callback
21391 + * @napi: napi polling structure
21392 + * @budget: count of how many packets we should handle
21395 +static int igb_poll(struct napi_struct *napi, int budget)
21397 + struct igb_ring *rx_ring = container_of(napi, struct igb_ring, napi);
21398 + struct igb_adapter *adapter = rx_ring->adapter;
21399 + struct net_device *netdev = adapter->netdev;
21400 + int tx_clean_complete, work_done = 0;
21402 + /* this poll routine only supports one tx and one rx queue */
21404 + if (adapter->flags & IGB_FLAG_DCA_ENABLED)
21405 + igb_update_tx_dca(&adapter->tx_ring[0]);
21407 + tx_clean_complete = igb_clean_tx_irq(&adapter->tx_ring[0]);
21410 + if (adapter->flags & IGB_FLAG_DCA_ENABLED)
21411 + igb_update_rx_dca(&adapter->rx_ring[0]);
21413 + igb_clean_rx_irq_adv(&adapter->rx_ring[0], &work_done, budget);
21415 + /* If no Tx and not enough Rx work done, exit the polling mode */
21416 + if ((tx_clean_complete && (work_done == 0)) || !netif_running(netdev)) {
21417 + netif_rx_complete(netdev, napi);
21418 + if (adapter->itr_setting & 3)
21419 + igb_set_itr(adapter);
21420 + if (!test_bit(__IGB_DOWN, &adapter->state))
21421 + igb_irq_enable(adapter);
21425 + if (!tx_clean_complete)
21426 + work_done = budget;
21428 + return work_done;
21431 +static int igb_clean_rx_ring_msix(struct napi_struct *napi, int budget)
21433 + struct igb_ring *rx_ring = container_of(napi, struct igb_ring, napi);
21434 + struct igb_adapter *adapter = rx_ring->adapter;
21435 + struct e1000_hw *hw = &adapter->hw;
21436 + struct net_device *netdev = adapter->netdev;
21437 + int tx_clean_complete = 1;
21438 + int work_done = 0;
21441 + if (adapter->flags & IGB_FLAG_DCA_ENABLED)
21442 + igb_update_rx_dca(rx_ring);
21444 + igb_clean_rx_irq_adv(rx_ring, &work_done, budget);
21446 + if (rx_ring->buddy) {
21448 + if (adapter->flags & IGB_FLAG_DCA_ENABLED)
21449 + igb_update_tx_dca(rx_ring->buddy);
21451 + tx_clean_complete = igb_clean_tx_irq(rx_ring->buddy);
21454 + /* If not enough Rx work done, exit the polling mode */
21455 + if ((tx_clean_complete && (work_done == 0)) || !netif_running(netdev)) {
21456 + netif_rx_complete(netdev, napi);
21457 + if (adapter->itr_setting & 3) {
21458 + if (adapter->num_rx_queues == 1)
21459 + igb_set_itr(adapter);
21461 + igb_update_ring_itr(rx_ring);
21463 + if (!test_bit(__IGB_DOWN, &adapter->state))
21464 + E1000_WRITE_REG(hw, E1000_EIMS, rx_ring->eims_value);
21469 + if (!tx_clean_complete)
21470 + work_done = budget;
21472 + return work_done;
21475 +static inline u32 get_head(struct igb_ring *tx_ring)
21477 + void *end = (struct e1000_tx_desc *)tx_ring->desc + tx_ring->count;
21478 + return le32_to_cpu(*(volatile __le32 *)end);
21482 + * igb_clean_tx_irq - Reclaim resources after transmit completes
21483 + * @adapter: board private structure
21484 + * returns TRUE if ring is completely cleaned
21486 +static bool igb_clean_tx_irq(struct igb_ring *tx_ring)
21488 + struct igb_adapter *adapter = tx_ring->adapter;
21489 + struct e1000_hw *hw = &adapter->hw;
21490 + struct net_device *netdev = adapter->netdev;
21491 + struct e1000_tx_desc *tx_desc;
21492 + struct igb_buffer *buffer_info;
21493 + struct sk_buff *skb;
21495 + u32 head, oldhead;
21496 + unsigned int count = 0;
21497 + unsigned int total_bytes = 0, total_packets = 0;
21498 + bool retval = TRUE;
21501 + head = get_head(tx_ring);
21502 + i = tx_ring->next_to_clean;
21504 + while (i != head) {
21505 + tx_desc = E1000_TX_DESC(*tx_ring, i);
21506 + buffer_info = &tx_ring->buffer_info[i];
21507 + skb = buffer_info->skb;
21510 +#ifdef NETIF_F_TSO
21511 + unsigned int segs, bytecount;
21513 + /* gso_segs is currently only valid for tcp */
21514 + segs = skb_shinfo(skb)->gso_segs ?: 1;
21515 + /* multiply data chunks by size of headers */
21516 + bytecount = ((segs - 1) * skb_headlen(skb)) +
21518 + total_packets += segs;
21519 + total_bytes += bytecount;
21522 + total_bytes += skb->len;
21526 + igb_unmap_and_free_tx_resource(adapter, buffer_info);
21529 + if (i == tx_ring->count)
21533 + if (count == tx_ring->count) {
21535 + goto done_cleaning;
21540 + head = get_head(tx_ring);
21541 + if (head == oldhead)
21542 + goto done_cleaning;
21543 + } /* while (1) */
21546 + tx_ring->next_to_clean = i;
21548 + if (unlikely(count &&
21549 + netif_carrier_ok(netdev) &&
21550 + IGB_DESC_UNUSED(tx_ring) >= IGB_TX_QUEUE_WAKE)) {
21551 + /* Make sure that anybody stopping the queue after this
21552 + * sees the new next_to_clean.
21556 + if (__netif_subqueue_stopped(netdev, tx_ring->queue_index) &&
21557 + !(test_bit(__IGB_DOWN, &adapter->state))) {
21558 + netif_wake_subqueue(netdev, tx_ring->queue_index);
21559 + ++adapter->restart_queue;
21562 + if (netif_queue_stopped(netdev) &&
21563 + !(test_bit(__IGB_DOWN, &adapter->state))) {
21564 + netif_wake_queue(netdev);
21565 + ++adapter->restart_queue;
21568 + if (tx_ring->detect_tx_hung) {
21569 + /* Detect a transmit hang in hardware, this serializes the
21570 + * check with the clearing of time_stamp and movement of i */
21571 + tx_ring->detect_tx_hung = FALSE;
21572 + if (tx_ring->buffer_info[i].time_stamp &&
21573 + time_after(jiffies, tx_ring->buffer_info[i].time_stamp +
21574 + (adapter->tx_timeout_factor * HZ))
21575 + && !(E1000_READ_REG(hw, E1000_STATUS) &
21576 + E1000_STATUS_TXOFF)) {
21578 + tx_desc = E1000_TX_DESC(*tx_ring, i);
21579 + /* detected Tx unit hang */
21580 + DPRINTK(DRV, ERR, "Detected Tx Unit Hang\n"
21581 + " Tx Queue <%lu>\n"
21584 + " next_to_use <%x>\n"
21585 + " next_to_clean <%x>\n"
21586 + " head (WB) <%x>\n"
21587 + "buffer_info[next_to_clean]\n"
21588 + " time_stamp <%lx>\n"
21589 + " jiffies <%lx>\n"
21590 + " desc.status <%x>\n",
21591 + (unsigned long)((tx_ring->queue_index) /
21592 + sizeof(struct igb_ring)),
21593 + readl(hw->hw_addr + tx_ring->head),
21594 + readl(hw->hw_addr + tx_ring->tail),
21595 + tx_ring->next_to_use,
21596 + tx_ring->next_to_clean,
21598 + tx_ring->buffer_info[i].time_stamp,
21600 + tx_desc->upper.fields.status);
21601 + if (netif_is_multiqueue(netdev))
21602 + netif_stop_subqueue(netdev,
21603 + tx_ring->queue_index);
21605 + netif_stop_queue(netdev);
21608 + tx_ring->total_bytes += total_bytes;
21609 + tx_ring->total_packets += total_packets;
21610 + tx_ring->tx_stats.packets += total_packets;
21611 + tx_ring->tx_stats.bytes += total_bytes;
21612 + adapter->net_stats.tx_bytes += total_bytes;
21613 + adapter->net_stats.tx_packets += total_packets;
21619 + * igb_get_skb_hdr - helper function for LRO header processing
21620 + * @skb: pointer to sk_buff to be added to LRO packet
21621 + * @iphdr: pointer to ip header structure
21622 + * @tcph: pointer to tcp header structure
21623 + * @hdr_flags: pointer to header flags
21624 + * @priv: pointer to the receive descriptor for the current sk_buff
21626 +static int igb_get_skb_hdr(struct sk_buff *skb, void **iphdr, void **tcph,
21627 + u64 *hdr_flags, void *priv)
21629 + union e1000_adv_rx_desc *rx_desc = priv;
21630 + u16 pkt_type = rx_desc->wb.lower.lo_dword.hs_rss.pkt_info &
21631 + (E1000_RXDADV_PKTTYPE_IPV4 | E1000_RXDADV_PKTTYPE_TCP);
21633 + /* Verify that this is a valid IPv4 TCP packet */
21634 + if (pkt_type != (E1000_RXDADV_PKTTYPE_IPV4 |
21635 + E1000_RXDADV_PKTTYPE_TCP))
21638 + /* Set network headers */
21639 + skb_reset_network_header(skb);
21640 + skb_set_transport_header(skb, ip_hdrlen(skb));
21641 + *iphdr = ip_hdr(skb);
21642 + *tcph = tcp_hdr(skb);
21643 + *hdr_flags = LRO_IPV4 | LRO_TCP;
21648 +#endif /* IGB_LRO */
21651 + * igb_receive_skb - helper function to handle rx indications
21652 + * @adapter: board private structure
21653 + * @status: descriptor status field as written by hardware
21654 + * @rx_desc: receive descriptor containing vlan and type information.
21655 + * @skb: pointer to sk_buff to be indicated to stack
21657 +static void igb_receive_skb(struct igb_ring *ring, u8 status,
21658 + union e1000_adv_rx_desc * rx_desc,
21659 + struct sk_buff *skb)
21661 + struct igb_adapter * adapter = ring->adapter;
21662 + bool vlan_extracted = (adapter->vlgrp && (status & E1000_RXD_STAT_VP));
21665 + if (adapter->netdev->features & NETIF_F_LRO &&
21666 + skb->ip_summed == CHECKSUM_UNNECESSARY) {
21667 + if (vlan_extracted)
21668 + lro_vlan_hwaccel_receive_skb(&ring->lro_mgr, skb,
21670 + le16_to_cpu(rx_desc->wb.upper.vlan),
21673 + lro_receive_skb(&ring->lro_mgr,skb, rx_desc);
21674 + ring->lro_used = TRUE;
21677 + if (vlan_extracted)
21678 + vlan_hwaccel_receive_skb(skb, adapter->vlgrp,
21679 + le16_to_cpu(rx_desc->wb.upper.vlan));
21682 + netif_receive_skb(skb);
21689 +static inline void igb_rx_checksum_adv(struct igb_adapter *adapter,
21690 + u32 status_err, struct sk_buff *skb)
21692 + skb->ip_summed = CHECKSUM_NONE;
21694 + /* Ignore Checksum bit is set or checksum is disabled through ethtool */
21695 + if ((status_err & E1000_RXD_STAT_IXSM) || !adapter->rx_csum)
21697 + /* TCP/UDP checksum error bit is set */
21699 + (E1000_RXDEXT_STATERR_TCPE | E1000_RXDEXT_STATERR_IPE)) {
21700 + /* let the stack verify checksum errors */
21701 + adapter->hw_csum_err++;
21704 + /* It must be a TCP or UDP packet with a valid checksum */
21705 + if (status_err & (E1000_RXD_STAT_TCPCS | E1000_RXD_STAT_UDPCS))
21706 + skb->ip_summed = CHECKSUM_UNNECESSARY;
21708 + adapter->hw_csum_good++;
21711 +static bool igb_clean_rx_irq_adv(struct igb_ring *rx_ring,
21712 + int *work_done, int work_to_do)
21714 + struct igb_adapter *adapter = rx_ring->adapter;
21715 + struct net_device *netdev = adapter->netdev;
21716 + struct pci_dev *pdev = adapter->pdev;
21717 + union e1000_adv_rx_desc *rx_desc , *next_rxd;
21718 + struct igb_buffer *buffer_info , *next_buffer;
21719 + struct sk_buff *skb;
21720 + bool cleaned = FALSE;
21721 + int cleaned_count = 0;
21722 + unsigned int total_bytes = 0, total_packets = 0;
21724 +#ifndef CONFIG_IGB_DISABLE_PACKET_SPLIT
21725 + u32 length, hlen, staterr;
21727 + u32 length, staterr;
21730 + i = rx_ring->next_to_clean;
21731 + rx_desc = E1000_RX_DESC_ADV(*rx_ring, i);
21732 + staterr = le32_to_cpu(rx_desc->wb.upper.status_error);
21734 + while (staterr & E1000_RXD_STAT_DD) {
21736 + if (*work_done >= work_to_do)
21740 + buffer_info = &rx_ring->buffer_info[i];
21742 +#ifndef CONFIG_IGB_DISABLE_PACKET_SPLIT
21743 + /* HW will not DMA in data larger than the given buffer, even
21744 + * if it parses the (NFS, of course) header to be larger. In
21745 + * that case, it fills the header buffer and spills the rest
21748 + hlen = (le16_to_cpu(rx_desc->wb.lower.lo_dword.hs_rss.hdr_info) &
21749 + E1000_RXDADV_HDRBUFLEN_MASK) >> E1000_RXDADV_HDRBUFLEN_SHIFT;
21750 + if (hlen > adapter->rx_ps_hdr_size)
21751 + hlen = adapter->rx_ps_hdr_size;
21753 +#endif /* CONFIG_IGB_DISABLE_PACKET_SPLIT */
21754 + if (staterr & E1000_RXD_STAT_DYNINT)
21755 + adapter->lli_int++;
21757 + length = le16_to_cpu(rx_desc->wb.upper.length);
21761 +#ifdef CONFIG_IGB_DISABLE_PACKET_SPLIT
21762 + skb = buffer_info->skb;
21763 + prefetch(skb->data - NET_IP_ALIGN);
21764 + buffer_info->skb = NULL;
21765 + pci_unmap_single(pdev, buffer_info->dma,
21766 + adapter->rx_buffer_len +
21768 + PCI_DMA_FROMDEVICE);
21769 + skb_put(skb, length);
21771 + skb = buffer_info->skb;
21772 + prefetch(skb->data - NET_IP_ALIGN);
21773 + buffer_info->skb = NULL;
21774 + if (!adapter->rx_ps_hdr_size) {
21775 + pci_unmap_single(pdev, buffer_info->dma,
21776 + adapter->rx_buffer_len +
21778 + PCI_DMA_FROMDEVICE);
21779 + skb_put(skb, length);
21783 + if (!skb_shinfo(skb)->nr_frags) {
21784 + pci_unmap_single(pdev, buffer_info->dma,
21785 + adapter->rx_ps_hdr_size + NET_IP_ALIGN,
21786 + PCI_DMA_FROMDEVICE);
21787 + skb_put(skb, hlen);
21791 + pci_unmap_page(pdev, buffer_info->page_dma,
21793 + PCI_DMA_FROMDEVICE);
21794 + buffer_info->page_dma = 0;
21796 + skb_fill_page_desc(skb, skb_shinfo(skb)->nr_frags++,
21797 + buffer_info->page,
21798 + buffer_info->page_offset,
21801 + if ((adapter->rx_buffer_len > (PAGE_SIZE / 2)) ||
21802 + (page_count(buffer_info->page) != 1))
21803 + buffer_info->page = NULL;
21805 + get_page(buffer_info->page);
21807 + skb->len += length;
21808 + skb->data_len += length;
21810 + skb->truesize += length;
21813 +#endif /* CONFIG_IGB_DISABLE_PACKET_SPLIT */
21815 + if (i == rx_ring->count)
21817 + next_rxd = E1000_RX_DESC_ADV(*rx_ring, i);
21818 + prefetch(next_rxd);
21819 + next_buffer = &rx_ring->buffer_info[i];
21821 + if (!(staterr & E1000_RXD_STAT_EOP)) {
21822 + buffer_info->skb = next_buffer->skb;
21823 + buffer_info->dma = next_buffer->dma;
21824 + next_buffer->skb = skb;
21825 + next_buffer->dma = 0;
21829 + if (staterr & E1000_RXDEXT_ERR_FRAME_ERR_MASK) {
21830 + dev_kfree_skb_irq(skb);
21834 + total_bytes += skb->len;
21837 + igb_rx_checksum_adv(adapter, staterr, skb);
21839 + skb->protocol = eth_type_trans(skb, netdev);
21841 + igb_receive_skb(rx_ring, staterr, rx_desc, skb);
21843 + netdev->last_rx = jiffies;
21846 + rx_desc->wb.upper.status_error = 0;
21848 + /* return some buffers to hardware, one at a time is too slow */
21849 + if (cleaned_count >= IGB_RX_BUFFER_WRITE) {
21850 + igb_alloc_rx_buffers_adv(rx_ring, cleaned_count);
21851 + cleaned_count = 0;
21854 + /* use prefetched values */
21855 + rx_desc = next_rxd;
21856 + buffer_info = next_buffer;
21858 + staterr = le32_to_cpu(rx_desc->wb.upper.status_error);
21861 + rx_ring->next_to_clean = i;
21862 + cleaned_count = IGB_DESC_UNUSED(rx_ring);
21865 + if (rx_ring->lro_used) {
21866 + lro_flush_all(&rx_ring->lro_mgr);
21867 + rx_ring->lro_used = FALSE;
21871 + if (cleaned_count)
21872 + igb_alloc_rx_buffers_adv(rx_ring, cleaned_count);
21874 + rx_ring->total_packets += total_packets;
21875 + rx_ring->total_bytes += total_bytes;
21876 + rx_ring->rx_stats.packets += total_packets;
21877 + rx_ring->rx_stats.bytes += total_bytes;
21878 + adapter->net_stats.rx_bytes += total_bytes;
21879 + adapter->net_stats.rx_packets += total_packets;
21885 + * igb_alloc_rx_buffers_adv - Replace used receive buffers; packet split
21886 + * @adapter: address of board private structure
21889 +static void igb_alloc_rx_buffers_adv(struct igb_ring *rx_ring,
21890 + int cleaned_count)
21892 + struct igb_adapter *adapter = rx_ring->adapter;
21893 + struct net_device *netdev = adapter->netdev;
21894 + struct pci_dev *pdev = adapter->pdev;
21895 + union e1000_adv_rx_desc *rx_desc;
21896 + struct igb_buffer *buffer_info;
21897 + struct sk_buff *skb;
21901 + i = rx_ring->next_to_use;
21902 + buffer_info = &rx_ring->buffer_info[i];
21904 +#ifndef CONFIG_IGB_DISABLE_PACKET_SPLIT
21905 + if (adapter->rx_ps_hdr_size)
21906 + bufsz = adapter->rx_ps_hdr_size;
21908 + bufsz = adapter->rx_buffer_len;
21909 + bufsz += NET_IP_ALIGN;
21911 + bufsz = adapter->rx_buffer_len + NET_IP_ALIGN;
21912 +#endif /* CONFIG_IGB_DISABLE_PACKET_SPLIT */
21914 + while (cleaned_count--) {
21915 + rx_desc = E1000_RX_DESC_ADV(*rx_ring, i);
21917 +#ifndef CONFIG_IGB_DISABLE_PACKET_SPLIT
21918 + if (adapter->rx_ps_hdr_size && !buffer_info->page_dma) {
21919 + if (!buffer_info->page) {
21920 + buffer_info->page = alloc_page(GFP_ATOMIC);
21921 + if (!buffer_info->page) {
21922 + adapter->alloc_rx_buff_failed++;
21925 + buffer_info->page_offset = 0;
21927 + buffer_info->page_offset ^= PAGE_SIZE / 2;
21929 + buffer_info->page_dma =
21930 + pci_map_page(pdev, buffer_info->page,
21931 + buffer_info->page_offset,
21933 + PCI_DMA_FROMDEVICE);
21935 +#endif /* CONFIG_IGB_DISABLE_PACKET_SPLIT */
21937 + if (!buffer_info->skb) {
21938 + skb = netdev_alloc_skb(netdev, bufsz);
21940 + adapter->alloc_rx_buff_failed++;
21944 + /* Make buffer alignment 2 beyond a 16 byte boundary
21945 + * this will result in a 16 byte aligned IP header after
21946 + * the 14 byte MAC header is removed
21948 + skb_reserve(skb, NET_IP_ALIGN);
21950 + buffer_info->skb = skb;
21951 + buffer_info->dma = pci_map_single(pdev, skb->data,
21953 + PCI_DMA_FROMDEVICE);
21955 + /* Refresh the desc even if buffer_addrs didn't change because
21956 + * each write-back erases this info. */
21957 +#ifndef CONFIG_IGB_DISABLE_PACKET_SPLIT
21958 + if (adapter->rx_ps_hdr_size) {
21959 + rx_desc->read.pkt_addr =
21960 + cpu_to_le64(buffer_info->page_dma);
21961 + rx_desc->read.hdr_addr = cpu_to_le64(buffer_info->dma);
21965 +#endif /* CONFIG_IGB_DISABLE_PACKET_SPLIT */
21966 + rx_desc->read.pkt_addr =
21967 + cpu_to_le64(buffer_info->dma);
21968 + rx_desc->read.hdr_addr = 0;
21972 + if (i == rx_ring->count)
21974 + buffer_info = &rx_ring->buffer_info[i];
21978 + if (rx_ring->next_to_use != i) {
21979 + rx_ring->next_to_use = i;
21981 + i = (rx_ring->count - 1);
21985 + /* Force memory writes to complete before letting h/w
21986 + * know there are new descriptors to fetch. (Only
21987 + * applicable for weak-ordered memory model archs,
21988 + * such as IA-64). */
21990 + writel(i, adapter->hw.hw_addr + rx_ring->tail);
21994 +#ifdef SIOCGMIIPHY
21996 + * igb_mii_ioctl -
22002 +static int igb_mii_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd)
22004 + struct igb_adapter *adapter = netdev_priv(netdev);
22005 + struct mii_ioctl_data *data = if_mii(ifr);
22007 + if (adapter->hw.phy.media_type != e1000_media_type_copper)
22008 + return -EOPNOTSUPP;
22011 + case SIOCGMIIPHY:
22012 + data->phy_id = adapter->hw.phy.addr;
22014 + case SIOCGMIIREG:
22015 + if (!capable(CAP_NET_ADMIN))
22017 + if (e1000_read_phy_reg(&adapter->hw, data->reg_num & 0x1F,
22021 + case SIOCSMIIREG:
22023 + return -EOPNOTSUPP;
22025 + return E1000_SUCCESS;
22036 +static int igb_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd)
22039 +#ifdef SIOCGMIIPHY
22040 + case SIOCGMIIPHY:
22041 + case SIOCGMIIREG:
22042 + case SIOCSMIIREG:
22043 + return igb_mii_ioctl(netdev, ifr, cmd);
22045 +#ifdef ETHTOOL_OPS_COMPAT
22046 + case SIOCETHTOOL:
22047 + return ethtool_ioctl(ifr);
22050 + return -EOPNOTSUPP;
22054 +void e1000_read_pci_cfg(struct e1000_hw *hw, u32 reg, u16 *value)
22056 + struct igb_adapter *adapter = hw->back;
22058 + pci_read_config_word(adapter->pdev, reg, value);
22062 +s32 e1000_read_pcie_cap_reg(struct e1000_hw *hw, u32 reg, u16 *value)
22064 + struct igb_adapter *adapter = hw->back;
22067 + cap_offset = pci_find_capability(adapter->pdev, PCI_CAP_ID_EXP);
22069 + return -E1000_ERR_CONFIG;
22071 + pci_read_config_word(adapter->pdev, cap_offset + reg, value);
22073 + return E1000_SUCCESS;
22076 +static void igb_vlan_rx_register(struct net_device *netdev,
22077 + struct vlan_group *grp)
22079 + struct igb_adapter *adapter = netdev_priv(netdev);
22080 + struct e1000_hw *hw = &adapter->hw;
22083 + igb_irq_disable(adapter);
22084 + adapter->vlgrp = grp;
22087 + /* enable VLAN tag insert/strip */
22088 + ctrl = E1000_READ_REG(hw, E1000_CTRL);
22089 + ctrl |= E1000_CTRL_VME;
22090 + E1000_WRITE_REG(hw, E1000_CTRL, ctrl);
22092 + /* Disable CFI check */
22093 + rctl = E1000_READ_REG(hw, E1000_RCTL);
22094 + rctl &= ~E1000_RCTL_CFIEN;
22095 + E1000_WRITE_REG(hw, E1000_RCTL, rctl);
22096 + igb_update_mng_vlan(adapter);
22097 + E1000_WRITE_REG(hw, E1000_RLPML,
22098 + adapter->max_frame_size + VLAN_TAG_SIZE);
22100 + /* disable VLAN tag insert/strip */
22101 + ctrl = E1000_READ_REG(hw, E1000_CTRL);
22102 + ctrl &= ~E1000_CTRL_VME;
22103 + E1000_WRITE_REG(hw, E1000_CTRL, ctrl);
22105 + if (adapter->mng_vlan_id != (u16)IGB_MNG_VLAN_NONE) {
22106 + igb_vlan_rx_kill_vid(netdev, adapter->mng_vlan_id);
22107 + adapter->mng_vlan_id = IGB_MNG_VLAN_NONE;
22109 + E1000_WRITE_REG(hw, E1000_RLPML,
22110 + adapter->max_frame_size);
22113 + if (!test_bit(__IGB_DOWN, &adapter->state))
22114 + igb_irq_enable(adapter);
22117 +static void igb_vlan_rx_add_vid(struct net_device *netdev, u16 vid)
22119 + struct igb_adapter *adapter = netdev_priv(netdev);
22120 + struct e1000_hw *hw = &adapter->hw;
22122 + struct net_device *v_netdev;
22124 + if ((hw->mng_cookie.status &
22125 + E1000_MNG_DHCP_COOKIE_STATUS_VLAN) &&
22126 + (vid == adapter->mng_vlan_id))
22128 + /* add VID to filter table */
22129 + index = (vid >> 5) & 0x7F;
22130 + vfta = E1000_READ_REG_ARRAY(hw, E1000_VFTA, index);
22131 + vfta |= (1 << (vid & 0x1F));
22132 + e1000_write_vfta(hw, index, vfta);
22133 + /* Copy feature flags from netdev to the vlan netdev for this vid.
22134 + * This allows things like TSO to bubble down to our vlan device.
22136 + v_netdev = vlan_group_get_device(adapter->vlgrp, vid);
22137 + v_netdev->features |= adapter->netdev->features;
22138 + vlan_group_set_device(adapter->vlgrp, vid, v_netdev);
22141 +static void igb_vlan_rx_kill_vid(struct net_device *netdev, u16 vid)
22143 + struct igb_adapter *adapter = netdev_priv(netdev);
22144 + struct e1000_hw *hw = &adapter->hw;
22147 + igb_irq_disable(adapter);
22148 + vlan_group_set_device(adapter->vlgrp, vid, NULL);
22150 + if (!test_bit(__IGB_DOWN, &adapter->state))
22151 + igb_irq_enable(adapter);
22153 + if ((adapter->hw.mng_cookie.status &
22154 + E1000_MNG_DHCP_COOKIE_STATUS_VLAN) &&
22155 + (vid == adapter->mng_vlan_id)) {
22156 + /* release control to f/w */
22157 + igb_release_hw_control(adapter);
22161 + /* remove VID from filter table */
22162 + index = (vid >> 5) & 0x7F;
22163 + vfta = E1000_READ_REG_ARRAY(hw, E1000_VFTA, index);
22164 + vfta &= ~(1 << (vid & 0x1F));
22165 + e1000_write_vfta(hw, index, vfta);
22168 +static void igb_restore_vlan(struct igb_adapter *adapter)
22170 + igb_vlan_rx_register(adapter->netdev, adapter->vlgrp);
22172 + if (adapter->vlgrp) {
22174 + for (vid = 0; vid < VLAN_GROUP_ARRAY_LEN; vid++) {
22175 + if (!vlan_group_get_device(adapter->vlgrp, vid))
22177 + igb_vlan_rx_add_vid(adapter->netdev, vid);
22182 +int igb_set_spd_dplx(struct igb_adapter *adapter, u16 spddplx)
22184 + struct e1000_mac_info *mac = &adapter->hw.mac;
22186 + mac->autoneg = 0;
22188 + /* Fiber NICs only allow 1000 gbps Full duplex */
22189 + if ((adapter->hw.phy.media_type == e1000_media_type_fiber) &&
22190 + spddplx != (SPEED_1000 + DUPLEX_FULL)) {
22191 + DPRINTK(PROBE, ERR, "Unsupported Speed/Duplex configuration\n");
22195 + switch (spddplx) {
22196 + case SPEED_10 + DUPLEX_HALF:
22197 + mac->forced_speed_duplex = ADVERTISE_10_HALF;
22199 + case SPEED_10 + DUPLEX_FULL:
22200 + mac->forced_speed_duplex = ADVERTISE_10_FULL;
22202 + case SPEED_100 + DUPLEX_HALF:
22203 + mac->forced_speed_duplex = ADVERTISE_100_HALF;
22205 + case SPEED_100 + DUPLEX_FULL:
22206 + mac->forced_speed_duplex = ADVERTISE_100_FULL;
22208 + case SPEED_1000 + DUPLEX_FULL:
22209 + mac->autoneg = 1;
22210 + adapter->hw.phy.autoneg_advertised = ADVERTISE_1000_FULL;
22212 + case SPEED_1000 + DUPLEX_HALF: /* not supported */
22214 + DPRINTK(PROBE, ERR, "Unsupported Speed/Duplex configuration\n");
22220 +#ifdef USE_REBOOT_NOTIFIER
22221 +/* only want to do this for 2.4 kernels? */
22222 +static int igb_notify_reboot(struct notifier_block *nb, unsigned long event,
22225 + struct pci_dev *pdev = NULL;
22230 + case SYS_POWER_OFF:
22231 + while ((pdev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, pdev))) {
22232 + if (pci_dev_driver(pdev) == &igb_driver)
22233 + igb_suspend(pdev, PMSG_SUSPEND);
22236 + return NOTIFY_DONE;
22240 +static int igb_suspend(struct pci_dev *pdev, pm_message_t state)
22242 + struct net_device *netdev = pci_get_drvdata(pdev);
22243 + struct igb_adapter *adapter = netdev_priv(netdev);
22244 + struct e1000_hw *hw = &adapter->hw;
22245 + u32 ctrl, rctl, status;
22246 + u32 wufc = adapter->wol;
22251 + netif_device_detach(netdev);
22253 + if (netif_running(netdev))
22254 + igb_close(netdev);
22256 + igb_reset_interrupt_capability(adapter);
22258 + igb_free_queues(adapter);
22261 + retval = pci_save_state(pdev);
22266 + status = E1000_READ_REG(hw, E1000_STATUS);
22267 + if (status & E1000_STATUS_LU)
22268 + wufc &= ~E1000_WUFC_LNKC;
22271 + igb_setup_rctl(adapter);
22272 + igb_set_multi(netdev);
22274 + /* turn on all-multi mode if wake on multicast is enabled */
22275 + if (wufc & E1000_WUFC_MC) {
22276 + rctl = E1000_READ_REG(hw, E1000_RCTL);
22277 + rctl |= E1000_RCTL_MPE;
22278 + E1000_WRITE_REG(hw, E1000_RCTL, rctl);
22281 + ctrl = E1000_READ_REG(hw, E1000_CTRL);
22282 + /* advertise wake from D3Cold */
22283 + #define E1000_CTRL_ADVD3WUC 0x00100000
22284 + /* phy power management enable */
22285 + #define E1000_CTRL_EN_PHY_PWR_MGMT 0x00200000
22286 + ctrl |= E1000_CTRL_ADVD3WUC;
22287 + E1000_WRITE_REG(hw, E1000_CTRL, ctrl);
22289 + /* Allow time for pending master requests to run */
22290 + e1000_disable_pcie_master(hw);
22292 + E1000_WRITE_REG(hw, E1000_WUC, E1000_WUC_PME_EN);
22293 + E1000_WRITE_REG(hw, E1000_WUFC, wufc);
22295 + E1000_WRITE_REG(hw, E1000_WUC, 0);
22296 + E1000_WRITE_REG(hw, E1000_WUFC, 0);
22299 + /* make sure adapter isn't asleep if manageability/wol is enabled */
22300 + if (wufc || adapter->en_mng_pt) {
22301 + pci_enable_wake(pdev, PCI_D3hot, 1);
22302 + pci_enable_wake(pdev, PCI_D3cold, 1);
22304 + e1000_shutdown_fiber_serdes_link(hw);
22305 + pci_enable_wake(pdev, PCI_D3hot, 0);
22306 + pci_enable_wake(pdev, PCI_D3cold, 0);
22309 + /* Release control of h/w to f/w. If f/w is AMT enabled, this
22310 + * would have already happened in close and is redundant. */
22311 + igb_release_hw_control(adapter);
22313 + pci_disable_device(pdev);
22315 + pci_set_power_state(pdev, pci_choose_state(pdev, state));
22321 +static int igb_resume(struct pci_dev *pdev)
22323 + struct net_device *netdev = pci_get_drvdata(pdev);
22324 + struct igb_adapter *adapter = netdev_priv(netdev);
22325 + struct e1000_hw *hw = &adapter->hw;
22328 + pci_set_power_state(pdev, PCI_D0);
22329 + pci_restore_state(pdev);
22330 + err = pci_enable_device(pdev);
22332 + dev_err(&pdev->dev, "igb: Cannot enable PCI device "
22333 + "from suspend\n");
22336 + pci_set_master(pdev);
22338 + pci_enable_wake(pdev, PCI_D3hot, 0);
22339 + pci_enable_wake(pdev, PCI_D3cold, 0);
22341 + igb_set_interrupt_capability(adapter);
22343 + if (igb_alloc_queues(adapter)) {
22344 + DPRINTK(PROBE, ERR, "Unable to allocate memory for queues\n");
22348 + /* e1000_power_up_phy(adapter); */
22350 + igb_reset(adapter);
22351 + E1000_WRITE_REG(hw, E1000_WUS, ~0);
22353 + if (netif_running(netdev)) {
22354 + err = igb_open(netdev);
22359 + netif_device_attach(netdev);
22365 +#ifndef USE_REBOOT_NOTIFIER
22366 +static void igb_shutdown(struct pci_dev *pdev)
22368 + igb_suspend(pdev, PMSG_SUSPEND);
22372 +#ifdef CONFIG_NET_POLL_CONTROLLER
22374 + * Polling 'interrupt' - used by things like netconsole to send skbs
22375 + * without having to re-enable interrupts. It's not called while
22376 + * the interrupt routine is executing.
22378 +static void igb_netpoll(struct net_device *netdev)
22380 + struct igb_adapter *adapter = netdev_priv(netdev);
22382 + int work_done = 0;
22384 + igb_irq_disable(adapter);
22385 + adapter->flags |= IGB_FLAG_IN_NETPOLL;
22387 +#ifndef CONFIG_IGB_SEPARATE_TX_HANDLER
22388 + for (i = 0; i < adapter->num_tx_queues; i++) {
22389 + igb_clean_tx_irq(&adapter->tx_ring[i]);
22393 + for (i = 0; i < adapter->num_rx_queues; i++) {
22394 + igb_clean_rx_irq_adv(&adapter->rx_ring[i],
22396 + adapter->rx_ring[i].napi.weight);
22398 + adapter->flags &= ~IGB_FLAG_IN_NETPOLL;
22399 + igb_irq_enable(adapter);
22401 +#endif /* CONFIG_NET_POLL_CONTROLLER */
22403 +#ifdef HAVE_PCI_ERS
22405 + * igb_io_error_detected - called when PCI error is detected
22406 + * @pdev: Pointer to PCI device
22407 + * @state: The current pci connection state
22409 + * This function is called after a PCI bus error affecting
22410 + * this device has been detected.
22412 +static pci_ers_result_t igb_io_error_detected(struct pci_dev *pdev,
22413 + pci_channel_state_t state)
22415 + struct net_device *netdev = pci_get_drvdata(pdev);
22416 + struct igb_adapter *adapter = netdev_priv(netdev);
22418 + netif_device_detach(netdev);
22420 + if (netif_running(netdev))
22421 + igb_down(adapter);
22422 + pci_disable_device(pdev);
22424 + /* Request a slot slot reset. */
22425 + return PCI_ERS_RESULT_NEED_RESET;
22429 + * igb_io_slot_reset - called after the pci bus has been reset.
22430 + * @pdev: Pointer to PCI device
22432 + * Restart the card from scratch, as if from a cold-boot. Implementation
22433 + * resembles the first-half of the igb_resume routine.
22435 +static pci_ers_result_t igb_io_slot_reset(struct pci_dev *pdev)
22437 + struct net_device *netdev = pci_get_drvdata(pdev);
22438 + struct igb_adapter *adapter = netdev_priv(netdev);
22439 + struct e1000_hw *hw = &adapter->hw;
22441 + if (pci_enable_device(pdev)) {
22442 + dev_err(&pdev->dev,
22443 + "Cannot re-enable PCI device after reset.\n");
22444 + return PCI_ERS_RESULT_DISCONNECT;
22446 + pci_set_master(pdev);
22447 + pci_restore_state(pdev);
22449 + pci_enable_wake(pdev, PCI_D3hot, 0);
22450 + pci_enable_wake(pdev, PCI_D3cold, 0);
22452 + igb_reset(adapter);
22453 + E1000_WRITE_REG(hw, E1000_WUS, ~0);
22455 + return PCI_ERS_RESULT_RECOVERED;
22459 + * igb_io_resume - called when traffic can start flowing again.
22460 + * @pdev: Pointer to PCI device
22462 + * This callback is called when the error recovery driver tells us that
22463 + * its OK to resume normal operation. Implementation resembles the
22464 + * second-half of the igb_resume routine.
22466 +static void igb_io_resume(struct pci_dev *pdev)
22468 + struct net_device *netdev = pci_get_drvdata(pdev);
22469 + struct igb_adapter *adapter = netdev_priv(netdev);
22471 + if (netif_running(netdev)) {
22472 + if (igb_up(adapter)) {
22473 + dev_err(&pdev->dev, "igb_up failed after reset\n");
22478 + netif_device_attach(netdev);
22480 + /* let the f/w know that the h/w is now under the control of the
22482 + igb_get_hw_control(adapter);
22485 +#endif /* HAVE_PCI_ERS */
22489 Binary files vanilla/drivers/net/igb/igb_main.o and linux-i686-2.6.22/drivers/net/igb/igb_main.o differ
22490 diff -Nru vanilla/drivers/net/igb/.igb_main.o.cmd linux-i686-2.6.22/drivers/net/igb/.igb_main.o.cmd
22491 --- vanilla/drivers/net/igb/.igb_main.o.cmd 1969-12-31 19:00:00.000000000 -0500
22492 +++ linux-i686-2.6.22/drivers/net/igb/.igb_main.o.cmd 2009-07-16 19:52:20.000000000 -0400
22494 +cmd_drivers/net/igb/igb_main.o := gcc -m32 -Wp,-MD,drivers/net/igb/.igb_main.o.d -nostdinc -isystem /usr/lib/gcc/i386-redhat-linux/4.1.2/include -D__KERNEL__ -Iinclude -include include/linux/autoconf.h -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Os -pipe -msoft-float -mregparm=3 -freg-struct-return -mpreferred-stack-boundary=2 -march=i686 -mtune=generic -ffreestanding -maccumulate-outgoing-args -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -Iinclude/asm-i386/mach-generic -Iinclude/asm-i386/mach-default -fno-omit-frame-pointer -fno-optimize-sibling-calls -g -fno-stack-protector -Wdeclaration-after-statement -Wno-pointer-sign -DMODULE -D"KBUILD_STR(s)=\#s" -D"KBUILD_BASENAME=KBUILD_STR(igb_main)" -D"KBUILD_MODNAME=KBUILD_STR(igb)" -c -o drivers/net/igb/.tmp_igb_main.o drivers/net/igb/igb_main.c
22496 +deps_drivers/net/igb/igb_main.o := \
22497 + drivers/net/igb/igb_main.c \
22498 + $(wildcard include/config/igb/separate/tx/handler.h) \
22499 + $(wildcard include/config/pm.h) \
22500 + $(wildcard include/config/net/poll/controller.h) \
22501 + $(wildcard include/config/netdevices/multiqueue.h) \
22502 + $(wildcard include/config/igb/disable/packet/split.h) \
22503 + include/linux/module.h \
22504 + $(wildcard include/config/modules.h) \
22505 + $(wildcard include/config/modversions.h) \
22506 + $(wildcard include/config/unused/symbols.h) \
22507 + $(wildcard include/config/generic/bug.h) \
22508 + $(wildcard include/config/module/unload.h) \
22509 + $(wildcard include/config/kallsyms.h) \
22510 + $(wildcard include/config/sysfs.h) \
22511 + include/linux/spinlock.h \
22512 + $(wildcard include/config/smp.h) \
22513 + $(wildcard include/config/debug/spinlock.h) \
22514 + $(wildcard include/config/preempt.h) \
22515 + $(wildcard include/config/debug/lock/alloc.h) \
22516 + include/linux/preempt.h \
22517 + $(wildcard include/config/debug/preempt.h) \
22518 + include/linux/thread_info.h \
22519 + include/linux/types.h \
22520 + $(wildcard include/config/uid16.h) \
22521 + $(wildcard include/config/lbd.h) \
22522 + $(wildcard include/config/lsf.h) \
22523 + $(wildcard include/config/resources/64bit.h) \
22524 + include/linux/posix_types.h \
22525 + include/linux/stddef.h \
22526 + include/linux/compiler.h \
22527 + $(wildcard include/config/enable/must/check.h) \
22528 + include/linux/compiler-gcc4.h \
22529 + $(wildcard include/config/forced/inlining.h) \
22530 + include/linux/compiler-gcc.h \
22531 + include/asm/posix_types.h \
22532 + include/asm/types.h \
22533 + $(wildcard include/config/highmem64g.h) \
22534 + include/linux/bitops.h \
22535 + include/asm/bitops.h \
22536 + include/asm/alternative.h \
22537 + $(wildcard include/config/paravirt.h) \
22538 + include/asm-generic/bitops/sched.h \
22539 + include/asm-generic/bitops/hweight.h \
22540 + include/asm-generic/bitops/fls64.h \
22541 + include/asm-generic/bitops/ext2-non-atomic.h \
22542 + include/asm-generic/bitops/le.h \
22543 + include/asm/byteorder.h \
22544 + $(wildcard include/config/x86/bswap.h) \
22545 + include/linux/byteorder/little_endian.h \
22546 + include/linux/byteorder/swab.h \
22547 + include/linux/byteorder/generic.h \
22548 + include/asm-generic/bitops/minix.h \
22549 + include/asm/thread_info.h \
22550 + $(wildcard include/config/4kstacks.h) \
22551 + $(wildcard include/config/debug/stack/usage.h) \
22552 + include/asm/page.h \
22553 + $(wildcard include/config/x86/use/3dnow.h) \
22554 + $(wildcard include/config/x86/pae.h) \
22555 + $(wildcard include/config/hugetlb/page.h) \
22556 + $(wildcard include/config/highmem4g.h) \
22557 + $(wildcard include/config/page/offset.h) \
22558 + $(wildcard include/config/flatmem.h) \
22559 + include/asm-generic/pgtable-nopmd.h \
22560 + include/asm-generic/pgtable-nopud.h \
22561 + include/asm-generic/memory_model.h \
22562 + $(wildcard include/config/discontigmem.h) \
22563 + $(wildcard include/config/sparsemem.h) \
22564 + $(wildcard include/config/out/of/line/pfn/to/page.h) \
22565 + include/asm-generic/page.h \
22566 + include/asm/processor.h \
22567 + $(wildcard include/config/x86/ht.h) \
22568 + $(wildcard include/config/mk8.h) \
22569 + $(wildcard include/config/mk7.h) \
22570 + include/asm/vm86.h \
22571 + $(wildcard include/config/vm86.h) \
22572 + include/asm/ptrace.h \
22573 + include/asm/ptrace-abi.h \
22574 + include/asm/segment.h \
22575 + include/asm/math_emu.h \
22576 + include/asm/sigcontext.h \
22577 + include/asm/cpufeature.h \
22578 + include/asm/required-features.h \
22579 + $(wildcard include/config/x86/minimum/cpu.h) \
22580 + $(wildcard include/config/x86/cmov.h) \
22581 + $(wildcard include/config/x86/cmpxchg64.h) \
22582 + include/asm/msr.h \
22583 + include/asm/msr-index.h \
22584 + include/asm/errno.h \
22585 + include/asm-generic/errno.h \
22586 + include/asm-generic/errno-base.h \
22587 + include/linux/errno.h \
22588 + include/asm/system.h \
22589 + $(wildcard include/config/x86/oostore.h) \
22590 + include/linux/kernel.h \
22591 + $(wildcard include/config/preempt/voluntary.h) \
22592 + $(wildcard include/config/debug/spinlock/sleep.h) \
22593 + $(wildcard include/config/printk.h) \
22594 + $(wildcard include/config/numa.h) \
22595 + /usr/lib/gcc/i386-redhat-linux/4.1.2/include/stdarg.h \
22596 + include/linux/linkage.h \
22597 + include/asm/linkage.h \
22598 + $(wildcard include/config/x86/alignment/16.h) \
22599 + include/linux/log2.h \
22600 + $(wildcard include/config/arch/has/ilog2/u32.h) \
22601 + $(wildcard include/config/arch/has/ilog2/u64.h) \
22602 + include/asm/bug.h \
22603 + $(wildcard include/config/bug.h) \
22604 + $(wildcard include/config/debug/bugverbose.h) \
22605 + include/asm-generic/bug.h \
22606 + include/asm/cmpxchg.h \
22607 + $(wildcard include/config/x86/cmpxchg.h) \
22608 + include/linux/irqflags.h \
22609 + $(wildcard include/config/trace/irqflags.h) \
22610 + $(wildcard include/config/trace/irqflags/support.h) \
22611 + $(wildcard include/config/x86.h) \
22612 + include/asm/irqflags.h \
22613 + include/asm/processor-flags.h \
22614 + include/linux/cache.h \
22615 + include/asm/cache.h \
22616 + $(wildcard include/config/x86/l1/cache/shift.h) \
22617 + include/linux/threads.h \
22618 + $(wildcard include/config/nr/cpus.h) \
22619 + $(wildcard include/config/base/small.h) \
22620 + include/asm/percpu.h \
22621 + include/linux/cpumask.h \
22622 + $(wildcard include/config/hotplug/cpu.h) \
22623 + include/linux/bitmap.h \
22624 + include/linux/string.h \
22625 + include/asm/string.h \
22626 + include/linux/init.h \
22627 + $(wildcard include/config/hotplug.h) \
22628 + $(wildcard include/config/memory/hotplug.h) \
22629 + $(wildcard include/config/acpi/hotplug/memory.h) \
22630 + include/linux/stringify.h \
22631 + include/linux/bottom_half.h \
22632 + include/linux/spinlock_types.h \
22633 + include/linux/lockdep.h \
22634 + $(wildcard include/config/lockdep.h) \
22635 + $(wildcard include/config/generic/hardirqs.h) \
22636 + $(wildcard include/config/prove/locking.h) \
22637 + include/asm/spinlock_types.h \
22638 + include/asm/spinlock.h \
22639 + $(wildcard include/config/x86/ppro/fence.h) \
22640 + include/asm/atomic.h \
22641 + $(wildcard include/config/m386.h) \
22642 + include/asm-generic/atomic.h \
22643 + include/asm/rwlock.h \
22644 + include/linux/spinlock_api_smp.h \
22645 + include/linux/list.h \
22646 + $(wildcard include/config/debug/list.h) \
22647 + include/linux/poison.h \
22648 + include/linux/prefetch.h \
22649 + include/linux/stat.h \
22650 + include/asm/stat.h \
22651 + include/linux/time.h \
22652 + include/linux/seqlock.h \
22653 + include/linux/vs_time.h \
22654 + $(wildcard include/config/vserver/vtime.h) \
22655 + include/linux/kmod.h \
22656 + $(wildcard include/config/kmod.h) \
22657 + include/linux/elf.h \
22658 + include/linux/auxvec.h \
22659 + include/asm/auxvec.h \
22660 + include/linux/elf-em.h \
22661 + include/asm/elf.h \
22662 + include/asm/user.h \
22663 + include/asm/desc.h \
22664 + include/asm/ldt.h \
22665 + include/linux/smp.h \
22666 + include/asm/smp.h \
22667 + $(wildcard include/config/x86/local/apic.h) \
22668 + $(wildcard include/config/x86/io/apic.h) \
22669 + include/asm/mpspec.h \
22670 + $(wildcard include/config/acpi.h) \
22671 + include/asm/mpspec_def.h \
22672 + include/asm-i386/mach-generic/mach_mpspec.h \
22673 + include/asm/apic.h \
22674 + $(wildcard include/config/x86/good/apic.h) \
22675 + include/linux/pm.h \
22676 + include/linux/delay.h \
22677 + include/asm/delay.h \
22678 + include/asm/fixmap.h \
22679 + $(wildcard include/config/highmem.h) \
22680 + $(wildcard include/config/x86/visws/apic.h) \
22681 + $(wildcard include/config/x86/f00f/bug.h) \
22682 + $(wildcard include/config/x86/cyclone/timer.h) \
22683 + $(wildcard include/config/pci/mmconfig.h) \
22684 + include/asm/acpi.h \
22685 + $(wildcard include/config/acpi/sleep.h) \
22686 + include/acpi/pdc_intel.h \
22687 + include/asm/apicdef.h \
22688 + include/asm/kmap_types.h \
22689 + $(wildcard include/config/debug/highmem.h) \
22690 + include/asm/io_apic.h \
22691 + include/asm-i386/mach-generic/mach_apicdef.h \
22692 + include/asm/genapic.h \
22693 + include/linux/percpu.h \
22694 + include/linux/slab.h \
22695 + $(wildcard include/config/slab/debug.h) \
22696 + $(wildcard include/config/slab.h) \
22697 + $(wildcard include/config/slub.h) \
22698 + $(wildcard include/config/debug/slab.h) \
22699 + include/linux/gfp.h \
22700 + $(wildcard include/config/zone/dma.h) \
22701 + $(wildcard include/config/zone/dma32.h) \
22702 + include/linux/mmzone.h \
22703 + $(wildcard include/config/force/max/zoneorder.h) \
22704 + $(wildcard include/config/arch/populates/node/map.h) \
22705 + $(wildcard include/config/flat/node/mem/map.h) \
22706 + $(wildcard include/config/have/memory/present.h) \
22707 + $(wildcard include/config/need/node/memmap/size.h) \
22708 + $(wildcard include/config/need/multiple/nodes.h) \
22709 + $(wildcard include/config/have/arch/early/pfn/to/nid.h) \
22710 + $(wildcard include/config/sparsemem/extreme.h) \
22711 + $(wildcard include/config/nodes/span/other/nodes.h) \
22712 + $(wildcard include/config/holes/in/zone.h) \
22713 + include/linux/wait.h \
22714 + include/asm/current.h \
22715 + include/linux/numa.h \
22716 + $(wildcard include/config/nodes/shift.h) \
22717 + include/linux/nodemask.h \
22718 + include/linux/memory_hotplug.h \
22719 + $(wildcard include/config/have/arch/nodedata/extension.h) \
22720 + include/linux/notifier.h \
22721 + include/linux/mutex.h \
22722 + $(wildcard include/config/debug/mutexes.h) \
22723 + $(wildcard include/config/chopstix.h) \
22724 + include/linux/rwsem.h \
22725 + $(wildcard include/config/rwsem/generic/spinlock.h) \
22726 + include/asm/rwsem.h \
22727 + include/linux/srcu.h \
22728 + include/linux/topology.h \
22729 + $(wildcard include/config/sched/smt.h) \
22730 + $(wildcard include/config/sched/mc.h) \
22731 + include/asm/topology.h \
22732 + include/asm-generic/topology.h \
22733 + include/linux/slab_def.h \
22734 + include/linux/kmalloc_sizes.h \
22735 + include/asm/mmu.h \
22736 + include/asm/semaphore.h \
22737 + include/linux/kobject.h \
22738 + include/linux/sysfs.h \
22739 + include/linux/kref.h \
22740 + include/linux/moduleparam.h \
22741 + include/asm/local.h \
22742 + include/asm/module.h \
22743 + $(wildcard include/config/m486.h) \
22744 + $(wildcard include/config/m586.h) \
22745 + $(wildcard include/config/m586tsc.h) \
22746 + $(wildcard include/config/m586mmx.h) \
22747 + $(wildcard include/config/mcore2.h) \
22748 + $(wildcard include/config/m686.h) \
22749 + $(wildcard include/config/mpentiumii.h) \
22750 + $(wildcard include/config/mpentiumiii.h) \
22751 + $(wildcard include/config/mpentiumm.h) \
22752 + $(wildcard include/config/mpentium4.h) \
22753 + $(wildcard include/config/mk6.h) \
22754 + $(wildcard include/config/x86/elan.h) \
22755 + $(wildcard include/config/mcrusoe.h) \
22756 + $(wildcard include/config/mefficeon.h) \
22757 + $(wildcard include/config/mwinchipc6.h) \
22758 + $(wildcard include/config/mwinchip2.h) \
22759 + $(wildcard include/config/mwinchip3d.h) \
22760 + $(wildcard include/config/mcyrixiii.h) \
22761 + $(wildcard include/config/mviac3/2.h) \
22762 + $(wildcard include/config/mviac7.h) \
22763 + $(wildcard include/config/mgeodegx1.h) \
22764 + $(wildcard include/config/mgeode/lx.h) \
22765 + include/linux/vmalloc.h \
22766 + include/linux/pagemap.h \
22767 + include/linux/mm.h \
22768 + $(wildcard include/config/sysctl.h) \
22769 + $(wildcard include/config/mmu.h) \
22770 + $(wildcard include/config/stack/growsup.h) \
22771 + $(wildcard include/config/debug/vm.h) \
22772 + $(wildcard include/config/shmem.h) \
22773 + $(wildcard include/config/split/ptlock/cpus.h) \
22774 + $(wildcard include/config/ia64.h) \
22775 + $(wildcard include/config/proc/fs.h) \
22776 + $(wildcard include/config/debug/pagealloc.h) \
22777 + include/linux/capability.h \
22778 + include/linux/rbtree.h \
22779 + include/linux/prio_tree.h \
22780 + include/linux/fs.h \
22781 + $(wildcard include/config/dnotify.h) \
22782 + $(wildcard include/config/vserver/cowbl.h) \
22783 + $(wildcard include/config/quota.h) \
22784 + $(wildcard include/config/inotify.h) \
22785 + $(wildcard include/config/security.h) \
22786 + $(wildcard include/config/epoll.h) \
22787 + $(wildcard include/config/auditsyscall.h) \
22788 + $(wildcard include/config/block.h) \
22789 + $(wildcard include/config/fs/xip.h) \
22790 + $(wildcard include/config/migration.h) \
22791 + include/linux/limits.h \
22792 + include/linux/ioctl.h \
22793 + include/asm/ioctl.h \
22794 + include/asm-generic/ioctl.h \
22795 + include/linux/kdev_t.h \
22796 + include/linux/dcache.h \
22797 + $(wildcard include/config/profiling.h) \
22798 + include/linux/rcupdate.h \
22799 + include/linux/namei.h \
22800 + include/linux/radix-tree.h \
22801 + include/linux/pid.h \
22802 + include/linux/quota.h \
22803 + include/linux/dqblk_xfs.h \
22804 + include/linux/dqblk_v1.h \
22805 + include/linux/dqblk_v2.h \
22806 + include/linux/nfs_fs_i.h \
22807 + include/linux/nfs.h \
22808 + include/linux/sunrpc/msg_prot.h \
22809 + include/linux/fcntl.h \
22810 + include/asm/fcntl.h \
22811 + include/asm-generic/fcntl.h \
22812 + $(wildcard include/config/64bit.h) \
22813 + include/linux/err.h \
22814 + include/linux/debug_locks.h \
22815 + $(wildcard include/config/debug/locking/api/selftests.h) \
22816 + include/linux/backing-dev.h \
22817 + include/linux/mm_types.h \
22818 + include/asm/pgtable.h \
22819 + $(wildcard include/config/highpte.h) \
22820 + include/asm/paravirt.h \
22821 + include/asm/pgtable-2level-defs.h \
22822 + include/asm/pgtable-2level.h \
22823 + include/asm-generic/pgtable.h \
22824 + include/linux/page-flags.h \
22825 + $(wildcard include/config/s390.h) \
22826 + $(wildcard include/config/swap.h) \
22827 + include/linux/vmstat.h \
22828 + $(wildcard include/config/vm/event/counters.h) \
22829 + include/linux/highmem.h \
22830 + include/linux/uaccess.h \
22831 + include/asm/uaccess.h \
22832 + $(wildcard include/config/x86/intel/usercopy.h) \
22833 + $(wildcard include/config/x86/wp/works/ok.h) \
22834 + include/asm/cacheflush.h \
22835 + $(wildcard include/config/debug/rodata.h) \
22836 + include/asm/highmem.h \
22837 + include/linux/interrupt.h \
22838 + $(wildcard include/config/high/res/timers.h) \
22839 + $(wildcard include/config/generic/irq/probe.h) \
22840 + include/linux/irqreturn.h \
22841 + include/linux/hardirq.h \
22842 + $(wildcard include/config/preempt/bkl.h) \
22843 + $(wildcard include/config/virt/cpu/accounting.h) \
22844 + include/linux/smp_lock.h \
22845 + $(wildcard include/config/lock/kernel.h) \
22846 + include/linux/sched.h \
22847 + $(wildcard include/config/no/hz.h) \
22848 + $(wildcard include/config/detect/softlockup.h) \
22849 + $(wildcard include/config/keys.h) \
22850 + $(wildcard include/config/bsd/process/acct.h) \
22851 + $(wildcard include/config/taskstats.h) \
22852 + $(wildcard include/config/inotify/user.h) \
22853 + $(wildcard include/config/schedstats.h) \
22854 + $(wildcard include/config/task/delay/acct.h) \
22855 + $(wildcard include/config/blk/dev/io/trace.h) \
22856 + $(wildcard include/config/cc/stackprotector.h) \
22857 + $(wildcard include/config/sysvipc.h) \
22858 + $(wildcard include/config/rt/mutexes.h) \
22859 + $(wildcard include/config/task/xacct.h) \
22860 + $(wildcard include/config/cpusets.h) \
22861 + $(wildcard include/config/compat.h) \
22862 + $(wildcard include/config/fault/injection.h) \
22863 + include/asm/param.h \
22864 + $(wildcard include/config/hz.h) \
22865 + include/linux/timex.h \
22866 + $(wildcard include/config/time/interpolation.h) \
22867 + include/asm/timex.h \
22868 + include/asm/tsc.h \
22869 + $(wildcard include/config/x86/tsc.h) \
22870 + $(wildcard include/config/x86/generic.h) \
22871 + include/linux/jiffies.h \
22872 + include/linux/calc64.h \
22873 + include/asm/div64.h \
22874 + include/asm/cputime.h \
22875 + include/asm-generic/cputime.h \
22876 + include/linux/sem.h \
22877 + include/linux/ipc.h \
22878 + $(wildcard include/config/ipc/ns.h) \
22879 + include/asm/ipcbuf.h \
22880 + include/asm/sembuf.h \
22881 + include/linux/signal.h \
22882 + include/asm/signal.h \
22883 + include/asm-generic/signal.h \
22884 + include/asm/siginfo.h \
22885 + include/asm-generic/siginfo.h \
22886 + include/linux/securebits.h \
22887 + include/linux/fs_struct.h \
22888 + include/linux/completion.h \
22889 + include/linux/seccomp.h \
22890 + $(wildcard include/config/seccomp.h) \
22891 + include/linux/futex.h \
22892 + $(wildcard include/config/futex.h) \
22893 + include/linux/rtmutex.h \
22894 + $(wildcard include/config/debug/rt/mutexes.h) \
22895 + include/linux/plist.h \
22896 + $(wildcard include/config/debug/pi/list.h) \
22897 + include/linux/param.h \
22898 + include/linux/resource.h \
22899 + include/asm/resource.h \
22900 + include/asm-generic/resource.h \
22901 + include/linux/timer.h \
22902 + $(wildcard include/config/timer/stats.h) \
22903 + include/linux/ktime.h \
22904 + $(wildcard include/config/ktime/scalar.h) \
22905 + include/linux/hrtimer.h \
22906 + include/linux/task_io_accounting.h \
22907 + $(wildcard include/config/task/io/accounting.h) \
22908 + include/linux/aio.h \
22909 + include/linux/workqueue.h \
22910 + include/linux/aio_abi.h \
22911 + include/linux/uio.h \
22912 + include/asm/hardirq.h \
22913 + include/linux/irq.h \
22914 + $(wildcard include/config/irq/per/cpu.h) \
22915 + $(wildcard include/config/irq/release/method.h) \
22916 + $(wildcard include/config/generic/pending/irq.h) \
22917 + $(wildcard include/config/irqbalance.h) \
22918 + $(wildcard include/config/auto/irq/affinity.h) \
22919 + $(wildcard include/config/generic/hardirqs/no//do/irq.h) \
22920 + include/asm/irq.h \
22921 + include/asm-i386/mach-default/irq_vectors.h \
22922 + include/asm-i386/mach-default/irq_vectors_limits.h \
22923 + include/asm/irq_regs.h \
22924 + include/asm/hw_irq.h \
22925 + include/linux/profile.h \
22926 + include/asm/sections.h \
22927 + include/asm-generic/sections.h \
22928 + include/linux/irq_cpustat.h \
22929 + include/linux/device.h \
22930 + $(wildcard include/config/debug/devres.h) \
22931 + include/linux/ioport.h \
22932 + include/linux/klist.h \
22933 + include/asm/device.h \
22934 + include/asm/tlbflush.h \
22935 + $(wildcard include/config/x86/invlpg.h) \
22936 + include/linux/netdevice.h \
22937 + $(wildcard include/config/ax25.h) \
22938 + $(wildcard include/config/tr.h) \
22939 + $(wildcard include/config/net/ipip.h) \
22940 + $(wildcard include/config/net/ipgre.h) \
22941 + $(wildcard include/config/ipv6/sit.h) \
22942 + $(wildcard include/config/ipv6/tunnel.h) \
22943 + $(wildcard include/config/wireless/ext.h) \
22944 + $(wildcard include/config/netpoll.h) \
22945 + $(wildcard include/config/netpoll/trap.h) \
22946 + $(wildcard include/config/net/dma.h) \
22947 + include/linux/if.h \
22948 + include/linux/socket.h \
22949 + include/asm/socket.h \
22950 + include/asm/sockios.h \
22951 + include/linux/sockios.h \
22952 + include/linux/hdlc/ioctl.h \
22953 + include/linux/if_ether.h \
22954 + include/linux/skbuff.h \
22955 + $(wildcard include/config/nf/conntrack.h) \
22956 + $(wildcard include/config/bridge/netfilter.h) \
22957 + $(wildcard include/config/vlan/8021q.h) \
22958 + $(wildcard include/config/net/sched.h) \
22959 + $(wildcard include/config/net/cls/act.h) \
22960 + $(wildcard include/config/network/secmark.h) \
22961 + include/linux/net.h \
22962 + include/linux/random.h \
22963 + include/linux/sysctl.h \
22964 + $(wildcard include/config/icmp/ipod.h) \
22965 + $(wildcard include/config/web100/net100.h) \
22966 + $(wildcard include/config/web100/stats.h) \
22967 + include/linux/textsearch.h \
22968 + include/net/checksum.h \
22969 + include/asm/checksum.h \
22970 + include/linux/in6.h \
22971 + include/linux/dmaengine.h \
22972 + $(wildcard include/config/dma/engine.h) \
22973 + include/linux/if_packet.h \
22974 + include/linux/tcp.h \
22975 + $(wildcard include/config/tcp/md5sig.h) \
22976 + include/net/sock.h \
22977 + $(wildcard include/config/security/network.h) \
22978 + include/linux/security.h \
22979 + $(wildcard include/config/security/network/xfrm.h) \
22980 + include/linux/binfmts.h \
22981 + include/linux/shm.h \
22982 + include/asm/shmparam.h \
22983 + include/asm/shmbuf.h \
22984 + include/linux/msg.h \
22985 + include/asm/msgbuf.h \
22986 + include/linux/key.h \
22987 + include/linux/xfrm.h \
22988 + include/net/flow.h \
22989 + $(wildcard include/config/ipv6/mip6.h) \
22990 + include/linux/filter.h \
22991 + include/net/dst.h \
22992 + $(wildcard include/config/net/cls/route.h) \
22993 + $(wildcard include/config/xfrm.h) \
22994 + include/linux/rtnetlink.h \
22995 + include/linux/netlink.h \
22996 + include/linux/if_link.h \
22997 + include/linux/if_addr.h \
22998 + include/linux/neighbour.h \
22999 + include/net/neighbour.h \
23000 + include/linux/seq_file.h \
23001 + include/net/rtnetlink.h \
23002 + include/net/netlink.h \
23003 + include/net/inet_connection_sock.h \
23004 + include/linux/poll.h \
23005 + include/asm/poll.h \
23006 + include/asm-generic/poll.h \
23007 + include/net/inet_sock.h \
23008 + $(wildcard include/config/ipv6.h) \
23009 + include/linux/jhash.h \
23010 + include/net/request_sock.h \
23011 + include/net/inet_timewait_sock.h \
23012 + include/net/tcp_states.h \
23013 + include/net/timewait_sock.h \
23014 + include/linux/ipv6.h \
23015 + $(wildcard include/config/ipv6/privacy.h) \
23016 + $(wildcard include/config/ipv6/router/pref.h) \
23017 + $(wildcard include/config/ipv6/route/info.h) \
23018 + $(wildcard include/config/ipv6/optimistic/dad.h) \
23019 + $(wildcard include/config/ipv6/subtrees.h) \
23020 + include/linux/icmpv6.h \
23021 + include/linux/udp.h \
23022 + include/net/if_inet6.h \
23023 + include/net/snmp.h \
23024 + include/linux/snmp.h \
23025 + include/net/ip6_checksum.h \
23026 + include/net/ip.h \
23027 + $(wildcard include/config/inet.h) \
23028 + include/linux/ip.h \
23029 + include/linux/in.h \
23030 + include/linux/mii.h \
23031 + include/linux/ethtool.h \
23032 + include/linux/if_vlan.h \
23033 + include/linux/etherdevice.h \
23034 + drivers/net/igb/igb.h \
23035 + $(wildcard include/config/dca.h) \
23036 + $(wildcard include/config/inet/lro.h) \
23037 + include/linux/pci.h \
23038 + $(wildcard include/config/pci/msi.h) \
23039 + $(wildcard include/config/pci.h) \
23040 + $(wildcard include/config/ht/irq.h) \
23041 + $(wildcard include/config/pci/domains.h) \
23042 + include/linux/pci_regs.h \
23043 + include/linux/mod_devicetable.h \
23044 + include/linux/pci_ids.h \
23045 + include/linux/dmapool.h \
23046 + include/asm/io.h \
23047 + $(wildcard include/config/x86/numaq.h) \
23048 + include/asm-generic/iomap.h \
23049 + include/asm/scatterlist.h \
23050 + include/asm/pci.h \
23051 + include/asm-generic/pci-dma-compat.h \
23052 + include/linux/dma-mapping.h \
23053 + include/asm/dma-mapping.h \
23054 + include/asm-generic/pci.h \
23055 + drivers/net/igb/kcompat.h \
23056 + $(wildcard include/config/e1000/napi.h) \
23057 + $(wildcard include/config/e1000e/napi.h) \
23058 + $(wildcard include/config/ixgb/napi.h) \
23059 + $(wildcard include/config/e1000/disable/packet/split.h) \
23060 + $(wildcard include/config/space/len.h) \
23061 + include/linux/version.h \
23062 + include/linux/latency.h \
23063 + drivers/net/igb/e1000_api.h \
23064 + drivers/net/igb/e1000_hw.h \
23065 + drivers/net/igb/e1000_osdep.h \
23066 + drivers/net/igb/e1000_regs.h \
23067 + drivers/net/igb/e1000_defines.h \
23068 + $(wildcard include/config/res.h) \
23069 + $(wildcard include/config/fault.h) \
23070 + drivers/net/igb/e1000_mac.h \
23071 + drivers/net/igb/e1000_phy.h \
23072 + drivers/net/igb/e1000_nvm.h \
23073 + drivers/net/igb/e1000_manage.h \
23074 + drivers/net/igb/e1000_82575.h \
23076 +drivers/net/igb/igb_main.o: $(deps_drivers/net/igb/igb_main.o)
23078 +$(deps_drivers/net/igb/igb_main.o):
23079 Binary files vanilla/drivers/net/igb/igb.o and linux-i686-2.6.22/drivers/net/igb/igb.o differ
23080 diff -Nru vanilla/drivers/net/igb/.igb.o.cmd linux-i686-2.6.22/drivers/net/igb/.igb.o.cmd
23081 --- vanilla/drivers/net/igb/.igb.o.cmd 1969-12-31 19:00:00.000000000 -0500
23082 +++ linux-i686-2.6.22/drivers/net/igb/.igb.o.cmd 2009-07-16 19:53:45.000000000 -0400
23084 +cmd_drivers/net/igb/igb.o := ld -m elf_i386 -m elf_i386 -r -o drivers/net/igb/igb.o drivers/net/igb/e1000_82575.o drivers/net/igb/igb_main.o drivers/net/igb/e1000_mac.o drivers/net/igb/e1000_nvm.o drivers/net/igb/e1000_phy.o drivers/net/igb/e1000_manage.o drivers/net/igb/igb_param.o drivers/net/igb/igb_ethtool.o drivers/net/igb/kcompat.o drivers/net/igb/e1000_api.o
23085 diff -Nru vanilla/drivers/net/igb/igb_param.c linux-i686-2.6.22/drivers/net/igb/igb_param.c
23086 --- vanilla/drivers/net/igb/igb_param.c 1969-12-31 19:00:00.000000000 -0500
23087 +++ linux-i686-2.6.22/drivers/net/igb/igb_param.c 2009-07-16 19:25:22.000000000 -0400
23089 +/*******************************************************************************
23091 + Intel(R) Gigabit Ethernet Linux driver
23092 + Copyright(c) 2007-2008 Intel Corporation.
23094 + This program is free software; you can redistribute it and/or modify it
23095 + under the terms and conditions of the GNU General Public License,
23096 + version 2, as published by the Free Software Foundation.
23098 + This program is distributed in the hope it will be useful, but WITHOUT
23099 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
23100 + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
23103 + You should have received a copy of the GNU General Public License along with
23104 + this program; if not, write to the Free Software Foundation, Inc.,
23105 + 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
23107 + The full GNU General Public License is included in this distribution in
23108 + the file called "COPYING".
23110 + Contact Information:
23111 + e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
23112 + Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
23114 +*******************************************************************************/
23117 +#include <linux/netdevice.h>
23121 +/* This is the only thing that needs to be changed to adjust the
23122 + * maximum number of ports that the driver can manage.
23125 +#define IGB_MAX_NIC 32
23127 +#define OPTION_UNSET -1
23128 +#define OPTION_DISABLED 0
23129 +#define OPTION_ENABLED 1
23131 +/* All parameters are treated the same, as an integer array of values.
23132 + * This macro just reduces the need to repeat the same declaration code
23133 + * over and over (plus this helps to avoid typo bugs).
23136 +#define IGB_PARAM_INIT { [0 ... IGB_MAX_NIC] = OPTION_UNSET }
23137 +#ifndef module_param_array
23138 +/* Module Parameters are always initialized to -1, so that the driver
23139 + * can tell the difference between no user specified value or the
23140 + * user asking for the default value.
23141 + * The true default values are loaded in when igb_check_options is called.
23143 + * This is a GCC extension to ANSI C.
23144 + * See the item "Labeled Elements in Initializers" in the section
23145 + * "Extensions to the C Language Family" of the GCC documentation.
23148 +#define IGB_PARAM(X, desc) \
23149 + static const int __devinitdata X[IGB_MAX_NIC+1] = IGB_PARAM_INIT; \
23150 + MODULE_PARM(X, "1-" __MODULE_STRING(IGB_MAX_NIC) "i"); \
23151 + MODULE_PARM_DESC(X, desc);
23153 +#define IGB_PARAM(X, desc) \
23154 + static int __devinitdata X[IGB_MAX_NIC+1] = IGB_PARAM_INIT; \
23155 + static unsigned int num_##X = 0; \
23156 + module_param_array_named(X, X, int, &num_##X, 0); \
23157 + MODULE_PARM_DESC(X, desc);
23160 +/* Interrupt Throttle Rate (interrupts/sec)
23162 + * Valid Range: 100-100000 (0=off, 1=dynamic, 3=dynamic conservative)
23164 +IGB_PARAM(InterruptThrottleRate, "Interrupt Throttling Rate");
23165 +#define DEFAULT_ITR 3
23166 +#define MAX_ITR 100000
23167 +#define MIN_ITR 120
23168 +/* IntMode (Interrupt Mode)
23170 + * Valid Range: 0 - 3
23172 + * Default Value: 2 (MSI-X single queue)
23174 +IGB_PARAM(IntMode, "Interrupt Mode");
23175 +#define MAX_INTMODE 3
23176 +#define MIN_INTMODE 0
23178 +/* LLIPort (Low Latency Interrupt TCP Port)
23180 + * Valid Range: 0 - 65535
23182 + * Default Value: 0 (disabled)
23184 +IGB_PARAM(LLIPort, "Low Latency Interrupt TCP Port");
23186 +#define DEFAULT_LLIPORT 0
23187 +#define MAX_LLIPORT 0xFFFF
23188 +#define MIN_LLIPORT 0
23190 +/* LLIPush (Low Latency Interrupt on TCP Push flag)
23192 + * Valid Range: 0, 1
23194 + * Default Value: 0 (disabled)
23196 +IGB_PARAM(LLIPush, "Low Latency Interrupt on TCP Push flag");
23198 +#define DEFAULT_LLIPUSH 0
23199 +#define MAX_LLIPUSH 1
23200 +#define MIN_LLIPUSH 0
23202 +/* LLISize (Low Latency Interrupt on Packet Size)
23204 + * Valid Range: 0 - 1500
23206 + * Default Value: 0 (disabled)
23208 +IGB_PARAM(LLISize, "Low Latency Interrupt on Packet Size");
23210 +#define DEFAULT_LLISIZE 0
23211 +#define MAX_LLISIZE 1500
23212 +#define MIN_LLISIZE 0
23215 +/* LROAggr (Large Receive Offload)
23217 + * Valid Range: 2 - 44
23219 + * Default Value: 32
23221 +IGB_PARAM(LROAggr, "LRO - Maximum packets to aggregate");
23223 +#define DEFAULT_LRO_AGGR 32
23224 +#define MAX_LRO_AGGR 44
23225 +#define MIN_LRO_AGGR 2
23228 +struct igb_option {
23229 + enum { enable_option, range_option, list_option } type;
23230 + const char *name;
23234 + struct { /* range_option info */
23238 + struct { /* list_option info */
23240 + struct igb_opt_list { int i; char *str; } *p;
23245 +static int __devinit igb_validate_option(unsigned int *value,
23246 + struct igb_option *opt,
23247 + struct igb_adapter *adapter)
23249 + if (*value == OPTION_UNSET) {
23250 + *value = opt->def;
23254 + switch (opt->type) {
23255 + case enable_option:
23256 + switch (*value) {
23257 + case OPTION_ENABLED:
23258 + DPRINTK(PROBE, INFO, "%s Enabled\n", opt->name);
23260 + case OPTION_DISABLED:
23261 + DPRINTK(PROBE, INFO, "%s Disabled\n", opt->name);
23265 + case range_option:
23266 + if (*value >= opt->arg.r.min && *value <= opt->arg.r.max) {
23267 + DPRINTK(PROBE, INFO,
23268 + "%s set to %d\n", opt->name, *value);
23272 + case list_option: {
23274 + struct igb_opt_list *ent;
23276 + for (i = 0; i < opt->arg.l.nr; i++) {
23277 + ent = &opt->arg.l.p[i];
23278 + if (*value == ent->i) {
23279 + if (ent->str[0] != '\0')
23280 + DPRINTK(PROBE, INFO, "%s\n", ent->str);
23290 + DPRINTK(PROBE, INFO, "Invalid %s value specified (%d) %s\n",
23291 + opt->name, *value, opt->err);
23292 + *value = opt->def;
23297 + * igb_check_options - Range Checking for Command Line Parameters
23298 + * @adapter: board private structure
23300 + * This routine checks all command line parameters for valid user
23301 + * input. If an invalid value is given, or if no user specified
23302 + * value exists, a default value is used. The final value is stored
23303 + * in a variable in the adapter structure.
23306 +void __devinit igb_check_options(struct igb_adapter *adapter)
23308 + int bd = adapter->bd_number;
23310 + if (bd >= IGB_MAX_NIC) {
23311 + DPRINTK(PROBE, NOTICE,
23312 + "Warning: no configuration for board #%d\n", bd);
23313 + DPRINTK(PROBE, NOTICE, "Using defaults for all values\n");
23314 +#ifndef module_param_array
23315 + bd = IGB_MAX_NIC;
23319 + { /* Interrupt Throttling Rate */
23320 + struct igb_option opt = {
23321 + .type = range_option,
23322 + .name = "Interrupt Throttling Rate (ints/sec)",
23323 + .err = "using default of " __MODULE_STRING(DEFAULT_ITR),
23324 + .def = DEFAULT_ITR,
23325 + .arg = { .r = { .min = MIN_ITR,
23326 + .max = MAX_ITR }}
23329 +#ifdef module_param_array
23330 + if (num_InterruptThrottleRate > bd) {
23332 + adapter->itr = InterruptThrottleRate[bd];
23333 + switch (adapter->itr) {
23335 + DPRINTK(PROBE, INFO, "%s turned off\n",
23339 + DPRINTK(PROBE, INFO, "%s set to dynamic mode\n",
23341 + adapter->itr_setting = adapter->itr;
23342 + adapter->itr = IGB_START_ITR;
23345 + DPRINTK(PROBE, INFO,
23346 + "%s set to dynamic conservative mode\n",
23348 + adapter->itr_setting = adapter->itr;
23349 + adapter->itr = IGB_START_ITR;
23352 + igb_validate_option(&adapter->itr, &opt,
23354 + /* save the setting, because the dynamic bits change itr */
23355 + /* in case of invalid user value, default to conservative mode,
23356 + * else need to clear the lower two bits because they are
23357 + * used as control */
23358 + if (adapter->itr == 3) {
23359 + adapter->itr_setting = adapter->itr;
23360 + adapter->itr = IGB_START_ITR;
23363 + adapter->itr = 1000000000 / (adapter->itr * 256);
23364 + adapter->itr_setting = adapter->itr & ~3;
23368 +#ifdef module_param_array
23370 + adapter->itr_setting = opt.def;
23371 + adapter->itr = 8000;
23375 + { /* Interrupt Mode */
23376 + struct igb_option opt = {
23377 + .type = range_option,
23378 + .name = "Interrupt Mode",
23379 + .err = "defaulting to 2 (MSI-X single queue)",
23380 + .def = IGB_INT_MODE_MSIX_1Q,
23381 + .arg = { .r = { .min = MIN_INTMODE,
23382 + .max = MAX_INTMODE }}
23385 +#ifdef module_param_array
23386 + if (num_IntMode > bd) {
23388 + unsigned int int_mode = IntMode[bd];
23389 + igb_validate_option(&int_mode, &opt, adapter);
23390 + adapter->int_mode = int_mode;
23391 +#ifdef module_param_array
23393 + adapter->int_mode = opt.def;
23397 + { /* Low Latency Interrupt TCP Port */
23398 + struct igb_option opt = {
23399 + .type = range_option,
23400 + .name = "Low Latency Interrupt TCP Port",
23401 + .err = "using default of " __MODULE_STRING(DEFAULT_LLIPORT),
23402 + .def = DEFAULT_LLIPORT,
23403 + .arg = { .r = { .min = MIN_LLIPORT,
23404 + .max = MAX_LLIPORT }}
23407 +#ifdef module_param_array
23408 + if (num_LLIPort > bd) {
23410 + adapter->lli_port = LLIPort[bd];
23411 + if (adapter->lli_port) {
23412 + igb_validate_option(&adapter->lli_port, &opt,
23415 + DPRINTK(PROBE, INFO, "%s turned off\n",
23418 +#ifdef module_param_array
23420 + adapter->lli_port = opt.def;
23424 + { /* Low Latency Interrupt on Packet Size */
23425 + struct igb_option opt = {
23426 + .type = range_option,
23427 + .name = "Low Latency Interrupt on Packet Size",
23428 + .err = "using default of " __MODULE_STRING(DEFAULT_LLISIZE),
23429 + .def = DEFAULT_LLISIZE,
23430 + .arg = { .r = { .min = MIN_LLISIZE,
23431 + .max = MAX_LLISIZE }}
23434 +#ifdef module_param_array
23435 + if (num_LLISize > bd) {
23437 + adapter->lli_size = LLISize[bd];
23438 + if (adapter->lli_size) {
23439 + igb_validate_option(&adapter->lli_size, &opt,
23442 + DPRINTK(PROBE, INFO, "%s turned off\n",
23445 +#ifdef module_param_array
23447 + adapter->lli_size = opt.def;
23451 + { /* Low Latency Interrupt on TCP Push flag */
23452 + struct igb_option opt = {
23453 + .type = enable_option,
23454 + .name = "Low Latency Interrupt on TCP Push flag",
23455 + .err = "defaulting to Disabled",
23456 + .def = OPTION_DISABLED
23459 +#ifdef module_param_array
23460 + if (num_LLIPush > bd) {
23462 + unsigned int lli_push = LLIPush[bd];
23463 + igb_validate_option(&lli_push, &opt, adapter);
23464 + adapter->flags |= lli_push ? IGB_FLAG_LLI_PUSH : 0;
23465 +#ifdef module_param_array
23467 + adapter->flags |= opt.def ? IGB_FLAG_LLI_PUSH : 0;
23472 + { /* Large Receive Offload - Maximum packets to aggregate */
23473 + struct igb_option opt = {
23474 + .type = range_option,
23475 + .name = "LRO - Maximum packets to aggregate",
23476 + .err = "using default of " __MODULE_STRING(DEFAULT_LRO_AGGR),
23477 + .def = DEFAULT_LRO_AGGR,
23478 + .arg = { .r = { .min = MIN_LRO_AGGR,
23479 + .max = MAX_LRO_AGGR }}
23482 +#ifdef module_param_array
23483 + if (num_LROAggr > bd) {
23485 + adapter->lro_max_aggr = LROAggr[bd];
23486 + igb_validate_option(&adapter->lro_max_aggr, &opt, adapter);
23488 +#ifdef module_param_array
23490 + adapter->lro_max_aggr = opt.def;
23494 +#endif /* IGB_LRO */
23497 Binary files vanilla/drivers/net/igb/igb_param.o and linux-i686-2.6.22/drivers/net/igb/igb_param.o differ
23498 diff -Nru vanilla/drivers/net/igb/.igb_param.o.cmd linux-i686-2.6.22/drivers/net/igb/.igb_param.o.cmd
23499 --- vanilla/drivers/net/igb/.igb_param.o.cmd 1969-12-31 19:00:00.000000000 -0500
23500 +++ linux-i686-2.6.22/drivers/net/igb/.igb_param.o.cmd 2009-07-16 19:53:43.000000000 -0400
23502 +cmd_drivers/net/igb/igb_param.o := gcc -m32 -Wp,-MD,drivers/net/igb/.igb_param.o.d -nostdinc -isystem /usr/lib/gcc/i386-redhat-linux/4.1.2/include -D__KERNEL__ -Iinclude -include include/linux/autoconf.h -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Os -pipe -msoft-float -mregparm=3 -freg-struct-return -mpreferred-stack-boundary=2 -march=i686 -mtune=generic -ffreestanding -maccumulate-outgoing-args -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -Iinclude/asm-i386/mach-generic -Iinclude/asm-i386/mach-default -fno-omit-frame-pointer -fno-optimize-sibling-calls -g -fno-stack-protector -Wdeclaration-after-statement -Wno-pointer-sign -DMODULE -D"KBUILD_STR(s)=\#s" -D"KBUILD_BASENAME=KBUILD_STR(igb_param)" -D"KBUILD_MODNAME=KBUILD_STR(igb)" -c -o drivers/net/igb/.tmp_igb_param.o drivers/net/igb/igb_param.c
23504 +deps_drivers/net/igb/igb_param.o := \
23505 + drivers/net/igb/igb_param.c \
23506 + include/linux/netdevice.h \
23507 + $(wildcard include/config/ax25.h) \
23508 + $(wildcard include/config/tr.h) \
23509 + $(wildcard include/config/net/ipip.h) \
23510 + $(wildcard include/config/net/ipgre.h) \
23511 + $(wildcard include/config/ipv6/sit.h) \
23512 + $(wildcard include/config/ipv6/tunnel.h) \
23513 + $(wildcard include/config/wireless/ext.h) \
23514 + $(wildcard include/config/netpoll.h) \
23515 + $(wildcard include/config/net/poll/controller.h) \
23516 + $(wildcard include/config/netpoll/trap.h) \
23517 + $(wildcard include/config/net/dma.h) \
23518 + $(wildcard include/config/bug.h) \
23519 + $(wildcard include/config/proc/fs.h) \
23520 + include/linux/if.h \
23521 + include/linux/types.h \
23522 + $(wildcard include/config/uid16.h) \
23523 + $(wildcard include/config/lbd.h) \
23524 + $(wildcard include/config/lsf.h) \
23525 + $(wildcard include/config/resources/64bit.h) \
23526 + include/linux/posix_types.h \
23527 + include/linux/stddef.h \
23528 + include/linux/compiler.h \
23529 + $(wildcard include/config/enable/must/check.h) \
23530 + include/linux/compiler-gcc4.h \
23531 + $(wildcard include/config/forced/inlining.h) \
23532 + include/linux/compiler-gcc.h \
23533 + include/asm/posix_types.h \
23534 + include/asm/types.h \
23535 + $(wildcard include/config/highmem64g.h) \
23536 + include/linux/socket.h \
23537 + $(wildcard include/config/compat.h) \
23538 + include/asm/socket.h \
23539 + include/asm/sockios.h \
23540 + include/linux/sockios.h \
23541 + include/linux/uio.h \
23542 + include/linux/hdlc/ioctl.h \
23543 + include/linux/if_ether.h \
23544 + $(wildcard include/config/sysctl.h) \
23545 + include/linux/skbuff.h \
23546 + $(wildcard include/config/nf/conntrack.h) \
23547 + $(wildcard include/config/bridge/netfilter.h) \
23548 + $(wildcard include/config/vlan/8021q.h) \
23549 + $(wildcard include/config/net/sched.h) \
23550 + $(wildcard include/config/net/cls/act.h) \
23551 + $(wildcard include/config/network/secmark.h) \
23552 + include/linux/kernel.h \
23553 + $(wildcard include/config/preempt/voluntary.h) \
23554 + $(wildcard include/config/debug/spinlock/sleep.h) \
23555 + $(wildcard include/config/printk.h) \
23556 + $(wildcard include/config/numa.h) \
23557 + /usr/lib/gcc/i386-redhat-linux/4.1.2/include/stdarg.h \
23558 + include/linux/linkage.h \
23559 + include/asm/linkage.h \
23560 + $(wildcard include/config/x86/alignment/16.h) \
23561 + include/linux/bitops.h \
23562 + include/asm/bitops.h \
23563 + include/asm/alternative.h \
23564 + $(wildcard include/config/smp.h) \
23565 + $(wildcard include/config/paravirt.h) \
23566 + include/asm-generic/bitops/sched.h \
23567 + include/asm-generic/bitops/hweight.h \
23568 + include/asm-generic/bitops/fls64.h \
23569 + include/asm-generic/bitops/ext2-non-atomic.h \
23570 + include/asm-generic/bitops/le.h \
23571 + include/asm/byteorder.h \
23572 + $(wildcard include/config/x86/bswap.h) \
23573 + include/linux/byteorder/little_endian.h \
23574 + include/linux/byteorder/swab.h \
23575 + include/linux/byteorder/generic.h \
23576 + include/asm-generic/bitops/minix.h \
23577 + include/linux/log2.h \
23578 + $(wildcard include/config/arch/has/ilog2/u32.h) \
23579 + $(wildcard include/config/arch/has/ilog2/u64.h) \
23580 + include/asm/bug.h \
23581 + $(wildcard include/config/debug/bugverbose.h) \
23582 + include/asm-generic/bug.h \
23583 + $(wildcard include/config/generic/bug.h) \
23584 + include/linux/time.h \
23585 + include/linux/seqlock.h \
23586 + include/linux/spinlock.h \
23587 + $(wildcard include/config/debug/spinlock.h) \
23588 + $(wildcard include/config/preempt.h) \
23589 + $(wildcard include/config/debug/lock/alloc.h) \
23590 + include/linux/preempt.h \
23591 + $(wildcard include/config/debug/preempt.h) \
23592 + include/linux/thread_info.h \
23593 + include/asm/thread_info.h \
23594 + $(wildcard include/config/4kstacks.h) \
23595 + $(wildcard include/config/debug/stack/usage.h) \
23596 + include/asm/page.h \
23597 + $(wildcard include/config/x86/use/3dnow.h) \
23598 + $(wildcard include/config/x86/pae.h) \
23599 + $(wildcard include/config/hugetlb/page.h) \
23600 + $(wildcard include/config/highmem4g.h) \
23601 + $(wildcard include/config/page/offset.h) \
23602 + $(wildcard include/config/flatmem.h) \
23603 + include/asm-generic/pgtable-nopmd.h \
23604 + include/asm-generic/pgtable-nopud.h \
23605 + include/asm-generic/memory_model.h \
23606 + $(wildcard include/config/discontigmem.h) \
23607 + $(wildcard include/config/sparsemem.h) \
23608 + $(wildcard include/config/out/of/line/pfn/to/page.h) \
23609 + include/asm-generic/page.h \
23610 + include/asm/processor.h \
23611 + $(wildcard include/config/x86/ht.h) \
23612 + $(wildcard include/config/mk8.h) \
23613 + $(wildcard include/config/mk7.h) \
23614 + include/asm/vm86.h \
23615 + $(wildcard include/config/vm86.h) \
23616 + include/asm/ptrace.h \
23617 + include/asm/ptrace-abi.h \
23618 + include/asm/segment.h \
23619 + include/asm/math_emu.h \
23620 + include/asm/sigcontext.h \
23621 + include/asm/cpufeature.h \
23622 + include/asm/required-features.h \
23623 + $(wildcard include/config/x86/minimum/cpu.h) \
23624 + $(wildcard include/config/x86/cmov.h) \
23625 + $(wildcard include/config/x86/cmpxchg64.h) \
23626 + include/asm/msr.h \
23627 + include/asm/msr-index.h \
23628 + include/asm/errno.h \
23629 + include/asm-generic/errno.h \
23630 + include/asm-generic/errno-base.h \
23631 + include/linux/errno.h \
23632 + include/asm/system.h \
23633 + $(wildcard include/config/x86/oostore.h) \
23634 + include/asm/cmpxchg.h \
23635 + $(wildcard include/config/x86/cmpxchg.h) \
23636 + include/linux/irqflags.h \
23637 + $(wildcard include/config/trace/irqflags.h) \
23638 + $(wildcard include/config/trace/irqflags/support.h) \
23639 + $(wildcard include/config/x86.h) \
23640 + include/asm/irqflags.h \
23641 + include/asm/processor-flags.h \
23642 + include/linux/cache.h \
23643 + include/asm/cache.h \
23644 + $(wildcard include/config/x86/l1/cache/shift.h) \
23645 + include/linux/threads.h \
23646 + $(wildcard include/config/nr/cpus.h) \
23647 + $(wildcard include/config/base/small.h) \
23648 + include/asm/percpu.h \
23649 + include/linux/cpumask.h \
23650 + $(wildcard include/config/hotplug/cpu.h) \
23651 + include/linux/bitmap.h \
23652 + include/linux/string.h \
23653 + include/asm/string.h \
23654 + include/linux/init.h \
23655 + $(wildcard include/config/modules.h) \
23656 + $(wildcard include/config/hotplug.h) \
23657 + $(wildcard include/config/memory/hotplug.h) \
23658 + $(wildcard include/config/acpi/hotplug/memory.h) \
23659 + include/linux/stringify.h \
23660 + include/linux/bottom_half.h \
23661 + include/linux/spinlock_types.h \
23662 + include/linux/lockdep.h \
23663 + $(wildcard include/config/lockdep.h) \
23664 + $(wildcard include/config/generic/hardirqs.h) \
23665 + $(wildcard include/config/prove/locking.h) \
23666 + include/asm/spinlock_types.h \
23667 + include/asm/spinlock.h \
23668 + $(wildcard include/config/x86/ppro/fence.h) \
23669 + include/asm/atomic.h \
23670 + $(wildcard include/config/m386.h) \
23671 + include/asm-generic/atomic.h \
23672 + include/asm/rwlock.h \
23673 + include/linux/spinlock_api_smp.h \
23674 + include/linux/vs_time.h \
23675 + $(wildcard include/config/vserver/vtime.h) \
23676 + include/linux/net.h \
23677 + include/linux/wait.h \
23678 + include/linux/list.h \
23679 + $(wildcard include/config/debug/list.h) \
23680 + include/linux/poison.h \
23681 + include/linux/prefetch.h \
23682 + include/asm/current.h \
23683 + include/linux/random.h \
23684 + include/linux/ioctl.h \
23685 + include/asm/ioctl.h \
23686 + include/asm-generic/ioctl.h \
23687 + include/linux/sysctl.h \
23688 + $(wildcard include/config/icmp/ipod.h) \
23689 + $(wildcard include/config/web100/net100.h) \
23690 + $(wildcard include/config/web100/stats.h) \
23691 + include/linux/textsearch.h \
23692 + include/linux/module.h \
23693 + $(wildcard include/config/modversions.h) \
23694 + $(wildcard include/config/unused/symbols.h) \
23695 + $(wildcard include/config/module/unload.h) \
23696 + $(wildcard include/config/kallsyms.h) \
23697 + $(wildcard include/config/sysfs.h) \
23698 + include/linux/stat.h \
23699 + include/asm/stat.h \
23700 + include/linux/kmod.h \
23701 + $(wildcard include/config/kmod.h) \
23702 + include/linux/elf.h \
23703 + include/linux/auxvec.h \
23704 + include/asm/auxvec.h \
23705 + include/linux/elf-em.h \
23706 + include/asm/elf.h \
23707 + include/asm/user.h \
23708 + include/asm/desc.h \
23709 + include/asm/ldt.h \
23710 + include/linux/smp.h \
23711 + include/asm/smp.h \
23712 + $(wildcard include/config/x86/local/apic.h) \
23713 + $(wildcard include/config/x86/io/apic.h) \
23714 + include/asm/mpspec.h \
23715 + $(wildcard include/config/acpi.h) \
23716 + include/asm/mpspec_def.h \
23717 + include/asm-i386/mach-generic/mach_mpspec.h \
23718 + include/asm/apic.h \
23719 + $(wildcard include/config/x86/good/apic.h) \
23720 + include/linux/pm.h \
23721 + $(wildcard include/config/pm.h) \
23722 + include/linux/delay.h \
23723 + include/asm/delay.h \
23724 + include/asm/fixmap.h \
23725 + $(wildcard include/config/highmem.h) \
23726 + $(wildcard include/config/x86/visws/apic.h) \
23727 + $(wildcard include/config/x86/f00f/bug.h) \
23728 + $(wildcard include/config/x86/cyclone/timer.h) \
23729 + $(wildcard include/config/pci/mmconfig.h) \
23730 + include/asm/acpi.h \
23731 + $(wildcard include/config/acpi/sleep.h) \
23732 + include/acpi/pdc_intel.h \
23733 + include/asm/apicdef.h \
23734 + include/asm/kmap_types.h \
23735 + $(wildcard include/config/debug/highmem.h) \
23736 + include/asm/io_apic.h \
23737 + include/asm-i386/mach-generic/mach_apicdef.h \
23738 + include/asm/genapic.h \
23739 + include/linux/percpu.h \
23740 + include/linux/slab.h \
23741 + $(wildcard include/config/slab/debug.h) \
23742 + $(wildcard include/config/slab.h) \
23743 + $(wildcard include/config/slub.h) \
23744 + $(wildcard include/config/debug/slab.h) \
23745 + include/linux/gfp.h \
23746 + $(wildcard include/config/zone/dma.h) \
23747 + $(wildcard include/config/zone/dma32.h) \
23748 + include/linux/mmzone.h \
23749 + $(wildcard include/config/force/max/zoneorder.h) \
23750 + $(wildcard include/config/arch/populates/node/map.h) \
23751 + $(wildcard include/config/flat/node/mem/map.h) \
23752 + $(wildcard include/config/have/memory/present.h) \
23753 + $(wildcard include/config/need/node/memmap/size.h) \
23754 + $(wildcard include/config/need/multiple/nodes.h) \
23755 + $(wildcard include/config/have/arch/early/pfn/to/nid.h) \
23756 + $(wildcard include/config/sparsemem/extreme.h) \
23757 + $(wildcard include/config/nodes/span/other/nodes.h) \
23758 + $(wildcard include/config/holes/in/zone.h) \
23759 + include/linux/numa.h \
23760 + $(wildcard include/config/nodes/shift.h) \
23761 + include/linux/nodemask.h \
23762 + include/linux/memory_hotplug.h \
23763 + $(wildcard include/config/have/arch/nodedata/extension.h) \
23764 + include/linux/notifier.h \
23765 + include/linux/mutex.h \
23766 + $(wildcard include/config/debug/mutexes.h) \
23767 + $(wildcard include/config/chopstix.h) \
23768 + include/linux/rwsem.h \
23769 + $(wildcard include/config/rwsem/generic/spinlock.h) \
23770 + include/asm/rwsem.h \
23771 + include/linux/srcu.h \
23772 + include/linux/topology.h \
23773 + $(wildcard include/config/sched/smt.h) \
23774 + $(wildcard include/config/sched/mc.h) \
23775 + include/asm/topology.h \
23776 + include/asm-generic/topology.h \
23777 + include/linux/slab_def.h \
23778 + include/linux/kmalloc_sizes.h \
23779 + include/asm/mmu.h \
23780 + include/asm/semaphore.h \
23781 + include/linux/kobject.h \
23782 + include/linux/sysfs.h \
23783 + include/linux/kref.h \
23784 + include/linux/moduleparam.h \
23785 + include/asm/local.h \
23786 + include/asm/module.h \
23787 + $(wildcard include/config/m486.h) \
23788 + $(wildcard include/config/m586.h) \
23789 + $(wildcard include/config/m586tsc.h) \
23790 + $(wildcard include/config/m586mmx.h) \
23791 + $(wildcard include/config/mcore2.h) \
23792 + $(wildcard include/config/m686.h) \
23793 + $(wildcard include/config/mpentiumii.h) \
23794 + $(wildcard include/config/mpentiumiii.h) \
23795 + $(wildcard include/config/mpentiumm.h) \
23796 + $(wildcard include/config/mpentium4.h) \
23797 + $(wildcard include/config/mk6.h) \
23798 + $(wildcard include/config/x86/elan.h) \
23799 + $(wildcard include/config/mcrusoe.h) \
23800 + $(wildcard include/config/mefficeon.h) \
23801 + $(wildcard include/config/mwinchipc6.h) \
23802 + $(wildcard include/config/mwinchip2.h) \
23803 + $(wildcard include/config/mwinchip3d.h) \
23804 + $(wildcard include/config/mcyrixiii.h) \
23805 + $(wildcard include/config/mviac3/2.h) \
23806 + $(wildcard include/config/mviac7.h) \
23807 + $(wildcard include/config/mgeodegx1.h) \
23808 + $(wildcard include/config/mgeode/lx.h) \
23809 + include/linux/err.h \
23810 + include/net/checksum.h \
23811 + include/asm/uaccess.h \
23812 + $(wildcard include/config/x86/intel/usercopy.h) \
23813 + $(wildcard include/config/x86/wp/works/ok.h) \
23814 + include/asm/checksum.h \
23815 + include/linux/in6.h \
23816 + include/linux/rcupdate.h \
23817 + include/linux/dmaengine.h \
23818 + $(wildcard include/config/dma/engine.h) \
23819 + include/linux/device.h \
23820 + $(wildcard include/config/debug/devres.h) \
23821 + include/linux/ioport.h \
23822 + include/linux/klist.h \
23823 + include/linux/completion.h \
23824 + include/asm/device.h \
23825 + include/linux/hrtimer.h \
23826 + $(wildcard include/config/high/res/timers.h) \
23827 + $(wildcard include/config/timer/stats.h) \
23828 + include/linux/rbtree.h \
23829 + include/linux/ktime.h \
23830 + $(wildcard include/config/ktime/scalar.h) \
23831 + include/linux/jiffies.h \
23832 + include/linux/calc64.h \
23833 + include/asm/div64.h \
23834 + include/linux/timex.h \
23835 + $(wildcard include/config/time/interpolation.h) \
23836 + $(wildcard include/config/no/hz.h) \
23837 + include/asm/param.h \
23838 + $(wildcard include/config/hz.h) \
23839 + include/asm/timex.h \
23840 + include/asm/tsc.h \
23841 + $(wildcard include/config/x86/tsc.h) \
23842 + $(wildcard include/config/x86/generic.h) \
23843 + include/linux/if_packet.h \
23844 + include/linux/timer.h \
23845 + include/linux/interrupt.h \
23846 + $(wildcard include/config/generic/irq/probe.h) \
23847 + include/linux/irqreturn.h \
23848 + include/linux/hardirq.h \
23849 + $(wildcard include/config/preempt/bkl.h) \
23850 + $(wildcard include/config/virt/cpu/accounting.h) \
23851 + include/linux/smp_lock.h \
23852 + $(wildcard include/config/lock/kernel.h) \
23853 + include/linux/sched.h \
23854 + $(wildcard include/config/detect/softlockup.h) \
23855 + $(wildcard include/config/split/ptlock/cpus.h) \
23856 + $(wildcard include/config/keys.h) \
23857 + $(wildcard include/config/bsd/process/acct.h) \
23858 + $(wildcard include/config/taskstats.h) \
23859 + $(wildcard include/config/inotify/user.h) \
23860 + $(wildcard include/config/schedstats.h) \
23861 + $(wildcard include/config/task/delay/acct.h) \
23862 + $(wildcard include/config/blk/dev/io/trace.h) \
23863 + $(wildcard include/config/cc/stackprotector.h) \
23864 + $(wildcard include/config/sysvipc.h) \
23865 + $(wildcard include/config/rt/mutexes.h) \
23866 + $(wildcard include/config/task/xacct.h) \
23867 + $(wildcard include/config/cpusets.h) \
23868 + $(wildcard include/config/fault/injection.h) \
23869 + include/linux/capability.h \
23870 + include/asm/cputime.h \
23871 + include/asm-generic/cputime.h \
23872 + include/linux/sem.h \
23873 + include/linux/ipc.h \
23874 + $(wildcard include/config/ipc/ns.h) \
23875 + include/asm/ipcbuf.h \
23876 + include/asm/sembuf.h \
23877 + include/linux/signal.h \
23878 + include/asm/signal.h \
23879 + include/asm-generic/signal.h \
23880 + include/asm/siginfo.h \
23881 + include/asm-generic/siginfo.h \
23882 + include/linux/securebits.h \
23883 + include/linux/fs_struct.h \
23884 + include/linux/pid.h \
23885 + include/linux/seccomp.h \
23886 + $(wildcard include/config/seccomp.h) \
23887 + include/linux/futex.h \
23888 + $(wildcard include/config/futex.h) \
23889 + include/linux/rtmutex.h \
23890 + $(wildcard include/config/debug/rt/mutexes.h) \
23891 + include/linux/plist.h \
23892 + $(wildcard include/config/debug/pi/list.h) \
23893 + include/linux/param.h \
23894 + include/linux/resource.h \
23895 + include/asm/resource.h \
23896 + include/asm-generic/resource.h \
23897 + include/linux/task_io_accounting.h \
23898 + $(wildcard include/config/task/io/accounting.h) \
23899 + include/linux/aio.h \
23900 + include/linux/workqueue.h \
23901 + include/linux/aio_abi.h \
23902 + include/asm/hardirq.h \
23903 + include/linux/irq.h \
23904 + $(wildcard include/config/s390.h) \
23905 + $(wildcard include/config/irq/per/cpu.h) \
23906 + $(wildcard include/config/irq/release/method.h) \
23907 + $(wildcard include/config/generic/pending/irq.h) \
23908 + $(wildcard include/config/irqbalance.h) \
23909 + $(wildcard include/config/auto/irq/affinity.h) \
23910 + $(wildcard include/config/generic/hardirqs/no//do/irq.h) \
23911 + include/asm/irq.h \
23912 + include/asm-i386/mach-default/irq_vectors.h \
23913 + include/asm-i386/mach-default/irq_vectors_limits.h \
23914 + include/asm/irq_regs.h \
23915 + include/asm/hw_irq.h \
23916 + include/linux/profile.h \
23917 + $(wildcard include/config/profiling.h) \
23918 + include/asm/sections.h \
23919 + include/asm-generic/sections.h \
23920 + include/linux/irq_cpustat.h \
23921 + drivers/net/igb/igb.h \
23922 + $(wildcard include/config/dca.h) \
23923 + $(wildcard include/config/inet/lro.h) \
23924 + $(wildcard include/config/igb/separate/tx/handler.h) \
23925 + $(wildcard include/config/igb/disable/packet/split.h) \
23926 + include/linux/pci.h \
23927 + $(wildcard include/config/pci/msi.h) \
23928 + $(wildcard include/config/pci.h) \
23929 + $(wildcard include/config/ht/irq.h) \
23930 + $(wildcard include/config/pci/domains.h) \
23931 + include/linux/pci_regs.h \
23932 + include/linux/mod_devicetable.h \
23933 + include/linux/pci_ids.h \
23934 + include/linux/dmapool.h \
23935 + include/asm/io.h \
23936 + $(wildcard include/config/x86/numaq.h) \
23937 + include/asm-generic/iomap.h \
23938 + include/linux/vmalloc.h \
23939 + include/asm/scatterlist.h \
23940 + include/asm/pci.h \
23941 + include/linux/mm.h \
23942 + $(wildcard include/config/mmu.h) \
23943 + $(wildcard include/config/stack/growsup.h) \
23944 + $(wildcard include/config/debug/vm.h) \
23945 + $(wildcard include/config/shmem.h) \
23946 + $(wildcard include/config/ia64.h) \
23947 + $(wildcard include/config/debug/pagealloc.h) \
23948 + include/linux/prio_tree.h \
23949 + include/linux/fs.h \
23950 + $(wildcard include/config/dnotify.h) \
23951 + $(wildcard include/config/vserver/cowbl.h) \
23952 + $(wildcard include/config/quota.h) \
23953 + $(wildcard include/config/inotify.h) \
23954 + $(wildcard include/config/security.h) \
23955 + $(wildcard include/config/epoll.h) \
23956 + $(wildcard include/config/auditsyscall.h) \
23957 + $(wildcard include/config/block.h) \
23958 + $(wildcard include/config/fs/xip.h) \
23959 + $(wildcard include/config/migration.h) \
23960 + include/linux/limits.h \
23961 + include/linux/kdev_t.h \
23962 + include/linux/dcache.h \
23963 + include/linux/namei.h \
23964 + include/linux/radix-tree.h \
23965 + include/linux/quota.h \
23966 + include/linux/dqblk_xfs.h \
23967 + include/linux/dqblk_v1.h \
23968 + include/linux/dqblk_v2.h \
23969 + include/linux/nfs_fs_i.h \
23970 + include/linux/nfs.h \
23971 + include/linux/sunrpc/msg_prot.h \
23972 + include/linux/fcntl.h \
23973 + include/asm/fcntl.h \
23974 + include/asm-generic/fcntl.h \
23975 + $(wildcard include/config/64bit.h) \
23976 + include/linux/debug_locks.h \
23977 + $(wildcard include/config/debug/locking/api/selftests.h) \
23978 + include/linux/backing-dev.h \
23979 + include/linux/mm_types.h \
23980 + include/asm/pgtable.h \
23981 + $(wildcard include/config/highpte.h) \
23982 + include/asm/paravirt.h \
23983 + include/asm/pgtable-2level-defs.h \
23984 + include/asm/pgtable-2level.h \
23985 + include/asm-generic/pgtable.h \
23986 + include/linux/page-flags.h \
23987 + $(wildcard include/config/swap.h) \
23988 + include/linux/vmstat.h \
23989 + $(wildcard include/config/vm/event/counters.h) \
23990 + include/asm-generic/pci-dma-compat.h \
23991 + include/linux/dma-mapping.h \
23992 + include/asm/dma-mapping.h \
23993 + include/asm-generic/pci.h \
23994 + include/linux/ethtool.h \
23995 + drivers/net/igb/kcompat.h \
23996 + $(wildcard include/config/e1000/napi.h) \
23997 + $(wildcard include/config/e1000e/napi.h) \
23998 + $(wildcard include/config/ixgb/napi.h) \
23999 + $(wildcard include/config/e1000/disable/packet/split.h) \
24000 + $(wildcard include/config/space/len.h) \
24001 + $(wildcard include/config/netdevices/multiqueue.h) \
24002 + include/linux/version.h \
24003 + include/linux/etherdevice.h \
24004 + include/linux/in.h \
24005 + include/linux/ip.h \
24006 + include/linux/udp.h \
24007 + include/net/inet_sock.h \
24008 + $(wildcard include/config/ipv6.h) \
24009 + include/linux/jhash.h \
24010 + include/net/flow.h \
24011 + $(wildcard include/config/ipv6/mip6.h) \
24012 + include/net/sock.h \
24013 + $(wildcard include/config/security/network.h) \
24014 + include/linux/security.h \
24015 + $(wildcard include/config/security/network/xfrm.h) \
24016 + include/linux/binfmts.h \
24017 + include/linux/shm.h \
24018 + include/asm/shmparam.h \
24019 + include/asm/shmbuf.h \
24020 + include/linux/msg.h \
24021 + include/asm/msgbuf.h \
24022 + include/linux/key.h \
24023 + include/linux/xfrm.h \
24024 + include/linux/filter.h \
24025 + include/net/dst.h \
24026 + $(wildcard include/config/net/cls/route.h) \
24027 + $(wildcard include/config/xfrm.h) \
24028 + include/linux/rtnetlink.h \
24029 + include/linux/netlink.h \
24030 + include/linux/if_link.h \
24031 + include/linux/if_addr.h \
24032 + include/linux/neighbour.h \
24033 + include/net/neighbour.h \
24034 + include/linux/seq_file.h \
24035 + include/net/rtnetlink.h \
24036 + include/net/netlink.h \
24037 + include/net/request_sock.h \
24038 + include/linux/mii.h \
24039 + include/linux/latency.h \
24040 + drivers/net/igb/e1000_api.h \
24041 + drivers/net/igb/e1000_hw.h \
24042 + drivers/net/igb/e1000_osdep.h \
24043 + drivers/net/igb/e1000_regs.h \
24044 + drivers/net/igb/e1000_defines.h \
24045 + $(wildcard include/config/res.h) \
24046 + $(wildcard include/config/fault.h) \
24047 + drivers/net/igb/e1000_mac.h \
24048 + drivers/net/igb/e1000_phy.h \
24049 + drivers/net/igb/e1000_nvm.h \
24050 + drivers/net/igb/e1000_manage.h \
24051 + drivers/net/igb/e1000_82575.h \
24053 +drivers/net/igb/igb_param.o: $(deps_drivers/net/igb/igb_param.o)
24055 +$(deps_drivers/net/igb/igb_param.o):
24056 diff -Nru vanilla/drivers/net/igb/igb_regtest.h linux-i686-2.6.22/drivers/net/igb/igb_regtest.h
24057 --- vanilla/drivers/net/igb/igb_regtest.h 1969-12-31 19:00:00.000000000 -0500
24058 +++ linux-i686-2.6.22/drivers/net/igb/igb_regtest.h 2009-07-16 19:25:22.000000000 -0400
24060 +/*******************************************************************************
24062 + Intel(R) Gigabit Ethernet Linux driver
24063 + Copyright(c) 2007-2008 Intel Corporation.
24065 + This program is free software; you can redistribute it and/or modify it
24066 + under the terms and conditions of the GNU General Public License,
24067 + version 2, as published by the Free Software Foundation.
24069 + This program is distributed in the hope it will be useful, but WITHOUT
24070 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
24071 + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
24074 + You should have received a copy of the GNU General Public License along with
24075 + this program; if not, write to the Free Software Foundation, Inc.,
24076 + 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
24078 + The full GNU General Public License is included in this distribution in
24079 + the file called "COPYING".
24081 + Contact Information:
24082 + e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
24083 + Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
24085 +*******************************************************************************/
24087 +/* ethtool register test data */
24088 +struct igb_reg_test {
24097 +/* In the hardware, registers are laid out either singly, in arrays
24098 + * spaced 0x100 bytes apart, or in contiguous tables. We assume
24099 + * most tests take place on arrays or single registers (handled
24100 + * as a single-element array) and special-case the tables.
24101 + * Table tests are always pattern tests.
24103 + * We also make provision for some required setup steps by specifying
24104 + * registers to be written without any read-back testing.
24107 +#define PATTERN_TEST 1
24108 +#define SET_READ_TEST 2
24109 +#define WRITE_NO_TEST 3
24110 +#define TABLE32_TEST 4
24111 +#define TABLE64_TEST_LO 5
24112 +#define TABLE64_TEST_HI 6
24114 +/* 82576 reg test */
24115 +static struct igb_reg_test reg_test_82576[] = {
24116 + { E1000_FCAL, 0x100, 1, PATTERN_TEST, 0xFFFFFFFF, 0xFFFFFFFF },
24117 + { E1000_FCAH, 0x100, 1, PATTERN_TEST, 0x0000FFFF, 0xFFFFFFFF },
24118 + { E1000_FCT, 0x100, 1, PATTERN_TEST, 0x0000FFFF, 0xFFFFFFFF },
24119 + { E1000_VET, 0x100, 1, PATTERN_TEST, 0xFFFFFFFF, 0xFFFFFFFF },
24120 + { E1000_RDBAL(0), 0x100, 4, PATTERN_TEST, 0xFFFFFF80, 0xFFFFFFFF },
24121 + { E1000_RDBAH(0), 0x100, 4, PATTERN_TEST, 0xFFFFFFFF, 0xFFFFFFFF },
24122 + { E1000_RDLEN(0), 0x100, 4, PATTERN_TEST, 0x000FFFF0, 0x000FFFFF },
24123 + { E1000_RDBAL(4), 0x40, 8, PATTERN_TEST, 0xFFFFFF80, 0xFFFFFFFF },
24124 + { E1000_RDBAH(4), 0x40, 8, PATTERN_TEST, 0xFFFFFFFF, 0xFFFFFFFF },
24125 + { E1000_RDLEN(4), 0x40, 8, PATTERN_TEST, 0x000FFFF0, 0x000FFFFF },
24126 + /* Enable all four RX queues before testing. */
24127 + { E1000_RXDCTL(0), 0x100, 1, WRITE_NO_TEST, 0, E1000_RXDCTL_QUEUE_ENABLE },
24128 + /* RDH is read-only for 82576, only test RDT. */
24129 + { E1000_RDT(0), 0x100, 4, PATTERN_TEST, 0x0000FFFF, 0x0000FFFF },
24130 + { E1000_RXDCTL(0), 0x100, 4, WRITE_NO_TEST, 0, 0 },
24131 + { E1000_FCRTH, 0x100, 1, PATTERN_TEST, 0x0000FFF0, 0x0000FFF0 },
24132 + { E1000_FCTTV, 0x100, 1, PATTERN_TEST, 0x0000FFFF, 0x0000FFFF },
24133 + { E1000_TIPG, 0x100, 1, PATTERN_TEST, 0x3FFFFFFF, 0x3FFFFFFF },
24134 + { E1000_TDBAL(0), 0x100, 4, PATTERN_TEST, 0xFFFFFF80, 0xFFFFFFFF },
24135 + { E1000_TDBAH(0), 0x100, 4, PATTERN_TEST, 0xFFFFFFFF, 0xFFFFFFFF },
24136 + { E1000_TDLEN(0), 0x100, 4, PATTERN_TEST, 0x000FFFF0, 0x000FFFFF },
24137 + { E1000_TDBAL(4), 0x40, 8, PATTERN_TEST, 0xFFFFFF80, 0xFFFFFFFF },
24138 + { E1000_TDBAH(4), 0x40, 8, PATTERN_TEST, 0xFFFFFFFF, 0xFFFFFFFF },
24139 + { E1000_TDLEN(4), 0x40, 8, PATTERN_TEST, 0x000FFFF0, 0x000FFFFF },
24140 + { E1000_RCTL, 0x100, 1, SET_READ_TEST, 0xFFFFFFFF, 0x00000000 },
24141 + { E1000_RCTL, 0x100, 1, SET_READ_TEST, 0x04CFB0FE, 0x003FFFFB },
24142 + { E1000_RCTL, 0x100, 1, SET_READ_TEST, 0x04CFB0FE, 0xFFFFFFFF },
24143 + { E1000_TCTL, 0x100, 1, SET_READ_TEST, 0xFFFFFFFF, 0x00000000 },
24144 + { E1000_RA, 0, 16, TABLE64_TEST_LO,
24145 + 0xFFFFFFFF, 0xFFFFFFFF },
24146 + { E1000_RA, 0, 16, TABLE64_TEST_HI,
24147 + 0x83FFFFFF, 0xFFFFFFFF },
24148 + { E1000_RA2, 0, 8, TABLE64_TEST_LO,
24149 + 0xFFFFFFFF, 0xFFFFFFFF },
24150 + { E1000_RA2, 0, 8, TABLE64_TEST_HI,
24151 + 0x83FFFFFF, 0xFFFFFFFF },
24152 + { E1000_MTA, 0, 128,TABLE32_TEST,
24153 + 0xFFFFFFFF, 0xFFFFFFFF },
24158 +/* 82575 register test */
24159 +static struct igb_reg_test reg_test_82575[] = {
24160 + { E1000_FCAL, 0x100, 1, PATTERN_TEST, 0xFFFFFFFF, 0xFFFFFFFF },
24161 + { E1000_FCAH, 0x100, 1, PATTERN_TEST, 0x0000FFFF, 0xFFFFFFFF },
24162 + { E1000_FCT, 0x100, 1, PATTERN_TEST, 0x0000FFFF, 0xFFFFFFFF },
24163 + { E1000_VET, 0x100, 1, PATTERN_TEST, 0xFFFFFFFF, 0xFFFFFFFF },
24164 + { E1000_RDBAL(0), 0x100, 4, PATTERN_TEST, 0xFFFFFF80, 0xFFFFFFFF },
24165 + { E1000_RDBAH(0), 0x100, 4, PATTERN_TEST, 0xFFFFFFFF, 0xFFFFFFFF },
24166 + { E1000_RDLEN(0), 0x100, 4, PATTERN_TEST, 0x000FFF80, 0x000FFFFF },
24167 + /* Enable all four RX queues before testing. */
24168 + { E1000_RXDCTL(0), 0x100, 4, WRITE_NO_TEST, 0, E1000_RXDCTL_QUEUE_ENABLE },
24169 + /* RDH is read-only for 82575, only test RDT. */
24170 + { E1000_RDT(0), 0x100, 4, PATTERN_TEST, 0x0000FFFF, 0x0000FFFF },
24171 + { E1000_RXDCTL(0), 0x100, 4, WRITE_NO_TEST, 0, 0 },
24172 + { E1000_FCRTH, 0x100, 1, PATTERN_TEST, 0x0000FFF0, 0x0000FFF0 },
24173 + { E1000_FCTTV, 0x100, 1, PATTERN_TEST, 0x0000FFFF, 0x0000FFFF },
24174 + { E1000_TIPG, 0x100, 1, PATTERN_TEST, 0x3FFFFFFF, 0x3FFFFFFF },
24175 + { E1000_TDBAL(0), 0x100, 4, PATTERN_TEST, 0xFFFFFF80, 0xFFFFFFFF },
24176 + { E1000_TDBAH(0), 0x100, 4, PATTERN_TEST, 0xFFFFFFFF, 0xFFFFFFFF },
24177 + { E1000_TDLEN(0), 0x100, 4, PATTERN_TEST, 0x000FFF80, 0x000FFFFF },
24178 + { E1000_RCTL, 0x100, 1, SET_READ_TEST, 0xFFFFFFFF, 0x00000000 },
24179 + { E1000_RCTL, 0x100, 1, SET_READ_TEST, 0x04CFB3FE, 0x003FFFFB },
24180 + { E1000_RCTL, 0x100, 1, SET_READ_TEST, 0x04CFB3FE, 0xFFFFFFFF },
24181 + { E1000_TCTL, 0x100, 1, SET_READ_TEST, 0xFFFFFFFF, 0x00000000 },
24182 + { E1000_TXCW, 0x100, 1, PATTERN_TEST, 0xC000FFFF, 0x0000FFFF },
24183 + { E1000_RA, 0, 16, TABLE64_TEST_LO,
24184 + 0xFFFFFFFF, 0xFFFFFFFF },
24185 + { E1000_RA, 0, 16, TABLE64_TEST_HI,
24186 + 0x800FFFFF, 0xFFFFFFFF },
24187 + { E1000_MTA, 0, 128, TABLE32_TEST,
24188 + 0xFFFFFFFF, 0xFFFFFFFF },
24193 diff -Nru vanilla/drivers/net/igb/kcompat.c linux-i686-2.6.22/drivers/net/igb/kcompat.c
24194 --- vanilla/drivers/net/igb/kcompat.c 1969-12-31 19:00:00.000000000 -0500
24195 +++ linux-i686-2.6.22/drivers/net/igb/kcompat.c 2009-07-16 19:25:22.000000000 -0400
24197 +/*******************************************************************************
24199 + Intel(R) Gigabit Ethernet Linux driver
24200 + Copyright(c) 2007-2008 Intel Corporation.
24202 + This program is free software; you can redistribute it and/or modify it
24203 + under the terms and conditions of the GNU General Public License,
24204 + version 2, as published by the Free Software Foundation.
24206 + This program is distributed in the hope it will be useful, but WITHOUT
24207 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
24208 + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
24211 + You should have received a copy of the GNU General Public License along with
24212 + this program; if not, write to the Free Software Foundation, Inc.,
24213 + 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
24215 + The full GNU General Public License is included in this distribution in
24216 + the file called "COPYING".
24218 + Contact Information:
24219 + e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
24220 + Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
24222 +*******************************************************************************/
24231 +#include "kcompat.h"
24233 +/*****************************************************************************/
24234 +#if ( LINUX_VERSION_CODE < KERNEL_VERSION(2,4,13) )
24236 +/**************************************/
24237 +/* PCI DMA MAPPING */
24239 +#if defined(CONFIG_HIGHMEM)
24241 +#ifndef PCI_DRAM_OFFSET
24242 +#define PCI_DRAM_OFFSET 0
24246 +_kc_pci_map_page(struct pci_dev *dev, struct page *page, unsigned long offset,
24247 + size_t size, int direction)
24249 + return (((u64) (page - mem_map) << PAGE_SHIFT) + offset +
24250 + PCI_DRAM_OFFSET);
24253 +#else /* CONFIG_HIGHMEM */
24256 +_kc_pci_map_page(struct pci_dev *dev, struct page *page, unsigned long offset,
24257 + size_t size, int direction)
24259 + return pci_map_single(dev, (void *)page_address(page) + offset, size,
24263 +#endif /* CONFIG_HIGHMEM */
24266 +_kc_pci_unmap_page(struct pci_dev *dev, u64 dma_addr, size_t size,
24269 + return pci_unmap_single(dev, dma_addr, size, direction);
24272 +#endif /* 2.4.13 => 2.4.3 */
24274 +/*****************************************************************************/
24275 +#if ( LINUX_VERSION_CODE < KERNEL_VERSION(2,4,3) )
24277 +/**************************************/
24278 +/* PCI DRIVER API */
24281 +_kc_pci_set_dma_mask(struct pci_dev *dev, dma_addr_t mask)
24283 + if (!pci_dma_supported(dev, mask))
24285 + dev->dma_mask = mask;
24290 +_kc_pci_request_regions(struct pci_dev *dev, char *res_name)
24294 + for (i = 0; i < 6; i++) {
24295 + if (pci_resource_len(dev, i) == 0)
24298 + if (pci_resource_flags(dev, i) & IORESOURCE_IO) {
24299 + if (!request_region(pci_resource_start(dev, i), pci_resource_len(dev, i), res_name)) {
24300 + pci_release_regions(dev);
24303 + } else if (pci_resource_flags(dev, i) & IORESOURCE_MEM) {
24304 + if (!request_mem_region(pci_resource_start(dev, i), pci_resource_len(dev, i), res_name)) {
24305 + pci_release_regions(dev);
24314 +_kc_pci_release_regions(struct pci_dev *dev)
24318 + for (i = 0; i < 6; i++) {
24319 + if (pci_resource_len(dev, i) == 0)
24322 + if (pci_resource_flags(dev, i) & IORESOURCE_IO)
24323 + release_region(pci_resource_start(dev, i), pci_resource_len(dev, i));
24325 + else if (pci_resource_flags(dev, i) & IORESOURCE_MEM)
24326 + release_mem_region(pci_resource_start(dev, i), pci_resource_len(dev, i));
24330 +/**************************************/
24331 +/* NETWORK DRIVER API */
24333 +struct net_device *
24334 +_kc_alloc_etherdev(int sizeof_priv)
24336 + struct net_device *dev;
24339 + alloc_size = sizeof(*dev) + sizeof_priv + IFNAMSIZ + 31;
24340 + dev = kmalloc(alloc_size, GFP_KERNEL);
24343 + memset(dev, 0, alloc_size);
24346 + dev->priv = (void *) (((unsigned long)(dev + 1) + 31) & ~31);
24347 + dev->name[0] = '\0';
24348 + ether_setup(dev);
24354 +_kc_is_valid_ether_addr(u8 *addr)
24356 + const char zaddr[6] = { 0, };
24358 + return !(addr[0] & 1) && memcmp(addr, zaddr, 6);
24361 +#endif /* 2.4.3 => 2.4.0 */
24363 +/*****************************************************************************/
24364 +#if ( LINUX_VERSION_CODE < KERNEL_VERSION(2,4,6) )
24367 +_kc_pci_set_power_state(struct pci_dev *dev, int state)
24373 +_kc_pci_enable_wake(struct pci_dev *pdev, u32 state, int enable)
24378 +#endif /* 2.4.6 => 2.4.3 */
24380 +/*****************************************************************************/
24381 +#if ( LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0) )
24382 +void _kc_skb_fill_page_desc(struct sk_buff *skb, int i, struct page *page,
24383 + int off, int size)
24385 + skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
24386 + frag->page = page;
24387 + frag->page_offset = off;
24388 + frag->size = size;
24389 + skb_shinfo(skb)->nr_frags = i + 1;
24393 + * Original Copyright:
24394 + * find_next_bit.c: fallback find next bit implementation
24396 + * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved.
24397 + * Written by David Howells (dhowells@redhat.com)
24401 + * find_next_bit - find the next set bit in a memory region
24402 + * @addr: The address to base the search on
24403 + * @offset: The bitnumber to start searching at
24404 + * @size: The maximum size to search
24406 +unsigned long find_next_bit(const unsigned long *addr, unsigned long size,
24407 + unsigned long offset)
24409 + const unsigned long *p = addr + BITOP_WORD(offset);
24410 + unsigned long result = offset & ~(BITS_PER_LONG-1);
24411 + unsigned long tmp;
24413 + if (offset >= size)
24416 + offset %= BITS_PER_LONG;
24419 + tmp &= (~0UL << offset);
24420 + if (size < BITS_PER_LONG)
24421 + goto found_first;
24423 + goto found_middle;
24424 + size -= BITS_PER_LONG;
24425 + result += BITS_PER_LONG;
24427 + while (size & ~(BITS_PER_LONG-1)) {
24428 + if ((tmp = *(p++)))
24429 + goto found_middle;
24430 + result += BITS_PER_LONG;
24431 + size -= BITS_PER_LONG;
24438 + tmp &= (~0UL >> (BITS_PER_LONG - size));
24439 + if (tmp == 0UL) /* Are any bits set? */
24440 + return result + size; /* Nope. */
24442 + return result + ffs(tmp);
24445 +#endif /* 2.6.0 => 2.4.6 */
24447 +/*****************************************************************************/
24448 +#if ( LINUX_VERSION_CODE < KERNEL_VERSION(2,6,14) )
24449 +void *_kc_kzalloc(size_t size, int flags)
24451 + void *ret = kmalloc(size, flags);
24453 + memset(ret, 0, size);
24456 +#endif /* <= 2.6.13 */
24458 +/*****************************************************************************/
24459 +#if ( LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18) )
24460 +struct sk_buff *_kc_netdev_alloc_skb(struct net_device *dev,
24461 + unsigned int length)
24463 + /* 16 == NET_PAD_SKB */
24464 + struct sk_buff *skb;
24465 + skb = alloc_skb(length + 16, GFP_ATOMIC);
24466 + if (likely(skb != NULL)) {
24467 + skb_reserve(skb, 16);
24472 +#endif /* <= 2.6.17 */
24474 +/*****************************************************************************/
24475 +#if ( LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19) )
24476 +int _kc_pci_save_state(struct pci_dev *pdev)
24478 + struct net_device *netdev = pci_get_drvdata(pdev);
24479 + struct adapter_struct *adapter = netdev_priv(netdev);
24480 + int size = PCI_CONFIG_SPACE_LEN, i;
24481 + u16 pcie_cap_offset = pci_find_capability(pdev, PCI_CAP_ID_EXP);
24482 + u16 pcie_link_status;
24484 + if (pcie_cap_offset) {
24485 + if (!pci_read_config_word(pdev,
24486 + pcie_cap_offset + PCIE_LINK_STATUS,
24487 + &pcie_link_status))
24488 + size = PCIE_CONFIG_SPACE_LEN;
24490 + pci_config_space_ich8lan();
24491 +#ifdef HAVE_PCI_ERS
24492 + if (adapter->config_space == NULL)
24494 + WARN_ON(adapter->config_space != NULL);
24496 + adapter->config_space = kmalloc(size, GFP_KERNEL);
24497 + if (!adapter->config_space) {
24498 + printk(KERN_ERR "Out of memory in pci_save_state\n");
24501 + for (i = 0; i < (size / 4); i++)
24502 + pci_read_config_dword(pdev, i * 4, &adapter->config_space[i]);
24506 +void _kc_pci_restore_state(struct pci_dev * pdev)
24508 + struct net_device *netdev = pci_get_drvdata(pdev);
24509 + struct adapter_struct *adapter = netdev_priv(netdev);
24510 + int size = PCI_CONFIG_SPACE_LEN, i;
24511 + u16 pcie_cap_offset;
24512 + u16 pcie_link_status;
24514 + if (adapter->config_space != NULL) {
24515 + pcie_cap_offset = pci_find_capability(pdev, PCI_CAP_ID_EXP);
24516 + if (pcie_cap_offset &&
24517 + !pci_read_config_word(pdev,
24518 + pcie_cap_offset + PCIE_LINK_STATUS,
24519 + &pcie_link_status))
24520 + size = PCIE_CONFIG_SPACE_LEN;
24522 + pci_config_space_ich8lan();
24523 + for (i = 0; i < (size / 4); i++)
24524 + pci_write_config_dword(pdev, i * 4, adapter->config_space[i]);
24525 +#ifndef HAVE_PCI_ERS
24526 + kfree(adapter->config_space);
24527 + adapter->config_space = NULL;
24532 +#ifdef HAVE_PCI_ERS
24533 +void _kc_free_netdev(struct net_device *netdev)
24535 + struct adapter_struct *adapter = netdev_priv(netdev);
24537 + if (adapter->config_space != NULL)
24538 + kfree(adapter->config_space);
24539 +#ifdef CONFIG_SYSFS
24540 + if (netdev->reg_state == NETREG_UNINITIALIZED) {
24541 + kfree((char *)netdev - netdev->padded);
24543 + BUG_ON(netdev->reg_state != NETREG_UNREGISTERED);
24544 + netdev->reg_state = NETREG_RELEASED;
24545 + class_device_put(&netdev->class_dev);
24548 + kfree((char *)netdev - netdev->padded);
24552 +#endif /* <= 2.6.18 */
24554 +/*****************************************************************************/
24555 +#if ( LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23) )
24556 +#endif /* < 2.6.23 */
24558 +/*****************************************************************************/
24559 +#if ( LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24) )
24561 +int __kc_adapter_clean(struct net_device *netdev, int *budget)
24564 + int work_to_do = min(*budget, netdev->quota);
24565 + /* kcompat.h netif_napi_add puts napi struct in "fake netdev->priv" */
24566 + struct napi_struct *napi = netdev->priv;
24567 + work_done = napi->poll(napi, work_to_do);
24568 + *budget -= work_done;
24569 + netdev->quota -= work_done;
24570 + return work_done ? 1 : 0;
24573 +#endif /* <= 2.6.24 */
24575 +/*****************************************************************************/
24576 +#if ( LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27) )
24578 +void _kc_netif_tx_stop_all_queues(struct net_device *netdev)
24580 + struct adapter_struct *adapter = netdev_priv(netdev);
24583 + netif_stop_queue(netdev);
24584 + if (netif_is_multiqueue(netdev))
24585 + for (i = 0; i < adapter->num_tx_queues; i++)
24586 + netif_stop_subqueue(netdev, i);
24588 +void _kc_netif_tx_wake_all_queues(struct net_device *netdev)
24590 + struct adapter_struct *adapter = netdev_priv(netdev);
24593 + netif_wake_queue(netdev);
24594 + if (netif_is_multiqueue(netdev))
24595 + for (i = 0; i < adapter->num_tx_queues; i++)
24596 + netif_wake_subqueue(netdev, i);
24598 +void _kc_netif_tx_start_all_queues(struct net_device *netdev)
24600 + struct adapter_struct *adapter = netdev_priv(netdev);
24603 + netif_start_queue(netdev);
24604 + if (netif_is_multiqueue(netdev))
24605 + for (i = 0; i < adapter->num_tx_queues; i++)
24606 + netif_start_subqueue(netdev, i);
24608 +#endif /* HAVE_TX_MQ */
24609 +#endif /* <= 2.6.27 */
24610 diff -Nru vanilla/drivers/net/igb/kcompat_ethtool.c linux-i686-2.6.22/drivers/net/igb/kcompat_ethtool.c
24611 --- vanilla/drivers/net/igb/kcompat_ethtool.c 1969-12-31 19:00:00.000000000 -0500
24612 +++ linux-i686-2.6.22/drivers/net/igb/kcompat_ethtool.c 2009-07-16 19:25:22.000000000 -0400
24614 +/*******************************************************************************
24616 + Intel(R) Gigabit Ethernet Linux driver
24617 + Copyright(c) 2007-2008 Intel Corporation.
24619 + This program is free software; you can redistribute it and/or modify it
24620 + under the terms and conditions of the GNU General Public License,
24621 + version 2, as published by the Free Software Foundation.
24623 + This program is distributed in the hope it will be useful, but WITHOUT
24624 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
24625 + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
24628 + You should have received a copy of the GNU General Public License along with
24629 + this program; if not, write to the Free Software Foundation, Inc.,
24630 + 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
24632 + The full GNU General Public License is included in this distribution in
24633 + the file called "COPYING".
24635 + Contact Information:
24636 + e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
24637 + Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
24639 +*******************************************************************************/
24642 + * net/core/ethtool.c - Ethtool ioctl handler
24643 + * Copyright (c) 2003 Matthew Wilcox <matthew@wil.cx>
24645 + * This file is where we call all the ethtool_ops commands to get
24646 + * the information ethtool needs. We fall back to calling do_ioctl()
24647 + * for drivers which haven't been converted to ethtool_ops yet.
24649 + * It's GPL, stupid.
24651 + * Modification by sfeldma@pobox.com to work as backward compat
24652 + * solution for pre-ethtool_ops kernels.
24653 + * - copied struct ethtool_ops from ethtool.h
24654 + * - defined SET_ETHTOOL_OPS
24655 + * - put in some #ifndef NETIF_F_xxx wrappers
24656 + * - changes refs to dev->ethtool_ops to ethtool_ops
24657 + * - changed dev_ethtool to ethtool_ioctl
24658 + * - remove EXPORT_SYMBOL()s
24659 + * - added _kc_ prefix in built-in ethtool_op_xxx ops.
24662 +#include <linux/module.h>
24663 +#include <linux/types.h>
24664 +#include <linux/errno.h>
24665 +#include <linux/mii.h>
24666 +#include <linux/ethtool.h>
24667 +#include <linux/netdevice.h>
24668 +#include <asm/uaccess.h>
24670 +#include "kcompat.h"
24672 +#undef SUPPORTED_10000baseT_Full
24673 +#define SUPPORTED_10000baseT_Full (1 << 12)
24674 +#undef ADVERTISED_10000baseT_Full
24675 +#define ADVERTISED_10000baseT_Full (1 << 12)
24676 +#undef SPEED_10000
24677 +#define SPEED_10000 10000
24679 +#undef ethtool_ops
24680 +#define ethtool_ops _kc_ethtool_ops
24682 +struct _kc_ethtool_ops {
24683 + int (*get_settings)(struct net_device *, struct ethtool_cmd *);
24684 + int (*set_settings)(struct net_device *, struct ethtool_cmd *);
24685 + void (*get_drvinfo)(struct net_device *, struct ethtool_drvinfo *);
24686 + int (*get_regs_len)(struct net_device *);
24687 + void (*get_regs)(struct net_device *, struct ethtool_regs *, void *);
24688 + void (*get_wol)(struct net_device *, struct ethtool_wolinfo *);
24689 + int (*set_wol)(struct net_device *, struct ethtool_wolinfo *);
24690 + u32 (*get_msglevel)(struct net_device *);
24691 + void (*set_msglevel)(struct net_device *, u32);
24692 + int (*nway_reset)(struct net_device *);
24693 + u32 (*get_link)(struct net_device *);
24694 + int (*get_eeprom_len)(struct net_device *);
24695 + int (*get_eeprom)(struct net_device *, struct ethtool_eeprom *, u8 *);
24696 + int (*set_eeprom)(struct net_device *, struct ethtool_eeprom *, u8 *);
24697 + int (*get_coalesce)(struct net_device *, struct ethtool_coalesce *);
24698 + int (*set_coalesce)(struct net_device *, struct ethtool_coalesce *);
24699 + void (*get_ringparam)(struct net_device *, struct ethtool_ringparam *);
24700 + int (*set_ringparam)(struct net_device *, struct ethtool_ringparam *);
24701 + void (*get_pauseparam)(struct net_device *,
24702 + struct ethtool_pauseparam*);
24703 + int (*set_pauseparam)(struct net_device *,
24704 + struct ethtool_pauseparam*);
24705 + u32 (*get_rx_csum)(struct net_device *);
24706 + int (*set_rx_csum)(struct net_device *, u32);
24707 + u32 (*get_tx_csum)(struct net_device *);
24708 + int (*set_tx_csum)(struct net_device *, u32);
24709 + u32 (*get_sg)(struct net_device *);
24710 + int (*set_sg)(struct net_device *, u32);
24711 + u32 (*get_tso)(struct net_device *);
24712 + int (*set_tso)(struct net_device *, u32);
24713 + int (*self_test_count)(struct net_device *);
24714 + void (*self_test)(struct net_device *, struct ethtool_test *, u64 *);
24715 + void (*get_strings)(struct net_device *, u32 stringset, u8 *);
24716 + int (*phys_id)(struct net_device *, u32);
24717 + int (*get_stats_count)(struct net_device *);
24718 + void (*get_ethtool_stats)(struct net_device *, struct ethtool_stats *,
24720 +} *ethtool_ops = NULL;
24722 +#undef SET_ETHTOOL_OPS
24723 +#define SET_ETHTOOL_OPS(netdev, ops) (ethtool_ops = (ops))
24726 + * Some useful ethtool_ops methods that are device independent. If we find that
24727 + * all drivers want to do the same thing here, we can turn these into dev_()
24728 + * function calls.
24731 +#undef ethtool_op_get_link
24732 +#define ethtool_op_get_link _kc_ethtool_op_get_link
24733 +u32 _kc_ethtool_op_get_link(struct net_device *dev)
24735 + return netif_carrier_ok(dev) ? 1 : 0;
24738 +#undef ethtool_op_get_tx_csum
24739 +#define ethtool_op_get_tx_csum _kc_ethtool_op_get_tx_csum
24740 +u32 _kc_ethtool_op_get_tx_csum(struct net_device *dev)
24742 +#ifdef NETIF_F_IP_CSUM
24743 + return (dev->features & NETIF_F_IP_CSUM) != 0;
24749 +#undef ethtool_op_set_tx_csum
24750 +#define ethtool_op_set_tx_csum _kc_ethtool_op_set_tx_csum
24751 +int _kc_ethtool_op_set_tx_csum(struct net_device *dev, u32 data)
24753 +#ifdef NETIF_F_IP_CSUM
24755 +#ifdef NETIF_F_IPV6_CSUM
24756 + dev->features |= (NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM);
24758 + dev->features &= ~(NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM);
24760 + dev->features |= NETIF_F_IP_CSUM;
24762 + dev->features &= ~NETIF_F_IP_CSUM;
24769 +#undef ethtool_op_get_sg
24770 +#define ethtool_op_get_sg _kc_ethtool_op_get_sg
24771 +u32 _kc_ethtool_op_get_sg(struct net_device *dev)
24774 + return (dev->features & NETIF_F_SG) != 0;
24780 +#undef ethtool_op_set_sg
24781 +#define ethtool_op_set_sg _kc_ethtool_op_set_sg
24782 +int _kc_ethtool_op_set_sg(struct net_device *dev, u32 data)
24786 + dev->features |= NETIF_F_SG;
24788 + dev->features &= ~NETIF_F_SG;
24794 +#undef ethtool_op_get_tso
24795 +#define ethtool_op_get_tso _kc_ethtool_op_get_tso
24796 +u32 _kc_ethtool_op_get_tso(struct net_device *dev)
24798 +#ifdef NETIF_F_TSO
24799 + return (dev->features & NETIF_F_TSO) != 0;
24805 +#undef ethtool_op_set_tso
24806 +#define ethtool_op_set_tso _kc_ethtool_op_set_tso
24807 +int _kc_ethtool_op_set_tso(struct net_device *dev, u32 data)
24809 +#ifdef NETIF_F_TSO
24811 + dev->features |= NETIF_F_TSO;
24813 + dev->features &= ~NETIF_F_TSO;
24819 +/* Handlers for each ethtool command */
24821 +static int ethtool_get_settings(struct net_device *dev, void *useraddr)
24823 + struct ethtool_cmd cmd = { ETHTOOL_GSET };
24826 + if (!ethtool_ops->get_settings)
24827 + return -EOPNOTSUPP;
24829 + err = ethtool_ops->get_settings(dev, &cmd);
24833 + if (copy_to_user(useraddr, &cmd, sizeof(cmd)))
24838 +static int ethtool_set_settings(struct net_device *dev, void *useraddr)
24840 + struct ethtool_cmd cmd;
24842 + if (!ethtool_ops->set_settings)
24843 + return -EOPNOTSUPP;
24845 + if (copy_from_user(&cmd, useraddr, sizeof(cmd)))
24848 + return ethtool_ops->set_settings(dev, &cmd);
24851 +static int ethtool_get_drvinfo(struct net_device *dev, void *useraddr)
24853 + struct ethtool_drvinfo info;
24854 + struct ethtool_ops *ops = ethtool_ops;
24856 + if (!ops->get_drvinfo)
24857 + return -EOPNOTSUPP;
24859 + memset(&info, 0, sizeof(info));
24860 + info.cmd = ETHTOOL_GDRVINFO;
24861 + ops->get_drvinfo(dev, &info);
24863 + if (ops->self_test_count)
24864 + info.testinfo_len = ops->self_test_count(dev);
24865 + if (ops->get_stats_count)
24866 + info.n_stats = ops->get_stats_count(dev);
24867 + if (ops->get_regs_len)
24868 + info.regdump_len = ops->get_regs_len(dev);
24869 + if (ops->get_eeprom_len)
24870 + info.eedump_len = ops->get_eeprom_len(dev);
24872 + if (copy_to_user(useraddr, &info, sizeof(info)))
24877 +static int ethtool_get_regs(struct net_device *dev, char *useraddr)
24879 + struct ethtool_regs regs;
24880 + struct ethtool_ops *ops = ethtool_ops;
24884 + if (!ops->get_regs || !ops->get_regs_len)
24885 + return -EOPNOTSUPP;
24887 + if (copy_from_user(®s, useraddr, sizeof(regs)))
24890 + reglen = ops->get_regs_len(dev);
24891 + if (regs.len > reglen)
24892 + regs.len = reglen;
24894 + regbuf = kmalloc(reglen, GFP_USER);
24898 + ops->get_regs(dev, ®s, regbuf);
24901 + if (copy_to_user(useraddr, ®s, sizeof(regs)))
24903 + useraddr += offsetof(struct ethtool_regs, data);
24904 + if (copy_to_user(useraddr, regbuf, reglen))
24913 +static int ethtool_get_wol(struct net_device *dev, char *useraddr)
24915 + struct ethtool_wolinfo wol = { ETHTOOL_GWOL };
24917 + if (!ethtool_ops->get_wol)
24918 + return -EOPNOTSUPP;
24920 + ethtool_ops->get_wol(dev, &wol);
24922 + if (copy_to_user(useraddr, &wol, sizeof(wol)))
24927 +static int ethtool_set_wol(struct net_device *dev, char *useraddr)
24929 + struct ethtool_wolinfo wol;
24931 + if (!ethtool_ops->set_wol)
24932 + return -EOPNOTSUPP;
24934 + if (copy_from_user(&wol, useraddr, sizeof(wol)))
24937 + return ethtool_ops->set_wol(dev, &wol);
24940 +static int ethtool_get_msglevel(struct net_device *dev, char *useraddr)
24942 + struct ethtool_value edata = { ETHTOOL_GMSGLVL };
24944 + if (!ethtool_ops->get_msglevel)
24945 + return -EOPNOTSUPP;
24947 + edata.data = ethtool_ops->get_msglevel(dev);
24949 + if (copy_to_user(useraddr, &edata, sizeof(edata)))
24954 +static int ethtool_set_msglevel(struct net_device *dev, char *useraddr)
24956 + struct ethtool_value edata;
24958 + if (!ethtool_ops->set_msglevel)
24959 + return -EOPNOTSUPP;
24961 + if (copy_from_user(&edata, useraddr, sizeof(edata)))
24964 + ethtool_ops->set_msglevel(dev, edata.data);
24968 +static int ethtool_nway_reset(struct net_device *dev)
24970 + if (!ethtool_ops->nway_reset)
24971 + return -EOPNOTSUPP;
24973 + return ethtool_ops->nway_reset(dev);
24976 +static int ethtool_get_link(struct net_device *dev, void *useraddr)
24978 + struct ethtool_value edata = { ETHTOOL_GLINK };
24980 + if (!ethtool_ops->get_link)
24981 + return -EOPNOTSUPP;
24983 + edata.data = ethtool_ops->get_link(dev);
24985 + if (copy_to_user(useraddr, &edata, sizeof(edata)))
24990 +static int ethtool_get_eeprom(struct net_device *dev, void *useraddr)
24992 + struct ethtool_eeprom eeprom;
24993 + struct ethtool_ops *ops = ethtool_ops;
24997 + if (!ops->get_eeprom || !ops->get_eeprom_len)
24998 + return -EOPNOTSUPP;
25000 + if (copy_from_user(&eeprom, useraddr, sizeof(eeprom)))
25003 + /* Check for wrap and zero */
25004 + if (eeprom.offset + eeprom.len <= eeprom.offset)
25007 + /* Check for exceeding total eeprom len */
25008 + if (eeprom.offset + eeprom.len > ops->get_eeprom_len(dev))
25011 + data = kmalloc(eeprom.len, GFP_USER);
25016 + if (copy_from_user(data, useraddr + sizeof(eeprom), eeprom.len))
25019 + ret = ops->get_eeprom(dev, &eeprom, data);
25024 + if (copy_to_user(useraddr, &eeprom, sizeof(eeprom)))
25026 + if (copy_to_user(useraddr + sizeof(eeprom), data, eeprom.len))
25035 +static int ethtool_set_eeprom(struct net_device *dev, void *useraddr)
25037 + struct ethtool_eeprom eeprom;
25038 + struct ethtool_ops *ops = ethtool_ops;
25042 + if (!ops->set_eeprom || !ops->get_eeprom_len)
25043 + return -EOPNOTSUPP;
25045 + if (copy_from_user(&eeprom, useraddr, sizeof(eeprom)))
25048 + /* Check for wrap and zero */
25049 + if (eeprom.offset + eeprom.len <= eeprom.offset)
25052 + /* Check for exceeding total eeprom len */
25053 + if (eeprom.offset + eeprom.len > ops->get_eeprom_len(dev))
25056 + data = kmalloc(eeprom.len, GFP_USER);
25061 + if (copy_from_user(data, useraddr + sizeof(eeprom), eeprom.len))
25064 + ret = ops->set_eeprom(dev, &eeprom, data);
25068 + if (copy_to_user(useraddr + sizeof(eeprom), data, eeprom.len))
25076 +static int ethtool_get_coalesce(struct net_device *dev, void *useraddr)
25078 + struct ethtool_coalesce coalesce = { ETHTOOL_GCOALESCE };
25080 + if (!ethtool_ops->get_coalesce)
25081 + return -EOPNOTSUPP;
25083 + ethtool_ops->get_coalesce(dev, &coalesce);
25085 + if (copy_to_user(useraddr, &coalesce, sizeof(coalesce)))
25090 +static int ethtool_set_coalesce(struct net_device *dev, void *useraddr)
25092 + struct ethtool_coalesce coalesce;
25094 + if (!ethtool_ops->get_coalesce)
25095 + return -EOPNOTSUPP;
25097 + if (copy_from_user(&coalesce, useraddr, sizeof(coalesce)))
25100 + return ethtool_ops->set_coalesce(dev, &coalesce);
25103 +static int ethtool_get_ringparam(struct net_device *dev, void *useraddr)
25105 + struct ethtool_ringparam ringparam = { ETHTOOL_GRINGPARAM };
25107 + if (!ethtool_ops->get_ringparam)
25108 + return -EOPNOTSUPP;
25110 + ethtool_ops->get_ringparam(dev, &ringparam);
25112 + if (copy_to_user(useraddr, &ringparam, sizeof(ringparam)))
25117 +static int ethtool_set_ringparam(struct net_device *dev, void *useraddr)
25119 + struct ethtool_ringparam ringparam;
25121 + if (!ethtool_ops->get_ringparam)
25122 + return -EOPNOTSUPP;
25124 + if (copy_from_user(&ringparam, useraddr, sizeof(ringparam)))
25127 + return ethtool_ops->set_ringparam(dev, &ringparam);
25130 +static int ethtool_get_pauseparam(struct net_device *dev, void *useraddr)
25132 + struct ethtool_pauseparam pauseparam = { ETHTOOL_GPAUSEPARAM };
25134 + if (!ethtool_ops->get_pauseparam)
25135 + return -EOPNOTSUPP;
25137 + ethtool_ops->get_pauseparam(dev, &pauseparam);
25139 + if (copy_to_user(useraddr, &pauseparam, sizeof(pauseparam)))
25144 +static int ethtool_set_pauseparam(struct net_device *dev, void *useraddr)
25146 + struct ethtool_pauseparam pauseparam;
25148 + if (!ethtool_ops->get_pauseparam)
25149 + return -EOPNOTSUPP;
25151 + if (copy_from_user(&pauseparam, useraddr, sizeof(pauseparam)))
25154 + return ethtool_ops->set_pauseparam(dev, &pauseparam);
25157 +static int ethtool_get_rx_csum(struct net_device *dev, char *useraddr)
25159 + struct ethtool_value edata = { ETHTOOL_GRXCSUM };
25161 + if (!ethtool_ops->get_rx_csum)
25162 + return -EOPNOTSUPP;
25164 + edata.data = ethtool_ops->get_rx_csum(dev);
25166 + if (copy_to_user(useraddr, &edata, sizeof(edata)))
25171 +static int ethtool_set_rx_csum(struct net_device *dev, char *useraddr)
25173 + struct ethtool_value edata;
25175 + if (!ethtool_ops->set_rx_csum)
25176 + return -EOPNOTSUPP;
25178 + if (copy_from_user(&edata, useraddr, sizeof(edata)))
25181 + ethtool_ops->set_rx_csum(dev, edata.data);
25185 +static int ethtool_get_tx_csum(struct net_device *dev, char *useraddr)
25187 + struct ethtool_value edata = { ETHTOOL_GTXCSUM };
25189 + if (!ethtool_ops->get_tx_csum)
25190 + return -EOPNOTSUPP;
25192 + edata.data = ethtool_ops->get_tx_csum(dev);
25194 + if (copy_to_user(useraddr, &edata, sizeof(edata)))
25199 +static int ethtool_set_tx_csum(struct net_device *dev, char *useraddr)
25201 + struct ethtool_value edata;
25203 + if (!ethtool_ops->set_tx_csum)
25204 + return -EOPNOTSUPP;
25206 + if (copy_from_user(&edata, useraddr, sizeof(edata)))
25209 + return ethtool_ops->set_tx_csum(dev, edata.data);
25212 +static int ethtool_get_sg(struct net_device *dev, char *useraddr)
25214 + struct ethtool_value edata = { ETHTOOL_GSG };
25216 + if (!ethtool_ops->get_sg)
25217 + return -EOPNOTSUPP;
25219 + edata.data = ethtool_ops->get_sg(dev);
25221 + if (copy_to_user(useraddr, &edata, sizeof(edata)))
25226 +static int ethtool_set_sg(struct net_device *dev, char *useraddr)
25228 + struct ethtool_value edata;
25230 + if (!ethtool_ops->set_sg)
25231 + return -EOPNOTSUPP;
25233 + if (copy_from_user(&edata, useraddr, sizeof(edata)))
25236 + return ethtool_ops->set_sg(dev, edata.data);
25239 +static int ethtool_get_tso(struct net_device *dev, char *useraddr)
25241 + struct ethtool_value edata = { ETHTOOL_GTSO };
25243 + if (!ethtool_ops->get_tso)
25244 + return -EOPNOTSUPP;
25246 + edata.data = ethtool_ops->get_tso(dev);
25248 + if (copy_to_user(useraddr, &edata, sizeof(edata)))
25253 +static int ethtool_set_tso(struct net_device *dev, char *useraddr)
25255 + struct ethtool_value edata;
25257 + if (!ethtool_ops->set_tso)
25258 + return -EOPNOTSUPP;
25260 + if (copy_from_user(&edata, useraddr, sizeof(edata)))
25263 + return ethtool_ops->set_tso(dev, edata.data);
25266 +static int ethtool_self_test(struct net_device *dev, char *useraddr)
25268 + struct ethtool_test test;
25269 + struct ethtool_ops *ops = ethtool_ops;
25273 + if (!ops->self_test || !ops->self_test_count)
25274 + return -EOPNOTSUPP;
25276 + if (copy_from_user(&test, useraddr, sizeof(test)))
25279 + test.len = ops->self_test_count(dev);
25280 + data = kmalloc(test.len * sizeof(u64), GFP_USER);
25284 + ops->self_test(dev, &test, data);
25287 + if (copy_to_user(useraddr, &test, sizeof(test)))
25289 + useraddr += sizeof(test);
25290 + if (copy_to_user(useraddr, data, test.len * sizeof(u64)))
25299 +static int ethtool_get_strings(struct net_device *dev, void *useraddr)
25301 + struct ethtool_gstrings gstrings;
25302 + struct ethtool_ops *ops = ethtool_ops;
25306 + if (!ops->get_strings)
25307 + return -EOPNOTSUPP;
25309 + if (copy_from_user(&gstrings, useraddr, sizeof(gstrings)))
25312 + switch (gstrings.string_set) {
25313 + case ETH_SS_TEST:
25314 + if (!ops->self_test_count)
25315 + return -EOPNOTSUPP;
25316 + gstrings.len = ops->self_test_count(dev);
25318 + case ETH_SS_STATS:
25319 + if (!ops->get_stats_count)
25320 + return -EOPNOTSUPP;
25321 + gstrings.len = ops->get_stats_count(dev);
25327 + data = kmalloc(gstrings.len * ETH_GSTRING_LEN, GFP_USER);
25331 + ops->get_strings(dev, gstrings.string_set, data);
25334 + if (copy_to_user(useraddr, &gstrings, sizeof(gstrings)))
25336 + useraddr += sizeof(gstrings);
25337 + if (copy_to_user(useraddr, data, gstrings.len * ETH_GSTRING_LEN))
25346 +static int ethtool_phys_id(struct net_device *dev, void *useraddr)
25348 + struct ethtool_value id;
25350 + if (!ethtool_ops->phys_id)
25351 + return -EOPNOTSUPP;
25353 + if (copy_from_user(&id, useraddr, sizeof(id)))
25356 + return ethtool_ops->phys_id(dev, id.data);
25359 +static int ethtool_get_stats(struct net_device *dev, void *useraddr)
25361 + struct ethtool_stats stats;
25362 + struct ethtool_ops *ops = ethtool_ops;
25366 + if (!ops->get_ethtool_stats || !ops->get_stats_count)
25367 + return -EOPNOTSUPP;
25369 + if (copy_from_user(&stats, useraddr, sizeof(stats)))
25372 + stats.n_stats = ops->get_stats_count(dev);
25373 + data = kmalloc(stats.n_stats * sizeof(u64), GFP_USER);
25377 + ops->get_ethtool_stats(dev, &stats, data);
25380 + if (copy_to_user(useraddr, &stats, sizeof(stats)))
25382 + useraddr += sizeof(stats);
25383 + if (copy_to_user(useraddr, data, stats.n_stats * sizeof(u64)))
25392 +/* The main entry point in this file. Called from net/core/dev.c */
25394 +#define ETHTOOL_OPS_COMPAT
25395 +int ethtool_ioctl(struct ifreq *ifr)
25397 + struct net_device *dev = __dev_get_by_name(ifr->ifr_name);
25398 + void *useraddr = (void *) ifr->ifr_data;
25402 + * XXX: This can be pushed down into the ethtool_* handlers that
25403 + * need it. Keep existing behavior for the moment.
25405 + if (!capable(CAP_NET_ADMIN))
25408 + if (!dev || !netif_device_present(dev))
25411 + if (copy_from_user(ðcmd, useraddr, sizeof (ethcmd)))
25414 + switch (ethcmd) {
25415 + case ETHTOOL_GSET:
25416 + return ethtool_get_settings(dev, useraddr);
25417 + case ETHTOOL_SSET:
25418 + return ethtool_set_settings(dev, useraddr);
25419 + case ETHTOOL_GDRVINFO:
25420 + return ethtool_get_drvinfo(dev, useraddr);
25421 + case ETHTOOL_GREGS:
25422 + return ethtool_get_regs(dev, useraddr);
25423 + case ETHTOOL_GWOL:
25424 + return ethtool_get_wol(dev, useraddr);
25425 + case ETHTOOL_SWOL:
25426 + return ethtool_set_wol(dev, useraddr);
25427 + case ETHTOOL_GMSGLVL:
25428 + return ethtool_get_msglevel(dev, useraddr);
25429 + case ETHTOOL_SMSGLVL:
25430 + return ethtool_set_msglevel(dev, useraddr);
25431 + case ETHTOOL_NWAY_RST:
25432 + return ethtool_nway_reset(dev);
25433 + case ETHTOOL_GLINK:
25434 + return ethtool_get_link(dev, useraddr);
25435 + case ETHTOOL_GEEPROM:
25436 + return ethtool_get_eeprom(dev, useraddr);
25437 + case ETHTOOL_SEEPROM:
25438 + return ethtool_set_eeprom(dev, useraddr);
25439 + case ETHTOOL_GCOALESCE:
25440 + return ethtool_get_coalesce(dev, useraddr);
25441 + case ETHTOOL_SCOALESCE:
25442 + return ethtool_set_coalesce(dev, useraddr);
25443 + case ETHTOOL_GRINGPARAM:
25444 + return ethtool_get_ringparam(dev, useraddr);
25445 + case ETHTOOL_SRINGPARAM:
25446 + return ethtool_set_ringparam(dev, useraddr);
25447 + case ETHTOOL_GPAUSEPARAM:
25448 + return ethtool_get_pauseparam(dev, useraddr);
25449 + case ETHTOOL_SPAUSEPARAM:
25450 + return ethtool_set_pauseparam(dev, useraddr);
25451 + case ETHTOOL_GRXCSUM:
25452 + return ethtool_get_rx_csum(dev, useraddr);
25453 + case ETHTOOL_SRXCSUM:
25454 + return ethtool_set_rx_csum(dev, useraddr);
25455 + case ETHTOOL_GTXCSUM:
25456 + return ethtool_get_tx_csum(dev, useraddr);
25457 + case ETHTOOL_STXCSUM:
25458 + return ethtool_set_tx_csum(dev, useraddr);
25459 + case ETHTOOL_GSG:
25460 + return ethtool_get_sg(dev, useraddr);
25461 + case ETHTOOL_SSG:
25462 + return ethtool_set_sg(dev, useraddr);
25463 + case ETHTOOL_GTSO:
25464 + return ethtool_get_tso(dev, useraddr);
25465 + case ETHTOOL_STSO:
25466 + return ethtool_set_tso(dev, useraddr);
25467 + case ETHTOOL_TEST:
25468 + return ethtool_self_test(dev, useraddr);
25469 + case ETHTOOL_GSTRINGS:
25470 + return ethtool_get_strings(dev, useraddr);
25471 + case ETHTOOL_PHYS_ID:
25472 + return ethtool_phys_id(dev, useraddr);
25473 + case ETHTOOL_GSTATS:
25474 + return ethtool_get_stats(dev, useraddr);
25476 + return -EOPNOTSUPP;
25479 + return -EOPNOTSUPP;
25482 +#define mii_if_info _kc_mii_if_info
25483 +struct _kc_mii_if_info {
25487 + int reg_num_mask;
25489 + unsigned int full_duplex : 1; /* is full duplex? */
25490 + unsigned int force_media : 1; /* is autoneg. disabled? */
25492 + struct net_device *dev;
25493 + int (*mdio_read) (struct net_device *dev, int phy_id, int location);
25494 + void (*mdio_write) (struct net_device *dev, int phy_id, int location, int val);
25497 +struct ethtool_cmd;
25498 +struct mii_ioctl_data;
25500 +#undef mii_link_ok
25501 +#define mii_link_ok _kc_mii_link_ok
25502 +#undef mii_nway_restart
25503 +#define mii_nway_restart _kc_mii_nway_restart
25504 +#undef mii_ethtool_gset
25505 +#define mii_ethtool_gset _kc_mii_ethtool_gset
25506 +#undef mii_ethtool_sset
25507 +#define mii_ethtool_sset _kc_mii_ethtool_sset
25508 +#undef mii_check_link
25509 +#define mii_check_link _kc_mii_check_link
25510 +#undef generic_mii_ioctl
25511 +#define generic_mii_ioctl _kc_generic_mii_ioctl
25512 +extern int _kc_mii_link_ok (struct mii_if_info *mii);
25513 +extern int _kc_mii_nway_restart (struct mii_if_info *mii);
25514 +extern int _kc_mii_ethtool_gset(struct mii_if_info *mii,
25515 + struct ethtool_cmd *ecmd);
25516 +extern int _kc_mii_ethtool_sset(struct mii_if_info *mii,
25517 + struct ethtool_cmd *ecmd);
25518 +extern void _kc_mii_check_link (struct mii_if_info *mii);
25519 +extern int _kc_generic_mii_ioctl(struct mii_if_info *mii_if,
25520 + struct mii_ioctl_data *mii_data, int cmd,
25521 + unsigned int *duplex_changed);
25524 +struct _kc_pci_dev_ext {
25525 + struct pci_dev *dev;
25526 + void *pci_drvdata;
25527 + struct pci_driver *driver;
25530 +struct _kc_net_dev_ext {
25531 + struct net_device *dev;
25532 + unsigned int carrier;
25536 +/**************************************/
25539 +int _kc_mii_ethtool_gset(struct mii_if_info *mii, struct ethtool_cmd *ecmd)
25541 + struct net_device *dev = mii->dev;
25542 + u32 advert, bmcr, lpa, nego;
25544 + ecmd->supported =
25545 + (SUPPORTED_10baseT_Half | SUPPORTED_10baseT_Full |
25546 + SUPPORTED_100baseT_Half | SUPPORTED_100baseT_Full |
25547 + SUPPORTED_Autoneg | SUPPORTED_TP | SUPPORTED_MII);
25549 + /* only supports twisted-pair */
25550 + ecmd->port = PORT_MII;
25552 + /* only supports internal transceiver */
25553 + ecmd->transceiver = XCVR_INTERNAL;
25555 + /* this isn't fully supported at higher layers */
25556 + ecmd->phy_address = mii->phy_id;
25558 + ecmd->advertising = ADVERTISED_TP | ADVERTISED_MII;
25559 + advert = mii->mdio_read(dev, mii->phy_id, MII_ADVERTISE);
25560 + if (advert & ADVERTISE_10HALF)
25561 + ecmd->advertising |= ADVERTISED_10baseT_Half;
25562 + if (advert & ADVERTISE_10FULL)
25563 + ecmd->advertising |= ADVERTISED_10baseT_Full;
25564 + if (advert & ADVERTISE_100HALF)
25565 + ecmd->advertising |= ADVERTISED_100baseT_Half;
25566 + if (advert & ADVERTISE_100FULL)
25567 + ecmd->advertising |= ADVERTISED_100baseT_Full;
25569 + bmcr = mii->mdio_read(dev, mii->phy_id, MII_BMCR);
25570 + lpa = mii->mdio_read(dev, mii->phy_id, MII_LPA);
25571 + if (bmcr & BMCR_ANENABLE) {
25572 + ecmd->advertising |= ADVERTISED_Autoneg;
25573 + ecmd->autoneg = AUTONEG_ENABLE;
25575 + nego = mii_nway_result(advert & lpa);
25576 + if (nego == LPA_100FULL || nego == LPA_100HALF)
25577 + ecmd->speed = SPEED_100;
25579 + ecmd->speed = SPEED_10;
25580 + if (nego == LPA_100FULL || nego == LPA_10FULL) {
25581 + ecmd->duplex = DUPLEX_FULL;
25582 + mii->full_duplex = 1;
25584 + ecmd->duplex = DUPLEX_HALF;
25585 + mii->full_duplex = 0;
25588 + ecmd->autoneg = AUTONEG_DISABLE;
25590 + ecmd->speed = (bmcr & BMCR_SPEED100) ? SPEED_100 : SPEED_10;
25591 + ecmd->duplex = (bmcr & BMCR_FULLDPLX) ? DUPLEX_FULL : DUPLEX_HALF;
25594 + /* ignore maxtxpkt, maxrxpkt for now */
25599 +int _kc_mii_ethtool_sset(struct mii_if_info *mii, struct ethtool_cmd *ecmd)
25601 + struct net_device *dev = mii->dev;
25603 + if (ecmd->speed != SPEED_10 && ecmd->speed != SPEED_100)
25605 + if (ecmd->duplex != DUPLEX_HALF && ecmd->duplex != DUPLEX_FULL)
25607 + if (ecmd->port != PORT_MII)
25609 + if (ecmd->transceiver != XCVR_INTERNAL)
25611 + if (ecmd->phy_address != mii->phy_id)
25613 + if (ecmd->autoneg != AUTONEG_DISABLE && ecmd->autoneg != AUTONEG_ENABLE)
25616 + /* ignore supported, maxtxpkt, maxrxpkt */
25618 + if (ecmd->autoneg == AUTONEG_ENABLE) {
25619 + u32 bmcr, advert, tmp;
25621 + if ((ecmd->advertising & (ADVERTISED_10baseT_Half |
25622 + ADVERTISED_10baseT_Full |
25623 + ADVERTISED_100baseT_Half |
25624 + ADVERTISED_100baseT_Full)) == 0)
25627 + /* advertise only what has been requested */
25628 + advert = mii->mdio_read(dev, mii->phy_id, MII_ADVERTISE);
25629 + tmp = advert & ~(ADVERTISE_ALL | ADVERTISE_100BASE4);
25630 + if (ADVERTISED_10baseT_Half)
25631 + tmp |= ADVERTISE_10HALF;
25632 + if (ADVERTISED_10baseT_Full)
25633 + tmp |= ADVERTISE_10FULL;
25634 + if (ADVERTISED_100baseT_Half)
25635 + tmp |= ADVERTISE_100HALF;
25636 + if (ADVERTISED_100baseT_Full)
25637 + tmp |= ADVERTISE_100FULL;
25638 + if (advert != tmp) {
25639 + mii->mdio_write(dev, mii->phy_id, MII_ADVERTISE, tmp);
25640 + mii->advertising = tmp;
25643 + /* turn on autonegotiation, and force a renegotiate */
25644 + bmcr = mii->mdio_read(dev, mii->phy_id, MII_BMCR);
25645 + bmcr |= (BMCR_ANENABLE | BMCR_ANRESTART);
25646 + mii->mdio_write(dev, mii->phy_id, MII_BMCR, bmcr);
25648 + mii->force_media = 0;
25652 + /* turn off auto negotiation, set speed and duplexity */
25653 + bmcr = mii->mdio_read(dev, mii->phy_id, MII_BMCR);
25654 + tmp = bmcr & ~(BMCR_ANENABLE | BMCR_SPEED100 | BMCR_FULLDPLX);
25655 + if (ecmd->speed == SPEED_100)
25656 + tmp |= BMCR_SPEED100;
25657 + if (ecmd->duplex == DUPLEX_FULL) {
25658 + tmp |= BMCR_FULLDPLX;
25659 + mii->full_duplex = 1;
25661 + mii->full_duplex = 0;
25663 + mii->mdio_write(dev, mii->phy_id, MII_BMCR, tmp);
25665 + mii->force_media = 1;
25670 +int _kc_mii_link_ok (struct mii_if_info *mii)
25672 + /* first, a dummy read, needed to latch some MII phys */
25673 + mii->mdio_read(mii->dev, mii->phy_id, MII_BMSR);
25674 + if (mii->mdio_read(mii->dev, mii->phy_id, MII_BMSR) & BMSR_LSTATUS)
25679 +int _kc_mii_nway_restart (struct mii_if_info *mii)
25684 + /* if autoneg is off, it's an error */
25685 + bmcr = mii->mdio_read(mii->dev, mii->phy_id, MII_BMCR);
25687 + if (bmcr & BMCR_ANENABLE) {
25688 + bmcr |= BMCR_ANRESTART;
25689 + mii->mdio_write(mii->dev, mii->phy_id, MII_BMCR, bmcr);
25696 +void _kc_mii_check_link (struct mii_if_info *mii)
25698 + int cur_link = mii_link_ok(mii);
25699 + int prev_link = netif_carrier_ok(mii->dev);
25701 + if (cur_link && !prev_link)
25702 + netif_carrier_on(mii->dev);
25703 + else if (prev_link && !cur_link)
25704 + netif_carrier_off(mii->dev);
25707 +int _kc_generic_mii_ioctl(struct mii_if_info *mii_if,
25708 + struct mii_ioctl_data *mii_data, int cmd,
25709 + unsigned int *duplex_chg_out)
25712 + unsigned int duplex_changed = 0;
25714 + if (duplex_chg_out)
25715 + *duplex_chg_out = 0;
25717 + mii_data->phy_id &= mii_if->phy_id_mask;
25718 + mii_data->reg_num &= mii_if->reg_num_mask;
25721 + case SIOCDEVPRIVATE: /* binary compat, remove in 2.5 */
25722 + case SIOCGMIIPHY:
25723 + mii_data->phy_id = mii_if->phy_id;
25724 + /* fall through */
25726 + case SIOCDEVPRIVATE + 1:/* binary compat, remove in 2.5 */
25727 + case SIOCGMIIREG:
25728 + mii_data->val_out =
25729 + mii_if->mdio_read(mii_if->dev, mii_data->phy_id,
25730 + mii_data->reg_num);
25733 + case SIOCDEVPRIVATE + 2:/* binary compat, remove in 2.5 */
25734 + case SIOCSMIIREG: {
25735 + u16 val = mii_data->val_in;
25737 + if (!capable(CAP_NET_ADMIN))
25740 + if (mii_data->phy_id == mii_if->phy_id) {
25741 + switch(mii_data->reg_num) {
25743 + unsigned int new_duplex = 0;
25744 + if (val & (BMCR_RESET|BMCR_ANENABLE))
25745 + mii_if->force_media = 0;
25747 + mii_if->force_media = 1;
25748 + if (mii_if->force_media &&
25749 + (val & BMCR_FULLDPLX))
25751 + if (mii_if->full_duplex != new_duplex) {
25752 + duplex_changed = 1;
25753 + mii_if->full_duplex = new_duplex;
25757 + case MII_ADVERTISE:
25758 + mii_if->advertising = val;
25766 + mii_if->mdio_write(mii_if->dev, mii_data->phy_id,
25767 + mii_data->reg_num, val);
25772 + rc = -EOPNOTSUPP;
25776 + if ((rc == 0) && (duplex_chg_out) && (duplex_changed))
25777 + *duplex_chg_out = 1;
25782 diff -Nru vanilla/drivers/net/igb/kcompat.h linux-i686-2.6.22/drivers/net/igb/kcompat.h
25783 --- vanilla/drivers/net/igb/kcompat.h 1969-12-31 19:00:00.000000000 -0500
25784 +++ linux-i686-2.6.22/drivers/net/igb/kcompat.h 2009-07-16 19:25:22.000000000 -0400
25786 +/*******************************************************************************
25788 + Intel(R) Gigabit Ethernet Linux driver
25789 + Copyright(c) 2007-2008 Intel Corporation.
25791 + This program is free software; you can redistribute it and/or modify it
25792 + under the terms and conditions of the GNU General Public License,
25793 + version 2, as published by the Free Software Foundation.
25795 + This program is distributed in the hope it will be useful, but WITHOUT
25796 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
25797 + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
25800 + You should have received a copy of the GNU General Public License along with
25801 + this program; if not, write to the Free Software Foundation, Inc.,
25802 + 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
25804 + The full GNU General Public License is included in this distribution in
25805 + the file called "COPYING".
25807 + Contact Information:
25808 + e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
25809 + Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
25811 +*******************************************************************************/
25813 +#ifndef _KCOMPAT_H_
25814 +#define _KCOMPAT_H_
25816 +#include <linux/version.h>
25817 +#include <linux/init.h>
25818 +#include <linux/types.h>
25819 +#include <linux/errno.h>
25820 +#include <linux/module.h>
25821 +#include <linux/pci.h>
25822 +#include <linux/netdevice.h>
25823 +#include <linux/etherdevice.h>
25824 +#include <linux/skbuff.h>
25825 +#include <linux/ioport.h>
25826 +#include <linux/slab.h>
25827 +#include <linux/list.h>
25828 +#include <linux/delay.h>
25829 +#include <linux/sched.h>
25830 +#include <linux/in.h>
25831 +#include <linux/ip.h>
25832 +#include <linux/udp.h>
25833 +#include <linux/mii.h>
25834 +#include <asm/io.h>
25836 +/* NAPI enable/disable flags here */
25840 +#ifdef CONFIG_E1000_NAPI
25847 +#ifdef E1000E_NAPI
25851 +#ifdef E1000_NO_NAPI
25854 +#ifdef E1000E_NO_NAPI
25869 +#define adapter_struct igb_adapter
25874 +/* and finally set defines so that the code sees the changes */
25876 +#ifndef CONFIG_E1000_NAPI
25877 +#define CONFIG_E1000_NAPI
25879 +#ifndef CONFIG_E1000E_NAPI
25880 +#define CONFIG_E1000E_NAPI
25883 +#undef CONFIG_E1000_NAPI
25884 +#undef CONFIG_E1000E_NAPI
25885 +#undef CONFIG_IXGB_NAPI
25888 +/* packet split disable/enable */
25889 +#ifdef DISABLE_PACKET_SPLIT
25890 +#undef CONFIG_E1000_DISABLE_PACKET_SPLIT
25891 +#define CONFIG_E1000_DISABLE_PACKET_SPLIT
25892 +#undef CONFIG_IGB_DISABLE_PACKET_SPLIT
25893 +#define CONFIG_IGB_DISABLE_PACKET_SPLIT
25896 +/* MSI compatibility code for all kernels and drivers */
25897 +#ifdef DISABLE_PCI_MSI
25898 +#undef CONFIG_PCI_MSI
25900 +#ifndef CONFIG_PCI_MSI
25901 +#if ( LINUX_VERSION_CODE < KERNEL_VERSION(2,6,8) )
25902 +struct msix_entry {
25903 + u16 vector; /* kernel uses to write allocated vector */
25904 + u16 entry; /* driver uses to specify entry, OS writes */
25907 +#define pci_enable_msi(a) -ENOTSUPP
25908 +#define pci_disable_msi(a) do {} while (0)
25909 +#define pci_enable_msix(a, b, c) -ENOTSUPP
25910 +#define pci_disable_msix(a) do {} while (0)
25911 +#define msi_remove_pci_irq_vectors(a) do {} while (0)
25912 +#endif /* CONFIG_PCI_MSI */
25917 +#ifdef DISABLE_NET_POLL_CONTROLLER
25918 +#undef CONFIG_NET_POLL_CONTROLLER
25921 +#ifndef PMSG_SUSPEND
25922 +#define PMSG_SUSPEND 3
25925 +/* generic boolean compatibility */
25929 +#define FALSE false
25930 +#ifdef GCC_VERSION
25931 +#if ( GCC_VERSION < 3000 )
25932 +#define _Bool char
25936 +#define bool _Bool
25942 +#ifndef module_param
25943 +#define module_param(v,t,p) MODULE_PARM(v, "i");
25946 +#ifndef DMA_64BIT_MASK
25947 +#define DMA_64BIT_MASK 0xffffffffffffffffULL
25950 +#ifndef DMA_32BIT_MASK
25951 +#define DMA_32BIT_MASK 0x00000000ffffffffULL
25954 +#ifndef PCI_CAP_ID_EXP
25955 +#define PCI_CAP_ID_EXP 0x10
25959 +#ifdef CONFIG_IA64
25960 +#define mmiowb() asm volatile ("mf.a" ::: "memory")
25966 +#ifndef IRQ_HANDLED
25967 +#define irqreturn_t void
25968 +#define IRQ_HANDLED
25972 +#ifndef SET_NETDEV_DEV
25973 +#define SET_NETDEV_DEV(net, pdev)
25976 +#ifndef HAVE_FREE_NETDEV
25977 +#define free_netdev(x) kfree(x)
25980 +#ifdef HAVE_POLL_CONTROLLER
25981 +#define CONFIG_NET_POLL_CONTROLLER
25984 +#ifndef NETDEV_TX_OK
25985 +#define NETDEV_TX_OK 0
25988 +#ifndef NETDEV_TX_BUSY
25989 +#define NETDEV_TX_BUSY 1
25992 +#ifndef NETDEV_TX_LOCKED
25993 +#define NETDEV_TX_LOCKED -1
25996 +#ifndef SKB_DATAREF_SHIFT
25997 +/* if we do not have the infrastructure to detect if skb_header is cloned
25998 + just return false in all cases */
25999 +#define skb_header_cloned(x) 0
26002 +#ifndef NETIF_F_GSO
26003 +#define gso_size tso_size
26004 +#define gso_segs tso_segs
26007 +#ifndef CHECKSUM_PARTIAL
26008 +#define CHECKSUM_PARTIAL CHECKSUM_HW
26009 +#define CHECKSUM_COMPLETE CHECKSUM_HW
26012 +#ifndef __read_mostly
26013 +#define __read_mostly
26016 +#ifndef HAVE_NETIF_MSG
26017 +#define HAVE_NETIF_MSG 1
26019 + NETIF_MSG_DRV = 0x0001,
26020 + NETIF_MSG_PROBE = 0x0002,
26021 + NETIF_MSG_LINK = 0x0004,
26022 + NETIF_MSG_TIMER = 0x0008,
26023 + NETIF_MSG_IFDOWN = 0x0010,
26024 + NETIF_MSG_IFUP = 0x0020,
26025 + NETIF_MSG_RX_ERR = 0x0040,
26026 + NETIF_MSG_TX_ERR = 0x0080,
26027 + NETIF_MSG_TX_QUEUED = 0x0100,
26028 + NETIF_MSG_INTR = 0x0200,
26029 + NETIF_MSG_TX_DONE = 0x0400,
26030 + NETIF_MSG_RX_STATUS = 0x0800,
26031 + NETIF_MSG_PKTDATA = 0x1000,
26032 + NETIF_MSG_HW = 0x2000,
26033 + NETIF_MSG_WOL = 0x4000,
26037 +#define NETIF_MSG_HW 0x2000
26038 +#define NETIF_MSG_WOL 0x4000
26039 +#endif /* HAVE_NETIF_MSG */
26042 +#define MII_RESV1 0x17 /* Reserved... */
26046 +#define unlikely(_x) _x
26047 +#define likely(_x) _x
26051 +#define WARN_ON(x)
26054 +#ifndef PCI_DEVICE
26055 +#define PCI_DEVICE(vend,dev) \
26056 + .vendor = (vend), .device = (dev), \
26057 + .subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID
26060 +#ifndef num_online_cpus
26061 +#define num_online_cpus() smp_num_cpus
26064 +#ifndef _LINUX_RANDOM_H
26065 +#include <linux/random.h>
26068 +#ifndef DECLARE_BITMAP
26069 +#ifndef BITS_TO_LONGS
26070 +#define BITS_TO_LONGS(bits) (((bits)+BITS_PER_LONG-1)/BITS_PER_LONG)
26072 +#define DECLARE_BITMAP(name,bits) long name[BITS_TO_LONGS(bits)]
26076 +#define VLAN_HLEN 4
26079 +#ifndef VLAN_ETH_HLEN
26080 +#define VLAN_ETH_HLEN 18
26083 +#ifndef VLAN_ETH_FRAME_LEN
26084 +#define VLAN_ETH_FRAME_LEN 1518
26087 +#ifndef DCA_GET_TAG_TWO_ARGS
26088 +#define dca3_get_tag(a,b) dca_get_tag(b)
26092 +/*****************************************************************************/
26093 +/* Installations with ethtool version without eeprom, adapter id, or statistics
26096 +#ifndef ETH_GSTRING_LEN
26097 +#define ETH_GSTRING_LEN 32
26100 +#ifndef ETHTOOL_GSTATS
26101 +#define ETHTOOL_GSTATS 0x1d
26102 +#undef ethtool_drvinfo
26103 +#define ethtool_drvinfo k_ethtool_drvinfo
26104 +struct k_ethtool_drvinfo {
26107 + char version[32];
26108 + char fw_version[32];
26109 + char bus_info[32];
26110 + char reserved1[32];
26111 + char reserved2[16];
26113 + u32 testinfo_len;
26118 +struct ethtool_stats {
26123 +#endif /* ETHTOOL_GSTATS */
26125 +#ifndef ETHTOOL_PHYS_ID
26126 +#define ETHTOOL_PHYS_ID 0x1c
26127 +#endif /* ETHTOOL_PHYS_ID */
26129 +#ifndef ETHTOOL_GSTRINGS
26130 +#define ETHTOOL_GSTRINGS 0x1b
26131 +enum ethtool_stringset {
26135 +struct ethtool_gstrings {
26136 + u32 cmd; /* ETHTOOL_GSTRINGS */
26137 + u32 string_set; /* string set id e.c. ETH_SS_TEST, etc*/
26138 + u32 len; /* number of strings in the string set */
26141 +#endif /* ETHTOOL_GSTRINGS */
26143 +#ifndef ETHTOOL_TEST
26144 +#define ETHTOOL_TEST 0x1a
26145 +enum ethtool_test_flags {
26146 + ETH_TEST_FL_OFFLINE = (1 << 0),
26147 + ETH_TEST_FL_FAILED = (1 << 1),
26149 +struct ethtool_test {
26156 +#endif /* ETHTOOL_TEST */
26158 +#ifndef ETHTOOL_GEEPROM
26159 +#define ETHTOOL_GEEPROM 0xb
26160 +#undef ETHTOOL_GREGS
26161 +struct ethtool_eeprom {
26169 +struct ethtool_value {
26173 +#endif /* ETHTOOL_GEEPROM */
26175 +#ifndef ETHTOOL_GLINK
26176 +#define ETHTOOL_GLINK 0xa
26177 +#endif /* ETHTOOL_GLINK */
26179 +#ifndef ETHTOOL_GREGS
26180 +#define ETHTOOL_GREGS 0x00000004 /* Get NIC registers */
26181 +#define ethtool_regs _kc_ethtool_regs
26182 +/* for passing big chunks of data */
26183 +struct _kc_ethtool_regs {
26185 + u32 version; /* driver-specific, indicates different chips/revs */
26186 + u32 len; /* bytes */
26189 +#endif /* ETHTOOL_GREGS */
26191 +#ifndef ETHTOOL_GMSGLVL
26192 +#define ETHTOOL_GMSGLVL 0x00000007 /* Get driver message level */
26194 +#ifndef ETHTOOL_SMSGLVL
26195 +#define ETHTOOL_SMSGLVL 0x00000008 /* Set driver msg level, priv. */
26197 +#ifndef ETHTOOL_NWAY_RST
26198 +#define ETHTOOL_NWAY_RST 0x00000009 /* Restart autonegotiation, priv */
26200 +#ifndef ETHTOOL_GLINK
26201 +#define ETHTOOL_GLINK 0x0000000a /* Get link status */
26203 +#ifndef ETHTOOL_GEEPROM
26204 +#define ETHTOOL_GEEPROM 0x0000000b /* Get EEPROM data */
26206 +#ifndef ETHTOOL_SEEPROM
26207 +#define ETHTOOL_SEEPROM 0x0000000c /* Set EEPROM data */
26209 +#ifndef ETHTOOL_GCOALESCE
26210 +#define ETHTOOL_GCOALESCE 0x0000000e /* Get coalesce config */
26211 +/* for configuring coalescing parameters of chip */
26212 +#define ethtool_coalesce _kc_ethtool_coalesce
26213 +struct _kc_ethtool_coalesce {
26214 + u32 cmd; /* ETHTOOL_{G,S}COALESCE */
26216 + /* How many usecs to delay an RX interrupt after
26217 + * a packet arrives. If 0, only rx_max_coalesced_frames
26220 + u32 rx_coalesce_usecs;
26222 + /* How many packets to delay an RX interrupt after
26223 + * a packet arrives. If 0, only rx_coalesce_usecs is
26224 + * used. It is illegal to set both usecs and max frames
26225 + * to zero as this would cause RX interrupts to never be
26228 + u32 rx_max_coalesced_frames;
26230 + /* Same as above two parameters, except that these values
26231 + * apply while an IRQ is being serviced by the host. Not
26232 + * all cards support this feature and the values are ignored
26235 + u32 rx_coalesce_usecs_irq;
26236 + u32 rx_max_coalesced_frames_irq;
26238 + /* How many usecs to delay a TX interrupt after
26239 + * a packet is sent. If 0, only tx_max_coalesced_frames
26242 + u32 tx_coalesce_usecs;
26244 + /* How many packets to delay a TX interrupt after
26245 + * a packet is sent. If 0, only tx_coalesce_usecs is
26246 + * used. It is illegal to set both usecs and max frames
26247 + * to zero as this would cause TX interrupts to never be
26250 + u32 tx_max_coalesced_frames;
26252 + /* Same as above two parameters, except that these values
26253 + * apply while an IRQ is being serviced by the host. Not
26254 + * all cards support this feature and the values are ignored
26257 + u32 tx_coalesce_usecs_irq;
26258 + u32 tx_max_coalesced_frames_irq;
26260 + /* How many usecs to delay in-memory statistics
26261 + * block updates. Some drivers do not have an in-memory
26262 + * statistic block, and in such cases this value is ignored.
26263 + * This value must not be zero.
26265 + u32 stats_block_coalesce_usecs;
26267 + /* Adaptive RX/TX coalescing is an algorithm implemented by
26268 + * some drivers to improve latency under low packet rates and
26269 + * improve throughput under high packet rates. Some drivers
26270 + * only implement one of RX or TX adaptive coalescing. Anything
26271 + * not implemented by the driver causes these values to be
26272 + * silently ignored.
26274 + u32 use_adaptive_rx_coalesce;
26275 + u32 use_adaptive_tx_coalesce;
26277 + /* When the packet rate (measured in packets per second)
26278 + * is below pkt_rate_low, the {rx,tx}_*_low parameters are
26281 + u32 pkt_rate_low;
26282 + u32 rx_coalesce_usecs_low;
26283 + u32 rx_max_coalesced_frames_low;
26284 + u32 tx_coalesce_usecs_low;
26285 + u32 tx_max_coalesced_frames_low;
26287 + /* When the packet rate is below pkt_rate_high but above
26288 + * pkt_rate_low (both measured in packets per second) the
26289 + * normal {rx,tx}_* coalescing parameters are used.
26292 + /* When the packet rate is (measured in packets per second)
26293 + * is above pkt_rate_high, the {rx,tx}_*_high parameters are
26296 + u32 pkt_rate_high;
26297 + u32 rx_coalesce_usecs_high;
26298 + u32 rx_max_coalesced_frames_high;
26299 + u32 tx_coalesce_usecs_high;
26300 + u32 tx_max_coalesced_frames_high;
26302 + /* How often to do adaptive coalescing packet rate sampling,
26303 + * measured in seconds. Must not be zero.
26305 + u32 rate_sample_interval;
26307 +#endif /* ETHTOOL_GCOALESCE */
26309 +#ifndef ETHTOOL_SCOALESCE
26310 +#define ETHTOOL_SCOALESCE 0x0000000f /* Set coalesce config. */
26312 +#ifndef ETHTOOL_GRINGPARAM
26313 +#define ETHTOOL_GRINGPARAM 0x00000010 /* Get ring parameters */
26314 +/* for configuring RX/TX ring parameters */
26315 +#define ethtool_ringparam _kc_ethtool_ringparam
26316 +struct _kc_ethtool_ringparam {
26317 + u32 cmd; /* ETHTOOL_{G,S}RINGPARAM */
26319 + /* Read only attributes. These indicate the maximum number
26320 + * of pending RX/TX ring entries the driver will allow the
26323 + u32 rx_max_pending;
26324 + u32 rx_mini_max_pending;
26325 + u32 rx_jumbo_max_pending;
26326 + u32 tx_max_pending;
26328 + /* Values changeable by the user. The valid values are
26329 + * in the range 1 to the "*_max_pending" counterpart above.
26332 + u32 rx_mini_pending;
26333 + u32 rx_jumbo_pending;
26336 +#endif /* ETHTOOL_GRINGPARAM */
26338 +#ifndef ETHTOOL_SRINGPARAM
26339 +#define ETHTOOL_SRINGPARAM 0x00000011 /* Set ring parameters, priv. */
26341 +#ifndef ETHTOOL_GPAUSEPARAM
26342 +#define ETHTOOL_GPAUSEPARAM 0x00000012 /* Get pause parameters */
26343 +/* for configuring link flow control parameters */
26344 +#define ethtool_pauseparam _kc_ethtool_pauseparam
26345 +struct _kc_ethtool_pauseparam {
26346 + u32 cmd; /* ETHTOOL_{G,S}PAUSEPARAM */
26348 + /* If the link is being auto-negotiated (via ethtool_cmd.autoneg
26349 + * being true) the user may set 'autoneg' here non-zero to have the
26350 + * pause parameters be auto-negotiated too. In such a case, the
26351 + * {rx,tx}_pause values below determine what capabilities are
26354 + * If 'autoneg' is zero or the link is not being auto-negotiated,
26355 + * then {rx,tx}_pause force the driver to use/not-use pause
26362 +#endif /* ETHTOOL_GPAUSEPARAM */
26364 +#ifndef ETHTOOL_SPAUSEPARAM
26365 +#define ETHTOOL_SPAUSEPARAM 0x00000013 /* Set pause parameters. */
26367 +#ifndef ETHTOOL_GRXCSUM
26368 +#define ETHTOOL_GRXCSUM 0x00000014 /* Get RX hw csum enable (ethtool_value) */
26370 +#ifndef ETHTOOL_SRXCSUM
26371 +#define ETHTOOL_SRXCSUM 0x00000015 /* Set RX hw csum enable (ethtool_value) */
26373 +#ifndef ETHTOOL_GTXCSUM
26374 +#define ETHTOOL_GTXCSUM 0x00000016 /* Get TX hw csum enable (ethtool_value) */
26376 +#ifndef ETHTOOL_STXCSUM
26377 +#define ETHTOOL_STXCSUM 0x00000017 /* Set TX hw csum enable (ethtool_value) */
26379 +#ifndef ETHTOOL_GSG
26380 +#define ETHTOOL_GSG 0x00000018 /* Get scatter-gather enable
26381 + * (ethtool_value) */
26383 +#ifndef ETHTOOL_SSG
26384 +#define ETHTOOL_SSG 0x00000019 /* Set scatter-gather enable
26385 + * (ethtool_value). */
26387 +#ifndef ETHTOOL_TEST
26388 +#define ETHTOOL_TEST 0x0000001a /* execute NIC self-test, priv. */
26390 +#ifndef ETHTOOL_GSTRINGS
26391 +#define ETHTOOL_GSTRINGS 0x0000001b /* get specified string set */
26393 +#ifndef ETHTOOL_PHYS_ID
26394 +#define ETHTOOL_PHYS_ID 0x0000001c /* identify the NIC */
26396 +#ifndef ETHTOOL_GSTATS
26397 +#define ETHTOOL_GSTATS 0x0000001d /* get NIC-specific statistics */
26399 +#ifndef ETHTOOL_GTSO
26400 +#define ETHTOOL_GTSO 0x0000001e /* Get TSO enable (ethtool_value) */
26402 +#ifndef ETHTOOL_STSO
26403 +#define ETHTOOL_STSO 0x0000001f /* Set TSO enable (ethtool_value) */
26406 +#ifndef ETHTOOL_BUSINFO_LEN
26407 +#define ETHTOOL_BUSINFO_LEN 32
26410 +/*****************************************************************************/
26411 +/* 2.4.3 => 2.4.0 */
26412 +#if ( LINUX_VERSION_CODE < KERNEL_VERSION(2,4,3) )
26414 +/**************************************/
26415 +/* PCI DRIVER API */
26417 +#ifndef pci_set_dma_mask
26418 +#define pci_set_dma_mask _kc_pci_set_dma_mask
26419 +extern int _kc_pci_set_dma_mask(struct pci_dev *dev, dma_addr_t mask);
26422 +#ifndef pci_request_regions
26423 +#define pci_request_regions _kc_pci_request_regions
26424 +extern int _kc_pci_request_regions(struct pci_dev *pdev, char *res_name);
26427 +#ifndef pci_release_regions
26428 +#define pci_release_regions _kc_pci_release_regions
26429 +extern void _kc_pci_release_regions(struct pci_dev *pdev);
26432 +/**************************************/
26433 +/* NETWORK DRIVER API */
26435 +#ifndef alloc_etherdev
26436 +#define alloc_etherdev _kc_alloc_etherdev
26437 +extern struct net_device * _kc_alloc_etherdev(int sizeof_priv);
26440 +#ifndef is_valid_ether_addr
26441 +#define is_valid_ether_addr _kc_is_valid_ether_addr
26442 +extern int _kc_is_valid_ether_addr(u8 *addr);
26445 +/**************************************/
26446 +/* MISCELLANEOUS */
26448 +#ifndef INIT_TQUEUE
26449 +#define INIT_TQUEUE(_tq, _routine, _data) \
26451 + INIT_LIST_HEAD(&(_tq)->list); \
26452 + (_tq)->sync = 0; \
26453 + (_tq)->routine = _routine; \
26454 + (_tq)->data = _data; \
26458 +#endif /* 2.4.3 => 2.4.0 */
26460 +/*****************************************************************************/
26461 +#if ( LINUX_VERSION_CODE < KERNEL_VERSION(2,4,5) )
26462 +/* Generic MII registers. */
26463 +#define MII_BMCR 0x00 /* Basic mode control register */
26464 +#define MII_BMSR 0x01 /* Basic mode status register */
26465 +#define MII_PHYSID1 0x02 /* PHYS ID 1 */
26466 +#define MII_PHYSID2 0x03 /* PHYS ID 2 */
26467 +#define MII_ADVERTISE 0x04 /* Advertisement control reg */
26468 +#define MII_LPA 0x05 /* Link partner ability reg */
26469 +#define MII_EXPANSION 0x06 /* Expansion register */
26470 +/* Basic mode control register. */
26471 +#define BMCR_FULLDPLX 0x0100 /* Full duplex */
26472 +#define BMCR_ANENABLE 0x1000 /* Enable auto negotiation */
26473 +/* Basic mode status register. */
26474 +#define BMSR_ERCAP 0x0001 /* Ext-reg capability */
26475 +#define BMSR_ANEGCAPABLE 0x0008 /* Able to do auto-negotiation */
26476 +#define BMSR_10HALF 0x0800 /* Can do 10mbps, half-duplex */
26477 +#define BMSR_10FULL 0x1000 /* Can do 10mbps, full-duplex */
26478 +#define BMSR_100HALF 0x2000 /* Can do 100mbps, half-duplex */
26479 +#define BMSR_100FULL 0x4000 /* Can do 100mbps, full-duplex */
26480 +/* Advertisement control register. */
26481 +#define ADVERTISE_CSMA 0x0001 /* Only selector supported */
26482 +#define ADVERTISE_10HALF 0x0020 /* Try for 10mbps half-duplex */
26483 +#define ADVERTISE_10FULL 0x0040 /* Try for 10mbps full-duplex */
26484 +#define ADVERTISE_100HALF 0x0080 /* Try for 100mbps half-duplex */
26485 +#define ADVERTISE_100FULL 0x0100 /* Try for 100mbps full-duplex */
26486 +#define ADVERTISE_ALL (ADVERTISE_10HALF | ADVERTISE_10FULL | \
26487 + ADVERTISE_100HALF | ADVERTISE_100FULL)
26488 +/* Expansion register for auto-negotiation. */
26489 +#define EXPANSION_ENABLENPAGE 0x0004 /* This enables npage words */
26492 +/*****************************************************************************/
26493 +/* 2.4.6 => 2.4.3 */
26494 +#if ( LINUX_VERSION_CODE < KERNEL_VERSION(2,4,6) )
26496 +#ifndef pci_set_power_state
26497 +#define pci_set_power_state _kc_pci_set_power_state
26498 +extern int _kc_pci_set_power_state(struct pci_dev *dev, int state);
26501 +#ifndef pci_enable_wake
26502 +#define pci_enable_wake _kc_pci_enable_wake
26503 +extern int _kc_pci_enable_wake(struct pci_dev *pdev, u32 state, int enable);
26506 +#ifndef pci_disable_device
26507 +#define pci_disable_device _kc_pci_disable_device
26508 +extern void _kc_pci_disable_device(struct pci_dev *pdev);
26511 +/* PCI PM entry point syntax changed, so don't support suspend/resume */
26514 +#endif /* 2.4.6 => 2.4.3 */
26516 +#ifndef HAVE_PCI_SET_MWI
26517 +#define pci_set_mwi(X) pci_write_config_word(X, \
26518 + PCI_COMMAND, adapter->hw.bus.pci_cmd_word | \
26519 + PCI_COMMAND_INVALIDATE);
26520 +#define pci_clear_mwi(X) pci_write_config_word(X, \
26521 + PCI_COMMAND, adapter->hw.bus.pci_cmd_word & \
26522 + ~PCI_COMMAND_INVALIDATE);
26525 +/*****************************************************************************/
26526 +/* 2.4.10 => 2.4.9 */
26527 +#if ( LINUX_VERSION_CODE < KERNEL_VERSION(2,4,10) )
26529 +/**************************************/
26532 +#ifndef MODULE_LICENSE
26533 + #define MODULE_LICENSE(X)
26536 +/**************************************/
26540 +#define min(x,y) ({ \
26541 + const typeof(x) _x = (x); \
26542 + const typeof(y) _y = (y); \
26543 + (void) (&_x == &_y); \
26544 + _x < _y ? _x : _y; })
26547 +#define max(x,y) ({ \
26548 + const typeof(x) _x = (x); \
26549 + const typeof(y) _y = (y); \
26550 + (void) (&_x == &_y); \
26551 + _x > _y ? _x : _y; })
26553 +#ifndef list_for_each_safe
26554 +#define list_for_each_safe(pos, n, head) \
26555 + for (pos = (head)->next, n = pos->next; pos != (head); \
26556 + pos = n, n = pos->next)
26559 +#endif /* 2.4.10 -> 2.4.6 */
26562 +/*****************************************************************************/
26563 +/* 2.4.13 => 2.4.10 */
26564 +#if ( LINUX_VERSION_CODE < KERNEL_VERSION(2,4,13) )
26566 +/**************************************/
26567 +/* PCI DMA MAPPING */
26569 +#ifndef virt_to_page
26570 + #define virt_to_page(v) (mem_map + (virt_to_phys(v) >> PAGE_SHIFT))
26573 +#ifndef pci_map_page
26574 +#define pci_map_page _kc_pci_map_page
26575 +extern u64 _kc_pci_map_page(struct pci_dev *dev, struct page *page, unsigned long offset, size_t size, int direction);
26578 +#ifndef pci_unmap_page
26579 +#define pci_unmap_page _kc_pci_unmap_page
26580 +extern void _kc_pci_unmap_page(struct pci_dev *dev, u64 dma_addr, size_t size, int direction);
26583 +/* pci_set_dma_mask takes dma_addr_t, which is only 32-bits prior to 2.4.13 */
26585 +#undef DMA_32BIT_MASK
26586 +#define DMA_32BIT_MASK 0xffffffff
26587 +#undef DMA_64BIT_MASK
26588 +#define DMA_64BIT_MASK 0xffffffff
26590 +/**************************************/
26594 +#define cpu_relax() rep_nop()
26597 +#endif /* 2.4.13 => 2.4.10 */
26599 +/*****************************************************************************/
26600 +/* 2.4.17 => 2.4.12 */
26601 +#if ( LINUX_VERSION_CODE < KERNEL_VERSION(2,4,17) )
26603 +#ifndef __devexit_p
26604 + #define __devexit_p(x) &(x)
26607 +#endif /* 2.4.17 => 2.4.13 */
26609 +/*****************************************************************************/
26610 +/* 2.4.20 => 2.4.19 */
26611 +#if ( LINUX_VERSION_CODE < KERNEL_VERSION(2,4,20) )
26613 +/* we won't support NAPI on less than 2.4.20 */
26615 +#undef CONFIG_E1000_NAPI
26616 +#undef CONFIG_E1000E_NAPI
26617 +#undef CONFIG_IXGB_NAPI
26620 +#endif /* 2.4.20 => 2.4.19 */
26621 +/*****************************************************************************/
26622 +/* 2.4.22 => 2.4.17 */
26623 +#if ( LINUX_VERSION_CODE < KERNEL_VERSION(2,4,22) )
26624 +#define pci_name(x) ((x)->slot_name)
26627 +/*****************************************************************************/
26628 +/* 2.4.22 => 2.4.17 */
26630 +#if ( LINUX_VERSION_CODE < KERNEL_VERSION(2,4,22) )
26633 +/*****************************************************************************/
26634 +/*****************************************************************************/
26635 +/* 2.4.23 => 2.4.22 */
26636 +#if ( LINUX_VERSION_CODE < KERNEL_VERSION(2,4,23) )
26637 +/*****************************************************************************/
26639 +#ifndef netif_poll_disable
26640 +#define netif_poll_disable(x) _kc_netif_poll_disable(x)
26641 +static inline void _kc_netif_poll_disable(struct net_device *netdev)
26643 + while (test_and_set_bit(__LINK_STATE_RX_SCHED, &netdev->state)) {
26645 + current->state = TASK_INTERRUPTIBLE;
26646 + schedule_timeout(1);
26651 +#ifndef netif_poll_enable
26652 +#define netif_poll_enable(x) _kc_netif_poll_enable(x)
26653 +static inline void _kc_netif_poll_enable(struct net_device *netdev)
26655 + clear_bit(__LINK_STATE_RX_SCHED, &netdev->state);
26659 +#ifndef netif_tx_disable
26660 +#define netif_tx_disable(x) _kc_netif_tx_disable(x)
26661 +static inline void _kc_netif_tx_disable(struct net_device *dev)
26663 + spin_lock_bh(&dev->xmit_lock);
26664 + netif_stop_queue(dev);
26665 + spin_unlock_bh(&dev->xmit_lock);
26668 +#endif /* 2.4.23 => 2.4.22 */
26670 +/*****************************************************************************/
26671 +/* 2.6.4 => 2.6.0 */
26672 +#if ( LINUX_VERSION_CODE < KERNEL_VERSION(2,4,25) || \
26673 + ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) && \
26674 + LINUX_VERSION_CODE < KERNEL_VERSION(2,6,4) ) )
26675 +#define ETHTOOL_OPS_COMPAT
26676 +#endif /* 2.6.4 => 2.6.0 */
26678 +/*****************************************************************************/
26679 +/* 2.5.71 => 2.4.x */
26680 +#if ( LINUX_VERSION_CODE < KERNEL_VERSION(2,5,71) )
26681 +#include <net/sock.h>
26682 +#define sk_protocol protocol
26684 +#define pci_get_device pci_find_device
26685 +#endif /* 2.5.70 => 2.4.x */
26687 +/*****************************************************************************/
26688 +/* < 2.4.27 or 2.6.0 <= 2.6.5 */
26689 +#if ( LINUX_VERSION_CODE < KERNEL_VERSION(2,4,27) || \
26690 + ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) && \
26691 + LINUX_VERSION_CODE < KERNEL_VERSION(2,6,5) ) )
26693 +#ifndef netif_msg_init
26694 +#define netif_msg_init _kc_netif_msg_init
26695 +static inline u32 _kc_netif_msg_init(int debug_value, int default_msg_enable_bits)
26697 + /* use default */
26698 + if (debug_value < 0 || debug_value >= (sizeof(u32) * 8))
26699 + return default_msg_enable_bits;
26700 + if (debug_value == 0) /* no output */
26702 + /* set low N bits */
26703 + return (1 << debug_value) -1;
26707 +#endif /* < 2.4.27 or 2.6.0 <= 2.6.5 */
26708 +/*****************************************************************************/
26709 +#if (( LINUX_VERSION_CODE < KERNEL_VERSION(2,4,27) ) || \
26710 + (( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) ) && \
26711 + ( LINUX_VERSION_CODE < KERNEL_VERSION(2,6,3) )))
26712 +#define netdev_priv(x) x->priv
26715 +/*****************************************************************************/
26717 +#if ( LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) )
26718 +#undef pci_register_driver
26719 +#define pci_register_driver pci_module_init
26721 +#define dev_err(__unused_dev, format, arg...) \
26722 + printk(KERN_ERR "%s: " format, pci_name(adapter->pdev) , ## arg)
26723 +#define dev_warn(__unused_dev, format, arg...) \
26724 + printk(KERN_WARNING "%s: " format, pci_name(pdev) , ## arg)
26726 +/* hlist_* code - double linked lists */
26727 +struct hlist_head {
26728 + struct hlist_node *first;
26731 +struct hlist_node {
26732 + struct hlist_node *next, **pprev;
26735 +static inline void __hlist_del(struct hlist_node *n)
26737 + struct hlist_node *next = n->next;
26738 + struct hlist_node **pprev = n->pprev;
26741 + next->pprev = pprev;
26744 +static inline void hlist_del(struct hlist_node *n)
26751 +static inline void hlist_add_head(struct hlist_node *n, struct hlist_head *h)
26753 + struct hlist_node *first = h->first;
26756 + first->pprev = &n->next;
26758 + n->pprev = &h->first;
26761 +static inline int hlist_empty(const struct hlist_head *h)
26763 + return !h->first;
26765 +#define HLIST_HEAD_INIT { .first = NULL }
26766 +#define HLIST_HEAD(name) struct hlist_head name = { .first = NULL }
26767 +#define INIT_HLIST_HEAD(ptr) ((ptr)->first = NULL)
26768 +static inline void INIT_HLIST_NODE(struct hlist_node *h)
26773 +#define hlist_entry(ptr, type, member) container_of(ptr,type,member)
26775 +#define hlist_for_each_entry(tpos, pos, head, member) \
26776 + for (pos = (head)->first; \
26777 + pos && ({ prefetch(pos->next); 1;}) && \
26778 + ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \
26781 +#define hlist_for_each_entry_safe(tpos, pos, n, head, member) \
26782 + for (pos = (head)->first; \
26783 + pos && ({ n = pos->next; 1; }) && \
26784 + ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \
26787 +/* we ignore GFP here */
26788 +#define dma_alloc_coherent(dv, sz, dma, gfp) \
26789 + pci_alloc_consistent(pdev, (sz), (dma))
26790 +#define dma_free_coherent(dv, sz, addr, dma_addr) \
26791 + pci_free_consistent(pdev, (sz), (addr), (dma_addr))
26793 +#ifndef might_sleep
26794 +#define might_sleep()
26797 +#ifndef NETREG_REGISTERED
26798 +#define NETREG_REGISTERED 1
26799 +#define reg_state deadbeaf
26801 +#endif /* <= 2.5.0 */
26803 +/*****************************************************************************/
26804 +/* 2.5.28 => 2.4.23 */
26805 +#if ( LINUX_VERSION_CODE < KERNEL_VERSION(2,5,28) )
26807 +static inline void _kc_synchronize_irq(void)
26809 + synchronize_irq();
26811 +#undef synchronize_irq
26812 +#define synchronize_irq(X) _kc_synchronize_irq()
26814 +#include <linux/tqueue.h>
26815 +#define work_struct tq_struct
26817 +#define INIT_WORK(a,b) INIT_TQUEUE(a,(void (*)(void *))b,a)
26818 +#undef container_of
26819 +#define container_of list_entry
26820 +#define schedule_work schedule_task
26821 +#define flush_scheduled_work flush_scheduled_tasks
26822 +#define cancel_work_sync(x) flush_scheduled_work()
26824 +#endif /* 2.5.28 => 2.4.17 */
26826 +/*****************************************************************************/
26827 +/* 2.6.0 => 2.5.28 */
26828 +#if ( LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0) )
26829 +#define MODULE_INFO(version, _version)
26830 +#ifndef CONFIG_E1000_DISABLE_PACKET_SPLIT
26831 +#define CONFIG_E1000_DISABLE_PACKET_SPLIT 1
26833 +#ifndef CONFIG_IGB_DISABLE_PACKET_SPLIT
26834 +#define CONFIG_IGB_DISABLE_PACKET_SPLIT 1
26837 +#define pci_set_consistent_dma_mask(dev,mask) 1
26840 +#define dev_put(dev) __dev_put(dev)
26842 +#ifndef skb_fill_page_desc
26843 +#define skb_fill_page_desc _kc_skb_fill_page_desc
26844 +extern void _kc_skb_fill_page_desc(struct sk_buff *skb, int i, struct page *page, int off, int size);
26848 +#define ALIGN(x,a) (((x)+(a)-1)&~((a)-1))
26850 +#ifndef page_count
26851 +#define page_count(p) atomic_read(&(p)->count)
26854 +/* find_first_bit and find_next bit are not defined for most
26855 + * 2.4 kernels (except for the redhat 2.4.21 kernels
26857 +#include <linux/bitops.h>
26858 +#define BITOP_WORD(nr) ((nr) / BITS_PER_LONG)
26859 +#undef find_next_bit
26860 +#define find_next_bit _kc_find_next_bit
26861 +extern unsigned long _kc_find_next_bit(const unsigned long *addr,
26862 + unsigned long size,
26863 + unsigned long offset);
26864 +#define find_first_bit(addr, size) find_next_bit((addr), (size), 0)
26866 +#endif /* 2.6.0 => 2.5.28 */
26868 +/*****************************************************************************/
26869 +/* 2.6.4 => 2.6.0 */
26870 +#if ( LINUX_VERSION_CODE < KERNEL_VERSION(2,6,4) )
26871 +#define MODULE_VERSION(_version) MODULE_INFO(version, _version)
26872 +#endif /* 2.6.4 => 2.6.0 */
26874 +/*****************************************************************************/
26875 +/* 2.6.5 => 2.6.0 */
26876 +#if ( LINUX_VERSION_CODE < KERNEL_VERSION(2,6,5) )
26877 +#define pci_dma_sync_single_for_cpu pci_dma_sync_single
26878 +#define pci_dma_sync_single_for_device pci_dma_sync_single_for_cpu
26879 +#endif /* 2.6.5 => 2.6.0 */
26881 +/*****************************************************************************/
26882 +#if ( LINUX_VERSION_CODE < KERNEL_VERSION(2,6,6) )
26883 +/* taken from 2.6 include/linux/bitmap.h */
26884 +#undef bitmap_zero
26885 +#define bitmap_zero _kc_bitmap_zero
26886 +static inline void _kc_bitmap_zero(unsigned long *dst, int nbits)
26888 + if (nbits <= BITS_PER_LONG)
26891 + int len = BITS_TO_LONGS(nbits) * sizeof(unsigned long);
26892 + memset(dst, 0, len);
26895 +#endif /* < 2.6.6 */
26897 +/*****************************************************************************/
26898 +#if ( LINUX_VERSION_CODE < KERNEL_VERSION(2,6,7) )
26900 +#define if_mii _kc_if_mii
26901 +static inline struct mii_ioctl_data *_kc_if_mii(struct ifreq *rq)
26903 + return (struct mii_ioctl_data *) &rq->ifr_ifru;
26905 +#endif /* < 2.6.7 */
26907 +/*****************************************************************************/
26908 +#if ( LINUX_VERSION_CODE < KERNEL_VERSION(2,6,8) )
26909 +#define msleep(x) do { set_current_state(TASK_UNINTERRUPTIBLE); \
26910 + schedule_timeout((x * HZ)/1000 + 2); \
26913 +#endif /* < 2.6.8 */
26915 +/*****************************************************************************/
26916 +#if ( LINUX_VERSION_CODE < KERNEL_VERSION(2,6,9))
26917 +#include <net/dsfield.h>
26921 +#define kcalloc(n, size, flags) _kc_kzalloc(((n) * (size)), flags)
26922 +extern void *_kc_kzalloc(size_t size, int flags);
26924 +#define MSEC_PER_SEC 1000L
26925 +static inline unsigned int _kc_jiffies_to_msecs(const unsigned long j)
26927 +#if HZ <= MSEC_PER_SEC && !(MSEC_PER_SEC % HZ)
26928 + return (MSEC_PER_SEC / HZ) * j;
26929 +#elif HZ > MSEC_PER_SEC && !(HZ % MSEC_PER_SEC)
26930 + return (j + (HZ / MSEC_PER_SEC) - 1)/(HZ / MSEC_PER_SEC);
26932 + return (j * MSEC_PER_SEC) / HZ;
26935 +static inline unsigned long _kc_msecs_to_jiffies(const unsigned int m)
26937 + if (m > _kc_jiffies_to_msecs(MAX_JIFFY_OFFSET))
26938 + return MAX_JIFFY_OFFSET;
26939 +#if HZ <= MSEC_PER_SEC && !(MSEC_PER_SEC % HZ)
26940 + return (m + (MSEC_PER_SEC / HZ) - 1) / (MSEC_PER_SEC / HZ);
26941 +#elif HZ > MSEC_PER_SEC && !(HZ % MSEC_PER_SEC)
26942 + return m * (HZ / MSEC_PER_SEC);
26944 + return (m * HZ + MSEC_PER_SEC - 1) / MSEC_PER_SEC;
26948 +#define msleep_interruptible _kc_msleep_interruptible
26949 +static inline unsigned long _kc_msleep_interruptible(unsigned int msecs)
26951 + unsigned long timeout = _kc_msecs_to_jiffies(msecs) + 1;
26953 + while (timeout && !signal_pending(current)) {
26954 + __set_current_state(TASK_INTERRUPTIBLE);
26955 + timeout = schedule_timeout(timeout);
26957 + return _kc_jiffies_to_msecs(timeout);
26960 +/* Basic mode control register. */
26961 +#define BMCR_SPEED1000 0x0040 /* MSB of Speed (1000) */
26964 +#define __le16 u16
26967 +#define __le32 u32
26970 +#define __le64 u64
26972 +#endif /* < 2.6.9 */
26974 +/*****************************************************************************/
26975 +#if ( LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10) )
26976 +#ifdef module_param_array_named
26977 +#undef module_param_array_named
26978 +#define module_param_array_named(name, array, type, nump, perm) \
26979 + static struct kparam_array __param_arr_##name \
26980 + = { ARRAY_SIZE(array), nump, param_set_##type, param_get_##type, \
26981 + sizeof(array[0]), array }; \
26982 + module_param_call(name, param_array_set, param_array_get, \
26983 + &__param_arr_##name, perm)
26984 +#endif /* module_param_array_named */
26985 +#endif /* < 2.6.10 */
26987 +/*****************************************************************************/
26988 +#if ( LINUX_VERSION_CODE < KERNEL_VERSION(2,6,11) )
26992 +#define PCI_D3hot 3
26993 +#define PCI_D3cold 4
26994 +#define pci_choose_state(pdev,state) state
26995 +#define PMSG_SUSPEND 3
26996 +#define PCI_EXP_LNKCTL 16
26998 +#undef NETIF_F_LLTX
27000 +#ifndef ARCH_HAS_PREFETCH
27001 +#define prefetch(X)
27004 +#ifndef NET_IP_ALIGN
27005 +#define NET_IP_ALIGN 2
27008 +#define KC_USEC_PER_SEC 1000000L
27009 +#define usecs_to_jiffies _kc_usecs_to_jiffies
27010 +static inline unsigned int _kc_jiffies_to_usecs(const unsigned long j)
27012 +#if HZ <= KC_USEC_PER_SEC && !(KC_USEC_PER_SEC % HZ)
27013 + return (KC_USEC_PER_SEC / HZ) * j;
27014 +#elif HZ > KC_USEC_PER_SEC && !(HZ % KC_USEC_PER_SEC)
27015 + return (j + (HZ / KC_USEC_PER_SEC) - 1)/(HZ / KC_USEC_PER_SEC);
27017 + return (j * KC_USEC_PER_SEC) / HZ;
27020 +static inline unsigned long _kc_usecs_to_jiffies(const unsigned int m)
27022 + if (m > _kc_jiffies_to_usecs(MAX_JIFFY_OFFSET))
27023 + return MAX_JIFFY_OFFSET;
27024 +#if HZ <= KC_USEC_PER_SEC && !(KC_USEC_PER_SEC % HZ)
27025 + return (m + (KC_USEC_PER_SEC / HZ) - 1) / (KC_USEC_PER_SEC / HZ);
27026 +#elif HZ > KC_USEC_PER_SEC && !(HZ % KC_USEC_PER_SEC)
27027 + return m * (HZ / KC_USEC_PER_SEC);
27029 + return (m * HZ + KC_USEC_PER_SEC - 1) / KC_USEC_PER_SEC;
27032 +#endif /* < 2.6.11 */
27034 +/*****************************************************************************/
27035 +#if ( LINUX_VERSION_CODE < KERNEL_VERSION(2,6,12) )
27036 +#include <linux/reboot.h>
27037 +#define USE_REBOOT_NOTIFIER
27039 +/* Generic MII registers. */
27040 +#define MII_CTRL1000 0x09 /* 1000BASE-T control */
27041 +#define MII_STAT1000 0x0a /* 1000BASE-T status */
27042 +/* Advertisement control register. */
27043 +#define ADVERTISE_PAUSE_CAP 0x0400 /* Try for pause */
27044 +#define ADVERTISE_PAUSE_ASYM 0x0800 /* Try for asymmetric pause */
27045 +/* 1000BASE-T Control register */
27046 +#define ADVERTISE_1000FULL 0x0200 /* Advertise 1000BASE-T full duplex */
27049 +/*****************************************************************************/
27050 +#if ( LINUX_VERSION_CODE < KERNEL_VERSION(2,6,14) )
27051 +#define pm_message_t u32
27053 +#define kzalloc _kc_kzalloc
27054 +extern void *_kc_kzalloc(size_t size, int flags);
27057 +/* Generic MII registers. */
27058 +#define MII_ESTATUS 0x0f /* Extended Status */
27059 +/* Basic mode status register. */
27060 +#define BMSR_ESTATEN 0x0100 /* Extended Status in R15 */
27061 +/* Extended status register. */
27062 +#define ESTATUS_1000_TFULL 0x2000 /* Can do 1000BT Full */
27063 +#define ESTATUS_1000_THALF 0x1000 /* Can do 1000BT Half */
27066 +/*****************************************************************************/
27067 +#if ( LINUX_VERSION_CODE < KERNEL_VERSION(2,6,16) )
27068 +#undef HAVE_PCI_ERS
27069 +#else /* 2.6.16 and above */
27070 +#undef HAVE_PCI_ERS
27071 +#define HAVE_PCI_ERS
27074 +/*****************************************************************************/
27075 +#if ( LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18) )
27077 +#ifndef IRQF_PROBE_SHARED
27078 +#ifdef SA_PROBEIRQ
27079 +#define IRQF_PROBE_SHARED SA_PROBEIRQ
27081 +#define IRQF_PROBE_SHARED 0
27085 +#ifndef IRQF_SHARED
27086 +#define IRQF_SHARED SA_SHIRQ
27089 +#ifndef ARRAY_SIZE
27090 +#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
27093 +#ifndef netdev_alloc_skb
27094 +#define netdev_alloc_skb _kc_netdev_alloc_skb
27095 +extern struct sk_buff *_kc_netdev_alloc_skb(struct net_device *dev,
27096 + unsigned int length);
27099 +#ifndef skb_is_gso
27100 +#ifdef NETIF_F_TSO
27101 +#define skb_is_gso _kc_skb_is_gso
27102 +static inline int _kc_skb_is_gso(const struct sk_buff *skb)
27104 + return skb_shinfo(skb)->gso_size;
27107 +#define skb_is_gso(a) 0
27111 +#endif /* < 2.6.18 */
27113 +/*****************************************************************************/
27114 +#if ( LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19) )
27116 +#ifndef DIV_ROUND_UP
27117 +#define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d))
27120 +#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) )
27121 +#ifndef RHEL_RELEASE_CODE
27122 +#define RHEL_RELEASE_CODE 0
27124 +#ifndef RHEL_RELEASE_VERSION
27125 +#define RHEL_RELEASE_VERSION(a,b) 0
27127 +#ifndef AX_RELEASE_CODE
27128 +#define AX_RELEASE_CODE 0
27130 +#ifndef AX_RELEASE_VERSION
27131 +#define AX_RELEASE_VERSION(a,b) 0
27133 +#if (!(( RHEL_RELEASE_CODE > RHEL_RELEASE_VERSION(4,4) ) && ( RHEL_RELEASE_CODE < RHEL_RELEASE_VERSION(5,0) ) || ( RHEL_RELEASE_CODE > RHEL_RELEASE_VERSION(5,0) ) || (AX_RELEASE_CODE > AX_RELEASE_VERSION(3,0))))
27134 +typedef irqreturn_t (*irq_handler_t)(int, void*, struct pt_regs *);
27136 +typedef irqreturn_t (*new_handler_t)(int, void*);
27137 +static inline irqreturn_t _kc_request_irq(unsigned int irq, new_handler_t handler, unsigned long flags, const char *devname, void *dev_id)
27139 +typedef void (*irq_handler_t)(int, void*, struct pt_regs *);
27140 +typedef void (*new_handler_t)(int, void*);
27141 +static inline int _kc_request_irq(unsigned int irq, new_handler_t handler, unsigned long flags, const char *devname, void *dev_id)
27144 + irq_handler_t new_handler = (irq_handler_t) handler;
27145 + return request_irq(irq, new_handler, flags, devname, dev_id);
27148 +#undef request_irq
27149 +#define request_irq(irq, handler, flags, devname, dev_id) _kc_request_irq((irq), (handler), (flags), (devname), (dev_id))
27151 +#define irq_handler_t new_handler_t
27153 +/* pci_restore_state and pci_save_state handles MSI/PCIE from 2.6.19 */
27154 +#define PCIE_CONFIG_SPACE_LEN 256
27155 +#define PCI_CONFIG_SPACE_LEN 64
27156 +#define PCIE_LINK_STATUS 0x12
27157 +#define pci_config_space_ich8lan() do {} while (0)
27158 +#undef pci_save_state
27159 +extern int _kc_pci_save_state(struct pci_dev *);
27160 +#define pci_save_state(pdev) _kc_pci_save_state(pdev)
27161 +#undef pci_restore_state
27162 +extern void _kc_pci_restore_state(struct pci_dev *);
27163 +#define pci_restore_state(pdev) _kc_pci_restore_state(pdev)
27164 +#ifdef HAVE_PCI_ERS
27165 +#undef free_netdev
27166 +extern void _kc_free_netdev(struct net_device *);
27167 +#define free_netdev(netdev) _kc_free_netdev(netdev)
27170 +#endif /* < 2.6.19 */
27171 +/*****************************************************************************/
27172 +#if ( LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) )
27173 +#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,28) )
27175 +#define INIT_WORK(_work, _func) \
27177 + INIT_LIST_HEAD(&(_work)->entry); \
27178 + (_work)->pending = 0; \
27179 + (_work)->func = (void (*)(void *))_func; \
27180 + (_work)->data = _work; \
27181 + init_timer(&(_work)->timer); \
27185 +#ifndef PCI_VDEVICE
27186 +#define PCI_VDEVICE(ven, dev) \
27187 + PCI_VENDOR_ID_##ven, (dev), \
27188 + PCI_ANY_ID, PCI_ANY_ID, 0, 0
27191 +#ifndef round_jiffies
27192 +#define round_jiffies(x) x
27195 +#define csum_offset csum
27197 +#endif /* < 2.6.20 */
27199 +/*****************************************************************************/
27200 +#if ( LINUX_VERSION_CODE < KERNEL_VERSION(2,6,21) )
27201 +#define vlan_group_get_device(vg, id) (vg->vlan_devices[id])
27202 +#define vlan_group_set_device(vg, id, dev) if (vg) vg->vlan_devices[id] = dev;
27203 +#define pci_channel_offline(pdev) (pdev->error_state && \
27204 + pdev->error_state != pci_channel_io_normal)
27205 +#define pci_request_selected_regions(pdev, bars, name) \
27206 + pci_request_regions(pdev, name)
27207 +#define pci_release_selected_regions(pdev, bars) pci_release_regions(pdev);
27208 +#endif /* < 2.6.21 */
27210 +/*****************************************************************************/
27211 +#if ( LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22) )
27212 +#define tcp_hdr(skb) (skb->h.th)
27213 +#define tcp_hdrlen(skb) (skb->h.th->doff << 2)
27214 +#define skb_transport_offset(skb) (skb->h.raw - skb->data)
27215 +#define skb_transport_header(skb) (skb->h.raw)
27216 +#define ipv6_hdr(skb) (skb->nh.ipv6h)
27217 +#define ip_hdr(skb) (skb->nh.iph)
27218 +#define skb_network_offset(skb) (skb->nh.raw - skb->data)
27219 +#define skb_network_header(skb) (skb->nh.raw)
27220 +#define skb_tail_pointer(skb) skb->tail
27221 +#define skb_copy_to_linear_data_offset(skb, offset, from, len) \
27222 + memcpy(skb->data + offset, from, len)
27223 +#define skb_network_header_len(skb) (skb->h.raw - skb->nh.raw)
27224 +#define pci_register_driver pci_module_init
27225 +#define skb_mac_header(skb) skb->mac.raw
27227 +#ifdef NETIF_F_MULTI_QUEUE
27228 +#ifndef alloc_etherdev_mq
27229 +#define alloc_etherdev_mq(_a, _b) alloc_etherdev(_a)
27231 +#endif /* NETIF_F_MULTI_QUEUE */
27233 +#ifndef ETH_FCS_LEN
27234 +#define ETH_FCS_LEN 4
27236 +#define cancel_work_sync(x) flush_scheduled_work()
27237 +#endif /* < 2.6.22 */
27239 +/*****************************************************************************/
27240 +#if ( LINUX_VERSION_CODE > KERNEL_VERSION(2,6,22) )
27241 +#undef ETHTOOL_GPERMADDR
27242 +#undef SET_MODULE_OWNER
27243 +#define SET_MODULE_OWNER(dev) do { } while (0)
27244 +#endif /* > 2.6.22 */
27246 +/*****************************************************************************/
27247 +#if ( LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24) )
27248 +/* NAPI API changes in 2.6.24 break everything */
27249 +struct napi_struct {
27250 + /* used to look up the real NAPI polling routine */
27251 + int (*poll)(struct napi_struct *, int);
27252 + struct net_device poll_dev;
27256 +extern int __kc_adapter_clean(struct net_device *, int *);
27257 +#if defined(DRIVER_IGB) || defined(DRIVER_IXGBE)
27258 +#define netif_rx_complete(_netdev, napi) netif_rx_complete(&(napi)->poll_dev)
27259 +#define netif_rx_schedule_prep(_netdev, napi) \
27260 + (netif_running(_netdev) && netif_rx_schedule_prep(&(napi)->poll_dev))
27261 +#define netif_rx_schedule(_netdev, napi) netif_rx_schedule(&(napi)->poll_dev)
27262 +#define __netif_rx_schedule(_netdev, napi) __netif_rx_schedule(&(napi)->poll_dev)
27263 +#define napi_enable(napi) do { \
27264 + /* abuse if_port as a counter */ \
27265 + if (!adapter->netdev->if_port) { \
27266 + netif_poll_enable(adapter->netdev); \
27268 + ++adapter->netdev->if_port; \
27269 + netif_poll_enable(&(napi)->poll_dev); \
27271 +#define napi_disable(_napi) do { \
27272 + netif_poll_disable(&(_napi)->poll_dev); \
27273 + --adapter->netdev->if_port; \
27274 + if (!adapter->netdev->if_port) \
27275 + netif_poll_disable(adapter->netdev); \
27278 +#define netif_napi_add(_netdev, _napi, _poll, _weight) \
27280 + struct napi_struct *__napi = (_napi); \
27281 + __napi->poll_dev.poll = &(__kc_adapter_clean); \
27282 + __napi->poll_dev.priv = (_napi); \
27283 + __napi->poll_dev.weight = (_weight); \
27284 + dev_hold(&__napi->poll_dev); \
27285 + set_bit(__LINK_STATE_START, &__napi->poll_dev.state);\
27286 + _netdev->poll = &(__kc_adapter_clean); \
27287 + _netdev->weight = (_weight); \
27288 + __napi->poll = &(_poll); \
27289 + __napi->weight = (_weight); \
27290 + set_bit(__LINK_STATE_RX_SCHED, &(_netdev)->state); \
27291 + set_bit(__LINK_STATE_RX_SCHED, &__napi->poll_dev.state); \
27293 +#define netif_napi_del(_napi) \
27295 + WARN_ON(!test_bit(__LINK_STATE_RX_SCHED, &(_napi)->poll_dev.state)); \
27296 + dev_put(&(_napi)->poll_dev); \
27297 + memset(&(_napi)->poll_dev, 0, sizeof(struct napi_struct));\
27299 +#else /* DRIVER_IGB || DRIVER_IXGBE */
27300 +#define netif_rx_complete(netdev, napi) netif_rx_complete(netdev)
27301 +#define netif_rx_schedule_prep(netdev, napi) netif_rx_schedule_prep(netdev)
27302 +#define netif_rx_schedule(netdev, napi) netif_rx_schedule(netdev)
27303 +#define __netif_rx_schedule(netdev, napi) __netif_rx_schedule(netdev)
27304 +#define napi_enable(napi) netif_poll_enable(adapter->netdev)
27305 +#define napi_disable(napi) netif_poll_disable(adapter->netdev)
27306 +#define netif_napi_add(_netdev, _napi, _poll, _weight) \
27308 + struct napi_struct *__napi = (_napi); \
27309 + _netdev->poll = &(__kc_adapter_clean); \
27310 + _netdev->weight = (_weight); \
27311 + __napi->poll = &(_poll); \
27312 + __napi->weight = (_weight); \
27313 + netif_poll_disable(_netdev); \
27315 +#define netif_napi_del(_a) do {} while (0)
27316 +#endif /* DRIVER_IGB || DRIVER_IXGBE */
27318 +#define netif_napi_add(_netdev, _napi, _poll, _weight) \
27320 + struct napi_struct *__napi = _napi; \
27321 + _netdev->poll = &(_poll); \
27322 + _netdev->weight = (_weight); \
27323 + __napi->poll = &(_poll); \
27324 + __napi->weight = (_weight); \
27326 +#define netif_napi_del(_a) do {} while (0)
27329 +#undef dev_get_by_name
27330 +#define dev_get_by_name(_a, _b) dev_get_by_name(_b)
27331 +#define __netif_subqueue_stopped(_a, _b) netif_subqueue_stopped(_a, _b)
27333 +#define netif_napi_del(_a) do {} while (0)
27334 +#endif /* < 2.6.24 */
27336 +/*****************************************************************************/
27337 +#if ( LINUX_VERSION_CODE > KERNEL_VERSION(2,6,24) )
27338 +#include <linux/pm_qos_params.h>
27339 +#endif /* > 2.6.24 */
27341 +/*****************************************************************************/
27342 +#if ( LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25) )
27343 +#define PM_QOS_CPU_DMA_LATENCY 1
27345 +#if ( LINUX_VERSION_CODE > KERNEL_VERSION(2,6,18) )
27346 +#include <linux/latency.h>
27347 +#define PM_QOS_DEFAULT_VALUE INFINITE_LATENCY
27348 +#define pm_qos_add_requirement(pm_qos_class, name, value) \
27349 + set_acceptable_latency(name, value)
27350 +#define pm_qos_remove_requirement(pm_qos_class, name) \
27351 + remove_acceptable_latency(name)
27352 +#define pm_qos_update_requirement(pm_qos_class, name, value) \
27353 + modify_acceptable_latency(name, value)
27355 +#define PM_QOS_DEFAULT_VALUE -1
27356 +#define pm_qos_add_requirement(pm_qos_class, name, value)
27357 +#define pm_qos_remove_requirement(pm_qos_class, name)
27358 +#define pm_qos_update_requirement(pm_qos_class, name, value) { \
27359 + if (value != PM_QOS_DEFAULT_VALUE) { \
27360 + printk(KERN_WARNING "%s: unable to set PM QoS requirement\n", \
27361 + pci_name(adapter->pdev)); \
27364 +#endif /* > 2.6.18 */
27366 +#define pci_enable_device_mem(pdev) pci_enable_device(pdev)
27368 +#endif /* < 2.6.25 */
27370 +/*****************************************************************************/
27371 +#ifndef PCIE_LINK_STATE_L0S
27372 +#define PCIE_LINK_STATE_L0S 1
27375 +/*****************************************************************************/
27376 +#if ( LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27) )
27377 +#ifndef netif_napi_del
27378 +#define netif_napi_del(_a) do {} while (0)
27380 +#ifdef CONFIG_NETPOLL
27381 +#undef netif_napi_del
27382 +#define netif_napi_del(_a) list_del(&(_a)->dev_list);
27385 +#endif /* netif_napi_del */
27386 +#ifndef pci_dma_mapping_error
27387 +#define pci_dma_mapping_error _kc_pci_dma_mapping_error
27388 +static inline int _kc_pci_dma_mapping_error(struct pci_dev *pdev,
27389 + dma_addr_t dma_addr)
27391 + return dma_addr == 0;
27395 +#ifdef CONFIG_NETDEVICES_MULTIQUEUE
27396 +#define HAVE_TX_MQ
27400 +extern void _kc_netif_tx_stop_all_queues(struct net_device *);
27401 +extern void _kc_netif_tx_wake_all_queues(struct net_device *);
27402 +extern void _kc_netif_tx_start_all_queues(struct net_device *);
27403 +#define netif_tx_stop_all_queues(a) _kc_netif_tx_stop_all_queues(a)
27404 +#define netif_tx_wake_all_queues(a) _kc_netif_tx_wake_all_queues(a)
27405 +#define netif_tx_start_all_queues(a) _kc_netif_tx_start_all_queues(a)
27406 +#else /* CONFIG_NETDEVICES_MULTIQUEUE */
27407 +#define netif_tx_stop_all_queues(a) netif_stop_queue(a)
27408 +#define netif_tx_wake_all_queues(a) netif_wake_queue(a)
27409 +#define netif_tx_start_all_queues(a) netif_start_queue(a)
27410 +#endif /* CONFIG_NETDEVICES_MULTIQUEUE */
27411 +#ifndef NETIF_F_MULTI_QUEUE
27412 +#define NETIF_F_MULTI_QUEUE 0
27413 +#define netif_is_multiqueue(a) 0
27414 +#define netif_stop_subqueue(a, b)
27415 +#define netif_wake_subqueue(a, b)
27416 +#define netif_start_subqueue(a, b)
27417 +#endif /* NETIF_F_MULTI_QUEUE */
27418 +#else /* < 2.6.27 */
27419 +#define HAVE_TX_MQ
27420 +#endif /* < 2.6.27 */
27422 +#endif /* _KCOMPAT_H_ */
27423 Binary files vanilla/drivers/net/igb/kcompat.o and linux-i686-2.6.22/drivers/net/igb/kcompat.o differ
27424 diff -Nru vanilla/drivers/net/igb/.kcompat.o.cmd linux-i686-2.6.22/drivers/net/igb/.kcompat.o.cmd
27425 --- vanilla/drivers/net/igb/.kcompat.o.cmd 1969-12-31 19:00:00.000000000 -0500
27426 +++ linux-i686-2.6.22/drivers/net/igb/.kcompat.o.cmd 2009-07-16 19:53:45.000000000 -0400
27428 +cmd_drivers/net/igb/kcompat.o := gcc -m32 -Wp,-MD,drivers/net/igb/.kcompat.o.d -nostdinc -isystem /usr/lib/gcc/i386-redhat-linux/4.1.2/include -D__KERNEL__ -Iinclude -include include/linux/autoconf.h -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Os -pipe -msoft-float -mregparm=3 -freg-struct-return -mpreferred-stack-boundary=2 -march=i686 -mtune=generic -ffreestanding -maccumulate-outgoing-args -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -Iinclude/asm-i386/mach-generic -Iinclude/asm-i386/mach-default -fno-omit-frame-pointer -fno-optimize-sibling-calls -g -fno-stack-protector -Wdeclaration-after-statement -Wno-pointer-sign -DMODULE -D"KBUILD_STR(s)=\#s" -D"KBUILD_BASENAME=KBUILD_STR(kcompat)" -D"KBUILD_MODNAME=KBUILD_STR(igb)" -c -o drivers/net/igb/.tmp_kcompat.o drivers/net/igb/kcompat.c
27430 +deps_drivers/net/igb/kcompat.o := \
27431 + drivers/net/igb/kcompat.c \
27432 + $(wildcard include/config/highmem.h) \
27433 + $(wildcard include/config/space/len.h) \
27434 + $(wildcard include/config/sysfs.h) \
27435 + drivers/net/igb/igb.h \
27436 + $(wildcard include/config/dca.h) \
27437 + $(wildcard include/config/inet/lro.h) \
27438 + $(wildcard include/config/igb/separate/tx/handler.h) \
27439 + $(wildcard include/config/igb/disable/packet/split.h) \
27440 + include/linux/pci.h \
27441 + $(wildcard include/config/pci/msi.h) \
27442 + $(wildcard include/config/pci.h) \
27443 + $(wildcard include/config/ht/irq.h) \
27444 + $(wildcard include/config/pci/domains.h) \
27445 + include/linux/pci_regs.h \
27446 + include/linux/mod_devicetable.h \
27447 + include/linux/types.h \
27448 + $(wildcard include/config/uid16.h) \
27449 + $(wildcard include/config/lbd.h) \
27450 + $(wildcard include/config/lsf.h) \
27451 + $(wildcard include/config/resources/64bit.h) \
27452 + include/linux/posix_types.h \
27453 + include/linux/stddef.h \
27454 + include/linux/compiler.h \
27455 + $(wildcard include/config/enable/must/check.h) \
27456 + include/linux/compiler-gcc4.h \
27457 + $(wildcard include/config/forced/inlining.h) \
27458 + include/linux/compiler-gcc.h \
27459 + include/asm/posix_types.h \
27460 + include/asm/types.h \
27461 + $(wildcard include/config/highmem64g.h) \
27462 + include/linux/ioport.h \
27463 + include/linux/list.h \
27464 + $(wildcard include/config/debug/list.h) \
27465 + include/linux/poison.h \
27466 + include/linux/prefetch.h \
27467 + include/asm/processor.h \
27468 + $(wildcard include/config/smp.h) \
27469 + $(wildcard include/config/x86/ht.h) \
27470 + $(wildcard include/config/paravirt.h) \
27471 + $(wildcard include/config/mk8.h) \
27472 + $(wildcard include/config/mk7.h) \
27473 + include/asm/vm86.h \
27474 + $(wildcard include/config/vm86.h) \
27475 + include/asm/ptrace.h \
27476 + include/asm/ptrace-abi.h \
27477 + include/asm/segment.h \
27478 + include/asm/math_emu.h \
27479 + include/asm/sigcontext.h \
27480 + include/asm/page.h \
27481 + $(wildcard include/config/x86/use/3dnow.h) \
27482 + $(wildcard include/config/x86/pae.h) \
27483 + $(wildcard include/config/hugetlb/page.h) \
27484 + $(wildcard include/config/highmem4g.h) \
27485 + $(wildcard include/config/page/offset.h) \
27486 + $(wildcard include/config/flatmem.h) \
27487 + include/asm-generic/pgtable-nopmd.h \
27488 + include/asm-generic/pgtable-nopud.h \
27489 + include/asm-generic/memory_model.h \
27490 + $(wildcard include/config/discontigmem.h) \
27491 + $(wildcard include/config/sparsemem.h) \
27492 + $(wildcard include/config/out/of/line/pfn/to/page.h) \
27493 + include/asm-generic/page.h \
27494 + include/asm/cpufeature.h \
27495 + include/linux/bitops.h \
27496 + include/asm/bitops.h \
27497 + include/asm/alternative.h \
27498 + include/asm-generic/bitops/sched.h \
27499 + include/asm-generic/bitops/hweight.h \
27500 + include/asm-generic/bitops/fls64.h \
27501 + include/asm-generic/bitops/ext2-non-atomic.h \
27502 + include/asm-generic/bitops/le.h \
27503 + include/asm/byteorder.h \
27504 + $(wildcard include/config/x86/bswap.h) \
27505 + include/linux/byteorder/little_endian.h \
27506 + include/linux/byteorder/swab.h \
27507 + include/linux/byteorder/generic.h \
27508 + include/asm-generic/bitops/minix.h \
27509 + include/asm/required-features.h \
27510 + $(wildcard include/config/x86/minimum/cpu.h) \
27511 + $(wildcard include/config/x86/cmov.h) \
27512 + $(wildcard include/config/x86/cmpxchg64.h) \
27513 + include/asm/msr.h \
27514 + include/asm/msr-index.h \
27515 + include/asm/errno.h \
27516 + include/asm-generic/errno.h \
27517 + include/asm-generic/errno-base.h \
27518 + include/linux/errno.h \
27519 + include/asm/system.h \
27520 + $(wildcard include/config/x86/oostore.h) \
27521 + include/linux/kernel.h \
27522 + $(wildcard include/config/preempt/voluntary.h) \
27523 + $(wildcard include/config/debug/spinlock/sleep.h) \
27524 + $(wildcard include/config/printk.h) \
27525 + $(wildcard include/config/numa.h) \
27526 + /usr/lib/gcc/i386-redhat-linux/4.1.2/include/stdarg.h \
27527 + include/linux/linkage.h \
27528 + include/asm/linkage.h \
27529 + $(wildcard include/config/x86/alignment/16.h) \
27530 + include/linux/log2.h \
27531 + $(wildcard include/config/arch/has/ilog2/u32.h) \
27532 + $(wildcard include/config/arch/has/ilog2/u64.h) \
27533 + include/asm/bug.h \
27534 + $(wildcard include/config/bug.h) \
27535 + $(wildcard include/config/debug/bugverbose.h) \
27536 + include/asm-generic/bug.h \
27537 + $(wildcard include/config/generic/bug.h) \
27538 + include/asm/cmpxchg.h \
27539 + $(wildcard include/config/x86/cmpxchg.h) \
27540 + include/linux/irqflags.h \
27541 + $(wildcard include/config/trace/irqflags.h) \
27542 + $(wildcard include/config/trace/irqflags/support.h) \
27543 + $(wildcard include/config/x86.h) \
27544 + include/asm/irqflags.h \
27545 + include/asm/processor-flags.h \
27546 + include/linux/cache.h \
27547 + include/asm/cache.h \
27548 + $(wildcard include/config/x86/l1/cache/shift.h) \
27549 + include/linux/threads.h \
27550 + $(wildcard include/config/nr/cpus.h) \
27551 + $(wildcard include/config/base/small.h) \
27552 + include/asm/percpu.h \
27553 + include/linux/cpumask.h \
27554 + $(wildcard include/config/hotplug/cpu.h) \
27555 + include/linux/bitmap.h \
27556 + include/linux/string.h \
27557 + include/asm/string.h \
27558 + include/linux/init.h \
27559 + $(wildcard include/config/modules.h) \
27560 + $(wildcard include/config/hotplug.h) \
27561 + $(wildcard include/config/memory/hotplug.h) \
27562 + $(wildcard include/config/acpi/hotplug/memory.h) \
27563 + include/asm/atomic.h \
27564 + $(wildcard include/config/m386.h) \
27565 + include/asm-generic/atomic.h \
27566 + include/linux/device.h \
27567 + $(wildcard include/config/debug/devres.h) \
27568 + include/linux/kobject.h \
27569 + include/linux/sysfs.h \
27570 + include/linux/spinlock.h \
27571 + $(wildcard include/config/debug/spinlock.h) \
27572 + $(wildcard include/config/preempt.h) \
27573 + $(wildcard include/config/debug/lock/alloc.h) \
27574 + include/linux/preempt.h \
27575 + $(wildcard include/config/debug/preempt.h) \
27576 + include/linux/thread_info.h \
27577 + include/asm/thread_info.h \
27578 + $(wildcard include/config/4kstacks.h) \
27579 + $(wildcard include/config/debug/stack/usage.h) \
27580 + include/linux/stringify.h \
27581 + include/linux/bottom_half.h \
27582 + include/linux/spinlock_types.h \
27583 + include/linux/lockdep.h \
27584 + $(wildcard include/config/lockdep.h) \
27585 + $(wildcard include/config/generic/hardirqs.h) \
27586 + $(wildcard include/config/prove/locking.h) \
27587 + include/asm/spinlock_types.h \
27588 + include/asm/spinlock.h \
27589 + $(wildcard include/config/x86/ppro/fence.h) \
27590 + include/asm/rwlock.h \
27591 + include/linux/spinlock_api_smp.h \
27592 + include/linux/kref.h \
27593 + include/linux/wait.h \
27594 + include/asm/current.h \
27595 + include/linux/klist.h \
27596 + include/linux/completion.h \
27597 + include/linux/module.h \
27598 + $(wildcard include/config/modversions.h) \
27599 + $(wildcard include/config/unused/symbols.h) \
27600 + $(wildcard include/config/module/unload.h) \
27601 + $(wildcard include/config/kallsyms.h) \
27602 + include/linux/stat.h \
27603 + include/asm/stat.h \
27604 + include/linux/time.h \
27605 + include/linux/seqlock.h \
27606 + include/linux/vs_time.h \
27607 + $(wildcard include/config/vserver/vtime.h) \
27608 + include/linux/kmod.h \
27609 + $(wildcard include/config/kmod.h) \
27610 + include/linux/elf.h \
27611 + include/linux/auxvec.h \
27612 + include/asm/auxvec.h \
27613 + include/linux/elf-em.h \
27614 + include/asm/elf.h \
27615 + include/asm/user.h \
27616 + include/asm/desc.h \
27617 + include/asm/ldt.h \
27618 + include/linux/smp.h \
27619 + include/asm/smp.h \
27620 + $(wildcard include/config/x86/local/apic.h) \
27621 + $(wildcard include/config/x86/io/apic.h) \
27622 + include/asm/mpspec.h \
27623 + $(wildcard include/config/acpi.h) \
27624 + include/asm/mpspec_def.h \
27625 + include/asm-i386/mach-generic/mach_mpspec.h \
27626 + include/asm/apic.h \
27627 + $(wildcard include/config/x86/good/apic.h) \
27628 + include/linux/pm.h \
27629 + $(wildcard include/config/pm.h) \
27630 + include/linux/delay.h \
27631 + include/asm/delay.h \
27632 + include/asm/fixmap.h \
27633 + $(wildcard include/config/x86/visws/apic.h) \
27634 + $(wildcard include/config/x86/f00f/bug.h) \
27635 + $(wildcard include/config/x86/cyclone/timer.h) \
27636 + $(wildcard include/config/pci/mmconfig.h) \
27637 + include/asm/acpi.h \
27638 + $(wildcard include/config/acpi/sleep.h) \
27639 + include/acpi/pdc_intel.h \
27640 + include/asm/apicdef.h \
27641 + include/asm/kmap_types.h \
27642 + $(wildcard include/config/debug/highmem.h) \
27643 + include/asm/io_apic.h \
27644 + include/asm-i386/mach-generic/mach_apicdef.h \
27645 + include/asm/genapic.h \
27646 + include/linux/percpu.h \
27647 + include/linux/slab.h \
27648 + $(wildcard include/config/slab/debug.h) \
27649 + $(wildcard include/config/slab.h) \
27650 + $(wildcard include/config/slub.h) \
27651 + $(wildcard include/config/debug/slab.h) \
27652 + include/linux/gfp.h \
27653 + $(wildcard include/config/zone/dma.h) \
27654 + $(wildcard include/config/zone/dma32.h) \
27655 + include/linux/mmzone.h \
27656 + $(wildcard include/config/force/max/zoneorder.h) \
27657 + $(wildcard include/config/arch/populates/node/map.h) \
27658 + $(wildcard include/config/flat/node/mem/map.h) \
27659 + $(wildcard include/config/have/memory/present.h) \
27660 + $(wildcard include/config/need/node/memmap/size.h) \
27661 + $(wildcard include/config/need/multiple/nodes.h) \
27662 + $(wildcard include/config/have/arch/early/pfn/to/nid.h) \
27663 + $(wildcard include/config/sparsemem/extreme.h) \
27664 + $(wildcard include/config/nodes/span/other/nodes.h) \
27665 + $(wildcard include/config/holes/in/zone.h) \
27666 + include/linux/numa.h \
27667 + $(wildcard include/config/nodes/shift.h) \
27668 + include/linux/nodemask.h \
27669 + include/linux/memory_hotplug.h \
27670 + $(wildcard include/config/have/arch/nodedata/extension.h) \
27671 + include/linux/notifier.h \
27672 + include/linux/mutex.h \
27673 + $(wildcard include/config/debug/mutexes.h) \
27674 + $(wildcard include/config/chopstix.h) \
27675 + include/linux/rwsem.h \
27676 + $(wildcard include/config/rwsem/generic/spinlock.h) \
27677 + include/asm/rwsem.h \
27678 + include/linux/srcu.h \
27679 + include/linux/topology.h \
27680 + $(wildcard include/config/sched/smt.h) \
27681 + $(wildcard include/config/sched/mc.h) \
27682 + include/asm/topology.h \
27683 + include/asm-generic/topology.h \
27684 + include/linux/slab_def.h \
27685 + include/linux/kmalloc_sizes.h \
27686 + include/asm/mmu.h \
27687 + include/asm/semaphore.h \
27688 + include/linux/moduleparam.h \
27689 + include/asm/local.h \
27690 + include/asm/module.h \
27691 + $(wildcard include/config/m486.h) \
27692 + $(wildcard include/config/m586.h) \
27693 + $(wildcard include/config/m586tsc.h) \
27694 + $(wildcard include/config/m586mmx.h) \
27695 + $(wildcard include/config/mcore2.h) \
27696 + $(wildcard include/config/m686.h) \
27697 + $(wildcard include/config/mpentiumii.h) \
27698 + $(wildcard include/config/mpentiumiii.h) \
27699 + $(wildcard include/config/mpentiumm.h) \
27700 + $(wildcard include/config/mpentium4.h) \
27701 + $(wildcard include/config/mk6.h) \
27702 + $(wildcard include/config/x86/elan.h) \
27703 + $(wildcard include/config/mcrusoe.h) \
27704 + $(wildcard include/config/mefficeon.h) \
27705 + $(wildcard include/config/mwinchipc6.h) \
27706 + $(wildcard include/config/mwinchip2.h) \
27707 + $(wildcard include/config/mwinchip3d.h) \
27708 + $(wildcard include/config/mcyrixiii.h) \
27709 + $(wildcard include/config/mviac3/2.h) \
27710 + $(wildcard include/config/mviac7.h) \
27711 + $(wildcard include/config/mgeodegx1.h) \
27712 + $(wildcard include/config/mgeode/lx.h) \
27713 + include/asm/device.h \
27714 + include/linux/pci_ids.h \
27715 + include/linux/dmapool.h \
27716 + include/asm/io.h \
27717 + $(wildcard include/config/x86/numaq.h) \
27718 + include/asm-generic/iomap.h \
27719 + include/linux/vmalloc.h \
27720 + include/asm/scatterlist.h \
27721 + include/asm/pci.h \
27722 + include/linux/mm.h \
27723 + $(wildcard include/config/sysctl.h) \
27724 + $(wildcard include/config/mmu.h) \
27725 + $(wildcard include/config/stack/growsup.h) \
27726 + $(wildcard include/config/debug/vm.h) \
27727 + $(wildcard include/config/shmem.h) \
27728 + $(wildcard include/config/split/ptlock/cpus.h) \
27729 + $(wildcard include/config/ia64.h) \
27730 + $(wildcard include/config/proc/fs.h) \
27731 + $(wildcard include/config/debug/pagealloc.h) \
27732 + include/linux/capability.h \
27733 + include/linux/rbtree.h \
27734 + include/linux/prio_tree.h \
27735 + include/linux/fs.h \
27736 + $(wildcard include/config/dnotify.h) \
27737 + $(wildcard include/config/vserver/cowbl.h) \
27738 + $(wildcard include/config/quota.h) \
27739 + $(wildcard include/config/inotify.h) \
27740 + $(wildcard include/config/security.h) \
27741 + $(wildcard include/config/epoll.h) \
27742 + $(wildcard include/config/auditsyscall.h) \
27743 + $(wildcard include/config/block.h) \
27744 + $(wildcard include/config/fs/xip.h) \
27745 + $(wildcard include/config/migration.h) \
27746 + include/linux/limits.h \
27747 + include/linux/ioctl.h \
27748 + include/asm/ioctl.h \
27749 + include/asm-generic/ioctl.h \
27750 + include/linux/kdev_t.h \
27751 + include/linux/dcache.h \
27752 + $(wildcard include/config/profiling.h) \
27753 + include/linux/rcupdate.h \
27754 + include/linux/namei.h \
27755 + include/linux/radix-tree.h \
27756 + include/linux/pid.h \
27757 + include/linux/quota.h \
27758 + include/linux/dqblk_xfs.h \
27759 + include/linux/dqblk_v1.h \
27760 + include/linux/dqblk_v2.h \
27761 + include/linux/nfs_fs_i.h \
27762 + include/linux/nfs.h \
27763 + include/linux/sunrpc/msg_prot.h \
27764 + include/linux/fcntl.h \
27765 + include/asm/fcntl.h \
27766 + include/asm-generic/fcntl.h \
27767 + $(wildcard include/config/64bit.h) \
27768 + include/linux/err.h \
27769 + include/linux/debug_locks.h \
27770 + $(wildcard include/config/debug/locking/api/selftests.h) \
27771 + include/linux/backing-dev.h \
27772 + include/linux/mm_types.h \
27773 + include/asm/pgtable.h \
27774 + $(wildcard include/config/highpte.h) \
27775 + include/asm/paravirt.h \
27776 + include/asm/pgtable-2level-defs.h \
27777 + include/asm/pgtable-2level.h \
27778 + include/asm-generic/pgtable.h \
27779 + include/linux/page-flags.h \
27780 + $(wildcard include/config/s390.h) \
27781 + $(wildcard include/config/swap.h) \
27782 + include/linux/vmstat.h \
27783 + $(wildcard include/config/vm/event/counters.h) \
27784 + include/asm-generic/pci-dma-compat.h \
27785 + include/linux/dma-mapping.h \
27786 + include/asm/dma-mapping.h \
27787 + include/asm-generic/pci.h \
27788 + include/linux/netdevice.h \
27789 + $(wildcard include/config/ax25.h) \
27790 + $(wildcard include/config/tr.h) \
27791 + $(wildcard include/config/net/ipip.h) \
27792 + $(wildcard include/config/net/ipgre.h) \
27793 + $(wildcard include/config/ipv6/sit.h) \
27794 + $(wildcard include/config/ipv6/tunnel.h) \
27795 + $(wildcard include/config/wireless/ext.h) \
27796 + $(wildcard include/config/netpoll.h) \
27797 + $(wildcard include/config/net/poll/controller.h) \
27798 + $(wildcard include/config/netpoll/trap.h) \
27799 + $(wildcard include/config/net/dma.h) \
27800 + include/linux/if.h \
27801 + include/linux/socket.h \
27802 + $(wildcard include/config/compat.h) \
27803 + include/asm/socket.h \
27804 + include/asm/sockios.h \
27805 + include/linux/sockios.h \
27806 + include/linux/uio.h \
27807 + include/linux/hdlc/ioctl.h \
27808 + include/linux/if_ether.h \
27809 + include/linux/skbuff.h \
27810 + $(wildcard include/config/nf/conntrack.h) \
27811 + $(wildcard include/config/bridge/netfilter.h) \
27812 + $(wildcard include/config/vlan/8021q.h) \
27813 + $(wildcard include/config/net/sched.h) \
27814 + $(wildcard include/config/net/cls/act.h) \
27815 + $(wildcard include/config/network/secmark.h) \
27816 + include/linux/net.h \
27817 + include/linux/random.h \
27818 + include/linux/sysctl.h \
27819 + $(wildcard include/config/icmp/ipod.h) \
27820 + $(wildcard include/config/web100/net100.h) \
27821 + $(wildcard include/config/web100/stats.h) \
27822 + include/linux/textsearch.h \
27823 + include/net/checksum.h \
27824 + include/asm/uaccess.h \
27825 + $(wildcard include/config/x86/intel/usercopy.h) \
27826 + $(wildcard include/config/x86/wp/works/ok.h) \
27827 + include/asm/checksum.h \
27828 + include/linux/in6.h \
27829 + include/linux/dmaengine.h \
27830 + $(wildcard include/config/dma/engine.h) \
27831 + include/linux/hrtimer.h \
27832 + $(wildcard include/config/high/res/timers.h) \
27833 + $(wildcard include/config/timer/stats.h) \
27834 + include/linux/ktime.h \
27835 + $(wildcard include/config/ktime/scalar.h) \
27836 + include/linux/jiffies.h \
27837 + include/linux/calc64.h \
27838 + include/asm/div64.h \
27839 + include/linux/timex.h \
27840 + $(wildcard include/config/time/interpolation.h) \
27841 + $(wildcard include/config/no/hz.h) \
27842 + include/asm/param.h \
27843 + $(wildcard include/config/hz.h) \
27844 + include/asm/timex.h \
27845 + include/asm/tsc.h \
27846 + $(wildcard include/config/x86/tsc.h) \
27847 + $(wildcard include/config/x86/generic.h) \
27848 + include/linux/if_packet.h \
27849 + include/linux/timer.h \
27850 + include/linux/interrupt.h \
27851 + $(wildcard include/config/generic/irq/probe.h) \
27852 + include/linux/irqreturn.h \
27853 + include/linux/hardirq.h \
27854 + $(wildcard include/config/preempt/bkl.h) \
27855 + $(wildcard include/config/virt/cpu/accounting.h) \
27856 + include/linux/smp_lock.h \
27857 + $(wildcard include/config/lock/kernel.h) \
27858 + include/linux/sched.h \
27859 + $(wildcard include/config/detect/softlockup.h) \
27860 + $(wildcard include/config/keys.h) \
27861 + $(wildcard include/config/bsd/process/acct.h) \
27862 + $(wildcard include/config/taskstats.h) \
27863 + $(wildcard include/config/inotify/user.h) \
27864 + $(wildcard include/config/schedstats.h) \
27865 + $(wildcard include/config/task/delay/acct.h) \
27866 + $(wildcard include/config/blk/dev/io/trace.h) \
27867 + $(wildcard include/config/cc/stackprotector.h) \
27868 + $(wildcard include/config/sysvipc.h) \
27869 + $(wildcard include/config/rt/mutexes.h) \
27870 + $(wildcard include/config/task/xacct.h) \
27871 + $(wildcard include/config/cpusets.h) \
27872 + $(wildcard include/config/fault/injection.h) \
27873 + include/asm/cputime.h \
27874 + include/asm-generic/cputime.h \
27875 + include/linux/sem.h \
27876 + include/linux/ipc.h \
27877 + $(wildcard include/config/ipc/ns.h) \
27878 + include/asm/ipcbuf.h \
27879 + include/asm/sembuf.h \
27880 + include/linux/signal.h \
27881 + include/asm/signal.h \
27882 + include/asm-generic/signal.h \
27883 + include/asm/siginfo.h \
27884 + include/asm-generic/siginfo.h \
27885 + include/linux/securebits.h \
27886 + include/linux/fs_struct.h \
27887 + include/linux/seccomp.h \
27888 + $(wildcard include/config/seccomp.h) \
27889 + include/linux/futex.h \
27890 + $(wildcard include/config/futex.h) \
27891 + include/linux/rtmutex.h \
27892 + $(wildcard include/config/debug/rt/mutexes.h) \
27893 + include/linux/plist.h \
27894 + $(wildcard include/config/debug/pi/list.h) \
27895 + include/linux/param.h \
27896 + include/linux/resource.h \
27897 + include/asm/resource.h \
27898 + include/asm-generic/resource.h \
27899 + include/linux/task_io_accounting.h \
27900 + $(wildcard include/config/task/io/accounting.h) \
27901 + include/linux/aio.h \
27902 + include/linux/workqueue.h \
27903 + include/linux/aio_abi.h \
27904 + include/asm/hardirq.h \
27905 + include/linux/irq.h \
27906 + $(wildcard include/config/irq/per/cpu.h) \
27907 + $(wildcard include/config/irq/release/method.h) \
27908 + $(wildcard include/config/generic/pending/irq.h) \
27909 + $(wildcard include/config/irqbalance.h) \
27910 + $(wildcard include/config/auto/irq/affinity.h) \
27911 + $(wildcard include/config/generic/hardirqs/no//do/irq.h) \
27912 + include/asm/irq.h \
27913 + include/asm-i386/mach-default/irq_vectors.h \
27914 + include/asm-i386/mach-default/irq_vectors_limits.h \
27915 + include/asm/irq_regs.h \
27916 + include/asm/hw_irq.h \
27917 + include/linux/profile.h \
27918 + include/asm/sections.h \
27919 + include/asm-generic/sections.h \
27920 + include/linux/irq_cpustat.h \
27921 + include/linux/ethtool.h \
27922 + drivers/net/igb/kcompat.h \
27923 + $(wildcard include/config/e1000/napi.h) \
27924 + $(wildcard include/config/e1000e/napi.h) \
27925 + $(wildcard include/config/ixgb/napi.h) \
27926 + $(wildcard include/config/e1000/disable/packet/split.h) \
27927 + $(wildcard include/config/netdevices/multiqueue.h) \
27928 + include/linux/version.h \
27929 + include/linux/etherdevice.h \
27930 + include/linux/in.h \
27931 + include/linux/ip.h \
27932 + include/linux/udp.h \
27933 + include/net/inet_sock.h \
27934 + $(wildcard include/config/ipv6.h) \
27935 + include/linux/jhash.h \
27936 + include/net/flow.h \
27937 + $(wildcard include/config/ipv6/mip6.h) \
27938 + include/net/sock.h \
27939 + $(wildcard include/config/security/network.h) \
27940 + include/linux/security.h \
27941 + $(wildcard include/config/security/network/xfrm.h) \
27942 + include/linux/binfmts.h \
27943 + include/linux/shm.h \
27944 + include/asm/shmparam.h \
27945 + include/asm/shmbuf.h \
27946 + include/linux/msg.h \
27947 + include/asm/msgbuf.h \
27948 + include/linux/key.h \
27949 + include/linux/xfrm.h \
27950 + include/linux/filter.h \
27951 + include/net/dst.h \
27952 + $(wildcard include/config/net/cls/route.h) \
27953 + $(wildcard include/config/xfrm.h) \
27954 + include/linux/rtnetlink.h \
27955 + include/linux/netlink.h \
27956 + include/linux/if_link.h \
27957 + include/linux/if_addr.h \
27958 + include/linux/neighbour.h \
27959 + include/net/neighbour.h \
27960 + include/linux/seq_file.h \
27961 + include/net/rtnetlink.h \
27962 + include/net/netlink.h \
27963 + include/net/request_sock.h \
27964 + include/linux/mii.h \
27965 + include/linux/latency.h \
27966 + drivers/net/igb/e1000_api.h \
27967 + drivers/net/igb/e1000_hw.h \
27968 + drivers/net/igb/e1000_osdep.h \
27969 + drivers/net/igb/e1000_regs.h \
27970 + drivers/net/igb/e1000_defines.h \
27971 + $(wildcard include/config/res.h) \
27972 + $(wildcard include/config/fault.h) \
27973 + drivers/net/igb/e1000_mac.h \
27974 + drivers/net/igb/e1000_phy.h \
27975 + drivers/net/igb/e1000_nvm.h \
27976 + drivers/net/igb/e1000_manage.h \
27977 + drivers/net/igb/e1000_82575.h \
27979 +drivers/net/igb/kcompat.o: $(deps_drivers/net/igb/kcompat.o)
27981 +$(deps_drivers/net/igb/kcompat.o):
27982 diff -Nru vanilla/drivers/net/igb/Makefile linux-i686-2.6.22/drivers/net/igb/Makefile
27983 --- vanilla/drivers/net/igb/Makefile 1969-12-31 19:00:00.000000000 -0500
27984 +++ linux-i686-2.6.22/drivers/net/igb/Makefile 2009-07-16 19:53:34.000000000 -0400
27986 +################################################################################
27988 +# Intel(R) Gigabit Ethernet Linux driver
27989 +# Copyright(c) 2007-2008 Intel Corporation.
27991 +# This program is free software; you can redistribute it and/or modify it
27992 +# under the terms and conditions of the GNU General Public License,
27993 +# version 2, as published by the Free Software Foundation.
27995 +# This program is distributed in the hope it will be useful, but WITHOUT
27996 +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
27997 +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
28000 +# You should have received a copy of the GNU General Public License along with
28001 +# this program; if not, write to the Free Software Foundation, Inc.,
28002 +# 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
28004 +# The full GNU General Public License is included in this distribution in
28005 +# the file called "COPYING".
28007 +# Contact Information:
28008 +# e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
28009 +# Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
28011 +################################################################################
28013 +###########################################################################
28015 +obj-$(CONFIG_IGB) += igb.o
28017 +igb-objs := e1000_82575.o igb_main.o e1000_mac.o e1000_nvm.o e1000_phy.o e1000_manage.o igb_param.o igb_ethtool.o kcompat.o e1000_api.o
28018 diff -Nru vanilla/drivers/net/igb/Makefile~ linux-i686-2.6.22/drivers/net/igb/Makefile~
28019 --- vanilla/drivers/net/igb/Makefile~ 1969-12-31 19:00:00.000000000 -0500
28020 +++ linux-i686-2.6.22/drivers/net/igb/Makefile~ 2009-07-16 19:29:30.000000000 -0400
28022 +################################################################################
28024 +# Intel(R) Gigabit Ethernet Linux driver
28025 +# Copyright(c) 2007-2008 Intel Corporation.
28027 +# This program is free software; you can redistribute it and/or modify it
28028 +# under the terms and conditions of the GNU General Public License,
28029 +# version 2, as published by the Free Software Foundation.
28031 +# This program is distributed in the hope it will be useful, but WITHOUT
28032 +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
28033 +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
28036 +# You should have received a copy of the GNU General Public License along with
28037 +# this program; if not, write to the Free Software Foundation, Inc.,
28038 +# 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
28040 +# The full GNU General Public License is included in this distribution in
28041 +# the file called "COPYING".
28043 +# Contact Information:
28044 +# e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
28045 +# Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
28047 +################################################################################
28049 +###########################################################################
28051 +obj-$(CONFIG_IGB) += igb.o
28053 +igb-objs := e1000_82575.o igb_main.o e1000_mac.0 e1000_nvm.o e1000_phy.o e1000_manage.o igb_param.o igb_ethtool.o kcompat.o e1000_api.o
28054 --- linux-2.6.22-710/drivers/net/Kconfig 2009-07-16 19:36:18.000000000 -0400
28055 +++ linux-i686-2.6.22/drivers/net/Kconfig 2009-07-16 19:56:54.000000000 -0400
28056 @@ -1905,6 +1905,12 @@
28061 + tristate "Intel(R) IGB Ethernet support"
28064 + Marc's port of the IGB driver.
28067 tristate "Alteon AceNIC/3Com 3C985/NetGear GA620 Gigabit support"
28069 --- linux-a/drivers/net/Makefile 2009-07-17 00:29:08.000000000 -0400
28070 +++ linux-b/drivers/net/Makefile 2009-07-17 00:29:37.000000000 -0400
28072 # Makefile for the Linux network (ethercard) device drivers.
28074 obj-m += vnet_tun.o
28075 +obj-$(CONFIG_IGB) += igb/
28076 obj-$(CONFIG_E1000) += e1000/
28077 obj-$(CONFIG_E1000E) += e1000e/
28078 obj-$(CONFIG_IBM_EMAC) += ibm_emac/