Skip to content

Commit 28a4acb

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (32 commits) net: Added ASSERT_RTNL() to dev_open() and dev_close(). can: Fix can_send() handling on dev_queue_xmit() failures netns: Fix arbitrary net_device-s corruptions on net_ns stop. netfilter: Kconfig: default DCCP/SCTP conntrack support to the protocol config values netfilter: nf_conntrack_sip: restrict RTP expect flushing on error to last request macvlan: Fix memleak on device removal/crash on module removal net/ipv4: correct RFC 1122 section reference in comment tcp FRTO: SACK variant is errorneously used with NewReno e1000e: don't return half-read eeprom on error ucc_geth: Don't use RX clock as TX clock. cxgb3: Use CAP_SYS_RAWIO for firmware pcnet32: delete non NAPI code from driver. fs_enet: Fix a memory leak in fs_enet_mdio_probe [netdrvr] eexpress: IPv6 fails - multicast problems 3c59x: use netstats in net_device structure 3c980-TX needs EXTRA_PREAMBLE fix warning in drivers/net/appletalk/cops.c e1000e: Add support for BM PHYs on ICH9 uli526x: fix endianness issues in the setup frame uli526x: initialize the hardware prior to requesting interrupts ...
2 parents 89f92d6 + e46b66b commit 28a4acb

40 files changed

+1242
-413
lines changed

