diff options
Diffstat (limited to 'drivers/net/wireless/intel/iwlegacy/common.c')
| -rw-r--r-- | drivers/net/wireless/intel/iwlegacy/common.c | 15 | 
1 files changed, 14 insertions, 1 deletions
diff --git a/drivers/net/wireless/intel/iwlegacy/common.c b/drivers/net/wireless/intel/iwlegacy/common.c index 9d33a66a49b5..958dd4f9bc69 100644 --- a/drivers/net/wireless/intel/iwlegacy/common.c +++ b/drivers/net/wireless/intel/iwlegacy/common.c @@ -3122,6 +3122,7 @@ il_enqueue_hcmd(struct il_priv *il, struct il_host_cmd *cmd)  	struct il_cmd_meta *out_meta;  	dma_addr_t phys_addr;  	unsigned long flags; +	u8 *out_payload;  	u32 idx;  	u16 fix_size; @@ -3157,6 +3158,16 @@ il_enqueue_hcmd(struct il_priv *il, struct il_host_cmd *cmd)  	out_cmd = txq->cmd[idx];  	out_meta = &txq->meta[idx]; +	/* The payload is in the same place in regular and huge +	 * command buffers, but we need to let the compiler know when +	 * we're using a larger payload buffer to avoid "field- +	 * spanning write" warnings at run-time for huge commands. +	 */ +	if (cmd->flags & CMD_SIZE_HUGE) +		out_payload = ((struct il_device_cmd_huge *)out_cmd)->cmd.payload; +	else +		out_payload = out_cmd->cmd.payload; +  	if (WARN_ON(out_meta->flags & CMD_MAPPED)) {  		spin_unlock_irqrestore(&il->hcmd_lock, flags);  		return -ENOSPC; @@ -3170,7 +3181,7 @@ il_enqueue_hcmd(struct il_priv *il, struct il_host_cmd *cmd)  		out_meta->callback = cmd->callback;  	out_cmd->hdr.cmd = cmd->id; -	memcpy(&out_cmd->cmd.payload, cmd->data, cmd->len); +	memcpy(out_payload, cmd->data, cmd->len);  	/* At this point, the out_cmd now has all of the incoming cmd  	 * information */ @@ -4962,6 +4973,8 @@ il_pci_resume(struct device *device)  	 */  	pci_write_config_byte(pdev, PCI_CFG_RETRY_TIMEOUT, 0x00); +	_il_wr(il, CSR_INT, 0xffffffff); +	_il_wr(il, CSR_FH_INT_STATUS, 0xffffffff);  	il_enable_interrupts(il);  	if (!(_il_rd(il, CSR_GP_CNTRL) & CSR_GP_CNTRL_REG_FLAG_HW_RF_KILL_SW))  | 
