From fc5765678f582700c8e557786784e71269409f99 Mon Sep 17 00:00:00 2001 From: hyphop Date: Wed, 18 Dec 2019 18:28:56 +0900 Subject: [PATCH] Wed Dec 18 18:28:56 +09 2019 --- patches/wifi2/.info.txt | 3 + ...-D11-cores-if-chip-has-two-D11-cores.patch | 232 +++++++++++++++++ ...-F2-blocksize-and-watermark-for-4359.patch | 188 ++++++++++++++ ...-3-9-brcmfmac-fix-rambase-for-4359-9.patch | 137 ++++++++++ ...setting-roaming-parameters-non-fatal.patch | 146 +++++++++++ ...add-support-for-BCM4359-SDIO-chipset.patch | 186 ++++++++++++++ ...-when-setting-interface-combinations.patch | 236 ++++++++++++++++++ ...if-if-firmware-does-not-support-MBSS.patch | 144 +++++++++++ scripts/auto_krescue | 2 +- scripts/auto_openwrt | 3 +- scripts/auto_openwrt_next | 26 ++ 11 files changed, 1301 insertions(+), 2 deletions(-) create mode 100644 patches/wifi2/.info.txt create mode 100644 patches/wifi2/v2-1-9-brcmfmac-reset-two-D11-cores-if-chip-has-two-D11-cores.patch create mode 100644 patches/wifi2/v2-2-9-brcmfmac-set-F2-blocksize-and-watermark-for-4359.patch create mode 100644 patches/wifi2/v2-3-9-brcmfmac-fix-rambase-for-4359-9.patch create mode 100644 patches/wifi2/v2-4-9-brcmfmac-make-errors-when-setting-roaming-parameters-non-fatal.patch create mode 100644 patches/wifi2/v2-5-9-brcmfmac-add-support-for-BCM4359-SDIO-chipset.patch create mode 100644 patches/wifi2/v2-6-9-brcmfmac-add-RSDB-condition-when-setting-interface-combinations.patch create mode 100644 patches/wifi2/v2-7-9-brcmfmac-not-set-mbss-in-vif-if-firmware-does-not-support-MBSS.patch create mode 100755 scripts/auto_openwrt_next diff --git a/patches/wifi2/.info.txt b/patches/wifi2/.info.txt new file mode 100644 index 0000000..dd71523 --- /dev/null +++ b/patches/wifi2/.info.txt @@ -0,0 +1,3 @@ +https://patchwork.kernel.org/project/linux-wireless/list/?series=215429 +https://forum.khadas.com/t/wifi-ap6398s-mainline-kernel/4929/31 + diff --git a/patches/wifi2/v2-1-9-brcmfmac-reset-two-D11-cores-if-chip-has-two-D11-cores.patch b/patches/wifi2/v2-1-9-brcmfmac-reset-two-D11-cores-if-chip-has-two-D11-cores.patch new file mode 100644 index 0000000..a75bbe8 --- /dev/null +++ b/patches/wifi2/v2-1-9-brcmfmac-reset-two-D11-cores-if-chip-has-two-D11-cores.patch @@ -0,0 +1,232 @@ +From patchwork Wed Dec 11 23:52:45 2019 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +X-Patchwork-Submitter: Soeren Moch +X-Patchwork-Id: 11286565 +X-Patchwork-Delegate: kvalo@adurom.com +Return-Path: +Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org + [172.30.200.123]) + by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 26CBE138D + for ; + Wed, 11 Dec 2019 23:54:02 +0000 (UTC) +Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) + by mail.kernel.org (Postfix) with ESMTP id EFD3321655 + for ; + Wed, 11 Dec 2019 23:54:01 +0000 (UTC) +Authentication-Results: mail.kernel.org; + dkim=pass (1024-bit key) header.d=web.de header.i=@web.de header.b="OZLDxo+Y" +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1727238AbfLKXx3 (ORCPT + ); + Wed, 11 Dec 2019 18:53:29 -0500 +Received: from mout.web.de ([217.72.192.78]:59813 "EHLO mout.web.de" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S1727199AbfLKXx1 (ORCPT ); + Wed, 11 Dec 2019 18:53:27 -0500 +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; + s=dbaedf251592; t=1576108388; + bh=QrCQqilrTouTgYj7yPQjXnTFJOK16++5KJ6q9dqCzuQ=; + h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; + b=OZLDxo+YhfcGWOq2ZjW1XGmkZRwtMEa9B9St7EgXLEOMeHEizbtlijhXFLk/N0qoz + 1+fJdbnjKSi2k+kVhlRJ+Ddd/mmBmYMibz10dF+1OBg6WKTPhoSbiod9KOofyA948D + emoZkjekJmVExY4VLQIVrf0OqIDqpZSxTWz1g1NQ= +X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 +Received: from localhost.localdomain ([89.204.139.166]) by smtp.web.de + (mrweb101 [213.165.67.124]) with ESMTPSA (Nemesis) id + 0MRl5x-1iGpH02iS1-00SxXf; Thu, 12 Dec 2019 00:53:07 +0100 +From: Soeren Moch +To: Kalle Valo , Heiko Stuebner +Cc: Wright Feng , Soeren Moch , + Arend van Spriel , + Franky Lin , + Hante Meuleman , + Chi-Hsien Lin , + linux-wireless@vger.kernel.org, + brcm80211-dev-list.pdl@broadcom.com, + brcm80211-dev-list@cypress.com, netdev@vger.kernel.org, + linux-arm-kernel@lists.infradead.org, + linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org +Subject: [PATCH v2 1/9] brcmfmac: reset two D11 cores if chip has two D11 + cores +Date: Thu, 12 Dec 2019 00:52:45 +0100 +Message-Id: <20191211235253.2539-2-smoch@web.de> +X-Mailer: git-send-email 2.17.1 +In-Reply-To: <20191211235253.2539-1-smoch@web.de> +References: <20191211235253.2539-1-smoch@web.de> +MIME-Version: 1.0 +X-Provags-ID: V03:K1:Us4gcuk0RbKR4HQNOPkL/oiRL4tAdmkHERdAxq/8Wll6xa5unY6 + vc4ERbkOO1hBhlxdSovkzPZ9KF6ywGdKRjYa7y55CjUt/ifWRWTIps60cr3cl9ahlVyaxpL + Nq2iiB7gOeo62Y4PROt4/1e7GCvb4gO+errOwi4IcUJX42eqY0n9VdPINUEI8dW7lXJf2ye + Y8lk7+vzq15It0JcqoSFg== +X-Spam-Flag: NO +X-UI-Out-Filterresults: notjunk:1;V03:K0:+88Ev/9dDg4=:z2IeWqdpeb4UiDzDXawSBY + aGmsNDovtHG8mwxFuNhrq9OyZ/gU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foIPRhQRFG + uqCE/eToDktOZ1czy6n/wQyM3yTWFH5zu0gr54Gu5MHpHv4hx3A0M+uVM+9lzeLaHI9ore98M + fDZU3r2s0muCJ7UC1rNn+e+zQ5ZQAPnzrQUADrdWJaJdtexNlcig2I+VuvRxnFLfTwFgXq1t9 + di3sCBWONCqTgyshjaj1kaT2cFCc/oDCh/9NYVQ== +Sender: linux-wireless-owner@vger.kernel.org +Precedence: bulk +List-ID: +X-Mailing-List: linux-wireless@vger.kernel.org + +From: Wright Feng + +There are two D11 cores in RSDB chips like 4359. We have to reset two +D11 cores simutaneously before firmware download, or the firmware may +not be initialized correctly and cause "fw initialized failed" error. + +Signed-off-by: Wright Feng +Signed-off-by: Soeren Moch +Reviewed-by: Chi-Hsien Lin +--- +changes in v2: +- add missing s-o-b +- add review tag received for v1 + +Cc: Kalle Valo +Cc: Heiko Stuebner +Cc: Arend van Spriel +Cc: Franky Lin +Cc: Hante Meuleman +Cc: Chi-Hsien Lin +Cc: Wright Feng +Cc: linux-wireless@vger.kernel.org +Cc: brcm80211-dev-list.pdl@broadcom.com +Cc: brcm80211-dev-list@cypress.com +Cc: netdev@vger.kernel.org +Cc: linux-arm-kernel@lists.infradead.org +Cc: linux-rockchip@lists.infradead.org +Cc: linux-kernel@vger.kernel.org +--- + .../broadcom/brcm80211/brcmfmac/chip.c | 50 +++++++++++++++++++ + .../broadcom/brcm80211/brcmfmac/chip.h | 1 + + .../broadcom/brcm80211/brcmfmac/pcie.c | 2 +- + 3 files changed, 52 insertions(+), 1 deletion(-) + +-- +2.17.1 + +diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c +index a795d781b4c5..0b5fbe5d8270 100644 +--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c ++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c +@@ -433,11 +433,25 @@ static void brcmf_chip_ai_resetcore(struct brcmf_core_priv *core, u32 prereset, + { + struct brcmf_chip_priv *ci; + int count; ++ struct brcmf_core *d11core2 = NULL; ++ struct brcmf_core_priv *d11priv2 = NULL; + + ci = core->chip; + ++ /* special handle two D11 cores reset */ ++ if (core->pub.id == BCMA_CORE_80211) { ++ d11core2 = brcmf_chip_get_d11core(&ci->pub, 1); ++ if (d11core2) { ++ brcmf_dbg(INFO, "found two d11 cores, reset both\n"); ++ d11priv2 = container_of(d11core2, ++ struct brcmf_core_priv, pub); ++ } ++ } ++ + /* must disable first to work for arbitrary current core state */ + brcmf_chip_ai_coredisable(core, prereset, reset); ++ if (d11priv2) ++ brcmf_chip_ai_coredisable(d11priv2, prereset, reset); + + count = 0; + while (ci->ops->read32(ci->ctx, core->wrapbase + BCMA_RESET_CTL) & +@@ -449,9 +463,30 @@ static void brcmf_chip_ai_resetcore(struct brcmf_core_priv *core, u32 prereset, + usleep_range(40, 60); + } + ++ if (d11priv2) { ++ count = 0; ++ while (ci->ops->read32(ci->ctx, ++ d11priv2->wrapbase + BCMA_RESET_CTL) & ++ BCMA_RESET_CTL_RESET) { ++ ci->ops->write32(ci->ctx, ++ d11priv2->wrapbase + BCMA_RESET_CTL, ++ 0); ++ count++; ++ if (count > 50) ++ break; ++ usleep_range(40, 60); ++ } ++ } ++ + ci->ops->write32(ci->ctx, core->wrapbase + BCMA_IOCTL, + postreset | BCMA_IOCTL_CLK); + ci->ops->read32(ci->ctx, core->wrapbase + BCMA_IOCTL); ++ ++ if (d11priv2) { ++ ci->ops->write32(ci->ctx, d11priv2->wrapbase + BCMA_IOCTL, ++ postreset | BCMA_IOCTL_CLK); ++ ci->ops->read32(ci->ctx, d11priv2->wrapbase + BCMA_IOCTL); ++ } + } + + char *brcmf_chip_name(u32 id, u32 rev, char *buf, uint len) +@@ -1109,6 +1144,21 @@ void brcmf_chip_detach(struct brcmf_chip *pub) + kfree(chip); + } + ++struct brcmf_core *brcmf_chip_get_d11core(struct brcmf_chip *pub, u8 unit) ++{ ++ struct brcmf_chip_priv *chip; ++ struct brcmf_core_priv *core; ++ ++ chip = container_of(pub, struct brcmf_chip_priv, pub); ++ list_for_each_entry(core, &chip->cores, list) { ++ if (core->pub.id == BCMA_CORE_80211) { ++ if (unit-- == 0) ++ return &core->pub; ++ } ++ } ++ return NULL; ++} ++ + struct brcmf_core *brcmf_chip_get_core(struct brcmf_chip *pub, u16 coreid) + { + struct brcmf_chip_priv *chip; +diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.h b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.h +index 7b00f6a59e89..8fa38658e727 100644 +--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.h ++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.h +@@ -74,6 +74,7 @@ struct brcmf_chip *brcmf_chip_attach(void *ctx, + const struct brcmf_buscore_ops *ops); + void brcmf_chip_detach(struct brcmf_chip *chip); + struct brcmf_core *brcmf_chip_get_core(struct brcmf_chip *chip, u16 coreid); ++struct brcmf_core *brcmf_chip_get_d11core(struct brcmf_chip *pub, u8 unit); + struct brcmf_core *brcmf_chip_get_chipcommon(struct brcmf_chip *chip); + struct brcmf_core *brcmf_chip_get_pmu(struct brcmf_chip *pub); + bool brcmf_chip_iscoreup(struct brcmf_core *core); +diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c +index f64ce5074a55..7ac72804e285 100644 +--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c ++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c +@@ -78,7 +78,7 @@ static const struct brcmf_firmware_mapping brcmf_pcie_fwnames[] = { + BRCMF_FW_ENTRY(BRCM_CC_4371_CHIP_ID, 0xFFFFFFFF, 4371), + }; + +-#define BRCMF_PCIE_FW_UP_TIMEOUT 2000 /* msec */ ++#define BRCMF_PCIE_FW_UP_TIMEOUT 5000 /* msec */ + + #define BRCMF_PCIE_REG_MAP_SIZE (32 * 1024) + diff --git a/patches/wifi2/v2-2-9-brcmfmac-set-F2-blocksize-and-watermark-for-4359.patch b/patches/wifi2/v2-2-9-brcmfmac-set-F2-blocksize-and-watermark-for-4359.patch new file mode 100644 index 0000000..f1555a7 --- /dev/null +++ b/patches/wifi2/v2-2-9-brcmfmac-set-F2-blocksize-and-watermark-for-4359.patch @@ -0,0 +1,188 @@ +From patchwork Wed Dec 11 23:52:46 2019 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +X-Patchwork-Submitter: Soeren Moch +X-Patchwork-Id: 11286559 +X-Patchwork-Delegate: kvalo@adurom.com +Return-Path: +Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org + [172.30.200.123]) + by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A0DA4138D + for ; + Wed, 11 Dec 2019 23:53:50 +0000 (UTC) +Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) + by mail.kernel.org (Postfix) with ESMTP id 759E320578 + for ; + Wed, 11 Dec 2019 23:53:50 +0000 (UTC) +Authentication-Results: mail.kernel.org; + dkim=pass (1024-bit key) header.d=web.de header.i=@web.de header.b="QHfjrJCv" +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1727335AbfLKXxq (ORCPT + ); + Wed, 11 Dec 2019 18:53:46 -0500 +Received: from mout.web.de ([212.227.17.11]:36427 "EHLO mout.web.de" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S1727226AbfLKXxb (ORCPT ); + Wed, 11 Dec 2019 18:53:31 -0500 +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; + s=dbaedf251592; t=1576108389; + bh=Jw3d/3FG5d2fs3pbP5cmR9tz+imTkB9FfgldNiz16/M=; + h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; + b=QHfjrJCvhmuCCnSf1F/RiTE3u7NdGsOyiro4sUDoDIQ+BV6PzAODPhHh1Cl7rbGB8 + 8g2zq0CxIlQxFOZ0mVoVjj+Q1dN150ZDpr5DsCsqGUV2gw/Iy4detaBikD0SXnkeal + jfU6VBuWfOIv7zxNJOfScJziWrGpu8ob2L2xUIF0= +X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 +Received: from localhost.localdomain ([89.204.139.166]) by smtp.web.de + (mrweb101 [213.165.67.124]) with ESMTPSA (Nemesis) id + 0Mhlmh-1iJYJC0mhf-00MwBd; Thu, 12 Dec 2019 00:53:09 +0100 +From: Soeren Moch +To: Kalle Valo , Heiko Stuebner +Cc: Chung-Hsien Hsu , + Soeren Moch , + Arend van Spriel , + Franky Lin , + Hante Meuleman , + Chi-Hsien Lin , + Wright Feng , + linux-wireless@vger.kernel.org, + brcm80211-dev-list.pdl@broadcom.com, + brcm80211-dev-list@cypress.com, netdev@vger.kernel.org, + linux-arm-kernel@lists.infradead.org, + linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org +Subject: [PATCH v2 2/9] brcmfmac: set F2 blocksize and watermark for 4359 +Date: Thu, 12 Dec 2019 00:52:46 +0100 +Message-Id: <20191211235253.2539-3-smoch@web.de> +X-Mailer: git-send-email 2.17.1 +In-Reply-To: <20191211235253.2539-1-smoch@web.de> +References: <20191211235253.2539-1-smoch@web.de> +MIME-Version: 1.0 +X-Provags-ID: V03:K1:vMAckOgNBxG6cLi2IX3dVxNnAjzrN9nQcd36iOgEGjn7lSyOXK0 + nMmPQF96FpuS9n/OnUjpHNPcWxW8ctz5fO3ibNoNVUPj3EW+6zvheCwlxSOOoWs2gDf+gmY + p4EirClUV1rcJdk7pgxNeOvTWz8mX1eiqcst5vCJFqdAHlgxEYhaMFLTEBK2i2tiRaxBzO3 + pyg4nxvbZPxpAHrGgvnZQ== +X-Spam-Flag: NO +X-UI-Out-Filterresults: notjunk:1;V03:K0:Jm6PikBj8do=:bhZOh8ji0Cm3PXLd8vpAhB + c7KT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Yq2FaymEsO0tKpr+J5FMbsC7lPoPoVKvq3FfHUFDbWfyz/j08 + YcpsQ05Po3tDeao9xyk0cO2kZ2kA25ic2TeifPRDQow9ogTTTSYhJCrREBtQ3wljTE9g0MG0L + 9N2Rw16Oitu46gwY4aR3zUIlM6itQMAuZF1Imj1Zrbj2dk1Ha00y/U9Id/PqaUSR1JB4ifYan + N5MNtNk3cmZwBbpmRKtsp9azFnviVwGUl/Yy3vw== +Sender: linux-wireless-owner@vger.kernel.org +Precedence: bulk +List-ID: +X-Mailing-List: linux-wireless@vger.kernel.org + +From: Chung-Hsien Hsu + +Set F2 blocksize to 256 bytes and watermark to 0x40 for 4359. Also +enable and configure F1 MesBusyCtrl. It fixes DMA error while having +UDP bi-directional traffic. + +Signed-off-by: Chung-Hsien Hsu +[slightly adapted for rebase on mainline linux] +Signed-off-by: Soeren Moch +Reviewed-by: Chi-Hsien Lin +--- +changes in v2: +- add review tag received for v1 + +Cc: Kalle Valo +Cc: Heiko Stuebner +Cc: Arend van Spriel +Cc: Franky Lin +Cc: Hante Meuleman +Cc: Chi-Hsien Lin +Cc: Wright Feng +Cc: linux-wireless@vger.kernel.org +Cc: brcm80211-dev-list.pdl@broadcom.com +Cc: brcm80211-dev-list@cypress.com +Cc: netdev@vger.kernel.org +Cc: linux-arm-kernel@lists.infradead.org +Cc: linux-rockchip@lists.infradead.org +Cc: linux-kernel@vger.kernel.org +--- + .../wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 6 +++++- + .../wireless/broadcom/brcm80211/brcmfmac/sdio.c | 15 +++++++++++++++ + 2 files changed, 20 insertions(+), 1 deletion(-) + +-- +2.17.1 + +diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c +index 96fd8e2bf773..68baf0189305 100644 +--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c ++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c +@@ -43,6 +43,7 @@ + + #define SDIO_FUNC1_BLOCKSIZE 64 + #define SDIO_FUNC2_BLOCKSIZE 512 ++#define SDIO_4359_FUNC2_BLOCKSIZE 256 + /* Maximum milliseconds to wait for F2 to come up */ + #define SDIO_WAIT_F2RDY 3000 + +@@ -903,6 +904,7 @@ static void brcmf_sdiod_host_fixup(struct mmc_host *host) + static int brcmf_sdiod_probe(struct brcmf_sdio_dev *sdiodev) + { + int ret = 0; ++ unsigned int f2_blksz = SDIO_FUNC2_BLOCKSIZE; + + sdio_claim_host(sdiodev->func1); + +@@ -912,7 +914,9 @@ static int brcmf_sdiod_probe(struct brcmf_sdio_dev *sdiodev) + sdio_release_host(sdiodev->func1); + goto out; + } +- ret = sdio_set_block_size(sdiodev->func2, SDIO_FUNC2_BLOCKSIZE); ++ if (sdiodev->func2->device == SDIO_DEVICE_ID_BROADCOM_4359) ++ f2_blksz = SDIO_4359_FUNC2_BLOCKSIZE; ++ ret = sdio_set_block_size(sdiodev->func2, f2_blksz); + if (ret) { + brcmf_err("Failed to set F2 blocksize\n"); + sdio_release_host(sdiodev->func1); +diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c +index 264ad63232f8..21e535072f3f 100644 +--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c ++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c +@@ -42,6 +42,8 @@ + #define DEFAULT_F2_WATERMARK 0x8 + #define CY_4373_F2_WATERMARK 0x40 + #define CY_43012_F2_WATERMARK 0x60 ++#define CY_4359_F2_WATERMARK 0x40 ++#define CY_4359_F1_MESBUSYCTRL (CY_4359_F2_WATERMARK | SBSDIO_MESBUSYCTRL_ENAB) + + #ifdef DEBUG + +@@ -4205,6 +4207,19 @@ static void brcmf_sdio_firmware_callback(struct device *dev, int err, + brcmf_sdiod_writeb(sdiod, SBSDIO_DEVICE_CTL, devctl, + &err); + break; ++ case SDIO_DEVICE_ID_BROADCOM_4359: ++ brcmf_dbg(INFO, "set F2 watermark to 0x%x*4 bytes\n", ++ CY_4359_F2_WATERMARK); ++ brcmf_sdiod_writeb(sdiod, SBSDIO_WATERMARK, ++ CY_4359_F2_WATERMARK, &err); ++ devctl = brcmf_sdiod_readb(sdiod, SBSDIO_DEVICE_CTL, ++ &err); ++ devctl |= SBSDIO_DEVCTL_F2WM_ENAB; ++ brcmf_sdiod_writeb(sdiod, SBSDIO_DEVICE_CTL, devctl, ++ &err); ++ brcmf_sdiod_writeb(sdiod, SBSDIO_FUNC1_MESBUSYCTRL, ++ CY_4359_F1_MESBUSYCTRL, &err); ++ break; + default: + brcmf_sdiod_writeb(sdiod, SBSDIO_WATERMARK, + DEFAULT_F2_WATERMARK, &err); diff --git a/patches/wifi2/v2-3-9-brcmfmac-fix-rambase-for-4359-9.patch b/patches/wifi2/v2-3-9-brcmfmac-fix-rambase-for-4359-9.patch new file mode 100644 index 0000000..2e8056f --- /dev/null +++ b/patches/wifi2/v2-3-9-brcmfmac-fix-rambase-for-4359-9.patch @@ -0,0 +1,137 @@ +From patchwork Wed Dec 11 23:52:47 2019 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +X-Patchwork-Submitter: Soeren Moch +X-Patchwork-Id: 11286585 +X-Patchwork-Delegate: kvalo@adurom.com +Return-Path: +Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org + [172.30.200.123]) + by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EF899138D + for ; + Wed, 11 Dec 2019 23:54:25 +0000 (UTC) +Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) + by mail.kernel.org (Postfix) with ESMTP id CE8B12173E + for ; + Wed, 11 Dec 2019 23:54:25 +0000 (UTC) +Authentication-Results: mail.kernel.org; + dkim=pass (1024-bit key) header.d=web.de header.i=@web.de header.b="Gu0wgLpK" +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1727101AbfLKXxZ (ORCPT + ); + Wed, 11 Dec 2019 18:53:25 -0500 +Received: from mout.web.de ([217.72.192.78]:57387 "EHLO mout.web.de" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S1726673AbfLKXxY (ORCPT ); + Wed, 11 Dec 2019 18:53:24 -0500 +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; + s=dbaedf251592; t=1576108391; + bh=4up7UPdrXKf7f4RHv1AgVYW/yVkK9as9YFQa80qMoKU=; + h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; + b=Gu0wgLpKWDiMw/KjGhRNXZ9fgdBWNCo60e8XriKrwIng+KPeNqpb/kEhnfL61n8xU + y5uala2/lTNOlXb13l0+YYMpnYRQXNnxT+eF5/UJuF6VzvntIVODJG/yru99dgUhdx + grgsKlgO5zws0iRjvX+lUFlh/JJwtKWBbhs5reT0= +X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 +Received: from localhost.localdomain ([89.204.139.166]) by smtp.web.de + (mrweb101 [213.165.67.124]) with ESMTPSA (Nemesis) id + 0M5fsK-1hm9Ms2iPg-00xdVy; Thu, 12 Dec 2019 00:53:10 +0100 +From: Soeren Moch +To: Kalle Valo , Heiko Stuebner +Cc: Soeren Moch , + Arend van Spriel , + Franky Lin , + Hante Meuleman , + Chi-Hsien Lin , + Wright Feng , + linux-wireless@vger.kernel.org, + brcm80211-dev-list.pdl@broadcom.com, + brcm80211-dev-list@cypress.com, netdev@vger.kernel.org, + linux-arm-kernel@lists.infradead.org, + linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org +Subject: [PATCH v2 3/9] brcmfmac: fix rambase for 4359/9 +Date: Thu, 12 Dec 2019 00:52:47 +0100 +Message-Id: <20191211235253.2539-4-smoch@web.de> +X-Mailer: git-send-email 2.17.1 +In-Reply-To: <20191211235253.2539-1-smoch@web.de> +References: <20191211235253.2539-1-smoch@web.de> +MIME-Version: 1.0 +X-Provags-ID: V03:K1:J+qJb/2Nw7OkPT3SxGUR8foewlU/Godf2lJr2WJR7yAVKyzHMHD + qqJRwEwFwDhjVM4go/USRgAOn7yIJ7hgH0ExeEB8svnzBOJMvZm9v/oljINQkZksxz9yNOA + nZNEOx3OYiAWZsAF9XCEJRfKHyQj1eGGSJYFqKM4drCj450VoEt1a3CZfYDmSsgUY/TjIq9 + kDe/TDllVqMrz07yDQuvA== +X-Spam-Flag: NO +X-UI-Out-Filterresults: notjunk:1;V03:K0:eZTTKvKqCQQ=:6Ufks9S8uTxW4FlPFgpy0Q + 71OY5XEmQ3puqHczlBr9G3y68a7jVmC4MRrtYw/khbu/oi4xTOfBxnEuLUSNqWDo5NuVfk6YQ + WapEexeYcScN7aZ1zXFZbAu1f7Z7M4qtsmXLA6jGSufrsxzQfVP3IN1pf3GaPnizWcWf/bNIj + O4Gh2od3tRllFMrzAJdr8VKhEJMr2Ct1LUDHAzGpmpxDF3l68Ma2mGBWlo0wvsOitYg04hQal + mO8Eo9Rt9R1xJyzlXy/2jXuQ1/jDClhLabD+H4vfdQUJinP2q5mmcYFYQwq1EqczeTe71+v6+ + k4z9DtxSPIgIGV2ONgBvabwQz3Vw/fpTi22AkUNPF3f6FqsafoDnyMVBPfkQC99sjZ7TEAhHZ + VUNXg92gOV7gPf8vWr8Kv6y/szKOGKrnYTDqPN2DVdrE4uSwNUTSxE/Hz11G+iAtBhVew+wH6 + I1sgG0LtAVJ+nN18k5MePHtETVFCploNouuXpHmwfChr55+hQG1KbUPh2vQdp7dvJtCiLjzGv + kXsh0eKa3Sdv11WGjk4jads0yY5UjX9LYzYVJ+P4Kcn6i/0yhRVIYpY1b7J/QsENZy1TOr/XW + VNiHhyOYcy7SzHKPMbtVaQF4W0V/377BbepKwymrnartfDkj9XPp/W62Hp9wG+hMKwigsg3Sb + ifpkVeyAMdTzFM5xL+EgqNgKXkW/AsS+pa7dPhrINbc1vsd9gVCSk7pNPAh0JSGogpsic3+i8 + VKiKUU7PunL1Lpji2UjNO6nt9vgFFkPbD981hlsERwu2nxMtAfydLD6YhcP8qR5rHqB7eYeyV + JJX3v7lJfobutiPHvkc1n9f9ePG1U0pU8LNfQ8f6CY93mp3RZEuM+wuyLDoMxncbmz7mhXStd + ru1xsPWf+ZgsEnGCFQL+aH7X0JgJjXDPVg6x3vc0Zbr4WJw2MMqfC7qsFscAx7sqoyfMPPn06 + Nil6mLEGhUEM/W6x1H43WXV9MBqFoN6p+FWFm0N/MyfAeE+PqKqKL1CH75ZtoZ6LYDbQFFqq9 + 9zSDIiIkd9pWD7Nsbr4Qu2MzWw0a0YIQXBXDh2btzsroEe34y0fvhfHrsdeeuIk8nHdlRsKx5 + cHHk+V8QTPrsRo4NowK3YbQDhTB+mNQo2qu7m7l9MWj+m5Jbm7LJyS7+jDLP4KJaDER5YPpCV + I5QlQfPw7W77CbOXYX/IbQEl1hswoCQ0UwhOKTml+ue5HgLic42YIXpinn1+Sdh/oCLZdFPsM + ayYpBwmhI8hqkatdtbKb/ugFIcs9ed3ldOf+M2Q== +Sender: linux-wireless-owner@vger.kernel.org +Precedence: bulk +List-ID: +X-Mailing-List: linux-wireless@vger.kernel.org + +Newer 4359 chip revisions need a different rambase address. +This fixes firmware download on such devices which fails otherwise. + +Signed-off-by: Soeren Moch +Acked-by: Chi-Hsien Lin +--- +changes in v2: none + +Cc: Kalle Valo +Cc: Heiko Stuebner +Cc: Arend van Spriel +Cc: Franky Lin +Cc: Hante Meuleman +Cc: Chi-Hsien Lin +Cc: Wright Feng +Cc: linux-wireless@vger.kernel.org +Cc: brcm80211-dev-list.pdl@broadcom.com +Cc: brcm80211-dev-list@cypress.com +Cc: netdev@vger.kernel.org +Cc: linux-arm-kernel@lists.infradead.org +Cc: linux-rockchip@lists.infradead.org +Cc: linux-kernel@vger.kernel.org +--- + drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +-- +2.17.1 + +diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c +index 0b5fbe5d8270..baf72e3984fc 100644 +--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c ++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c +@@ -712,7 +712,6 @@ static u32 brcmf_chip_tcm_rambase(struct brcmf_chip_priv *ci) + case BRCM_CC_43569_CHIP_ID: + case BRCM_CC_43570_CHIP_ID: + case BRCM_CC_4358_CHIP_ID: +- case BRCM_CC_4359_CHIP_ID: + case BRCM_CC_43602_CHIP_ID: + case BRCM_CC_4371_CHIP_ID: + return 0x180000; +@@ -722,6 +721,8 @@ static u32 brcmf_chip_tcm_rambase(struct brcmf_chip_priv *ci) + case BRCM_CC_4366_CHIP_ID: + case BRCM_CC_43664_CHIP_ID: + return 0x200000; ++ case BRCM_CC_4359_CHIP_ID: ++ return (ci->pub.chiprev < 9) ? 0x180000 : 0x160000; + case CY_CC_4373_CHIP_ID: + return 0x160000; + default: diff --git a/patches/wifi2/v2-4-9-brcmfmac-make-errors-when-setting-roaming-parameters-non-fatal.patch b/patches/wifi2/v2-4-9-brcmfmac-make-errors-when-setting-roaming-parameters-non-fatal.patch new file mode 100644 index 0000000..90927b5 --- /dev/null +++ b/patches/wifi2/v2-4-9-brcmfmac-make-errors-when-setting-roaming-parameters-non-fatal.patch @@ -0,0 +1,146 @@ +From patchwork Wed Dec 11 23:52:48 2019 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +X-Patchwork-Submitter: Soeren Moch +X-Patchwork-Id: 11286561 +X-Patchwork-Delegate: kvalo@adurom.com +Return-Path: +Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org + [172.30.200.123]) + by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EF18415AB + for ; + Wed, 11 Dec 2019 23:53:52 +0000 (UTC) +Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) + by mail.kernel.org (Postfix) with ESMTP id CF4E82173E + for ; + Wed, 11 Dec 2019 23:53:52 +0000 (UTC) +Authentication-Results: mail.kernel.org; + dkim=pass (1024-bit key) header.d=web.de header.i=@web.de header.b="fC+reDFW" +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1727267AbfLKXxa (ORCPT + ); + Wed, 11 Dec 2019 18:53:30 -0500 +Received: from mout.web.de ([212.227.17.12]:40639 "EHLO mout.web.de" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S1727202AbfLKXx3 (ORCPT ); + Wed, 11 Dec 2019 18:53:29 -0500 +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; + s=dbaedf251592; t=1576108392; + bh=UNWwBy4HvMp8NS5BHLEVj6k8eNrJ1QW+53Ygqx3ikyQ=; + h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; + b=fC+reDFWWXrCC1oVsGw4DQ2cGfkh72ux9rGAVkcaHPaAqvApQhggsnIfFOGYk32jb + 6EBEjgep0F9A+dEEHivoHe44RLKCJ+3fsNEZeNO0CLe+pnvi3zalkX/PDYrUan0NZG + uuwRvwgNSI8U/goq1XXnv0LUBDjbA5OpR7WhU9Zk= +X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 +Received: from localhost.localdomain ([89.204.139.166]) by smtp.web.de + (mrweb101 [213.165.67.124]) with ESMTPSA (Nemesis) id + 0MNcV4-1idZEQ0uXy-007BYG; Thu, 12 Dec 2019 00:53:12 +0100 +From: Soeren Moch +To: Kalle Valo , Heiko Stuebner +Cc: Soeren Moch , + Arend van Spriel , + Franky Lin , + Hante Meuleman , + Chi-Hsien Lin , + Wright Feng , + linux-wireless@vger.kernel.org, + brcm80211-dev-list.pdl@broadcom.com, + brcm80211-dev-list@cypress.com, netdev@vger.kernel.org, + linux-arm-kernel@lists.infradead.org, + linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org +Subject: [PATCH v2 4/9] brcmfmac: make errors when setting roaming parameters + non-fatal +Date: Thu, 12 Dec 2019 00:52:48 +0100 +Message-Id: <20191211235253.2539-5-smoch@web.de> +X-Mailer: git-send-email 2.17.1 +In-Reply-To: <20191211235253.2539-1-smoch@web.de> +References: <20191211235253.2539-1-smoch@web.de> +MIME-Version: 1.0 +X-Provags-ID: V03:K1:iWY6io2UQ6RIkm2j/nioDi8y8IvMaEyrFJN80SKzmn5lD3C51Hk + h3/+agnrE46TIzUUZIsWNSG7+jxo/QOQNpX56dWjEcTw05Yp4UChy+Ww/3ueKnCCJ59PoZ5 + tpmmXvLM1lnsJnGCnIzDOkWqJc6SlNH4eAwRxCh7GQEMLIlOvB2HQMc4gcfS5RhSBBlLfIK + 5+/LmDbh3Gx55YpFdC45Q== +X-Spam-Flag: NO +X-UI-Out-Filterresults: notjunk:1;V03:K0:pNccthOUpKw=:z9QcLBPdXM4E7dbreh5KhI + LbeK3P1yhdftZzuhI+R0FUJFoGiC4b6ano7oqYIsLK/N2nEj6o6crBfkW1A0kW4MzGvnEkkGO + T4/Yj7rQh0lwFjY+PAHk11lU7gWKYy3dzF9ykEzUfYFPCWCLlFGsxlT1P7Qptk12Qp46FhixQ + vQtI4x1hJB+scZ+MlFV/T1Eq26ClwCRwd2/FNm125HU+fNFXw39nDEtrEqZiARo5wMEwwYz/M + 3Z9bhcOEIftDTWukSx0LqRymqCjT14szC29OgLXyZqjNAopuF1aD1w0ArLlVpRJzrXWrjTJr/ + QAygyLWbky6ZFgyi8oiqzquFk67bVFjQn/qjswICugFTVrJGmTXUKxtPZ4OnNcWMy8tm75OLP + z/cYpvtRR64hXUJT7Zii9IKPW8GxxwOnEf7mTJU76JTiUTHbhKPezaF2ykto81DU6Vuc9L0j9 + UyudOga5QCRSlCtyDXQTK2UWSFSC+fgRYA43fkhrdKukQIFM2Dr9f4SiuK3/x7vrS+OWi1T5f + sW7nA8fSrOrjynGIBPd68jPqGxlpUULc47flahXzMVRPM+frWVoYjDz94MT5fRO9xbvuN9HxB + guWKwE8k7m3dAUiFx3Y5qD2I0dULfY+WsTtedJk1d6QLAs7ie42tUVeQ0PB7+QLqu5cTftePA + NQsl28wrGYf0XsJbsrmMxRKvc/rvLOXG/lGm0i2NZu07XRfBpinmjnUrZULzaP8mrNhurml+6 + EGv9SJZYfsvvYfSW9q671TjElYEld5L3IJlK7cQqfYdFWBKVbxfXqM+HTvU9yKAS6XFYC7QWx + ck6BnF8QaZW9rL63mQ4qmOFqcU7jNLQ2Hmpu6cibJAakOBJVZNTYbQAVMK5K67MUz/6XcaxdB + mIABZMCdTkF8CV9QJIp1ZHahsRIvYhonr1LhVWLRgE5f1UGO6WfLY04NkoanJIq9FwWQwE7VO + JPMibERe+SINR2JjvQ+X2rr0xCjeWL990Z91mGxswVqExzYVmCvi0DZEfXHN7axO0PLRcNx5D + NoGw4gxFqB4fcx4P0BcERfC5Lis0/fixa2MuA8RIQsXP7S8JReCrHqT7jLH+5FHDW5PnYsZQ+ + 122BqIJ6oQuH0V8FHCqZg5cN47nQahH+zmj8WvL6tS530j81e0dCqIJZ3GP3m3iINXeHwonFZ + hHMSM8QtDpTSGMwvSMlfczDxG13IzN4ystrcIrQGXACqC5eA8wJ4qr3UsiRxYorMxm5B5VMA3 + a2scy3jluKvcVFP3w9UQ8co1zL8aS82pC9JqSSg== +Sender: linux-wireless-owner@vger.kernel.org +Precedence: bulk +List-ID: +X-Mailing-List: linux-wireless@vger.kernel.org + +4359 dongles do not support setting roaming parameters (error -52). +Do not fail the 80211 configuration in this case. + +Signed-off-by: Soeren Moch +Acked-by: Chi-Hsien Lin +--- +changes in v2: +- add ack tag received for v1 + +Cc: Kalle Valo +Cc: Heiko Stuebner +Cc: Arend van Spriel +Cc: Franky Lin +Cc: Hante Meuleman +Cc: Chi-Hsien Lin +Cc: Wright Feng +Cc: linux-wireless@vger.kernel.org +Cc: brcm80211-dev-list.pdl@broadcom.com +Cc: brcm80211-dev-list@cypress.com +Cc: netdev@vger.kernel.org +Cc: linux-arm-kernel@lists.infradead.org +Cc: linux-rockchip@lists.infradead.org +Cc: linux-kernel@vger.kernel.org +--- + .../wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 10 ++++------ + 1 file changed, 4 insertions(+), 6 deletions(-) + +-- +2.17.1 + +diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +index 5598bbd09b62..0cf13cea1dbe 100644 +--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c ++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +@@ -6012,19 +6012,17 @@ static s32 brcmf_dongle_roam(struct brcmf_if *ifp) + roamtrigger[1] = cpu_to_le32(BRCM_BAND_ALL); + err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SET_ROAM_TRIGGER, + (void *)roamtrigger, sizeof(roamtrigger)); +- if (err) { ++ if (err) + bphy_err(drvr, "WLC_SET_ROAM_TRIGGER error (%d)\n", err); +- goto roam_setup_done; +- } + + roam_delta[0] = cpu_to_le32(WL_ROAM_DELTA); + roam_delta[1] = cpu_to_le32(BRCM_BAND_ALL); + err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SET_ROAM_DELTA, + (void *)roam_delta, sizeof(roam_delta)); +- if (err) { ++ if (err) + bphy_err(drvr, "WLC_SET_ROAM_DELTA error (%d)\n", err); +- goto roam_setup_done; +- } ++ ++ return 0; + + roam_setup_done: + return err; diff --git a/patches/wifi2/v2-5-9-brcmfmac-add-support-for-BCM4359-SDIO-chipset.patch b/patches/wifi2/v2-5-9-brcmfmac-add-support-for-BCM4359-SDIO-chipset.patch new file mode 100644 index 0000000..ee76618 --- /dev/null +++ b/patches/wifi2/v2-5-9-brcmfmac-add-support-for-BCM4359-SDIO-chipset.patch @@ -0,0 +1,186 @@ +From patchwork Wed Dec 11 23:52:49 2019 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +X-Patchwork-Submitter: Soeren Moch +X-Patchwork-Id: 11286555 +X-Patchwork-Delegate: kvalo@adurom.com +Return-Path: +Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org + [172.30.200.123]) + by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2C337138D + for ; + Wed, 11 Dec 2019 23:53:33 +0000 (UTC) +Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) + by mail.kernel.org (Postfix) with ESMTP id 018DA2173E + for ; + Wed, 11 Dec 2019 23:53:32 +0000 (UTC) +Authentication-Results: mail.kernel.org; + dkim=pass (1024-bit key) header.d=web.de header.i=@web.de header.b="k+FurcGv" +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1727297AbfLKXxc (ORCPT + ); + Wed, 11 Dec 2019 18:53:32 -0500 +Received: from mout.web.de ([212.227.17.12]:58215 "EHLO mout.web.de" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S1727223AbfLKXxa (ORCPT ); + Wed, 11 Dec 2019 18:53:30 -0500 +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; + s=dbaedf251592; t=1576108394; + bh=UIfQ1uEbBM7aRcsCELoWupsxNBU1uTnrfPC1GXuP4k0=; + h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; + b=k+FurcGv4TqMLZ609jRprB6gFKo66ccff7+ww9DBPhQA3+MY2E9cemTMAeF/mQc/D + W6mrMnD79QAA2/sbWWE2G2YVn6SF27stpEQioQHz7idLthLgPOqFKLURomtcw4zBW6 + A0dwfZFmfTDMlWbvEf+eQ+ZgKgNxW2vyvlTXLj8o= +X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 +Received: from localhost.localdomain ([89.204.139.166]) by smtp.web.de + (mrweb101 [213.165.67.124]) with ESMTPSA (Nemesis) id + 0LopiJ-1i3xMg2sFn-00gnU9; Thu, 12 Dec 2019 00:53:13 +0100 +From: Soeren Moch +To: Kalle Valo , Heiko Stuebner +Cc: Soeren Moch , + Arend van Spriel , + Franky Lin , + Hante Meuleman , + Chi-Hsien Lin , + Wright Feng , + linux-wireless@vger.kernel.org, + brcm80211-dev-list.pdl@broadcom.com, + brcm80211-dev-list@cypress.com, netdev@vger.kernel.org, + linux-arm-kernel@lists.infradead.org, + linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org +Subject: [PATCH v2 5/9] brcmfmac: add support for BCM4359 SDIO chipset +Date: Thu, 12 Dec 2019 00:52:49 +0100 +Message-Id: <20191211235253.2539-6-smoch@web.de> +X-Mailer: git-send-email 2.17.1 +In-Reply-To: <20191211235253.2539-1-smoch@web.de> +References: <20191211235253.2539-1-smoch@web.de> +MIME-Version: 1.0 +X-Provags-ID: V03:K1:fbFLsfS9zJn7W1W+geLYLgL2xgrwq0iSOy4xXpjyJpvWZaUoD4E + Y0N/HgtLWYoCW//RMA1C56H/2QGtRXUt7FI3e+QfgKv7AbY7WZfIYaL0vqoEDdrNw1A7fou + Bda7+OfEDfs76gdEzVQB+VO+mAGdy7KGqTxlpNipT/MSTqPXjhnbcFMvToySJY3i9bvbqSG + zaec0MLD5YciT9kes7SPg== +X-Spam-Flag: NO +X-UI-Out-Filterresults: notjunk:1;V03:K0:QcQIpKAkuMw=:9dXi2isuR2bE8ZA7lkpXK3 + JHnpknUmYgsJHS5jpFZlGrfzeS79/ygdKCK4CMI6KkJ+cVRcXPzAUWkAB9l3jho2xXKh28c1x + 2la10ALczojxXFDuCCWb6G02C5ESFJzE02HTX6oTcZnhVabr7HU96rtlUN6spKEZ9Bd7My17/ + RRZ7KSsMH9JlQ80JiNuKsD/tLHHTwi5PzmmrcUfmv9yTWf2/ZBE8J20R2S7YOBu6xecdLVR2Y + IA17+ZWAzHh/GkSAmMHPiBInLGgT2yx1UvbY0MOFTC7RserBpyOBRle8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X-Mailing-List: linux-wireless@vger.kernel.org + +BCM4359 is a 2x2 802.11 abgn+ac Dual-Band HT80 combo chip and it +supports Real Simultaneous Dual Band feature. + +Based on a similar patch by: Wright Feng + +Signed-off-by: Soeren Moch +Acked-by: Chi-Hsien Lin +Acked-by: Ulf Hansson +--- +changes in v2: +- add SDIO_DEVICE_ID_CYPRESS_89359 as requested + by Chi-Hsien Lin + +Cc: Kalle Valo +Cc: Heiko Stuebner +Cc: Arend van Spriel +Cc: Franky Lin +Cc: Hante Meuleman +Cc: Chi-Hsien Lin +Cc: Wright Feng +Cc: linux-wireless@vger.kernel.org +Cc: brcm80211-dev-list.pdl@broadcom.com +Cc: brcm80211-dev-list@cypress.com +Cc: netdev@vger.kernel.org +Cc: linux-arm-kernel@lists.infradead.org +Cc: linux-rockchip@lists.infradead.org +Cc: linux-kernel@vger.kernel.org +--- + drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 2 ++ + drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c | 1 + + drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 2 ++ + include/linux/mmc/sdio_ids.h | 2 ++ + 4 files changed, 7 insertions(+) + +-- +2.17.1 + +diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c +index 68baf0189305..f4c53ab46058 100644 +--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c ++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c +@@ -973,8 +973,10 @@ static const struct sdio_device_id brcmf_sdmmc_ids[] = { + BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_43455), + BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_4354), + BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_4356), ++ BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_4359), + BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_CYPRESS_4373), + BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_CYPRESS_43012), ++ BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_CYPRESS_89359), + { /* end: all zeroes */ } + }; + MODULE_DEVICE_TABLE(sdio, brcmf_sdmmc_ids); +diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c +index baf72e3984fc..282d0bc14e8e 100644 +--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c ++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c +@@ -1408,6 +1408,7 @@ bool brcmf_chip_sr_capable(struct brcmf_chip *pub) + addr = CORE_CC_REG(base, sr_control0); + reg = chip->ops->read32(chip->ctx, addr); + return (reg & CC_SR_CTL0_ENABLE_MASK) != 0; ++ case BRCM_CC_4359_CHIP_ID: + case CY_CC_43012_CHIP_ID: + addr = CORE_CC_REG(pmu->base, retention_ctl); + reg = chip->ops->read32(chip->ctx, addr); +diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c +index 21e535072f3f..c4012ed58b9c 100644 +--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c ++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c +@@ -616,6 +616,7 @@ BRCMF_FW_DEF(43455, "brcmfmac43455-sdio"); + BRCMF_FW_DEF(43456, "brcmfmac43456-sdio"); + BRCMF_FW_DEF(4354, "brcmfmac4354-sdio"); + BRCMF_FW_DEF(4356, "brcmfmac4356-sdio"); ++BRCMF_FW_DEF(4359, "brcmfmac4359-sdio"); + BRCMF_FW_DEF(4373, "brcmfmac4373-sdio"); + BRCMF_FW_DEF(43012, "brcmfmac43012-sdio"); + +@@ -638,6 +639,7 @@ static const struct brcmf_firmware_mapping brcmf_sdio_fwnames[] = { + BRCMF_FW_ENTRY(BRCM_CC_4345_CHIP_ID, 0xFFFFFDC0, 43455), + BRCMF_FW_ENTRY(BRCM_CC_4354_CHIP_ID, 0xFFFFFFFF, 4354), + BRCMF_FW_ENTRY(BRCM_CC_4356_CHIP_ID, 0xFFFFFFFF, 4356), ++ BRCMF_FW_ENTRY(BRCM_CC_4359_CHIP_ID, 0xFFFFFFFF, 4359), + BRCMF_FW_ENTRY(CY_CC_4373_CHIP_ID, 0xFFFFFFFF, 4373), + BRCMF_FW_ENTRY(CY_CC_43012_CHIP_ID, 0xFFFFFFFF, 43012) + }; +diff --git a/include/linux/mmc/sdio_ids.h b/include/linux/mmc/sdio_ids.h +index 08b25c02b5a1..2e9a6e4634eb 100644 +--- a/include/linux/mmc/sdio_ids.h ++++ b/include/linux/mmc/sdio_ids.h +@@ -41,8 +41,10 @@ + #define SDIO_DEVICE_ID_BROADCOM_43455 0xa9bf + #define SDIO_DEVICE_ID_BROADCOM_4354 0x4354 + #define SDIO_DEVICE_ID_BROADCOM_4356 0x4356 ++#define SDIO_DEVICE_ID_BROADCOM_4359 0x4359 + #define SDIO_DEVICE_ID_CYPRESS_4373 0x4373 + #define SDIO_DEVICE_ID_CYPRESS_43012 43012 ++#define SDIO_DEVICE_ID_CYPRESS_89359 0x4355 + + #define SDIO_VENDOR_ID_INTEL 0x0089 + #define SDIO_DEVICE_ID_INTEL_IWMC3200WIMAX 0x1402 diff --git a/patches/wifi2/v2-6-9-brcmfmac-add-RSDB-condition-when-setting-interface-combinations.patch b/patches/wifi2/v2-6-9-brcmfmac-add-RSDB-condition-when-setting-interface-combinations.patch new file mode 100644 index 0000000..aa909a5 --- /dev/null +++ b/patches/wifi2/v2-6-9-brcmfmac-add-RSDB-condition-when-setting-interface-combinations.patch @@ -0,0 +1,236 @@ +From patchwork Wed Dec 11 23:52:50 2019 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +X-Patchwork-Submitter: Soeren Moch +X-Patchwork-Id: 11286579 +X-Patchwork-Delegate: kvalo@adurom.com +Return-Path: +Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org + [172.30.200.123]) + by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CF90C138D + for ; + Wed, 11 Dec 2019 23:54:16 +0000 (UTC) +Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) + by mail.kernel.org (Postfix) with ESMTP id A532521655 + for ; + Wed, 11 Dec 2019 23:54:16 +0000 (UTC) +Authentication-Results: mail.kernel.org; + dkim=pass (1024-bit key) header.d=web.de header.i=@web.de header.b="LrNnwQUq" +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1727417AbfLKXyM (ORCPT + ); + Wed, 11 Dec 2019 18:54:12 -0500 +Received: from mout.web.de ([217.72.192.78]:51263 "EHLO mout.web.de" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S1727198AbfLKXx2 (ORCPT ); + Wed, 11 Dec 2019 18:53:28 -0500 +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; + s=dbaedf251592; t=1576108395; + bh=bqrfzn03Wk5A81+Bxtr6JafRDf0LDppSY0FopstiOWU=; + h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; + b=LrNnwQUqQrR0y8v6QbdwFWGQreRkC4UnLS5vcVMOJWqrggruA85WPRuDtsut44XCJ + yEqnecDjdVWTJLbeEBdKSRro6bhl4HlystbX32DXbG0J+16xNcdgo0pzXbUjQ/Rumx + VmqU5cVabbZFYa0qgNLQtUwVMzEIAshhpw5rpgtU= +X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 +Received: from localhost.localdomain ([89.204.139.166]) by smtp.web.de + (mrweb101 [213.165.67.124]) with ESMTPSA (Nemesis) id + 0M6E6g-1hmhaz0h0k-00yBkG; Thu, 12 Dec 2019 00:53:15 +0100 +From: Soeren Moch +To: Kalle Valo , Heiko Stuebner +Cc: Wright Feng , Soeren Moch , + Arend van Spriel , + Franky Lin , + Hante Meuleman , + Chi-Hsien Lin , + linux-wireless@vger.kernel.org, + brcm80211-dev-list.pdl@broadcom.com, + brcm80211-dev-list@cypress.com, netdev@vger.kernel.org, + linux-arm-kernel@lists.infradead.org, + linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org +Subject: [PATCH v2 6/9] brcmfmac: add RSDB condition when setting interface + combinations +Date: Thu, 12 Dec 2019 00:52:50 +0100 +Message-Id: <20191211235253.2539-7-smoch@web.de> +X-Mailer: git-send-email 2.17.1 +In-Reply-To: <20191211235253.2539-1-smoch@web.de> +References: <20191211235253.2539-1-smoch@web.de> +MIME-Version: 1.0 +X-Provags-ID: V03:K1:sObgus2FDRoa5HGMYXoHjJ8dLBCTgL7OufE2JZLV/N7PtqNDME2 + YuQXbzzDjKtPnQsO7f8f9MzJSbdmoMqCb/6c4H24QSLEbLJ8AUwZUsdhGOh3NKpytNJMIhG + hXxgebyZByKXqYQJn7hWvI2FVd66BOnDCk39Fi8sBq+VoW4dZHw85R6jVOnpy5jpfvCvUlo + Tx1C7zBeV/t96cuCIyhhA== +X-Spam-Flag: NO +X-UI-Out-Filterresults: notjunk:1;V03:K0:l+RZ/qB1OXc=:NPKGOTlEvEQpnntq6ydHAz + fHl0SEXZuE6K9NBqv4Lht5uPB32IkQoru8VRv4/YD+JhRqRzu+tcMxC2gZ5IB67lWwyUdySCm + uBnJwQR+zq8SQmwMwXiVtWbbYaPtxcQ0OPwiJgkN35EtVWAdo18b1j2o3Y6eiXAgb+yTDfEO4 + QPc4Xh7ZV7/Ozn0gxYjPVXPBRJV+m5jNdO0gT+LKNmb/axMJrSIBvPmuqB+IXexqXIFAxwPhO + DdJ49akvIGJuQq/h7m3KcOo0bUrki08Pi9KFUo6INuqAEup9RxYJZjrRH4K5fZ18kZOuiIfx7 + Jtjz0ht7DMIP7XJ0gbAdp+aFbgq9mieu/1OzKTp4r15FJLEwXbY+x+VFvN7YuMruvhAlgDN/f + uydFFv0xu0FTYf0XcqEWIsTOrwK18uAoRBDUb36QwOqZJq3+XAFsCuy6P9Y6IWqnGE4lHlav+ + 4yBD7vYaRJWj1eNLqmi8QqSLSaYQ+kNKY40IK+eiTiyjwCumX2WEdTlTpPsvD3REp6CyYJgHt + wVKBHcBh0uGmpU+PjdLDvaLjeXLSS9NTMXZHTmywifF9gbLon8IKH2GfjUjbfpio0uItVKhOp + +qKdcNo33fS1f+dpD7kGF0KSy1XTMgfbblzY4yDs4twfxdRxU5RWo0kGPsdf4NxT3XV7gZWMD + 76dZ6dQ0cQxRxmWS6Ebl6SXx/kNq2ih0ox1/gK6awP7WmV5bZP4XwMiRmvVLtwsKtv4BuvMWv + 0JfZf0gFBagGgAEVGPPd0nlodPWZ8OlHGbxBThsTUdS51d265/UdnYQkKigcGBPY3JnBxDis3 + UwLBb5gwrG+zDOOdAAwxZuS7qdnmFlUniQXAFFOf+/JTYJ4X8WdMX1JxCLMzSEhxlWCKELgLK + 4zcMN76iTCWG/YWMnUtvX7w4zL1r/adcNOG4vs4TTum2DsZEkwEWP3bB/b6TyaNGzQhIWwSUN + yiQrAwsPKj06psAXb7PTg2pinbvSX3REtejpZkkJZJRtYE75gKujsDDaEkaUtXYeSH7LzBSK0 + S9XH6EFM0BNYJ3o8DS7HpcYPyi5Lt8TBZ5V70l/aHBAIHVCfvN9gqXoQQt+7nLCq68jMwQpDC + r0JrD16e3CTTvuHUKgb4rtUf2H3PGBDRcU/BrKAV4gZPgXqqjS93FL5H7bBWm7EZOGa/K34Uk + 4B+zsViWMt89PTi2nQ0qlYivNwmqGEkMQivWWOSNzkk5qg+vpBFP7lxMoMi8XdZ+Qu3oa1zNw + tPGbo/eu0kB/3JzBN69//WDdupLb2MjoLAududA== +Sender: linux-wireless-owner@vger.kernel.org +Precedence: bulk +List-ID: +X-Mailing-List: linux-wireless@vger.kernel.org + +From: Wright Feng + +With firmware RSDB feature +1. The maximum support interface is four. +2. The maximum difference channel is two. +3. The maximum interfaces of {station/p2p client/AP} are two. +4. The maximum interface of p2p device is one. + +Signed-off-by: Wright Feng +Signed-off-by: Soeren Moch +Reviewed-by: Chi-Hsien Lin +--- +changes in v2: +- add missing s-o-b +- add review tag received for v1 + +Cc: Kalle Valo +Cc: Heiko Stuebner +Cc: Arend van Spriel +Cc: Franky Lin +Cc: Hante Meuleman +Cc: Chi-Hsien Lin +Cc: Wright Feng +Cc: linux-wireless@vger.kernel.org +Cc: brcm80211-dev-list.pdl@broadcom.com +Cc: brcm80211-dev-list@cypress.com +Cc: netdev@vger.kernel.org +Cc: linux-arm-kernel@lists.infradead.org +Cc: linux-rockchip@lists.infradead.org +Cc: linux-kernel@vger.kernel.org +--- + .../broadcom/brcm80211/brcmfmac/cfg80211.c | 54 ++++++++++++++++--- + 1 file changed, 46 insertions(+), 8 deletions(-) + +-- +2.17.1 + +diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +index 0cf13cea1dbe..9d9dc9195e9e 100644 +--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c ++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +@@ -6520,6 +6520,9 @@ brcmf_txrx_stypes[NUM_NL80211_IFTYPES] = { + * #STA <= 1, #AP <= 1, channels = 1, 2 total + * #AP <= 4, matching BI, channels = 1, 4 total + * ++ * no p2p and rsdb: ++ * #STA <= 2, #AP <= 2, channels = 2, 4 total ++ * + * p2p, no mchan, and mbss: + * + * #STA <= 1, #P2P-DEV <= 1, #{P2P-CL, P2P-GO} <= 1, channels = 1, 3 total +@@ -6531,6 +6534,10 @@ brcmf_txrx_stypes[NUM_NL80211_IFTYPES] = { + * #STA <= 1, #P2P-DEV <= 1, #{P2P-CL, P2P-GO} <= 1, channels = 2, 3 total + * #STA <= 1, #P2P-DEV <= 1, #AP <= 1, #P2P-CL <= 1, channels = 1, 4 total + * #AP <= 4, matching BI, channels = 1, 4 total ++ * ++ * p2p, rsdb, and no mbss: ++ * #STA <= 2, #P2P-DEV <= 1, #{P2P-CL, P2P-GO} <= 2, AP <= 2, ++ * channels = 2, 4 total + */ + static int brcmf_setup_ifmodes(struct wiphy *wiphy, struct brcmf_if *ifp) + { +@@ -6538,13 +6545,14 @@ static int brcmf_setup_ifmodes(struct wiphy *wiphy, struct brcmf_if *ifp) + struct ieee80211_iface_limit *c0_limits = NULL; + struct ieee80211_iface_limit *p2p_limits = NULL; + struct ieee80211_iface_limit *mbss_limits = NULL; +- bool mbss, p2p; ++ bool mbss, p2p, rsdb; + int i, c, n_combos; + + mbss = brcmf_feat_is_enabled(ifp, BRCMF_FEAT_MBSS); + p2p = brcmf_feat_is_enabled(ifp, BRCMF_FEAT_P2P); ++ rsdb = brcmf_feat_is_enabled(ifp, BRCMF_FEAT_RSDB); + +- n_combos = 1 + !!p2p + !!mbss; ++ n_combos = 1 + !!(p2p && !rsdb) + !!mbss; + combo = kcalloc(n_combos, sizeof(*combo), GFP_KERNEL); + if (!combo) + goto err; +@@ -6555,16 +6563,36 @@ static int brcmf_setup_ifmodes(struct wiphy *wiphy, struct brcmf_if *ifp) + + c = 0; + i = 0; +- c0_limits = kcalloc(p2p ? 3 : 2, sizeof(*c0_limits), GFP_KERNEL); ++ if (p2p && rsdb) ++ c0_limits = kcalloc(4, sizeof(*c0_limits), GFP_KERNEL); ++ else if (p2p) ++ c0_limits = kcalloc(3, sizeof(*c0_limits), GFP_KERNEL); ++ else ++ c0_limits = kcalloc(2, sizeof(*c0_limits), GFP_KERNEL); + if (!c0_limits) + goto err; +- c0_limits[i].max = 1; +- c0_limits[i++].types = BIT(NL80211_IFTYPE_STATION); +- if (p2p) { ++ if (p2p && rsdb) { ++ combo[c].num_different_channels = 2; ++ wiphy->interface_modes |= BIT(NL80211_IFTYPE_P2P_CLIENT) | ++ BIT(NL80211_IFTYPE_P2P_GO) | ++ BIT(NL80211_IFTYPE_P2P_DEVICE); ++ c0_limits[i].max = 2; ++ c0_limits[i++].types = BIT(NL80211_IFTYPE_STATION); ++ c0_limits[i].max = 1; ++ c0_limits[i++].types = BIT(NL80211_IFTYPE_P2P_DEVICE); ++ c0_limits[i].max = 2; ++ c0_limits[i++].types = BIT(NL80211_IFTYPE_P2P_CLIENT) | ++ BIT(NL80211_IFTYPE_P2P_GO); ++ c0_limits[i].max = 2; ++ c0_limits[i++].types = BIT(NL80211_IFTYPE_AP); ++ combo[c].max_interfaces = 5; ++ } else if (p2p) { + if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_MCHAN)) + combo[c].num_different_channels = 2; + else + combo[c].num_different_channels = 1; ++ c0_limits[i].max = 1; ++ c0_limits[i++].types = BIT(NL80211_IFTYPE_STATION); + wiphy->interface_modes |= BIT(NL80211_IFTYPE_P2P_CLIENT) | + BIT(NL80211_IFTYPE_P2P_GO) | + BIT(NL80211_IFTYPE_P2P_DEVICE); +@@ -6573,16 +6601,26 @@ static int brcmf_setup_ifmodes(struct wiphy *wiphy, struct brcmf_if *ifp) + c0_limits[i].max = 1; + c0_limits[i++].types = BIT(NL80211_IFTYPE_P2P_CLIENT) | + BIT(NL80211_IFTYPE_P2P_GO); ++ combo[c].max_interfaces = i; ++ } else if (rsdb) { ++ combo[c].num_different_channels = 2; ++ c0_limits[i].max = 2; ++ c0_limits[i++].types = BIT(NL80211_IFTYPE_STATION); ++ c0_limits[i].max = 2; ++ c0_limits[i++].types = BIT(NL80211_IFTYPE_AP); ++ combo[c].max_interfaces = 3; + } else { + combo[c].num_different_channels = 1; + c0_limits[i].max = 1; ++ c0_limits[i++].types = BIT(NL80211_IFTYPE_STATION); ++ c0_limits[i].max = 1; + c0_limits[i++].types = BIT(NL80211_IFTYPE_AP); ++ combo[c].max_interfaces = i; + } +- combo[c].max_interfaces = i; + combo[c].n_limits = i; + combo[c].limits = c0_limits; + +- if (p2p) { ++ if (p2p && !rsdb) { + c++; + i = 0; + p2p_limits = kcalloc(4, sizeof(*p2p_limits), GFP_KERNEL); diff --git a/patches/wifi2/v2-7-9-brcmfmac-not-set-mbss-in-vif-if-firmware-does-not-support-MBSS.patch b/patches/wifi2/v2-7-9-brcmfmac-not-set-mbss-in-vif-if-firmware-does-not-support-MBSS.patch new file mode 100644 index 0000000..334ab2c --- /dev/null +++ b/patches/wifi2/v2-7-9-brcmfmac-not-set-mbss-in-vif-if-firmware-does-not-support-MBSS.patch @@ -0,0 +1,144 @@ +From patchwork Wed Dec 11 23:52:51 2019 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +X-Patchwork-Submitter: Soeren Moch +X-Patchwork-Id: 11286569 +X-Patchwork-Delegate: kvalo@adurom.com +Return-Path: +Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org + [172.30.200.123]) + by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5C62F138D + for ; + Wed, 11 Dec 2019 23:54:06 +0000 (UTC) +Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) + by mail.kernel.org (Postfix) with ESMTP id 3BF6D21655 + for ; + Wed, 11 Dec 2019 23:54:06 +0000 (UTC) +Authentication-Results: mail.kernel.org; + dkim=pass (1024-bit key) header.d=web.de header.i=@web.de header.b="I1puRLyA" +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1727387AbfLKXyB (ORCPT + ); + Wed, 11 Dec 2019 18:54:01 -0500 +Received: from mout.web.de ([212.227.17.11]:54749 "EHLO mout.web.de" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S1727221AbfLKXxa (ORCPT ); + Wed, 11 Dec 2019 18:53:30 -0500 +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; + s=dbaedf251592; t=1576108397; + bh=7pQcYbT5CQoEEaxvWi8Uu1MkcuZw52tCD3i8PVSaiP0=; + h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; + b=I1puRLyA2WAJfJ1s8no6Dyz/jMFM+Lhw0Yx5hubaBqNqiwHsTWgCgpNOCLNtJUz3I + 6oJ7nJlRK7wbGM8oNxFcsDCeGR7ejZMiKbnFVUXtQ4ewro+e0C0/C/yABfrYPgycVx + fp3PUyp8b1Jkp2x4M55FxOxPfxmUfBQAIXdq0Tek= +X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 +Received: from localhost.localdomain ([89.204.139.166]) by smtp.web.de + (mrweb101 [213.165.67.124]) with ESMTPSA (Nemesis) id + 0MRCrb-1iITxr2kut-00UcEf; Thu, 12 Dec 2019 00:53:16 +0100 +From: Soeren Moch +To: Kalle Valo , Heiko Stuebner +Cc: Wright Feng , Soeren Moch , + Arend van Spriel , + Franky Lin , + Hante Meuleman , + Chi-Hsien Lin , + linux-wireless@vger.kernel.org, + brcm80211-dev-list.pdl@broadcom.com, + brcm80211-dev-list@cypress.com, netdev@vger.kernel.org, + linux-arm-kernel@lists.infradead.org, + linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org +Subject: [PATCH v2 7/9] brcmfmac: not set mbss in vif if firmware does not + support MBSS +Date: Thu, 12 Dec 2019 00:52:51 +0100 +Message-Id: <20191211235253.2539-8-smoch@web.de> +X-Mailer: git-send-email 2.17.1 +In-Reply-To: <20191211235253.2539-1-smoch@web.de> +References: <20191211235253.2539-1-smoch@web.de> +MIME-Version: 1.0 +X-Provags-ID: V03:K1:ydPMbbLZaxGnMRPj9cpe5yDs3Qub8wc2zlvo+FhzRwhJe6CeWja + ZCPy1SNdvscy7jaRyoNSIbG0RsFSe4egx9rjGpNd4NoevT6JFdb0HCGhS/NAjXoMCF6AAa2 + l6pycAH9BIM/H8KcH/tuyLXVKriNd7KDDiap0vDs/ScJ/nWDZEKMQTAQ8Y5WtbY572+Bhwp + ba2aIIocLz3hJIpxei3IQ== +X-Spam-Flag: NO +X-UI-Out-Filterresults: notjunk:1;V03:K0:qEBdN5KF0nw=:kNLWSGjSFVvCh01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5jFYuyzjbrkFIIUP6s8pftUBBkySVwG+gzxXoL4nQPAdQtC+qF + uDbm+nDCX8qQ3Fh35Hjdxco14pF+z36eaWgcTlGoNtiouAYOT2tmfyquPtyM1UV3bPgCWEvHq + xu3Sfub7wRdxohQvE2VLLnjRhqzcUI05JrvH4un3wvdSJGY5G5uWKfKgaIiuACjDY2EfR6s52 + cZ0ft2+k7BfFKOVcpPrzBN+FoITLSodCaik3LpQ== +Sender: linux-wireless-owner@vger.kernel.org +Precedence: bulk +List-ID: +X-Mailing-List: linux-wireless@vger.kernel.org + +From: Wright Feng + +With RSDB mode, FMAC and firmware are able to create 2 or more AP, +so we should not set mbss in vif structure if firmware does not +support MBSS feature. + +Signed-off-by: Wright Feng +Signed-off-by: Soeren Moch +Reviewed-by: Chi-Hsien Lin +--- +changes in v2: +- add missing s-o-b +- add review tag received for v1 + +Cc: Kalle Valo +Cc: Heiko Stuebner +Cc: Arend van Spriel +Cc: Franky Lin +Cc: Hante Meuleman +Cc: Chi-Hsien Lin +Cc: Wright Feng +Cc: linux-wireless@vger.kernel.org +Cc: brcm80211-dev-list.pdl@broadcom.com +Cc: brcm80211-dev-list@cypress.com +Cc: netdev@vger.kernel.org +Cc: linux-arm-kernel@lists.infradead.org +Cc: linux-rockchip@lists.infradead.org +Cc: linux-kernel@vger.kernel.org +--- + drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +-- +2.17.1 + +diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +index 9d9dc9195e9e..6eb3064c3721 100644 +--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c ++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +@@ -5363,6 +5363,7 @@ struct brcmf_cfg80211_vif *brcmf_alloc_vif(struct brcmf_cfg80211_info *cfg, + struct brcmf_cfg80211_vif *vif_walk; + struct brcmf_cfg80211_vif *vif; + bool mbss; ++ struct brcmf_if *ifp = brcmf_get_ifp(cfg->pub, 0); + + brcmf_dbg(TRACE, "allocating virtual interface (size=%zu)\n", + sizeof(*vif)); +@@ -5375,7 +5376,8 @@ struct brcmf_cfg80211_vif *brcmf_alloc_vif(struct brcmf_cfg80211_info *cfg, + + brcmf_init_prof(&vif->profile); + +- if (type == NL80211_IFTYPE_AP) { ++ if (type == NL80211_IFTYPE_AP && ++ brcmf_feat_is_enabled(ifp, BRCMF_FEAT_MBSS)) { + mbss = false; + list_for_each_entry(vif_walk, &cfg->vif_list, list) { + if (vif_walk->wdev.iftype == NL80211_IFTYPE_AP) { diff --git a/scripts/auto_krescue b/scripts/auto_krescue index 12aa92e..5f1f83a 100755 --- a/scripts/auto_krescue +++ b/scripts/auto_krescue @@ -18,7 +18,7 @@ export LINUX_VER=linux-5.4-rc5 ./kernel_config ../files/configs/mmc_m ./kernel_config ../files/configs/eth2_y -NOPOST=1 ./make_kernel_mainline_vimsX dtbs +NOPOST=1 ./make_kernel_mainline_vimsX dtbs || echo "[w] ups...">&2 ./make_kernel_mainline_vimsX diff --git a/scripts/auto_openwrt b/scripts/auto_openwrt index b61db41..02bd3b8 100755 --- a/scripts/auto_openwrt +++ b/scripts/auto_openwrt @@ -14,9 +14,10 @@ export LINUX_VER=linux-5.3-rc6 ./patch_ ../patches/gitignore-local-fix.patch ./patch_ ../patches/0185-arm64-dts-VIM1-add-thermal-zones.patch ./patch_ ../patches/0333-exfat.patch -./patch_ ../patches/wifi/board-VIM1-0069-fix.patch +#./patch_ ../patches/wifi/board-VIM1-0069-fix.patch ./patch_ ../patches/wifi/board-VIM1-fixup-btbcm.patch ./patch_ ../patches/linux-5.4-rc5/0030-fix-broken-ethernet-interface-up-down.patch +./patch_ ../patches/wifi2/*.patch ./prepare_ diff --git a/scripts/auto_openwrt_next b/scripts/auto_openwrt_next new file mode 100755 index 0000000..94dcfe1 --- /dev/null +++ b/scripts/auto_openwrt_next @@ -0,0 +1,26 @@ +#!/bin/sh + +#= auto build example + +## hyphop ## + +set -e + +export LINUX_VER=linux-5.4-rc5 + +./kernel_prepare + +./patch_ ../patches/$LINUX_VER/*.patch +./patch_ ../patches/wifi2/*.patch + +#exit 0 + +./make_kernel_mainline_vimsX -n +./kernel_config ../files/configs/mmc_y +./kernel_config ../files/configs/eth2_y + +NOPOST=1 ./make_kernel_mainline_vimsX dtbs || echo "[w] ups...">&2 + +./make_kernel_mainline_vimsX + +TAR=1 ./make_kernel_mainline_vimsX_modules