From patchwork Fri Aug 28 09:59:26 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jussi Kivilinna X-Patchwork-Id: 44431 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 n7S9xTTv020893 for ; Fri, 28 Aug 2009 09:59:29 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751920AbZH1J7Z (ORCPT ); Fri, 28 Aug 2009 05:59:25 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751916AbZH1J7Z (ORCPT ); Fri, 28 Aug 2009 05:59:25 -0400 Received: from sinikuusama.dnainternet.net ([83.102.40.134]:37485 "EHLO sinikuusama.dnainternet.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751912AbZH1J7Z (ORCPT ); Fri, 28 Aug 2009 05:59:25 -0400 Received: from localhost (localhost [127.0.0.1]) by sinikuusama.dnainternet.net (Postfix) with ESMTP id AFDE17F08B; Fri, 28 Aug 2009 12:59:26 +0300 (EEST) X-Virus-Scanned: DNA Postiturva at dnainternet.net X-Spam-Flag: NO X-Spam-Score: -0.052 X-Spam-Level: X-Spam-Status: No, score=-0.052 tagged_above=-9999 required=6 tests=[AWL=-0.052] Received: from sinikuusama.dnainternet.net ([83.102.40.134]) by localhost (sinikuusama.dnainternet.net [127.0.0.1]) (amavisd-new, port 10041) with ESMTP id 8ucjLW2blwQe; Fri, 28 Aug 2009 12:59:26 +0300 (EEST) Received: from oliivipuu.dnainternet.net (oliivipuu.dnainternet.net [83.102.40.215]) by sinikuusama.dnainternet.net (Postfix) with ESMTP id 87BF27F0B4; Fri, 28 Aug 2009 12:59:26 +0300 (EEST) Received: from fate.lan (dyn2-85-23-163-149.psoas.suomi.net [85.23.163.149]) by oliivipuu.dnainternet.net (Postfix) with ESMTP id 753DA2BAE9; Fri, 28 Aug 2009 12:59:26 +0300 (EEST) From: Jussi Kivilinna Subject: [PATCH 8/8] rndis_wlan: enable infrastructure before setting random essid To: linux-wireless@vger.kernel.org Cc: "John W. Linville" Date: Fri, 28 Aug 2009 12:59:26 +0300 Message-ID: <20090828095926.10554.15679.stgit@fate.lan> In-Reply-To: <20090828095849.10554.58857.stgit@fate.lan> References: <20090828095849.10554.58857.stgit@fate.lan> User-Agent: StGIT/0.14.2 MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Random essid must be set to turn on radio when not connected. If device is in ad-hoc mode, this results 'media connect' indications with the random essid which should be ignored. Signed-off-by: Jussi Kivilinna --- drivers/net/wireless/rndis_wlan.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/net/wireless/rndis_wlan.c b/drivers/net/wireless/rndis_wlan.c index d117620..c5a674d 100644 --- a/drivers/net/wireless/rndis_wlan.c +++ b/drivers/net/wireless/rndis_wlan.c @@ -921,6 +921,7 @@ static int freq_to_dsconfig(struct iw_freq *freq, unsigned int *dsconfig) /* * common functions */ +static int set_infra_mode(struct usbnet *usbdev, int mode); static void restore_keys(struct usbnet *usbdev); static int rndis_check_bssid_list(struct usbnet *usbdev); @@ -1014,6 +1015,11 @@ static int disassociate(struct usbnet *usbdev, int reset_ssid) /* disassociate causes radio to be turned off; if reset_ssid * is given, set random ssid to enable radio */ if (reset_ssid) { + /* Set device to infrastructure mode so we don't get ad-hoc + * 'media connect' indications with the random ssid. + */ + set_infra_mode(usbdev, NDIS_80211_INFRA_INFRA); + ssid.length = cpu_to_le32(sizeof(ssid.essid)); get_random_bytes(&ssid.essid[2], sizeof(ssid.essid)-2); ssid.essid[0] = 0x1;