Merge branch 'upstream-fixes' of git://lost.foo-projects.org/~ahkok/git/netdev-2...
authorJeff Garzik <jeff@garzik.org>
Thu, 24 Aug 2006 04:45:36 +0000 (00:45 -0400)
committerJeff Garzik <jeff@garzik.org>
Thu, 24 Aug 2006 04:45:36 +0000 (00:45 -0400)
1  2 
drivers/net/e100.c
drivers/net/e1000/e1000_hw.c
drivers/net/e1000/e1000_main.c
drivers/net/ixgb/ixgb_main.c

diff --combined drivers/net/e100.c
@@@ -1,7 -1,7 +1,7 @@@
  /*******************************************************************************
  
  
-   Copyright(c) 1999 - 2005 Intel Corporation. All rights reserved.
+   Copyright(c) 1999 - 2006 Intel Corporation. All rights reserved.
  
    This program is free software; you can redistribute it and/or modify it
    under the terms of the GNU General Public License as published by the Free
  
  
  #define DRV_NAME              "e100"
- #define DRV_EXT               "-NAPI"
- #define DRV_VERSION           "3.5.10-k2"DRV_EXT
+ #define DRV_EXT                       "-NAPI"
+ #define DRV_VERSION           "3.5.10-k4"DRV_EXT
  #define DRV_DESCRIPTION               "Intel(R) PRO/100 Network Driver"
- #define DRV_COPYRIGHT         "Copyright(c) 1999-2005 Intel Corporation"
+ #define DRV_COPYRIGHT         "Copyright(c) 1999-2006 Intel Corporation"
  #define PFX                   DRV_NAME ": "
  
  #define E100_WATCHDOG_PERIOD  (2 * HZ)
@@@ -1391,15 -1391,11 +1391,11 @@@ static int e100_phy_init(struct nic *ni
        }
  
        if((nic->mac >= mac_82550_D102) || ((nic->flags & ich) &&
-          (mdio_read(netdev, nic->mii.phy_id, MII_TPISTATUS) & 0x8000))) {
-               /* enable/disable MDI/MDI-X auto-switching.
-                  MDI/MDI-X auto-switching is disabled for 82551ER/QM chips */
-               if((nic->mac == mac_82551_E) || (nic->mac == mac_82551_F) ||
-                  (nic->mac == mac_82551_10) || (nic->mii.force_media) ||
-                  !(nic->eeprom[eeprom_cnfg_mdix] & eeprom_mdix_enabled))
-                       mdio_write(netdev, nic->mii.phy_id, MII_NCONFIG, 0);
-               else
-                       mdio_write(netdev, nic->mii.phy_id, MII_NCONFIG, NCONFIG_AUTO_SWITCH);
+          (mdio_read(netdev, nic->mii.phy_id, MII_TPISTATUS) & 0x8000) &&
+               !(nic->eeprom[eeprom_cnfg_mdix] & eeprom_mdix_enabled))) {
+               /* enable/disable MDI/MDI-X auto-switching. */
+               mdio_write(netdev, nic->mii.phy_id, MII_NCONFIG,
+                               nic->mii.force_media ? 0 : NCONFIG_AUTO_SWITCH);
        }
  
        return 0;
@@@ -2873,7 -2869,7 +2869,7 @@@ static int __init e100_init_module(void
                printk(KERN_INFO PFX "%s, %s\n", DRV_DESCRIPTION, DRV_VERSION);
                printk(KERN_INFO PFX "%s\n", DRV_COPYRIGHT);
        }
 -      return pci_module_init(&e100_driver);
 +      return pci_register_driver(&e100_driver);
  }
  
  static void __exit e100_cleanup_module(void)
