MA-19405 Build nxp mxmwifi driver with debug APIs disabled for GKI

Add build config item to control if debug APIs in mxmwifi driver
is enabled or not.
Default disable Debug APIs as GKI build disallow drivers read
and write to the filesystem directly.

Change-Id: I9f111e5a435ea95409a00bf344d62b3450e48895
Signed-off-by: yang.tian <yang.tian@nxp.com>
This commit is contained in:
yang.tian 2021-09-02 12:35:58 +08:00
parent e82d96cb65
commit 42c915813e
7 changed files with 62 additions and 2 deletions

View file

@ -61,6 +61,9 @@ CONFIG_PCIE9098=y
# 2: All PRINTM()
CONFIG_DEBUG=1
# Enable Debug
CONFIG_DEBUG_SUPPORT=n
# Enable STA mode support
CONFIG_STA_SUPPORT=y
@ -151,6 +154,10 @@ ifeq ($(CONFIG_DEBUG),2)
DBG= -dbg
endif
ifeq ($(CONFIG_DEBUG_SUPPORT),y)
ccflags-y += -DDEBUG_SUPPORT
endif
ifeq ($(CONFIG_64BIT), y)
ccflags-y += -DMLAN_64BIT
endif

View file

@ -655,6 +655,7 @@ done:
return ret;
}
#ifdef DEBUG_SUPPORT
/**
* @brief vendor command to get driver memory dump
*
@ -714,6 +715,7 @@ done:
LEAVE();
return ret;
}
#endif
/**
* @brief vendor command to get supported feature set
@ -4100,6 +4102,7 @@ static const struct wiphy_vendor_command vendor_commands[] = {
.policy = VENDOR_CMD_RAW_DATA,
#endif
},
#ifdef DEBUG_SUPPORT
{
.info = {
.vendor_id = MRVL_VENDOR_ID,
@ -4113,6 +4116,7 @@ static const struct wiphy_vendor_command vendor_commands[] = {
.policy = VENDOR_CMD_RAW_DATA,
#endif
},
#endif
{
.info = {
.vendor_id = MRVL_VENDOR_ID,

View file

@ -7380,6 +7380,7 @@ t_void woal_send_disconnect_to_system(moal_private *priv,
}
#endif /* STA_SUPPORT */
#ifdef DEBUG_SUPPORT
#if defined(PCIE)
/**
* @brief This function stores the SSU dumps in a file
@ -7447,10 +7448,13 @@ save_ssudump:
return;
}
#endif /* SSU_SUPPORT */
#endif
#define OFFSET_SEQNUM 4
#define OFFSET_TYPE 8
#define DUMP_TYPE_ENDE 2
#ifdef DEBUG_SUPPORT
t_void woal_store_firmware_dump(moal_handle *phandle, mlan_event *pmevent)
{
struct file *pfile_fwdump = NULL;
@ -7541,6 +7545,7 @@ t_void woal_store_firmware_dump(moal_handle *phandle, mlan_event *pmevent)
LEAVE();
return;
}
#endif
#define DRV_INFO_SIZE 0x60000
#define DRV_INFO_PER_INTF 0x11000
@ -7921,6 +7926,8 @@ static int woal_dump_mlan_drv_info(moal_private *priv, t_u8 *buf)
#define HostCmd_CMD_CFG_DATA 0x008f
#define DEF_FW_PATH "/lib/firmware/"
#define DEF_HOSTCMD_PATH "/lib/firmware/nxp/hostcmd.conf"
#ifdef DEBUG_SUPPORT
/**
* @brief This function save the hostcmd response to file
*
@ -7993,6 +8000,7 @@ t_void woal_save_host_cmdresp(moal_handle *phandle, mlan_cmdresp_event *pevent)
filp_close(pfile, NULL);
return;
}
#endif
/**
* @brief This function dump moal hex to file
@ -8101,6 +8109,7 @@ static int woal_dump_mlan_hex(moal_private *priv, t_u8 *buf)
return ptr - (char *)buf;
}
#ifdef DEBUG_SUPPORT
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 1, 0)
/**
* @brief This function create dump directory
@ -8172,7 +8181,9 @@ done:
LEAVE();
}
#endif
#endif
#ifdef DEBUG_SUPPORT
/**
* @brief This function save dump buf to file
*
@ -8239,7 +8250,9 @@ done:
LEAVE();
return ret;
}
#endif
#ifdef DEBUG_SUPPORT
/**
* @brief This function dump drv info to file
*
@ -8328,6 +8341,7 @@ done:
moal_vfree(phandle, drv_buf);
LEAVE();
}
#endif
/**
* @brief This function displays extra MOAL debug information

View file

@ -2931,12 +2931,14 @@ int woal_enable_hs(moal_private *priv);
/** Get wakeup reason */
mlan_status woal_get_wakeup_reason(moal_private *priv,
mlan_ds_hs_wakeup_reason *wakeup_reason);
#ifdef DEBUG_SUPPORT
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 1, 0)
void woal_create_dump_dir(moal_handle *phandle, char *dir_buf, int buf_size);
#endif
mlan_status woal_save_dump_info_to_file(char *dir_name, char *file_name,
t_u8 *buf, t_u32 buf_len);
void woal_dump_drv_info(moal_handle *phandle, t_u8 *dir_name);
#endif
#define FW_DUMP_TYPE_ENDED 0x002
#define FW_DUMP_TYPE_MEM_ITCM 0x004
@ -2948,19 +2950,23 @@ void woal_dump_drv_info(moal_handle *phandle, t_u8 *dir_name);
#define FW_DUMP_TYPE_REG_APU 0x00F
#define FW_DUMP_TYPE_REG_ICU 0x014
#ifdef SDIO_MMC
#ifdef DEBUG_SUPPORT
void woal_dump_firmware_info(moal_handle *phandle);
void woal_dump_firmware_info_v2(moal_handle *phandle);
void woal_dump_firmware_info_v3(moal_handle *phandle);
#endif
#endif /* SDIO_MMC */
#ifdef DEBUG_SUPPORT
/* Store the FW dumps received from events in a file */
void woal_store_firmware_dump(moal_handle *phandle, pmlan_event pmevent);
#if defined(PCIE)
void woal_store_ssu_dump(moal_handle *phandle, pmlan_event pmevent);
#endif /* SSU_SUPPORT */
/** save hostcmd response to file */
t_void woal_save_host_cmdresp(moal_handle *phandle, mlan_cmdresp_event *pevent);
#endif
int woal_pre_warmreset(moal_private *priv);
int woal_warmreset(moal_private *priv);

