aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorAbhijeet Kolekar <abhijeet.kolekar@intel.com>2010-02-19 14:49:49 -0500
committerReinette Chatre <reinette.chatre@intel.com>2010-02-23 17:59:12 -0500
commit89612124d6d62230043ebd827a2b54ea5ea5280c (patch)
tree6bc255e176748a399948ef8c7549632409931ace /drivers/net
parenta120e912eb51e347f36c71b60a1d13af74d30e83 (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')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-commands.h1
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-tx.c11
2 files changed, 8 insertions, 4 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-commands.h b/drivers/net/wireless/iwlwifi/iwl-commands.h
index e91507531923..cfd6c8423113 100644
--- a/drivers/net/wireless/iwlwifi/iwl-commands.h
+++ b/drivers/net/wireless/iwlwifi/iwl-commands.h
@@ -2612,6 +2612,7 @@ struct iwl_ssid_ie {
2612#define TX_CMD_LIFE_TIME_INFINITE cpu_to_le32(0xFFFFFFFF) 2612#define TX_CMD_LIFE_TIME_INFINITE cpu_to_le32(0xFFFFFFFF)
2613#define IWL_GOOD_CRC_TH cpu_to_le16(1) 2613#define IWL_GOOD_CRC_TH cpu_to_le16(1)
2614#define IWL_MAX_SCAN_SIZE 1024 2614#define IWL_MAX_SCAN_SIZE 1024
2615#define IWL_MAX_CMD_SIZE 4096
2615#define IWL_MAX_PROBE_REQUEST 200 2616#define IWL_MAX_PROBE_REQUEST 200
2616 2617
2617/* 2618/*
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) {