]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - drivers/net/wireless/ath/ath5k/reg.h
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wirel...
[karo-tx-linux.git] / drivers / net / wireless / ath / ath5k / reg.h
index 1464f89b249c6b70e7187350cd8b08755db6bc0c..45d62e915e4cd4c4848cbec3109c37d670bbfa15 100644 (file)
  * MIB control register
  */
 #define AR5K_MIBC              0x0040                  /* Register Address */
-#define AR5K_MIBC_COW          0x00000001      /* Warn test indicator */
+#define AR5K_MIBC_COW          0x00000001      /* Counter Overflow Warning */
 #define AR5K_MIBC_FMC          0x00000002      /* Freeze MIB Counters  */
-#define AR5K_MIBC_CMC          0x00000004      /* Clean MIB Counters  */
-#define AR5K_MIBC_MCS          0x00000008      /* MIB counter strobe */
+#define AR5K_MIBC_CMC          0x00000004      /* Clear MIB Counters  */
+#define AR5K_MIBC_MCS          0x00000008      /* MIB counter strobe, increment all */
 
 /*
  * Timeout prescale register
                                AR5K_NAV_5210 : AR5K_NAV_5211)
 
 /*
- * RTS success register
+ * MIB counters:
+ *
+ * max value is 0xc000, if this is reached we get a MIB interrupt.
+ * they can be controlled via AR5K_MIBC and are cleared on read.
+ */
+
+/*
+ * RTS success (MIB counter)
  */
 #define AR5K_RTS_OK_5210       0x8090
 #define AR5K_RTS_OK_5211       0x8088
                                AR5K_RTS_OK_5210 : AR5K_RTS_OK_5211)
 
 /*
- * RTS failure register
+ * RTS failure (MIB counter)
  */
 #define AR5K_RTS_FAIL_5210     0x8094
 #define AR5K_RTS_FAIL_5211     0x808c
                                AR5K_RTS_FAIL_5210 : AR5K_RTS_FAIL_5211)
 
 /*
- * ACK failure register
+ * ACK failure (MIB counter)
  */
 #define AR5K_ACK_FAIL_5210     0x8098
 #define AR5K_ACK_FAIL_5211     0x8090
                                AR5K_ACK_FAIL_5210 : AR5K_ACK_FAIL_5211)
 
 /*
- * FCS failure register
+ * FCS failure (MIB counter)
  */
 #define AR5K_FCS_FAIL_5210     0x809c
 #define AR5K_FCS_FAIL_5211     0x8094
 
 /*
  * Profile count registers
+ *
+ * These registers can be cleared and freezed with ATH5K_MIBC, but they do not
+ * generate a MIB interrupt.
+ * Instead of overflowing, they shift by one bit to the right. All registers
+ * shift together, i.e. when one reaches the max, all shift at the same time by
+ * one bit to the right. This way we should always get consistent values.
  */
 #define AR5K_PROFCNT_TX                        0x80ec  /* Tx count */
 #define AR5K_PROFCNT_RX                        0x80f0  /* Rx count */
-#define AR5K_PROFCNT_RXCLR             0x80f4  /* Clear Rx count */
-#define AR5K_PROFCNT_CYCLE             0x80f8  /* Cycle count (?) */
+#define AR5K_PROFCNT_RXCLR             0x80f4  /* Busy count */
+#define AR5K_PROFCNT_CYCLE             0x80f8  /* Cycle counter */
 
 /*
  * Quiet period control registers
 #define        AR5K_CCK_FIL_CNT                0x8128
 
 /*
- * PHY Error Counters (?)
+ * PHY Error Counters (same masks as AR5K_PHY_ERR_FIL)
  */
 #define        AR5K_PHYERR_CNT1                0x812c
 #define        AR5K_PHYERR_CNT1_MASK           0x8130
 #define        AR5K_PHYERR_CNT2                0x8134
 #define        AR5K_PHYERR_CNT2_MASK           0x8138
 
+/* if the PHY Error Counters reach this maximum, we get MIB interrupts */
+#define ATH5K_PHYERR_CNT_MAX           0x00c00000
+
 /*
  * TSF Threshold register (?)
  */
 #define AR5K_PHY_SETTLING              0x9844                  /* Register Address */
 #define        AR5K_PHY_SETTLING_AGC           0x0000007f      /* AGC settling time */
 #define        AR5K_PHY_SETTLING_AGC_S         0
-#define        AR5K_PHY_SETTLING_SWITCH        0x00003f80      /* Switch settlig time */
+#define        AR5K_PHY_SETTLING_SWITCH        0x00003f80      /* Switch settling time */
 #define        AR5K_PHY_SETTLING_SWITCH_S      7
 
 /*