Statistics patch for scc.c driver

From: Martijn Hijdra (prmsn.fmggs@kasolution.com.br)
Date: Fri Sep 05 2003 - 11:15:27 EEST

  • Next message: Henk Remijn: "email adres wijziging / email address change"

    Hi All,

    I had some spare time and generated a small patch to
    fill the statistics counters for the scc driver.
    see output of ifconfig RX bytes and TX bytes.

    Patch is generated for 2.6.0 kernel but should apply
    on numerous other (read older) kernels because the driver is not changed
    in a long time.

    Please test and if this patch works correctly we can apply this to the standard kernel.

    btw, a small compile fix is is in scc.h to change datatype.

    -- 
    Martijn Hijdra <euazrvn.zoveaaykk@uninet.ee>
    

    --- drivers/net/hamradio/scc.c.orig 2003-08-23 01:58:57.000000000 +0200 +++ drivers/net/hamradio/scc.c 2003-09-03 08:57:50.000000000 +0200 @@ -1635,6 +1635,7 @@ } scc->dev_stat.rx_packets++; + scc->dev_stat.rx_bytes += skb->len; skb->dev = scc->dev; skb->protocol = htons(ETH_P_AX25); @@ -1661,6 +1662,7 @@ } scc->dev_stat.tx_packets++; + scc->dev_stat.tx_bytes += skb->len; scc->stat.txframes++; kisscmd = *skb->data & 0x1f; --- include/linux/scc.h.orig 2003-09-03 09:13:26.000000000 +0200 +++ include/linux/scc.h 2003-09-03 09:13:55.000000000 +0200 @@ -200,7 +200,7 @@ unsigned char fulldup; /* Full Duplex mode 0=CSMA 1=DUP 2=ALWAYS KEYED */ unsigned char waittime; /* Waittime before any transmit attempt */ unsigned int maxkeyup; /* Maximum time to transmit (seconds) */ - unsigned char mintime; /* Minimal offtime after MAXKEYUP timeout (seconds) */ + unsigned int mintime; /* Minimal offtime after MAXKEYUP timeout (seconds) */ unsigned int idletime; /* Maximum idle time in ALWAYS KEYED mode (seconds) */ unsigned int maxdefer; /* Timer for CSMA channel busy limit */ unsigned char tx_inhibit; /* Transmit is not allowed when set */

    - To unsubscribe from this list: send the line "unsubscribe linux-hams" in the body of a message to ibxll@telekom.hr More majordomo info at http://vger.kernel.org/majordomo-info.html



    This archive was generated by hypermail 2b30 : Fri Sep 05 2003 - 11:13:35 EEST