From patchwork Fri Nov 2 08:24:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wright Feng X-Patchwork-Id: 10665133 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 9CF4114E2 for ; Fri, 2 Nov 2018 08:24:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 73C412BC3F for ; Fri, 2 Nov 2018 08:24:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 682052BC6E; Fri, 2 Nov 2018 08:24:38 +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,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 E7E202BC3F for ; Fri, 2 Nov 2018 08:24:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728018AbeKBRa5 (ORCPT ); Fri, 2 Nov 2018 13:30:57 -0400 Received: from mail-eopbgr700122.outbound.protection.outlook.com ([40.107.70.122]:9621 "EHLO NAM04-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726713AbeKBRa5 (ORCPT ); Fri, 2 Nov 2018 13:30:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cypress.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+FLCZ/1RuQrU1GpJGGHAL+Qs4hNvEeuD83mk4pstrPo=; b=odmczB2E7lwhwd0NmjiiiIlBm9Xs/5JS8uaGhzHVixP7ba+FOBkZ8DL5NlHvR+3YIkwyRuXv4bwdSyoJVelVUz+lj4S+x2NO5dOxXlodPwE9rLBiVgNnpyCkW8JL3DzGakZlrvD+MYhIMHW/uhdhdvpUGc+TU20rSxuP0qcxV4Y= Received: from BYAPR06MB3992.namprd06.prod.outlook.com (52.135.200.22) by BYAPR06MB5062.namprd06.prod.outlook.com (20.177.186.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.26; Fri, 2 Nov 2018 08:24:33 +0000 Received: from BYAPR06MB3992.namprd06.prod.outlook.com ([fe80::2147:2944:5ff:e986]) by BYAPR06MB3992.namprd06.prod.outlook.com ([fe80::2147:2944:5ff:e986%3]) with mapi id 15.20.1294.024; Fri, 2 Nov 2018 08:24:33 +0000 From: Wright Feng To: "linux-wireless@vger.kernel.org" CC: Wright Feng , "arend.vanspriel@broadcom.com" , "franky.lin@broadcom.com" , "hante.meuleman@broadcom.com" , "kvalo@codeaurora.org" , Chi-Hsien Lin , "brcm80211-dev-list.pdl@broadcom.com" Subject: [PATCH v2 1/2] brcmfmac: add credit numbers updating support Thread-Topic: [PATCH v2 1/2] brcmfmac: add credit numbers updating support Thread-Index: AQHUcoV77Viu1Up5UUCF/8H+MssHlQ== Date: Fri, 2 Nov 2018 08:24:33 +0000 Message-ID: <20181102082403.11676-2-wright.feng@cypress.com> References: <20181102082403.11676-1-wright.feng@cypress.com> In-Reply-To: <20181102082403.11676-1-wright.feng@cypress.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: TYAPR01CA0164.jpnprd01.prod.outlook.com (2603:1096:404:7e::32) To BYAPR06MB3992.namprd06.prod.outlook.com (2603:10b6:a02:90::22) x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [61.222.14.99] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BYAPR06MB5062;6:Qpj0vSpKfuYOgVm0MZZf2sNaOG6wK8rwlItjiwwhLqR4fbxASV/e5AmGoGCxrXd4IKy8R8ebKIfysgwb1/iPpJB6v3BU7gRRg4W7LcCpfDmXMDNtpoPvuj5b4eg/04bD094RSv2lzruPIivBwbkG4ffQ0M11lj3ItI6Rq/XT8yZfzATWbvlKgN/6CFhnyt5NkeSoMQ6+5XnKEePg1EHWTRhQG3B5PVxWY7OuhM0WfIDd1pR1ZGajhyD8qPrJbDv1p1m+wZcr7N2W9T4VJ4qX13Ko4+zZGXur+TUMMn+IHbgZd7bOQb4414MGNGTepvT+TCgll6kNFuo1Qcv/XpA0B3qfaACuT4rBLgoEapKX+iTNya6tceMO2JYNBrJQuJmJDhX1Sx7wDXMZZefTVBUp1ndMXhgM6NA3pLYTgBCRinD7qccU2oL0iUAksoKHLzbtpeswYnCyJ+Wi//cy+ZFukQ==;5:zhR6jKJzPNNVc03+l71rwTAUmA27+Lp9xp2OECyrFsRCPSiUd72iEC7Eq4QGh2AtNW3N85q1ta3Yuf61FTqYEvpMmrc9x0pVIt5j/DUPJucZu5GVvSfhaozplZ6N5Y4Axd1xfhJ/6imAaST5YNPEb96FGLOPfjFvoUNZi9Rt6S8=;7:bMECYtQzXYMftN+vbT97b4UI4dI6G00Tz2JRsDDno9W3IlEke+MvGe8BkwKu6VR3ss07TXKBqk2CxVbMUVPWvf3OPErsf/Xw/YwywxZNR9DzQBLPana2FUWGG4uEO7wmIxtEwyHvTeCrh3ild6Gc9A== x-ms-office365-filtering-correlation-id: 90029e7a-6ad7-44b6-7367-08d6409c9e1c x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020);SRVR:BYAPR06MB5062; x-ms-traffictypediagnostic: BYAPR06MB5062: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Wright.Feng@cypress.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(788757137089)(258095267146985); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(3231382)(944501410)(52105095)(3002001)(10201501046)(6055026)(148016)(149066)(150057)(6041310)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051)(76991095);SRVR:BYAPR06MB5062;BCL:0;PCL:0;RULEID:;SRVR:BYAPR06MB5062; x-forefront-prvs: 08444C7C87 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(136003)(396003)(39860400002)(366004)(376002)(346002)(189003)(199004)(7736002)(6436002)(256004)(71200400001)(8936002)(14444005)(71190400001)(97736004)(66066001)(316002)(3846002)(81156014)(5660300001)(76176011)(81166006)(6116002)(25786009)(8676002)(476003)(102836004)(446003)(478600001)(99286004)(2501003)(11346002)(26005)(106356001)(2351001)(105586002)(44832011)(6506007)(386003)(4326008)(52116002)(2900100001)(54906003)(305945005)(2616005)(486006)(2906002)(6486002)(86362001)(72206003)(5640700003)(186003)(14454004)(36756003)(1076002)(53936002)(68736007)(6916009)(6512007);DIR:OUT;SFP:1102;SCL:1;SRVR:BYAPR06MB5062;H:BYAPR06MB3992.namprd06.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: cypress.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: 0pKdJ6FUiuNWdpGN6CDXbEvgewuG6DTF3wO/LEgzVifn0kouIdY5FPl04YCXOIuklLusZZKXlB0Z8HXt9cFRauGhBkM14ig+EME13qYSD2EwpLqh9OC+jkgC/9JceZ8vk1w3AJSS3wXEnCyiBhlennRmj3H40MaYxgCiJHcId2hFByvQEOiXVKTuM75f/W1hfjSMxOAh4O7BTQi3lbDjO25A5d1kHKEocKmwI9py2pl+h9FHzhcwllEP3+0vuMyZd36FZzuPFmQhWlWmPPkgfjIo4ym1DpJrfHbjjp68MROMy/9kmC7jqLBr3/U9PMxk+aW86+C23TakzM3NYgJYJcEfHGhXwzwTMd29+QGpZP0= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: cypress.com X-MS-Exchange-CrossTenant-Network-Message-Id: 90029e7a-6ad7-44b6-7367-08d6409c9e1c X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Nov 2018 08:24:33.4838 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 011addfc-2c09-450d-8938-e0bbc2dd2376 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR06MB5062 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 credit numbers are static and tunable per chip in firmware side. However the credit number may be changed that is based on packet pool length and will send BRCMF_E_FIFO_CREDIT_MAP event to notify host driver updates the credit numbers during interface up. The purpose of this patch is making host driver has ability of updating the credit numbers when receiving the BRCMF_E_FIFO_CREDIT_MAP event. Signed-off-by: Wright Feng --- v2: replace brcmf_err with WARN_ONCE --- .../broadcom/brcm80211/brcmfmac/fwsignal.c | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c index f3cbf78c8899..c75be2703b3e 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c @@ -511,6 +511,7 @@ struct brcmf_fws_info { struct work_struct fws_dequeue_work; u32 fifo_enqpkt[BRCMF_FWS_FIFO_COUNT]; int fifo_credit[BRCMF_FWS_FIFO_COUNT]; + int init_fifo_credit[BRCMF_FWS_FIFO_COUNT]; int credits_borrowed[BRCMF_FWS_FIFO_AC_VO + 1]; int deq_node_pos[BRCMF_FWS_FIFO_COUNT]; u32 fifo_credit_map; @@ -1237,6 +1238,9 @@ static void brcmf_fws_return_credits(struct brcmf_fws_info *fws, } fws->fifo_credit[fifo] += credits; + if (fws->fifo_credit[fifo] > fws->init_fifo_credit[fifo]) + fws->fifo_credit[fifo] = fws->init_fifo_credit[fifo]; + } static void brcmf_fws_schedule_deq(struct brcmf_fws_info *fws) @@ -1595,19 +1599,21 @@ static int brcmf_fws_notify_credit_map(struct brcmf_if *ifp, brcmf_err("event payload too small (%d)\n", e->datalen); return -EINVAL; } - if (fws->creditmap_received) - return 0; fws->creditmap_received = true; brcmf_dbg(TRACE, "enter: credits %pM\n", credits); brcmf_fws_lock(fws); for (i = 0; i < ARRAY_SIZE(fws->fifo_credit); i++) { - if (*credits) + fws->fifo_credit[i] += credits[i] - fws->init_fifo_credit[i]; + fws->init_fifo_credit[i] = credits[i]; + if (fws->fifo_credit[i] > 0) fws->fifo_credit_map |= 1 << i; else fws->fifo_credit_map &= ~(1 << i); - fws->fifo_credit[i] = *credits++; + WARN_ONCE(fws->fifo_credit[i] < 0, + "fifo_credit[%d] is negative(%d)\n", i, + fws->fifo_credit[i]); } brcmf_fws_schedule_deq(fws); brcmf_fws_unlock(fws); @@ -2013,7 +2019,7 @@ static int brcmf_fws_borrow_credit(struct brcmf_fws_info *fws) } for (lender_ac = 0; lender_ac <= BRCMF_FWS_FIFO_AC_VO; lender_ac++) { - if (fws->fifo_credit[lender_ac]) { + if (fws->fifo_credit[lender_ac] > 0) { fws->credits_borrowed[lender_ac]++; fws->fifo_credit[lender_ac]--; if (fws->fifo_credit[lender_ac] == 0) @@ -2210,8 +2216,9 @@ static void brcmf_fws_dequeue_worker(struct work_struct *worker) } continue; } - while ((fws->fifo_credit[fifo]) || ((!fws->bcmc_credit_check) && - (fifo == BRCMF_FWS_FIFO_BCMC))) { + while ((fws->fifo_credit[fifo] > 0) || + ((!fws->bcmc_credit_check) && + (fifo == BRCMF_FWS_FIFO_BCMC))) { skb = brcmf_fws_deq(fws, fifo); if (!skb) break; @@ -2222,7 +2229,7 @@ static void brcmf_fws_dequeue_worker(struct work_struct *worker) break; } if ((fifo == BRCMF_FWS_FIFO_AC_BE) && - (fws->fifo_credit[fifo] == 0) && + (fws->fifo_credit[fifo] <= 0) && (!fws->bus_flow_blocked)) { while (brcmf_fws_borrow_credit(fws) == 0) { skb = brcmf_fws_deq(fws, fifo); From patchwork Fri Nov 2 08:24:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wright Feng X-Patchwork-Id: 10665135 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 162821751 for ; Fri, 2 Nov 2018 08:24:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E54562BC3F for ; Fri, 2 Nov 2018 08:24:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D9A522BC6E; Fri, 2 Nov 2018 08:24:45 +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,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 A85C22BC3F for ; Fri, 2 Nov 2018 08:24:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728375AbeKBRbE (ORCPT ); Fri, 2 Nov 2018 13:31:04 -0400 Received: from mail-eopbgr700138.outbound.protection.outlook.com ([40.107.70.138]:27443 "EHLO NAM04-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726713AbeKBRbD (ORCPT ); Fri, 2 Nov 2018 13:31:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cypress.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Matm4AYvkxOgPCSjlVbBFLRFWR0p+YT66eoj+NBtkhY=; b=ggojDXYQLDbOSvu82LcesAHbB0RkQ2/e8N4deDvQTqHQssyjqjZC6L0nhvuPa89ABcvn3czuJiycY7SPHgjLbOFCzcnsxGSygwcBB4mf3M4pxAU+8AUxireoPihUX8I//q++dJOwq8jYAcFuRD/MkTGaWy/i6GWC67rxXfBj1UA= Received: from BYAPR06MB3992.namprd06.prod.outlook.com (52.135.200.22) by BYAPR06MB5062.namprd06.prod.outlook.com (20.177.186.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.26; Fri, 2 Nov 2018 08:24:40 +0000 Received: from BYAPR06MB3992.namprd06.prod.outlook.com ([fe80::2147:2944:5ff:e986]) by BYAPR06MB3992.namprd06.prod.outlook.com ([fe80::2147:2944:5ff:e986%3]) with mapi id 15.20.1294.024; Fri, 2 Nov 2018 08:24:40 +0000 From: Wright Feng To: "linux-wireless@vger.kernel.org" CC: Wright Feng , "arend.vanspriel@broadcom.com" , "franky.lin@broadcom.com" , "hante.meuleman@broadcom.com" , "kvalo@codeaurora.org" , Chi-Hsien Lin , "brcm80211-dev-list.pdl@broadcom.com" Subject: [PATCH v2 2/2] brcmfmac: make firmware frameburst mode a module parameter Thread-Topic: [PATCH v2 2/2] brcmfmac: make firmware frameburst mode a module parameter Thread-Index: AQHUcoV/WIxtZ0hPo0CVXdK0lG3H5g== Date: Fri, 2 Nov 2018 08:24:40 +0000 Message-ID: <20181102082403.11676-3-wright.feng@cypress.com> References: <20181102082403.11676-1-wright.feng@cypress.com> In-Reply-To: <20181102082403.11676-1-wright.feng@cypress.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: TYAPR01CA0075.jpnprd01.prod.outlook.com (2603:1096:404:2c::15) To BYAPR06MB3992.namprd06.prod.outlook.com (2603:10b6:a02:90::22) x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [61.222.14.99] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BYAPR06MB5062;6:wcWkgMC3QhkkBk7F23jbYeVFYqOTg40HF/gQzIofYU+QcgXC4Q4pNKhQ+vQIw+mGVSiWFoVS2o5wW9PrYtSmka+xsSd+N+DIMgm7Db4Os8BA9yvFewfnXDZXLHLroUV0OdDBr9v5yV8+ZT5zC8OJpU6/e75XLN63yEF+fdbgNgJzdrZ4YvT1NjO3nkMnFQP7cB3D2LurC44lWgCWpivpiXAiE+HFHyQkwTos4DryManKjbn1TXnAn9OfScxF7n5RSBXOQK7zThsLPFkBBMW2ZdT7/zhWrI+GCC+eOny+nUF8P3nuAEzzkXtfFML7fIb+QpJUGg4ve63A7er4AdKHjpuneB+vnkEl5Ht4iqg1XkcbK1/Oyt2/JBmP/pLVwwnaIP43FirE+aUfL0dcKEaLUivB17thgUJAaXvGbZbSOok0utQn19uSzxikVnZFM4Br4F3fy4f5BeoHBuaOzcx5Yg==;5:Mcx7zxHu1HTVjuKvjbvKpd22Idezter+Ip2ThfstT7N3Rp83AunQRjs9DetAp/g5SOY0jdmd6E9K1hCwDoFwg0nXx5WREvAv9O2ro1ssuioWMQpzYIwOOdxbYzwGJWZsrAScgUm+9Ibs+Z8OQ3MEQNUC5FYUlZ6leWKdosfs3oc=;7:SZvT9BzrDzXg3w/uvFMFPl4FhX2WLrf/QVqk53a2Xk+20qq9eaxx2QCA+B9q1RdzthapdtaMB7A0g+Ne5mxA2MH/w/pFH38/CEQZRrr6/48MAR959vDXGQR3JKreT4ql8pUsPMMpB0hLoKmirUFeSA== x-ms-office365-filtering-correlation-id: f3b9e2d1-7bb2-4c9c-a795-08d6409ca23c x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020);SRVR:BYAPR06MB5062; x-ms-traffictypediagnostic: BYAPR06MB5062: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Wright.Feng@cypress.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(258095267146985); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(3231382)(944501410)(52105095)(3002001)(10201501046)(6055026)(148016)(149066)(150057)(6041310)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051)(76991095);SRVR:BYAPR06MB5062;BCL:0;PCL:0;RULEID:;SRVR:BYAPR06MB5062; x-forefront-prvs: 08444C7C87 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(136003)(396003)(39860400002)(366004)(376002)(346002)(189003)(199004)(7736002)(6436002)(256004)(71200400001)(8936002)(14444005)(71190400001)(97736004)(66066001)(316002)(3846002)(81156014)(5660300001)(76176011)(81166006)(6116002)(25786009)(8676002)(476003)(102836004)(446003)(478600001)(99286004)(2501003)(11346002)(26005)(106356001)(2351001)(105586002)(44832011)(6506007)(386003)(4326008)(52116002)(2900100001)(54906003)(305945005)(2616005)(486006)(2906002)(6486002)(86362001)(72206003)(5640700003)(186003)(14454004)(36756003)(1076002)(53936002)(68736007)(6916009)(6512007)(309714004);DIR:OUT;SFP:1102;SCL:1;SRVR:BYAPR06MB5062;H:BYAPR06MB3992.namprd06.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: cypress.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: SFz6wD/vVfaRMUau2uSPRY7RyaVxIxmdyX3WDXaTiAR8MhwK4xx0ipltIX/TztDmzrjhZHB+7VdA9Xgcxo7UKxpzhvUVxvelQg+rIqEIGsJ1Oa4ZalWEQ6tawiP0YgAMe12IikMxYOvoeBJI4AWPjbarMrr6mR46Dnp+AYwNCURjoW2b1UvLVQ1evw1WZ2BgHt7HjydFKdvgvLC3amMXxZ7GPdbQZP2WuwyYnHE2Vzg1IPIZGTFMCIVM6j9AvwhxZ9+2+yb1/mHu/NNClOB0ETsD2X1r6ng1PKgN2WOTlFzlBW0i1jwFAHiPCGUBAOt3hM5U7pVU1t+bT5vC2+QQQr0EKL3eGKx95o7hw5iEnDs= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: cypress.com X-MS-Exchange-CrossTenant-Network-Message-Id: f3b9e2d1-7bb2-4c9c-a795-08d6409ca23c X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Nov 2018 08:24:40.3276 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 011addfc-2c09-450d-8938-e0bbc2dd2376 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR06MB5062 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 This patch is for adding a new module parameter "frameburst". With setting "frameburst=1" in module parameters, firmware frameburst mode will be enabled. The feature can enable per-packet framebursting in firmware side and get higher TX throughput in High Throughput(HT) mode. Signed-off-by: Wright Feng --- .../net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 7 +++++++ drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c | 5 +++++ drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.h | 2 ++ drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil.h | 1 + 4 files changed, 15 insertions(+) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c index 230a378c26fc..4a05d3f50cff 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c @@ -6638,6 +6638,13 @@ static s32 brcmf_config_dongle(struct brcmf_cfg80211_info *cfg) brcmf_configure_arp_nd_offload(ifp, true); + if (ifp->drvr->settings->frameburst) { + err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_FAKEFRAG, 1); + if (err) + brcmf_info("setting frameburst mode failed\n"); + brcmf_dbg(INFO, "frameburst mode enabled\n"); + } + cfg->dongle_up = true; default_conf_out: diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c index 94044a7a6021..0ad4c3196e5d 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c @@ -78,6 +78,10 @@ static int brcmf_iapp_enable; module_param_named(iapp, brcmf_iapp_enable, int, 0); MODULE_PARM_DESC(iapp, "Enable partial support for the obsoleted Inter-Access Point Protocol"); +static int brcmf_frameburst; +module_param_named(frameburst, brcmf_frameburst, int, 0); +MODULE_PARM_DESC(frameburst, "Enable firmware frameburst feature"); + #ifdef DEBUG /* always succeed brcmf_bus_started() */ static int brcmf_ignore_probe_fail; @@ -419,6 +423,7 @@ struct brcmf_mp_device *brcmf_get_module_param(struct device *dev, settings->fcmode = brcmf_fcmode; settings->roamoff = !!brcmf_roamoff; settings->iapp = !!brcmf_iapp_enable; + settings->frameburst = !!brcmf_frameburst; #ifdef DEBUG settings->ignore_probe_fail = !!brcmf_ignore_probe_fail; #endif diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.h b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.h index a34642cb4d2f..b91975258a68 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.h +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.h @@ -47,6 +47,7 @@ extern struct brcmf_mp_global_t brcmf_mp_global; * @feature_disable: Feature_disable bitmask. * @fcmode: FWS flow control. * @roamoff: Firmware roaming off? + * @frameburst: Firmware frame burst mode. * @ignore_probe_fail: Ignore probe failure. * @country_codes: If available, pointer to struct for translating country codes * @bus: Bus specific platform data. Only SDIO at the mmoment. @@ -57,6 +58,7 @@ struct brcmf_mp_device { int fcmode; bool roamoff; bool iapp; + bool frameburst; bool ignore_probe_fail; struct brcmfmac_pd_cc *country_codes; union { diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil.h b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil.h index 63b1287e2e6d..b6b183b18413 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil.h +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil.h @@ -80,6 +80,7 @@ #define BRCMF_C_SCB_DEAUTHENTICATE_FOR_REASON 201 #define BRCMF_C_SET_ASSOC_PREFER 205 #define BRCMF_C_GET_VALID_CHANNELS 217 +#define BRCMF_C_SET_FAKEFRAG 219 #define BRCMF_C_GET_KEY_PRIMARY 235 #define BRCMF_C_SET_KEY_PRIMARY 236 #define BRCMF_C_SET_SCAN_PASSIVE_TIME 258