Intel Wired LAN Driver Updates
Subsystems (3)
This series contains updates to ixgbevf and e1000e.
Alex's ixgbevf patch is meant to address several race issues that become possible because next_to_watch could possibly be set to a value that shows that the descriptor is done when it is not. In order to correct that we instead make next_to_watch a pointer that is set to NULL during cleanup, and set to the eop_desc after the descriptor rings have been written.
Stephen's ixgbevf patch makes the PCI id table a const and reformats the table to match what the ixgbe driver does.
The remaining 13 patches from Bruce are cleanup patches for e1000e to resolve checkpatch.pl warnings/errors, removing blank lines where necessary and fix code formatting.
The following are changes since commit 7f0e44ac9f7f12a2519bfed9ea4df3c1471bd8bb:
ipv6 flowlabel: add __rcu annotations
and are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-next master
Alexander Duyck (1):
ixgbevf: Make next_to_watch a pointer and adjust memory barriers to
avoid races
Bruce Allan (13):
e1000e: cleanup CODE_INDENT checkpatch errors
e1000e: cleanup SPACING checkpatch errors and warnings
e1000e: cleanup LONG_LINE checkpatch warnings
e1000e: cleanup LEADING_SPACE checkpatch warnings
e1000e: cleanup PARENTHESIS_ALIGNMENT checkpatch checks
e1000e: cleanup SPACING checkpatch checks
e1000e: cleanup (add/remove) blank lines where appropriate
e1000e: cleanup unusually placed comments
e1000e: cleanup formatting of static structs
e1000e: cleanup unnecessary line breaks
e1000e: cleanup USLEEP_RANGE checkpatch checks
e1000e: cleanup format of struct e1000_opt_list struct
e1000e: cleanup - move defines to appropriate header file
Stephen Hemminger (1):
ixgbevf: use PCI_DEVICE_TABLE macro
drivers/net/ethernet/intel/e1000e/80003es2lan.c | 131 ++++++----- drivers/net/ethernet/intel/e1000e/82571.c | 38 ++- drivers/net/ethernet/intel/e1000e/82571.h | 2 + drivers/net/ethernet/intel/e1000e/defines.h | 25 +- drivers/net/ethernet/intel/e1000e/e1000.h | 18 +- drivers/net/ethernet/intel/e1000e/ethtool.c | 177 +++++++------- drivers/net/ethernet/intel/e1000e/hw.h | 4 +- drivers/net/ethernet/intel/e1000e/ich8lan.c | 195 ++++++++-------- drivers/net/ethernet/intel/e1000e/mac.c | 10 +- drivers/net/ethernet/intel/e1000e/netdev.c | 269 ++++++++++------------ drivers/net/ethernet/intel/e1000e/nvm.c | 2 +- drivers/net/ethernet/intel/e1000e/param.c | 62 +++-- drivers/net/ethernet/intel/e1000e/phy.c | 130 +++++------ drivers/net/ethernet/intel/ixgbevf/ixgbevf.h | 2 +- drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 80 ++++--- 15 files changed, 574 insertions(+), 571 deletions(-)
Signature · 1 line
1.7.11.7
PATCH 1/15 ixgbevf: Make next_to_watch a pointer and adjust memory barriers to avoid races
From: Alexander Duyck <[email protected]>
This change is meant to address several race issues that become possible because next_to_watch could possibly be set to a value that shows that the descriptor is done when it is not. In order to correct that we instead make next_to_watch a pointer that is set to NULL during cleanup, and set to the eop_desc after the descriptor rings have been written.
To enforce proper ordering the next_to_watch pointer is not set until after a wmb writing the values to the last descriptor in a transmit. In order to guarantee that the descriptor is not read until after the eop_desc we use the read_barrier_depends which is only really necessary on the alpha architecture.
--- drivers/net/ethernet/intel/ixgbevf/ixgbevf.h | 2 +- drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 71 +++++++++++++---------- 2 files changed, 40 insertions(+), 33 deletions(-)
drivers/net/ethernet/intel/ixgbevf/ixgbevf.h +1 -1
@@ -44,8 +44,8 @@ struct ixgbevf_tx_buffer {struct sk_buff *skb;dma_addr_t dma;unsigned long time_stamp; +union ixgbe_adv_tx_desc *next_to_watch;u16 length; -u16 next_to_watch;u16 mapped_as_page; };
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c +39 -32
144 lines not on this page · raw message
Signature · 1 line
1.7.11.7
PATCH 2/15 ixgbevf: use PCI_DEVICE_TABLE macro
In reply to Jeff KirsherFrom: Stephen Hemminger <[email protected]>
Makes PCI id table const. Reformat to match table in ixgbe_main.c
--- drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c +3 -6
@@ -76,12 +76,9 @@ static const struct ixgbevf_info *ixgbevf_info_tbl[] = {* { Vendor ID, Device ID, SubVendor ID, SubDevice ID, * Class, Class Mask, private data (not used) } */ -static struct pci_device_id ixgbevf_pci_tbl[] = { - {PCI_VDEVICE (INTEL ,IXGBE_DEV_ID_82599_VF ), - board_82599_vf}, - {PCI_VDEVICE (INTEL ,IXGBE_DEV_ID_X540_VF ), - board_X540_vf}, - +static DEFINE_PCI_DEVICE_TABLE (ixgbevf_pci_tbl) = { + {PCI_VDEVICE (INTEL ,IXGBE_DEV_ID_82599_VF ), board_82599_vf }, + {PCI_VDEVICE (INTEL ,IXGBE_DEV_ID_X540_VF ), board_X540_vf },/* required last entry */ {0 , } };
Signature · 1 line
1.7.11.7
PATCH 3/15 e1000e: cleanup CODE_INDENT checkpatch errors
In reply to Jeff KirsherFrom: Bruce Allan <[email protected]>
ERROR:CODE_INDENT: code indent should use tabs where possible
--- drivers/net/ethernet/intel/e1000e/80003es2lan.c | 73 +++++++++++----------- drivers/net/ethernet/intel/e1000e/82571.c | 18 +++--- drivers/net/ethernet/intel/e1000e/ethtool.c | 37 ++++++----- drivers/net/ethernet/intel/e1000e/hw.h | 2 +- drivers/net/ethernet/intel/e1000e/ich8lan.c | 74 +++++++++++----------- drivers/net/ethernet/intel/e1000e/netdev.c | 80 +++++++++++------------- drivers/net/ethernet/intel/e1000e/phy.c | 81 ++++++++++++------------- 7 files changed, 178 insertions(+), 187 deletions(-)
drivers/net/ethernet/intel/e1000e/80003es2lan.c +38 -35
@@ -116,7 +116,7 @@ static s32 e1000_init_nvm_params_80003es2lan(struct e1000_hw *hw) nvm->type = e1000_nvm_eeprom_spi; size = (u16)((eecd &E1000_EECD_SIZE_EX_MASK ) >> -E1000_EECD_SIZE_EX_SHIFT ); +E1000_EECD_SIZE_EX_SHIFT );/* Added to a constant, "size" becomes the left-shift value * for setting word_size.
@@ -406,14 +406,14 @@ static s32 e1000_read_phy_reg_gg82563_80003es2lan(struct e1000_hw *hw,udelay (200 ); ret_val =e1000e_read_phy_reg_mdic (hw, -MAX_PHY_REG_ADDRESS & offset, - data); +MAX_PHY_REG_ADDRESS & offset, + data);udelay (200 ); }else { ret_val =e1000e_read_phy_reg_mdic (hw, -MAX_PHY_REG_ADDRESS & offset, - data); +MAX_PHY_REG_ADDRESS & offset, + data); }e1000_release_phy_80003es2lan (hw);
@@ -475,14 +475,14 @@ static s32 e1000_write_phy_reg_gg82563_80003es2lan(struct e1000_hw *hw,udelay (200 ); ret_val =e1000e_write_phy_reg_mdic (hw, -MAX_PHY_REG_ADDRESS & offset, - data); +MAX_PHY_REG_ADDRESS & + offset, data);udelay (200 ); }else { ret_val =e1000e_write_phy_reg_mdic (hw, -MAX_PHY_REG_ADDRESS & offset, - data); +MAX_PHY_REG_ADDRESS & + offset, data); }e1000_release_phy_80003es2lan (hw);
@@ -784,14 +784,14 @@ static s32 e1000_init_hw_80003es2lan(struct e1000_hw *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 ; + 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. */ reg_data =er32 (TXDCTL (1 )); - reg_data = (reg_data & ~E1000_TXDCTL_WTHRESH ) | -E1000_TXDCTL_FULL_TX_DESC_WB |E1000_TXDCTL_COUNT_DESC ; + reg_data = ((reg_data & ~E1000_TXDCTL_WTHRESH ) | +E1000_TXDCTL_FULL_TX_DESC_WB |E1000_TXDCTL_COUNT_DESC );ew32 (TXDCTL (1 ), reg_data);/* Enable retransmit on late collisions */
@@ -818,10 +818,9 @@ static s32 e1000_init_hw_80003es2lan(struct e1000_hw *hw)/* default to true to enable the MDIC W/A */ hw->dev_spec.e80003es2lan.mdic_wa_enable = true; - ret_val =e1000_read_kmrn_reg_80003es2lan (hw, -E1000_KMRNCTRLSTA_OFFSET >> -E1000_KMRNCTRLSTA_OFFSET_SHIFT , - &i); + ret_val = +e1000_read_kmrn_reg_80003es2lan (hw,E1000_KMRNCTRLSTA_OFFSET >> +E1000_KMRNCTRLSTA_OFFSET_SHIFT , &i);if (!ret_val) {if ((i &E1000_KMRNCTRLSTA_OPMODE_MASK ) ==E1000_KMRNCTRLSTA_OPMODE_INBAND_MDIO )
@@ -1049,27 +1048,29 @@ static s32 e1000_setup_copper_link_80003es2lan(struct e1000_hw *hw)* polling the phy; this fixes erroneous timeouts at 10Mbps. */ ret_val =e1000_write_kmrn_reg_80003es2lan (hw,GG82563_REG (0x34 ,4 ), -0xFFFF ); +0xFFFF );if (ret_val)return ret_val; ret_val =e1000_read_kmrn_reg_80003es2lan (hw,GG82563_REG (0x34 ,9 ), - ®_data); + ®_data);if (ret_val)return ret_val; reg_data |=0x3F ; ret_val =e1000_write_kmrn_reg_80003es2lan (hw,GG82563_REG (0x34 ,9 ), - reg_data); + reg_data);if (ret_val)return ret_val; - ret_val =e1000_read_kmrn_reg_80003es2lan (hw, -E1000_KMRNCTRLSTA_OFFSET_INB_CTRL , - ®_data); + ret_val = +e1000_read_kmrn_reg_80003es2lan (hw, +E1000_KMRNCTRLSTA_OFFSET_INB_CTRL , + ®_data);if (ret_val)return ret_val; reg_data |=E1000_KMRNCTRLSTA_INB_CTRL_DIS_PADDING ; - ret_val =e1000_write_kmrn_reg_80003es2lan (hw, -E1000_KMRNCTRLSTA_OFFSET_INB_CTRL , - reg_data); + ret_val = +e1000_write_kmrn_reg_80003es2lan (hw, +E1000_KMRNCTRLSTA_OFFSET_INB_CTRL , + reg_data);if (ret_val)return ret_val;
@@ -1096,7 +1097,7 @@ static s32 e1000_cfg_on_link_up_80003es2lan(struct e1000_hw *hw)if (hw->phy.media_type == e1000_media_type_copper) { ret_val =e1000e_get_speed_and_duplex_copper (hw, &speed, - &duplex); + &duplex);if (ret_val)return ret_val;
@@ -1125,9 +1126,10 @@ static s32 e1000_cfg_kmrn_10_100_80003es2lan(struct e1000_hw *hw, u16 duplex)u16 reg_data, reg_data2; reg_data =E1000_KMRNCTRLSTA_HD_CTRL_10_100_DEFAULT ; - ret_val =e1000_write_kmrn_reg_80003es2lan (hw, -E1000_KMRNCTRLSTA_OFFSET_HD_CTRL , - reg_data); + ret_val = +e1000_write_kmrn_reg_80003es2lan (hw, +E1000_KMRNCTRLSTA_OFFSET_HD_CTRL , + reg_data);if (ret_val)return ret_val;
@@ -1171,9 +1173,10 @@ static s32 e1000_cfg_kmrn_1000_80003es2lan(struct e1000_hw *hw)u32 i =0 ; reg_data =E1000_KMRNCTRLSTA_HD_CTRL_1000_DEFAULT ; - ret_val =e1000_write_kmrn_reg_80003es2lan (hw, -E1000_KMRNCTRLSTA_OFFSET_HD_CTRL , - reg_data); + ret_val = +e1000_write_kmrn_reg_80003es2lan (hw, +E1000_KMRNCTRLSTA_OFFSET_HD_CTRL , + reg_data);if (ret_val)return ret_val;
@@ -1220,7 +1223,7 @@ static s32 e1000_read_kmrn_reg_80003es2lan(struct e1000_hw *hw, u32 offset,return ret_val; kmrnctrlsta = ((offset <<E1000_KMRNCTRLSTA_OFFSET_SHIFT ) & -E1000_KMRNCTRLSTA_OFFSET ) |E1000_KMRNCTRLSTA_REN ; +E1000_KMRNCTRLSTA_OFFSET ) |E1000_KMRNCTRLSTA_REN ;ew32 (KMRNCTRLSTA , kmrnctrlsta);e1e_flush ();
@@ -1255,7 +1258,7 @@ static s32 e1000_write_kmrn_reg_80003es2lan(struct e1000_hw *hw, u32 offset,return ret_val; kmrnctrlsta = ((offset <<E1000_KMRNCTRLSTA_OFFSET_SHIFT ) & -E1000_KMRNCTRLSTA_OFFSET ) | data; +E1000_KMRNCTRLSTA_OFFSET ) | data;ew32 (KMRNCTRLSTA , kmrnctrlsta);e1e_flush ();
drivers/net/ethernet/intel/e1000e/82571.c +9 -9
@@ -846,9 +846,9 @@ static s32 e1000_write_nvm_eewr_82571(struct e1000_hw *hw, u16 offset, }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 ; + 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)
@@ -1122,9 +1122,9 @@ static s32 e1000_init_hw_82571(struct e1000_hw *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 ; + 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. */
@@ -1140,9 +1140,9 @@ static s32 e1000_init_hw_82571(struct e1000_hw *hw)break ;default : reg_data =er32 (TXDCTL (1 )); - reg_data = (reg_data & ~E1000_TXDCTL_WTHRESH ) | -E1000_TXDCTL_FULL_TX_DESC_WB | -E1000_TXDCTL_COUNT_DESC ; + reg_data = ((reg_data & ~E1000_TXDCTL_WTHRESH ) | +E1000_TXDCTL_FULL_TX_DESC_WB | +E1000_TXDCTL_COUNT_DESC );ew32 (TXDCTL (1 ), reg_data);break ; }
drivers/net/ethernet/intel/e1000e/ethtool.c +17 -20
@@ -196,8 +196,7 @@ static int e1000_get_settings(struct net_device *netdev,/* MDI-X => 2; MDI =>1; Invalid =>0 */ if ((hw->phy.media_type == e1000_media_type_copper) &&netif_carrier_ok (netdev)) - ecmd->eth_tp_mdix = hw->phy.is_mdix ?ETH_TP_MDI_X : -ETH_TP_MDI ; + ecmd->eth_tp_mdix = hw->phy.is_mdix ?ETH_TP_MDI_X :ETH_TP_MDI ;else ecmd->eth_tp_mdix =ETH_TP_MDI_INVALID ;
@@ -297,12 +296,10 @@ static int e1000_set_settings(struct net_device *netdev, hw->mac.autoneg =1 ;if (hw->phy.media_type == e1000_media_type_fiber) hw->phy.autoneg_advertised = ADVERTISED_1000baseT_Full | -ADVERTISED_FIBRE | - ADVERTISED_Autoneg; +ADVERTISED_FIBRE | ADVERTISED_Autoneg;else hw->phy.autoneg_advertised = ecmd->advertising | -ADVERTISED_TP | - ADVERTISED_Autoneg; +ADVERTISED_TP | ADVERTISED_Autoneg; ecmd->advertising = hw->phy.autoneg_advertised;if (adapter->fc_autoneg) hw->fc.requested_mode = e1000_fc_default;
@@ -345,7 +342,7 @@ static void e1000_get_pauseparam(struct net_device *netdev,struct e1000_hw *hw = &adapter->hw; pause->autoneg = - (adapter->fc_autoneg ?AUTONEG_ENABLE :AUTONEG_DISABLE ); + (adapter->fc_autoneg ?AUTONEG_ENABLE :AUTONEG_DISABLE );if (hw->fc.current_mode == e1000_fc_rx_pause) { pause->rx_pause =1 ;
@@ -434,7 +431,7 @@ static void e1000_get_regs(struct net_device *netdev,memset (p,0 ,E1000_REGS_LEN *sizeof (u32)); regs->version = (1 <<24 ) | (adapter->pdev->revision <<16 ) | - adapter->pdev->device; + adapter->pdev->device; regs_buff[0 ] =er32 (CTRL ); regs_buff[1 ] =er32 (STATUS );
@@ -821,7 +818,7 @@ static int e1000_reg_test(struct e1000_adapter *adapter, u64 *data)case e1000_80003es2lan: toggle =0x7FFFF3FF ;break ; -default : +default : toggle =0x7FFFF033 ;break ; }
@@ -1178,8 +1175,8 @@ static int e1000_setup_desc_rings(struct e1000_adapter *adapter) tx_ring->buffer_info[i].skb = skb; tx_ring->buffer_info[i].length = skb->len; tx_ring->buffer_info[i].dma = -dma_map_single (&pdev->dev, skb->data, skb->len, -DMA_TO_DEVICE ); +dma_map_single (&pdev->dev, skb->data, skb->len, +DMA_TO_DEVICE );if (dma_mapping_error (&pdev->dev, tx_ring->buffer_info[i].dma)) { ret_val =4 ;
@@ -1225,10 +1222,10 @@ static int e1000_setup_desc_rings(struct e1000_adapter *adapter)ew32 (RDH (0 ),0 );ew32 (RDT (0 ),0 ); rctl =E1000_RCTL_EN |E1000_RCTL_BAM |E1000_RCTL_SZ_2048 | -E1000_RCTL_UPE |E1000_RCTL_MPE |E1000_RCTL_LPE | -E1000_RCTL_SBP |E1000_RCTL_SECRC | -E1000_RCTL_LBM_NO |E1000_RCTL_RDMTS_HALF | - (adapter->hw.mac.mc_filter_type <<E1000_RCTL_MO_SHIFT ); +E1000_RCTL_UPE |E1000_RCTL_MPE |E1000_RCTL_LPE | +E1000_RCTL_SBP |E1000_RCTL_SECRC | +E1000_RCTL_LBM_NO |E1000_RCTL_RDMTS_HALF | + (adapter->hw.mac.mc_filter_type <<E1000_RCTL_MO_SHIFT );ew32 (RCTL , rctl);for (i =0 ; i < rx_ring->count; i++) {
@@ -1243,8 +1240,8 @@ static int e1000_setup_desc_rings(struct e1000_adapter *adapter)skb_reserve (skb,NET_IP_ALIGN ); rx_ring->buffer_info[i].skb = skb; rx_ring->buffer_info[i].dma = -dma_map_single (&pdev->dev, skb->data,2048 , -DMA_FROM_DEVICE ); +dma_map_single (&pdev->dev, skb->data,2048 , +DMA_FROM_DEVICE );if (dma_mapping_error (&pdev->dev, rx_ring->buffer_info[i].dma)) { ret_val =8 ;
@@ -1980,11 +1977,11 @@ static void e1000_get_ethtool_stats(struct net_device *netdev,switch (e1000_gstrings_stats[i].type) {case NETDEV_STATS : p = (char *) &net_stats + - e1000_gstrings_stats[i].stat_offset; + e1000_gstrings_stats[i].stat_offset;break ;case E1000_STATS : p = (char *) adapter + - e1000_gstrings_stats[i].stat_offset; + e1000_gstrings_stats[i].stat_offset;break ;default : data[i] =0 ;
@@ -1992,7 +1989,7 @@ static void e1000_get_ethtool_stats(struct net_device *netdev, } data[i] = (e1000_gstrings_stats[i].sizeof_stat == -sizeof (u64)) ? *(u64 *)p : *(u32 *)p; +sizeof (u64)) ? *(u64 *)p : *(u32 *)p; } }
drivers/net/ethernet/intel/e1000e/hw.h +1 -1
@@ -545,7 +545,7 @@ struct e1000_mac_info {u16 mta_reg_count;/* Maximum size of the MTA register table in all supported adapters */ -#define MAX_MTA_REG 128 +#define MAX_MTA_REG 128u32 mta_shadow[MAX_MTA_REG ];u16 rar_entry_count;
drivers/net/ethernet/intel/e1000e/ich8lan.c +37 -37
162 lines not on this page · raw message
drivers/net/ethernet/intel/e1000e/netdev.c +36 -44
223 lines not on this page · raw message
drivers/net/ethernet/intel/e1000e/phy.c +40 -41
205 lines not on this page · raw message
Signature · 1 line
1.7.11.7
PATCH 4/15 e1000e: cleanup SPACING checkpatch errors and warnings
In reply to Jeff KirsherFrom: Bruce Allan <[email protected]>
ERROR:SPACING: spaces prohibited around that ':' (ctx:WxV) ERROR:SPACING: need consistent spacing around '-' (ctx:WxV) ERROR:SPACING: space required after that ',' (ctx:VxV) ERROR:SPACING: spaces required around that '=' (ctx:VxV) WARNING:SPACING: missing space after enum definition
and some similar spacing issues not reported by checkpatch.
--- drivers/net/ethernet/intel/e1000e/82571.c | 2 +- drivers/net/ethernet/intel/e1000e/ethtool.c | 2 +- drivers/net/ethernet/intel/e1000e/hw.h | 2 +- drivers/net/ethernet/intel/e1000e/ich8lan.c | 48 ++++++++++++++--------------- drivers/net/ethernet/intel/e1000e/netdev.c | 12 ++++---- drivers/net/ethernet/intel/e1000e/phy.c | 2 +- 6 files changed, 34 insertions(+), 34 deletions(-)
drivers/net/ethernet/intel/e1000e/82571.c +1 -1
@@ -847,7 +847,7 @@ static s32 e1000_write_nvm_eewr_82571(struct e1000_hw *hw, u16 offset,for (i =0 ; i < words; i++) { eewr = ((data[i] <<E1000_NVM_RW_REG_DATA ) | - ((offset+i) <<E1000_NVM_RW_ADDR_SHIFT ) | + ((offset + i) <<E1000_NVM_RW_ADDR_SHIFT ) |E1000_NVM_RW_REG_START ); ret_val =e1000e_poll_eerd_eewr_done (hw,E1000_NVM_POLL_WRITE );
drivers/net/ethernet/intel/e1000e/ethtool.c +1 -1
@@ -39,7 +39,7 @@#include "e1000.h" -enum {NETDEV_STATS ,E1000_STATS }; +enum {NETDEV_STATS ,E1000_STATS };struct e1000_stats {char stat_string[ETH_GSTRING_LEN ];
drivers/net/ethernet/intel/e1000e/hw.h +1 -1
@@ -167,7 +167,7 @@ enum e1000_1000t_rx_status { e1000_1000t_rx_status_undefined =0xFF }; -enum e1000_rev_polarity { +enum e1000_rev_polarity { e1000_rev_polarity_normal =0 , e1000_rev_polarity_reversed, e1000_rev_polarity_undefined =0xFF
drivers/net/ethernet/intel/e1000e/ich8lan.c +24 -24
90 lines not on this page · raw message
drivers/net/ethernet/intel/e1000e/netdev.c +6 -6
@@ -1495,7 +1495,7 @@ static bool e1000_clean_jumbo_rx_irq(struct e1000_ring *rx_ring, int *work_done,unsigned int i;int cleaned_count =0 ;bool cleaned = false; -unsigned int total_rx_bytes=0 , total_rx_packets=0 ; +unsigned int total_rx_bytes =0 , total_rx_packets =0 ; i = rx_ring->next_to_clean; rx_desc =E1000_RX_DESC_EXT (*rx_ring, i);
@@ -2489,7 +2489,7 @@ static unsigned int e1000_update_itr(u16 itr_setting, int packets, int bytes)switch (itr_setting) {case lowest_latency:/* handle TSO and jumbo frames */ -if (bytes/packets >8000 ) +if (bytes / packets >8000 ) retval = bulk_latency;else if ((packets <5 ) && (bytes >512 )) retval = low_latency;
@@ -2497,13 +2497,13 @@ static unsigned int e1000_update_itr(u16 itr_setting, int packets, int bytes)case low_latency:/* 50 usec aka 20000 ints/s */ if (bytes >10000 ) {/* this if handles the TSO accounting */ -if (bytes/packets >8000 ) +if (bytes / packets >8000 ) retval = bulk_latency; -else if ((packets <10 ) || ((bytes/packets) >1200 )) +else if ((packets <10 ) || ((bytes / packets) >1200 )) retval = bulk_latency;else if ((packets >35 )) retval = lowest_latency; - }else if (bytes/packets >2000 ) { + }else if (bytes / packets >2000 ) { retval = bulk_latency; }else if (packets <=2 && bytes <512 ) { retval = lowest_latency;
@@ -5346,7 +5346,7 @@ static int e1000_transfer_dhcp_info(struct e1000_adapter *adapter,return 0 ; { -const struct iphdr *ip = (struct iphdr *)((u8 *)skb->data+14 ); +const struct iphdr *ip = (struct iphdr *)((u8 *)skb->data +14 );struct udphdr *udp;if (ip->protocol !=IPPROTO_UDP )
drivers/net/ethernet/intel/e1000e/phy.c +1 -1
@@ -1756,7 +1756,7 @@ s32 e1000e_phy_has_link_generic(struct e1000_hw *hw, u32 iterations,if (phy_status &BMSR_LSTATUS )break ;if (usec_interval >=1000 ) -mdelay (usec_interval/1000 ); +mdelay (usec_interval /1000 );else udelay (usec_interval); }
Signature · 1 line
1.7.11.7
PATCH 5/15 e1000e: cleanup LONG_LINE checkpatch warnings
In reply to Jeff KirsherFrom: Bruce Allan <[email protected]>
WARNING:LONG_LINE: line over 80 characters
--- drivers/net/ethernet/intel/e1000e/defines.h | 21 +++++++++++---------- drivers/net/ethernet/intel/e1000e/e1000.h | 6 ++++-- drivers/net/ethernet/intel/e1000e/ethtool.c | 3 ++- drivers/net/ethernet/intel/e1000e/netdev.c | 3 ++- drivers/net/ethernet/intel/e1000e/param.c | 6 ++++-- 5 files changed, 23 insertions(+), 16 deletions(-)
drivers/net/ethernet/intel/e1000e/defines.h +11 -10
@@ -66,7 +66,7 @@#define E1000_CTRL_EXT_LINK_MODE_PCIE_SERDES 0x00C00000#define E1000_CTRL_EXT_EIAME 0x01000000#define E1000_CTRL_EXT_DRV_LOAD 0x10000000/* Driver loaded bit for FW */ -#define E1000_CTRL_EXT_IAME 0x08000000/* Interrupt acknowledge Auto-mask */ +#define E1000_CTRL_EXT_IAME 0x08000000/* Int ACK Auto-mask */ #define E1000_CTRL_EXT_PBA_CLR 0x80000000/* PBA Clear */ #define E1000_CTRL_EXT_LSECCK 0x00001000#define E1000_CTRL_EXT_PHYPDEN 0x00100000
@@ -239,7 +239,7 @@#define E1000_STATUS_SPEED_1000 0x00000080/* Speed 1000Mb/s */ #define E1000_STATUS_LAN_INIT_DONE 0x00000200/* Lan Init Completion by NVM */ #define E1000_STATUS_PHYRA 0x00000400/* PHY Reset Asserted */ -#define E1000_STATUS_GIO_MASTER_ENABLE 0x00080000/* Status of Master requests. */ +#define E1000_STATUS_GIO_MASTER_ENABLE 0x00080000/* Master Req status */ #define HALF_DUPLEX 1#define FULL_DUPLEX 2
@@ -400,7 +400,8 @@#define E1000_ICR_RXDMT0 0x00000010/* Rx desc min. threshold (0) */ #define E1000_ICR_RXT0 0x00000080/* Rx timer intr (ring 0) */ #define E1000_ICR_ECCER 0x00400000/* Uncorrectable ECC Error */ -#define E1000_ICR_INT_ASSERTED 0x80000000/* If this bit asserted, the driver should claim the interrupt */ +/* If this bit asserted, the driver should claim the interrupt */ +#define E1000_ICR_INT_ASSERTED 0x80000000#define E1000_ICR_RXQ0 0x00100000/* Rx Queue 0 Interrupt */ #define E1000_ICR_RXQ1 0x00200000/* Rx Queue 1 Interrupt */ #define E1000_ICR_TXQ0 0x00400000/* Tx Queue 0 Interrupt */
@@ -583,13 +584,13 @@#define E1000_EECD_SEC1VAL 0x00400000/* Sector One Valid */ #define E1000_EECD_SEC1VAL_VALID_MASK (E1000_EECD_AUTO_RD | E1000_EECD_PRES) -#define E1000_NVM_RW_REG_DATA 16/* Offset to data in NVM read/write registers */ -#define E1000_NVM_RW_REG_DONE 2/* Offset to READ/WRITE done bit */ -#define E1000_NVM_RW_REG_START 1/* Start operation */ -#define E1000_NVM_RW_ADDR_SHIFT 2/* Shift to the address bits */ -#define E1000_NVM_POLL_WRITE 1/* Flag for polling for write complete */ -#define E1000_NVM_POLL_READ 0/* Flag for polling for read complete */ -#define E1000_FLASH_UPDATES 2000 +#define E1000_NVM_RW_REG_DATA 16/* Offset to data in NVM r/w regs */ +#define E1000_NVM_RW_REG_DONE 2/* Offset to READ/WRITE done bit */ +#define E1000_NVM_RW_REG_START 1/* Start operation */ +#define E1000_NVM_RW_ADDR_SHIFT 2/* Shift to the address bits */ +#define E1000_NVM_POLL_WRITE 1/* Flag for polling write complete */ +#define E1000_NVM_POLL_READ 0/* Flag for polling read complete */ +#define E1000_FLASH_UPDATES 2000/* NVM Word Offsets */ #define NVM_COMPAT 0x0003
drivers/net/ethernet/intel/e1000e/e1000.h +4 -2
@@ -558,12 +558,14 @@ static inline s32 e1000e_update_nvm_checksum(struct e1000_hw *hw)return hw->nvm.ops.update (hw); } -static inline s32 e1000_read_nvm (struct e1000_hw *hw,u16 offset,u16 words,u16 *data) +static inline s32 e1000_read_nvm (struct e1000_hw *hw,u16 offset,u16 words, +u16 *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) +static inline s32 e1000_write_nvm (struct e1000_hw *hw,u16 offset,u16 words, +u16 *data) {return hw->nvm.ops.write (hw, offset, words, data); }
drivers/net/ethernet/intel/e1000e/ethtool.c +2 -1
@@ -549,7 +549,8 @@ static int e1000_set_eeprom(struct net_device *netdev,if (eeprom->len ==0 )return -EOPNOTSUPP ; -if (eeprom->magic != (adapter->pdev->vendor | (adapter->pdev->device <<16 ))) +if (eeprom->magic != + (adapter->pdev->vendor | (adapter->pdev->device <<16 )))return -EFAULT ;if (adapter->flags &FLAG_READ_ONLY_NVM )
drivers/net/ethernet/intel/e1000e/netdev.c +2 -1
@@ -6918,7 +6918,8 @@ static DEFINE_PCI_DEVICE_TABLE(e1000_pci_tbl) = { { PCI_VDEVICE(INTEL, E1000_DEV_ID_82571EB_COPPER), board_82571 }, { PCI_VDEVICE(INTEL, E1000_DEV_ID_82571EB_FIBER), board_82571 }, { PCI_VDEVICE(INTEL, E1000_DEV_ID_82571EB_QUAD_COPPER), board_82571 }, - { PCI_VDEVICE(INTEL, E1000_DEV_ID_82571EB_QUAD_COPPER_LP), board_82571 }, + { PCI_VDEVICE(INTEL, E1000_DEV_ID_82571EB_QUAD_COPPER_LP), + board_82571 }, { PCI_VDEVICE(INTEL, E1000_DEV_ID_82571EB_QUAD_FIBER), board_82571 }, { PCI_VDEVICE(INTEL, E1000_DEV_ID_82571EB_SERDES), board_82571 }, { PCI_VDEVICE(INTEL, E1000_DEV_ID_82571EB_SERDES_DUAL), board_82571 },
drivers/net/ethernet/intel/e1000e/param.c +4 -2
@@ -143,7 +143,8 @@ E1000_PARAM(KumeranLockLoss, "Enable Kumeran lock loss workaround");* * Default Value: 1 (enabled) */ -E1000_PARAM (WriteProtectNVM,"Write-protect NVM [WARNING: disabling this can lead to corrupted NVM]" ); +E1000_PARAM (WriteProtectNVM, +"Write-protect NVM [WARNING: disabling this can lead to corrupted NVM]" );/* Enable CRC Stripping *
@@ -500,7 +501,8 @@ void e1000e_check_options(struct e1000_adapter *adapter)if (adapter->flags &FLAG_IS_ICH ) {if (num_WriteProtectNVM > bd) { -unsigned int write_protect_nvm = WriteProtectNVM[bd]; +unsigned int write_protect_nvm = + WriteProtectNVM[bd];e1000_validate_option (&write_protect_nvm, &opt, adapter);if (write_protect_nvm)
Signature · 1 line
1.7.11.7
PATCH 6/15 e1000e: cleanup LEADING_SPACE checkpatch warnings
In reply to Jeff KirsherFrom: Bruce Allan <[email protected]>
WARNING:LEADING_SPACE: please, no spaces at the start of a line
--- drivers/net/ethernet/intel/e1000e/e1000.h | 4 ++-- drivers/net/ethernet/intel/e1000e/netdev.c | 4 ++-- drivers/net/ethernet/intel/e1000e/phy.c | 10 +++++----- 3 files changed, 9 insertions(+), 9 deletions(-)
drivers/net/ethernet/intel/e1000e/e1000.h +2 -2
@@ -487,8 +487,8 @@ extern int e1000e_setup_tx_resources(struct e1000_ring *ring);extern void e1000e_free_rx_resources (struct e1000_ring *ring);extern void e1000e_free_tx_resources (struct e1000_ring *ring);extern struct rtnl_link_stats64 *e1000e_get_stats64 (struct net_device *netdev, -struct rtnl_link_stats64 - *stats); +struct rtnl_link_stats64 + *stats);extern void e1000e_set_interrupt_capability (struct e1000_adapter *adapter);extern void e1000e_reset_interrupt_capability (struct e1000_adapter *adapter);extern void e1000e_get_hw_control (struct e1000_adapter *adapter);
drivers/net/ethernet/intel/e1000e/netdev.c +2 -2
@@ -1468,7 +1468,7 @@ next_desc:* e1000_consume_page - helper function **/ static void e1000_consume_page (struct e1000_buffer *bi,struct sk_buff *skb, -u16 length) +u16 length) { bi->page =NULL ; skb->len += length;
@@ -5571,7 +5571,7 @@ static void e1000_reset_task(struct work_struct *work)* Returns the address of the device statistics structure. **/ struct rtnl_link_stats64 *e1000e_get_stats64 (struct net_device *netdev, -struct rtnl_link_stats64 *stats) +struct rtnl_link_stats64 *stats) {struct e1000_adapter *adapter =netdev_priv (netdev);
drivers/net/ethernet/intel/e1000e/phy.c +5 -5
@@ -324,7 +324,7 @@ s32 e1000_set_page_igp(struct e1000_hw *hw, u16 page)* semaphores before exiting. **/ static s32 __e1000e_read_phy_reg_igp (struct e1000_hw *hw,u32 offset,u16 *data, -bool locked) +bool locked) {s32 ret_val =0 ;
@@ -391,7 +391,7 @@ s32 e1000e_read_phy_reg_igp_locked(struct e1000_hw *hw, u32 offset, u16 *data)* at the offset. Release any acquired semaphores before exiting. **/ static s32 __e1000e_write_phy_reg_igp (struct e1000_hw *hw,u32 offset,u16 data, -bool locked) +bool locked) {s32 ret_val =0 ;
@@ -458,7 +458,7 @@ s32 e1000e_write_phy_reg_igp_locked(struct e1000_hw *hw, u32 offset, u16 data)* Release any acquired semaphores before exiting. **/ static s32 __e1000_read_kmrn_reg (struct e1000_hw *hw,u32 offset,u16 *data, -bool locked) +bool locked) {u32 kmrnctrlsta;
@@ -531,7 +531,7 @@ s32 e1000e_read_kmrn_reg_locked(struct e1000_hw *hw, u32 offset, u16 *data)* before exiting. **/ static s32 __e1000_write_kmrn_reg (struct e1000_hw *hw,u32 offset,u16 data, -bool locked) +bool locked) {u32 kmrnctrlsta;
@@ -2987,7 +2987,7 @@ static u32 e1000_get_phy_addr_for_hv_page(u32 page)* These accesses done with PHY address 2 and without using pages. **/ static s32 e1000_access_phy_debug_regs_hv (struct e1000_hw *hw,u32 offset, -u16 *data,bool read) +u16 *data,bool read) {s32 ret_val;u32 addr_reg;
Signature · 1 line
1.7.11.7
PATCH 7/15 e1000e: cleanup PARENTHESIS_ALIGNMENT checkpatch checks
In reply to Jeff KirsherFrom: Bruce Allan <[email protected]>
CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis
--- drivers/net/ethernet/intel/e1000e/80003es2lan.c | 39 +++++------ drivers/net/ethernet/intel/e1000e/82571.c | 2 +- drivers/net/ethernet/intel/e1000e/ethtool.c | 71 ++++++++++--------- drivers/net/ethernet/intel/e1000e/ich8lan.c | 40 +++++------ drivers/net/ethernet/intel/e1000e/netdev.c | 90 ++++++++++++++----------- drivers/net/ethernet/intel/e1000e/param.c | 15 ++--- drivers/net/ethernet/intel/e1000e/phy.c | 9 ++- 7 files changed, 139 insertions(+), 127 deletions(-)
drivers/net/ethernet/intel/e1000e/80003es2lan.c +17 -22
@@ -580,7 +580,7 @@ static s32 e1000_phy_force_speed_duplex_80003es2lan(struct e1000_hw *hw)e_dbg ("Waiting for forced speed/duplex link on GG82563 phy.\n" ); ret_val =e1000e_phy_has_link_generic (hw,PHY_FORCE_LIMIT , -100000 , &link); +100000 , &link);if (ret_val)return ret_val;
@@ -595,7 +595,7 @@ static s32 e1000_phy_force_speed_duplex_80003es2lan(struct e1000_hw *hw)/* Try once more */ ret_val =e1000e_phy_has_link_generic (hw,PHY_FORCE_LIMIT , -100000 , &link); +100000 , &link);if (ret_val)return ret_val; }
@@ -666,14 +666,12 @@ static s32 e1000_get_link_up_info_80003es2lan(struct e1000_hw *hw, u16 *speed,s32 ret_val;if (hw->phy.media_type == e1000_media_type_copper) { - ret_val =e1000e_get_speed_and_duplex_copper (hw, - speed, - duplex); + ret_val =e1000e_get_speed_and_duplex_copper (hw, speed, duplex); hw->phy.ops.cfg_on_link_up (hw); }else { ret_val =e1000e_get_speed_and_duplex_fiber_serdes (hw, - speed, - duplex); + speed, + duplex); }return ret_val;
@@ -823,7 +821,7 @@ static s32 e1000_init_hw_80003es2lan(struct e1000_hw *hw) E1000_KMRNCTRLSTA_OFFSET_SHIFT, &i);if (!ret_val) {if ((i &E1000_KMRNCTRLSTA_OPMODE_MASK ) == -E1000_KMRNCTRLSTA_OPMODE_INBAND_MDIO ) +E1000_KMRNCTRLSTA_OPMODE_INBAND_MDIO ) hw->dev_spec.e80003es2lan.mdic_wa_enable = false; }
@@ -890,7 +888,7 @@ static s32 e1000_copper_link_setup_gg82563_80003es2lan(struct e1000_hw *hw) {struct e1000_phy_info *phy = &hw->phy;s32 ret_val; -u32 ctrl_ext; +u32 reg;u16 data; ret_val =e1e_rphy (hw,GG82563_PHY_MAC_SPEC_CTRL , &data);
@@ -953,22 +951,19 @@ static s32 e1000_copper_link_setup_gg82563_80003es2lan(struct e1000_hw *hw) }/* Bypass Rx and Tx FIFO's */ - ret_val =e1000_write_kmrn_reg_80003es2lan (hw, -E1000_KMRNCTRLSTA_OFFSET_FIFO_CTRL , -E1000_KMRNCTRLSTA_FIFO_CTRL_RX_BYPASS | -E1000_KMRNCTRLSTA_FIFO_CTRL_TX_BYPASS ); + reg =E1000_KMRNCTRLSTA_OFFSET_FIFO_CTRL ; + data = (E1000_KMRNCTRLSTA_FIFO_CTRL_RX_BYPASS | +E1000_KMRNCTRLSTA_FIFO_CTRL_TX_BYPASS ); + ret_val =e1000_write_kmrn_reg_80003es2lan (hw, reg, data);if (ret_val)return ret_val; - ret_val =e1000_read_kmrn_reg_80003es2lan (hw, -E1000_KMRNCTRLSTA_OFFSET_MAC2PHY_OPMODE , - &data); + reg =E1000_KMRNCTRLSTA_OFFSET_MAC2PHY_OPMODE ; + ret_val =e1000_read_kmrn_reg_80003es2lan (hw, reg, &data);if (ret_val)return ret_val; data |=E1000_KMRNCTRLSTA_OPMODE_E_IDLE ; - ret_val =e1000_write_kmrn_reg_80003es2lan (hw, -E1000_KMRNCTRLSTA_OFFSET_MAC2PHY_OPMODE , - data); + ret_val =e1000_write_kmrn_reg_80003es2lan (hw, reg, data);if (ret_val)return ret_val;
@@ -981,9 +976,9 @@ static s32 e1000_copper_link_setup_gg82563_80003es2lan(struct e1000_hw *hw)if (ret_val)return ret_val; - ctrl_ext =er32 (CTRL_EXT ); - ctrl_ext &= ~(E1000_CTRL_EXT_LINK_MODE_MASK ); -ew32 (CTRL_EXT , ctrl_ext); + reg =er32 (CTRL_EXT ); + reg &= ~E1000_CTRL_EXT_LINK_MODE_MASK ; +ew32 (CTRL_EXT , reg); ret_val =e1e_rphy (hw,GG82563_PHY_PWR_MGMT_CTRL , &data);if (ret_val)
drivers/net/ethernet/intel/e1000e/82571.c +1 -1
@@ -184,7 +184,7 @@ static s32 e1000_init_nvm_params_82571(struct e1000_hw *hw)default : nvm->type = e1000_nvm_eeprom_spi; size = (u16)((eecd &E1000_EECD_SIZE_EX_MASK ) >> -E1000_EECD_SIZE_EX_SHIFT ); +E1000_EECD_SIZE_EX_SHIFT );/* Added to a constant, "size" becomes the left-shift value * for setting word_size. */
drivers/net/ethernet/intel/e1000e/ethtool.c +40 -31
145 lines not on this page · raw message
drivers/net/ethernet/intel/e1000e/ich8lan.c +21 -19
@@ -1804,8 +1804,8 @@ s32 e1000_lv_jumbo_workaround_ich8lan(struct e1000_hw *hw, bool enable)ew32 (RCTL , mac_reg); ret_val =e1000e_read_kmrn_reg (hw, -E1000_KMRNCTRLSTA_CTRL_OFFSET , - &data); +E1000_KMRNCTRLSTA_CTRL_OFFSET , + &data);if (ret_val)return ret_val; ret_val = e1000e_write_kmrn_reg(hw,
@@ -1814,8 +1814,8 @@ s32 e1000_lv_jumbo_workaround_ich8lan(struct e1000_hw *hw, bool enable)if (ret_val)return ret_val; ret_val =e1000e_read_kmrn_reg (hw, -E1000_KMRNCTRLSTA_HD_CTRL , - &data); +E1000_KMRNCTRLSTA_HD_CTRL , + &data);if (ret_val)return ret_val; data &= ~(0xF <<8 );
@@ -1862,8 +1862,8 @@ s32 e1000_lv_jumbo_workaround_ich8lan(struct e1000_hw *hw, bool enable)ew32 (RCTL , mac_reg); ret_val =e1000e_read_kmrn_reg (hw, -E1000_KMRNCTRLSTA_CTRL_OFFSET , - &data); +E1000_KMRNCTRLSTA_CTRL_OFFSET , + &data);if (ret_val)return ret_val; ret_val = e1000e_write_kmrn_reg(hw,
@@ -1872,8 +1872,8 @@ s32 e1000_lv_jumbo_workaround_ich8lan(struct e1000_hw *hw, bool enable)if (ret_val)return ret_val; ret_val =e1000e_read_kmrn_reg (hw, -E1000_KMRNCTRLSTA_HD_CTRL , - &data); +E1000_KMRNCTRLSTA_HD_CTRL , + &data);if (ret_val)return ret_val; data &= ~(0xF <<8 );
@@ -2653,8 +2653,9 @@ static s32 e1000_read_flash_data_ich8lan(struct e1000_hw *hw, u32 offset,ew32flash (ICH_FLASH_FADDR , flash_linear_addr); - ret_val =e1000_flash_cycle_ich8lan (hw, -ICH_FLASH_READ_COMMAND_TIMEOUT ); + ret_val = +e1000_flash_cycle_ich8lan (hw, +ICH_FLASH_READ_COMMAND_TIMEOUT );/* Check if FCERR is set to 1, if set to 1, clear it * and try the whole sequence a few more times, else
@@ -3017,8 +3018,9 @@ static s32 e1000_write_flash_data_ich8lan(struct e1000_hw *hw, u32 offset,/* check if FCERR is set to 1 , if set to 1, clear it * and try the whole sequence a few more times else done */ - ret_val =e1000_flash_cycle_ich8lan (hw, -ICH_FLASH_WRITE_COMMAND_TIMEOUT ); + ret_val = +e1000_flash_cycle_ich8lan (hw, +ICH_FLASH_WRITE_COMMAND_TIMEOUT );if (!ret_val)break ;
@@ -3150,6 +3152,8 @@ static s32 e1000_erase_flash_bank_ich8lan(struct e1000_hw *hw, u32 bank)for (j =0 ; j < iteration ; j++) { do { + u32 timeout = ICH_FLASH_ERASE_COMMAND_TIMEOUT; + /* Steps */ ret_val = e1000_flash_cycle_init_ich8lan(hw); if (ret_val)
@@ -3169,8 +3173,7 @@ static s32 e1000_erase_flash_bank_ich8lan(struct e1000_hw *hw, u32 bank) flash_linear_addr += (j * sector_size);ew32flash (ICH_FLASH_FADDR , flash_linear_addr); - ret_val =e1000_flash_cycle_ich8lan (hw, -ICH_FLASH_ERASE_COMMAND_TIMEOUT ); + ret_val =e1000_flash_cycle_ich8lan (hw, timeout);if (!ret_val)break ;
@@ -3625,8 +3628,7 @@ static s32 e1000_setup_link_ich8lan(struct e1000_hw *hw)*/ hw->fc.current_mode = hw->fc.requested_mode; -e_dbg ("After fix-ups FlowControl is now = %x\n" , - hw->fc.current_mode); +e_dbg ("After fix-ups FlowControl is now = %x\n" , hw->fc.current_mode);/* Continue to configure the copper link. */ ret_val = hw->mac.ops.setup_physical_interface (hw);
@@ -3838,7 +3840,7 @@ static s32 e1000_kmrn_lock_loss_workaround_ich8lan(struct e1000_hw *hw)* /disabled - false). **/ void e1000e_set_kmrn_lock_loss_workaround_ich8lan (struct e1000_hw *hw, -bool state) +bool state) {struct e1000_dev_spec_ich8lan *dev_spec = &hw->dev_spec.ich8lan;
@@ -3920,12 +3922,12 @@ void e1000e_gig_downshift_workaround_ich8lan(struct e1000_hw *hw)return ; ret_val =e1000e_read_kmrn_reg (hw,E1000_KMRNCTRLSTA_DIAG_OFFSET , - ®_data); + ®_data);if (ret_val)return ; reg_data |=E1000_KMRNCTRLSTA_DIAG_NELPBK ; ret_val =e1000e_write_kmrn_reg (hw,E1000_KMRNCTRLSTA_DIAG_OFFSET , - reg_data); + reg_data);if (ret_val)return ; reg_data &= ~E1000_KMRNCTRLSTA_DIAG_NELPBK ;
drivers/net/ethernet/intel/e1000e/netdev.c +49 -41
216 lines not on this page · raw message
drivers/net/ethernet/intel/e1000e/param.c +7 -8
@@ -45,7 +45,7 @@unsigned int copybreak =COPYBREAK_DEFAULT ;module_param (copybreak, uint,0644 );MODULE_PARM_DESC (copybreak, -"Maximum size of packet that is copied to a new buffer on receive" ); +"Maximum size of packet that is copied to a new buffer on receive" );/* All parameters are treated the same, as an integer array of values. * This macro just reduces the need to repeat the same declaration code
@@ -478,18 +478,17 @@ void e1000e_check_options(struct e1000_adapter *adapter) .err = "defaulting to Enabled", .def = OPTION_ENABLED }; +bool enabled = opt.def;if (num_KumeranLockLoss > bd) {unsigned int kmrn_lock_loss = KumeranLockLoss[bd];e1000_validate_option (&kmrn_lock_loss, &opt, adapter); -if (hw->mac.type == e1000_ich8lan) -e1000e_set_kmrn_lock_loss_workaround_ich8lan (hw, - kmrn_lock_loss); - }else { -if (hw->mac.type == e1000_ich8lan) -e1000e_set_kmrn_lock_loss_workaround_ich8lan (hw, - opt.def); + enabled = kmrn_lock_loss; } + +if (hw->mac.type == e1000_ich8lan) +e1000e_set_kmrn_lock_loss_workaround_ich8lan (hw, + enabled); } {/* Write-protect NVM */ static const struct e1000_option opt = {
drivers/net/ethernet/intel/e1000e/phy.c +4 -5
@@ -410,8 +410,7 @@ static s32 __e1000e_write_phy_reg_igp(struct e1000_hw *hw, u32 offset, u16 data, (u16)offset);if (!ret_val) ret_val =e1000e_write_phy_reg_mdic (hw,MAX_PHY_REG_ADDRESS & - offset, - data); + offset, data);if (!locked) hw->phy.ops.release (hw);
@@ -1296,7 +1295,7 @@ s32 e1000e_phy_force_speed_duplex_m88(struct e1000_hw *hw)e_dbg ("Waiting for forced speed/duplex link on M88 phy.\n" ); ret_val =e1000e_phy_has_link_generic (hw,PHY_FORCE_LIMIT , -100000 , &link); +100000 , &link);if (ret_val)return ret_val;
@@ -1319,7 +1318,7 @@ s32 e1000e_phy_force_speed_duplex_m88(struct e1000_hw *hw)/* Try once more */ ret_val =e1000e_phy_has_link_generic (hw,PHY_FORCE_LIMIT , -100000 , &link); +100000 , &link);if (ret_val)return ret_val; }
@@ -1733,7 +1732,7 @@ static s32 e1000_wait_autoneg(struct e1000_hw *hw)* Polls the PHY status register for link, 'iterations' number of times. **/ s32 e1000e_phy_has_link_generic (struct e1000_hw *hw,u32 iterations, -u32 usec_interval,bool *success) +u32 usec_interval,bool *success) {s32 ret_val =0 ;u16 i, phy_status;
Signature · 1 line
1.7.11.7
PATCH 8/15 e1000e: cleanup SPACING checkpatch checks
In reply to Jeff KirsherFrom: Bruce Allan <[email protected]>
CHECK:SPACING: No space is necessary after a cast CHECK:SPACING: space prohibited before semicolon
--- drivers/net/ethernet/intel/e1000e/ethtool.c | 16 ++++++++-------- drivers/net/ethernet/intel/e1000e/ich8lan.c | 4 ++-- drivers/net/ethernet/intel/e1000e/netdev.c | 10 +++++----- drivers/net/ethernet/intel/e1000e/phy.c | 2 +- 4 files changed, 16 insertions(+), 16 deletions(-)
drivers/net/ethernet/intel/e1000e/ethtool.c +8 -8
@@ -925,7 +925,7 @@ static int e1000_eeprom_test(struct e1000_adapter *adapter, u64 *data) }/* If Checksum is not Correct return error else test passed */ -if ((checksum != (u16 )NVM_SUM ) && !(*data)) +if ((checksum != (u16 )NVM_SUM ) && !(*data)) *data =2 ;return *data;
@@ -933,7 +933,7 @@ static int e1000_eeprom_test(struct e1000_adapter *adapter, u64 *data)static irqreturn_t e1000_test_intr (int __always_unused irq,void *data) { -struct net_device *netdev = (struct net_device *) data; +struct net_device *netdev = (struct net_device *)data;struct e1000_adapter *adapter =netdev_priv (netdev);struct e1000_hw *hw = &adapter->hw;
@@ -1158,8 +1158,8 @@ static int e1000_setup_desc_rings(struct e1000_adapter *adapter) tx_ring->next_to_use =0 ; tx_ring->next_to_clean =0 ; -ew32 (TDBAL (0 ), ((u64 ) tx_ring->dma &0x00000000FFFFFFFF )); -ew32 (TDBAH (0 ), ((u64 ) tx_ring->dma >>32 )); +ew32 (TDBAL (0 ), ((u64 )tx_ring->dma &0x00000000FFFFFFFF )); +ew32 (TDBAH (0 ), ((u64 )tx_ring->dma >>32 ));ew32 (TDLEN (0 ), tx_ring->count *sizeof (struct e1000_tx_desc ));ew32 (TDH (0 ),0 );ew32 (TDT (0 ),0 );
@@ -1222,8 +1222,8 @@ static int e1000_setup_desc_rings(struct e1000_adapter *adapter) rctl =er32 (RCTL );if (!(adapter->flags2 &FLAG2_NO_DISABLE_RX ))ew32 (RCTL , rctl & ~E1000_RCTL_EN ); -ew32 (RDBAL (0 ), ((u64 ) rx_ring->dma &0xFFFFFFFF )); -ew32 (RDBAH (0 ), ((u64 ) rx_ring->dma >>32 )); +ew32 (RDBAL (0 ), ((u64 )rx_ring->dma &0xFFFFFFFF )); +ew32 (RDBAH (0 ), ((u64 )rx_ring->dma >>32 ));ew32 (RDLEN (0 ), rx_ring->size);ew32 (RDH (0 ),0 );ew32 (RDT (0 ),0 );
@@ -1986,11 +1986,11 @@ static void e1000_get_ethtool_stats(struct net_device *netdev,for (i =0 ; i <E1000_GLOBAL_STATS_LEN ; i++) {switch (e1000_gstrings_stats[i].type) {case NETDEV_STATS : - p = (char *) &net_stats + + p = (char *)&net_stats + e1000_gstrings_stats[i].stat_offset;break ;case E1000_STATS : - p = (char *) adapter + + p = (char *)adapter + e1000_gstrings_stats[i].stat_offset;break ;default :
drivers/net/ethernet/intel/e1000e/ich8lan.c +2 -2
@@ -3150,7 +3150,7 @@ static s32 e1000_erase_flash_bank_ich8lan(struct e1000_hw *hw, u32 bank) flash_linear_addr = hw->nvm.flash_base_addr; flash_linear_addr += (bank) ? flash_bank_size :0 ; -for (j =0 ; j < iteration ; j++) { +for (j =0 ; j < iteration; j++) { do { u32 timeout = ICH_FLASH_ERASE_COMMAND_TIMEOUT;
@@ -3501,7 +3501,7 @@ static s32 e1000_init_hw_ich8lan(struct e1000_hw *hw)if (mac->type == e1000_ich8lan) snoop =PCIE_ICH8_SNOOP_ALL ;else - snoop = (u32 ) ~(PCIE_NO_SNOOP_ALL ); + snoop = (u32 )~(PCIE_NO_SNOOP_ALL );e1000e_set_pcie_no_snoop (hw, snoop); ctrl_ext =er32 (CTRL_EXT );
drivers/net/ethernet/intel/e1000e/netdev.c +5 -5
@@ -4452,7 +4452,7 @@ static void e1000e_update_phy_task(struct work_struct *work)**/ static void e1000_update_phy_info (unsigned long data) { -struct e1000_adapter *adapter = (struct e1000_adapter *) data; +struct e1000_adapter *adapter = (struct e1000_adapter *)data;if (test_bit (__E1000_DOWN, &adapter->state))return ;
@@ -4784,7 +4784,7 @@ static void e1000e_check_82574_phy_workaround(struct e1000_adapter *adapter)**/ static void e1000_watchdog (unsigned long data) { -struct e1000_adapter *adapter = (struct e1000_adapter *) data; +struct e1000_adapter *adapter = (struct e1000_adapter *)data;/* Do the rest outside of interrupt context */ schedule_work (&adapter->watchdog_task);
@@ -5350,7 +5350,7 @@ static int e1000_transfer_dhcp_info(struct e1000_adapter *adapter,if (skb->len <=MINIMUM_DHCP_PACKET_SIZE )return 0 ; -if (((struct ethhdr *) skb->data)->h_proto !=htons (ETH_P_IP )) +if (((struct ethhdr *)skb->data)->h_proto !=htons (ETH_P_IP ))return 0 ; {
@@ -6727,11 +6727,11 @@ static int e1000_probe(struct pci_dev *pdev, const struct pci_device_id *ent)init_timer (&adapter->watchdog_timer); adapter->watchdog_timer.function = e1000_watchdog; - adapter->watchdog_timer.data = (unsigned long ) adapter; + adapter->watchdog_timer.data = (unsigned long )adapter;init_timer (&adapter->phy_info_timer); adapter->phy_info_timer.function = e1000_update_phy_info; - adapter->phy_info_timer.data = (unsigned long ) adapter; + adapter->phy_info_timer.data = (unsigned long )adapter;INIT_WORK (&adapter->reset_task, e1000_reset_task);INIT_WORK (&adapter->watchdog_task, e1000_watchdog_task);
drivers/net/ethernet/intel/e1000e/phy.c +1 -1
@@ -175,7 +175,7 @@ s32 e1000e_read_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 *data)e_dbg ("MDI Error\n" );return -E1000_ERR_PHY ; } - *data = (u16 ) mdic; + *data = (u16 )mdic;/* Allow some time after each MDIC transaction to avoid * reading duplicate data in the next MDIC transaction.
Signature · 1 line
1.7.11.7
PATCH 9/15 e1000e: cleanup (add/remove) blank lines where appropriate
In reply to Jeff KirsherFrom: Bruce Allan <[email protected]>
--- drivers/net/ethernet/intel/e1000e/80003es2lan.c | 2 +- drivers/net/ethernet/intel/e1000e/82571.c | 2 +- drivers/net/ethernet/intel/e1000e/defines.h | 1 - drivers/net/ethernet/intel/e1000e/e1000.h | 1 - drivers/net/ethernet/intel/e1000e/ethtool.c | 2 ++ drivers/net/ethernet/intel/e1000e/ich8lan.c | 2 +- drivers/net/ethernet/intel/e1000e/netdev.c | 3 +-- drivers/net/ethernet/intel/e1000e/phy.c | 2 ++ 8 files changed, 8 insertions(+), 7 deletions(-)
drivers/net/ethernet/intel/e1000e/80003es2lan.c +1 -1
@@ -38,6 +38,7 @@*/ static const u16 e1000_gg82563_cable_length_table[] = {0 ,60 ,115 ,150 ,150 ,60 ,115 ,150 ,180 ,180 ,0xFF }; +#define GG82563_CABLE_LENGTH_TABLE_SIZE \ ARRAY_SIZE(e1000_gg82563_cable_length_table)
@@ -1417,4 +1418,3 @@ const struct e1000_info e1000_es2_info = { .phy_ops = &es2_phy_ops, .nvm_ops = &es2_nvm_ops, }; -
drivers/net/ethernet/intel/e1000e/82571.c +1 -1
@@ -526,6 +526,7 @@ static void e1000_put_hw_semaphore_82571(struct e1000_hw *hw) swsm &= ~(E1000_SWSM_SMBI |E1000_SWSM_SWESMBI );ew32 (SWSM , swsm); } +/** * e1000_get_hw_semaphore_82573 - Acquire hardware semaphore * @hw: pointer to the HW structure
@@ -2066,4 +2067,3 @@ const struct e1000_info e1000_82583_info = { .phy_ops = &e82_phy_ops_bm, .nvm_ops = &e82571_nvm_ops, }; -
drivers/net/ethernet/intel/e1000e/defines.h +0 -1
@@ -244,7 +244,6 @@#define HALF_DUPLEX 1#define FULL_DUPLEX 2 -#define ADVERTISE_10_HALF 0x0001#define ADVERTISE_10_FULL 0x0002#define ADVERTISE_100_HALF 0x0004
drivers/net/ethernet/intel/e1000e/e1000.h +0 -1
@@ -61,7 +61,6 @@ struct e1000_info; #define e_notice(format, arg...) \ netdev_notice(adapter->netdev, format, ## arg) -/* Interrupt modes, as used by the IntMode parameter */ #define E1000E_INT_MODE_LEGACY 0#define E1000E_INT_MODE_MSI 1
drivers/net/ethernet/intel/e1000e/ethtool.c +2 -0
@@ -120,6 +120,7 @@ static const char e1000_gstrings_test[][ETH_GSTRING_LEN] = {"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,
@@ -783,6 +784,7 @@ static bool reg_set_and_check(struct e1000_adapter *adapter, u64 *data, }return 0 ; } +#define REG_PATTERN_TEST_ARRAY (reg, offset, mask, write) \ do { \ if (reg_pattern_test(adapter, data, reg, offset, mask, write)) \
drivers/net/ethernet/intel/e1000e/ich8lan.c +1 -1
@@ -1606,7 +1606,6 @@ release:return ret_val; } -/** * e1000_set_mdio_slow_mode_hv - Set slow MDIO access mode * @hw: pointer to the HW structure
@@ -3517,6 +3516,7 @@ static s32 e1000_init_hw_ich8lan(struct e1000_hw *hw)return ret_val; } +/** * e1000_initialize_hw_bits_ich8lan - Initialize required hardware bits * @hw: pointer to the HW structure
drivers/net/ethernet/intel/e1000e/netdev.c +1 -2
@@ -1542,7 +1542,6 @@ static bool e1000_clean_jumbo_rx_irq(struct e1000_ring *rx_ring, int *work_done, rx_ring->rx_skb_top =NULL ; goto next_desc; } -#define rxtop (rx_ring->rx_skb_top)if (!(staterr &E1000_RXD_STAT_EOP )) {/* this descriptor is only the beginning (or middle) */
@@ -1916,7 +1915,6 @@ static irqreturn_t e1000_intr_msix_tx(int __always_unused irq, void *data)struct e1000_hw *hw = &adapter->hw;struct e1000_ring *tx_ring = adapter->tx_ring; - adapter->total_tx_bytes =0 ; adapter->total_tx_packets =0 ;
@@ -4384,6 +4382,7 @@ static int e1000_close(struct net_device *netdev)return 0 ; } +/** * e1000_set_mac - Change the Ethernet Address of the NIC * @netdev: network interface device structure
drivers/net/ethernet/intel/e1000e/phy.c +2 -0
@@ -38,6 +38,7 @@ static s32 e1000_access_phy_debug_regs_hv(struct e1000_hw *hw, u32 offset,/* Cable length tables */ static const u16 e1000_m88_cable_length_table[] = {0 ,50 ,80 ,110 ,140 ,140 ,E1000_CABLE_LENGTH_UNDEFINED }; +#define M88E1000_CABLE_LENGTH_TABLE_SIZE \ ARRAY_SIZE(e1000_m88_cable_length_table)
@@ -50,6 +51,7 @@ static const u16 e1000_igp_2_cable_length_table[] = {87 ,92 ,96 ,100 ,104 ,108 ,111 ,114 ,117 ,119 ,121 ,83 ,89 ,95 ,100 ,105 ,109 ,113 ,116 ,119 ,122 ,124 ,104 ,109 ,114 ,118 ,121 , 124}; +#define IGP02E1000_CABLE_LENGTH_TABLE_SIZE \ ARRAY_SIZE(e1000_igp_2_cable_length_table)
Signature · 1 line
1.7.11.7
PATCH 10/15 e1000e: cleanup unusually placed comments
In reply to Jeff KirsherFrom: Bruce Allan <[email protected]>
--- drivers/net/ethernet/intel/e1000e/80003es2lan.c | 2 +- drivers/net/ethernet/intel/e1000e/82571.c | 2 +- drivers/net/ethernet/intel/e1000e/e1000.h | 5 ++-- drivers/net/ethernet/intel/e1000e/ethtool.c | 15 ++++++----- drivers/net/ethernet/intel/e1000e/ich8lan.c | 2 +- drivers/net/ethernet/intel/e1000e/netdev.c | 2 +- drivers/net/ethernet/intel/e1000e/param.c | 36 ++++++++++++++++--------- 7 files changed, 39 insertions(+), 25 deletions(-)
drivers/net/ethernet/intel/e1000e/80003es2lan.c +1 -1
@@ -753,9 +753,9 @@ static s32 e1000_init_hw_80003es2lan(struct e1000_hw *hw)/* Initialize identification LED */ ret_val = mac->ops.id_led_init (hw); +/* An error is not fatal and we should not stop init due to this */ if (ret_val)e_dbg ("Error initializing identification LED\n" ); -/* 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/ethernet/intel/e1000e/82571.c +1 -1
@@ -1096,9 +1096,9 @@ static s32 e1000_init_hw_82571(struct e1000_hw *hw)/* Initialize identification LED */ ret_val = mac->ops.id_led_init (hw); +/* An error is not fatal and we should not stop init due to this */ if (ret_val)e_dbg ("Error initializing identification LED\n" ); -/* 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/ethernet/intel/e1000e/e1000.h +2 -3
@@ -238,9 +238,8 @@ struct e1000_adapter {u16 tx_itr;u16 rx_itr; -/* Tx */ -struct e1000_ring *tx_ring/* One per active queue */ -____cacheline_aligned_in_smp ; +/* Tx - one ring per active queue */ +struct e1000_ring *tx_ring____cacheline_aligned_in_smp ;u32 tx_fifo_limit;struct napi_struct napi;
drivers/net/ethernet/intel/e1000e/ethtool.c +9 -6
@@ -812,10 +812,10 @@ static int e1000_reg_test(struct e1000_adapter *adapter, u64 *data)u32 wlock_mac =0 ;/* The status register is Read Only, so a write should fail. -* Some bits that get toggled are ignored. +* Some bits that get toggled are ignored. There are several bits +* on newer hardware that are r/w. */ switch (mac->type) { -/* there are several bits on newer hardware that are r/w */ case e1000_82571:case e1000_82572:case e1000_80003es2lan:
@@ -1600,8 +1600,10 @@ static int e1000_run_loopback_test(struct e1000_adapter *adapter) k =0 ; l =0 ; -for (j =0 ; j <= lc; j++) {/* loop count loop */ -for (i =0 ; i <64 ; i++) {/* send the packets */ +/* loop count loop */ +for (j =0 ; j <= lc; j++) { +/* send the packets */ +for (i =0 ; i <64 ; i++) { buffer_info = &tx_ring->buffer_info[k];e1000_create_lbtest_frame (buffer_info->skb,1024 );
@@ -1618,7 +1620,8 @@ static int e1000_run_loopback_test(struct e1000_adapter *adapter)msleep (200 ); time = jiffies;/* set the start time for the receive */ good_cnt =0 ; - do { /* receive the sent packets */ +/* receive the sent packets */ + do { buffer_info = &rx_ring->buffer_info[l]; dma_sync_single_for_cpu(&pdev->dev,
@@ -1645,7 +1648,7 @@ static int e1000_run_loopback_test(struct e1000_adapter *adapter) ret_val =14 ;/* error code for time out error */ break ; } - }/* end loop count loop */ + }return ret_val; }
drivers/net/ethernet/intel/e1000e/ich8lan.c +1 -1
@@ -3452,9 +3452,9 @@ static s32 e1000_init_hw_ich8lan(struct e1000_hw *hw)/* Initialize identification LED */ ret_val = mac->ops.id_led_init (hw); +/* An error is not fatal and we should not stop init due to this */ if (ret_val)e_dbg ("Error initializing identification LED\n" ); -/* 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);
drivers/net/ethernet/intel/e1000e/netdev.c +1 -1
@@ -2558,8 +2558,8 @@ static void e1000_set_itr(struct e1000_adapter *adapter) current_itr =max (adapter->rx_itr, adapter->tx_itr); -switch (current_itr) {/* counts and packets in update_itr are dependent on these numbers */ +switch (current_itr) {case lowest_latency: new_itr =70000 ;break ;
drivers/net/ethernet/intel/e1000e/param.c +24 -12
@@ -161,11 +161,13 @@ struct e1000_option {const char *err;int def;union { -struct {/* range_option info */ +/* range_option info */ +struct {int min;int max; } r; -struct {/* list_option info */ +/* list_option info */ +struct {int nr;struct e1000_opt_list {int i;char *str; } *p; } l;
@@ -247,7 +249,8 @@ void e1000e_check_options(struct e1000_adapter *adapter) "Using defaults for all values\n"); } - {/* Transmit Interrupt Delay */ +/* Transmit Interrupt Delay */ + {static const struct e1000_option opt = { .type = range_option, .name ="Transmit Interrupt Delay" ,
@@ -266,7 +269,8 @@ void e1000e_check_options(struct e1000_adapter *adapter) adapter->tx_int_delay = opt.def; } } - {/* Transmit Absolute Interrupt Delay */ +/* Transmit Absolute Interrupt Delay */ + {static const struct e1000_option opt = { .type = range_option, .name ="Transmit Absolute Interrupt Delay" ,
@@ -285,7 +289,8 @@ void e1000e_check_options(struct e1000_adapter *adapter) adapter->tx_abs_int_delay = opt.def; } } - {/* Receive Interrupt Delay */ +/* Receive Interrupt Delay */ + {static struct e1000_option opt = { .type = range_option, .name ="Receive Interrupt Delay" ,
@@ -304,7 +309,8 @@ void e1000e_check_options(struct e1000_adapter *adapter) adapter->rx_int_delay = opt.def; } } - {/* Receive Absolute Interrupt Delay */ +/* Receive Absolute Interrupt Delay */ + {static const struct e1000_option opt = { .type = range_option, .name ="Receive Absolute Interrupt Delay" ,
@@ -323,7 +329,8 @@ void e1000e_check_options(struct e1000_adapter *adapter) adapter->rx_abs_int_delay = opt.def; } } - {/* Interrupt Throttling Rate */ +/* Interrupt Throttling Rate */ + {static const struct e1000_option opt = { .type = range_option, .name ="Interrupt Throttling Rate (ints/sec)" ,
@@ -393,7 +400,8 @@ void e1000e_check_options(struct e1000_adapter *adapter)break ; } } - {/* Interrupt Mode */ +/* Interrupt Mode */ + {static struct e1000_option opt = { .type = range_option, .name ="Interrupt Mode" ,
@@ -436,7 +444,8 @@ void e1000e_check_options(struct e1000_adapter *adapter)kfree (opt.err);#endif } - {/* Smart Power Down */ +/* Smart Power Down */ + {static const struct e1000_option opt = { .type = enable_option, .name ="PHY Smart Power Down" ,
@@ -451,7 +460,8 @@ void e1000e_check_options(struct e1000_adapter *adapter) adapter->flags |=FLAG_SMART_POWER_DOWN ; } } - {/* CRC Stripping */ +/* CRC Stripping */ + {static const struct e1000_option opt = { .type = enable_option, .name ="CRC Stripping" ,
@@ -471,7 +481,8 @@ void e1000e_check_options(struct e1000_adapter *adapter) adapter->flags2 |=FLAG2_DFLT_CRC_STRIPPING ; } } - {/* Kumeran Lock Loss Workaround */ +/* Kumeran Lock Loss Workaround */ + {static const struct e1000_option opt = { .type = enable_option, .name ="Kumeran Lock Loss Workaround" ,
@@ -490,7 +501,8 @@ void e1000e_check_options(struct e1000_adapter *adapter)e1000e_set_kmrn_lock_loss_workaround_ich8lan (hw, enabled); } - {/* Write-protect NVM */ +/* Write-protect NVM */ + {static const struct e1000_option opt = { .type = enable_option, .name ="Write-protect NVM" ,
Signature · 1 line
1.7.11.7
PATCH 11/15 e1000e: cleanup formatting of static structs
In reply to Jeff KirsherFrom: Bruce Allan <[email protected]>
--- drivers/net/ethernet/intel/e1000e/80003es2lan.c | 3 ++- drivers/net/ethernet/intel/e1000e/ethtool.c | 3 ++- drivers/net/ethernet/intel/e1000e/phy.c | 6 ++++-- 3 files changed, 8 insertions(+), 4 deletions(-)
drivers/net/ethernet/intel/e1000e/80003es2lan.c +2 -1
@@ -37,7 +37,8 @@* "index + 5". */ static const u16 e1000_gg82563_cable_length_table[] = { -0 ,60 ,115 ,150 ,150 ,60 ,115 ,150 ,180 ,180 ,0xFF }; +0 ,60 ,115 ,150 ,150 ,60 ,115 ,150 ,180 ,180 ,0xFF +};#define GG82563_CABLE_LENGTH_TABLE_SIZE \ ARRAY_SIZE(e1000_gg82563_cable_length_table)
drivers/net/ethernet/intel/e1000e/ethtool.c +2 -1
@@ -754,7 +754,8 @@ static bool reg_pattern_test(struct e1000_adapter *adapter, u64 *data, {u32 pat, val;static const u32 test[] = { -0x5A5A5A5A ,0xA5A5A5A5 ,0x00000000 ,0xFFFFFFFF }; +0x5A5A5A5A ,0xA5A5A5A5 ,0x00000000 ,0xFFFFFFFF + };for (pat =0 ; pat <ARRAY_SIZE (test); pat++) {E1000_WRITE_REG_ARRAY (&adapter->hw, reg, offset, (test[pat] & write));
drivers/net/ethernet/intel/e1000e/phy.c +4 -2
@@ -37,7 +37,8 @@ static s32 e1000_access_phy_debug_regs_hv(struct e1000_hw *hw, u32 offset,/* Cable length tables */ static const u16 e1000_m88_cable_length_table[] = { -0 ,50 ,80 ,110 ,140 ,140 ,E1000_CABLE_LENGTH_UNDEFINED }; +0 ,50 ,80 ,110 ,140 ,140 ,E1000_CABLE_LENGTH_UNDEFINED +};#define M88E1000_CABLE_LENGTH_TABLE_SIZE \ ARRAY_SIZE(e1000_m88_cable_length_table)
@@ -50,7 +51,8 @@ static const u16 e1000_igp_2_cable_length_table[] = {66 ,70 ,75 ,79 ,83 ,87 ,91 ,94 ,98 ,101 ,104 ,60 ,66 ,72 ,77 ,82 ,87 ,92 ,96 ,100 ,104 ,108 ,111 ,114 ,117 ,119 ,121 ,83 ,89 ,95 ,100 ,105 ,109 ,113 ,116 ,119 ,122 ,124 ,104 ,109 ,114 ,118 ,121 , - 124}; +124 +};#define IGP02E1000_CABLE_LENGTH_TABLE_SIZE \ ARRAY_SIZE(e1000_igp_2_cable_length_table)
Signature · 1 line
1.7.11.7
PATCH 12/15 e1000e: cleanup unnecessary line breaks
In reply to Jeff KirsherFrom: Bruce Allan <[email protected]>
Cuddle broken lines where appropriate.
--- drivers/net/ethernet/intel/e1000e/82571.c | 6 +-- drivers/net/ethernet/intel/e1000e/ethtool.c | 12 ++---- drivers/net/ethernet/intel/e1000e/ich8lan.c | 9 ++--- drivers/net/ethernet/intel/e1000e/netdev.c | 60 ++++++++++------------------- drivers/net/ethernet/intel/e1000e/phy.c | 6 +-- 5 files changed, 31 insertions(+), 62 deletions(-)
drivers/net/ethernet/intel/e1000e/82571.c +2 -4
@@ -876,8 +876,7 @@ 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 ) +if (er32 (EEMNGCTL ) &E1000_NVM_CFG_DONE_PORT_0 )break ;usleep_range (1000 ,2000 ); timeout--;
@@ -1124,8 +1123,7 @@ static s32 e1000_init_hw_82571(struct e1000_hw *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 ); +E1000_TXDCTL_FULL_TX_DESC_WB |E1000_TXDCTL_COUNT_DESC );ew32 (TXDCTL (0 ), reg_data);/* ...for both queues. */
drivers/net/ethernet/intel/e1000e/ethtool.c +4 -8
@@ -223,8 +223,7 @@ static int e1000_set_spd_dplx(struct e1000_adapter *adapter, u32 spd, u8 dplx)/* Fiber NICs only allow 1000 gbps Full duplex */ if ((adapter->hw.phy.media_type == e1000_media_type_fiber) && - spd !=SPEED_1000 && - dplx !=DUPLEX_FULL ) { + (spd !=SPEED_1000 ) && (dplx !=DUPLEX_FULL )) { goto err_inval; }
@@ -616,8 +615,7 @@ static void e1000_get_drvinfo(struct net_device *netdev, {struct e1000_adapter *adapter =netdev_priv (netdev); -strlcpy (drvinfo->driver, e1000e_driver_name, -sizeof (drvinfo->driver)); +strlcpy (drvinfo->driver, e1000e_driver_name,sizeof (drvinfo->driver));strlcpy (drvinfo->version, e1000e_driver_version,sizeof (drvinfo->version));
@@ -1143,8 +1141,7 @@ static int e1000_setup_desc_rings(struct e1000_adapter *adapter) tx_ring->count =E1000_DEFAULT_TXD ; tx_ring->buffer_info =kcalloc (tx_ring->count, -sizeof (struct e1000_buffer ), -GFP_KERNEL ); +sizeof (struct e1000_buffer ),GFP_KERNEL );if (!tx_ring->buffer_info) { ret_val =1 ; goto err_nomem;
@@ -1205,8 +1202,7 @@ static int e1000_setup_desc_rings(struct e1000_adapter *adapter) rx_ring->count =E1000_DEFAULT_RXD ; rx_ring->buffer_info =kcalloc (rx_ring->count, -sizeof (struct e1000_buffer ), -GFP_KERNEL ); +sizeof (struct e1000_buffer ),GFP_KERNEL );if (!rx_ring->buffer_info) { ret_val =5 ; goto err_nomem;
drivers/net/ethernet/intel/e1000e/ich8lan.c +3 -6
@@ -1379,8 +1379,7 @@ static s32 e1000_sw_lcd_config_ich8lan(struct e1000_hw *hw) word_addr = (u16)(cnf_base_addr <<1 );for (i =0 ; i < cnf_size; i++) { - ret_val =e1000_read_nvm (hw, (word_addr + i *2 ),1 , - ®_data); + ret_val =e1000_read_nvm (hw, (word_addr + i *2 ),1 , ®_data);if (ret_val) goto release;
@@ -3211,8 +3210,7 @@ static s32 e1000_valid_led_default_ich8lan(struct e1000_hw *hw, u16 *data)return ret_val; } -if (*data ==ID_LED_RESERVED_0000 || - *data ==ID_LED_RESERVED_FFFF ) +if (*data ==ID_LED_RESERVED_0000 || *data ==ID_LED_RESERVED_FFFF ) *data =ID_LED_DEFAULT_ICH8LAN ;return 0 ;
@@ -3756,8 +3754,7 @@ static s32 e1000_get_link_up_info_ich8lan(struct e1000_hw *hw, u16 *speed,return ret_val;if ((hw->mac.type == e1000_ich8lan) && - (hw->phy.type == e1000_phy_igp_3) && - (*speed ==SPEED_1000 )) { + (hw->phy.type == e1000_phy_igp_3) && (*speed ==SPEED_1000 )) { ret_val =e1000_kmrn_lock_loss_workaround_ich8lan (hw); }
drivers/net/ethernet/intel/e1000e/netdev.c +20 -40
125 lines not on this page · raw message
drivers/net/ethernet/intel/e1000e/phy.c +2 -4
@@ -71,8 +71,7 @@ s32 e1000e_check_reset_block_generic(struct e1000_hw *hw) manc =er32 (MANC ); -return (manc &E1000_MANC_BLK_PHY_RST_ON_IDE ) ? -E1000_BLK_PHY_RESET :0 ; +return (manc &E1000_MANC_BLK_PHY_RST_ON_IDE ) ?E1000_BLK_PHY_RESET :0 ; }/**
@@ -775,8 +774,7 @@ s32 e1000e_copper_link_setup_m88(struct e1000_hw *hw) phy_data |=M88E1000_EPSCR_TX_CLK_25 ; -if ((phy->revision ==2 ) && - (phy->id ==M88E1111_I_PHY_ID )) { +if ((phy->revision ==2 ) && (phy->id ==M88E1111_I_PHY_ID )) {/* 82573L PHY - set the downshift counter to 5x. */ phy_data &= ~M88EC018_EPSCR_DOWNSHIFT_COUNTER_MASK ; phy_data |=M88EC018_EPSCR_DOWNSHIFT_COUNTER_5X ;
Signature · 1 line
1.7.11.7
PATCH 13/15 e1000e: cleanup USLEEP_RANGE checkpatch checks
In reply to Jeff KirsherFrom: Bruce Allan <[email protected]>
Resolve strict checkpatch USLEEP_RANGE checks by converting delays and sleeps as described in ./Documentation/timers/timers-howto.txt. Three other violations of the text have also been fixed.
CHECK:USLEEP_RANGE: usleep_range is preferred over udelay; see Documentation/timers/timers-howto.txt
--- drivers/net/ethernet/intel/e1000e/80003es2lan.c | 12 ++++++------ drivers/net/ethernet/intel/e1000e/82571.c | 12 ++++++------ drivers/net/ethernet/intel/e1000e/e1000.h | 2 +- drivers/net/ethernet/intel/e1000e/ethtool.c | 10 +++++----- drivers/net/ethernet/intel/e1000e/ich8lan.c | 16 ++++++++-------- drivers/net/ethernet/intel/e1000e/mac.c | 10 +++++----- drivers/net/ethernet/intel/e1000e/nvm.c | 2 +- drivers/net/ethernet/intel/e1000e/phy.c | 12 ++++++------ 8 files changed, 38 insertions(+), 38 deletions(-)
drivers/net/ethernet/intel/e1000e/80003es2lan.c +6 -6
@@ -395,7 +395,7 @@ static s32 e1000_read_phy_reg_gg82563_80003es2lan(struct e1000_hw *hw,* before the device has completed the "Page Select" MDI * transaction. So we wait 200us after each MDI command... */ -udelay (200 ); +usleep_range (200 ,400 );/* ...and verify the command was successful. */ ret_val =e1000e_read_phy_reg_mdic (hw, page_select, &temp);
@@ -405,13 +405,13 @@ static s32 e1000_read_phy_reg_gg82563_80003es2lan(struct e1000_hw *hw,return -E1000_ERR_PHY ; } -udelay (200 ); +usleep_range (200 ,400 ); ret_val =e1000e_read_phy_reg_mdic (hw,MAX_PHY_REG_ADDRESS & offset, data); -udelay (200 ); +usleep_range (200 ,400 ); }else { ret_val = e1000e_read_phy_reg_mdic(hw, MAX_PHY_REG_ADDRESS & offset,
@@ -464,7 +464,7 @@ static s32 e1000_write_phy_reg_gg82563_80003es2lan(struct e1000_hw *hw,* before the device has completed the "Page Select" MDI * transaction. So we wait 200us after each MDI command... */ -udelay (200 ); +usleep_range (200 ,400 );/* ...and verify the command was successful. */ ret_val =e1000e_read_phy_reg_mdic (hw, page_select, &temp);
@@ -474,13 +474,13 @@ static s32 e1000_write_phy_reg_gg82563_80003es2lan(struct e1000_hw *hw,return -E1000_ERR_PHY ; } -udelay (200 ); +usleep_range (200 ,400 ); ret_val =e1000e_write_phy_reg_mdic (hw,MAX_PHY_REG_ADDRESS & offset, data); -udelay (200 ); +usleep_range (200 ,400 ); }else { ret_val = e1000e_write_phy_reg_mdic(hw, MAX_PHY_REG_ADDRESS &
drivers/net/ethernet/intel/e1000e/82571.c +6 -6
@@ -437,7 +437,7 @@ static s32 e1000_get_phy_id_82571(struct e1000_hw *hw)return ret_val; phy->id = (u32)(phy_id <<16 ); -udelay (20 ); +usleep_range (20 ,40 ); ret_val =e1e_rphy (hw,MII_PHYSID2 , &phy_id);if (ret_val)return ret_val;
@@ -482,7 +482,7 @@ static s32 e1000_get_hw_semaphore_82571(struct e1000_hw *hw)if (!(swsm &E1000_SWSM_SMBI ))break ; -udelay (50 ); +usleep_range (50 ,100 ); i++; }
@@ -499,7 +499,7 @@ static s32 e1000_get_hw_semaphore_82571(struct e1000_hw *hw)if (er32 (SWSM ) &E1000_SWSM_SWESMBI )break ; -udelay (50 ); +usleep_range (50 ,100 ); }if (i == fw_timeout) {
@@ -1022,7 +1022,7 @@ static s32 e1000_reset_hw_82571(struct e1000_hw *hw) }if (hw->nvm.type == e1000_nvm_flash_hw) { -udelay (10 ); +usleep_range (10 ,20 ); ctrl_ext =er32 (CTRL_EXT ); ctrl_ext |=E1000_CTRL_EXT_EE_RST ;ew32 (CTRL_EXT , ctrl_ext);
@@ -1529,7 +1529,7 @@ static s32 e1000_check_for_serdes_link_82571(struct e1000_hw *hw) status =er32 (STATUS );er32 (RXCW );/* SYNCH bit and IV bit are sticky */ -udelay (10 ); +usleep_range (10 ,20 ); rxcw =er32 (RXCW );if ((rxcw &E1000_RXCW_SYNCH ) && !(rxcw &E1000_RXCW_IV )) {
@@ -1632,7 +1632,7 @@ static s32 e1000_check_for_serdes_link_82571(struct e1000_hw *hw)* the IV bit and restart Autoneg */ for (i =0 ; i <AN_RETRY_COUNT ; i++) { -udelay (10 ); +usleep_range (10 ,20 ); rxcw =er32 (RXCW );if ((rxcw &E1000_RXCW_SYNCH ) && (rxcw &E1000_RXCW_C ))
drivers/net/ethernet/intel/e1000e/e1000.h +1 -1
@@ -597,7 +597,7 @@ static inline s32 __ew32_prepare(struct e1000_hw *hw)s32 i =E1000_ICH_FWSM_PCIM2PCI_COUNT ;while ((er32 (FWSM ) &E1000_ICH_FWSM_PCIM2PCI ) && --i) -udelay (50 ); +usleep_range (50 ,100 );return i; }
drivers/net/ethernet/intel/e1000e/ethtool.c +5 -5
@@ -1297,7 +1297,7 @@ static int e1000_integrated_phy_loopback(struct e1000_adapter *adapter)ew32 (CTRL , ctrl_reg);e1e_flush (); -udelay (500 ); +usleep_range (500 ,1000 );return 0 ; }
@@ -1323,7 +1323,7 @@ static int e1000_integrated_phy_loopback(struct e1000_adapter *adapter)e1e_wphy (hw,PHY_REG (2 ,21 ), phy_reg);/* Assert SW reset for above settings to take effect */ hw->phy.ops.commit (hw); -mdelay (1 ); +usleep_range (1000 ,2000 );/* Force Full Duplex */ e1e_rphy (hw,PHY_REG (769 ,16 ), &phy_reg);e1e_wphy (hw,PHY_REG (769 ,16 ), phy_reg |0x000C );
@@ -1364,7 +1364,7 @@ static int e1000_integrated_phy_loopback(struct e1000_adapter *adapter)/* force 1000, set loopback */ e1e_wphy (hw,MII_BMCR ,0x4140 ); -mdelay (250 ); +msleep (250 );/* Now set up the MAC to the same speed/duplex as the PHY. */ ctrl_reg =er32 (CTRL );
@@ -1396,7 +1396,7 @@ static int e1000_integrated_phy_loopback(struct e1000_adapter *adapter)if (hw->phy.type == e1000_phy_m88)e1000_phy_disable_receiver (adapter); -udelay (500 ); +usleep_range (500 ,1000 );return 0 ; }
@@ -1704,7 +1704,7 @@ static int e1000_link_test(struct e1000_adapter *adapter, u64 *data)/* On some Phy/switch combinations, link establishment * can take a few seconds more than expected. */ -msleep (5000 ); +msleep_interruptible (5000 );if (!(er32 (STATUS ) &E1000_STATUS_LU )) *data =1 ;
drivers/net/ethernet/intel/e1000e/ich8lan.c +8 -8
@@ -312,7 +312,7 @@ static s32 e1000_init_phy_workarounds_pchlan(struct e1000_hw *hw) mac_reg &= ~E1000_CTRL_LANPHYPC_VALUE ;ew32 (CTRL , mac_reg);e1e_flush (); -udelay (10 ); +usleep_range (10 ,20 ); mac_reg &= ~E1000_CTRL_LANPHYPC_OVERRIDE ;ew32 (CTRL , mac_reg);e1e_flush ();
@@ -1517,7 +1517,7 @@ s32 e1000_configure_k1_ich8lan(struct e1000_hw *hw, bool k1_enable)if (ret_val)return ret_val; -udelay (20 ); +usleep_range (20 ,40 ); ctrl_ext =er32 (CTRL_EXT ); ctrl_reg =er32 (CTRL );
@@ -1527,11 +1527,11 @@ s32 e1000_configure_k1_ich8lan(struct e1000_hw *hw, bool k1_enable)ew32 (CTRL_EXT , ctrl_ext |E1000_CTRL_EXT_SPD_BYPS );e1e_flush (); -udelay (20 ); +usleep_range (20 ,40 );ew32 (CTRL , ctrl_reg);ew32 (CTRL_EXT , ctrl_ext);e1e_flush (); -udelay (20 ); +usleep_range (20 ,40 );return 0 ; }
@@ -2037,7 +2037,7 @@ static void e1000_lan_init_done_ich8lan(struct e1000_hw *hw)do { data =er32 (STATUS ); data &=E1000_STATUS_LAN_INIT_DONE ; -udelay (100 ); +usleep_range (100 ,200 ); }while ((!data) && --loop);/* If basic configuration is incomplete before the above loop
@@ -2801,7 +2801,7 @@ static s32 e1000_update_nvm_checksum_ich8lan(struct e1000_hw *hw)/* Convert offset to bytes. */ act_offset = (i + new_bank_offset) <<1 ; -udelay (100 ); +usleep_range (100 ,200 );/* Write the bytes to the new bank. */ ret_val = e1000_retry_write_flash_byte_ich8lan(hw, act_offset,
@@ -2809,7 +2809,7 @@ static s32 e1000_update_nvm_checksum_ich8lan(struct e1000_hw *hw)if (ret_val)break ; -udelay (100 ); +usleep_range (100 ,200 ); ret_val =e1000_retry_write_flash_byte_ich8lan (hw, act_offset +1 , (u8)(data >>8 ));
@@ -3077,7 +3077,7 @@ static s32 e1000_retry_write_flash_byte_ich8lan(struct e1000_hw *hw,for (program_retries =0 ; program_retries <100 ; program_retries++) {e_dbg ("Retrying Byte %2.2X at offset %u\n" , byte, offset); -udelay (100 ); +usleep_range (100 ,200 ); ret_val =e1000_write_flash_byte_ich8lan (hw, offset, byte);if (!ret_val)break ;
drivers/net/ethernet/intel/e1000e/mac.c +5 -5
@@ -596,7 +596,7 @@ s32 e1000e_check_for_serdes_link(struct e1000_hw *hw)* serdes media type. */ /* SYNCH bit and IV bit are sticky. */ -udelay (10 ); +usleep_range (10 ,20 ); rxcw =er32 (RXCW );if (rxcw &E1000_RXCW_SYNCH ) {if (!(rxcw &E1000_RXCW_IV )) {
@@ -613,7 +613,7 @@ s32 e1000e_check_for_serdes_link(struct e1000_hw *hw) status =er32 (STATUS );if (status &E1000_STATUS_LU ) {/* SYNCH bit and IV bit are sticky, so reread rxcw. */ -udelay (10 ); +usleep_range (10 ,20 ); rxcw =er32 (RXCW );if (rxcw &E1000_RXCW_SYNCH ) {if (!(rxcw &E1000_RXCW_IV )) {
@@ -1382,7 +1382,7 @@ s32 e1000e_get_hw_semaphore(struct e1000_hw *hw)if (!(swsm &E1000_SWSM_SMBI ))break ; -udelay (50 ); +usleep_range (50 ,100 ); i++; }
@@ -1400,7 +1400,7 @@ s32 e1000e_get_hw_semaphore(struct e1000_hw *hw)if (er32 (SWSM ) &E1000_SWSM_SWESMBI )break ; -udelay (50 ); +usleep_range (50 ,100 ); }if (i == timeout) {
@@ -1712,7 +1712,7 @@ s32 e1000e_disable_pcie_master(struct e1000_hw *hw)while (timeout) {if (!(er32 (STATUS ) &E1000_STATUS_GIO_MASTER_ENABLE ))break ; -udelay (100 ); +usleep_range (100 ,200 ); timeout--; }
drivers/net/ethernet/intel/e1000e/nvm.c +1 -1
@@ -630,7 +630,7 @@ void e1000e_reload_nvm_generic(struct e1000_hw *hw) {u32 ctrl_ext; -udelay (10 ); +usleep_range (10 ,20 ); ctrl_ext =er32 (CTRL_EXT ); ctrl_ext |=E1000_CTRL_EXT_EE_RST ;ew32 (CTRL_EXT , ctrl_ext);
drivers/net/ethernet/intel/e1000e/phy.c +6 -6
@@ -97,7 +97,7 @@ s32 e1000e_get_phy_id(struct e1000_hw *hw)return ret_val; phy->id = (u32)(phy_id <<16 ); -udelay (20 ); +usleep_range (20 ,40 ); ret_val =e1e_rphy (hw,MII_PHYSID2 , &phy_id);if (ret_val)return ret_val;
@@ -165,7 +165,7 @@ s32 e1000e_read_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 *data)* the lower time out */ for (i =0 ; i < (E1000_GEN_POLL_TIMEOUT *3 ); i++) { -udelay (50 ); +usleep_range (50 ,100 ); mdic =er32 (MDIC );if (mdic &E1000_MDIC_READY )break ;
@@ -184,7 +184,7 @@ s32 e1000e_read_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 *data)* reading duplicate data in the next MDIC transaction. */ if (hw->mac.type == e1000_pch2lan) -udelay (100 ); +usleep_range (100 ,200 );return 0 ; }
@@ -223,7 +223,7 @@ s32 e1000e_write_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 data)* the lower time out */ for (i =0 ; i < (E1000_GEN_POLL_TIMEOUT *3 ); i++) { -udelay (50 ); +usleep_range (50 ,100 ); mdic =er32 (MDIC );if (mdic &E1000_MDIC_READY )break ;
@@ -241,7 +241,7 @@ s32 e1000e_write_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 data)* reading duplicate data in the next MDIC transaction. */ if (hw->mac.type == e1000_pch2lan) -udelay (100 ); +usleep_range (100 ,200 );return 0 ; }
@@ -2120,7 +2120,7 @@ s32 e1000e_phy_hw_reset_generic(struct e1000_hw *hw)ew32 (CTRL , ctrl);e1e_flush (); -udelay (150 ); +usleep_range (150 ,300 ); phy->ops.release (hw);
Signature · 1 line
1.7.11.7
PATCH 14/15 e1000e: cleanup format of struct e1000_opt_list struct
In reply to Jeff KirsherFrom: Bruce Allan <[email protected]>
--- drivers/net/ethernet/intel/e1000e/param.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/net/ethernet/intel/e1000e/param.c +4 -1
@@ -169,7 +169,10 @@ struct e1000_option {/* list_option info */ struct {int nr; -struct e1000_opt_list {int i;char *str; } *p; +struct e1000_opt_list { +int i; +char *str; + } *p; } l; } arg; };
Signature · 1 line
1.7.11.7
PATCH 15/15 e1000e: cleanup - move defines to appropriate header file
In reply to Jeff KirsherFrom: Bruce Allan <[email protected]>
--- drivers/net/ethernet/intel/e1000e/82571.h | 2 ++ drivers/net/ethernet/intel/e1000e/defines.h | 3 +++ drivers/net/ethernet/intel/e1000e/ethtool.c | 6 ++---- drivers/net/ethernet/intel/e1000e/netdev.c | 5 ----- 4 files changed, 7 insertions(+), 9 deletions(-)
drivers/net/ethernet/intel/e1000e/82571.h +2 -0
@@ -44,6 +44,8 @@#define E1000_EIAC_82574 0x000DC/* Ext. Interrupt Auto Clear - RW */ #define E1000_EIAC_MASK_82574 0x01F00000 +#define E1000_IVAR_INT_ALLOC_VALID 0x8 +/* Manageability Operation Mode mask */ #define E1000_NVM_INIT_CTRL2_MNGM 0x6000
drivers/net/ethernet/intel/e1000e/defines.h +3 -0
@@ -216,6 +216,8 @@#define E1000_CTRL_MEHE 0x00080000/* Memory Error Handling Enable */ #define E1000_CTRL_SWDPIN0 0x00040000/* SWDPIN 0 value */ #define E1000_CTRL_SWDPIN1 0x00080000/* SWDPIN 1 value */ +#define E1000_CTRL_ADVD3WUC 0x00100000/* D3 WUC */ +#define E1000_CTRL_EN_PHY_PWR_MGMT 0x00200000/* PHY PM enable */ #define E1000_CTRL_SWDPIO0 0x00400000/* SWDPIN 0 Input or output */ #define E1000_CTRL_RST 0x04000000/* Global reset */ #define E1000_CTRL_RFCE 0x08000000/* Receive Flow Control enable */
@@ -310,6 +312,7 @@/* SerDes Control */ #define E1000_SCTL_DISABLE_SERDES_LOOPBACK 0x0400 +#define E1000_SCTL_ENABLE_SERDES_LOOPBACK 0x0410/* Receive Checksum Control */ #define E1000_RXCSUM_TUOFL 0x00000200/* TCP / UDP checksum offload */
drivers/net/ethernet/intel/e1000e/ethtool.c +2 -4
@@ -1432,8 +1432,7 @@ static int e1000_set_82571_fiber_loopback(struct e1000_adapter *adapter)/* special write to serdes control register to enable SerDes analog * loopback */ -#define E1000_SERDES_LB_ON 0x410 -ew32 (SCTL ,E1000_SERDES_LB_ON ); +ew32 (SCTL ,E1000_SCTL_ENABLE_SERDES_LOOPBACK );e1e_flush ();usleep_range (10000 ,20000 );
@@ -1527,8 +1526,7 @@ static void e1000_loopback_cleanup(struct e1000_adapter *adapter)case e1000_82572:if (hw->phy.media_type == e1000_media_type_fiber || hw->phy.media_type == e1000_media_type_internal_serdes) { -#define E1000_SERDES_LB_OFF 0x400 -ew32 (SCTL ,E1000_SERDES_LB_OFF ); +ew32 (SCTL ,E1000_SCTL_DISABLE_SERDES_LOOPBACK );e1e_flush ();usleep_range (10000 ,20000 );break ;
drivers/net/ethernet/intel/e1000e/netdev.c +0 -5
@@ -1957,7 +1957,6 @@ static void e1000_configure_msix(struct e1000_adapter *adapter)ew32 (RFCTL , rfctl); } -#define E1000_IVAR_INT_ALLOC_VALID 0x8/* Configure Rx vector */ rx_ring->ims_val =E1000_IMS_RXQ0 ; adapter->eiac_mask |= rx_ring->ims_val;
@@ -5911,10 +5910,6 @@ static int __e1000_shutdown(struct pci_dev *pdev, bool *enable_wake, } ctrl =er32 (CTRL ); -/* advertise wake from D3Cold */ -#define E1000_CTRL_ADVD3WUC 0x00100000 -/* phy power management enable */ -#define E1000_CTRL_EN_PHY_PWR_MGMT 0x00200000 ctrl |=E1000_CTRL_ADVD3WUC ;if (!(adapter->flags2 &FLAG2_HAS_PHY_WAKEUP )) ctrl |=E1000_CTRL_EN_PHY_PWR_MGMT ;
Signature · 1 line
1.7.11.7
David Miller
maintainerFrom: Jeff Kirsher <[email protected]>
Date: Fri, 8 Mar 2013 02:07:02 -0800
Quoted 11 lines
This series contains updates to ixgbevf and e1000e.
Alex's ixgbevf patch is meant to address several race issues that become possible because
next_to_watchcould possibly be set to a value that shows that the descriptor is done when it is not. In order to correct that we instead makenext_to_watcha pointer that is set to NULL during cleanup, and set to theeop_descafter the descriptor rings have been written.Stephen's ixgbevf patch makes the PCI id table a const and reformats the table to match what the ixgbe driver does.
Quoted 8 lines
The remaining 13 patches from Bruce are cleanup patches for e1000e to resolve checkpatch.pl warnings/errors, removing blank lines where necessary and fix code formatting.
The following are changes since commit
7f0e44ac9f7f12a2519bfed9ea4df3c1471bd8bb:
ipv6 flowlabel: add__rcuannotations
and are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-nextmaster
Pulled, thanks Jeff.