iwmc3200wifi: Do not handle wifi command if the interface is not ready
authorSamuel Ortiz <sameo@linux.intel.com>
Fri, 16 Oct 2009 05:18:56 +0000 (13:18 +0800)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 27 Oct 2009 20:48:27 +0000 (16:48 -0400)
When resetting or bringing the interface down, we should just reject any wifi
related command.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/iwmc3200wifi/commands.c

index d5125b7659a8d0b48fc1280fba12d32360e6a5f4..25fb8dfd83b52b7ce350c94b58f4257ead687a21 100644 (file)
@@ -76,6 +76,11 @@ int iwm_send_wifi_if_cmd(struct iwm_priv *iwm, void *payload, u16 payload_size,
        int ret;
        u8 oid = hdr->oid;
 
+       if (!test_bit(IWM_STATUS_READY, &iwm->status)) {
+               IWM_ERR(iwm, "Interface is not ready yet");
+               return -EAGAIN;
+       }
+
        umac_cmd.id = UMAC_CMD_OPCODE_WIFI_IF_WRAPPER;
        umac_cmd.resp = resp;