From patchwork Thu May 6 13:20:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alvin_=C5=A0ipraga?= X-Patchwork-Id: 432016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 37B26C433ED for ; Thu, 6 May 2021 13:20:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F382C61104 for ; Thu, 6 May 2021 13:20:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233407AbhEFNVR (ORCPT ); Thu, 6 May 2021 09:21:17 -0400 Received: from mail-eopbgr40096.outbound.protection.outlook.com ([40.107.4.96]:7687 "EHLO EUR03-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231993AbhEFNVQ (ORCPT ); Thu, 6 May 2021 09:21:16 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Q74uDxiOlzeiS/lkoYTZRSMugpnIGEBBExcRXKbxy4L0JNa/8xBgXQ3fbsVGHiN3uRt+gnC9Ha6slIgVhbFWkrwkFO0q3nd/HQg3lA1mp6Ft108rxoHRgSyneyx3t+z9fFg7l0L7Rf56I229hW9ISIpMgyNfMe4nj0j3lCTpMvpt/TlDhzGZ4hz/la3XwihsMOf+4Fm2KfbTOCl2P6kLYJraEfqCQFnvyKLreiaUlksGQ9SyAJ8BigNod1gc7mqASQQFM85IR+d6yQPbOOqlXJzdt8xsni+1zeOSSKb4u9C38+m0D4zYHD07ln9+3FPGZNRHKFwT7LwgaCnp0JUSLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nWgZkNYYiTe4RQ5OhyzEZiTQFltOOT1xvekU68a5EGA=; b=ekdNP5FrCxZhaX785N9myAx8Max4GOrb2P/SttXYkvdGQ/B/9kJ7EZvqO4GMwiSYSsgouX90aLzSWLoVX6moOYv+r6OQFwHhvNMXouV0Phhyt8r5igSGZzC7S0CNcGy5FefF6rWxZ4AynVdll/VJP6QawXZCKsx9dhsbzYF5qA5RkdKNAu4Fim4OwdcA4OTFe7WVuACb+KprwME88KAOnxpjNfxfYg/QCefbOB2fTqslw1W8nAbpwCJ4fwaGtr+XdHdX8Wn9i/eV6x/KyjUQ+b8SjdHbdSJWtbxQ1Fac4cUuQlf9njC7tG1DIkB+8oxMQwBq7pDqy6duzt7N6uFjBg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=bang-olufsen.dk; dmarc=pass action=none header.from=bang-olufsen.dk; dkim=pass header.d=bang-olufsen.dk; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bang-olufsen.dk; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nWgZkNYYiTe4RQ5OhyzEZiTQFltOOT1xvekU68a5EGA=; b=sxEsrLxoJ91n3iTASy3QUBvCHOLP58aZ0ho7gEcXbFgFVElip62vENvKXmDoAKRYOWzByUOCAW0Am2hBkvrkMecxvk7iG5kNESATxQvpknuGohzQJqPb5gYdcJJHtui+h6eAK+LRl8e2L8j05C2Drx+QMkV40ELcwVPwpmh8k/o= Received: from VI1PR03MB3166.eurprd03.prod.outlook.com (2603:10a6:802:32::30) by VI1PR03MB5135.eurprd03.prod.outlook.com (2603:10a6:803:bc::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.25; Thu, 6 May 2021 13:20:12 +0000 Received: from VI1PR03MB3166.eurprd03.prod.outlook.com ([fe80::ddd3:cf29:124a:ef1e]) by VI1PR03MB3166.eurprd03.prod.outlook.com ([fe80::ddd3:cf29:124a:ef1e%4]) with mapi id 15.20.4087.044; Thu, 6 May 2021 13:20:12 +0000 From: =?utf-8?q?Alvin_=C5=A0ipraga?= To: Arend van Spriel , Franky Lin , Hante Meuleman , Chi-hsien Lin , Wright Feng , Chung-hsien Hsu , Kalle Valo CC: "linux-wireless@vger.kernel.org" , "brcm80211-dev-list.pdl@broadcom.com" , "SHA-cyfmac-dev-list@infineon.com" , =?utf-8?q?Alvin_=C5=A0ipraga?= Subject: [PATCH 1/2] brcmfmac: fix setting of station info chains bitmask Thread-Topic: [PATCH 1/2] brcmfmac: fix setting of station info chains bitmask Thread-Index: AQHXQnqLrkcIm6m/cUuFlqnvRe20bg== Date: Thu, 6 May 2021 13:20:12 +0000 Message-ID: <20210506132010.3964484-1-alsi@bang-olufsen.dk> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.31.1 authentication-results: gmail.com; dkim=none (message not signed) header.d=none; gmail.com; dmarc=none action=none header.from=bang-olufsen.dk; x-originating-ip: [193.89.194.27] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 7f1a74b5-3901-4856-7585-08d91091ae28 x-ms-traffictypediagnostic: VI1PR03MB5135: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8273; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: uPNSm+SmH40wG3mh5rEhHS537oXfRF8M980K6CiiIpVugS0aYWmR4JWkVEraLEjkN0wl1C8L18BKHmZBrYdpoK1zyC2h8eLva6Rr2o0nGmpLcwi9IscizQTbbp4h7GGTswUpdD1drJYv+dJbTS02gqTRgQ9A7iZB1JoN9Wkiud7rFEMBegtj5ZbyKSMLtU5XnTkumCNJlxpJdRK378TOzYcc1itSIuw+UItqZhWXuLXoTgBkfQry1sGBky7UbPXLozxPGwI723VVpWuMCGFqVgeh3kPwWoKcOLZ830AivyIYSDGEayebczJBsk3Y0jyUl+C9UQcVEyCEL8eyeIP5YWPvLSO0awGmW3fv7YVmHt/cQ08KXPhxF9gDkaKi1rUuwYty7H/TunW1pIFoBXg+RjYQ6hybuptBdrJ+XmCHG1clONDafUWAoaUnwwEvwK24GVmXd2IDjsy4BhRtM4hEFLzP2rjLLaRwRY31rIksGCnl8Mhvf6Eynan/rTN34/g6jrzOhpYSBYxA1PK0ZJM93ODO4hvmuPDSWD7NHq1zXMEbbhilzkqeqmMIZXYs5SKPWVLOZnkajW8I5rDh//hSaLybxVh6b6I+DDqDs43yBjE= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR03MB3166.eurprd03.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(39850400004)(366004)(136003)(376002)(346002)(396003)(110136005)(4326008)(107886003)(186003)(1076003)(66476007)(6506007)(85202003)(2906002)(478600001)(64756008)(54906003)(83380400001)(76116006)(316002)(66946007)(66556008)(66446008)(36756003)(6486002)(5660300002)(71200400001)(122000001)(2616005)(8936002)(86362001)(6512007)(8676002)(8976002)(85182001)(38100700002)(7416002)(91956017)(26005); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: =?utf-8?q?08DmT1vS3yoNAt/b5cvZxvB0RxL?= =?utf-8?q?xG6IpwdltQrYPlNLe/k2kZYsqEIrKhYF7hpWL4X74We1LsgnA2Zbyaah?= =?utf-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Jd6/K?= =?utf-8?q?GsVHaw9ceAX7YDk2vj3VtY7/sHn5a0DAFnsrXE4VeKaJmZT1Pzs1Lsl7?= =?utf-8?q?+PMScvLI9iRFfQlFVI3rddxiGhndJ+XTFmBU/FDVSCOGMHFW5zhRzw3f?= =?utf-8?q?/Yxl0ec9I48wcFiD2dyoasngDXx1A5UDmnN1CJ/Sglz9BCUoz1MEiod0?= =?utf-8?q?9hZ7zZfnBKeBBxraPG/1raVGvYXx3bHdmKIc9GBIWDtGbFNG9AI8O32b?= =?utf-8?q?9kzPDA6AHnG6aZbwVy70wf3sj0GxPgDb8B74jXrOE/hsaCS8z2AcJZoF?= =?utf-8?q?zH5fLlGtspLJT+DF3H7p36Xk+iefcMJ0DefOUQPr2tckOGUKZ1+inwIm?= =?utf-8?q?8Xstt+SlqZDqEtnOpuMfTYSV+hxTN?= Content-ID: <0C510F9715584341B640A205305C7BC2@eurprd03.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: bang-olufsen.dk X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: VI1PR03MB3166.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7f1a74b5-3901-4856-7585-08d91091ae28 X-MS-Exchange-CrossTenant-originalarrivaltime: 06 May 2021 13:20:12.6246 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 210d08b8-83f7-470a-bc96-381193ca14a1 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: ELxSER4DAhk64H+OJlFwRhcNydhCIJKSUhobWKdmt2sMAPuWYCSkgHAucJqLS56BYof4GkLqMgAjQlHnol21/w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR03MB5135 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org The sinfo->chains field is a bitmask for filled values in chain_signal and chain_signal_avg, not a count. Treat it as such so that the driver can properly report per-chain RSSI information. Before (MIMO mode): $ iw dev wlan0 station dump ... signal: -51 [-51] dBm After (MIMO mode): $ iw dev wlan0 station dump ... signal: -53 [-53, -54] dBm Signed-off-by: Alvin Šipraga Fixes: cae355dc90db ("brcmfmac: Add RSSI information to get_station.") --- drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -- 2.31.1 diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c index f4405d7861b6..afa75cb83221 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c @@ -2838,6 +2838,7 @@ brcmf_cfg80211_get_station(struct wiphy *wiphy, struct net_device *ndev, count_rssi = 0; for (i = 0; i < BRCMF_ANT_MAX; i++) { if (sta_info_le.rssi[i]) { + sinfo->chains |= BIT(count_rssi); sinfo->chain_signal_avg[count_rssi] = sta_info_le.rssi[i]; sinfo->chain_signal[count_rssi] = @@ -2848,8 +2849,6 @@ brcmf_cfg80211_get_station(struct wiphy *wiphy, struct net_device *ndev, } if (count_rssi) { sinfo->filled |= BIT_ULL(NL80211_STA_INFO_CHAIN_SIGNAL); - sinfo->chains = count_rssi; - sinfo->filled |= BIT_ULL(NL80211_STA_INFO_SIGNAL); total_rssi /= count_rssi; sinfo->signal = total_rssi;