@@@ -105,33 -105,6 +105,33 @@@ static int32_t e1000_configure_kmrn_for
                                                 uint16_t duplex);
  static int32_t e1000_configure_kmrn_for_1000(struct e1000_hw *hw);
  
 +static int32_t e1000_erase_ich8_4k_segment(struct e1000_hw *hw,
 +                                         uint32_t segment);
 +static int32_t e1000_get_software_flag(struct e1000_hw *hw);
 +static int32_t e1000_get_software_semaphore(struct e1000_hw *hw);
 +static int32_t e1000_init_lcd_from_nvm(struct e1000_hw *hw);
 +static int32_t e1000_kumeran_lock_loss_workaround(struct e1000_hw *hw);
 +static int32_t e1000_read_eeprom_ich8(struct e1000_hw *hw, uint16_t offset,
 +                                    uint16_t words, uint16_t *data);
 +static int32_t e1000_read_ich8_byte(struct e1000_hw *hw, uint32_t index,
 +                                  uint8_t* data);
 +static int32_t e1000_read_ich8_word(struct e1000_hw *hw, uint32_t index,
 +                                  uint16_t *data);
 +static int32_t e1000_read_kmrn_reg(struct e1000_hw *hw, uint32_t reg_addr,
 +                                 uint16_t *data);
 +static void e1000_release_software_flag(struct e1000_hw *hw);
 +static void e1000_release_software_semaphore(struct e1000_hw *hw);
 +static int32_t e1000_set_pci_ex_no_snoop(struct e1000_hw *hw,
 +                                       uint32_t no_snoop);
 +static int32_t e1000_verify_write_ich8_byte(struct e1000_hw *hw,
 +                                          uint32_t index, uint8_t byte);
 +static int32_t e1000_write_eeprom_ich8(struct e1000_hw *hw, uint16_t offset,
 +                                     uint16_t words, uint16_t *data);
 +static int32_t e1000_write_ich8_byte(struct e1000_hw *hw, uint32_t index,
 +                                   uint8_t data);
 +static int32_t e1000_write_kmrn_reg(struct e1000_hw *hw, uint32_t reg_addr,
 +                                  uint16_t data);
 +
  /* IGP cable length table */
  static const
  uint16_t e1000_igp_cable_length_table[IGP01E1000_AGC_LENGTH_TABLE_SIZE] =