arch/arm/mach-orion5x/common.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,9 @@ static struct platform_device orion5x_eth = {
223223

224224
void __init orion5x_eth_init(struct mv643xx_eth_platform_data *eth_data)
225225
{
226+
eth_data->shared = &orion5x_eth_shared;
226227
orion5x_eth.dev.platform_data = eth_data;
228+
227229
platform_device_register(&orion5x_eth_shared);
228230
platform_device_register(&orion5x_eth);
229231
}

arch/powerpc/platforms/chrp/pegasos_eth.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ static struct resource mv643xx_eth0_resources[] = {
5858

5959

6060
static struct mv643xx_eth_platform_data eth0_pd = {
61+
.shared = &mv643xx_eth_shared_device,
6162
.port_number = 0,
63+
6264
.tx_sram_addr = PEGASOS2_SRAM_BASE_ETH0,
6365
.tx_sram_size = PEGASOS2_SRAM_TXRING_SIZE,
6466
.tx_queue_size = PEGASOS2_SRAM_TXRING_SIZE/16,
@@ -88,7 +90,9 @@ static struct resource mv643xx_eth1_resources[] = {
8890
};
8991

9092
static struct mv643xx_eth_platform_data eth1_pd = {
93+
.shared = &mv643xx_eth_shared_device,
9194
.port_number = 1,
95+
9296
.tx_sram_addr = PEGASOS2_SRAM_BASE_ETH1,
9397
.tx_sram_size = PEGASOS2_SRAM_TXRING_SIZE,
9498
.tx_queue_size = PEGASOS2_SRAM_TXRING_SIZE/16,

arch/powerpc/sysdev/mv64x60_dev.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,8 @@ static int __init mv64x60_eth_device_setup(struct device_node *np, int id,
239239

240240
memset(&pdata, 0, sizeof(pdata));
241241

242+
pdata.shared = shared_pdev;
243+
242244
prop = of_get_property(np, "reg", NULL);
243245
if (!prop)
244246
return -ENODEV;

arch/ppc/syslib/mv64x60.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,7 @@ static struct resource mv64x60_eth0_resources[] = {
341341
};
342342

343343
static struct mv643xx_eth_platform_data eth0_pd = {
344+
.shared = &mv64x60_eth_shared_device;
344345
.port_number = 0,
345346
};
346347

@@ -366,6 +367,7 @@ static struct resource mv64x60_eth1_resources[] = {
366367
};
367368

368369
static struct mv643xx_eth_platform_data eth1_pd = {
370+
.shared = &mv64x60_eth_shared_device;
369371
.port_number = 1,
370372
};
371373

@@ -391,6 +393,7 @@ static struct resource mv64x60_eth2_resources[] = {
391393
};
392394

393395
static struct mv643xx_eth_platform_data eth2_pd = {
396+
.shared = &mv64x60_eth_shared_device;
394397
.port_number = 2,
395398
};
396399

drivers/net/3c59x.c

Lines changed: 36 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ static struct vortex_chip_info {
319319
{"3c920B-EMB-WNM (ATI Radeon 9100 IGP)",
320320
PCI_USES_MASTER, IS_TORNADO|HAS_MII|HAS_HWCKSM, 128, },
321321
{"3c980 Cyclone",
322-
PCI_USES_MASTER, IS_CYCLONE|HAS_HWCKSM, 128, },
322+
PCI_USES_MASTER, IS_CYCLONE|HAS_HWCKSM|EXTRA_PREAMBLE, 128, },
323323

324324
{"3c980C Python-T",
325325
PCI_USES_MASTER, IS_CYCLONE|HAS_NWAY|HAS_HWCKSM, 128, },
@@ -600,7 +600,6 @@ struct vortex_private {
600600
struct sk_buff* tx_skbuff[TX_RING_SIZE];
601601
unsigned int cur_rx, cur_tx; /* The next free ring entry */
602602
unsigned int dirty_rx, dirty_tx; /* The ring entries to be free()ed. */
603-
struct net_device_stats stats; /* Generic stats */
604603
struct vortex_extra_stats xstats; /* NIC-specific extra stats */
605604
struct sk_buff *tx_skb; /* Packet being eaten by bus master ctrl. */
606605
dma_addr_t tx_skb_dma; /* Allocated DMA address for bus master ctrl DMA. */
@@ -1875,7 +1874,7 @@ static void vortex_tx_timeout(struct net_device *dev)
18751874

18761875
issue_and_wait(dev, TxReset);
18771876

1878-
vp->stats.tx_errors++;
1877+
dev->stats.tx_errors++;
18791878
if (vp->full_bus_master_tx) {
18801879
printk(KERN_DEBUG "%s: Resetting the Tx ring pointer.\n", dev->name);
18811880
if (vp->cur_tx - vp->dirty_tx > 0 && ioread32(ioaddr + DownListPtr) == 0)
@@ -1887,7 +1886,7 @@ static void vortex_tx_timeout(struct net_device *dev)
18871886
iowrite8(PKT_BUF_SZ>>8, ioaddr + TxFreeThreshold);
18881887
iowrite16(DownUnstall, ioaddr + EL3_CMD);
18891888
} else {
1890-
vp->stats.tx_dropped++;
1889+
dev->stats.tx_dropped++;
18911890
netif_wake_queue(dev);
18921891
}
18931892

@@ -1928,8 +1927,8 @@ vortex_error(struct net_device *dev, int status)
19281927
}
19291928
dump_tx_ring(dev);
19301929
}
1931-
if (tx_status & 0x14) vp->stats.tx_fifo_errors++;
1932-
if (tx_status & 0x38) vp->stats.tx_aborted_errors++;
1930+
if (tx_status & 0x14) dev->stats.tx_fifo_errors++;
1931+
if (tx_status & 0x38) dev->stats.tx_aborted_errors++;
19331932
if (tx_status & 0x08) vp->xstats.tx_max_collisions++;
19341933
iowrite8(0, ioaddr + TxStatus);
19351934
if (tx_status & 0x30) { /* txJabber or txUnderrun */
@@ -2051,8 +2050,8 @@ vortex_start_xmit(struct sk_buff *skb, struct net_device *dev)
20512050
if (vortex_debug > 2)
20522051
printk(KERN_DEBUG "%s: Tx error, status %2.2x.\n",
20532052
dev->name, tx_status);
2054-
if (tx_status & 0x04) vp->stats.tx_fifo_errors++;
2055-
if (tx_status & 0x38) vp->stats.tx_aborted_errors++;
2053+
if (tx_status & 0x04) dev->stats.tx_fifo_errors++;
2054+
if (tx_status & 0x38) dev->stats.tx_aborted_errors++;
20562055
if (tx_status & 0x30) {
20572056
issue_and_wait(dev, TxReset);
20582057
}
@@ -2350,7 +2349,7 @@ boomerang_interrupt(int irq, void *dev_id)
23502349
} else {
23512350
printk(KERN_DEBUG "boomerang_interrupt: no skb!\n");
23522351
}
2353-
/* vp->stats.tx_packets++; Counted below. */
2352+
/* dev->stats.tx_packets++; Counted below. */
23542353
dirty_tx++;
23552354
}
23562355
vp->dirty_tx = dirty_tx;
@@ -2409,12 +2408,12 @@ static int vortex_rx(struct net_device *dev)
24092408
unsigned char rx_error = ioread8(ioaddr + RxErrors);
24102409
if (vortex_debug > 2)
24112410
printk(KERN_DEBUG " Rx error: status %2.2x.\n", rx_error);
2412-
vp->stats.rx_errors++;
2413-
if (rx_error & 0x01) vp->stats.rx_over_errors++;
2414-
if (rx_error & 0x02) vp->stats.rx_length_errors++;
2415-
if (rx_error & 0x04) vp->stats.rx_frame_errors++;
2416-
if (rx_error & 0x08) vp->stats.rx_crc_errors++;
2417-
if (rx_error & 0x10) vp->stats.rx_length_errors++;
2411+
dev->stats.rx_errors++;
2412+
if (rx_error & 0x01) dev->stats.rx_over_errors++;
2413+
if (rx_error & 0x02) dev->stats.rx_length_errors++;
2414+
if (rx_error & 0x04) dev->stats.rx_frame_errors++;
2415+
if (rx_error & 0x08) dev->stats.rx_crc_errors++;
2416+
if (rx_error & 0x10) dev->stats.rx_length_errors++;
24182417
} else {
24192418
/* The packet length: up to 4.5K!. */
24202419
int pkt_len = rx_status & 0x1fff;
@@ -2446,7 +2445,7 @@ static int vortex_rx(struct net_device *dev)
24462445
skb->protocol = eth_type_trans(skb, dev);
24472446
netif_rx(skb);
24482447
dev->last_rx = jiffies;
2449-
vp->stats.rx_packets++;
2448+
dev->stats.rx_packets++;
24502449
/* Wait a limited time to go to next packet. */
24512450
for (i = 200; i >= 0; i--)
24522451
if ( ! (ioread16(ioaddr + EL3_STATUS) & CmdInProgress))
@@ -2455,7 +2454,7 @@ static int vortex_rx(struct net_device *dev)
24552454
} else if (vortex_debug > 0)
24562455
printk(KERN_NOTICE "%s: No memory to allocate a sk_buff of "
24572456
"size %d.\n", dev->name, pkt_len);
2458-
vp->stats.rx_dropped++;
2457+
dev->stats.rx_dropped++;
24592458
}
24602459
issue_and_wait(dev, RxDiscard);
24612460
}
@@ -2482,12 +2481,12 @@ boomerang_rx(struct net_device *dev)
24822481
unsigned char rx_error = rx_status >> 16;
24832482
if (vortex_debug > 2)
24842483
printk(KERN_DEBUG " Rx error: status %2.2x.\n", rx_error);
2485-
vp->stats.rx_errors++;
2486-
if (rx_error & 0x01) vp->stats.rx_over_errors++;
2487-
if (rx_error & 0x02) vp->stats.rx_length_errors++;
2488-
if (rx_error & 0x04) vp->stats.rx_frame_errors++;
2489-
if (rx_error & 0x08) vp->stats.rx_crc_errors++;
2490-
if (rx_error & 0x10) vp->stats.rx_length_errors++;
2484+
dev->stats.rx_errors++;
2485+
if (rx_error & 0x01) dev->stats.rx_over_errors++;
2486+
if (rx_error & 0x02) dev->stats.rx_length_errors++;
2487+
if (rx_error & 0x04) dev->stats.rx_frame_errors++;
2488+
if (rx_error & 0x08) dev->stats.rx_crc_errors++;
2489+
if (rx_error & 0x10) dev->stats.rx_length_errors++;
24912490
} else {
24922491
/* The packet length: up to 4.5K!. */
24932492
int pkt_len = rx_status & 0x1fff;
@@ -2529,7 +2528,7 @@ boomerang_rx(struct net_device *dev)
25292528
}
25302529
netif_rx(skb);
25312530
dev->last_rx = jiffies;
2532-
vp->stats.rx_packets++;
2531+
dev->stats.rx_packets++;
25332532
}
25342533
entry = (++vp->cur_rx) % RX_RING_SIZE;
25352534
}
@@ -2591,7 +2590,7 @@ vortex_down(struct net_device *dev, int final_down)
25912590
del_timer_sync(&vp->rx_oom_timer);
25922591
del_timer_sync(&vp->timer);
25932592

