1
0

qcacld-3.0: Remove FW memory dump feature

qcacld-2.0 to qcacld-3.0 propagation

FW memory dump feature is no longer used. Hence remove FW memory
dump feature code changes.

Change-Id: Ida655f83630c369df746e7c0c9d61a8fee2932a2
CRs-Fixed: 2140261
Este cometimento está contido em:
Hanumanth Reddy Pothula
2017-11-08 19:35:19 +05:30
ascendente daf47342e0
cometimento 07e5f99716
20 ficheiros modificados com 28 adições e 1183 eliminações

12
Kbuild
Ver ficheiro

@@ -176,9 +176,6 @@ ifeq ($(KERNEL_BUILD), 0)
endif
ifneq ($(CONFIG_ROME_IF),sdio)
#Flag to enable memdump feature
CONFIG_WLAN_FEATURE_MEMDUMP := y
#Flag to enable DISA
CONFIG_WLAN_FEATURE_DISA := y
@@ -433,6 +430,7 @@ HDD_OBJS := $(HDD_SRC_DIR)/wlan_hdd_assoc.o \
$(HDD_SRC_DIR)/wlan_hdd_ioctl.o \
$(HDD_SRC_DIR)/wlan_hdd_main.o \
$(HDD_SRC_DIR)/wlan_hdd_object_manager.o \
$(HDD_SRC_DIR)/wlan_hdd_memdump.o \
$(HDD_SRC_DIR)/wlan_hdd_oemdata.o \
$(HDD_SRC_DIR)/wlan_hdd_packet_filter.o \
$(HDD_SRC_DIR)/wlan_hdd_power.o \
@@ -507,10 +505,6 @@ ifeq ($(CONFIG_MPC_UT_FRAMEWORK),y)
HDD_OBJS += $(HDD_SRC_DIR)/wlan_hdd_conc_ut.o
endif
ifeq ($(CONFIG_WLAN_FEATURE_MEMDUMP),y)
HDD_OBJS += $(HDD_SRC_DIR)/wlan_hdd_memdump.o
endif
ifeq ($(CONFIG_WLAN_FEATURE_DISA),y)
HDD_OBJS += $(HDD_SRC_DIR)/wlan_hdd_disa.o
endif
@@ -2221,10 +2215,6 @@ ifeq ($(CONFIG_WLAN_OFFLOAD_PACKETS),y)
CDEFINES += -DWLAN_FEATURE_OFFLOAD_PACKETS
endif
ifeq ($(CONFIG_WLAN_FEATURE_MEMDUMP),y)
CDEFINES += -DWLAN_FEATURE_MEMDUMP
endif
ifeq ($(CONFIG_WLAN_FEATURE_DISA),y)
CDEFINES += -DWLAN_FEATURE_DISA
endif

Ver ficheiro

@@ -71,10 +71,6 @@ config WLAN_OFFLOAD_PACKETS
bool "Enable offload packets feature"
default n
config WLAN_FEATURE_MEMDUMP
bool "Enable MEMDUMP feature"
default n
config FEATURE_TSO
bool "Enable TCP Segmentation Offload"
depends on HELIUMPLUS

Ver ficheiro

