From 61df09450eaa1b97ef5324a614c3420cc3fa1431 Mon Sep 17 00:00:00 2001 From: Surabhi Vishnoi Date: Tue, 21 Jan 2020 22:34:46 +0530 Subject: [PATCH 1/4] qcacmn: Add wmi interface changes for wlan time sync eventid Add wmi event id's for ftm based wlan time sync feature. CRs-Fixed: 2610092 Change-Id: Ifd7b10bbbe2b4c3f954233da55f318bef99fa13a --- wmi/inc/wmi_unified_param.h | 4 ++++ wmi/src/wmi_unified_tlv.c | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/wmi/inc/wmi_unified_param.h b/wmi/inc/wmi_unified_param.h index 5eb0597d8a..29f560ddd0 100644 --- a/wmi/inc/wmi_unified_param.h +++ b/wmi/inc/wmi_unified_param.h @@ -4546,6 +4546,10 @@ typedef enum { wmi_mgmt_offload_data_event_id, wmi_pdev_multi_vdev_restart_response_event_id, wmi_roam_pmkid_request_event_id, +#ifdef FEATURE_WLAN_TIME_SYNC_FTM + wmi_wlan_time_sync_ftm_start_stop_event_id, + wmi_wlan_time_sync_q_master_slave_offset_eventid, +#endif wmi_events_max, } wmi_conv_event_id; diff --git a/wmi/src/wmi_unified_tlv.c b/wmi/src/wmi_unified_tlv.c index 21dbdef06f..a801a82de9 100644 --- a/wmi/src/wmi_unified_tlv.c +++ b/wmi/src/wmi_unified_tlv.c @@ -13745,6 +13745,12 @@ static void populate_tlv_events_id(uint32_t *event_ids) WMI_PDEV_MULTIPLE_VDEV_RESTART_RESP_EVENTID; event_ids[wmi_roam_pmkid_request_event_id] = WMI_ROAM_PMKID_REQUEST_EVENTID; +#ifdef FEATURE_WLAN_TIME_SYNC_FTM + event_ids[wmi_wlan_time_sync_ftm_start_stop_event_id] = + WMI_VDEV_AUDIO_SYNC_START_STOP_EVENTID; + event_ids[wmi_wlan_time_sync_q_master_slave_offset_eventid] = + WMI_VDEV_AUDIO_SYNC_Q_MASTER_SLAVE_OFFSET_EVENTID; +#endif } /** From 0265d7917a566543744a67669ef47f4abc60579e Mon Sep 17 00:00:00 2001 From: Alok Kumar Date: Fri, 24 Jan 2020 16:59:58 +0530 Subject: [PATCH 2/4] qcacmn: Add INI support for packet log buffer size Add INI parameter "PacketLogBufSize" to populate packet log buffer size. Change-Id: Ic9b963a88a6f6d884d5fa3a63b4fed6768ba2fc4 CRs-Fixed: 2611409 --- utils/pktlog/pktlog_ac.c | 21 +++++++++++++++------ wlan_cfg/cfg_dp.h | 14 +++++++++++++- wlan_cfg/wlan_cfg.c | 2 ++ wlan_cfg/wlan_cfg.h | 2 ++ 4 files changed, 32 insertions(+), 7 deletions(-) diff --git a/utils/pktlog/pktlog_ac.c b/utils/pktlog/pktlog_ac.c index 157581f915..a7a0583e22 100644 --- a/utils/pktlog/pktlog_ac.c +++ b/utils/pktlog/pktlog_ac.c @@ -585,10 +585,14 @@ static void pktlog_callback_registration(uint8_t callback_type) } #endif +#define ONE_MEGABYTE (1024 * 1024) + void pktlog_init(struct hif_opaque_softc *scn) { struct pktlog_dev_t *pl_dev = get_pktlog_handle(); struct ath_pktlog_info *pl_info; + void *soc = cds_get_context(QDF_MODULE_ID_SOC); + uint32_t buff_size; if (!pl_dev || !pl_dev->pl_info) { qdf_print("pl_dev or pl_info is invalid"); @@ -601,7 +605,9 @@ void pktlog_init(struct hif_opaque_softc *scn) PKTLOG_LOCK_INIT(pl_info); mutex_init(&pl_info->pktlog_mutex); - pl_info->buf_size = PKTLOG_DEFAULT_BUFSIZE; + buff_size = cdp_cfg_get(soc, cfg_dp_pktlog_buffer_size) * ONE_MEGABYTE; + + pl_info->buf_size = (buff_size ? buff_size : ONE_MEGABYTE); pl_info->buf = NULL; pl_info->log_state = 0; pl_info->init_saved_state = 0; @@ -780,14 +786,14 @@ int pktlog_enable(struct hif_opaque_softc *scn, int32_t log_state, return err; } -#define ONE_MEGABYTE (1024 * 1024) -#define MAX_ALLOWED_PKTLOG_SIZE (64 * ONE_MEGABYTE) - static int __pktlog_setsize(struct hif_opaque_softc *scn, int32_t size) { struct pktlog_dev_t *pl_dev; struct ath_pktlog_info *pl_info; uint8_t pdev_id = WMI_PDEV_ID_SOC; + void *soc = cds_get_context(QDF_MODULE_ID_SOC); + uint32_t buff_size; + uint32_t max_allowed_buff_size; pl_dev = get_pktlog_handle(); @@ -815,10 +821,13 @@ static int __pktlog_setsize(struct hif_opaque_softc *scn, int32_t size) pl_info->curr_pkt_state = PKTLOG_OPR_IN_PROGRESS; - if (size < ONE_MEGABYTE || size > MAX_ALLOWED_PKTLOG_SIZE) { + buff_size = cdp_cfg_get(soc, cfg_dp_pktlog_buffer_size) * ONE_MEGABYTE; + max_allowed_buff_size = (buff_size ? buff_size : ONE_MEGABYTE); + + if (size < ONE_MEGABYTE || size > max_allowed_buff_size) { qdf_print("%s: Cannot Set Pktlog Buffer size of %d bytes.Min required is %d MB and Max allowed is %d MB.", __func__, size, (ONE_MEGABYTE / ONE_MEGABYTE), - (MAX_ALLOWED_PKTLOG_SIZE / ONE_MEGABYTE)); + (max_allowed_buff_size / ONE_MEGABYTE)); pl_info->curr_pkt_state = PKTLOG_OPR_NOT_IN_PROGRESS; qdf_print("%s: Invalid requested buff size", __func__); return -EINVAL; diff --git a/wlan_cfg/cfg_dp.h b/wlan_cfg/cfg_dp.h index 7bb4917ed4..922bdd7d19 100644 --- a/wlan_cfg/cfg_dp.h +++ b/wlan_cfg/cfg_dp.h @@ -316,6 +316,10 @@ #define WLAN_CFG_RX_FLOW_SEARCH_TABLE_SIZE_MIN 1 #define WLAN_CFG_RX_FLOW_SEARCH_TABLE_SIZE_MAX 16384 +#define WLAN_CFG_PKTLOG_BUFFER_SIZE 10 +#define WLAN_CFG_PKTLOG_MIN_BUFFER_SIZE 1 +#define WLAN_CFG_PKTLOG_MAX_BUFFER_SIZE 10 + /* DP INI Declerations */ #define CFG_DP_HTT_PACKET_TYPE \ CFG_INI_UINT("dp_htt_packet_type", \ @@ -781,6 +785,13 @@ #define CFG_DP_CONFIG_PKT_CAPTURE_MODE_ALL #endif /* WLAN_FEATURE_PKT_CAPTURE */ +#define CFG_DP_PKTLOG_BUFFER_SIZE \ + CFG_INI_UINT("PktlogBufSize", \ + WLAN_CFG_PKTLOG_MIN_BUFFER_SIZE, \ + WLAN_CFG_PKTLOG_MAX_BUFFER_SIZE, \ + WLAN_CFG_PKTLOG_BUFFER_SIZE, \ + CFG_VALUE_OR_DEFAULT, "Packet Log buffer size") + #define CFG_DP \ CFG(CFG_DP_HTT_PACKET_TYPE) \ CFG(CFG_DP_INT_BATCH_THRESHOLD_OTHER) \ @@ -852,6 +863,7 @@ CFG(CFG_DP_RX_FLOW_SEARCH_TABLE_PER_PDEV) \ CFG(CFG_DP_RX_MON_PROTOCOL_FLOW_TAG_ENABLE) \ CFG(CFG_DP_RXDMA_MONITOR_RX_DROP_THRESHOLD) \ - CFG_DP_CONFIG_PKT_CAPTURE_MODE_ALL + CFG_DP_CONFIG_PKT_CAPTURE_MODE_ALL \ + CFG(CFG_DP_PKTLOG_BUFFER_SIZE) #endif /* _CFG_DP_H_ */ diff --git a/wlan_cfg/wlan_cfg.c b/wlan_cfg/wlan_cfg.c index 98ddc48b6c..4fe6820b79 100644 --- a/wlan_cfg/wlan_cfg.c +++ b/wlan_cfg/wlan_cfg.c @@ -473,6 +473,8 @@ wlan_cfg_soc_attach(struct cdp_ctrl_objmgr_psoc *psoc) cfg_get(psoc, CFG_DP_INT_BATCH_THRESHOLD_OTHER); wlan_cfg_ctx->int_timer_threshold_other = cfg_get(psoc, CFG_DP_INT_TIMER_THRESHOLD_OTHER); + wlan_cfg_ctx->pktlog_buffer_size = + cfg_get(psoc, CFG_DP_PKTLOG_BUFFER_SIZE); /* This is default mapping and can be overridden by HW config * received from FW */ diff --git a/wlan_cfg/wlan_cfg.h b/wlan_cfg/wlan_cfg.h index 4e125882d2..2c2cb79cad 100644 --- a/wlan_cfg/wlan_cfg.h +++ b/wlan_cfg/wlan_cfg.h @@ -179,6 +179,7 @@ struct wlan_srng_cfg { * @rx_flow_max_search: max skid length for each hash entry * @rx_toeplitz_hash_key: toeplitz key pointer used for hash computation over * 5 tuple flow entry + * @pktlog_buffer_size: packet log buffer size */ struct wlan_cfg_dp_soc_ctxt { int num_int_ctxts; @@ -274,6 +275,7 @@ struct wlan_cfg_dp_soc_ctxt { uint16_t rx_flow_search_table_size; uint16_t rx_flow_max_search; uint8_t *rx_toeplitz_hash_key; + uint8_t pktlog_buffer_size; }; /** From fef1078ed071cba0ffcbfa267af762323580862b Mon Sep 17 00:00:00 2001 From: Alok Kumar Date: Fri, 24 Jan 2020 16:57:24 +0530 Subject: [PATCH 3/4] qcacmn: DP change to get buffer size from INI file DP layer change to read the packet log buffer size from INI file. Change-Id: If307ad5abfd0360c3f39247ccc62abd32095303f CRs-Fixed: 2611406 --- dp/inc/cdp_txrx_cmn_struct.h | 1 + dp/inc/cdp_txrx_mob_def.h | 1 + dp/wifi3.0/dp_main.c | 3 +++ 3 files changed, 5 insertions(+) diff --git a/dp/inc/cdp_txrx_cmn_struct.h b/dp/inc/cdp_txrx_cmn_struct.h index defcef50c1..e973f348af 100644 --- a/dp/inc/cdp_txrx_cmn_struct.h +++ b/dp/inc/cdp_txrx_cmn_struct.h @@ -2215,6 +2215,7 @@ enum cdp_dp_cfg { cfg_dp_reorder_offload_supported, cfg_dp_ce_classify_enable, cfg_dp_disable_intra_bss_fwd, + cfg_dp_pktlog_buffer_size, }; /** diff --git a/dp/inc/cdp_txrx_mob_def.h b/dp/inc/cdp_txrx_mob_def.h index e91753bb72..c7d8900723 100644 --- a/dp/inc/cdp_txrx_mob_def.h +++ b/dp/inc/cdp_txrx_mob_def.h @@ -316,6 +316,7 @@ struct txrx_pdev_cfg_param_t { uint16_t bundle_timer_value; uint16_t bundle_size; #endif + uint8_t pktlog_buffer_size; }; #ifdef IPA_OFFLOAD diff --git a/dp/wifi3.0/dp_main.c b/dp/wifi3.0/dp_main.c index 3937a902c1..bf9b211887 100644 --- a/dp/wifi3.0/dp_main.c +++ b/dp/wifi3.0/dp_main.c @@ -9936,6 +9936,9 @@ static uint32_t dp_get_cfg(struct cdp_soc_t *soc, enum cdp_dp_cfg cfg) case cfg_dp_disable_intra_bss_fwd: value = dpsoc->wlan_cfg_ctx->disable_intra_bss_fwd; break; + case cfg_dp_pktlog_buffer_size: + value = dpsoc->wlan_cfg_ctx->pktlog_buffer_size; + break; default: value = 0; } From b59458c28415f7fb8e97c6ae66e2bbddaf0c4b22 Mon Sep 17 00:00:00 2001 From: Abhinav Kumar Date: Fri, 24 Jan 2020 19:02:52 +0530 Subject: [PATCH 4/4] qcacmn: Send val of separate iface support for NAN INI to Fw Update value of new ini for separate iface support for NAN "nan_separate_iface_support" to fw through a command WMI_INIT_CMDID. Change-Id: I55830e0d16d86ee5a0bfa7d3e44c6309c0d3d54b CRs-Fixed: 2612010 --- wmi/inc/wmi_unified_param.h | 2 ++ wmi/src/wmi_unified_tlv.c | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/wmi/inc/wmi_unified_param.h b/wmi/inc/wmi_unified_param.h index 29f560ddd0..4ab5c81137 100644 --- a/wmi/inc/wmi_unified_param.h +++ b/wmi/inc/wmi_unified_param.h @@ -5189,6 +5189,7 @@ struct wmi_host_fw_abi_ver { * @ast_3_flow_mask_enable: mask to enable flow support for ast index 3 * @ast_tid_high_mask_enable: enable tid valid mask for high priority flow * @ast_tid_low_mask_enable: enable tid valid mask for low priority flow + * @nan_separate_iface_support: Separate iface creation for NAN */ typedef struct { uint32_t num_vdevs; @@ -5285,6 +5286,7 @@ typedef struct { ast_3_flow_mask_enable:4, ast_tid_high_mask_enable:8, ast_tid_low_mask_enable:8; + bool nan_separate_iface_support; } target_resource_config; /** diff --git a/wmi/src/wmi_unified_tlv.c b/wmi/src/wmi_unified_tlv.c index a801a82de9..f20b5a93b2 100644 --- a/wmi/src/wmi_unified_tlv.c +++ b/wmi/src/wmi_unified_tlv.c @@ -6868,6 +6868,10 @@ void wmi_copy_resource_config(wmi_resource_config *resource_cfg, WMI_MSDU_FLOW_TID_VALID_LOW_MASKS_SET( resource_cfg->msdu_flow_override_config1, tgt_res_cfg->ast_tid_low_mask_enable); + WMI_RSRC_CFG_HOST_SERVICE_FLAG_NAN_IFACE_SUPPORT_SET( + resource_cfg->host_service_flags, + tgt_res_cfg->nan_separate_iface_support); + } /* copy_hw_mode_id_in_init_cmd() - Helper routine to copy hw_mode in init cmd