From patchwork Wed Jun 17 05:46:49 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: 6621851 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 56B419F1C1 for ; Wed, 17 Jun 2015 05:47:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 541722080E for ; Wed, 17 Jun 2015 05:47:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 651482080D for ; Wed, 17 Jun 2015 05:47:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753291AbbFQFrJ (ORCPT ); Wed, 17 Jun 2015 01:47:09 -0400 Received: from mail-wi0-f169.google.com ([209.85.212.169]:37020 "EHLO mail-wi0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752448AbbFQFrG (ORCPT ); Wed, 17 Jun 2015 01:47:06 -0400 Received: by wifx6 with SMTP id x6so40287307wif.0 for ; Tue, 16 Jun 2015 22:47:05 -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; bh=1a2b+zEhiFfbxLjOc15WS2awQTn6QWM4n6ktXTpNnjs=; b=5NiTFOGVtDHHzOtqWBi+aJYJ58zZjxWB/N+SZIOMqQxbE6mP/qxUs1yl3SVPSqM6Xc a06bTjcb0upS9folzShaSwtc0p0cTrDRJsI4BG2dtSqZLaMdA3rFMwrYwzUfYbhNiK9I W77Rou7SOdZqCNuu8Pia5nbHDQQd3TtGVe2XE= 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; bh=1a2b+zEhiFfbxLjOc15WS2awQTn6QWM4n6ktXTpNnjs=; b=P2i1PoGu/iBOYQIO0TZ845THSb9e4ahoCMKzj4ZeHBe2U2jSwtmVioXaIew7yOW9Xc b1N3h5lzT6xJI2xsO8/ExYqHKuJwHA4+894dZbYmqil2e2OWDFVUSTdVfc8773ETyeCW 4zPeeSbLtINBIOSOGCpFoxzY7BA1M8F9SvOLbHJ6RG35Z0DNv2jx90SYctJu5YKKXynx RawRUK8YN7qQr3a5uAAvJV/N+RqXfiLm1UHQUqV3MksITRH5XVu++Xh/NRGKGAIrBTJG g074tJWggL8KW7uSnrtE8pfg5riwefowvvYRniIdac6ecC/q/0NtOApxJTQ5zCnGNhRq hskQ== X-Gm-Message-State: ALoCoQmUtzzknAaNmUKNldQMGQNrYKI1orJMT3b6qPq0bWdRo3mjP9wjvwXTMLz0HN8dPEbV1qcmpSHU1GR+aiJCESxUTdMSxKdfKiG3IqTRp8p/cj/s2rcByUWQdcplQGy/gBp4UOP7zHKhMlPDQTyMs/aDLr+sZWmnEodLU/8irSYXRBIHuTGQ7aBjcS53yX0Mk4yLndQy X-Received: by 10.194.23.225 with SMTP id p1mr2495537wjf.155.1434520025106; Tue, 16 Jun 2015 22:47:05 -0700 (PDT) Received: from localhost.localdomain ([91.198.246.8]) by mx.google.com with ESMTPSA id i14sm4893055wjr.7.2015.06.16.22.47.03 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 16 Jun 2015 22:47:04 -0700 (PDT) From: Janusz Dziedzic To: linux-wireless@vger.kernel.org Cc: nbd@openwrt.org, sujith@msujith.org, Janusz Dziedzic Subject: [RFCv2] ath9k: make rxfilter per HW Date: Wed, 17 Jun 2015 07:46:49 +0200 Message-Id: <1434520009-8824-1-git-send-email-janusz.dziedzic@tieto.com> X-Mailer: git-send-email 1.9.1 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=-7.4 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 ath_chanctx. Then we loose rxfilter configuration. Eg. during p2p_find (when 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 Acked-by: Felix Fietkau --- @Sujith, Felix please review 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; }