aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
diff options
context:
space:
mode:
authorPiotr Haber <phaber@broadcom.com>2013-04-05 04:57:42 -0400
committerJohn W. Linville <linville@tuxdriver.com>2013-04-08 15:28:42 -0400
commitbaa9e60927331c3324fccf4c39485e857d8472eb (patch)
tree68ab91b3d8ab5c35571e91f566e07c41805f5658 /drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
parent5f38b6836083b96613ebe8a0a43cde3400dd4a1b (diff)
brcmfmac: read firmware console without trap indication
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> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c')
-rw-r--r--drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c30
1 files 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 d2a9d78e2669..ac9f650772fc 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,
2804 int error, res; 2804 int error, res;
2805 char buf[350]; 2805 char buf[350];
2806 struct brcmf_trap_info tr; 2806 struct brcmf_trap_info tr;
2807 int nbytes;
2808 loff_t pos = 0; 2807 loff_t pos = 0;
2809 2808
2810 if ((sh->flags & SDPCM_SHARED_TRAP) == 0) 2809 if ((sh->flags & SDPCM_SHARED_TRAP) == 0) {
2810 brcmf_dbg(INFO, "no trap in firmware\n");
2811 return 0; 2811 return 0;
2812 }
2812 2813
2813 error = brcmf_sdbrcm_membytes(bus, false, sh->trap_addr, (u8 *)&tr, 2814 error = brcmf_sdbrcm_membytes(bus, false, sh->trap_addr, (u8 *)&tr,
2814 sizeof(struct brcmf_trap_info)); 2815 sizeof(struct brcmf_trap_info));
2815 if (error < 0) 2816 if (error < 0)
2816 return error; 2817 return error;
2817 2818
2818 nbytes = brcmf_sdio_dump_console(bus, sh, data, count);
2819 if (nbytes < 0)
2820 return nbytes;
2821
2822 res = scnprintf(buf, sizeof(buf), 2819 res = scnprintf(buf, sizeof(buf),
2823 "dongle trap info: type 0x%x @ epc 0x%08x\n" 2820 "dongle trap info: type 0x%x @ epc 0x%08x\n"
2824 " cpsr 0x%08x spsr 0x%08x sp 0x%08x\n" 2821 " 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,
2834 le32_to_cpu(tr.r4), le32_to_cpu(tr.r5), 2831 le32_to_cpu(tr.r4), le32_to_cpu(tr.r5),
2835 le32_to_cpu(tr.r6), le32_to_cpu(tr.r7)); 2832 le32_to_cpu(tr.r6), le32_to_cpu(tr.r7));
2836 2833
2837 error = simple_read_from_buffer(data+nbytes, count, &pos, buf, res); 2834 return simple_read_from_buffer(data, count, &pos, buf, res);
2838 if (error < 0)
2839 return error;
2840
2841 nbytes += error;
2842 return nbytes;
2843} 2835}
2844 2836
2845static int brcmf_sdio_assert_info(struct brcmf_sdio *bus, 2837static 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,
2921 error = brcmf_sdio_assert_info(bus, &sh, data, count); 2913 error = brcmf_sdio_assert_info(bus, &sh, data, count);
2922 if (error < 0) 2914 if (error < 0)
2923 goto done; 2915 goto done;
2924
2925 nbytes = error; 2916 nbytes = error;
2926 error = brcmf_sdio_trap_info(bus, &sh, data, count); 2917
2918 error = brcmf_sdio_trap_info(bus, &sh, data+nbytes, count);
2927 if (error < 0) 2919 if (error < 0)
2928 goto done; 2920 goto done;
2921 nbytes += error;
2922
2923 error = brcmf_sdio_dump_console(bus, &sh, data+nbytes, count);
2924 if (error < 0)
2925 goto done;
2926 nbytes += error;
2929 2927
2930 error += nbytes; 2928 error = nbytes;
2931 *ppos += error; 2929 *ppos += nbytes;
2932done: 2930done:
2933 return error; 2931 return error;
2934} 2932}