From patchwork Tue Sep 1 13:13:58 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Ortiz X-Patchwork-Id: 45066 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n81DDIOd017103 for ; Tue, 1 Sep 2009 13:13:20 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754689AbZIANMm (ORCPT ); Tue, 1 Sep 2009 09:12:42 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754692AbZIANMm (ORCPT ); Tue, 1 Sep 2009 09:12:42 -0400 Received: from mga09.intel.com ([134.134.136.24]:54638 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754689AbZIANMl (ORCPT ); Tue, 1 Sep 2009 09:12:41 -0400 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 01 Sep 2009 05:58:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.44,311,1249282800"; d="scan'208";a="444554283" Received: from unknown (HELO sortiz-mobl) ([143.185.76.195]) by orsmga002.jf.intel.com with ESMTP; 01 Sep 2009 06:18:37 -0700 From: Samuel Ortiz To: John Linville Cc: linux-wireless@vger.kernel.org, Zhu Yi , Samuel Ortiz Subject: [PATCH 1/9] iwmc3200wifi: invalidate profile when necessary before connect Date: Tue, 1 Sep 2009 15:13:58 +0200 Message-Id: <51aebb943245be1aef404d6274fe60feabd47c94.1251809163.git.sameo@linux.intel.com> X-Mailer: git-send-email 1.6.3.3 In-Reply-To: References: In-Reply-To: References: Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Zhu Yi If cfg80211 requests to connect when we have already had an active profile, invalidate the current profile first before sending a new profile to UMAC. Signed-off-by: Zhu Yi Signed-off-by: Samuel Ortiz --- drivers/net/wireless/iwmc3200wifi/cfg80211.c | 15 ++++++++++----- 1 files changed, 10 insertions(+), 5 deletions(-) diff --git a/drivers/net/wireless/iwmc3200wifi/cfg80211.c b/drivers/net/wireless/iwmc3200wifi/cfg80211.c index a6e852f..789ef5c 100644 --- a/drivers/net/wireless/iwmc3200wifi/cfg80211.c +++ b/drivers/net/wireless/iwmc3200wifi/cfg80211.c @@ -326,11 +326,8 @@ static int iwm_cfg80211_change_iface(struct wiphy *wiphy, iwm->umac_profile->mode = cpu_to_le32(iwm->conf.mode); - if (iwm->umac_profile_active) { - int ret = iwm_invalidate_mlme_profile(iwm); - if (ret < 0) - IWM_ERR(iwm, "Couldn't invalidate profile\n"); - } + if (iwm->umac_profile_active) + iwm_invalidate_mlme_profile(iwm); return 0; } @@ -573,6 +570,14 @@ static int iwm_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev, if (!sme->ssid) return -EINVAL; + if (iwm->umac_profile_active) { + ret = iwm_invalidate_mlme_profile(iwm); + if (ret) { + IWM_ERR(iwm, "Couldn't invalidate profile\n"); + return ret; + } + } + if (chan) iwm->channel = ieee80211_frequency_to_channel(chan->center_freq);