From: "Arend van Spriel" <arend@broadcom.com>
To: "John W. Linville" <linville@tuxdriver.com>
Cc: linux-wireless <linux-wireless@vger.kernel.org>,
"Piotr Haber" <phaber@broadcom.com>,
"Arend van Spriel" <arend@broadcom.com>
Subject: [PATCH 04/16] brcmfmac: read firmware console without trap indication
Date: Fri, 5 Apr 2013 10:57:42 +0200 [thread overview]
Message-ID: <1365152274-4252-5-git-send-email-arend@broadcom.com> (raw)
In-Reply-To: <1365152274-4252-1-git-send-email-arend@broadcom.com>
From: Piotr Haber <phaber@broadcom.com>
Firmware console output can be read also when there was
no trap indication.
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Piotr Haber <phaber@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
---
drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c | 30 +++++++++-----------
1 file changed, 14 insertions(+), 16 deletions(-)
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c b/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
index d2a9d78..ac9f650 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
@@ -2804,21 +2804,18 @@ static int brcmf_sdio_trap_info(struct brcmf_sdio *bus, struct sdpcm_shared *sh,
int error, res;
char buf[350];
struct brcmf_trap_info tr;
- int nbytes;
loff_t pos = 0;
- if ((sh->flags & SDPCM_SHARED_TRAP) == 0)
+ if ((sh->flags & SDPCM_SHARED_TRAP) == 0) {
+ brcmf_dbg(INFO, "no trap in firmware\n");
return 0;
+ }
error = brcmf_sdbrcm_membytes(bus, false, sh->trap_addr, (u8 *)&tr,
sizeof(struct brcmf_trap_info));
if (error < 0)
return error;
- nbytes = brcmf_sdio_dump_console(bus, sh, data, count);
- if (nbytes < 0)
- return nbytes;
-
res = scnprintf(buf, sizeof(buf),
"dongle trap info: type 0x%x @ epc 0x%08x\n"
" cpsr 0x%08x spsr 0x%08x sp 0x%08x\n"
@@ -2834,12 +2831,7 @@ static int brcmf_sdio_trap_info(struct brcmf_sdio *bus, struct sdpcm_shared *sh,
le32_to_cpu(tr.r4), le32_to_cpu(tr.r5),
le32_to_cpu(tr.r6), le32_to_cpu(tr.r7));
- error = simple_read_from_buffer(data+nbytes, count, &pos, buf, res);
- if (error < 0)
- return error;
-
- nbytes += error;
- return nbytes;
+ return simple_read_from_buffer(data, count, &pos, buf, res);
}
static int brcmf_sdio_assert_info(struct brcmf_sdio *bus,
@@ -2921,14 +2913,20 @@ static int brcmf_sdbrcm_died_dump(struct brcmf_sdio *bus, char __user *data,
error = brcmf_sdio_assert_info(bus, &sh, data, count);
if (error < 0)
goto done;
-
nbytes = error;
- error = brcmf_sdio_trap_info(bus, &sh, data, count);
+
+ error = brcmf_sdio_trap_info(bus, &sh, data+nbytes, count);
if (error < 0)
goto done;
+ nbytes += error;
+
+ error = brcmf_sdio_dump_console(bus, &sh, data+nbytes, count);
+ if (error < 0)
+ goto done;
+ nbytes += error;
- error += nbytes;
- *ppos += error;
+ error = nbytes;
+ *ppos += nbytes;
done:
return error;
}
--
1.7.10.4
next prev parent reply other threads:[~2013-04-05 8:58 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-05 8:57 [PATCH 00/16] brcm80211: patches providing new functionality Arend van Spriel
2013-04-05 8:57 ` [PATCH 01/16] brcmfmac: fix unaligned access in TXSTATUS signal handling Arend van Spriel
2013-04-05 8:57 ` [PATCH 02/16] brcmfmac: handle firmware signalling destination entry state Arend van Spriel
2013-04-05 8:57 ` [PATCH 03/16] brcmfmac: handle firmware signals requesting for packets Arend van Spriel
2013-04-05 8:57 ` Arend van Spriel [this message]
2013-04-05 8:57 ` [PATCH 05/16] brcmfmac: firmware shared data version fix Arend van Spriel
2013-04-05 8:57 ` [PATCH 06/16] brcmfmac: add hexadecimal trace of message payload Arend van Spriel
2013-04-05 8:57 ` [PATCH 07/16] brcmfmac: add role attribute to struct brcmf_if_event definition Arend van Spriel
2013-04-05 8:57 ` [PATCH 08/16] brcmfmac: remove condition for calling event handler Arend van Spriel
2013-04-05 8:57 ` [PATCH 09/16] brcmfmac: remove use of unconditional access of struct wireless_dev::netdev Arend van Spriel
2013-04-05 8:57 ` [PATCH 10/16] brcmfmac: use struct brcmf_if instance as parameter in brcmf_set_mpc() Arend van Spriel
2013-04-05 8:57 ` [PATCH 11/16] brcmfmac: use struct brcmf_if instance iso netdevice in escan functions Arend van Spriel
2013-04-05 8:57 ` [PATCH 12/16] brcmfmac: support creation of P2P_DEVICE through user-space Arend van Spriel
2013-04-05 8:57 ` [PATCH 13/16] brcmfmac: wait for firmware event when creating P2P_DEVICE interface Arend van Spriel
2013-04-05 8:57 ` [PATCH 14/16] brcmfmac: fix reception of P2P probe requests on " Arend van Spriel
2013-04-05 8:57 ` [PATCH 15/16] brcmfmac: obtain wdev using vif object in action frame rx Arend van Spriel
2013-04-05 8:57 ` [PATCH 16/16] brcmfmac: only use ifidx from BDC header in brcmf_rx_frames() Arend van Spriel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1365152274-4252-5-git-send-email-arend@broadcom.com \
--to=arend@broadcom.com \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=phaber@broadcom.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).