Skip to content

Commit

Permalink
staging: brcm80211: absorb msgtrace.h in fullmac
Browse files Browse the repository at this point in the history
Absorb msgtrace.h into dhd_common.c

Signed-off-by: Franky Lin <frankyl@broadcom.com>
Reviewed-by: Roland Vossen <rvossen@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Franky Lin authored and Greg Kroah-Hartman committed Jun 7, 2011
1 parent b49b14d commit 86c0184
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 66 deletions.
28 changes: 23 additions & 5 deletions drivers/staging/brcm80211/brcmfmac/dhd_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
#include <dhd_bus.h>
#include <dhd_proto.h>
#include <dhd_dbg.h>
#include <msgtrace.h>

#define BRCM_OUI "\x00\x10\x18"
#define DOT11_OUI_LEN 3
Expand Down Expand Up @@ -57,6 +56,8 @@ void dhd_iscan_unlock(void);
#endif

#define EPI_VERSION_STR "4.218.248.5"
#define MSGTRACE_VERSION 1

#ifdef DHD_DEBUG
const char dhd_version[] =
"Dongle Host Driver, version " EPI_VERSION_STR "\nCompiled on " __DATE__
Expand Down Expand Up @@ -118,6 +119,22 @@ const bcm_iovar_t dhd_iovars[] = {
{NULL, 0, 0, 0, 0}
};

/* Message trace header */
struct msgtrace_hdr {
u8 version;
u8 spare;
u16 len; /* Len of the trace */
u32 seqnum; /* Sequence number of message. Useful
* if the messsage has been lost
* because of DMA error or a bus reset
* (ex: SDIO Func2)
*/
u32 discarded_bytes; /* Number of discarded bytes because of
trace overflow */
u32 discarded_printf; /* Number of discarded printf
because of trace overflow */
} __packed;

void dhd_common_init(void)
{
/* Init global variables at run-time, not as part of the declaration.
Expand Down Expand Up @@ -732,12 +749,12 @@ static void wl_show_host_event(wl_event_msg_t *event, void *event_data)
case WLC_E_TRACE:
{
static u32 seqnum_prev;
msgtrace_hdr_t hdr;
struct msgtrace_hdr hdr;
u32 nblost;
char *s, *p;

buf = (unsigned char *) event_data;
memcpy(&hdr, buf, MSGTRACE_HDRLEN);
memcpy(&hdr, buf, sizeof(struct msgtrace_hdr));

if (hdr.version != MSGTRACE_VERSION) {
DHD_ERROR(
Expand All @@ -751,7 +768,8 @@ static void wl_show_host_event(wl_event_msg_t *event, void *event_data)
}

/* There are 2 bytes available at the end of data */
buf[MSGTRACE_HDRLEN + be16_to_cpu(hdr.len)] = '\0';
*(buf + sizeof(struct msgtrace_hdr)
+ be16_to_cpu(hdr.len)) = '\0';

if (be32_to_cpu(hdr.discarded_bytes)
|| be32_to_cpu(hdr.discarded_printf)) {
Expand All @@ -774,7 +792,7 @@ static void wl_show_host_event(wl_event_msg_t *event, void *event_data)
* avoid display big
* printf (issue with Linux printk )
*/
p = (char *)&buf[MSGTRACE_HDRLEN];
p = (char *)&buf[sizeof(struct msgtrace_hdr)];
while ((s = strstr(p, "\n")) != NULL) {
*s = '\0';
printk(KERN_DEBUG"%s\n", p);
Expand Down
61 changes: 0 additions & 61 deletions drivers/staging/brcm80211/brcmfmac/msgtrace.h

This file was deleted.

0 comments on commit 86c0184

Please sign in to comment.