@@ -361,6 +361,8 @@
#define WLAN_NUD_STATS_LEN 800
/* ARP packet type for NUD debug stats */
#define WLAN_NUD_STATS_ARP_PKT_TYPE 1
/* Assigned size of driver memory dump is 4096 bytes */
#define DRIVER_MEM_DUMP_SIZE 4096
/*
* Generic asynchronous request/response support
@@ -1614,14 +1616,7 @@ struct hdd_context {
struct hdd_offloaded_packets_ctx op_ctx;
#endif
bool mcc_mode;
#ifdef WLAN_FEATURE_MEMDUMP
uint8_t *fw_dump_loc;
uint32_t dump_loc_paddr;
qdf_mc_timer_t memdump_cleanup_timer;
struct mutex memdump_lock;
bool memdump_in_progress;
bool memdump_init_done;
#endif /* WLAN_FEATURE_MEMDUMP */
uint16_t driver_dump_size;
uint8_t *driver_dump_mem;
@@ -1700,7 +1695,6 @@ struct hdd_context {
uint8_t bt_vo_active:1;
struct hdd_nud_stats_context nud_stats_context;
enum band_info curr_band;
bool fw_mem_dump_enabled;
bool imps_enabled;
int user_configured_pkt_filter_rules;
bool is_fils_roaming_supported;
@@ -2174,25 +2168,6 @@ int hdd_update_acs_timer_reason(struct hdd_adapter *adapter, uint8_t reason);
* Return: None
*/
void hdd_switch_sap_channel(struct hdd_adapter *adapter, uint8_t channel);
#ifdef WLAN_FEATURE_MEMDUMP
/**
* hdd_is_memdump_supported() - to check if memdump feature support
*
* This function is used to check if memdump feature is supported in
* the host driver
*
* Return: true if supported and false otherwise
*/
static inline bool hdd_is_memdump_supported(struct hdd_context *hdd_ctx)
{
return hdd_ctx->fw_mem_dump_enabled;
}
#else
static inline bool hdd_is_memdump_supported(struct hdd_context *hdd_ctx)
{
return false;
}
#endif /* WLAN_FEATURE_MEMDUMP */
void hdd_update_macaddr(struct hdd_config *config,
struct qdf_mac_addr hw_macaddr);
@@ -2866,4 +2841,7 @@ void hdd_pld_ipa_uc_shutdown_pipes(void);
*/
uint32_t hdd_limit_max_per_index_score(uint32_t per_index_score);
int hdd_driver_memdump_init(void);
void hdd_driver_memdump_deinit(void);
#endif /* end #if !defined(WLAN_HDD_MAIN_H) */

Ver ficheiro

@@ -1,118 +0,0 @@
/*
* Copyright (c) 2015-2016 The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
* above copyright notice and this permission notice appear in all
* copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
* AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
/*
* This file was originally distributed by Qualcomm Atheros, Inc.
* under proprietary terms before Copyright ownership was assigned
* to the Linux Foundation.
*/
/**
* DOC : wlan_hdd_memdump.h
*
* WLAN Host Device Driver file for dumping firmware memory
*
*/
#if !defined(WLAN_HDD_MEMDUMP_H)
#define WLAN_HDD_MEMDUMP_H
#include "wlan_hdd_main.h"
/* Assigned size of driver memory dump is 4096 bytes */
#define DRIVER_MEM_DUMP_SIZE 4096
#ifdef WLAN_FEATURE_MEMDUMP
/**
* enum qca_wlan_vendor_attr_memory_dump - values for memory dump attributes
* @QCA_WLAN_VENDOR_ATTR_MEMORY_DUMP_INVALID - Invalid
* @QCA_WLAN_VENDOR_ATTR_REQUEST_ID - Indicate request ID
* @QCA_WLAN_VENDOR_ATTR_MEMDUMP_SIZE - Indicate size of the memory dump
* @QCA_WLAN_VENDOR_ATTR_MEMORY_DUMP_AFTER_LAST - To keep track of the last enum
* @QCA_WLAN_VENDOR_ATTR_MEMORY_DUMP_MAX - max value possible for this type
*
* enum values are used for NL attributes for data used by
* QCA_NL80211_VENDOR_SUBCMD_WIFI_LOGGER_MEMORY_DUMP sub command.
*/
enum qca_wlan_vendor_attr_memory_dump {
QCA_WLAN_VENDOR_ATTR_MEMORY_DUMP_INVALID = 0,
QCA_WLAN_VENDOR_ATTR_REQUEST_ID = 1,
QCA_WLAN_VENDOR_ATTR_MEMDUMP_SIZE = 2,
QCA_WLAN_VENDOR_ATTR_MEMORY_DUMP_AFTER_LAST,
QCA_WLAN_VENDOR_ATTR_MEMORY_DUMP_MAX =
QCA_WLAN_VENDOR_ATTR_MEMORY_DUMP_AFTER_LAST - 1,
};
/* Size of fw memory dump is estimated to be 327680 bytes */
#define FW_MEM_DUMP_SIZE 327680
#define FW_DRAM_LOCATION 0x00400000
#define FW_MEM_DUMP_REQ_ID 1
#define FW_MEM_DUMP_NUM_SEG 1
#define MEMDUMP_COMPLETION_TIME_MS 800
int memdump_init(void);
void memdump_deinit(void);
int wlan_hdd_cfg80211_get_fw_mem_dump(struct wiphy *wiphy,
struct wireless_dev *wdev,
const void *data, int data_len);
void wlan_hdd_cfg80211_fw_mem_dump_cb(void *ctx, struct fw_dump_rsp *dump_rsp);
int hdd_driver_memdump_init(void);
void hdd_driver_memdump_deinit(void);
#else
static inline int memdump_init(void)
{
return -ENOTSUPP;
}
static inline void memdump_deinit(void)
{
}
static inline int wlan_hdd_cfg80211_get_fw_mem_dump(struct wiphy *wiphy,
struct wireless_dev *wdev,
const void *data, int data_len)
{
return -ENOTSUPP;
}
static inline void wlan_hdd_cfg80211_fw_mem_dump_cb(void *ctx,
struct fw_dump_rsp
*dump_rsp)
{
}
static inline int hdd_driver_memdump_init(void)
{
return -ENOTSUPP;
}
static inline void hdd_driver_memdump_deinit(void)
{
}
#endif
#endif /* if !defined(WLAN_HDD_MEMDUMP_H)*/

Ver ficheiro

@@ -92,7 +92,6 @@
#include "cds_api.h"
#include "wlan_policy_mgr_api.h"
#include "qwlan_version.h"
#include "wlan_hdd_memdump.h"
#include "wlan_hdd_ocb.h"
#include "wlan_hdd_tsf.h"
@@ -1379,12 +1378,6 @@ static const struct nl80211_vendor_cmd_info wlan_hdd_cfg80211_vendor_events[] =
.vendor_id = QCA_NL80211_VENDOR_ID,
.subcmd = QCA_NL80211_VENDOR_SUBCMD_MONITOR_RSSI
},
#ifdef WLAN_FEATURE_MEMDUMP
[QCA_NL80211_VENDOR_SUBCMD_WIFI_LOGGER_MEMORY_DUMP_INDEX] = {
.vendor_id = QCA_NL80211_VENDOR_ID,
.subcmd = QCA_NL80211_VENDOR_SUBCMD_WIFI_LOGGER_MEMORY_DUMP
},
#endif /* WLAN_FEATURE_MEMDUMP */
#ifdef WLAN_FEATURE_TSF
[QCA_NL80211_VENDOR_SUBCMD_TSF_INDEX] = {
.vendor_id = QCA_NL80211_VENDOR_ID,
@@ -5489,8 +5482,6 @@ __wlan_hdd_cfg80211_get_logger_supp_feature(struct wiphy *wiphy,
features = 0;
if (hdd_is_memdump_supported(hdd_ctx))
features |= WIFI_LOGGER_MEMORY_DUMP_SUPPORTED;
features |= WIFI_LOGGER_PER_PACKET_TX_RX_STATUS_SUPPORTED;
features |= WIFI_LOGGER_CONNECT_EVENT_SUPPORTED;
features |= WIFI_LOGGER_WAKE_LOCK_SUPPORTED;
@@ -12554,16 +12545,6 @@ const struct wiphy_vendor_command hdd_wiphy_vendor_commands[] = {
WIPHY_VENDOR_CMD_NEED_RUNNING,
.doit = wlan_hdd_cfg80211_get_logger_supp_feature
},
#ifdef WLAN_FEATURE_MEMDUMP
{
.info.vendor_id = QCA_NL80211_VENDOR_ID,
.info.subcmd = QCA_NL80211_VENDOR_SUBCMD_WIFI_LOGGER_MEMORY_DUMP,
.flags = WIPHY_VENDOR_CMD_NEED_WDEV |
WIPHY_VENDOR_CMD_NEED_NETDEV |
WIPHY_VENDOR_CMD_NEED_RUNNING,
.doit = wlan_hdd_cfg80211_get_fw_mem_dump
},
#endif /* WLAN_FEATURE_MEMDUMP */
{
.info.vendor_id = QCA_NL80211_VENDOR_ID,
.info.subcmd = QCA_NL80211_VENDOR_SUBCMD_TRIGGER_SCAN,

Ver ficheiro

@@ -96,7 +96,6 @@
#include "wlan_hdd_debugfs.h"
#include "wlan_hdd_driver_ops.h"
#include "epping_main.h"
#include "wlan_hdd_memdump.h"
#include "wlan_hdd_data_stall_detection.h"
#include <wlan_hdd_ipa.h>
@@ -1884,8 +1883,6 @@ void hdd_update_tgt_cfg(void *context, void *param)
*/
hdd_update_wiphy_vhtcap(hdd_ctx);
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
@@ -6246,7 +6243,6 @@ static void hdd_wlan_exit(struct hdd_context *hdd_ctx)
hdd_wlan_stop_modules(hdd_ctx, false);
memdump_deinit();
hdd_driver_memdump_deinit();
qdf_nbuf_deinit_replenish_timer();
@@ -10251,7 +10247,6 @@ int hdd_wlan_startup(struct device *dev)
hdd_request_manager_init();
hdd_green_ap_init(hdd_ctx);
memdump_init();
hdd_driver_memdump_init();
ret = hdd_wlan_start_modules(hdd_ctx, NULL, false);
@@ -10367,7 +10362,6 @@ err_stop_modules:
err_memdump_deinit:
hdd_driver_memdump_deinit();
memdump_deinit();
hdd_green_ap_deinit(hdd_ctx);
hdd_request_manager_deinit();
@@ -10491,13 +10485,6 @@ int hdd_register_cb(struct hdd_context *hdd_ctx)
sme_register_oem_data_rsp_callback(hdd_ctx->hHal,
hdd_send_oem_data_rsp_msg);
status = sme_fw_mem_dump_register_cb(hdd_ctx->hHal,
wlan_hdd_cfg80211_fw_mem_dump_cb);
if (!QDF_IS_STATUS_SUCCESS(status)) {
hdd_err("Failed to register memdump callback");
ret = -EINVAL;
return ret;
}
sme_register_mgmt_frame_ind_callback(hdd_ctx->hHal,
hdd_indicate_mgmt_frame);
sme_set_tsfcb(hdd_ctx->hHal, hdd_get_tsf_cb, hdd_ctx);
@@ -10588,10 +10575,6 @@ void hdd_deregister_cb(struct hdd_context *hdd_ctx)
if (!QDF_IS_STATUS_SUCCESS(status))
hdd_err("Failed to de-register tsfcb the callback:%d",
status);
status = sme_fw_mem_dump_unregister_cb(hdd_ctx->hHal);
if (!QDF_IS_STATUS_SUCCESS(status))
hdd_err("Failed to de-register the fw mem dump callback: %d",
status);
ret = hdd_deregister_data_stall_detect_cb();
if (ret)

Ver ficheiro

@@ -34,329 +34,22 @@
#include <sme_api.h>
#include <wlan_hdd_includes.h>
#include "wlan_hdd_memdump.h"
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/version.h>
#include <linux/proc_fs.h> /* Necessary because we use the proc fs */
#include <linux/uaccess.h> /* for copy_to_user */
/**
* hdd_fw_dump_context - hdd firmware memory dump context
*
* @request_id: userspace assigned firmware memory dump request ID
* @response_event: firmware memory dump request wait event
*/
struct hdd_fw_dump_context {
uint32_t request_id;
struct completion response_event;
};
static struct hdd_fw_dump_context fw_dump_context;
/**
* memdump_cleanup_timer_cb() - Timer callback function for memory dump cleanup.
*
* @data: Callback data (used to stored HDD context)
*
* Callback function registered for memory dump cleanup VOS timer.
*
* Return: none
*/
#ifdef MULTI_IF_NAME
#define PROCFS_DRIVER_DUMP_DIR "debugdriver" MULTI_IF_NAME
#else
#define PROCFS_DRIVER_DUMP_DIR "debugdriver"
#endif
#define PROCFS_DRIVER_DUMP_NAME "driverdump"
#define PROCFS_DRIVER_DUMP_PERM 0444
static void memdump_cleanup_timer_cb(void *data)
{
int status;
struct hdd_context *hdd_ctx = data;
qdf_dma_addr_t paddr;
qdf_dma_addr_t dma_ctx = 0;
qdf_device_t qdf_ctx;
status = wlan_hdd_validate_context(hdd_ctx);
if (status)
return;
if (!hdd_ctx->fw_dump_loc) {
hdd_debug("Memory dump already freed");
return;
}
qdf_ctx = cds_get_context(QDF_MODULE_ID_QDF_DEVICE);
if (!qdf_ctx) {
hdd_err("QDF context is NULL");
return;
}
paddr = hdd_ctx->dump_loc_paddr;
mutex_lock(&hdd_ctx->memdump_lock);
qdf_mem_free_consistent(qdf_ctx, qdf_ctx->dev,
FW_MEM_DUMP_SIZE, hdd_ctx->fw_dump_loc, paddr, dma_ctx);
hdd_ctx->fw_dump_loc = NULL;
hdd_ctx->memdump_in_progress = false;
mutex_unlock(&hdd_ctx->memdump_lock);
}
/**
* wlan_hdd_cfg80211_fw_mem_dump_cb() - Callback to receive FW memory dump
* @ctx: pointer to HDD context.
* @dump_rsp: pointer to fw dump copy complete response
*
* This is a callback function used to indicate user space about the
* availability for firmware memory dump via vendor event.
*
* Return: None
*/
void wlan_hdd_cfg80211_fw_mem_dump_cb(void *ctx,
struct fw_dump_rsp *dump_rsp)
{
struct hdd_context *hdd_ctx = ctx;
struct hdd_fw_dump_context *context;
int status;
status = wlan_hdd_validate_context(hdd_ctx);
if (status)
return;
spin_lock(&hdd_context_lock);
context = &fw_dump_context;
/* validate the response received */
if (!dump_rsp->dump_complete ||
context->request_id != dump_rsp->request_id) {
spin_unlock(&hdd_context_lock);
hdd_err("request_id: %d response_id: %d status: %d",
context->request_id, dump_rsp->request_id,
dump_rsp->dump_complete);
return;
}
complete(&context->response_event);
spin_unlock(&hdd_context_lock);
}
/**
* wlan_hdd_send_memdump_rsp - send memory dump response to user space
* @hdd_ctx: Pointer to hdd context
*
* Return: 0 for success; non-zero for failure
*/
static int wlan_hdd_send_memdump_rsp(struct hdd_context *hdd_ctx)
{
struct sk_buff *skb;
int status;
status = wlan_hdd_validate_context(hdd_ctx);
if (status)
return status;
skb = cfg80211_vendor_cmd_alloc_reply_skb(hdd_ctx->wiphy,
NLMSG_HDRLEN + NLA_HDRLEN + sizeof(uint32_t));
if (!skb) {
hdd_err("cfg80211_vendor_cmd_alloc_reply_skb failed");
return -ENOMEM;
}
if (nla_put_u32(skb, QCA_WLAN_VENDOR_ATTR_MEMDUMP_SIZE,
FW_MEM_DUMP_SIZE)) {
hdd_err("nla put fail");
goto nla_put_failure;
}
cfg80211_vendor_cmd_reply(skb);
hdd_debug("Memdump event sent successfully to user space");
return 0;
nla_put_failure:
kfree_skb(skb);
return -EINVAL;
}
/**
* __wlan_hdd_cfg80211_get_fw_mem_dump() - Get FW memory dump
* @wiphy: pointer to wireless wiphy structure.
* @wdev: pointer to wireless_dev structure.
* @data: Pointer to the NL data.
* @data_len:Length of @data
*
* This is called when wlan driver needs to get the firmware memory dump
* via vendor specific command.
*
* Return: 0 on success, error number otherwise.
*/
static int __wlan_hdd_cfg80211_get_fw_mem_dump(struct wiphy *wiphy,
struct wireless_dev *wdev,
const void *data, int data_len)
{
int status;
QDF_STATUS sme_status;
struct hdd_context *hdd_ctx = wiphy_priv(wiphy);
struct fw_dump_req fw_mem_dump_req;
struct fw_dump_seg_req *seg_req;
uint8_t loop;
qdf_dma_addr_t paddr;
qdf_dma_addr_t dma_ctx = 0;
qdf_device_t qdf_ctx;
unsigned long rc;
struct hdd_fw_dump_context *context;
ENTER_DEV(wdev->netdev);
status = wlan_hdd_validate_context(hdd_ctx);
if (status)
return status;
if (!hdd_ctx->fw_mem_dump_enabled) {
hdd_notice("FW memory dump not supported by this FW");
return -EOPNOTSUPP;
}
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;
}
/*
* Allocate memory for fw memory dump. Memory allocated should be
* contiguous. Physical address of the allocated memory is passed
* to the FW for copy
*
* Reuse the memory if available.
*/
mutex_lock(&hdd_ctx->memdump_lock);
if (!hdd_ctx->fw_dump_loc) {
hdd_ctx->fw_dump_loc = qdf_mem_alloc_consistent(
qdf_ctx, qdf_ctx->dev, FW_MEM_DUMP_SIZE, &paddr);
if (!hdd_ctx->fw_dump_loc) {
mutex_unlock(&hdd_ctx->memdump_lock);
hdd_err("qdf_mem_alloc_consistent failed");
return -ENOMEM;
}
hdd_ctx->dump_loc_paddr = paddr;
} else {
paddr = hdd_ctx->dump_loc_paddr;
}
mutex_unlock(&hdd_ctx->memdump_lock);
/*
* Currently request_id and num_seg is assumed to be default(1)
* It is assumed that firmware dump requested is for DRAM section
* only
*/
fw_mem_dump_req.request_id = FW_MEM_DUMP_REQ_ID;
fw_mem_dump_req.num_seg = FW_MEM_DUMP_NUM_SEG;
hdd_debug("request_id:%d num_seg:%d",
fw_mem_dump_req.request_id, fw_mem_dump_req.num_seg);
seg_req = (struct fw_dump_seg_req *) fw_mem_dump_req.segment;
for (loop = 0; loop < fw_mem_dump_req.num_seg; loop++) {
seg_req->seg_id = 1;
seg_req->seg_start_addr_lo = FW_DRAM_LOCATION;
seg_req->seg_start_addr_hi = 0;
seg_req->seg_length = FW_MEM_DUMP_SIZE;
seg_req->dst_addr_lo = hdd_ctx->dump_loc_paddr;
seg_req->dst_addr_hi = 0;
hdd_debug("seg_number:%d", loop);
hdd_debug("seg_id:%d start_addr_lo:0x%x start_addr_hi:0x%x",
seg_req->seg_id, seg_req->seg_start_addr_lo,
seg_req->seg_start_addr_hi);
hdd_debug("seg_length:%d dst_addr_lo:0x%x dst_addr_hi:0x%x",
seg_req->seg_length, seg_req->dst_addr_lo,
seg_req->dst_addr_hi);
seg_req++;
}
/**
* Start the cleanup timer.
* Memory allocated for this request will be freed up
* once the timer expires. Memory dump request is expected to be
* completed by this time.
*
* User space will not be able to access the dump after this time.
* New request should be issued to get the dump again.
*/
qdf_mc_timer_start(&hdd_ctx->memdump_cleanup_timer,
MEMDUMP_COMPLETION_TIME_MS);
hdd_ctx->memdump_in_progress = true;
spin_lock(&hdd_context_lock);
context = &fw_dump_context;
context->request_id = fw_mem_dump_req.request_id;
INIT_COMPLETION(context->response_event);
spin_unlock(&hdd_context_lock);
sme_status = sme_fw_mem_dump(hdd_ctx->hHal, &fw_mem_dump_req);
if (QDF_STATUS_SUCCESS != sme_status) {
hdd_err("sme_fw_mem_dump Failed");
mutex_lock(&hdd_ctx->memdump_lock);
qdf_mem_free_consistent(qdf_ctx, qdf_ctx->dev,
FW_MEM_DUMP_SIZE, hdd_ctx->fw_dump_loc, paddr, dma_ctx);
hdd_ctx->fw_dump_loc = NULL;
mutex_unlock(&hdd_ctx->memdump_lock);
hdd_ctx->memdump_in_progress = false;
if (QDF_TIMER_STATE_RUNNING ==
qdf_mc_timer_get_current_state(
&hdd_ctx->memdump_cleanup_timer)) {
qdf_mc_timer_stop(&hdd_ctx->memdump_cleanup_timer);
}
return -EINVAL;
}
rc = wait_for_completion_timeout(&context->response_event,
msecs_to_jiffies(MEMDUMP_COMPLETION_TIME_MS));
if (!rc) {
hdd_err("Target response timed out for request_id: %d",
context->request_id);
return -ETIMEDOUT;
}
status = wlan_hdd_send_memdump_rsp(hdd_ctx);
if (status)
hdd_err("Failed to send FW memory dump rsp to user space");
return status;
}
/**
* wlan_hdd_cfg80211_get_fw_mem_dump() - Get FW memory dump
* @wiphy: pointer to wireless wiphy structure.
* @wdev: pointer to wireless_dev structure.
* @data: Pointer to the NL data.
* @data_len:Length of @data
*
* This is called when wlan driver needs to get the firmware memory dump
* via vendor specific command.
*
* Return: 0 on success, error number otherwise.
*/
int wlan_hdd_cfg80211_get_fw_mem_dump(struct wiphy *wiphy,
struct wireless_dev *wdev,
const void *data, int data_len)
{
int ret;
cds_ssr_protect(__func__);
ret = __wlan_hdd_cfg80211_get_fw_mem_dump(wiphy, wdev, data, data_len);
cds_ssr_unprotect(__func__);
return ret;
}
#define PROCFS_MEMDUMP_DIR "debug"
#define PROCFS_MEMDUMP_NAME "fwdump"
#define PROCFS_MEMDUMP_PERM 0444
static struct proc_dir_entry *proc_file, *proc_dir;
static struct proc_dir_entry *proc_file_driver, *proc_dir_driver;
/** memdump_get_file_data() - get data available in proc file
*
@@ -375,272 +68,6 @@ static void *memdump_get_file_data(struct file *file)
return hdd_ctx;
}
/**
* memdump_read() - perform read operation in memory dump proc file
*
* @file - handle for the proc file.
* @buf - pointer to user space buffer.
* @count - number of bytes to be read.
* @pos - offset in the from buffer.
*
* This function performs read operation for the memory dump proc file.
*
* Return: number of bytes read on success, error code otherwise.
*/
static ssize_t memdump_read(struct file *file, char __user *buf,
size_t count, loff_t *pos)
{
int status;
struct hdd_context *hdd_ctx;
qdf_dma_addr_t paddr;
qdf_dma_addr_t dma_ctx = 0;
qdf_device_t qdf_ctx;
hdd_ctx = memdump_get_file_data(file);
hdd_debug("Read req for size:%zu pos:%llu", count, *pos);
status = wlan_hdd_validate_context(hdd_ctx);
if (status)
return status;
qdf_ctx = cds_get_context(QDF_MODULE_ID_QDF_DEVICE);
if (!qdf_ctx) {
hdd_err("QDF context is NULL");
return -EINVAL;
}
mutex_lock(&hdd_ctx->memdump_lock);
if (!hdd_ctx->memdump_in_progress) {
hdd_err("Current mem dump request timed out/failed");
status = -EINVAL;
goto memdump_read_fail;
}
if (*pos < 0) {
hdd_err("Invalid start offset for memdump read");
status = -EINVAL;
goto memdump_read_fail;
} else if (*pos >= FW_MEM_DUMP_SIZE || !count) {
hdd_debug("No more data to copy");
status = 0;
goto memdump_read_fail;
} else if (count > FW_MEM_DUMP_SIZE - *pos) {
count = FW_MEM_DUMP_SIZE - *pos;
}
if (!hdd_ctx->fw_dump_loc) {
hdd_err("Invalid fw mem dump location");
status = -EINVAL;
goto memdump_read_fail;
}
if (copy_to_user(buf, hdd_ctx->fw_dump_loc + *pos, count)) {
hdd_err("copy to user space failed");
status = -EFAULT;
goto memdump_read_fail;
}
/* offset(pos) should be updated here based on the copy done*/
*pos += count;
/* Entire FW memory dump copy completed */
if (*pos >= FW_MEM_DUMP_SIZE) {
paddr = hdd_ctx->dump_loc_paddr;
qdf_mem_free_consistent(qdf_ctx, qdf_ctx->dev,
FW_MEM_DUMP_SIZE, hdd_ctx->fw_dump_loc, paddr, dma_ctx);
hdd_ctx->fw_dump_loc = NULL;
hdd_ctx->memdump_in_progress = false;
if (QDF_TIMER_STATE_RUNNING ==
qdf_mc_timer_get_current_state(
&hdd_ctx->memdump_cleanup_timer)) {
qdf_mc_timer_stop(&hdd_ctx->memdump_cleanup_timer);
}
}
status = count;
memdump_read_fail:
mutex_unlock(&hdd_ctx->memdump_lock);
return status;
}
/**
* struct memdump_fops - file operations for memory dump feature
* @read - read function for memory dump operation.
*
* This structure initialize the file operation handle for memory
* dump feature
*/
static const struct file_operations memdump_fops = {
read: memdump_read
};
/**
* memdump_procfs_init() - Initialize procfs for memory dump
*
* This function create file under proc file system to be used later for
* processing firmware memory dump
*
* Return: 0 on success, error code otherwise.
*/
static int memdump_procfs_init(void)
{
struct hdd_context *hdd_ctx;
hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
if (!hdd_ctx) {
hdd_err("Invalid HDD context");
return -EINVAL;
}
proc_dir = proc_mkdir(PROCFS_MEMDUMP_DIR, NULL);
if (proc_dir == NULL) {
remove_proc_entry(PROCFS_MEMDUMP_DIR, NULL);
pr_debug("Could not initialize /proc/%s\n",
PROCFS_MEMDUMP_DIR);
return -ENOMEM;
}
proc_file = proc_create_data(PROCFS_MEMDUMP_NAME,
PROCFS_MEMDUMP_PERM, proc_dir,
&memdump_fops, hdd_ctx);
if (proc_file == NULL) {
remove_proc_entry(PROCFS_MEMDUMP_NAME, proc_dir);
pr_debug("Could not initialize /proc/%s\n",
PROCFS_MEMDUMP_NAME);
return -ENOMEM;
}
pr_debug("/proc/%s/%s created\n", PROCFS_MEMDUMP_DIR,
PROCFS_MEMDUMP_NAME);
return 0;
}
/**
* memdump_procfs_remove() - Remove file/dir under procfs for memory dump
*
* This function removes file/dir under proc file system that was
* processing firmware memory dump
*
* Return: None
*/
static void memdump_procfs_remove(void)
{
remove_proc_entry(PROCFS_MEMDUMP_NAME, proc_dir);
pr_debug("/proc/%s/%s removed\n", PROCFS_MEMDUMP_DIR,
PROCFS_MEMDUMP_NAME);
remove_proc_entry(PROCFS_MEMDUMP_DIR, NULL);
pr_debug("/proc/%s removed\n", PROCFS_MEMDUMP_DIR);
}
/**
* memdump_init() - Intialization function for memory dump feature
*
* This function creates proc file for memdump feature and registers
* HDD callback function with SME.
*
* Return - 0 on success, error otherwise
*/
int memdump_init(void)
{
struct hdd_context *hdd_ctx;
int status = 0;
QDF_STATUS qdf_status;
hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
if (!hdd_ctx) {
hdd_err("Invalid HDD context");
return -EINVAL;
}
status = memdump_procfs_init();
if (status) {
hdd_err("Failed to create proc file");
return status;
}
init_completion(&fw_dump_context.response_event);
qdf_status = qdf_mc_timer_init(&hdd_ctx->memdump_cleanup_timer,
QDF_TIMER_TYPE_SW, memdump_cleanup_timer_cb,
(void *)hdd_ctx);
if (!QDF_IS_STATUS_SUCCESS(qdf_status)) {
hdd_err("Failed to init memdump cleanup timer");
return -EINVAL;
}
mutex_init(&hdd_ctx->memdump_lock);
hdd_ctx->memdump_init_done = true;
return 0;
}
/**
* memdump_deinit() - De initialize memdump feature
*
* This function removes proc file created for memdump feature.
*
* Return: None
*/
void memdump_deinit(void)
{
struct hdd_context *hdd_ctx;
qdf_dma_addr_t paddr;
qdf_dma_addr_t dma_ctx = 0;
qdf_device_t qdf_ctx;
QDF_STATUS qdf_status;
hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
if (!hdd_ctx) {
hdd_err("Invalid HDD context");
return;
}
if (!hdd_ctx->memdump_init_done) {
hdd_warn("MemDump not initialized");
return;
}
hdd_ctx->memdump_init_done = false;
qdf_ctx = cds_get_context(QDF_MODULE_ID_QDF_DEVICE);
if (!qdf_ctx) {
hdd_err("QDF context is NULL");
return;
}
memdump_procfs_remove();
mutex_lock(&hdd_ctx->memdump_lock);
if (hdd_ctx->fw_dump_loc) {
paddr = hdd_ctx->dump_loc_paddr;
qdf_mem_free_consistent(qdf_ctx, qdf_ctx->dev,
FW_MEM_DUMP_SIZE, hdd_ctx->fw_dump_loc, paddr, dma_ctx);
hdd_ctx->fw_dump_loc = NULL;
hdd_ctx->memdump_in_progress = false;
}
mutex_unlock(&hdd_ctx->memdump_lock);
mutex_destroy(&hdd_ctx->memdump_lock);
if (QDF_TIMER_STATE_RUNNING ==
qdf_mc_timer_get_current_state(&hdd_ctx->memdump_cleanup_timer)) {
qdf_mc_timer_stop(&hdd_ctx->memdump_cleanup_timer);
}
qdf_status = qdf_mc_timer_destroy(&hdd_ctx->memdump_cleanup_timer);
if (!QDF_IS_STATUS_SUCCESS(qdf_status))
hdd_err("Failed to deallocate timer");
}
#ifdef MULTI_IF_NAME
#define PROCFS_DRIVER_DUMP_DIR "debugdriver" MULTI_IF_NAME
#else
#define PROCFS_DRIVER_DUMP_DIR "debugdriver"
#endif
#define PROCFS_DRIVER_DUMP_NAME "driverdump"
#define PROCFS_DRIVER_DUMP_PERM 0444
static struct proc_dir_entry *proc_file_driver, *proc_dir_driver;
/**
* hdd_driver_mem_cleanup() - Frees memory allocated for
* driver dump
@@ -771,22 +198,15 @@ read: hdd_driver_memdump_read
/**
* hdd_driver_memdump_procfs_init() - Initialize procfs for driver memory dump
* @hdd_ctx Pointer to hdd context
*
* This function create file under proc file system to be used later for
* processing driver memory dump
*
* Return: 0 on success, error code otherwise.
*/
static int hdd_driver_memdump_procfs_init(void)
static int hdd_driver_memdump_procfs_init(struct hdd_context *hdd_ctx)
{
struct hdd_context *hdd_ctx;
hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
if (!hdd_ctx) {
hdd_err("Invalid HDD context");
return -EINVAL;
}
proc_dir_driver = proc_mkdir(PROCFS_DRIVER_DUMP_DIR, NULL);
if (proc_dir_driver == NULL) {
pr_debug("Could not initialize /proc/%s\n",
@@ -838,13 +258,22 @@ static void hdd_driver_memdump_procfs_remove(void)
int hdd_driver_memdump_init(void)
{
int status;
struct hdd_context *hdd_ctx;
if (hdd_get_conparam() == QDF_GLOBAL_FTM_MODE) {
hdd_err("Not initializing memdump in FTM mode");
return -EINVAL;
}
status = hdd_driver_memdump_procfs_init();
hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
if (!hdd_ctx) {
hdd_err("Invalid HDD context");
return -EINVAL;
}
mutex_init(&hdd_ctx->memdump_lock);
status = hdd_driver_memdump_procfs_init(hdd_ctx);
if (status) {
hdd_err("Failed to create proc file");
return status;

Ver ficheiro

@@ -6019,56 +6019,6 @@ struct chip_pwr_save_fail_detected_params {
#define MAX_NUM_FW_SEGMENTS 4
/**
* struct fw_dump_seg_req - individual segment details
* @seg_id - segment id.
* @seg_start_addr_lo - lower address of the segment.
* @seg_start_addr_hi - higher address of the segment.
* @seg_length - length of the segment.
* @dst_addr_lo - lower address of the destination buffer.
* @dst_addr_hi - higher address of the destination buffer.
*
* This structure carries the information to firmware about the
* individual segments. This structure is part of firmware memory
* dump request.
*/
struct fw_dump_seg_req {
uint8_t seg_id;
uint32_t seg_start_addr_lo;
uint32_t seg_start_addr_hi;
uint32_t seg_length;
uint32_t dst_addr_lo;
uint32_t dst_addr_hi;
};
/**
* struct fw_dump_req - firmware memory dump request details.
* @request_id - request id.
* @num_seg - requested number of segments.
* @fw_dump_seg_req - individual segment information.
*
* This structure carries information about the firmware
* memory dump request.
*/
struct fw_dump_req {
uint32_t request_id;
uint32_t num_seg;
struct fw_dump_seg_req segment[MAX_NUM_FW_SEGMENTS];
};
/**
* struct fw_dump_rsp - firmware dump response details.
* @request_id - request id.
* @dump_complete - copy completion status.
*
* This structure is used to store the firmware dump copy complete
* response from the firmware.
*/
struct fw_dump_rsp {
uint32_t request_id;
uint32_t dump_complete;
};
/**
* DEFAULT_SCAN_IE_ID - Identifier for the collection of IE's added
* by default to the probe request

Ver ficheiro

@@ -199,7 +199,6 @@ enum eWniMsgTypes {
eWNI_SME_EXTSCAN_FULL_SCAN_RESULT_IND,
eWNI_SME_EPNO_NETWORK_FOUND_IND,
#endif
eWNI_SME_FW_DUMP_IND,
eWNI_SME_SET_HW_MODE_REQ,
eWNI_SME_SET_HW_MODE_RESP,
eWNI_SME_HW_MODE_TRANS_IND,

Ver ficheiro

@@ -596,7 +596,8 @@ typedef struct sSirMbMsgP2p {
#define SIR_HAL_DCC_CLEAR_STATS_CMD (SIR_HAL_ITC_MSG_TYPES_BEGIN + 325)
#define SIR_HAL_DCC_UPDATE_NDL_CMD (SIR_HAL_ITC_MSG_TYPES_BEGIN + 326)
#define SIR_HAL_FW_MEM_DUMP_REQ (SIR_HAL_ITC_MSG_TYPES_BEGIN + 327)
/* FW Memory Dump feature is deprecated */
#define SIR_HAL_START_STOP_LOGGING (SIR_HAL_ITC_MSG_TYPES_BEGIN + 328)
#define SIR_HAL_PDEV_SET_HW_MODE (SIR_HAL_ITC_MSG_TYPES_BEGIN + 329)
#define SIR_HAL_PDEV_SET_HW_MODE_RESP (SIR_HAL_ITC_MSG_TYPES_BEGIN + 330)

Ver ficheiro

@@ -374,7 +374,6 @@ uint8_t *mac_trace_get_sme_msg_string(uint16_t sme_msg)
CASE_RETURN_STRING(eWNI_SME_SET_DUAL_MAC_CFG_REQ);
CASE_RETURN_STRING(eWNI_SME_SET_DUAL_MAC_CFG_RESP);
CASE_RETURN_STRING(eWNI_SME_SET_IE_REQ);
CASE_RETURN_STRING(eWNI_SME_FW_DUMP_IND);
CASE_RETURN_STRING(eWNI_SME_EXT_CHANGE_CHANNEL);
CASE_RETURN_STRING(eWNI_SME_EXT_CHANGE_CHANNEL_IND);
CASE_RETURN_STRING(eWNI_SME_SET_ANTENNA_MODE_REQ);
@@ -682,7 +681,6 @@ uint8_t *mac_trace_get_wma_msg_string(uint16_t wma_msg)
CASE_RETURN_STRING(WMA_UPDATE_Q2Q_IE_IND);
#endif /* FEATURE_AP_MCC_CH_AVOIDANCE */
CASE_RETURN_STRING(WMA_SET_RSSI_MONITOR_REQ);
CASE_RETURN_STRING(WMA_FW_MEM_DUMP_REQ);
CASE_RETURN_STRING(WMA_SET_WISA_PARAMS);
CASE_RETURN_STRING(WMA_SET_WOW_PULSE_CMD);
CASE_RETURN_STRING(WMA_SET_PER_ROAM_CONFIG_CMD);

Ver ficheiro

@@ -916,11 +916,6 @@ QDF_STATUS sme_ll_stats_set_thresh(tHalHandle hal,
struct sir_ll_ext_stats_threshold *threshold);
#endif /* WLAN_FEATURE_LINK_LAYER_STATS */
QDF_STATUS sme_fw_mem_dump(tHalHandle hHal, void *recvd_req);
QDF_STATUS sme_fw_mem_dump_register_cb(tHalHandle hHal,
void (*callback_routine)(void *cb_context,
struct fw_dump_rsp *rsp));
QDF_STATUS sme_fw_mem_dump_unregister_cb(tHalHandle hHal);
QDF_STATUS sme_set_wisa_params(tHalHandle hal,
struct sir_wisa_params *wisa_params);
#ifdef WLAN_FEATURE_ROAM_OFFLOAD

Ver ficheiro

@@ -228,9 +228,6 @@ typedef struct tagSmeStruct {
uint8_t miracast_value;
struct ps_global_info ps_global_info;
void (*rssi_threshold_breached_cb)(void *, struct rssi_breach_event *);
#ifdef WLAN_FEATURE_MEMDUMP
void (*fw_dump_callback)(void *context, struct fw_dump_rsp *rsp);
#endif
hw_mode_transition_cb sme_hw_mode_trans_cb;
/* OCB callbacks */
void *ocb_set_config_context;

Ver ficheiro

@@ -1420,35 +1420,6 @@ static QDF_STATUS sme_extended_change_channel_ind(tpAniSirGlobal mac_ctx,
return status;
}
/**
* sme_process_fw_mem_dump_rsp - process fw memory dump response from WMA
*
* @mac_ctx: pointer to MAC handle.
* @msg: pointer to received SME msg.
*
* This function process the received SME message and calls the corresponding
* callback which was already registered with SME.
*
* Return: None
*/
#ifdef WLAN_FEATURE_MEMDUMP
static void sme_process_fw_mem_dump_rsp(tpAniSirGlobal mac_ctx,
struct scheduler_msg *msg)
{
if (msg->bodyptr) {
if (mac_ctx->sme.fw_dump_callback)
mac_ctx->sme.fw_dump_callback(mac_ctx->hHdd,
(struct fw_dump_rsp *) msg->bodyptr);
qdf_mem_free(msg->bodyptr);
}
}
#else
static void sme_process_fw_mem_dump_rsp(tpAniSirGlobal mac_ctx,
struct scheduler_msg *msg)
{
}
#endif
#ifdef FEATURE_WLAN_ESE
/**
* sme_update_is_ese_feature_enabled() - enable/disable ESE support at runtime
@@ -2260,9 +2231,6 @@ QDF_STATUS sme_process_msg(tHalHandle hHal, struct scheduler_msg *pMsg)
qdf_mem_free(pMsg->bodyptr);
break;
#endif
case eWNI_SME_FW_DUMP_IND:
sme_process_fw_mem_dump_rsp(pMac, pMsg);
break;
case eWNI_SME_SET_HW_MODE_RESP:
if (pMsg->bodyptr) {
status = sme_process_set_hw_mode_resp(pMac,
@@ -12196,75 +12164,6 @@ QDF_STATUS sme_power_debug_stats_req(tHalHandle hal, void (*callback_fn)
}
#endif
/**
* sme_fw_mem_dump_register_cb() - Register fw memory dump callback
*
* @hal - MAC global handle
* @callback_routine - callback routine from HDD
*
* This API is invoked by HDD to register its callback in SME
*
* Return: QDF_STATUS
*/
#ifdef WLAN_FEATURE_MEMDUMP
QDF_STATUS sme_fw_mem_dump_register_cb(tHalHandle hal,
void (*callback_routine)(void *cb_context,
struct fw_dump_rsp *rsp))
{
QDF_STATUS status = QDF_STATUS_SUCCESS;
tpAniSirGlobal pmac = PMAC_STRUCT(hal);
status = sme_acquire_global_lock(&pmac->sme);
if (QDF_STATUS_SUCCESS == status) {
pmac->sme.fw_dump_callback = callback_routine;
sme_release_global_lock(&pmac->sme);
} else
QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
FL("sme_acquire_global_lock error"));
return status;
}
#else
QDF_STATUS sme_fw_mem_dump_register_cb(tHalHandle hal,
void (*callback_routine)(void *cb_context,
struct fw_dump_rsp *rsp))
{
return QDF_STATUS_SUCCESS;
}
#endif /* WLAN_FEATURE_MEMDUMP */
/**
* sme_fw_mem_dump_unregister_cb() - Unregister fw memory dump callback
*
* @hHal - MAC global handle
*
* This API is invoked by HDD to unregister its callback in SME
*
* Return: QDF_STATUS
*/
#ifdef WLAN_FEATURE_MEMDUMP
QDF_STATUS sme_fw_mem_dump_unregister_cb(tHalHandle hal)
{
QDF_STATUS status;
tpAniSirGlobal pmac = PMAC_STRUCT(hal);
status = sme_acquire_global_lock(&pmac->sme);
if (QDF_STATUS_SUCCESS == status) {
pmac->sme.fw_dump_callback = NULL;
sme_release_global_lock(&pmac->sme);
} else
QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
FL("sme_acquire_global_lock error"));
return status;
}
#else
QDF_STATUS sme_fw_mem_dump_unregister_cb(tHalHandle hal)
{
return QDF_STATUS_SUCCESS;
}
#endif /* WLAN_FEATURE_MEMDUMP */
#ifdef WLAN_FEATURE_ROAM_OFFLOAD
/*
* sme_update_roam_offload_enabled() - enable/disable roam offload feaure
@@ -13261,83 +13160,6 @@ QDF_STATUS sme_set_rssi_monitoring(tHalHandle hal,
return status;
}
/**
* sme_fw_mem_dump() - Get FW memory dump
* @hHal: hal handle
* @recvd_req: received memory dump request.
*
* This API is invoked by HDD to indicate FW to start
* dumping firmware memory.
*
* Return: QDF_STATUS
*/
#ifdef WLAN_FEATURE_MEMDUMP
QDF_STATUS sme_fw_mem_dump(tHalHandle hHal, void *recvd_req)
{
QDF_STATUS status = QDF_STATUS_SUCCESS;
QDF_STATUS qdf_status = QDF_STATUS_SUCCESS;
tpAniSirGlobal pMac = PMAC_STRUCT(hHal);
struct scheduler_msg msg = {0};
struct fw_dump_req *send_req;
struct fw_dump_seg_req seg_req;
int loop;
send_req = qdf_mem_malloc(sizeof(*send_req));
if (!send_req) {
QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
FL("Memory allocation failed for WDA_FW_MEM_DUMP"));
return QDF_STATUS_E_FAILURE;
}
qdf_mem_copy(send_req, recvd_req, sizeof(*send_req));
QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_DEBUG,
FL("request_id:%d num_seg:%d"),
send_req->request_id, send_req->num_seg);
QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_DEBUG,
FL("Segment Information"));
for (loop = 0; loop < send_req->num_seg; loop++) {
seg_req = send_req->segment[loop];
QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_DEBUG,
FL("seg_number:%d"), loop);
QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_DEBUG,
FL("seg_id:%d start_addr_lo:0x%x start_addr_hi:0x%x"),
seg_req.seg_id, seg_req.seg_start_addr_lo,
seg_req.seg_start_addr_hi);
QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_DEBUG,
FL("seg_length:%d dst_addr_lo:0x%x dst_addr_hi:0x%x"),
seg_req.seg_length, seg_req.dst_addr_lo,
seg_req.dst_addr_hi);
}
if (QDF_STATUS_SUCCESS == sme_acquire_global_lock(&pMac->sme)) {
msg.bodyptr = send_req;
msg.type = WMA_FW_MEM_DUMP_REQ;
msg.reserved = 0;
qdf_status = scheduler_post_msg(QDF_MODULE_ID_WMA, &msg);
if (QDF_STATUS_SUCCESS != qdf_status) {
QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
FL("Not able to post WMA_FW_MEM_DUMP"));
qdf_mem_free(send_req);
status = QDF_STATUS_E_FAILURE;
}
sme_release_global_lock(&pMac->sme);
} else {
QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
FL("Failed to acquire SME Global Lock"));
qdf_mem_free(send_req);
status = QDF_STATUS_E_FAILURE;
}
return status;
}
#else
QDF_STATUS sme_fw_mem_dump(tHalHandle hHal, void *recvd_req)
{
return QDF_STATUS_SUCCESS;
}
#endif /* WLAN_FEATURE_MEMDUMP */
/*
* sme_pdev_set_pcl() - Send WMI_PDEV_SET_PCL_CMDID to the WMA
* @hal: Handle returned by macOpen

Ver ficheiro

@@ -1400,7 +1400,6 @@ struct hw_mode_idx_to_mac_cap_idx {
* @dfs_cac_offload: dfs and cac timer offload
* @bandcapability: band capability configured through ini
* @ito_repeat_count: Indicates ito repeated count
* @fw_mem_dump_enabled: Fw memory dump support
* @critical_events_in_flight: number of suspend preventing events in flight
*/
typedef struct {
@@ -1599,7 +1598,6 @@ typedef struct {
bool tx_bfee_8ss_enabled;
bool in_imps;
uint8_t ito_repeat_count;
bool fw_mem_dump_enabled;
qdf_atomic_t critical_events_in_flight;
} t_wma_handle, *tp_wma_handle;

Ver ficheiro

@@ -1120,24 +1120,7 @@ void wma_set_sap_keepalive(tp_wma_handle wma, uint8_t vdev_id);
int wma_rssi_breached_event_handler(void *handle,
u_int8_t *cmd_param_info, u_int32_t len);
#ifdef WLAN_FEATURE_MEMDUMP
int wma_fw_mem_dump_event_handler(void *handle, u_int8_t *cmd_param_info,
u_int32_t len);
QDF_STATUS wma_process_fw_mem_dump_req(tp_wma_handle wma,
struct fw_dump_req *mem_dump_req);
#else
static inline int wma_fw_mem_dump_event_handler(void *handle,
u_int8_t *cmd_param_info, u_int32_t len)
{
return 0;
}
static inline QDF_STATUS wma_process_fw_mem_dump_req(tp_wma_handle wma,
void *mem_dump_req)
{
return QDF_STATUS_SUCCESS;
}
#endif
QDF_STATUS wma_process_set_ie_info(tp_wma_handle wma,
struct vdev_ie_info *ie_info);
int wma_peer_assoc_conf_handler(void *handle, uint8_t *cmd_param_info,

Ver ficheiro

@@ -159,7 +159,6 @@ struct wma_dfs_radar_ind {
* @dfs_cac_offload: dfs and cac timer offloaded
* @tx_bfee_8ss_enabled: Tx Beamformee support for 8x8
* @rcpi_enabled: for checking rcpi support
* @fw_mem_dump_enabled: Fw memory dump support
*/
struct wma_tgt_cfg {
uint32_t target_fw_version;
@@ -195,6 +194,5 @@ struct wma_tgt_cfg {
bool dfs_cac_offload;
bool tx_bfee_8ss_enabled;
bool rcpi_enabled;
bool fw_mem_dump_enabled;
};
#endif /* WMA_TGT_CFG_H */

Ver ficheiro

@@ -442,8 +442,6 @@
#endif /* FEATURE_AP_MCC_CH_AVOIDANCE */
#define WMA_SET_RSSI_MONITOR_REQ SIR_HAL_SET_RSSI_MONITOR_REQ
#define WMA_FW_MEM_DUMP_REQ SIR_HAL_FW_MEM_DUMP_REQ
#define WMA_OCB_SET_CONFIG_CMD SIR_HAL_OCB_SET_CONFIG_CMD
#define WMA_OCB_SET_UTC_TIME_CMD SIR_HAL_OCB_SET_UTC_TIME_CMD
#define WMA_OCB_START_TIMING_ADVERT_CMD SIR_HAL_OCB_START_TIMING_ADVERT_CMD

Ver ficheiro

@@ -4208,118 +4208,6 @@ end_tdls_peer_state:
}
#endif /* FEATURE_WLAN_TDLS */
#ifdef WLAN_FEATURE_MEMDUMP
/*
* wma_process_fw_mem_dump_req() - Function to request fw memory dump from
* firmware
* @wma: Pointer to WMA handle
* @mem_dump_req: Pointer for mem_dump_req
*
* This function sends memory dump request to firmware
*
* Return: QDF_STATUS_SUCCESS for success otherwise failure
*
*/
QDF_STATUS wma_process_fw_mem_dump_req(tp_wma_handle wma,
struct fw_dump_req *mem_dump_req)
{
int ret;
if (!mem_dump_req || !wma) {
WMA_LOGE(FL("input pointer is NULL"));
return QDF_STATUS_E_FAILURE;
}
ret = wmi_unified_process_fw_mem_dump_cmd(wma->wmi_handle,
(struct fw_dump_req_param *) mem_dump_req);
if (ret)
return QDF_STATUS_E_FAILURE;
return QDF_STATUS_SUCCESS;
}
/**
* wma_fw_mem_dump_rsp() - send fw mem dump response to SME
*
* @req_id - request id.
* @status - copy status from the firmware.
*
* This function is called by the memory dump response handler to
* indicate SME that firmware dump copy is complete
*
* Return: QDF_STATUS
*/
static QDF_STATUS wma_fw_mem_dump_rsp(uint32_t req_id, uint32_t status)
{
struct fw_dump_rsp *dump_rsp;
struct scheduler_msg sme_msg = {0};
QDF_STATUS qdf_status = QDF_STATUS_SUCCESS;
dump_rsp = qdf_mem_malloc(sizeof(*dump_rsp));
if (!dump_rsp) {
WMA_LOGE(FL("Memory allocation failed."));
qdf_status = QDF_STATUS_E_NOMEM;
return qdf_status;
}
WMA_LOGI(FL("FW memory dump copy complete status: %d for request: %d"),
status, req_id);
dump_rsp->request_id = req_id;
dump_rsp->dump_complete = status;
sme_msg.type = eWNI_SME_FW_DUMP_IND;
sme_msg.bodyptr = dump_rsp;
sme_msg.bodyval = 0;
qdf_status = scheduler_post_msg(QDF_MODULE_ID_SME, &sme_msg);
if (!QDF_IS_STATUS_SUCCESS(qdf_status)) {
WMA_LOGE(FL("Fail to post fw mem dump ind msg"));
qdf_mem_free(dump_rsp);
}
return qdf_status;
}
/**
* wma_fw_mem_dump_event_handler() - handles fw memory dump event
*
* @handle: pointer to wma handle.
* @cmd_param_info: pointer to TLV info received in the event.
* @len: length of data in @cmd_param_info
*
* This function is a handler for firmware memory dump event.
*
* Return: integer (0 for success and error code otherwise)
*/
int wma_fw_mem_dump_event_handler(void *handle, u_int8_t *cmd_param_info,
u_int32_t len)
{
WMI_UPDATE_FW_MEM_DUMP_EVENTID_param_tlvs *param_buf;
wmi_update_fw_mem_dump_fixed_param *event;
QDF_STATUS status;
param_buf =
(WMI_UPDATE_FW_MEM_DUMP_EVENTID_param_tlvs *) cmd_param_info;
if (!param_buf) {
WMA_LOGA("%s: Invalid stats event", __func__);
return -EINVAL;
}
event = param_buf->fixed_param;
status = wma_fw_mem_dump_rsp(event->request_id,
event->fw_mem_dump_complete);
if (QDF_STATUS_SUCCESS != status) {
WMA_LOGE("Error posting FW MEM DUMP RSP.");
return -EINVAL;
}
WMA_LOGI("FW MEM DUMP RSP posted successfully");
return 0;
}
#endif /* WLAN_FEATURE_MEMDUMP */
/*
* wma_process_set_ie_info() - Function to send IE info to firmware

Ver ficheiro

@@ -2832,15 +2832,6 @@ QDF_STATUS wma_open(struct wlan_objmgr_psoc *psoc,
#endif /* WLAN_FEATURE_LINK_LAYER_STATS */
/*
* Register event handler to receive firmware mem dump
* copy complete indication
*/
wmi_unified_register_event_handler(wma_handle->wmi_handle,
wmi_update_fw_mem_dump_event_id,
wma_fw_mem_dump_event_handler,
WMA_RX_SERIALIZER_CTX);
wmi_set_tgt_assert(wma_handle->wmi_handle,
cds_cfg->force_target_assert_enabled);
/* Firmware debug log */
@@ -4905,7 +4896,6 @@ static void wma_update_hdd_cfg(tp_wma_handle wma_handle)
- WMI_TLV_HEADROOM;
wma_setup_egap_support(&tgt_cfg, wma_handle);
tgt_cfg.tx_bfee_8ss_enabled = wma_handle->tx_bfee_8ss_enabled;
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);
}
@@ -5267,12 +5257,6 @@ 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_tbttoffset_update_event_id,
wma_tbttoffset_update_event_handler,
@@ -7847,11 +7831,6 @@ static QDF_STATUS wma_mc_process_msg(struct scheduler_msg *msg)
(struct rssi_monitor_req *)msg->bodyptr);
qdf_mem_free(msg->bodyptr);
break;
case WMA_FW_MEM_DUMP_REQ:
wma_process_fw_mem_dump_req(wma_handle,
(struct fw_dump_req *)msg->bodyptr);
qdf_mem_free(msg->bodyptr);
break;
case SIR_HAL_PDEV_SET_PCL_TO_FW:
wma_send_pdev_set_pcl_cmd(wma_handle,
(struct wmi_pcl_chan_weights *)msg->bodyptr);