/* We have 2 types of commands: wifi and non-wifi ones. */
static int iwm_nonwifi_cmd_init(struct iwm_priv *iwm, struct iwm_nonwifi_cmd *cmd, struct iwm_udma_nonwifi_cmd *udma_cmd)
/* We have 2 types of commands: wifi and non-wifi ones. */
static int iwm_nonwifi_cmd_init(struct iwm_priv *iwm, struct iwm_nonwifi_cmd *cmd, struct iwm_udma_nonwifi_cmd *udma_cmd)
{
	INIT_LIST_HEAD(&cmd->pending);
	spin_lock(&iwm->cmd_lock);
	cmd->resp_received = 0;
	cmd->seq_num = iwm->nonwifi_seq_num;
	udma_cmd->seq_num = cpu_to_le16(cmd->seq_num);
	iwm->nonwifi_seq_num++;
	iwm->nonwifi_seq_num %= UMAC_NONWIFI_SEQ_NUM_MAX;
	if (udma_cmd->resp)
		list_add_tail(&cmd->pending, &iwm->nonwifi_pending_cmd);
	spin_unlock(&iwm->cmd_lock);
	cmd->buf.start = cmd->buf.payload;
	cmd->buf.len = 0;
	memcpy(&cmd->udma_cmd, udma_cmd, sizeof(*udma_cmd));
	return cmd->seq_num;
}