qcacmn: Protocol tag support in lite rx monitor

Add protocol tagging support in lite rx monitor mode.

Change-Id: I1966fc4f54e1f4a1486162a88853f68f7644a766
CRs-Fixed: 2448517
This commit is contained in:
Karunakar Dasineni
2019-05-07 07:00:24 -07:00
committed by nshrivas
parent ac6b275768
commit acc8b565b3
6 changed files with 53 additions and 9 deletions

View File

@@ -1190,7 +1190,6 @@ struct cdp_htt_rx_pdev_stats {
* protocol types * protocol types
*/ */
#define RX_PROTOCOL_TAG_ALL 0xff #define RX_PROTOCOL_TAG_ALL 0xff
#endif /* WLAN_SUPPORT_RX_PROTOCOL_TYPE_TAG */ #endif /* WLAN_SUPPORT_RX_PROTOCOL_TYPE_TAG */
/* struct cdp_pdev_stats - pdev stats /* struct cdp_pdev_stats - pdev stats

View File

@@ -82,11 +82,11 @@ extern int con_mode_monitor;
* Return: QDF_STATUS * Return: QDF_STATUS
*/ */
static QDF_STATUS static QDF_STATUS
dp_config_enh_rx_capture(struct cdp_pdev *pdev_handle, int val) dp_config_enh_rx_capture(struct cdp_pdev *pdev_handle, uint8_t val)
{ {
return QDF_STATUS_E_INVAL; return QDF_STATUS_E_INVAL;
} }
#endif #endif /* WLAN_RX_PKT_CAPTURE_ENH */
#ifdef WLAN_TX_PKT_CAPTURE_ENH #ifdef WLAN_TX_PKT_CAPTURE_ENH
#include "dp_tx_capture.h" #include "dp_tx_capture.h"
@@ -6053,6 +6053,9 @@ QDF_STATUS dp_pdev_configure_monitor_rings(struct dp_pdev *pdev)
CDP_RX_ENH_CAPTURE_MPDU_MSDU) { CDP_RX_ENH_CAPTURE_MPDU_MSDU) {
htt_tlv_filter.header_per_msdu = 1; htt_tlv_filter.header_per_msdu = 1;
htt_tlv_filter.enable_mo = 0; htt_tlv_filter.enable_mo = 0;
if (pdev->is_rx_protocol_tagging_enabled ||
pdev->is_rx_enh_capture_trailer_enabled)
htt_tlv_filter.msdu_end = 1;
} }
} }

View File

