Prechádzať zdrojové kódy

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
Dundi Raviteja 5 rokov pred
rodič
commit
25a77e7f71

+ 1 - 3
components/pkt_capture/core/src/wlan_pkt_capture_main.c

@@ -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)

+ 2 - 3
components/pkt_capture/core/src/wlan_pkt_capture_mgmt_txrx.c

@@ -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);
 

+ 3 - 1
core/hdd/src/wlan_hdd_assoc.c

@@ -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,

+ 4 - 2
core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c

@@ -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;

+ 3 - 1
core/sme/src/csr/csr_api_roam.c

@@ -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;

+ 2 - 1
core/wma/src/wma_data.c

@@ -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,