From patchwork Mon Feb 10 11:47:33 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eliad Peller X-Patchwork-Id: 3618351 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 A9649BF418 for ; Mon, 10 Feb 2014 11:48:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C9697201B6 for ; Mon, 10 Feb 2014 11:48:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E541F20138 for ; Mon, 10 Feb 2014 11:48:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752760AbaBJLsM (ORCPT ); Mon, 10 Feb 2014 06:48:12 -0500 Received: from mail-we0-f182.google.com ([74.125.82.182]:49108 "EHLO mail-we0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752357AbaBJLsK (ORCPT ); Mon, 10 Feb 2014 06:48:10 -0500 Received: by mail-we0-f182.google.com with SMTP id u57so4174205wes.13 for ; Mon, 10 Feb 2014 03:48:09 -0800 (PST) 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=KX4jHh7WLwttmdE3iy6EIaN4Tn677jZ/teLBqwPfzjY=; b=b7sivS3GzApwTA971VxlVPrYQ/3y9SY5tRCDDfkO7XZ8rxqVPjpTPXhy1kZu9glgrk 4Ws8vcfoFE+5fvnpD6+PqSy1jDRjHnoalKSwo8uKtqiOcxiHmoViExvw807nGDlyiGdD tiQ7jGsnYX1Rq3uJDfiw5s3nnTHDQraaGmG7jsAxb9P8DRNQ/ebittkDnqixL+ARDwNu QHv1e91c/lmA9FaolDN272KrPj7qGp3WxUgJUxO9yU72rywU4PIsD62D/D4C6rUQKd1u AJXcmZRns1pOzKsKe4knnxffVD3yvwRBTzVIvgculUPjKTDTqxDGpfMID3SDfPiRIAML 065A== X-Gm-Message-State: ALoCoQlBNtsPMRWogZhC345Kh3sDhbUpwlrIOnBJgdxPoUIVFHUkilOUMMmqc9Iqu+9ETjQ58la+ X-Received: by 10.180.91.17 with SMTP id ca17mr10176605wib.41.1392032889226; Mon, 10 Feb 2014 03:48:09 -0800 (PST) Received: from muse.amr.corp.intel.com (93-173-177-113.bb.netvision.net.il. [93.173.177.113]) by mx.google.com with ESMTPSA id ju6sm34687484wjc.1.2014.02.10.03.48.07 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 10 Feb 2014 03:48:08 -0800 (PST) From: Eliad Peller To: "John W. Linville" Cc: Subject: [PATCH 17/18] wlcore: enable beacon filtering only after receiving a beacon Date: Mon, 10 Feb 2014 13:47:33 +0200 Message-Id: <1392032854-28126-18-git-send-email-eliad@wizery.com> X-Mailer: git-send-email 1.8.5.2.229.g4448466.dirty In-Reply-To: <1392032854-28126-1-git-send-email-eliad@wizery.com> References: <1392032854-28126-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.5 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 Enabling beacon filtering before receving a beacon might result in not having a beacon at all for the current connected AP, which prevents the station from entering power-save. Replace the current approach (of starting beacon filtering on init) and configure beacon filering only after bss_conf->dtimper is set (which means mac80211 already parsed a beacon). Signed-off-by: Eliad Peller --- drivers/net/wireless/ti/wlcore/acx.c | 3 ++- drivers/net/wireless/ti/wlcore/init.c | 4 ++-- drivers/net/wireless/ti/wlcore/main.c | 12 ++++++++++++ 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/ti/wlcore/acx.c b/drivers/net/wireless/ti/wlcore/acx.c index 71b244b..b924cea 100644 --- a/drivers/net/wireless/ti/wlcore/acx.c +++ b/drivers/net/wireless/ti/wlcore/acx.c @@ -358,7 +358,8 @@ int wl1271_acx_beacon_filter_opt(struct wl1271 *wl, struct wl12xx_vif *wlvif, struct acx_beacon_filter_option *beacon_filter = NULL; int ret = 0; - wl1271_debug(DEBUG_ACX, "acx beacon filter opt"); + wl1271_debug(DEBUG_ACX, "acx beacon filter opt enable=%d", + enable_filter); if (enable_filter && wl->conf.conn.bcn_filt_mode == CONF_BCN_FILT_MODE_DISABLED) diff --git a/drivers/net/wireless/ti/wlcore/init.c b/drivers/net/wireless/ti/wlcore/init.c index b376c99..199e941 100644 --- a/drivers/net/wireless/ti/wlcore/init.c +++ b/drivers/net/wireless/ti/wlcore/init.c @@ -287,8 +287,8 @@ static int wl1271_init_sta_beacon_filter(struct wl1271 *wl, if (ret < 0) return ret; - /* enable beacon filtering */ - ret = wl1271_acx_beacon_filter_opt(wl, wlvif, true); + /* disable beacon filtering until we get the first beacon */ + ret = wl1271_acx_beacon_filter_opt(wl, wlvif, false); if (ret < 0) return ret; diff --git a/drivers/net/wireless/ti/wlcore/main.c b/drivers/net/wireless/ti/wlcore/main.c index a2348b9..82d5461 100644 --- a/drivers/net/wireless/ti/wlcore/main.c +++ b/drivers/net/wireless/ti/wlcore/main.c @@ -2941,6 +2941,11 @@ static int wlcore_unset_assoc(struct wl1271 *wl, struct wl12xx_vif *wlvif) ret = wl1271_acx_keep_alive_mode(wl, wlvif, false); if (ret < 0) return ret; + + /* disable beacon filtering */ + ret = wl1271_acx_beacon_filter_opt(wl, wlvif, false); + if (ret < 0) + return ret; } if (test_and_clear_bit(WLVIF_FLAG_CS_PROGRESS, &wlvif->flags)) { @@ -4312,6 +4317,13 @@ static void wl1271_bss_info_changed_sta(struct wl1271 *wl, } } + if ((changed & BSS_CHANGED_BEACON_INFO) && bss_conf->dtim_period) { + /* enable beacon filtering */ + ret = wl1271_acx_beacon_filter_opt(wl, wlvif, true); + if (ret < 0) + goto out; + } + ret = wl1271_bss_erp_info_changed(wl, vif, bss_conf, changed); if (ret < 0) goto out;