aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/3c59x.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/3c59x.c')
-rw-r--r--drivers/net/3c59x.c33
1 files changed, 23 insertions, 10 deletions
diff --git a/drivers/net/3c59x.c b/drivers/net/3c59x.c
index 3dde1df33487..9e8897976a69 100644
--- a/drivers/net/3c59x.c
+++ b/drivers/net/3c59x.c
@@ -754,9 +754,11 @@ enum tx_desc_status {
754enum ChipCaps { CapBusMaster=0x20, CapPwrMgmt=0x2000 }; 754enum ChipCaps { CapBusMaster=0x20, CapPwrMgmt=0x2000 };
755 755
756struct vortex_extra_stats { 756struct vortex_extra_stats {
757 unsigned long tx_deferred; 757 unsigned long tx_deferred;
758 unsigned long tx_multiple_collisions; 758 unsigned long tx_max_collisions;
759 unsigned long rx_bad_ssd; 759 unsigned long tx_multiple_collisions;
760 unsigned long tx_single_collisions;
761 unsigned long rx_bad_ssd;
760}; 762};
761 763
762struct vortex_private { 764struct vortex_private {
@@ -864,12 +866,14 @@ static struct {
864 const char str[ETH_GSTRING_LEN]; 866 const char str[ETH_GSTRING_LEN];
865} ethtool_stats_keys[] = { 867} ethtool_stats_keys[] = {
866 { "tx_deferred" }, 868 { "tx_deferred" },
869 { "tx_max_collisions" },
867 { "tx_multiple_collisions" }, 870 { "tx_multiple_collisions" },
871 { "tx_single_collisions" },
868 { "rx_bad_ssd" }, 872 { "rx_bad_ssd" },
869}; 873};
870 874
871/* number of ETHTOOL_GSTATS u64's */ 875/* number of ETHTOOL_GSTATS u64's */
872#define VORTEX_NUM_STATS 3 876#define VORTEX_NUM_STATS 5
873 877
874static int vortex_probe1(struct device *gendev, void __iomem *ioaddr, int irq, 878static int vortex_probe1(struct device *gendev, void __iomem *ioaddr, int irq,
875 int chip_idx, int card_idx); 879 int chip_idx, int card_idx);
@@ -2109,9 +2113,12 @@ vortex_error(struct net_device *dev, int status)
2109 iowrite8(0, ioaddr + TxStatus); 2113 iowrite8(0, ioaddr + TxStatus);
2110 if (tx_status & 0x30) { /* txJabber or txUnderrun */ 2114 if (tx_status & 0x30) { /* txJabber or txUnderrun */
2111 do_tx_reset = 1; 2115 do_tx_reset = 1;
2112 } else if ((tx_status & 0x08) && (vp->drv_flags & MAX_COLLISION_RESET)) { /* maxCollisions */ 2116 } else if (tx_status & 0x08) { /* maxCollisions */
2113 do_tx_reset = 1; 2117 vp->xstats.tx_max_collisions++;
2114 reset_mask = 0x0108; /* Reset interface logic, but not download logic */ 2118 if (vp->drv_flags & MAX_COLLISION_RESET) {
2119 do_tx_reset = 1;
2120 reset_mask = 0x0108; /* Reset interface logic, but not download logic */
2121 }
2115 } else { /* Merely re-enable the transmitter. */ 2122 } else { /* Merely re-enable the transmitter. */
2116 iowrite16(TxEnable, ioaddr + EL3_CMD); 2123 iowrite16(TxEnable, ioaddr + EL3_CMD);
2117 } 2124 }
@@ -2927,7 +2934,6 @@ static void update_stats(void __iomem *ioaddr, struct net_device *dev)
2927 EL3WINDOW(6); 2934 EL3WINDOW(6);
2928 vp->stats.tx_carrier_errors += ioread8(ioaddr + 0); 2935 vp->stats.tx_carrier_errors += ioread8(ioaddr + 0);
2929 vp->stats.tx_heartbeat_errors += ioread8(ioaddr + 1); 2936 vp->stats.tx_heartbeat_errors += ioread8(ioaddr + 1);
2930 vp->stats.collisions += ioread8(ioaddr + 3);
2931 vp->stats.tx_window_errors += ioread8(ioaddr + 4); 2937 vp->stats.tx_window_errors += ioread8(ioaddr + 4);
2932 vp->stats.rx_fifo_errors += ioread8(ioaddr + 5); 2938 vp->stats.rx_fifo_errors += ioread8(ioaddr + 5);
2933 vp->stats.tx_packets += ioread8(ioaddr + 6); 2939 vp->stats.tx_packets += ioread8(ioaddr + 6);
@@ -2940,10 +2946,15 @@ static void update_stats(void __iomem *ioaddr, struct net_device *dev)
2940 vp->stats.tx_bytes += ioread16(ioaddr + 12); 2946 vp->stats.tx_bytes += ioread16(ioaddr + 12);
2941 /* Extra stats for get_ethtool_stats() */ 2947 /* Extra stats for get_ethtool_stats() */
2942 vp->xstats.tx_multiple_collisions += ioread8(ioaddr + 2); 2948 vp->xstats.tx_multiple_collisions += ioread8(ioaddr + 2);
2949 vp->xstats.tx_single_collisions += ioread8(ioaddr + 3);
2943 vp->xstats.tx_deferred += ioread8(ioaddr + 8); 2950 vp->xstats.tx_deferred += ioread8(ioaddr + 8);
2944 EL3WINDOW(4); 2951 EL3WINDOW(4);
2945 vp->xstats.rx_bad_ssd += ioread8(ioaddr + 12); 2952 vp->xstats.rx_bad_ssd += ioread8(ioaddr + 12);
2946 2953
2954 vp->stats.collisions = vp->xstats.tx_multiple_collisions
2955 + vp->xstats.tx_single_collisions
2956 + vp->xstats.tx_max_collisions;
2957
2947 { 2958 {
2948 u8 up = ioread8(ioaddr + 13); 2959 u8 up = ioread8(ioaddr + 13);
2949 vp->stats.rx_bytes += (up & 0x0f) << 16; 2960 vp->stats.rx_bytes += (up & 0x0f) << 16;
@@ -3037,8 +3048,10 @@ static void vortex_get_ethtool_stats(struct net_device *dev,
3037 spin_unlock_irqrestore(&vp->lock, flags); 3048 spin_unlock_irqrestore(&vp->lock, flags);
3038 3049
3039 data[0] = vp->xstats.tx_deferred; 3050 data[0] = vp->xstats.tx_deferred;
3040 data[1] = vp->xstats.tx_multiple_collisions; 3051 data[1] = vp->xstats.tx_max_collisions;
3041 data[2] = vp->xstats.rx_bad_ssd; 3052 data[2] = vp->xstats.tx_multiple_collisions;
3053 data[3] = vp->xstats.tx_single_collisions;
3054 data[4] = vp->xstats.rx_bad_ssd;
3042} 3055}
3043 3056
3044 3057