diff options
author | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2011-06-09 08:48:36 -0400 |
---|---|---|
committer | Wey-Yi Guy <wey-yi.w.guy@intel.com> | 2011-06-18 11:19:07 -0400 |
commit | 4b55b07fc9e5eccfd204cad75509bf062d3c22a3 (patch) | |
tree | c2fc0a1352e04f27b6717901254e1dfd0f68ee87 /drivers/net | |
parent | 807caf261c5196b566964ccb9e12d3e25eee9c4a (diff) |
iwlagn: warn about nested SYNC commands
Since there is no protection around SYNC host command mechanism, at least WARN
when collision happens between two SYNC host comamnds. I am not sure there is a
real issue (beyond the HCMD_ACTIVE flag maintenance) with having two SYNC host
commands at the same time, but at least now, we will know about it.
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-dev.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-hcmd.c | 11 |
2 files changed, 11 insertions, 1 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h index 34f9d0f6702a..2d13d8928e2c 100644 --- a/drivers/net/wireless/iwlwifi/iwl-dev.h +++ b/drivers/net/wireless/iwlwifi/iwl-dev.h | |||
@@ -1300,6 +1300,7 @@ struct iwl_priv { | |||
1300 | 1300 | ||
1301 | /* command queue number */ | 1301 | /* command queue number */ |
1302 | u8 cmd_queue; | 1302 | u8 cmd_queue; |
1303 | u8 last_sync_cmd_id; | ||
1303 | 1304 | ||
1304 | /* max number of station keys */ | 1305 | /* max number of station keys */ |
1305 | u8 sta_key_max_num; | 1306 | u8 sta_key_max_num; |
diff --git a/drivers/net/wireless/iwlwifi/iwl-hcmd.c b/drivers/net/wireless/iwlwifi/iwl-hcmd.c index 76f996623140..7cdb1ec73b54 100644 --- a/drivers/net/wireless/iwlwifi/iwl-hcmd.c +++ b/drivers/net/wireless/iwlwifi/iwl-hcmd.c | |||
@@ -181,7 +181,16 @@ int iwl_send_cmd_sync(struct iwl_priv *priv, struct iwl_host_cmd *cmd) | |||
181 | IWL_DEBUG_INFO(priv, "Attempting to send sync command %s\n", | 181 | IWL_DEBUG_INFO(priv, "Attempting to send sync command %s\n", |
182 | get_cmd_string(cmd->id)); | 182 | get_cmd_string(cmd->id)); |
183 | 183 | ||
184 | set_bit(STATUS_HCMD_ACTIVE, &priv->status); | 184 | if (test_and_set_bit(STATUS_HCMD_ACTIVE, &priv->status)) { |
185 | IWL_ERR(priv, "STATUS_HCMD_ACTIVE already set while sending %s" | ||
186 | ". Previous SYNC cmdn is %s\n", | ||
187 | get_cmd_string(cmd->id), | ||
188 | get_cmd_string(priv->last_sync_cmd_id)); | ||
189 | WARN_ON(1); | ||
190 | } else { | ||
191 | priv->last_sync_cmd_id = cmd->id; | ||
192 | } | ||
193 | |||
185 | IWL_DEBUG_INFO(priv, "Setting HCMD_ACTIVE for command %s\n", | 194 | IWL_DEBUG_INFO(priv, "Setting HCMD_ACTIVE for command %s\n", |
186 | get_cmd_string(cmd->id)); | 195 | get_cmd_string(cmd->id)); |
187 | 196 | ||