From patchwork Tue May 22 13:18:34 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: 10418645 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 C388460545 for ; Tue, 22 May 2018 13:20:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B39F028CCE for ; Tue, 22 May 2018 13:20:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B22A128CE2; Tue, 22 May 2018 13:20:33 +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 D13F928CCE for ; Tue, 22 May 2018 13:20:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751311AbeEVNUJ (ORCPT ); Tue, 22 May 2018 09:20:09 -0400 Received: from mail-wr0-f194.google.com ([209.85.128.194]:38330 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751036AbeEVNUI (ORCPT ); Tue, 22 May 2018 09:20:08 -0400 Received: by mail-wr0-f194.google.com with SMTP id 94-v6so20134386wrf.5 for ; Tue, 22 May 2018 06:20:07 -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=9yygHg9LcKxLCix/lWPpVEyl+5nMzKybufazkERw+7I=; b=JezgVDO9k6VJVOOn5f/iWPX96GM+JTH4aDNL4uKcfYNYoxPmB7VthLJqlN6CGCHhlR c1fi5uE15ygsxfeBzyu4IwjzlnOFGnv+ouz3fvMJtCTxVvxBpoh6vstkaNEyCOIApord 0sc9/8O0IXHTUcsThI/BBRpZ1/AoYENtUkn5rOqME3UHu7DRD6MsHNstMAq3IXmp/qpA ml7OVj1HyibCJ4RsS5WvnXYUfSYBpEKwTOCkZxQ6HAPgNqPq9ovQJtSGrU7pWqkIX3GL sVXpFukh0fb/4bKSTIROmIYu1OK70VV1jpb9r7huk+XVywsGi+MfAcYrkdpGKqhtweSA zspw== 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=9yygHg9LcKxLCix/lWPpVEyl+5nMzKybufazkERw+7I=; b=Ps8dpUOhBaeuXeomNw0vFmsDRI/rrcMYQuLphfNWRPJfNPkcS7lhFqDmwZ7fmUX+ty sMCW57KVVoLm9kQizQQy8Mx8rA6QHNB+/ZISq1XJG6y7pwIugsIg837jNXciVsYQpXlx sVZCj+guqvvB322WtNw4B5eSHBhWbJ/U2jNa5mZU414afXk+r73SeGs4QMBxK7GkXqwQ Kl4oNZLMUdI+zITpfLQ6LkxTETjhZFLT32kN7vFoN6xDPmEza+Wms+p7odJ+CjxZOs1I RMi1eTLACtSLjbUjiB5IFDkNPR3UccBFu6IfR1IDpWMhOdy2pT+T3wyN6b3biSvmEGN0 Fv4Q== X-Gm-Message-State: ALKqPwczn6tw5CtvjkzVDJSvqW+WM1nDn9Eu5TCR8iRZrrDiP/4un9wz Yq6POZCa83RYUYUHZDiUZKY= X-Google-Smtp-Source: AB8JxZocrM4RLj9JgWaxTbWlAsx7pspI2a1Qlc9KQuXwYXnyQuMyeDguHP8Ei5OKx/qFFTTi1fYQzA== X-Received: by 2002:a19:8f8a:: with SMTP id s10-v6mr31603444lfk.47.1526995206903; Tue, 22 May 2018 06:20:06 -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 t4-v6sm3977752lff.48.2018.05.22.06.20.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 22 May 2018 06:20:06 -0700 (PDT) From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= To: Kalle Valo Cc: Arend van Spriel , 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 1/3] brcmfmac: allow specifying features per firmware version Date: Tue, 22 May 2018 15:18:34 +0200 Message-Id: <20180522131836.26858-1-zajec5@gmail.com> X-Mailer: git-send-email 2.13.6 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 Some features supported by firmware aren't advertised and there is no way for a driver to query them. This includes e.g. monitor mode details. Some firmwares support tagging monitor frames, some build radiotap header but there is no way to detect it. This commit adds table that will allow specifying features like: { "01-abcdef01", BIT(BRCMF_FEAT_FOO) } Signed-off-by: Rafał Miłecki --- .../wireless/broadcom/brcm80211/brcmfmac/feature.c | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.c index 876731c57bf5..1194d31d3902 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.c @@ -91,6 +91,28 @@ static int brcmf_feat_debugfs_read(struct seq_file *seq, void *data) } #endif /* DEBUG */ +struct brcmf_feat_fwfeat { + const char * const fwid; + u32 flags; +}; + +static const struct brcmf_feat_fwfeat brcmf_feat_fwfeat_map[] = { +}; + +static void brcmf_feat_firmware_features(struct brcmf_pub *pub) +{ + const struct brcmf_feat_fwfeat *e; + int i; + + for (i = 0; i < ARRAY_SIZE(brcmf_feat_fwfeat_map); i++) { + e = &brcmf_feat_fwfeat_map[i]; + if (!strcmp(e->fwid, pub->fwver)) { + pub->feat_flags |= e->flags; + break; + } + } +} + /** * brcmf_feat_iovar_int_get() - determine feature through iovar query. * @@ -216,6 +238,8 @@ void brcmf_feat_attach(struct brcmf_pub *drvr) } brcmf_feat_iovar_int_get(ifp, BRCMF_FEAT_FWSUP, "sup_wpa"); + brcmf_feat_firmware_features(drvr); + /* set chip related quirks */ switch (drvr->bus_if->chip) { case BRCM_CC_43236_CHIP_ID: