From patchwork Thu Jun 28 10:36:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= X-Patchwork-Id: 10493539 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9C7106022E for ; Thu, 28 Jun 2018 10:38:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 89378299EF for ; Thu, 28 Jun 2018 10:38:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7D63429A34; Thu, 28 Jun 2018 10:38:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 10451299EF for ; Thu, 28 Jun 2018 10:38:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753203AbeF1Kiu (ORCPT ); Thu, 28 Jun 2018 06:38:50 -0400 Received: from mail-lf0-f68.google.com ([209.85.215.68]:45820 "EHLO mail-lf0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753019AbeF1Kis (ORCPT ); Thu, 28 Jun 2018 06:38:48 -0400 Received: by mail-lf0-f68.google.com with SMTP id m13-v6so3815188lfb.12 for ; Thu, 28 Jun 2018 03:38:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=m73GM0Er+m979lCIhmXADQtMBu5n926PAyXdsS48sF4=; b=sfJgwUuH0w7H2TYv32NJrE0ujrpaouEjcxDd7XO0ICSYoxbBpKupKg1yqG0pUluVKf q0jkqSGEXsNFkQJp9tCzdjd7epjqObdIJp9IqB6LtMk2QganIQbIVZu8t38oyeXi+2U8 Z4mQs4MM5zgSVcaQKTF19rOpJo8zMr9WQiF4ISxU//mCN90/3+dh8Wgh9y4r4yTyfvYK AoZmnOfk7Op873w/+1xdLhSOYWvNQzLVtzS17rxO0tswBJWRhHIbgykKoecJERuHUm5l Pevz4fxYICf80ptMqOx04SgudjhTVm/LbP7pcR/kb6Gjn7xefSIcrluZBmcmZlzn6u8/ LB6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=m73GM0Er+m979lCIhmXADQtMBu5n926PAyXdsS48sF4=; b=Ob8riTgE2OdAIp2rRBNPDYQKC3GCdK++7VnmUnWrbMALsnezViyoV8K2Ej1ZbE/xV2 awJGATO+evOP340P1TGOkGb7erRGi+wSsELqVZr3s2q7SGcGdhkxikuihpFgO2IVPL6D AbMZNfPERYLD4War+7PmaDo0jv86PYmtL74CBj4KfgoHFI8xq9eWPcT/vqvWwSe6xU6p rEopwbqAwLx4AsH0b6aWQRrTG//QtOptX1ilqR9q0n9SCWiXua+9bVYhTy4JeSA/2dYG Ku6RqV3YEnko1Tyxsi6tMaMSIJCIXLZq2EOMfvNu28HldHix0ZA3s31zjyNkXp2nrDtX AGqg== X-Gm-Message-State: APt69E1THGD71q/GRQAgb+wzecvQlIxWXMseq71WDuG58KVYrRhTWjnX s74U5nvjWCmUr+fT+3Fm490= X-Google-Smtp-Source: AAOMgpdDAlh6JvOhSXGdFPhehn9/QKTn48F+ZT2wA3sBJsk6510elNkWvT5Y/bEESUbahM5fMa6abA== X-Received: by 2002:a19:d0:: with SMTP id 199-v6mr4432834lfa.69.1530182326968; Thu, 28 Jun 2018 03:38:46 -0700 (PDT) Received: from linux-veee.lan (ip-194-187-74-233.konfederacka.maverick.com.pl. [194.187.74.233]) by smtp.gmail.com with ESMTPSA id j22-v6sm1072652ljh.0.2018.06.28.03.38.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 28 Jun 2018 03:38:45 -0700 (PDT) From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= To: Kalle Valo , Arend van Spriel Cc: Franky Lin , Hante Meuleman , Chi-Hsien Lin , Wright Feng , Pieter-Paul Giesberts , Chung-Hsien Hsu , linux-wireless@vger.kernel.org, brcm80211-dev-list.pdl@broadcom.com, brcm80211-dev-list@cypress.com, =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Subject: [PATCH] brcmfmac: update STA info struct to the v5 Date: Thu, 28 Jun 2018 12:36:23 +0200 Message-Id: <20180628103623.29103-1-zajec5@gmail.com> X-Mailer: git-send-email 2.13.7 MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Rafał Miłecki That struct is used when querying firmware for the STA. It seem is has been changing during the time. Luckily its format seems to be backward compatible starting with v2 (the only breakage was v1 -> v2). The version that was supported by brcmfmac so far was v4. It was what 43602a1 and 4366b1 firmwares (7.35.177.56 and 10.10.69.3309 accordingly) were using. It also seems to be used by early 4366c0 firmwares (10.10.69.6908 and 10.10.69.69017). The problem appears when switching to the 10.10.122.20 firmware. It uses v5 and instead of falling back to v4 when submitted buffer isn't big enough it fallbacks to the v3. To receive all v4 specific info with the newest firmware we have to submit a struct (buffer) that matches v5. Signed-off-by: Rafał Miłecki Acked-by: Arend van Spriel --- .../net/wireless/broadcom/brcm80211/brcmfmac/fwil_types.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil_types.h b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil_types.h index 9b3a58e89dd1..d5bb81e88762 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil_types.h +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil_types.h @@ -174,6 +174,8 @@ #define BRCMF_MFP_CAPABLE 1 #define BRCMF_MFP_REQUIRED 2 +#define BRCMF_VHT_CAP_MCS_MAP_NSS_MAX 8 + /* MAX_CHUNK_LEN is the maximum length for data passing to firmware in each * ioctl. It is relatively small because firmware has small maximum size input * playload restriction for ioctls. @@ -550,6 +552,8 @@ struct brcmf_sta_info_le { /* w/hi bit set if basic */ __le32 in; /* seconds elapsed since associated */ __le32 listen_interval_inms; /* Min Listen interval in ms for STA */ + + /* Fields valid for ver >= 3 */ __le32 tx_pkts; /* # of packets transmitted */ __le32 tx_failures; /* # of packets failed */ __le32 rx_ucast_pkts; /* # of unicast packets received */ @@ -558,6 +562,8 @@ struct brcmf_sta_info_le { __le32 rx_rate; /* Rate of last successful rx frame */ __le32 rx_decrypt_succeeds; /* # of packet decrypted successfully */ __le32 rx_decrypt_failures; /* # of packet decrypted failed */ + + /* Fields valid for ver >= 4 */ __le32 tx_tot_pkts; /* # of tx pkts (ucast + mcast) */ __le32 rx_tot_pkts; /* # of data packets recvd (uni + mcast) */ __le32 tx_mcast_pkts; /* # of mcast pkts txed */ @@ -594,6 +600,14 @@ struct brcmf_sta_info_le { */ __le32 rx_pkts_retried; /* # rx with retry bit set */ __le32 tx_rate_fallback; /* lowest fallback TX rate */ + + /* Fields valid for ver >= 5 */ + struct { + __le32 count; /* # rates in this set */ + u8 rates[BRCMF_MAXRATES_IN_SET]; /* rates in 500kbps units w/hi bit set if basic */ + u8 mcs[BRCMF_MCSSET_LEN]; /* supported mcs index bit map */ + __le16 vht_mcs[BRCMF_VHT_CAP_MCS_MAP_NSS_MAX]; /* supported mcs index bit map per nss */ + } rateset_adv; }; struct brcmf_chanspec_list {