qcacld-3.0: Process pkt_capture APIs based on packet capture mode

Process pkt_capture APIs only if packet capture mode is present.

Change-Id: Ibf08e550a829c266fd108c0023c016ab36728589
CRs-Fixed: 2640309
This commit is contained in:
Dundi Raviteja
2020-03-06 12:46:16 +05:30
committed by Gerrit - the friendly Code Review server
parent a14d64d378
commit 25a77e7f71
6 changed files with 15 additions and 11 deletions

View File

@@ -159,10 +159,8 @@ pkt_capture_get_pktcap_mode(struct wlan_objmgr_psoc *psoc)
vdev = wlan_objmgr_get_vdev_by_opmode_from_psoc(psoc,
QDF_STA_MODE,
WLAN_PKT_CAPTURE_ID);
if (!vdev) {
pkt_capture_err("vdev is NULL");
if (!vdev)
return 0;
}
vdev_priv = pkt_capture_vdev_get_priv(vdev);
if (!vdev_priv)

View File

@@ -201,10 +201,9 @@ pkt_capture_process_mgmt_tx_data(struct wlan_objmgr_pdev *pdev,
vdev = wlan_objmgr_get_vdev_by_macaddr_from_pdev(pdev,
wh->i_addr2,
WLAN_PKT_CAPTURE_ID);
if (!vdev) {
pkt_capture_err("vdev is NULL");
if (!vdev)
return QDF_STATUS_E_FAILURE;
}
vdev_id = wlan_vdev_get_id(vdev);
wlan_objmgr_vdev_release_ref(vdev, WLAN_PKT_CAPTURE_ID);

View File

@@ -1454,7 +1454,9 @@ static void hdd_send_association_event(struct net_device *dev,
/* start timer in sta/p2p_cli */
hdd_bus_bw_compute_prev_txrx_stats(adapter);
hdd_bus_bw_compute_timer_start(hdd_ctx);
ucfg_pkt_capture_record_channel(adapter->vdev);
if (ucfg_pkt_capture_get_pktcap_mode(hdd_ctx->psoc))
ucfg_pkt_capture_record_channel(adapter->vdev);
} else if (eConnectionState_IbssConnected == /* IBss Associated */
sta_ctx->conn_info.conn_state) {
policy_mgr_update_connection_info(hdd_ctx->psoc,

View File

@@ -2905,7 +2905,8 @@ void lim_process_switch_channel_rsp(struct mac_context *mac,
pe_session->send_p2p_conf_frame = true;
}
ucfg_pkt_capture_record_channel(pe_session->vdev);
if (ucfg_pkt_capture_get_pktcap_mode(mac->psoc))
ucfg_pkt_capture_record_channel(pe_session->vdev);
break;
case LIM_SWITCH_CHANNEL_SAP_DFS:
/* Note: This event code specific to SAP mode
@@ -2932,7 +2933,8 @@ void lim_process_switch_channel_rsp(struct mac_context *mac,
*/
policy_mgr_update_connection_info(mac->psoc,
pe_session->smeSessionId);
ucfg_pkt_capture_record_channel(pe_session->vdev);
if (ucfg_pkt_capture_get_pktcap_mode(mac->psoc))
ucfg_pkt_capture_record_channel(pe_session->vdev);
break;
default:
break;

View File

@@ -21402,7 +21402,9 @@ static QDF_STATUS csr_process_roam_sync_callback(struct mac_context *mac_ctx,
session->roam_synch_in_progress = false;
csr_check_and_set_sae_single_pmk_cap(mac_ctx, session,
session_id);
ucfg_pkt_capture_record_channel(vdev);
if (ucfg_pkt_capture_get_pktcap_mode(mac_ctx->psoc))
ucfg_pkt_capture_record_channel(vdev);
if (WLAN_REG_IS_5GHZ_CH_FREQ(bss_desc->chan_freq)) {
session->disable_hi_rssi = true;

View File

@@ -2797,7 +2797,8 @@ QDF_STATUS wma_tx_packet(void *wma_context, void *tx_frame, uint16_t frmLen,
WLAN_MGMT_NB_ID);
}
if (ucfg_pkt_capture_get_pktcap_mode(psoc)) {
if (ucfg_pkt_capture_get_pktcap_mode(psoc) &&
PKT_CAPTURE_MODE_MGMT_ONLY) {
ucfg_pkt_capture_mgmt_tx(wma_handle->pdev,
tx_frame,
wma_handle->interfaces[vdev_id].mhz,