diff options
| author | Manjeet Singh <manjee@codeaurora.org> | 2016-12-20 20:41:10 +0530 |
|---|---|---|
| committer | qcabuildsw <qcabuildsw@localhost> | 2016-12-23 03:35:51 -0800 |
| commit | 8c0b847478941047e1f0492eba601b38ff1722d2 (patch) | |
| tree | b30ba319d68f2491888c8d51c531f07fcebb9f44 | |
| parent | 214568fe561d481ac4b0b02e0e8099f9ec76aca0 (diff) | |
qcacld-3.0: Check FW support for FW mem dump
Currently HDD sends a FW memory dump request to firmware without
checking support for this feature. This can lead to a crash as firmware
doesn't send the command response if feature is not supported.
Add a check in HDD so that the request is only sent when FW memory dump
capability is advertised by the firmware.
Change-Id: I73b980f50910e13aa5f2d2434f07b6f985dd5010
CRs-fixed: 1090806
| -rw-r--r-- | core/hdd/inc/wlan_hdd_main.h | 1 | ||||
| -rw-r--r-- | core/hdd/src/wlan_hdd_main.c | 2 | ||||
| -rw-r--r-- | core/hdd/src/wlan_hdd_memdump.c | 10 | ||||
| -rw-r--r-- | core/wma/inc/wma.h | 2 | ||||
| -rw-r--r-- | core/wma/inc/wma_tgt_cfg.h | 2 | ||||
| -rw-r--r-- | core/wma/src/wma_main.c | 8 |
6 files changed, 22 insertions, 3 deletions
diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h index 1adb46012515..5f2b79918065 100644 --- a/core/hdd/inc/wlan_hdd_main.h +++ b/core/hdd/inc/wlan_hdd_main.h @@ -1573,6 +1573,7 @@ struct hdd_context_s { /* tdls source timer to enable/disable TDLS on p2p listen */ qdf_mc_timer_t tdls_source_timer; qdf_atomic_t disable_lro_in_concurrency; + bool fw_mem_dump_enabled; }; /*--------------------------------------------------------------------------- diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index ea5cfd11a0e8..555479e972ff 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -1407,6 +1407,8 @@ void hdd_update_tgt_cfg(void *context, void *param) hdd_ctx->config->bpf_packet_filter_enable); hdd_update_ra_rate_limit(hdd_ctx, cfg); + hdd_ctx->fw_mem_dump_enabled = cfg->fw_mem_dump_enabled; + /* * If BPF is enabled, maxWowFilters set to WMA_STA_WOW_DEFAULT_PTRN_MAX * because we need atleast WMA_STA_WOW_DEFAULT_PTRN_MAX free slots to diff --git a/core/hdd/src/wlan_hdd_memdump.c b/core/hdd/src/wlan_hdd_memdump.c index a4ce2148da97..bb23d3ab7df6 100644 --- a/core/hdd/src/wlan_hdd_memdump.c +++ b/core/hdd/src/wlan_hdd_memdump.c @@ -210,13 +210,19 @@ static int __wlan_hdd_cfg80211_get_fw_mem_dump(struct wiphy *wiphy, if (status) return status; - + if (!hdd_ctx->fw_mem_dump_enabled) { + hdd_notice("FW memory dump not supported by this FW"); + return -ENOTSUPP; + } qdf_ctx = cds_get_context(QDF_MODULE_ID_QDF_DEVICE); if (!qdf_ctx) { hdd_err("QDF context is NULL"); return -EINVAL; } - + if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) { + hdd_err("memdump not supported in FTM mode"); + return -EINVAL; + } if (hdd_ctx->memdump_in_progress) { hdd_err("Already a memdump req in progress."); return -EBUSY; diff --git a/core/wma/inc/wma.h b/core/wma/inc/wma.h index 18580e6d58a5..64f8628e8eee 100644 --- a/core/wma/inc/wma.h +++ b/core/wma/inc/wma.h @@ -1407,6 +1407,7 @@ struct extended_caps { * @wmi_cmd_rsp_wake_lock: wmi command response wake lock * @wmi_cmd_rsp_runtime_lock: wmi command response bus lock * @saved_chan: saved channel list sent as part of WMI_SCAN_CHAN_LIST_CMDID + * @fw_mem_dump_enabled: Fw memory dump support */ typedef struct { void *wmi_handle; @@ -1610,6 +1611,7 @@ typedef struct { tp_wma_packetdump_cb wma_mgmt_tx_packetdump_cb; tp_wma_packetdump_cb wma_mgmt_rx_packetdump_cb; tSirLLStatsResults *link_stats_results; + bool fw_mem_dump_enabled; } t_wma_handle, *tp_wma_handle; /** diff --git a/core/wma/inc/wma_tgt_cfg.h b/core/wma/inc/wma_tgt_cfg.h index 5ce91f38425b..c92ac0834c42 100644 --- a/core/wma/inc/wma_tgt_cfg.h +++ b/core/wma/inc/wma_tgt_cfg.h @@ -149,6 +149,7 @@ struct wma_dfs_radar_ind { * @egap_support: enhanced green ap support * @nan_datapath_enabled: nan data path support * @bool is_ra_rate_limit_enabled: RA filter support + * @fw_mem_dump_enabled: Fw memory dump support */ struct wma_tgt_cfg { uint32_t target_fw_version; @@ -178,5 +179,6 @@ struct wma_tgt_cfg { #endif bool sub_20_support; uint16_t wmi_max_len; + bool fw_mem_dump_enabled; }; #endif /* WMA_TGT_CFG_H */ diff --git a/core/wma/src/wma_main.c b/core/wma/src/wma_main.c index fa29c1b423ce..5031be19e043 100644 --- a/core/wma/src/wma_main.c +++ b/core/wma/src/wma_main.c @@ -4281,7 +4281,7 @@ static void wma_update_hdd_cfg(tp_wma_handle wma_handle) tgt_cfg.wmi_max_len = wmi_get_max_msg_len(wma_handle->wmi_handle) - WMI_TLV_HEADROOM; wma_setup_egap_support(&tgt_cfg, wma_handle); - + tgt_cfg.fw_mem_dump_enabled = wma_handle->fw_mem_dump_enabled; wma_update_hdd_cfg_ndp(wma_handle, &tgt_cfg); wma_handle->tgt_cfg_update_cb(hdd_ctx, &tgt_cfg); } @@ -4684,6 +4684,12 @@ int wma_rx_service_ready_event(void *handle, uint8_t *cmd_param_info, } #endif /* WLAN_FEATURE_GTK_OFFLOAD */ + if (WMI_SERVICE_IS_ENABLED(wma_handle->wmi_service_bitmap, + WMI_SERVICE_FW_MEM_DUMP_SUPPORT)) + wma_handle->fw_mem_dump_enabled = true; + else + wma_handle->fw_mem_dump_enabled = false; + status = wmi_unified_register_event_handler(wma_handle->wmi_handle, WMI_P2P_NOA_EVENTID, wma_p2p_noa_event_handler, |