@@@ -745,6 -718,17 +745,17 @@@ e1000_init_hw(struct e1000_hw *hw
  
      DEBUGFUNC("e1000_init_hw");
  
+     /* force full DMA clock frequency for 10/100 on ICH8 A0-B0 */
+     if (hw->mac_type == e1000_ich8lan) {
+         reg_data = E1000_READ_REG(hw, TARC0);
+         reg_data |= 0x30000000;
+         E1000_WRITE_REG(hw, TARC0, reg_data);
+         reg_data = E1000_READ_REG(hw, STATUS);
+         reg_data &= ~0x80000000;
+         E1000_WRITE_REG(hw, STATUS, reg_data);
+     }
      /* Initialize Identification LED */
      ret_val = e1000_id_led_init(hw);
      if(ret_val) {
@@@ -1351,11 -1335,14 +1362,14 @@@ e1000_copper_link_igp_setup(struct e100
      E1000_WRITE_REG(hw, LEDCTL, led_ctrl);
      }
  
-     /* disable lplu d3 during driver init */
-     ret_val = e1000_set_d3_lplu_state(hw, FALSE);
-     if (ret_val) {
-         DEBUGOUT("Error Disabling LPLU D3\n");
-         return ret_val;
+     /* The NVM settings will configure LPLU in D3 for IGP2 and IGP3 PHYs */
+     if (hw->phy_type == e1000_phy_igp) {
+         /* disable lplu d3 during driver init */
+         ret_val = e1000_set_d3_lplu_state(hw, FALSE);
+         if (ret_val) {
+             DEBUGOUT("Error Disabling LPLU D3\n");
+             return ret_val;
+         }
      }
  
      /* disable lplu d0 during driver init */
@@@ -3260,7 -3247,7 +3274,7 @@@ e1000_shift_in_mdi_bits(struct e1000_h
      return data;
  }
  
 -int32_t
 +static int32_t
  e1000_swfw_sync_acquire(struct e1000_hw *hw, uint16_t mask)
  {
      uint32_t swfw_sync = 0;
      return E1000_SUCCESS;
  }
  
 -void
 +static void
  e1000_swfw_sync_release(struct e1000_hw *hw, uint16_t mask)
  {
      uint32_t swfw_sync;
@@@ -3602,7 -3589,7 +3616,7 @@@ e1000_write_phy_reg_ex(struct e1000_hw 
      return E1000_SUCCESS;
  }
  
 -int32_t
 +static int32_t
  e1000_read_kmrn_reg(struct e1000_hw *hw,
                      uint32_t reg_addr,
                      uint16_t *data)
      return E1000_SUCCESS;
  }
  
 -int32_t
 +static int32_t
  e1000_write_kmrn_reg(struct e1000_hw *hw,
                       uint32_t reg_addr,
                       uint16_t data)
@@@ -3866,7 -3853,7 +3880,7 @@@ e1000_phy_powerdown_workaround(struct e
  *
  * hw - struct containing variables accessed by shared code
  ******************************************************************************/
 -int32_t
 +static int32_t
  e1000_kumeran_lock_loss_workaround(struct e1000_hw *hw)
  {
      int32_t ret_val;
@@@ -4113,7 -4100,7 +4127,7 @@@ e1000_phy_igp_get_info(struct e1000_hw 
  * hw - Struct containing variables accessed by shared code
  * phy_info - PHY information structure
  ******************************************************************************/
 -int32_t
 +static int32_t
  e1000_phy_ife_get_info(struct e1000_hw *hw,
                         struct e1000_phy_info *phy_info)
  {
@@@ -5670,7 -5657,6 +5684,7 @@@ e1000_init_rx_addrs(struct e1000_hw *hw
   * for the first 15 multicast addresses, and hashes the rest into the
   * multicast table.
   *****************************************************************************/
 +#if 0
  void
  e1000_mc_addr_list_update(struct e1000_hw *hw,
                            uint8_t *mc_addr_list,
      }
      DEBUGOUT("MC Update Complete\n");
  }
 +#endif  /*  0  */
  
  /******************************************************************************
   * Hashes an address to determine its location in the multicast table
@@@ -6616,7 -6601,6 +6630,7 @@@ e1000_get_bus_info(struct e1000_hw *hw
   * hw - Struct containing variables accessed by shared code
   * offset - offset to read from
   *****************************************************************************/
 +#if 0
  uint32_t
  e1000_read_reg_io(struct e1000_hw *hw,
                    uint32_t offset)
      e1000_io_write(hw, io_addr, offset);
      return e1000_io_read(hw, io_data);
  }
 +#endif  /*  0  */
  
  /******************************************************************************
   * Writes a value to one of the devices registers using port I/O (as opposed to
@@@ -7940,7 -7923,6 +7954,7 @@@ e1000_set_pci_express_master_disable(st
   * returns: - none.
   *
   ***************************************************************************/
 +#if 0
  void
  e1000_enable_pciex_master(struct e1000_hw *hw)
  {
      ctrl &= ~E1000_CTRL_GIO_MASTER_DISABLE;
      E1000_WRITE_REG(hw, CTRL, ctrl);
  }
 +#endif  /*  0  */
  
  /*******************************************************************************
   *
@@@ -8181,7 -8162,7 +8195,7 @@@ e1000_put_hw_eeprom_semaphore(struct e1
   *            E1000_SUCCESS at any other case.
   *
   ***************************************************************************/
 -int32_t
 +static int32_t
  e1000_get_software_semaphore(struct e1000_hw *hw)
  {
      int32_t timeout = hw->eeprom.word_size + 1;
   * hw: Struct containing variables accessed by shared code
   *
   ***************************************************************************/
 -void
 +static void
  e1000_release_software_semaphore(struct e1000_hw *hw)
  {
      uint32_t swsm;
@@@ -8298,7 -8279,7 +8312,7 @@@ e1000_arc_subsystem_valid(struct e1000_
   * returns: E1000_SUCCESS
   *
   *****************************************************************************/
 -int32_t
 +static int32_t
  e1000_set_pci_ex_no_snoop(struct e1000_hw *hw, uint32_t no_snoop)
  {
      uint32_t gcr_reg = 0;
   * hw: Struct containing variables accessed by shared code
   *
   ***************************************************************************/
 -int32_t
 +static int32_t
  e1000_get_software_flag(struct e1000_hw *hw)
  {
      int32_t timeout = PHY_CFG_TIMEOUT;
   * hw: Struct containing variables accessed by shared code
   *
   ***************************************************************************/
 -void
 +static void
  e1000_release_software_flag(struct e1000_hw *hw)
  {
      uint32_t extcnf_ctrl;
   * hw: Struct containing variables accessed by shared code
   *
   ***************************************************************************/
 +#if 0
  int32_t
  e1000_ife_disable_dynamic_power_down(struct e1000_hw *hw)
  {
  
      return ret_val;
  }
 +#endif  /*  0  */
  
  /***************************************************************************
   *
   * hw: Struct containing variables accessed by shared code
   *
   ***************************************************************************/
 +#if 0
  int32_t
  e1000_ife_enable_dynamic_power_down(struct e1000_hw *hw)
  {
  
      return ret_val;
  }
 +#endif  /*  0  */
  
  /******************************************************************************
   * Reads a 16 bit word or words from the EEPROM using the ICH8's flash access
   * data - word read from the EEPROM
   * words - number of words to read
   *****************************************************************************/
 -int32_t
 +static int32_t
  e1000_read_eeprom_ich8(struct e1000_hw *hw, uint16_t offset, uint16_t words,
                         uint16_t *data)
  {
   * words - number of words to write
   * data - words to write to the EEPROM
   *****************************************************************************/
 -int32_t
 +static int32_t
  e1000_write_eeprom_ich8(struct e1000_hw *hw, uint16_t offset, uint16_t words,
                          uint16_t *data)
  {
   *
   * hw - The pointer to the hw structure
   ****************************************************************************/
 -int32_t
 +static int32_t
  e1000_ich8_cycle_init(struct e1000_hw *hw)
  {
      union ich8_hws_flash_status hsfsts;
   *
   * hw - The pointer to the hw structure
   ****************************************************************************/
 -int32_t
 +static int32_t
  e1000_ich8_flash_cycle(struct e1000_hw *hw, uint32_t timeout)
  {
      union ich8_hws_flash_ctrl hsflctl;
   * size - Size of data to read, 1=byte 2=word
   * data - Pointer to the word to store the value read.
   *****************************************************************************/
 -int32_t
 +static int32_t
  e1000_read_ich8_data(struct e1000_hw *hw, uint32_t index,
                       uint32_t size, uint16_t* data)
  {
   * size - Size of data to read, 1=byte 2=word
   * data - The byte(s) to write to the NVM.
   *****************************************************************************/
 -int32_t
 +static int32_t
  e1000_write_ich8_data(struct e1000_hw *hw, uint32_t index, uint32_t size,
                        uint16_t data)
  {
   * index - The index of the byte to read.
   * data - Pointer to a byte to store the value read.
   *****************************************************************************/
 -int32_t
 +static int32_t
  e1000_read_ich8_byte(struct e1000_hw *hw, uint32_t index, uint8_t* data)
  {
      int32_t status = E1000_SUCCESS;
   * index - The index of the byte to write.
   * byte - The byte to write to the NVM.
   *****************************************************************************/
 -int32_t
 +static int32_t
  e1000_verify_write_ich8_byte(struct e1000_hw *hw, uint32_t index, uint8_t byte)
  {
      int32_t error = E1000_SUCCESS;
   * index - The index of the byte to read.
   * data - The byte to write to the NVM.
   *****************************************************************************/
 -int32_t
 +static int32_t
  e1000_write_ich8_byte(struct e1000_hw *hw, uint32_t index, uint8_t data)
  {
      int32_t status = E1000_SUCCESS;
   * index - The starting byte index of the word to read.
   * data - Pointer to a word to store the value read.
   *****************************************************************************/
 -int32_t
 +static int32_t
  e1000_read_ich8_word(struct e1000_hw *hw, uint32_t index, uint16_t *data)
  {
      int32_t status = E1000_SUCCESS;
   * index - The starting byte index of the word to read.
   * data - The word to write to the NVM.
   *****************************************************************************/
 +#if 0
  int32_t
  e1000_write_ich8_word(struct e1000_hw *hw, uint32_t index, uint16_t data)
  {
      status = e1000_write_ich8_data(hw, index, 2, data);
      return status;
  }
 +#endif  /*  0  */
  
  /******************************************************************************
   * Erases the bank specified. Each bank is a 4k block. Segments are 0 based.
   * hw - pointer to e1000_hw structure
   * segment - 0 for first segment, 1 for second segment, etc.
   *****************************************************************************/
 -int32_t
 +static int32_t
  e1000_erase_ich8_4k_segment(struct e1000_hw *hw, uint32_t segment)
  {
      union ich8_hws_flash_status hsfsts;
   * hw: Struct containing variables accessed by shared code
   *
   *****************************************************************************/
 +#if 0
  int32_t
  e1000_duplex_reversal(struct e1000_hw *hw)
  {
  
      return ret_val;
  }
 +#endif  /*  0  */
  
 -int32_t
 +static int32_t
  e1000_init_lcd_from_nvm_config_region(struct e1000_hw *hw,
                                        uint32_t cnf_base_addr, uint32_t cnf_size)
  {
  }
  
  
 -int32_t
 +static int32_t
  e1000_init_lcd_from_nvm(struct e1000_hw *hw)
  {
      uint32_t reg_data, cnf_base_addr, cnf_size, ret_val, loop;
@@@ -36,7 -36,7 +36,7 @@@ static char e1000_driver_string[] = "In
  #else
  #define DRIVERNAPI "-NAPI"
  #endif
- #define DRV_VERSION "7.1.9-k4"DRIVERNAPI
+ #define DRV_VERSION "7.1.9-k6"DRIVERNAPI
  char e1000_driver_version[] = DRV_VERSION;
  static char e1000_copyright[] = "Copyright (c) 1999-2006 Intel Corporation.";
  
@@@ -48,7 -48,6 +48,6 @@@
   *   {PCI_DEVICE(PCI_VENDOR_ID_INTEL, device_id)}
   */
  static struct pci_device_id e1000_pci_tbl[] = {
-       INTEL_E1000_ETHERNET_DEVICE(0x1000),
        INTEL_E1000_ETHERNET_DEVICE(0x1001),
        INTEL_E1000_ETHERNET_DEVICE(0x1004),
        INTEL_E1000_ETHERNET_DEVICE(0x1008),
@@@ -245,7 -244,7 +244,7 @@@ e1000_init_module(void
  
        printk(KERN_INFO "%s\n", e1000_copyright);
  
 -      ret = pci_module_init(&e1000_driver);
 +      ret = pci_register_driver(&e1000_driver);
  
        return ret;
  }
@@@ -485,7 -484,7 +484,7 @@@ e1000_up(struct e1000_adapter *adapter
   *
   **/
  
static void e1000_power_up_phy(struct e1000_adapter *adapter)
+ void e1000_power_up_phy(struct e1000_adapter *adapter)
  {
        uint16_t mii_reg = 0;
  
@@@ -1499,8 -1498,6 +1498,6 @@@ e1000_configure_tx(struct e1000_adapte
        } else if (hw->mac_type == e1000_80003es2lan) {
                tarc = E1000_READ_REG(hw, TARC0);
                tarc |= 1;
-               if (hw->media_type == e1000_media_type_internal_serdes)
-                       tarc |= (1 << 20);
                E1000_WRITE_REG(hw, TARC0, tarc);
                tarc = E1000_READ_REG(hw, TARC1);
                tarc |= 1;
@@@ -2545,7 -2542,7 +2542,7 @@@ e1000_tso(struct e1000_adapter *adapter
                        cmd_length = E1000_TXD_CMD_IP;
                        ipcse = skb->h.raw - skb->data - 1;
  #ifdef NETIF_F_TSO_IPV6
-               } else if (skb->protocol == ntohs(ETH_P_IPV6)) {
+               } else if (skb->protocol == htons(ETH_P_IPV6)) {
                        skb->nh.ipv6h->payload_len = 0;
                        skb->h.th->check =
                                ~csum_ipv6_magic(&skb->nh.ipv6h->saddr,
@@@ -4386,13 -4383,11 +4383,13 @@@ e1000_write_pci_cfg(struct e1000_hw *hw
        pci_write_config_word(adapter->pdev, reg, *value);
  }
  
 +#if 0
  uint32_t
  e1000_io_read(struct e1000_hw *hw, unsigned long port)
  {
        return inl(port);
  }
 +#endif  /*  0  */
  
  void
  e1000_io_write(struct e1000_hw *hw, unsigned long port, uint32_t value)
@@@ -36,7 -36,7 +36,7 @@@ static char ixgb_driver_string[] = "Int
  #else
  #define DRIVERNAPI "-NAPI"
  #endif
- #define DRV_VERSION           "1.0.109-k2"DRIVERNAPI
+ #define DRV_VERSION           "1.0.109-k4"DRIVERNAPI
  char ixgb_driver_version[] = DRV_VERSION;
  static char ixgb_copyright[] = "Copyright (c) 1999-2006 Intel Corporation.";
  
@@@ -140,12 -140,12 +140,12 @@@ module_param(debug, int, 0)
  MODULE_PARM_DESC(debug, "Debug level (0=none,...,16=all)");
  
  /* some defines for controlling descriptor fetches in h/w */
- #define RXDCTL_WTHRESH_DEFAULT 16     /* chip writes back at this many or RXT0 */
- #define RXDCTL_PTHRESH_DEFAULT 0              /* chip considers prefech below
-                                                * this */
- #define RXDCTL_HTHRESH_DEFAULT 0              /* chip will only prefetch if tail
-                                                * is pushed this many descriptors
-                                                * from head */
+ #define RXDCTL_WTHRESH_DEFAULT 15  /* chip writes back at this many or RXT0 */
+ #define RXDCTL_PTHRESH_DEFAULT 0   /* chip considers prefech below
+                                     * this */
+ #define RXDCTL_HTHRESH_DEFAULT 0   /* chip will only prefetch if tail
+                                     * is pushed this many descriptors
+                                     * from head */
  
  /**
   * ixgb_init_module - Driver Registration Routine
@@@ -162,7 -162,7 +162,7 @@@ ixgb_init_module(void
  
        printk(KERN_INFO "%s\n", ixgb_copyright);
  
 -      return pci_module_init(&ixgb_driver);
 +      return pci_register_driver(&ixgb_driver);
  }
  
  module_init(ixgb_init_module);