From eedb6e357a4b1bd3d7e4544e77fbd71718492547 Mon Sep 17 00:00:00 2001 From: Wey-Yi Guy Date: Fri, 8 Jul 2011 08:46:27 -0700 Subject: iwlagn: block regular host commands if driver don't own uCode 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 Signed-off-by: John W. Linville --- drivers/net/wireless/iwlwifi/iwl-tx.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'drivers/net/wireless/iwlwifi/iwl-tx.c') diff --git a/drivers/net/wireless/iwlwifi/iwl-tx.c b/drivers/net/wireless/iwlwifi/iwl-tx.c index b62d03235b8c..9b07e07f1689 100644 --- a/drivers/net/wireless/iwlwifi/iwl-tx.c +++ b/drivers/net/wireless/iwlwifi/iwl-tx.c @@ -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); -- cgit v1.2.2