Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 18d60501 authored by Xinming Hu's avatar Xinming Hu Committed by Kalle Valo
Browse files

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: default avatarXinming Hu <huxm@marvell.com>
Signed-off-by: default avatarCathy Luo <cluo@marvell.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent f5ecd02a
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -290,13 +290,16 @@ static int mwifiex_dnld_cmd_to_fw(struct mwifiex_private *priv,
	adapter->dbg.last_cmd_act[adapter->dbg.last_cmd_index] =
			get_unaligned_le16((u8 *)host_cmd + S_DS_GEN);

	/* Clear BSS_NO_BITS from HostCmd */
	cmd_code &= HostCmd_CMD_ID_MASK;

	/* Setup the timer after transmit command */
	/* Setup the timer after transmit command, except that specific
	 * command might not have command response.
	 */
	if (cmd_code != HostCmd_CMD_FW_DUMP_EVENT)
		mod_timer(&adapter->cmd_timer,
			  jiffies + msecs_to_jiffies(MWIFIEX_TIMER_10S));

	/* Clear BSS_NO_BITS from HostCmd */
	cmd_code &= HostCmd_CMD_ID_MASK;

	return 0;
}

+9 −4
Original line number Diff line number Diff line
@@ -168,9 +168,14 @@ mwifiex_device_dump_read(struct file *file, char __user *ubuf,
{
	struct mwifiex_private *priv = file->private_data;

	if (!priv->adapter->if_ops.device_dump)
		return -EIO;

	/* 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 ourselves.
	 */
	if (priv->adapter->iface_type == MWIFIEX_USB)
		mwifiex_send_cmd(priv, HostCmd_CMD_FW_DUMP_EVENT,
				 HostCmd_ACT_GEN_SET, 0, NULL, true);
	else
		priv->adapter->if_ops.device_dump(priv->adapter);

	return 0;
+1 −0
Original line number Diff line number Diff line
@@ -409,6 +409,7 @@ enum MWIFIEX_802_11_PRIVACY_FILTER {
#define HostCmd_CMD_TDLS_CONFIG                       0x0100
#define HostCmd_CMD_MC_POLICY                         0x0121
#define HostCmd_CMD_TDLS_OPER                         0x0122
#define HostCmd_CMD_FW_DUMP_EVENT		      0x0125
#define HostCmd_CMD_SDIO_SP_RX_AGGR_CFG               0x0223
#define HostCmd_CMD_CHAN_REGION_CFG		      0x0242
#define HostCmd_CMD_PACKET_AGGR_CTRL		      0x0251
+4 −0
Original line number Diff line number Diff line
@@ -2206,6 +2206,10 @@ int mwifiex_sta_prepare_cmd(struct mwifiex_private *priv, uint16_t cmd_no,
	case HostCmd_CMD_CHAN_REGION_CFG:
		ret = mwifiex_cmd_chan_region_cfg(priv, cmd_ptr, cmd_action);
		break;
	case HostCmd_CMD_FW_DUMP_EVENT:
		cmd_ptr->command = cpu_to_le16(cmd_no);
		cmd_ptr->size = cpu_to_le16(S_DS_GEN);
		break;
	default:
		mwifiex_dbg(priv->adapter, ERROR,
			    "PREP_CMD: unknown cmd- %#x\n", cmd_no);