From patchwork Fri Jul 11 00:01:36 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eliad Peller X-Patchwork-Id: 4529031 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 629BDBEEAA for ; Fri, 11 Jul 2014 00:02:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8F176201C0 for ; Fri, 11 Jul 2014 00:02:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B4E4C2015E for ; Fri, 11 Jul 2014 00:02:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751790AbaGKAC0 (ORCPT ); Thu, 10 Jul 2014 20:02:26 -0400 Received: from mail-we0-f172.google.com ([74.125.82.172]:33758 "EHLO mail-we0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751716AbaGKAC0 (ORCPT ); Thu, 10 Jul 2014 20:02:26 -0400 Received: by mail-we0-f172.google.com with SMTP id u57so303331wes.31 for ; Thu, 10 Jul 2014 17:02:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=HoliSzrSG3/G9Y6q77AgTVMQ9NGvjexez62MJKUi9yA=; b=ZTS5HPFeqM+33MD9OPIYWtvTZXRpGSnAGcQMYqo5loO1uYStb5WSOy9Cbd0HV+3AzR uMUf9qe+lWDXZsDfM/Xgv8MVP86o4Imk9ca24c0gUU35SHMmmfaCa635U6YmtQ7usonl ZGbScLVJwolkw5AjUvx5zQ7cSv21NcsqAVHelj0xzT6iD6eRf47OusgC1qthRQN/OTzN w487BN2D2HtSbjitVcOoFmhBY8VU/jrkGOnmX5zz1PxnVZXfkQ+kW/C5QMmWsvcK/Ilz QOYEW8HY6NIU/x30Xip+EqGJPUNmMj+2AZqhKFe/NqsN0t3uBOuao2YGa3wdhgE3RuYj Ktiw== X-Gm-Message-State: ALoCoQmwbDxPmnvVSd4lVrdVTavLxH5Pv/AGzb+2Yl7sSr1JzKKBpiJRNff6D8429yAoLLiXQW9E X-Received: by 10.194.186.178 with SMTP id fl18mr59244484wjc.83.1405036944765; Thu, 10 Jul 2014 17:02:24 -0700 (PDT) Received: from localhost.localdomain (46-116-157-102.bb.netvision.net.il. [46.116.157.102]) by mx.google.com with ESMTPSA id 19sm1426848wjz.3.2014.07.10.17.02.22 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 10 Jul 2014 17:02:24 -0700 (PDT) From: Eliad Peller To: "John W. Linville" Cc: Subject: [PATCH 11/14] wlcore: don't switch channels on disconnected STA vifs Date: Fri, 11 Jul 2014 03:01:36 +0300 Message-Id: <1405036899-27396-12-git-send-email-eliad@wizery.com> X-Mailer: git-send-email 1.8.5.1.109.g3d252a9 In-Reply-To: <1405036899-27396-1-git-send-email-eliad@wizery.com> References: <1405036899-27396-1-git-send-email-eliad@wizery.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Arik Nemtsov Sending the FW a channel switch command on a disconnected vif may result in a beacon loss event. Avoid this corner case. Signed-off-by: Arik Nemtsov Signed-off-by: Eliad Peller --- drivers/net/wireless/ti/wlcore/main.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/net/wireless/ti/wlcore/main.c b/drivers/net/wireless/ti/wlcore/main.c index d92f578..ec21141 100644 --- a/drivers/net/wireless/ti/wlcore/main.c +++ b/drivers/net/wireless/ti/wlcore/main.c @@ -5192,6 +5192,10 @@ static void wl12xx_op_channel_switch(struct ieee80211_hw *hw, if (unlikely(wl->state == WLCORE_STATE_OFF)) { wl12xx_for_each_wlvif_sta(wl, wlvif) { struct ieee80211_vif *vif = wl12xx_wlvif_to_vif(wlvif); + + if (!test_bit(WLVIF_FLAG_STA_ASSOCIATED, &wlvif->flags)) + continue; + ieee80211_chswitch_done(vif, false); } goto out; @@ -5207,6 +5211,9 @@ static void wl12xx_op_channel_switch(struct ieee80211_hw *hw, wl12xx_for_each_wlvif_sta(wl, wlvif) { unsigned long delay_usec; + if (!test_bit(WLVIF_FLAG_STA_ASSOCIATED, &wlvif->flags)) + continue; + ret = wl->ops->channel_switch(wl, wlvif, ch_switch); if (ret) goto out_sleep;