qcacmn: HAL Changes for RX packet capture

Add HAL apis for populate RX packet capture params.

CRs-Fixed: 2891049
Change-Id: I0befd3001a40fd286704699f4ec682f7c390fbda
This commit is contained in:
Mohit Khanna
2021-02-28 20:34:45 -08:00
committed by Rakesh Pillai
parent 477928661c
commit f3e19b41d3
3 changed files with 42 additions and 1 deletions

View File

@@ -623,6 +623,15 @@ enum hal_reo_cmd_type {
CMD_UPDATE_RX_REO_QUEUE = 5 CMD_UPDATE_RX_REO_QUEUE = 5
}; };
struct hal_rx_pkt_capture_flags {
uint8_t encrypt_type;
uint8_t fragment_flag;
uint8_t fcs_err;
uint32_t chan_freq;
uint32_t rssi_comb;
uint64_t tsft;
};
struct hal_hw_txrx_ops { struct hal_hw_txrx_ops {
/* init and setup */ /* init and setup */
void (*hal_srng_dst_hw_init)(struct hal_soc *hal, void (*hal_srng_dst_hw_init)(struct hal_soc *hal,

View File

@@ -21,6 +21,7 @@
#include <hal_api.h> #include <hal_api.h>
#include "hal_rx_hw_defines.h" #include "hal_rx_hw_defines.h"
#include "hal_hw_headers.h"
/************************************* /*************************************
* Ring desc offset/shift/masks * Ring desc offset/shift/masks
@@ -2697,6 +2698,17 @@ hal_rx_tlv_csum_err_get(hal_soc_handle_t hal_soc_hdl, uint8_t *rx_tlv_hdr,
tcp_udp_csum_err); tcp_udp_csum_err);
} }
static inline void
hal_rx_tlv_get_pkt_capture_flags(hal_soc_handle_t hal_soc_hdl,
uint8_t *rx_tlv_hdr,
struct hal_rx_pkt_capture_flags *flags)
{
struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
return hal_soc->ops->hal_rx_tlv_get_pkt_capture_flags(rx_tlv_hdr,
flags);
}
static inline uint8_t static inline uint8_t
hal_rx_err_status_get(hal_soc_handle_t hal_soc_hdl, hal_ring_desc_t rx_desc) hal_rx_err_status_get(hal_soc_handle_t hal_soc_hdl, hal_ring_desc_t rx_desc)
{ {

View File

@@ -20,7 +20,7 @@
#include "hal_li_hw_headers.h" #include "hal_li_hw_headers.h"
#include "hal_li_reo.h" #include "hal_li_reo.h"
#include "hal_rx.h" // hal_reo_config #include "hal_rx.h"
#include "hal_li_rx.h" #include "hal_li_rx.h"
#include "hal_tx.h" #include "hal_tx.h"
#include <hal_api_mon.h> #include <hal_api_mon.h>
@@ -919,6 +919,26 @@ hal_rx_tlv_csum_err_get_li(uint8_t *rx_tlv_hdr, uint32_t *ip_csum_err,
*tcp_udp_csum_err = hal_rx_attn_tcp_udp_cksum_fail_get(rx_tlv_hdr); *tcp_udp_csum_err = hal_rx_attn_tcp_udp_cksum_fail_get(rx_tlv_hdr);
} }
static
void hal_rx_tlv_get_pkt_capture_flags_li(uint8_t *rx_tlv_pkt_hdr,
struct hal_rx_pkt_capture_flags *flags)
{
struct rx_pkt_tlvs *rx_tlv_hdr = (struct rx_pkt_tlvs *)rx_tlv_pkt_hdr;
struct rx_attention *rx_attn = &rx_tlv_hdr->attn_tlv.rx_attn;
struct rx_mpdu_start *mpdu_start =
&rx_tlv_hdr->mpdu_start_tlv.rx_mpdu_start;
struct rx_mpdu_end *mpdu_end = &rx_tlv_hdr->mpdu_end_tlv.rx_mpdu_end;
struct rx_msdu_start *msdu_start =
&rx_tlv_hdr->msdu_start_tlv.rx_msdu_start;
flags->encrypt_type = mpdu_start->rx_mpdu_info_details.encrypt_type;
flags->fcs_err = mpdu_end->fcs_err;
flags->fragment_flag = rx_attn->fragment_flag;
flags->chan_freq = HAL_RX_MSDU_START_FREQ_GET(msdu_start);
flags->rssi_comb = HAL_RX_MSDU_START_RSSI_GET(msdu_start);
flags->tsft = msdu_start->ppdu_start_timestamp;
}
static uint8_t hal_rx_err_status_get_li(hal_ring_desc_t rx_desc) static uint8_t hal_rx_err_status_get_li(hal_ring_desc_t rx_desc)
{ {
return HAL_RX_ERROR_STATUS_GET(rx_desc); return HAL_RX_ERROR_STATUS_GET(rx_desc);