* [PATCH INTERNAL V2 1/1] brcmfmac: add console log support with configurable read size
@ 2017-11-22 1:26 Li Jin
2017-12-04 15:15 ` Kalle Valo
0 siblings, 1 reply; 3+ messages in thread
From: Li Jin @ 2017-11-22 1:26 UTC (permalink / raw)
To: Kalle Valo, Wright Feng, Chi-Hsien Lin, Hante Meuleman,
Franky Lin, Arend van Spriel
Cc: linux-kernel, netdev, brcm80211-dev-list, brcm80211-dev-list.pdl,
linux-wireless, Jason Uy, Li Jin
From: Jason Uy <jason.uy@broadcom.com>
Add support for configurable read size so that older wifi
chips that have size restrictions can be supported.
Signed-off-by: Jason Uy <jason.uy@broadcom.com>
Reviewed-by: Ray Jui <ray.jui@broadcom.com>
Reviewed-by: Scott Branden <scott.branden@broadcom.com>
Signed-off-by: Li Jin <li.jin@broadcom.com>
---
.../wireless/broadcom/brcm80211/brcmfmac/common.c | 5 +++
.../wireless/broadcom/brcm80211/brcmfmac/common.h | 2 ++
.../wireless/broadcom/brcm80211/brcmfmac/sdio.c | 39 ++++++++++++++++++++--
3 files changed, 43 insertions(+), 3 deletions(-)
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
index 7a2b495..e1bfcaa 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
@@ -52,6 +52,10 @@ int brcmf_msg_level;
module_param_named(debug, brcmf_msg_level, int, S_IRUSR | S_IWUSR);
MODULE_PARM_DESC(debug, "Level of debug output");
+static unsigned int brcmf_log_size;
+module_param_named(logsize, brcmf_log_size, int, 0000);
+MODULE_PARM_DESC(logsize, "Size of log output to read each time");
+
static int brcmf_p2p_enable;
module_param_named(p2pon, brcmf_p2p_enable, int, 0);
MODULE_PARM_DESC(p2pon, "Enable legacy p2p management functionality");
@@ -287,6 +291,7 @@ struct brcmf_mp_device *brcmf_get_module_param(struct device *dev,
settings->feature_disable = brcmf_feature_disable;
settings->fcmode = brcmf_fcmode;
settings->roamoff = !!brcmf_roamoff;
+ settings->log_size = brcmf_log_size;
#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 a62f8e7..f3eab04 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.h
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.h
@@ -51,6 +51,7 @@ extern struct brcmf_mp_global_t brcmf_mp_global;
* @roamoff: Firmware roaming off?
* @ignore_probe_fail: Ignore probe failure.
* @country_codes: If available, pointer to struct for translating country codes
+ * @log_size: limit the read size when accessing log from wifi chip
* @bus: Bus specific platform data. Only SDIO at the mmoment.
*/
struct brcmf_mp_device {
@@ -60,6 +61,7 @@ struct brcmf_mp_device {
bool roamoff;
bool ignore_probe_fail;
struct brcmfmac_pd_cc *country_codes;
+ unsigned int log_size;
union {
struct brcmfmac_sdio_pd sdio;
} bus;
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
index 613caca..71ba680 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
@@ -2790,6 +2790,10 @@ static int brcmf_sdio_readconsole(struct brcmf_sdio *bus)
u8 line[CONSOLE_LINE_MAX], ch;
u32 n, idx, addr;
int rv;
+ unsigned int left_to_read;
+ unsigned int offset;
+ unsigned int cur_read_size;
+ unsigned int log_size = bus->sdiodev->settings->log_size;
/* Don't do anything until FWREADY updates console address */
if (bus->console_addr == 0)
@@ -2823,9 +2827,38 @@ static int brcmf_sdio_readconsole(struct brcmf_sdio *bus)
/* Read the console buffer */
addr = le32_to_cpu(c->log_le.buf);
- rv = brcmf_sdiod_ramrw(bus->sdiodev, false, addr, c->buf, c->bufsize);
- if (rv < 0)
- return rv;
+
+ if (log_size > 0) {
+ /* limit the amount of data to read in case wifi chip has
+ * restrictions
+ */
+ left_to_read = c->bufsize;
+ offset = 0;
+ while (left_to_read) {
+ cur_read_size = (left_to_read > log_size) ?
+ log_size :
+ left_to_read;
+
+ rv = brcmf_sdiod_ramrw(bus->sdiodev,
+ false,
+ addr + offset,
+ c->buf + offset,
+ cur_read_size);
+ if (rv < 0)
+ return rv;
+
+ left_to_read -= cur_read_size;
+ offset += cur_read_size;
+ }
+ } else {
+ rv = brcmf_sdiod_ramrw(bus->sdiodev,
+ false,
+ addr,
+ c->buf,
+ c->bufsize);
+ if (rv < 0)
+ return rv;
+ }
while (c->last != idx) {
for (n = 0; n < CONSOLE_LINE_MAX - 2; n++) {
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH INTERNAL V2 1/1] brcmfmac: add console log support with configurable read size
2017-11-22 1:26 [PATCH INTERNAL V2 1/1] brcmfmac: add console log support with configurable read size Li Jin
@ 2017-12-04 15:15 ` Kalle Valo
2017-12-04 17:11 ` Li Jin
0 siblings, 1 reply; 3+ messages in thread
From: Kalle Valo @ 2017-12-04 15:15 UTC (permalink / raw)
To: Li Jin
Cc: Wright Feng, Chi-Hsien Lin, Hante Meuleman, Franky Lin,
Arend van Spriel, linux-kernel, netdev, brcm80211-dev-list,
brcm80211-dev-list.pdl, linux-wireless, Jason Uy
Li Jin <li.jin@broadcom.com> writes:
> From: Jason Uy <jason.uy@broadcom.com>
>
> Add support for configurable read size so that older wifi
> chips that have size restrictions can be supported.
>
> Signed-off-by: Jason Uy <jason.uy@broadcom.com>
> Reviewed-by: Ray Jui <ray.jui@broadcom.com>
> Reviewed-by: Scott Branden <scott.branden@broadcom.com>
> Signed-off-by: Li Jin <li.jin@broadcom.com>
Arend, am I supposed to apply this even if there's this "INTERNAL" tag
in the Subject?
--
Kalle Valo
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: [PATCH INTERNAL V2 1/1] brcmfmac: add console log support with configurable read size
2017-12-04 15:15 ` Kalle Valo
@ 2017-12-04 17:11 ` Li Jin
0 siblings, 0 replies; 3+ messages in thread
From: Li Jin @ 2017-12-04 17:11 UTC (permalink / raw)
To: Kalle Valo
Cc: Wright Feng, Chi-Hsien Lin, Hante Meuleman, Franky Lin,
Arend Van Spriel, linux-kernel, netdev, brcm80211-dev-list,
BRCM80211-DEV-LIST,PDL, linux-wireless, Jason Uy
Hi Kalle,
Apologies. The title of this patch should be EXTERNAL. I put down INTERNAL
by mistake.
Thanks!
Li
-----Original Message-----
From: Kalle Valo [mailto:kvalo@codeaurora.org]
Sent: Monday, December 4, 2017 7:15 AM
To: Li Jin
Cc: Wright Feng; Chi-Hsien Lin; Hante Meuleman; Franky Lin; Arend van
Spriel; linux-kernel@vger.kernel.org; netdev@vger.kernel.org;
brcm80211-dev-list@cypress.com; brcm80211-dev-list.pdl@broadcom.com;
linux-wireless@vger.kernel.org; Jason Uy
Subject: Re: [PATCH INTERNAL V2 1/1] brcmfmac: add console log support
with configurable read size
Li Jin <li.jin@broadcom.com> writes:
> From: Jason Uy <jason.uy@broadcom.com>
>
> Add support for configurable read size so that older wifi chips that
> have size restrictions can be supported.
>
> Signed-off-by: Jason Uy <jason.uy@broadcom.com>
> Reviewed-by: Ray Jui <ray.jui@broadcom.com>
> Reviewed-by: Scott Branden <scott.branden@broadcom.com>
> Signed-off-by: Li Jin <li.jin@broadcom.com>
Arend, am I supposed to apply this even if there's this "INTERNAL" tag in
the Subject?
--
Kalle Valo
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-12-04 17:12 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-22 1:26 [PATCH INTERNAL V2 1/1] brcmfmac: add console log support with configurable read size Li Jin
2017-12-04 15:15 ` Kalle Valo
2017-12-04 17:11 ` Li Jin
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).