You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
Merge branch 'upstream-net26' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6
This commit is contained in:
@@ -966,8 +966,8 @@ static int __devinit rtl8139_init_one (struct pci_dev *pdev,
|
|||||||
|
|
||||||
addr_len = read_eeprom (ioaddr, 0, 8) == 0x8129 ? 8 : 6;
|
addr_len = read_eeprom (ioaddr, 0, 8) == 0x8129 ? 8 : 6;
|
||||||
for (i = 0; i < 3; i++)
|
for (i = 0; i < 3; i++)
|
||||||
((u16 *) (dev->dev_addr))[i] =
|
((__le16 *) (dev->dev_addr))[i] =
|
||||||
le16_to_cpu (read_eeprom (ioaddr, i + 7, addr_len));
|
cpu_to_le16(read_eeprom (ioaddr, i + 7, addr_len));
|
||||||
memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len);
|
memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len);
|
||||||
|
|
||||||
/* The Rtl8139-specific entries in the device structure. */
|
/* The Rtl8139-specific entries in the device structure. */
|
||||||
@@ -1373,8 +1373,8 @@ static void rtl8139_hw_start (struct net_device *dev)
|
|||||||
/* unlock Config[01234] and BMCR register writes */
|
/* unlock Config[01234] and BMCR register writes */
|
||||||
RTL_W8_F (Cfg9346, Cfg9346_Unlock);
|
RTL_W8_F (Cfg9346, Cfg9346_Unlock);
|
||||||
/* Restore our idea of the MAC address. */
|
/* Restore our idea of the MAC address. */
|
||||||
RTL_W32_F (MAC0 + 0, cpu_to_le32 (*(u32 *) (dev->dev_addr + 0)));
|
RTL_W32_F (MAC0 + 0, le32_to_cpu (*(__le32 *) (dev->dev_addr + 0)));
|
||||||
RTL_W32_F (MAC0 + 4, cpu_to_le32 (*(u32 *) (dev->dev_addr + 4)));
|
RTL_W32_F (MAC0 + 4, le16_to_cpu (*(__le16 *) (dev->dev_addr + 4)));
|
||||||
|
|
||||||
/* Must enable Tx/Rx before setting transfer thresholds! */
|
/* Must enable Tx/Rx before setting transfer thresholds! */
|
||||||
RTL_W8 (ChipCmd, CmdRxEnb | CmdTxEnb);
|
RTL_W8 (ChipCmd, CmdRxEnb | CmdTxEnb);
|
||||||
@@ -1945,7 +1945,7 @@ static int rtl8139_rx(struct net_device *dev, struct rtl8139_private *tp,
|
|||||||
rmb();
|
rmb();
|
||||||
|
|
||||||
/* read size+status of next frame from DMA ring buffer */
|
/* read size+status of next frame from DMA ring buffer */
|
||||||
rx_status = le32_to_cpu (*(u32 *) (rx_ring + ring_offset));
|
rx_status = le32_to_cpu (*(__le32 *) (rx_ring + ring_offset));
|
||||||
rx_size = rx_status >> 16;
|
rx_size = rx_status >> 16;
|
||||||
pkt_size = rx_size - 4;
|
pkt_size = rx_size - 4;
|
||||||
|
|
||||||
|
|||||||
@@ -467,6 +467,13 @@ config SNI_82596
|
|||||||
Say Y here to support the on-board Intel 82596 ethernet controller
|
Say Y here to support the on-board Intel 82596 ethernet controller
|
||||||
built into SNI RM machines.
|
built into SNI RM machines.
|
||||||
|
|
||||||
|
config KORINA
|
||||||
|
tristate "Korina (IDT RC32434) Ethernet support"
|
||||||
|
depends on NET_ETHERNET && MIKROTIK_RB500
|
||||||
|
help
|
||||||
|
If you have a Mikrotik RouterBoard 500 or IDT RC32434
|
||||||
|
based system say Y. Otherwise say N.
|
||||||
|
|
||||||
config MIPS_JAZZ_SONIC
|
config MIPS_JAZZ_SONIC
|
||||||
tristate "MIPS JAZZ onboard SONIC Ethernet support"
|
tristate "MIPS JAZZ onboard SONIC Ethernet support"
|
||||||
depends on MACH_JAZZ
|
depends on MACH_JAZZ
|
||||||
|
|||||||
@@ -190,6 +190,7 @@ obj-$(CONFIG_ZORRO8390) += zorro8390.o
|
|||||||
obj-$(CONFIG_HPLANCE) += hplance.o 7990.o
|
obj-$(CONFIG_HPLANCE) += hplance.o 7990.o
|
||||||
obj-$(CONFIG_MVME147_NET) += mvme147.o 7990.o
|
obj-$(CONFIG_MVME147_NET) += mvme147.o 7990.o
|
||||||
obj-$(CONFIG_EQUALIZER) += eql.o
|
obj-$(CONFIG_EQUALIZER) += eql.o
|
||||||
|
obj-$(CONFIG_KORINA) += korina.o
|
||||||
obj-$(CONFIG_MIPS_JAZZ_SONIC) += jazzsonic.o
|
obj-$(CONFIG_MIPS_JAZZ_SONIC) += jazzsonic.o
|
||||||
obj-$(CONFIG_MIPS_AU1X00_ENET) += au1000_eth.o
|
obj-$(CONFIG_MIPS_AU1X00_ENET) += au1000_eth.o
|
||||||
obj-$(CONFIG_MIPS_SIM_NET) += mipsnet.o
|
obj-$(CONFIG_MIPS_SIM_NET) += mipsnet.o
|
||||||
|
|||||||
+2
-2
@@ -378,8 +378,8 @@ static void __init get_node_ID(struct net_device *dev)
|
|||||||
sa_offset = 15;
|
sa_offset = 15;
|
||||||
|
|
||||||
for (i = 0; i < 3; i++)
|
for (i = 0; i < 3; i++)
|
||||||
((u16 *)dev->dev_addr)[i] =
|
((__be16 *)dev->dev_addr)[i] =
|
||||||
be16_to_cpu(eeprom_op(ioaddr, EE_READ(sa_offset + i)));
|
cpu_to_be16(eeprom_op(ioaddr, EE_READ(sa_offset + i)));
|
||||||
|
|
||||||
write_reg(ioaddr, CMR2, CMR2_NULL);
|
write_reg(ioaddr, CMR2, CMR2_NULL);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -833,10 +833,26 @@ static int do_trace(struct t3cdev *dev, struct sk_buff *skb)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* That skb would better have come from process_responses() where we abuse
|
||||||
|
* ->priority and ->csum to carry our data. NB: if we get to per-arch
|
||||||
|
* ->csum, the things might get really interesting here.
|
||||||
|
*/
|
||||||
|
|
||||||
|
static inline u32 get_hwtid(struct sk_buff *skb)
|
||||||
|
{
|
||||||
|
return ntohl((__force __be32)skb->priority) >> 8 & 0xfffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline u32 get_opcode(struct sk_buff *skb)
|
||||||
|
{
|
||||||
|
return G_OPCODE(ntohl((__force __be32)skb->csum));
|
||||||
|
}
|
||||||
|
|
||||||
static int do_term(struct t3cdev *dev, struct sk_buff *skb)
|
static int do_term(struct t3cdev *dev, struct sk_buff *skb)
|
||||||
{
|
{
|
||||||
unsigned int hwtid = ntohl(skb->priority) >> 8 & 0xfffff;
|
unsigned int hwtid = get_hwtid(skb);
|
||||||
unsigned int opcode = G_OPCODE(ntohl(skb->csum));
|
unsigned int opcode = get_opcode(skb);
|
||||||
struct t3c_tid_entry *t3c_tid;
|
struct t3c_tid_entry *t3c_tid;
|
||||||
|
|
||||||
t3c_tid = lookup_tid(&(T3C_DATA(dev))->tid_maps, hwtid);
|
t3c_tid = lookup_tid(&(T3C_DATA(dev))->tid_maps, hwtid);
|
||||||
@@ -914,7 +930,7 @@ int process_rx(struct t3cdev *dev, struct sk_buff **skbs, int n)
|
|||||||
{
|
{
|
||||||
while (n--) {
|
while (n--) {
|
||||||
struct sk_buff *skb = *skbs++;
|
struct sk_buff *skb = *skbs++;
|
||||||
unsigned int opcode = G_OPCODE(ntohl(skb->csum));
|
unsigned int opcode = get_opcode(skb);
|
||||||
int ret = cpl_handlers[opcode] (dev, skb);
|
int ret = cpl_handlers[opcode] (dev, skb);
|
||||||
|
|
||||||
#if VALIDATE_TID
|
#if VALIDATE_TID
|
||||||
|
|||||||
+2
-1
@@ -971,7 +971,8 @@ static int __devinit dfx_driver_init(struct net_device *dev,
|
|||||||
int alloc_size; /* total buffer size needed */
|
int alloc_size; /* total buffer size needed */
|
||||||
char *top_v, *curr_v; /* virtual addrs into memory block */
|
char *top_v, *curr_v; /* virtual addrs into memory block */
|
||||||
dma_addr_t top_p, curr_p; /* physical addrs into memory block */
|
dma_addr_t top_p, curr_p; /* physical addrs into memory block */
|
||||||
u32 data, le32; /* host data register value */
|
u32 data; /* host data register value */
|
||||||
|
__le32 le32;
|
||||||
char *board_name = NULL;
|
char *board_name = NULL;
|
||||||
|
|
||||||
DBG_printk("In dfx_driver_init...\n");
|
DBG_printk("In dfx_driver_init...\n");
|
||||||
|
|||||||
+13
-14
@@ -188,7 +188,7 @@ struct e1000_tx_ring {
|
|||||||
spinlock_t tx_lock;
|
spinlock_t tx_lock;
|
||||||
uint16_t tdh;
|
uint16_t tdh;
|
||||||
uint16_t tdt;
|
uint16_t tdt;
|
||||||
boolean_t last_tx_tso;
|
bool last_tx_tso;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct e1000_rx_ring {
|
struct e1000_rx_ring {
|
||||||
@@ -249,7 +249,6 @@ struct e1000_adapter {
|
|||||||
#ifdef CONFIG_E1000_NAPI
|
#ifdef CONFIG_E1000_NAPI
|
||||||
spinlock_t tx_queue_lock;
|
spinlock_t tx_queue_lock;
|
||||||
#endif
|
#endif
|
||||||
atomic_t irq_sem;
|
|
||||||
unsigned int total_tx_bytes;
|
unsigned int total_tx_bytes;
|
||||||
unsigned int total_tx_packets;
|
unsigned int total_tx_packets;
|
||||||
unsigned int total_rx_bytes;
|
unsigned int total_rx_bytes;
|
||||||
@@ -283,17 +282,17 @@ struct e1000_adapter {
|
|||||||
uint32_t tx_fifo_size;
|
uint32_t tx_fifo_size;
|
||||||
uint8_t tx_timeout_factor;
|
uint8_t tx_timeout_factor;
|
||||||
atomic_t tx_fifo_stall;
|
atomic_t tx_fifo_stall;
|
||||||
boolean_t pcix_82544;
|
bool pcix_82544;
|
||||||
boolean_t detect_tx_hung;
|
bool detect_tx_hung;
|
||||||
|
|
||||||
/* RX */
|
/* RX */
|
||||||
#ifdef CONFIG_E1000_NAPI
|
#ifdef CONFIG_E1000_NAPI
|
||||||
boolean_t (*clean_rx) (struct e1000_adapter *adapter,
|
bool (*clean_rx) (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
|
||||||
boolean_t (*clean_rx) (struct e1000_adapter *adapter,
|
bool (*clean_rx) (struct e1000_adapter *adapter,
|
||||||
struct e1000_rx_ring *rx_ring);
|
struct e1000_rx_ring *rx_ring);
|
||||||
#endif
|
#endif
|
||||||
void (*alloc_rx_buf) (struct e1000_adapter *adapter,
|
void (*alloc_rx_buf) (struct e1000_adapter *adapter,
|
||||||
struct e1000_rx_ring *rx_ring,
|
struct e1000_rx_ring *rx_ring,
|
||||||
@@ -312,7 +311,7 @@ struct e1000_adapter {
|
|||||||
uint32_t alloc_rx_buff_failed;
|
uint32_t alloc_rx_buff_failed;
|
||||||
uint32_t rx_int_delay;
|
uint32_t rx_int_delay;
|
||||||
uint32_t rx_abs_int_delay;
|
uint32_t rx_abs_int_delay;
|
||||||
boolean_t rx_csum;
|
bool rx_csum;
|
||||||
unsigned int rx_ps_pages;
|
unsigned int rx_ps_pages;
|
||||||
uint32_t gorcl;
|
uint32_t gorcl;
|
||||||
uint64_t gorcl_old;
|
uint64_t gorcl_old;
|
||||||
@@ -335,12 +334,12 @@ struct e1000_adapter {
|
|||||||
struct e1000_rx_ring test_rx_ring;
|
struct e1000_rx_ring test_rx_ring;
|
||||||
|
|
||||||
int msg_enable;
|
int msg_enable;
|
||||||
boolean_t have_msi;
|
bool have_msi;
|
||||||
|
|
||||||
/* to not mess up cache alignment, always add to the bottom */
|
/* to not mess up cache alignment, always add to the bottom */
|
||||||
boolean_t tso_force;
|
bool tso_force;
|
||||||
boolean_t smart_power_down; /* phy smart power down */
|
bool smart_power_down; /* phy smart power down */
|
||||||
boolean_t quad_port_a;
|
bool quad_port_a;
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
uint32_t eeprom_wol;
|
uint32_t eeprom_wol;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -353,7 +353,7 @@ e1000_set_tso(struct net_device *netdev, uint32_t data)
|
|||||||
netdev->features &= ~NETIF_F_TSO6;
|
netdev->features &= ~NETIF_F_TSO6;
|
||||||
|
|
||||||
DPRINTK(PROBE, INFO, "TSO is %s\n", data ? "Enabled" : "Disabled");
|
DPRINTK(PROBE, INFO, "TSO is %s\n", data ? "Enabled" : "Disabled");
|
||||||
adapter->tso_force = TRUE;
|
adapter->tso_force = true;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -922,7 +922,8 @@ static int
|
|||||||
e1000_intr_test(struct e1000_adapter *adapter, uint64_t *data)
|
e1000_intr_test(struct e1000_adapter *adapter, uint64_t *data)
|
||||||
{
|
{
|
||||||
struct net_device *netdev = adapter->netdev;
|
struct net_device *netdev = adapter->netdev;
|
||||||
uint32_t mask, i=0, shared_int = TRUE;
|
uint32_t mask, i = 0;
|
||||||
|
bool shared_int = true;
|
||||||
uint32_t irq = adapter->pdev->irq;
|
uint32_t irq = adapter->pdev->irq;
|
||||||
|
|
||||||
*data = 0;
|
*data = 0;
|
||||||
@@ -931,7 +932,7 @@ e1000_intr_test(struct e1000_adapter *adapter, uint64_t *data)
|
|||||||
/* Hook up test interrupt handler just for this test */
|
/* Hook up test interrupt handler just for this test */
|
||||||
if (!request_irq(irq, &e1000_test_intr, IRQF_PROBE_SHARED, netdev->name,
|
if (!request_irq(irq, &e1000_test_intr, IRQF_PROBE_SHARED, netdev->name,
|
||||||
netdev))
|
netdev))
|
||||||
shared_int = FALSE;
|
shared_int = false;
|
||||||
else if (request_irq(irq, &e1000_test_intr, IRQF_SHARED,
|
else if (request_irq(irq, &e1000_test_intr, IRQF_SHARED,
|
||||||
netdev->name, netdev)) {
|
netdev->name, netdev)) {
|
||||||
*data = 1;
|
*data = 1;
|
||||||
@@ -1295,7 +1296,7 @@ e1000_integrated_phy_loopback(struct e1000_adapter *adapter)
|
|||||||
uint32_t ctrl_reg = 0;
|
uint32_t ctrl_reg = 0;
|
||||||
uint32_t stat_reg = 0;
|
uint32_t stat_reg = 0;
|
||||||
|
|
||||||
adapter->hw.autoneg = FALSE;
|
adapter->hw.autoneg = false;
|
||||||
|
|
||||||
if (adapter->hw.phy_type == e1000_phy_m88) {
|
if (adapter->hw.phy_type == e1000_phy_m88) {
|
||||||
/* Auto-MDI/MDIX Off */
|
/* Auto-MDI/MDIX Off */
|
||||||
@@ -1473,7 +1474,7 @@ e1000_loopback_cleanup(struct e1000_adapter *adapter)
|
|||||||
case e1000_82545_rev_3:
|
case e1000_82545_rev_3:
|
||||||
case e1000_82546_rev_3:
|
case e1000_82546_rev_3:
|
||||||
default:
|
default:
|
||||||
hw->autoneg = TRUE;
|
hw->autoneg = true;
|
||||||
if (hw->phy_type == e1000_phy_gg82563)
|
if (hw->phy_type == e1000_phy_gg82563)
|
||||||
e1000_write_phy_reg(hw,
|
e1000_write_phy_reg(hw,
|
||||||
GG82563_PHY_KMRN_MODE_CTRL,
|
GG82563_PHY_KMRN_MODE_CTRL,
|
||||||
@@ -1607,13 +1608,13 @@ e1000_link_test(struct e1000_adapter *adapter, uint64_t *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) {
|
||||||
int i = 0;
|
int i = 0;
|
||||||
adapter->hw.serdes_link_down = TRUE;
|
adapter->hw.serdes_link_down = true;
|
||||||
|
|
||||||
/* On some blade server designs, link establishment
|
/* On some blade server designs, link establishment
|
||||||
* could take as long as 2-3 minutes */
|
* could take as long as 2-3 minutes */
|
||||||
do {
|
do {
|
||||||
e1000_check_for_link(&adapter->hw);
|
e1000_check_for_link(&adapter->hw);
|
||||||
if (adapter->hw.serdes_link_down == FALSE)
|
if (!adapter->hw.serdes_link_down)
|
||||||
return *data;
|
return *data;
|
||||||
msleep(20);
|
msleep(20);
|
||||||
} while (i++ < 3750);
|
} while (i++ < 3750);
|
||||||
@@ -1649,7 +1650,7 @@ e1000_diag_test(struct net_device *netdev,
|
|||||||
struct ethtool_test *eth_test, uint64_t *data)
|
struct ethtool_test *eth_test, uint64_t *data)
|
||||||
{
|
{
|
||||||
struct e1000_adapter *adapter = netdev_priv(netdev);
|
struct e1000_adapter *adapter = netdev_priv(netdev);
|
||||||
boolean_t if_running = netif_running(netdev);
|
bool if_running = netif_running(netdev);
|
||||||
|
|
||||||
set_bit(__E1000_TESTING, &adapter->flags);
|
set_bit(__E1000_TESTING, &adapter->flags);
|
||||||
if (eth_test->flags == ETH_TEST_FL_OFFLINE) {
|
if (eth_test->flags == ETH_TEST_FL_OFFLINE) {
|
||||||
|
|||||||
+111
-112
File diff suppressed because it is too large
Load Diff
@@ -100,8 +100,8 @@ typedef enum {
|
|||||||
} e1000_fc_type;
|
} e1000_fc_type;
|
||||||
|
|
||||||
struct e1000_shadow_ram {
|
struct e1000_shadow_ram {
|
||||||
uint16_t eeprom_word;
|
uint16_t eeprom_word;
|
||||||
boolean_t modified;
|
bool modified;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* PCI bus types */
|
/* PCI bus types */
|
||||||
@@ -274,8 +274,8 @@ struct e1000_eeprom_info {
|
|||||||
uint16_t address_bits;
|
uint16_t address_bits;
|
||||||
uint16_t delay_usec;
|
uint16_t delay_usec;
|
||||||
uint16_t page_size;
|
uint16_t page_size;
|
||||||
boolean_t use_eerd;
|
bool use_eerd;
|
||||||
boolean_t use_eewr;
|
bool use_eewr;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Flex ASF Information */
|
/* Flex ASF Information */
|
||||||
@@ -391,8 +391,8 @@ struct e1000_host_mng_dhcp_cookie{
|
|||||||
|
|
||||||
int32_t e1000_mng_write_dhcp_info(struct e1000_hw *hw, uint8_t *buffer,
|
int32_t e1000_mng_write_dhcp_info(struct e1000_hw *hw, uint8_t *buffer,
|
||||||
uint16_t length);
|
uint16_t length);
|
||||||
boolean_t e1000_check_mng_mode(struct e1000_hw *hw);
|
bool e1000_check_mng_mode(struct e1000_hw *hw);
|
||||||
boolean_t e1000_enable_tx_pkt_filtering(struct e1000_hw *hw);
|
bool e1000_enable_tx_pkt_filtering(struct e1000_hw *hw);
|
||||||
int32_t e1000_read_eeprom(struct e1000_hw *hw, uint16_t reg, uint16_t words, uint16_t *data);
|
int32_t e1000_read_eeprom(struct e1000_hw *hw, uint16_t reg, uint16_t words, uint16_t *data);
|
||||||
int32_t e1000_validate_eeprom_checksum(struct e1000_hw *hw);
|
int32_t e1000_validate_eeprom_checksum(struct e1000_hw *hw);
|
||||||
int32_t e1000_update_eeprom_checksum(struct e1000_hw *hw);
|
int32_t e1000_update_eeprom_checksum(struct e1000_hw *hw);
|
||||||
@@ -1420,7 +1420,7 @@ struct e1000_hw {
|
|||||||
uint32_t ledctl_default;
|
uint32_t ledctl_default;
|
||||||
uint32_t ledctl_mode1;
|
uint32_t ledctl_mode1;
|
||||||
uint32_t ledctl_mode2;
|
uint32_t ledctl_mode2;
|
||||||
boolean_t tx_pkt_filtering;
|
bool tx_pkt_filtering;
|
||||||
struct e1000_host_mng_dhcp_cookie mng_cookie;
|
struct e1000_host_mng_dhcp_cookie mng_cookie;
|
||||||
uint16_t phy_spd_default;
|
uint16_t phy_spd_default;
|
||||||
uint16_t autoneg_advertised;
|
uint16_t autoneg_advertised;
|
||||||
@@ -1445,30 +1445,30 @@ struct e1000_hw {
|
|||||||
uint8_t dma_fairness;
|
uint8_t dma_fairness;
|
||||||
uint8_t mac_addr[NODE_ADDRESS_SIZE];
|
uint8_t mac_addr[NODE_ADDRESS_SIZE];
|
||||||
uint8_t perm_mac_addr[NODE_ADDRESS_SIZE];
|
uint8_t perm_mac_addr[NODE_ADDRESS_SIZE];
|
||||||
boolean_t disable_polarity_correction;
|
bool disable_polarity_correction;
|
||||||
boolean_t speed_downgraded;
|
bool speed_downgraded;
|
||||||
e1000_smart_speed smart_speed;
|
e1000_smart_speed smart_speed;
|
||||||
e1000_dsp_config dsp_config_state;
|
e1000_dsp_config dsp_config_state;
|
||||||
boolean_t get_link_status;
|
bool get_link_status;
|
||||||
boolean_t serdes_link_down;
|
bool serdes_link_down;
|
||||||
boolean_t tbi_compatibility_en;
|
bool tbi_compatibility_en;
|
||||||
boolean_t tbi_compatibility_on;
|
bool tbi_compatibility_on;
|
||||||
boolean_t laa_is_present;
|
bool laa_is_present;
|
||||||
boolean_t phy_reset_disable;
|
bool phy_reset_disable;
|
||||||
boolean_t initialize_hw_bits_disable;
|
bool initialize_hw_bits_disable;
|
||||||
boolean_t fc_send_xon;
|
bool fc_send_xon;
|
||||||
boolean_t fc_strict_ieee;
|
bool fc_strict_ieee;
|
||||||
boolean_t report_tx_early;
|
bool report_tx_early;
|
||||||
boolean_t adaptive_ifs;
|
bool adaptive_ifs;
|
||||||
boolean_t ifs_params_forced;
|
bool ifs_params_forced;
|
||||||
boolean_t in_ifs_mode;
|
bool in_ifs_mode;
|
||||||
boolean_t mng_reg_access_disabled;
|
bool mng_reg_access_disabled;
|
||||||
boolean_t leave_av_bit_off;
|
bool leave_av_bit_off;
|
||||||
boolean_t kmrn_lock_loss_workaround_disabled;
|
bool kmrn_lock_loss_workaround_disabled;
|
||||||
boolean_t bad_tx_carr_stats_fd;
|
bool bad_tx_carr_stats_fd;
|
||||||
boolean_t has_manc2h;
|
bool has_manc2h;
|
||||||
boolean_t rx_needs_kicking;
|
bool rx_needs_kicking;
|
||||||
boolean_t has_smbus;
|
bool has_smbus;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -2518,11 +2518,11 @@ struct e1000_host_command_info {
|
|||||||
* Typical use:
|
* Typical use:
|
||||||
* ...
|
* ...
|
||||||
* if (TBI_ACCEPT) {
|
* if (TBI_ACCEPT) {
|
||||||
* accept_frame = TRUE;
|
* accept_frame = true;
|
||||||
* e1000_tbi_adjust_stats(adapter, MacAddress);
|
* e1000_tbi_adjust_stats(adapter, MacAddress);
|
||||||
* frame_length--;
|
* frame_length--;
|
||||||
* } else {
|
* } else {
|
||||||
* accept_frame = FALSE;
|
* accept_frame = false;
|
||||||
* }
|
* }
|
||||||
* ...
|
* ...
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -169,21 +169,21 @@ static int e1000_change_mtu(struct net_device *netdev, int new_mtu);
|
|||||||
static int e1000_set_mac(struct net_device *netdev, void *p);
|
static int e1000_set_mac(struct net_device *netdev, void *p);
|
||||||
static irqreturn_t e1000_intr(int irq, void *data);
|
static irqreturn_t e1000_intr(int irq, void *data);
|
||||||
static irqreturn_t e1000_intr_msi(int irq, void *data);
|
static irqreturn_t e1000_intr_msi(int irq, void *data);
|
||||||
static boolean_t e1000_clean_tx_irq(struct e1000_adapter *adapter,
|
static bool e1000_clean_tx_irq(struct e1000_adapter *adapter,
|
||||||
struct e1000_tx_ring *tx_ring);
|
struct e1000_tx_ring *tx_ring);
|
||||||
#ifdef CONFIG_E1000_NAPI
|
#ifdef CONFIG_E1000_NAPI
|
||||||
static int e1000_clean(struct napi_struct *napi, int budget);
|
static int e1000_clean(struct napi_struct *napi, int budget);
|
||||||
static boolean_t 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);
|
||||||
static boolean_t 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
|
||||||
static boolean_t 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);
|
||||||
static boolean_t 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
|
||||||
static void e1000_alloc_rx_buffers(struct e1000_adapter *adapter,
|
static void e1000_alloc_rx_buffers(struct e1000_adapter *adapter,
|
||||||
struct e1000_rx_ring *rx_ring,
|
struct e1000_rx_ring *rx_ring,
|
||||||
@@ -347,7 +347,6 @@ static void e1000_free_irq(struct e1000_adapter *adapter)
|
|||||||
static void
|
static void
|
||||||
e1000_irq_disable(struct e1000_adapter *adapter)
|
e1000_irq_disable(struct e1000_adapter *adapter)
|
||||||
{
|
{
|
||||||
atomic_inc(&adapter->irq_sem);
|
|
||||||
E1000_WRITE_REG(&adapter->hw, IMC, ~0);
|
E1000_WRITE_REG(&adapter->hw, IMC, ~0);
|
||||||
E1000_WRITE_FLUSH(&adapter->hw);
|
E1000_WRITE_FLUSH(&adapter->hw);
|
||||||
synchronize_irq(adapter->pdev->irq);
|
synchronize_irq(adapter->pdev->irq);
|
||||||
@@ -361,10 +360,8 @@ e1000_irq_disable(struct e1000_adapter *adapter)
|
|||||||
static void
|
static void
|
||||||
e1000_irq_enable(struct e1000_adapter *adapter)
|
e1000_irq_enable(struct e1000_adapter *adapter)
|
||||||
{
|
{
|
||||||
if (likely(atomic_dec_and_test(&adapter->irq_sem))) {
|
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
|
||||||
@@ -584,7 +581,7 @@ void e1000_power_up_phy(struct e1000_adapter *adapter)
|
|||||||
static void e1000_power_down_phy(struct e1000_adapter *adapter)
|
static void e1000_power_down_phy(struct e1000_adapter *adapter)
|
||||||
{
|
{
|
||||||
/* Power down the PHY so no link is implied when interface is down *
|
/* Power down the PHY so no link is implied when interface is down *
|
||||||
* The PHY cannot be powered down if any of the following is TRUE *
|
* The PHY cannot be powered down if any of the following is true *
|
||||||
* (a) WoL is enabled
|
* (a) WoL is enabled
|
||||||
* (b) AMT is active
|
* (b) AMT is active
|
||||||
* (c) SoL/IDER session is active */
|
* (c) SoL/IDER session is active */
|
||||||
@@ -638,7 +635,6 @@ e1000_down(struct e1000_adapter *adapter)
|
|||||||
|
|
||||||
#ifdef CONFIG_E1000_NAPI
|
#ifdef CONFIG_E1000_NAPI
|
||||||
napi_disable(&adapter->napi);
|
napi_disable(&adapter->napi);
|
||||||
atomic_set(&adapter->irq_sem, 0);
|
|
||||||
#endif
|
#endif
|
||||||
e1000_irq_disable(adapter);
|
e1000_irq_disable(adapter);
|
||||||
|
|
||||||
@@ -673,7 +669,7 @@ e1000_reset(struct e1000_adapter *adapter)
|
|||||||
{
|
{
|
||||||
uint32_t pba = 0, tx_space, min_tx_space, min_rx_space;
|
uint32_t pba = 0, tx_space, min_tx_space, min_rx_space;
|
||||||
uint16_t fc_high_water_mark = E1000_FC_HIGH_DIFF;
|
uint16_t fc_high_water_mark = E1000_FC_HIGH_DIFF;
|
||||||
boolean_t legacy_pba_adjust = FALSE;
|
bool legacy_pba_adjust = false;
|
||||||
|
|
||||||
/* Repartition Pba for greater than 9k mtu
|
/* Repartition Pba for greater than 9k mtu
|
||||||
* To take effect CTRL.RST is required.
|
* To take effect CTRL.RST is required.
|
||||||
@@ -687,7 +683,7 @@ e1000_reset(struct e1000_adapter *adapter)
|
|||||||
case e1000_82540:
|
case e1000_82540:
|
||||||
case e1000_82541:
|
case e1000_82541:
|
||||||
case e1000_82541_rev_2:
|
case e1000_82541_rev_2:
|
||||||
legacy_pba_adjust = TRUE;
|
legacy_pba_adjust = true;
|
||||||
pba = E1000_PBA_48K;
|
pba = E1000_PBA_48K;
|
||||||
break;
|
break;
|
||||||
case e1000_82545:
|
case e1000_82545:
|
||||||
@@ -698,7 +694,7 @@ e1000_reset(struct e1000_adapter *adapter)
|
|||||||
break;
|
break;
|
||||||
case e1000_82547:
|
case e1000_82547:
|
||||||
case e1000_82547_rev_2:
|
case e1000_82547_rev_2:
|
||||||
legacy_pba_adjust = TRUE;
|
legacy_pba_adjust = true;
|
||||||
pba = E1000_PBA_30K;
|
pba = E1000_PBA_30K;
|
||||||
break;
|
break;
|
||||||
case e1000_82571:
|
case e1000_82571:
|
||||||
@@ -716,7 +712,7 @@ e1000_reset(struct e1000_adapter *adapter)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (legacy_pba_adjust == TRUE) {
|
if (legacy_pba_adjust) {
|
||||||
if (adapter->netdev->mtu > E1000_RXBUFFER_8192)
|
if (adapter->netdev->mtu > E1000_RXBUFFER_8192)
|
||||||
pba -= 8; /* allocate more FIFO for Tx */
|
pba -= 8; /* allocate more FIFO for Tx */
|
||||||
|
|
||||||
@@ -1366,15 +1362,15 @@ e1000_sw_init(struct e1000_adapter *adapter)
|
|||||||
|
|
||||||
e1000_set_media_type(hw);
|
e1000_set_media_type(hw);
|
||||||
|
|
||||||
hw->wait_autoneg_complete = FALSE;
|
hw->wait_autoneg_complete = false;
|
||||||
hw->tbi_compatibility_en = TRUE;
|
hw->tbi_compatibility_en = true;
|
||||||
hw->adaptive_ifs = TRUE;
|
hw->adaptive_ifs = true;
|
||||||
|
|
||||||
/* Copper options */
|
/* Copper options */
|
||||||
|
|
||||||
if (hw->media_type == e1000_media_type_copper) {
|
if (hw->media_type == e1000_media_type_copper) {
|
||||||
hw->mdix = AUTO_ALL_MODES;
|
hw->mdix = AUTO_ALL_MODES;
|
||||||
hw->disable_polarity_correction = FALSE;
|
hw->disable_polarity_correction = false;
|
||||||
hw->master_slave = E1000_MASTER_SLAVE;
|
hw->master_slave = E1000_MASTER_SLAVE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1396,7 +1392,6 @@ e1000_sw_init(struct e1000_adapter *adapter)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Explicitly disable IRQ since the NIC can be in any state. */
|
/* Explicitly disable IRQ since the NIC can be in any state. */
|
||||||
atomic_set(&adapter->irq_sem, 0);
|
|
||||||
e1000_irq_disable(adapter);
|
e1000_irq_disable(adapter);
|
||||||
|
|
||||||
spin_lock_init(&adapter->stats_lock);
|
spin_lock_init(&adapter->stats_lock);
|
||||||
@@ -1576,7 +1571,7 @@ 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 boolean_t
|
static bool
|
||||||
e1000_check_64k_bound(struct e1000_adapter *adapter,
|
e1000_check_64k_bound(struct e1000_adapter *adapter,
|
||||||
void *start, unsigned long len)
|
void *start, unsigned long len)
|
||||||
{
|
{
|
||||||
@@ -1587,10 +1582,10 @@ e1000_check_64k_bound(struct e1000_adapter *adapter,
|
|||||||
* write location to cross 64k boundary due to errata 23 */
|
* write location to cross 64k boundary due to errata 23 */
|
||||||
if (adapter->hw.mac_type == e1000_82545 ||
|
if (adapter->hw.mac_type == e1000_82545 ||
|
||||||
adapter->hw.mac_type == e1000_82546) {
|
adapter->hw.mac_type == e1000_82546) {
|
||||||
return ((begin ^ (end - 1)) >> 16) != 0 ? FALSE : TRUE;
|
return ((begin ^ (end - 1)) >> 16) != 0 ? false : true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -2133,7 +2128,7 @@ e1000_configure_rx(struct e1000_adapter *adapter)
|
|||||||
/* Enable 82543 Receive Checksum Offload for TCP and UDP */
|
/* Enable 82543 Receive Checksum Offload for TCP and UDP */
|
||||||
if (hw->mac_type >= e1000_82543) {
|
if (hw->mac_type >= e1000_82543) {
|
||||||
rxcsum = E1000_READ_REG(hw, RXCSUM);
|
rxcsum = E1000_READ_REG(hw, RXCSUM);
|
||||||
if (adapter->rx_csum == TRUE) {
|
if (adapter->rx_csum) {
|
||||||
rxcsum |= E1000_RXCSUM_TUOFL;
|
rxcsum |= E1000_RXCSUM_TUOFL;
|
||||||
|
|
||||||
/* Enable 82571 IPv4 payload checksum for UDP fragments
|
/* Enable 82571 IPv4 payload checksum for UDP fragments
|
||||||
@@ -2669,7 +2664,7 @@ e1000_watchdog(unsigned long data)
|
|||||||
if (link) {
|
if (link) {
|
||||||
if (!netif_carrier_ok(netdev)) {
|
if (!netif_carrier_ok(netdev)) {
|
||||||
uint32_t ctrl;
|
uint32_t ctrl;
|
||||||
boolean_t txb2b = 1;
|
bool txb2b = true;
|
||||||
e1000_get_speed_and_duplex(&adapter->hw,
|
e1000_get_speed_and_duplex(&adapter->hw,
|
||||||
&adapter->link_speed,
|
&adapter->link_speed,
|
||||||
&adapter->link_duplex);
|
&adapter->link_duplex);
|
||||||
@@ -2691,12 +2686,12 @@ e1000_watchdog(unsigned long data)
|
|||||||
adapter->tx_timeout_factor = 1;
|
adapter->tx_timeout_factor = 1;
|
||||||
switch (adapter->link_speed) {
|
switch (adapter->link_speed) {
|
||||||
case SPEED_10:
|
case SPEED_10:
|
||||||
txb2b = 0;
|
txb2b = false;
|
||||||
netdev->tx_queue_len = 10;
|
netdev->tx_queue_len = 10;
|
||||||
adapter->tx_timeout_factor = 8;
|
adapter->tx_timeout_factor = 8;
|
||||||
break;
|
break;
|
||||||
case SPEED_100:
|
case SPEED_100:
|
||||||
txb2b = 0;
|
txb2b = false;
|
||||||
netdev->tx_queue_len = 100;
|
netdev->tx_queue_len = 100;
|
||||||
/* maybe add some timeout factor ? */
|
/* maybe add some timeout factor ? */
|
||||||
break;
|
break;
|
||||||
@@ -2704,7 +2699,7 @@ e1000_watchdog(unsigned long data)
|
|||||||
|
|
||||||
if ((adapter->hw.mac_type == e1000_82571 ||
|
if ((adapter->hw.mac_type == e1000_82571 ||
|
||||||
adapter->hw.mac_type == e1000_82572) &&
|
adapter->hw.mac_type == e1000_82572) &&
|
||||||
txb2b == 0) {
|
!txb2b) {
|
||||||
uint32_t tarc0;
|
uint32_t tarc0;
|
||||||
tarc0 = E1000_READ_REG(&adapter->hw, TARC0);
|
tarc0 = E1000_READ_REG(&adapter->hw, TARC0);
|
||||||
tarc0 &= ~(1 << 21);
|
tarc0 &= ~(1 << 21);
|
||||||
@@ -2802,7 +2797,7 @@ e1000_watchdog(unsigned long data)
|
|||||||
E1000_WRITE_REG(&adapter->hw, ICS, E1000_ICS_RXDMT0);
|
E1000_WRITE_REG(&adapter->hw, ICS, E1000_ICS_RXDMT0);
|
||||||
|
|
||||||
/* Force detection of hung controller every watchdog period */
|
/* Force detection of hung controller every watchdog period */
|
||||||
adapter->detect_tx_hung = TRUE;
|
adapter->detect_tx_hung = true;
|
||||||
|
|
||||||
/* With 82571 controllers, LAA may be overwritten due to controller
|
/* With 82571 controllers, LAA may be overwritten due to controller
|
||||||
* reset from the other port. Set the appropriate LAA in RAR[0] */
|
* reset from the other port. Set the appropriate LAA in RAR[0] */
|
||||||
@@ -3025,12 +3020,12 @@ e1000_tso(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring,
|
|||||||
if (++i == tx_ring->count) i = 0;
|
if (++i == tx_ring->count) i = 0;
|
||||||
tx_ring->next_to_use = i;
|
tx_ring->next_to_use = i;
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static boolean_t
|
static bool
|
||||||
e1000_tx_csum(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring,
|
e1000_tx_csum(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring,
|
||||||
struct sk_buff *skb)
|
struct sk_buff *skb)
|
||||||
{
|
{
|
||||||
@@ -3060,10 +3055,10 @@ e1000_tx_csum(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring,
|
|||||||
if (unlikely(++i == tx_ring->count)) i = 0;
|
if (unlikely(++i == tx_ring->count)) i = 0;
|
||||||
tx_ring->next_to_use = i;
|
tx_ring->next_to_use = i;
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define E1000_MAX_TXD_PWR 12
|
#define E1000_MAX_TXD_PWR 12
|
||||||
@@ -3836,11 +3831,8 @@ e1000_intr_msi(int irq, void *data)
|
|||||||
#endif
|
#endif
|
||||||
uint32_t icr = E1000_READ_REG(hw, ICR);
|
uint32_t icr = E1000_READ_REG(hw, ICR);
|
||||||
|
|
||||||
#ifdef CONFIG_E1000_NAPI
|
/* in NAPI mode read ICR disables interrupts using IAM */
|
||||||
/* read ICR disables interrupts using IAM, so keep up with our
|
|
||||||
* enable/disable accounting */
|
|
||||||
atomic_inc(&adapter->irq_sem);
|
|
||||||
#endif
|
|
||||||
if (icr & (E1000_ICR_RXSEQ | E1000_ICR_LSC)) {
|
if (icr & (E1000_ICR_RXSEQ | E1000_ICR_LSC)) {
|
||||||
hw->get_link_status = 1;
|
hw->get_link_status = 1;
|
||||||
/* 80003ES2LAN workaround-- For packet buffer work-around on
|
/* 80003ES2LAN workaround-- For packet buffer work-around on
|
||||||
@@ -3910,12 +3902,8 @@ e1000_intr(int irq, void *data)
|
|||||||
!(icr & E1000_ICR_INT_ASSERTED)))
|
!(icr & E1000_ICR_INT_ASSERTED)))
|
||||||
return IRQ_NONE;
|
return IRQ_NONE;
|
||||||
|
|
||||||
/* Interrupt Auto-Mask...upon reading ICR,
|
/* Interrupt Auto-Mask...upon reading ICR, interrupts are masked. No
|
||||||
* interrupts are masked. No need for the
|
* need for the IMC write */
|
||||||
* IMC write, but it does mean we should
|
|
||||||
* account for it ASAP. */
|
|
||||||
if (likely(hw->mac_type >= e1000_82571))
|
|
||||||
atomic_inc(&adapter->irq_sem);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (unlikely(icr & (E1000_ICR_RXSEQ | E1000_ICR_LSC))) {
|
if (unlikely(icr & (E1000_ICR_RXSEQ | E1000_ICR_LSC))) {
|
||||||
@@ -3939,7 +3927,6 @@ e1000_intr(int irq, void *data)
|
|||||||
#ifdef CONFIG_E1000_NAPI
|
#ifdef CONFIG_E1000_NAPI
|
||||||
if (unlikely(hw->mac_type < e1000_82571)) {
|
if (unlikely(hw->mac_type < e1000_82571)) {
|
||||||
/* disable interrupts, without the synchronize_irq bit */
|
/* disable interrupts, without the synchronize_irq bit */
|
||||||
atomic_inc(&adapter->irq_sem);
|
|
||||||
E1000_WRITE_REG(hw, IMC, ~0);
|
E1000_WRITE_REG(hw, IMC, ~0);
|
||||||
E1000_WRITE_FLUSH(hw);
|
E1000_WRITE_FLUSH(hw);
|
||||||
}
|
}
|
||||||
@@ -3964,10 +3951,8 @@ e1000_intr(int irq, void *data)
|
|||||||
* in dead lock. Writing IMC forces 82547 into
|
* in dead lock. Writing IMC forces 82547 into
|
||||||
* de-assertion state.
|
* de-assertion state.
|
||||||
*/
|
*/
|
||||||
if (hw->mac_type == e1000_82547 || hw->mac_type == e1000_82547_rev_2) {
|
if (hw->mac_type == e1000_82547 || hw->mac_type == e1000_82547_rev_2)
|
||||||
atomic_inc(&adapter->irq_sem);
|
|
||||||
E1000_WRITE_REG(hw, IMC, ~0);
|
E1000_WRITE_REG(hw, IMC, ~0);
|
||||||
}
|
|
||||||
|
|
||||||
adapter->total_tx_bytes = 0;
|
adapter->total_tx_bytes = 0;
|
||||||
adapter->total_rx_bytes = 0;
|
adapter->total_rx_bytes = 0;
|
||||||
@@ -4038,7 +4023,7 @@ e1000_clean(struct napi_struct *napi, int budget)
|
|||||||
* @adapter: board private structure
|
* @adapter: board private structure
|
||||||
**/
|
**/
|
||||||
|
|
||||||
static boolean_t
|
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)
|
||||||
{
|
{
|
||||||
@@ -4049,7 +4034,7 @@ e1000_clean_tx_irq(struct e1000_adapter *adapter,
|
|||||||
#ifdef CONFIG_E1000_NAPI
|
#ifdef CONFIG_E1000_NAPI
|
||||||
unsigned int count = 0;
|
unsigned int count = 0;
|
||||||
#endif
|
#endif
|
||||||
boolean_t cleaned = FALSE;
|
bool cleaned = false;
|
||||||
unsigned int total_tx_bytes=0, total_tx_packets=0;
|
unsigned int total_tx_bytes=0, total_tx_packets=0;
|
||||||
|
|
||||||
i = tx_ring->next_to_clean;
|
i = tx_ring->next_to_clean;
|
||||||
@@ -4057,7 +4042,7 @@ e1000_clean_tx_irq(struct e1000_adapter *adapter,
|
|||||||
eop_desc = E1000_TX_DESC(*tx_ring, eop);
|
eop_desc = E1000_TX_DESC(*tx_ring, eop);
|
||||||
|
|
||||||
while (eop_desc->upper.data & cpu_to_le32(E1000_TXD_STAT_DD)) {
|
while (eop_desc->upper.data & cpu_to_le32(E1000_TXD_STAT_DD)) {
|
||||||
for (cleaned = FALSE; !cleaned; ) {
|
for (cleaned = false; !cleaned; ) {
|
||||||
tx_desc = E1000_TX_DESC(*tx_ring, i);
|
tx_desc = E1000_TX_DESC(*tx_ring, i);
|
||||||
buffer_info = &tx_ring->buffer_info[i];
|
buffer_info = &tx_ring->buffer_info[i];
|
||||||
cleaned = (i == eop);
|
cleaned = (i == eop);
|
||||||
@@ -4105,7 +4090,7 @@ e1000_clean_tx_irq(struct e1000_adapter *adapter,
|
|||||||
if (adapter->detect_tx_hung) {
|
if (adapter->detect_tx_hung) {
|
||||||
/* Detect a transmit hang in hardware, this serializes the
|
/* Detect a transmit hang in hardware, this serializes the
|
||||||
* check with the clearing of time_stamp and movement of i */
|
* check with the clearing of time_stamp and movement of i */
|
||||||
adapter->detect_tx_hung = FALSE;
|
adapter->detect_tx_hung = false;
|
||||||
if (tx_ring->buffer_info[eop].dma &&
|
if (tx_ring->buffer_info[eop].dma &&
|
||||||
time_after(jiffies, tx_ring->buffer_info[eop].time_stamp +
|
time_after(jiffies, tx_ring->buffer_info[eop].time_stamp +
|
||||||
(adapter->tx_timeout_factor * HZ))
|
(adapter->tx_timeout_factor * HZ))
|
||||||
@@ -4200,7 +4185,7 @@ e1000_rx_checksum(struct e1000_adapter *adapter,
|
|||||||
* @adapter: board private structure
|
* @adapter: board private structure
|
||||||
**/
|
**/
|
||||||
|
|
||||||
static boolean_t
|
static bool
|
||||||
#ifdef CONFIG_E1000_NAPI
|
#ifdef CONFIG_E1000_NAPI
|
||||||
e1000_clean_rx_irq(struct e1000_adapter *adapter,
|
e1000_clean_rx_irq(struct e1000_adapter *adapter,
|
||||||
struct e1000_rx_ring *rx_ring,
|
struct e1000_rx_ring *rx_ring,
|
||||||
@@ -4219,7 +4204,7 @@ e1000_clean_rx_irq(struct e1000_adapter *adapter,
|
|||||||
uint8_t last_byte;
|
uint8_t last_byte;
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
int cleaned_count = 0;
|
int cleaned_count = 0;
|
||||||
boolean_t cleaned = FALSE;
|
bool cleaned = false;
|
||||||
unsigned int total_rx_bytes=0, total_rx_packets=0;
|
unsigned int total_rx_bytes=0, total_rx_packets=0;
|
||||||
|
|
||||||
i = rx_ring->next_to_clean;
|
i = rx_ring->next_to_clean;
|
||||||
@@ -4247,7 +4232,7 @@ e1000_clean_rx_irq(struct e1000_adapter *adapter,
|
|||||||
|
|
||||||
next_buffer = &rx_ring->buffer_info[i];
|
next_buffer = &rx_ring->buffer_info[i];
|
||||||
|
|
||||||
cleaned = TRUE;
|
cleaned = true;
|
||||||
cleaned_count++;
|
cleaned_count++;
|
||||||
pci_unmap_single(pdev,
|
pci_unmap_single(pdev,
|
||||||
buffer_info->dma,
|
buffer_info->dma,
|
||||||
@@ -4373,7 +4358,7 @@ next_desc:
|
|||||||
* @adapter: board private structure
|
* @adapter: board private structure
|
||||||
**/
|
**/
|
||||||
|
|
||||||
static boolean_t
|
static bool
|
||||||
#ifdef CONFIG_E1000_NAPI
|
#ifdef CONFIG_E1000_NAPI
|
||||||
e1000_clean_rx_irq_ps(struct e1000_adapter *adapter,
|
e1000_clean_rx_irq_ps(struct e1000_adapter *adapter,
|
||||||
struct e1000_rx_ring *rx_ring,
|
struct e1000_rx_ring *rx_ring,
|
||||||
@@ -4393,7 +4378,7 @@ e1000_clean_rx_irq_ps(struct e1000_adapter *adapter,
|
|||||||
unsigned int i, j;
|
unsigned int i, j;
|
||||||
uint32_t length, staterr;
|
uint32_t length, staterr;
|
||||||
int cleaned_count = 0;
|
int cleaned_count = 0;
|
||||||
boolean_t cleaned = FALSE;
|
bool cleaned = false;
|
||||||
unsigned int total_rx_bytes=0, total_rx_packets=0;
|
unsigned int total_rx_bytes=0, total_rx_packets=0;
|
||||||
|
|
||||||
i = rx_ring->next_to_clean;
|
i = rx_ring->next_to_clean;
|
||||||
@@ -4420,7 +4405,7 @@ e1000_clean_rx_irq_ps(struct e1000_adapter *adapter,
|
|||||||
|
|
||||||
next_buffer = &rx_ring->buffer_info[i];
|
next_buffer = &rx_ring->buffer_info[i];
|
||||||
|
|
||||||
cleaned = TRUE;
|
cleaned = true;
|
||||||
cleaned_count++;
|
cleaned_count++;
|
||||||
pci_unmap_single(pdev, buffer_info->dma,
|
pci_unmap_single(pdev, buffer_info->dma,
|
||||||
buffer_info->length,
|
buffer_info->length,
|
||||||
@@ -5001,7 +4986,8 @@ e1000_vlan_rx_register(struct net_device *netdev, struct vlan_group *grp)
|
|||||||
struct e1000_adapter *adapter = netdev_priv(netdev);
|
struct e1000_adapter *adapter = netdev_priv(netdev);
|
||||||
uint32_t ctrl, rctl;
|
uint32_t ctrl, rctl;
|
||||||
|
|
||||||
e1000_irq_disable(adapter);
|
if (!test_bit(__E1000_DOWN, &adapter->flags))
|
||||||
|
e1000_irq_disable(adapter);
|
||||||
adapter->vlgrp = grp;
|
adapter->vlgrp = grp;
|
||||||
|
|
||||||
if (grp) {
|
if (grp) {
|
||||||
@@ -5038,7 +5024,8 @@ e1000_vlan_rx_register(struct net_device *netdev, struct vlan_group *grp)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
e1000_irq_enable(adapter);
|
if (!test_bit(__E1000_DOWN, &adapter->flags))
|
||||||
|
e1000_irq_enable(adapter);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -5064,9 +5051,11 @@ e1000_vlan_rx_kill_vid(struct net_device *netdev, uint16_t vid)
|
|||||||
struct e1000_adapter *adapter = netdev_priv(netdev);
|
struct e1000_adapter *adapter = netdev_priv(netdev);
|
||||||
uint32_t vfta, index;
|
uint32_t vfta, index;
|
||||||
|
|
||||||
e1000_irq_disable(adapter);
|
if (!test_bit(__E1000_DOWN, &adapter->flags))
|
||||||
|
e1000_irq_disable(adapter);
|
||||||
vlan_group_set_device(adapter->vlgrp, vid, NULL);
|
vlan_group_set_device(adapter->vlgrp, vid, NULL);
|
||||||
e1000_irq_enable(adapter);
|
if (!test_bit(__E1000_DOWN, &adapter->flags))
|
||||||
|
e1000_irq_enable(adapter);
|
||||||
|
|
||||||
if ((adapter->hw.mng_cookie.status &
|
if ((adapter->hw.mng_cookie.status &
|
||||||
E1000_MNG_DHCP_COOKIE_STATUS_VLAN_SUPPORT) &&
|
E1000_MNG_DHCP_COOKIE_STATUS_VLAN_SUPPORT) &&
|
||||||
|
|||||||
@@ -41,13 +41,6 @@
|
|||||||
#include <linux/interrupt.h>
|
#include <linux/interrupt.h>
|
||||||
#include <linux/sched.h>
|
#include <linux/sched.h>
|
||||||
|
|
||||||
typedef enum {
|
|
||||||
#undef FALSE
|
|
||||||
FALSE = 0,
|
|
||||||
#undef TRUE
|
|
||||||
TRUE = 1
|
|
||||||
} boolean_t;
|
|
||||||
|
|
||||||
#ifdef DBG
|
#ifdef DBG
|
||||||
#define DEBUGOUT(S) printk(KERN_DEBUG S "\n")
|
#define DEBUGOUT(S) printk(KERN_DEBUG S "\n")
|
||||||
#define DEBUGOUT1(S, A...) printk(KERN_DEBUG S "\n", A)
|
#define DEBUGOUT1(S, A...) printk(KERN_DEBUG S "\n", A)
|
||||||
|
|||||||
@@ -167,9 +167,6 @@ struct e1000_adapter {
|
|||||||
|
|
||||||
spinlock_t tx_queue_lock; /* prevent concurrent tail updates */
|
spinlock_t tx_queue_lock; /* prevent concurrent tail updates */
|
||||||
|
|
||||||
/* this is still needed for 82571 and above */
|
|
||||||
atomic_t irq_sem;
|
|
||||||
|
|
||||||
/* track device up/down/testing state */
|
/* track device up/down/testing state */
|
||||||
unsigned long state;
|
unsigned long state;
|
||||||
|
|
||||||
@@ -462,7 +459,6 @@ extern s32 e1000e_acquire_nvm(struct e1000_hw *hw);
|
|||||||
extern s32 e1000e_write_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data);
|
extern s32 e1000e_write_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data);
|
||||||
extern s32 e1000e_update_nvm_checksum_generic(struct e1000_hw *hw);
|
extern s32 e1000e_update_nvm_checksum_generic(struct e1000_hw *hw);
|
||||||
extern s32 e1000e_poll_eerd_eewr_done(struct e1000_hw *hw, int ee_reg);
|
extern s32 e1000e_poll_eerd_eewr_done(struct e1000_hw *hw, int ee_reg);
|
||||||
extern s32 e1000e_read_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data);
|
|
||||||
extern s32 e1000e_read_nvm_eerd(struct e1000_hw *hw, u16 offset, u16 words, u16 *data);
|
extern s32 e1000e_read_nvm_eerd(struct e1000_hw *hw, u16 offset, u16 words, u16 *data);
|
||||||
extern s32 e1000e_validate_nvm_checksum_generic(struct e1000_hw *hw);
|
extern s32 e1000e_validate_nvm_checksum_generic(struct e1000_hw *hw);
|
||||||
extern void e1000e_release_nvm(struct e1000_hw *hw);
|
extern void e1000e_release_nvm(struct e1000_hw *hw);
|
||||||
|
|||||||
@@ -1851,62 +1851,6 @@ static s32 e1000_ready_nvm_eeprom(struct e1000_hw *hw)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* e1000e_read_nvm_spi - Reads EEPROM using SPI
|
|
||||||
* @hw: pointer to the HW structure
|
|
||||||
* @offset: offset of word in the EEPROM to read
|
|
||||||
* @words: number of words to read
|
|
||||||
* @data: word read from the EEPROM
|
|
||||||
*
|
|
||||||
* Reads a 16 bit word from the EEPROM.
|
|
||||||
**/
|
|
||||||
s32 e1000e_read_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data)
|
|
||||||
{
|
|
||||||
struct e1000_nvm_info *nvm = &hw->nvm;
|
|
||||||
u32 i = 0;
|
|
||||||
s32 ret_val;
|
|
||||||
u16 word_in;
|
|
||||||
u8 read_opcode = NVM_READ_OPCODE_SPI;
|
|
||||||
|
|
||||||
/* A check for invalid values: offset too large, too many words,
|
|
||||||
* and not enough words. */
|
|
||||||
if ((offset >= nvm->word_size) || (words > (nvm->word_size - offset)) ||
|
|
||||||
(words == 0)) {
|
|
||||||
hw_dbg(hw, "nvm parameter(s) out of bounds\n");
|
|
||||||
return -E1000_ERR_NVM;
|
|
||||||
}
|
|
||||||
|
|
||||||
ret_val = nvm->ops.acquire_nvm(hw);
|
|
||||||
if (ret_val)
|
|
||||||
return ret_val;
|
|
||||||
|
|
||||||
ret_val = e1000_ready_nvm_eeprom(hw);
|
|
||||||
if (ret_val) {
|
|
||||||
nvm->ops.release_nvm(hw);
|
|
||||||
return ret_val;
|
|
||||||
}
|
|
||||||
|
|
||||||
e1000_standby_nvm(hw);
|
|
||||||
|
|
||||||
if ((nvm->address_bits == 8) && (offset >= 128))
|
|
||||||
read_opcode |= NVM_A8_OPCODE_SPI;
|
|
||||||
|
|
||||||
/* Send the READ command (opcode + addr) */
|
|
||||||
e1000_shift_out_eec_bits(hw, read_opcode, nvm->opcode_bits);
|
|
||||||
e1000_shift_out_eec_bits(hw, (u16)(offset*2), nvm->address_bits);
|
|
||||||
|
|
||||||
/* Read the data. SPI NVMs increment the address with each byte
|
|
||||||
* read and will roll over if reading beyond the end. This allows
|
|
||||||
* us to read the whole NVM from any offset */
|
|
||||||
for (i = 0; i < words; i++) {
|
|
||||||
word_in = e1000_shift_in_eec_bits(hw, 16);
|
|
||||||
data[i] = (word_in >> 8) | (word_in << 8);
|
|
||||||
}
|
|
||||||
|
|
||||||
nvm->ops.release_nvm(hw);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* e1000e_read_nvm_eerd - Reads EEPROM using EERD register
|
* e1000e_read_nvm_eerd - Reads EEPROM using EERD register
|
||||||
* @hw: pointer to the HW structure
|
* @hw: pointer to the HW structure
|
||||||
|
|||||||
+14
-23
@@ -836,9 +836,7 @@ static irqreturn_t e1000_intr_msi(int irq, void *data)
|
|||||||
struct e1000_hw *hw = &adapter->hw;
|
struct e1000_hw *hw = &adapter->hw;
|
||||||
u32 icr = er32(ICR);
|
u32 icr = er32(ICR);
|
||||||
|
|
||||||
/* read ICR disables interrupts using IAM, so keep up with our
|
/* read ICR disables interrupts using IAM */
|
||||||
* enable/disable accounting */
|
|
||||||
atomic_inc(&adapter->irq_sem);
|
|
||||||
|
|
||||||
if (icr & (E1000_ICR_RXSEQ | E1000_ICR_LSC)) {
|
if (icr & (E1000_ICR_RXSEQ | E1000_ICR_LSC)) {
|
||||||
hw->mac.get_link_status = 1;
|
hw->mac.get_link_status = 1;
|
||||||
@@ -868,8 +866,6 @@ static irqreturn_t e1000_intr_msi(int irq, void *data)
|
|||||||
adapter->total_rx_bytes = 0;
|
adapter->total_rx_bytes = 0;
|
||||||
adapter->total_rx_packets = 0;
|
adapter->total_rx_packets = 0;
|
||||||
__netif_rx_schedule(netdev, &adapter->napi);
|
__netif_rx_schedule(netdev, &adapter->napi);
|
||||||
} else {
|
|
||||||
atomic_dec(&adapter->irq_sem);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return IRQ_HANDLED;
|
return IRQ_HANDLED;
|
||||||
@@ -895,11 +891,8 @@ static irqreturn_t e1000_intr(int irq, void *data)
|
|||||||
if (!(icr & E1000_ICR_INT_ASSERTED))
|
if (!(icr & E1000_ICR_INT_ASSERTED))
|
||||||
return IRQ_NONE;
|
return IRQ_NONE;
|
||||||
|
|
||||||
/* Interrupt Auto-Mask...upon reading ICR,
|
/* Interrupt Auto-Mask...upon reading ICR, interrupts are masked. No
|
||||||
* interrupts are masked. No need for the
|
* need for the IMC write */
|
||||||
* IMC write, but it does mean we should
|
|
||||||
* account for it ASAP. */
|
|
||||||
atomic_inc(&adapter->irq_sem);
|
|
||||||
|
|
||||||
if (icr & (E1000_ICR_RXSEQ | E1000_ICR_LSC)) {
|
if (icr & (E1000_ICR_RXSEQ | E1000_ICR_LSC)) {
|
||||||
hw->mac.get_link_status = 1;
|
hw->mac.get_link_status = 1;
|
||||||
@@ -931,8 +924,6 @@ static irqreturn_t e1000_intr(int irq, void *data)
|
|||||||
adapter->total_rx_bytes = 0;
|
adapter->total_rx_bytes = 0;
|
||||||
adapter->total_rx_packets = 0;
|
adapter->total_rx_packets = 0;
|
||||||
__netif_rx_schedule(netdev, &adapter->napi);
|
__netif_rx_schedule(netdev, &adapter->napi);
|
||||||
} else {
|
|
||||||
atomic_dec(&adapter->irq_sem);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return IRQ_HANDLED;
|
return IRQ_HANDLED;
|
||||||
@@ -983,7 +974,6 @@ static void e1000_irq_disable(struct e1000_adapter *adapter)
|
|||||||
{
|
{
|
||||||
struct e1000_hw *hw = &adapter->hw;
|
struct e1000_hw *hw = &adapter->hw;
|
||||||
|
|
||||||
atomic_inc(&adapter->irq_sem);
|
|
||||||
ew32(IMC, ~0);
|
ew32(IMC, ~0);
|
||||||
e1e_flush();
|
e1e_flush();
|
||||||
synchronize_irq(adapter->pdev->irq);
|
synchronize_irq(adapter->pdev->irq);
|
||||||
@@ -996,10 +986,8 @@ static void e1000_irq_enable(struct e1000_adapter *adapter)
|
|||||||
{
|
{
|
||||||
struct e1000_hw *hw = &adapter->hw;
|
struct e1000_hw *hw = &adapter->hw;
|
||||||
|
|
||||||
if (atomic_dec_and_test(&adapter->irq_sem)) {
|
ew32(IMS, IMS_ENABLE_MASK);
|
||||||
ew32(IMS, IMS_ENABLE_MASK);
|
e1e_flush();
|
||||||
e1e_flush();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1427,9 +1415,12 @@ static void e1000_vlan_rx_kill_vid(struct net_device *netdev, u16 vid)
|
|||||||
struct e1000_hw *hw = &adapter->hw;
|
struct e1000_hw *hw = &adapter->hw;
|
||||||
u32 vfta, index;
|
u32 vfta, index;
|
||||||
|
|
||||||
e1000_irq_disable(adapter);
|
if (!test_bit(__E1000_DOWN, &adapter->state))
|
||||||
|
e1000_irq_disable(adapter);
|
||||||
vlan_group_set_device(adapter->vlgrp, vid, NULL);
|
vlan_group_set_device(adapter->vlgrp, vid, NULL);
|
||||||
e1000_irq_enable(adapter);
|
|
||||||
|
if (!test_bit(__E1000_DOWN, &adapter->state))
|
||||||
|
e1000_irq_enable(adapter);
|
||||||
|
|
||||||
if ((adapter->hw.mng_cookie.status &
|
if ((adapter->hw.mng_cookie.status &
|
||||||
E1000_MNG_DHCP_COOKIE_STATUS_VLAN) &&
|
E1000_MNG_DHCP_COOKIE_STATUS_VLAN) &&
|
||||||
@@ -1480,7 +1471,8 @@ static void e1000_vlan_rx_register(struct net_device *netdev,
|
|||||||
struct e1000_hw *hw = &adapter->hw;
|
struct e1000_hw *hw = &adapter->hw;
|
||||||
u32 ctrl, rctl;
|
u32 ctrl, rctl;
|
||||||
|
|
||||||
e1000_irq_disable(adapter);
|
if (!test_bit(__E1000_DOWN, &adapter->state))
|
||||||
|
e1000_irq_disable(adapter);
|
||||||
adapter->vlgrp = grp;
|
adapter->vlgrp = grp;
|
||||||
|
|
||||||
if (grp) {
|
if (grp) {
|
||||||
@@ -1517,7 +1509,8 @@ static void e1000_vlan_rx_register(struct net_device *netdev,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
e1000_irq_enable(adapter);
|
if (!test_bit(__E1000_DOWN, &adapter->state))
|
||||||
|
e1000_irq_enable(adapter);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void e1000_restore_vlan(struct e1000_adapter *adapter)
|
static void e1000_restore_vlan(struct e1000_adapter *adapter)
|
||||||
@@ -2167,7 +2160,6 @@ void e1000e_down(struct e1000_adapter *adapter)
|
|||||||
msleep(10);
|
msleep(10);
|
||||||
|
|
||||||
napi_disable(&adapter->napi);
|
napi_disable(&adapter->napi);
|
||||||
atomic_set(&adapter->irq_sem, 0);
|
|
||||||
e1000_irq_disable(adapter);
|
e1000_irq_disable(adapter);
|
||||||
|
|
||||||
del_timer_sync(&adapter->watchdog_timer);
|
del_timer_sync(&adapter->watchdog_timer);
|
||||||
@@ -2227,7 +2219,6 @@ static int __devinit e1000_sw_init(struct e1000_adapter *adapter)
|
|||||||
spin_lock_init(&adapter->tx_queue_lock);
|
spin_lock_init(&adapter->tx_queue_lock);
|
||||||
|
|
||||||
/* Explicitly disable IRQ since the NIC can be in any state. */
|
/* Explicitly disable IRQ since the NIC can be in any state. */
|
||||||
atomic_set(&adapter->irq_sem, 0);
|
|
||||||
e1000_irq_disable(adapter);
|
e1000_irq_disable(adapter);
|
||||||
|
|
||||||
spin_lock_init(&adapter->stats_lock);
|
spin_lock_init(&adapter->stats_lock);
|
||||||
|
|||||||
@@ -3859,7 +3859,8 @@ static void nv_do_stats_poll(unsigned long data)
|
|||||||
nv_get_hw_stats(dev);
|
nv_get_hw_stats(dev);
|
||||||
|
|
||||||
if (!np->in_shutdown)
|
if (!np->in_shutdown)
|
||||||
mod_timer(&np->stats_poll, jiffies + STATS_INTERVAL);
|
mod_timer(&np->stats_poll,
|
||||||
|
round_jiffies(jiffies + STATS_INTERVAL));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void nv_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
|
static void nv_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
|
||||||
@@ -5063,7 +5064,8 @@ static int nv_open(struct net_device *dev)
|
|||||||
|
|
||||||
/* start statistics timer */
|
/* start statistics timer */
|
||||||
if (np->driver_data & (DEV_HAS_STATISTICS_V1|DEV_HAS_STATISTICS_V2))
|
if (np->driver_data & (DEV_HAS_STATISTICS_V1|DEV_HAS_STATISTICS_V2))
|
||||||
mod_timer(&np->stats_poll, jiffies + STATS_INTERVAL);
|
mod_timer(&np->stats_poll,
|
||||||
|
round_jiffies(jiffies + STATS_INTERVAL));
|
||||||
|
|
||||||
spin_unlock_irq(&np->lock);
|
spin_unlock_irq(&np->lock);
|
||||||
|
|
||||||
|
|||||||
+11
-13
@@ -1185,7 +1185,7 @@ static int gfar_change_mtu(struct net_device *dev, int new_mtu)
|
|||||||
int frame_size = new_mtu + ETH_HLEN;
|
int frame_size = new_mtu + ETH_HLEN;
|
||||||
|
|
||||||
if (priv->vlan_enable)
|
if (priv->vlan_enable)
|
||||||
frame_size += VLAN_ETH_HLEN;
|
frame_size += VLAN_HLEN;
|
||||||
|
|
||||||
if (gfar_uses_fcb(priv))
|
if (gfar_uses_fcb(priv))
|
||||||
frame_size += GMAC_FCB_LEN;
|
frame_size += GMAC_FCB_LEN;
|
||||||
@@ -1299,11 +1299,11 @@ static irqreturn_t gfar_transmit(int irq, void *dev_id)
|
|||||||
|
|
||||||
/* If we are coalescing the interrupts, reset the timer */
|
/* If we are coalescing the interrupts, reset the timer */
|
||||||
/* Otherwise, clear it */
|
/* Otherwise, clear it */
|
||||||
if (priv->txcoalescing)
|
if (likely(priv->txcoalescing)) {
|
||||||
|
gfar_write(&priv->regs->txic, 0);
|
||||||
gfar_write(&priv->regs->txic,
|
gfar_write(&priv->regs->txic,
|
||||||
mk_ic_value(priv->txcount, priv->txtime));
|
mk_ic_value(priv->txcount, priv->txtime));
|
||||||
else
|
}
|
||||||
gfar_write(&priv->regs->txic, 0);
|
|
||||||
|
|
||||||
spin_unlock(&priv->txlock);
|
spin_unlock(&priv->txlock);
|
||||||
|
|
||||||
@@ -1417,11 +1417,11 @@ irqreturn_t gfar_receive(int irq, void *dev_id)
|
|||||||
|
|
||||||
/* If we are coalescing interrupts, update the timer */
|
/* If we are coalescing interrupts, update the timer */
|
||||||
/* Otherwise, clear it */
|
/* Otherwise, clear it */
|
||||||
if (priv->rxcoalescing)
|
if (likely(priv->rxcoalescing)) {
|
||||||
|
gfar_write(&priv->regs->rxic, 0);
|
||||||
gfar_write(&priv->regs->rxic,
|
gfar_write(&priv->regs->rxic,
|
||||||
mk_ic_value(priv->rxcount, priv->rxtime));
|
mk_ic_value(priv->rxcount, priv->rxtime));
|
||||||
else
|
}
|
||||||
gfar_write(&priv->regs->rxic, 0);
|
|
||||||
|
|
||||||
spin_unlock_irqrestore(&priv->rxlock, flags);
|
spin_unlock_irqrestore(&priv->rxlock, flags);
|
||||||
#endif
|
#endif
|
||||||
@@ -1526,9 +1526,7 @@ int gfar_clean_rx_ring(struct net_device *dev, int rx_work_limit)
|
|||||||
rmb();
|
rmb();
|
||||||
skb = priv->rx_skbuff[priv->skb_currx];
|
skb = priv->rx_skbuff[priv->skb_currx];
|
||||||
|
|
||||||
if (!(bdp->status &
|
if ((bdp->status & RXBD_LAST) && !(bdp->status & RXBD_ERR)) {
|
||||||
(RXBD_LARGE | RXBD_SHORT | RXBD_NONOCTET
|
|
||||||
| RXBD_CRCERR | RXBD_OVERRUN | RXBD_TRUNCATED))) {
|
|
||||||
/* Increment the number of packets */
|
/* Increment the number of packets */
|
||||||
dev->stats.rx_packets++;
|
dev->stats.rx_packets++;
|
||||||
howmany++;
|
howmany++;
|
||||||
@@ -1595,11 +1593,11 @@ static int gfar_poll(struct napi_struct *napi, int budget)
|
|||||||
|
|
||||||
/* If we are coalescing interrupts, update the timer */
|
/* If we are coalescing interrupts, update the timer */
|
||||||
/* Otherwise, clear it */
|
/* Otherwise, clear it */
|
||||||
if (priv->rxcoalescing)
|
if (likely(priv->rxcoalescing)) {
|
||||||
|
gfar_write(&priv->regs->rxic, 0);
|
||||||
gfar_write(&priv->regs->rxic,
|
gfar_write(&priv->regs->rxic,
|
||||||
mk_ic_value(priv->rxcount, priv->rxtime));
|
mk_ic_value(priv->rxcount, priv->rxtime));
|
||||||
else
|
}
|
||||||
gfar_write(&priv->regs->rxic, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return howmany;
|
return howmany;
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ extern const char gfar_driver_version[];
|
|||||||
#define DEFAULT_FIFO_TX_STARVE 0x40
|
#define DEFAULT_FIFO_TX_STARVE 0x40
|
||||||
#define DEFAULT_FIFO_TX_STARVE_OFF 0x80
|
#define DEFAULT_FIFO_TX_STARVE_OFF 0x80
|
||||||
#define DEFAULT_BD_STASH 1
|
#define DEFAULT_BD_STASH 1
|
||||||
#define DEFAULT_STASH_LENGTH 64
|
#define DEFAULT_STASH_LENGTH 96
|
||||||
#define DEFAULT_STASH_INDEX 0
|
#define DEFAULT_STASH_INDEX 0
|
||||||
|
|
||||||
/* The number of Exact Match registers */
|
/* The number of Exact Match registers */
|
||||||
@@ -124,11 +124,11 @@ extern const char gfar_driver_version[];
|
|||||||
|
|
||||||
#define DEFAULT_TX_COALESCE 1
|
#define DEFAULT_TX_COALESCE 1
|
||||||
#define DEFAULT_TXCOUNT 16
|
#define DEFAULT_TXCOUNT 16
|
||||||
#define DEFAULT_TXTIME 4
|
#define DEFAULT_TXTIME 21
|
||||||
|
|
||||||
#define DEFAULT_RX_COALESCE 1
|
#define DEFAULT_RX_COALESCE 1
|
||||||
#define DEFAULT_RXCOUNT 16
|
#define DEFAULT_RXCOUNT 16
|
||||||
#define DEFAULT_RXTIME 4
|
#define DEFAULT_RXTIME 21
|
||||||
|
|
||||||
#define TBIPA_VALUE 0x1f
|
#define TBIPA_VALUE 0x1f
|
||||||
#define MIIMCFG_INIT_VALUE 0x00000007
|
#define MIIMCFG_INIT_VALUE 0x00000007
|
||||||
@@ -340,6 +340,9 @@ extern const char gfar_driver_version[];
|
|||||||
#define RXBD_OVERRUN 0x0002
|
#define RXBD_OVERRUN 0x0002
|
||||||
#define RXBD_TRUNCATED 0x0001
|
#define RXBD_TRUNCATED 0x0001
|
||||||
#define RXBD_STATS 0x01ff
|
#define RXBD_STATS 0x01ff
|
||||||
|
#define RXBD_ERR (RXBD_LARGE | RXBD_SHORT | RXBD_NONOCTET \
|
||||||
|
| RXBD_CRCERR | RXBD_OVERRUN \
|
||||||
|
| RXBD_TRUNCATED)
|
||||||
|
|
||||||
/* Rx FCB status field bits */
|
/* Rx FCB status field bits */
|
||||||
#define RXFCB_VLN 0x8000
|
#define RXFCB_VLN 0x8000
|
||||||
|
|||||||
+3
-39
@@ -1259,26 +1259,7 @@ static void ibmveth_proc_unregister_driver(void)
|
|||||||
remove_proc_entry(IBMVETH_PROC_DIR, init_net.proc_net);
|
remove_proc_entry(IBMVETH_PROC_DIR, init_net.proc_net);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void *ibmveth_seq_start(struct seq_file *seq, loff_t *pos)
|
static int ibmveth_show(struct seq_file *seq, void *v)
|
||||||
{
|
|
||||||
if (*pos == 0) {
|
|
||||||
return (void *)1;
|
|
||||||
} else {
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void *ibmveth_seq_next(struct seq_file *seq, void *v, loff_t *pos)
|
|
||||||
{
|
|
||||||
++*pos;
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void ibmveth_seq_stop(struct seq_file *seq, void *v)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
static int ibmveth_seq_show(struct seq_file *seq, void *v)
|
|
||||||
{
|
{
|
||||||
struct ibmveth_adapter *adapter = seq->private;
|
struct ibmveth_adapter *adapter = seq->private;
|
||||||
char *current_mac = ((char*) &adapter->netdev->dev_addr);
|
char *current_mac = ((char*) &adapter->netdev->dev_addr);
|
||||||
@@ -1302,27 +1283,10 @@ static int ibmveth_seq_show(struct seq_file *seq, void *v)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
static struct seq_operations ibmveth_seq_ops = {
|
|
||||||
.start = ibmveth_seq_start,
|
|
||||||
.next = ibmveth_seq_next,
|
|
||||||
.stop = ibmveth_seq_stop,
|
|
||||||
.show = ibmveth_seq_show,
|
|
||||||
};
|
|
||||||
|
|
||||||
static int ibmveth_proc_open(struct inode *inode, struct file *file)
|
static int ibmveth_proc_open(struct inode *inode, struct file *file)
|
||||||
{
|
{
|
||||||
struct seq_file *seq;
|
return single_open(file, ibmveth_show, PDE(inode)->data);
|
||||||
struct proc_dir_entry *proc;
|
|
||||||
int rc;
|
|
||||||
|
|
||||||
rc = seq_open(file, &ibmveth_seq_ops);
|
|
||||||
if (!rc) {
|
|
||||||
/* recover the pointer buried in proc_dir_entry data */
|
|
||||||
seq = file->private_data;
|
|
||||||
proc = PDE(inode);
|
|
||||||
seq->private = proc->data;
|
|
||||||
}
|
|
||||||
return rc;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct file_operations ibmveth_proc_fops = {
|
static const struct file_operations ibmveth_proc_fops = {
|
||||||
@@ -1330,7 +1294,7 @@ static const struct file_operations ibmveth_proc_fops = {
|
|||||||
.open = ibmveth_proc_open,
|
.open = ibmveth_proc_open,
|
||||||
.read = seq_read,
|
.read = seq_read,
|
||||||
.llseek = seq_lseek,
|
.llseek = seq_lseek,
|
||||||
.release = seq_release,
|
.release = single_release,
|
||||||
};
|
};
|
||||||
|
|
||||||
static void ibmveth_proc_register_adapter(struct ibmveth_adapter *adapter)
|
static void ibmveth_proc_register_adapter(struct ibmveth_adapter *adapter)
|
||||||
|
|||||||
+23
-5
@@ -158,7 +158,6 @@ struct ixgb_adapter {
|
|||||||
uint16_t link_speed;
|
uint16_t link_speed;
|
||||||
uint16_t link_duplex;
|
uint16_t link_duplex;
|
||||||
spinlock_t tx_lock;
|
spinlock_t tx_lock;
|
||||||
atomic_t irq_sem;
|
|
||||||
struct work_struct tx_timeout_task;
|
struct work_struct tx_timeout_task;
|
||||||
|
|
||||||
struct timer_list blink_timer;
|
struct timer_list blink_timer;
|
||||||
@@ -173,15 +172,15 @@ struct ixgb_adapter {
|
|||||||
uint64_t hw_csum_tx_error;
|
uint64_t hw_csum_tx_error;
|
||||||
uint32_t tx_int_delay;
|
uint32_t tx_int_delay;
|
||||||
uint32_t tx_timeout_count;
|
uint32_t tx_timeout_count;
|
||||||
boolean_t tx_int_delay_enable;
|
bool tx_int_delay_enable;
|
||||||
boolean_t detect_tx_hung;
|
bool detect_tx_hung;
|
||||||
|
|
||||||
/* RX */
|
/* RX */
|
||||||
struct ixgb_desc_ring rx_ring;
|
struct ixgb_desc_ring rx_ring;
|
||||||
uint64_t hw_csum_rx_error;
|
uint64_t hw_csum_rx_error;
|
||||||
uint64_t hw_csum_rx_good;
|
uint64_t hw_csum_rx_good;
|
||||||
uint32_t rx_int_delay;
|
uint32_t rx_int_delay;
|
||||||
boolean_t rx_csum;
|
bool rx_csum;
|
||||||
|
|
||||||
/* OS defined structs */
|
/* OS defined structs */
|
||||||
struct napi_struct napi;
|
struct napi_struct napi;
|
||||||
@@ -194,7 +193,16 @@ struct ixgb_adapter {
|
|||||||
u16 msg_enable;
|
u16 msg_enable;
|
||||||
struct ixgb_hw_stats stats;
|
struct ixgb_hw_stats stats;
|
||||||
uint32_t alloc_rx_buff_failed;
|
uint32_t alloc_rx_buff_failed;
|
||||||
boolean_t have_msi;
|
bool have_msi;
|
||||||
|
unsigned long flags;
|
||||||
|
};
|
||||||
|
|
||||||
|
enum ixgb_state_t {
|
||||||
|
/* TBD
|
||||||
|
__IXGB_TESTING,
|
||||||
|
__IXGB_RESETTING,
|
||||||
|
*/
|
||||||
|
__IXGB_DOWN
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Exported from other modules */
|
/* Exported from other modules */
|
||||||
@@ -203,4 +211,14 @@ extern void ixgb_set_ethtool_ops(struct net_device *netdev);
|
|||||||
extern char ixgb_driver_name[];
|
extern char ixgb_driver_name[];
|
||||||
extern const char ixgb_driver_version[];
|
extern const char ixgb_driver_version[];
|
||||||
|
|
||||||
|
extern int ixgb_up(struct ixgb_adapter *adapter);
|
||||||
|
extern void ixgb_down(struct ixgb_adapter *adapter, bool kill_watchdog);
|
||||||
|
extern void ixgb_reset(struct ixgb_adapter *adapter);
|
||||||
|
extern int ixgb_setup_rx_resources(struct ixgb_adapter *adapter);
|
||||||
|
extern int ixgb_setup_tx_resources(struct ixgb_adapter *adapter);
|
||||||
|
extern void ixgb_free_rx_resources(struct ixgb_adapter *adapter);
|
||||||
|
extern void ixgb_free_tx_resources(struct ixgb_adapter *adapter);
|
||||||
|
extern void ixgb_update_stats(struct ixgb_adapter *adapter);
|
||||||
|
|
||||||
|
|
||||||
#endif /* _IXGB_H_ */
|
#endif /* _IXGB_H_ */
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user