Skip to content

Commit 7cf7526

Browse files
committed
Merge branch 'upstream-davem' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6
2 parents c8f1568 + b0e4539 commit 7cf7526

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+13271
-6948
lines changed

Documentation/networking/e1000.txt

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -513,21 +513,11 @@ Additional Configurations
513513
Intel(R) PRO/1000 PT Dual Port Server Connection
514514
Intel(R) PRO/1000 PT Dual Port Server Adapter
515515
Intel(R) PRO/1000 PF Dual Port Server Adapter
516-
Intel(R) PRO/1000 PT Quad Port Server Adapter
516+
Intel(R) PRO/1000 PT Quad Port Server Adapter
517517

518518
NAPI
519519
----
520-
NAPI (Rx polling mode) is supported in the e1000 driver. NAPI is enabled
521-
or disabled based on the configuration of the kernel. To override
522-
the default, use the following compile-time flags.
523-
524-
To enable NAPI, compile the driver module, passing in a configuration option:
525-
526-
make CFLAGS_EXTRA=-DE1000_NAPI install
527-
528-
To disable NAPI, compile the driver module, passing in a configuration option:
529-
530-
make CFLAGS_EXTRA=-DE1000_NO_NAPI install
520+
NAPI (Rx polling mode) is enabled in the e1000 driver.
531521

532522
See www.cyberus.ca/~hadi/usenix-paper.tgz for more information on NAPI.
533523

MAINTAINERS

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3527,7 +3527,7 @@ S: Supported
35273527

35283528
S390 NETWORK DRIVERS
35293529
P: Ursula Braun
3530-
3530+
M: ursula.braun@de.ibm.com
35313531
P: Frank Blaschka
35323532
35333533
@@ -3547,7 +3547,7 @@ S: Supported
35473547

35483548
S390 IUCV NETWORK LAYER
35493549
P: Ursula Braun
3550-
3550+
M: ursula.braun@de.ibm.com
35513551
35523552
35533553
W: http://www.ibm.com/developerworks/linux/linux390/

drivers/net/8139too.c

Lines changed: 74 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@
9898
#include <linux/compiler.h>
9999
#include <linux/pci.h>
100100
#include <linux/init.h>
101-
#include <linux/ioport.h>
102101
#include <linux/netdevice.h>
103102
#include <linux/etherdevice.h>
104103
#include <linux/rtnetlink.h>
@@ -120,11 +119,6 @@
120119
NETIF_MSG_LINK)
121120

122121

123-
/* enable PIO instead of MMIO, if CONFIG_8139TOO_PIO is selected */
124-
#ifdef CONFIG_8139TOO_PIO
125-
#define USE_IO_OPS 1
126-
#endif
127-
128122
/* define to 1, 2 or 3 to enable copious debugging info */
129123
#define RTL8139_DEBUG 0
130124

@@ -156,6 +150,13 @@
156150
static int media[MAX_UNITS] = {-1, -1, -1, -1, -1, -1, -1, -1};
157151
static int full_duplex[MAX_UNITS] = {-1, -1, -1, -1, -1, -1, -1, -1};
158152

153+
/* Whether to use MMIO or PIO. Default to MMIO. */
154+
#ifdef CONFIG_8139TOO_PIO
155+
static int use_io = 1;
156+
#else
157+
static int use_io = 0;
158+
#endif
159+
159160
/* Maximum number of multicast addresses to filter (vs. Rx-all-multicast).
160161
The RTL chips use a 64 element hash table based on the Ethernet CRC. */
161162
static int multicast_filter_limit = 32;
@@ -614,6 +615,8 @@ MODULE_DESCRIPTION ("RealTek RTL-8139 Fast Ethernet driver");
614615
MODULE_LICENSE("GPL");
615616
MODULE_VERSION(DRV_VERSION);
616617

