Commit 7cf75262 authored by David S. Miller's avatar David S. Miller

Merge branch 'upstream-davem' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6

parents c8f15686 b0e45390
...@@ -517,17 +517,7 @@ Additional Configurations ...@@ -517,17 +517,7 @@ Additional Configurations
NAPI NAPI
---- ----
NAPI (Rx polling mode) is supported in the e1000 driver. NAPI is enabled NAPI (Rx polling mode) is enabled in the e1000 driver.
or disabled based on the configuration of the kernel. To override
the default, use the following compile-time flags.
To enable NAPI, compile the driver module, passing in a configuration option:
make CFLAGS_EXTRA=-DE1000_NAPI install
To disable NAPI, compile the driver module, passing in a configuration option:
make CFLAGS_EXTRA=-DE1000_NO_NAPI install
See www.cyberus.ca/~hadi/usenix-paper.tgz for more information on NAPI. See www.cyberus.ca/~hadi/usenix-paper.tgz for more information on NAPI.
......
...@@ -3527,7 +3527,7 @@ S: Supported ...@@ -3527,7 +3527,7 @@ S: Supported
S390 NETWORK DRIVERS S390 NETWORK DRIVERS
P: Ursula Braun P: Ursula Braun
M: ubraun@linux.vnet.ibm.com M: ursula.braun@de.ibm.com
P: Frank Blaschka P: Frank Blaschka
M: blaschka@linux.vnet.ibm.com M: blaschka@linux.vnet.ibm.com
M: linux390@de.ibm.com M: linux390@de.ibm.com
...@@ -3547,7 +3547,7 @@ S: Supported ...@@ -3547,7 +3547,7 @@ S: Supported
S390 IUCV NETWORK LAYER S390 IUCV NETWORK LAYER
P: Ursula Braun P: Ursula Braun
M: ubraun@linux.vnet.ibm.com M: ursula.braun@de.ibm.com
M: linux390@de.ibm.com M: linux390@de.ibm.com
L: linux-s390@vger.kernel.org L: linux-s390@vger.kernel.org
W: http://www.ibm.com/developerworks/linux/linux390/ W: http://www.ibm.com/developerworks/linux/linux390/
......
...@@ -98,7 +98,6 @@ ...@@ -98,7 +98,6 @@
#include <linux/compiler.h> #include <linux/compiler.h>
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/ioport.h>
#include <linux/netdevice.h> #include <linux/netdevice.h>
#include <linux/etherdevice.h> #include <linux/etherdevice.h>
#include <linux/rtnetlink.h> #include <linux/rtnetlink.h>
...@@ -120,11 +119,6 @@ ...@@ -120,11 +119,6 @@
NETIF_MSG_LINK) NETIF_MSG_LINK)
/* enable PIO instead of MMIO, if CONFIG_8139TOO_PIO is selected */
#ifdef CONFIG_8139TOO_PIO
#define USE_IO_OPS 1
#endif
/* define to 1, 2 or 3 to enable copious debugging info */ /* define to 1, 2 or 3 to enable copious debugging info */
#define RTL8139_DEBUG 0 #define RTL8139_DEBUG 0
...@@ -156,6 +150,13 @@ ...@@ -156,6 +150,13 @@
static int media[MAX_UNITS] = {-1, -1, -1, -1, -1, -1, -1, -1}; static int media[MAX_UNITS] = {-1, -1, -1, -1, -1, -1, -1, -1};
static int full_duplex[MAX_UNITS] = {-1, -1, -1, -1, -1, -1, -1, -1}; static int full_duplex[MAX_UNITS] = {-1, -1, -1, -1, -1, -1, -1, -1};
/* Whether to use MMIO or PIO. Default to MMIO. */
#ifdef CONFIG_8139TOO_PIO
static int use_io = 1;
#else
static int use_io = 0;
#endif
/* Maximum number of multicast addresses to filter (vs. Rx-all-multicast). /* Maximum number of multicast addresses to filter (vs. Rx-all-multicast).
The RTL chips use a 64 element hash table based on the Ethernet CRC. */ The RTL chips use a 64 element hash table based on the Ethernet CRC. */
static int multicast_filter_limit = 32; static int multicast_filter_limit = 32;
...@@ -614,6 +615,8 @@ MODULE_DESCRIPTION ("RealTek RTL-8139 Fast Ethernet driver"); ...@@ -614,6 +615,8 @@ MODULE_DESCRIPTION ("RealTek RTL-8139 Fast Ethernet driver");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_VERSION(DRV_VERSION); MODULE_VERSION(DRV_VERSION);
module_param(use_io, int, 0);
MODULE_PARM_DESC(use_io, "Force use of I/O access mode. 0=MMIO 1=PIO");
module_param(multicast_filter_limit, int, 0); module_param(multicast_filter_limit, int, 0);
module_param_array(media, int, NULL, 0); module_param_array(media, int, NULL, 0);
module_param_array(full_duplex, int, NULL, 0); module_param_array(full_duplex, int, NULL, 0);
...@@ -709,13 +712,8 @@ static void __rtl8139_cleanup_dev (struct net_device *dev) ...@@ -709,13 +712,8 @@ static void __rtl8139_cleanup_dev (struct net_device *dev)
assert (tp->pci_dev != NULL); assert (tp->pci_dev != NULL);
pdev = tp->pci_dev; pdev = tp->pci_dev;
#ifdef USE_IO_OPS
if (tp->mmio_addr)
ioport_unmap (tp->mmio_addr);
#else
if (tp->mmio_addr) if (tp->mmio_addr)
pci_iounmap (pdev, tp->mmio_addr); pci_iounmap (pdev, tp->mmio_addr);
#endif /* USE_IO_OPS */
/* it's ok to call this even if we have no regions to free */ /* it's ok to call this even if we have no regions to free */
pci_release_regions (pdev); pci_release_regions (pdev);
...@@ -790,7 +788,8 @@ static int __devinit rtl8139_init_board (struct pci_dev *pdev, ...@@ -790,7 +788,8 @@ static int __devinit rtl8139_init_board (struct pci_dev *pdev,
DPRINTK("PIO region size == 0x%02X\n", pio_len); DPRINTK("PIO region size == 0x%02X\n", pio_len);
DPRINTK("MMIO region size == 0x%02lX\n", mmio_len); DPRINTK("MMIO region size == 0x%02lX\n", mmio_len);
#ifdef USE_IO_OPS retry:
if (use_io) {
/* make sure PCI base addr 0 is PIO */ /* make sure PCI base addr 0 is PIO */
if (!(pio_flags & IORESOURCE_IO)) { if (!(pio_flags & IORESOURCE_IO)) {
dev_err(&pdev->dev, "region #0 not a PIO resource, aborting\n"); dev_err(&pdev->dev, "region #0 not a PIO resource, aborting\n");
...@@ -803,7 +802,7 @@ static int __devinit rtl8139_init_board (struct pci_dev *pdev, ...@@ -803,7 +802,7 @@ static int __devinit rtl8139_init_board (struct pci_dev *pdev,
rc = -ENODEV; rc = -ENODEV;
goto err_out; goto err_out;
} }
#else } else {
/* make sure PCI base addr 1 is MMIO */ /* make sure PCI base addr 1 is MMIO */
if (!(mmio_flags & IORESOURCE_MEM)) { if (!(mmio_flags & IORESOURCE_MEM)) {
dev_err(&pdev->dev, "region #1 not an MMIO resource, aborting\n"); dev_err(&pdev->dev, "region #1 not an MMIO resource, aborting\n");
...@@ -815,7 +814,7 @@ static int __devinit rtl8139_init_board (struct pci_dev *pdev, ...@@ -815,7 +814,7 @@ static int __devinit rtl8139_init_board (struct pci_dev *pdev,
rc = -ENODEV; rc = -ENODEV;
goto err_out; goto err_out;
} }
#endif }
rc = pci_request_regions (pdev, DRV_NAME); rc = pci_request_regions (pdev, DRV_NAME);
if (rc) if (rc)
...@@ -825,28 +824,28 @@ static int __devinit rtl8139_init_board (struct pci_dev *pdev, ...@@ -825,28 +824,28 @@ static int __devinit rtl8139_init_board (struct pci_dev *pdev,
/* enable PCI bus-mastering */ /* enable PCI bus-mastering */
pci_set_master (pdev); pci_set_master (pdev);
#ifdef USE_IO_OPS if (use_io) {
ioaddr = ioport_map(pio_start, pio_len); ioaddr = pci_iomap(pdev, 0, 0);
if (!ioaddr) { if (!ioaddr) {
dev_err(&pdev->dev, "cannot map PIO, aborting\n"); dev_err(&pdev->dev, "cannot map PIO, aborting\n");
rc = -EIO; rc = -EIO;
goto err_out; goto err_out;
} }
dev->base_addr = pio_start; dev->base_addr = pio_start;
tp->mmio_addr = ioaddr;
tp->regs_len = pio_len; tp->regs_len = pio_len;
#else } else {
/* ioremap MMIO region */ /* ioremap MMIO region */
ioaddr = pci_iomap(pdev, 1, 0); ioaddr = pci_iomap(pdev, 1, 0);
if (ioaddr == NULL) { if (ioaddr == NULL) {
dev_err(&pdev->dev, "cannot remap MMIO, aborting\n"); dev_err(&pdev->dev, "cannot remap MMIO, trying PIO\n");
rc = -EIO; pci_release_regions(pdev);
goto err_out; use_io = 1;
goto retry;
} }
dev->base_addr = (long) ioaddr; dev->base_addr = (long) ioaddr;
tp->mmio_addr = ioaddr;
tp->regs_len = mmio_len; tp->regs_len = mmio_len;
#endif /* USE_IO_OPS */ }
tp->mmio_addr = ioaddr;
/* Bring old chips out of low-power mode. */ /* Bring old chips out of low-power mode. */
RTL_W8 (HltClk, 'R'); RTL_W8 (HltClk, 'R');
...@@ -952,6 +951,14 @@ static int __devinit rtl8139_init_one (struct pci_dev *pdev, ...@@ -952,6 +951,14 @@ static int __devinit rtl8139_init_one (struct pci_dev *pdev,
"Use the \"8139cp\" driver for improved performance and stability.\n"); "Use the \"8139cp\" driver for improved performance and stability.\n");
} }
if (pdev->vendor == PCI_VENDOR_ID_REALTEK &&
pdev->device == PCI_DEVICE_ID_REALTEK_8139 &&
pdev->subsystem_vendor == PCI_VENDOR_ID_ATHEROS &&
pdev->subsystem_device == PCI_DEVICE_ID_REALTEK_8139) {
printk(KERN_INFO "8139too: OQO Model 2 detected. Forcing PIO\n");
use_io = 1;
}
i = rtl8139_init_board (pdev, &dev); i = rtl8139_init_board (pdev, &dev);
if (i < 0) if (i < 0)
return i; return i;
...@@ -2381,20 +2388,24 @@ static void rtl8139_set_msglevel(struct net_device *dev, u32 datum) ...@@ -2381,20 +2388,24 @@ static void rtl8139_set_msglevel(struct net_device *dev, u32 datum)
np->msg_enable = datum; np->msg_enable = datum;
} }
/* TODO: we are too slack to do reg dumping for pio, for now */
#ifdef CONFIG_8139TOO_PIO
#define rtl8139_get_regs_len NULL
#define rtl8139_get_regs NULL
#else
static int rtl8139_get_regs_len(struct net_device *dev) static int rtl8139_get_regs_len(struct net_device *dev)
{ {
struct rtl8139_private *np = netdev_priv(dev); struct rtl8139_private *np;
/* TODO: we are too slack to do reg dumping for pio, for now */
if (use_io)
return 0;
np = netdev_priv(dev);
return np->regs_len; return np->regs_len;
} }
static void rtl8139_get_regs(struct net_device *dev, struct ethtool_regs *regs, void *regbuf) static void rtl8139_get_regs(struct net_device *dev, struct ethtool_regs *regs, void *regbuf)
{ {
struct rtl8139_private *np = netdev_priv(dev); struct rtl8139_private *np;
/* TODO: we are too slack to do reg dumping for pio, for now */
if (use_io)
return;
np = netdev_priv(dev);
regs->version = RTL_REGS_VER; regs->version = RTL_REGS_VER;
...@@ -2402,7 +2413,6 @@ static void rtl8139_get_regs(struct net_device *dev, struct ethtool_regs *regs, ...@@ -2402,7 +2413,6 @@ static void rtl8139_get_regs(struct net_device *dev, struct ethtool_regs *regs,
memcpy_fromio(regbuf, np->mmio_addr, regs->len); memcpy_fromio(regbuf, np->mmio_addr, regs->len);
spin_unlock_irq(&np->lock); spin_unlock_irq(&np->lock);
} }
#endif /* CONFIG_8139TOO_MMIO */
static int rtl8139_get_sset_count(struct net_device *dev, int sset) static int rtl8139_get_sset_count(struct net_device *dev, int sset)
{ {
......
...@@ -1926,20 +1926,6 @@ config E1000 ...@@ -1926,20 +1926,6 @@ config E1000
To compile this driver as a module, choose M here. The module To compile this driver as a module, choose M here. The module
will be called e1000. will be called e1000.
config E1000_NAPI
bool "Use Rx Polling (NAPI)"
depends on E1000
help
NAPI is a new driver API designed to reduce CPU and interrupt load
when the driver is receiving lots of packets from the card. It is
still somewhat experimental and thus not yet enabled by default.
If your estimated Rx load is 10kpps or more, or if the card will be
deployed on potentially unfriendly networks (e.g. in a firewall),
then say Y here.
If in doubt, say N.
config E1000_DISABLE_PACKET_SPLIT config E1000_DISABLE_PACKET_SPLIT
bool "Disable Packet Split for PCI express adapters" bool "Disable Packet Split for PCI express adapters"
depends on E1000 depends on E1000
...@@ -2304,6 +2290,17 @@ config ATL1 ...@@ -2304,6 +2290,17 @@ config ATL1
To compile this driver as a module, choose M here. The module To compile this driver as a module, choose M here. The module
will be called atl1. will be called atl1.
config ATL1E
tristate "Atheros L1E Gigabit Ethernet support (EXPERIMENTAL)"
depends on PCI && EXPERIMENTAL
select CRC32
select MII
help
This driver supports the Atheros L1E gigabit ethernet adapter.
To compile this driver as a module, choose M here. The module
will be called atl1e.
endif # NETDEV_1000 endif # NETDEV_1000
# #
......
...@@ -15,6 +15,7 @@ obj-$(CONFIG_EHEA) += ehea/ ...@@ -15,6 +15,7 @@ obj-$(CONFIG_EHEA) += ehea/
obj-$(CONFIG_CAN) += can/ obj-$(CONFIG_CAN) += can/
obj-$(CONFIG_BONDING) += bonding/ obj-$(CONFIG_BONDING) += bonding/
obj-$(CONFIG_ATL1) += atlx/ obj-$(CONFIG_ATL1) += atlx/
obj-$(CONFIG_ATL1E) += atl1e/
obj-$(CONFIG_GIANFAR) += gianfar_driver.o obj-$(CONFIG_GIANFAR) += gianfar_driver.o
obj-$(CONFIG_TEHUTI) += tehuti.o obj-$(CONFIG_TEHUTI) += tehuti.o
......
...@@ -820,7 +820,7 @@ static int at91ether_tx(struct sk_buff *skb, struct net_device *dev) ...@@ -820,7 +820,7 @@ static int at91ether_tx(struct sk_buff *skb, struct net_device *dev)
lp->skb = skb; lp->skb = skb;
lp->skb_length = skb->len; lp->skb_length = skb->len;
lp->skb_physaddr = dma_map_single(NULL, skb->data, skb->len, DMA_TO_DEVICE); lp->skb_physaddr = dma_map_single(NULL, skb->data, skb->len, DMA_TO_DEVICE);
lp->stats.tx_bytes += skb->len; dev->stats.tx_bytes += skb->len;
/* Set address of the data in the Transmit Address register */ /* Set address of the data in the Transmit Address register */
at91_emac_write(AT91_EMAC_TAR, lp->skb_physaddr); at91_emac_write(AT91_EMAC_TAR, lp->skb_physaddr);
...@@ -843,34 +843,33 @@ static int at91ether_tx(struct sk_buff *skb, struct net_device *dev) ...@@ -843,34 +843,33 @@ static int at91ether_tx(struct sk_buff *skb, struct net_device *dev)
*/ */
static struct net_device_stats *at91ether_stats(struct net_device *dev) static struct net_device_stats *at91ether_stats(struct net_device *dev)
{ {
struct at91_private *lp = netdev_priv(dev);
int ale, lenerr, seqe, lcol, ecol; int ale, lenerr, seqe, lcol, ecol;
if (netif_running(dev)) { if (netif_running(dev)) {
lp->stats.rx_packets += at91_emac_read(AT91_EMAC_OK); /* Good frames received */ dev->stats.rx_packets += at91_emac_read(AT91_EMAC_OK); /* Good frames received */
ale = at91_emac_read(AT91_EMAC_ALE); ale = at91_emac_read(AT91_EMAC_ALE);
lp->stats.rx_frame_errors += ale; /* Alignment errors */ dev->stats.rx_frame_errors += ale; /* Alignment errors */
lenerr = at91_emac_read(AT91_EMAC_ELR) + at91_emac_read(AT91_EMAC_USF); lenerr = at91_emac_read(AT91_EMAC_ELR) + at91_emac_read(AT91_EMAC_USF);
lp->stats.rx_length_errors += lenerr; /* Excessive Length or Undersize Frame error */ dev->stats.rx_length_errors += lenerr; /* Excessive Length or Undersize Frame error */
seqe = at91_emac_read(AT91_EMAC_SEQE); seqe = at91_emac_read(AT91_EMAC_SEQE);
lp->stats.rx_crc_errors += seqe; /* CRC error */ dev->stats.rx_crc_errors += seqe; /* CRC error */
lp->stats.rx_fifo_errors += at91_emac_read(AT91_EMAC_DRFC); /* Receive buffer not available */ dev->stats.rx_fifo_errors += at91_emac_read(AT91_EMAC_DRFC); /* Receive buffer not available */
lp->stats.rx_errors += (ale + lenerr + seqe dev->stats.rx_errors += (ale + lenerr + seqe
+ at91_emac_read(AT91_EMAC_CDE) + at91_emac_read(AT91_EMAC_RJB)); + at91_emac_read(AT91_EMAC_CDE) + at91_emac_read(AT91_EMAC_RJB));
lp->stats.tx_packets += at91_emac_read(AT91_EMAC_FRA); /* Frames successfully transmitted */ dev->stats.tx_packets += at91_emac_read(AT91_EMAC_FRA); /* Frames successfully transmitted */
lp->stats.tx_fifo_errors += at91_emac_read(AT91_EMAC_TUE); /* Transmit FIFO underruns */ dev->stats.tx_fifo_errors += at91_emac_read(AT91_EMAC_TUE); /* Transmit FIFO underruns */
lp->stats.tx_carrier_errors += at91_emac_read(AT91_EMAC_CSE); /* Carrier Sense errors */ dev->stats.tx_carrier_errors += at91_emac_read(AT91_EMAC_CSE); /* Carrier Sense errors */
lp->stats.tx_heartbeat_errors += at91_emac_read(AT91_EMAC_SQEE);/* Heartbeat error */ dev->stats.tx_heartbeat_errors += at91_emac_read(AT91_EMAC_SQEE);/* Heartbeat error */
lcol = at91_emac_read(AT91_EMAC_LCOL); lcol = at91_emac_read(AT91_EMAC_LCOL);
ecol = at91_emac_read(AT91_EMAC_ECOL); ecol = at91_emac_read(AT91_EMAC_ECOL);
lp->stats.tx_window_errors += lcol; /* Late collisions */ dev->stats.tx_window_errors += lcol; /* Late collisions */
lp->stats.tx_aborted_errors += ecol; /* 16 collisions */ dev->stats.tx_aborted_errors += ecol; /* 16 collisions */
lp->stats.collisions += (at91_emac_read(AT91_EMAC_SCOL) + at91_emac_read(AT91_EMAC_MCOL) + lcol + ecol); dev->stats.collisions += (at91_emac_read(AT91_EMAC_SCOL) + at91_emac_read(AT91_EMAC_MCOL) + lcol + ecol);
} }
return &lp->stats; return &dev->stats;
} }
/* /*
...@@ -896,16 +895,16 @@ static void at91ether_rx(struct net_device *dev) ...@@ -896,16 +895,16 @@ static void at91ether_rx(struct net_device *dev)
skb->protocol = eth_type_trans(skb, dev); skb->protocol = eth_type_trans(skb, dev);
dev->last_rx = jiffies; dev->last_rx = jiffies;
lp->stats.rx_bytes += pktlen; dev->stats.rx_bytes += pktlen;
netif_rx(skb); netif_rx(skb);
} }
else { else {
lp->stats.rx_dropped += 1; dev->stats.rx_dropped += 1;
printk(KERN_NOTICE "%s: Memory squeeze, dropping packet.\n", dev->name); printk(KERN_NOTICE "%s: Memory squeeze, dropping packet.\n", dev->name);
} }
if (dlist->descriptors[lp->rxBuffIndex].size & EMAC_MULTICAST) if (dlist->descriptors[lp->rxBuffIndex].size & EMAC_MULTICAST)
lp->stats.multicast++; dev->stats.multicast++;
dlist->descriptors[lp->rxBuffIndex].addr &= ~EMAC_DESC_DONE; /* reset ownership bit */ dlist->descriptors[lp->rxBuffIndex].addr &= ~EMAC_DESC_DONE; /* reset ownership bit */
if (lp->rxBuffIndex == MAX_RX_DESCR-1) /* wrap after last buffer */ if (lp->rxBuffIndex == MAX_RX_DESCR-1) /* wrap after last buffer */
...@@ -934,7 +933,7 @@ static irqreturn_t at91ether_interrupt(int irq, void *dev_id) ...@@ -934,7 +933,7 @@ static irqreturn_t at91ether_interrupt(int irq, void *dev_id)
if (intstatus & AT91_EMAC_TCOM) { /* Transmit complete */ if (intstatus & AT91_EMAC_TCOM) { /* Transmit complete */
/* The TCOM bit is set even if the transmission failed. */ /* The TCOM bit is set even if the transmission failed. */
if (intstatus & (AT91_EMAC_TUND | AT91_EMAC_RTRY)) if (intstatus & (AT91_EMAC_TUND | AT91_EMAC_RTRY))
lp->stats.tx_errors += 1; dev->stats.tx_errors += 1;
if (lp->skb) { if (lp->skb) {
dev_kfree_skb_irq(lp->skb); dev_kfree_skb_irq(lp->skb);
......
...@@ -84,7 +84,6 @@ struct recv_desc_bufs ...@@ -84,7 +84,6 @@ struct recv_desc_bufs
struct at91_private struct at91_private
{ {
struct net_device_stats stats;
struct mii_if_info mii; /* ethtool support */ struct mii_if_info mii; /* ethtool support */
struct at91_eth_data board_data; /* board-specific configuration */ struct at91_eth_data board_data; /* board-specific configuration */
struct clk *ether_clk; /* clock */ struct clk *ether_clk; /* clock */
......
obj-$(CONFIG_ATL1E) += atl1e.o
atl1e-objs += atl1e_main.o atl1e_hw.o atl1e_ethtool.o atl1e_param.o
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/*
* Copyright(c) 2007 Atheros Corporation. All rights reserved.
*
* Derived from Intel e1000 driver
* Copyright(c) 1999 - 2005 Intel Corporation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc., 59
* Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <linux/netdevice.h>
#include "atl1e.h"
/* This is the only thing that needs to be changed to adjust the
* maximum number of ports that the driver can manage.
*/
#define ATL1E_MAX_NIC 32
#define OPTION_UNSET -1
#define OPTION_DISABLED 0
#define OPTION_ENABLED 1
/* All parameters are treated the same, as an integer array of values.
* This macro just reduces the need to repeat the same declaration code
* over and over (plus this helps to avoid typo bugs).
*/
#define ATL1E_PARAM_INIT { [0 ... ATL1E_MAX_NIC] = OPTION_UNSET }
#define ATL1E_PARAM(x, desc) \
static int __devinitdata x[ATL1E_MAX_NIC + 1] = ATL1E_PARAM_INIT; \
static int num_##x; \
module_param_array_named(x, x, int, &num_##x, 0); \
MODULE_PARM_DESC(x, desc);
/* Transmit Memory count
*
* Valid Range: 64-2048
*
* Default Value: 128
*/
#define ATL1E_MIN_TX_DESC_CNT 32
#define ATL1E_MAX_TX_DESC_CNT 1020
#define ATL1E_DEFAULT_TX_DESC_CNT 128
ATL1E_PARAM(tx_desc_cnt, "Transmit description count");
/* Receive Memory Block Count
*
* Valid Range: 16-512
*
* Default Value: 128
*/
#define ATL1E_MIN_RX_MEM_SIZE 8 /* 8KB */
#define ATL1E_MAX_RX_MEM_SIZE 1024 /* 1MB */
#define ATL1E_DEFAULT_RX_MEM_SIZE 256 /* 128KB */
ATL1E_PARAM(rx_mem_size, "memory size of rx buffer(KB)");
/* User Specified MediaType Override
*
* Valid Range: 0-5
* - 0 - auto-negotiate at all supported speeds
* - 1 - only link at 100Mbps Full Duplex
* - 2 - only link at 100Mbps Half Duplex
* - 3 - only link at 10Mbps Full Duplex
* - 4 - only link at 10Mbps Half Duplex
* Default Value: 0
*/
ATL1E_PARAM(media_type, "MediaType Select");
/* Interrupt Moderate Timer in units of 2 us
*
* Valid Range: 10-65535
*
* Default Value: 45000(90ms)
*/
#define INT_MOD_DEFAULT_CNT 100 /* 200us */
#define INT_MOD_MAX_CNT 65000
#define INT_MOD_MIN_CNT 50
ATL1E_PARAM(int_mod_timer, "Interrupt Moderator Timer");
#define AUTONEG_ADV_DEFAULT 0x2F
#define AUTONEG_ADV_MASK 0x2F
#define FLOW_CONTROL_DEFAULT FLOW_CONTROL_FULL
#define FLASH_VENDOR_DEFAULT 0
#define FLASH_VENDOR_MIN 0
#define FLASH_VENDOR_MAX 2
struct atl1e_option {
enum { enable_option, range_option, list_option } type;
char *name;
char *err;
int def;
union {
struct { /* range_option info */
int min;
int max;
} r;
struct { /* list_option info */
int nr;
struct atl1e_opt_list { int i; char *str; } *p;
} l;
} arg;
};
static int __devinit atl1e_validate_option(int *value, struct atl1e_option *opt, struct pci_dev *pdev)
{
if (*value == OPTION_UNSET) {
*value = opt->def;
return 0;
}
switch (opt->type) {
case enable_option:
switch (*value) {
case OPTION_ENABLED:
dev_info(&pdev->dev, "%s Enabled\n", opt->name);
return 0;
case OPTION_DISABLED:
dev_info(&pdev->dev, "%s Disabled\n", opt->name);
return 0;
}
break;
case range_option:
if (*value >= opt->arg.r.min && *value <= opt->arg.r.max) {
dev_info(&pdev->dev, "%s set to %i\n", opt->name, *value);
return 0;
}
break;
case list_option:{
int i;
struct atl1e_opt_list *ent;
for (i = 0; i < opt->arg.l.nr; i++) {
ent = &opt->arg.l.p[i];
if (*value == ent->i) {
if (ent->str[0] != '\0')
dev_info(&pdev->dev, "%s\n",
ent->str);
return 0;
}
}
break;
}
default:
BUG();
}
dev_info(&pdev->dev, "Invalid %s specified (%i) %s\n",
opt->name, *value, opt->err);
*value = opt->def;
return -1;
}
/*
* atl1e_check_options - Range Checking for Command Line Parameters
* @adapter: board private structure
*
* This routine checks all command line parameters for valid user
* input. If an invalid value is given, or if no user specified
* value exists, a default value is used. The final value is stored
* in a variable in the adapter structure.
*/
void __devinit atl1e_check_options(struct atl1e_adapter *adapter)
{
struct pci_dev *pdev = adapter->pdev;
int bd = adapter->bd_number;
if (bd >= ATL1E_MAX_NIC) {
dev_notice(&pdev->dev, "no configuration for board #%i\n", bd);
dev_notice(&pdev->dev, "Using defaults for all values\n");
}
{ /* Transmit Ring Size */
struct atl1e_option opt = {
.type = range_option,
.name = "Transmit Ddescription Count",
.err = "using default of "
__MODULE_STRING(ATL1E_DEFAULT_TX_DESC_CNT),
.def = ATL1E_DEFAULT_TX_DESC_CNT,
.arg = { .r = { .min = ATL1E_MIN_TX_DESC_CNT,
.max = ATL1E_MAX_TX_DESC_CNT} }
};
int val;
if (num_tx_desc_cnt > bd) {
val = tx_desc_cnt[bd];
atl1e_validate_option(&val, &opt, pdev);
adapter->tx_ring.count = (u16) val & 0xFFFC;
} else
adapter->tx_ring.count = (u16)opt.def;
}
{ /* Receive Memory Block Count */
struct atl1e_option opt = {
.type = range_option,
.name = "Memory size of rx buffer(KB)",
.err = "using default of "
__MODULE_STRING(ATL1E_DEFAULT_RX_MEM_SIZE),
.def = ATL1E_DEFAULT_RX_MEM_SIZE,
.arg = { .r = { .min = ATL1E_MIN_RX_MEM_SIZE,
.max = ATL1E_MAX_RX_MEM_SIZE} }
};
int val;
if (num_rx_mem_size > bd) {
val = rx_mem_size[bd];
atl1e_validate_option(&val, &opt, pdev);
adapter->rx_ring.page_size = (u32)val * 1024;
} else {
adapter->rx_ring.page_size = (u32)opt.def * 1024;
}
}
{ /* Interrupt Moderate Timer */
struct atl1e_option opt = {
.type = range_option,
.name = "Interrupt Moderate Timer",
.err = "using default of "
__MODULE_STRING(INT_MOD_DEFAULT_CNT),
.def = INT_MOD_DEFAULT_CNT,
.arg = { .r = { .min = INT_MOD_MIN_CNT,
.max = INT_MOD_MAX_CNT} }
} ;
int val;
if (num_int_mod_timer > bd) {
val = int_mod_timer[bd];
atl1e_validate_option(&val, &opt, pdev);
adapter->hw.imt = (u16) val;
} else
adapter->hw.imt = (u16)(opt.def);
}
{ /* MediaType */
struct atl1e_option opt = {
.type = range_option,
.name = "Speed/Duplex Selection",
.err = "using default of "
__MODULE_STRING(MEDIA_TYPE_AUTO_SENSOR),
.def = MEDIA_TYPE_AUTO_SENSOR,
.arg = { .r = { .min = MEDIA_TYPE_AUTO_SENSOR,
.max = MEDIA_TYPE_10M_HALF} }
} ;
int val;
if (num_media_type > bd) {
val = media_type[bd];
atl1e_validate_option(&val, &opt, pdev);
adapter->hw.media_type = (u16) val;
} else
adapter->hw.media_type = (u16)(opt.def);
}
}
...@@ -888,19 +888,22 @@ dm9000_rx(struct net_device *dev) ...@@ -888,19 +888,22 @@ dm9000_rx(struct net_device *dev)
dev_dbg(db->dev, "RST: RX Len:%x\n", RxLen); dev_dbg(db->dev, "RST: RX Len:%x\n", RxLen);
} }
if (rxhdr.RxStatus & 0xbf) { /* rxhdr.RxStatus is identical to RSR register. */
if (rxhdr.RxStatus & (RSR_FOE | RSR_CE | RSR_AE |
RSR_PLE | RSR_RWTO |
RSR_LCS | RSR_RF)) {
GoodPacket = false; GoodPacket = false;
if (rxhdr.RxStatus & 0x01) { if (rxhdr.RxStatus & RSR_FOE) {
if (netif_msg_rx_err(db)) if (netif_msg_rx_err(db))
dev_dbg(db->dev, "fifo error\n"); dev_dbg(db->dev, "fifo error\n");
dev->stats.rx_fifo_errors++; dev->stats.rx_fifo_errors++;
} }
if (rxhdr.RxStatus & 0x02) { if (rxhdr.RxStatus & RSR_CE) {
if (netif_msg_rx_err(db)) if (netif_msg_rx_err(db))
dev_dbg(db->dev, "crc error\n"); dev_dbg(db->dev, "crc error\n");
dev->stats.rx_crc_errors++; dev->stats.rx_crc_errors++;
} }
if (rxhdr.RxStatus & 0x80) { if (rxhdr.RxStatus & RSR_RF) {
if (netif_msg_rx_err(db)) if (netif_msg_rx_err(db))
dev_dbg(db->dev, "length error\n"); dev_dbg(db->dev, "length error\n");
dev->stats.rx_length_errors++; dev->stats.rx_length_errors++;
...@@ -1067,7 +1070,7 @@ dm9000_phy_read(struct net_device *dev, int phy_reg_unused, int reg) ...@@ -1067,7 +1070,7 @@ dm9000_phy_read(struct net_device *dev, int phy_reg_unused, int reg)
/* Fill the phyxcer register into REG_0C */ /* Fill the phyxcer register into REG_0C */
iow(db, DM9000_EPAR, DM9000_PHY | reg); iow(db, DM9000_EPAR, DM9000_PHY | reg);
iow(db, DM9000_EPCR, 0xc); /* Issue phyxcer read command */ iow(db, DM9000_EPCR, EPCR_ERPRR | EPCR_EPOS); /* Issue phyxcer read command */
writeb(reg_save, db->io_addr); writeb(reg_save, db->io_addr);
spin_unlock_irqrestore(&db->lock,flags); spin_unlock_irqrestore(&db->lock,flags);
...@@ -1118,7 +1121,7 @@ dm9000_phy_write(struct net_device *dev, ...@@ -1118,7 +1121,7 @@ dm9000_phy_write(struct net_device *dev,
iow(db, DM9000_EPDRL, value); iow(db, DM9000_EPDRL, value);
iow(db, DM9000_EPDRH, value >> 8); iow(db, DM9000_EPDRH, value >> 8);
iow(db, DM9000_EPCR, 0xa); /* Issue phyxcer write command */ iow(db, DM9000_EPCR, EPCR_EPOS | EPCR_ERPRW); /* Issue phyxcer write command */
writeb(reg_save, db->io_addr); writeb(reg_save, db->io_addr);
spin_unlock_irqrestore(&db->lock, flags); spin_unlock_irqrestore(&db->lock, flags);
......
...@@ -90,10 +90,13 @@ struct e1000_adapter; ...@@ -90,10 +90,13 @@ struct e1000_adapter;
#define E1000_ERR(args...) printk(KERN_ERR "e1000: " args) #define E1000_ERR(args...) printk(KERN_ERR "e1000: " args)
#define PFX "e1000: " #define PFX "e1000: "
#define DPRINTK(nlevel, klevel, fmt, args...) \ #define DPRINTK(nlevel, klevel, fmt, args...) \
(void)((NETIF_MSG_##nlevel & adapter->msg_enable) && \ do { \
printk(KERN_##klevel PFX "%s: %s: " fmt, adapter->netdev->name, \ if (NETIF_MSG_##nlevel & adapter->msg_enable) \
__FUNCTION__ , ## args)) printk(KERN_##klevel PFX "%s: %s: " fmt, \
adapter->netdev->name, __func__, ##args); \
} while (0)
#define E1000_MAX_INTR 10 #define E1000_MAX_INTR 10
...@@ -151,9 +154,9 @@ struct e1000_adapter; ...@@ -151,9 +154,9 @@ struct e1000_adapter;
#define E1000_MASTER_SLAVE e1000_ms_hw_default #define E1000_MASTER_SLAVE e1000_ms_hw_default
#endif #endif
#define E1000_MNG_VLAN_NONE -1 #define E1000_MNG_VLAN_NONE (-1)
/* Number of packet split data buffers (not including the header buffer) */ /* Number of packet split data buffers (not including the header buffer) */
#define PS_PAGE_BUFFERS MAX_PS_BUFFERS-1 #define PS_PAGE_BUFFERS (MAX_PS_BUFFERS - 1)
/* wrapper around a pointer to a socket buffer, /* wrapper around a pointer to a socket buffer,
* so a DMA handle can be stored along with the buffer */ * so a DMA handle can be stored along with the buffer */
...@@ -165,9 +168,13 @@ struct e1000_buffer { ...@@ -165,9 +168,13 @@ struct e1000_buffer {
u16 next_to_watch; u16 next_to_watch;
}; };
struct e1000_ps_page {
struct page *ps_page[PS_PAGE_BUFFERS];
};
struct e1000_ps_page { struct page *ps_page[PS_PAGE_BUFFERS]; }; struct e1000_ps_page_dma {
struct e1000_ps_page_dma { u64 ps_page_dma[PS_PAGE_BUFFERS]; }; u64 ps_page_dma[PS_PAGE_BUFFERS];
};
struct e1000_tx_ring { struct e1000_tx_ring {
/* pointer to the descriptor ring memory */ /* pointer to the descriptor ring memory */
...@@ -218,8 +225,8 @@ struct e1000_rx_ring { ...@@ -218,8 +225,8 @@ struct e1000_rx_ring {
}; };
#define E1000_DESC_UNUSED(R) \ #define E1000_DESC_UNUSED(R) \
((((R)->next_to_clean > (R)->next_to_use) ? 0 : (R)->count) + \ ((((R)->next_to_clean > (R)->next_to_use) \
(R)->next_to_clean - (R)->next_to_use - 1) ? 0 : (R)->count) + (R)->next_to_clean - (R)->next_to_use - 1)
#define E1000_RX_DESC_PS(R, i) \ #define E1000_RX_DESC_PS(R, i) \
(&(((union e1000_rx_desc_packet_split *)((R).desc))[i])) (&(((union e1000_rx_desc_packet_split *)((R).desc))[i]))
...@@ -246,9 +253,7 @@ struct e1000_adapter { ...@@ -246,9 +253,7 @@ struct e1000_adapter {
u16 link_speed; u16 link_speed;
u16 link_duplex; u16 link_duplex;
spinlock_t stats_lock; spinlock_t stats_lock;
#ifdef CONFIG_E1000_NAPI
spinlock_t tx_queue_lock; spinlock_t tx_queue_lock;
#endif
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;
...@@ -286,22 +291,16 @@ struct e1000_adapter { ...@@ -286,22 +291,16 @@ struct e1000_adapter {
bool detect_tx_hung; bool detect_tx_hung;
/* RX */ /* RX */
#ifdef CONFIG_E1000_NAPI bool (*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 void (*alloc_rx_buf)(struct e1000_adapter *adapter,
bool (*clean_rx) (struct e1000_adapter *adapter,
struct e1000_rx_ring *rx_ring);
#endif
void (*alloc_rx_buf) (struct e1000_adapter *adapter,
struct e1000_rx_ring *rx_ring, struct e1000_rx_ring *rx_ring,
int cleaned_count); int cleaned_count);
struct e1000_rx_ring *rx_ring; /* One per active queue */ struct e1000_rx_ring *rx_ring; /* One per active queue */
#ifdef CONFIG_E1000_NAPI
struct napi_struct napi; struct napi_struct napi;
struct net_device *polling_netdev; /* One per active queue */ struct net_device *polling_netdev; /* One per active queue */
#endif
int num_tx_queues; int num_tx_queues;
int num_rx_queues; int num_rx_queues;
...@@ -317,7 +316,6 @@ struct e1000_adapter { ...@@ -317,7 +316,6 @@ struct e1000_adapter {
u64 gorcl_old; u64 gorcl_old;
u16 rx_ps_bsize0; u16 rx_ps_bsize0;
/* OS defined structs */ /* OS defined structs */
struct net_device *netdev; struct net_device *netdev;
struct pci_dev *pdev; struct pci_dev *pdev;
...@@ -342,6 +340,10 @@ struct e1000_adapter { ...@@ -342,6 +340,10 @@ struct e1000_adapter {
bool quad_port_a; bool quad_port_a;
unsigned long flags; unsigned long flags;
u32 eeprom_wol; u32 eeprom_wol;
/* for ioport free */
int bars;
int need_ioport;
}; };
enum e1000_state_t { enum e1000_state_t {
...@@ -353,9 +355,18 @@ enum e1000_state_t { ...@@ -353,9 +355,18 @@ enum e1000_state_t {
extern char e1000_driver_name[]; extern char e1000_driver_name[];
extern const char e1000_driver_version[]; extern const char e1000_driver_version[];
extern int e1000_up(struct e1000_adapter *adapter);
extern void e1000_down(struct e1000_adapter *adapter);
extern void e1000_reinit_locked(struct e1000_adapter *adapter);
extern void e1000_reset(struct e1000_adapter *adapter);
extern int e1000_set_spd_dplx(struct e1000_adapter *adapter, u16 spddplx);
extern int e1000_setup_all_rx_resources(struct e1000_adapter *adapter);
extern int e1000_setup_all_tx_resources(struct e1000_adapter *adapter);
extern void e1000_free_all_rx_resources(struct e1000_adapter *adapter);
extern void e1000_free_all_tx_resources(struct e1000_adapter *adapter);
extern void e1000_update_stats(struct e1000_adapter *adapter);
extern void e1000_power_up_phy(struct e1000_adapter *); extern void e1000_power_up_phy(struct e1000_adapter *);
extern void e1000_set_ethtool_ops(struct net_device *netdev); extern void e1000_set_ethtool_ops(struct net_device *netdev);
extern void e1000_check_options(struct e1000_adapter *adapter); extern void e1000_check_options(struct e1000_adapter *adapter);
#endif /* _E1000_H_ */ #endif /* _E1000_H_ */
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -55,13 +55,13 @@ ...@@ -55,13 +55,13 @@
#define DEBUGOUT7 DEBUGOUT3 #define DEBUGOUT7 DEBUGOUT3
#define E1000_WRITE_REG(a, reg, value) ( \ #define er32(reg) \
writel((value), ((a)->hw_addr + \ (readl(hw->hw_addr + ((hw->mac_type >= e1000_82543) \
(((a)->mac_type >= e1000_82543) ? E1000_##reg : E1000_82542_##reg)))) ? E1000_##reg : E1000_82542_##reg)))
#define E1000_READ_REG(a, reg) ( \ #define ew32(reg, value) \
readl((a)->hw_addr + \ (writel((value), (hw->hw_addr + ((hw->mac_type >= e1000_82543) \
(((a)->mac_type >= e1000_82543) ? E1000_##reg : E1000_82542_##reg))) ? E1000_##reg : E1000_82542_##reg))))
#define E1000_WRITE_REG_ARRAY(a, reg, offset, value) ( \ #define E1000_WRITE_REG_ARRAY(a, reg, offset, value) ( \
writel((value), ((a)->hw_addr + \ writel((value), ((a)->hw_addr + \
...@@ -96,7 +96,7 @@ ...@@ -96,7 +96,7 @@
(((a)->mac_type >= e1000_82543) ? E1000_##reg : E1000_82542_##reg) + \ (((a)->mac_type >= e1000_82543) ? E1000_##reg : E1000_82542_##reg) + \
(offset))) (offset)))
#define E1000_WRITE_FLUSH(a) E1000_READ_REG(a, STATUS) #define E1000_WRITE_FLUSH() er32(STATUS)
#define E1000_WRITE_ICH_FLASH_REG(a, reg, value) ( \ #define E1000_WRITE_ICH_FLASH_REG(a, reg, value) ( \
writel((value), ((a)->flash_address + reg))) writel((value), ((a)->flash_address + reg)))
......
...@@ -213,8 +213,7 @@ struct e1000_option { ...@@ -213,8 +213,7 @@ 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)
{ {
...@@ -278,8 +277,7 @@ static void e1000_check_copper_options(struct e1000_adapter *adapter); ...@@ -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) ...@@ -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) ...@@ -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;
......
...@@ -262,7 +262,7 @@ static int __init hpp_probe1(struct net_device *dev, int ioaddr) ...@@ -262,7 +262,7 @@ static int __init hpp_probe1(struct net_device *dev, int ioaddr)
} }
outw(Perf_Page, ioaddr + HP_PAGING); outw(Perf_Page, ioaddr + HP_PAGING);
NS8390_init(dev, 0); NS8390p_init(dev, 0);
/* Leave the 8390 and HP chip reset. */ /* Leave the 8390 and HP chip reset. */
outw(inw(ioaddr + HPP_OPTION) & ~EnableIRQ, ioaddr + HPP_OPTION); outw(inw(ioaddr + HPP_OPTION) & ~EnableIRQ, ioaddr + HPP_OPTION);
......
...@@ -389,7 +389,7 @@ static void __init ...@@ -389,7 +389,7 @@ static void __init
hp_init_card(struct net_device *dev) hp_init_card(struct net_device *dev)
{ {
int irq = dev->irq; int irq = dev->irq;
NS8390_init(dev, 0); NS8390p_init(dev, 0);
outb_p(irqmap[irq&0x0f] | HP_RUN, outb_p(irqmap[irq&0x0f] | HP_RUN,
dev->base_addr - NIC_OFFSET + HP_CONFIGURE); dev->base_addr - NIC_OFFSET + HP_CONFIGURE);
return; return;
......
...@@ -385,7 +385,7 @@ static void igb_configure_msix(struct igb_adapter *adapter) ...@@ -385,7 +385,7 @@ static void igb_configure_msix(struct igb_adapter *adapter)
for (i = 0; i < adapter->num_rx_queues; i++) { for (i = 0; i < adapter->num_rx_queues; i++) {
struct igb_ring *rx_ring = &adapter->rx_ring[i]; struct igb_ring *rx_ring = &adapter->rx_ring[i];
rx_ring->buddy = 0; rx_ring->buddy = NULL;
igb_assign_vector(adapter, i, IGB_N0_QUEUE, vector++); igb_assign_vector(adapter, i, IGB_N0_QUEUE, vector++);
adapter->eims_enable_mask |= rx_ring->eims_value; adapter->eims_enable_mask |= rx_ring->eims_value;
if (rx_ring->itr_val) if (rx_ring->itr_val)
......
...@@ -70,8 +70,6 @@ static struct pci_device_id ixgbe_pci_tbl[] = { ...@@ -70,8 +70,6 @@ static struct pci_device_id ixgbe_pci_tbl[] = {
board_82598 }, board_82598 },
{PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82598AF_SINGLE_PORT), {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82598AF_SINGLE_PORT),
board_82598 }, board_82598 },
{PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82598AT_DUAL_PORT),
board_82598 },
{PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82598EB_CX4), {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82598EB_CX4),
board_82598 }, board_82598 },
......
...@@ -287,7 +287,7 @@ int meth_reset(struct net_device *dev) ...@@ -287,7 +287,7 @@ int meth_reset(struct net_device *dev)
/* Initial mode: 10 | Half-duplex | Accept normal packets */ /* Initial mode: 10 | Half-duplex | Accept normal packets */
priv->mac_ctrl = METH_ACCEPT_MCAST | METH_DEFAULT_IPG; priv->mac_ctrl = METH_ACCEPT_MCAST | METH_DEFAULT_IPG;
if (dev->flags | IFF_PROMISC) if (dev->flags & IFF_PROMISC)
priv->mac_ctrl |= METH_PROMISC; priv->mac_ctrl |= METH_PROMISC;
mace->eth.mac_ctrl = priv->mac_ctrl; mace->eth.mac_ctrl = priv->mac_ctrl;
......
...@@ -2112,7 +2112,7 @@ static void mv643xx_eth_netpoll(struct net_device *dev) ...@@ -2112,7 +2112,7 @@ static void mv643xx_eth_netpoll(struct net_device *dev)
mv643xx_eth_irq(dev->irq, dev); mv643xx_eth_irq(dev->irq, dev);
wrl(mp, INT_MASK(mp->port_num), INT_TX_END | INT_RX | INT_CAUSE_EXT); wrl(mp, INT_MASK(mp->port_num), INT_TX_END | INT_RX | INT_EXT);
} }
#endif #endif
......
...@@ -125,7 +125,6 @@ struct myri10ge_cmd { ...@@ -125,7 +125,6 @@ struct myri10ge_cmd {
struct myri10ge_rx_buf { struct myri10ge_rx_buf {
struct mcp_kreq_ether_recv __iomem *lanai; /* lanai ptr for recv ring */ struct mcp_kreq_ether_recv __iomem *lanai; /* lanai ptr for recv ring */
u8 __iomem *wc_fifo; /* w/c rx dma addr fifo address */
struct mcp_kreq_ether_recv *shadow; /* host shadow of recv ring */ struct mcp_kreq_ether_recv *shadow; /* host shadow of recv ring */
struct myri10ge_rx_buffer_state *info; struct myri10ge_rx_buffer_state *info;
struct page *page; struct page *page;
...@@ -140,7 +139,6 @@ struct myri10ge_rx_buf { ...@@ -140,7 +139,6 @@ struct myri10ge_rx_buf {
struct myri10ge_tx_buf { struct myri10ge_tx_buf {
struct mcp_kreq_ether_send __iomem *lanai; /* lanai ptr for sendq */ struct mcp_kreq_ether_send __iomem *lanai; /* lanai ptr for sendq */
u8 __iomem *wc_fifo; /* w/c send fifo address */
struct mcp_kreq_ether_send *req_list; /* host shadow of sendq */ struct mcp_kreq_ether_send *req_list; /* host shadow of sendq */
char *req_bytes; char *req_bytes;
struct myri10ge_tx_buffer_state *info; struct myri10ge_tx_buffer_state *info;
...@@ -332,10 +330,6 @@ MODULE_PARM_DESC(myri10ge_fill_thresh, "Number of empty rx slots allowed"); ...@@ -332,10 +330,6 @@ MODULE_PARM_DESC(myri10ge_fill_thresh, "Number of empty rx slots allowed");
static int myri10ge_reset_recover = 1; static int myri10ge_reset_recover = 1;
static int myri10ge_wcfifo = 0;
module_param(myri10ge_wcfifo, int, S_IRUGO);
MODULE_PARM_DESC(myri10ge_wcfifo, "Enable WC Fifo when WC is enabled");
static int myri10ge_max_slices = 1; static int myri10ge_max_slices = 1;
module_param(myri10ge_max_slices, int, S_IRUGO); module_param(myri10ge_max_slices, int, S_IRUGO);
MODULE_PARM_DESC(myri10ge_max_slices, "Max tx/rx queues"); MODULE_PARM_DESC(myri10ge_max_slices, "Max tx/rx queues");
...@@ -1218,14 +1212,8 @@ myri10ge_alloc_rx_pages(struct myri10ge_priv *mgp, struct myri10ge_rx_buf *rx, ...@@ -1218,14 +1212,8 @@ myri10ge_alloc_rx_pages(struct myri10ge_priv *mgp, struct myri10ge_rx_buf *rx,
/* copy 8 descriptors to the firmware at a time */ /* copy 8 descriptors to the firmware at a time */
if ((idx & 7) == 7) { if ((idx & 7) == 7) {
if (rx->wc_fifo == NULL)
myri10ge_submit_8rx(&rx->lanai[idx - 7], myri10ge_submit_8rx(&rx->lanai[idx - 7],
&rx->shadow[idx - 7]); &rx->shadow[idx - 7]);
else {
mb();
myri10ge_pio_copy(rx->wc_fifo,
&rx->shadow[idx - 7], 64);
}
} }
} }
} }
...@@ -2229,18 +2217,6 @@ static int myri10ge_get_txrx(struct myri10ge_priv *mgp, int slice) ...@@ -2229,18 +2217,6 @@ static int myri10ge_get_txrx(struct myri10ge_priv *mgp, int slice)
ss->rx_big.lanai = (struct mcp_kreq_ether_recv __iomem *) ss->rx_big.lanai = (struct mcp_kreq_ether_recv __iomem *)
(mgp->sram + cmd.data0); (mgp->sram + cmd.data0);
if (myri10ge_wcfifo && mgp->wc_enabled) {
ss->tx.wc_fifo = (u8 __iomem *)
mgp->sram + MXGEFW_ETH_SEND_4 + 64 * slice;
ss->rx_small.wc_fifo = (u8 __iomem *)
mgp->sram + MXGEFW_ETH_RECV_SMALL + 64 * slice;
ss->rx_big.wc_fifo = (u8 __iomem *)
mgp->sram + MXGEFW_ETH_RECV_BIG + 64 * slice;
} else {
ss->tx.wc_fifo = NULL;
ss->rx_small.wc_fifo = NULL;
ss->rx_big.wc_fifo = NULL;
}
return status; return status;
} }
...@@ -2573,27 +2549,6 @@ myri10ge_submit_req(struct myri10ge_tx_buf *tx, struct mcp_kreq_ether_send *src, ...@@ -2573,27 +2549,6 @@ myri10ge_submit_req(struct myri10ge_tx_buf *tx, struct mcp_kreq_ether_send *src,
mb(); mb();
} }
static inline void
myri10ge_submit_req_wc(struct myri10ge_tx_buf *tx,
struct mcp_kreq_ether_send *src, int cnt)
{
tx->req += cnt;
mb();
while (cnt >= 4) {
myri10ge_pio_copy(tx->wc_fifo, src, 64);
mb();
src += 4;
cnt -= 4;
}
if (cnt > 0) {
/* pad it to 64 bytes. The src is 64 bytes bigger than it
* needs to be so that we don't overrun it */
myri10ge_pio_copy(tx->wc_fifo + MXGEFW_ETH_SEND_OFFSET(cnt),
src, 64);
mb();
}
}
/* /*
* Transmit a packet. We need to split the packet so that a single * Transmit a packet. We need to split the packet so that a single
* segment does not cross myri10ge->tx_boundary, so this makes segment * segment does not cross myri10ge->tx_boundary, so this makes segment
...@@ -2830,10 +2785,7 @@ static int myri10ge_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -2830,10 +2785,7 @@ static int myri10ge_xmit(struct sk_buff *skb, struct net_device *dev)
MXGEFW_FLAGS_FIRST))); MXGEFW_FLAGS_FIRST)));
idx = ((count - 1) + tx->req) & tx->mask; idx = ((count - 1) + tx->req) & tx->mask;
tx->info[idx].last = 1; tx->info[idx].last = 1;
if (tx->wc_fifo == NULL)
myri10ge_submit_req(tx, tx->req_list, count); myri10ge_submit_req(tx, tx->req_list, count);
else
myri10ge_submit_req_wc(tx, tx->req_list, count);
tx->pkt_start++; tx->pkt_start++;
if ((avail - count) < MXGEFW_MAX_SEND_DESC) { if ((avail - count) < MXGEFW_MAX_SEND_DESC) {
tx->stop_queue++; tx->stop_queue++;
...@@ -3768,14 +3720,14 @@ static int myri10ge_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -3768,14 +3720,14 @@ static int myri10ge_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
if (mgp->sram_size > mgp->board_span) { if (mgp->sram_size > mgp->board_span) {
dev_err(&pdev->dev, "board span %ld bytes too small\n", dev_err(&pdev->dev, "board span %ld bytes too small\n",
mgp->board_span); mgp->board_span);
goto abort_with_wc; goto abort_with_mtrr;
} }
mgp->sram = ioremap(mgp->iomem_base, mgp->board_span); mgp->sram = ioremap_wc(mgp->iomem_base, mgp->board_span);
if (mgp->sram == NULL) { if (mgp->sram == NULL) {
dev_err(&pdev->dev, "ioremap failed for %ld bytes at 0x%lx\n", dev_err(&pdev->dev, "ioremap failed for %ld bytes at 0x%lx\n",
mgp->board_span, mgp->iomem_base); mgp->board_span, mgp->iomem_base);
status = -ENXIO; status = -ENXIO;
goto abort_with_wc; goto abort_with_mtrr;
} }
memcpy_fromio(mgp->eeprom_strings, memcpy_fromio(mgp->eeprom_strings,
mgp->sram + mgp->sram_size - MYRI10GE_EEPROM_STRINGS_SIZE, mgp->sram + mgp->sram_size - MYRI10GE_EEPROM_STRINGS_SIZE,
...@@ -3876,7 +3828,7 @@ static int myri10ge_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -3876,7 +3828,7 @@ static int myri10ge_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
abort_with_ioremap: abort_with_ioremap:
iounmap(mgp->sram); iounmap(mgp->sram);
abort_with_wc: abort_with_mtrr:
#ifdef CONFIG_MTRR #ifdef CONFIG_MTRR
if (mgp->mtrr >= 0) if (mgp->mtrr >= 0)
mtrr_del(mgp->mtrr, mgp->iomem_base, mgp->board_span); mtrr_del(mgp->mtrr, mgp->iomem_base, mgp->board_span);
......
...@@ -355,7 +355,7 @@ static int __init ne_probe1(struct net_device *dev, unsigned long ioaddr) ...@@ -355,7 +355,7 @@ static int __init ne_probe1(struct net_device *dev, unsigned long ioaddr)
} }
/* Read the 16 bytes of station address PROM. /* Read the 16 bytes of station address PROM.
We must first initialize registers, similar to NS8390_init(eifdev, 0). We must first initialize registers, similar to NS8390p_init(eifdev, 0).
We can't reliably read the SAPROM address without this. We can't reliably read the SAPROM address without this.
(I learned the hard way!). */ (I learned the hard way!). */
{ {
......
...@@ -404,7 +404,7 @@ static int __init ne2_probe1(struct net_device *dev, int slot) ...@@ -404,7 +404,7 @@ static int __init ne2_probe1(struct net_device *dev, int slot)
/* Read the 16 bytes of station address PROM. /* Read the 16 bytes of station address PROM.
We must first initialize registers, similar to We must first initialize registers, similar to
NS8390_init(eifdev, 0). NS8390p_init(eifdev, 0).
We can't reliably read the SAPROM address without this. We can't reliably read the SAPROM address without this.
(I learned the hard way!). */ (I learned the hard way!). */
{ {
......
...@@ -32,4 +32,4 @@ ...@@ -32,4 +32,4 @@
obj-$(CONFIG_NETXEN_NIC) := netxen_nic.o obj-$(CONFIG_NETXEN_NIC) := netxen_nic.o
netxen_nic-y := netxen_nic_hw.o netxen_nic_main.o netxen_nic_init.o \ netxen_nic-y := netxen_nic_hw.o netxen_nic_main.o netxen_nic_init.o \
netxen_nic_isr.o netxen_nic_ethtool.o netxen_nic_niu.o netxen_nic_ethtool.o netxen_nic_niu.o netxen_nic_ctx.o
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -42,8 +42,11 @@ ...@@ -42,8 +42,11 @@
#define CRB_CMD_CONSUMER_OFFSET NETXEN_NIC_REG(0x0c) #define CRB_CMD_CONSUMER_OFFSET NETXEN_NIC_REG(0x0c)
#define CRB_PAUSE_ADDR_LO NETXEN_NIC_REG(0x10) /* C0 EPG BUG */ #define CRB_PAUSE_ADDR_LO NETXEN_NIC_REG(0x10) /* C0 EPG BUG */
#define CRB_PAUSE_ADDR_HI NETXEN_NIC_REG(0x14) #define CRB_PAUSE_ADDR_HI NETXEN_NIC_REG(0x14)
#define CRB_HOST_CMD_ADDR_HI NETXEN_NIC_REG(0x18) /* host add:cmd ring */ #define NX_CDRP_CRB_OFFSET NETXEN_NIC_REG(0x18)
#define CRB_HOST_CMD_ADDR_LO NETXEN_NIC_REG(0x1c) #define NX_ARG1_CRB_OFFSET NETXEN_NIC_REG(0x1c)
#define NX_ARG2_CRB_OFFSET NETXEN_NIC_REG(0x20)
#define NX_ARG3_CRB_OFFSET NETXEN_NIC_REG(0x24)
#define NX_SIGN_CRB_OFFSET NETXEN_NIC_REG(0x28)
#define CRB_CMD_INTR_LOOP NETXEN_NIC_REG(0x20) /* 4 regs for perf */ #define CRB_CMD_INTR_LOOP NETXEN_NIC_REG(0x20) /* 4 regs for perf */
#define CRB_CMD_DMA_LOOP NETXEN_NIC_REG(0x24) #define CRB_CMD_DMA_LOOP NETXEN_NIC_REG(0x24)
#define CRB_RCV_INTR_LOOP NETXEN_NIC_REG(0x28) #define CRB_RCV_INTR_LOOP NETXEN_NIC_REG(0x28)
...@@ -74,7 +77,7 @@ ...@@ -74,7 +77,7 @@
#define CRB_DMA_MAX_RCV_BUFS NETXEN_NIC_REG(0x8c) #define CRB_DMA_MAX_RCV_BUFS NETXEN_NIC_REG(0x8c)
#define CRB_MAX_DMA_ENTRIES NETXEN_NIC_REG(0x90) #define CRB_MAX_DMA_ENTRIES NETXEN_NIC_REG(0x90)
#define CRB_XG_STATE NETXEN_NIC_REG(0x94) /* XG Link status */ #define CRB_XG_STATE NETXEN_NIC_REG(0x94) /* XG Link status */
#define CRB_AGENT_GO NETXEN_NIC_REG(0x98) /* NIC pkt gen agent */ #define CRB_XG_STATE_P3 NETXEN_NIC_REG(0x98) /* XG PF Link status */
#define CRB_AGENT_TX_SIZE NETXEN_NIC_REG(0x9c) #define CRB_AGENT_TX_SIZE NETXEN_NIC_REG(0x9c)
#define CRB_AGENT_TX_TYPE NETXEN_NIC_REG(0xa0) #define CRB_AGENT_TX_TYPE NETXEN_NIC_REG(0xa0)
#define CRB_AGENT_TX_ADDR NETXEN_NIC_REG(0xa4) #define CRB_AGENT_TX_ADDR NETXEN_NIC_REG(0xa4)
...@@ -97,7 +100,9 @@ ...@@ -97,7 +100,9 @@
#define CRB_HOST_BUFFER_CONS NETXEN_NIC_REG(0xf0) #define CRB_HOST_BUFFER_CONS NETXEN_NIC_REG(0xf0)
#define CRB_JUMBO_BUFFER_PROD NETXEN_NIC_REG(0xf4) #define CRB_JUMBO_BUFFER_PROD NETXEN_NIC_REG(0xf4)
#define CRB_JUMBO_BUFFER_CONS NETXEN_NIC_REG(0xf8) #define CRB_JUMBO_BUFFER_CONS NETXEN_NIC_REG(0xf8)
#define CRB_HOST_DUMMY_BUF NETXEN_NIC_REG(0xfc)
#define CRB_RCVPEG_STATE NETXEN_NIC_REG(0x13c)
#define CRB_CMD_PRODUCER_OFFSET_1 NETXEN_NIC_REG(0x1ac) #define CRB_CMD_PRODUCER_OFFSET_1 NETXEN_NIC_REG(0x1ac)
#define CRB_CMD_CONSUMER_OFFSET_1 NETXEN_NIC_REG(0x1b0) #define CRB_CMD_CONSUMER_OFFSET_1 NETXEN_NIC_REG(0x1b0)
#define CRB_CMD_PRODUCER_OFFSET_2 NETXEN_NIC_REG(0x1b8) #define CRB_CMD_PRODUCER_OFFSET_2 NETXEN_NIC_REG(0x1b8)
...@@ -147,29 +152,15 @@ ...@@ -147,29 +152,15 @@
#define nx_get_temp_state(x) ((x) & 0xffff) #define nx_get_temp_state(x) ((x) & 0xffff)
#define nx_encode_temp(val, state) (((val) << 16) | (state)) #define nx_encode_temp(val, state) (((val) << 16) | (state))
/* CRB registers per Rcv Descriptor ring */
struct netxen_rcv_desc_crb {
u32 crb_rcv_producer_offset __attribute__ ((aligned(512)));
u32 crb_rcv_consumer_offset;
u32 crb_globalrcv_ring;
u32 crb_rcv_ring_size;
};
/* /*
* CRB registers used by the receive peg logic. * CRB registers used by the receive peg logic.
*/ */
struct netxen_recv_crb { struct netxen_recv_crb {
struct netxen_rcv_desc_crb rcv_desc_crb[NUM_RCV_DESC_RINGS]; u32 crb_rcv_producer[NUM_RCV_DESC_RINGS];
u32 crb_rcvstatus_ring; u32 crb_sts_consumer;
u32 crb_rcv_status_producer;
u32 crb_rcv_status_consumer;
u32 crb_rcvpeg_state;
u32 crb_status_ring_size;
}; };
extern struct netxen_recv_crb recv_crb_registers[];
/* /*
* Temperature control. * Temperature control.
*/ */
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment