diff options
| author | Johannes Berg <johannes.berg@intel.com> | 2013-02-26 05:32:26 -0500 |
|---|---|---|
| committer | Johannes Berg <johannes.berg@intel.com> | 2013-02-28 05:48:51 -0500 |
| commit | 1afbfb6041fb8f639e742620ad933c347e14ba2c (patch) | |
| tree | 028e6a718d1f338ba5f53d980294393e9251d4ed | |
| parent | 98891754ea9453de4db9111c91b20122ca330101 (diff) | |
iwlwifi: rename IWL_MAX_CMD_TFDS to IWL_MAX_CMD_TBS_PER_TFD
The IWL_MAX_CMD_TFDS name for this constant is wrong, the
constant really indicates how many TBs we can use in the
driver for a single command TFD, rename the constant and
also add a comment explaining it.
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
| -rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-devtrace.h | 2 | ||||
| -rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-trans.h | 12 | ||||
| -rw-r--r-- | drivers/net/wireless/iwlwifi/pcie/tx.c | 12 |
3 files changed, 15 insertions, 11 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-devtrace.h b/drivers/net/wireless/iwlwifi/iwl-devtrace.h index 10f01793d7a6..81aa91fab5aa 100644 --- a/drivers/net/wireless/iwlwifi/iwl-devtrace.h +++ b/drivers/net/wireless/iwlwifi/iwl-devtrace.h | |||
| @@ -363,7 +363,7 @@ TRACE_EVENT(iwlwifi_dev_hcmd, | |||
| 363 | __entry->flags = cmd->flags; | 363 | __entry->flags = cmd->flags; |
| 364 | memcpy(__get_dynamic_array(hcmd), hdr, sizeof(*hdr)); | 364 | memcpy(__get_dynamic_array(hcmd), hdr, sizeof(*hdr)); |
| 365 | 365 | ||
| 366 | for (i = 0; i < IWL_MAX_CMD_TFDS; i++) { | 366 | for (i = 0; i < IWL_MAX_CMD_TBS_PER_TFD; i++) { |
| 367 | if (!cmd->len[i]) | 367 | if (!cmd->len[i]) |
| 368 | continue; | 368 | continue; |
| 369 | memcpy((u8 *)__get_dynamic_array(hcmd) + offset, | 369 | memcpy((u8 *)__get_dynamic_array(hcmd) + offset, |
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans.h b/drivers/net/wireless/iwlwifi/iwl-trans.h index 8c7bec6b9a0b..058947f213b2 100644 --- a/drivers/net/wireless/iwlwifi/iwl-trans.h +++ b/drivers/net/wireless/iwlwifi/iwl-trans.h | |||
| @@ -217,7 +217,11 @@ struct iwl_device_cmd { | |||
| 217 | 217 | ||
| 218 | #define TFD_MAX_PAYLOAD_SIZE (sizeof(struct iwl_device_cmd)) | 218 | #define TFD_MAX_PAYLOAD_SIZE (sizeof(struct iwl_device_cmd)) |
| 219 | 219 | ||
| 220 | #define IWL_MAX_CMD_TFDS 2 | 220 | /* |
| 221 | * number of transfer buffers (fragments) per transmit frame descriptor; | ||
| 222 | * this is just the driver's idea, the hardware supports 20 | ||
| 223 | */ | ||
| 224 | #define IWL_MAX_CMD_TBS_PER_TFD 2 | ||
| 221 | 225 | ||
| 222 | /** | 226 | /** |
| 223 | * struct iwl_hcmd_dataflag - flag for each one of the chunks of the command | 227 | * struct iwl_hcmd_dataflag - flag for each one of the chunks of the command |
| @@ -254,15 +258,15 @@ enum iwl_hcmd_dataflag { | |||
| 254 | * @id: id of the host command | 258 | * @id: id of the host command |
| 255 | */ | 259 | */ |
| 256 | struct iwl_host_cmd { | 260 | struct iwl_host_cmd { |
| 257 | const void *data[IWL_MAX_CMD_TFDS]; | 261 | const void *data[IWL_MAX_CMD_TBS_PER_TFD]; |
| 258 | struct iwl_rx_packet *resp_pkt; | 262 | struct iwl_rx_packet *resp_pkt; |
| 259 | unsigned long _rx_page_addr; | 263 | unsigned long _rx_page_addr; |
| 260 | u32 _rx_page_order; | 264 | u32 _rx_page_order; |
| 261 | int handler_status; | 265 | int handler_status; |
| 262 | 266 | ||
| 263 | u32 flags; | 267 | u32 flags; |
| 264 | u16 len[IWL_MAX_CMD_TFDS]; | 268 | u16 len[IWL_MAX_CMD_TBS_PER_TFD]; |
| 265 | u8 dataflags[IWL_MAX_CMD_TFDS]; | 269 | u8 dataflags[IWL_MAX_CMD_TBS_PER_TFD]; |
| 266 | u8 id; | 270 | u8 id; |
| 267 | }; | 271 | }; |
| 268 | 272 | ||
diff --git a/drivers/net/wireless/iwlwifi/pcie/tx.c b/drivers/net/wireless/iwlwifi/pcie/tx.c index 975492f0b8c8..ff80a7e55f00 100644 --- a/drivers/net/wireless/iwlwifi/pcie/tx.c +++ b/drivers/net/wireless/iwlwifi/pcie/tx.c | |||
| @@ -1146,16 +1146,16 @@ static int iwl_pcie_enqueue_hcmd(struct iwl_trans *trans, | |||
| 1146 | bool had_nocopy = false; | 1146 | bool had_nocopy = false; |
| 1147 | int i; | 1147 | int i; |
| 1148 | u32 cmd_pos; | 1148 | u32 cmd_pos; |
| 1149 | const u8 *cmddata[IWL_MAX_CMD_TFDS]; | 1149 | const u8 *cmddata[IWL_MAX_CMD_TBS_PER_TFD]; |
| 1150 | u16 cmdlen[IWL_MAX_CMD_TFDS]; | 1150 | u16 cmdlen[IWL_MAX_CMD_TBS_PER_TFD]; |
| 1151 | 1151 | ||
| 1152 | copy_size = sizeof(out_cmd->hdr); | 1152 | copy_size = sizeof(out_cmd->hdr); |
| 1153 | cmd_size = sizeof(out_cmd->hdr); | 1153 | cmd_size = sizeof(out_cmd->hdr); |
| 1154 | 1154 | ||
| 1155 | /* need one for the header if the first is NOCOPY */ | 1155 | /* need one for the header if the first is NOCOPY */ |
| 1156 | BUILD_BUG_ON(IWL_MAX_CMD_TFDS > IWL_NUM_OF_TBS - 1); | 1156 | BUILD_BUG_ON(IWL_MAX_CMD_TBS_PER_TFD > IWL_NUM_OF_TBS - 1); |
| 1157 | 1157 | ||
| 1158 | for (i = 0; i < IWL_MAX_CMD_TFDS; i++) { | 1158 | for (i = 0; i < IWL_MAX_CMD_TBS_PER_TFD; i++) { |
| 1159 | cmddata[i] = cmd->data[i]; | 1159 | cmddata[i] = cmd->data[i]; |
| 1160 | cmdlen[i] = cmd->len[i]; | 1160 | cmdlen[i] = cmd->len[i]; |
| 1161 | 1161 | ||
| @@ -1250,7 +1250,7 @@ static int iwl_pcie_enqueue_hcmd(struct iwl_trans *trans, | |||
| 1250 | /* and copy the data that needs to be copied */ | 1250 | /* and copy the data that needs to be copied */ |
| 1251 | cmd_pos = offsetof(struct iwl_device_cmd, payload); | 1251 | cmd_pos = offsetof(struct iwl_device_cmd, payload); |
| 1252 | copy_size = sizeof(out_cmd->hdr); | 1252 | copy_size = sizeof(out_cmd->hdr); |
| 1253 | for (i = 0; i < IWL_MAX_CMD_TFDS; i++) { | 1253 | for (i = 0; i < IWL_MAX_CMD_TBS_PER_TFD; i++) { |
| 1254 | int copy = 0; | 1254 | int copy = 0; |
| 1255 | 1255 | ||
| 1256 | if (!cmd->len) | 1256 | if (!cmd->len) |
| @@ -1319,7 +1319,7 @@ static int iwl_pcie_enqueue_hcmd(struct iwl_trans *trans, | |||
| 1319 | iwl_pcie_txq_build_tfd(trans, txq, phys_addr, copy_size, 1); | 1319 | iwl_pcie_txq_build_tfd(trans, txq, phys_addr, copy_size, 1); |
| 1320 | 1320 | ||
| 1321 | /* map the remaining (adjusted) nocopy/dup fragments */ | 1321 | /* map the remaining (adjusted) nocopy/dup fragments */ |
| 1322 | for (i = 0; i < IWL_MAX_CMD_TFDS; i++) { | 1322 | for (i = 0; i < IWL_MAX_CMD_TBS_PER_TFD; i++) { |
| 1323 | const void *data = cmddata[i]; | 1323 | const void *data = cmddata[i]; |
| 1324 | 1324 | ||
| 1325 | if (!cmdlen[i]) | 1325 | if (!cmdlen[i]) |
