[Zrouter-src-freebsd] [rt2860-in-ral] push by r... at ddteam.net - Replace rt2860_io_mac_read_multi with RAL_READ. on 2012-03-14 10:27 GMT

rt2860-in-ral at googlecode.com rt2860-in-ral at googlecode.com
Wed Mar 14 10:28:17 UTC 2012


Revision: 4d1d28d3ff67
Author:   Aleksandr Rybalko <ray at ddteam.net>
Date:     Wed Mar 14 03:27:16 2012
Log:      Replace rt2860_io_mac_read_multi with RAL_READ.
http://code.google.com/p/rt2860-in-ral/source/detail?r=4d1d28d3ff67

Modified:
  /sys/dev/ral/rt2860.c

=======================================
--- /sys/dev/ral/rt2860.c	Wed Mar 14 02:42:49 2012
+++ /sys/dev/ral/rt2860.c	Wed Mar 14 03:27:16 2012
@@ -1120,10 +1120,8 @@
  	rt2860_asic_set_macaddr(sc, IF_LLADDR(ifp));

  	/* clear statistic registers */
-#if 0
-	rt2860_io_mac_read_multi(sc, RT2860_REG_RX_STA_CNT0,
-		stacnt, sizeof(stacnt));
-#endif
+	for (i = 0; i < (sizeof(uint32_t) * 6); i += sizeof(uint32_t))
+		RAL_READ(sc, RT2860_REG_RX_STA_CNT0 + i);

  	/* set RTS threshold */

@@ -5653,14 +5651,12 @@
  	rt2860_drain_fifo_stats(sc);

  	/* read and clear Tx statistic registers */
-#if 0
-	rt2860_io_mac_read_multi(sc, RT2860_REG_TX_STA_CNT0,
+	RAL_READ(sc, RT2860_REG_TX_STA_CNT0)
  		stacnt, sizeof(stacnt));
-#endif
-
-	stacnt[0] = le32toh(stacnt[0]);
-	stacnt[1] = le32toh(stacnt[1]);
-	stacnt[2] = le32toh(stacnt[2]);
+
+	stacnt[0] = le32toh(RAL_READ(sc, RT2860_REG_TX_STA_CNT0));
+	stacnt[1] = le32toh(RAL_READ(sc, RT2860_REG_TX_STA_CNT1));
+	stacnt[2] = le32toh(RAL_READ(sc, RT2860_REG_TX_STA_CNT2));

  	beacons = stacnt[0] >> 16;
  	noretryok = stacnt[1] & 0xffff;


More information about the Zrouter-src-freebsd mailing list