summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/iwlwifi/pcie/internal.h
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2013-02-25 19:01:34 +0400
committerJohannes Berg <johannes.berg@intel.com>2013-02-27 01:09:12 +0400
commit8a964f44e01ad3bbc208c3e80d931ba91b9ea786 (patch)
treedfcd5d77e86358daf79df6810933d1e9ddc86aba /drivers/net/wireless/iwlwifi/pcie/internal.h
parentdc4a787c8f52f9d6e46156953f8014a3353bcbc7 (diff)
downloadlinux-8a964f44e01ad3bbc208c3e80d931ba91b9ea786.tar.xz
iwlwifi: always copy first 16 bytes of commands
The FH hardware will always write back to the scratch field in commands, even host commands not just TX commands, which can overwrite parts of the command. This is problematic if the command is re-used (with IWL_HCMD_DFL_NOCOPY) and can cause calibration issues. Address this problem by always putting at least the first 16 bytes into the buffer we also use for the command header and therefore make the DMA engine write back into this. For commands that are smaller than 16 bytes also always map enough memory for the DMA engine to write back to. Cc: stable@vger.kernel.org Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/pcie/internal.h')
-rw-r--r--drivers/net/wireless/iwlwifi/pcie/internal.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/pcie/internal.h b/drivers/net/wireless/iwlwifi/pcie/internal.h
index aa2a39a637dd..3d62e8055352 100644
--- a/drivers/net/wireless/iwlwifi/pcie/internal.h
+++ b/drivers/net/wireless/iwlwifi/pcie/internal.h
@@ -182,6 +182,15 @@ struct iwl_queue {
#define TFD_TX_CMD_SLOTS 256
#define TFD_CMD_SLOTS 32
+/*
+ * The FH will write back to the first TB only, so we need
+ * to copy some data into the buffer regardless of whether
+ * it should be mapped or not. This indicates how much to
+ * copy, even for HCMDs it must be big enough to fit the
+ * DRAM scratch from the TX cmd, at least 16 bytes.
+ */
+#define IWL_HCMD_MIN_COPY_SIZE 16
+
struct iwl_pcie_txq_entry {
struct iwl_device_cmd *cmd;
struct iwl_device_cmd *copy_cmd;