618+
module_param(use_io, int, 0);
619+
MODULE_PARM_DESC(use_io, "Force use of I/O access mode. 0=MMIO 1=PIO");
617620
module_param(multicast_filter_limit, int, 0);
618621
module_param_array(media, int, NULL, 0);
619622
module_param_array(full_duplex, int, NULL, 0);
@@ -709,13 +712,8 @@ static void __rtl8139_cleanup_dev (struct net_device *dev)
709712
assert (tp->pci_dev != NULL);
710713
pdev = tp->pci_dev;
711714

712-
#ifdef USE_IO_OPS
713-
if (tp->mmio_addr)
714-
ioport_unmap (tp->mmio_addr);
715-
#else
716715
if (tp->mmio_addr)
717716
pci_iounmap (pdev, tp->mmio_addr);
718-
#endif /* USE_IO_OPS */
719717

720718
/* it's ok to call this even if we have no regions to free */
721719
pci_release_regions (pdev);
@@ -790,32 +788,33 @@ static int __devinit rtl8139_init_board (struct pci_dev *pdev,
790788
DPRINTK("PIO region size == 0x%02X\n", pio_len);
791789
DPRINTK("MMIO region size == 0x%02lX\n", mmio_len);
792790

793-
#ifdef USE_IO_OPS
794-
/* make sure PCI base addr 0 is PIO */
795-
if (!(pio_flags & IORESOURCE_IO)) {
796-
dev_err(&pdev->dev, "region #0 not a PIO resource, aborting\n");
797-
rc = -ENODEV;
798-
goto err_out;
799-
}
800-
/* check for weird/broken PCI region reporting */
801-
if (pio_len < RTL_MIN_IO_SIZE) {
802-
dev_err(&pdev->dev, "Invalid PCI I/O region size(s), aborting\n");
803-
rc = -ENODEV;
804-
goto err_out;
805-
}
806-
#else
807-
/* make sure PCI base addr 1 is MMIO */
808-
if (!(mmio_flags & IORESOURCE_MEM)) {
809-
dev_err(&pdev->dev, "region #1 not an MMIO resource, aborting\n");
810-
rc = -ENODEV;
811-
goto err_out;
812-
}
813-
if (mmio_len < RTL_MIN_IO_SIZE) {
814-
dev_err(&pdev->dev, "Invalid PCI mem region size(s), aborting\n");
815-
rc = -ENODEV;
816-
goto err_out;
791+
retry:
792+
if (use_io) {
793+
/* make sure PCI base addr 0 is PIO */
794+
if (!(pio_flags & IORESOURCE_IO)) {
795+
dev_err(&pdev->dev, "region #0 not a PIO resource, aborting\n");
796+
rc = -ENODEV;
797+
goto err_out;
798+
}
799+
/* check for weird/broken PCI region reporting */
800+
if (pio_len < RTL_MIN_IO_SIZE) {
801+
dev_err(&pdev->dev, "Invalid PCI I/O region size(s), aborting\n");
802+
rc = -ENODEV;
803+
goto err_out;
804+
}
805+
} else {
806+
/* make sure PCI base addr 1 is MMIO */
807+
if (!(mmio_flags & IORESOURCE_MEM)) {
808+
dev_err(&pdev->dev, "region #1 not an MMIO resource, aborting\n");
809+
rc = -ENODEV;
810+
goto err_out;
811+
}
812+
if (mmio_len < RTL_MIN_IO_SIZE) {
813+
dev_err(&pdev->dev, "Invalid PCI mem region size(s), aborting\n");
814+
rc = -ENODEV;
815+
goto err_out;
816+
}
817817
}
818-
#endif
819818

820819
rc = pci_request_regions (pdev, DRV_NAME);
821820
if (rc)
@@ -825,28 +824,28 @@ static int __devinit rtl8139_init_board (struct pci_dev *pdev,
825824
/* enable PCI bus-mastering */
826825
pci_set_master (pdev);
827826

828-
#ifdef USE_IO_OPS
829-
ioaddr = ioport_map(pio_start, pio_len);
830-
if (!ioaddr) {
831-
dev_err(&pdev->dev, "cannot map PIO, aborting\n");
832-
rc = -EIO;
833-
goto err_out;
834-
}
835-
dev->base_addr = pio_start;
836-
tp->mmio_addr = ioaddr;
837-
tp->regs_len = pio_len;
838-
#else
839-
/* ioremap MMIO region */
840-
ioaddr = pci_iomap(pdev, 1, 0);
841-
if (ioaddr == NULL) {
842-
dev_err(&pdev->dev, "cannot remap MMIO, aborting\n");
843-
rc = -EIO;
844-
goto err_out;
827+
if (use_io) {
828+
ioaddr = pci_iomap(pdev, 0, 0);
829+
if (!ioaddr) {
830+
dev_err(&pdev->dev, "cannot map PIO, aborting\n");
831+
rc = -EIO;
832+
goto err_out;
833+
}
834+
dev->base_addr = pio_start;
835+
tp->regs_len = pio_len;
836+
} else {
837+
/* ioremap MMIO region */
838+
ioaddr = pci_iomap(pdev, 1, 0);
839+
if (ioaddr == NULL) {
840+
dev_err(&pdev->dev, "cannot remap MMIO, trying PIO\n");
841+
pci_release_regions(pdev);
842+
use_io = 1;
843+
goto retry;
844+
}
845+
dev->base_addr = (long) ioaddr;
846+
tp->regs_len = mmio_len;
845847
}
846-
dev->base_addr = (long) ioaddr;
847848
tp->mmio_addr = ioaddr;
848-
tp->regs_len = mmio_len;
849-
#endif /* USE_IO_OPS */
850849

851850
/* Bring old chips out of low-power mode. */
852851
RTL_W8 (HltClk, 'R');
@@ -952,6 +951,14 @@ static int __devinit rtl8139_init_one (struct pci_dev *pdev,
952951
"Use the \"8139cp\" driver for improved performance and stability.\n");
953952
}
954953

954+
if (pdev->vendor == PCI_VENDOR_ID_REALTEK &&
955+
pdev->device == PCI_DEVICE_ID_REALTEK_8139 &&
956+
pdev->subsystem_vendor == PCI_VENDOR_ID_ATHEROS &&
957+
pdev->subsystem_device == PCI_DEVICE_ID_REALTEK_8139) {
958+
printk(KERN_INFO "8139too: OQO Model 2 detected. Forcing PIO\n");
959+
use_io = 1;
960+
}
961+
955962
i = rtl8139_init_board (pdev, &dev);
956963
if (i < 0)
957964
return i;
@@ -2381,28 +2388,31 @@ static void rtl8139_set_msglevel(struct net_device *dev, u32 datum)
23812388
np->msg_enable = datum;
23822389
}
23832390

2384-
/* TODO: we are too slack to do reg dumping for pio, for now */
2385-
#ifdef CONFIG_8139TOO_PIO
2386-
#define rtl8139_get_regs_len NULL
2387-
#define rtl8139_get_regs NULL
2388-
#else
23892391
static int rtl8139_get_regs_len(struct net_device *dev)
23902392
{
2391-
struct rtl8139_private *np = netdev_priv(dev);
2393+
struct rtl8139_private *np;
2394+
/* TODO: we are too slack to do reg dumping for pio, for now */
2395+
if (use_io)
2396+
return 0;
2397+
np = netdev_priv(dev);
23922398
return np->regs_len;
23932399
}
23942400

23952401
static void rtl8139_get_regs(struct net_device *dev, struct ethtool_regs *regs, void *regbuf)
23962402
{
2397-
struct rtl8139_private *np = netdev_priv(dev);
2403+
struct rtl8139_private *np;
2404+
2405+
/* TODO: we are too slack to do reg dumping for pio, for now */
2406+
if (use_io)
2407+
return;
2408+
np = netdev_priv(dev);
23982409

23992410
regs->version = RTL_REGS_VER;
24002411

24012412
spin_lock_irq(&np->lock);
24022413
memcpy_fromio(regbuf, np->mmio_addr, regs->len);
24032414
spin_unlock_irq(&np->lock);
24042415
}
2405-
#endif /* CONFIG_8139TOO_MMIO */
24062416

24072417
static int rtl8139_get_sset_count(struct net_device *dev, int sset)
24082418
{

drivers/net/Kconfig

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1926,20 +1926,6 @@ config E1000
19261926
To compile this driver as a module, choose M here. The module
19271927
will be called e1000.
19281928

1929-
config E1000_NAPI
1930-
bool "Use Rx Polling (NAPI)"
1931-
depends on E1000
1932-
help
1933-
NAPI is a new driver API designed to reduce CPU and interrupt load
1934-
when the driver is receiving lots of packets from the card. It is
1935-
still somewhat experimental and thus not yet enabled by default.
1936-
1937-
If your estimated Rx load is 10kpps or more, or if the card will be
1938-
deployed on potentially unfriendly networks (e.g. in a firewall),
1939-
then say Y here.
1940-
1941-
If in doubt, say N.
1942-
19431929
config E1000_DISABLE_PACKET_SPLIT
19441930
bool "Disable Packet Split for PCI express adapters"
19451931
depends on E1000
@@ -2304,6 +2290,17 @@ config ATL1
23042290
To compile this driver as a module, choose M here. The module
23052291
will be called atl1.
23062292

2293+
config ATL1E
2294+
tristate "Atheros L1E Gigabit Ethernet support (EXPERIMENTAL)"
2295+
depends on PCI && EXPERIMENTAL
2296+
select CRC32
2297+
select MII
2298+
help
2299+
This driver supports the Atheros L1E gigabit ethernet adapter.
2300+
2301+
To compile this driver as a module, choose M here. The module
2302+
will be called atl1e.
2303+
23072304
endif # NETDEV_1000
23082305

23092306
#

drivers/net/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ obj-$(CONFIG_EHEA) += ehea/
1515
obj-$(CONFIG_CAN) += can/
1616
obj-$(CONFIG_BONDING) += bonding/
1717
obj-$(CONFIG_ATL1) += atlx/
18+
obj-$(CONFIG_ATL1E) += atl1e/
1819
obj-$(CONFIG_GIANFAR) += gianfar_driver.o
1920
obj-$(CONFIG_TEHUTI) += tehuti.o
2021

drivers/net/arm/at91_ether.c

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -820,7 +820,7 @@ static int at91ether_tx(struct sk_buff *skb, struct net_device *dev)
820820
lp->skb = skb;
821821
lp->skb_length = skb->len;
822822
lp->skb_physaddr = dma_map_single(NULL, skb->data, skb->len, DMA_TO_DEVICE);
823-
lp->stats.tx_bytes += skb->len;
823+
dev->stats.tx_bytes += skb->len;
824824

825825
/* Set address of the data in the Transmit Address register */
826826
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)
843843
*/
844844
static struct net_device_stats *at91ether_stats(struct net_device *dev)
845845
{
846-
struct at91_private *lp = netdev_priv(dev);
847846
int ale, lenerr, seqe, lcol, ecol;
848847

849848
if (netif_running(dev)) {
850-
lp->stats.rx_packets += at91_emac_read(AT91_EMAC_OK); /* Good frames received */
849+
dev->stats.rx_packets += at91_emac_read(AT91_EMAC_OK); /* Good frames received */
851850
ale = at91_emac_read(AT91_EMAC_ALE);
852-
lp->stats.rx_frame_errors += ale; /* Alignment errors */
851+
dev->stats.rx_frame_errors += ale; /* Alignment errors */
853852
lenerr = at91_emac_read(AT91_EMAC_ELR) + at91_emac_read(AT91_EMAC_USF);
854-
lp->stats.rx_length_errors += lenerr; /* Excessive Length or Undersize Frame error */
853+
dev->stats.rx_length_errors += lenerr; /* Excessive Length or Undersize Frame error */
855854
seqe = at91_emac_read(AT91_EMAC_SEQE);
856-
lp->stats.rx_crc_errors += seqe; /* CRC error */
857-
lp->stats.rx_fifo_errors += at91_emac_read(AT91_EMAC_DRFC); /* Receive buffer not available */
858-
lp->stats.rx_errors += (ale + lenerr + seqe
855+
dev->stats.rx_crc_errors += seqe; /* CRC error */
856+
dev->stats.rx_fifo_errors += at91_emac_read(AT91_EMAC_DRFC); /* Receive buffer not available */
857+
dev->stats.rx_errors += (ale + lenerr + seqe
859858
+ at91_emac_read(AT91_EMAC_CDE) + at91_emac_read(AT91_EMAC_RJB));
860859

861-
lp->stats.tx_packets += at91_emac_read(AT91_EMAC_FRA); /* Frames successfully transmitted */
862-
lp->stats.tx_fifo_errors += at91_emac_read(AT91_EMAC_TUE); /* Transmit FIFO underruns */
863-
lp->stats.tx_carrier_errors += at91_emac_read(AT91_EMAC_CSE); /* Carrier Sense errors */
864-
lp->stats.tx_heartbeat_errors += at91_emac_read(AT91_EMAC_SQEE);/* Heartbeat error */
860+
dev->stats.tx_packets += at91_emac_read(AT91_EMAC_FRA); /* Frames successfully transmitted */
861+
dev->stats.tx_fifo_errors += at91_emac_read(AT91_EMAC_TUE); /* Transmit FIFO underruns */
862+
dev->stats.tx_carrier_errors += at91_emac_read(AT91_EMAC_CSE); /* Carrier Sense errors */
863+
dev->stats.tx_heartbeat_errors += at91_emac_read(AT91_EMAC_SQEE);/* Heartbeat error */
865864

866865
lcol = at91_emac_read(AT91_EMAC_LCOL);
867866
ecol = at91_emac_read(AT91_EMAC_ECOL);
868-
lp->stats.tx_window_errors += lcol; /* Late collisions */
869-
lp->stats.tx_aborted_errors += ecol; /* 16 collisions */
867+
dev->stats.tx_window_errors += lcol; /* Late collisions */
868+
dev->stats.tx_aborted_errors += ecol; /* 16 collisions */
870869

871-
lp->stats.collisions += (at91_emac_read(AT91_EMAC_SCOL) + at91_emac_read(AT91_EMAC_MCOL) + lcol + ecol);
870+
dev->stats.collisions += (at91_emac_read(AT91_EMAC_SCOL) + at91_emac_read(AT91_EMAC_MCOL) + lcol + ecol);
872871
}
873-
return &lp->stats;
872+
return &dev->stats;
874873
}
875874

876875
/*
@@ -896,16 +895,16 @@ static void at91ether_rx(struct net_device *dev)
896895

897896
skb->protocol = eth_type_trans(skb, dev);
898897
dev->last_rx = jiffies;
899-
lp->stats.rx_bytes += pktlen;
898+
dev->stats.rx_bytes += pktlen;
900899
netif_rx(skb);
901900
}
902901
else {
903-
lp->stats.rx_dropped += 1;
902+
dev->stats.rx_dropped += 1;
904903
printk(KERN_NOTICE "%s: Memory squeeze, dropping packet.\n", dev->name);
905904
}
906905

907906
if (dlist->descriptors[lp->rxBuffIndex].size & EMAC_MULTICAST)
908-
lp->stats.multicast++;
907+
dev->stats.multicast++;
909908

910909
dlist->descriptors[lp->rxBuffIndex].addr &= ~EMAC_DESC_DONE; /* reset ownership bit */
911910
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)
934933
if (intstatus & AT91_EMAC_TCOM) { /* Transmit complete */
935934
/* The TCOM bit is set even if the transmission failed. */
936935
if (intstatus & (AT91_EMAC_TUND | AT91_EMAC_RTRY))
937-
lp->stats.tx_errors += 1;
936+
dev->stats.tx_errors += 1;
938937

939938
if (lp->skb) {
940939
dev_kfree_skb_irq(lp->skb);

0 commit comments

Comments
 (0)