diff options
author | Abhijeet Kolekar <abhijeet.kolekar@intel.com> | 2010-02-19 14:49:49 -0500 |
---|---|---|
committer | Reinette Chatre <reinette.chatre@intel.com> | 2010-02-23 17:59:12 -0500 |
commit | 89612124d6d62230043ebd827a2b54ea5ea5280c (patch) | |
tree | 6bc255e176748a399948ef8c7549632409931ace /drivers/net/wireless/iwlwifi/iwl-tx.c | |
parent | a120e912eb51e347f36c71b60a1d13af74d30e83 (diff) |
iwlwifi: increase command buffer size
Increase the buffer size for commands with "huge"
bit set. This has been recently observed for 6050 cards where
for even with huge bit set few commands were not properly allocated
memory with the command overwriting the buffer allocated for it..
Also add a check to see if command size exceeds the
maximum allowable size.
Signed-off-by: Abhijeet Kolekar <abhijeet.kolekar@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-tx.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-tx.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-tx.c b/drivers/net/wireless/iwlwifi/iwl-tx.c index 8f4071562857..066491fc75f2 100644 --- a/drivers/net/wireless/iwlwifi/iwl-tx.c +++ b/drivers/net/wireless/iwlwifi/iwl-tx.c | |||
@@ -366,7 +366,7 @@ int iwl_tx_queue_init(struct iwl_priv *priv, struct iwl_tx_queue *txq, | |||
366 | for (i = 0; i < actual_slots; i++) { | 366 | for (i = 0; i < actual_slots; i++) { |
367 | /* only happens for cmd queue */ | 367 | /* only happens for cmd queue */ |
368 | if (i == slots_num) | 368 | if (i == slots_num) |
369 | len += IWL_MAX_SCAN_SIZE; | 369 | len = IWL_MAX_CMD_SIZE; |
370 | 370 | ||
371 | txq->cmd[i] = kmalloc(len, GFP_KERNEL); | 371 | txq->cmd[i] = kmalloc(len, GFP_KERNEL); |
372 | if (!txq->cmd[i]) | 372 | if (!txq->cmd[i]) |
@@ -1027,9 +1027,12 @@ int iwl_enqueue_hcmd(struct iwl_priv *priv, struct iwl_host_cmd *cmd) | |||
1027 | 1027 | ||
1028 | /* If any of the command structures end up being larger than | 1028 | /* If any of the command structures end up being larger than |
1029 | * the TFD_MAX_PAYLOAD_SIZE, and it sent as a 'small' command then | 1029 | * the TFD_MAX_PAYLOAD_SIZE, and it sent as a 'small' command then |
1030 | * we will need to increase the size of the TFD entries */ | 1030 | * we will need to increase the size of the TFD entries |
1031 | * Also, check to see if command buffer should not exceed the size | ||
1032 | * of device_cmd and max_cmd_size. */ | ||
1031 | BUG_ON((fix_size > TFD_MAX_PAYLOAD_SIZE) && | 1033 | BUG_ON((fix_size > TFD_MAX_PAYLOAD_SIZE) && |
1032 | !(cmd->flags & CMD_SIZE_HUGE)); | 1034 | !(cmd->flags & CMD_SIZE_HUGE)); |
1035 | BUG_ON(fix_size > IWL_MAX_CMD_SIZE); | ||
1033 | 1036 | ||
1034 | if (iwl_is_rfkill(priv) || iwl_is_ctkill(priv)) { | 1037 | if (iwl_is_rfkill(priv) || iwl_is_ctkill(priv)) { |
1035 | IWL_WARN(priv, "Not sending command - %s KILL\n", | 1038 | IWL_WARN(priv, "Not sending command - %s KILL\n", |
@@ -1073,8 +1076,8 @@ int iwl_enqueue_hcmd(struct iwl_priv *priv, struct iwl_host_cmd *cmd) | |||
1073 | if (cmd->flags & CMD_SIZE_HUGE) | 1076 | if (cmd->flags & CMD_SIZE_HUGE) |
1074 | out_cmd->hdr.sequence |= SEQ_HUGE_FRAME; | 1077 | out_cmd->hdr.sequence |= SEQ_HUGE_FRAME; |
1075 | len = sizeof(struct iwl_device_cmd); | 1078 | len = sizeof(struct iwl_device_cmd); |
1076 | len += (idx == TFD_CMD_SLOTS) ? IWL_MAX_SCAN_SIZE : 0; | 1079 | if (idx == TFD_CMD_SLOTS) |
1077 | 1080 | len = IWL_MAX_CMD_SIZE; | |
1078 | 1081 | ||
1079 | #ifdef CONFIG_IWLWIFI_DEBUG | 1082 | #ifdef CONFIG_IWLWIFI_DEBUG |
1080 | switch (out_cmd->hdr.cmd) { | 1083 | switch (out_cmd->hdr.cmd) { |