@@ -319,7 +319,7 @@ static struct vortex_chip_info {
319
319
{"3c920B-EMB-WNM (ATI Radeon 9100 IGP)" ,
320
320
PCI_USES_MASTER , IS_TORNADO |HAS_MII |HAS_HWCKSM , 128 , },
321
321
{"3c980 Cyclone" ,
322
- PCI_USES_MASTER , IS_CYCLONE |HAS_HWCKSM , 128 , },
322
+ PCI_USES_MASTER , IS_CYCLONE |HAS_HWCKSM | EXTRA_PREAMBLE , 128 , },
323
323
324
324
{"3c980C Python-T" ,
325
325
PCI_USES_MASTER , IS_CYCLONE |HAS_NWAY |HAS_HWCKSM , 128 , },
@@ -600,7 +600,6 @@ struct vortex_private {
600
600
struct sk_buff * tx_skbuff [TX_RING_SIZE ];
601
601
unsigned int cur_rx , cur_tx ; /* The next free ring entry */
602
602
unsigned int dirty_rx , dirty_tx ; /* The ring entries to be free()ed. */
603
- struct net_device_stats stats ; /* Generic stats */
604
603
struct vortex_extra_stats xstats ; /* NIC-specific extra stats */
605
604
struct sk_buff * tx_skb ; /* Packet being eaten by bus master ctrl. */
606
605
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)
1875
1874
1876
1875
issue_and_wait (dev , TxReset );
1877
1876
1878
- vp -> stats .tx_errors ++ ;
1877
+ dev -> stats .tx_errors ++ ;
1879
1878
if (vp -> full_bus_master_tx ) {
1880
1879
printk (KERN_DEBUG "%s: Resetting the Tx ring pointer.\n" , dev -> name );
1881
1880
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)
1887
1886
iowrite8 (PKT_BUF_SZ >>8 , ioaddr + TxFreeThreshold );
1888
1887
iowrite16 (DownUnstall , ioaddr + EL3_CMD );
1889
1888
} else {
1890
- vp -> stats .tx_dropped ++ ;
1889
+ dev -> stats .tx_dropped ++ ;
1891
1890
netif_wake_queue (dev );
1892
1891
}
1893
1892
@@ -1928,8 +1927,8 @@ vortex_error(struct net_device *dev, int status)
1928
1927
}
1929
1928
dump_tx_ring (dev );
1930
1929
}
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 ++ ;
1933
1932
if (tx_status & 0x08 ) vp -> xstats .tx_max_collisions ++ ;
1934
1933
iowrite8 (0 , ioaddr + TxStatus );
1935
1934
if (tx_status & 0x30 ) { /* txJabber or txUnderrun */
@@ -2051,8 +2050,8 @@ vortex_start_xmit(struct sk_buff *skb, struct net_device *dev)
2051
2050
if (vortex_debug > 2 )
2052
2051
printk (KERN_DEBUG "%s: Tx error, status %2.2x.\n" ,
2053
2052
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 ++ ;
2056
2055
if (tx_status & 0x30 ) {
2057
2056
issue_and_wait (dev , TxReset );
2058
2057
}
@@ -2350,7 +2349,7 @@ boomerang_interrupt(int irq, void *dev_id)
2350
2349
} else {
2351
2350
printk (KERN_DEBUG "boomerang_interrupt: no skb!\n" );
2352
2351
}
2353
- /* vp ->stats.tx_packets++; Counted below. */
2352
+ /* dev ->stats.tx_packets++; Counted below. */
2354
2353
dirty_tx ++ ;
2355
2354
}
2356
2355
vp -> dirty_tx = dirty_tx ;
@@ -2409,12 +2408,12 @@ static int vortex_rx(struct net_device *dev)
2409
2408
unsigned char rx_error = ioread8 (ioaddr + RxErrors );
2410
2409
if (vortex_debug > 2 )
2411
2410
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 ++ ;
2418
2417
} else {
2419
2418
/* The packet length: up to 4.5K!. */
2420
2419
int pkt_len = rx_status & 0x1fff ;
@@ -2446,7 +2445,7 @@ static int vortex_rx(struct net_device *dev)
2446
2445
skb -> protocol = eth_type_trans (skb , dev );
2447
2446
netif_rx (skb );
2448
2447
dev -> last_rx = jiffies ;
2449
- vp -> stats .rx_packets ++ ;
2448
+ dev -> stats .rx_packets ++ ;
2450
2449
/* Wait a limited time to go to next packet. */
2451
2450
for (i = 200 ; i >= 0 ; i -- )
2452
2451
if ( ! (ioread16 (ioaddr + EL3_STATUS ) & CmdInProgress ))
@@ -2455,7 +2454,7 @@ static int vortex_rx(struct net_device *dev)
2455
2454
} else if (vortex_debug > 0 )
2456
2455
printk (KERN_NOTICE "%s: No memory to allocate a sk_buff of "
2457
2456
"size %d.\n" , dev -> name , pkt_len );
2458
- vp -> stats .rx_dropped ++ ;
2457
+ dev -> stats .rx_dropped ++ ;
2459
2458
}
2460
2459
issue_and_wait (dev , RxDiscard );
2461
2460
}
@@ -2482,12 +2481,12 @@ boomerang_rx(struct net_device *dev)
2482
2481
unsigned char rx_error = rx_status >> 16 ;
2483
2482
if (vortex_debug > 2 )
2484
2483
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 ++ ;
2491
2490
} else {
2492
2491
/* The packet length: up to 4.5K!. */
2493
2492
int pkt_len = rx_status & 0x1fff ;
@@ -2529,7 +2528,7 @@ boomerang_rx(struct net_device *dev)
2529
2528
}
2530
2529
netif_rx (skb );
2531
2530
dev -> last_rx = jiffies ;
2532
- vp -> stats .rx_packets ++ ;
2531
+ dev -> stats .rx_packets ++ ;
2533
2532
}
2534
2533
entry = (++ vp -> cur_rx ) % RX_RING_SIZE ;
2535
2534
}
@@ -2591,7 +2590,7 @@ vortex_down(struct net_device *dev, int final_down)
2591
2590
del_timer_sync (& vp -> rx_oom_timer );
2592
2591
del_timer_sync (& vp -> timer );
2593
2592
2594
- /* Turn off statistics ASAP. We update vp ->stats below. */
2593
+ /* Turn off statistics ASAP. We update dev ->stats below. */
2595
2594
iowrite16 (StatsDisable , ioaddr + EL3_CMD );
2596
2595
2597
2596
/* Disable the receiver and transmitter. */
@@ -2728,7 +2727,7 @@ static struct net_device_stats *vortex_get_stats(struct net_device *dev)
2728
2727
update_stats (ioaddr , dev );
2729
2728
spin_unlock_irqrestore (& vp -> lock , flags );
2730
2729
}
2731
- return & vp -> stats ;
2730
+ return & dev -> stats ;
2732
2731
}
2733
2732
2734
2733
/* Update statistics.
@@ -2748,33 +2747,33 @@ static void update_stats(void __iomem *ioaddr, struct net_device *dev)
2748
2747
/* Unlike the 3c5x9 we need not turn off stats updates while reading. */
2749
2748
/* Switch to the stats window, and read everything. */
2750
2749
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 ;
2757
2756
/* Rx packets */ ioread8 (ioaddr + 7 ); /* Must read to clear */
2758
2757
/* Don't bother with register 9, an extension of registers 6&7.
2759
2758
If we do use the 6&7 values the atomic update assumption above
2760
2759
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 );
2763
2762
/* Extra stats for get_ethtool_stats() */
2764
2763
vp -> xstats .tx_multiple_collisions += ioread8 (ioaddr + 2 );
2765
2764
vp -> xstats .tx_single_collisions += ioread8 (ioaddr + 3 );
2766
2765
vp -> xstats .tx_deferred += ioread8 (ioaddr + 8 );
2767
2766
EL3WINDOW (4 );
2768
2767
vp -> xstats .rx_bad_ssd += ioread8 (ioaddr + 12 );
2769
2768
2770
- vp -> stats .collisions = vp -> xstats .tx_multiple_collisions
2769
+ dev -> stats .collisions = vp -> xstats .tx_multiple_collisions
2771
2770
+ vp -> xstats .tx_single_collisions
2772
2771
+ vp -> xstats .tx_max_collisions ;
2773
2772
2774
2773
{
2775
2774
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 ;
2778
2777
}
2779
2778
2780
2779
EL3WINDOW (old_window >> 13 );
0 commit comments