Commit da35111a authored by Bruno Randolf's avatar Bruno Randolf Committed by John W. Linville

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: default avatarBruno Randolf <br1@einfach.org>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 495391d7
...@@ -1940,6 +1940,8 @@ ath5k_tasklet_rx(unsigned long data) ...@@ -1940,6 +1940,8 @@ ath5k_tasklet_rx(unsigned long data)
sc->stats.rxerr_fifo++; sc->stats.rxerr_fifo++;
if (rs.rs_status & AR5K_RXERR_PHY) { if (rs.rs_status & AR5K_RXERR_PHY) {
sc->stats.rxerr_phy++; sc->stats.rxerr_phy++;
if (rs.rs_phyerr > 0 && rs.rs_phyerr < 32)
sc->stats.rxerr_phy_code[rs.rs_phyerr]++;
goto next; goto next;
} }
if (rs.rs_status & AR5K_RXERR_DECRYPT) { if (rs.rs_status & AR5K_RXERR_DECRYPT) {
......
...@@ -116,6 +116,7 @@ struct ath5k_statistics { ...@@ -116,6 +116,7 @@ struct ath5k_statistics {
unsigned int tx_all_count; /* all TX frames, including errors */ unsigned int tx_all_count; /* all TX frames, including errors */
unsigned int rxerr_crc; unsigned int rxerr_crc;
unsigned int rxerr_phy; unsigned int rxerr_phy;
unsigned int rxerr_phy_code[32];
unsigned int rxerr_fifo; unsigned int rxerr_fifo;
unsigned int rxerr_decrypt; unsigned int rxerr_decrypt;
unsigned int rxerr_mic; unsigned int rxerr_mic;
......
...@@ -474,6 +474,7 @@ static ssize_t read_file_frameerrors(struct file *file, char __user *user_buf, ...@@ -474,6 +474,7 @@ static ssize_t read_file_frameerrors(struct file *file, char __user *user_buf,
struct ath5k_statistics *st = &sc->stats; struct ath5k_statistics *st = &sc->stats;
char buf[700]; char buf[700];
unsigned int len = 0; unsigned int len = 0;
int i;
len += snprintf(buf+len, sizeof(buf)-len, len += snprintf(buf+len, sizeof(buf)-len,
"RX\n---------------------\n"); "RX\n---------------------\n");
...@@ -485,6 +486,13 @@ static ssize_t read_file_frameerrors(struct file *file, char __user *user_buf, ...@@ -485,6 +486,13 @@ static ssize_t read_file_frameerrors(struct file *file, char __user *user_buf,
st->rxerr_phy, st->rxerr_phy,
st->rx_all_count > 0 ? st->rx_all_count > 0 ?
st->rxerr_phy*100/st->rx_all_count : 0); st->rxerr_phy*100/st->rx_all_count : 0);
for (i = 0; i < 32; i++) {
if (st->rxerr_phy_code[i])
len += snprintf(buf+len, sizeof(buf)-len,
" phy_err[%d]\t%d\n",
i, st->rxerr_phy_code[i]);
}
len += snprintf(buf+len, sizeof(buf)-len, "FIFO\t%d\t(%d%%)\n", len += snprintf(buf+len, sizeof(buf)-len, "FIFO\t%d\t(%d%%)\n",
st->rxerr_fifo, st->rxerr_fifo,
st->rx_all_count > 0 ? st->rx_all_count > 0 ?
......
...@@ -112,15 +112,32 @@ struct ath5k_hw_rx_error { ...@@ -112,15 +112,32 @@ struct ath5k_hw_rx_error {
#define AR5K_RX_DESC_ERROR1_PHY_ERROR_CODE 0x0000ff00 #define AR5K_RX_DESC_ERROR1_PHY_ERROR_CODE 0x0000ff00
#define AR5K_RX_DESC_ERROR1_PHY_ERROR_CODE_S 8 #define AR5K_RX_DESC_ERROR1_PHY_ERROR_CODE_S 8
/* PHY Error codes */ /**
#define AR5K_DESC_RX_PHY_ERROR_NONE 0x00 * enum ath5k_phy_error_code - PHY Error codes
#define AR5K_DESC_RX_PHY_ERROR_TIMING 0x20 */
#define AR5K_DESC_RX_PHY_ERROR_PARITY 0x40 enum ath5k_phy_error_code {
#define AR5K_DESC_RX_PHY_ERROR_RATE 0x60 AR5K_RX_PHY_ERROR_UNDERRUN = 0, /* Transmit underrun */
#define AR5K_DESC_RX_PHY_ERROR_LENGTH 0x80 AR5K_RX_PHY_ERROR_TIMING = 1, /* Timing error */
#define AR5K_DESC_RX_PHY_ERROR_64QAM 0xa0 AR5K_RX_PHY_ERROR_PARITY = 2, /* Illegal parity */
#define AR5K_DESC_RX_PHY_ERROR_SERVICE 0xc0 AR5K_RX_PHY_ERROR_RATE = 3, /* Illegal rate */
#define AR5K_DESC_RX_PHY_ERROR_TRANSMITOVR 0xe0 AR5K_RX_PHY_ERROR_LENGTH = 4, /* Illegal length */
AR5K_RX_PHY_ERROR_RADAR = 5, /* Radar detect */
AR5K_RX_PHY_ERROR_SERVICE = 6, /* Illegal service */
AR5K_RX_PHY_ERROR_TOR = 7, /* Transmit override receive */
/* these are specific to the 5212 */
AR5K_RX_PHY_ERROR_OFDM_TIMING = 17,
AR5K_RX_PHY_ERROR_OFDM_SIGNAL_PARITY = 18,
AR5K_RX_PHY_ERROR_OFDM_RATE_ILLEGAL = 19,
AR5K_RX_PHY_ERROR_OFDM_LENGTH_ILLEGAL = 20,
AR5K_RX_PHY_ERROR_OFDM_POWER_DROP = 21,
AR5K_RX_PHY_ERROR_OFDM_SERVICE = 22,
AR5K_RX_PHY_ERROR_OFDM_RESTART = 23,
AR5K_RX_PHY_ERROR_CCK_TIMING = 25,
AR5K_RX_PHY_ERROR_CCK_HEADER_CRC = 26,
AR5K_RX_PHY_ERROR_CCK_RATE_ILLEGAL = 27,
AR5K_RX_PHY_ERROR_CCK_SERVICE = 30,
AR5K_RX_PHY_ERROR_CCK_RESTART = 31,
};
/* /*
* 5210/5211 hardware 2-word TX control descriptor * 5210/5211 hardware 2-word TX control descriptor
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment