From patchwork Mon Feb 11 22:04:53 2019 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: 10806865 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 BDD5B6C2 for ; Mon, 11 Feb 2019 22:05:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AC6332AD32 for ; Mon, 11 Feb 2019 22:05:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9CA6C2B30C; Mon, 11 Feb 2019 22:05:09 +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 06C152AD32 for ; Mon, 11 Feb 2019 22:05:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727002AbfBKWFI (ORCPT ); Mon, 11 Feb 2019 17:05:08 -0500 Received: from mail-lf1-f65.google.com ([209.85.167.65]:37850 "EHLO mail-lf1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726358AbfBKWFH (ORCPT ); Mon, 11 Feb 2019 17:05:07 -0500 Received: by mail-lf1-f65.google.com with SMTP id n23so383249lfl.4 for ; Mon, 11 Feb 2019 14:05:06 -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=hDWTmWX4Vqb1TEK+OwX8F9WXle3xfnlvHcLiOquCVbI=; b=tqKbvAHW14lsTMKU5jS5ZRIcjylezbsFLtxQ2VvX4DOBwaiIYOXZ2T6S1blFN87DX7 XGtv//WWsx8IdaejvG7wzYov5QmCLsQocRvaACjIBEdYXPxe/D+hinllFwfuLxg4ZBfx 3e5PqdjgKinRIvFSMvJDi2ht08IXpHLCVoK0SL2T+z4iKXdWPCOW5+B2FH/4znqGA4ca OiTtI9Lws+JyLiA5QqbVZB+HRvgNunhyGjQiBK4zwkCiwCukQv/fZSjN18pbV7CkXNCi eRp2gTBnxXrJrZIod04eipKSO6B1xQPODPZABwlvm2+0xd4GACQRTYeoDvkAmYPyTS08 iuBg== 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=hDWTmWX4Vqb1TEK+OwX8F9WXle3xfnlvHcLiOquCVbI=; b=Qpy06tfLKAZzRqHY7F9oluof2DQwZH8Vqzu90rtAr1oa6h/kh1A4/ubgnwmqDPWiHM yPo5rAQ3SUNkodm+TmCfw2c2pfDxFYSs+fQ/tERsWaeunqdhfCb/+8Xi+6xpcl84lw+O aQMromCLk3hpSxVyA4ZMqshOnVDKc50oYZjBxakr08gNr9MZxHwuCZIvGtiIQX074kes VN+uOfmI/7Nw/f6sU6kmjep9FB1OzNYaBM6P6zQQdRZCBBrip5mDm81daQD9hJIy7QwD cSYA11yo/a7cAeIeU1dIQgHGpQd8InJq0Chq0l4cq6B4vGTUp/NNtiq9EJzpy6zgzBVX 29PA== X-Gm-Message-State: AHQUAuY5F80mYTB5iiLMET6e88TMIfNf0fkiGCxha3rTH3QAG71mV8VH IM56TNoBm+t4YiPQRtld5gk= X-Google-Smtp-Source: AHgI3IYkXhGWRcLNpBlgKKaasKo6hiXBvA1xqBmHYkZspiUqvCr04Hyeyun7+x9hEUf6KFnRTWs1Ug== X-Received: by 2002:ac2:4297:: with SMTP id m23mr233532lfh.141.1549922705415; Mon, 11 Feb 2019 14:05:05 -0800 (PST) Received: from elitebook.lan (ip-194-187-74-233.konfederacka.maverick.com.pl. [194.187.74.233]) by smtp.gmail.com with ESMTPSA id c19-v6sm2238875lja.82.2019.02.11.14.05.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Feb 2019 14:05:04 -0800 (PST) From: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= To: Kalle Valo Cc: Arend van Spriel , linux-wireless@vger.kernel.org, brcm80211-dev-list.pdl@broadcom.com, brcm80211-dev-list@cypress.com, =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= Subject: [PATCH 1/2] brcmfmac: improve code handling bandwidth of firmware reported channels Date: Mon, 11 Feb 2019 23:04:53 +0100 Message-Id: <20190211220454.19850-1-zajec5@gmail.com> X-Mailer: git-send-email 2.20.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 From: Rafał Miłecki 1) Use switch to simplify/improve the code & avoid some duplication 2) Add warning for unsupported values Signed-off-by: Rafał Miłecki --- .../wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c index b5e291ed9496..fa752ec04f22 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c @@ -6049,11 +6049,18 @@ static int brcmf_construct_chaninfo(struct brcmf_cfg80211_info *cfg, /* assuming the chanspecs order is HT20, * HT40 upper, HT40 lower, and VHT80. */ - if (ch.bw == BRCMU_CHAN_BW_80) { + switch (ch.bw) { + case BRCMU_CHAN_BW_80: channel->flags &= ~IEEE80211_CHAN_NO_80MHZ; - } else if (ch.bw == BRCMU_CHAN_BW_40) { + break; + case BRCMU_CHAN_BW_40: brcmf_update_bw40_channel_flag(channel, &ch); - } else { + break; + default: + wiphy_warn(wiphy, "Firmware reported unsupported bandwidth %d\n", + ch.bw); + /* fall through */ + case BRCMU_CHAN_BW_20: /* enable the channel and disable other bandwidths * for now as mentioned order assure they are enabled * for subsequent chanspecs. From patchwork Mon Feb 11 22:04:54 2019 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: 10806867 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 5F6D6746 for ; Mon, 11 Feb 2019 22:05:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4DA1A2AD32 for ; Mon, 11 Feb 2019 22:05:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3EC072B30C; Mon, 11 Feb 2019 22:05: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 E47B72AD32 for ; Mon, 11 Feb 2019 22:05:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727054AbfBKWFK (ORCPT ); Mon, 11 Feb 2019 17:05:10 -0500 Received: from mail-lf1-f66.google.com ([209.85.167.66]:38558 "EHLO mail-lf1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726358AbfBKWFJ (ORCPT ); Mon, 11 Feb 2019 17:05:09 -0500 Received: by mail-lf1-f66.google.com with SMTP id n15so378191lfe.5 for ; Mon, 11 Feb 2019 14:05:08 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=gh8tmjZJJrwcaBCD0SfNUWYtqzTSRUQtNCL4aak7XKE=; b=tHkT1X43n3fnevJAgR9DeQDkRKUMKCmGHu4u2V9S7tvtZLByU94bZ7COBg2FCzjtIK gri7x+0lIoqzqX/K3GJ7tDBoKjwXGNjE5flb29XqmttETNVYH1PYQlIxMCDCGQb1HKPk yMd6kzFDLK8YejA4rBFoN45DHMrLdOD+nR4LJem0HIm8JTDBjOyI7aHcG66WYRxdyFv3 KZo6Xpx3dkJ9Fq+jM8+JJNusmRSp/WaWzG72FG6eEfXJfWT1Ke2VTKXlc2V7bQKdEFlb KdER/dEPb0uKZrrTGw3/Yx7nTT07dfsqMx8irbiF6aFbU08SMTR3FwEdNMVTHp9d79ZW pKYw== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=gh8tmjZJJrwcaBCD0SfNUWYtqzTSRUQtNCL4aak7XKE=; b=k+ew+QbTNtisz89TtXvdNuFB3LBKQMgcqBVIjpmRHTMFH+uTtpVgkYaJKnpmuNj/hk UpIq6no/cEtbrsaBj400SbZz4QiYRwAwM41FFK/gtwYMwaR9g2SIf9nPtk61h8ROcyhe wO92Exmp6CSeyb1hfw1MpbSlDmf12ZJT8vyQb04affdsO+YmPqYa2ju8WVO8f5RNuoNe x4DSBLvhriEmTLN3D1Dnu2GJs7vMurWhmWT2ezyUz7frmPlqQ+ny0mevlvl6tXvqTLWJ NT2N7QvKGaecPemOP/G0wyMQYpVQcG3+eInohGrWGIb1Bi4f10doSG1ldIPx0KeY8wC1 2sRQ== X-Gm-Message-State: AHQUAuZjgHDNqpDntiFeVavVbc3iBYuMygtBN+JHANwz/4xUCKQD2C/3 mSAS0nVUVaFFUvdl2/37wwI= X-Google-Smtp-Source: AHgI3IbARwxDWUhNdNYRy7oX3eqWkoB05qHOJ/+tYlgJEEQNZ87M0tFtUM+JnwHzm4zOdxjYxoMwyg== X-Received: by 2002:a19:c942:: with SMTP id z63mr244461lff.162.1549922707635; Mon, 11 Feb 2019 14:05:07 -0800 (PST) Received: from elitebook.lan (ip-194-187-74-233.konfederacka.maverick.com.pl. [194.187.74.233]) by smtp.gmail.com with ESMTPSA id c19-v6sm2238875lja.82.2019.02.11.14.05.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Feb 2019 14:05:07 -0800 (PST) From: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= To: Kalle Valo Cc: Arend van Spriel , linux-wireless@vger.kernel.org, brcm80211-dev-list.pdl@broadcom.com, brcm80211-dev-list@cypress.com, =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= Subject: [PATCH 2/2] brcmfmac: support firmware reporting 160 MHz channels Date: Mon, 11 Feb 2019 23:04:54 +0100 Message-Id: <20190211220454.19850-2-zajec5@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190211220454.19850-1-zajec5@gmail.com> References: <20190211220454.19850-1-zajec5@gmail.com> 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 So far 160 MHz channels were treated as 20 MHz ones which was breaking support for 40/80 MHz due to the brcmf_construct_chaninfo() logic and its assumptions. Signed-off-by: Rafał Miłecki --- drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c index fa752ec04f22..b3611f0f68bf 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c @@ -6050,6 +6050,9 @@ static int brcmf_construct_chaninfo(struct brcmf_cfg80211_info *cfg, * HT40 upper, HT40 lower, and VHT80. */ switch (ch.bw) { + case BRCMU_CHAN_BW_160: + channel->flags &= ~IEEE80211_CHAN_NO_160MHZ; + break; case BRCMU_CHAN_BW_80: channel->flags &= ~IEEE80211_CHAN_NO_80MHZ; break;