From patchwork Fri Nov 9 16:38:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Dan Haab X-Patchwork-Id: 10676321 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-2.web.codeaurora.org (Postfix) with ESMTP id D5CBE14E2 for ; Fri, 9 Nov 2018 16:38:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C44212EECC for ; Fri, 9 Nov 2018 16:38:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B730A2EED6; Fri, 9 Nov 2018 16:38:11 +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 359B92EECC for ; Fri, 9 Nov 2018 16:38:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728424AbeKJCT3 (ORCPT ); Fri, 9 Nov 2018 21:19:29 -0500 Received: from mail-pf1-f195.google.com ([209.85.210.195]:33251 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727955AbeKJCT3 (ORCPT ); Fri, 9 Nov 2018 21:19:29 -0500 Received: by mail-pf1-f195.google.com with SMTP id v68-v6so1170477pfk.0 for ; Fri, 09 Nov 2018 08:38:09 -0800 (PST) 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=gGckfnoExzxWsSqFCpZLbKKIXo48NwKkb3kHmy2WQI4=; b=n4aq0hhXCsQGfXFRwSiTdt+likhjdcZrmyG71j+59wrllKxZmLNxrpaol82k2BVQeX ZOBrIQ6VbwzrpQAqvxournzCUx3LT/1HKFb9zzDCVUQhRqTmiEVaoiNwC6oTnSCSh894 /j4BuZnWLjJRRwmiv5hjs2ySbdvSIkm3YR8uq29MBarrhRD8zwYzHZIHwLUORFQalVjh EV3TtyWAGPi0TAMq7wgUvFqDv03GRvoX0yEfPMTAl8aTK/PluDFaCntSK8yaLkrdb4x1 BNJkjy7HYqYOh5pb22DFv5cD6wc9VBPBRMxnPL97Oz4NyPlGdcXMhTndKnEYJMQomzHM 9FPA== 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=gGckfnoExzxWsSqFCpZLbKKIXo48NwKkb3kHmy2WQI4=; b=L+daZ4jvGCjam9Ubh4ga3FRATouYZHHNtSewaQ8QT/a8NlLGqvN1+Pov3NF3AbkmWW FFIbB/D5adjowN/wccPW7XfOr1WwbJU7u5gdfQGeXDYpWD90BDbScxPUtkhR2KBOP3hb 6Zfpo4PpHnjz9VZiRwMpsyXyZ185Tbi1D4OAsstSmDnllnpYW30okfTIw7MCHNqgzkcn 9oK7hyf7xIv7mCceJUPqWBcyeBO0JSYR912UIht/9SNN2W6KQrhLGO2bgCsrG1iDPPYG 8Jlh6PCW/VLK4/s9pz3nqMc7KHwltNNx4Ez1eLnJ/yBKJ+mfk8VidlIm0IO0oUBtC6ow WkJQ== X-Gm-Message-State: AGRZ1gLVJ3UwzdEth+NmWTYe78P2YE0DdN2+Ih/aGv2v6J4qnTwHIjSF 5Lges/5lTgHCORk7Hp2YZs4= X-Google-Smtp-Source: AJdET5d26BtNhuBv9Q8Znj2c29sEXb71p/gpgvJwxs2kGQ6z/eRxem7TDSOSvrRZcq7XhxoL9Kl2mA== X-Received: by 2002:a63:fc49:: with SMTP id r9mr7875252pgk.209.1541781488919; Fri, 09 Nov 2018 08:38:08 -0800 (PST) Received: from localhost.localdomain ([67.139.187.132]) by smtp.gmail.com with ESMTPSA id y144-v6sm12507686pfb.81.2018.11.09.08.38.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 09 Nov 2018 08:38:08 -0800 (PST) From: Dan Haab X-Google-Original-From: Dan Haab To: Kalle Valo Cc: Arend van Spriel , Franky Lin , Hante Meuleman , Chi-Hsien Lin , Wright Feng , "David S. Miller" , =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= , Chung-Hsien Hsu , linux-wireless@vger.kernel.org, brcm80211-dev-list.pdl@broadcom.com, brcm80211-dev-list@cypress.com, Dan Haab Subject: [PATCH v2] brcmfmac: support STA info struct v7 Date: Fri, 9 Nov 2018 09:38:55 -0700 Message-Id: <1541781535-10523-1-git-send-email-dan.haab@luxul.com> X-Mailer: git-send-email 1.9.1 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 The newest firmwares provide STA info using v7 of the struct. As v7 isn't backward compatible, a union is needed. Even though brcmfmac does not use any of the new info it's important to provide the proper struct buffer. Without this change new firmwares will fallback to the very limited v3 instead of something in between such as v4. Signed-off-by: Dan Haab Reviewed-by: Rafał Miłecki Reviewed-by: Arend van Spriel --- .../broadcom/brcm80211/brcmfmac/fwil_types.h | 40 ++++++++++++++++++---- 1 file changed, 33 insertions(+), 7 deletions(-) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil_types.h b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil_types.h index d5bb81e..39ac1bb 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil_types.h +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil_types.h @@ -176,6 +176,8 @@ #define BRCMF_VHT_CAP_MCS_MAP_NSS_MAX 8 +#define BRCMF_HE_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. @@ -601,13 +603,37 @@ 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; + union { + struct { + 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; + } v5; + + struct { + __le32 rx_dur_total; /* total user RX duration (estimated) */ + __le16 chanspec; /** chanspec this sta is on */ + __le16 pad_1; + struct { + __le16 version; /* version */ + __le16 len; /* length */ + __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 */ + __le16 he_mcs[BRCMF_HE_CAP_MCS_MAP_NSS_MAX]; /* supported he mcs index bit map per nss */ + } rateset_adv; /* rateset along with mcs index bitmap */ + __le16 wpauth; /* authentication type */ + u8 algo; /* crypto algorithm */ + u8 pad_2; + __le32 tx_rspec; /* Rate of last successful tx frame */ + __le32 rx_rspec; /* Rate of last successful rx frame */ + __le32 wnm_cap; /* wnm capabilities */ + } v7; + }; }; struct brcmf_chanspec_list {