From patchwork Thu Feb 21 10:33:24 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: 10823623 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 F03A66C2 for ; Thu, 21 Feb 2019 10:33:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DC0C630656 for ; Thu, 21 Feb 2019 10:33:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CFD3730792; Thu, 21 Feb 2019 10:33:34 +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 7A66830656 for ; Thu, 21 Feb 2019 10:33:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725891AbfBUKdd (ORCPT ); Thu, 21 Feb 2019 05:33:33 -0500 Received: from mail-lj1-f193.google.com ([209.85.208.193]:34140 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725814AbfBUKdd (ORCPT ); Thu, 21 Feb 2019 05:33:33 -0500 Received: by mail-lj1-f193.google.com with SMTP id l5so20132813lje.1 for ; Thu, 21 Feb 2019 02:33:31 -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=J3wkq8BVOiG+cWlYBh4iPXQxstMyGutzZ1BTisCisPI=; b=p82TxakjNJjFmnyYB3RHZz+zgZaBaxugqqS5BqO2HX7UpNvK/eRHxsvLkJYQJQiVSx /mGBzblwsoJlWvpeyb7uVQHjwh8pZHY0/lWQC0rjkuGQZiDeSLgPs+lzeEu5Qq2C8i86 y4o2iLpPy+Ct++Xn4DPiwEHW67E2yuW+8x3uE3roB7v4jRU4FhgszxSKnz0GRCDO730w f0SzdTHHVaan7f9vQFUzpBaXctNSN1CRc18F7UrcKdc/kj7Jbp4EcuCtWyVNs1Nn2wZI karb9KBodrV3AbeGL3LEKRblDUhCHpKb01C4maLNUPucyfH6I+4eHu55y6fwRZSYHeUS zt2g== 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=J3wkq8BVOiG+cWlYBh4iPXQxstMyGutzZ1BTisCisPI=; b=ck0/Mc+NTYeXG76AqNgxji3iunZaMAXY4qC6F0jrbM0GnX0nxeP7Lpm2UuK+uL1mt0 z4Nkl9e9Zx3avAumx6KZWJOLncCDmA6R6Y9sVJvhJnQib7eHnzaP87VIEvtQlwVaDEbF tfbpWevNsp1snSzu1xd/sgzy/PzI2t2ffzVl30HHUZFLv3/OVlsUm1humHR52PKp40UY xUQ8XBXr+HYCRBKrqMnSB60krEZOLTRniQyGqcSh5v/9fFO1huS/5oqn60zcrqNPx0Dh HA4/ZWLBh5V9bkletnn5CxjOIVq/D/YikyhZPPmCHzn9E0iookHjvqbsGQU5PaizmxCy HTRw== X-Gm-Message-State: AHQUAuYKp/RC3YZHvSjTYv8Tw5BFtDIpcmn8d4oxbnIVCHvWgbf2+Gy7 NeySSJovBUM7OYR/Cx+wWBY= X-Google-Smtp-Source: AHgI3IZ+EeKV1/OG6NFnKY7DDRepNafjSFWa5HObAmzhKKDsYjIZnCqsmIYypcLj2TkXkS+dlxSkCg== X-Received: by 2002:a2e:6c04:: with SMTP id h4-v6mr23543819ljc.92.1550745210722; Thu, 21 Feb 2019 02:33:30 -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 j14sm6059064lfc.28.2019.02.21.02.33.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Feb 2019 02:33:30 -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 wireless-drivers-next 1/2] brcmfmac: fix size of the struct msgbuf_ring_status Date: Thu, 21 Feb 2019 11:33:24 +0100 Message-Id: <20190221103325.28228-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 This updates host struct to match the in-firmawre definition. It's a cosmetic change as it only applies to the reserved struct space. Fixes: c988b78244df ("brcmfmac: print firmware reported ring status errors") Signed-off-by: Rafał Miłecki --- drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c index aef2d4092872..d711dc8ed606 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c @@ -139,7 +139,7 @@ struct msgbuf_ring_status { struct msgbuf_common_hdr msg; struct msgbuf_completion_hdr compl_hdr; __le16 write_idx; - __le32 rsvd0[5]; + __le16 rsvd0[5]; }; struct msgbuf_rx_event { From patchwork Thu Feb 21 10:33:25 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: 10823625 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 98F476C2 for ; Thu, 21 Feb 2019 10:33:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8690230671 for ; Thu, 21 Feb 2019 10:33:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7AB89307A0; Thu, 21 Feb 2019 10:33:39 +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 1FBEC30671 for ; Thu, 21 Feb 2019 10:33:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726292AbfBUKdi (ORCPT ); Thu, 21 Feb 2019 05:33:38 -0500 Received: from mail-lf1-f66.google.com ([209.85.167.66]:36280 "EHLO mail-lf1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725814AbfBUKdi (ORCPT ); Thu, 21 Feb 2019 05:33:38 -0500 Received: by mail-lf1-f66.google.com with SMTP id q11so19946996lfd.3 for ; Thu, 21 Feb 2019 02:33:35 -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=nxY9KSgz2HbSexuJUIXHkbK//lhKlSJ4neACS/pGpCQ=; b=YHrMGdregDM746gyKCBWeUKO4I8f7hr+FztqSv8VZ9iotIakmBjdWDC4H9qgyg/6nm BcORkPnUJMc+uzQv45mlwyQ/RpHn3YIoUpKupNZ/xzEzpHLcyXWRsHtncBTY0XcdWcyf GdJSE6pZ49lum3DOfE75c8v1CacE4Cx2wIY/qnxbJDuivs7VnViU0tcrglspXaoosEhj Dzcl80w7k+tyQTB248i9dcL8JV2cLmmMXceRSaOv+yyHZ8M4wh7xrRa9ZNi5OCih0fGN 7IhiUB16Kt8NV9ibrVjLGjcTOYrA5K2pXn2Q6ajpnyPyKGFvdlXE1NsxaKh+2Mj/kO1j EExA== 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=nxY9KSgz2HbSexuJUIXHkbK//lhKlSJ4neACS/pGpCQ=; b=IdKFpq8VoLv4P/vPnhacI1+SAhRLgjqikz/myxb1pnfdxEprcry43SWg8dXGSTtlST +qFb0g+cAUfLDCdheoIpm8USkbDNMp/x5v6WCrDp81V5Y51Np5jhbgx4tICJuMtuq/E7 Pg/HrZDse12Ssqv4PEpJpH8beR5nTw60Dzhe7OUtK+DdanLzL2ItWRwymJ1+WH0dxlWV 1+ZtweCZ2vVtUCyCUMC+1Ald9weF0GM3yO+Y+13/o/mlyZIl7PKZptnmOogrw8auyggz fRB54GbxsRf53SwaUTetLIOVsRzTZM1ytO4rVY9DINN3FxVKBVcsoHjmCFykm6ixXhzv MNVA== X-Gm-Message-State: AHQUAuayq1Od86Bz23eiSEV894fR2r7MvJC2zUB8u8tmx8/Z/5bf1orU 5rDzrq4B632puJqLiC3eiqY= X-Google-Smtp-Source: AHgI3IbaS+D1nJ1RoneQ115UJktRyVRGqoHCCp8oEixPz5hzxYHq6lJOh8QjfswSRvu9VkRnhi9h+Q== X-Received: by 2002:a19:9c87:: with SMTP id f129mr6791510lfe.77.1550745214562; Thu, 21 Feb 2019 02:33:34 -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 j14sm6059064lfc.28.2019.02.21.02.33.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Feb 2019 02:33:33 -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 wireless-drivers-next 2/2] brcmfmac: print firmware reported general status errors Date: Thu, 21 Feb 2019 11:33:25 +0100 Message-Id: <20190221103325.28228-2-zajec5@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190221103325.28228-1-zajec5@gmail.com> References: <20190221103325.28228-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 Firmware may report general errors using a special message type. Add basic support for it by simply decoding & printing an error number. A sample situation in which firmware reports a buf error: CONSOLE: 027084.733 no host response IOCTL buffer available..so fail the request will now produce a "Firmware reported general error: 9" on the host. Signed-off-by: Rafał Miłecki Acked-by: Arend van Spriel --- .../broadcom/brcm80211/brcmfmac/msgbuf.c | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c index d711dc8ed606..d3780eae7f19 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c @@ -134,6 +134,14 @@ struct msgbuf_completion_hdr { __le16 flow_ring_id; }; +/* Data struct for the MSGBUF_TYPE_GEN_STATUS */ +struct msgbuf_gen_status { + struct msgbuf_common_hdr msg; + struct msgbuf_completion_hdr compl_hdr; + __le16 write_idx; + __le32 rsvd0[3]; +}; + /* Data struct for the MSGBUF_TYPE_RING_STATUS */ struct msgbuf_ring_status { struct msgbuf_common_hdr msg; @@ -1194,6 +1202,18 @@ brcmf_msgbuf_process_rx_complete(struct brcmf_msgbuf *msgbuf, void *buf) brcmf_netif_rx(ifp, skb); } +static void brcmf_msgbuf_process_gen_status(struct brcmf_msgbuf *msgbuf, + void *buf) +{ + struct msgbuf_gen_status *gen_status = buf; + struct brcmf_pub *drvr = msgbuf->drvr; + int err; + + err = le16_to_cpu(gen_status->compl_hdr.status); + if (err) + bphy_err(drvr, "Firmware reported general error: %d\n", err); +} + static void brcmf_msgbuf_process_ring_status(struct brcmf_msgbuf *msgbuf, void *buf) { @@ -1273,6 +1293,10 @@ static void brcmf_msgbuf_process_msgtype(struct brcmf_msgbuf *msgbuf, void *buf) msg = (struct msgbuf_common_hdr *)buf; switch (msg->msgtype) { + case MSGBUF_TYPE_GEN_STATUS: + brcmf_dbg(MSGBUF, "MSGBUF_TYPE_GEN_STATUS\n"); + brcmf_msgbuf_process_gen_status(msgbuf, buf); + break; case MSGBUF_TYPE_RING_STATUS: brcmf_dbg(MSGBUF, "MSGBUF_TYPE_RING_STATUS\n"); brcmf_msgbuf_process_ring_status(msgbuf, buf);