qcacld-3.0: Process Rx data packet for pkt capture mode

Process Rx data packets and post to the mon thread for
packet capture mode

Change-Id: Id8ae54677615c27d61c6def1a521c509f602863b
CRs-Fixed: 2618941
This commit is contained in:
Vulupala Shashank Reddy
2020-01-29 11:16:39 +05:30
committed by nshrivas
parent 5a3b87db75
commit a2deef8c83
14 changed files with 683 additions and 21 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2011, 2014-2019 The Linux Foundation. All rights reserved.
* Copyright (c) 2011, 2014-2020 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@@ -1119,6 +1119,19 @@ int htt_rx_mon_amsdu_rx_in_order_pop_ll(htt_pdev_handle pdev,
qdf_nbuf_t *head_msdu,
qdf_nbuf_t *tail_msdu,
uint32_t *replenish_cnt);
/**
* htt_rx_mon_get_rx_status() - Update information about the rx status,
* which is used later for radiotap updation.
* @pdev: Pointer to pdev handle
* @rx_desc: Pointer to struct htt_host_rx_desc_base
* @rx_status: Return variable updated with rx_status
*
* Return: None
*/
void htt_rx_mon_get_rx_status(htt_pdev_handle pdev,
struct htt_host_rx_desc_base *rx_desc,
struct mon_rx_status *rx_status);
#else
static inline
int htt_rx_mon_amsdu_rx_in_order_pop_ll(htt_pdev_handle pdev,
@@ -1129,6 +1142,13 @@ int htt_rx_mon_amsdu_rx_in_order_pop_ll(htt_pdev_handle pdev,
{
return 0;
}
static inline
void htt_rx_mon_get_rx_status(htt_pdev_handle pdev,
struct htt_host_rx_desc_base *rx_desc,
struct mon_rx_status *rx_status)
{
}
#endif
#endif /* _HTT_INTERNAL__H_ */

View File

@@ -458,17 +458,9 @@ static uint8_t htt_mon_rx_get_rtap_flags(struct htt_host_rx_desc_base *rx_desc)
return rtap_flags;
}
/**
* htt_rx_mon_get_rx_status() - Update information about the rx status,
* which is used later for radiotap updation.
* @rx_desc: Pointer to struct htt_host_rx_desc_base
* @rx_status: Return variable updated with rx_status
*
* Return: None
*/
static void htt_rx_mon_get_rx_status(htt_pdev_handle pdev,
struct htt_host_rx_desc_base *rx_desc,
struct mon_rx_status *rx_status)
void htt_rx_mon_get_rx_status(htt_pdev_handle pdev,
struct htt_host_rx_desc_base *rx_desc,
struct mon_rx_status *rx_status)
{
uint16_t channel_flags = 0;
struct mon_channel *ch_info = &pdev->mon_ch_info;

View File

@@ -56,6 +56,7 @@
#include <cdp_txrx_handle.h>
#include <pld_common.h>
#include <htt_internal.h>
#include <wlan_pkt_capture_ucfg_api.h>
#ifndef OL_RX_INDICATION_MAX_RECORDS
#define OL_RX_INDICATION_MAX_RECORDS 2048
@@ -1561,6 +1562,7 @@ ol_rx_in_order_indication_handler(ol_txrx_pdev_handle pdev,
{
struct ol_txrx_vdev_t *vdev = NULL;
struct ol_txrx_peer_t *peer = NULL;
struct ol_txrx_peer_t *peer_head = NULL;
htt_pdev_handle htt_pdev = NULL;
int status;
qdf_nbuf_t head_msdu = NULL, tail_msdu = NULL;
@@ -1569,6 +1571,14 @@ ol_rx_in_order_indication_handler(ol_txrx_pdev_handle pdev,
uint32_t msdu_count;
uint8_t pktlog_bit;
uint32_t filled = 0;
uint8_t bssid[QDF_MAC_ADDR_SIZE];
bool offloaded_pkt;
struct ol_txrx_soc_t *soc = cds_get_context(QDF_MODULE_ID_SOC);
if (qdf_unlikely(!soc)) {
ol_txrx_err("soc is NULL");
return;
}
if (tid >= OL_TXRX_NUM_EXT_TIDS) {
ol_txrx_err("invalid tid, %u", tid);
@@ -1632,6 +1642,43 @@ ol_rx_in_order_indication_handler(ol_txrx_pdev_handle pdev,
/* rx_opt_proc takes a NULL-terminated list of msdu netbufs */
qdf_nbuf_set_next(tail_msdu, NULL);
/* Packet Capture Mode */
if ((ucfg_pkt_capture_get_mode((void *)soc->psoc) &
PKT_CAPTURE_MODE_DATA_ONLY)) {
offloaded_pkt = ucfg_pkt_capture_rx_offloaded_pkt(rx_ind_msg);
if (peer) {
vdev = peer->vdev;
if (peer->vdev) {
qdf_spin_lock_bh(&pdev->peer_ref_mutex);
peer_head = TAILQ_FIRST(&vdev->peer_list);
qdf_spin_unlock_bh(&pdev->peer_ref_mutex);
if (peer_head) {
qdf_spin_lock_bh(
&peer_head->peer_info_lock);
qdf_mem_copy(bssid,
&peer_head->mac_addr.raw,
QDF_MAC_ADDR_SIZE);
qdf_spin_unlock_bh(
&peer_head->peer_info_lock);
ucfg_pkt_capture_rx_msdu_process(
bssid, head_msdu,
peer->vdev->vdev_id,
htt_pdev);
}
}
} else if (offloaded_pkt) {
ucfg_pkt_capture_rx_msdu_process(
bssid, head_msdu,
HTT_INVALID_VDEV,
htt_pdev);
ucfg_pkt_capture_rx_drop_offload_pkt(head_msdu);
return;
}
}
/* Pktlog */
ol_rx_send_pktlog_event(pdev, peer, head_msdu, pktlog_bit);

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2011-2019 The Linux Foundation. All rights reserved.
* Copyright (c) 2011-2020 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@@ -58,6 +58,7 @@
#include <ol_rx_defrag.h>
#include <enet.h>
#include <qdf_time.h> /* qdf_system_time */
#include <wlan_pkt_capture_ucfg_api.h>
#define DEFRAG_IEEE80211_ADDR_EQ(a1, a2) \
(!qdf_mem_cmp(a1, a2, QDF_MAC_ADDR_SIZE))
@@ -653,7 +654,14 @@ ol_rx_defrag(ol_txrx_pdev_handle pdev,
struct ieee80211_frame *wh;
uint8_t key[DEFRAG_IEEE80211_KEY_LEN];
htt_pdev_handle htt_pdev = pdev->htt_pdev;
struct ol_txrx_peer_t *peer_head = NULL;
uint8_t bssid[QDF_MAC_ADDR_SIZE];
struct ol_txrx_soc_t *soc = cds_get_context(QDF_MODULE_ID_SOC);
if (qdf_unlikely(!soc)) {
ol_txrx_err("soc is NULL");
return;
}
vdev = peer->vdev;
/* bypass defrag for safe mode */
@@ -770,6 +778,33 @@ ol_rx_defrag(ol_txrx_pdev_handle pdev,
if (ol_cfg_frame_type(pdev->ctrl_pdev) == wlan_frm_fmt_802_3)
ol_rx_defrag_nwifi_to_8023(pdev, msdu);
/* Packet Capture Mode */
if ((ucfg_pkt_capture_get_mode((void *)soc->psoc) &
PKT_CAPTURE_MODE_DATA_ONLY)) {
if (peer) {
if (peer->vdev) {
qdf_spin_lock_bh(&pdev->peer_ref_mutex);
peer_head = TAILQ_FIRST(&vdev->peer_list);
qdf_spin_unlock_bh(&pdev->peer_ref_mutex);
if (peer_head) {
qdf_spin_lock_bh(
&peer_head->peer_info_lock);
qdf_mem_copy(bssid,
&peer_head->mac_addr.raw,
QDF_MAC_ADDR_SIZE);
qdf_spin_unlock_bh(
&peer_head->peer_info_lock);
ucfg_pkt_capture_rx_msdu_process(
bssid, msdu,
vdev->vdev_id,
htt_pdev);
}
}
}
}
ol_rx_fwd_check(vdev, peer, tid, msdu);
}