e1000: neaten function declarations
Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
This commit is contained in:
Родитель
cdc18a6709
Коммит
6479884509
|
@ -112,8 +112,8 @@ static const char e1000_gstrings_test[][ETH_GSTRING_LEN] = {
|
||||||
};
|
};
|
||||||
#define E1000_TEST_LEN ARRAY_SIZE(e1000_gstrings_test)
|
#define E1000_TEST_LEN ARRAY_SIZE(e1000_gstrings_test)
|
||||||
|
|
||||||
static int
|
static int e1000_get_settings(struct net_device *netdev,
|
||||||
e1000_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
|
struct ethtool_cmd *ecmd)
|
||||||
{
|
{
|
||||||
struct e1000_adapter *adapter = netdev_priv(netdev);
|
struct e1000_adapter *adapter = netdev_priv(netdev);
|
||||||
struct e1000_hw *hw = &adapter->hw;
|
struct e1000_hw *hw = &adapter->hw;
|
||||||
|
@ -185,8 +185,8 @@ e1000_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int e1000_set_settings(struct net_device *netdev,
|
||||||
e1000_set_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
|
struct ethtool_cmd *ecmd)
|
||||||
{
|
{
|
||||||
struct e1000_adapter *adapter = netdev_priv(netdev);
|
struct e1000_adapter *adapter = netdev_priv(netdev);
|
||||||
struct e1000_hw *hw = &adapter->hw;
|
struct e1000_hw *hw = &adapter->hw;
|
||||||
|
@ -231,9 +231,8 @@ e1000_set_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void e1000_get_pauseparam(struct net_device *netdev,
|
||||||
e1000_get_pauseparam(struct net_device *netdev,
|
struct ethtool_pauseparam *pause)
|
||||||
struct ethtool_pauseparam *pause)
|
|
||||||
{
|
{
|
||||||
struct e1000_adapter *adapter = netdev_priv(netdev);
|
struct e1000_adapter *adapter = netdev_priv(netdev);
|
||||||
struct e1000_hw *hw = &adapter->hw;
|
struct e1000_hw *hw = &adapter->hw;
|
||||||
|
@ -251,9 +250,8 @@ e1000_get_pauseparam(struct net_device *netdev,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int e1000_set_pauseparam(struct net_device *netdev,
|
||||||
e1000_set_pauseparam(struct net_device *netdev,
|
struct ethtool_pauseparam *pause)
|
||||||
struct ethtool_pauseparam *pause)
|
|
||||||
{
|
{
|
||||||
struct e1000_adapter *adapter = netdev_priv(netdev);
|
struct e1000_adapter *adapter = netdev_priv(netdev);
|
||||||
struct e1000_hw *hw = &adapter->hw;
|
struct e1000_hw *hw = &adapter->hw;
|
||||||
|
@ -289,15 +287,13 @@ e1000_set_pauseparam(struct net_device *netdev,
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
static u32
|
static u32 e1000_get_rx_csum(struct net_device *netdev)
|
||||||
e1000_get_rx_csum(struct net_device *netdev)
|
|
||||||
{
|
{
|
||||||
struct e1000_adapter *adapter = netdev_priv(netdev);
|
struct e1000_adapter *adapter = netdev_priv(netdev);
|
||||||
return adapter->rx_csum;
|
return adapter->rx_csum;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int e1000_set_rx_csum(struct net_device *netdev, u32 data)
|
||||||
e1000_set_rx_csum(struct net_device *netdev, u32 data)
|
|
||||||
{
|
{
|
||||||
struct e1000_adapter *adapter = netdev_priv(netdev);
|
struct e1000_adapter *adapter = netdev_priv(netdev);
|
||||||
adapter->rx_csum = data;
|
adapter->rx_csum = data;
|
||||||
|
@ -309,14 +305,12 @@ e1000_set_rx_csum(struct net_device *netdev, u32 data)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static u32
|
static u32 e1000_get_tx_csum(struct net_device *netdev)
|
||||||
e1000_get_tx_csum(struct net_device *netdev)
|
|
||||||
{
|
{
|
||||||
return (netdev->features & NETIF_F_HW_CSUM) != 0;
|
return (netdev->features & NETIF_F_HW_CSUM) != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int e1000_set_tx_csum(struct net_device *netdev, u32 data)
|
||||||
e1000_set_tx_csum(struct net_device *netdev, u32 data)
|
|
||||||
{
|
{
|
||||||
struct e1000_adapter *adapter = netdev_priv(netdev);
|
struct e1000_adapter *adapter = netdev_priv(netdev);
|
||||||
|
|
||||||
|
@ -334,8 +328,7 @@ e1000_set_tx_csum(struct net_device *netdev, u32 data)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int e1000_set_tso(struct net_device *netdev, u32 data)
|
||||||
e1000_set_tso(struct net_device *netdev, u32 data)
|
|
||||||
{
|
{
|
||||||
struct e1000_adapter *adapter = netdev_priv(netdev);
|
struct e1000_adapter *adapter = netdev_priv(netdev);
|
||||||
if ((adapter->hw.mac_type < e1000_82544) ||
|
if ((adapter->hw.mac_type < e1000_82544) ||
|
||||||
|
@ -357,30 +350,26 @@ e1000_set_tso(struct net_device *netdev, u32 data)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static u32
|
static u32 e1000_get_msglevel(struct net_device *netdev)
|
||||||
e1000_get_msglevel(struct net_device *netdev)
|
|
||||||
{
|
{
|
||||||
struct e1000_adapter *adapter = netdev_priv(netdev);
|
struct e1000_adapter *adapter = netdev_priv(netdev);
|
||||||
return adapter->msg_enable;
|
return adapter->msg_enable;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void e1000_set_msglevel(struct net_device *netdev, u32 data)
|
||||||
e1000_set_msglevel(struct net_device *netdev, u32 data)
|
|
||||||
{
|
{
|
||||||
struct e1000_adapter *adapter = netdev_priv(netdev);
|
struct e1000_adapter *adapter = netdev_priv(netdev);
|
||||||
adapter->msg_enable = data;
|
adapter->msg_enable = data;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int e1000_get_regs_len(struct net_device *netdev)
|
||||||
e1000_get_regs_len(struct net_device *netdev)
|
|
||||||
{
|
{
|
||||||
#define E1000_REGS_LEN 32
|
#define E1000_REGS_LEN 32
|
||||||
return E1000_REGS_LEN * sizeof(u32);
|
return E1000_REGS_LEN * sizeof(u32);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void e1000_get_regs(struct net_device *netdev, struct ethtool_regs *regs,
|
||||||
e1000_get_regs(struct net_device *netdev,
|
void *p)
|
||||||
struct ethtool_regs *regs, void *p)
|
|
||||||
{
|
{
|
||||||
struct e1000_adapter *adapter = netdev_priv(netdev);
|
struct e1000_adapter *adapter = netdev_priv(netdev);
|
||||||
struct e1000_hw *hw = &adapter->hw;
|
struct e1000_hw *hw = &adapter->hw;
|
||||||
|
@ -468,16 +457,14 @@ e1000_get_regs(struct net_device *netdev,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int e1000_get_eeprom_len(struct net_device *netdev)
|
||||||
e1000_get_eeprom_len(struct net_device *netdev)
|
|
||||||
{
|
{
|
||||||
struct e1000_adapter *adapter = netdev_priv(netdev);
|
struct e1000_adapter *adapter = netdev_priv(netdev);
|
||||||
return adapter->hw.eeprom.word_size * 2;
|
return adapter->hw.eeprom.word_size * 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int e1000_get_eeprom(struct net_device *netdev,
|
||||||
e1000_get_eeprom(struct net_device *netdev,
|
struct ethtool_eeprom *eeprom, u8 *bytes)
|
||||||
struct ethtool_eeprom *eeprom, u8 *bytes)
|
|
||||||
{
|
{
|
||||||
struct e1000_adapter *adapter = netdev_priv(netdev);
|
struct e1000_adapter *adapter = netdev_priv(netdev);
|
||||||
struct e1000_hw *hw = &adapter->hw;
|
struct e1000_hw *hw = &adapter->hw;
|
||||||
|
@ -521,9 +508,8 @@ e1000_get_eeprom(struct net_device *netdev,
|
||||||
return ret_val;
|
return ret_val;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int e1000_set_eeprom(struct net_device *netdev,
|
||||||
e1000_set_eeprom(struct net_device *netdev,
|
struct ethtool_eeprom *eeprom, u8 *bytes)
|
||||||
struct ethtool_eeprom *eeprom, u8 *bytes)
|
|
||||||
{
|
{
|
||||||
struct e1000_adapter *adapter = netdev_priv(netdev);
|
struct e1000_adapter *adapter = netdev_priv(netdev);
|
||||||
struct e1000_hw *hw = &adapter->hw;
|
struct e1000_hw *hw = &adapter->hw;
|
||||||
|
@ -584,9 +570,8 @@ e1000_set_eeprom(struct net_device *netdev,
|
||||||
return ret_val;
|
return ret_val;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void e1000_get_drvinfo(struct net_device *netdev,
|
||||||
e1000_get_drvinfo(struct net_device *netdev,
|
struct ethtool_drvinfo *drvinfo)
|
||||||
struct ethtool_drvinfo *drvinfo)
|
|
||||||
{
|
{
|
||||||
struct e1000_adapter *adapter = netdev_priv(netdev);
|
struct e1000_adapter *adapter = netdev_priv(netdev);
|
||||||
char firmware_version[32];
|
char firmware_version[32];
|
||||||
|
@ -619,9 +604,8 @@ e1000_get_drvinfo(struct net_device *netdev,
|
||||||
drvinfo->eedump_len = e1000_get_eeprom_len(netdev);
|
drvinfo->eedump_len = e1000_get_eeprom_len(netdev);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void e1000_get_ringparam(struct net_device *netdev,
|
||||||
e1000_get_ringparam(struct net_device *netdev,
|
struct ethtool_ringparam *ring)
|
||||||
struct ethtool_ringparam *ring)
|
|
||||||
{
|
{
|
||||||
struct e1000_adapter *adapter = netdev_priv(netdev);
|
struct e1000_adapter *adapter = netdev_priv(netdev);
|
||||||
e1000_mac_type mac_type = adapter->hw.mac_type;
|
e1000_mac_type mac_type = adapter->hw.mac_type;
|
||||||
|
@ -640,9 +624,8 @@ e1000_get_ringparam(struct net_device *netdev,
|
||||||
ring->rx_jumbo_pending = 0;
|
ring->rx_jumbo_pending = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int e1000_set_ringparam(struct net_device *netdev,
|
||||||
e1000_set_ringparam(struct net_device *netdev,
|
struct ethtool_ringparam *ring)
|
||||||
struct ethtool_ringparam *ring)
|
|
||||||
{
|
{
|
||||||
struct e1000_adapter *adapter = netdev_priv(netdev);
|
struct e1000_adapter *adapter = netdev_priv(netdev);
|
||||||
e1000_mac_type mac_type = adapter->hw.mac_type;
|
e1000_mac_type mac_type = adapter->hw.mac_type;
|
||||||
|
@ -728,8 +711,8 @@ err_setup:
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool reg_pattern_test(struct e1000_adapter *adapter, u64 *data,
|
static bool reg_pattern_test(struct e1000_adapter *adapter, u64 *data, int reg,
|
||||||
int reg, u32 mask, u32 write)
|
u32 mask, u32 write)
|
||||||
{
|
{
|
||||||
static const u32 test[] =
|
static const u32 test[] =
|
||||||
{0x5A5A5A5A, 0xA5A5A5A5, 0x00000000, 0xFFFFFFFF};
|
{0x5A5A5A5A, 0xA5A5A5A5, 0x00000000, 0xFFFFFFFF};
|
||||||
|
@ -751,8 +734,8 @@ static bool reg_pattern_test(struct e1000_adapter *adapter, u64 *data,
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool reg_set_and_check(struct e1000_adapter *adapter, u64 *data,
|
static bool reg_set_and_check(struct e1000_adapter *adapter, u64 *data, int reg,
|
||||||
int reg, u32 mask, u32 write)
|
u32 mask, u32 write)
|
||||||
{
|
{
|
||||||
u8 __iomem *address = adapter->hw.hw_addr + reg;
|
u8 __iomem *address = adapter->hw.hw_addr + reg;
|
||||||
u32 read;
|
u32 read;
|
||||||
|
@ -787,8 +770,7 @@ static bool reg_set_and_check(struct e1000_adapter *adapter, u64 *data,
|
||||||
return 1; \
|
return 1; \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
static int
|
static int e1000_reg_test(struct e1000_adapter *adapter, u64 *data)
|
||||||
e1000_reg_test(struct e1000_adapter *adapter, u64 *data)
|
|
||||||
{
|
{
|
||||||
u32 value, before, after;
|
u32 value, before, after;
|
||||||
u32 i, toggle;
|
u32 i, toggle;
|
||||||
|
@ -883,8 +865,7 @@ e1000_reg_test(struct e1000_adapter *adapter, u64 *data)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int e1000_eeprom_test(struct e1000_adapter *adapter, u64 *data)
|
||||||
e1000_eeprom_test(struct e1000_adapter *adapter, u64 *data)
|
|
||||||
{
|
{
|
||||||
u16 temp;
|
u16 temp;
|
||||||
u16 checksum = 0;
|
u16 checksum = 0;
|
||||||
|
@ -907,8 +888,7 @@ e1000_eeprom_test(struct e1000_adapter *adapter, u64 *data)
|
||||||
return *data;
|
return *data;
|
||||||
}
|
}
|
||||||
|
|
||||||
static irqreturn_t
|
static irqreturn_t e1000_test_intr(int irq, void *data)
|
||||||
e1000_test_intr(int 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_adapter *adapter = netdev_priv(netdev);
|
||||||
|
@ -918,8 +898,7 @@ e1000_test_intr(int irq, void *data)
|
||||||
return IRQ_HANDLED;
|
return IRQ_HANDLED;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int e1000_intr_test(struct e1000_adapter *adapter, u64 *data)
|
||||||
e1000_intr_test(struct e1000_adapter *adapter, u64 *data)
|
|
||||||
{
|
{
|
||||||
struct net_device *netdev = adapter->netdev;
|
struct net_device *netdev = adapter->netdev;
|
||||||
u32 mask, i = 0;
|
u32 mask, i = 0;
|
||||||
|
@ -1017,8 +996,7 @@ e1000_intr_test(struct e1000_adapter *adapter, u64 *data)
|
||||||
return *data;
|
return *data;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void e1000_free_desc_rings(struct e1000_adapter *adapter)
|
||||||
e1000_free_desc_rings(struct e1000_adapter *adapter)
|
|
||||||
{
|
{
|
||||||
struct e1000_tx_ring *txdr = &adapter->test_tx_ring;
|
struct e1000_tx_ring *txdr = &adapter->test_tx_ring;
|
||||||
struct e1000_rx_ring *rxdr = &adapter->test_rx_ring;
|
struct e1000_rx_ring *rxdr = &adapter->test_rx_ring;
|
||||||
|
@ -1064,8 +1042,7 @@ e1000_free_desc_rings(struct e1000_adapter *adapter)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int e1000_setup_desc_rings(struct e1000_adapter *adapter)
|
||||||
e1000_setup_desc_rings(struct e1000_adapter *adapter)
|
|
||||||
{
|
{
|
||||||
struct e1000_tx_ring *txdr = &adapter->test_tx_ring;
|
struct e1000_tx_ring *txdr = &adapter->test_tx_ring;
|
||||||
struct e1000_rx_ring *rxdr = &adapter->test_rx_ring;
|
struct e1000_rx_ring *rxdr = &adapter->test_rx_ring;
|
||||||
|
@ -1189,8 +1166,7 @@ err_nomem:
|
||||||
return ret_val;
|
return ret_val;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void e1000_phy_disable_receiver(struct e1000_adapter *adapter)
|
||||||
e1000_phy_disable_receiver(struct e1000_adapter *adapter)
|
|
||||||
{
|
{
|
||||||
/* Write out to PHY registers 29 and 30 to disable the Receiver. */
|
/* Write out to PHY registers 29 and 30 to disable the Receiver. */
|
||||||
e1000_write_phy_reg(&adapter->hw, 29, 0x001F);
|
e1000_write_phy_reg(&adapter->hw, 29, 0x001F);
|
||||||
|
@ -1199,8 +1175,7 @@ e1000_phy_disable_receiver(struct e1000_adapter *adapter)
|
||||||
e1000_write_phy_reg(&adapter->hw, 30, 0x8FF0);
|
e1000_write_phy_reg(&adapter->hw, 30, 0x8FF0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void e1000_phy_reset_clk_and_crs(struct e1000_adapter *adapter)
|
||||||
e1000_phy_reset_clk_and_crs(struct e1000_adapter *adapter)
|
|
||||||
{
|
{
|
||||||
u16 phy_reg;
|
u16 phy_reg;
|
||||||
|
|
||||||
|
@ -1223,8 +1198,7 @@ e1000_phy_reset_clk_and_crs(struct e1000_adapter *adapter)
|
||||||
M88E1000_PHY_SPEC_CTRL, phy_reg);
|
M88E1000_PHY_SPEC_CTRL, phy_reg);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int e1000_nonintegrated_phy_loopback(struct e1000_adapter *adapter)
|
||||||
e1000_nonintegrated_phy_loopback(struct e1000_adapter *adapter)
|
|
||||||
{
|
{
|
||||||
u32 ctrl_reg;
|
u32 ctrl_reg;
|
||||||
u16 phy_reg;
|
u16 phy_reg;
|
||||||
|
@ -1290,8 +1264,7 @@ e1000_nonintegrated_phy_loopback(struct e1000_adapter *adapter)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int e1000_integrated_phy_loopback(struct e1000_adapter *adapter)
|
||||||
e1000_integrated_phy_loopback(struct e1000_adapter *adapter)
|
|
||||||
{
|
{
|
||||||
u32 ctrl_reg = 0;
|
u32 ctrl_reg = 0;
|
||||||
u32 stat_reg = 0;
|
u32 stat_reg = 0;
|
||||||
|
@ -1360,8 +1333,7 @@ e1000_integrated_phy_loopback(struct e1000_adapter *adapter)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int e1000_set_phy_loopback(struct e1000_adapter *adapter)
|
||||||
e1000_set_phy_loopback(struct e1000_adapter *adapter)
|
|
||||||
{
|
{
|
||||||
u16 phy_reg = 0;
|
u16 phy_reg = 0;
|
||||||
u16 count = 0;
|
u16 count = 0;
|
||||||
|
@ -1412,8 +1384,7 @@ e1000_set_phy_loopback(struct e1000_adapter *adapter)
|
||||||
return 8;
|
return 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int e1000_setup_loopback_test(struct e1000_adapter *adapter)
|
||||||
e1000_setup_loopback_test(struct e1000_adapter *adapter)
|
|
||||||
{
|
{
|
||||||
struct e1000_hw *hw = &adapter->hw;
|
struct e1000_hw *hw = &adapter->hw;
|
||||||
u32 rctl;
|
u32 rctl;
|
||||||
|
@ -1447,8 +1418,7 @@ e1000_setup_loopback_test(struct e1000_adapter *adapter)
|
||||||
return 7;
|
return 7;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void e1000_loopback_cleanup(struct e1000_adapter *adapter)
|
||||||
e1000_loopback_cleanup(struct e1000_adapter *adapter)
|
|
||||||
{
|
{
|
||||||
struct e1000_hw *hw = &adapter->hw;
|
struct e1000_hw *hw = &adapter->hw;
|
||||||
u32 rctl;
|
u32 rctl;
|
||||||
|
@ -1489,8 +1459,8 @@ e1000_loopback_cleanup(struct e1000_adapter *adapter)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void e1000_create_lbtest_frame(struct sk_buff *skb,
|
||||||
e1000_create_lbtest_frame(struct sk_buff *skb, unsigned int frame_size)
|
unsigned int frame_size)
|
||||||
{
|
{
|
||||||
memset(skb->data, 0xFF, frame_size);
|
memset(skb->data, 0xFF, frame_size);
|
||||||
frame_size &= ~1;
|
frame_size &= ~1;
|
||||||
|
@ -1499,8 +1469,8 @@ e1000_create_lbtest_frame(struct sk_buff *skb, unsigned int frame_size)
|
||||||
memset(&skb->data[frame_size / 2 + 12], 0xAF, 1);
|
memset(&skb->data[frame_size / 2 + 12], 0xAF, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int e1000_check_lbtest_frame(struct sk_buff *skb,
|
||||||
e1000_check_lbtest_frame(struct sk_buff *skb, unsigned int frame_size)
|
unsigned int frame_size)
|
||||||
{
|
{
|
||||||
frame_size &= ~1;
|
frame_size &= ~1;
|
||||||
if (*(skb->data + 3) == 0xFF) {
|
if (*(skb->data + 3) == 0xFF) {
|
||||||
|
@ -1512,8 +1482,7 @@ e1000_check_lbtest_frame(struct sk_buff *skb, unsigned int frame_size)
|
||||||
return 13;
|
return 13;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int e1000_run_loopback_test(struct e1000_adapter *adapter)
|
||||||
e1000_run_loopback_test(struct e1000_adapter *adapter)
|
|
||||||
{
|
{
|
||||||
struct e1000_tx_ring *txdr = &adapter->test_tx_ring;
|
struct e1000_tx_ring *txdr = &adapter->test_tx_ring;
|
||||||
struct e1000_rx_ring *rxdr = &adapter->test_rx_ring;
|
struct e1000_rx_ring *rxdr = &adapter->test_rx_ring;
|
||||||
|
@ -1577,8 +1546,7 @@ e1000_run_loopback_test(struct e1000_adapter *adapter)
|
||||||
return ret_val;
|
return ret_val;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int e1000_loopback_test(struct e1000_adapter *adapter, u64 *data)
|
||||||
e1000_loopback_test(struct e1000_adapter *adapter, u64 *data)
|
|
||||||
{
|
{
|
||||||
/* PHY loopback cannot be performed if SoL/IDER
|
/* PHY loopback cannot be performed if SoL/IDER
|
||||||
* sessions are active */
|
* sessions are active */
|
||||||
|
@ -1602,8 +1570,7 @@ out:
|
||||||
return *data;
|
return *data;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int e1000_link_test(struct e1000_adapter *adapter, u64 *data)
|
||||||
e1000_link_test(struct e1000_adapter *adapter, u64 *data)
|
|
||||||
{
|
{
|
||||||
*data = 0;
|
*data = 0;
|
||||||
if (adapter->hw.media_type == e1000_media_type_internal_serdes) {
|
if (adapter->hw.media_type == e1000_media_type_internal_serdes) {
|
||||||
|
@ -1632,8 +1599,7 @@ e1000_link_test(struct e1000_adapter *adapter, u64 *data)
|
||||||
return *data;
|
return *data;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int e1000_get_sset_count(struct net_device *netdev, int sset)
|
||||||
e1000_get_sset_count(struct net_device *netdev, int sset)
|
|
||||||
{
|
{
|
||||||
switch (sset) {
|
switch (sset) {
|
||||||
case ETH_SS_TEST:
|
case ETH_SS_TEST:
|
||||||
|
@ -1645,9 +1611,8 @@ e1000_get_sset_count(struct net_device *netdev, int sset)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void e1000_diag_test(struct net_device *netdev,
|
||||||
e1000_diag_test(struct net_device *netdev,
|
struct ethtool_test *eth_test, u64 *data)
|
||||||
struct ethtool_test *eth_test, u64 *data)
|
|
||||||
{
|
{
|
||||||
struct e1000_adapter *adapter = netdev_priv(netdev);
|
struct e1000_adapter *adapter = netdev_priv(netdev);
|
||||||
bool if_running = netif_running(netdev);
|
bool if_running = netif_running(netdev);
|
||||||
|
@ -1717,7 +1682,8 @@ e1000_diag_test(struct net_device *netdev,
|
||||||
msleep_interruptible(4 * 1000);
|
msleep_interruptible(4 * 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int e1000_wol_exclusion(struct e1000_adapter *adapter, struct ethtool_wolinfo *wol)
|
static int e1000_wol_exclusion(struct e1000_adapter *adapter,
|
||||||
|
struct ethtool_wolinfo *wol)
|
||||||
{
|
{
|
||||||
struct e1000_hw *hw = &adapter->hw;
|
struct e1000_hw *hw = &adapter->hw;
|
||||||
int retval = 1; /* fail by default */
|
int retval = 1; /* fail by default */
|
||||||
|
@ -1778,8 +1744,8 @@ static int e1000_wol_exclusion(struct e1000_adapter *adapter, struct ethtool_wol
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void e1000_get_wol(struct net_device *netdev,
|
||||||
e1000_get_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)
|
struct ethtool_wolinfo *wol)
|
||||||
{
|
{
|
||||||
struct e1000_adapter *adapter = netdev_priv(netdev);
|
struct e1000_adapter *adapter = netdev_priv(netdev);
|
||||||
|
|
||||||
|
@ -1818,8 +1784,7 @@ e1000_get_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int e1000_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)
|
||||||
e1000_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)
|
|
||||||
{
|
{
|
||||||
struct e1000_adapter *adapter = netdev_priv(netdev);
|
struct e1000_adapter *adapter = netdev_priv(netdev);
|
||||||
struct e1000_hw *hw = &adapter->hw;
|
struct e1000_hw *hw = &adapter->hw;
|
||||||
|
@ -1863,8 +1828,7 @@ e1000_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)
|
||||||
/* bit defines for adapter->led_status */
|
/* bit defines for adapter->led_status */
|
||||||
#define E1000_LED_ON 0
|
#define E1000_LED_ON 0
|
||||||
|
|
||||||
static void
|
static void e1000_led_blink_callback(unsigned long data)
|
||||||
e1000_led_blink_callback(unsigned long data)
|
|
||||||
{
|
{
|
||||||
struct e1000_adapter *adapter = (struct e1000_adapter *) data;
|
struct e1000_adapter *adapter = (struct e1000_adapter *) data;
|
||||||
|
|
||||||
|
@ -1876,8 +1840,7 @@ e1000_led_blink_callback(unsigned long data)
|
||||||
mod_timer(&adapter->blink_timer, jiffies + E1000_ID_INTERVAL);
|
mod_timer(&adapter->blink_timer, jiffies + E1000_ID_INTERVAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int e1000_phys_id(struct net_device *netdev, u32 data)
|
||||||
e1000_phys_id(struct net_device *netdev, u32 data)
|
|
||||||
{
|
{
|
||||||
struct e1000_adapter *adapter = netdev_priv(netdev);
|
struct e1000_adapter *adapter = netdev_priv(netdev);
|
||||||
|
|
||||||
|
@ -1916,8 +1879,7 @@ e1000_phys_id(struct net_device *netdev, u32 data)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int e1000_nway_reset(struct net_device *netdev)
|
||||||
e1000_nway_reset(struct net_device *netdev)
|
|
||||||
{
|
{
|
||||||
struct e1000_adapter *adapter = netdev_priv(netdev);
|
struct e1000_adapter *adapter = netdev_priv(netdev);
|
||||||
if (netif_running(netdev))
|
if (netif_running(netdev))
|
||||||
|
@ -1925,9 +1887,8 @@ e1000_nway_reset(struct net_device *netdev)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void e1000_get_ethtool_stats(struct net_device *netdev,
|
||||||
e1000_get_ethtool_stats(struct net_device *netdev,
|
struct ethtool_stats *stats, u64 *data)
|
||||||
struct ethtool_stats *stats, u64 *data)
|
|
||||||
{
|
{
|
||||||
struct e1000_adapter *adapter = netdev_priv(netdev);
|
struct e1000_adapter *adapter = netdev_priv(netdev);
|
||||||
int i;
|
int i;
|
||||||
|
@ -1941,8 +1902,8 @@ e1000_get_ethtool_stats(struct net_device *netdev,
|
||||||
/* BUG_ON(i != E1000_STATS_LEN); */
|
/* BUG_ON(i != E1000_STATS_LEN); */
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void e1000_get_strings(struct net_device *netdev, u32 stringset,
|
||||||
e1000_get_strings(struct net_device *netdev, u32 stringset, u8 *data)
|
u8 *data)
|
||||||
{
|
{
|
||||||
u8 *p = data;
|
u8 *p = data;
|
||||||
int i;
|
int i;
|
||||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -232,8 +232,7 @@ MODULE_PARM_DESC(debug, "Debug level (0=none,...,16=all)");
|
||||||
* loaded. All it does is register with the PCI subsystem.
|
* loaded. All it does is register with the PCI subsystem.
|
||||||
**/
|
**/
|
||||||
|
|
||||||
static int __init
|
static int __init e1000_init_module(void)
|
||||||
e1000_init_module(void)
|
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
printk(KERN_INFO "%s - version %s\n",
|
printk(KERN_INFO "%s - version %s\n",
|
||||||
|
@ -261,8 +260,7 @@ module_init(e1000_init_module);
|
||||||
* from memory.
|
* from memory.
|
||||||
**/
|
**/
|
||||||
|
|
||||||
static void __exit
|
static void __exit e1000_exit_module(void)
|
||||||
e1000_exit_module(void)
|
|
||||||
{
|
{
|
||||||
pci_unregister_driver(&e1000_driver);
|
pci_unregister_driver(&e1000_driver);
|
||||||
}
|
}
|
||||||
|
@ -311,8 +309,7 @@ static void e1000_free_irq(struct e1000_adapter *adapter)
|
||||||
* @adapter: board private structure
|
* @adapter: board private structure
|
||||||
**/
|
**/
|
||||||
|
|
||||||
static void
|
static void e1000_irq_disable(struct e1000_adapter *adapter)
|
||||||
e1000_irq_disable(struct e1000_adapter *adapter)
|
|
||||||
{
|
{
|
||||||
E1000_WRITE_REG(&adapter->hw, IMC, ~0);
|
E1000_WRITE_REG(&adapter->hw, IMC, ~0);
|
||||||
E1000_WRITE_FLUSH(&adapter->hw);
|
E1000_WRITE_FLUSH(&adapter->hw);
|
||||||
|
@ -324,15 +321,13 @@ e1000_irq_disable(struct e1000_adapter *adapter)
|
||||||
* @adapter: board private structure
|
* @adapter: board private structure
|
||||||
**/
|
**/
|
||||||
|
|
||||||
static void
|
static void e1000_irq_enable(struct e1000_adapter *adapter)
|
||||||
e1000_irq_enable(struct e1000_adapter *adapter)
|
|
||||||
{
|
{
|
||||||
E1000_WRITE_REG(&adapter->hw, IMS, IMS_ENABLE_MASK);
|
E1000_WRITE_REG(&adapter->hw, IMS, IMS_ENABLE_MASK);
|
||||||
E1000_WRITE_FLUSH(&adapter->hw);
|
E1000_WRITE_FLUSH(&adapter->hw);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void e1000_update_mng_vlan(struct e1000_adapter *adapter)
|
||||||
e1000_update_mng_vlan(struct e1000_adapter *adapter)
|
|
||||||
{
|
{
|
||||||
struct net_device *netdev = adapter->netdev;
|
struct net_device *netdev = adapter->netdev;
|
||||||
u16 vid = adapter->hw.mng_cookie.vlan_id;
|
u16 vid = adapter->hw.mng_cookie.vlan_id;
|
||||||
|
@ -366,8 +361,7 @@ e1000_update_mng_vlan(struct e1000_adapter *adapter)
|
||||||
*
|
*
|
||||||
**/
|
**/
|
||||||
|
|
||||||
static void
|
static void e1000_release_hw_control(struct e1000_adapter *adapter)
|
||||||
e1000_release_hw_control(struct e1000_adapter *adapter)
|
|
||||||
{
|
{
|
||||||
u32 ctrl_ext;
|
u32 ctrl_ext;
|
||||||
u32 swsm;
|
u32 swsm;
|
||||||
|
@ -403,8 +397,7 @@ e1000_release_hw_control(struct e1000_adapter *adapter)
|
||||||
*
|
*
|
||||||
**/
|
**/
|
||||||
|
|
||||||
static void
|
static void e1000_get_hw_control(struct e1000_adapter *adapter)
|
||||||
e1000_get_hw_control(struct e1000_adapter *adapter)
|
|
||||||
{
|
{
|
||||||
u32 ctrl_ext;
|
u32 ctrl_ext;
|
||||||
u32 swsm;
|
u32 swsm;
|
||||||
|
@ -429,8 +422,7 @@ e1000_get_hw_control(struct e1000_adapter *adapter)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void e1000_init_manageability(struct e1000_adapter *adapter)
|
||||||
e1000_init_manageability(struct e1000_adapter *adapter)
|
|
||||||
{
|
{
|
||||||
if (adapter->en_mng_pt) {
|
if (adapter->en_mng_pt) {
|
||||||
u32 manc = E1000_READ_REG(&adapter->hw, MANC);
|
u32 manc = E1000_READ_REG(&adapter->hw, MANC);
|
||||||
|
@ -456,8 +448,7 @@ e1000_init_manageability(struct e1000_adapter *adapter)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void e1000_release_manageability(struct e1000_adapter *adapter)
|
||||||
e1000_release_manageability(struct e1000_adapter *adapter)
|
|
||||||
{
|
{
|
||||||
if (adapter->en_mng_pt) {
|
if (adapter->en_mng_pt) {
|
||||||
u32 manc = E1000_READ_REG(&adapter->hw, MANC);
|
u32 manc = E1000_READ_REG(&adapter->hw, MANC);
|
||||||
|
@ -591,8 +582,7 @@ out:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void e1000_down(struct e1000_adapter *adapter)
|
||||||
e1000_down(struct e1000_adapter *adapter)
|
|
||||||
{
|
{
|
||||||
struct net_device *netdev = adapter->netdev;
|
struct net_device *netdev = adapter->netdev;
|
||||||
|
|
||||||
|
@ -620,8 +610,7 @@ e1000_down(struct e1000_adapter *adapter)
|
||||||
e1000_clean_all_rx_rings(adapter);
|
e1000_clean_all_rx_rings(adapter);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void e1000_reinit_locked(struct e1000_adapter *adapter)
|
||||||
e1000_reinit_locked(struct e1000_adapter *adapter)
|
|
||||||
{
|
{
|
||||||
WARN_ON(in_interrupt());
|
WARN_ON(in_interrupt());
|
||||||
while (test_and_set_bit(__E1000_RESETTING, &adapter->flags))
|
while (test_and_set_bit(__E1000_RESETTING, &adapter->flags))
|
||||||
|
@ -631,8 +620,7 @@ e1000_reinit_locked(struct e1000_adapter *adapter)
|
||||||
clear_bit(__E1000_RESETTING, &adapter->flags);
|
clear_bit(__E1000_RESETTING, &adapter->flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void e1000_reset(struct e1000_adapter *adapter)
|
||||||
e1000_reset(struct e1000_adapter *adapter)
|
|
||||||
{
|
{
|
||||||
u32 pba = 0, tx_space, min_tx_space, min_rx_space;
|
u32 pba = 0, tx_space, min_tx_space, min_rx_space;
|
||||||
u16 fc_high_water_mark = E1000_FC_HIGH_DIFF;
|
u16 fc_high_water_mark = E1000_FC_HIGH_DIFF;
|
||||||
|
@ -1231,8 +1219,7 @@ err_dma:
|
||||||
* memory.
|
* memory.
|
||||||
**/
|
**/
|
||||||
|
|
||||||
static void __devexit
|
static void __devexit e1000_remove(struct pci_dev *pdev)
|
||||||
e1000_remove(struct pci_dev *pdev)
|
|
||||||
{
|
{
|
||||||
struct net_device *netdev = pci_get_drvdata(pdev);
|
struct net_device *netdev = pci_get_drvdata(pdev);
|
||||||
struct e1000_adapter *adapter = netdev_priv(netdev);
|
struct e1000_adapter *adapter = netdev_priv(netdev);
|
||||||
|
@ -1283,8 +1270,7 @@ e1000_remove(struct pci_dev *pdev)
|
||||||
* OS network device settings (MTU size).
|
* OS network device settings (MTU size).
|
||||||
**/
|
**/
|
||||||
|
|
||||||
static int __devinit
|
static int __devinit e1000_sw_init(struct e1000_adapter *adapter)
|
||||||
e1000_sw_init(struct e1000_adapter *adapter)
|
|
||||||
{
|
{
|
||||||
struct e1000_hw *hw = &adapter->hw;
|
struct e1000_hw *hw = &adapter->hw;
|
||||||
struct net_device *netdev = adapter->netdev;
|
struct net_device *netdev = adapter->netdev;
|
||||||
|
@ -1377,8 +1363,7 @@ e1000_sw_init(struct e1000_adapter *adapter)
|
||||||
* intended for Multiqueue, but should work fine with a single queue.
|
* intended for Multiqueue, but should work fine with a single queue.
|
||||||
**/
|
**/
|
||||||
|
|
||||||
static int __devinit
|
static int __devinit e1000_alloc_queues(struct e1000_adapter *adapter)
|
||||||
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);
|
||||||
|
@ -1419,8 +1404,7 @@ e1000_alloc_queues(struct e1000_adapter *adapter)
|
||||||
* and the stack is notified that the interface is ready.
|
* and the stack is notified that the interface is ready.
|
||||||
**/
|
**/
|
||||||
|
|
||||||
static int
|
static int e1000_open(struct net_device *netdev)
|
||||||
e1000_open(struct net_device *netdev)
|
|
||||||
{
|
{
|
||||||
struct e1000_adapter *adapter = netdev_priv(netdev);
|
struct e1000_adapter *adapter = netdev_priv(netdev);
|
||||||
int err;
|
int err;
|
||||||
|
@ -1503,8 +1487,7 @@ err_setup_tx:
|
||||||
* hardware, and all transmit and receive resources are freed.
|
* hardware, and all transmit and receive resources are freed.
|
||||||
**/
|
**/
|
||||||
|
|
||||||
static int
|
static int e1000_close(struct net_device *netdev)
|
||||||
e1000_close(struct net_device *netdev)
|
|
||||||
{
|
{
|
||||||
struct e1000_adapter *adapter = netdev_priv(netdev);
|
struct e1000_adapter *adapter = netdev_priv(netdev);
|
||||||
|
|
||||||
|
@ -1540,9 +1523,8 @@ e1000_close(struct net_device *netdev)
|
||||||
* @start: address of beginning of memory
|
* @start: address of beginning of memory
|
||||||
* @len: length of memory
|
* @len: length of memory
|
||||||
**/
|
**/
|
||||||
static bool
|
static bool e1000_check_64k_bound(struct e1000_adapter *adapter, void *start,
|
||||||
e1000_check_64k_bound(struct e1000_adapter *adapter,
|
unsigned long len)
|
||||||
void *start, unsigned long len)
|
|
||||||
{
|
{
|
||||||
unsigned long begin = (unsigned long) start;
|
unsigned long begin = (unsigned long) start;
|
||||||
unsigned long end = begin + len;
|
unsigned long end = begin + len;
|
||||||
|
@ -1565,9 +1547,8 @@ e1000_check_64k_bound(struct e1000_adapter *adapter,
|
||||||
* Return 0 on success, negative on failure
|
* Return 0 on success, negative on failure
|
||||||
**/
|
**/
|
||||||
|
|
||||||
static int
|
static int e1000_setup_tx_resources(struct e1000_adapter *adapter,
|
||||||
e1000_setup_tx_resources(struct e1000_adapter *adapter,
|
struct e1000_tx_ring *txdr)
|
||||||
struct e1000_tx_ring *txdr)
|
|
||||||
{
|
{
|
||||||
struct pci_dev *pdev = adapter->pdev;
|
struct pci_dev *pdev = adapter->pdev;
|
||||||
int size;
|
int size;
|
||||||
|
@ -1641,8 +1622,7 @@ setup_tx_desc_die:
|
||||||
* Return 0 on success, negative on failure
|
* Return 0 on success, negative on failure
|
||||||
**/
|
**/
|
||||||
|
|
||||||
int
|
int e1000_setup_all_tx_resources(struct e1000_adapter *adapter)
|
||||||
e1000_setup_all_tx_resources(struct e1000_adapter *adapter)
|
|
||||||
{
|
{
|
||||||
int i, err = 0;
|
int i, err = 0;
|
||||||
|
|
||||||
|
@ -1668,8 +1648,7 @@ e1000_setup_all_tx_resources(struct e1000_adapter *adapter)
|
||||||
* Configure the Tx unit of the MAC after a reset.
|
* Configure the Tx unit of the MAC after a reset.
|
||||||
**/
|
**/
|
||||||
|
|
||||||
static void
|
static void e1000_configure_tx(struct e1000_adapter *adapter)
|
||||||
e1000_configure_tx(struct e1000_adapter *adapter)
|
|
||||||
{
|
{
|
||||||
u64 tdba;
|
u64 tdba;
|
||||||
struct e1000_hw *hw = &adapter->hw;
|
struct e1000_hw *hw = &adapter->hw;
|
||||||
|
@ -1782,9 +1761,8 @@ e1000_configure_tx(struct e1000_adapter *adapter)
|
||||||
* Returns 0 on success, negative on failure
|
* Returns 0 on success, negative on failure
|
||||||
**/
|
**/
|
||||||
|
|
||||||
static int
|
static int e1000_setup_rx_resources(struct e1000_adapter *adapter,
|
||||||
e1000_setup_rx_resources(struct e1000_adapter *adapter,
|
struct e1000_rx_ring *rxdr)
|
||||||
struct e1000_rx_ring *rxdr)
|
|
||||||
{
|
{
|
||||||
struct pci_dev *pdev = adapter->pdev;
|
struct pci_dev *pdev = adapter->pdev;
|
||||||
int size, desc_len;
|
int size, desc_len;
|
||||||
|
@ -1887,8 +1865,7 @@ setup_rx_desc_die:
|
||||||
* Return 0 on success, negative on failure
|
* Return 0 on success, negative on failure
|
||||||
**/
|
**/
|
||||||
|
|
||||||
int
|
int e1000_setup_all_rx_resources(struct e1000_adapter *adapter)
|
||||||
e1000_setup_all_rx_resources(struct e1000_adapter *adapter)
|
|
||||||
{
|
{
|
||||||
int i, err = 0;
|
int i, err = 0;
|
||||||
|
|
||||||
|
@ -1913,8 +1890,7 @@ e1000_setup_all_rx_resources(struct e1000_adapter *adapter)
|
||||||
**/
|
**/
|
||||||
#define PAGE_USE_COUNT(S) (((S) >> PAGE_SHIFT) + \
|
#define PAGE_USE_COUNT(S) (((S) >> PAGE_SHIFT) + \
|
||||||
(((S) & (PAGE_SIZE - 1)) ? 1 : 0))
|
(((S) & (PAGE_SIZE - 1)) ? 1 : 0))
|
||||||
static void
|
static void e1000_setup_rctl(struct e1000_adapter *adapter)
|
||||||
e1000_setup_rctl(struct e1000_adapter *adapter)
|
|
||||||
{
|
{
|
||||||
u32 rctl, rfctl;
|
u32 rctl, rfctl;
|
||||||
u32 psrctl = 0;
|
u32 psrctl = 0;
|
||||||
|
@ -2031,8 +2007,7 @@ e1000_setup_rctl(struct e1000_adapter *adapter)
|
||||||
* Configure the Rx unit of the MAC after a reset.
|
* Configure the Rx unit of the MAC after a reset.
|
||||||
**/
|
**/
|
||||||
|
|
||||||
static void
|
static void e1000_configure_rx(struct e1000_adapter *adapter)
|
||||||
e1000_configure_rx(struct e1000_adapter *adapter)
|
|
||||||
{
|
{
|
||||||
u64 rdba;
|
u64 rdba;
|
||||||
struct e1000_hw *hw = &adapter->hw;
|
struct e1000_hw *hw = &adapter->hw;
|
||||||
|
@ -2131,9 +2106,8 @@ e1000_configure_rx(struct e1000_adapter *adapter)
|
||||||
* Free all transmit software resources
|
* Free all transmit software resources
|
||||||
**/
|
**/
|
||||||
|
|
||||||
static void
|
static void e1000_free_tx_resources(struct e1000_adapter *adapter,
|
||||||
e1000_free_tx_resources(struct e1000_adapter *adapter,
|
struct e1000_tx_ring *tx_ring)
|
||||||
struct e1000_tx_ring *tx_ring)
|
|
||||||
{
|
{
|
||||||
struct pci_dev *pdev = adapter->pdev;
|
struct pci_dev *pdev = adapter->pdev;
|
||||||
|
|
||||||
|
@ -2154,8 +2128,7 @@ e1000_free_tx_resources(struct e1000_adapter *adapter,
|
||||||
* Free all transmit software resources
|
* Free all transmit software resources
|
||||||
**/
|
**/
|
||||||
|
|
||||||
void
|
void e1000_free_all_tx_resources(struct e1000_adapter *adapter)
|
||||||
e1000_free_all_tx_resources(struct e1000_adapter *adapter)
|
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
@ -2163,9 +2136,8 @@ e1000_free_all_tx_resources(struct e1000_adapter *adapter)
|
||||||
e1000_free_tx_resources(adapter, &adapter->tx_ring[i]);
|
e1000_free_tx_resources(adapter, &adapter->tx_ring[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void e1000_unmap_and_free_tx_resource(struct e1000_adapter *adapter,
|
||||||
e1000_unmap_and_free_tx_resource(struct e1000_adapter *adapter,
|
struct e1000_buffer *buffer_info)
|
||||||
struct e1000_buffer *buffer_info)
|
|
||||||
{
|
{
|
||||||
if (buffer_info->dma) {
|
if (buffer_info->dma) {
|
||||||
pci_unmap_page(adapter->pdev,
|
pci_unmap_page(adapter->pdev,
|
||||||
|
@ -2187,9 +2159,8 @@ e1000_unmap_and_free_tx_resource(struct e1000_adapter *adapter,
|
||||||
* @tx_ring: ring to be cleaned
|
* @tx_ring: ring to be cleaned
|
||||||
**/
|
**/
|
||||||
|
|
||||||
static void
|
static void e1000_clean_tx_ring(struct e1000_adapter *adapter,
|
||||||
e1000_clean_tx_ring(struct e1000_adapter *adapter,
|
struct e1000_tx_ring *tx_ring)
|
||||||
struct e1000_tx_ring *tx_ring)
|
|
||||||
{
|
{
|
||||||
struct e1000_buffer *buffer_info;
|
struct e1000_buffer *buffer_info;
|
||||||
unsigned long size;
|
unsigned long size;
|
||||||
|
@ -2222,8 +2193,7 @@ e1000_clean_tx_ring(struct e1000_adapter *adapter,
|
||||||
* @adapter: board private structure
|
* @adapter: board private structure
|
||||||
**/
|
**/
|
||||||
|
|
||||||
static void
|
static void e1000_clean_all_tx_rings(struct e1000_adapter *adapter)
|
||||||
e1000_clean_all_tx_rings(struct e1000_adapter *adapter)
|
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
@ -2239,9 +2209,8 @@ e1000_clean_all_tx_rings(struct e1000_adapter *adapter)
|
||||||
* Free all receive software resources
|
* Free all receive software resources
|
||||||
**/
|
**/
|
||||||
|
|
||||||
static void
|
static void e1000_free_rx_resources(struct e1000_adapter *adapter,
|
||||||
e1000_free_rx_resources(struct e1000_adapter *adapter,
|
struct e1000_rx_ring *rx_ring)
|
||||||
struct e1000_rx_ring *rx_ring)
|
|
||||||
{
|
{
|
||||||
struct pci_dev *pdev = adapter->pdev;
|
struct pci_dev *pdev = adapter->pdev;
|
||||||
|
|
||||||
|
@ -2266,8 +2235,7 @@ e1000_free_rx_resources(struct e1000_adapter *adapter,
|
||||||
* Free all receive software resources
|
* Free all receive software resources
|
||||||
**/
|
**/
|
||||||
|
|
||||||
void
|
void e1000_free_all_rx_resources(struct e1000_adapter *adapter)
|
||||||
e1000_free_all_rx_resources(struct e1000_adapter *adapter)
|
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
@ -2281,9 +2249,8 @@ e1000_free_all_rx_resources(struct e1000_adapter *adapter)
|
||||||
* @rx_ring: ring to free buffers from
|
* @rx_ring: ring to free buffers from
|
||||||
**/
|
**/
|
||||||
|
|
||||||
static void
|
static void e1000_clean_rx_ring(struct e1000_adapter *adapter,
|
||||||
e1000_clean_rx_ring(struct e1000_adapter *adapter,
|
struct e1000_rx_ring *rx_ring)
|
||||||
struct e1000_rx_ring *rx_ring)
|
|
||||||
{
|
{
|
||||||
struct e1000_buffer *buffer_info;
|
struct e1000_buffer *buffer_info;
|
||||||
struct e1000_ps_page *ps_page;
|
struct e1000_ps_page *ps_page;
|
||||||
|
@ -2340,8 +2307,7 @@ e1000_clean_rx_ring(struct e1000_adapter *adapter,
|
||||||
* @adapter: board private structure
|
* @adapter: board private structure
|
||||||
**/
|
**/
|
||||||
|
|
||||||
static void
|
static void e1000_clean_all_rx_rings(struct e1000_adapter *adapter)
|
||||||
e1000_clean_all_rx_rings(struct e1000_adapter *adapter)
|
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
@ -2352,8 +2318,7 @@ e1000_clean_all_rx_rings(struct e1000_adapter *adapter)
|
||||||
/* The 82542 2.0 (revision 2) needs to have the receive unit in reset
|
/* The 82542 2.0 (revision 2) needs to have the receive unit in reset
|
||||||
* and memory write and invalidate disabled for certain operations
|
* and memory write and invalidate disabled for certain operations
|
||||||
*/
|
*/
|
||||||
static void
|
static void e1000_enter_82542_rst(struct e1000_adapter *adapter)
|
||||||
e1000_enter_82542_rst(struct e1000_adapter *adapter)
|
|
||||||
{
|
{
|
||||||
struct net_device *netdev = adapter->netdev;
|
struct net_device *netdev = adapter->netdev;
|
||||||
u32 rctl;
|
u32 rctl;
|
||||||
|
@ -2370,8 +2335,7 @@ e1000_enter_82542_rst(struct e1000_adapter *adapter)
|
||||||
e1000_clean_all_rx_rings(adapter);
|
e1000_clean_all_rx_rings(adapter);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void e1000_leave_82542_rst(struct e1000_adapter *adapter)
|
||||||
e1000_leave_82542_rst(struct e1000_adapter *adapter)
|
|
||||||
{
|
{
|
||||||
struct net_device *netdev = adapter->netdev;
|
struct net_device *netdev = adapter->netdev;
|
||||||
u32 rctl;
|
u32 rctl;
|
||||||
|
@ -2401,8 +2365,7 @@ e1000_leave_82542_rst(struct e1000_adapter *adapter)
|
||||||
* Returns 0 on success, negative on failure
|
* Returns 0 on success, negative on failure
|
||||||
**/
|
**/
|
||||||
|
|
||||||
static int
|
static int e1000_set_mac(struct net_device *netdev, void *p)
|
||||||
e1000_set_mac(struct net_device *netdev, void *p)
|
|
||||||
{
|
{
|
||||||
struct e1000_adapter *adapter = netdev_priv(netdev);
|
struct e1000_adapter *adapter = netdev_priv(netdev);
|
||||||
struct sockaddr *addr = p;
|
struct sockaddr *addr = p;
|
||||||
|
@ -2452,8 +2415,7 @@ e1000_set_mac(struct net_device *netdev, void *p)
|
||||||
* promiscuous mode, and all-multi behavior.
|
* promiscuous mode, and all-multi behavior.
|
||||||
**/
|
**/
|
||||||
|
|
||||||
static void
|
static void e1000_set_rx_mode(struct net_device *netdev)
|
||||||
e1000_set_rx_mode(struct net_device *netdev)
|
|
||||||
{
|
{
|
||||||
struct e1000_adapter *adapter = netdev_priv(netdev);
|
struct e1000_adapter *adapter = netdev_priv(netdev);
|
||||||
struct e1000_hw *hw = &adapter->hw;
|
struct e1000_hw *hw = &adapter->hw;
|
||||||
|
@ -2552,8 +2514,7 @@ e1000_set_rx_mode(struct net_device *netdev)
|
||||||
/* Need to wait a few seconds after link up to get diagnostic information from
|
/* Need to wait a few seconds after link up to get diagnostic information from
|
||||||
* the phy */
|
* the phy */
|
||||||
|
|
||||||
static void
|
static void e1000_update_phy_info(unsigned long data)
|
||||||
e1000_update_phy_info(unsigned long data)
|
|
||||||
{
|
{
|
||||||
struct e1000_adapter *adapter = (struct e1000_adapter *) data;
|
struct e1000_adapter *adapter = (struct e1000_adapter *) data;
|
||||||
e1000_phy_get_info(&adapter->hw, &adapter->phy_info);
|
e1000_phy_get_info(&adapter->hw, &adapter->phy_info);
|
||||||
|
@ -2564,8 +2525,7 @@ e1000_update_phy_info(unsigned long data)
|
||||||
* @data: pointer to adapter cast into an unsigned long
|
* @data: pointer to adapter cast into an unsigned long
|
||||||
**/
|
**/
|
||||||
|
|
||||||
static void
|
static void e1000_82547_tx_fifo_stall(unsigned long data)
|
||||||
e1000_82547_tx_fifo_stall(unsigned long data)
|
|
||||||
{
|
{
|
||||||
struct e1000_adapter *adapter = (struct e1000_adapter *) data;
|
struct e1000_adapter *adapter = (struct e1000_adapter *) data;
|
||||||
struct net_device *netdev = adapter->netdev;
|
struct net_device *netdev = adapter->netdev;
|
||||||
|
@ -2605,8 +2565,7 @@ e1000_82547_tx_fifo_stall(unsigned long data)
|
||||||
* e1000_watchdog - Timer Call-back
|
* e1000_watchdog - Timer Call-back
|
||||||
* @data: pointer to adapter cast into an unsigned long
|
* @data: pointer to adapter cast into an unsigned long
|
||||||
**/
|
**/
|
||||||
static void
|
static void e1000_watchdog(unsigned long data)
|
||||||
e1000_watchdog(unsigned long data)
|
|
||||||
{
|
{
|
||||||
struct e1000_adapter *adapter = (struct e1000_adapter *) data;
|
struct e1000_adapter *adapter = (struct e1000_adapter *) data;
|
||||||
struct net_device *netdev = adapter->netdev;
|
struct net_device *netdev = adapter->netdev;
|
||||||
|
@ -2806,9 +2765,7 @@ enum latency_range {
|
||||||
* @bytes: the number of bytes during this measurement interval
|
* @bytes: the number of bytes during this measurement interval
|
||||||
**/
|
**/
|
||||||
static unsigned int e1000_update_itr(struct e1000_adapter *adapter,
|
static unsigned int e1000_update_itr(struct e1000_adapter *adapter,
|
||||||
u16 itr_setting,
|
u16 itr_setting, int packets, int bytes)
|
||||||
int packets,
|
|
||||||
int bytes)
|
|
||||||
{
|
{
|
||||||
unsigned int retval = itr_setting;
|
unsigned int retval = itr_setting;
|
||||||
struct e1000_hw *hw = &adapter->hw;
|
struct e1000_hw *hw = &adapter->hw;
|
||||||
|
@ -2926,9 +2883,8 @@ set_itr_now:
|
||||||
#define E1000_TX_FLAGS_VLAN_MASK 0xffff0000
|
#define E1000_TX_FLAGS_VLAN_MASK 0xffff0000
|
||||||
#define E1000_TX_FLAGS_VLAN_SHIFT 16
|
#define E1000_TX_FLAGS_VLAN_SHIFT 16
|
||||||
|
|
||||||
static int
|
static int e1000_tso(struct e1000_adapter *adapter,
|
||||||
e1000_tso(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring,
|
struct e1000_tx_ring *tx_ring, struct sk_buff *skb)
|
||||||
struct sk_buff *skb)
|
|
||||||
{
|
{
|
||||||
struct e1000_context_desc *context_desc;
|
struct e1000_context_desc *context_desc;
|
||||||
struct e1000_buffer *buffer_info;
|
struct e1000_buffer *buffer_info;
|
||||||
|
@ -2999,9 +2955,8 @@ e1000_tso(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring,
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool
|
static bool e1000_tx_csum(struct e1000_adapter *adapter,
|
||||||
e1000_tx_csum(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring,
|
struct e1000_tx_ring *tx_ring, struct sk_buff *skb)
|
||||||
struct sk_buff *skb)
|
|
||||||
{
|
{
|
||||||
struct e1000_context_desc *context_desc;
|
struct e1000_context_desc *context_desc;
|
||||||
struct e1000_buffer *buffer_info;
|
struct e1000_buffer *buffer_info;
|
||||||
|
@ -3038,10 +2993,11 @@ e1000_tx_csum(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring,
|
||||||
#define E1000_MAX_TXD_PWR 12
|
#define E1000_MAX_TXD_PWR 12
|
||||||
#define E1000_MAX_DATA_PER_TXD (1<<E1000_MAX_TXD_PWR)
|
#define E1000_MAX_DATA_PER_TXD (1<<E1000_MAX_TXD_PWR)
|
||||||
|
|
||||||
static int
|
static int e1000_tx_map(struct e1000_adapter *adapter,
|
||||||
e1000_tx_map(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring,
|
struct e1000_tx_ring *tx_ring,
|
||||||
struct sk_buff *skb, unsigned int first, unsigned int max_per_txd,
|
struct sk_buff *skb, unsigned int first,
|
||||||
unsigned int nr_frags, unsigned int mss)
|
unsigned int max_per_txd, unsigned int nr_frags,
|
||||||
|
unsigned int mss)
|
||||||
{
|
{
|
||||||
struct e1000_buffer *buffer_info;
|
struct e1000_buffer *buffer_info;
|
||||||
unsigned int len = skb->len;
|
unsigned int len = skb->len;
|
||||||
|
@ -3145,9 +3101,9 @@ e1000_tx_map(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring,
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void e1000_tx_queue(struct e1000_adapter *adapter,
|
||||||
e1000_tx_queue(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring,
|
struct e1000_tx_ring *tx_ring, int tx_flags,
|
||||||
int tx_flags, int count)
|
int count)
|
||||||
{
|
{
|
||||||
struct e1000_tx_desc *tx_desc = NULL;
|
struct e1000_tx_desc *tx_desc = NULL;
|
||||||
struct e1000_buffer *buffer_info;
|
struct e1000_buffer *buffer_info;
|
||||||
|
@ -3212,8 +3168,8 @@ e1000_tx_queue(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring,
|
||||||
#define E1000_FIFO_HDR 0x10
|
#define E1000_FIFO_HDR 0x10
|
||||||
#define E1000_82547_PAD_LEN 0x3E0
|
#define E1000_82547_PAD_LEN 0x3E0
|
||||||
|
|
||||||
static int
|
static int e1000_82547_fifo_workaround(struct e1000_adapter *adapter,
|
||||||
e1000_82547_fifo_workaround(struct e1000_adapter *adapter, struct sk_buff *skb)
|
struct sk_buff *skb)
|
||||||
{
|
{
|
||||||
u32 fifo_space = adapter->tx_fifo_size - adapter->tx_fifo_head;
|
u32 fifo_space = adapter->tx_fifo_size - adapter->tx_fifo_head;
|
||||||
u32 skb_fifo_len = skb->len + E1000_FIFO_HDR;
|
u32 skb_fifo_len = skb->len + E1000_FIFO_HDR;
|
||||||
|
@ -3239,8 +3195,8 @@ no_fifo_stall_required:
|
||||||
}
|
}
|
||||||
|
|
||||||
#define MINIMUM_DHCP_PACKET_SIZE 282
|
#define MINIMUM_DHCP_PACKET_SIZE 282
|
||||||
static int
|
static int e1000_transfer_dhcp_info(struct e1000_adapter *adapter,
|
||||||
e1000_transfer_dhcp_info(struct e1000_adapter *adapter, struct sk_buff *skb)
|
struct sk_buff *skb)
|
||||||
{
|
{
|
||||||
struct e1000_hw *hw = &adapter->hw;
|
struct e1000_hw *hw = &adapter->hw;
|
||||||
u16 length, offset;
|
u16 length, offset;
|
||||||
|
@ -3304,8 +3260,7 @@ static int e1000_maybe_stop_tx(struct net_device *netdev,
|
||||||
}
|
}
|
||||||
|
|
||||||
#define TXD_USE_COUNT(S, X) (((S) >> (X)) + 1 )
|
#define TXD_USE_COUNT(S, X) (((S) >> (X)) + 1 )
|
||||||
static int
|
static int e1000_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
|
||||||
e1000_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
|
|
||||||
{
|
{
|
||||||
struct e1000_adapter *adapter = netdev_priv(netdev);
|
struct e1000_adapter *adapter = netdev_priv(netdev);
|
||||||
struct e1000_tx_ring *tx_ring;
|
struct e1000_tx_ring *tx_ring;
|
||||||
|
@ -3482,8 +3437,7 @@ e1000_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
|
||||||
* @netdev: network interface device structure
|
* @netdev: network interface device structure
|
||||||
**/
|
**/
|
||||||
|
|
||||||
static void
|
static void e1000_tx_timeout(struct net_device *netdev)
|
||||||
e1000_tx_timeout(struct net_device *netdev)
|
|
||||||
{
|
{
|
||||||
struct e1000_adapter *adapter = netdev_priv(netdev);
|
struct e1000_adapter *adapter = netdev_priv(netdev);
|
||||||
|
|
||||||
|
@ -3492,8 +3446,7 @@ e1000_tx_timeout(struct net_device *netdev)
|
||||||
schedule_work(&adapter->reset_task);
|
schedule_work(&adapter->reset_task);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void e1000_reset_task(struct work_struct *work)
|
||||||
e1000_reset_task(struct work_struct *work)
|
|
||||||
{
|
{
|
||||||
struct e1000_adapter *adapter =
|
struct e1000_adapter *adapter =
|
||||||
container_of(work, struct e1000_adapter, reset_task);
|
container_of(work, struct e1000_adapter, reset_task);
|
||||||
|
@ -3509,8 +3462,7 @@ e1000_reset_task(struct work_struct *work)
|
||||||
* The statistics are actually updated from the timer callback.
|
* The statistics are actually updated from the timer callback.
|
||||||
**/
|
**/
|
||||||
|
|
||||||
static struct net_device_stats *
|
static struct net_device_stats *e1000_get_stats(struct net_device *netdev)
|
||||||
e1000_get_stats(struct net_device *netdev)
|
|
||||||
{
|
{
|
||||||
struct e1000_adapter *adapter = netdev_priv(netdev);
|
struct e1000_adapter *adapter = netdev_priv(netdev);
|
||||||
|
|
||||||
|
@ -3526,8 +3478,7 @@ e1000_get_stats(struct net_device *netdev)
|
||||||
* Returns 0 on success, negative on failure
|
* Returns 0 on success, negative on failure
|
||||||
**/
|
**/
|
||||||
|
|
||||||
static int
|
static int e1000_change_mtu(struct net_device *netdev, int new_mtu)
|
||||||
e1000_change_mtu(struct net_device *netdev, int new_mtu)
|
|
||||||
{
|
{
|
||||||
struct e1000_adapter *adapter = netdev_priv(netdev);
|
struct e1000_adapter *adapter = netdev_priv(netdev);
|
||||||
int max_frame = new_mtu + ENET_HEADER_SIZE + ETHERNET_FCS_SIZE;
|
int max_frame = new_mtu + ENET_HEADER_SIZE + ETHERNET_FCS_SIZE;
|
||||||
|
@ -3620,8 +3571,7 @@ e1000_change_mtu(struct net_device *netdev, int new_mtu)
|
||||||
* @adapter: board private structure
|
* @adapter: board private structure
|
||||||
**/
|
**/
|
||||||
|
|
||||||
void
|
void e1000_update_stats(struct e1000_adapter *adapter)
|
||||||
e1000_update_stats(struct e1000_adapter *adapter)
|
|
||||||
{
|
{
|
||||||
struct e1000_hw *hw = &adapter->hw;
|
struct e1000_hw *hw = &adapter->hw;
|
||||||
struct pci_dev *pdev = adapter->pdev;
|
struct pci_dev *pdev = adapter->pdev;
|
||||||
|
@ -3794,8 +3744,7 @@ e1000_update_stats(struct e1000_adapter *adapter)
|
||||||
* @data: pointer to a network interface device structure
|
* @data: pointer to a network interface device structure
|
||||||
**/
|
**/
|
||||||
|
|
||||||
static irqreturn_t
|
static irqreturn_t e1000_intr_msi(int irq, void *data)
|
||||||
e1000_intr_msi(int irq, void *data)
|
|
||||||
{
|
{
|
||||||
struct net_device *netdev = data;
|
struct net_device *netdev = data;
|
||||||
struct e1000_adapter *adapter = netdev_priv(netdev);
|
struct e1000_adapter *adapter = netdev_priv(netdev);
|
||||||
|
@ -3856,8 +3805,7 @@ e1000_intr_msi(int irq, void *data)
|
||||||
* @data: pointer to a network interface device structure
|
* @data: pointer to a network interface device structure
|
||||||
**/
|
**/
|
||||||
|
|
||||||
static irqreturn_t
|
static irqreturn_t e1000_intr(int irq, void *data)
|
||||||
e1000_intr(int irq, void *data)
|
|
||||||
{
|
{
|
||||||
struct net_device *netdev = data;
|
struct net_device *netdev = data;
|
||||||
struct e1000_adapter *adapter = netdev_priv(netdev);
|
struct e1000_adapter *adapter = netdev_priv(netdev);
|
||||||
|
@ -3954,8 +3902,7 @@ e1000_intr(int irq, void *data)
|
||||||
* @adapter: board private structure
|
* @adapter: board private structure
|
||||||
**/
|
**/
|
||||||
|
|
||||||
static int
|
static int e1000_clean(struct napi_struct *napi, int budget)
|
||||||
e1000_clean(struct napi_struct *napi, int budget)
|
|
||||||
{
|
{
|
||||||
struct e1000_adapter *adapter = container_of(napi, struct e1000_adapter, napi);
|
struct e1000_adapter *adapter = container_of(napi, struct e1000_adapter, napi);
|
||||||
struct net_device *poll_dev = adapter->netdev;
|
struct net_device *poll_dev = adapter->netdev;
|
||||||
|
@ -3997,9 +3944,8 @@ e1000_clean(struct napi_struct *napi, int budget)
|
||||||
* @adapter: board private structure
|
* @adapter: board private structure
|
||||||
**/
|
**/
|
||||||
|
|
||||||
static bool
|
static bool e1000_clean_tx_irq(struct e1000_adapter *adapter,
|
||||||
e1000_clean_tx_irq(struct e1000_adapter *adapter,
|
struct e1000_tx_ring *tx_ring)
|
||||||
struct e1000_tx_ring *tx_ring)
|
|
||||||
{
|
{
|
||||||
struct net_device *netdev = adapter->netdev;
|
struct net_device *netdev = adapter->netdev;
|
||||||
struct e1000_tx_desc *tx_desc, *eop_desc;
|
struct e1000_tx_desc *tx_desc, *eop_desc;
|
||||||
|
@ -4111,10 +4057,8 @@ e1000_clean_tx_irq(struct e1000_adapter *adapter,
|
||||||
* @sk_buff: socket buffer with received data
|
* @sk_buff: socket buffer with received data
|
||||||
**/
|
**/
|
||||||
|
|
||||||
static void
|
static void e1000_rx_checksum(struct e1000_adapter *adapter, u32 status_err,
|
||||||
e1000_rx_checksum(struct e1000_adapter *adapter,
|
u32 csum, struct sk_buff *skb)
|
||||||
u32 status_err, u32 csum,
|
|
||||||
struct sk_buff *skb)
|
|
||||||
{
|
{
|
||||||
u16 status = (u16)status_err;
|
u16 status = (u16)status_err;
|
||||||
u8 errors = (u8)(status_err >> 24);
|
u8 errors = (u8)(status_err >> 24);
|
||||||
|
@ -4158,15 +4102,13 @@ e1000_rx_checksum(struct e1000_adapter *adapter,
|
||||||
* e1000_clean_rx_irq - Send received data up the network stack; legacy
|
* e1000_clean_rx_irq - Send received data up the network stack; legacy
|
||||||
* @adapter: board private structure
|
* @adapter: board private structure
|
||||||
**/
|
**/
|
||||||
|
|
||||||
static bool
|
|
||||||
#ifdef CONFIG_E1000_NAPI
|
#ifdef CONFIG_E1000_NAPI
|
||||||
e1000_clean_rx_irq(struct e1000_adapter *adapter,
|
static bool e1000_clean_rx_irq(struct e1000_adapter *adapter,
|
||||||
struct e1000_rx_ring *rx_ring,
|
struct e1000_rx_ring *rx_ring,
|
||||||
int *work_done, int work_to_do)
|
int *work_done, int work_to_do)
|
||||||
#else
|
#else
|
||||||
e1000_clean_rx_irq(struct e1000_adapter *adapter,
|
static bool e1000_clean_rx_irq(struct e1000_adapter *adapter,
|
||||||
struct e1000_rx_ring *rx_ring)
|
struct e1000_rx_ring *rx_ring)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
struct net_device *netdev = adapter->netdev;
|
struct net_device *netdev = adapter->netdev;
|
||||||
|
@ -4330,14 +4272,13 @@ next_desc:
|
||||||
* @adapter: board private structure
|
* @adapter: board private structure
|
||||||
**/
|
**/
|
||||||
|
|
||||||
static bool
|
|
||||||
#ifdef CONFIG_E1000_NAPI
|
#ifdef CONFIG_E1000_NAPI
|
||||||
e1000_clean_rx_irq_ps(struct e1000_adapter *adapter,
|
static bool e1000_clean_rx_irq_ps(struct e1000_adapter *adapter,
|
||||||
struct e1000_rx_ring *rx_ring,
|
struct e1000_rx_ring *rx_ring,
|
||||||
int *work_done, int work_to_do)
|
int *work_done, int work_to_do)
|
||||||
#else
|
#else
|
||||||
e1000_clean_rx_irq_ps(struct e1000_adapter *adapter,
|
static bool e1000_clean_rx_irq_ps(struct e1000_adapter *adapter,
|
||||||
struct e1000_rx_ring *rx_ring)
|
struct e1000_rx_ring *rx_ring)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
union e1000_rx_desc_packet_split *rx_desc, *next_rxd;
|
union e1000_rx_desc_packet_split *rx_desc, *next_rxd;
|
||||||
|
@ -4517,10 +4458,9 @@ next_desc:
|
||||||
* @adapter: address of board private structure
|
* @adapter: address of board private structure
|
||||||
**/
|
**/
|
||||||
|
|
||||||
static void
|
static void e1000_alloc_rx_buffers(struct e1000_adapter *adapter,
|
||||||
e1000_alloc_rx_buffers(struct e1000_adapter *adapter,
|
struct e1000_rx_ring *rx_ring,
|
||||||
struct e1000_rx_ring *rx_ring,
|
int cleaned_count)
|
||||||
int cleaned_count)
|
|
||||||
{
|
{
|
||||||
struct net_device *netdev = adapter->netdev;
|
struct net_device *netdev = adapter->netdev;
|
||||||
struct pci_dev *pdev = adapter->pdev;
|
struct pci_dev *pdev = adapter->pdev;
|
||||||
|
@ -4628,10 +4568,9 @@ map_skb:
|
||||||
* @adapter: address of board private structure
|
* @adapter: address of board private structure
|
||||||
**/
|
**/
|
||||||
|
|
||||||
static void
|
static void e1000_alloc_rx_buffers_ps(struct e1000_adapter *adapter,
|
||||||
e1000_alloc_rx_buffers_ps(struct e1000_adapter *adapter,
|
struct e1000_rx_ring *rx_ring,
|
||||||
struct e1000_rx_ring *rx_ring,
|
int cleaned_count)
|
||||||
int cleaned_count)
|
|
||||||
{
|
{
|
||||||
struct net_device *netdev = adapter->netdev;
|
struct net_device *netdev = adapter->netdev;
|
||||||
struct pci_dev *pdev = adapter->pdev;
|
struct pci_dev *pdev = adapter->pdev;
|
||||||
|
@ -4726,8 +4665,7 @@ no_buffers:
|
||||||
* @adapter:
|
* @adapter:
|
||||||
**/
|
**/
|
||||||
|
|
||||||
static void
|
static void e1000_smartspeed(struct e1000_adapter *adapter)
|
||||||
e1000_smartspeed(struct e1000_adapter *adapter)
|
|
||||||
{
|
{
|
||||||
u16 phy_status;
|
u16 phy_status;
|
||||||
u16 phy_ctrl;
|
u16 phy_ctrl;
|
||||||
|
@ -4783,8 +4721,7 @@ e1000_smartspeed(struct e1000_adapter *adapter)
|
||||||
* @cmd:
|
* @cmd:
|
||||||
**/
|
**/
|
||||||
|
|
||||||
static int
|
static int e1000_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd)
|
||||||
e1000_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd)
|
|
||||||
{
|
{
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case SIOCGMIIPHY:
|
case SIOCGMIIPHY:
|
||||||
|
@ -4803,8 +4740,8 @@ e1000_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd)
|
||||||
* @cmd:
|
* @cmd:
|
||||||
**/
|
**/
|
||||||
|
|
||||||
static int
|
static int e1000_mii_ioctl(struct net_device *netdev, struct ifreq *ifr,
|
||||||
e1000_mii_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd)
|
int cmd)
|
||||||
{
|
{
|
||||||
struct e1000_adapter *adapter = netdev_priv(netdev);
|
struct e1000_adapter *adapter = netdev_priv(netdev);
|
||||||
struct mii_ioctl_data *data = if_mii(ifr);
|
struct mii_ioctl_data *data = if_mii(ifr);
|
||||||
|
@ -4897,8 +4834,7 @@ e1000_mii_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd)
|
||||||
return E1000_SUCCESS;
|
return E1000_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void e1000_pci_set_mwi(struct e1000_hw *hw)
|
||||||
e1000_pci_set_mwi(struct e1000_hw *hw)
|
|
||||||
{
|
{
|
||||||
struct e1000_adapter *adapter = hw->back;
|
struct e1000_adapter *adapter = hw->back;
|
||||||
int ret_val = pci_set_mwi(adapter->pdev);
|
int ret_val = pci_set_mwi(adapter->pdev);
|
||||||
|
@ -4907,30 +4843,26 @@ e1000_pci_set_mwi(struct e1000_hw *hw)
|
||||||
DPRINTK(PROBE, ERR, "Error in setting MWI\n");
|
DPRINTK(PROBE, ERR, "Error in setting MWI\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void e1000_pci_clear_mwi(struct e1000_hw *hw)
|
||||||
e1000_pci_clear_mwi(struct e1000_hw *hw)
|
|
||||||
{
|
{
|
||||||
struct e1000_adapter *adapter = hw->back;
|
struct e1000_adapter *adapter = hw->back;
|
||||||
|
|
||||||
pci_clear_mwi(adapter->pdev);
|
pci_clear_mwi(adapter->pdev);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int e1000_pcix_get_mmrbc(struct e1000_hw *hw)
|
||||||
e1000_pcix_get_mmrbc(struct e1000_hw *hw)
|
|
||||||
{
|
{
|
||||||
struct e1000_adapter *adapter = hw->back;
|
struct e1000_adapter *adapter = hw->back;
|
||||||
return pcix_get_mmrbc(adapter->pdev);
|
return pcix_get_mmrbc(adapter->pdev);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void e1000_pcix_set_mmrbc(struct e1000_hw *hw, int mmrbc)
|
||||||
e1000_pcix_set_mmrbc(struct e1000_hw *hw, int mmrbc)
|
|
||||||
{
|
{
|
||||||
struct e1000_adapter *adapter = hw->back;
|
struct e1000_adapter *adapter = hw->back;
|
||||||
pcix_set_mmrbc(adapter->pdev, mmrbc);
|
pcix_set_mmrbc(adapter->pdev, mmrbc);
|
||||||
}
|
}
|
||||||
|
|
||||||
s32
|
s32 e1000_read_pcie_cap_reg(struct e1000_hw *hw, u32 reg, u16 *value)
|
||||||
e1000_read_pcie_cap_reg(struct e1000_hw *hw, u32 reg, u16 *value)
|
|
||||||
{
|
{
|
||||||
struct e1000_adapter *adapter = hw->back;
|
struct e1000_adapter *adapter = hw->back;
|
||||||
u16 cap_offset;
|
u16 cap_offset;
|
||||||
|
@ -4944,14 +4876,13 @@ e1000_read_pcie_cap_reg(struct e1000_hw *hw, u32 reg, u16 *value)
|
||||||
return E1000_SUCCESS;
|
return E1000_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void e1000_io_write(struct e1000_hw *hw, unsigned long port, u32 value)
|
||||||
e1000_io_write(struct e1000_hw *hw, unsigned long port, u32 value)
|
|
||||||
{
|
{
|
||||||
outl(value, port);
|
outl(value, port);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void e1000_vlan_rx_register(struct net_device *netdev,
|
||||||
e1000_vlan_rx_register(struct net_device *netdev, struct vlan_group *grp)
|
struct vlan_group *grp)
|
||||||
{
|
{
|
||||||
struct e1000_adapter *adapter = netdev_priv(netdev);
|
struct e1000_adapter *adapter = netdev_priv(netdev);
|
||||||
u32 ctrl, rctl;
|
u32 ctrl, rctl;
|
||||||
|
@ -4993,8 +4924,7 @@ e1000_vlan_rx_register(struct net_device *netdev, struct vlan_group *grp)
|
||||||
e1000_irq_enable(adapter);
|
e1000_irq_enable(adapter);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void e1000_vlan_rx_add_vid(struct net_device *netdev, u16 vid)
|
||||||
e1000_vlan_rx_add_vid(struct net_device *netdev, u16 vid)
|
|
||||||
{
|
{
|
||||||
struct e1000_adapter *adapter = netdev_priv(netdev);
|
struct e1000_adapter *adapter = netdev_priv(netdev);
|
||||||
u32 vfta, index;
|
u32 vfta, index;
|
||||||
|
@ -5010,8 +4940,7 @@ e1000_vlan_rx_add_vid(struct net_device *netdev, u16 vid)
|
||||||
e1000_write_vfta(&adapter->hw, index, vfta);
|
e1000_write_vfta(&adapter->hw, index, vfta);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void e1000_vlan_rx_kill_vid(struct net_device *netdev, u16 vid)
|
||||||
e1000_vlan_rx_kill_vid(struct net_device *netdev, u16 vid)
|
|
||||||
{
|
{
|
||||||
struct e1000_adapter *adapter = netdev_priv(netdev);
|
struct e1000_adapter *adapter = netdev_priv(netdev);
|
||||||
u32 vfta, index;
|
u32 vfta, index;
|
||||||
|
@ -5037,8 +4966,7 @@ e1000_vlan_rx_kill_vid(struct net_device *netdev, u16 vid)
|
||||||
e1000_write_vfta(&adapter->hw, index, vfta);
|
e1000_write_vfta(&adapter->hw, index, vfta);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void e1000_restore_vlan(struct e1000_adapter *adapter)
|
||||||
e1000_restore_vlan(struct e1000_adapter *adapter)
|
|
||||||
{
|
{
|
||||||
e1000_vlan_rx_register(adapter->netdev, adapter->vlgrp);
|
e1000_vlan_rx_register(adapter->netdev, adapter->vlgrp);
|
||||||
|
|
||||||
|
@ -5052,8 +4980,7 @@ e1000_restore_vlan(struct e1000_adapter *adapter)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int e1000_set_spd_dplx(struct e1000_adapter *adapter, u16 spddplx)
|
||||||
e1000_set_spd_dplx(struct e1000_adapter *adapter, u16 spddplx)
|
|
||||||
{
|
{
|
||||||
adapter->hw.autoneg = 0;
|
adapter->hw.autoneg = 0;
|
||||||
|
|
||||||
|
@ -5089,8 +5016,7 @@ e1000_set_spd_dplx(struct e1000_adapter *adapter, u16 spddplx)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int e1000_suspend(struct pci_dev *pdev, pm_message_t state)
|
||||||
e1000_suspend(struct pci_dev *pdev, pm_message_t state)
|
|
||||||
{
|
{
|
||||||
struct net_device *netdev = pci_get_drvdata(pdev);
|
struct net_device *netdev = pci_get_drvdata(pdev);
|
||||||
struct e1000_adapter *adapter = netdev_priv(netdev);
|
struct e1000_adapter *adapter = netdev_priv(netdev);
|
||||||
|
@ -5187,8 +5113,7 @@ e1000_suspend(struct pci_dev *pdev, pm_message_t state)
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_PM
|
#ifdef CONFIG_PM
|
||||||
static int
|
static int e1000_resume(struct pci_dev *pdev)
|
||||||
e1000_resume(struct pci_dev *pdev)
|
|
||||||
{
|
{
|
||||||
struct net_device *netdev = pci_get_drvdata(pdev);
|
struct net_device *netdev = pci_get_drvdata(pdev);
|
||||||
struct e1000_adapter *adapter = netdev_priv(netdev);
|
struct e1000_adapter *adapter = netdev_priv(netdev);
|
||||||
|
@ -5242,8 +5167,7 @@ static void e1000_shutdown(struct pci_dev *pdev)
|
||||||
* without having to re-enable interrupts. It's not called while
|
* without having to re-enable interrupts. It's not called while
|
||||||
* the interrupt routine is executing.
|
* the interrupt routine is executing.
|
||||||
*/
|
*/
|
||||||
static void
|
static void e1000_netpoll(struct net_device *netdev)
|
||||||
e1000_netpoll(struct net_device *netdev)
|
|
||||||
{
|
{
|
||||||
struct e1000_adapter *adapter = netdev_priv(netdev);
|
struct e1000_adapter *adapter = netdev_priv(netdev);
|
||||||
|
|
||||||
|
@ -5264,7 +5188,8 @@ e1000_netpoll(struct net_device *netdev)
|
||||||
* This function is called after a PCI bus error affecting
|
* This function is called after a PCI bus error affecting
|
||||||
* this device has been detected.
|
* this device has been detected.
|
||||||
*/
|
*/
|
||||||
static pci_ers_result_t e1000_io_error_detected(struct pci_dev *pdev, pci_channel_state_t state)
|
static pci_ers_result_t e1000_io_error_detected(struct pci_dev *pdev,
|
||||||
|
pci_channel_state_t state)
|
||||||
{
|
{
|
||||||
struct net_device *netdev = pci_get_drvdata(pdev);
|
struct net_device *netdev = pci_get_drvdata(pdev);
|
||||||
struct e1000_adapter *adapter = netdev->priv;
|
struct e1000_adapter *adapter = netdev->priv;
|
||||||
|
|
|
@ -213,10 +213,9 @@ struct e1000_option {
|
||||||
} arg;
|
} arg;
|
||||||
};
|
};
|
||||||
|
|
||||||
static int __devinit
|
static int __devinit e1000_validate_option(unsigned int *value,
|
||||||
e1000_validate_option(unsigned int *value,
|
const struct e1000_option *opt,
|
||||||
const struct e1000_option *opt,
|
struct e1000_adapter *adapter)
|
||||||
struct e1000_adapter *adapter)
|
|
||||||
{
|
{
|
||||||
if (*value == OPTION_UNSET) {
|
if (*value == OPTION_UNSET) {
|
||||||
*value = opt->def;
|
*value = opt->def;
|
||||||
|
@ -278,8 +277,7 @@ static void e1000_check_copper_options(struct e1000_adapter *adapter);
|
||||||
* in a variable in the adapter structure.
|
* in a variable in the adapter structure.
|
||||||
**/
|
**/
|
||||||
|
|
||||||
void __devinit
|
void __devinit e1000_check_options(struct e1000_adapter *adapter)
|
||||||
e1000_check_options(struct e1000_adapter *adapter)
|
|
||||||
{
|
{
|
||||||
int bd = adapter->bd_number;
|
int bd = adapter->bd_number;
|
||||||
if (bd >= E1000_MAX_NIC) {
|
if (bd >= E1000_MAX_NIC) {
|
||||||
|
@ -551,8 +549,7 @@ e1000_check_options(struct e1000_adapter *adapter)
|
||||||
* Handles speed and duplex options on fiber adapters
|
* Handles speed and duplex options on fiber adapters
|
||||||
**/
|
**/
|
||||||
|
|
||||||
static void __devinit
|
static void __devinit e1000_check_fiber_options(struct e1000_adapter *adapter)
|
||||||
e1000_check_fiber_options(struct e1000_adapter *adapter)
|
|
||||||
{
|
{
|
||||||
int bd = adapter->bd_number;
|
int bd = adapter->bd_number;
|
||||||
if (num_Speed > bd) {
|
if (num_Speed > bd) {
|
||||||
|
@ -579,8 +576,7 @@ e1000_check_fiber_options(struct e1000_adapter *adapter)
|
||||||
* Handles speed and duplex options on copper adapters
|
* Handles speed and duplex options on copper adapters
|
||||||
**/
|
**/
|
||||||
|
|
||||||
static void __devinit
|
static void __devinit e1000_check_copper_options(struct e1000_adapter *adapter)
|
||||||
e1000_check_copper_options(struct e1000_adapter *adapter)
|
|
||||||
{
|
{
|
||||||
unsigned int speed, dplx, an;
|
unsigned int speed, dplx, an;
|
||||||
int bd = adapter->bd_number;
|
int bd = adapter->bd_number;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче