* [PATCH V2 0/2] brcm80211: minor rework
@ 2014-11-25 19:55 Arend van Spriel
2014-11-25 19:55 ` [PATCH V2 1/2] brcmutil: add helper function to format board revision Arend van Spriel
2014-11-25 19:55 ` [PATCH V2 2/2] brcmsmac: extend hardware info shown in debugfs Arend van Spriel
0 siblings, 2 replies; 5+ messages in thread
From: Arend van Spriel @ 2014-11-25 19:55 UTC (permalink / raw)
To: John W. Linville; +Cc: linux-wireless, Arend van Spriel
Fixing my mistake in utils.c these two patches will
extend the information in the hardware debugfs file.
It is intended for 3.19 and applies to the master
branch of the wireless-next repository, ie.:
commit 18ca43823f3ce111c6efb8cc90d9f35246527727
Author: Amitkumar Karwar <akarwar@marvell.com>
Date: Tue Nov 25 06:43:06 2014 -0800
mwifiex: add Tx status support for ACTION frames
Arend van Spriel (2):
brcmutil: add helper function to format board revision
brcmsmac: extend hardware info shown in debugfs
drivers/net/wireless/brcm80211/brcmsmac/debug.c | 40 +++++++++++++++-------
drivers/net/wireless/brcm80211/brcmutil/utils.c | 16 +++++++++
.../net/wireless/brcm80211/include/brcmu_utils.h | 2 ++
3 files changed, 45 insertions(+), 13 deletions(-)
--
1.9.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH V2 1/2] brcmutil: add helper function to format board revision
2014-11-25 19:55 [PATCH V2 0/2] brcm80211: minor rework Arend van Spriel
@ 2014-11-25 19:55 ` Arend van Spriel
2014-11-25 20:39 ` Rafał Miłecki
2014-11-25 19:55 ` [PATCH V2 2/2] brcmsmac: extend hardware info shown in debugfs Arend van Spriel
1 sibling, 1 reply; 5+ messages in thread
From: Arend van Spriel @ 2014-11-25 19:55 UTC (permalink / raw)
To: John W. Linville; +Cc: linux-wireless, Arend van Spriel
The board revision that is available in hardware can be translated
so it matches the labelling on the board. This is accomplished by
this helper function.
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
---
drivers/net/wireless/brcm80211/brcmutil/utils.c | 16 ++++++++++++++++
drivers/net/wireless/brcm80211/include/brcmu_utils.h | 2 ++
2 files changed, 18 insertions(+)
diff --git a/drivers/net/wireless/brcm80211/brcmutil/utils.c b/drivers/net/wireless/brcm80211/brcmutil/utils.c
index 0f7e1c7..906e89d 100644
--- a/drivers/net/wireless/brcm80211/brcmutil/utils.c
+++ b/drivers/net/wireless/brcm80211/brcmutil/utils.c
@@ -261,6 +261,21 @@ struct sk_buff *brcmu_pktq_mdeq(struct pktq *pq, uint prec_bmp,
}
EXPORT_SYMBOL(brcmu_pktq_mdeq);
+/* Produce a human-readable string for boardrev */
+char *brcmu_boardrev_str(u32 brev, char *buf)
+{
+ char c;
+
+ if (brev < 0x100) {
+ snprintf(buf, 8, "%d.%d", (brev & 0xf0) >> 4, brev & 0xf);
+ } else {
+ c = (brev & 0xf000) == 0x1000 ? 'P' : 'A';
+ snprintf(buf, 8, "%c%03x", c, brev & 0xfff);
+ }
+ return buf;
+}
+EXPORT_SYMBOL(brcmu_boardrev_str);
+
#if defined(DEBUG)
/* pretty hex print a pkt buffer chain */
void brcmu_prpkt(const char *msg, struct sk_buff *p0)
@@ -292,4 +307,5 @@ void brcmu_dbg_hex_dump(const void *data, size_t size, const char *fmt, ...)
print_hex_dump_bytes("", DUMP_PREFIX_OFFSET, data, size);
}
EXPORT_SYMBOL(brcmu_dbg_hex_dump);
+
#endif /* defined(DEBUG) */
diff --git a/drivers/net/wireless/brcm80211/include/brcmu_utils.h b/drivers/net/wireless/brcm80211/include/brcmu_utils.h
index 8ba445b..a043e29 100644
--- a/drivers/net/wireless/brcm80211/include/brcmu_utils.h
+++ b/drivers/net/wireless/brcm80211/include/brcmu_utils.h
@@ -218,4 +218,6 @@ void brcmu_dbg_hex_dump(const void *data, size_t size, const char *fmt, ...)
}
#endif
+char *brcmu_boardrev_str(u32 brev, char *buf);
+
#endif /* _BRCMU_UTILS_H_ */
--
1.9.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH V2 2/2] brcmsmac: extend hardware info shown in debugfs
2014-11-25 19:55 [PATCH V2 0/2] brcm80211: minor rework Arend van Spriel
2014-11-25 19:55 ` [PATCH V2 1/2] brcmutil: add helper function to format board revision Arend van Spriel
@ 2014-11-25 19:55 ` Arend van Spriel
1 sibling, 0 replies; 5+ messages in thread
From: Arend van Spriel @ 2014-11-25 19:55 UTC (permalink / raw)
To: John W. Linville; +Cc: linux-wireless, Arend van Spriel
The hardware info now also include radio and phy information, which
can be helpful in debugging issues.
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
---
drivers/net/wireless/brcm80211/brcmsmac/debug.c | 40 +++++++++++++++++--------
1 file changed, 27 insertions(+), 13 deletions(-)
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/debug.c b/drivers/net/wireless/brcm80211/brcmsmac/debug.c
index 19740c1..c9a8b93 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/debug.c
+++ b/drivers/net/wireless/brcm80211/brcmsmac/debug.c
@@ -30,6 +30,7 @@
#include "main.h"
#include "debug.h"
#include "brcms_trace_events.h"
+#include "phy/phy_int.h"
static struct dentry *root_folder;
@@ -74,20 +75,33 @@ static
int brcms_debugfs_hardware_read(struct seq_file *s, void *data)
{
struct brcms_pub *drvr = s->private;
+ struct brcms_hardware *hw = drvr->wlc->hw;
+ struct bcma_device *core = hw->d11core;
+ struct bcma_bus *bus = core->bus;
+ char boardrev[10];
- seq_printf(s, "board vendor: %x\n"
- "board type: %x\n"
- "board revision: %x\n"
- "board flags: %x\n"
- "board flags2: %x\n"
- "firmware revision: %x\n",
- drvr->wlc->hw->d11core->bus->boardinfo.vendor,
- drvr->wlc->hw->d11core->bus->boardinfo.type,
- drvr->wlc->hw->boardrev,
- drvr->wlc->hw->boardflags,
- drvr->wlc->hw->boardflags2,
- drvr->wlc->ucode_rev);
-
+ seq_printf(s, "chipnum 0x%x\n"
+ "chiprev 0x%x\n"
+ "chippackage 0x%x\n"
+ "corerev 0x%x\n"
+ "boardid 0x%x\n"
+ "boardvendor 0x%x\n"
+ "boardrev %s\n"
+ "boardflags 0x%x\n"
+ "boardflags2 0x%x\n"
+ "ucoderev 0x%x\n"
+ "radiorev 0x%x\n"
+ "phytype 0x%x\n"
+ "phyrev 0x%x\n"
+ "anarev 0x%x\n"
+ "nvramrev %d\n",
+ bus->chipinfo.id, bus->chipinfo.rev, bus->chipinfo.pkg,
+ core->id.rev, bus->boardinfo.type, bus->boardinfo.vendor,
+ brcmu_boardrev_str(hw->boardrev, boardrev),
+ drvr->wlc->hw->boardflags, drvr->wlc->hw->boardflags2,
+ drvr->wlc->ucode_rev, hw->band->radiorev,
+ hw->band->phytype, hw->band->phyrev, hw->band->pi->ana_rev,
+ hw->sromrev);
return 0;
}
--
1.9.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH V2 1/2] brcmutil: add helper function to format board revision
2014-11-25 19:55 ` [PATCH V2 1/2] brcmutil: add helper function to format board revision Arend van Spriel
@ 2014-11-25 20:39 ` Rafał Miłecki
2014-11-25 20:56 ` Arend van Spriel
0 siblings, 1 reply; 5+ messages in thread
From: Rafał Miłecki @ 2014-11-25 20:39 UTC (permalink / raw)
To: Arend van Spriel; +Cc: John W. Linville, linux-wireless
On 25 November 2014 at 20:55, Arend van Spriel <arend@broadcom.com> wrote:
> +/* Produce a human-readable string for boardrev */
> +char *brcmu_boardrev_str(u32 brev, char *buf)
> +{
> + char c;
> +
> + if (brev < 0x100) {
> + snprintf(buf, 8, "%d.%d", (brev & 0xf0) >> 4, brev & 0xf);
> + } else {
> + c = (brev & 0xf000) == 0x1000 ? 'P' : 'A';
> + snprintf(buf, 8, "%c%03x", c, brev & 0xfff);
> + }
> + return buf;
> +}
Is this known what do 'P' and 'A' mean? Just curious.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH V2 1/2] brcmutil: add helper function to format board revision
2014-11-25 20:39 ` Rafał Miłecki
@ 2014-11-25 20:56 ` Arend van Spriel
0 siblings, 0 replies; 5+ messages in thread
From: Arend van Spriel @ 2014-11-25 20:56 UTC (permalink / raw)
To: Rafał Miłecki; +Cc: John W. Linville, linux-wireless
On 11/25/14 21:39, Rafał Miłecki wrote:
> On 25 November 2014 at 20:55, Arend van Spriel<arend@broadcom.com> wrote:
>> +/* Produce a human-readable string for boardrev */
>> +char *brcmu_boardrev_str(u32 brev, char *buf)
>> +{
>> + char c;
>> +
>> + if (brev< 0x100) {
>> + snprintf(buf, 8, "%d.%d", (brev& 0xf0)>> 4, brev& 0xf);
>> + } else {
>> + c = (brev& 0xf000) == 0x1000 ? 'P' : 'A';
>> + snprintf(buf, 8, "%c%03x", c, brev& 0xfff);
>> + }
>> + return buf;
>> +}
>
> Is this known what do 'P' and 'A' mean? Just curious.
Me too, but never found out ;-) The test boards I have over here all
have 'P' prefix.
Regards,
Arend
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-11-25 20:56 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-25 19:55 [PATCH V2 0/2] brcm80211: minor rework Arend van Spriel
2014-11-25 19:55 ` [PATCH V2 1/2] brcmutil: add helper function to format board revision Arend van Spriel
2014-11-25 20:39 ` Rafał Miłecki
2014-11-25 20:56 ` Arend van Spriel
2014-11-25 19:55 ` [PATCH V2 2/2] brcmsmac: extend hardware info shown in debugfs Arend van Spriel
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).