Thread: [RTnet-developers] Add e1000e driver to RTnet
Brought to you by:
bet-frogger,
kiszka
|
From: Arnout V. (Essensium/Mind) <ar...@mi...> - 2011-10-06 20:12:36
|
This patch series adds the e1000e driver from Linux 2.6.32.20 to RTnet. It is based on the work of Stefan Kral, but rewritten a bit to making merging upstream patches more easy. |
|
From: Arnout V. (Essensium/Mind) <ar...@mi...> - 2011-10-06 20:13:29
|
From: "Arnout Vandecappelle (Essensium/Mind)" <ar...@mi...>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <ar...@mi...>
---
drivers/experimental/e1000e/82571.c | 1829 +++++++++++
drivers/experimental/e1000e/Makefile | 37 +
drivers/experimental/e1000e/defines.h | 815 +++++
drivers/experimental/e1000e/e1000.h | 666 ++++
drivers/experimental/e1000e/es2lan.c | 1433 +++++++++
drivers/experimental/e1000e/ethtool.c | 1983 ++++++++++++
drivers/experimental/e1000e/hw.h | 940 ++++++
drivers/experimental/e1000e/ich8lan.c | 3571 +++++++++++++++++++++
drivers/experimental/e1000e/lib.c | 2530 +++++++++++++++
drivers/experimental/e1000e/netdev.c | 5453 +++++++++++++++++++++++++++++++++
drivers/experimental/e1000e/param.c | 475 +++
drivers/experimental/e1000e/phy.c | 3134 +++++++++++++++++++
12 files changed, 22866 insertions(+), 0 deletions(-)
create mode 100644 drivers/experimental/e1000e/82571.c
create mode 100644 drivers/experimental/e1000e/Makefile
create mode 100644 drivers/experimental/e1000e/defines.h
create mode 100644 drivers/experimental/e1000e/e1000.h
create mode 100644 drivers/experimental/e1000e/es2lan.c
create mode 100644 drivers/experimental/e1000e/ethtool.c
create mode 100644 drivers/experimental/e1000e/hw.h
create mode 100644 drivers/experimental/e1000e/ich8lan.c
create mode 100644 drivers/experimental/e1000e/lib.c
create mode 100644 drivers/experimental/e1000e/netdev.c
create mode 100644 drivers/experimental/e1000e/param.c
create mode 100644 drivers/experimental/e1000e/phy.c
diff --git a/drivers/experimental/e1000e/82571.c b/drivers/experimental/e1000e/82571.c
new file mode 100644
index 0000000..d1e0563
--- /dev/null
+++ b/drivers/experimental/e1000e/82571.c
@@ -0,0 +1,1829 @@
+/*******************************************************************************
+
+ Intel PRO/1000 Linux driver
+ Copyright(c) 1999 - 2008 Intel Corporation.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms and conditions of the GNU General Public License,
+ version 2, as published by the Free Software Foundation.
+
+ This program is distributed in the hope it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
+
+ The full GNU General Public License is included in this distribution in
+ the file called "COPYING".
+
+ Contact Information:
+ Linux NICS <lin...@in...>
+ e1000-devel Mailing List <e10...@li...>
+ Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
+
+*******************************************************************************/
+
+/*
+ * 82571EB Gigabit Ethernet Controller
+ * 82571EB Gigabit Ethernet Controller (Copper)
+ * 82571EB Gigabit Ethernet Controller (Fiber)
+ * 82571EB Dual Port Gigabit Mezzanine Adapter
+ * 82571EB Quad Port Gigabit Mezzanine Adapter
+ * 82571PT Gigabit PT Quad Port Server ExpressModule
+ * 82572EI Gigabit Ethernet Controller (Copper)
+ * 82572EI Gigabit Ethernet Controller (Fiber)
+ * 82572EI Gigabit Ethernet Controller
+ * 82573V Gigabit Ethernet Controller (Copper)
+ * 82573E Gigabit Ethernet Controller (Copper)
+ * 82573L Gigabit Ethernet Controller
+ * 82574L Gigabit Network Connection
+ * 82583V Gigabit Network Connection
+ */
+
+#include <linux/netdevice.h>
+#include <linux/delay.h>
+#include <linux/pci.h>
+
+#include "e1000.h"
+
+#define ID_LED_RESERVED_F746 0xF746
+#define ID_LED_DEFAULT_82573 ((ID_LED_DEF1_DEF2 << 12) | \
+ (ID_LED_OFF1_ON2 << 8) | \
+ (ID_LED_DEF1_DEF2 << 4) | \
+ (ID_LED_DEF1_DEF2))
+
+#define E1000_GCR_L1_ACT_WITHOUT_L0S_RX 0x08000000
+
+#define E1000_NVM_INIT_CTRL2_MNGM 0x6000 /* Manageability Operation Mode mask */
+
+static s32 e1000_get_phy_id_82571(struct e1000_hw *hw);
+static s32 e1000_setup_copper_link_82571(struct e1000_hw *hw);
+static s32 e1000_setup_fiber_serdes_link_82571(struct e1000_hw *hw);
+static s32 e1000_check_for_serdes_link_82571(struct e1000_hw *hw);
+static s32 e1000_write_nvm_eewr_82571(struct e1000_hw *hw, u16 offset,
+ u16 words, u16 *data);
+static s32 e1000_fix_nvm_checksum_82571(struct e1000_hw *hw);
+static void e1000_initialize_hw_bits_82571(struct e1000_hw *hw);
+static s32 e1000_setup_link_82571(struct e1000_hw *hw);
+static void e1000_clear_hw_cntrs_82571(struct e1000_hw *hw);
+static bool e1000_check_mng_mode_82574(struct e1000_hw *hw);
+static s32 e1000_led_on_82574(struct e1000_hw *hw);
+static void e1000_put_hw_semaphore_82571(struct e1000_hw *hw);
+
+/**
+ * e1000_init_phy_params_82571 - Init PHY func ptrs.
+ * @hw: pointer to the HW structure
+ *
+ * This is a function pointer entry point called by the api module.
+ **/
+static s32 e1000_init_phy_params_82571(struct e1000_hw *hw)
+{
+ struct e1000_phy_info *phy = &hw->phy;
+ s32 ret_val;
+
+ if (hw->phy.media_type != e1000_media_type_copper) {
+ phy->type = e1000_phy_none;
+ return 0;
+ }
+
+ phy->addr = 1;
+ phy->autoneg_mask = AUTONEG_ADVERTISE_SPEED_DEFAULT;
+ phy->reset_delay_us = 100;
+
+ switch (hw->mac.type) {
+ case e1000_82571:
+ case e1000_82572:
+ phy->type = e1000_phy_igp_2;
+ break;
+ case e1000_82573:
+ phy->type = e1000_phy_m88;
+ break;
+ case e1000_82574:
+ case e1000_82583:
+ phy->type = e1000_phy_bm;
+ break;
+ default:
+ return -E1000_ERR_PHY;
+ break;
+ }
+
+ /* This can only be done after all function pointers are setup. */
+ ret_val = e1000_get_phy_id_82571(hw);
+
+ /* Verify phy id */
+ switch (hw->mac.type) {
+ case e1000_82571:
+ case e1000_82572:
+ if (phy->id != IGP01E1000_I_PHY_ID)
+ return -E1000_ERR_PHY;
+ break;
+ case e1000_82573:
+ if (phy->id != M88E1111_I_PHY_ID)
+ return -E1000_ERR_PHY;
+ break;
+ case e1000_82574:
+ case e1000_82583:
+ if (phy->id != BME1000_E_PHY_ID_R2)
+ return -E1000_ERR_PHY;
+ break;
+ default:
+ return -E1000_ERR_PHY;
+ break;
+ }
+
+ return 0;
+}
+
+/**
+ * e1000_init_nvm_params_82571 - Init NVM func ptrs.
+ * @hw: pointer to the HW structure
+ *
+ * This is a function pointer entry point called by the api module.
+ **/
+static s32 e1000_init_nvm_params_82571(struct e1000_hw *hw)
+{
+ struct e1000_nvm_info *nvm = &hw->nvm;
+ u32 eecd = er32(EECD);
+ u16 size;
+
+ nvm->opcode_bits = 8;
+ nvm->delay_usec = 1;
+ switch (nvm->override) {
+ case e1000_nvm_override_spi_large:
+ nvm->page_size = 32;
+ nvm->address_bits = 16;
+ break;
+ case e1000_nvm_override_spi_small:
+ nvm->page_size = 8;
+ nvm->address_bits = 8;
+ break;
+ default:
+ nvm->page_size = eecd & E1000_EECD_ADDR_BITS ? 32 : 8;
+ nvm->address_bits = eecd & E1000_EECD_ADDR_BITS ? 16 : 8;
+ break;
+ }
+
+ switch (hw->mac.type) {
+ case e1000_82573:
+ case e1000_82574:
+ case e1000_82583:
+ if (((eecd >> 15) & 0x3) == 0x3) {
+ nvm->type = e1000_nvm_flash_hw;
+ nvm->word_size = 2048;
+ /*
+ * Autonomous Flash update bit must be cleared due
+ * to Flash update issue.
+ */
+ eecd &= ~E1000_EECD_AUPDEN;
+ ew32(EECD, eecd);
+ break;
+ }
+ /* Fall Through */
+ default:
+ nvm->type = e1000_nvm_eeprom_spi;
+ size = (u16)((eecd & E1000_EECD_SIZE_EX_MASK) >>
+ E1000_EECD_SIZE_EX_SHIFT);
+ /*
+ * Added to a constant, "size" becomes the left-shift value
+ * for setting word_size.
+ */
+ size += NVM_WORD_SIZE_BASE_SHIFT;
+
+ /* EEPROM access above 16k is unsupported */
+ if (size > 14)
+ size = 14;
+ nvm->word_size = 1 << size;
+ break;
+ }
+
+ return 0;
+}
+
+/**
+ * e1000_init_mac_params_82571 - Init MAC func ptrs.
+ * @hw: pointer to the HW structure
+ *
+ * This is a function pointer entry point called by the api module.
+ **/
+static s32 e1000_init_mac_params_82571(struct e1000_adapter *adapter)
+{
+ struct e1000_hw *hw = &adapter->hw;
+ struct e1000_mac_info *mac = &hw->mac;
+ struct e1000_mac_operations *func = &mac->ops;
+ u32 swsm = 0;
+ u32 swsm2 = 0;
+ bool force_clear_smbi = false;
+
+ /* Set media type */
+ switch (adapter->pdev->device) {
+ case E1000_DEV_ID_82571EB_FIBER:
+ case E1000_DEV_ID_82572EI_FIBER:
+ case E1000_DEV_ID_82571EB_QUAD_FIBER:
+ hw->phy.media_type = e1000_media_type_fiber;
+ break;
+ case E1000_DEV_ID_82571EB_SERDES:
+ case E1000_DEV_ID_82572EI_SERDES:
+ case E1000_DEV_ID_82571EB_SERDES_DUAL:
+ case E1000_DEV_ID_82571EB_SERDES_QUAD:
+ hw->phy.media_type = e1000_media_type_internal_serdes;
+ break;
+ default:
+ hw->phy.media_type = e1000_media_type_copper;
+ break;
+ }
+
+ /* Set mta register count */
+ mac->mta_reg_count = 128;
+ /* Set rar entry count */
+ mac->rar_entry_count = E1000_RAR_ENTRIES;
+ /* Set if manageability features are enabled. */
+ mac->arc_subsystem_valid = (er32(FWSM) & E1000_FWSM_MODE_MASK) ? 1 : 0;
+
+ /* check for link */
+ switch (hw->phy.media_type) {
+ case e1000_media_type_copper:
+ func->setup_physical_interface = e1000_setup_copper_link_82571;
+ func->check_for_link = e1000e_check_for_copper_link;
+ func->get_link_up_info = e1000e_get_speed_and_duplex_copper;
+ break;
+ case e1000_media_type_fiber:
+ func->setup_physical_interface =
+ e1000_setup_fiber_serdes_link_82571;
+ func->check_for_link = e1000e_check_for_fiber_link;
+ func->get_link_up_info =
+ e1000e_get_speed_and_duplex_fiber_serdes;
+ break;
+ case e1000_media_type_internal_serdes:
+ func->setup_physical_interface =
+ e1000_setup_fiber_serdes_link_82571;
+ func->check_for_link = e1000_check_for_serdes_link_82571;
+ func->get_link_up_info =
+ e1000e_get_speed_and_duplex_fiber_serdes;
+ break;
+ default:
+ return -E1000_ERR_CONFIG;
+ break;
+ }
+
+ switch (hw->mac.type) {
+ case e1000_82574:
+ case e1000_82583:
+ func->check_mng_mode = e1000_check_mng_mode_82574;
+ func->led_on = e1000_led_on_82574;
+ break;
+ default:
+ func->check_mng_mode = e1000e_check_mng_mode_generic;
+ func->led_on = e1000e_led_on_generic;
+ break;
+ }
+
+ /*
+ * Ensure that the inter-port SWSM.SMBI lock bit is clear before
+ * first NVM or PHY acess. This should be done for single-port
+ * devices, and for one port only on dual-port devices so that
+ * for those devices we can still use the SMBI lock to synchronize
+ * inter-port accesses to the PHY & NVM.
+ */
+ switch (hw->mac.type) {
+ case e1000_82571:
+ case e1000_82572:
+ swsm2 = er32(SWSM2);
+
+ if (!(swsm2 & E1000_SWSM2_LOCK)) {
+ /* Only do this for the first interface on this card */
+ ew32(SWSM2,
+ swsm2 | E1000_SWSM2_LOCK);
+ force_clear_smbi = true;
+ } else
+ force_clear_smbi = false;
+ break;
+ default:
+ force_clear_smbi = true;
+ break;
+ }
+
+ if (force_clear_smbi) {
+ /* Make sure SWSM.SMBI is clear */
+ swsm = er32(SWSM);
+ if (swsm & E1000_SWSM_SMBI) {
+ /* This bit should not be set on a first interface, and
+ * indicates that the bootagent or EFI code has
+ * improperly left this bit enabled
+ */
+ hw_dbg(hw, "Please update your 82571 Bootagent\n");
+ }
+ ew32(SWSM, swsm & ~E1000_SWSM_SMBI);
+ }
+
+ /*
+ * Initialze device specific counter of SMBI acquisition
+ * timeouts.
+ */
+ hw->dev_spec.e82571.smb_counter = 0;
+
+ return 0;
+}
+
+static s32 e1000_get_variants_82571(struct e1000_adapter *adapter)
+{
+ struct e1000_hw *hw = &adapter->hw;
+ static int global_quad_port_a; /* global port a indication */
+ struct pci_dev *pdev = adapter->pdev;
+ u16 eeprom_data = 0;
+ int is_port_b = er32(STATUS) & E1000_STATUS_FUNC_1;
+ s32 rc;
+
+ rc = e1000_init_mac_params_82571(adapter);
+ if (rc)
+ return rc;
+
+ rc = e1000_init_nvm_params_82571(hw);
+ if (rc)
+ return rc;
+
+ rc = e1000_init_phy_params_82571(hw);
+ if (rc)
+ return rc;
+
+ /* tag quad port adapters first, it's used below */
+ switch (pdev->device) {
+ case E1000_DEV_ID_82571EB_QUAD_COPPER:
+ case E1000_DEV_ID_82571EB_QUAD_FIBER:
+ case E1000_DEV_ID_82571EB_QUAD_COPPER_LP:
+ case E1000_DEV_ID_82571PT_QUAD_COPPER:
+ adapter->flags |= FLAG_IS_QUAD_PORT;
+ /* mark the first port */
+ if (global_quad_port_a == 0)
+ adapter->flags |= FLAG_IS_QUAD_PORT_A;
+ /* Reset for multiple quad port adapters */
+ global_quad_port_a++;
+ if (global_quad_port_a == 4)
+ global_quad_port_a = 0;
+ break;
+ default:
+ break;
+ }
+
+ switch (adapter->hw.mac.type) {
+ case e1000_82571:
+ /* these dual ports don't have WoL on port B at all */
+ if (((pdev->device == E1000_DEV_ID_82571EB_FIBER) ||
+ (pdev->device == E1000_DEV_ID_82571EB_SERDES) ||
+ (pdev->device == E1000_DEV_ID_82571EB_COPPER)) &&
+ (is_port_b))
+ adapter->flags &= ~FLAG_HAS_WOL;
+ /* quad ports only support WoL on port A */
+ if (adapter->flags & FLAG_IS_QUAD_PORT &&
+ (!(adapter->flags & FLAG_IS_QUAD_PORT_A)))
+ adapter->flags &= ~FLAG_HAS_WOL;
+ /* Does not support WoL on any port */
+ if (pdev->device == E1000_DEV_ID_82571EB_SERDES_QUAD)
+ adapter->flags &= ~FLAG_HAS_WOL;
+ break;
+
+ case e1000_82573:
+ if (pdev->device == E1000_DEV_ID_82573L) {
+ if (e1000_read_nvm(&adapter->hw, NVM_INIT_3GIO_3, 1,
+ &eeprom_data) < 0)
+ break;
+ if (!(eeprom_data & NVM_WORD1A_ASPM_MASK)) {
+ adapter->flags |= FLAG_HAS_JUMBO_FRAMES;
+ adapter->max_hw_frame_size = DEFAULT_JUMBO;
+ }
+ }
+ break;
+ default:
+ break;
+ }
+
+ return 0;
+}
+
+/**
+ * e1000_get_phy_id_82571 - Retrieve the PHY ID and revision
+ * @hw: pointer to the HW structure
+ *
+ * Reads the PHY registers and stores the PHY ID and possibly the PHY
+ * revision in the hardware structure.
+ **/
+static s32 e1000_get_phy_id_82571(struct e1000_hw *hw)
+{
+ struct e1000_phy_info *phy = &hw->phy;
+ s32 ret_val;
+ u16 phy_id = 0;
+
+ switch (hw->mac.type) {
+ case e1000_82571:
+ case e1000_82572:
+ /*
+ * The 82571 firmware may still be configuring the PHY.
+ * In this case, we cannot access the PHY until the
+ * configuration is done. So we explicitly set the
+ * PHY ID.
+ */
+ phy->id = IGP01E1000_I_PHY_ID;
+ break;
+ case e1000_82573:
+ return e1000e_get_phy_id(hw);
+ break;
+ case e1000_82574:
+ case e1000_82583:
+ ret_val = e1e_rphy(hw, PHY_ID1, &phy_id);
+ if (ret_val)
+ return ret_val;
+
+ phy->id = (u32)(phy_id << 16);
+ udelay(20);
+ ret_val = e1e_rphy(hw, PHY_ID2, &phy_id);
+ if (ret_val)
+ return ret_val;
+
+ phy->id |= (u32)(phy_id);
+ phy->revision = (u32)(phy_id & ~PHY_REVISION_MASK);
+ break;
+ default:
+ return -E1000_ERR_PHY;
+ break;
+ }
+
+ return 0;
+}
+
+/**
+ * e1000_get_hw_semaphore_82571 - Acquire hardware semaphore
+ * @hw: pointer to the HW structure
+ *
+ * Acquire the HW semaphore to access the PHY or NVM
+ **/
+static s32 e1000_get_hw_semaphore_82571(struct e1000_hw *hw)
+{
+ u32 swsm;
+ s32 sw_timeout = hw->nvm.word_size + 1;
+ s32 fw_timeout = hw->nvm.word_size + 1;
+ s32 i = 0;
+
+ /*
+ * If we have timedout 3 times on trying to acquire
+ * the inter-port SMBI semaphore, there is old code
+ * operating on the other port, and it is not
+ * releasing SMBI. Modify the number of times that
+ * we try for the semaphore to interwork with this
+ * older code.
+ */
+ if (hw->dev_spec.e82571.smb_counter > 2)
+ sw_timeout = 1;
+
+ /* Get the SW semaphore */
+ while (i < sw_timeout) {
+ swsm = er32(SWSM);
+ if (!(swsm & E1000_SWSM_SMBI))
+ break;
+
+ udelay(50);
+ i++;
+ }
+
+ if (i == sw_timeout) {
+ hw_dbg(hw, "Driver can't access device - SMBI bit is set.\n");
+ hw->dev_spec.e82571.smb_counter++;
+ }
+ /* Get the FW semaphore. */
+ for (i = 0; i < fw_timeout; i++) {
+ swsm = er32(SWSM);
+ ew32(SWSM, swsm | E1000_SWSM_SWESMBI);
+
+ /* Semaphore acquired if bit latched */
+ if (er32(SWSM) & E1000_SWSM_SWESMBI)
+ break;
+
+ udelay(50);
+ }
+
+ if (i == fw_timeout) {
+ /* Release semaphores */
+ e1000_put_hw_semaphore_82571(hw);
+ hw_dbg(hw, "Driver can't access the NVM\n");
+ return -E1000_ERR_NVM;
+ }
+
+ return 0;
+}
+
+/**
+ * e1000_put_hw_semaphore_82571 - Release hardware semaphore
+ * @hw: pointer to the HW structure
+ *
+ * Release hardware semaphore used to access the PHY or NVM
+ **/
+static void e1000_put_hw_semaphore_82571(struct e1000_hw *hw)
+{
+ u32 swsm;
+
+ swsm = er32(SWSM);
+ swsm &= ~(E1000_SWSM_SMBI | E1000_SWSM_SWESMBI);
+ ew32(SWSM, swsm);
+}
+
+/**
+ * e1000_acquire_nvm_82571 - Request for access to the EEPROM
+ * @hw: pointer to the HW structure
+ *
+ * To gain access to the EEPROM, first we must obtain a hardware semaphore.
+ * Then for non-82573 hardware, set the EEPROM access request bit and wait
+ * for EEPROM access grant bit. If the access grant bit is not set, release
+ * hardware semaphore.
+ **/
+static s32 e1000_acquire_nvm_82571(struct e1000_hw *hw)
+{
+ s32 ret_val;
+
+ ret_val = e1000_get_hw_semaphore_82571(hw);
+ if (ret_val)
+ return ret_val;
+
+ switch (hw->mac.type) {
+ case e1000_82573:
+ case e1000_82574:
+ case e1000_82583:
+ break;
+ default:
+ ret_val = e1000e_acquire_nvm(hw);
+ break;
+ }
+
+ if (ret_val)
+ e1000_put_hw_semaphore_82571(hw);
+
+ return ret_val;
+}
+
+/**
+ * e1000_release_nvm_82571 - Release exclusive access to EEPROM
+ * @hw: pointer to the HW structure
+ *
+ * Stop any current commands to the EEPROM and clear the EEPROM request bit.
+ **/
+static void e1000_release_nvm_82571(struct e1000_hw *hw)
+{
+ e1000e_release_nvm(hw);
+ e1000_put_hw_semaphore_82571(hw);
+}
+
+/**
+ * e1000_write_nvm_82571 - Write to EEPROM using appropriate interface
+ * @hw: pointer to the HW structure
+ * @offset: offset within the EEPROM to be written to
+ * @words: number of words to write
+ * @data: 16 bit word(s) to be written to the EEPROM
+ *
+ * For non-82573 silicon, write data to EEPROM at offset using SPI interface.
+ *
+ * If e1000e_update_nvm_checksum is not called after this function, the
+ * EEPROM will most likely contain an invalid checksum.
+ **/
+static s32 e1000_write_nvm_82571(struct e1000_hw *hw, u16 offset, u16 words,
+ u16 *data)
+{
+ s32 ret_val;
+
+ switch (hw->mac.type) {
+ case e1000_82573:
+ case e1000_82574:
+ case e1000_82583:
+ ret_val = e1000_write_nvm_eewr_82571(hw, offset, words, data);
+ break;
+ case e1000_82571:
+ case e1000_82572:
+ ret_val = e1000e_write_nvm_spi(hw, offset, words, data);
+ break;
+ default:
+ ret_val = -E1000_ERR_NVM;
+ break;
+ }
+
+ return ret_val;
+}
+
+/**
+ * e1000_update_nvm_checksum_82571 - Update EEPROM checksum
+ * @hw: pointer to the HW structure
+ *
+ * Updates the EEPROM checksum by reading/adding each word of the EEPROM
+ * up to the checksum. Then calculates the EEPROM checksum and writes the
+ * value to the EEPROM.
+ **/
+static s32 e1000_update_nvm_checksum_82571(struct e1000_hw *hw)
+{
+ u32 eecd;
+ s32 ret_val;
+ u16 i;
+
+ ret_val = e1000e_update_nvm_checksum_generic(hw);
+ if (ret_val)
+ return ret_val;
+
+ /*
+ * If our nvm is an EEPROM, then we're done
+ * otherwise, commit the checksum to the flash NVM.
+ */
+ if (hw->nvm.type != e1000_nvm_flash_hw)
+ return ret_val;
+
+ /* Check for pending operations. */
+ for (i = 0; i < E1000_FLASH_UPDATES; i++) {
+ msleep(1);
+ if ((er32(EECD) & E1000_EECD_FLUPD) == 0)
+ break;
+ }
+
+ if (i == E1000_FLASH_UPDATES)
+ return -E1000_ERR_NVM;
+
+ /* Reset the firmware if using STM opcode. */
+ if ((er32(FLOP) & 0xFF00) == E1000_STM_OPCODE) {
+ /*
+ * The enabling of and the actual reset must be done
+ * in two write cycles.
+ */
+ ew32(HICR, E1000_HICR_FW_RESET_ENABLE);
+ e1e_flush();
+ ew32(HICR, E1000_HICR_FW_RESET);
+ }
+
+ /* Commit the write to flash */
+ eecd = er32(EECD) | E1000_EECD_FLUPD;
+ ew32(EECD, eecd);
+
+ for (i = 0; i < E1000_FLASH_UPDATES; i++) {
+ msleep(1);
+ if ((er32(EECD) & E1000_EECD_FLUPD) == 0)
+ break;
+ }
+
+ if (i == E1000_FLASH_UPDATES)
+ return -E1000_ERR_NVM;
+
+ return 0;
+}
+
+/**
+ * e1000_validate_nvm_checksum_82571 - Validate EEPROM checksum
+ * @hw: pointer to the HW structure
+ *
+ * Calculates the EEPROM checksum by reading/adding each word of the EEPROM
+ * and then verifies that the sum of the EEPROM is equal to 0xBABA.
+ **/
+static s32 e1000_validate_nvm_checksum_82571(struct e1000_hw *hw)
+{
+ if (hw->nvm.type == e1000_nvm_flash_hw)
+ e1000_fix_nvm_checksum_82571(hw);
+
+ return e1000e_validate_nvm_checksum_generic(hw);
+}
+
+/**
+ * e1000_write_nvm_eewr_82571 - Write to EEPROM for 82573 silicon
+ * @hw: pointer to the HW structure
+ * @offset: offset within the EEPROM to be written to
+ * @words: number of words to write
+ * @data: 16 bit word(s) to be written to the EEPROM
+ *
+ * After checking for invalid values, poll the EEPROM to ensure the previous
+ * command has completed before trying to write the next word. After write
+ * poll for completion.
+ *
+ * If e1000e_update_nvm_checksum is not called after this function, the
+ * EEPROM will most likely contain an invalid checksum.
+ **/
+static s32 e1000_write_nvm_eewr_82571(struct e1000_hw *hw, u16 offset,
+ u16 words, u16 *data)
+{
+ struct e1000_nvm_info *nvm = &hw->nvm;
+ u32 i;
+ u32 eewr = 0;
+ s32 ret_val = 0;
+
+ /*
+ * A check for invalid values: offset too large, too many words,
+ * and not enough words.
+ */
+ if ((offset >= nvm->word_size) || (words > (nvm->word_size - offset)) ||
+ (words == 0)) {
+ hw_dbg(hw, "nvm parameter(s) out of bounds\n");
+ return -E1000_ERR_NVM;
+ }
+
+ for (i = 0; i < words; i++) {
+ eewr = (data[i] << E1000_NVM_RW_REG_DATA) |
+ ((offset+i) << E1000_NVM_RW_ADDR_SHIFT) |
+ E1000_NVM_RW_REG_START;
+
+ ret_val = e1000e_poll_eerd_eewr_done(hw, E1000_NVM_POLL_WRITE);
+ if (ret_val)
+ break;
+
+ ew32(EEWR, eewr);
+
+ ret_val = e1000e_poll_eerd_eewr_done(hw, E1000_NVM_POLL_WRITE);
+ if (ret_val)
+ break;
+ }
+
+ return ret_val;
+}
+
+/**
+ * e1000_get_cfg_done_82571 - Poll for configuration done
+ * @hw: pointer to the HW structure
+ *
+ * Reads the management control register for the config done bit to be set.
+ **/
+static s32 e1000_get_cfg_done_82571(struct e1000_hw *hw)
+{
+ s32 timeout = PHY_CFG_TIMEOUT;
+
+ while (timeout) {
+ if (er32(EEMNGCTL) &
+ E1000_NVM_CFG_DONE_PORT_0)
+ break;
+ msleep(1);
+ timeout--;
+ }
+ if (!timeout) {
+ hw_dbg(hw, "MNG configuration cycle has not completed.\n");
+ return -E1000_ERR_RESET;
+ }
+
+ return 0;
+}
+
+/**
+ * e1000_set_d0_lplu_state_82571 - Set Low Power Linkup D0 state
+ * @hw: pointer to the HW structure
+ * @active: TRUE to enable LPLU, FALSE to disable
+ *
+ * Sets the LPLU D0 state according to the active flag. When activating LPLU
+ * this function also disables smart speed and vice versa. LPLU will not be
+ * activated unless the device autonegotiation advertisement meets standards
+ * of either 10 or 10/100 or 10/100/1000 at all duplexes. This is a function
+ * pointer entry point only called by PHY setup routines.
+ **/
+static s32 e1000_set_d0_lplu_state_82571(struct e1000_hw *hw, bool active)
+{
+ struct e1000_phy_info *phy = &hw->phy;
+ s32 ret_val;
+ u16 data;
+
+ ret_val = e1e_rphy(hw, IGP02E1000_PHY_POWER_MGMT, &data);
+ if (ret_val)
+ return ret_val;
+
+ if (active) {
+ data |= IGP02E1000_PM_D0_LPLU;
+ ret_val = e1e_wphy(hw, IGP02E1000_PHY_POWER_MGMT, data);
+ if (ret_val)
+ return ret_val;
+
+ /* When LPLU is enabled, we should disable SmartSpeed */
+ ret_val = e1e_rphy(hw, IGP01E1000_PHY_PORT_CONFIG, &data);
+ data &= ~IGP01E1000_PSCFR_SMART_SPEED;
+ ret_val = e1e_wphy(hw, IGP01E1000_PHY_PORT_CONFIG, data);
+ if (ret_val)
+ return ret_val;
+ } else {
+ data &= ~IGP02E1000_PM_D0_LPLU;
+ ret_val = e1e_wphy(hw, IGP02E1000_PHY_POWER_MGMT, data);
+ /*
+ * LPLU and SmartSpeed are mutually exclusive. LPLU is used
+ * during Dx states where the power conservation is most
+ * important. During driver activity we should enable
+ * SmartSpeed, so performance is maintained.
+ */
+ if (phy->smart_speed == e1000_smart_speed_on) {
+ ret_val = e1e_rphy(hw, IGP01E1000_PHY_PORT_CONFIG,
+ &data);
+ if (ret_val)
+ return ret_val;
+
+ data |= IGP01E1000_PSCFR_SMART_SPEED;
+ ret_val = e1e_wphy(hw, IGP01E1000_PHY_PORT_CONFIG,
+ data);
+ if (ret_val)
+ return ret_val;
+ } else if (phy->smart_speed == e1000_smart_speed_off) {
+ ret_val = e1e_rphy(hw, IGP01E1000_PHY_PORT_CONFIG,
+ &data);
+ if (ret_val)
+ return ret_val;
+
+ data &= ~IGP01E1000_PSCFR_SMART_SPEED;
+ ret_val = e1e_wphy(hw, IGP01E1000_PHY_PORT_CONFIG,
+ data);
+ if (ret_val)
+ return ret_val;
+ }
+ }
+
+ return 0;
+}
+
+/**
+ * e1000_reset_hw_82571 - Reset hardware
+ * @hw: pointer to the HW structure
+ *
+ * This resets the hardware into a known state. This is a
+ * function pointer entry point called by the api module.
+ **/
+static s32 e1000_reset_hw_82571(struct e1000_hw *hw)
+{
+ u32 ctrl;
+ u32 extcnf_ctrl;
+ u32 ctrl_ext;
+ u32 icr;
+ s32 ret_val;
+ u16 i = 0;
+
+ /*
+ * Prevent the PCI-E bus from sticking if there is no TLP connection
+ * on the last TLP read/write transaction when MAC is reset.
+ */
+ ret_val = e1000e_disable_pcie_master(hw);
+ if (ret_val)
+ hw_dbg(hw, "PCI-E Master disable polling has failed.\n");
+
+ hw_dbg(hw, "Masking off all interrupts\n");
+ ew32(IMC, 0xffffffff);
+
+ ew32(RCTL, 0);
+ ew32(TCTL, E1000_TCTL_PSP);
+ e1e_flush();
+
+ msleep(10);
+
+ /*
+ * Must acquire the MDIO ownership before MAC reset.
+ * Ownership defaults to firmware after a reset.
+ */
+ switch (hw->mac.type) {
+ case e1000_82573:
+ case e1000_82574:
+ case e1000_82583:
+ extcnf_ctrl = er32(EXTCNF_CTRL);
+ extcnf_ctrl |= E1000_EXTCNF_CTRL_MDIO_SW_OWNERSHIP;
+
+ do {
+ ew32(EXTCNF_CTRL, extcnf_ctrl);
+ extcnf_ctrl = er32(EXTCNF_CTRL);
+
+ if (extcnf_ctrl & E1000_EXTCNF_CTRL_MDIO_SW_OWNERSHIP)
+ break;
+
+ extcnf_ctrl |= E1000_EXTCNF_CTRL_MDIO_SW_OWNERSHIP;
+
+ msleep(2);
+ i++;
+ } while (i < MDIO_OWNERSHIP_TIMEOUT);
+ break;
+ default:
+ break;
+ }
+
+ ctrl = er32(CTRL);
+
+ hw_dbg(hw, "Issuing a global reset to MAC\n");
+ ew32(CTRL, ctrl | E1000_CTRL_RST);
+
+ if (hw->nvm.type == e1000_nvm_flash_hw) {
+ udelay(10);
+ ctrl_ext = er32(CTRL_EXT);
+ ctrl_ext |= E1000_CTRL_EXT_EE_RST;
+ ew32(CTRL_EXT, ctrl_ext);
+ e1e_flush();
+ }
+
+ ret_val = e1000e_get_auto_rd_done(hw);
+ if (ret_val)
+ /* We don't want to continue accessing MAC registers. */
+ return ret_val;
+
+ /*
+ * Phy configuration from NVM just starts after EECD_AUTO_RD is set.
+ * Need to wait for Phy configuration completion before accessing
+ * NVM and Phy.
+ */
+
+ switch (hw->mac.type) {
+ case e1000_82573:
+ case e1000_82574:
+ case e1000_82583:
+ msleep(25);
+ break;
+ default:
+ break;
+ }
+
+ /* Clear any pending interrupt events. */
+ ew32(IMC, 0xffffffff);
+ icr = er32(ICR);
+
+ if (hw->mac.type == e1000_82571 &&
+ hw->dev_spec.e82571.alt_mac_addr_is_present)
+ e1000e_set_laa_state_82571(hw, true);
+
+ /* Reinitialize the 82571 serdes link state machine */
+ if (hw->phy.media_type == e1000_media_type_internal_serdes)
+ hw->mac.serdes_link_state = e1000_serdes_link_down;
+
+ return 0;
+}
+
+/**
+ * e1000_init_hw_82571 - Initialize hardware
+ * @hw: pointer to the HW structure
+ *
+ * This inits the hardware readying it for operation.
+ **/
+static s32 e1000_init_hw_82571(struct e1000_hw *hw)
+{
+ struct e1000_mac_info *mac = &hw->mac;
+ u32 reg_data;
+ s32 ret_val;
+ u16 i;
+ u16 rar_count = mac->rar_entry_count;
+
+ e1000_initialize_hw_bits_82571(hw);
+
+ /* Initialize identification LED */
+ ret_val = e1000e_id_led_init(hw);
+ if (ret_val) {
+ hw_dbg(hw, "Error initializing identification LED\n");
+ return ret_val;
+ }
+
+ /* Disabling VLAN filtering */
+ hw_dbg(hw, "Initializing the IEEE VLAN\n");
+ e1000e_clear_vfta(hw);
+
+ /* Setup the receive address. */
+ /*
+ * If, however, a locally administered address was assigned to the
+ * 82571, we must reserve a RAR for it to work around an issue where
+ * resetting one port will reload the MAC on the other port.
+ */
+ if (e1000e_get_laa_state_82571(hw))
+ rar_count--;
+ e1000e_init_rx_addrs(hw, rar_count);
+
+ /* Zero out the Multicast HASH table */
+ hw_dbg(hw, "Zeroing the MTA\n");
+ for (i = 0; i < mac->mta_reg_count; i++)
+ E1000_WRITE_REG_ARRAY(hw, E1000_MTA, i, 0);
+
+ /* Setup link and flow control */
+ ret_val = e1000_setup_link_82571(hw);
+
+ /* Set the transmit descriptor write-back policy */
+ reg_data = er32(TXDCTL(0));
+ reg_data = (reg_data & ~E1000_TXDCTL_WTHRESH) |
+ E1000_TXDCTL_FULL_TX_DESC_WB |
+ E1000_TXDCTL_COUNT_DESC;
+ ew32(TXDCTL(0), reg_data);
+
+ /* ...for both queues. */
+ switch (mac->type) {
+ case e1000_82573:
+ case e1000_82574:
+ case e1000_82583:
+ e1000e_enable_tx_pkt_filtering(hw);
+ reg_data = er32(GCR);
+ reg_data |= E1000_GCR_L1_ACT_WITHOUT_L0S_RX;
+ ew32(GCR, reg_data);
+ break;
+ default:
+ reg_data = er32(TXDCTL(1));
+ reg_data = (reg_data & ~E1000_TXDCTL_WTHRESH) |
+ E1000_TXDCTL_FULL_TX_DESC_WB |
+ E1000_TXDCTL_COUNT_DESC;
+ ew32(TXDCTL(1), reg_data);
+ break;
+ }
+
+ /*
+ * Clear all of the statistics registers (clear on read). It is
+ * important that we do this after we have tried to establish link
+ * because the symbol error count will increment wildly if there
+ * is no link.
+ */
+ e1000_clear_hw_cntrs_82571(hw);
+
+ return ret_val;
+}
+
+/**
+ * e1000_initialize_hw_bits_82571 - Initialize hardware-dependent bits
+ * @hw: pointer to the HW structure
+ *
+ * Initializes required hardware-dependent bits needed for normal operation.
+ **/
+static void e1000_initialize_hw_bits_82571(struct e1000_hw *hw)
+{
+ u32 reg;
+
+ /* Transmit Descriptor Control 0 */
+ reg = er32(TXDCTL(0));
+ reg |= (1 << 22);
+ ew32(TXDCTL(0), reg);
+
+ /* Transmit Descriptor Control 1 */
+ reg = er32(TXDCTL(1));
+ reg |= (1 << 22);
+ ew32(TXDCTL(1), reg);
+
+ /* Transmit Arbitration Control 0 */
+ reg = er32(TARC(0));
+ reg &= ~(0xF << 27); /* 30:27 */
+ switch (hw->mac.type) {
+ case e1000_82571:
+ case e1000_82572:
+ reg |= (1 << 23) | (1 << 24) | (1 << 25) | (1 << 26);
+ break;
+ default:
+ break;
+ }
+ ew32(TARC(0), reg);
+
+ /* Transmit Arbitration Control 1 */
+ reg = er32(TARC(1));
+ switch (hw->mac.type) {
+ case e1000_82571:
+ case e1000_82572:
...
[truncated message content] |
|
From: Arnout V. (Essensium/Mind) <ar...@mi...> - 2011-10-06 20:35:53
|
From: "Arnout Vandecappelle (Essensium/Mind)" <ar...@mi...>
Signed-off-by: Stefan Kral <st...@re...>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <ar...@mi...>
---
configure.ac | 12 ++++++
drivers/experimental/GNUmakefile.am | 4 ++
drivers/experimental/Kconfig | 3 +
drivers/experimental/e1000e/GNUmakefile.am | 55 +++++++++++++++++++++++++++
drivers/experimental/e1000e/Makefile | 37 ------------------
drivers/experimental/e1000e/Makefile.kbuild | 9 ++++
6 files changed, 83 insertions(+), 37 deletions(-)
create mode 100644 drivers/experimental/e1000e/GNUmakefile.am
delete mode 100644 drivers/experimental/e1000e/Makefile
create mode 100644 drivers/experimental/e1000e/Makefile.kbuild
diff --git a/configure.ac b/configure.ac
index 86a72fd..16678bc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1019,6 +1019,16 @@ AC_ARG_ENABLE(e1000-new,
AC_MSG_RESULT([${CONFIG_RTNET_DRV_E1000_NEW:-n}])
AM_CONDITIONAL(CONFIG_RTNET_DRV_E1000_NEW,[test "$CONFIG_RTNET_DRV_E1000_NEW" = "y"])
+AC_MSG_CHECKING([whether to build new Intel PRO/1000 PCEe (Gigabit) driver (experimental)])
+AC_ARG_ENABLE(e1000-e,
+ AS_HELP_STRING([--enable-e1000-e], [build new Intel PCEe PRO/1000 driver]),
+ [case "$enableval" in
+ y | yes) CONFIG_RTNET_DRV_E1000_E=y ;;
+ *) CONFIG_RTNET_DRV_E1000_E=n ;;
+ esac])
+AC_MSG_RESULT([${CONFIG_RTNET_DRV_E1000_E:-n}])
+AM_CONDITIONAL(CONFIG_RTNET_DRV_E1000_E,[test "$CONFIG_RTNET_DRV_E1000_E" = "y"])
+
AC_MSG_CHECKING([whether to build AT91 Ethernet [AT91RM9200] driver])
AC_ARG_ENABLE(at91ether,
AS_HELP_STRING([--enable-at91ether], [build AT91 Ethernet driver]),
@@ -1440,6 +1450,7 @@ if test x$CONFIG_KBUILD = xy; then
drivers/experimental \
drivers/experimental/rt2500 \
drivers/experimental/e1000 \
+ drivers/experimental/e1000e \
\
stack \
stack/packet \
@@ -1523,6 +1534,7 @@ AC_CONFIG_FILES([ \
drivers/experimental/GNUmakefile \
drivers/experimental/rt2500/GNUmakefile \
drivers/experimental/e1000/GNUmakefile \
+ drivers/experimental/e1000e/GNUmakefile \
\
stack/GNUmakefile \
stack/include/GNUmakefile \
diff --git a/drivers/experimental/GNUmakefile.am b/drivers/experimental/GNUmakefile.am
index 8b90fc9..7cf0a57 100644
--- a/drivers/experimental/GNUmakefile.am
+++ b/drivers/experimental/GNUmakefile.am
@@ -41,6 +41,10 @@ if CONFIG_RTNET_DRV_E1000_NEW
OPTDIRS += e1000
endif
+if CONFIG_RTNET_DRV_E1000_E
+OPTDIRS += e1000e
+endif
+
rt_3c59x.o: libkernel_3c59x.a
$(LD) --whole-archive $< -r -o $@
diff --git a/drivers/experimental/Kconfig b/drivers/experimental/Kconfig
index f8dab6e..9b309ff 100644
--- a/drivers/experimental/Kconfig
+++ b/drivers/experimental/Kconfig
@@ -11,6 +11,9 @@ config RTNET_DRV_R8169
config RTNET_DRV_E1000_NEW
bool "New Intel(R) PRO/1000 (Gigabit)"
+
+config RTNET_DRV_E1000_E
+ bool "New Intel(R) PRO/1000 PCIe (Gigabit)"
source "drivers/experimental/rt2500/Kconfig"
diff --git a/drivers/experimental/e1000e/GNUmakefile.am b/drivers/experimental/e1000e/GNUmakefile.am
new file mode 100644
index 0000000..0daf050
--- /dev/null
+++ b/drivers/experimental/e1000e/GNUmakefile.am
@@ -0,0 +1,55 @@
+moduledir = $(DESTDIR)$(RTNET_MODULE_DIR)
+modext = $(RTNET_MODULE_EXT)
+
+EXTRA_LIBRARIES = libkernel_e1000.a
+
+libkernel_e1000_a_CPPFLAGS = \
+ $(RTEXT_KMOD_CFLAGS) \
+ -I$(top_srcdir)/stack/include \
+ -I$(top_builddir)/stack/include
+
+libkernel_e1000_a_SOURCES = \
+ 82571.c \
+ defines.h \
+ e1000.h \
+ es2lan.c \
+ hw.h \
+ ich8lan.c \
+ lib.c \
+ netdev.c \
+ param.c \
+ phy.c
+
+OBJS = rt_e1000e$(modext)
+
+rt_e1000e.o: libkernel_e1000.a
+ $(LD) --whole-archive $< -r -o $@
+
+all-local: all-local$(modext)
+
+# 2.4 build
+all-local.o: $(OBJS)
+
+# 2.6 build
+all-local.ko: @RTNET_KBUILD_ENV@
+all-local.ko: $(libkernel_e1000_a_SOURCES) FORCE
+ $(RTNET_KBUILD_CMD)
+
+install-exec-local: $(OBJS)
+ $(mkinstalldirs) $(moduledir)
+ $(INSTALL_DATA) $^ $(moduledir)
+
+uninstall-local:
+ for MOD in $(OBJS); do $(RM) $(moduledir)/$$MOD; done
+
+clean-local: $(libkernel_e1000_a_SOURCES)
+ $(RTNET_KBUILD_CLEAN)
+
+distclean-local:
+ $(RTNET_KBUILD_DISTCLEAN)
+
+EXTRA_DIST = Makefile.kbuild
+
+DISTCLEANFILES = Makefile
+
+.PHONY: FORCE
diff --git a/drivers/experimental/e1000e/Makefile b/drivers/experimental/e1000e/Makefile
deleted file mode 100644
index 360c913..0000000
--- a/drivers/experimental/e1000e/Makefile
+++ /dev/null
@@ -1,37 +0,0 @@
-################################################################################
-#
-# Intel PRO/1000 Linux driver
-# Copyright(c) 1999 - 2008 Intel Corporation.
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms and conditions of the GNU General Public License,
-# version 2, as published by the Free Software Foundation.
-#
-# This program is distributed in the hope it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
-# more details.
-#
-# You should have received a copy of the GNU General Public License along with
-# this program; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# The full GNU General Public License is included in this distribution in
-# the file called "COPYING".
-#
-# Contact Information:
-# Linux NICS <lin...@in...>
-# e1000-devel Mailing List <e10...@li...>
-# Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
-#
-################################################################################
-
-#
-# Makefile for the Intel(R) PRO/1000 ethernet driver
-#
-
-obj-$(CONFIG_E1000E) += e1000e.o
-
-e1000e-objs := 82571.o ich8lan.o es2lan.o \
- lib.o phy.o param.o ethtool.o netdev.o
-
diff --git a/drivers/experimental/e1000e/Makefile.kbuild b/drivers/experimental/e1000e/Makefile.kbuild
new file mode 100644
index 0000000..b606069
--- /dev/null
+++ b/drivers/experimental/e1000e/Makefile.kbuild
@@ -0,0 +1,9 @@
+EXTRA_CFLAGS += \
+ $(rtext_kmod_cflags) \
+ -I$(top_srcdir)/stack/include \
+ -I$(top_builddir)/stack/include \
+ -I$(srcdir)
+
+obj-m += $(build_targets)
+
+rt_e1000e-objs := $(build_objs)
--
1.7.6.3
|
|
From: Arnout V. (Essensium/Mind) <ar...@mi...> - 2011-10-06 20:37:16
|
From: "Arnout Vandecappelle (Essensium/Mind)" <ar...@mi...>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <ar...@mi...>
---
Documentation/GNUmakefile.in | 51 +-
GNUmakefile.in | 216 +-
aclocal.m4 | 328 +-
addons/GNUmakefile.in | 91 +-
config/autoconf/config.guess | 493 +-
config/autoconf/config.sub | 230 +-
config/autoconf/depcomp | 87 +-
config/autoconf/install-sh | 5 +-
config/autoconf/ltmain.sh | 3998 ++++++++-----
config/autoconf/missing | 49 +-
config/m4/libtool.m4 | 2056 ++++---
config/m4/ltoptions.m4 | 13 +-
config/m4/ltversion.m4 | 12 +-
config/m4/lt~obsolete.m4 | 12 +-
config/rtnet_config_pre.h.in | 3 +
configure | 8249 ++++++++++++-------------
drivers/GNUmakefile.in | 204 +-
drivers/e1000/GNUmakefile.in | 99 +-
drivers/experimental/GNUmakefile.in | 165 +-
drivers/experimental/e1000/GNUmakefile.in | 143 +-
drivers/experimental/e1000e/GNUmakefile.in | 647 ++
drivers/experimental/rt2500/GNUmakefile.in | 91 +-
drivers/igb/GNUmakefile.in | 103 +-
drivers/mpc52xx_fec/GNUmakefile.in | 87 +-
drivers/tulip/GNUmakefile.in | 111 +-
examples/GNUmakefile.in | 145 +-
examples/generic/GNUmakefile.in | 139 +-
examples/rtai/GNUmakefile.in | 139 +-
examples/xenomai/GNUmakefile.in | 145 +-
examples/xenomai/native/GNUmakefile.in | 208 +-
examples/xenomai/native/kernel/GNUmakefile.in | 91 +-
examples/xenomai/posix/GNUmakefile.in | 139 +-
scripts/GNUmakefile.in | 145 +-
scripts/kconfig/GNUmakefile.in | 145 +-
scripts/kconfig/lxdialog/GNUmakefile.in | 51 +-
stack/GNUmakefile.in | 196 +-
stack/include/GNUmakefile.in | 122 +-
stack/ipv4/GNUmakefile.in | 188 +-
stack/ipv4/tcp/GNUmakefile.in | 91 +-
stack/ipv4/udp/GNUmakefile.in | 87 +-
stack/packet/GNUmakefile.in | 87 +-
stack/rtcfg/GNUmakefile.in | 119 +-
stack/rtmac/GNUmakefile.in | 176 +-
stack/rtmac/nomac/GNUmakefile.in | 99 +-
stack/rtmac/tdma/GNUmakefile.in | 103 +-
tools/GNUmakefile.in | 250 +-
46 files changed, 12216 insertions(+), 8192 deletions(-)
create mode 100644 drivers/experimental/e1000e/GNUmakefile.in
diff --git a/Documentation/GNUmakefile.in b/Documentation/GNUmakefile.in
index 6861847..fdfd726 100644
--- a/Documentation/GNUmakefile.in
+++ b/Documentation/GNUmakefile.in
@@ -1,8 +1,9 @@
-# GNUmakefile.in generated by automake 1.10.1 from GNUmakefile.am.
+# GNUmakefile.in generated by automake 1.11.1 from GNUmakefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -15,8 +16,9 @@
@SET_MAKE@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
@@ -47,6 +49,7 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config/rtnet_config_pre.h
CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
SOURCES =
DIST_SOURCES =
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -69,6 +72,7 @@ CROSS_COMPILE = @CROSS_COMPILE@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
@@ -93,6 +97,7 @@ LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
NCURSES_LIBS = @NCURSES_LIBS@
NM = @NM@
@@ -106,6 +111,7 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
@@ -134,6 +140,7 @@ abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
@@ -166,7 +173,6 @@ libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
@@ -205,14 +211,14 @@ $(srcdir)/GNUmakefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/GNUmakefile.am $(am_
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
- && exit 0; \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Documentation/GNUmakefile'; \
- cd $(top_srcdir) && \
- $(AUTOMAKE) --foreign Documentation/GNUmakefile
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Documentation/GNUmakefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign Documentation/GNUmakefile
.PRECIOUS: GNUmakefile
GNUmakefile: $(srcdir)/GNUmakefile.in $(top_builddir)/config.status
@case '$?' in \
@@ -230,6 +236,7 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
mostlyclean-libtool:
-rm -f *.lo
@@ -259,13 +266,17 @@ distdir: $(DISTFILES)
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
- cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
- test -f $(distdir)/$$file \
- || cp -p $$d/$$file $(distdir)/$$file \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
@@ -293,6 +304,7 @@ clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@@ -311,6 +323,8 @@ dvi-am:
html: html-am
+html-am:
+
info: info-am
info-am:
@@ -319,18 +333,28 @@ install-data-am:
install-dvi: install-dvi-am
+install-dvi-am:
+
install-exec-am:
install-html: install-html-am
+install-html-am:
+
install-info: install-info-am
+install-info-am:
+
install-man:
install-pdf: install-pdf-am
+install-pdf-am:
+
install-ps: install-ps-am
+install-ps-am:
+
installcheck-am:
maintainer-clean: maintainer-clean-am
@@ -364,6 +388,7 @@ uninstall-am:
maintainer-clean-generic mostlyclean mostlyclean-generic \
mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am
+
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
diff --git a/GNUmakefile.in b/GNUmakefile.in
index 3f2532b..dbf6595 100644
--- a/GNUmakefile.in
+++ b/GNUmakefile.in
@@ -1,8 +1,9 @@
-# GNUmakefile.in generated by automake 1.10.1 from GNUmakefile.am.
+# GNUmakefile.in generated by automake 1.11.1 from GNUmakefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -15,8 +16,9 @@
@SET_MAKE@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
@@ -56,6 +58,7 @@ am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config/rtnet_config_pre.h
CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
SOURCES =
DIST_SOURCES =
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
@@ -67,6 +70,9 @@ RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
ps-recursive uninstall-recursive
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
distclean-recursive maintainer-clean-recursive
+AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
+ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
+ distdir dist dist-all distcheck
ETAGS = etags
CTAGS = ctags
DIST_SUBDIRS = stack drivers addons examples tools Documentation \
@@ -75,9 +81,34 @@ DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
am__remove_distdir = \
- { test ! -d $(distdir) \
- || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
- && rm -fr $(distdir); }; }
+ { test ! -d "$(distdir)" \
+ || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
+ && rm -fr "$(distdir)"; }; }
+am__relativize = \
+ dir0=`pwd`; \
+ sed_first='s,^\([^/]*\)/.*$$,\1,'; \
+ sed_rest='s,^[^/]*/*,,'; \
+ sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+ sed_butlast='s,/*[^/]*$$,,'; \
+ while test -n "$$dir1"; do \
+ first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+ if test "$$first" != "."; then \
+ if test "$$first" = ".."; then \
+ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+ else \
+ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+ if test "$$first2" = "$$first"; then \
+ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+ else \
+ dir2="../$$dir2"; \
+ fi; \
+ dir0="$$dir0"/"$$first"; \
+ fi; \
+ fi; \
+ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+ done; \
+ reldir="$$dir2"
GZIP_ENV = --best
DIST_ARCHIVES = $(distdir).tar.bz2
distuninstallcheck_listfiles = find . -type f -print
@@ -101,6 +132,7 @@ CROSS_COMPILE = @CROSS_COMPILE@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
@@ -125,6 +157,7 @@ LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
NCURSES_LIBS = @NCURSES_LIBS@
NM = @NM@
@@ -138,6 +171,7 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
@@ -166,6 +200,7 @@ abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
@@ -198,7 +233,6 @@ libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
@@ -227,15 +261,15 @@ $(srcdir)/GNUmakefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/GNUmakefile.am $(am_
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
- echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \
- cd $(srcdir) && $(AUTOMAKE) --foreign \
+ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \
+ $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \
&& exit 0; \
exit 1;; \
esac; \
done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign GNUmakefile'; \
- cd $(top_srcdir) && \
- $(AUTOMAKE) --foreign GNUmakefile
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign GNUmakefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign GNUmakefile
.PRECIOUS: GNUmakefile
GNUmakefile: $(srcdir)/GNUmakefile.in $(top_builddir)/config.status
@case '$?' in \
@@ -251,9 +285,10 @@ $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENC
$(SHELL) ./config.status --recheck
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
- cd $(srcdir) && $(AUTOCONF)
+ $(am__cd) $(srcdir) && $(AUTOCONF)
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
- cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+ $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+$(am__aclocal_m4_deps):
config/rtnet_config_pre.h: config/stamp-h1
@if test ! -f $@; then \
@@ -265,7 +300,7 @@ config/stamp-h1: $(top_srcdir)/config/rtnet_config_pre.h.in $(top_builddir)/conf
@rm -f config/stamp-h1
cd $(top_builddir) && $(SHELL) ./config.status config/rtnet_config_pre.h
$(top_srcdir)/config/rtnet_config_pre.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
- cd $(top_srcdir) && $(AUTOHEADER)
+ ($(am__cd) $(top_srcdir) && $(AUTOHEADER))
rm -f config/stamp-h1
touch $@
@@ -279,7 +314,7 @@ clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
- -rm -f libtool
+ -rm -f libtool config.lt
# This directory's subdirectories are mostly independent; you can cd
# into them and run `make' without going through this Makefile.
@@ -288,7 +323,7 @@ distclean-libtool:
# (which will cause the Makefiles to be regenerated when you run `make');
# (2) otherwise, pass the desired values on the `make' command line.
$(RECURSIVE_TARGETS):
- @failcom='exit 1'; \
+ @fail= failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
@@ -305,7 +340,7 @@ $(RECURSIVE_TARGETS):
else \
local_target="$$target"; \
fi; \
- (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done; \
if test "$$dot_seen" = "no"; then \
@@ -313,7 +348,7 @@ $(RECURSIVE_TARGETS):
fi; test -z "$$fail"
$(RECURSIVE_CLEAN_TARGETS):
- @failcom='exit 1'; \
+ @fail= failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
@@ -339,16 +374,16 @@ $(RECURSIVE_CLEAN_TARGETS):
else \
local_target="$$target"; \
fi; \
- (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done && test -z "$$fail"
tags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
- test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
done
ctags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
- test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
done
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
@@ -356,14 +391,14 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
- $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
- tags=; \
+ set x; \
here=`pwd`; \
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
include_option=--etags-include; \
@@ -375,7 +410,7 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test ! -f $$subdir/TAGS || \
- tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
fi; \
done; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
@@ -384,36 +419,41 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
- if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$tags $$unique; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
fi
ctags: CTAGS
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
- tags=; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
- test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
- $$tags $$unique
+ $$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
- && cd $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) $$here
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
$(am__remove_distdir)
- test -d $(distdir) || mkdir $(distdir)
+ test -d "$(distdir)" || mkdir "$(distdir)"
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
@@ -429,38 +469,55 @@ distdir: $(DISTFILES)
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
- cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
- test -f $(distdir)/$$file \
- || cp -p $$d/$$file $(distdir)/$$file \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
- list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test -d "$(distdir)/$$subdir" \
|| $(MKDIR_P) "$(distdir)/$$subdir" \
|| exit 1; \
- distdir=`$(am__cd) $(distdir) && pwd`; \
- top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
- (cd $$subdir && \
+ fi; \
+ done
+ @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
+ $(am__relativize); \
+ new_distdir=$$reldir; \
+ dir1=$$subdir; dir2="$(top_distdir)"; \
+ $(am__relativize); \
+ new_top_distdir=$$reldir; \
+ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+ ($(am__cd) $$subdir && \
$(MAKE) $(AM_MAKEFLAGS) \
- top_distdir="$$top_distdir" \
- distdir="$$distdir/$$subdir" \
+ top_distdir="$$new_top_distdir" \
+ distdir="$$new_distdir" \
am__remove_distdir=: \
am__skip_length_check=: \
+ am__skip_mode_fix=: \
distdir) \
|| exit 1; \
fi; \
done
- -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
+ -test -n "$(am__skip_mode_fix)" \
+ || find "$(distdir)" -type d ! -perm -755 \
+ -exec chmod u+rwx,go+rx {} \; -o \
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
! -type d ! -perm -400 -exec chmod a+r {} \; -o \
! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
- || chmod -R a+r $(distdir)
+ || chmod -R a+r "$(distdir)"
dist-gzip: distdir
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
$(am__remove_distdir)
@@ -472,6 +529,10 @@ dist-lzma: distdir
tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
$(am__remove_distdir)
+dist-xz: distdir
+ tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz
+ $(am__remove_distdir)
+
dist-tarZ: distdir
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
$(am__remove_distdir)
@@ -495,15 +556,17 @@ dist dist-all: distdir
distcheck: dist
case '$(DIST_ARCHIVES)' in \
*.tar.gz*) \
- GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
+ GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
*.tar.bz2*) \
- bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
+ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
*.tar.lzma*) \
- unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\
+ lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\
+ *.tar.xz*) \
+ xz -dc $(distdir).tar.xz | $(am__untar) ;;\
*.tar.Z*) \
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
*.shar.gz*) \
- GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\
+ GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
*.zip*) \
unzip $(distdir).zip ;;\
esac
@@ -511,9 +574,11 @@ distcheck: dist
mkdir $(distdir)/_build
mkdir $(distdir)/_inst
chmod a-w $(distdir)
+ test -d $(distdir)/_build || exit 0; \
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
- && cd $(distdir)/_build \
+ && am__cwd=`pwd` \
+ && $(am__cd) $(distdir)/_build \
&& ../configure --srcdir=.. --prefix="$$dc_install_base" \
$(DISTCHECK_CONFIGURE_FLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) \
@@ -535,13 +600,15 @@ distcheck: dist
&& rm -rf "$$dc_destdir" \
&& $(MAKE) $(AM_MAKEFLAGS) dist \
&& rm -rf $(DIST_ARCHIVES) \
- && $(MAKE) $(AM_MAKEFLAGS) distcleancheck
+ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
+ && cd "$$am__cwd" \
+ || exit 1
$(am__remove_distdir)
@(echo "$(distdir) archives ready for distribution: "; \
list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
distuninstallcheck:
- @cd $(distuninstallcheck_dir) \
+ @$(am__cd) '$(distuninstallcheck_dir)' \
&& test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
|| { echo "ERROR: files left after uninstall:" ; \
if test -n "$(DESTDIR)"; then \
@@ -583,6 +650,7 @@ clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
maintainer-clean-generic:
@@ -604,6 +672,8 @@ dvi-am:
html: html-recursive
+html-am:
+
info: info-recursive
info-am:
@@ -612,18 +682,28 @@ install-data-am: install-data-local
install-dvi: install-dvi-recursive
+install-dvi-am:
+
install-exec-am:
install-html: install-html-recursive
+install-html-am:
+
install-info: install-info-recursive
+install-info-am:
+
install-man:
install-pdf: install-pdf-recursive
+install-pdf-am:
+
install-ps: install-ps-recursive
+install-ps-am:
+
installcheck-am:
maintainer-clean: maintainer-clean-recursive
@@ -646,24 +726,25 @@ ps-am:
uninstall-am:
-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \
- install-strip
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
+ install-am install-strip tags-recursive
.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
all all-am am--refresh check check-am clean clean-generic \
clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \
- dist-gzip dist-lzma dist-shar dist-tarZ dist-zip distcheck \
- distclean distclean-generic distclean-hdr distclean-libtool \
- distclean-tags distcleancheck distdir distuninstallcheck dvi \
- dvi-am html html-am info info-am install install-am \
- install-data install-data-am install-data-local install-dvi \
- install-dvi-am install-exec install-exec-am install-html \
- install-html-am install-info install-info-am install-man \
- install-pdf install-pdf-am install-ps install-ps-am \
- install-strip installcheck installcheck-am installdirs \
- installdirs-am maintainer-clean maintainer-clean-generic \
- mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
- ps ps-am tags tags-recursive uninstall uninstall-am
+ dist-gzip dist-lzma dist-shar dist-tarZ dist-xz dist-zip \
+ distcheck distclean distclean-generic distclean-hdr \
+ distclean-libtool distclean-tags distcleancheck distdir \
+ distuninstallcheck dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am \
+ install-data-local install-dvi install-dvi-am install-exec \
+ install-exec-am install-html install-html-am install-info \
+ install-info-am install-man install-pdf install-pdf-am \
+ install-ps install-ps-am install-strip installcheck \
+ installcheck-am installdirs installdirs-am maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-generic \
+ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
+ uninstall uninstall-am
reconfig xconfig gconfig mconfig menuconfig config oldconfig help:
@@ -679,6 +760,7 @@ install-data-local:
$(LN_S) @abs_top_builddir@/symbols $(DESTDIR)$(prefix)/symbols
.PHONY: reconfig xconfig gconfig mconfig menuconfig config oldconfig help
+
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
diff --git a/aclocal.m4 b/aclocal.m4
index cade7cf..ab93720 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1,7 +1,7 @@
-# generated automatically by aclocal 1.10.1 -*- Autoconf -*-
+# generated automatically by aclocal 1.11.1 -*- Autoconf -*-
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+# 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -13,13 +13,13 @@
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
-m4_if(AC_AUTOCONF_VERSION, [2.63],,
-[m4_warning([this file was generated for autoconf 2.63.
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
+[m4_warning([this file was generated for autoconf 2.68.
You have another version of autoconf. It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically `autoreconf'.])])
-# Copyright (C) 2002, 2003, 2005, 2006, 2007 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -31,10 +31,10 @@ To do so, use the procedure documented by the package, typically `autoreconf'.])
# generated from the m4 files accompanying Automake X.Y.
# (This private macro should not be called outside this file.)
AC_DEFUN([AM_AUTOMAKE_VERSION],
-[am__api_version='1.10'
+[am__api_version='1.11'
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
dnl require some minimum version. Point them to the right macro.
-m4_if([$1], [1.10.1], [],
+m4_if([$1], [1.11.1], [],
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
])
@@ -48,12 +48,12 @@ m4_define([_AM_AUTOCONF_VERSION], [])
# AM_SET_CURRENT_AUTOMAKE_VERSION
# -------------...
[truncated message content] |
|
From: Arnout V. (Essensium/Mind) <ar...@mi...> - 2011-10-06 20:37:25
|
From: "Arnout Vandecappelle (Essensium/Mind)" <ar...@mi...>
Signed-off-by: Stefan Kral <st...@re...>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <ar...@mi...>
---
drivers/experimental/e1000e/e1000.h | 22 +-
drivers/experimental/e1000e/ethtool.c | 1983 ---------------------------------
drivers/experimental/e1000e/netdev.c | 678 +++++-------
drivers/experimental/e1000e/param.c | 16 +-
4 files changed, 301 insertions(+), 2398 deletions(-)
delete mode 100644 drivers/experimental/e1000e/ethtool.c
diff --git a/drivers/experimental/e1000e/e1000.h b/drivers/experimental/e1000e/e1000.h
index 47db9bd..a7fa117 100644
--- a/drivers/experimental/e1000e/e1000.h
+++ b/drivers/experimental/e1000e/e1000.h
@@ -39,6 +39,8 @@
#include "hw.h"
+#include <rtnet_port.h>
+
struct e1000_info;
#define e_printk(level, adapter, format, arg...) \
@@ -94,7 +96,7 @@ struct e1000_info;
#define E1000_MNG_VLAN_NONE (-1)
/* Number of packet split data buffers (not including the header buffer) */
-#define PS_PAGE_BUFFERS (MAX_PS_BUFFERS - 1)
+//#define PS_PAGE_BUFFERS (MAX_PS_BUFFERS - 1)
#define DEFAULT_JUMBO 9234
@@ -186,7 +188,7 @@ struct e1000_ps_page {
*/
struct e1000_buffer {
dma_addr_t dma;
- struct sk_buff *skb;
+ struct rtskb *skb;
union {
/* Tx */
struct {
@@ -213,6 +215,8 @@ struct e1000_ring {
u16 head;
u16 tail;
+ rtdm_lock_t lock;
+
/* array of buffer information structs */
struct e1000_buffer *buffer_info;
@@ -222,7 +226,7 @@ struct e1000_ring {
u16 itr_register;
int set_itr;
- struct sk_buff *rx_skb_top;
+ struct rtskb *rx_skb_top;
struct e1000_queue_stats stats;
};
@@ -304,9 +308,7 @@ struct e1000_adapter {
/*
* Rx
*/
- bool (*clean_rx) (struct e1000_adapter *adapter,
- int *work_done, int work_to_do)
- ____cacheline_aligned_in_smp;
+ bool (*clean_rx) (struct e1000_adapter *adapter, nanosecs_abs_t *time_stamp);
void (*alloc_rx_buf) (struct e1000_adapter *adapter,
int cleaned_count);
struct e1000_ring *rx_ring;
@@ -329,10 +331,16 @@ struct e1000_adapter {
u32 min_frame_size;
/* OS defined structs */
- struct net_device *netdev;
+ struct rtnet_device *netdev;
+ struct rtskb_queue skb_pool;
+
struct pci_dev *pdev;
struct net_device_stats net_stats;
+ rtdm_irq_t irq_handle;
+ rtdm_nrtsig_t mod_timer_sig;
+ char data_received;
+
/* structs defined in e1000_hw.h */
struct e1000_hw hw;
diff --git a/drivers/experimental/e1000e/ethtool.c b/drivers/experimental/e1000e/ethtool.c
deleted file mode 100644
index e82638e..0000000
--- a/drivers/experimental/e1000e/ethtool.c
+++ /dev/null
@@ -1,1983 +0,0 @@
-/*******************************************************************************
-
- Intel PRO/1000 Linux driver
- Copyright(c) 1999 - 2008 Intel Corporation.
-
- This program is free software; you can redistribute it and/or modify it
- under the terms and conditions of the GNU General Public License,
- version 2, as published by the Free Software Foundation.
-
- This program is distributed in the hope it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- more details.
-
- You should have received a copy of the GNU General Public License along with
- this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
-
- The full GNU General Public License is included in this distribution in
- the file called "COPYING".
-
- Contact Information:
- Linux NICS <lin...@in...>
- e1000-devel Mailing List <e10...@li...>
- Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
-
-*******************************************************************************/
-
-/* ethtool support for e1000 */
-
-#include <linux/netdevice.h>
-#include <linux/ethtool.h>
-#include <linux/pci.h>
-#include <linux/delay.h>
-
-#include "e1000.h"
-
-struct e1000_stats {
- char stat_string[ETH_GSTRING_LEN];
- int sizeof_stat;
- int stat_offset;
-};
-
-#define E1000_STAT(m) sizeof(((struct e1000_adapter *)0)->m), \
- offsetof(struct e1000_adapter, m)
-static const struct e1000_stats e1000_gstrings_stats[] = {
- { "rx_packets", E1000_STAT(stats.gprc) },
- { "tx_packets", E1000_STAT(stats.gptc) },
- { "rx_bytes", E1000_STAT(stats.gorc) },
- { "tx_bytes", E1000_STAT(stats.gotc) },
- { "rx_broadcast", E1000_STAT(stats.bprc) },
- { "tx_broadcast", E1000_STAT(stats.bptc) },
- { "rx_multicast", E1000_STAT(stats.mprc) },
- { "tx_multicast", E1000_STAT(stats.mptc) },
- { "rx_errors", E1000_STAT(net_stats.rx_errors) },
- { "tx_errors", E1000_STAT(net_stats.tx_errors) },
- { "tx_dropped", E1000_STAT(net_stats.tx_dropped) },
- { "multicast", E1000_STAT(stats.mprc) },
- { "collisions", E1000_STAT(stats.colc) },
- { "rx_length_errors", E1000_STAT(net_stats.rx_length_errors) },
- { "rx_over_errors", E1000_STAT(net_stats.rx_over_errors) },
- { "rx_crc_errors", E1000_STAT(stats.crcerrs) },
- { "rx_frame_errors", E1000_STAT(net_stats.rx_frame_errors) },
- { "rx_no_buffer_count", E1000_STAT(stats.rnbc) },
- { "rx_missed_errors", E1000_STAT(stats.mpc) },
- { "tx_aborted_errors", E1000_STAT(stats.ecol) },
- { "tx_carrier_errors", E1000_STAT(stats.tncrs) },
- { "tx_fifo_errors", E1000_STAT(net_stats.tx_fifo_errors) },
- { "tx_heartbeat_errors", E1000_STAT(net_stats.tx_heartbeat_errors) },
- { "tx_window_errors", E1000_STAT(stats.latecol) },
- { "tx_abort_late_coll", E1000_STAT(stats.latecol) },
- { "tx_deferred_ok", E1000_STAT(stats.dc) },
- { "tx_single_coll_ok", E1000_STAT(stats.scc) },
- { "tx_multi_coll_ok", E1000_STAT(stats.mcc) },
- { "tx_timeout_count", E1000_STAT(tx_timeout_count) },
- { "tx_restart_queue", E1000_STAT(restart_queue) },
- { "rx_long_length_errors", E1000_STAT(stats.roc) },
- { "rx_short_length_errors", E1000_STAT(stats.ruc) },
- { "rx_align_errors", E1000_STAT(stats.algnerrc) },
- { "tx_tcp_seg_good", E1000_STAT(stats.tsctc) },
- { "tx_tcp_seg_failed", E1000_STAT(stats.tsctfc) },
- { "rx_flow_control_xon", E1000_STAT(stats.xonrxc) },
- { "rx_flow_control_xoff", E1000_STAT(stats.xoffrxc) },
- { "tx_flow_control_xon", E1000_STAT(stats.xontxc) },
- { "tx_flow_control_xoff", E1000_STAT(stats.xofftxc) },
- { "rx_long_byte_count", E1000_STAT(stats.gorc) },
- { "rx_csum_offload_good", E1000_STAT(hw_csum_good) },
- { "rx_csum_offload_errors", E1000_STAT(hw_csum_err) },
- { "rx_header_split", E1000_STAT(rx_hdr_split) },
- { "alloc_rx_buff_failed", E1000_STAT(alloc_rx_buff_failed) },
- { "tx_smbus", E1000_STAT(stats.mgptc) },
- { "rx_smbus", E1000_STAT(stats.mgprc) },
- { "dropped_smbus", E1000_STAT(stats.mgpdc) },
- { "rx_dma_failed", E1000_STAT(rx_dma_failed) },
- { "tx_dma_failed", E1000_STAT(tx_dma_failed) },
-};
-
-#define E1000_GLOBAL_STATS_LEN ARRAY_SIZE(e1000_gstrings_stats)
-#define E1000_STATS_LEN (E1000_GLOBAL_STATS_LEN)
-static const char e1000_gstrings_test[][ETH_GSTRING_LEN] = {
- "Register test (offline)", "Eeprom test (offline)",
- "Interrupt test (offline)", "Loopback test (offline)",
- "Link test (on/offline)"
-};
-#define E1000_TEST_LEN ARRAY_SIZE(e1000_gstrings_test)
-
-static int e1000_get_settings(struct net_device *netdev,
- struct ethtool_cmd *ecmd)
-{
- struct e1000_adapter *adapter = netdev_priv(netdev);
- struct e1000_hw *hw = &adapter->hw;
- u32 status;
-
- if (hw->phy.media_type == e1000_media_type_copper) {
-
- ecmd->supported = (SUPPORTED_10baseT_Half |
- SUPPORTED_10baseT_Full |
- SUPPORTED_100baseT_Half |
- SUPPORTED_100baseT_Full |
- SUPPORTED_1000baseT_Full |
- SUPPORTED_Autoneg |
- SUPPORTED_TP);
- if (hw->phy.type == e1000_phy_ife)
- ecmd->supported &= ~SUPPORTED_1000baseT_Full;
- ecmd->advertising = ADVERTISED_TP;
-
- if (hw->mac.autoneg == 1) {
- ecmd->advertising |= ADVERTISED_Autoneg;
- /* the e1000 autoneg seems to match ethtool nicely */
- ecmd->advertising |= hw->phy.autoneg_advertised;
- }
-
- ecmd->port = PORT_TP;
- ecmd->phy_address = hw->phy.addr;
- ecmd->transceiver = XCVR_INTERNAL;
-
- } else {
- ecmd->supported = (SUPPORTED_1000baseT_Full |
- SUPPORTED_FIBRE |
- SUPPORTED_Autoneg);
-
- ecmd->advertising = (ADVERTISED_1000baseT_Full |
- ADVERTISED_FIBRE |
- ADVERTISED_Autoneg);
-
- ecmd->port = PORT_FIBRE;
- ecmd->transceiver = XCVR_EXTERNAL;
- }
-
- status = er32(STATUS);
- if (status & E1000_STATUS_LU) {
- if (status & E1000_STATUS_SPEED_1000)
- ecmd->speed = 1000;
- else if (status & E1000_STATUS_SPEED_100)
- ecmd->speed = 100;
- else
- ecmd->speed = 10;
-
- if (status & E1000_STATUS_FD)
- ecmd->duplex = DUPLEX_FULL;
- else
- ecmd->duplex = DUPLEX_HALF;
- } else {
- ecmd->speed = -1;
- ecmd->duplex = -1;
- }
-
- ecmd->autoneg = ((hw->phy.media_type == e1000_media_type_fiber) ||
- hw->mac.autoneg) ? AUTONEG_ENABLE : AUTONEG_DISABLE;
-
- /* MDI-X => 2; MDI =>1; Invalid =>0 */
- if ((hw->phy.media_type == e1000_media_type_copper) &&
- !hw->mac.get_link_status)
- ecmd->eth_tp_mdix = hw->phy.is_mdix ? ETH_TP_MDI_X :
- ETH_TP_MDI;
- else
- ecmd->eth_tp_mdix = ETH_TP_MDI_INVALID;
-
- return 0;
-}
-
-static u32 e1000_get_link(struct net_device *netdev)
-{
- struct e1000_adapter *adapter = netdev_priv(netdev);
-
- return e1000_has_link(adapter);
-}
-
-static int e1000_set_spd_dplx(struct e1000_adapter *adapter, u16 spddplx)
-{
- struct e1000_mac_info *mac = &adapter->hw.mac;
-
- mac->autoneg = 0;
-
- /* Fiber NICs only allow 1000 gbps Full duplex */
- if ((adapter->hw.phy.media_type == e1000_media_type_fiber) &&
- spddplx != (SPEED_1000 + DUPLEX_FULL)) {
- e_err("Unsupported Speed/Duplex configuration\n");
- return -EINVAL;
- }
-
- switch (spddplx) {
- case SPEED_10 + DUPLEX_HALF:
- mac->forced_speed_duplex = ADVERTISE_10_HALF;
- break;
- case SPEED_10 + DUPLEX_FULL:
- mac->forced_speed_duplex = ADVERTISE_10_FULL;
- break;
- case SPEED_100 + DUPLEX_HALF:
- mac->forced_speed_duplex = ADVERTISE_100_HALF;
- break;
- case SPEED_100 + DUPLEX_FULL:
- mac->forced_speed_duplex = ADVERTISE_100_FULL;
- break;
- case SPEED_1000 + DUPLEX_FULL:
- mac->autoneg = 1;
- adapter->hw.phy.autoneg_advertised = ADVERTISE_1000_FULL;
- break;
- case SPEED_1000 + DUPLEX_HALF: /* not supported */
- default:
- e_err("Unsupported Speed/Duplex configuration\n");
- return -EINVAL;
- }
- return 0;
-}
-
-static int e1000_set_settings(struct net_device *netdev,
- struct ethtool_cmd *ecmd)
-{
- struct e1000_adapter *adapter = netdev_priv(netdev);
- struct e1000_hw *hw = &adapter->hw;
-
- /*
- * When SoL/IDER sessions are active, autoneg/speed/duplex
- * cannot be changed
- */
- if (e1000_check_reset_block(hw)) {
- e_err("Cannot change link characteristics when SoL/IDER is "
- "active.\n");
- return -EINVAL;
- }
-
- while (test_and_set_bit(__E1000_RESETTING, &adapter->state))
- msleep(1);
-
- if (ecmd->autoneg == AUTONEG_ENABLE) {
- hw->mac.autoneg = 1;
- if (hw->phy.media_type == e1000_media_type_fiber)
- hw->phy.autoneg_advertised = ADVERTISED_1000baseT_Full |
- ADVERTISED_FIBRE |
- ADVERTISED_Autoneg;
- else
- hw->phy.autoneg_advertised = ecmd->advertising |
- ADVERTISED_TP |
- ADVERTISED_Autoneg;
- ecmd->advertising = hw->phy.autoneg_advertised;
- if (adapter->fc_autoneg)
- hw->fc.requested_mode = e1000_fc_default;
- } else {
- if (e1000_set_spd_dplx(adapter, ecmd->speed + ecmd->duplex)) {
- clear_bit(__E1000_RESETTING, &adapter->state);
- return -EINVAL;
- }
- }
-
- /* reset the link */
-
- if (netif_running(adapter->netdev)) {
- e1000e_down(adapter);
- e1000e_up(adapter);
- } else {
- e1000e_reset(adapter);
- }
-
- clear_bit(__E1000_RESETTING, &adapter->state);
- return 0;
-}
-
-static void e1000_get_pauseparam(struct net_device *netdev,
- struct ethtool_pauseparam *pause)
-{
- struct e1000_adapter *adapter = netdev_priv(netdev);
- struct e1000_hw *hw = &adapter->hw;
-
- pause->autoneg =
- (adapter->fc_autoneg ? AUTONEG_ENABLE : AUTONEG_DISABLE);
-
- if (hw->fc.current_mode == e1000_fc_rx_pause) {
- pause->rx_pause = 1;
- } else if (hw->fc.current_mode == e1000_fc_tx_pause) {
- pause->tx_pause = 1;
- } else if (hw->fc.current_mode == e1000_fc_full) {
- pause->rx_pause = 1;
- pause->tx_pause = 1;
- }
-}
-
-static int e1000_set_pauseparam(struct net_device *netdev,
- struct ethtool_pauseparam *pause)
-{
- struct e1000_adapter *adapter = netdev_priv(netdev);
- struct e1000_hw *hw = &adapter->hw;
- int retval = 0;
-
- adapter->fc_autoneg = pause->autoneg;
-
- while (test_and_set_bit(__E1000_RESETTING, &adapter->state))
- msleep(1);
-
- if (adapter->fc_autoneg == AUTONEG_ENABLE) {
- hw->fc.requested_mode = e1000_fc_default;
- if (netif_running(adapter->netdev)) {
- e1000e_down(adapter);
- e1000e_up(adapter);
- } else {
- e1000e_reset(adapter);
- }
- } else {
- if (pause->rx_pause && pause->tx_pause)
- hw->fc.requested_mode = e1000_fc_full;
- else if (pause->rx_pause && !pause->tx_pause)
- hw->fc.requested_mode = e1000_fc_rx_pause;
- else if (!pause->rx_pause && pause->tx_pause)
- hw->fc.requested_mode = e1000_fc_tx_pause;
- else if (!pause->rx_pause && !pause->tx_pause)
- hw->fc.requested_mode = e1000_fc_none;
-
- hw->fc.current_mode = hw->fc.requested_mode;
-
- if (hw->phy.media_type == e1000_media_type_fiber) {
- retval = hw->mac.ops.setup_link(hw);
- /* implicit goto out */
- } else {
- retval = e1000e_force_mac_fc(hw);
- if (retval)
- goto out;
- e1000e_set_fc_watermarks(hw);
- }
- }
-
-out:
- clear_bit(__E1000_RESETTING, &adapter->state);
- return retval;
-}
-
-static u32 e1000_get_rx_csum(struct net_device *netdev)
-{
- struct e1000_adapter *adapter = netdev_priv(netdev);
- return (adapter->flags & FLAG_RX_CSUM_ENABLED);
-}
-
-static int e1000_set_rx_csum(struct net_device *netdev, u32 data)
-{
- struct e1000_adapter *adapter = netdev_priv(netdev);
-
- if (data)
- adapter->flags |= FLAG_RX_CSUM_ENABLED;
- else
- adapter->flags &= ~FLAG_RX_CSUM_ENABLED;
-
- if (netif_running(netdev))
- e1000e_reinit_locked(adapter);
- else
- e1000e_reset(adapter);
- return 0;
-}
-
-static u32 e1000_get_tx_csum(struct net_device *netdev)
-{
- return ((netdev->features & NETIF_F_HW_CSUM) != 0);
-}
-
-static int e1000_set_tx_csum(struct net_device *netdev, u32 data)
-{
- if (data)
- netdev->features |= NETIF_F_HW_CSUM;
- else
- netdev->features &= ~NETIF_F_HW_CSUM;
-
- return 0;
-}
-
-static int e1000_set_tso(struct net_device *netdev, u32 data)
-{
- struct e1000_adapter *adapter = netdev_priv(netdev);
-
- if (data) {
- netdev->features |= NETIF_F_TSO;
- netdev->features |= NETIF_F_TSO6;
- } else {
- netdev->features &= ~NETIF_F_TSO;
- netdev->features &= ~NETIF_F_TSO6;
- }
-
- e_info("TSO is %s\n", data ? "Enabled" : "Disabled");
- adapter->flags |= FLAG_TSO_FORCE;
- return 0;
-}
-
-static u32 e1000_get_msglevel(struct net_device *netdev)
-{
- struct e1000_adapter *adapter = netdev_priv(netdev);
- return adapter->msg_enable;
-}
-
-static void e1000_set_msglevel(struct net_device *netdev, u32 data)
-{
- struct e1000_adapter *adapter = netdev_priv(netdev);
- adapter->msg_enable = data;
-}
-
-static int e1000_get_regs_len(struct net_device *netdev)
-{
-#define E1000_REGS_LEN 32 /* overestimate */
- return E1000_REGS_LEN * sizeof(u32);
-}
-
-static void e1000_get_regs(struct net_device *netdev,
- struct ethtool_regs *regs, void *p)
-{
- struct e1000_adapter *adapter = netdev_priv(netdev);
- struct e1000_hw *hw = &adapter->hw;
- u32 *regs_buff = p;
- u16 phy_data;
- u8 revision_id;
-
- memset(p, 0, E1000_REGS_LEN * sizeof(u32));
-
- pci_read_config_byte(adapter->pdev, PCI_REVISION_ID, &revision_id);
-
- regs->version = (1 << 24) | (revision_id << 16) | adapter->pdev->device;
-
- regs_buff[0] = er32(CTRL);
- regs_buff[1] = er32(STATUS);
-
- regs_buff[2] = er32(RCTL);
- regs_buff[3] = er32(RDLEN);
- regs_buff[4] = er32(RDH);
- regs_buff[5] = er32(RDT);
- regs_buff[6] = er32(RDTR);
-
- regs_buff[7] = er32(TCTL);
- regs_buff[8] = er32(TDLEN);
- regs_buff[9] = er32(TDH);
- regs_buff[10] = er32(TDT);
- regs_buff[11] = er32(TIDV);
-
- regs_buff[12] = adapter->hw.phy.type; /* PHY type (IGP=1, M88=0) */
-
- /* ethtool doesn't use anything past this point, so all this
- * code is likely legacy junk for apps that may or may not
- * exist */
- if (hw->phy.type == e1000_phy_m88) {
- e1e_rphy(hw, M88E1000_PHY_SPEC_STATUS, &phy_data);
- regs_buff[13] = (u32)phy_data; /* cable length */
- regs_buff[14] = 0; /* Dummy (to align w/ IGP phy reg dump) */
- regs_buff[15] = 0; /* Dummy (to align w/ IGP phy reg dump) */
- regs_buff[16] = 0; /* Dummy (to align w/ IGP phy reg dump) */
- e1e_rphy(hw, M88E1000_PHY_SPEC_CTRL, &phy_data);
- regs_buff[17] = (u32)phy_data; /* extended 10bt distance */
- regs_buff[18] = regs_buff[13]; /* cable polarity */
- regs_buff[19] = 0; /* Dummy (to align w/ IGP phy reg dump) */
- regs_buff[20] = regs_buff[17]; /* polarity correction */
- /* phy receive errors */
- regs_buff[22] = adapter->phy_stats.receive_errors;
- regs_buff[23] = regs_buff[13]; /* mdix mode */
- }
- regs_buff[21] = 0; /* was idle_errors */
- e1e_rphy(hw, PHY_1000T_STATUS, &phy_data);
- regs_buff[24] = (u32)phy_data; /* phy local receiver status */
- regs_buff[25] = regs_buff[24]; /* phy remote receiver status */
-}
-
-static int e1000_get_eeprom_len(struct net_device *netdev)
-{
- struct e1000_adapter *adapter = netdev_priv(netdev);
- return adapter->hw.nvm.word_size * 2;
-}
-
-static int e1000_get_eeprom(struct net_device *netdev,
- struct ethtool_eeprom *eeprom, u8 *bytes)
-{
- struct e1000_adapter *adapter = netdev_priv(netdev);
- struct e1000_hw *hw = &adapter->hw;
- u16 *eeprom_buff;
- int first_word;
- int last_word;
- int ret_val = 0;
- u16 i;
-
- if (eeprom->len == 0)
- return -EINVAL;
-
- eeprom->magic = adapter->pdev->vendor | (adapter->pdev->device << 16);
-
- first_word = eeprom->offset >> 1;
- last_word = (eeprom->offset + eeprom->len - 1) >> 1;
-
- eeprom_buff = kmalloc(sizeof(u16) *
- (last_word - first_word + 1), GFP_KERNEL);
- if (!eeprom_buff)
- return -ENOMEM;
-
- if (hw->nvm.type == e1000_nvm_eeprom_spi) {
- ret_val = e1000_read_nvm(hw, first_word,
- last_word - first_word + 1,
- eeprom_buff);
- } else {
- for (i = 0; i < last_word - first_word + 1; i++) {
- ret_val = e1000_read_nvm(hw, first_word + i, 1,
- &eeprom_buff[i]);
- if (ret_val)
- break;
- }
- }
-
- if (ret_val) {
- /* a read error occurred, throw away the result */
- memset(eeprom_buff, 0xff, sizeof(eeprom_buff));
- } else {
- /* Device's eeprom is always little-endian, word addressable */
- for (i = 0; i < last_word - first_word + 1; i++)
- le16_to_cpus(&eeprom_buff[i]);
- }
-
- memcpy(bytes, (u8 *)eeprom_buff + (eeprom->offset & 1), eeprom->len);
- kfree(eeprom_buff);
-
- return ret_val;
-}
-
-static int e1000_set_eeprom(struct net_device *netdev,
- struct ethtool_eeprom *eeprom, u8 *bytes)
-{
- struct e1000_adapter *adapter = netdev_priv(netdev);
- struct e1000_hw *hw = &adapter->hw;
- u16 *eeprom_buff;
- void *ptr;
- int max_len;
- int first_word;
- int last_word;
- int ret_val = 0;
- u16 i;
-
- if (eeprom->len == 0)
- return -EOPNOTSUPP;
-
- if (eeprom->magic != (adapter->pdev->vendor | (adapter->pdev->device << 16)))
- return -EFAULT;
-
- if (adapter->flags & FLAG_READ_ONLY_NVM)
- return -EINVAL;
-
- max_len = hw->nvm.word_size * 2;
-
- first_word = eeprom->offset >> 1;
- last_word = (eeprom->offset + eeprom->len - 1) >> 1;
- eeprom_buff = kmalloc(max_len, GFP_KERNEL);
- if (!eeprom_buff)
- return -ENOMEM;
-
- ptr = (void *)eeprom_buff;
-
- if (eeprom->offset & 1) {
- /* need read/modify/write of first changed EEPROM word */
- /* only the second byte of the word is being modified */
- ret_val = e1000_read_nvm(hw, first_word, 1, &eeprom_buff[0]);
- ptr++;
- }
- if (((eeprom->offset + eeprom->len) & 1) && (ret_val == 0))
- /* need read/modify/write of last changed EEPROM word */
- /* only the first byte of the word is being modified */
- ret_val = e1000_read_nvm(hw, last_word, 1,
- &eeprom_buff[last_word - first_word]);
-
- if (ret_val)
- goto out;
-
- /* Device's eeprom is always little-endian, word addressable */
- for (i = 0; i < last_word - first_word + 1; i++)
- le16_to_cpus(&eeprom_buff[i]);
-
- memcpy(ptr, bytes, eeprom->len);
-
- for (i = 0; i < last_word - first_word + 1; i++)
- eeprom_buff[i] = cpu_to_le16(eeprom_buff[i]);
-
- ret_val = e1000_write_nvm(hw, first_word,
- last_word - first_word + 1, eeprom_buff);
-
- if (ret_val)
- goto out;
-
- /*
- * Update the checksum over the first part of the EEPROM if needed
- * and flush shadow RAM for applicable controllers
- */
- if ((first_word <= NVM_CHECKSUM_REG) ||
- (hw->mac.type == e1000_82574) || (hw->mac.type == e1000_82573))
- ret_val = e1000e_update_nvm_checksum(hw);
-
-out:
- kfree(eeprom_buff);
- return ret_val;
-}
-
-static void e1000_get_drvinfo(struct net_device *netdev,
- struct ethtool_drvinfo *drvinfo)
-{
- struct e1000_adapter *adapter = netdev_priv(netdev);
- char firmware_version[32];
-
- strncpy(drvinfo->driver, e1000e_driver_name, 32);
- strncpy(drvinfo->version, e1000e_driver_version, 32);
-
- /*
- * EEPROM image version # is reported as firmware version # for
- * PCI-E controllers
- */
- sprintf(firmware_version, "%d.%d-%d",
- (adapter->eeprom_vers & 0xF000) >> 12,
- (adapter->eeprom_vers & 0x0FF0) >> 4,
- (adapter->eeprom_vers & 0x000F));
-
- strncpy(drvinfo->fw_version, firmware_version, 32);
- strncpy(drvinfo->bus_info, pci_name(adapter->pdev), 32);
- drvinfo->regdump_len = e1000_get_regs_len(netdev);
- drvinfo->eedump_len = e1000_get_eeprom_len(netdev);
-}
-
-static void e1000_get_ringparam(struct net_device *netdev,
- struct ethtool_ringparam *ring)
-{
- struct e1000_adapter *adapter = netdev_priv(netdev);
- struct e1000_ring *tx_ring = adapter->tx_ring;
- struct e1000_ring *rx_ring = adapter->rx_ring;
-
- ring->rx_max_pending = E1000_MAX_RXD;
- ring->tx_max_pending = E1000_MAX_TXD;
- ring->rx_mini_max_pending = 0;
- ring->rx_jumbo_max_pending = 0;
- ring->rx_pending = rx_ring->count;
- ring->tx_pending = tx_ring->count;
- ring->rx_mini_pending = 0;
- ring->rx_jumbo_pending = 0;
-}
-
-static int e1000_set_ringparam(struct net_device *netdev,
- struct ethtool_ringparam *ring)
-{
- struct e1000_adapter *adapter = netdev_priv(netdev);
- struct e1000_ring *tx_ring, *tx_old;
- struct e1000_ring *rx_ring, *rx_old;
- int err;
-
- if ((ring->rx_mini_pending) || (ring->rx_jumbo_pending))
- return -EINVAL;
-
- while (test_and_set_bit(__E1000_RESETTING, &adapter->state))
- msleep(1);
-
- if (netif_running(adapter->netdev))
- e1000e_down(adapter);
-
- tx_old = adapter->tx_ring;
- rx_old = adapter->rx_ring;
-
- err = -ENOMEM;
- tx_ring = kzalloc(sizeof(struct e1000_ring), GFP_KERNEL);
- if (!tx_ring)
- goto err_alloc_tx;
- /*
- * use a memcpy to save any previously configured
- * items like napi structs from having to be
- * reinitialized
- */
- memcpy(tx_ring, tx_old, sizeof(struct e1000_ring));
-
- rx_ring = kzalloc(sizeof(struct e1000_ring), GFP_KERNEL);
- if (!rx_ring)
- goto err_alloc_rx;
- memcpy(rx_ring, rx_old, sizeof(struct e1000_ring));
-
- adapter->tx_ring = tx_ring;
- adapter->rx_ring = rx_ring;
-
- rx_ring->count = max(ring->rx_pending, (u32)E1000_MIN_RXD);
- rx_ring->count = min(rx_ring->count, (u32)(E1000_MAX_RXD));
- rx_ring->count = ALIGN(rx_ring->count, REQ_RX_DESCRIPTOR_MULTIPLE);
-
- tx_ring->count = max(ring->tx_pending, (u32)E1000_MIN_TXD);
- tx_ring->count = min(tx_ring->count, (u32)(E1000_MAX_TXD));
- tx_ring->count = ALIGN(tx_ring->count, REQ_TX_DESCRIPTOR_MULTIPLE);
-
- if (netif_running(adapter->netdev)) {
- /* Try to get new resources before deleting old */
- err = e1000e_setup_rx_resources(adapter);
- if (err)
- goto err_setup_rx;
- err = e1000e_setup_tx_resources(adapter);
- if (err)
- goto err_setup_tx;
-
- /*
- * restore the old in order to free it,
- * then add in the new
- */
- adapter->rx_ring = rx_old;
- adapter->tx_ring = tx_old;
- e1000e_free_rx_resources(adapter);
- e1000e_free_tx_resources(adapter);
- kfree(tx_old);
- kfree(rx_old);
- adapter->rx_ring = rx_ring;
- adapter->tx_ring = tx_ring;
- err = e1000e_up(adapter);
- if (err)
- goto err_setup;
- }
-
- clear_bit(__E1000_RESETTING, &adapter->state);
- return 0;
-err_setup_tx:
- e1000e_free_rx_resources(adapter);
-err_setup_rx:
- adapter->rx_ring = rx_old;
- adapter->tx_ring = tx_old;
- kfree(rx_ring);
-err_alloc_rx:
- kfree(tx_ring);
-err_alloc_tx:
- e1000e_up(adapter);
-err_setup:
- clear_bit(__E1000_RESETTING, &adapter->state);
- return err;
-}
-
-static bool reg_pattern_test(struct e1000_adapter *adapter, u64 *data,
- int reg, int offset, u32 mask, u32 write)
-{
- u32 pat, val;
- static const u32 test[] =
- {0x5A5A5A5A, 0xA5A5A5A5, 0x00000000, 0xFFFFFFFF};
- for (pat = 0; pat < ARRAY_SIZE(test); pat++) {
- E1000_WRITE_REG_ARRAY(&adapter->hw, reg, offset,
- (test[pat] & write));
- val = E1000_READ_REG_ARRAY(&adapter->hw, reg, offset);
- if (val != (test[pat] & write & mask)) {
- e_err("pattern test reg %04X failed: got 0x%08X "
- "expected 0x%08X\n", reg + offset, val,
- (test[pat] & write & mask));
- *data = reg;
- return 1;
- }
- }
- return 0;
-}
-
-static bool reg_set_and_check(struct e1000_adapter *adapter, u64 *data,
- int reg, u32 mask, u32 write)
-{
- u32 val;
- __ew32(&adapter->hw, reg, write & mask);
- val = __er32(&adapter->hw, reg);
- if ((write & mask) != (val & mask)) {
- e_err("set/check reg %04X test failed: got 0x%08X "
- "expected 0x%08X\n", reg, (val & mask), (write & mask));
- *data = reg;
- return 1;
- }
- return 0;
-}
-#define REG_PATTERN_TEST_ARRAY(reg, offset, mask, write) \
- do { \
- if (reg_pattern_test(adapter, data, reg, offset, mask, write)) \
- return 1; \
- } while (0)
-#define REG_PATTERN_TEST(reg, mask, write) \
- REG_PATTERN_TEST_ARRAY(reg, 0, mask, write)
-
-#define REG_SET_AND_CHECK(reg, mask, write) \
- do { \
- if (reg_set_and_check(adapter, data, reg, mask, write)) \
- return 1; \
- } while (0)
-
-static int e1000_reg_test(struct e1000_adapter *adapter, u64 *data)
-{
- struct e1000_hw *hw = &adapter->hw;
- struct e1000_mac_info *mac = &adapter->hw.mac;
- u32 value;
- u32 before;
- u32 after;
- u32 i;
- u32 toggle;
- u32 mask;
-
- /*
- * The status register is Read Only, so a write should fail.
- * Some bits that get toggled are ignored.
- */
- switch (mac->type) {
- /* there are several bits on newer hardware that are r/w */
- case e1000_82571:
- case e1000_82572:
- case e1000_80003es2lan:
- toggle = 0x7FFFF3FF;
- break;
- default:
- toggle = 0x7FFFF033;
- break;
- }
-
- before = er32(STATUS);
- value = (er32(STATUS) & toggle);
- ew32(STATUS, toggle);
- after = er32(STATUS) & toggle;
- if (value != after) {
- e_err("failed STATUS register test got: 0x%08X expected: "
- "0x%08X\n", after, value);
- *data = 1;
- return 1;
- }
- /* restore previous status */
- ew32(STATUS, before);
-
- if (!(adapter->flags & FLAG_IS_ICH)) {
- REG_PATTERN_TEST(E1000_FCAL, 0xFFFFFFFF, 0xFFFFFFFF);
- REG_PATTERN_TEST(E1000_FCAH, 0x0000FFFF, 0xFFFFFFFF);
- REG_PATTERN_TEST(E1000_FCT, 0x0000FFFF, 0xFFFFFFFF);
- REG_PATTERN_TEST(E1000_VET, 0x0000FFFF, 0xFFFFFFFF);
- }
-
- REG_PATTERN_TEST(E1000_RDTR, 0x0000FFFF, 0xFFFFFFFF);
- REG_PATTERN_TEST(E1000_RDBAH, 0xFFFFFFFF, 0xFFFFFFFF);
- REG_PATTERN_TEST(E1000_RDLEN, 0x000FFF80, 0x000FFFFF);
- REG_PATTERN_TEST(E1000_RDH, 0x0000FFFF, 0x0000FFFF);
- REG_PATTERN_TEST(E1000_RDT, 0x0000FFFF, 0x0000FFFF);
- REG_PATTERN_TEST(E1000_FCRTH, 0x0000FFF8, 0x0000FFF8);
- REG_PATTERN_TEST(E1000_FCTTV, 0x0000FFFF, 0x0000FFFF);
- REG_PATTERN_TEST(E1000_TIPG, 0x3FFFFFFF, 0x3FFFFFFF);
- REG_PATTERN_TEST(E1000_TDBAH, 0xFFFFFFFF, 0xFFFFFFFF);
- REG_PATTERN_TEST(E1000_TDLEN, 0x000FFF80, 0x000FFFFF);
-
- REG_SET_AND_CHECK(E1000_RCTL, 0xFFFFFFFF, 0x00000000);
-
- before = ((adapter->flags & FLAG_IS_ICH) ? 0x06C3B33E : 0x06DFB3FE);
- REG_SET_AND_CHECK(E1000_RCTL, before, 0x003FFFFB);
- REG_SET_AND_CHECK(E1000_TCTL, 0xFFFFFFFF, 0x00000000);
-
- REG_SET_AND_CHECK(E1000_RCTL, before, 0xFFFFFFFF);
- REG_PATTERN_TEST(E1000_RDBAL, 0xFFFFFFF0, 0xFFFFFFFF);
- if (!(adapter->flags & FLAG_IS_ICH))
- REG_PATTERN_TEST(E1000_TXCW, 0xC000FFFF, 0x0000FFFF);
- REG_PATTERN_TEST(E1000_TDBAL, 0xFFFFFFF0, 0xFFFFFFFF);
- REG_PATTERN_TEST(E1000_TIDV, 0x0000FFFF, 0x0000FFFF);
- mask = 0x8003FFFF;
- switch (mac->type) {
- case e1000_ich10lan:
- case e1000_pchlan:
- mask |= (1 << 18);
- break;
- default:
- break;
- }
- for (i = 0; i < mac->rar_entry_count; i++)
- REG_PATTERN_TEST_ARRAY(E1000_RA, ((i << 1) + 1),
- mask, 0xFFFFFFFF);
-
- for (i = 0; i < mac->mta_reg_count; i++)
- REG_PATTERN_TEST_ARRAY(E1000_MTA, i, 0xFFFFFFFF, 0xFFFFFFFF);
-
- *data = 0;
- return 0;
-}
-
-static int e1000_eeprom_test(struct e1000_adapter *adapter, u64 *data)
-{
- u16 temp;
- u16 checksum = 0;
- u16 i;
-
- *data = 0;
- /* Read and add up the contents of the EEPROM */
- for (i = 0; i < (NVM_CHECKSUM_REG + 1); i++) {
- if ((e1000_read_nvm(&adapter->hw, i, 1, &temp)) < 0) {
- *data = 1;
- return *data;
- }
- checksum += temp;
- }
-
- /* If Checksum is not Correct return error else test passed */
- if ((checksum != (u16) NVM_SUM) && !(*data))
- *data = 2;
-
- return *data;
-}
-
-static irqreturn_t e1000_test_intr(int irq, void *data)
-{
- struct net_device *netdev = (struct net_device *) data;
- struct e1000_adapter *adapter = netdev_priv(netdev);
- struct e1000_hw *hw = &adapter->hw;
-
- adapter->test_icr |= er32(ICR);
-
- return IRQ_HANDLED;
-}
-
-static int e1000_intr_test(struct e1000_adapter *adapter, u64 *data)
-{
- struct net_device *netdev = adapter->netdev;
- struct e1000_hw *hw =...
[truncated message content] |
|
From: Arnout V. (Essensium/Mind) <ar...@mi...> - 2011-10-06 20:37:19
|
From: "Arnout Vandecappelle (Essensium/Mind)" <ar...@mi...>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <ar...@mi...>
---
drivers/experimental/e1000e/hw.h | 2 +-
drivers/experimental/e1000e/netdev.c | 5 ++++
drivers/experimental/e1000e/param.c | 40 ++++++++++++++++++++++++++++++++++
3 files changed, 46 insertions(+), 1 deletions(-)
diff --git a/drivers/experimental/e1000e/hw.h b/drivers/experimental/e1000e/hw.h
index 11f3b7c..0c5ddb3 100644
--- a/drivers/experimental/e1000e/hw.h
+++ b/drivers/experimental/e1000e/hw.h
@@ -810,7 +810,7 @@ struct e1000_mac_info {
u16 mta_reg_count;
u16 rar_entry_count;
- u8 forced_speed_duplex;
+ u32 forced_speed_duplex;
bool arc_subsystem_valid;
bool autoneg;
diff --git a/drivers/experimental/e1000e/netdev.c b/drivers/experimental/e1000e/netdev.c
index bf2b916..d005956 100644
--- a/drivers/experimental/e1000e/netdev.c
+++ b/drivers/experimental/e1000e/netdev.c
@@ -5055,6 +5055,11 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
adapter->hw.fc.current_mode = e1000_fc_default;
adapter->hw.phy.autoneg_advertised = 0x2f;
+ if (adapter->hw.mac.forced_speed_duplex != 0) {
+ adapter->hw.mac.autoneg = false;
+ adapter->hw.phy.autoneg_advertised = adapter->hw.mac.forced_speed_duplex;
+ }
+
/* ring size defaults */
adapter->rx_ring->count = 256;
adapter->tx_ring->count = 256;
diff --git a/drivers/experimental/e1000e/param.c b/drivers/experimental/e1000e/param.c
index bb20552..a57ddb8 100644
--- a/drivers/experimental/e1000e/param.c
+++ b/drivers/experimental/e1000e/param.c
@@ -64,6 +64,22 @@ unsigned int copybreak = COPYBREAK_DEFAULT;
/*
+ * Force speed and duplex.
+ *
+ * Valid Values:
+ * 0x00: Auto-negotiate (default)
+ * 0x01: 10Mbps Half-Duplex
+ * 0x02: 10Mbps Full-Duplex
+ * 0x04: 100Mbps Half-Duplex
+ * 0x08: 100Mbps Full-Duplex
+ * 0x20: 1000Mbps Full-Duplex
+ *
+ * Note: although these values are the same as the flags for advertising, it
+ * is not valid to specify multiple flags.
+ */
+E1000_PARAM(ForceSpeedDuplex, "Forced Speed and Duplex");
+
+/*
* Transmit Interrupt Delay in units of 1.024 microseconds
* Tx interrupt delay needs to typically be set to something non zero
*
@@ -247,6 +263,30 @@ void __devinit e1000e_check_options(struct e1000_adapter *adapter)
e_notice("Using defaults for all values\n");
}
+ { /* Force speed and duplex */
+ struct e1000_opt_list fsd_list[] =
+ {{ ADVERTISE_10_HALF, "10 Mbps Half-Duplex" },
+ { ADVERTISE_10_FULL, "10 Mbps Full-Duplex" },
+ { ADVERTISE_100_HALF, "100 Mbps Half-Duplex" },
+ { ADVERTISE_100_FULL, "100 Mbps Full-Duplex" },
+ { ADVERTISE_1000_FULL, "1000 Mbps Full-Duplex" }};
+ const struct e1000_option opt = {
+ .type = list_option,
+ .name = "Forced Speed and Duplex",
+ .err = "defaulting to Auto-Negotiate",
+ .def = 0,
+ .arg = { .l = { .nr = ARRAY_SIZE(fsd_list),
+ .p = fsd_list } }
+ };
+ if (num_ForceSpeedDuplex > bd) {
+ adapter->hw.mac.forced_speed_duplex = ForceSpeedDuplex[bd];
+ e1000_validate_option(&adapter->hw.mac.forced_speed_duplex, &opt,
+ adapter);
+ } else {
+ adapter->hw.mac.forced_speed_duplex = opt.def;
+ }
+ }
+
{ /* Transmit Interrupt Delay */
const struct e1000_option opt = {
.type = range_option,
--
1.7.6.3
|
|
From: Jan K. <jan...@si...> - 2011-10-25 13:05:27
|
On 2011-10-06 22:35, Arnout Vandecappelle (Essensium/Mind) wrote:
> From: "Arnout Vandecappelle (Essensium/Mind)" <ar...@mi...>
>
That's a replacement interface for missing ethtool support, right?
Please use the commit log for an explanation of the why.
Jan
> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <ar...@mi...>
> ---
> drivers/experimental/e1000e/hw.h | 2 +-
> drivers/experimental/e1000e/netdev.c | 5 ++++
> drivers/experimental/e1000e/param.c | 40 ++++++++++++++++++++++++++++++++++
> 3 files changed, 46 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/experimental/e1000e/hw.h b/drivers/experimental/e1000e/hw.h
> index 11f3b7c..0c5ddb3 100644
> --- a/drivers/experimental/e1000e/hw.h
> +++ b/drivers/experimental/e1000e/hw.h
> @@ -810,7 +810,7 @@ struct e1000_mac_info {
> u16 mta_reg_count;
> u16 rar_entry_count;
>
> - u8 forced_speed_duplex;
> + u32 forced_speed_duplex;
>
> bool arc_subsystem_valid;
> bool autoneg;
> diff --git a/drivers/experimental/e1000e/netdev.c b/drivers/experimental/e1000e/netdev.c
> index bf2b916..d005956 100644
> --- a/drivers/experimental/e1000e/netdev.c
> +++ b/drivers/experimental/e1000e/netdev.c
> @@ -5055,6 +5055,11 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
> adapter->hw.fc.current_mode = e1000_fc_default;
> adapter->hw.phy.autoneg_advertised = 0x2f;
>
> + if (adapter->hw.mac.forced_speed_duplex != 0) {
> + adapter->hw.mac.autoneg = false;
> + adapter->hw.phy.autoneg_advertised = adapter->hw.mac.forced_speed_duplex;
> + }
> +
> /* ring size defaults */
> adapter->rx_ring->count = 256;
> adapter->tx_ring->count = 256;
> diff --git a/drivers/experimental/e1000e/param.c b/drivers/experimental/e1000e/param.c
> index bb20552..a57ddb8 100644
> --- a/drivers/experimental/e1000e/param.c
> +++ b/drivers/experimental/e1000e/param.c
> @@ -64,6 +64,22 @@ unsigned int copybreak = COPYBREAK_DEFAULT;
>
>
> /*
> + * Force speed and duplex.
> + *
> + * Valid Values:
> + * 0x00: Auto-negotiate (default)
> + * 0x01: 10Mbps Half-Duplex
> + * 0x02: 10Mbps Full-Duplex
> + * 0x04: 100Mbps Half-Duplex
> + * 0x08: 100Mbps Full-Duplex
> + * 0x20: 1000Mbps Full-Duplex
> + *
> + * Note: although these values are the same as the flags for advertising, it
> + * is not valid to specify multiple flags.
> + */
> +E1000_PARAM(ForceSpeedDuplex, "Forced Speed and Duplex");
> +
> +/*
> * Transmit Interrupt Delay in units of 1.024 microseconds
> * Tx interrupt delay needs to typically be set to something non zero
> *
> @@ -247,6 +263,30 @@ void __devinit e1000e_check_options(struct e1000_adapter *adapter)
> e_notice("Using defaults for all values\n");
> }
>
> + { /* Force speed and duplex */
> + struct e1000_opt_list fsd_list[] =
> + {{ ADVERTISE_10_HALF, "10 Mbps Half-Duplex" },
> + { ADVERTISE_10_FULL, "10 Mbps Full-Duplex" },
> + { ADVERTISE_100_HALF, "100 Mbps Half-Duplex" },
> + { ADVERTISE_100_FULL, "100 Mbps Full-Duplex" },
> + { ADVERTISE_1000_FULL, "1000 Mbps Full-Duplex" }};
> + const struct e1000_option opt = {
> + .type = list_option,
> + .name = "Forced Speed and Duplex",
> + .err = "defaulting to Auto-Negotiate",
> + .def = 0,
> + .arg = { .l = { .nr = ARRAY_SIZE(fsd_list),
> + .p = fsd_list } }
> + };
> + if (num_ForceSpeedDuplex > bd) {
> + adapter->hw.mac.forced_speed_duplex = ForceSpeedDuplex[bd];
> + e1000_validate_option(&adapter->hw.mac.forced_speed_duplex, &opt,
> + adapter);
> + } else {
> + adapter->hw.mac.forced_speed_duplex = opt.def;
> + }
> + }
> +
> { /* Transmit Interrupt Delay */
> const struct e1000_option opt = {
> .type = range_option,
--
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux
|
|
From: Arnout V. (Essensium/Mind) <ar...@mi...> - 2011-10-06 20:37:22
|
From: "Arnout Vandecappelle (Essensium/Mind)" <ar...@mi...>
e1000_test_msi(), which is a workaround for malfunctioning PCIe chipsets,
is not included. It is assumed the IntMode module parameter will be used
if required.
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <ar...@mi...>
---
drivers/experimental/e1000e/netdev.c | 35 ++++++++++++++++++++++++++-------
drivers/experimental/e1000e/param.c | 4 +-
2 files changed, 29 insertions(+), 10 deletions(-)
diff --git a/drivers/experimental/e1000e/netdev.c b/drivers/experimental/e1000e/netdev.c
index d005956..7bc606b 100644
--- a/drivers/experimental/e1000e/netdev.c
+++ b/drivers/experimental/e1000e/netdev.c
@@ -1419,14 +1419,16 @@ static void e1000_configure_msix(struct e1000_adapter *adapter)
ew32(CTRL_EXT, ctrl_ext);
e1e_flush();
}
+#endif
void e1000e_reset_interrupt_capability(struct e1000_adapter *adapter)
{
- if (adapter->msix_entries) {
- pci_disable_msix(adapter->pdev);
- kfree(adapter->msix_entries);
- adapter->msix_entries = NULL;
- } else if (adapter->flags & FLAG_MSI_ENABLED) {
+// if (adapter->msix_entries) {
+// pci_disable_msix(adapter->pdev);
+// kfree(adapter->msix_entries);
+// adapter->msix_entries = NULL;
+// } else
+ if (adapter->flags & FLAG_MSI_ENABLED) {
pci_disable_msi(adapter->pdev);
adapter->flags &= ~FLAG_MSI_ENABLED;
}
@@ -1442,11 +1444,12 @@ void e1000e_reset_interrupt_capability(struct e1000_adapter *adapter)
**/
void e1000e_set_interrupt_capability(struct e1000_adapter *adapter)
{
- int err;
- int numvecs, i;
+// int err;
+// int numvecs, i;
switch (adapter->int_mode) {
+#ifdef DISABLED_FOR_RTNET
case E1000E_INT_MODE_MSIX:
if (adapter->flags & FLAG_HAS_MSIX) {
numvecs = 3; /* RxQ0, TxQ0 and other */
@@ -1470,6 +1473,7 @@ void e1000e_set_interrupt_capability(struct e1000_adapter *adapter)
}
adapter->int_mode = E1000E_INT_MODE_MSI;
/* Fall through */
+#endif
case E1000E_INT_MODE_MSI:
if (!pci_enable_msi(adapter->pdev)) {
adapter->flags |= FLAG_MSI_ENABLED;
@@ -1487,6 +1491,7 @@ void e1000e_set_interrupt_capability(struct e1000_adapter *adapter)
return;
}
+#ifdef DISABLED_FOR_RTNET
/**
* e1000_request_msix - Initialize MSI-X interrupts
*
@@ -1549,6 +1554,16 @@ static int e1000_request_irq(struct e1000_adapter *adapter)
rt_stack_connect(netdev, &STACK_manager);
+ if (adapter->flags & FLAG_MSI_ENABLED) {
+ err = rtdm_irq_request(&adapter->irq_handle, adapter->pdev->irq,
+ &e1000_intr, 0, netdev->name, netdev);
+ if (!err)
+ return err;
+
+ /* fall back to legacy interrupt */
+ e1000e_reset_interrupt_capability(adapter);
+ adapter->int_mode = E1000E_INT_MODE_LEGACY;
+ }
err = rtdm_irq_request(&adapter->irq_handle, adapter->pdev->irq,
&e1000_intr, RTDM_IRQTYPE_SHARED, netdev->name, netdev);
if (err)
@@ -2884,6 +2899,8 @@ static int __devinit e1000_sw_init(struct e1000_adapter *adapter)
adapter->max_frame_size = netdev->mtu + ETH_HLEN + ETH_FCS_LEN;
adapter->min_frame_size = ETH_ZLEN + ETH_FCS_LEN;
+ e1000e_set_interrupt_capability(adapter);
+
if (rtskb_pool_init(&adapter->skb_pool, 16) < 16)
{
rtskb_pool_release(&adapter->skb_pool);
@@ -4393,7 +4410,7 @@ static int __e1000_shutdown(struct pci_dev *pdev, bool *enable_wake)
e1000e_down(adapter);
e1000_free_irq(adapter);
}
-// e1000e_reset_interrupt_capability(adapter);
+ e1000e_reset_interrupt_capability(adapter);
retval = pci_save_state(pdev);
if (retval)
@@ -5186,6 +5203,8 @@ static void __devexit e1000_remove(struct pci_dev *pdev)
*/
e1000_release_hw_control(adapter);
+ e1000e_reset_interrupt_capability(adapter);
+
rt_unregister_rtnetdev(netdev);
if (!e1000_check_reset_block(&adapter->hw))
diff --git a/drivers/experimental/e1000e/param.c b/drivers/experimental/e1000e/param.c
index a57ddb8..09d5e60 100644
--- a/drivers/experimental/e1000e/param.c
+++ b/drivers/experimental/e1000e/param.c
@@ -424,8 +424,8 @@ void __devinit e1000e_check_options(struct e1000_adapter *adapter)
struct e1000_option opt = {
.type = range_option,
.name = "Interrupt Mode",
- .err = "defaulting to 2 (MSI-X)",
- .def = E1000E_INT_MODE_LEGACY, //E1000E_INT_MODE_MSIX,
+ .err = "defaulting to 1 (MSI)",
+ .def = E1000E_INT_MODE_MSI,
.arg = { .r = { .min = MIN_INTMODE,
.max = MAX_INTMODE } }
};
--
1.7.6.3
|
|
From: Jan K. <jan...@si...> - 2011-10-25 13:08:14
|
On 2011-10-06 22:35, Arnout Vandecappelle (Essensium/Mind) wrote:
> From: "Arnout Vandecappelle (Essensium/Mind)" <ar...@mi...>
>
> e1000_test_msi(), which is a workaround for malfunctioning PCIe chipsets,
> is not included. It is assumed the IntMode module parameter will be used
> if required.
MSI-X is usable under RT as well (see rt-igb changes) and should
generally be preferred over legacy MSI, e.g. due to lower hardware
latencies or separation of config and tx/rx interrupts - the former may
be realized as normal Linux IRQs when lucky.
Jan
>
> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <ar...@mi...>
> ---
> drivers/experimental/e1000e/netdev.c | 35 ++++++++++++++++++++++++++-------
> drivers/experimental/e1000e/param.c | 4 +-
> 2 files changed, 29 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/experimental/e1000e/netdev.c b/drivers/experimental/e1000e/netdev.c
> index d005956..7bc606b 100644
> --- a/drivers/experimental/e1000e/netdev.c
> +++ b/drivers/experimental/e1000e/netdev.c
> @@ -1419,14 +1419,16 @@ static void e1000_configure_msix(struct e1000_adapter *adapter)
> ew32(CTRL_EXT, ctrl_ext);
> e1e_flush();
> }
> +#endif
>
> void e1000e_reset_interrupt_capability(struct e1000_adapter *adapter)
> {
> - if (adapter->msix_entries) {
> - pci_disable_msix(adapter->pdev);
> - kfree(adapter->msix_entries);
> - adapter->msix_entries = NULL;
> - } else if (adapter->flags & FLAG_MSI_ENABLED) {
> +// if (adapter->msix_entries) {
> +// pci_disable_msix(adapter->pdev);
> +// kfree(adapter->msix_entries);
> +// adapter->msix_entries = NULL;
> +// } else
> + if (adapter->flags & FLAG_MSI_ENABLED) {
> pci_disable_msi(adapter->pdev);
> adapter->flags &= ~FLAG_MSI_ENABLED;
> }
> @@ -1442,11 +1444,12 @@ void e1000e_reset_interrupt_capability(struct e1000_adapter *adapter)
> **/
> void e1000e_set_interrupt_capability(struct e1000_adapter *adapter)
> {
> - int err;
> - int numvecs, i;
> +// int err;
> +// int numvecs, i;
>
>
> switch (adapter->int_mode) {
> +#ifdef DISABLED_FOR_RTNET
> case E1000E_INT_MODE_MSIX:
> if (adapter->flags & FLAG_HAS_MSIX) {
> numvecs = 3; /* RxQ0, TxQ0 and other */
> @@ -1470,6 +1473,7 @@ void e1000e_set_interrupt_capability(struct e1000_adapter *adapter)
> }
> adapter->int_mode = E1000E_INT_MODE_MSI;
> /* Fall through */
> +#endif
> case E1000E_INT_MODE_MSI:
> if (!pci_enable_msi(adapter->pdev)) {
> adapter->flags |= FLAG_MSI_ENABLED;
> @@ -1487,6 +1491,7 @@ void e1000e_set_interrupt_capability(struct e1000_adapter *adapter)
> return;
> }
>
> +#ifdef DISABLED_FOR_RTNET
> /**
> * e1000_request_msix - Initialize MSI-X interrupts
> *
> @@ -1549,6 +1554,16 @@ static int e1000_request_irq(struct e1000_adapter *adapter)
>
> rt_stack_connect(netdev, &STACK_manager);
>
> + if (adapter->flags & FLAG_MSI_ENABLED) {
> + err = rtdm_irq_request(&adapter->irq_handle, adapter->pdev->irq,
> + &e1000_intr, 0, netdev->name, netdev);
> + if (!err)
> + return err;
> +
> + /* fall back to legacy interrupt */
> + e1000e_reset_interrupt_capability(adapter);
> + adapter->int_mode = E1000E_INT_MODE_LEGACY;
> + }
> err = rtdm_irq_request(&adapter->irq_handle, adapter->pdev->irq,
> &e1000_intr, RTDM_IRQTYPE_SHARED, netdev->name, netdev);
> if (err)
> @@ -2884,6 +2899,8 @@ static int __devinit e1000_sw_init(struct e1000_adapter *adapter)
> adapter->max_frame_size = netdev->mtu + ETH_HLEN + ETH_FCS_LEN;
> adapter->min_frame_size = ETH_ZLEN + ETH_FCS_LEN;
>
> + e1000e_set_interrupt_capability(adapter);
> +
> if (rtskb_pool_init(&adapter->skb_pool, 16) < 16)
> {
> rtskb_pool_release(&adapter->skb_pool);
> @@ -4393,7 +4410,7 @@ static int __e1000_shutdown(struct pci_dev *pdev, bool *enable_wake)
> e1000e_down(adapter);
> e1000_free_irq(adapter);
> }
> -// e1000e_reset_interrupt_capability(adapter);
> + e1000e_reset_interrupt_capability(adapter);
>
> retval = pci_save_state(pdev);
> if (retval)
> @@ -5186,6 +5203,8 @@ static void __devexit e1000_remove(struct pci_dev *pdev)
> */
> e1000_release_hw_control(adapter);
>
> + e1000e_reset_interrupt_capability(adapter);
> +
> rt_unregister_rtnetdev(netdev);
>
> if (!e1000_check_reset_block(&adapter->hw))
> diff --git a/drivers/experimental/e1000e/param.c b/drivers/experimental/e1000e/param.c
> index a57ddb8..09d5e60 100644
> --- a/drivers/experimental/e1000e/param.c
> +++ b/drivers/experimental/e1000e/param.c
> @@ -424,8 +424,8 @@ void __devinit e1000e_check_options(struct e1000_adapter *adapter)
> struct e1000_option opt = {
> .type = range_option,
> .name = "Interrupt Mode",
> - .err = "defaulting to 2 (MSI-X)",
> - .def = E1000E_INT_MODE_LEGACY, //E1000E_INT_MODE_MSIX,
> + .err = "defaulting to 1 (MSI)",
> + .def = E1000E_INT_MODE_MSI,
> .arg = { .r = { .min = MIN_INTMODE,
> .max = MAX_INTMODE } }
> };
--
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux
|
|
From: Arnout V. <ar...@mi...> - 2011-10-18 10:44:36
|
Hoi all, On Thursday 06 October 2011 08:13:36, Arnout Vandecappelle (Essensium/Mind) wrote: > This patch series adds the e1000e driver from Linux 2.6.32.20 to RTnet. > It is based on the work of Stefan Kral, but rewritten a bit to making > merging upstream patches more easy. Did this patch series (6 patches) arrive to the list? Was it the correct place to post it? Was anything else wrong with it? Reactions have been rather underwhelming... Regards, Arnout -- Arnout Vandecappelle arnout at mind be Senior Embedded Software Architect +32-16-286540 Essensium/Mind http://www.mind.be G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle GPG fingerprint: 31BB CF53 8660 6F88 345D 54CC A836 5879 20D7 CF43 |
|
From: Jan K. <jan...@si...> - 2011-10-18 11:06:20
|
On 2011-10-18 12:44, Arnout Vandecappelle wrote: > Hoi all, > > On Thursday 06 October 2011 08:13:36, Arnout Vandecappelle (Essensium/Mind) wrote: >> This patch series adds the e1000e driver from Linux 2.6.32.20 to RTnet. >> It is based on the work of Stefan Kral, but rewritten a bit to making >> merging upstream patches more easy. > > Did this patch series (6 patches) arrive to the list? Was it the correct > place to post it? Was anything else wrong with it? Reactions have been > rather underwhelming... Sorry, I have all the pending RTnet mails on my to-do list, but they keep slipping to the bottom over and over again. Will try to have a look the next days. Jan -- Siemens AG, Corporate Technology, CT T DE IT 1 Corporate Competence Center Embedded Linux |
|
From: Jan K. <jan...@si...> - 2011-10-25 13:04:03
|
On 2011-10-06 08:13, Arnout Vandecappelle (Essensium/Mind) wrote: > This patch series adds the e1000e driver from Linux 2.6.32.20 to RTnet. Why using a historic kernel as baseline? This is apparently e1000e driver version 1.0.2-k2 while upstream as at 1.5.1-k! > It is based on the work of Stefan Kral, but rewritten a bit to making > merging upstream patches more easy. Let's see of that works out: I will try to merge the latest version with your RTnet adaption. :) Generally, I like your approach of first importing vanilla and then adjusting it for RTnet - keeps that step as part of the development history. Jan -- Siemens AG, Corporate Technology, CT T DE IT 1 Corporate Competence Center Embedded Linux |
|
From: Jan K. <jan...@we...> - 2011-11-03 08:27:25
Attachments:
signature.asc
|
On 2011-10-25 15:03, Jan Kiszka wrote: > On 2011-10-06 08:13, Arnout Vandecappelle (Essensium/Mind) wrote: >> This patch series adds the e1000e driver from Linux 2.6.32.20 to RTnet. > > Why using a historic kernel as baseline? This is apparently e1000e > driver version 1.0.2-k2 while upstream as at 1.5.1-k! > >> It is based on the work of Stefan Kral, but rewritten a bit to making >> merging upstream patches more easy. > > Let's see of that works out: I will try to merge the latest version with > your RTnet adaption. :) > > Generally, I like your approach of first importing vanilla and then > adjusting it for RTnet - keeps that step as part of the development history. Just finally pushed the work, would appreciate if you could test it as well. It's based on the latest kernel version and should (untested) work with MSI-X as well. I noticed that the e1000e also suffers from a start-up delay that eats outgoing or incoming packets. We had to work around it in e1000 via an msleep(3000), and I'm considering to add this to e1000e as well. Did you notice this with your version as well? Jan |