@@ -46,8 +46,7 @@ static void
dp_rx_mon_enh_capture_process(struct dp_pdev *pdev, uint32_t tlv_status, dp_rx_mon_enh_capture_process(struct dp_pdev *pdev, uint32_t tlv_status,
qdf_nbuf_t status_nbuf, qdf_nbuf_t status_nbuf,
struct hal_rx_ppdu_info *ppdu_info, struct hal_rx_ppdu_info *ppdu_info,
bool *nbuf_used, bool *nbuf_used)
uint32_t rx_enh_capture_mode)
{ {
} }
#endif #endif
@@ -589,7 +588,7 @@ dp_rx_mon_status_process_tlv(struct dp_soc *soc, uint32_t mac_id,
dp_rx_mon_enh_capture_process(pdev, tlv_status, dp_rx_mon_enh_capture_process(pdev, tlv_status,
status_nbuf, ppdu_info, status_nbuf, ppdu_info,
&nbuf_used, rx_enh_capture_mode); &nbuf_used);
rx_tlv = hal_rx_status_get_next_tlv(rx_tlv); rx_tlv = hal_rx_status_get_next_tlv(rx_tlv);
@@ -598,7 +597,8 @@ dp_rx_mon_status_process_tlv(struct dp_soc *soc, uint32_t mac_id,
} while ((tlv_status == HAL_TLV_STATUS_PPDU_NOT_DONE) || } while ((tlv_status == HAL_TLV_STATUS_PPDU_NOT_DONE) ||
(tlv_status == HAL_TLV_STATUS_HEADER) || (tlv_status == HAL_TLV_STATUS_HEADER) ||
(tlv_status == HAL_TLV_STATUS_MPDU_END)); (tlv_status == HAL_TLV_STATUS_MPDU_END) ||
(tlv_status == HAL_TLV_STATUS_MSDU_END));
} }
if (pdev->dp_peer_based_pktlog) { if (pdev->dp_peer_based_pktlog) {
dp_rx_process_peer_based_pktlog(soc, ppdu_info, dp_rx_process_peer_based_pktlog(soc, ppdu_info,

View File

@@ -1269,6 +1269,25 @@ struct dp_pdev_tx_capture {
struct dp_peer_tx_capture { struct dp_peer_tx_capture {
}; };
#endif #endif
#ifdef WLAN_RX_PKT_CAPTURE_ENH
/* Template data to be set for Enhanced RX Monitor packets */
#define RX_MON_CAP_ENH_TRAILER 0xdeadc0dedeadda7a
/**
* struct dp_rx_mon_enh_trailer_data - Data structure to set a known pattern
* at end of each MSDU in monitor-lite mode
* @reserved1: reserved for future use
* @reserved2: reserved for future use
* @reserved3: reserved for future use
* @protocol_tag: protocol tag value read from skb->cb
*/
struct dp_rx_mon_enh_trailer_data {
uint16_t reserved1;
uint16_t reserved2;
uint16_t reserved3;
uint16_t protocol_tag;
};
#endif /* WLAN_RX_PKT_CAPTURE_ENH */
/* PDEV level structure for data path */ /* PDEV level structure for data path */
struct dp_pdev { struct dp_pdev {
@@ -1441,7 +1460,9 @@ struct dp_pdev {
/* per user 128 bytes msdu header list for MPDU */ /* per user 128 bytes msdu header list for MPDU */
struct msdu_list msdu_list[MAX_MU_USERS]; struct msdu_list msdu_list[MAX_MU_USERS];
/* RX enhanced capture mode */ /* RX enhanced capture mode */
uint32_t rx_enh_capture_mode; uint8_t rx_enh_capture_mode;
/* RX enhanced capture trailer enable/disable flag */
bool is_rx_enh_capture_trailer_enabled;
#ifdef WLAN_RX_PKT_CAPTURE_ENH #ifdef WLAN_RX_PKT_CAPTURE_ENH
/* RX per MPDU/PPDU information */ /* RX per MPDU/PPDU information */
struct cdp_rx_indication_mpdu mpdu_ind[MAX_MU_USERS]; struct cdp_rx_indication_mpdu mpdu_ind[MAX_MU_USERS];
@@ -1567,13 +1588,14 @@ struct dp_pdev {
/* unique cookie required for peer session */ /* unique cookie required for peer session */
uint32_t next_peer_cookie; uint32_t next_peer_cookie;
#ifdef WLAN_SUPPORT_RX_PROTOCOL_TYPE_TAG
/* /*
* Run time enabled when the first protocol tag is added, * Run time enabled when the first protocol tag is added,
* run time disabled when the last protocol tag is deleted * run time disabled when the last protocol tag is deleted
*/ */
bool is_rx_protocol_tagging_enabled; bool is_rx_protocol_tagging_enabled;
#ifdef WLAN_SUPPORT_RX_PROTOCOL_TYPE_TAG
/* /*
* The protocol type is used as array index to save * The protocol type is used as array index to save
* user provided tag info * user provided tag info

View File

@@ -405,17 +405,27 @@ struct hal_rx_msdu_payload_info {
/** /**
* struct hal_rx_nac_info - struct for neighbour info * struct hal_rx_nac_info - struct for neighbour info
* @fc_valid: flag indicate if it has valid frame control information * @fc_valid: flag indicate if it has valid frame control information
* @frame_control: frame control from each MPDU
* @to_ds_flag: flag indicate to_ds bit * @to_ds_flag: flag indicate to_ds bit
* @mac_addr2_valid: flag indicate if mac_addr2 is valid * @mac_addr2_valid: flag indicate if mac_addr2 is valid
* @mac_addr2: mac address2 in wh * @mac_addr2: mac address2 in wh
*/ */
struct hal_rx_nac_info { struct hal_rx_nac_info {
uint8_t fc_valid; uint8_t fc_valid;
uint16_t frame_control;
uint8_t to_ds_flag; uint8_t to_ds_flag;
uint8_t mac_addr2_valid; uint8_t mac_addr2_valid;
uint8_t mac_addr2[QDF_MAC_ADDR_SIZE]; uint8_t mac_addr2[QDF_MAC_ADDR_SIZE];
}; };
/**
* struct hal_rx_ppdu_msdu_info - struct for msdu info from HW TLVs
* @cce_metadata: cached metadata value received in the MSDU_END TLV
*/
struct hal_rx_ppdu_msdu_info {
uint16_t cce_metadata;
};
struct hal_rx_ppdu_info { struct hal_rx_ppdu_info {
struct hal_rx_ppdu_common_info com_info; struct hal_rx_ppdu_common_info com_info;
struct mon_rx_status rx_status; struct mon_rx_status rx_status;
@@ -432,6 +442,7 @@ struct hal_rx_ppdu_info {
uint32_t hdr_len; uint32_t hdr_len;
/* MPDU FCS error */ /* MPDU FCS error */
bool fcs_err; bool fcs_err;
struct hal_rx_ppdu_msdu_info rx_msdu_info[HAL_MAX_UL_MU_USERS];
}; };
static inline uint32_t static inline uint32_t

View File

@@ -1183,6 +1183,11 @@ hal_rx_status_get_tlv_info_generic(void *rx_tlv_hdr, void *ppduinfo,
RX_MPDU_INFO_2, RX_MPDU_INFO_2,
TO_DS); TO_DS);
ppdu_info->nac_info.frame_control =
HAL_RX_GET(rx_mpdu_start,
RX_MPDU_INFO_14,
MPDU_FRAME_CONTROL_FIELD);
ppdu_info->nac_info.mac_addr2_valid = ppdu_info->nac_info.mac_addr2_valid =
HAL_RX_GET(rx_mpdu_start, HAL_RX_GET(rx_mpdu_start,
RX_MPDU_INFO_2, RX_MPDU_INFO_2,
@@ -1225,6 +1230,10 @@ hal_rx_status_get_tlv_info_generic(void *rx_tlv_hdr, void *ppduinfo,
HAL_RX_GET(rx_tlv, RX_MPDU_END_1, HAL_RX_GET(rx_tlv, RX_MPDU_END_1,
FCS_ERR); FCS_ERR);
return HAL_TLV_STATUS_MPDU_END; return HAL_TLV_STATUS_MPDU_END;
case WIFIRX_MSDU_END_E:
ppdu_info->rx_msdu_info[user_id].cce_metadata =
HAL_RX_MSDU_END_CCE_METADATA_GET(rx_tlv);
return HAL_TLV_STATUS_MSDU_END;
case 0: case 0:
return HAL_TLV_STATUS_PPDU_DONE; return HAL_TLV_STATUS_PPDU_DONE;