2594-
/* Turn off statistics ASAP. We update vp->stats below. */
2593+
/* Turn off statistics ASAP. We update dev->stats below. */
25952594
iowrite16(StatsDisable, ioaddr + EL3_CMD);
25962595

25972596
/* Disable the receiver and transmitter. */
@@ -2728,7 +2727,7 @@ static struct net_device_stats *vortex_get_stats(struct net_device *dev)
27282727
update_stats(ioaddr, dev);
27292728
spin_unlock_irqrestore (&vp->lock, flags);
27302729
}
2731-
return &vp->stats;
2730+
return &dev->stats;
27322731
}
27332732

27342733
/* Update statistics.
@@ -2748,33 +2747,33 @@ static void update_stats(void __iomem *ioaddr, struct net_device *dev)
27482747
/* Unlike the 3c5x9 we need not turn off stats updates while reading. */
27492748
/* Switch to the stats window, and read everything. */
27502749
EL3WINDOW(6);
2751-
vp->stats.tx_carrier_errors += ioread8(ioaddr + 0);
2752-
vp->stats.tx_heartbeat_errors += ioread8(ioaddr + 1);
2753-
vp->stats.tx_window_errors += ioread8(ioaddr + 4);
2754-
vp->stats.rx_fifo_errors += ioread8(ioaddr + 5);
2755-
vp->stats.tx_packets += ioread8(ioaddr + 6);
2756-
vp->stats.tx_packets += (ioread8(ioaddr + 9)&0x30) << 4;
2750+
dev->stats.tx_carrier_errors += ioread8(ioaddr + 0);
2751+
dev->stats.tx_heartbeat_errors += ioread8(ioaddr + 1);
2752+
dev->stats.tx_window_errors += ioread8(ioaddr + 4);
2753+
dev->stats.rx_fifo_errors += ioread8(ioaddr + 5);
2754+
dev->stats.tx_packets += ioread8(ioaddr + 6);
2755+
dev->stats.tx_packets += (ioread8(ioaddr + 9)&0x30) << 4;
27572756
/* Rx packets */ ioread8(ioaddr + 7); /* Must read to clear */
27582757
/* Don't bother with register 9, an extension of registers 6&7.
27592758
If we do use the 6&7 values the atomic update assumption above
27602759
is invalid. */
2761-
vp->stats.rx_bytes += ioread16(ioaddr + 10);
2762-
vp->stats.tx_bytes += ioread16(ioaddr + 12);
2760+
dev->stats.rx_bytes += ioread16(ioaddr + 10);
2761+
dev->stats.tx_bytes += ioread16(ioaddr + 12);
27632762
/* Extra stats for get_ethtool_stats() */
27642763
vp->xstats.tx_multiple_collisions += ioread8(ioaddr + 2);
27652764
vp->xstats.tx_single_collisions += ioread8(ioaddr + 3);
27662765
vp->xstats.tx_deferred += ioread8(ioaddr + 8);
27672766
EL3WINDOW(4);
27682767
vp->xstats.rx_bad_ssd += ioread8(ioaddr + 12);
27692768

