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: 5505751 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.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id E10069F456 for ; Wed, 17 Dec 2014 09:02:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 26ED7209AB for ; Wed, 17 Dec 2014 09:02:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DD83B20A2A for ; Wed, 17 Dec 2014 09:02:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752158AbaLQJCD (ORCPT ); Wed, 17 Dec 2014 04:02:03 -0500 Received: from mail-wi0-f181.google.com ([209.85.212.181]:35359 "EHLO mail-wi0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752145AbaLQJB7 (ORCPT ); Wed, 17 Dec 2014 04:01:59 -0500 Received: by mail-wi0-f181.google.com with SMTP id r20so15245038wiv.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=f1qe9wLdhnqkMklPp/v0bhAXFLtC1pvpOpuFmvKf2dVXHnE0h4tyzr9HT2rBy4JNPb 2+BqD4m/aEQeD0pldBeoXI3p2dcrCSHIn4dJziYViw0DcEpu2lUjzaMSNCz/5L8Y83KC XJCX2dIjQFnlc0qgBvIEJfU360s4xaHj3D+s5RPoWjaVYqr121NLNZ8Ev/enmd1WA6tx 04OvxJFO5ZW0g63xEfbrst8pSTDaGuqooCoWqdYhZjt2kQdqc949r/SD2pn4LnOXROwq zaqrJqGB3tiaWrM8R6H/9ltQPmdwrd+u5W9JUpKPfbZVNxaIenIt6w1hWE/R1iO75A9t v6CA== X-Gm-Message-State: ALoCoQkXViS2gu/iji0mqwTieanNRYPKwMwzvuIybBGuP03zMyoB09R0eCJYX+32Okl2wbTIGW5tp0J+syj0wcRp2+98wbNXtogslGRb6dWCoJUUbkHJkOhzVWNLZ2eRYxoRUqtvC9smEQt1Vd4waIBtWbiYnEDZnBcO4JDZRBwRonIXU3u4/y9Po/vDBRP1KYSK/WqMX+gd 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 Cc: ath10k@lists.infradead.org, johannes@sipsolutions.net, Janusz Dziedzic 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 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,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();