diff options
author | Xinming Hu <huxm@marvell.com> | 2017-12-12 02:38:13 -0500 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2018-01-08 12:36:56 -0500 |
commit | 18d605013357563de79afeee9e9d2000161eb6a0 (patch) | |
tree | c00a3e7a0fde718d8aba67e520d54019cddf565d | |
parent | f5ecd02a8b20f900701d6809a3ea5f12e5c87de8 (diff) |
mwifiex: debugfs: trigger device dump for usb interface
This patch extend device_dump debugfs function to make it
works for usb interface.
For command timeouts, USB firmware will automatically emit
firmware dump events, so we don't implement device_dump().
For user-initiated dumps, we trigger it by issue firmware
dump event command to firmware, as there is no command
response, do not start 10s timer.
Signed-off-by: Xinming Hu <huxm@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
-rw-r--r-- | drivers/net/wireless/marvell/mwifiex/cmdevt.c | 11 | ||||
-rw-r--r-- | drivers/net/wireless/marvell/mwifiex/debugfs.c | 13 | ||||
-rw-r--r-- | drivers/net/wireless/marvell/mwifiex/fw.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/marvell/mwifiex/sta_cmd.c | 4 |
4 files changed, 21 insertions, 8 deletions
diff --git a/drivers/net/wireless/marvell/mwifiex/cmdevt.c b/drivers/net/wireless/marvell/mwifiex/cmdevt.c index dcc529e9c0ef..874660052055 100644 --- a/drivers/net/wireless/marvell/mwifiex/cmdevt.c +++ b/drivers/net/wireless/marvell/mwifiex/cmdevt.c | |||
@@ -290,13 +290,16 @@ static int mwifiex_dnld_cmd_to_fw(struct mwifiex_private *priv, | |||
290 | adapter->dbg.last_cmd_act[adapter->dbg.last_cmd_index] = | 290 | adapter->dbg.last_cmd_act[adapter->dbg.last_cmd_index] = |
291 | get_unaligned_le16((u8 *)host_cmd + S_DS_GEN); | 291 | get_unaligned_le16((u8 *)host_cmd + S_DS_GEN); |
292 | 292 | ||
293 | /* Setup the timer after transmit command, except that specific | ||
294 | * command might not have command response. | ||
295 | */ | ||
296 | if (cmd_code != HostCmd_CMD_FW_DUMP_EVENT) | ||
297 | mod_timer(&adapter->cmd_timer, | ||
298 | jiffies + msecs_to_jiffies(MWIFIEX_TIMER_10S)); | ||
299 | |||
293 | /* Clear BSS_NO_BITS from HostCmd */ | 300 | /* Clear BSS_NO_BITS from HostCmd */ |
294 | cmd_code &= HostCmd_CMD_ID_MASK; | 301 | cmd_code &= HostCmd_CMD_ID_MASK; |
295 | 302 | ||
296 | /* Setup the timer after transmit command */ | ||
297 | mod_timer(&adapter->cmd_timer, | ||
298 | jiffies + msecs_to_jiffies(MWIFIEX_TIMER_10S)); | ||
299 | |||
300 | return 0; | 303 | return 0; |
301 | } | 304 | } |
302 | 305 | ||
diff --git a/drivers/net/wireless/marvell/mwifiex/debugfs.c b/drivers/net/wireless/marvell/mwifiex/debugfs.c index 6f4239be609d..db2872daae97 100644 --- a/drivers/net/wireless/marvell/mwifiex/debugfs.c +++ b/drivers/net/wireless/marvell/mwifiex/debugfs.c | |||
@@ -168,10 +168,15 @@ mwifiex_device_dump_read(struct file *file, char __user *ubuf, | |||
168 | { | 168 | { |
169 | struct mwifiex_private *priv = file->private_data; | 169 | struct mwifiex_private *priv = file->private_data; |
170 | 170 | ||
171 | if (!priv->adapter->if_ops.device_dump) | 171 | /* For command timeouts, USB firmware will automatically emit |
172 | return -EIO; | 172 | * firmware dump events, so we don't implement device_dump(). |
173 | 173 | * For user-initiated dumps, we trigger it ourselves. | |
174 | priv->adapter->if_ops.device_dump(priv->adapter); | 174 | */ |
175 | if (priv->adapter->iface_type == MWIFIEX_USB) | ||
176 | mwifiex_send_cmd(priv, HostCmd_CMD_FW_DUMP_EVENT, | ||
177 | HostCmd_ACT_GEN_SET, 0, NULL, true); | ||
178 | else | ||
179 | priv->adapter->if_ops.device_dump(priv->adapter); | ||
175 | 180 | ||
176 | return 0; | 181 | return 0; |
177 | } | 182 | } |
diff --git a/drivers/net/wireless/marvell/mwifiex/fw.h b/drivers/net/wireless/marvell/mwifiex/fw.h index 4d5e686fd5bd..9c2cdef54074 100644 --- a/drivers/net/wireless/marvell/mwifiex/fw.h +++ b/drivers/net/wireless/marvell/mwifiex/fw.h | |||
@@ -409,6 +409,7 @@ enum MWIFIEX_802_11_PRIVACY_FILTER { | |||
409 | #define HostCmd_CMD_TDLS_CONFIG 0x0100 | 409 | #define HostCmd_CMD_TDLS_CONFIG 0x0100 |
410 | #define HostCmd_CMD_MC_POLICY 0x0121 | 410 | #define HostCmd_CMD_MC_POLICY 0x0121 |
411 | #define HostCmd_CMD_TDLS_OPER 0x0122 | 411 | #define HostCmd_CMD_TDLS_OPER 0x0122 |
412 | #define HostCmd_CMD_FW_DUMP_EVENT 0x0125 | ||
412 | #define HostCmd_CMD_SDIO_SP_RX_AGGR_CFG 0x0223 | 413 | #define HostCmd_CMD_SDIO_SP_RX_AGGR_CFG 0x0223 |
413 | #define HostCmd_CMD_CHAN_REGION_CFG 0x0242 | 414 | #define HostCmd_CMD_CHAN_REGION_CFG 0x0242 |
414 | #define HostCmd_CMD_PACKET_AGGR_CTRL 0x0251 | 415 | #define HostCmd_CMD_PACKET_AGGR_CTRL 0x0251 |
diff --git a/drivers/net/wireless/marvell/mwifiex/sta_cmd.c b/drivers/net/wireless/marvell/mwifiex/sta_cmd.c index fb090144a6d8..211e47d8b318 100644 --- a/drivers/net/wireless/marvell/mwifiex/sta_cmd.c +++ b/drivers/net/wireless/marvell/mwifiex/sta_cmd.c | |||
@@ -2206,6 +2206,10 @@ int mwifiex_sta_prepare_cmd(struct mwifiex_private *priv, uint16_t cmd_no, | |||
2206 | case HostCmd_CMD_CHAN_REGION_CFG: | 2206 | case HostCmd_CMD_CHAN_REGION_CFG: |
2207 | ret = mwifiex_cmd_chan_region_cfg(priv, cmd_ptr, cmd_action); | 2207 | ret = mwifiex_cmd_chan_region_cfg(priv, cmd_ptr, cmd_action); |
2208 | break; | 2208 | break; |
2209 | case HostCmd_CMD_FW_DUMP_EVENT: | ||
2210 | cmd_ptr->command = cpu_to_le16(cmd_no); | ||
2211 | cmd_ptr->size = cpu_to_le16(S_DS_GEN); | ||
2212 | break; | ||
2209 | default: | 2213 | default: |
2210 | mwifiex_dbg(priv->adapter, ERROR, | 2214 | mwifiex_dbg(priv->adapter, ERROR, |
2211 | "PREP_CMD: unknown cmd- %#x\n", cmd_no); | 2215 | "PREP_CMD: unknown cmd- %#x\n", cmd_no); |