From patchwork Mon Jun 22 11:43:04 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janusz.Dziedzic@tieto.com X-Patchwork-Id: 6655161 X-Patchwork-Delegate: kvalo@adurom.com 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.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 0B861C05AC for ; Mon, 22 Jun 2015 11:43:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1B5F9205E3 for ; Mon, 22 Jun 2015 11:43:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 55CF6205E2 for ; Mon, 22 Jun 2015 11:43:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756096AbbFVLni (ORCPT ); Mon, 22 Jun 2015 07:43:38 -0400 Received: from mail-lb0-f172.google.com ([209.85.217.172]:33945 "EHLO mail-lb0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754252AbbFVLnf (ORCPT ); Mon, 22 Jun 2015 07:43:35 -0400 Received: by lbnk3 with SMTP id k3so782935lbn.1 for ; Mon, 22 Jun 2015 04:43:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tieto.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=EB55K+TxZNww4Z6fdNKFzJx8CW6GiqPnKzTX7dB46tY=; b=EQVj3uA9y9rzOg8EOMhuGHD0vBqiaim19T1ldL6Jg86tyxpLEKJ/jC1O5sCtACX6Jr hoPbpAc0nQN7ZBy8rVcvHrET66CdU6GZ3e8lZYGHwEzIax6iQcKWEQZwQcqkyu1lN+Df uKHfXSix5mAsDHTanMJSTuLKfQzT/q7Fa1meU= 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=EB55K+TxZNww4Z6fdNKFzJx8CW6GiqPnKzTX7dB46tY=; b=EwIQchymY3QpNBvPYGW/n1biFBLeu192lNSphCbPYylS7pLVwZsO8GNi18LUPtDtjy VutOFfj+w2BSeopvTwziSyrXVRtZxnFjkoyfoTS0bhLYNnmHVNYGKEpWLdPhRUo988j9 E00xF5zKFwYkU6Cz94i43+1nXhfYwAroL7Ukpa2vSbbigsh1LEY8XM4MmHyvC6nQkosI ebM1xuz3Z45qZ93eQ/Nz3vR5z+Q+XyG83iyKH3b7F6edRiNEUyLfKh/oq0TmgtZerz2S PxZUA83RiTWBfrhLcIykLo9V66TUbCQ4zwJtut2j93j9+VHo8BpNdbjktpVQND7MqpVi 31Fw== X-Gm-Message-State: ALoCoQmN9MWPfA7uyJeP8Zv9O30oyrVJe1yTGa1JGPFjlE1DRQn7mrXWNRuJCgxsM7ZVN410axFrnKUIgHSu3ZZGSDIqIAS4kx7/HpI3SanYpgwcYIDKXkzT+qpGZHu1qP8uj3IaBpSX/p/kvdIxiVAKA+/zh+NKPYqQKkWanidrEjcQor9hlxz7KNcnrHrdnNcO9IFCyxRu X-Received: by 10.112.151.178 with SMTP id ur18mr30063734lbb.59.1434973413805; Mon, 22 Jun 2015 04:43:33 -0700 (PDT) Received: from localhost.localdomain ([91.198.246.8]) by mx.google.com with ESMTPSA id cq1sm2442725lad.18.2015.06.22.04.43.32 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 22 Jun 2015 04:43:32 -0700 (PDT) From: Janusz Dziedzic To: linux-wireless@vger.kernel.org Cc: ath9k-devel@venema.h4ckr.net, nbd@openwrt.org, sujith@msujith.org, Janusz Dziedzic Subject: [PATCH 2/3] ath9k: make rxfilter per HW Date: Mon, 22 Jun 2015 13:43:04 +0200 Message-Id: <1434973385-15865-3-git-send-email-janusz.dziedzic@tieto.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1434973385-15865-1-git-send-email-janusz.dziedzic@tieto.com> References: <1434973385-15865-1-git-send-email-janusz.dziedzic@tieto.com> X-DomainID: tieto.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=-8.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,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 mac80211 configure rxfilter per HW, so we don't need this per channel. This fix problem when chanctx used and ath9k allocate new internal ath_chanctx (eg. when offchannel) and we loose rxfilter configuration. Eg. when p2p_find (with use_chanctx=1), during remain on channel, driver create new ath_chanctx with incorrect rxfilter. Then we didn't receive probe requests and fail p2p_find. Signed-off-by: Janusz Dziedzic --- drivers/net/wireless/ath/ath9k/ath9k.h | 3 ++- drivers/net/wireless/ath/ath9k/main.c | 2 +- drivers/net/wireless/ath/ath9k/recv.c | 12 ++++++------ 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h index a7a81b3..030fd0f 100644 --- a/drivers/net/wireless/ath/ath9k/ath9k.h +++ b/drivers/net/wireless/ath/ath9k/ath9k.h @@ -356,7 +356,6 @@ struct ath_chanctx { short nvifs; short nvifs_assigned; - unsigned int rxfilter; }; enum ath_chanctx_event { @@ -1001,8 +1000,10 @@ struct ath_softc { struct cfg80211_chan_def cur_chandef; struct ath_chanctx chanctx[ATH9K_NUM_CHANCTX]; struct ath_chanctx *cur_chan; + unsigned int rxfilter; spinlock_t chan_lock; + #ifdef CONFIG_MAC80211_LEDS bool led_registered; char led_name[32]; diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c index d285e3a..945f002 100644 --- a/drivers/net/wireless/ath/ath9k/main.c +++ b/drivers/net/wireless/ath/ath9k/main.c @@ -1463,7 +1463,7 @@ static void ath9k_configure_filter(struct ieee80211_hw *hw, *total_flags &= SUPPORTED_FILTERS; spin_lock_bh(&sc->chan_lock); - sc->cur_chan->rxfilter = *total_flags; + sc->rxfilter = *total_flags; spin_unlock_bh(&sc->chan_lock); ath9k_ps_wakeup(sc); diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c index 6c75fb1..5f72c65 100644 --- a/drivers/net/wireless/ath/ath9k/recv.c +++ b/drivers/net/wireless/ath/ath9k/recv.c @@ -389,31 +389,31 @@ u32 ath_calcrxfilter(struct ath_softc *sc) spin_lock_bh(&sc->chan_lock); - if (sc->cur_chan->rxfilter & FIF_PROBE_REQ) + if (sc->rxfilter & FIF_PROBE_REQ) rfilt |= ATH9K_RX_FILTER_PROBEREQ; if (sc->sc_ah->is_monitoring) rfilt |= ATH9K_RX_FILTER_PROM; - if ((sc->cur_chan->rxfilter & FIF_CONTROL) || + if ((sc->rxfilter & FIF_CONTROL) || sc->sc_ah->dynack.enabled) rfilt |= ATH9K_RX_FILTER_CONTROL; if ((sc->sc_ah->opmode == NL80211_IFTYPE_STATION) && (sc->cur_chan->nvifs <= 1) && - !(sc->cur_chan->rxfilter & FIF_BCN_PRBRESP_PROMISC)) + !(sc->rxfilter & FIF_BCN_PRBRESP_PROMISC)) rfilt |= ATH9K_RX_FILTER_MYBEACON; else rfilt |= ATH9K_RX_FILTER_BEACON; if ((sc->sc_ah->opmode == NL80211_IFTYPE_AP) || - (sc->cur_chan->rxfilter & FIF_PSPOLL)) + (sc->rxfilter & FIF_PSPOLL)) rfilt |= ATH9K_RX_FILTER_PSPOLL; if (sc->cur_chandef.width != NL80211_CHAN_WIDTH_20_NOHT) rfilt |= ATH9K_RX_FILTER_COMP_BAR; - if (sc->cur_chan->nvifs > 1 || (sc->cur_chan->rxfilter & FIF_OTHER_BSS)) { + if (sc->cur_chan->nvifs > 1 || (sc->rxfilter & FIF_OTHER_BSS)) { /* This is needed for older chips */ if (sc->sc_ah->hw_version.macVersion <= AR_SREV_VERSION_9160) rfilt |= ATH9K_RX_FILTER_PROM; @@ -878,7 +878,7 @@ static int ath9k_rx_skb_preprocess(struct ath_softc *sc, */ spin_lock_bh(&sc->chan_lock); if (!ath9k_cmn_rx_accept(common, hdr, rx_status, rx_stats, decrypt_error, - sc->cur_chan->rxfilter)) { + sc->rxfilter)) { spin_unlock_bh(&sc->chan_lock); return -EINVAL; }