From patchwork Wed Dec 17 09:00:52 2014 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: 5505761 Return-Path: X-Original-To: patchwork-ath10k@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 15E579F456 for ; Wed, 17 Dec 2014 09:02:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0CA18209B1 for ; Wed, 17 Dec 2014 09:02:32 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id F1A3A209AB for ; Wed, 17 Dec 2014 09:02:30 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Y1AUw-0000rU-V8; Wed, 17 Dec 2014 09:02:22 +0000 Received: from mail-wi0-x235.google.com ([2a00:1450:400c:c05::235]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Y1AUu-0000nv-H4 for ath10k@lists.infradead.org; Wed, 17 Dec 2014 09:02:21 +0000 Received: by mail-wi0-f181.google.com with SMTP id r20so15245035wiv.2 for ; Wed, 17 Dec 2014 01:01:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tieto.com; s=google; h=from:to:cc:subject:date:message-id; bh=c+Tf8VUOU5HdeVdPkzIATPq5IUCW8JeONpmGRlJwABg=; b=be5n46dZc7cpb5rKMEfBkvn/0tNGP/Dp6CODk9GekUBkeIwUZdHVcatVv+cj6y4XO0 rdiAvl4t0JxiIJ7rvgN8emZp9geWxGOE1a6I7o89xv7P5pB3f3G7LmlWMX0nHxKhNUzT 5lM85yk4BYsEXs5lZ6k8iYFP4pwp9rAeHwKMU= 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=c+Tf8VUOU5HdeVdPkzIATPq5IUCW8JeONpmGRlJwABg=; b=coHCuNb/X+K7x8fGNoqwe3NPyDAUAbcIMlz8ActC7ltRZpoL1p3hxGaEwNDcb4eZWT 95EizFtLOrB3E5MAE9JiI4Mol7VtNnwushyJPDZCA5R6GPX4R57Wmp1oqRXbt/db100N hb2ZQNvGfkdRuCA39loYrX2zNx0RWPCXHEEzfN72lY/adnq8/jLiaGPS2Cm5aRpeDMWe xbpwuDIDNPA0fYxPPBKp+QLWgtA9luqqAAy9YgNmDcR0M4SQ6EW64Vszw/YJ4K6gEdJH hBcyIlbKHXLO3XRyrYndBeyH6NSmHw4GgTaMWdMWqbRCuIzeed+o75qZPxzEtOfLei36 qm+g== X-Gm-Message-State: ALoCoQlq0bMytR7QUuvXv/khOils6ZDsif04UuuUzp7bhIZw1wRp2cIXidWlndjLPLfPYqRpg7xAfpsnInPRIQOYP4/7Q4XCQEXfDoPyQVLI5w9yPmoOdjxW1uZp+v27eriSl13dNqok X-Received: by 10.180.108.143 with SMTP id hk15mr12671514wib.6.1418806918054; Wed, 17 Dec 2014 01:01:58 -0800 (PST) Received: from localhost.localdomain (apn-95-41-83-92.dynamic.gprs.plus.pl. [95.41.83.92]) by mx.google.com with ESMTPSA id fx6sm4224837wjc.39.2014.12.17.01.01.56 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 17 Dec 2014 01:01:57 -0800 (PST) From: Janusz Dziedzic To: linux-wireless@vger.kernel.org Subject: [PATCH v2] mac80211: notify NSS changed when IBSS and HT Date: Wed, 17 Dec 2014 10:00:52 +0100 Message-Id: <1418806852-558-1-git-send-email-janusz.dziedzic@tieto.com> X-Mailer: git-send-email 1.9.1 X-DomainID: tieto.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141217_010220_738230_93C2A014 X-CRM114-Status: UNSURE ( 8.17 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.8 (/) Cc: Janusz Dziedzic , johannes@sipsolutions.net, ath10k@lists.infradead.org X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_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 When using IBSS in HT mode, we always get NSS=1 in rc_update callback. Force NSS recalculation when rates updated and notify driver that NSS changed. Signed-off-by: Janusz Dziedzic --- net/mac80211/ibss.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c index 509bc15..b606b53 100644 --- a/net/mac80211/ibss.c +++ b/net/mac80211/ibss.c @@ -1069,9 +1069,16 @@ static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata, } if (sta && rates_updated) { - drv_sta_rc_update(local, sdata, &sta->sta, - IEEE80211_RC_SUPP_RATES_CHANGED); + u32 changed = IEEE80211_RC_SUPP_RATES_CHANGED; + u8 rx_nss = sta->sta.rx_nss; + + /* Force rx_nss recalculation */ + sta->sta.rx_nss = 0; rate_control_rate_init(sta); + if (sta->sta.rx_nss != rx_nss) + changed |= IEEE80211_RC_NSS_CHANGED; + + drv_sta_rc_update(local, sdata, &sta->sta, changed); } rcu_read_unlock();