iwlagn: block regular host commands if driver don't own uCode
authorWey-Yi Guy <wey-yi.w.guy@intel.com>
Fri, 8 Jul 2011 15:46:27 +0000 (08:46 -0700)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 11 Jul 2011 19:02:09 +0000 (15:02 -0400)
The only host command allow to send to uCode is the one initiated from
testmode if testmode is the owner of uCode

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/iwlwifi/iwl-tx.c

index b62d03235b8c4e662e420d4539d5fcc42e955a3f..9b07e07f1689f939ab765369aeee15ebbc0750db 100644 (file)
@@ -328,6 +328,12 @@ int iwl_enqueue_hcmd(struct iwl_priv *priv, struct iwl_host_cmd *cmd)
                return -EIO;
        }
 
+       if ((priv->ucode_owner == IWL_OWNERSHIP_TM) &&
+           !(cmd->flags & CMD_ON_DEMAND)) {
+               IWL_DEBUG_HC(priv, "tm own the uCode, no regular hcmd send\n");
+               return -EIO;
+       }
+
        copy_size = sizeof(out_cmd->hdr);
        cmd_size = sizeof(out_cmd->hdr);