2770-
vp->stats.collisions = vp->xstats.tx_multiple_collisions
2769+
dev->stats.collisions = vp->xstats.tx_multiple_collisions
27712770
+ vp->xstats.tx_single_collisions
27722771
+ vp->xstats.tx_max_collisions;
27732772

27742773
{
27752774
u8 up = ioread8(ioaddr + 13);
2776-
vp->stats.rx_bytes += (up & 0x0f) << 16;
2777-
vp->stats.tx_bytes += (up & 0xf0) << 12;
2775+
dev->stats.rx_bytes += (up & 0x0f) << 16;
2776+
dev->stats.tx_bytes += (up & 0xf0) << 12;
27782777
}
27792778

27802779
EL3WINDOW(old_window >> 13);

drivers/net/Kconfig

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1273,20 +1273,6 @@ config PCNET32
12731273
To compile this driver as a module, choose M here. The module
12741274
will be called pcnet32.
12751275

1276-
config PCNET32_NAPI
1277-
bool "Use RX polling (NAPI)"
1278-
depends on PCNET32
1279-
help
1280-
NAPI is a new driver API designed to reduce CPU and interrupt load
1281-
when the driver is receiving lots of packets from the card. It is
1282-
still somewhat experimental and thus not yet enabled by default.
1283-
1284-
If your estimated Rx load is 10kpps or more, or if the card will be
1285-
deployed on potentially unfriendly networks (e.g. in a firewall),
1286-
then say Y here.
1287-
1288-
If in doubt, say N.
1289-
12901276
config AMD8111_ETH
12911277
tristate "AMD 8111 (new PCI lance) support"
12921278
depends on NET_PCI && PCI

