Commit a48954c8 authored by Janusz Wolak's avatar Janusz Wolak Committed by Jeff Kirsher

e1000: Remove checkpatch coding style errors

Signed-off-by: default avatarJanusz Wolak <januszvdm@gmail.com>
Tested-by: default avatarAaron Brown <aaron.f.brown@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent 73bf8048
...@@ -683,7 +683,7 @@ static s32 e1000_adjust_serdes_amplitude(struct e1000_hw *hw) ...@@ -683,7 +683,7 @@ static s32 e1000_adjust_serdes_amplitude(struct e1000_hw *hw)
} }
ret_val = e1000_read_eeprom(hw, EEPROM_SERDES_AMPLITUDE, 1, ret_val = e1000_read_eeprom(hw, EEPROM_SERDES_AMPLITUDE, 1,
&eeprom_data); &eeprom_data);
if (ret_val) { if (ret_val) {
return ret_val; return ret_val;
} }
...@@ -1652,7 +1652,7 @@ s32 e1000_phy_setup_autoneg(struct e1000_hw *hw) ...@@ -1652,7 +1652,7 @@ s32 e1000_phy_setup_autoneg(struct e1000_hw *hw)
mii_1000t_ctrl_reg = 0; mii_1000t_ctrl_reg = 0;
} else { } else {
ret_val = e1000_write_phy_reg(hw, PHY_1000T_CTRL, ret_val = e1000_write_phy_reg(hw, PHY_1000T_CTRL,
mii_1000t_ctrl_reg); mii_1000t_ctrl_reg);
if (ret_val) if (ret_val)
return ret_val; return ret_val;
} }
...@@ -2193,8 +2193,7 @@ static s32 e1000_config_fc_after_link_up(struct e1000_hw *hw) ...@@ -2193,8 +2193,7 @@ static s32 e1000_config_fc_after_link_up(struct e1000_hw *hw)
else if (!(mii_nway_adv_reg & NWAY_AR_PAUSE) && else if (!(mii_nway_adv_reg & NWAY_AR_PAUSE) &&
(mii_nway_adv_reg & NWAY_AR_ASM_DIR) && (mii_nway_adv_reg & NWAY_AR_ASM_DIR) &&
(mii_nway_lp_ability_reg & NWAY_LPAR_PAUSE) && (mii_nway_lp_ability_reg & NWAY_LPAR_PAUSE) &&
(mii_nway_lp_ability_reg & NWAY_LPAR_ASM_DIR)) (mii_nway_lp_ability_reg & NWAY_LPAR_ASM_DIR)) {
{
hw->fc = E1000_FC_TX_PAUSE; hw->fc = E1000_FC_TX_PAUSE;
e_dbg e_dbg
("Flow Control = TX PAUSE frames only.\n"); ("Flow Control = TX PAUSE frames only.\n");
...@@ -2210,8 +2209,7 @@ static s32 e1000_config_fc_after_link_up(struct e1000_hw *hw) ...@@ -2210,8 +2209,7 @@ static s32 e1000_config_fc_after_link_up(struct e1000_hw *hw)
else if ((mii_nway_adv_reg & NWAY_AR_PAUSE) && else if ((mii_nway_adv_reg & NWAY_AR_PAUSE) &&
(mii_nway_adv_reg & NWAY_AR_ASM_DIR) && (mii_nway_adv_reg & NWAY_AR_ASM_DIR) &&
!(mii_nway_lp_ability_reg & NWAY_LPAR_PAUSE) && !(mii_nway_lp_ability_reg & NWAY_LPAR_PAUSE) &&
(mii_nway_lp_ability_reg & NWAY_LPAR_ASM_DIR)) (mii_nway_lp_ability_reg & NWAY_LPAR_ASM_DIR)) {
{
hw->fc = E1000_FC_RX_PAUSE; hw->fc = E1000_FC_RX_PAUSE;
e_dbg e_dbg
("Flow Control = RX PAUSE frames only.\n"); ("Flow Control = RX PAUSE frames only.\n");
...@@ -3449,7 +3447,7 @@ s32 e1000_phy_get_info(struct e1000_hw *hw, struct e1000_phy_info *phy_info) ...@@ -3449,7 +3447,7 @@ s32 e1000_phy_get_info(struct e1000_hw *hw, struct e1000_phy_info *phy_info)
if (hw->phy_type == e1000_phy_igp) if (hw->phy_type == e1000_phy_igp)
return e1000_phy_igp_get_info(hw, phy_info); return e1000_phy_igp_get_info(hw, phy_info);
else if ((hw->phy_type == e1000_phy_8211) || else if ((hw->phy_type == e1000_phy_8211) ||
(hw->phy_type == e1000_phy_8201)) (hw->phy_type == e1000_phy_8201))
return E1000_SUCCESS; return E1000_SUCCESS;
else else
return e1000_phy_m88_get_info(hw, phy_info); return e1000_phy_m88_get_info(hw, phy_info);
...@@ -3896,7 +3894,7 @@ static s32 e1000_do_read_eeprom(struct e1000_hw *hw, u16 offset, u16 words, ...@@ -3896,7 +3894,7 @@ static s32 e1000_do_read_eeprom(struct e1000_hw *hw, u16 offset, u16 words,
if (hw->mac_type == e1000_ce4100) { if (hw->mac_type == e1000_ce4100) {
GBE_CONFIG_FLASH_READ(GBE_CONFIG_BASE_VIRT, offset, words, GBE_CONFIG_FLASH_READ(GBE_CONFIG_BASE_VIRT, offset, words,
data); data);
return E1000_SUCCESS; return E1000_SUCCESS;
} }
...@@ -4067,7 +4065,7 @@ static s32 e1000_do_write_eeprom(struct e1000_hw *hw, u16 offset, u16 words, ...@@ -4067,7 +4065,7 @@ static s32 e1000_do_write_eeprom(struct e1000_hw *hw, u16 offset, u16 words,
if (hw->mac_type == e1000_ce4100) { if (hw->mac_type == e1000_ce4100) {
GBE_CONFIG_FLASH_WRITE(GBE_CONFIG_BASE_VIRT, offset, words, GBE_CONFIG_FLASH_WRITE(GBE_CONFIG_BASE_VIRT, offset, words,
data); data);
return E1000_SUCCESS; return E1000_SUCCESS;
} }
......
...@@ -99,13 +99,13 @@ int e1000_setup_all_rx_resources(struct e1000_adapter *adapter); ...@@ -99,13 +99,13 @@ int e1000_setup_all_rx_resources(struct e1000_adapter *adapter);
void e1000_free_all_tx_resources(struct e1000_adapter *adapter); void e1000_free_all_tx_resources(struct e1000_adapter *adapter);
void e1000_free_all_rx_resources(struct e1000_adapter *adapter); void e1000_free_all_rx_resources(struct e1000_adapter *adapter);
static int e1000_setup_tx_resources(struct e1000_adapter *adapter, static int e1000_setup_tx_resources(struct e1000_adapter *adapter,
struct e1000_tx_ring *txdr); struct e1000_tx_ring *txdr);
static int e1000_setup_rx_resources(struct e1000_adapter *adapter, static int e1000_setup_rx_resources(struct e1000_adapter *adapter,
struct e1000_rx_ring *rxdr); struct e1000_rx_ring *rxdr);
static void e1000_free_tx_resources(struct e1000_adapter *adapter, static void e1000_free_tx_resources(struct e1000_adapter *adapter,
struct e1000_tx_ring *tx_ring); struct e1000_tx_ring *tx_ring);
static void e1000_free_rx_resources(struct e1000_adapter *adapter, static void e1000_free_rx_resources(struct e1000_adapter *adapter,
struct e1000_rx_ring *rx_ring); struct e1000_rx_ring *rx_ring);
void e1000_update_stats(struct e1000_adapter *adapter); void e1000_update_stats(struct e1000_adapter *adapter);
static int e1000_init_module(void); static int e1000_init_module(void);
...@@ -122,16 +122,16 @@ static void e1000_setup_rctl(struct e1000_adapter *adapter); ...@@ -122,16 +122,16 @@ static void e1000_setup_rctl(struct e1000_adapter *adapter);
static void e1000_clean_all_tx_rings(struct e1000_adapter *adapter); static void e1000_clean_all_tx_rings(struct e1000_adapter *adapter);
static void e1000_clean_all_rx_rings(struct e1000_adapter *adapter); static void e1000_clean_all_rx_rings(struct e1000_adapter *adapter);
static void e1000_clean_tx_ring(struct e1000_adapter *adapter, static void e1000_clean_tx_ring(struct e1000_adapter *adapter,
struct e1000_tx_ring *tx_ring); struct e1000_tx_ring *tx_ring);
static void e1000_clean_rx_ring(struct e1000_adapter *adapter, static void e1000_clean_rx_ring(struct e1000_adapter *adapter,
struct e1000_rx_ring *rx_ring); struct e1000_rx_ring *rx_ring);
static void e1000_set_rx_mode(struct net_device *netdev); static void e1000_set_rx_mode(struct net_device *netdev);
static void e1000_update_phy_info_task(struct work_struct *work); static void e1000_update_phy_info_task(struct work_struct *work);
static void e1000_watchdog(struct work_struct *work); static void e1000_watchdog(struct work_struct *work);
static void e1000_82547_tx_fifo_stall_task(struct work_struct *work); static void e1000_82547_tx_fifo_stall_task(struct work_struct *work);
static netdev_tx_t e1000_xmit_frame(struct sk_buff *skb, static netdev_tx_t e1000_xmit_frame(struct sk_buff *skb,
struct net_device *netdev); struct net_device *netdev);
static struct net_device_stats * e1000_get_stats(struct net_device *netdev); static struct net_device_stats *e1000_get_stats(struct net_device *netdev);
static int e1000_change_mtu(struct net_device *netdev, int new_mtu); static int e1000_change_mtu(struct net_device *netdev, int new_mtu);
static int e1000_set_mac(struct net_device *netdev, void *p); static int e1000_set_mac(struct net_device *netdev, void *p);
static irqreturn_t e1000_intr(int irq, void *data); static irqreturn_t e1000_intr(int irq, void *data);
...@@ -164,7 +164,7 @@ static void e1000_tx_timeout(struct net_device *dev); ...@@ -164,7 +164,7 @@ static void e1000_tx_timeout(struct net_device *dev);
static void e1000_reset_task(struct work_struct *work); static void e1000_reset_task(struct work_struct *work);
static void e1000_smartspeed(struct e1000_adapter *adapter); static void e1000_smartspeed(struct e1000_adapter *adapter);
static int e1000_82547_fifo_workaround(struct e1000_adapter *adapter, static int e1000_82547_fifo_workaround(struct e1000_adapter *adapter,
struct sk_buff *skb); struct sk_buff *skb);
static bool e1000_vlan_used(struct e1000_adapter *adapter); static bool e1000_vlan_used(struct e1000_adapter *adapter);
static void e1000_vlan_mode(struct net_device *netdev, static void e1000_vlan_mode(struct net_device *netdev,
...@@ -195,7 +195,7 @@ MODULE_PARM_DESC(copybreak, ...@@ -195,7 +195,7 @@ 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");
static pci_ers_result_t e1000_io_error_detected(struct pci_dev *pdev, static pci_ers_result_t e1000_io_error_detected(struct pci_dev *pdev,
pci_channel_state_t state); pci_channel_state_t state);
static pci_ers_result_t e1000_io_slot_reset(struct pci_dev *pdev); static pci_ers_result_t e1000_io_slot_reset(struct pci_dev *pdev);
static void e1000_io_resume(struct pci_dev *pdev); static void e1000_io_resume(struct pci_dev *pdev);
...@@ -287,7 +287,7 @@ static int e1000_request_irq(struct e1000_adapter *adapter) ...@@ -287,7 +287,7 @@ static int e1000_request_irq(struct e1000_adapter *adapter)
int err; int err;
err = request_irq(adapter->pdev->irq, handler, irq_flags, netdev->name, err = request_irq(adapter->pdev->irq, handler, irq_flags, netdev->name,
netdev); netdev);
if (err) { if (err) {
e_err(probe, "Unable to allocate interrupt Error: %d\n", err); e_err(probe, "Unable to allocate interrupt Error: %d\n", err);
} }
...@@ -636,8 +636,8 @@ void e1000_reset(struct e1000_adapter *adapter) ...@@ -636,8 +636,8 @@ void e1000_reset(struct e1000_adapter *adapter)
* but don't include ethernet FCS because hardware appends it * but don't include ethernet FCS because hardware appends it
*/ */
min_tx_space = (hw->max_frame_size + min_tx_space = (hw->max_frame_size +
sizeof(struct e1000_tx_desc) - sizeof(struct e1000_tx_desc) -
ETH_FCS_LEN) * 2; ETH_FCS_LEN) * 2;
min_tx_space = ALIGN(min_tx_space, 1024); min_tx_space = ALIGN(min_tx_space, 1024);
min_tx_space >>= 10; min_tx_space >>= 10;
/* software strips receive CRC, so leave room for it */ /* software strips receive CRC, so leave room for it */
...@@ -943,8 +943,8 @@ static int e1000_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -943,8 +943,8 @@ static int e1000_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
struct e1000_adapter *adapter; struct e1000_adapter *adapter;
struct e1000_hw *hw; struct e1000_hw *hw;
static int cards_found = 0; static int cards_found;
static int global_quad_port_a = 0; /* global ksp3 port a indication */ static int global_quad_port_a; /* global ksp3 port a indication */
int i, err, pci_using_dac; int i, err, pci_using_dac;
u16 eeprom_data = 0; u16 eeprom_data = 0;
u16 tmp = 0; u16 tmp = 0;
...@@ -1046,7 +1046,7 @@ static int e1000_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -1046,7 +1046,7 @@ static int e1000_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
if (hw->mac_type == e1000_ce4100) { if (hw->mac_type == e1000_ce4100) {
hw->ce4100_gbe_mdio_base_virt = hw->ce4100_gbe_mdio_base_virt =
ioremap(pci_resource_start(pdev, BAR_1), ioremap(pci_resource_start(pdev, BAR_1),
pci_resource_len(pdev, BAR_1)); pci_resource_len(pdev, BAR_1));
if (!hw->ce4100_gbe_mdio_base_virt) if (!hw->ce4100_gbe_mdio_base_virt)
goto err_mdio_ioremap; goto err_mdio_ioremap;
...@@ -1148,7 +1148,7 @@ static int e1000_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -1148,7 +1148,7 @@ static int e1000_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
break; break;
case e1000_82546: case e1000_82546:
case e1000_82546_rev_3: case e1000_82546_rev_3:
if (er32(STATUS) & E1000_STATUS_FUNC_1){ if (er32(STATUS) & E1000_STATUS_FUNC_1) {
e1000_read_eeprom(hw, e1000_read_eeprom(hw,
EEPROM_INIT_CONTROL3_PORT_B, 1, &eeprom_data); EEPROM_INIT_CONTROL3_PORT_B, 1, &eeprom_data);
break; break;
...@@ -1334,12 +1334,12 @@ static int e1000_sw_init(struct e1000_adapter *adapter) ...@@ -1334,12 +1334,12 @@ static int e1000_sw_init(struct e1000_adapter *adapter)
static int e1000_alloc_queues(struct e1000_adapter *adapter) static int e1000_alloc_queues(struct e1000_adapter *adapter)
{ {
adapter->tx_ring = kcalloc(adapter->num_tx_queues, adapter->tx_ring = kcalloc(adapter->num_tx_queues,
sizeof(struct e1000_tx_ring), GFP_KERNEL); sizeof(struct e1000_tx_ring), GFP_KERNEL);
if (!adapter->tx_ring) if (!adapter->tx_ring)
return -ENOMEM; return -ENOMEM;
adapter->rx_ring = kcalloc(adapter->num_rx_queues, adapter->rx_ring = kcalloc(adapter->num_rx_queues,
sizeof(struct e1000_rx_ring), GFP_KERNEL); sizeof(struct e1000_rx_ring), GFP_KERNEL);
if (!adapter->rx_ring) { if (!adapter->rx_ring) {
kfree(adapter->tx_ring); kfree(adapter->tx_ring);
return -ENOMEM; return -ENOMEM;
...@@ -1811,20 +1811,20 @@ static void e1000_setup_rctl(struct e1000_adapter *adapter) ...@@ -1811,20 +1811,20 @@ static void e1000_setup_rctl(struct e1000_adapter *adapter)
rctl &= ~E1000_RCTL_SZ_4096; rctl &= ~E1000_RCTL_SZ_4096;
rctl |= E1000_RCTL_BSEX; rctl |= E1000_RCTL_BSEX;
switch (adapter->rx_buffer_len) { switch (adapter->rx_buffer_len) {
case E1000_RXBUFFER_2048: case E1000_RXBUFFER_2048:
default: default:
rctl |= E1000_RCTL_SZ_2048; rctl |= E1000_RCTL_SZ_2048;
rctl &= ~E1000_RCTL_BSEX; rctl &= ~E1000_RCTL_BSEX;
break; break;
case E1000_RXBUFFER_4096: case E1000_RXBUFFER_4096:
rctl |= E1000_RCTL_SZ_4096; rctl |= E1000_RCTL_SZ_4096;
break; break;
case E1000_RXBUFFER_8192: case E1000_RXBUFFER_8192:
rctl |= E1000_RCTL_SZ_8192; rctl |= E1000_RCTL_SZ_8192;
break; break;
case E1000_RXBUFFER_16384: case E1000_RXBUFFER_16384:
rctl |= E1000_RCTL_SZ_16384; rctl |= E1000_RCTL_SZ_16384;
break; break;
} }
/* This is useful for sniffing bad packets. */ /* This is useful for sniffing bad packets. */
...@@ -1861,12 +1861,12 @@ static void e1000_configure_rx(struct e1000_adapter *adapter) ...@@ -1861,12 +1861,12 @@ static void e1000_configure_rx(struct e1000_adapter *adapter)
if (adapter->netdev->mtu > ETH_DATA_LEN) { if (adapter->netdev->mtu > ETH_DATA_LEN) {
rdlen = adapter->rx_ring[0].count * rdlen = adapter->rx_ring[0].count *
sizeof(struct e1000_rx_desc); sizeof(struct e1000_rx_desc);
adapter->clean_rx = e1000_clean_jumbo_rx_irq; adapter->clean_rx = e1000_clean_jumbo_rx_irq;
adapter->alloc_rx_buf = e1000_alloc_jumbo_rx_buffers; adapter->alloc_rx_buf = e1000_alloc_jumbo_rx_buffers;
} else { } else {
rdlen = adapter->rx_ring[0].count * rdlen = adapter->rx_ring[0].count *
sizeof(struct e1000_rx_desc); sizeof(struct e1000_rx_desc);
adapter->clean_rx = e1000_clean_rx_irq; adapter->clean_rx = e1000_clean_rx_irq;
adapter->alloc_rx_buf = e1000_alloc_rx_buffers; adapter->alloc_rx_buf = e1000_alloc_rx_buffers;
} }
...@@ -2761,7 +2761,9 @@ static int e1000_tso(struct e1000_adapter *adapter, ...@@ -2761,7 +2761,9 @@ static int e1000_tso(struct e1000_adapter *adapter,
buffer_info->time_stamp = jiffies; buffer_info->time_stamp = jiffies;
buffer_info->next_to_watch = i; buffer_info->next_to_watch = i;
if (++i == tx_ring->count) i = 0; if (++i == tx_ring->count)
i = 0;
tx_ring->next_to_use = i; tx_ring->next_to_use = i;
return true; return true;
...@@ -2816,7 +2818,9 @@ static bool e1000_tx_csum(struct e1000_adapter *adapter, ...@@ -2816,7 +2818,9 @@ static bool e1000_tx_csum(struct e1000_adapter *adapter,
buffer_info->time_stamp = jiffies; buffer_info->time_stamp = jiffies;
buffer_info->next_to_watch = i; buffer_info->next_to_watch = i;
if (unlikely(++i == tx_ring->count)) i = 0; if (unlikely(++i == tx_ring->count))
i = 0;
tx_ring->next_to_use = i; tx_ring->next_to_use = i;
return true; return true;
...@@ -2865,8 +2869,8 @@ static int e1000_tx_map(struct e1000_adapter *adapter, ...@@ -2865,8 +2869,8 @@ static int e1000_tx_map(struct e1000_adapter *adapter,
* packet is smaller than 2048 - 16 - 16 (or 2016) bytes * packet is smaller than 2048 - 16 - 16 (or 2016) bytes
*/ */
if (unlikely((hw->bus_type == e1000_bus_type_pcix) && if (unlikely((hw->bus_type == e1000_bus_type_pcix) &&
(size > 2015) && count == 0)) (size > 2015) && count == 0))
size = 2015; size = 2015;
/* Workaround for potential 82544 hang in PCI-X. Avoid /* Workaround for potential 82544 hang in PCI-X. Avoid
* terminating buffers within evenly-aligned dwords. * terminating buffers within evenly-aligned dwords.
...@@ -2963,7 +2967,7 @@ static int e1000_tx_map(struct e1000_adapter *adapter, ...@@ -2963,7 +2967,7 @@ static int e1000_tx_map(struct e1000_adapter *adapter,
count--; count--;
while (count--) { while (count--) {
if (i==0) if (i == 0)
i += tx_ring->count; i += tx_ring->count;
i--; i--;
buffer_info = &tx_ring->buffer_info[i]; buffer_info = &tx_ring->buffer_info[i];
...@@ -3013,7 +3017,8 @@ static void e1000_tx_queue(struct e1000_adapter *adapter, ...@@ -3013,7 +3017,8 @@ static void e1000_tx_queue(struct e1000_adapter *adapter,
tx_desc->lower.data = tx_desc->lower.data =
cpu_to_le32(txd_lower | buffer_info->length); cpu_to_le32(txd_lower | buffer_info->length);
tx_desc->upper.data = cpu_to_le32(txd_upper); tx_desc->upper.data = cpu_to_le32(txd_upper);
if (unlikely(++i == tx_ring->count)) i = 0; if (unlikely(++i == tx_ring->count))
i = 0;
} }
tx_desc->lower.data |= cpu_to_le32(adapter->txd_cmd); tx_desc->lower.data |= cpu_to_le32(adapter->txd_cmd);
...@@ -3101,7 +3106,7 @@ static int e1000_maybe_stop_tx(struct net_device *netdev, ...@@ -3101,7 +3106,7 @@ static int e1000_maybe_stop_tx(struct net_device *netdev,
return __e1000_maybe_stop_tx(netdev, size); return __e1000_maybe_stop_tx(netdev, size);
} }
#define TXD_USE_COUNT(S, X) (((S) >> (X)) + 1 ) #define TXD_USE_COUNT(S, X) (((S) >> (X)) + 1)
static netdev_tx_t e1000_xmit_frame(struct sk_buff *skb, static netdev_tx_t e1000_xmit_frame(struct sk_buff *skb,
struct net_device *netdev) struct net_device *netdev)
{ {
...@@ -3841,7 +3846,7 @@ static bool e1000_clean_tx_irq(struct e1000_adapter *adapter, ...@@ -3841,7 +3846,7 @@ static bool e1000_clean_tx_irq(struct e1000_adapter *adapter,
struct e1000_tx_buffer *buffer_info; struct e1000_tx_buffer *buffer_info;
unsigned int i, eop; unsigned int i, eop;
unsigned int count = 0; unsigned int count = 0;
unsigned int total_tx_bytes=0, total_tx_packets=0; unsigned int total_tx_bytes = 0, total_tx_packets = 0;
unsigned int bytes_compl = 0, pkts_compl = 0; unsigned int bytes_compl = 0, pkts_compl = 0;
i = tx_ring->next_to_clean; i = tx_ring->next_to_clean;
...@@ -3869,7 +3874,8 @@ static bool e1000_clean_tx_irq(struct e1000_adapter *adapter, ...@@ -3869,7 +3874,8 @@ static bool e1000_clean_tx_irq(struct e1000_adapter *adapter,
e1000_unmap_and_free_tx_resource(adapter, buffer_info); e1000_unmap_and_free_tx_resource(adapter, buffer_info);
tx_desc->upper.data = 0; tx_desc->upper.data = 0;
if (unlikely(++i == tx_ring->count)) i = 0; if (unlikely(++i == tx_ring->count))
i = 0;
} }
eop = tx_ring->buffer_info[i].next_to_watch; eop = tx_ring->buffer_info[i].next_to_watch;
...@@ -3957,9 +3963,11 @@ static void e1000_rx_checksum(struct e1000_adapter *adapter, u32 status_err, ...@@ -3957,9 +3963,11 @@ static void e1000_rx_checksum(struct e1000_adapter *adapter, u32 status_err,
skb_checksum_none_assert(skb); skb_checksum_none_assert(skb);
/* 82543 or newer only */ /* 82543 or newer only */
if (unlikely(hw->mac_type < e1000_82543)) return; if (unlikely(hw->mac_type < e1000_82543))
return;
/* Ignore Checksum bit is set */ /* Ignore Checksum bit is set */
if (unlikely(status & E1000_RXD_STAT_IXSM)) return; if (unlikely(status & E1000_RXD_STAT_IXSM))
return;
/* TCP/UDP checksum error bit is set */ /* TCP/UDP checksum error bit is set */
if (unlikely(errors & E1000_RXD_ERR_TCPE)) { if (unlikely(errors & E1000_RXD_ERR_TCPE)) {
/* let the stack verify checksum errors */ /* let the stack verify checksum errors */
...@@ -4139,7 +4147,7 @@ static bool e1000_clean_jumbo_rx_irq(struct e1000_adapter *adapter, ...@@ -4139,7 +4147,7 @@ static bool e1000_clean_jumbo_rx_irq(struct e1000_adapter *adapter,
unsigned int i; unsigned int i;
int cleaned_count = 0; int cleaned_count = 0;
bool cleaned = false; 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; i = rx_ring->next_to_clean;
rx_desc = E1000_RX_DESC(*rx_ring, i); rx_desc = E1000_RX_DESC(*rx_ring, i);
...@@ -4156,7 +4164,9 @@ static bool e1000_clean_jumbo_rx_irq(struct e1000_adapter *adapter, ...@@ -4156,7 +4164,9 @@ static bool e1000_clean_jumbo_rx_irq(struct e1000_adapter *adapter,
status = rx_desc->status; status = rx_desc->status;
if (++i == rx_ring->count) i = 0; if (++i == rx_ring->count)
i = 0;
next_rxd = E1000_RX_DESC(*rx_ring, i); next_rxd = E1000_RX_DESC(*rx_ring, i);
prefetch(next_rxd); prefetch(next_rxd);
...@@ -4359,7 +4369,7 @@ static bool e1000_clean_rx_irq(struct e1000_adapter *adapter, ...@@ -4359,7 +4369,7 @@ static bool e1000_clean_rx_irq(struct e1000_adapter *adapter,
unsigned int i; unsigned int i;
int cleaned_count = 0; int cleaned_count = 0;
bool cleaned = false; 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; i = rx_ring->next_to_clean;
rx_desc = E1000_RX_DESC(*rx_ring, i); rx_desc = E1000_RX_DESC(*rx_ring, i);
...@@ -4398,7 +4408,9 @@ static bool e1000_clean_rx_irq(struct e1000_adapter *adapter, ...@@ -4398,7 +4408,9 @@ static bool e1000_clean_rx_irq(struct e1000_adapter *adapter,
buffer_info->rxbuf.data = NULL; buffer_info->rxbuf.data = NULL;
} }
if (++i == rx_ring->count) i = 0; if (++i == rx_ring->count)
i = 0;
next_rxd = E1000_RX_DESC(*rx_ring, i); next_rxd = E1000_RX_DESC(*rx_ring, i);
prefetch(next_rxd); prefetch(next_rxd);
...@@ -4686,9 +4698,11 @@ static void e1000_smartspeed(struct e1000_adapter *adapter) ...@@ -4686,9 +4698,11 @@ static void e1000_smartspeed(struct e1000_adapter *adapter)
* we assume back-to-back * we assume back-to-back
*/ */
e1000_read_phy_reg(hw, PHY_1000T_STATUS, &phy_status); e1000_read_phy_reg(hw, PHY_1000T_STATUS, &phy_status);
if (!(phy_status & SR_1000T_MS_CONFIG_FAULT)) return; if (!(phy_status & SR_1000T_MS_CONFIG_FAULT))
return;
e1000_read_phy_reg(hw, PHY_1000T_STATUS, &phy_status); e1000_read_phy_reg(hw, PHY_1000T_STATUS, &phy_status);
if (!(phy_status & SR_1000T_MS_CONFIG_FAULT)) return; if (!(phy_status & SR_1000T_MS_CONFIG_FAULT))
return;
e1000_read_phy_reg(hw, PHY_1000T_CTRL, &phy_ctrl); e1000_read_phy_reg(hw, PHY_1000T_CTRL, &phy_ctrl);
if (phy_ctrl & CR_1000T_MS_ENABLE) { if (phy_ctrl & CR_1000T_MS_ENABLE) {
phy_ctrl &= ~CR_1000T_MS_ENABLE; phy_ctrl &= ~CR_1000T_MS_ENABLE;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment