From patchwork Thu Jan 21 17:26:19 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Ortiz X-Patchwork-Id: 74395 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.2) with ESMTP id o0LHOpLD018595 for ; Thu, 21 Jan 2010 17:24:51 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752241Ab0AURYu (ORCPT ); Thu, 21 Jan 2010 12:24:50 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752112Ab0AURYu (ORCPT ); Thu, 21 Jan 2010 12:24:50 -0500 Received: from mga07.intel.com ([143.182.124.22]:23554 "EHLO azsmga101.ch.intel.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752103Ab0AURYt (ORCPT ); Thu, 21 Jan 2010 12:24:49 -0500 Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga101.ch.intel.com with ESMTP; 21 Jan 2010 09:24:49 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.47,316,1257148800"; d="scan'208";a="235352089" Received: from unknown (HELO sortiz-mobl) ([10.255.17.126]) by azsmga001.ch.intel.com with ESMTP; 21 Jan 2010 09:24:47 -0800 Date: Thu, 21 Jan 2010 18:26:19 +0100 From: Samuel Ortiz To: "John W. Linville" Cc: linux-wireless@vger.kernel.org, Dan Williams Subject: [PATCH v2] libertas: Set/clear WPA keys before the WEP ones Message-ID: <20100121172618.GA17610@sortiz.org> References: <20100118231920.GH5176@sortiz.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20100118231920.GH5176@sortiz.org> User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org diff --git a/drivers/net/wireless/libertas/assoc.c b/drivers/net/wireless/libertas/assoc.c index 5e650f3..e15a83a 100644 --- a/drivers/net/wireless/libertas/assoc.c +++ b/drivers/net/wireless/libertas/assoc.c @@ -2052,13 +2052,6 @@ void lbs_association_worker(struct work_struct *work) goto out; } - if ( test_bit(ASSOC_FLAG_WEP_KEYS, &assoc_req->flags) - || test_bit(ASSOC_FLAG_WEP_TX_KEYIDX, &assoc_req->flags)) { - ret = assoc_helper_wep_keys(priv, assoc_req); - if (ret) - goto out; - } - if (test_bit(ASSOC_FLAG_SECINFO, &assoc_req->flags)) { ret = assoc_helper_secinfo(priv, assoc_req); if (ret) @@ -2071,6 +2064,10 @@ void lbs_association_worker(struct work_struct *work) goto out; } + /* v10 FW wants WPA keys to be set/cleared before WEP key operations, + * otherwise it will fail to correctly associate to WEP networks. + * Other firmware versions don't appear to care. + */ if (test_bit(ASSOC_FLAG_WPA_MCAST_KEY, &assoc_req->flags) || test_bit(ASSOC_FLAG_WPA_UCAST_KEY, &assoc_req->flags)) { ret = assoc_helper_wpa_keys(priv, assoc_req); @@ -2078,6 +2075,14 @@ void lbs_association_worker(struct work_struct *work) goto out; } + if (test_bit(ASSOC_FLAG_WEP_KEYS, &assoc_req->flags) + || test_bit(ASSOC_FLAG_WEP_TX_KEYIDX, &assoc_req->flags)) { + ret = assoc_helper_wep_keys(priv, assoc_req); + if (ret) + goto out; + } + + /* SSID/BSSID should be the _last_ config option set, because they * trigger the association attempt. */