summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmarnath Hullur Subramanyam <amarnath@codeaurora.org>2015-07-03 14:12:50 +0530
committerVineeta Srivastava <vsrivastava@google.com>2015-07-09 11:59:09 -0700
commite71133216d9b9e3af5cde78572f220818a72ab6e (patch)
tree7653d85e71a338ebedfab05659250c6eb7d8b11a
parent20c7b34cdd5fe85d0491c63efd5cbfae23db1392 (diff)
downloadwlan-e71133216d9b9e3af5cde78572f220818a72ab6e.tar.gz
WiFi-HAL: Decode rate and set status for Rx packets properly
1. Firmware sends stats for failed Rx packets with corresponding error code. Set Rx packet status as success only if none of the error bits are set. 2. Indicate tsf timestamp as the packet timestamp for Rx packets. 3. Correct the rate index calculation. Change-Id: Icbe0c0bb8d8d61d55d1f01b247eb784365dcf8f4
-rw-r--r--qcwcn/wifi_hal/pkt_stats.h36
-rw-r--r--qcwcn/wifi_hal/wifilogger_diag.cpp15
2 files changed, 38 insertions, 13 deletions
diff --git a/qcwcn/wifi_hal/pkt_stats.h b/qcwcn/wifi_hal/pkt_stats.h
index 03a8abd..8f33eb3 100644
--- a/qcwcn/wifi_hal/pkt_stats.h
+++ b/qcwcn/wifi_hal/pkt_stats.h
@@ -84,7 +84,20 @@ typedef struct {
struct rx_attention {
u32 first_mpdu : 1; //[0]
u32 last_mpdu : 1; //[1]
- u32 reserved2 : 30; //[30:2]
+ u32 reserved1 : 6; //[7:2]
+ u32 mgmt_type : 1; //[8]
+ u32 ctrl_type : 1; //[9]
+ u32 reserved2 : 6; //[15:10]
+ u32 overflow_err : 1; //[16]
+ u32 msdu_length_err : 1; //[17]
+ u32 tcp_udp_chksum_fail : 1; //[18]
+ u32 ip_chksum_fail : 1; //[19]
+ u32 reserved3 : 7; //[26:20]
+ u32 mpdu_length_err : 1; //[27]
+ u32 tkip_mic_err : 1; //[28]
+ u32 decrypt_err : 1; //[29]
+ u32 fcs_err : 1; //[30]
+ u32 msdu_done : 1; //[31]
} __attribute__((packed));
struct rx_mpdu_start {
@@ -122,9 +135,15 @@ struct rx_msdu_end {
} __attribute__((packed));
struct rx_mpdu_end {
- u32 reserved1 : 29; //[28:0]
+ u32 reserved1 : 13; //[12:0]
+ u32 overflow_err : 1; //[13]
+ u32 last_mpdu : 1; //[14]
+ u32 post_delim_err : 1; //[15]
+ u32 reserved2 : 12; //[27:16]
+ u32 mpdu_length_err : 1; //[28]
u32 tkip_mic_err : 1; //[29]
- u32 reserved2 : 2; //[31:30]
+ u32 decrypt_err : 1; //[30]
+ u32 fcs_err : 1; //[31]
} __attribute__((packed));
#define PREAMBLE_L_SIG_RATE 0x04
@@ -159,9 +178,9 @@ struct rx_ppdu_start {
} __attribute__((packed));
struct rx_ppdu_end {
- u32 reserved1[17];
- u32 wb_timestamp;
- u32 reserved2[4];
+ u32 reserved1[16];
+ u32 tsf_timestamp;
+ u32 reserved2[5];
} __attribute__((packed));
#define MAX_MSDUS_PER_MPDU 3
@@ -201,7 +220,8 @@ struct try_status {
u32 timestamp : 23; //[22:0]
u32 reserved1 : 5; //[23]
u32 packet_bw : 2; //[29:28]
- u32 reserved2 : 2; //[31:30]
+ u32 reserved2 : 1; //[30]
+ u32 tx_packet : 1; //[31]
} __attribute__((packed));
struct try_list {
@@ -327,7 +347,7 @@ typedef struct {
MCS RxMCS;
u16 last_transmit_rate;
u16 rssi;
- u32 wb_timestamp;
+ u32 timestamp;
} rx_aggr_stats;
diff --git a/qcwcn/wifi_hal/wifilogger_diag.cpp b/qcwcn/wifi_hal/wifilogger_diag.cpp
index 5cf7a9c..a92e437 100644
--- a/qcwcn/wifi_hal/wifilogger_diag.cpp
+++ b/qcwcn/wifi_hal/wifilogger_diag.cpp
@@ -1111,7 +1111,7 @@ static wifi_error populate_rx_aggr_stats(hal_info *info)
pps_entry->MCS = info->aggr_stats.RxMCS.mcs;
pps_entry->last_transmit_rate = info->aggr_stats.last_transmit_rate;
pps_entry->rssi = info->aggr_stats.rssi;
- pps_entry->firmware_entry_timestamp = info->aggr_stats.wb_timestamp;
+ pps_entry->firmware_entry_timestamp = info->aggr_stats.timestamp;
index += pRingBufferEntry->entry_size;
status = update_stats_to_ring_buf(info, (u8 *)pRingBufferEntry,
@@ -1196,7 +1196,12 @@ static wifi_error parse_rx_stats(hal_info *info, u8 *buf, u16 size)
/* Peer tx packet and it is an Rx packet for us */
rb_pkt_stats->flags |= PER_PACKET_ENTRY_FLAGS_DIRECTION_TX;
- if (!rx_stats_rcvd->mpdu_end.tkip_mic_err)
+ if (!((rx_stats_rcvd->mpdu_end.overflow_err) ||
+ (rx_stats_rcvd->attention.fcs_err) ||
+ (rx_stats_rcvd->attention.mpdu_length_err) ||
+ (rx_stats_rcvd->attention.msdu_length_err) ||
+ (rx_stats_rcvd->attention.tkip_mic_err) ||
+ (rx_stats_rcvd->attention.decrypt_err)))
rb_pkt_stats->flags |= PER_PACKET_ENTRY_FLAGS_TX_SUCCESS;
rb_pkt_stats->flags |= PER_PACKET_ENTRY_FLAGS_80211_HEADER;
@@ -1210,9 +1215,9 @@ static wifi_error parse_rx_stats(hal_info *info, u8 *buf, u16 size)
MCS *mcs = &info->aggr_stats.RxMCS;
u32 ht_vht_sig;
if (rx_stats_rcvd->ppdu_start.preamble_type == PREAMBLE_L_SIG_RATE) {
- if (!rx_stats_rcvd->ppdu_start.l_sig_rate_select)
+ if (rx_stats_rcvd->ppdu_start.l_sig_rate_select)
mcs->mcs_s.preamble = WL_PREAMBLE_OFDM;
- mcs->mcs_s.rate = rx_stats_rcvd->ppdu_start.l_sig_rate >> 3;
+ mcs->mcs_s.rate = rx_stats_rcvd->ppdu_start.l_sig_rate - 8;
/*BW is 0 for legacy cases*/
} else if (rx_stats_rcvd->ppdu_start.preamble_type ==
PREAMBLE_VHT_SIG_A_1) {
@@ -1250,7 +1255,7 @@ static wifi_error parse_rx_stats(hal_info *info, u8 *buf, u16 size)
&& rx_stats_rcvd->msdu_end.last_msdu)
|| (rx_stats_rcvd->attention.first_mpdu
&& rx_stats_rcvd->attention.last_mpdu)) {
- info->aggr_stats.wb_timestamp = rx_stats_rcvd->ppdu_end.wb_timestamp;
+ info->aggr_stats.timestamp = rx_stats_rcvd->ppdu_end.tsf_timestamp;
status = populate_rx_aggr_stats(info);
}