Return-path: Received: from mga01.intel.com ([192.55.52.88]:15258 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752200AbZJPFVJ (ORCPT ); Fri, 16 Oct 2009 01:21:09 -0400 From: Zhu Yi To: linville@tuxdriver.com Cc: linux-wireless@vger.kernel.org, Samuel Ortiz , Zhu Yi Subject: [PATCH 12/16] iwmc3200wifi: Do not handle wifi command if the interface is not ready Date: Fri, 16 Oct 2009 13:18:56 +0800 Message-Id: <1255670340-22565-13-git-send-email-yi.zhu@intel.com> In-Reply-To: <1255670340-22565-12-git-send-email-yi.zhu@intel.com> References: <1255670340-22565-1-git-send-email-yi.zhu@intel.com> <1255670340-22565-2-git-send-email-yi.zhu@intel.com> <1255670340-22565-3-git-send-email-yi.zhu@intel.com> <1255670340-22565-4-git-send-email-yi.zhu@intel.com> <1255670340-22565-5-git-send-email-yi.zhu@intel.com> <1255670340-22565-6-git-send-email-yi.zhu@intel.com> <1255670340-22565-7-git-send-email-yi.zhu@intel.com> <1255670340-22565-8-git-send-email-yi.zhu@intel.com> <1255670340-22565-9-git-send-email-yi.zhu@intel.com> <1255670340-22565-10-git-send-email-yi.zhu@intel.com> <1255670340-22565-11-git-send-email-yi.zhu@intel.com> <1255670340-22565-12-git-send-email-yi.zhu@intel.com> Sender: linux-wireless-owner@vger.kernel.org List-ID: From: Samuel Ortiz When resetting or bringing the interface down, we should just reject any wifi related command. Signed-off-by: Samuel Ortiz Signed-off-by: Zhu Yi --- drivers/net/wireless/iwmc3200wifi/commands.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/drivers/net/wireless/iwmc3200wifi/commands.c b/drivers/net/wireless/iwmc3200wifi/commands.c index 0641bc7..2911ace 100644 --- a/drivers/net/wireless/iwmc3200wifi/commands.c +++ b/drivers/net/wireless/iwmc3200wifi/commands.c @@ -77,6 +77,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; -- 1.6.0.4