From d493c152c90e0cb870863f0fcbc33fb9b4159beb Mon Sep 17 00:00:00 2001 From: Vulupala Shashank Reddy Date: Wed, 19 Feb 2020 15:44:35 +0530 Subject: [PATCH] qcacld-3.0: Record the channel number for pktcapture mode For packet capture mode, record the channel number on which STA vdev is operating on. Change-Id: Id52536b5b238dc1e4fe4c612a651c6fe8ddc17d3 CRs-Fixed: 2627713 --- .../core/inc/wlan_pkt_capture_main.h | 9 +++++++ .../core/src/wlan_pkt_capture_main.c | 25 +++++++++++++++++++ .../inc/wlan_pkt_capture_ucfg_api.h | 13 ++++++++++ .../src/wlan_pkt_capture_ucfg_api.c | 7 +++++- core/hdd/src/wlan_hdd_assoc.c | 2 ++ .../src/pe/lim/lim_process_mlm_rsp_messages.c | 4 +++ core/sme/src/csr/csr_api_roam.c | 2 ++ 7 files changed, 61 insertions(+), 1 deletion(-) diff --git a/components/pkt_capture/core/inc/wlan_pkt_capture_main.h b/components/pkt_capture/core/inc/wlan_pkt_capture_main.h index 00b73f607a..c38d239828 100644 --- a/components/pkt_capture/core/inc/wlan_pkt_capture_main.h +++ b/components/pkt_capture/core/inc/wlan_pkt_capture_main.h @@ -162,4 +162,13 @@ pkt_capture_get_pktcap_mode(struct wlan_objmgr_psoc *psoc); * Return: number of buffers dropped */ uint32_t pkt_capture_drop_nbuf_list(qdf_nbuf_t buf_list); + +/** + * pkt_capture_record_channel() - Update Channel Information + * for packet capture mode + * @vdev: pointer to vdev + * + * Return: None + */ +void pkt_capture_record_channel(struct wlan_objmgr_vdev *vdev); #endif /* end of _WLAN_PKT_CAPTURE_MAIN_H_ */ diff --git a/components/pkt_capture/core/src/wlan_pkt_capture_main.c b/components/pkt_capture/core/src/wlan_pkt_capture_main.c index c54b6997b6..8e003668bf 100644 --- a/components/pkt_capture/core/src/wlan_pkt_capture_main.c +++ b/components/pkt_capture/core/src/wlan_pkt_capture_main.c @@ -26,6 +26,7 @@ #include "wlan_pkt_capture_mon_thread.h" #include "wlan_pkt_capture_mgmt_txrx.h" #include "target_if_pkt_capture.h" +#include "cdp_txrx_ctrl.h" static struct wlan_objmgr_vdev *gp_pkt_capture_vdev; @@ -429,3 +430,27 @@ pkt_capture_psoc_destroy_notification(struct wlan_objmgr_psoc *psoc, void *arg) qdf_mem_free(psoc_priv); return status; } + +void pkt_capture_record_channel(struct wlan_objmgr_vdev *vdev) +{ + struct wlan_objmgr_pdev *pdev = wlan_vdev_get_pdev(vdev); + void *soc = cds_get_context(QDF_MODULE_ID_SOC); + struct wlan_channel *des_chan; + cdp_config_param_type val; + struct wlan_objmgr_psoc *psoc; + + psoc = wlan_vdev_get_psoc(vdev); + + if (!pkt_capture_get_mode(psoc)) + return; + /* + * Record packet capture channel here + */ + des_chan = vdev->vdev_mlme.des_chan; + val.cdp_pdev_param_monitor_chan = des_chan->ch_ieee; + cdp_txrx_set_pdev_param(soc, wlan_objmgr_pdev_get_pdev_id(pdev), + CDP_MONITOR_CHANNEL, val); + val.cdp_pdev_param_mon_freq = des_chan->ch_freq; + cdp_txrx_set_pdev_param(soc, wlan_objmgr_pdev_get_pdev_id(pdev), + CDP_MONITOR_FREQUENCY, val); +} diff --git a/components/pkt_capture/dispatcher/inc/wlan_pkt_capture_ucfg_api.h b/components/pkt_capture/dispatcher/inc/wlan_pkt_capture_ucfg_api.h index 21da9c5d4d..ff7112b48d 100644 --- a/components/pkt_capture/dispatcher/inc/wlan_pkt_capture_ucfg_api.h +++ b/components/pkt_capture/dispatcher/inc/wlan_pkt_capture_ucfg_api.h @@ -237,6 +237,14 @@ void ucfg_pkt_capture_tx_completion_process( uint8_t tid, uint8_t status, bool pkt_format, uint8_t *bssid, htt_pdev_handle pdev); +/** + * ucfg_pkt_capture_record_channel() - Update Channel Information + * for packet capture mode + * @vdev: pointer to vdev + * + * Return: None + */ +void ucfg_pkt_capture_record_channel(struct wlan_objmgr_vdev *vdev); #else static inline QDF_STATUS ucfg_pkt_capture_init(void) @@ -353,5 +361,10 @@ ucfg_pkt_capture_tx_completion_process( { } + +static inline void +ucfg_pkt_capture_record_channel(struct wlan_objmgr_vdev *vdev) +{ +} #endif /* WLAN_FEATURE_PKT_CAPTURE */ #endif /* _WLAN_PKT_CAPTURE_UCFG_API_H_ */ diff --git a/components/pkt_capture/dispatcher/src/wlan_pkt_capture_ucfg_api.c b/components/pkt_capture/dispatcher/src/wlan_pkt_capture_ucfg_api.c index ab83031a77..525274e3c8 100644 --- a/components/pkt_capture/dispatcher/src/wlan_pkt_capture_ucfg_api.c +++ b/components/pkt_capture/dispatcher/src/wlan_pkt_capture_ucfg_api.c @@ -260,7 +260,7 @@ int ucfg_pkt_capture_enable_ops(struct wlan_objmgr_vdev *vdev) return -EINVAL; } - mode = ucfg_pkt_capture_get_mode(psoc); + mode = pkt_capture_get_mode(psoc); ret = tx_ops->pkt_capture_send_mode(psoc, vdev->vdev_objmgr.vdev_id, mode); @@ -321,3 +321,8 @@ ucfg_pkt_capture_tx_completion_process( mon_buf_list, TXRX_PROCESS_TYPE_DATA_TX_COMPL, tid, status, pkt_format, bssid, pdev); } + +void ucfg_pkt_capture_record_channel(struct wlan_objmgr_vdev *vdev) +{ + pkt_capture_record_channel(vdev); +} diff --git a/core/hdd/src/wlan_hdd_assoc.c b/core/hdd/src/wlan_hdd_assoc.c index 725042be5d..6c794f921f 100644 --- a/core/hdd/src/wlan_hdd_assoc.c +++ b/core/hdd/src/wlan_hdd_assoc.c @@ -74,6 +74,7 @@ #include "wlan_hdd_ftm_time_sync.h" #include +#include "wlan_pkt_capture_ucfg_api.h" /* These are needed to recognize WPA and RSN suite types */ #define HDD_WPA_OUI_SIZE 4 @@ -1451,6 +1452,7 @@ 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); } else if (eConnectionState_IbssConnected == /* IBss Associated */ sta_ctx->conn_info.conn_state) { policy_mgr_update_connection_info(hdd_ctx->psoc, diff --git a/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c b/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c index dbc9c83fa8..afc4bab9c9 100644 --- a/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c +++ b/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c @@ -42,6 +42,7 @@ #include "nan_datapath.h" #include "wlan_reg_services_api.h" #include "wma.h" +#include "wlan_pkt_capture_ucfg_api.h" #define MAX_SUPPORTED_PEERS_WEP 16 @@ -2903,6 +2904,8 @@ void lim_process_switch_channel_rsp(struct mac_context *mac, pe_debug("Send p2p operating channel change conf action frame once first beacon is received on new channel"); pe_session->send_p2p_conf_frame = true; } + + ucfg_pkt_capture_record_channel(pe_session->vdev); break; case LIM_SWITCH_CHANNEL_SAP_DFS: /* Note: This event code specific to SAP mode @@ -2929,6 +2932,7 @@ 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); break; default: break; diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index de29f1ba8b..ba1d79515d 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/core/sme/src/csr/csr_api_roam.c @@ -67,6 +67,7 @@ #include "wlan_scan_utils_api.h" #include +#include "wlan_pkt_capture_ucfg_api.h" #define RSN_AUTH_KEY_MGMT_SAE WLAN_RSN_SEL(WLAN_AKM_SAE) #define MAX_PWR_FCC_CHAN_12 8 @@ -21417,6 +21418,7 @@ 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 (WLAN_REG_IS_5GHZ_CH_FREQ(bss_desc->chan_freq)) { session->disable_hi_rssi = true;