struct msgtrace_hdr {
u8 version;
u8 spare;
- u16 len; /* Len of the trace */
- u32 seqnum; /* Sequence number of message. Useful
+ __be16 len; /* Len of the trace */
+ __be32 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
+ __be32 discarded_bytes; /* Number of discarded bytes because of
trace overflow */
- u32 discarded_printf; /* Number of discarded printf
+ __be32 discarded_printf; /* Number of discarded printf
because of trace overflow */
} __packed;
case BRCMF_E_RSSI:
brcmf_dbg(EVENT, "MACEVENT: %s %d\n",
- event_name, be32_to_cpu(*((int *)event_data)));
+ event_name, be32_to_cpu(*((__be32 *)event_data)));
break;
default:
/* put it back to BRCMF_E_NDIS_LINK */
if (type == BRCMF_E_NDIS_LINK) {
- u32 temp;
+ u32 temp1;
+ __be32 temp2;
- temp = get_unaligned_be32(&event->event_type);
+ temp1 = get_unaligned_be32(&event->event_type);
brcmf_dbg(TRACE, "Converted to WLC_E_LINK type %d\n",
- temp);
+ temp1);
- temp = be32_to_cpu(BRCMF_E_NDIS_LINK);
- memcpy((void *)(&pvt_data->msg.event_type), &temp,
+ temp2 = cpu_to_be32(BRCMF_E_NDIS_LINK);
+ memcpy((void *)(&pvt_data->msg.event_type), &temp2,
sizeof(pvt_data->msg.event_type));
}
break;
#define CBUF_LEN (128)
-struct rte_log {
- u32 buf; /* Can't be pointer on (64-bit) hosts */
- uint buf_size;
- uint idx;
+struct rte_log_le {
+ __le32 buf; /* Can't be pointer on (64-bit) hosts */
+ __le32 buf_size;
+ __le32 idx;
char *_buf_compat; /* Redundant pointer for backward compat. */
};
* Output will be lost if the output wraps around faster than the host
* polls.
*/
- struct rte_log log;
+ struct rte_log_le log_le;
/* Console input line buffer
* Characters are read one at a time into cbuf
struct brcmf_console {
uint count; /* Poll interval msec counter */
uint log_addr; /* Log struct address (fixed) */
- struct rte_log log; /* Log struct (host copy) */
+ struct rte_log_le log_le; /* Log struct (host copy) */
uint bufsize; /* Size of log buffer */
u8 *buf; /* Log buffer (host copy) */
uint last; /* Last buffer read index */
return 0;
/* Read console log struct */
- addr = bus->console_addr + offsetof(struct rte_console, log);
- rv = brcmf_sdbrcm_membytes(bus, false, addr, (u8 *)&c->log,
- sizeof(c->log));
+ addr = bus->console_addr + offsetof(struct rte_console, log_le);
+ rv = brcmf_sdbrcm_membytes(bus, false, addr, (u8 *)&c->log_le,
+ sizeof(c->log_le));
if (rv < 0)
return rv;
/* Allocate console buffer (one time only) */
if (c->buf == NULL) {
- c->bufsize = le32_to_cpu(c->log.buf_size);
+ c->bufsize = le32_to_cpu(c->log_le.buf_size);
c->buf = kmalloc(c->bufsize, GFP_ATOMIC);
if (c->buf == NULL)
return -ENOMEM;
}
- idx = le32_to_cpu(c->log.idx);
+ idx = le32_to_cpu(c->log_le.idx);
/* Protect against corrupt value */
if (idx > c->bufsize)
return 0;
/* Read the console buffer */
- addr = le32_to_cpu(c->log.buf);
+ addr = le32_to_cpu(c->log_le.buf);
rv = brcmf_sdbrcm_membytes(bus, false, addr, c->buf, c->bufsize);
if (rv < 0)
return rv;