From patchwork Fri Oct 16 12:27:21 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luciano Coelho X-Patchwork-Id: 54246 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 n9GCUB8X007500 for ; Fri, 16 Oct 2009 12:30:12 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759035AbZJPM3H (ORCPT ); Fri, 16 Oct 2009 08:29:07 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1759039AbZJPM3G (ORCPT ); Fri, 16 Oct 2009 08:29:06 -0400 Received: from smtp.nokia.com ([192.100.122.230]:32563 "EHLO mgw-mx03.nokia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759034AbZJPM3F (ORCPT ); Fri, 16 Oct 2009 08:29:05 -0400 Received: from vaebh105.NOE.Nokia.com (vaebh105.europe.nokia.com [10.160.244.31]) by mgw-mx03.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id n9GCRKYX027080 for ; Fri, 16 Oct 2009 15:27:35 +0300 Received: from esebh102.NOE.Nokia.com ([172.21.138.183]) by vaebh105.NOE.Nokia.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 16 Oct 2009 15:27:29 +0300 Received: from mgw-da01.ext.nokia.com ([147.243.128.24]) by esebh102.NOE.Nokia.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.3959); Fri, 16 Oct 2009 15:27:28 +0300 Received: from localhost.localdomain (pimenta.research.nokia.com [172.21.50.90]) by mgw-da01.ext.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id n9GCRMrA008409; Fri, 16 Oct 2009 15:27:26 +0300 From: Luciano Coelho To: linux-wireless@vger.kernel.org Cc: kalle.valo@nokia.com, juuso.oikarinen@nokia.com Subject: [RFC 2/3] wl1271: WIP - use operating BSSID for joining and disconnecting Date: Fri, 16 Oct 2009 15:27:21 +0300 Message-Id: <1255696042-28413-3-git-send-email-luciano.coelho@nokia.com> X-Mailer: git-send-email 1.5.6.5 In-Reply-To: <1255696042-28413-1-git-send-email-luciano.coelho@nokia.com> References: <1255696042-28413-1-git-send-email-luciano.coelho@nokia.com> X-OriginalArrivalTime: 16 Oct 2009 12:27:29.0078 (UTC) FILETIME=[06C17560:01CA4E5C] X-Nokia-AV: Clean 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/wl12xx/wl1271_main.c b/drivers/net/wireless/wl12xx/wl1271_main.c index 86132bb..3077509 100644 --- a/drivers/net/wireless/wl12xx/wl1271_main.c +++ b/drivers/net/wireless/wl12xx/wl1271_main.c @@ -1114,10 +1114,12 @@ static int wl1271_op_config(struct ieee80211_hw *hw, u32 changed) channel = ieee80211_frequency_to_channel(conf->channel->center_freq); - wl1271_debug(DEBUG_MAC80211, "mac80211 config ch %d psm %s power %d", + wl1271_debug(DEBUG_MAC80211, "mac80211 config ch %d psm %s power %d " + "bssid %pM", channel, conf->flags & IEEE80211_CONF_PS ? "on" : "off", - conf->power_level); + conf->power_level, + conf->oper_bssid); mutex_lock(&wl->mutex); @@ -1141,6 +1143,27 @@ static int wl1271_op_config(struct ieee80211_hw *hw, u32 changed) if (ret < 0) goto out_sleep; + if (changed & IEEE80211_CONF_CHANGE_OPER_BSSID) { + if (is_zero_ether_addr(conf->oper_bssid)) { + wl1271_debug(DEBUG_MAC80211, "gone to idle"); + + ret = wl1271_cmd_disconnect(wl); + if (ret < 0) { + wl1271_error("failed to disconnect"); + goto out_sleep; + } + memset(wl->bssid, 0, ETH_ALEN); + } else if (memcmp(wl->bssid, conf->oper_bssid, ETH_ALEN)) { + wl1271_debug(DEBUG_MAC80211, "oper_bssid changed"); + + memcpy(wl->bssid, conf->oper_bssid, ETH_ALEN); + + ret = wl1271_cmd_join(wl); + if (ret < 0) + goto out_sleep; + } + } + if (conf->flags & IEEE80211_CONF_PS && !wl->psm_requested) { wl1271_info("psm enabled"); @@ -1474,6 +1497,17 @@ static void wl1271_op_bss_info_changed(struct ieee80211_hw *hw, if (ret < 0) goto out; + if ((changed & BSS_CHANGED_BSSID) && + memcmp(wl->bssid, bss_conf->bssid, ETH_ALEN)) { + wl1271_debug(DEBUG_MAC80211, "bssid changed"); + + memcpy(wl->bssid, bss_conf->bssid, ETH_ALEN); + + ret = wl1271_cmd_join(wl); + if (ret < 0) + goto out_sleep; + } + if (changed & BSS_CHANGED_ASSOC) { if (bss_conf->assoc) { wl->aid = bss_conf->aid;