aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath
diff options
context:
space:
mode:
authorBruno Randolf <br1@einfach.org>2010-03-25 01:49:42 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-03-31 14:39:10 -0400
commitda35111ad970081bdf6e848d1861c7d16e71079b (patch)
tree2cdb7d166f14d89526dfb6dbf2a33b5b060b0edc /drivers/net/wireless/ath
parent495391d715a310a7cbf622850e372d40ac86ef6e (diff)
ath5k: update phy errors codes
Update PHY error codes from the HAL, and keep them in statistics for debugging via the 'frameerrors' file. This will also be used by ANI. Signed-off-by: Bruno Randolf <br1@einfach.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath')
-rw-r--r--drivers/net/wireless/ath/ath5k/base.c2
-rw-r--r--drivers/net/wireless/ath/ath5k/base.h1
-rw-r--r--drivers/net/wireless/ath/ath5k/debug.c8
-rw-r--r--drivers/net/wireless/ath/ath5k/desc.h35
4 files changed, 37 insertions, 9 deletions
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index ea33b993b28e..a1c0dcb4926e 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -1940,6 +1940,8 @@ ath5k_tasklet_rx(unsigned long data)
1940 sc->stats.rxerr_fifo++; 1940 sc->stats.rxerr_fifo++;
1941 if (rs.rs_status & AR5K_RXERR_PHY) { 1941 if (rs.rs_status & AR5K_RXERR_PHY) {
1942 sc->stats.rxerr_phy++; 1942 sc->stats.rxerr_phy++;
1943 if (rs.rs_phyerr > 0 && rs.rs_phyerr < 32)
1944 sc->stats.rxerr_phy_code[rs.rs_phyerr]++;
1943 goto next; 1945 goto next;
1944 } 1946 }
1945 if (rs.rs_status & AR5K_RXERR_DECRYPT) { 1947 if (rs.rs_status & AR5K_RXERR_DECRYPT) {
diff --git a/drivers/net/wireless/ath/ath5k/base.h b/drivers/net/wireless/ath/ath5k/base.h
index fe5dae517545..a572a4844800 100644
--- a/drivers/net/wireless/ath/ath5k/base.h
+++ b/drivers/net/wireless/ath/ath5k/base.h
@@ -116,6 +116,7 @@ struct ath5k_statistics {
116 unsigned int tx_all_count; /* all TX frames, including errors */ 116 unsigned int tx_all_count; /* all TX frames, including errors */
117 unsigned int rxerr_crc; 117 unsigned int rxerr_crc;
118 unsigned int rxerr_phy; 118 unsigned int rxerr_phy;
119 unsigned int rxerr_phy_code[32];
119 unsigned int rxerr_fifo; 120 unsigned int rxerr_fifo;
120 unsigned int rxerr_decrypt; 121 unsigned int rxerr_decrypt;
121 unsigned int rxerr_mic; 122 unsigned int rxerr_mic;
diff --git a/drivers/net/wireless/ath/ath5k/debug.c b/drivers/net/wireless/ath/ath5k/debug.c
index bccd4a78027e..90247dc74198 100644
--- a/drivers/net/wireless/ath/ath5k/debug.c
+++ b/drivers/net/wireless/ath/ath5k/debug.c
@@ -474,6 +474,7 @@ static ssize_t read_file_frameerrors(struct file *file, char __user *user_buf,
474 struct ath5k_statistics *st = &sc->stats; 474 struct ath5k_statistics *st = &sc->stats;
475 char buf[700]; 475 char buf[700];
476 unsigned int len = 0; 476 unsigned int len = 0;
477 int i;
477 478
478 len += snprintf(buf+len, sizeof(buf)-len, 479 len += snprintf(buf+len, sizeof(buf)-len,
479 "RX\n---------------------\n"); 480 "RX\n---------------------\n");
@@ -485,6 +486,13 @@ static ssize_t read_file_frameerrors(struct file *file, char __user *user_buf,
485 st->rxerr_phy, 486 st->rxerr_phy,
486 st->rx_all_count > 0 ? 487 st->rx_all_count > 0 ?
487 st->rxerr_phy*100/st->rx_all_count : 0); 488 st->rxerr_phy*100/st->rx_all_count : 0);
489 for (i = 0; i < 32; i++) {
490 if (st->rxerr_phy_code[i])
491 len += snprintf(buf+len, sizeof(buf)-len,
492 " phy_err[%d]\t%d\n",
493 i, st->rxerr_phy_code[i]);
494 }
495
488 len += snprintf(buf+len, sizeof(buf)-len, "FIFO\t%d\t(%d%%)\n", 496 len += snprintf(buf+len, sizeof(buf)-len, "FIFO\t%d\t(%d%%)\n",
489 st->rxerr_fifo, 497 st->rxerr_fifo,
490 st->rx_all_count > 0 ? 498 st->rx_all_count > 0 ?
diff --git a/drivers/net/wireless/ath/ath5k/desc.h b/drivers/net/wireless/ath/ath5k/desc.h
index 56158c804e3e..64538fbe4167 100644
--- a/drivers/net/wireless/ath/ath5k/desc.h
+++ b/drivers/net/wireless/ath/ath5k/desc.h
@@ -112,15 +112,32 @@ struct ath5k_hw_rx_error {
112#define AR5K_RX_DESC_ERROR1_PHY_ERROR_CODE 0x0000ff00 112#define AR5K_RX_DESC_ERROR1_PHY_ERROR_CODE 0x0000ff00
113#define AR5K_RX_DESC_ERROR1_PHY_ERROR_CODE_S 8 113#define AR5K_RX_DESC_ERROR1_PHY_ERROR_CODE_S 8
114 114
115/* PHY Error codes */ 115/**
116#define AR5K_DESC_RX_PHY_ERROR_NONE 0x00 116 * enum ath5k_phy_error_code - PHY Error codes
117#define AR5K_DESC_RX_PHY_ERROR_TIMING 0x20 117 */
118#define AR5K_DESC_RX_PHY_ERROR_PARITY 0x40 118enum ath5k_phy_error_code {
119#define AR5K_DESC_RX_PHY_ERROR_RATE 0x60 119 AR5K_RX_PHY_ERROR_UNDERRUN = 0, /* Transmit underrun */
120#define AR5K_DESC_RX_PHY_ERROR_LENGTH 0x80 120 AR5K_RX_PHY_ERROR_TIMING = 1, /* Timing error */
121#define AR5K_DESC_RX_PHY_ERROR_64QAM 0xa0 121 AR5K_RX_PHY_ERROR_PARITY = 2, /* Illegal parity */
122#define AR5K_DESC_RX_PHY_ERROR_SERVICE 0xc0 122 AR5K_RX_PHY_ERROR_RATE = 3, /* Illegal rate */
123#define AR5K_DESC_RX_PHY_ERROR_TRANSMITOVR 0xe0 123 AR5K_RX_PHY_ERROR_LENGTH = 4, /* Illegal length */
124 AR5K_RX_PHY_ERROR_RADAR = 5, /* Radar detect */
125 AR5K_RX_PHY_ERROR_SERVICE = 6, /* Illegal service */
126 AR5K_RX_PHY_ERROR_TOR = 7, /* Transmit override receive */
127 /* these are specific to the 5212 */
128 AR5K_RX_PHY_ERROR_OFDM_TIMING = 17,
129 AR5K_RX_PHY_ERROR_OFDM_SIGNAL_PARITY = 18,
130 AR5K_RX_PHY_ERROR_OFDM_RATE_ILLEGAL = 19,
131 AR5K_RX_PHY_ERROR_OFDM_LENGTH_ILLEGAL = 20,
132 AR5K_RX_PHY_ERROR_OFDM_POWER_DROP = 21,
133 AR5K_RX_PHY_ERROR_OFDM_SERVICE = 22,
134 AR5K_RX_PHY_ERROR_OFDM_RESTART = 23,
135 AR5K_RX_PHY_ERROR_CCK_TIMING = 25,
136 AR5K_RX_PHY_ERROR_CCK_HEADER_CRC = 26,
137 AR5K_RX_PHY_ERROR_CCK_RATE_ILLEGAL = 27,
138 AR5K_RX_PHY_ERROR_CCK_SERVICE = 30,
139 AR5K_RX_PHY_ERROR_CCK_RESTART = 31,
140};
124 141
125/* 142/*
126 * 5210/5211 hardware 2-word TX control descriptor 143 * 5210/5211 hardware 2-word TX control descriptor