master/ethernet.c
branchstable-1.1
changeset 1719 42ed27ae6785
parent 1716 9440f4ff25c7
child 1731 60b2aad9d40b
--- a/master/ethernet.c	Wed Aug 09 15:14:29 2006 +0000
+++ b/master/ethernet.c	Fri Sep 01 12:35:41 2006 +0000
@@ -105,7 +105,7 @@
     eoe->tx_counter = 0;
     eoe->rx_rate = 0;
     eoe->tx_rate = 0;
-    eoe->t_last = 0;
+    eoe->rate_jiffies = 0;
 
     if (!(eoe->dev =
           alloc_netdev(sizeof(ec_eoe_t *), "eoe%d", ether_setup))) {
@@ -278,21 +278,18 @@
 
 void ec_eoe_run(ec_eoe_t *eoe /**< EoE handler */)
 {
-    cycles_t t_now;
-
     if (!eoe->opened) return;
 
     // call state function
     eoe->state(eoe);
 
     // update statistics
-    t_now = get_cycles();
-    if ((u32) (t_now - eoe->t_last) > cpu_khz * 1000) {
+    if (jiffies - eoe->rate_jiffies > HZ) {
         eoe->rx_rate = eoe->rx_counter * 8;
         eoe->tx_rate = eoe->tx_counter * 8;
         eoe->rx_counter = 0;
         eoe->tx_counter = 0;
-        eoe->t_last = t_now;
+        eoe->rate_jiffies = jiffies;
     }
 }