summaryrefslogtreecommitdiffstats
path: root/qcwcn/wifi_hal/pkt_stats.h
diff options
context:
space:
mode:
Diffstat (limited to 'qcwcn/wifi_hal/pkt_stats.h')
-rw-r--r--qcwcn/wifi_hal/pkt_stats.h154
1 files changed, 130 insertions, 24 deletions
diff --git a/qcwcn/wifi_hal/pkt_stats.h b/qcwcn/wifi_hal/pkt_stats.h
index a8bd10e..89e51e9 100644
--- a/qcwcn/wifi_hal/pkt_stats.h
+++ b/qcwcn/wifi_hal/pkt_stats.h
@@ -44,6 +44,30 @@
#define PKTLOG_TYPE_RC_UPDATE 7
#define PKTLOG_TYPE_TX_VIRT_ADDR 8
#define PKTLOG_TYPE_MAX 9
+#define BW_OFFSET 8
+#define INVALID_RSSI 255
+
+#define PKT_INFO_FLG_TX_LOCAL_S 0x1
+#define PKT_INFO_FLG_RX_HOST_RXD 0x2
+#define PKT_INFO_FLG_TX_REMOTE_S 0x4
+#define PKT_INFO_FLG_RX_LOCAL_S 0x8
+#define PKT_INFO_FLG_RX_REMOTE_S 0x10
+#define PKT_INFO_FLG_RX_LOCAL_DISCARD_S 0x20
+#define PKT_INFO_FLG_RX_REMOTE_DISCARD_S 0x40
+#define PKT_INFO_FLG_RX_REORDER_STORE_S 0x80
+#define PKT_INFO_FLG_RX_REORDER_DROP_S 0x100
+#define PKT_INFO_FLG_RX_PEER_INFO_S 0x200
+#define PKT_INFO_FLG_UNKNOWN_S 0x400
+
+/* MASK value of flags based on RX_STAT content.
+ * These are the events that carry Rx decriptor
+ */
+#define PKT_INFO_FLG_RX_RXDESC_MASK \
+ (PKT_INFO_FLG_RX_HOST_RXD | \
+ PKT_INFO_FLG_RX_LOCAL_S | \
+ PKT_INFO_FLG_RX_REMOTE_S | \
+ PKT_INFO_FLG_RX_LOCAL_DISCARD_S | \
+ PKT_INFO_FLG_RX_REMOTE_DISCARD_S)
/* Format of the packet stats event*/
typedef struct {
@@ -55,6 +79,24 @@ typedef struct {
} __attribute__((packed)) wh_pktlog_hdr_t;
/*Rx stats specific structures. */
+struct rx_attention {
+ u32 first_mpdu : 1; //[0]
+ u32 last_mpdu : 1; //[1]
+ 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 {
u32 reserved1 : 13; //[12:0]
@@ -83,17 +125,40 @@ struct rx_msdu_start {
u32 reserved3 : 22; //[31:10]
} __attribute__((packed));
+struct rx_msdu_end {
+ u32 reserved1[4];
+ u32 reserved2 : 15;
+ u32 last_msdu : 1; //[15]
+ u32 reserved3 : 16; //[31:16]
+} __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
#define PREAMBLE_VHT_SIG_A_1 0x08
#define PREAMBLE_VHT_SIG_A_2 0x0c
+/* Wifi Logger preamble */
+#define WL_PREAMBLE_CCK 0
+#define WL_PREAMBLE_OFDM 1
+#define WL_PREAMBLE_HT 2
+#define WL_PREAMBLE_VHT 3
+
#define BITMASK(x) ((1<<(x)) - 1 )
+#define MAX_BA_WINDOW_SIZE 64
+#define SEQ_NUM_RANGE 4096
+#define BITMAP_VAR_SIZE 32
+
/* Contains MCS related stats */
struct rx_ppdu_start {
u32 reserved1[4];
@@ -111,17 +176,20 @@ 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
+#define MAX_RXMPDUS_PER_AMPDU 64
#define RX_HTT_HDR_STATUS_LEN 64
typedef struct {
- u32 reserved1[2];
+ struct rx_attention attention;
+ u32 reserved1;
struct rx_mpdu_start mpdu_start;
struct rx_msdu_start msdu_start;
- u32 reserved2[5];
+ struct rx_msdu_end msdu_end;
struct rx_mpdu_end mpdu_end;
struct rx_ppdu_start ppdu_start;
struct rx_ppdu_end ppdu_end;
@@ -130,25 +198,34 @@ typedef struct {
/*Tx stats specific structures. */
struct ppdu_status {
- u32 reserved1 : 31; //[30:0]
+ u32 ba_start_seq_num : 12; //[11:0]
+ u32 reserved1 : 3; //[14:12]
+ u32 ba_status : 1; //[15]
+ u32 reserved2 : 15; //[30:16]
u32 tx_ok : 1; //[31]
- u32 reserved2[10];
+ u32 ba_bitmap_31_0 : 32; //[31:0]
+ u32 ba_bitmap_63_32 : 32; //[31:0]
+ u32 reserved3[8];
u32 ack_rssi_ave : 8; //[7:0]
- u32 reserved3 : 16; //[23:8]
+ u32 reserved4 : 16; //[23:8]
u32 total_tries : 5; //[28:24]
- u32 reserved4 : 3; //[31:29]
- u32 reserved5[4];
+ u32 reserved5 : 3; //[31:29]
+ u32 reserved6[4];
} __attribute__((packed));
/*Contains tx timestamp*/
struct try_status {
u32 timestamp : 23; //[22:0]
- u32 reserved : 9; //[23]
+ u32 reserved1 : 1; //[23]
+ u32 series : 1; //[24]
+ u32 reserved2 : 3; //[27:25]
+ u32 packet_bw : 2; //[29:28]
+ u32 reserved3 : 1; //[30]
+ u32 tx_packet : 1; //[31]
} __attribute__((packed));
struct try_list {
- struct try_status try_00;
- u32 reserved[15];
+ struct try_status try_st[16];
} __attribute__((packed));
@@ -181,13 +258,19 @@ struct tx_ppdu_start {
u32 reserved1[2];
u32 start_seq_num : 12; //[11:0]
u32 reserved2 : 20; //[31:12]
- u32 reserved3[11];
- u32 reserved4 : 16; //[15:0]
+ u32 seqnum_bitmap_31_0 : 32; //[31:0]
+ u32 seqnum_bitmap_63_32 : 32; //[31:0]
+ u32 reserved3[8];
+ u32 reserved4 : 15; //[14:0]
+ u32 ampdu : 1; //[15]
+ u32 no_ack : 1; //[16]
+ u32 reserved5 : 15; //[31:17]
+ u32 reserved6 : 16; //[15:0]
u32 frame_control : 16; //[31:16]
- u32 reserved5 : 16; //[23:21]
+ u32 reserved7 : 16; //[23:21]
u32 qos_ctl : 16; //[31:16]
- u32 reserved6[4];
- u32 reserved7 : 24; //[23:21]
+ u32 reserved8[4];
+ u32 reserved9 : 24; //[23:21]
u32 valid_s0_bw20 : 1; //[24]
u32 valid_s0_bw40 : 1; //[25]
u32 valid_s0_bw80 : 1; //[26]
@@ -204,7 +287,7 @@ struct tx_ppdu_start {
struct series_bw s1_bw40;
struct series_bw s1_bw80;
struct series_bw s1_bw160;
- u32 reserved8[3];
+ u32 reserved10[3];
} __attribute__((packed));
#define PKTLOG_MAX_TXCTL_WORDS 57 /* +2 words for bitmap */
@@ -227,14 +310,26 @@ typedef struct {
*/
#define RING_BUF_ENTRY_SIZE 512
+#define PKT_STATS_BUF_SIZE 128
struct pkt_stats_s {
u8 tx_stats_events;
- u32 prev_seq_no;
/* TODO: Need to handle the case if size of the stats are more
* than 512 bytes. Currently, the tx size is 34 bytes and ring buffer entry
* size is 12 bytes.
*/
- u8 tx_stats[RING_BUF_ENTRY_SIZE];
+ u8 tx_stats[PKT_STATS_BUF_SIZE];
+ u8 num_msdu;
+ u16 start_seq_num;
+ u16 ba_seq_num;
+ u32 ba_bitmap_31_0;
+ u32 ba_bitmap_63_32;
+ u32 tx_seqnum_bitmap_31_0;
+ u32 tx_seqnum_bitmap_63_32;
+ u32 shifted_bitmap_31_0;
+ u32 shifted_bitmap_63_32;
+ bool isBlockAck;
+ u8 tx_bandwidth;
+ u8 series;
};
typedef union {
@@ -242,11 +337,22 @@ typedef union {
u16 rate : 4;
u16 nss : 2;
u16 preamble : 2;
- u16 bw : 8;
+ u16 bw : 2;
+ u16 short_gi : 1;
+ u16 reserved : 5;
} mcs_s;
u16 mcs;
} MCS;
+typedef struct {
+ MCS RxMCS;
+ u16 last_transmit_rate;
+ u16 rssi;
+ u32 timestamp;
+ u8 tid;
+} rx_aggr_stats;
+
+
typedef struct drv_msg_s
{
u16 length;