drivers/net/appletalk/cops.c

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -499,19 +499,13 @@ static void cops_reset(struct net_device *dev, int sleep)
499499
{
500500
outb(0, ioaddr+DAYNA_RESET); /* Assert the reset port */
501501
inb(ioaddr+DAYNA_RESET); /* Clear the reset */
502-
if(sleep)
503-
{
504-
long snap=jiffies;
505-
506-
/* Let card finish initializing, about 1/3 second */
507-
while (time_before(jiffies, snap + HZ/3))
508-
schedule();
509-
}
510-
else
511-
mdelay(333);
502+
if (sleep)
503+
msleep(333);
504+
else
505+
mdelay(333);
512506
}
507+
513508
netif_wake_queue(dev);
514-
return;
515509
}
516510

517511
static void cops_load (struct net_device *dev)

drivers/net/bonding/bond_main.c

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1425,13 +1425,13 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
14251425
res = netdev_set_master(slave_dev, bond_dev);
14261426
if (res) {
14271427
dprintk("Error %d calling netdev_set_master\n", res);
1428-
goto err_close;
1428+
goto err_restore_mac;
14291429
}
14301430
/* open the slave since the application closed it */
14311431
res = dev_open(slave_dev);
14321432
if (res) {
14331433
dprintk("Openning slave %s failed\n", slave_dev->name);
1434-
goto err_restore_mac;
1434+
goto err_unset_master;
14351435
}
14361436

14371437
new_slave->dev = slave_dev;
@@ -1444,7 +1444,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
14441444
*/
14451445
res = bond_alb_init_slave(bond, new_slave);
14461446
if (res) {
1447-
goto err_unset_master;
1447+
goto err_close;
14481448
}
14491449
}
14501450

@@ -1619,7 +1619,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
16191619

16201620
res = bond_create_slave_symlinks(bond_dev, slave_dev);
16211621
if (res)
1622-
goto err_unset_master;
1622+
goto err_close;
16231623

16241624
printk(KERN_INFO DRV_NAME
16251625
": %s: enslaving %s as a%s interface with a%s link.\n",
@@ -1631,12 +1631,12 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
16311631
return 0;
16321632

16331633
/* Undo stages on error */
1634-
err_unset_master:
1635-
netdev_set_master(slave_dev, NULL);
1636-
16371634
err_close:
16381635
dev_close(slave_dev);
16391636

1637+
err_unset_master:
1638+
netdev_set_master(slave_dev, NULL);
1639+
16401640
err_restore_mac:
16411641
if (!bond->params.fail_over_mac) {
16421642
memcpy(addr.sa_data, new_slave->perm_hwaddr, ETH_ALEN);
@@ -4936,7 +4936,9 @@ int bond_create(char *name, struct bond_params *params, struct bonding **newbond
49364936
if (res < 0) {
49374937
rtnl_lock();
49384938
down_write(&bonding_rwsem);
4939-
goto out_bond;
4939+
bond_deinit(bond_dev);
4940+
unregister_netdevice(bond_dev);
4941+
goto out_rtnl;
49404942
}
49414943

49424944
return 0;
@@ -4990,9 +4992,10 @@ static int __init bonding_init(void)
49904992
destroy_workqueue(bond->wq);
49914993
}
49924994

4995+
bond_destroy_sysfs();
4996+
49934997
rtnl_lock();
49944998
bond_free_all();
4995-
bond_destroy_sysfs();
49964999
rtnl_unlock();
49975000
out:
49985001
return res;
@@ -5004,9 +5007,10 @@ static void __exit bonding_exit(void)
50045007
unregister_netdevice_notifier(&bond_netdev_notifier);
50055008
unregister_inetaddr_notifier(&bond_inetaddr_notifier);
50065009

5010+
bond_destroy_sysfs();
5011+
50075012
rtnl_lock();
50085013
bond_free_all();
5009-
bond_destroy_sysfs();
50105014
rtnl_unlock();
50115015
}
50125016

0 commit comments

Comments
 (0)