diff options
author | Chin-ran Lo <crlo@marvell.com> | 2015-05-12 00:48:17 +0530 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2015-05-26 13:50:32 +0300 |
commit | c2c6c85fca47f4c5ac99d482b64d59dbd142117c (patch) | |
tree | 42ceec434000e9a77ffaa81705bfd1c513614a6d /drivers/net/wireless/mwifiex/sta_cmd.c | |
parent | 111c61054d86f3c8586146819aa905e14026fc4d (diff) | |
download | lwn-c2c6c85fca47f4c5ac99d482b64d59dbd142117c.tar.gz lwn-c2c6c85fca47f4c5ac99d482b64d59dbd142117c.zip |
mwifiex: add support for FW memory read/write operations
This patch adds support for FW memory read/write operations via debugfs.
This is useful during debugging FW issues.
Examples:
For reading FW memory location:
echo r 0x01ac > /sys/kernel/debug/mwifiex/mlan0/memrw
cat /sys/kernel/debug/mwifiex/mlan0/memrw
For writing FW memory location:
echo w 0x01ac 0x55aa > /sys/kernel/debug/mwifiex/mlan0/memrw
Signed-off-by: Chin-ran Lo <crlo@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/mwifiex/sta_cmd.c')
-rw-r--r-- | drivers/net/wireless/mwifiex/sta_cmd.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/net/wireless/mwifiex/sta_cmd.c b/drivers/net/wireless/mwifiex/sta_cmd.c index 49422f2a5380..a76d6a4340d0 100644 --- a/drivers/net/wireless/mwifiex/sta_cmd.c +++ b/drivers/net/wireless/mwifiex/sta_cmd.c @@ -1071,6 +1071,26 @@ static int mwifiex_cmd_ibss_coalescing_status(struct host_cmd_ds_command *cmd, return 0; } +/* This function prepares command buffer to get/set memory location value. + */ +static int +mwifiex_cmd_mem_access(struct host_cmd_ds_command *cmd, u16 cmd_action, + void *pdata_buf) +{ + struct mwifiex_ds_mem_rw *mem_rw = (void *)pdata_buf; + struct host_cmd_ds_mem_access *mem_access = (void *)&cmd->params.mem; + + cmd->command = cpu_to_le16(HostCmd_CMD_MEM_ACCESS); + cmd->size = cpu_to_le16(sizeof(struct host_cmd_ds_mem_access) + + S_DS_GEN); + + mem_access->action = cpu_to_le16(cmd_action); + mem_access->addr = cpu_to_le32(mem_rw->addr); + mem_access->value = cpu_to_le32(mem_rw->value); + + return 0; +} + /* * This function prepares command to set/get register value. * @@ -1885,6 +1905,9 @@ int mwifiex_sta_prepare_cmd(struct mwifiex_private *priv, uint16_t cmd_no, case HostCmd_CMD_802_11_SCAN_EXT: ret = mwifiex_cmd_802_11_scan_ext(priv, cmd_ptr, data_buf); break; + case HostCmd_CMD_MEM_ACCESS: + ret = mwifiex_cmd_mem_access(cmd_ptr, cmd_action, data_buf); + break; case HostCmd_CMD_MAC_REG_ACCESS: case HostCmd_CMD_BBP_REG_ACCESS: case HostCmd_CMD_RF_REG_ACCESS: |