View file

@ -1886,6 +1886,7 @@ static rdwr_status woal_pcie_rdwr_firmware(moal_handle *phandle, t_u8 doneflag)
}
#endif
#ifdef DEBUG_SUPPORT
#ifdef PCIE8897
/**
* @brief This function dump firmware memory to file
@ -2053,7 +2054,9 @@ done:
return;
}
#endif
#endif
#ifdef DEBUG_SUPPORT
#if defined(PCIE8997) || defined(PCIE9098) || defined(PCIE9097)
/**
* @brief This function dump firmware memory to file
@ -2239,6 +2242,7 @@ done:
return;
}
#endif
#endif
/**
* @brief This function check if this is second mac
@ -2257,6 +2261,7 @@ static t_u8 woal_pcie_is_second_mac(moal_handle *handle)
return MFALSE;
}
#ifdef DEBUG_SUPPORT
static void woal_pcie_dump_fw_info(moal_handle *phandle)
{
mlan_pm_wakeup_card(phandle->pmlan_adapter, MTRUE);
@ -2281,6 +2286,7 @@ static void woal_pcie_dump_fw_info(moal_handle *phandle)
mlan_pm_wakeup_card(phandle->pmlan_adapter, MFALSE);
queue_work(phandle->workqueue, &phandle->main_work);
}
#endif
static mlan_status woal_pcie_get_fw_name(moal_handle *handle)
{
@ -2468,7 +2474,9 @@ static moal_if_ops pcie_ops = {
.read_data_sync = woal_pcie_read_data_sync,
.write_data_sync = woal_pcie_write_data_sync,
.get_fw_name = woal_pcie_get_fw_name,
#ifdef DEBUG_SUPPORT
.dump_fw_info = woal_pcie_dump_fw_info,
#endif
.reg_dbg = woal_pcie_reg_dbg,
.dump_reg_info = woal_pcie_dump_reg_info,
.is_second_mac = woal_pcie_is_second_mac,

View file

@ -173,7 +173,9 @@ static struct sdio_driver REFDATA wlan_sdio = {
/********************************************************
Local Functions
********************************************************/
#ifdef DEBUG_SUPPORT
static void woal_sdiommc_dump_fw_info(moal_handle *phandle);
#endif
#if 0
/** @brief This function dump the sdio register
*
@ -1659,6 +1661,7 @@ static rdwr_status woal_cmd52_rdwr_firmware(moal_handle *phandle, t_u8 doneflag)
#define SQRAM_SIZE 0x33500
#define DTCM_SIZE 0x14000
#ifdef DEBUG_SUPPORT
/**
* @brief This function dump firmware memory to file
*
@ -1869,7 +1872,9 @@ done:
return;
}
#endif
#endif
#ifdef DEBUG_SUPPORT
/**
* @brief This function dump firmware memory to file
*
@ -2045,7 +2050,9 @@ done:
PRINTM(MMSG, "==== DEBUG MODE END ====\n");
return;
}
#endif
#ifdef DEBUG_SUPPORT
/**
* @brief This function dump firmware memory to file
*
@ -2233,6 +2240,7 @@ done:
PRINTM(MMSG, "==== DEBUG MODE END ====\n");
return;
}
#endif
/**
* @brief This function reads and displays SDIO registers for debugging
@ -2307,6 +2315,7 @@ static void woal_sdiommc_reg_dbg(moal_handle *phandle)
mlan_pm_wakeup_card(phandle->pmlan_adapter, MFALSE);
}
#ifdef DEBUG_SUPPORT
/**
* @brief This function dump firmware memory to file
*
@ -2343,6 +2352,7 @@ static void woal_sdiommc_dump_fw_info(moal_handle *phandle)
return;
}
/**
* @brief This function save sdio reg info
*
@ -2439,6 +2449,7 @@ static int woal_sdiommc_dump_reg_info(moal_handle *phandle, t_u8 *drv_buf)
LEAVE();
return drv_ptr - (char *)drv_buf;
}
#endif
/**
* @brief This function reset sdio through sdio bus driver
@ -2487,8 +2498,10 @@ static moal_if_ops sdiommc_ops = {
.read_data_sync = woal_sdiommc_read_data_sync,
.write_data_sync = woal_sdiommc_write_data_sync,
.get_fw_name = woal_sdiommc_get_fw_name,
#ifdef DEBUG_SUPPORT
.dump_fw_info = woal_sdiommc_dump_fw_info,
.dump_reg_info = woal_sdiommc_dump_reg_info,
#endif
.reg_dbg = woal_sdiommc_reg_dbg,
.is_second_mac = woal_sdiommc_is_second_mac,
};

View file

@ -1726,6 +1726,7 @@ mlan_status moal_recv_event(t_void *pmoal, pmlan_event pmevent)
t_u8 radar_detected;
ENTER();
#ifdef DEBUG_SUPPORT
if (pmevent->event_id == MLAN_EVENT_ID_FW_DUMP_INFO) {
woal_store_firmware_dump(pmoal, pmevent);
handle->driver_status = MTRUE;
@ -1734,20 +1735,27 @@ mlan_status moal_recv_event(t_void *pmoal, pmlan_event pmevent)
ref_handle->driver_status = MTRUE;
goto done;
}
#endif
if ((pmevent->event_id != MLAN_EVENT_ID_DRV_DEFER_RX_WORK) &&
(pmevent->event_id != MLAN_EVENT_ID_DRV_DEFER_HANDLING) &&
(pmevent->event_id != MLAN_EVENT_ID_DRV_MGMT_FRAME))
PRINTM(MEVENT, "event id:0x%x\n", pmevent->event_id);
#ifdef DEBUG_SUPPORT
#if defined(PCIE)
if (pmevent->event_id == MLAN_EVENT_ID_SSU_DUMP_FILE) {
woal_store_ssu_dump(pmoal, pmevent);
goto done;
}
#endif /* SSU_SUPPORT */
#endif
#ifdef DEBUG_SUPPORT
if (pmevent->event_id == MLAN_EVENT_ID_STORE_HOST_CMD_RESP) {
woal_save_host_cmdresp(handle, (mlan_cmdresp_event *)pmevent);
goto done;
}
#endif
priv = woal_bss_index_to_priv(pmoal, pmevent->bss_index);
if (priv == NULL) {
PRINTM(MERROR, "%s: priv is null\n", __func__);