e1000e: check WoL mode is among set of supported modes
Subsystems (2)
PATCH 1/23 e1000e: check WoL mode is among set of supported modes
From: Bruce Allan <[email protected]>
When setting WoL feature, check the supplied modes are all supported rather than checking for no support. This way, if any new modes are added the driver does not default to not complaining about it if we don't really support it.
---
drivers/net/e1000e/ethtool.c | 9 ++++----- 1 files changed, 4 insertions(+), 5 deletions(-)
drivers/net/e1000e/ethtool.c +4 -5
@@ -1777,12 +1777,11 @@ static int e1000_set_wol(struct net_device *netdev, {struct e1000_adapter *adapter =netdev_priv (netdev); -if (wol->wolopts &WAKE_MAGICSECURE ) -return -EOPNOTSUPP ; -if (!(adapter->flags &FLAG_HAS_WOL ) || - !device_can_wakeup (&adapter->pdev->dev)) -return wol->wolopts ? -EOPNOTSUPP :0 ; + !device_can_wakeup (&adapter->pdev->dev) || + (wol->wolopts & ~(WAKE_UCAST |WAKE_MCAST |WAKE_BCAST | +WAKE_MAGIC |WAKE_PHY |WAKE_ARP ))) +return -EOPNOTSUPP ;/* these settings will always override what we currently have */ adapter->wol =0 ;
PATCH 2/23 e1000e: add missing tests for 82583 in ethtool functions
From: Bruce Allan <[email protected]>
Add tests for 82583 in a couple ethtool functions that were missed from the initial hardware enablement submission.
---
drivers/net/e1000e/ethtool.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-)
drivers/net/e1000e/ethtool.c +4 -1
@@ -604,7 +604,9 @@ static int e1000_set_eeprom(struct net_device *netdev,* and flush shadow RAM for applicable controllers */ if ((first_word <=NVM_CHECKSUM_REG ) || - (hw->mac.type == e1000_82574) || (hw->mac.type == e1000_82573)) + (hw->mac.type == e1000_82583) || + (hw->mac.type == e1000_82574) || + (hw->mac.type == e1000_82573)) ret_val =e1000e_update_nvm_checksum (hw); out:
@@ -1839,6 +1841,7 @@ static int e1000_phys_id(struct net_device *netdev, u32 data)if ((hw->phy.type == e1000_phy_ife) || (hw->mac.type == e1000_pchlan) || + (hw->mac.type == e1000_82583) || (hw->mac.type == e1000_82574)) {INIT_WORK (&adapter->led_blink_task, e1000e_led_blink_task);if (!adapter->blink_timer.function) {
PATCH 3/23 e1000e: clearing interrupt timers causes descriptors to get flushed
In reply to Jeff KirsherFrom: Bruce Allan <[email protected]>
Clearing the interrupt timers following an IMS clear has the unwanted side-effect of flushing all descriptors immediately following a partial write when interrupts are disabled.
---
drivers/net/e1000e/netdev.c | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-)
drivers/net/e1000e/netdev.c +0 -2
@@ -2441,8 +2441,6 @@ static void e1000_configure_rx(struct e1000_adapter *adapter)ew32 (ITR ,1000000000 / (adapter->itr *256 )); ctrl_ext =er32 (CTRL_EXT ); -/* Reset delay timers after every interrupt */ - ctrl_ext |=E1000_CTRL_EXT_INT_TIMER_CLR ;/* Auto-Mask interrupts upon ICR access */ ctrl_ext |=E1000_CTRL_EXT_IAME ;ew32 (IAM ,0xffffffff );
PATCH 4/23 e1000e: function pointers for ethtool set/get offloads
In reply to Jeff KirsherFrom: Bruce Allan <[email protected]>
Provide missing function pointers for ethtool set/get offloads.
---
drivers/net/e1000e/ethtool.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/net/e1000e/ethtool.c +2 -0
@@ -1996,6 +1996,8 @@ static const struct ethtool_ops e1000_ethtool_ops = { .get_sset_count = e1000e_get_sset_count, .get_coalesce = e1000_get_coalesce, .set_coalesce = e1000_set_coalesce, + .get_flags = ethtool_op_get_flags, + .set_flags = ethtool_op_set_flags, };void e1000e_set_ethtool_ops (struct net_device *netdev)
PATCH 5/23 e1000e: don't clean Rx ring while resetting
In reply to Jeff KirsherFrom: Bruce Allan <[email protected]>
When using legacy interrupts, do not clean the Rx ring while resetting otherwise traffic will not pass.
---
drivers/net/e1000e/netdev.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/e1000e/netdev.c +1 -1
@@ -1176,7 +1176,7 @@ static irqreturn_t e1000_intr(int irq, void *data)struct e1000_hw *hw = &adapter->hw;u32 rctl, icr =er32 (ICR ); -if (!icr) +if (!icr ||test_bit (__E1000_DOWN, &adapter->state))return IRQ_NONE ;/* Not our interrupt */ /*
PATCH 6/23 e1000e: link reporting problems
In reply to Jeff KirsherFrom: Bruce Allan <[email protected]>
Copper links with WoL or management enabled (any condition which prevents the phy from being powered down when the interface is taken down) were always reporting link-up when the interface had been taken down. This is because when the interface is taken down (ifconfig ethx down), interrupts are disabled. With no interrupts, there is no LSC interrupt, which is normally required to set "get_link_status", which instructs the driver to query the device for link state. The fix is to force get_link_status to true if the interface is not up.
---
drivers/net/e1000e/ethtool.c | 11 +++++++++++ 1 files changed, 11 insertions(+), 0 deletions(-)
drivers/net/e1000e/ethtool.c +11 -0
@@ -190,6 +190,17 @@ static int e1000_get_settings(struct net_device *netdev,static u32 e1000_get_link (struct net_device *netdev) {struct e1000_adapter *adapter =netdev_priv (netdev); +struct e1000_mac_info *mac = &adapter->hw.mac; + +/* +* If the link is not reported up to netdev, interrupts are disabled, +* and so the physical link state may have changed since we last +* looked. Set get_link_status to make sure that the true link +* state is interrogated, rather than pulling a cached and possibly +* stale link state from the driver. +*/ +if (!netif_carrier_ok (netdev)) + mac->get_link_status =1 ;return e1000_has_link (adapter); }
PATCH 7/23 e1000e: improper return code signage
In reply to Jeff KirsherFrom: Bruce Allan <[email protected]>
The e1000_get_cable_length_82577() should return a negative value upon error.
---
drivers/net/e1000e/phy.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/e1000e/phy.c +1 -1
@@ -3137,7 +3137,7 @@ s32 e1000_get_cable_length_82577(struct e1000_hw *hw)I82577_DSTATUS_CABLE_LENGTH_SHIFT ;if (length ==E1000_CABLE_LENGTH_UNDEFINED ) - ret_val =E1000_ERR_PHY ; + ret_val = -E1000_ERR_PHY ; phy->cable_length = length;
PATCH 8/23 e1000e: disable K1 on PCH LOM when in PHY loopback mode
In reply to Jeff KirsherFrom: Bruce Allan <[email protected]>
When performing the ethtool PHY loopback test on PCH-based LOMs (82577 and 82578), disable K1 (a MAC-PHY interconnect low power mode) otherwise packets might get corrupted.
---
drivers/net/e1000e/e1000.h | 1 + drivers/net/e1000e/ethtool.c | 4 ++++ drivers/net/e1000e/ich8lan.c | 3 +-- 3 files changed, 6 insertions(+), 2 deletions(-)
drivers/net/e1000e/e1000.h +1 -0
@@ -485,6 +485,7 @@ extern void e1000e_set_kmrn_lock_loss_workaround_ich8lan(struct e1000_hw *hw,extern void e1000e_igp3_phy_powerdown_workaround_ich8lan (struct e1000_hw *hw);extern void e1000e_gig_downshift_workaround_ich8lan (struct e1000_hw *hw);extern void e1000e_disable_gig_wol_ich8lan (struct e1000_hw *hw); +extern s32 e1000_configure_k1_ich8lan (struct e1000_hw *hw,bool k1_enable);extern s32 e1000e_check_for_copper_link (struct e1000_hw *hw);extern s32 e1000e_check_for_fiber_link (struct e1000_hw *hw);
drivers/net/e1000e/ethtool.c +4 -0
@@ -1260,6 +1260,10 @@ static int e1000_integrated_phy_loopback(struct e1000_adapter *adapter) hw->mac.autoneg =0 ; +/* Workaround: K1 must be disabled for stable 1Gbps operation */ +if (hw->mac.type == e1000_pchlan) +e1000_configure_k1_ich8lan (hw, false); +if (hw->phy.type == e1000_phy_m88) {/* Auto-MDI/MDIX Off */ e1e_wphy (hw,M88E1000_PHY_SPEC_CTRL ,0x0808 );
drivers/net/e1000e/ich8lan.c +1 -2
@@ -224,7 +224,6 @@ static s32 e1000_led_off_pchlan(struct e1000_hw *hw);static s32 e1000_set_lplu_state_pchlan (struct e1000_hw *hw,bool active);static void e1000_lan_init_done_ich8lan (struct e1000_hw *hw);static s32 e1000_k1_gig_workaround_hv (struct e1000_hw *hw,bool link); -static s32 e1000_configure_k1_ich8lan (struct e1000_hw *hw,bool k1_enable);static inline u16 __er16flash (struct e1000_hw *hw,unsigned long reg) {
@@ -1023,7 +1022,7 @@ out:* * Success returns 0, Failure returns -E1000_ERR_PHY (-2) **/ -static s32 e1000_configure_k1_ich8lan (struct e1000_hw *hw,bool k1_enable) +s32 e1000_configure_k1_ich8lan (struct e1000_hw *hw,bool k1_enable) {s32 ret_val =0 ;u32 ctrl_reg =0 ;
PATCH 9/23 e1000e: Incorrect MII Link beat reporting.
In reply to Jeff KirsherFrom: Bruce Allan <[email protected]>
The driver was only updating MII stats when an LSC up was detected and the interface had not already been reported up to netdev. This meant MII stats returned in response to an SIOCGMIIREG ioctl would always show a link up if it had ever been up. This was misleading the networking daemon guessnet, which uses this ioctl, into making improper network port selections.
This fix adds a call to e1000_phy_read_status() to actively read the mii stats before responding to the SIOCGMIIREG ioctl.
---
drivers/net/e1000e/netdev.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/net/e1000e/netdev.c +2 -0
@@ -4320,6 +4320,8 @@ static int e1000_mii_ioctl(struct net_device *netdev, struct ifreq *ifr, data->phy_id = adapter->hw.phy.addr;break ;case SIOCGMIIREG : +e1000_phy_read_status (adapter); +switch (data->reg_num &0x1F ) {case MII_BMCR : data->val_out = adapter->phy_regs.bmcr;
PATCH 10/23 e1000e: cleanup redundant #include's
In reply to Jeff KirsherFrom: Bruce Allan <[email protected]>
---
drivers/net/e1000e/82571.c | 4 ---- drivers/net/e1000e/e1000.h | 1 + drivers/net/e1000e/es2lan.c | 5 ----- drivers/net/e1000e/ich8lan.c | 5 ----- drivers/net/e1000e/lib.c | 5 ----- 5 files changed, 1 insertions(+), 19 deletions(-)
drivers/net/e1000e/82571.c +0 -4
@@ -43,10 +43,6 @@* 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
drivers/net/e1000e/e1000.h +1 -0
@@ -36,6 +36,7 @@#include <linux/workqueue.h> #include <linux/io.h> #include <linux/netdevice.h> +#include <linux/pci.h> #include "hw.h"
drivers/net/e1000e/es2lan.c +0 -5
@@ -31,11 +31,6 @@* 80003ES2LAN Gigabit Ethernet Controller (Serdes) */ -#include <linux/netdevice.h> -#include <linux/ethtool.h> -#include <linux/delay.h> -#include <linux/pci.h> -#include "e1000.h" #define E1000_KMRNCTRLSTA_OFFSET_FIFO_CTRL 0x00
drivers/net/e1000e/ich8lan.c +0 -5
@@ -54,11 +54,6 @@* 82578DC Gigabit Network Connection */ -#include <linux/netdevice.h> -#include <linux/ethtool.h> -#include <linux/delay.h> -#include <linux/pci.h> -#include "e1000.h" #define ICH_FLASH_GFPREG 0x0000
drivers/net/e1000e/lib.c +0 -5
@@ -26,11 +26,6 @@*******************************************************************************/ -#include <linux/netdevice.h> -#include <linux/ethtool.h> -#include <linux/delay.h> -#include <linux/pci.h> -#include "e1000.h" enum e1000_mng_mode {
PATCH 11/23 e1000e: consolidate two dbug macros into one simpler one
In reply to Jeff KirsherFrom: Bruce Allan <[email protected]>
This patch depends on a previous one that cleans up redundant #includes.
---
drivers/net/e1000e/82571.c | 40 +++++++------- drivers/net/e1000e/e1000.h | 4 + drivers/net/e1000e/es2lan.c | 23 ++++---- drivers/net/e1000e/hw.h | 11 ---- drivers/net/e1000e/ich8lan.c | 69 ++++++++++++------------ drivers/net/e1000e/lib.c | 122 +++++++++++++++++++++--------------------- drivers/net/e1000e/netdev.c | 28 +++------- drivers/net/e1000e/phy.c | 92 ++++++++++++++++---------------- 8 files changed, 183 insertions(+), 206 deletions(-)
drivers/net/e1000e/82571.c +20 -20
@@ -309,7 +309,7 @@ static s32 e1000_init_mac_params_82571(struct e1000_adapter *adapter)* indicates that the bootagent or EFI code has * improperly left this bit enabled */ -hw_dbg (hw,"Please update your 82571 Bootagent\n" ); +e_dbg ("Please update your 82571 Bootagent\n" ); }ew32 (SWSM , swsm & ~E1000_SWSM_SMBI ); }
@@ -483,7 +483,7 @@ static s32 e1000_get_hw_semaphore_82571(struct e1000_hw *hw) }if (i == sw_timeout) { -hw_dbg (hw,"Driver can't access device - SMBI bit is set.\n" ); +e_dbg ("Driver can't access device - SMBI bit is set.\n" ); hw->dev_spec.e82571.smb_counter++; }/* Get the FW semaphore. */
@@ -501,7 +501,7 @@ static s32 e1000_get_hw_semaphore_82571(struct e1000_hw *hw)if (i == fw_timeout) {/* Release semaphores */ e1000_put_hw_semaphore_82571 (hw); -hw_dbg (hw,"Driver can't access the NVM\n" ); +e_dbg ("Driver can't access the NVM\n" );return -E1000_ERR_NVM ; }
@@ -708,7 +708,7 @@ static s32 e1000_write_nvm_eewr_82571(struct e1000_hw *hw, u16 offset,*/ if ((offset >= nvm->word_size) || (words > (nvm->word_size - offset)) || (words ==0 )) { -hw_dbg (hw,"nvm parameter(s) out of bounds\n" ); +e_dbg ("nvm parameter(s) out of bounds\n" );return -E1000_ERR_NVM ; }
@@ -749,7 +749,7 @@ static s32 e1000_get_cfg_done_82571(struct e1000_hw *hw) timeout--; }if (!timeout) { -hw_dbg (hw,"MNG configuration cycle has not completed.\n" ); +e_dbg ("MNG configuration cycle has not completed.\n" );return -E1000_ERR_RESET ; }
@@ -848,9 +848,9 @@ static s32 e1000_reset_hw_82571(struct e1000_hw *hw)*/ ret_val =e1000e_disable_pcie_master (hw);if (ret_val) -hw_dbg (hw,"PCI-E Master disable polling has failed.\n" ); +e_dbg ("PCI-E Master disable polling has failed.\n" ); -hw_dbg (hw,"Masking off all interrupts\n" ); +e_dbg ("Masking off all interrupts\n" );ew32 (IMC ,0xffffffff );ew32 (RCTL ,0 );
@@ -889,7 +889,7 @@ static s32 e1000_reset_hw_82571(struct e1000_hw *hw) ctrl =er32 (CTRL ); -hw_dbg (hw,"Issuing a global reset to MAC\n" ); +e_dbg ("Issuing a global reset to MAC\n" );ew32 (CTRL , ctrl |E1000_CTRL_RST );if (hw->nvm.type == e1000_nvm_flash_hw) {
@@ -955,12 +955,12 @@ static s32 e1000_init_hw_82571(struct e1000_hw *hw)/* Initialize identification LED */ ret_val =e1000e_id_led_init (hw);if (ret_val) { -hw_dbg (hw,"Error initializing identification LED\n" ); +e_dbg ("Error initializing identification LED\n" );return ret_val; }/* Disabling VLAN filtering */ -hw_dbg (hw,"Initializing the IEEE VLAN\n" ); +e_dbg ("Initializing the IEEE VLAN\n" );e1000e_clear_vfta (hw);/* Setup the receive address. */
@@ -974,7 +974,7 @@ static s32 e1000_init_hw_82571(struct e1000_hw *hw)e1000e_init_rx_addrs (hw, rar_count);/* Zero out the Multicast HASH table */ -hw_dbg (hw,"Zeroing the MTA\n" ); +e_dbg ("Zeroing the MTA\n" );for (i =0 ; i < mac->mta_reg_count; i++)E1000_WRITE_REG_ARRAY (hw,E1000_MTA , i,0 );
@@ -1383,7 +1383,7 @@ static s32 e1000_check_for_serdes_link_82571(struct e1000_hw *hw)*/ mac->serdes_link_state = e1000_serdes_link_autoneg_progress; -hw_dbg (hw,"AN_UP -> AN_PROG\n" ); +e_dbg ("AN_UP -> AN_PROG\n" ); }break ;
@@ -1401,7 +1401,7 @@ static s32 e1000_check_for_serdes_link_82571(struct e1000_hw *hw) (ctrl & ~E1000_CTRL_SLU)); mac->serdes_link_state = e1000_serdes_link_autoneg_progress; -hw_dbg (hw,"FORCED_UP -> AN_PROG\n" ); +e_dbg ("FORCED_UP -> AN_PROG\n" ); }break ;
@@ -1415,7 +1415,7 @@ static s32 e1000_check_for_serdes_link_82571(struct e1000_hw *hw)if (status &E1000_STATUS_LU ) { mac->serdes_link_state = e1000_serdes_link_autoneg_complete; -hw_dbg (hw,"AN_PROG -> AN_UP\n" ); +e_dbg ("AN_PROG -> AN_UP\n" ); }else {/* * Disable autoneg, force link up and
@@ -1430,12 +1430,12 @@ static s32 e1000_check_for_serdes_link_82571(struct e1000_hw *hw) ret_val =e1000e_config_fc_after_link_up (hw);if (ret_val) { -hw_dbg (hw,"Error config flow control\n" ); +e_dbg ("Error config flow control\n" );break ; } mac->serdes_link_state = e1000_serdes_link_forced_up; -hw_dbg (hw,"AN_PROG -> FORCED_UP\n" ); +e_dbg ("AN_PROG -> FORCED_UP\n" ); } mac->serdes_has_link = true;break ;
@@ -1450,14 +1450,14 @@ static s32 e1000_check_for_serdes_link_82571(struct e1000_hw *hw) (ctrl & ~E1000_CTRL_SLU)); mac->serdes_link_state = e1000_serdes_link_autoneg_progress; -hw_dbg (hw,"DOWN -> AN_PROG\n" ); +e_dbg ("DOWN -> AN_PROG\n" );break ; } }else {if (!(rxcw &E1000_RXCW_SYNCH )) { mac->serdes_has_link = false; mac->serdes_link_state = e1000_serdes_link_down; -hw_dbg (hw,"ANYSTATE -> DOWN\n" ); +e_dbg ("ANYSTATE -> DOWN\n" ); }else {/* * We have sync, and can tolerate one
@@ -1469,7 +1469,7 @@ static s32 e1000_check_for_serdes_link_82571(struct e1000_hw *hw)if (rxcw &E1000_RXCW_IV ) { mac->serdes_link_state = e1000_serdes_link_down; mac->serdes_has_link = false; -hw_dbg (hw,"ANYSTATE -> DOWN\n" ); +e_dbg ("ANYSTATE -> DOWN\n" ); } } }
@@ -1491,7 +1491,7 @@ static s32 e1000_valid_led_default_82571(struct e1000_hw *hw, u16 *data) ret_val =e1000_read_nvm (hw,NVM_ID_LED_SETTINGS ,1 , data);if (ret_val) { -hw_dbg (hw,"NVM Read Error\n" ); +e_dbg ("NVM Read Error\n" );return ret_val; }
drivers/net/e1000e/e1000.h +2 -2
@@ -48,9 +48,9 @@ struct e1000_info;#ifdef DEBUG #define e_dbg(format, arg...) \ - e_printk(KERN_DEBUG , adapter, format, ## arg) + e_printk(KERN_DEBUG , hw->adapter, format, ## arg)#else -#define e_dbg(format, arg...) do { (void)(adapter); } while (0) +#define e_dbg(format, arg...) do { (void)(hw); } while (0)#endif #define e_err(format, arg...) \
drivers/net/e1000e/es2lan.c +11 -12
@@ -394,8 +394,7 @@ static s32 e1000_acquire_swfw_sync_80003es2lan(struct e1000_hw *hw, u16 mask) }if (i == timeout) { -hw_dbg (hw, -"Driver can't access resource, SW_FW_SYNC timeout.\n" ); +e_dbg ("Driver can't access resource, SW_FW_SYNC timeout.\n" );return -E1000_ERR_SWFW_SYNC ; }
@@ -597,7 +596,7 @@ static s32 e1000_get_cfg_done_80003es2lan(struct e1000_hw *hw) timeout--; }if (!timeout) { -hw_dbg (hw,"MNG configuration cycle has not completed.\n" ); +e_dbg ("MNG configuration cycle has not completed.\n" );return -E1000_ERR_RESET ; }
@@ -630,7 +629,7 @@ static s32 e1000_phy_force_speed_duplex_80003es2lan(struct e1000_hw *hw)if (ret_val)return ret_val; -hw_dbg (hw,"GG82563 PSCR: %X\n" , phy_data); +e_dbg ("GG82563 PSCR: %X\n" , phy_data); ret_val =e1e_rphy (hw,PHY_CONTROL , &phy_data);if (ret_val)
@@ -648,7 +647,7 @@ static s32 e1000_phy_force_speed_duplex_80003es2lan(struct e1000_hw *hw)udelay (1 );if (hw->phy.autoneg_wait_to_complete) { -hw_dbg (hw,"Waiting for forced speed/duplex link " +e_dbg ("Waiting for forced speed/duplex link " "on GG82563 phy.\n" ); ret_val = e1000e_phy_has_link_generic(hw, PHY_FORCE_LIMIT,
@@ -771,9 +770,9 @@ static s32 e1000_reset_hw_80003es2lan(struct e1000_hw *hw)*/ ret_val =e1000e_disable_pcie_master (hw);if (ret_val) -hw_dbg (hw,"PCI-E Master disable polling has failed.\n" ); +e_dbg ("PCI-E Master disable polling has failed.\n" ); -hw_dbg (hw,"Masking off all interrupts\n" ); +e_dbg ("Masking off all interrupts\n" );ew32 (IMC ,0xffffffff );ew32 (RCTL ,0 );
@@ -785,7 +784,7 @@ static s32 e1000_reset_hw_80003es2lan(struct e1000_hw *hw) ctrl =er32 (CTRL ); ret_val =e1000_acquire_phy_80003es2lan (hw); -hw_dbg (hw,"Issuing a global reset to MAC\n" ); +e_dbg ("Issuing a global reset to MAC\n" );ew32 (CTRL , ctrl |E1000_CTRL_RST );e1000_release_phy_80003es2lan (hw);
@@ -820,19 +819,19 @@ static s32 e1000_init_hw_80003es2lan(struct e1000_hw *hw)/* Initialize identification LED */ ret_val =e1000e_id_led_init (hw);if (ret_val) { -hw_dbg (hw,"Error initializing identification LED\n" ); +e_dbg ("Error initializing identification LED\n" );return ret_val; }/* Disabling VLAN filtering */ -hw_dbg (hw,"Initializing the IEEE VLAN\n" ); +e_dbg ("Initializing the IEEE VLAN\n" );e1000e_clear_vfta (hw);/* Setup the receive address. */ e1000e_init_rx_addrs (hw, mac->rar_entry_count);/* Zero out the Multicast HASH table */ -hw_dbg (hw,"Zeroing the MTA\n" ); +e_dbg ("Zeroing the MTA\n" );for (i =0 ; i < mac->mta_reg_count; i++)E1000_WRITE_REG_ARRAY (hw,E1000_MTA , i,0 );
@@ -989,7 +988,7 @@ static s32 e1000_copper_link_setup_gg82563_80003es2lan(struct e1000_hw *hw)/* SW Reset the PHY so all changes take effect */ ret_val =e1000e_commit_phy (hw);if (ret_val) { -hw_dbg (hw,"Error Resetting the PHY\n" ); +e_dbg ("Error Resetting the PHY\n" );return ret_val; }
drivers/net/e1000e/hw.h +0 -11
@@ -925,15 +925,4 @@ struct e1000_hw { } dev_spec; }; -#ifdef DEBUG -#define hw_dbg(hw, format, arg...) \ - printk(KERN_DEBUG "%s: " format, e1000e_get_hw_dev_name(hw), ##arg) -#else -static inline int __attribute__ ((format (printf,2 ,3 ))) -hw_dbg (struct e1000_hw *hw,const char *format, ...) -{ -return 0 ; -} -#endif -#endif
drivers/net/e1000e/ich8lan.c +34 -35
267 lines not on this page · raw message
drivers/net/e1000e/lib.c +61 -61
456 lines not on this page · raw message
drivers/net/e1000e/netdev.c +9 -19
@@ -65,17 +65,6 @@ static const struct e1000_info *e1000_info_tbl[] = { [board_pchlan] = &e1000_pch_info, }; -#ifdef DEBUG -/** -* e1000_get_hw_dev_name - return device name string -* used by hardware layer to print debugging information -**/ -char *e1000e_get_hw_dev_name (struct e1000_hw *hw) -{ -return hw->adapter->netdev->name; -} -#endif -/** * e1000_desc_unused - calculate if we have unused descriptors **/
@@ -415,6 +404,7 @@ static bool e1000_clean_rx_irq(struct e1000_adapter *adapter, {struct net_device *netdev = adapter->netdev;struct pci_dev *pdev = adapter->pdev; +struct e1000_hw *hw = &adapter->hw;struct e1000_ring *rx_ring = adapter->rx_ring;struct e1000_rx_desc *rx_desc, *next_rxd;struct e1000_buffer *buffer_info, *next_buffer;
@@ -464,8 +454,7 @@ static bool e1000_clean_rx_irq(struct e1000_adapter *adapter,* packet, also make sure the frame isn't just CRC only */ if (!(status &E1000_RXD_STAT_EOP ) || (length <=4 )) {/* All receives must fit into a single buffer */ -e_dbg ("%s: Receive packet consumed multiple buffers\n" , - netdev->name); +e_dbg ("Receive packet consumed multiple buffers\n" );/* recycle */ buffer_info->skb = skb; goto next_desc;
@@ -682,6 +671,7 @@ static bool e1000_clean_tx_irq(struct e1000_adapter *adapter)static bool e1000_clean_rx_irq_ps (struct e1000_adapter *adapter,int *work_done,int work_to_do) { +struct e1000_hw *hw = &adapter->hw;union e1000_rx_desc_packet_split *rx_desc, *next_rxd;struct net_device *netdev = adapter->netdev;struct pci_dev *pdev = adapter->pdev;
@@ -725,8 +715,8 @@ static bool e1000_clean_rx_irq_ps(struct e1000_adapter *adapter, buffer_info->dma =0 ;if (!(staterr &E1000_RXD_STAT_EOP )) { -e_dbg ("%s: Packet Split buffers didn't pick up the " -"full packet\n" , netdev->name); +e_dbg ("Packet Split buffers didn't pick up the full " +"packet\n" );dev_kfree_skb_irq (skb); goto next_desc; }
@@ -739,8 +729,8 @@ static bool e1000_clean_rx_irq_ps(struct e1000_adapter *adapter, length =le16_to_cpu (rx_desc->wb.middle.length0);if (!length) { -e_dbg ("%s: Last part of the packet spanning multiple " -"descriptors\n" , netdev->name); +e_dbg ("Last part of the packet spanning multiple " +"descriptors\n" );dev_kfree_skb_irq (skb); goto next_desc; }
@@ -2931,7 +2921,7 @@ static irqreturn_t e1000_intr_msi_test(int irq, void *data)struct e1000_hw *hw = &adapter->hw;u32 icr =er32 (ICR ); -e_dbg ("%s: icr is %08X\n" , netdev->name, icr); +e_dbg ("icr is %08X\n" , icr);if (icr &E1000_ICR_RXSEQ ) { adapter->flags &= ~FLAG_MSI_TEST_FAILED ;wmb ();
@@ -3001,7 +2991,7 @@ static int e1000_test_msi_interrupt(struct e1000_adapter *adapter) goto msi_test_failed;/* okay so the test worked, restore settings */ -e_dbg ("%s: MSI interrupt test succeeded!\n" , netdev->name); +e_dbg ("MSI interrupt test succeeded!\n" ); msi_test_failed:e1000e_set_interrupt_capability (adapter);e1000_request_irq (adapter);
drivers/net/e1000e/phy.c +46 -46
328 lines not on this page · raw message
PATCH 12/23 e1000e: cleanup ops function pointers
In reply to Jeff KirsherFrom: Bruce Allan <[email protected]>
The phy and nvm operations structures have function pointers that contain "phy" and "nvm" in the pointer names which are redundant since the structures are already obviously in phy and nvm structures.
---
drivers/net/e1000e/82571.c | 54 +++++++-------- drivers/net/e1000e/e1000.h | 16 ++-- drivers/net/e1000e/es2lan.c | 26 ++++--- drivers/net/e1000e/hw.h | 32 ++++----- drivers/net/e1000e/ich8lan.c | 156 +++++++++++++++++++++--------------------- drivers/net/e1000e/lib.c | 6 +- drivers/net/e1000e/netdev.c | 4 + drivers/net/e1000e/phy.c | 110 +++++++++++++++--------------- 8 files changed, 201 insertions(+), 203 deletions(-)
drivers/net/e1000e/82571.c +27 -27
@@ -1671,64 +1671,64 @@ static struct e1000_mac_operations e82571_mac_ops = { };static struct e1000_phy_operations e82_phy_ops_igp = { - .acquire_phy = e1000_get_hw_semaphore_82571, + .acquire = e1000_get_hw_semaphore_82571, .check_reset_block = e1000e_check_reset_block_generic, - .commit_phy =NULL , + .commit =NULL , .force_speed_duplex = e1000e_phy_force_speed_duplex_igp, .get_cfg_done = e1000_get_cfg_done_82571, .get_cable_length = e1000e_get_cable_length_igp_2, - .get_phy_info = e1000e_get_phy_info_igp, - .read_phy_reg = e1000e_read_phy_reg_igp, - .release_phy = e1000_put_hw_semaphore_82571, - .reset_phy = e1000e_phy_hw_reset_generic, + .get_info = e1000e_get_phy_info_igp, + .read_reg = e1000e_read_phy_reg_igp, + .release = e1000_put_hw_semaphore_82571, + .reset = e1000e_phy_hw_reset_generic, .set_d0_lplu_state = e1000_set_d0_lplu_state_82571, .set_d3_lplu_state = e1000e_set_d3_lplu_state, - .write_phy_reg = e1000e_write_phy_reg_igp, + .write_reg = e1000e_write_phy_reg_igp, .cfg_on_link_up =NULL , };static struct e1000_phy_operations e82_phy_ops_m88 = { - .acquire_phy = e1000_get_hw_semaphore_82571, + .acquire = e1000_get_hw_semaphore_82571, .check_reset_block = e1000e_check_reset_block_generic, - .commit_phy = e1000e_phy_sw_reset, + .commit = e1000e_phy_sw_reset, .force_speed_duplex = e1000e_phy_force_speed_duplex_m88, .get_cfg_done = e1000e_get_cfg_done, .get_cable_length = e1000e_get_cable_length_m88, - .get_phy_info = e1000e_get_phy_info_m88, - .read_phy_reg = e1000e_read_phy_reg_m88, - .release_phy = e1000_put_hw_semaphore_82571, - .reset_phy = e1000e_phy_hw_reset_generic, + .get_info = e1000e_get_phy_info_m88, + .read_reg = e1000e_read_phy_reg_m88, + .release = e1000_put_hw_semaphore_82571, + .reset = e1000e_phy_hw_reset_generic, .set_d0_lplu_state = e1000_set_d0_lplu_state_82571, .set_d3_lplu_state = e1000e_set_d3_lplu_state, - .write_phy_reg = e1000e_write_phy_reg_m88, + .write_reg = e1000e_write_phy_reg_m88, .cfg_on_link_up =NULL , };static struct e1000_phy_operations e82_phy_ops_bm = { - .acquire_phy = e1000_get_hw_semaphore_82571, + .acquire = e1000_get_hw_semaphore_82571, .check_reset_block = e1000e_check_reset_block_generic, - .commit_phy = e1000e_phy_sw_reset, + .commit = e1000e_phy_sw_reset, .force_speed_duplex = e1000e_phy_force_speed_duplex_m88, .get_cfg_done = e1000e_get_cfg_done, .get_cable_length = e1000e_get_cable_length_m88, - .get_phy_info = e1000e_get_phy_info_m88, - .read_phy_reg = e1000e_read_phy_reg_bm2, - .release_phy = e1000_put_hw_semaphore_82571, - .reset_phy = e1000e_phy_hw_reset_generic, + .get_info = e1000e_get_phy_info_m88, + .read_reg = e1000e_read_phy_reg_bm2, + .release = e1000_put_hw_semaphore_82571, + .reset = e1000e_phy_hw_reset_generic, .set_d0_lplu_state = e1000_set_d0_lplu_state_82571, .set_d3_lplu_state = e1000e_set_d3_lplu_state, - .write_phy_reg = e1000e_write_phy_reg_bm2, + .write_reg = e1000e_write_phy_reg_bm2, .cfg_on_link_up =NULL , };static struct e1000_nvm_operations e82571_nvm_ops = { - .acquire_nvm = e1000_acquire_nvm_82571, - .read_nvm = e1000e_read_nvm_eerd, - .release_nvm = e1000_release_nvm_82571, - .update_nvm = e1000_update_nvm_checksum_82571, + .acquire = e1000_acquire_nvm_82571, + .read = e1000e_read_nvm_eerd, + .release = e1000_release_nvm_82571, + .update = e1000_update_nvm_checksum_82571, .valid_led_default = e1000_valid_led_default_82571, - .validate_nvm = e1000_validate_nvm_checksum_82571, - .write_nvm = e1000_write_nvm_82571, + .validate = e1000_validate_nvm_checksum_82571, + .write = e1000_write_nvm_82571, };struct e1000_info e1000_82571_info = {
drivers/net/e1000e/e1000.h +8 -8
@@ -584,7 +584,7 @@ extern s32 e1000_get_cable_length_82577(struct e1000_hw *hw);static inline s32 e1000_phy_hw_reset (struct e1000_hw *hw) { -return hw->phy.ops.reset_phy (hw); +return hw->phy.ops.reset (hw); }static inline s32 e1000_check_reset_block (struct e1000_hw *hw)
@@ -594,12 +594,12 @@ static inline s32 e1000_check_reset_block(struct e1000_hw *hw)static inline s32 e1e_rphy (struct e1000_hw *hw,u32 offset,u16 *data) { -return hw->phy.ops.read_phy_reg (hw, offset, data); +return hw->phy.ops.read_reg (hw, offset, data); }static inline s32 e1e_wphy (struct e1000_hw *hw,u32 offset,u16 data) { -return hw->phy.ops.write_phy_reg (hw, offset, data); +return hw->phy.ops.write_reg (hw, offset, data); }static inline s32 e1000_get_cable_length (struct e1000_hw *hw)
@@ -619,27 +619,27 @@ extern s32 e1000e_read_mac_addr(struct e1000_hw *hw);static inline s32 e1000_validate_nvm_checksum (struct e1000_hw *hw) { -return hw->nvm.ops.validate_nvm (hw); +return hw->nvm.ops.validate (hw); }static inline s32 e1000e_update_nvm_checksum (struct e1000_hw *hw) { -return hw->nvm.ops.update_nvm (hw); +return hw->nvm.ops.update (hw); }static inline s32 e1000_read_nvm (struct e1000_hw *hw,u16 offset,u16 words,u16 *data) { -return hw->nvm.ops.read_nvm (hw, offset, words, data); +return hw->nvm.ops.read (hw, offset, words, data); }static inline s32 e1000_write_nvm (struct e1000_hw *hw,u16 offset,u16 words,u16 *data) { -return hw->nvm.ops.write_nvm (hw, offset, words, data); +return hw->nvm.ops.write (hw, offset, words, data); }static inline s32 e1000_get_phy_info (struct e1000_hw *hw) { -return hw->phy.ops.get_phy_info (hw); +return hw->phy.ops.get_info (hw); }static inline s32 e1000e_check_mng_mode (struct e1000_hw *hw)
drivers/net/e1000e/es2lan.c +13 -13
@@ -1378,30 +1378,30 @@ static struct e1000_mac_operations es2_mac_ops = { };static struct e1000_phy_operations es2_phy_ops = { - .acquire_phy = e1000_acquire_phy_80003es2lan, + .acquire = e1000_acquire_phy_80003es2lan, .check_reset_block = e1000e_check_reset_block_generic, - .commit_phy = e1000e_phy_sw_reset, + .commit = e1000e_phy_sw_reset, .force_speed_duplex = e1000_phy_force_speed_duplex_80003es2lan, .get_cfg_done = e1000_get_cfg_done_80003es2lan, .get_cable_length = e1000_get_cable_length_80003es2lan, - .get_phy_info = e1000e_get_phy_info_m88, - .read_phy_reg = e1000_read_phy_reg_gg82563_80003es2lan, - .release_phy = e1000_release_phy_80003es2lan, - .reset_phy = e1000e_phy_hw_reset_generic, + .get_info = e1000e_get_phy_info_m88, + .read_reg = e1000_read_phy_reg_gg82563_80003es2lan, + .release = e1000_release_phy_80003es2lan, + .reset = e1000e_phy_hw_reset_generic, .set_d0_lplu_state =NULL , .set_d3_lplu_state = e1000e_set_d3_lplu_state, - .write_phy_reg = e1000_write_phy_reg_gg82563_80003es2lan, + .write_reg = e1000_write_phy_reg_gg82563_80003es2lan, .cfg_on_link_up = e1000_cfg_on_link_up_80003es2lan, };static struct e1000_nvm_operations es2_nvm_ops = { - .acquire_nvm = e1000_acquire_nvm_80003es2lan, - .read_nvm = e1000e_read_nvm_eerd, - .release_nvm = e1000_release_nvm_80003es2lan, - .update_nvm = e1000e_update_nvm_checksum_generic, + .acquire = e1000_acquire_nvm_80003es2lan, + .read = e1000e_read_nvm_eerd, + .release = e1000_release_nvm_80003es2lan, + .update = e1000e_update_nvm_checksum_generic, .valid_led_default = e1000e_valid_led_default, - .validate_nvm = e1000e_validate_nvm_checksum_generic, - .write_nvm = e1000_write_nvm_80003es2lan, + .validate = e1000e_validate_nvm_checksum_generic, + .write = e1000_write_nvm_80003es2lan, };struct e1000_info e1000_es2_info = {
drivers/net/e1000e/hw.h +16 -16
@@ -755,34 +755,34 @@ struct e1000_mac_operations {/* Function pointers for the PHY. */ struct e1000_phy_operations { -s32 (*acquire_phy)(struct e1000_hw *); +s32 (*acquire)(struct e1000_hw *); +s32 (*cfg_on_link_up)(struct e1000_hw *);s32 (*check_polarity)(struct e1000_hw *);s32 (*check_reset_block)(struct e1000_hw *); -s32 (*commit_phy)(struct e1000_hw *); +s32 (*commit)(struct e1000_hw *);s32 (*force_speed_duplex)(struct e1000_hw *);s32 (*get_cfg_done)(struct e1000_hw *hw);s32 (*get_cable_length)(struct e1000_hw *); -s32 (*get_phy_info)(struct e1000_hw *); -s32 (*read_phy_reg)(struct e1000_hw *,u32 ,u16 *); -s32 (*read_phy_reg_locked)(struct e1000_hw *,u32 ,u16 *); -void (*release_phy)(struct e1000_hw *); -s32 (*reset_phy)(struct e1000_hw *); +s32 (*get_info)(struct e1000_hw *); +s32 (*read_reg)(struct e1000_hw *,u32 ,u16 *); +s32 (*read_reg_locked)(struct e1000_hw *,u32 ,u16 *); +void (*release)(struct e1000_hw *); +s32 (*reset)(struct e1000_hw *);s32 (*set_d0_lplu_state)(struct e1000_hw *,bool );s32 (*set_d3_lplu_state)(struct e1000_hw *,bool ); -s32 (*write_phy_reg)(struct e1000_hw *,u32 ,u16 ); -s32 (*write_phy_reg_locked)(struct e1000_hw *,u32 ,u16 ); -s32 (*cfg_on_link_up)(struct e1000_hw *); +s32 (*write_reg)(struct e1000_hw *,u32 ,u16 ); +s32 (*write_reg_locked)(struct e1000_hw *,u32 ,u16 ); };/* Function pointers for the NVM. */ struct e1000_nvm_operations { -s32 (*acquire_nvm)(struct e1000_hw *); -s32 (*read_nvm)(struct e1000_hw *,u16 ,u16 ,u16 *); -void (*release_nvm)(struct e1000_hw *); -s32 (*update_nvm)(struct e1000_hw *); +s32 (*acquire)(struct e1000_hw *); +s32 (*read)(struct e1000_hw *,u16 ,u16 ,u16 *); +void (*release)(struct e1000_hw *); +s32 (*update)(struct e1000_hw *);s32 (*valid_led_default)(struct e1000_hw *,u16 *); -s32 (*validate_nvm)(struct e1000_hw *); -s32 (*write_nvm)(struct e1000_hw *,u16 ,u16 ,u16 *); +s32 (*validate)(struct e1000_hw *); +s32 (*write)(struct e1000_hw *,u16 ,u16 ,u16 *); };struct e1000_mac_info {
drivers/net/e1000e/ich8lan.c +77 -79
428 lines not on this page · raw message
drivers/net/e1000e/lib.c +3 -3
@@ -1985,7 +1985,7 @@ s32 e1000e_write_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data)return -E1000_ERR_NVM ; } - ret_val = nvm->ops.acquire_nvm (hw); + ret_val = nvm->ops.acquire (hw);if (ret_val)return ret_val;
@@ -1996,7 +1996,7 @@ s32 e1000e_write_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data) ret_val =e1000_ready_nvm_eeprom (hw);if (ret_val) { - nvm->ops.release_nvm (hw); + nvm->ops.release (hw);return ret_val; }
@@ -2035,7 +2035,7 @@ s32 e1000e_write_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data) }msleep (10 ); - nvm->ops.release_nvm (hw); + nvm->ops.release (hw);return 0 ; }
drivers/net/e1000e/netdev.c +2 -2
@@ -4419,7 +4419,7 @@ static int e1000_init_phy_wakeup(struct e1000_adapter *adapter, u32 wufc)e1e_wphy (&adapter->hw,BM_WUC ,E1000_WUC_PME_EN );/* activate PHY wakeup */ - retval = hw->phy.ops.acquire_phy (hw); + retval = hw->phy.ops.acquire (hw);if (retval) {e_err ("Could not acquire PHY\n" );return retval;
@@ -4436,7 +4436,7 @@ static int e1000_init_phy_wakeup(struct e1000_adapter *adapter, u32 wufc)if (retval)e_err ("Could not set PHY Host Wakeup bit\n" ); out: - hw->phy.ops.release_phy (hw); + hw->phy.ops.release (hw);return retval; }
drivers/net/e1000e/phy.c +55 -55
405 lines not on this page · raw message
PATCH 13/23 e1000e: update copyright information
In reply to Jeff KirsherFrom: Bruce Allan <[email protected]>
---
drivers/net/e1000e/82571.c | 2 +- drivers/net/e1000e/defines.h | 2 +- drivers/net/e1000e/e1000.h | 2 +- drivers/net/e1000e/es2lan.c | 2 +- drivers/net/e1000e/ethtool.c | 2 +- drivers/net/e1000e/hw.h | 2 +- drivers/net/e1000e/ich8lan.c | 2 +- drivers/net/e1000e/lib.c | 2 +- drivers/net/e1000e/netdev.c | 4 ++-- drivers/net/e1000e/param.c | 2 +- drivers/net/e1000e/phy.c | 2 +- 11 files changed, 12 insertions(+), 12 deletions(-)
drivers/net/e1000e/82571.c +1 -1
@@ -1,7 +1,7 @@/******************************************************************************* Intel PRO/1000 Linux driver -Copyright(c) 1999 - 2008 Intel Corporation. +Copyright(c) 1999 - 2009 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,
drivers/net/e1000e/defines.h +1 -1
@@ -1,7 +1,7 @@/******************************************************************************* Intel PRO/1000 Linux driver -Copyright(c) 1999 - 2008 Intel Corporation. +Copyright(c) 1999 - 2009 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,
drivers/net/e1000e/e1000.h +1 -1
@@ -1,7 +1,7 @@/******************************************************************************* Intel PRO/1000 Linux driver -Copyright(c) 1999 - 2008 Intel Corporation. +Copyright(c) 1999 - 2009 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,
drivers/net/e1000e/es2lan.c +1 -1
@@ -1,7 +1,7 @@/******************************************************************************* Intel PRO/1000 Linux driver -Copyright(c) 1999 - 2008 Intel Corporation. +Copyright(c) 1999 - 2009 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,
drivers/net/e1000e/ethtool.c +1 -1
@@ -1,7 +1,7 @@/******************************************************************************* Intel PRO/1000 Linux driver -Copyright(c) 1999 - 2008 Intel Corporation. +Copyright(c) 1999 - 2009 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,
drivers/net/e1000e/hw.h +1 -1
@@ -1,7 +1,7 @@/******************************************************************************* Intel PRO/1000 Linux driver -Copyright(c) 1999 - 2008 Intel Corporation. +Copyright(c) 1999 - 2009 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,
drivers/net/e1000e/ich8lan.c +1 -1
@@ -1,7 +1,7 @@/******************************************************************************* Intel PRO/1000 Linux driver -Copyright(c) 1999 - 2008 Intel Corporation. +Copyright(c) 1999 - 2009 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,
drivers/net/e1000e/lib.c +1 -1
@@ -1,7 +1,7 @@/******************************************************************************* Intel PRO/1000 Linux driver -Copyright(c) 1999 - 2008 Intel Corporation. +Copyright(c) 1999 - 2009 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,
drivers/net/e1000e/netdev.c +2 -2
@@ -1,7 +1,7 @@/******************************************************************************* Intel PRO/1000 Linux driver -Copyright(c) 1999 - 2008 Intel Corporation. +Copyright(c) 1999 - 2009 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,
@@ -5364,7 +5364,7 @@ static int __init e1000_init_module(void)int ret;printk (KERN_INFO "%s: Intel(R) PRO/1000 Network Driver - %s\n" , e1000e_driver_name, e1000e_driver_version); -printk (KERN_INFO "%s: Copyright (c) 1999-2008 Intel Corporation.\n" , +printk (KERN_INFO "%s: Copyright (c) 1999 - 2009 Intel Corporation.\n" , e1000e_driver_name); ret =pci_register_driver (&e1000_driver); pm_qos_add_requirement(PM_QOS_CPU_DMA_LATENCY, e1000e_driver_name,
drivers/net/e1000e/param.c +1 -1
@@ -1,7 +1,7 @@/******************************************************************************* Intel PRO/1000 Linux driver -Copyright(c) 1999 - 2008 Intel Corporation. +Copyright(c) 1999 - 2009 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,
drivers/net/e1000e/phy.c +1 -1
@@ -1,7 +1,7 @@/******************************************************************************* Intel PRO/1000 Linux driver -Copyright(c) 1999 - 2008 Intel Corporation. +Copyright(c) 1999 - 2009 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,
PATCH 14/23 e1000e: remove comments regarding a non-existent api module
In reply to Jeff KirsherFrom: Bruce Allan <[email protected]>
---
drivers/net/e1000e/82571.c | 9 +-------- drivers/net/e1000e/es2lan.c | 30 +++++++----------------------- 2 files changed, 8 insertions(+), 31 deletions(-)
drivers/net/e1000e/82571.c +1 -8
@@ -72,8 +72,6 @@ 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) {
@@ -136,8 +134,6 @@ static s32 e1000_init_phy_params_82571(struct e1000_hw *hw)/** * 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) {
@@ -201,8 +197,6 @@ static s32 e1000_init_nvm_params_82571(struct e1000_hw *hw)/** * 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) {
@@ -830,8 +824,7 @@ static s32 e1000_set_d0_lplu_state_82571(struct e1000_hw *hw, bool active)* 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. +* This resets the hardware into a known state. **/ static s32 e1000_reset_hw_82571 (struct e1000_hw *hw) {
drivers/net/e1000e/es2lan.c +7 -23
@@ -116,8 +116,6 @@ static s32 e1000_write_kmrn_reg_80003es2lan(struct e1000_hw *hw, u32 offset,/** * e1000_init_phy_params_80003es2lan - Init ESB2 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_80003es2lan (struct e1000_hw *hw) {
@@ -147,8 +145,6 @@ static s32 e1000_init_phy_params_80003es2lan(struct e1000_hw *hw)/** * e1000_init_nvm_params_80003es2lan - Init ESB2 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_80003es2lan (struct e1000_hw *hw) {
@@ -195,8 +191,6 @@ static s32 e1000_init_nvm_params_80003es2lan(struct e1000_hw *hw)/** * e1000_init_mac_params_80003es2lan - Init ESB2 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_80003es2lan (struct e1000_adapter *adapter) {
@@ -267,8 +261,7 @@ static s32 e1000_get_variants_80003es2lan(struct e1000_adapter *adapter)* e1000_acquire_phy_80003es2lan - Acquire rights to access PHY * @hw: pointer to the HW structure * -* A wrapper to acquire access rights to the correct PHY. This is a -* function pointer entry point called by the api module. +* A wrapper to acquire access rights to the correct PHY. **/ static s32 e1000_acquire_phy_80003es2lan (struct e1000_hw *hw) {
@@ -282,8 +275,7 @@ static s32 e1000_acquire_phy_80003es2lan(struct e1000_hw *hw)* e1000_release_phy_80003es2lan - Release rights to access PHY * @hw: pointer to the HW structure * -* A wrapper to release access rights to the correct PHY. This is a -* function pointer entry point called by the api module. +* A wrapper to release access rights to the correct PHY. **/ static void e1000_release_phy_80003es2lan (struct e1000_hw *hw) {
@@ -328,8 +320,7 @@ static void e1000_release_mac_csr_80003es2lan(struct e1000_hw *hw)* e1000_acquire_nvm_80003es2lan - Acquire rights to access NVM * @hw: pointer to the HW structure * -* Acquire the semaphore to access the EEPROM. This is a function -* pointer entry point called by the api module. +* Acquire the semaphore to access the EEPROM. **/ static s32 e1000_acquire_nvm_80003es2lan (struct e1000_hw *hw) {
@@ -351,8 +342,7 @@ static s32 e1000_acquire_nvm_80003es2lan(struct e1000_hw *hw)* e1000_release_nvm_80003es2lan - Relinquish rights to access NVM * @hw: pointer to the HW structure * -* Release the semaphore used to access the EEPROM. This is a -* function pointer entry point called by the api module. +* Release the semaphore used to access the EEPROM. **/ static void e1000_release_nvm_80003es2lan (struct e1000_hw *hw) {
@@ -434,8 +424,7 @@ static void e1000_release_swfw_sync_80003es2lan(struct e1000_hw *hw, u16 mask)* @offset: offset of the register to read * @data: pointer to the data returned from the operation * -* Read the GG82563 PHY register. This is a function pointer entry -* point called by the api module. +* Read the GG82563 PHY register. **/ static s32 e1000_read_phy_reg_gg82563_80003es2lan (struct e1000_hw *hw,u32 offset,u16 *data)
@@ -499,8 +488,7 @@ static s32 e1000_read_phy_reg_gg82563_80003es2lan(struct e1000_hw *hw,* @offset: offset of the register to read * @data: value to write to the register * -* Write to the GG82563 PHY register. This is a function pointer entry -* point called by the api module. +* Write to the GG82563 PHY register. **/ static s32 e1000_write_phy_reg_gg82563_80003es2lan (struct e1000_hw *hw,u32 offset,u16 data)
@@ -565,8 +553,7 @@ static s32 e1000_write_phy_reg_gg82563_80003es2lan(struct e1000_hw *hw,* @words: number of words to write * @data: buffer of data to write to the NVM * -* Write "words" of data to the ESB2 NVM. This is a function -* pointer entry point called by the api module. +* Write "words" of data to the ESB2 NVM. **/ static s32 e1000_write_nvm_80003es2lan (struct e1000_hw *hw,u16 offset,u16 words,u16 *data)
@@ -730,7 +717,6 @@ static s32 e1000_get_cable_length_80003es2lan(struct e1000_hw *hw)* @duplex: pointer to duplex buffer * * Retrieve the current speed and duplex configuration. -* This is a function pointer entry point called by the api module. **/ static s32 e1000_get_link_up_info_80003es2lan (struct e1000_hw *hw,u16 *speed,u16 *duplex)
@@ -756,7 +742,6 @@ static s32 e1000_get_link_up_info_80003es2lan(struct e1000_hw *hw, u16 *speed,* @hw: pointer to the HW structure * * Perform a global reset to the ESB2 controller. -* This is a function pointer entry point called by the api module. **/ static s32 e1000_reset_hw_80003es2lan (struct e1000_hw *hw) {
@@ -805,7 +790,6 @@ static s32 e1000_reset_hw_80003es2lan(struct e1000_hw *hw)* @hw: pointer to the HW structure * * Initialize the hw bits, LED, VFTA, MTA, link and hw counters. -* This is a function pointer entry point called by the api module. **/ static s32 e1000_init_hw_80003es2lan (struct e1000_hw *hw) {
PATCH 15/23 e1000e: provide comment for 82571 workaround
In reply to Jeff KirsherFrom: Bruce Allan <[email protected]>
---
drivers/net/e1000e/82571.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-)
drivers/net/e1000e/82571.c +7 -0
@@ -1114,6 +1114,13 @@ static void e1000_initialize_hw_bits_82571(struct e1000_hw *hw) reg |= (1 <<22 );ew32 (GCR , reg); +/* +* Workaround for hardware errata. +* apply workaround for hardware errata documented in errata +* docs Fixes issue where some error prone or unreliable PCIe +* completions are occurring, particularly with ASPM enabled. +* Without fix, issue can cause tx timeouts. +*/ reg =er32 (GCR2 ); reg |=1 ;ew32 (GCR2 , reg);
PATCH 16/23 e1000e: set bools to true/false instead of 1/0
In reply to Jeff KirsherFrom: Bruce Allan <[email protected]>
Set booleans to 'true' or 'false' to make it clear it is a boolean. Also change instances of TRUE/FALSE in comments to lowercase true/false.
---
drivers/net/e1000e/82571.c | 7 ++++--- drivers/net/e1000e/es2lan.c | 3 ++- drivers/net/e1000e/ich8lan.c | 18 +++++++++--------- drivers/net/e1000e/lib.c | 24 ++++++++++++------------ drivers/net/e1000e/phy.c | 6 +++--- 5 files changed, 30 insertions(+), 28 deletions(-)
drivers/net/e1000e/82571.c +4 -3
@@ -230,7 +230,8 @@ static s32 e1000_init_mac_params_82571(struct e1000_adapter *adapter)/* 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 ; + mac->arc_subsystem_valid = (er32 (FWSM ) &E1000_FWSM_MODE_MASK ) + ? true : false;/* check for link */ switch (hw->phy.media_type) {
@@ -753,7 +754,7 @@ static s32 e1000_get_cfg_done_82571(struct e1000_hw *hw)/** * 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 +* @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
@@ -1521,7 +1522,7 @@ static s32 e1000_valid_led_default_82571(struct e1000_hw *hw, u16 *data)bool e1000e_get_laa_state_82571 (struct e1000_hw *hw) {if (hw->mac.type != e1000_82571) -return 0 ; +return false;return hw->dev_spec.e82571.laa_is_present; }
drivers/net/e1000e/es2lan.c +2 -1
@@ -213,7 +213,8 @@ static s32 e1000_init_mac_params_80003es2lan(struct e1000_adapter *adapter)/* 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 ; + mac->arc_subsystem_valid = (er32 (FWSM ) &E1000_FWSM_MODE_MASK ) + ? true : false;/* check for link */ switch (hw->phy.media_type) {
drivers/net/e1000e/ich8lan.c +9 -9
@@ -401,7 +401,7 @@ static s32 e1000_init_nvm_params_ich8lan(struct e1000_hw *hw)/* Clear shadow ram */ for (i =0 ; i < nvm->word_size; i++) { - dev_spec->shadow_ram[i].modified =0 ; + dev_spec->shadow_ram[i].modified = false; dev_spec->shadow_ram[i].value =0xFFFF ; }
@@ -430,7 +430,7 @@ static s32 e1000_init_mac_params_ich8lan(struct e1000_adapter *adapter)if (mac->type == e1000_ich8lan) mac->rar_entry_count--;/* Set if manageability features are enabled. */ - mac->arc_subsystem_valid =1 ; + mac->arc_subsystem_valid = true;/* LED operations */ switch (mac->type) {
@@ -464,7 +464,7 @@ static s32 e1000_init_mac_params_ich8lan(struct e1000_adapter *adapter)/* Enable PCS Lock-loss workaround for ICH8 */ if (mac->type == e1000_ich8lan) -e1000e_set_kmrn_lock_loss_workaround_ich8lan (hw,1 ); +e1000e_set_kmrn_lock_loss_workaround_ich8lan (hw, true);return 0 ; }
@@ -1403,7 +1403,7 @@ out:/** * e1000_set_d0_lplu_state_ich8lan - Set Low Power Linkup D0 state * @hw: pointer to the HW structure -* @active: TRUE to enable LPLU, FALSE to disable +* @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
@@ -1489,7 +1489,7 @@ static s32 e1000_set_d0_lplu_state_ich8lan(struct e1000_hw *hw, bool active)/** * e1000_set_d3_lplu_state_ich8lan - Set Low Power Linkup D3 state * @hw: pointer to the HW structure -* @active: TRUE to enable LPLU, FALSE to disable +* @active: true to enable LPLU, false to disable * * Sets the LPLU D3 state according to the active flag. When * activating LPLU this function also disables smart speed
@@ -1952,7 +1952,7 @@ static s32 e1000_write_nvm_ich8lan(struct e1000_hw *hw, u16 offset, u16 words, nvm->ops.acquire (hw);for (i =0 ; i < words; i++) { - dev_spec->shadow_ram[offset+i].modified =1 ; + dev_spec->shadow_ram[offset+i].modified = true; dev_spec->shadow_ram[offset+i].value = data[i]; }
@@ -2111,7 +2111,7 @@ static s32 e1000_update_nvm_checksum_ich8lan(struct e1000_hw *hw)/* Great! Everything worked, we can now clear the cached entries. */ for (i =0 ; i <E1000_ICH8_SHADOW_RAM_WORDS ; i++) { - dev_spec->shadow_ram[i].modified =0 ; + dev_spec->shadow_ram[i].modified = false; dev_spec->shadow_ram[i].value =0xFFFF ; }
@@ -3083,8 +3083,8 @@ static s32 e1000_kmrn_lock_loss_workaround_ich8lan(struct e1000_hw *hw)* @hw: pointer to the HW structure * @state: boolean value used to set the current Kumeran workaround state * -* If ICH8, set the current Kumeran workaround state (enabled - TRUE -* /disabled - FALSE). +* If ICH8, set the current Kumeran workaround state (enabled - true +* /disabled - false). **/ void e1000e_set_kmrn_lock_loss_workaround_ich8lan (struct e1000_hw *hw,bool state)
drivers/net/e1000e/lib.c +12 -12
@@ -371,7 +371,7 @@ s32 e1000e_check_for_copper_link(struct e1000_hw *hw)if (!link)return ret_val;/* No link detected */ - mac->get_link_status =0 ; + mac->get_link_status = false;/* * Check if there was DownShift, must be checked
@@ -1603,7 +1603,7 @@ void e1000e_reset_adaptive(struct e1000_hw *hw) mac->ifs_step_size =IFS_STEP ; mac->ifs_ratio =IFS_RATIO ; - mac->in_ifs_mode =0 ; + mac->in_ifs_mode = false;ew32 (AIT ,0 ); }
@@ -1620,7 +1620,7 @@ void e1000e_update_adaptive(struct e1000_hw *hw)if ((mac->collision_delta * mac->ifs_ratio) > mac->tx_packet_delta) {if (mac->tx_packet_delta >MIN_NUM_XMITS ) { - mac->in_ifs_mode =1 ; + mac->in_ifs_mode = true;if (mac->current_ifs_val < mac->ifs_max_val) {if (!mac->current_ifs_val) mac->current_ifs_val = mac->ifs_min_val;
@@ -1634,7 +1634,7 @@ void e1000e_update_adaptive(struct e1000_hw *hw)if (mac->in_ifs_mode && (mac->tx_packet_delta <=MIN_NUM_XMITS )) { mac->current_ifs_val =0 ; - mac->in_ifs_mode =0 ; + mac->in_ifs_mode = false;ew32 (AIT ,0 ); } }
@@ -2277,7 +2277,7 @@ bool e1000e_enable_tx_pkt_filtering(struct e1000_hw *hw)/* No manageability, no filtering */ if (!e1000e_check_mng_mode (hw)) { - hw->mac.tx_pkt_filtering =0 ; + hw->mac.tx_pkt_filtering = false;return 0 ; }
@@ -2287,7 +2287,7 @@ bool e1000e_enable_tx_pkt_filtering(struct e1000_hw *hw)*/ ret_val =e1000_mng_enable_host_if (hw);if (ret_val !=0 ) { - hw->mac.tx_pkt_filtering =0 ; + hw->mac.tx_pkt_filtering = false;return ret_val; }
@@ -2306,17 +2306,17 @@ bool e1000e_enable_tx_pkt_filtering(struct e1000_hw *hw)* take the safe route of assuming Tx filtering is enabled. */ if ((hdr_csum != csum) || (hdr->signature !=E1000_IAMT_SIGNATURE )) { - hw->mac.tx_pkt_filtering =1 ; + hw->mac.tx_pkt_filtering = true;return 1 ; }/* Cookie area is valid, make the final check for filtering. */ if (!(hdr->status &E1000_MNG_DHCP_COOKIE_STATUS_PARSING )) { - hw->mac.tx_pkt_filtering =0 ; + hw->mac.tx_pkt_filtering = false;return 0 ; } - hw->mac.tx_pkt_filtering =1 ; + hw->mac.tx_pkt_filtering = true;return 1 ; }
@@ -2473,7 +2473,7 @@ bool e1000e_enable_mng_pass_thru(struct e1000_hw *hw) {u32 manc;u32 fwsm, factps; -bool ret_val =0 ; +bool ret_val = false; manc =er32 (MANC );
@@ -2488,13 +2488,13 @@ bool e1000e_enable_mng_pass_thru(struct e1000_hw *hw)if (!(factps &E1000_FACTPS_MNGCG ) && ((fwsm &E1000_FWSM_MODE_MASK ) == (e1000_mng_mode_pt <<E1000_FWSM_MODE_SHIFT ))) { - ret_val =1 ; + ret_val = true;return ret_val; } }else {if ((manc &E1000_MANC_SMBUS_EN ) && !(manc &E1000_MANC_ASF_EN )) { - ret_val =1 ; + ret_val = true;return ret_val; } }
drivers/net/e1000e/phy.c +3 -3
@@ -834,7 +834,7 @@ s32 e1000e_copper_link_setup_igp(struct e1000_hw *hw)msleep (100 );/* disable lplu d0 during driver init */ - ret_val =e1000_set_d0_lplu_state (hw,0 ); + ret_val =e1000_set_d0_lplu_state (hw, false);if (ret_val) {e_dbg ("Error Disabling LPLU D0\n" );return ret_val;
@@ -1545,7 +1545,7 @@ s32 e1000e_check_downshift(struct e1000_hw *hw)break ;default :/* speed downshift not supported */ - phy->speed_downgraded =0 ; + phy->speed_downgraded = false;return 0 ; }
@@ -1907,7 +1907,7 @@ s32 e1000e_get_phy_info_igp(struct e1000_hw *hw)return -E1000_ERR_CONFIG ; } - phy->polarity_correction =1 ; + phy->polarity_correction = true; ret_val =e1000_check_polarity_igp (hw);if (ret_val)
PATCH 17/23 e1000e: cleanup - shift indentation left by exiting early in e1000_tso
In reply to Jeff KirsherFrom: Bruce Allan <[email protected]>
---
drivers/net/e1000e/netdev.c | 104 +++++++++++++++++++++---------------------- 1 files changed, 50 insertions(+), 54 deletions(-)
drivers/net/e1000e/netdev.c +50 -54
@@ -3725,68 +3725,64 @@ static int e1000_tso(struct e1000_adapter *adapter,u8 ipcss, ipcso, tucss, tucso, hdr_len;int err; -if (skb_is_gso (skb)) { -if (skb_header_cloned (skb)) { - err =pskb_expand_head (skb,0 ,0 ,GFP_ATOMIC ); -if (err) -return err; - } +if (!skb_is_gso (skb)) +return 0 ; - hdr_len =skb_transport_offset (skb) +tcp_hdrlen (skb); - mss =skb_shinfo (skb)->gso_size; -if (skb->protocol ==htons (ETH_P_IP )) { -struct iphdr *iph =ip_hdr (skb); - iph->tot_len =0 ; - iph->check =0 ; -tcp_hdr (skb)->check = ~csum_tcpudp_magic (iph->saddr, - iph->daddr,0 , -IPPROTO_TCP , -0 ); - cmd_length =E1000_TXD_CMD_IP ; - ipcse =skb_transport_offset (skb) -1 ; - }else if (skb_shinfo (skb)->gso_type ==SKB_GSO_TCPV6 ) { -ipv6_hdr (skb)->payload_len =0 ; -tcp_hdr (skb)->check = - ~csum_ipv6_magic (&ipv6_hdr (skb)->saddr, - &ipv6_hdr (skb)->daddr, -0 ,IPPROTO_TCP ,0 ); - ipcse =0 ; - } - ipcss =skb_network_offset (skb); - ipcso = (void *)&(ip_hdr (skb)->check) - (void *)skb->data; - tucss =skb_transport_offset (skb); - tucso = (void *)&(tcp_hdr (skb)->check) - (void *)skb->data; - tucse =0 ; +if (skb_header_cloned (skb)) { + err =pskb_expand_head (skb,0 ,0 ,GFP_ATOMIC ); +if (err) +return err; + } - cmd_length |= (E1000_TXD_CMD_DEXT |E1000_TXD_CMD_TSE | -E1000_TXD_CMD_TCP | (skb->len - (hdr_len))); + hdr_len =skb_transport_offset (skb) +tcp_hdrlen (skb); + mss =skb_shinfo (skb)->gso_size; +if (skb->protocol ==htons (ETH_P_IP )) { +struct iphdr *iph =ip_hdr (skb); + iph->tot_len =0 ; + iph->check =0 ; +tcp_hdr (skb)->check = ~csum_tcpudp_magic (iph->saddr, iph->daddr, +0 ,IPPROTO_TCP ,0 ); + cmd_length =E1000_TXD_CMD_IP ; + ipcse =skb_transport_offset (skb) -1 ; + }else if (skb_shinfo (skb)->gso_type ==SKB_GSO_TCPV6 ) { +ipv6_hdr (skb)->payload_len =0 ; +tcp_hdr (skb)->check = ~csum_ipv6_magic (&ipv6_hdr (skb)->saddr, + &ipv6_hdr (skb)->daddr, +0 ,IPPROTO_TCP ,0 ); + ipcse =0 ; + } + ipcss =skb_network_offset (skb); + ipcso = (void *)&(ip_hdr (skb)->check) - (void *)skb->data; + tucss =skb_transport_offset (skb); + tucso = (void *)&(tcp_hdr (skb)->check) - (void *)skb->data; + tucse =0 ; - i = tx_ring->next_to_use; - context_desc =E1000_CONTEXT_DESC (*tx_ring, i); - buffer_info = &tx_ring->buffer_info[i]; + cmd_length |= (E1000_TXD_CMD_DEXT |E1000_TXD_CMD_TSE | +E1000_TXD_CMD_TCP | (skb->len - (hdr_len))); - context_desc->lower_setup.ip_fields.ipcss = ipcss; - context_desc->lower_setup.ip_fields.ipcso = ipcso; - context_desc->lower_setup.ip_fields.ipcse =cpu_to_le16 (ipcse); - context_desc->upper_setup.tcp_fields.tucss = tucss; - context_desc->upper_setup.tcp_fields.tucso = tucso; - context_desc->upper_setup.tcp_fields.tucse =cpu_to_le16 (tucse); - context_desc->tcp_seg_setup.fields.mss =cpu_to_le16 (mss); - context_desc->tcp_seg_setup.fields.hdr_len = hdr_len; - context_desc->cmd_and_length =cpu_to_le32 (cmd_length); + i = tx_ring->next_to_use; + context_desc =E1000_CONTEXT_DESC (*tx_ring, i); + buffer_info = &tx_ring->buffer_info[i]; - buffer_info->time_stamp = jiffies; - buffer_info->next_to_watch = i; + context_desc->lower_setup.ip_fields.ipcss = ipcss; + context_desc->lower_setup.ip_fields.ipcso = ipcso; + context_desc->lower_setup.ip_fields.ipcse =cpu_to_le16 (ipcse); + context_desc->upper_setup.tcp_fields.tucss = tucss; + context_desc->upper_setup.tcp_fields.tucso = tucso; + context_desc->upper_setup.tcp_fields.tucse =cpu_to_le16 (tucse); + context_desc->tcp_seg_setup.fields.mss =cpu_to_le16 (mss); + context_desc->tcp_seg_setup.fields.hdr_len = hdr_len; + context_desc->cmd_and_length =cpu_to_le32 (cmd_length); - i++; -if (i == tx_ring->count) - i =0 ; - tx_ring->next_to_use = i; + buffer_info->time_stamp = jiffies; + buffer_info->next_to_watch = i; -return 1 ; - } + i++; +if (i == tx_ring->count) + i =0 ; + tx_ring->next_to_use = i; -return 0 ; +return 1 ; }static bool e1000_tx_csum (struct e1000_adapter *adapter,struct sk_buff *skb)
PATCH 18/23 e1000e: cleanup functions that clear hardware statistics
In reply to Jeff KirsherFrom: Bruce Allan <[email protected]>
The e1000_clear_hw_cntrs_*() functions read the registers to clear them. There is no reason to save the register contents so the temp variable can be removed.
---
drivers/net/e1000e/82571.c | 70 +++++++++++++++++++-------------------- drivers/net/e1000e/es2lan.c | 70 +++++++++++++++++++-------------------- drivers/net/e1000e/ich8lan.c | 23 ++++++------- drivers/net/e1000e/lib.c | 76 ++++++++++++++++++++---------------------- 4 files changed, 116 insertions(+), 123 deletions(-)
drivers/net/e1000e/82571.c +34 -36
@@ -1613,44 +1613,42 @@ static s32 e1000_fix_nvm_checksum_82571(struct e1000_hw *hw)**/ static void e1000_clear_hw_cntrs_82571 (struct e1000_hw *hw) { -u32 temp; -e1000e_clear_hw_cntrs_base (hw); - temp =er32 (PRC64 ); - temp =er32 (PRC127 ); - temp =er32 (PRC255 ); - temp =er32 (PRC511 ); - temp =er32 (PRC1023 ); - temp =er32 (PRC1522 ); - temp =er32 (PTC64 ); - temp =er32 (PTC127 ); - temp =er32 (PTC255 ); - temp =er32 (PTC511 ); - temp =er32 (PTC1023 ); - temp =er32 (PTC1522 ); - - temp =er32 (ALGNERRC ); - temp =er32 (RXERRC ); - temp =er32 (TNCRS ); - temp =er32 (CEXTERR ); - temp =er32 (TSCTC ); - temp =er32 (TSCTFC ); - - temp =er32 (MGTPRC ); - temp =er32 (MGTPDC ); - temp =er32 (MGTPTC ); - - temp =er32 (IAC ); - temp =er32 (ICRXOC ); - - temp =er32 (ICRXPTC ); - temp =er32 (ICRXATC ); - temp =er32 (ICTXPTC ); - temp =er32 (ICTXATC ); - temp =er32 (ICTXQEC ); - temp =er32 (ICTXQMTC ); - temp =er32 (ICRXDMTC ); +er32 (PRC64 ); +er32 (PRC127 ); +er32 (PRC255 ); +er32 (PRC511 ); +er32 (PRC1023 ); +er32 (PRC1522 ); +er32 (PTC64 ); +er32 (PTC127 ); +er32 (PTC255 ); +er32 (PTC511 ); +er32 (PTC1023 ); +er32 (PTC1522 ); + +er32 (ALGNERRC ); +er32 (RXERRC ); +er32 (TNCRS ); +er32 (CEXTERR ); +er32 (TSCTC ); +er32 (TSCTFC ); + +er32 (MGTPRC ); +er32 (MGTPDC ); +er32 (MGTPTC ); + +er32 (IAC ); +er32 (ICRXOC ); + +er32 (ICRXPTC ); +er32 (ICRXATC ); +er32 (ICTXPTC ); +er32 (ICTXATC ); +er32 (ICTXQEC ); +er32 (ICTXQMTC ); +er32 (ICRXDMTC ); }static struct e1000_mac_operations e82571_mac_ops = {
drivers/net/e1000e/es2lan.c +34 -36
78 lines not on this page · raw message
drivers/net/e1000e/ich8lan.c +11 -12
@@ -3402,24 +3402,23 @@ static s32 e1000_get_cfg_done_ich8lan(struct e1000_hw *hw)**/ static void e1000_clear_hw_cntrs_ich8lan (struct e1000_hw *hw) { -u32 temp;u16 phy_data;e1000e_clear_hw_cntrs_base (hw); - temp =er32 (ALGNERRC ); - temp =er32 (RXERRC ); - temp =er32 (TNCRS ); - temp =er32 (CEXTERR ); - temp =er32 (TSCTC ); - temp =er32 (TSCTFC ); +er32 (ALGNERRC ); +er32 (RXERRC ); +er32 (TNCRS ); +er32 (CEXTERR ); +er32 (TSCTC ); +er32 (TSCTFC ); - temp =er32 (MGTPRC ); - temp =er32 (MGTPDC ); - temp =er32 (MGTPTC ); +er32 (MGTPRC ); +er32 (MGTPDC ); +er32 (MGTPTC ); - temp =er32 (IAC ); - temp =er32 (ICRXOC ); +er32 (IAC ); +er32 (ICRXOC );/* Clear PHY statistics registers */ if ((hw->phy.type == e1000_phy_82578) ||
drivers/net/e1000e/lib.c +37 -39
82 lines not on this page · raw message
PATCH 19/23 e1000e: set pm_qos DMA latency requirement per interface when needed
In reply to Jeff KirsherFrom: Bruce Allan <[email protected]>
It was pointed out a pm_qos DMA latency requirement set when the driver is loaded when parts that support early receive of jumbo frames are probed could have that requirement overidden if another part supported by the driver (one that does not support early receive of jumbo frames) is probed later. Change the DMA latency requirement to be per-interface if needed instead of per driver.
---
drivers/net/e1000e/netdev.c | 47 ++++++++++++++++++++++++++----------------- 1 files changed, 28 insertions(+), 19 deletions(-)
drivers/net/e1000e/netdev.c +28 -19
@@ -2472,21 +2472,23 @@ static void e1000_configure_rx(struct e1000_adapter *adapter)* packet size is equal or larger than the specified value (in 8 byte * units), e.g. using jumbo frames when setting to E1000_ERT_2048 */ -if ((adapter->flags &FLAG_HAS_ERT ) && - (adapter->netdev->mtu >ETH_DATA_LEN )) { -u32 rxdctl =er32 (RXDCTL (0 )); -ew32 (RXDCTL (0 ), rxdctl |0x3 ); -ew32 (ERT ,E1000_ERT_2048 | (1 <<13 )); -/* -* With jumbo frames and early-receive enabled, excessive -* C4->C2 latencies result in dropped transactions. -*/ -pm_qos_update_requirement (PM_QOS_CPU_DMA_LATENCY , - e1000e_driver_name,55 ); - }else { -pm_qos_update_requirement (PM_QOS_CPU_DMA_LATENCY , - e1000e_driver_name, -PM_QOS_DEFAULT_VALUE ); +if (adapter->flags &FLAG_HAS_ERT ) { +if (adapter->netdev->mtu >ETH_DATA_LEN ) { +u32 rxdctl =er32 (RXDCTL (0 )); +ew32 (RXDCTL (0 ), rxdctl |0x3 ); +ew32 (ERT ,E1000_ERT_2048 | (1 <<13 )); +/* +* With jumbo frames and early-receive enabled, +* excessive C-state transition latencies result in +* dropped transactions. +*/ +pm_qos_update_requirement (PM_QOS_CPU_DMA_LATENCY , + adapter->netdev->name,55 ); + }else { +pm_qos_update_requirement (PM_QOS_CPU_DMA_LATENCY , + adapter->netdev->name, +PM_QOS_DEFAULT_VALUE ); + } }/* Enable Receives */
@@ -2804,6 +2806,12 @@ int e1000e_up(struct e1000_adapter *adapter) {struct e1000_hw *hw = &adapter->hw; +/* DMA latency requirement to workaround early-receive/jumbo issue */ +if (adapter->flags &FLAG_HAS_ERT ) +pm_qos_add_requirement (PM_QOS_CPU_DMA_LATENCY , + adapter->netdev->name, +PM_QOS_DEFAULT_VALUE ); +/* hardware has been reset, we need to reload some things */ e1000_configure (adapter);
@@ -2864,6 +2872,10 @@ void e1000e_down(struct e1000_adapter *adapter)e1000_clean_tx_ring (adapter);e1000_clean_rx_ring (adapter); +if (adapter->flags &FLAG_HAS_ERT ) +pm_qos_remove_requirement (PM_QOS_CPU_DMA_LATENCY , + adapter->netdev->name); +/* * TODO: for power management, we could drop the link and * pci_disable_device here.
@@ -5363,9 +5375,7 @@ static int __init e1000_init_module(void)printk (KERN_INFO "%s: Copyright (c) 1999 - 2009 Intel Corporation.\n" , e1000e_driver_name); ret =pci_register_driver (&e1000_driver); -pm_qos_add_requirement (PM_QOS_CPU_DMA_LATENCY , e1000e_driver_name, -PM_QOS_DEFAULT_VALUE ); - +return ret; }module_init (e1000_init_module);
@@ -5379,7 +5389,6 @@ module_init(e1000_init_module); static void __exit e1000_exit_module(void) {pci_unregister_driver (&e1000_driver); -pm_qos_remove_requirement (PM_QOS_CPU_DMA_LATENCY , e1000e_driver_name); }module_exit (e1000_exit_module);
PATCH 20/23 e1000e: do not error out on identification LED init failure
In reply to Jeff KirsherFrom: Bruce Allan <[email protected]>
A failure to initialize the identification LED is not a fatal condition and should allow the init path to continue.
---
drivers/net/e1000e/82571.c | 5 ++--- drivers/net/e1000e/es2lan.c | 5 ++--- drivers/net/e1000e/ich8lan.c | 5 ++--- 3 files changed, 6 insertions(+), 9 deletions(-)
drivers/net/e1000e/82571.c +2 -3
@@ -948,10 +948,9 @@ static s32 e1000_init_hw_82571(struct e1000_hw *hw)/* Initialize identification LED */ ret_val =e1000e_id_led_init (hw); -if (ret_val) { +if (ret_val)e_dbg ("Error initializing identification LED\n" ); -return ret_val; - } +/* This is not fatal and we should not stop init due to this */ /* Disabling VLAN filtering */ e_dbg ("Initializing the IEEE VLAN\n" );
drivers/net/e1000e/es2lan.c +2 -3
@@ -803,10 +803,9 @@ static s32 e1000_init_hw_80003es2lan(struct e1000_hw *hw)/* Initialize identification LED */ ret_val =e1000e_id_led_init (hw); -if (ret_val) { +if (ret_val)e_dbg ("Error initializing identification LED\n" ); -return ret_val; - } +/* This is not fatal and we should not stop init due to this */ /* Disabling VLAN filtering */ e_dbg ("Initializing the IEEE VLAN\n" );
drivers/net/e1000e/ich8lan.c +2 -3
@@ -2722,10 +2722,9 @@ static s32 e1000_init_hw_ich8lan(struct e1000_hw *hw)/* Initialize identification LED */ ret_val = mac->ops.id_led_init (hw); -if (ret_val) { +if (ret_val)e_dbg ("Error initializing identification LED\n" ); -return ret_val; - } +/* This is not fatal and we should not stop init due to this */ /* Setup the receive address. */ e1000e_init_rx_addrs (hw, mac->rar_entry_count);
PATCH 21/23 e1000e: remove redundant might_sleep()
In reply to Jeff KirsherFrom: Bruce Allan <[email protected]>
Now that mutex_lock() calls might_sleep() the driver doesn't have to here.
---
drivers/net/e1000e/ich8lan.c | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-)
drivers/net/e1000e/ich8lan.c +0 -2
@@ -630,8 +630,6 @@ static s32 e1000_acquire_swflag_ich8lan(struct e1000_hw *hw)u32 extcnf_ctrl, timeout =PHY_CFG_TIMEOUT ;s32 ret_val =0 ; -might_sleep (); -mutex_lock (&swflag_mutex);while (timeout) {
PATCH 22/23 e1000e: cosmetic - group local variables of the same type
In reply to Jeff KirsherFrom: Bruce Allan <[email protected]>
---
drivers/net/e1000e/82571.c | 11 +++-------- drivers/net/e1000e/es2lan.c | 6 ++---- drivers/net/e1000e/ich8lan.c | 8 ++++---- 3 files changed, 9 insertions(+), 16 deletions(-)
drivers/net/e1000e/82571.c +3 -8
@@ -693,8 +693,7 @@ 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 ; +u32 i, eewr =0 ;s32 ret_val =0 ;/*
@@ -829,10 +828,7 @@ static s32 e1000_set_d0_lplu_state_82571(struct e1000_hw *hw, bool active)**/ static s32 e1000_reset_hw_82571 (struct e1000_hw *hw) { -u32 ctrl; -u32 extcnf_ctrl; -u32 ctrl_ext; -u32 icr; +u32 ctrl, extcnf_ctrl, ctrl_ext, icr;s32 ret_val;u16 i =0 ;
@@ -941,8 +937,7 @@ 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; +u16 i, rar_count = mac->rar_entry_count;e1000_initialize_hw_bits_82571 (hw);
drivers/net/e1000e/es2lan.c +2 -4
@@ -695,8 +695,7 @@ static s32 e1000_get_cable_length_80003es2lan(struct e1000_hw *hw) {struct e1000_phy_info *phy = &hw->phy;s32 ret_val; -u16 phy_data; -u16 index; +u16 phy_data, index; ret_val =e1e_rphy (hw,GG82563_PHY_DSP_DISTANCE , &phy_data);if (ret_val)
@@ -746,8 +745,7 @@ static s32 e1000_get_link_up_info_80003es2lan(struct e1000_hw *hw, u16 *speed,**/ static s32 e1000_reset_hw_80003es2lan (struct e1000_hw *hw) { -u32 ctrl; -u32 icr; +u32 ctrl, icr;s32 ret_val;/*
drivers/net/e1000e/ich8lan.c +4 -4
@@ -706,7 +706,9 @@ static void e1000_release_swflag_ich8lan(struct e1000_hw *hw)**/ static bool e1000_check_mng_mode_ich8lan (struct e1000_hw *hw) { -u32 fwsm =er32 (FWSM ); +u32 fwsm; + + fwsm =er32 (FWSM );return (fwsm &E1000_FWSM_MODE_MASK ) == (E1000_ICH_MNG_IAMT_MODE <<E1000_FWSM_MODE_SHIFT );
@@ -2349,9 +2351,7 @@ static s32 e1000_erase_flash_bank_ich8lan(struct e1000_hw *hw, u32 bank)u32 flash_bank_size = nvm->flash_bank_size *2 ;s32 ret_val;s32 count =0 ; -s32 iteration; -s32 sector_size; -s32 j; +s32 j, iteration, sector_size; hsfsts.regval =er16flash (ICH_FLASH_HSFSTS );
PATCH 23/23 e1000e: update Tx Unit hang detection message
In reply to Jeff KirsherFrom: Bruce Allan <[email protected]>
The Tx unit hang detection code in e1000e detects other hangs caused by hardware components (e.g. Rx, DMA units), but it is not possible to detect exactly which component is hung so it has always assumed a Tx unit hang. When dumping a message to the system log because of a hang, this patch adds more data to help narrow the cause of the issue and makes the message non-Tx-specific. Because this new code reads PHY registers which can sleep, move it off to a workqueue. This and all previously existing work tasks in the driver are now cancelled when the driver is removed.
---
drivers/net/e1000e/e1000.h | 1 + drivers/net/e1000e/netdev.c | 46 ++++++++++++++++++++++++++++++++++++------- 2 files changed, 39 insertions(+), 8 deletions(-)
drivers/net/e1000e/e1000.h +1 -0
@@ -364,6 +364,7 @@ struct e1000_adapter {struct work_struct downshift_task;struct work_struct update_phy_task;struct work_struct led_blink_task; +struct work_struct print_hang_task; };struct e1000_info {
drivers/net/e1000e/netdev.c +38 -8
93 lines not on this page · raw message