Commit bfbae2ea authored by David S. Miller's avatar David S. Miller

Merge branch '1GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue

Jeff Kirsher says:

====================
Intel Wired LAN Driver Updates 2019-02-05

This series contains updates to igc, e1000e, ixgbe, fm10k and driver
documentation.

Kai-Heng Feng fixes an e1000e issue where the Wake-On-LAN settings where
being set incorrectly during a system suspend.

Sasha addresses community feedback on the igc driver and provides a
number of code cleanups to remove either unreachable or unused code.  In
addition, added basic ethtool support for the igc driver.

Mike Rapoport fixes the formatting of the kernel driver documentation so
that the title is properly formatted and does not get lumped with the
document sections in the HTML kernel documents generated.

Jiri Kosina updates a hard coded RAR entries value with the existing
define IXGBE_82599_RAR_ENTRIES.

Jake fixes up whitespace in the fm10k driver.

Konstantin Khlebnikov fixes an issue where in some cases, the e1000e
driver will continually reset during a system boot because the watchdog
task sees items in the transmit buffer but the carrier is off (trying to
establish link) causing the device reset to flush the buffer.  To
resolve, just move this check/flush into the watchdog section for when
the carrier is off.

Todd bumps the igb driver version to reflect the recent driver changes.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents bf2fa125 8c5ad0da
.. SPDX-License-Identifier: GPL-2.0+ .. SPDX-License-Identifier: GPL-2.0+
==============================================================
Linux* Base Driver for the Intel(R) PRO/100 Family of Adapters Linux* Base Driver for the Intel(R) PRO/100 Family of Adapters
============================================================== ==============================================================
......
.. SPDX-License-Identifier: GPL-2.0+ .. SPDX-License-Identifier: GPL-2.0+
===========================================================
Linux* Base Driver for Intel(R) Ethernet Network Connection Linux* Base Driver for Intel(R) Ethernet Network Connection
=========================================================== ===========================================================
......
.. SPDX-License-Identifier: GPL-2.0+ .. SPDX-License-Identifier: GPL-2.0+
======================================================
Linux* Driver for Intel(R) Ethernet Network Connection Linux* Driver for Intel(R) Ethernet Network Connection
====================================================== ======================================================
......
.. SPDX-License-Identifier: GPL-2.0+ .. SPDX-License-Identifier: GPL-2.0+
==============================================================
Linux* Base Driver for Intel(R) Ethernet Multi-host Controller Linux* Base Driver for Intel(R) Ethernet Multi-host Controller
============================================================== ==============================================================
......
.. SPDX-License-Identifier: GPL-2.0+ .. SPDX-License-Identifier: GPL-2.0+
==================================================================
Linux* Base Driver for the Intel(R) Ethernet Controller 700 Series Linux* Base Driver for the Intel(R) Ethernet Controller 700 Series
================================================================== ==================================================================
......
.. SPDX-License-Identifier: GPL-2.0+ .. SPDX-License-Identifier: GPL-2.0+
==================================================================
Linux* Base Driver for Intel(R) Ethernet Adaptive Virtual Function Linux* Base Driver for Intel(R) Ethernet Adaptive Virtual Function
================================================================== ==================================================================
......
.. SPDX-License-Identifier: GPL-2.0+ .. SPDX-License-Identifier: GPL-2.0+
===================================================================
Linux* Base Driver for the Intel(R) Ethernet Connection E800 Series Linux* Base Driver for the Intel(R) Ethernet Connection E800 Series
=================================================================== ===================================================================
......
.. SPDX-License-Identifier: GPL-2.0+ .. SPDX-License-Identifier: GPL-2.0+
===========================================================
Linux* Base Driver for Intel(R) Ethernet Network Connection Linux* Base Driver for Intel(R) Ethernet Network Connection
=========================================================== ===========================================================
......
.. SPDX-License-Identifier: GPL-2.0+ .. SPDX-License-Identifier: GPL-2.0+
============================================================
Linux* Base Virtual Function Driver for Intel(R) 1G Ethernet Linux* Base Virtual Function Driver for Intel(R) 1G Ethernet
============================================================ ============================================================
......
.. SPDX-License-Identifier: GPL-2.0+ .. SPDX-License-Identifier: GPL-2.0+
=====================================================================
Linux Base Driver for 10 Gigabit Intel(R) Ethernet Network Connection Linux Base Driver for 10 Gigabit Intel(R) Ethernet Network Connection
===================================================================== =====================================================================
......
.. SPDX-License-Identifier: GPL-2.0+ .. SPDX-License-Identifier: GPL-2.0+
=============================================================================
Linux* Base Driver for the Intel(R) Ethernet 10 Gigabit PCI Express Adapters Linux* Base Driver for the Intel(R) Ethernet 10 Gigabit PCI Express Adapters
============================================================================= =============================================================================
......
.. SPDX-License-Identifier: GPL-2.0+ .. SPDX-License-Identifier: GPL-2.0+
=============================================================
Linux* Base Virtual Function Driver for Intel(R) 10G Ethernet Linux* Base Virtual Function Driver for Intel(R) 10G Ethernet
============================================================= =============================================================
......
...@@ -696,11 +696,16 @@ static s32 e1000_reset_hw_80003es2lan(struct e1000_hw *hw) ...@@ -696,11 +696,16 @@ static s32 e1000_reset_hw_80003es2lan(struct e1000_hw *hw)
ret_val = ret_val =
e1000_read_kmrn_reg_80003es2lan(hw, E1000_KMRNCTRLSTA_INBAND_PARAM, e1000_read_kmrn_reg_80003es2lan(hw, E1000_KMRNCTRLSTA_INBAND_PARAM,
&kum_reg_data); &kum_reg_data);
if (ret_val) if (!ret_val) {
return ret_val;
kum_reg_data |= E1000_KMRNCTRLSTA_IBIST_DISABLE; kum_reg_data |= E1000_KMRNCTRLSTA_IBIST_DISABLE;
e1000_write_kmrn_reg_80003es2lan(hw, E1000_KMRNCTRLSTA_INBAND_PARAM, ret_val = e1000_write_kmrn_reg_80003es2lan(hw,
E1000_KMRNCTRLSTA_INBAND_PARAM,
kum_reg_data); kum_reg_data);
if (ret_val)
e_dbg("Error disabling far-end loopback\n");
} else {
e_dbg("Error disabling far-end loopback\n");
}
ret_val = e1000e_get_auto_rd_done(hw); ret_val = e1000e_get_auto_rd_done(hw);
if (ret_val) if (ret_val)
...@@ -754,11 +759,19 @@ static s32 e1000_init_hw_80003es2lan(struct e1000_hw *hw) ...@@ -754,11 +759,19 @@ static s32 e1000_init_hw_80003es2lan(struct e1000_hw *hw)
return ret_val; return ret_val;
/* Disable IBIST slave mode (far-end loopback) */ /* Disable IBIST slave mode (far-end loopback) */
ret_val =
e1000_read_kmrn_reg_80003es2lan(hw, E1000_KMRNCTRLSTA_INBAND_PARAM, e1000_read_kmrn_reg_80003es2lan(hw, E1000_KMRNCTRLSTA_INBAND_PARAM,
&kum_reg_data); &kum_reg_data);
if (!ret_val) {
kum_reg_data |= E1000_KMRNCTRLSTA_IBIST_DISABLE; kum_reg_data |= E1000_KMRNCTRLSTA_IBIST_DISABLE;
e1000_write_kmrn_reg_80003es2lan(hw, E1000_KMRNCTRLSTA_INBAND_PARAM, ret_val = e1000_write_kmrn_reg_80003es2lan(hw,
E1000_KMRNCTRLSTA_INBAND_PARAM,
kum_reg_data); kum_reg_data);
if (ret_val)
e_dbg("Error disabling far-end loopback\n");
} else {
e_dbg("Error disabling far-end loopback\n");
}
/* Set the transmit descriptor write-back policy */ /* Set the transmit descriptor write-back policy */
reg_data = er32(TXDCTL(0)); reg_data = er32(TXDCTL(0));
......
...@@ -5309,8 +5309,13 @@ static void e1000_watchdog_task(struct work_struct *work) ...@@ -5309,8 +5309,13 @@ static void e1000_watchdog_task(struct work_struct *work)
/* 8000ES2LAN requires a Rx packet buffer work-around /* 8000ES2LAN requires a Rx packet buffer work-around
* on link down event; reset the controller to flush * on link down event; reset the controller to flush
* the Rx packet buffer. * the Rx packet buffer.
*
* If the link is lost the controller stops DMA, but
* if there is queued Tx work it cannot be done. So
* reset the controller to flush the Tx packet buffers.
*/ */
if (adapter->flags & FLAG_RX_NEEDS_RESTART) if ((adapter->flags & FLAG_RX_NEEDS_RESTART) ||
e1000_desc_unused(tx_ring) + 1 < tx_ring->count)
adapter->flags |= FLAG_RESTART_NOW; adapter->flags |= FLAG_RESTART_NOW;
else else
pm_schedule_suspend(netdev->dev.parent, pm_schedule_suspend(netdev->dev.parent,
...@@ -5333,14 +5338,6 @@ static void e1000_watchdog_task(struct work_struct *work) ...@@ -5333,14 +5338,6 @@ static void e1000_watchdog_task(struct work_struct *work)
adapter->gotc_old = adapter->stats.gotc; adapter->gotc_old = adapter->stats.gotc;
spin_unlock(&adapter->stats64_lock); spin_unlock(&adapter->stats64_lock);
/* If the link is lost the controller stops DMA, but
* if there is queued Tx work it cannot be done. So
* reset the controller to flush the Tx packet buffers.
*/
if (!netif_carrier_ok(netdev) &&
(e1000_desc_unused(tx_ring) + 1 < tx_ring->count))
adapter->flags |= FLAG_RESTART_NOW;
/* If reset is necessary, do it outside of interrupt context. */ /* If reset is necessary, do it outside of interrupt context. */
if (adapter->flags & FLAG_RESTART_NOW) { if (adapter->flags & FLAG_RESTART_NOW) {
schedule_work(&adapter->reset_task); schedule_work(&adapter->reset_task);
...@@ -7351,6 +7348,8 @@ static int e1000_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -7351,6 +7348,8 @@ static int e1000_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
e1000_print_device_info(adapter); e1000_print_device_info(adapter);
dev_pm_set_driver_flags(&pdev->dev, DPM_FLAG_NEVER_SKIP);
if (pci_dev_run_wake(pdev)) if (pci_dev_run_wake(pdev))
pm_runtime_put_noidle(&pdev->dev); pm_runtime_put_noidle(&pdev->dev);
......
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
#include "igb.h" #include "igb.h"
#define MAJ 5 #define MAJ 5
#define MIN 4 #define MIN 6
#define BUILD 0 #define BUILD 0
#define DRV_VERSION __stringify(MAJ) "." __stringify(MIN) "." \ #define DRV_VERSION __stringify(MAJ) "." __stringify(MIN) "." \
__stringify(BUILD) "-k" __stringify(BUILD) "-k"
......
...@@ -7,4 +7,5 @@ ...@@ -7,4 +7,5 @@
obj-$(CONFIG_IGC) += igc.o obj-$(CONFIG_IGC) += igc.o
igc-objs := igc_main.o igc_mac.o igc_i225.o igc_base.o igc_nvm.o igc_phy.o igc-objs := igc_main.o igc_mac.o igc_i225.o igc_base.o igc_nvm.o igc_phy.o \
igc_ethtool.o
...@@ -13,19 +13,43 @@ ...@@ -13,19 +13,43 @@
#include "igc_hw.h" #include "igc_hw.h"
/* main */ /* forward declaration */
void igc_set_ethtool_ops(struct net_device *);
struct igc_adapter;
struct igc_ring;
void igc_up(struct igc_adapter *adapter);
void igc_down(struct igc_adapter *adapter);
int igc_setup_tx_resources(struct igc_ring *ring);
int igc_setup_rx_resources(struct igc_ring *ring);
void igc_free_tx_resources(struct igc_ring *ring);
void igc_free_rx_resources(struct igc_ring *ring);
unsigned int igc_get_max_rss_queues(struct igc_adapter *adapter);
void igc_set_flag_queue_pairs(struct igc_adapter *adapter,
const u32 max_rss_queues);
int igc_reinit_queues(struct igc_adapter *adapter);
bool igc_has_link(struct igc_adapter *adapter);
void igc_reset(struct igc_adapter *adapter);
int igc_set_spd_dplx(struct igc_adapter *adapter, u32 spd, u8 dplx);
extern char igc_driver_name[]; extern char igc_driver_name[];
extern char igc_driver_version[]; extern char igc_driver_version[];
#define IGC_REGS_LEN 740
#define IGC_RETA_SIZE 128
/* Interrupt defines */ /* Interrupt defines */
#define IGC_START_ITR 648 /* ~6000 ints/sec */ #define IGC_START_ITR 648 /* ~6000 ints/sec */
#define IGC_FLAG_HAS_MSI BIT(0) #define IGC_FLAG_HAS_MSI BIT(0)
#define IGC_FLAG_QUEUE_PAIRS BIT(4) #define IGC_FLAG_QUEUE_PAIRS BIT(3)
#define IGC_FLAG_DMAC BIT(4)
#define IGC_FLAG_NEED_LINK_UPDATE BIT(9) #define IGC_FLAG_NEED_LINK_UPDATE BIT(9)
#define IGC_FLAG_MEDIA_RESET BIT(10) #define IGC_FLAG_MEDIA_RESET BIT(10)
#define IGC_FLAG_MAS_ENABLE BIT(12) #define IGC_FLAG_MAS_ENABLE BIT(12)
#define IGC_FLAG_HAS_MSIX BIT(13) #define IGC_FLAG_HAS_MSIX BIT(13)
#define IGC_FLAG_VLAN_PROMISC BIT(15) #define IGC_FLAG_VLAN_PROMISC BIT(15)
#define IGC_FLAG_RX_LEGACY BIT(16)
#define IGC_START_ITR 648 /* ~6000 ints/sec */ #define IGC_START_ITR 648 /* ~6000 ints/sec */
#define IGC_4K_ITR 980 #define IGC_4K_ITR 980
...@@ -60,6 +84,7 @@ extern char igc_driver_version[]; ...@@ -60,6 +84,7 @@ extern char igc_driver_version[];
#define IGC_RXBUFFER_2048 2048 #define IGC_RXBUFFER_2048 2048
#define IGC_RXBUFFER_3072 3072 #define IGC_RXBUFFER_3072 3072
#define AUTO_ALL_MODES 0
#define IGC_RX_HDR_LEN IGC_RXBUFFER_256 #define IGC_RX_HDR_LEN IGC_RXBUFFER_256
/* RX and TX descriptor control thresholds. /* RX and TX descriptor control thresholds.
...@@ -340,6 +365,8 @@ struct igc_adapter { ...@@ -340,6 +365,8 @@ struct igc_adapter {
struct igc_mac_addr *mac_table; struct igc_mac_addr *mac_table;
u8 rss_indir_tbl[IGC_RETA_SIZE];
unsigned long link_check_timeout; unsigned long link_check_timeout;
struct igc_info ei; struct igc_info ei;
}; };
...@@ -418,6 +445,9 @@ static inline s32 igc_read_phy_reg(struct igc_hw *hw, u32 offset, u16 *data) ...@@ -418,6 +445,9 @@ static inline s32 igc_read_phy_reg(struct igc_hw *hw, u32 offset, u16 *data)
return 0; return 0;
} }
/* forward declaration */
void igc_reinit_locked(struct igc_adapter *);
#define igc_rx_pg_size(_ring) (PAGE_SIZE << igc_rx_pg_order(_ring)) #define igc_rx_pg_size(_ring) (PAGE_SIZE << igc_rx_pg_order(_ring))
#define IGC_TXD_DCMD (IGC_ADVTXD_DCMD_EOP | IGC_ADVTXD_DCMD_RS) #define IGC_TXD_DCMD (IGC_ADVTXD_DCMD_EOP | IGC_ADVTXD_DCMD_RS)
......
...@@ -53,22 +53,6 @@ static s32 igc_set_pcie_completion_timeout(struct igc_hw *hw) ...@@ -53,22 +53,6 @@ static s32 igc_set_pcie_completion_timeout(struct igc_hw *hw)
return ret_val; return ret_val;
} }
/**
* igc_check_for_link_base - Check for link
* @hw: pointer to the HW structure
*
* If sgmii is enabled, then use the pcs register to determine link, otherwise
* use the generic interface for determining link.
*/
static s32 igc_check_for_link_base(struct igc_hw *hw)
{
s32 ret_val = 0;
ret_val = igc_check_for_copper_link(hw);
return ret_val;
}
/** /**
* igc_reset_hw_base - Reset hardware * igc_reset_hw_base - Reset hardware
* @hw: pointer to the HW structure * @hw: pointer to the HW structure
...@@ -123,22 +107,6 @@ static s32 igc_reset_hw_base(struct igc_hw *hw) ...@@ -123,22 +107,6 @@ static s32 igc_reset_hw_base(struct igc_hw *hw)
return ret_val; return ret_val;
} }
/**
* igc_get_phy_id_base - Retrieve PHY addr and id
* @hw: pointer to the HW structure
*
* Retrieves the PHY address and ID for both PHY's which do and do not use
* sgmi interface.
*/
static s32 igc_get_phy_id_base(struct igc_hw *hw)
{
s32 ret_val = 0;
ret_val = igc_get_phy_id(hw);
return ret_val;
}
/** /**
* igc_init_nvm_params_base - Init NVM func ptrs. * igc_init_nvm_params_base - Init NVM func ptrs.
* @hw: pointer to the HW structure * @hw: pointer to the HW structure
...@@ -163,6 +131,7 @@ static s32 igc_init_nvm_params_base(struct igc_hw *hw) ...@@ -163,6 +131,7 @@ static s32 igc_init_nvm_params_base(struct igc_hw *hw)
if (size > 15) if (size > 15)
size = 15; size = 15;
nvm->type = igc_nvm_eeprom_spi;
nvm->word_size = BIT(size); nvm->word_size = BIT(size);
nvm->opcode_bits = 8; nvm->opcode_bits = 8;
nvm->delay_usec = 1; nvm->delay_usec = 1;
...@@ -261,11 +230,11 @@ static s32 igc_init_phy_params_base(struct igc_hw *hw) ...@@ -261,11 +230,11 @@ static s32 igc_init_phy_params_base(struct igc_hw *hw)
goto out; goto out;
} }
ret_val = igc_get_phy_id_base(hw); ret_val = igc_get_phy_id(hw);
if (ret_val) if (ret_val)
return ret_val; return ret_val;
igc_check_for_link_base(hw); igc_check_for_copper_link(hw);
/* Verify phy id and set remaining function pointers */ /* Verify phy id and set remaining function pointers */
switch (phy->id) { switch (phy->id) {
...@@ -349,26 +318,6 @@ static void igc_release_phy_base(struct igc_hw *hw) ...@@ -349,26 +318,6 @@ static void igc_release_phy_base(struct igc_hw *hw)
hw->mac.ops.release_swfw_sync(hw, mask); hw->mac.ops.release_swfw_sync(hw, mask);
} }
/**
* igc_get_link_up_info_base - Get link speed/duplex info
* @hw: pointer to the HW structure
* @speed: stores the current speed
* @duplex: stores the current duplex
*
* This is a wrapper function, if using the serial gigabit media independent
* interface, use PCS to retrieve the link speed and duplex information.
* Otherwise, use the generic function to get the link speed and duplex info.
*/
static s32 igc_get_link_up_info_base(struct igc_hw *hw, u16 *speed,
u16 *duplex)
{
s32 ret_val;
ret_val = igc_get_speed_and_duplex_copper(hw, speed, duplex);
return ret_val;
}
/** /**
* igc_init_hw_base - Initialize hardware * igc_init_hw_base - Initialize hardware
* @hw: pointer to the HW structure * @hw: pointer to the HW structure
...@@ -407,19 +356,6 @@ static s32 igc_init_hw_base(struct igc_hw *hw) ...@@ -407,19 +356,6 @@ static s32 igc_init_hw_base(struct igc_hw *hw)
return ret_val; return ret_val;
} }
/**
* igc_read_mac_addr_base - Read device MAC address
* @hw: pointer to the HW structure
*/
static s32 igc_read_mac_addr_base(struct igc_hw *hw)
{
s32 ret_val = 0;
ret_val = igc_read_mac_addr(hw);
return ret_val;
}
/** /**
* igc_power_down_phy_copper_base - Remove link during PHY power down * igc_power_down_phy_copper_base - Remove link during PHY power down
* @hw: pointer to the HW structure * @hw: pointer to the HW structure
...@@ -512,10 +448,10 @@ void igc_rx_fifo_flush_base(struct igc_hw *hw) ...@@ -512,10 +448,10 @@ void igc_rx_fifo_flush_base(struct igc_hw *hw)
static struct igc_mac_operations igc_mac_ops_base = { static struct igc_mac_operations igc_mac_ops_base = {
.init_hw = igc_init_hw_base, .init_hw = igc_init_hw_base,
.check_for_link = igc_check_for_link_base, .check_for_link = igc_check_for_copper_link,
.rar_set = igc_rar_set, .rar_set = igc_rar_set,
.read_mac_addr = igc_read_mac_addr_base, .read_mac_addr = igc_read_mac_addr,
.get_speed_and_duplex = igc_get_link_up_info_base, .get_speed_and_duplex = igc_get_speed_and_duplex_copper,
}; };
static const struct igc_phy_operations igc_phy_ops_base = { static const struct igc_phy_operations igc_phy_ops_base = {
......
...@@ -36,28 +36,6 @@ union igc_adv_tx_desc { ...@@ -36,28 +36,6 @@ union igc_adv_tx_desc {
#define IGC_RAR_ENTRIES 16 #define IGC_RAR_ENTRIES 16
struct igc_adv_data_desc {
__le64 buffer_addr; /* Address of the descriptor's data buffer */
union {
u32 data;
struct {
u32 datalen:16; /* Data buffer length */
u32 rsvd:4;
u32 dtyp:4; /* Descriptor type */
u32 dcmd:8; /* Descriptor command */
} config;
} lower;
union {
u32 data;
struct {
u32 status:4; /* Descriptor status */
u32 idx:4;
u32 popts:6; /* Packet Options */
u32 paylen:18; /* Payload length */
} options;
} upper;
};
/* Receive Descriptor - Advanced */ /* Receive Descriptor - Advanced */
union igc_adv_rx_desc { union igc_adv_rx_desc {
struct { struct {
...@@ -90,9 +68,6 @@ union igc_adv_rx_desc { ...@@ -90,9 +68,6 @@ union igc_adv_rx_desc {
} wb; /* writeback */ } wb; /* writeback */
}; };
/* Adv Transmit Descriptor Config Masks */
#define IGC_ADVTXD_PAYLEN_SHIFT 14 /* Adv desc PAYLEN shift */
/* Additional Transmit Descriptor Control definitions */ /* Additional Transmit Descriptor Control definitions */
#define IGC_TXDCTL_QUEUE_ENABLE 0x02000000 /* Ena specific Tx Queue */ #define IGC_TXDCTL_QUEUE_ENABLE 0x02000000 /* Ena specific Tx Queue */
......
...@@ -4,6 +4,10 @@ ...@@ -4,6 +4,10 @@
#ifndef _IGC_DEFINES_H_ #ifndef _IGC_DEFINES_H_
#define _IGC_DEFINES_H_ #define _IGC_DEFINES_H_
/* Number of Transmit and Receive Descriptors must be a multiple of 8 */
#define REQ_TX_DESCRIPTOR_MULTIPLE 8
#define REQ_RX_DESCRIPTOR_MULTIPLE 8
#define IGC_CTRL_EXT_DRV_LOAD 0x10000000 /* Drv loaded bit for FW */ #define IGC_CTRL_EXT_DRV_LOAD 0x10000000 /* Drv loaded bit for FW */
/* PCI Bus Info */ /* PCI Bus Info */
......
This diff is collapsed.
...@@ -55,6 +55,7 @@ enum igc_media_type { ...@@ -55,6 +55,7 @@ enum igc_media_type {
enum igc_nvm_type { enum igc_nvm_type {
igc_nvm_unknown = 0, igc_nvm_unknown = 0,
igc_nvm_eeprom_spi,
igc_nvm_flash_hw, igc_nvm_flash_hw,
igc_nvm_invm, igc_nvm_invm,
}; };
......
...@@ -12,6 +12,8 @@ ...@@ -12,6 +12,8 @@
#define DRV_VERSION "0.0.1-k" #define DRV_VERSION "0.0.1-k"
#define DRV_SUMMARY "Intel(R) 2.5G Ethernet Linux Driver" #define DRV_SUMMARY "Intel(R) 2.5G Ethernet Linux Driver"
#define DEFAULT_MSG_ENABLE (NETIF_MSG_DRV | NETIF_MSG_PROBE | NETIF_MSG_LINK)
static int debug = -1; static int debug = -1;
MODULE_AUTHOR("Intel Corporation, <linux.nics@intel.com>"); MODULE_AUTHOR("Intel Corporation, <linux.nics@intel.com>");
...@@ -66,7 +68,7 @@ enum latency_range { ...@@ -66,7 +68,7 @@ enum latency_range {
latency_invalid = 255 latency_invalid = 255
}; };
static void igc_reset(struct igc_adapter *adapter) void igc_reset(struct igc_adapter *adapter)
{ {
struct pci_dev *pdev = adapter->pdev; struct pci_dev *pdev = adapter->pdev;
struct igc_hw *hw = &adapter->hw; struct igc_hw *hw = &adapter->hw;
...@@ -150,7 +152,7 @@ static void igc_get_hw_control(struct igc_adapter *adapter) ...@@ -150,7 +152,7 @@ static void igc_get_hw_control(struct igc_adapter *adapter)
* *
* Free all transmit software resources * Free all transmit software resources
*/ */
static void igc_free_tx_resources(struct igc_ring *tx_ring) void igc_free_tx_resources(struct igc_ring *tx_ring)
{ {
igc_clean_tx_ring(tx_ring); igc_clean_tx_ring(tx_ring);
...@@ -261,7 +263,7 @@ static void igc_clean_all_tx_rings(struct igc_adapter *adapter) ...@@ -261,7 +263,7 @@ static void igc_clean_all_tx_rings(struct igc_adapter *adapter)
* *
* Return 0 on success, negative on failure * Return 0 on success, negative on failure
*/ */
static int igc_setup_tx_resources(struct igc_ring *tx_ring) int igc_setup_tx_resources(struct igc_ring *tx_ring)
{ {
struct device *dev = tx_ring->dev; struct device *dev = tx_ring->dev;
int size = 0; int size = 0;
...@@ -381,7 +383,7 @@ static void igc_clean_all_rx_rings(struct igc_adapter *adapter) ...@@ -381,7 +383,7 @@ static void igc_clean_all_rx_rings(struct igc_adapter *adapter)
* *
* Free all receive software resources * Free all receive software resources
*/ */
static void igc_free_rx_resources(struct igc_ring *rx_ring) void igc_free_rx_resources(struct igc_ring *rx_ring)
{ {
igc_clean_rx_ring(rx_ring); igc_clean_rx_ring(rx_ring);
...@@ -418,7 +420,7 @@ static void igc_free_all_rx_resources(struct igc_adapter *adapter) ...@@ -418,7 +420,7 @@ static void igc_free_all_rx_resources(struct igc_adapter *adapter)
* *
* Returns 0 on success, negative on failure * Returns 0 on success, negative on failure
*/ */
static int igc_setup_rx_resources(struct igc_ring *rx_ring) int igc_setup_rx_resources(struct igc_ring *rx_ring)
{ {
struct device *dev = rx_ring->dev; struct device *dev = rx_ring->dev;
int size, desc_len; int size, desc_len;
...@@ -1703,7 +1705,7 @@ static bool igc_clean_tx_irq(struct igc_q_vector *q_vector, int napi_budget) ...@@ -1703,7 +1705,7 @@ static bool igc_clean_tx_irq(struct igc_q_vector *q_vector, int napi_budget)
* igc_up - Open the interface and prepare it to handle traffic * igc_up - Open the interface and prepare it to handle traffic
* @adapter: board private structure * @adapter: board private structure
*/ */
static void igc_up(struct igc_adapter *adapter) void igc_up(struct igc_adapter *adapter)
{ {
struct igc_hw *hw = &adapter->hw; struct igc_hw *hw = &adapter->hw;
int i = 0; int i = 0;
...@@ -1748,7 +1750,7 @@ static void igc_nfc_filter_exit(struct igc_adapter *adapter) ...@@ -1748,7 +1750,7 @@ static void igc_nfc_filter_exit(struct igc_adapter *adapter)
* igc_down - Close the interface * igc_down - Close the interface
* @adapter: board private structure * @adapter: board private structure
*/ */
static void igc_down(struct igc_adapter *adapter) void igc_down(struct igc_adapter *adapter)
{ {
struct net_device *netdev = adapter->netdev; struct net_device *netdev = adapter->netdev;
struct igc_hw *hw = &adapter->hw; struct igc_hw *hw = &adapter->hw;
...@@ -1810,7 +1812,7 @@ static void igc_down(struct igc_adapter *adapter) ...@@ -1810,7 +1812,7 @@ static void igc_down(struct igc_adapter *adapter)
igc_clean_all_rx_rings(adapter); igc_clean_all_rx_rings(adapter);
} }
static void igc_reinit_locked(struct igc_adapter *adapter) void igc_reinit_locked(struct igc_adapter *adapter)
{ {
WARN_ON(in_interrupt()); WARN_ON(in_interrupt());
while (test_and_set_bit(__IGC_RESETTING, &adapter->state)) while (test_and_set_bit(__IGC_RESETTING, &adapter->state))
...@@ -1922,7 +1924,7 @@ static void igc_configure(struct igc_adapter *adapter) ...@@ -1922,7 +1924,7 @@ static void igc_configure(struct igc_adapter *adapter)
/** /**
* igc_rar_set_index - Sync RAL[index] and RAH[index] registers with MAC table * igc_rar_set_index - Sync RAL[index] and RAH[index] registers with MAC table
* @adapter: Pointer to adapter structure * @adapter: address of board private structure
* @index: Index of the RAR entry which need to be synced with MAC table * @index: Index of the RAR entry which need to be synced with MAC table
*/ */
static void igc_rar_set_index(struct igc_adapter *adapter, u32 index) static void igc_rar_set_index(struct igc_adapter *adapter, u32 index)
...@@ -2298,7 +2300,7 @@ static void igc_update_phy_info(struct timer_list *t) ...@@ -2298,7 +2300,7 @@ static void igc_update_phy_info(struct timer_list *t)
* igc_has_link - check shared code for link and determine up/down * igc_has_link - check shared code for link and determine up/down
* @adapter: pointer to driver private info * @adapter: pointer to driver private info
*/ */
static bool igc_has_link(struct igc_adapter *adapter) bool igc_has_link(struct igc_adapter *adapter)
{ {
struct igc_hw *hw = &adapter->hw; struct igc_hw *hw = &adapter->hw;
bool link_active = false; bool link_active = false;
...@@ -3501,6 +3503,57 @@ u32 igc_rd32(struct igc_hw *hw, u32 reg) ...@@ -3501,6 +3503,57 @@ u32 igc_rd32(struct igc_hw *hw, u32 reg)
return value; return value;
} }
int igc_set_spd_dplx(struct igc_adapter *adapter, u32 spd, u8 dplx)
{
struct pci_dev *pdev = adapter->pdev;
struct igc_mac_info *mac = &adapter->hw.mac;
mac->autoneg = 0;
/* Make sure dplx is at most 1 bit and lsb of speed is not set
* for the switch() below to work
*/
if ((spd & 1) || (dplx & ~1))
goto err_inval;
switch (spd + dplx) {
case SPEED_10 + DUPLEX_HALF:
mac->forced_speed_duplex = ADVERTISE_10_HALF;
break;
case SPEED_10 + DUPLEX_FULL:
mac->forced_speed_duplex = ADVERTISE_10_FULL;
break;
case SPEED_100 + DUPLEX_HALF:
mac->forced_speed_duplex = ADVERTISE_100_HALF;
break;
case SPEED_100 + DUPLEX_FULL:
mac->forced_speed_duplex = ADVERTISE_100_FULL;
break;
case SPEED_1000 + DUPLEX_FULL:
mac->autoneg = 1;
adapter->hw.phy.autoneg_advertised = ADVERTISE_1000_FULL;
break;
case SPEED_1000 + DUPLEX_HALF: /* not supported */
goto err_inval;
case SPEED_2500 + DUPLEX_FULL:
mac->autoneg = 1;
adapter->hw.phy.autoneg_advertised = ADVERTISE_2500_FULL;
break;
case SPEED_2500 + DUPLEX_HALF: /* not supported */
default:
goto err_inval;
}
/* clear MDI, MDI(-X) override is only allowed when autoneg enabled */
adapter->hw.phy.mdix = AUTO_ALL_MODES;
return 0;
err_inval:
dev_err(&pdev->dev, "Unsupported Speed/Duplex configuration\n");
return -EINVAL;
}
/** /**
* igc_probe - Device Initialization Routine * igc_probe - Device Initialization Routine
* @pdev: PCI device information struct * @pdev: PCI device information struct
...@@ -3568,7 +3621,7 @@ static int igc_probe(struct pci_dev *pdev, ...@@ -3568,7 +3621,7 @@ static int igc_probe(struct pci_dev *pdev,
hw = &adapter->hw; hw = &adapter->hw;
hw->back = adapter; hw->back = adapter;
adapter->port_num = hw->bus.func; adapter->port_num = hw->bus.func;
adapter->msg_enable = GENMASK(debug - 1, 0); adapter->msg_enable = netif_msg_init(debug, DEFAULT_MSG_ENABLE);
err = pci_save_state(pdev); err = pci_save_state(pdev);
if (err) if (err)
...@@ -3584,7 +3637,7 @@ static int igc_probe(struct pci_dev *pdev, ...@@ -3584,7 +3637,7 @@ static int igc_probe(struct pci_dev *pdev,
hw->hw_addr = adapter->io_addr; hw->hw_addr = adapter->io_addr;
netdev->netdev_ops = &igc_netdev_ops; netdev->netdev_ops = &igc_netdev_ops;
igc_set_ethtool_ops(netdev);
netdev->watchdog_timeo = 5 * HZ; netdev->watchdog_timeo = 5 * HZ;
netdev->mem_start = pci_resource_start(pdev, 0); netdev->mem_start = pci_resource_start(pdev, 0);
...@@ -3744,7 +3797,7 @@ static struct pci_driver igc_driver = { ...@@ -3744,7 +3797,7 @@ static struct pci_driver igc_driver = {
.remove = igc_remove, .remove = igc_remove,
}; };
static void igc_set_flag_queue_pairs(struct igc_adapter *adapter, void igc_set_flag_queue_pairs(struct igc_adapter *adapter,
const u32 max_rss_queues) const u32 max_rss_queues)
{ {
/* Determine if we need to pair queues. */ /* Determine if we need to pair queues. */
...@@ -3757,7 +3810,7 @@ static void igc_set_flag_queue_pairs(struct igc_adapter *adapter, ...@@ -3757,7 +3810,7 @@ static void igc_set_flag_queue_pairs(struct igc_adapter *adapter,
adapter->flags &= ~IGC_FLAG_QUEUE_PAIRS; adapter->flags &= ~IGC_FLAG_QUEUE_PAIRS;
} }
static unsigned int igc_get_max_rss_queues(struct igc_adapter *adapter) unsigned int igc_get_max_rss_queues(struct igc_adapter *adapter)
{ {
unsigned int max_rss_queues; unsigned int max_rss_queues;
...@@ -3836,6 +3889,32 @@ static int igc_sw_init(struct igc_adapter *adapter) ...@@ -3836,6 +3889,32 @@ static int igc_sw_init(struct igc_adapter *adapter)
return 0; return 0;
} }
/**
* igc_reinit_queues - return error
* @adapter: pointer to adapter structure
*/
int igc_reinit_queues(struct igc_adapter *adapter)
{
struct net_device *netdev = adapter->netdev;
struct pci_dev *pdev = adapter->pdev;
int err = 0;
if (netif_running(netdev))
igc_close(netdev);
igc_reset_interrupt_capability(adapter);
if (igc_init_interrupt_scheme(adapter, true)) {
dev_err(&pdev->dev, "Unable to allocate memory for queues\n");
return -ENOMEM;
}
if (netif_running(netdev))
err = igc_open(netdev);
return err;
}
/** /**
* igc_get_hw_dev - return device * igc_get_hw_dev - return device
* @hw: pointer to hardware structure * @hw: pointer to hardware structure
......
...@@ -152,7 +152,6 @@ void igc_power_down_phy_copper(struct igc_hw *hw) ...@@ -152,7 +152,6 @@ void igc_power_down_phy_copper(struct igc_hw *hw)
s32 igc_check_downshift(struct igc_hw *hw) s32 igc_check_downshift(struct igc_hw *hw)
{ {
struct igc_phy_info *phy = &hw->phy; struct igc_phy_info *phy = &hw->phy;
u16 phy_data, offset, mask;
s32 ret_val; s32 ret_val;
switch (phy->type) { switch (phy->type) {
...@@ -161,15 +160,8 @@ s32 igc_check_downshift(struct igc_hw *hw) ...@@ -161,15 +160,8 @@ s32 igc_check_downshift(struct igc_hw *hw)
/* speed downshift not supported */ /* speed downshift not supported */
phy->speed_downgraded = false; phy->speed_downgraded = false;
ret_val = 0; ret_val = 0;
goto out;
} }
ret_val = phy->ops.read_reg(hw, offset, &phy_data);
if (!ret_val)
phy->speed_downgraded = (phy_data & mask) ? true : false;
out:
return ret_val; return ret_val;
} }
......
...@@ -80,6 +80,9 @@ ...@@ -80,6 +80,9 @@
/* MSI-X Table Register Descriptions */ /* MSI-X Table Register Descriptions */
#define IGC_PBACL 0x05B68 /* MSIx PBA Clear - R/W 1 to clear */ #define IGC_PBACL 0x05B68 /* MSIx PBA Clear - R/W 1 to clear */
/* Redirection Table - RW Array */
#define IGC_RETA(_i) (0x05C00 + ((_i) * 4))
/* Receive Register Descriptions */ /* Receive Register Descriptions */
#define IGC_RCTL 0x00100 /* Rx Control - RW */ #define IGC_RCTL 0x00100 /* Rx Control - RW */
#define IGC_SRRCTL(_n) (0x0C00C + ((_n) * 0x40)) #define IGC_SRRCTL(_n) (0x0C00C + ((_n) * 0x40))
...@@ -188,7 +191,6 @@ ...@@ -188,7 +191,6 @@
#define IGC_HGOTCL 0x04130 /* Host Good Octets Transmit Count Low */ #define IGC_HGOTCL 0x04130 /* Host Good Octets Transmit Count Low */
#define IGC_HGOTCH 0x04134 /* Host Good Octets Transmit Count High */ #define IGC_HGOTCH 0x04134 /* Host Good Octets Transmit Count High */
#define IGC_LENERRS 0x04138 /* Length Errors Count */ #define IGC_LENERRS 0x04138 /* Length Errors Count */
#define IGC_SCVPC 0x04228 /* SerDes/SGMII Code Violation Pkt Count */
#define IGC_HRMPC 0x0A018 /* Header Redirection Missed Packet Count */ #define IGC_HRMPC 0x0A018 /* Header Redirection Missed Packet Count */
/* Management registers */ /* Management registers */
......
...@@ -1048,7 +1048,7 @@ static s32 ixgbe_reset_hw_82599(struct ixgbe_hw *hw) ...@@ -1048,7 +1048,7 @@ static s32 ixgbe_reset_hw_82599(struct ixgbe_hw *hw)
* clear the multicast table. Also reset num_rar_entries to 128, * clear the multicast table. Also reset num_rar_entries to 128,
* since we modify this value when programming the SAN MAC address. * since we modify this value when programming the SAN MAC address.
*/ */
hw->mac.num_rar_entries = 128; hw->mac.num_rar_entries = IXGBE_82599_RAR_ENTRIES;
hw->mac.ops.init_rx_addrs(hw); hw->mac.ops.init_rx_addrs(hw);
/* Store the permanent SAN mac address */ /* Store the permanent SAN mac address */
......
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