Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 236089
b: refs/heads/master
c: 628f10b
h: refs/heads/master
i:
  236087: 3c4c236
v: v3
  • Loading branch information
Stanislav Fomichev authored and Greg Kroah-Hartman committed Feb 23, 2011
1 parent 4f5f607 commit fb5c326
Show file tree
Hide file tree
Showing 15 changed files with 189 additions and 227 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1005f085743362129396d5c5e68d7c385392dafb
refs/heads/master: 628f10ba81ed26e61c25cd6b79a3edb9041610ef
2 changes: 1 addition & 1 deletion trunk/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,7 @@ static int sdioh_sdmmc_get_cisaddr(sdioh_info_t *sd, u32 regaddr)
}

/* Only the lower 17-bits are valid */
scratch = ltoh32(scratch);
scratch = le32_to_cpu(scratch);
scratch &= 0x0001FFFF;
return scratch;
}
Expand Down
30 changes: 15 additions & 15 deletions trunk/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ typedef struct dhd_prot {
static int dhdcdc_msg(dhd_pub_t *dhd)
{
dhd_prot_t *prot = dhd->prot;
int len = ltoh32(prot->msg.len) + sizeof(cdc_ioctl_t);
int len = le32_to_cpu(prot->msg.len) + sizeof(cdc_ioctl_t);

DHD_TRACE(("%s: Enter\n", __func__));

Expand Down Expand Up @@ -93,7 +93,7 @@ static int dhdcdc_cmplt(dhd_pub_t *dhd, u32 id, u32 len)
len + sizeof(cdc_ioctl_t));
if (ret < 0)
break;
} while (CDC_IOC_ID(ltoh32(prot->msg.flags)) != id);
} while (CDC_IOC_ID(le32_to_cpu(prot->msg.flags)) != id);

return ret;
}
Expand Down Expand Up @@ -124,11 +124,11 @@ dhdcdc_query_ioctl(dhd_pub_t *dhd, int ifidx, uint cmd, void *buf, uint len)

memset(msg, 0, sizeof(cdc_ioctl_t));

msg->cmd = htol32(cmd);
msg->len = htol32(len);
msg->cmd = cpu_to_le32(cmd);
msg->len = cpu_to_le32(len);
msg->flags = (++prot->reqid << CDCF_IOC_ID_SHIFT);
CDC_SET_IF_IDX(msg, ifidx);
msg->flags = htol32(msg->flags);
msg->flags = cpu_to_le32(msg->flags);

if (buf)
memcpy(prot->buf, buf, len);
Expand All @@ -146,7 +146,7 @@ dhdcdc_query_ioctl(dhd_pub_t *dhd, int ifidx, uint cmd, void *buf, uint len)
if (ret < 0)
goto done;

flags = ltoh32(msg->flags);
flags = le32_to_cpu(msg->flags);
id = (flags & CDCF_IOC_ID_MASK) >> CDCF_IOC_ID_SHIFT;

if ((id < prot->reqid) && (++retries < RETRIES))
Expand All @@ -170,7 +170,7 @@ dhdcdc_query_ioctl(dhd_pub_t *dhd, int ifidx, uint cmd, void *buf, uint len)

/* Check the ERROR flag */
if (flags & CDCF_IOC_ERROR) {
ret = ltoh32(msg->status);
ret = le32_to_cpu(msg->status);
/* Cache error from dongle */
dhd->dongle_error = ret;
}
Expand All @@ -191,11 +191,11 @@ int dhdcdc_set_ioctl(dhd_pub_t *dhd, int ifidx, uint cmd, void *buf, uint len)

memset(msg, 0, sizeof(cdc_ioctl_t));

msg->cmd = htol32(cmd);
msg->len = htol32(len);
msg->cmd = cpu_to_le32(cmd);
msg->len = cpu_to_le32(len);
msg->flags = (++prot->reqid << CDCF_IOC_ID_SHIFT) | CDCF_IOC_SET;
CDC_SET_IF_IDX(msg, ifidx);
msg->flags = htol32(msg->flags);
msg->flags = cpu_to_le32(msg->flags);

if (buf)
memcpy(prot->buf, buf, len);
Expand All @@ -208,7 +208,7 @@ int dhdcdc_set_ioctl(dhd_pub_t *dhd, int ifidx, uint cmd, void *buf, uint len)
if (ret < 0)
goto done;

flags = ltoh32(msg->flags);
flags = le32_to_cpu(msg->flags);
id = (flags & CDCF_IOC_ID_MASK) >> CDCF_IOC_ID_SHIFT;

if (id != prot->reqid) {
Expand All @@ -220,7 +220,7 @@ int dhdcdc_set_ioctl(dhd_pub_t *dhd, int ifidx, uint cmd, void *buf, uint len)

/* Check the ERROR flag */
if (flags & CDCF_IOC_ERROR) {
ret = ltoh32(msg->status);
ret = le32_to_cpu(msg->status);
/* Cache error from dongle */
dhd->dongle_error = ret;
}
Expand Down Expand Up @@ -276,8 +276,8 @@ dhd_prot_ioctl(dhd_pub_t *dhd, int ifidx, wl_ioctl_t *ioc, void *buf, int len)
ret = 0;
else {
cdc_ioctl_t *msg = &prot->msg;
ioc->needed = ltoh32(msg->len); /* len == needed when set/query
fails from dongle */
/* len == needed when set/query fails from dongle */
ioc->needed = le32_to_cpu(msg->len);
}

/* Intercept the wme_dp ioctl here */
Expand All @@ -287,7 +287,7 @@ dhd_prot_ioctl(dhd_pub_t *dhd, int ifidx, wl_ioctl_t *ioc, void *buf, int len)
slen = strlen("wme_dp") + 1;
if (len >= (int)(slen + sizeof(int)))
memcpy(&val, (char *)buf + slen, sizeof(int));
dhd->wme_dp = (u8) ltoh32(val);
dhd->wme_dp = (u8) le32_to_cpu(val);
}

prot->pending = false;
Expand Down
32 changes: 16 additions & 16 deletions trunk/drivers/staging/brcm80211/brcmfmac/dhd_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -577,12 +577,12 @@ static void wl_show_host_event(wl_event_msg_t *event, void *event_data)
WLC_E_PFN_SCAN_COMPLETE, "SCAN_COMPLETE"}
};
uint event_type, flags, auth_type, datalen;
event_type = ntoh32(event->event_type);
flags = ntoh16(event->flags);
status = ntoh32(event->status);
reason = ntoh32(event->reason);
auth_type = ntoh32(event->auth_type);
datalen = ntoh32(event->datalen);
event_type = be32_to_cpu(event->event_type);
flags = be16_to_cpu(event->flags);
status = be32_to_cpu(event->status);
reason = be32_to_cpu(event->reason);
auth_type = be32_to_cpu(event->auth_type);
datalen = be32_to_cpu(event->datalen);
/* debug dump of event messages */
sprintf(eabuf, "%pM", event->addr);

Expand Down Expand Up @@ -750,24 +750,24 @@ 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 + ntoh16(hdr.len)] = '\0';
buf[MSGTRACE_HDRLEN + be16_to_cpu(hdr.len)] = '\0';

if (ntoh32(hdr.discarded_bytes)
|| ntoh32(hdr.discarded_printf)) {
if (be32_to_cpu(hdr.discarded_bytes)
|| be32_to_cpu(hdr.discarded_printf)) {
DHD_ERROR(
("\nWLC_E_TRACE: [Discarded traces in dongle -->"
"discarded_bytes %d discarded_printf %d]\n",
ntoh32(hdr.discarded_bytes),
ntoh32(hdr.discarded_printf)));
be32_to_cpu(hdr.discarded_bytes),
be32_to_cpu(hdr.discarded_printf)));
}

nblost = ntoh32(hdr.seqnum) - seqnum_prev - 1;
nblost = be32_to_cpu(hdr.seqnum) - seqnum_prev - 1;
if (nblost > 0) {
DHD_ERROR(
("\nWLC_E_TRACE: [Event lost --> seqnum %d nblost %d\n",
ntoh32(hdr.seqnum), nblost));
be32_to_cpu(hdr.seqnum), nblost));
}
seqnum_prev = ntoh32(hdr.seqnum);
seqnum_prev = be32_to_cpu(hdr.seqnum);

/* Display the trace buffer. Advance from \n to \n to
* avoid display big
Expand All @@ -788,7 +788,7 @@ static void wl_show_host_event(wl_event_msg_t *event, void *event_data)

case WLC_E_RSSI:
DHD_EVENT(("MACEVENT: %s %d\n", event_name,
ntoh32(*((int *)event_data))));
be32_to_cpu(*((int *)event_data))));
break;

default:
Expand Down Expand Up @@ -898,7 +898,7 @@ wl_host_event(struct dhd_info *dhd, int *ifidx, void *pktdata,
temp = ntoh32_ua((void *)&event->event_type);
DHD_TRACE(("Converted to WLC_E_LINK type %d\n", temp));

temp = ntoh32(WLC_E_NDIS_LINK);
temp = be32_to_cpu(WLC_E_NDIS_LINK);
memcpy((void *)(&pvt_data->event.event_type), &temp,
sizeof(pvt_data->event.event_type));
}
Expand Down
20 changes: 11 additions & 9 deletions trunk/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,7 @@ static void _dhd_set_multicast_list(dhd_info_t *dhd, int ifidx)
strcpy(bufp, "mcast_list");
bufp += strlen("mcast_list") + 1;

cnt = htol32(cnt);
cnt = cpu_to_le32(cnt);
memcpy(bufp, &cnt, sizeof(cnt));
bufp += sizeof(cnt);

Expand Down Expand Up @@ -752,7 +752,7 @@ static void _dhd_set_multicast_list(dhd_info_t *dhd, int ifidx)
dhd_ifname(&dhd->pub, ifidx)));
return;
}
allmulti = htol32(allmulti);
allmulti = cpu_to_le32(allmulti);

if (!bcm_mkiovar
("allmulti", (void *)&allmulti, sizeof(allmulti), buf, buflen)) {
Expand All @@ -772,7 +772,8 @@ static void _dhd_set_multicast_list(dhd_info_t *dhd, int ifidx)
ret = dhd_prot_ioctl(&dhd->pub, ifidx, &ioc, ioc.buf, ioc.len);
if (ret < 0) {
DHD_ERROR(("%s: set allmulti %d failed\n",
dhd_ifname(&dhd->pub, ifidx), ltoh32(allmulti)));
dhd_ifname(&dhd->pub, ifidx),
le32_to_cpu(allmulti)));
}

kfree(buf);
Expand All @@ -781,7 +782,7 @@ static void _dhd_set_multicast_list(dhd_info_t *dhd, int ifidx)
driver does */

allmulti = (dev->flags & IFF_PROMISC) ? true : false;
allmulti = htol32(allmulti);
allmulti = cpu_to_le32(allmulti);

memset(&ioc, 0, sizeof(ioc));
ioc.cmd = WLC_SET_PROMISC;
Expand All @@ -792,7 +793,8 @@ static void _dhd_set_multicast_list(dhd_info_t *dhd, int ifidx)
ret = dhd_prot_ioctl(&dhd->pub, ifidx, &ioc, ioc.buf, ioc.len);
if (ret < 0) {
DHD_ERROR(("%s: set promisc %d failed\n",
dhd_ifname(&dhd->pub, ifidx), ltoh32(allmulti)));
dhd_ifname(&dhd->pub, ifidx),
le32_to_cpu(allmulti)));
}
}

Expand Down Expand Up @@ -1028,7 +1030,7 @@ int dhd_sendpkt(dhd_pub_t *dhdp, int ifidx, struct sk_buff *pktbuf)

if (is_multicast_ether_addr(eh->h_dest))
dhdp->tx_multicast++;
if (ntoh16(eh->h_proto) == ETH_P_PAE)
if (ntohs(eh->h_proto) == ETH_P_PAE)
atomic_inc(&dhd->pend_8021x_cnt);
}

Expand Down Expand Up @@ -1208,7 +1210,7 @@ void dhd_rx_frame(dhd_pub_t *dhdp, int ifidx, struct sk_buff *pktbuf,
skb_pull(skb, ETH_HLEN);

/* Process special event packets and then discard them */
if (ntoh16(skb->protocol) == ETH_P_BRCM)
if (ntohs(skb->protocol) == ETH_P_BRCM)
dhd_wl_host_event(dhd, &ifidx,
skb_mac_header(skb),
&event, &data);
Expand Down Expand Up @@ -1253,7 +1255,7 @@ void dhd_txcomplete(dhd_pub_t *dhdp, struct sk_buff *txp, bool success)
dhd_prot_hdrpull(dhdp, &ifidx, txp);

eh = (struct ethhdr *)(txp->data);
type = ntoh16(eh->h_proto);
type = ntohs(eh->h_proto);

if (type == ETH_P_PAE)
atomic_dec(&dhd->pend_8021x_cnt);
Expand Down Expand Up @@ -2749,7 +2751,7 @@ dhd_wl_host_event(dhd_info_t *dhd, int *ifidx, void *pktdata,
/* send up locally generated event */
void dhd_sendup_event(dhd_pub_t *dhdp, wl_event_msg_t *event, void *data)
{
switch (ntoh32(event->event_type)) {
switch (be32_to_cpu(event->event_type)) {
default:
break;
}
Expand Down
36 changes: 18 additions & 18 deletions trunk/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -966,8 +966,8 @@ static int dhdsdio_txpkt(dhd_bus_t *bus, struct sk_buff *pkt, uint chan,

/* Hardware tag: 2 byte len followed by 2 byte ~len check (all LE) */
len = (u16) (pkt->len);
*(u16 *) frame = htol16(len);
*(((u16 *) frame) + 1) = htol16(~len);
*(u16 *) frame = cpu_to_le16(len);
*(((u16 *) frame) + 1) = cpu_to_le16(~len);

/* Software tag: channel, sequence number, data offset */
swheader =
Expand Down Expand Up @@ -1281,8 +1281,8 @@ int dhd_bus_txctl(struct dhd_bus *bus, unsigned char *msg, uint msglen)
dhdsdio_clkctl(bus, CLK_AVAIL, false);

/* Hardware tag: 2 byte len followed by 2 byte ~len check (all LE) */
*(u16 *) frame = htol16((u16) msglen);
*(((u16 *) frame) + 1) = htol16(~msglen);
*(u16 *) frame = cpu_to_le16((u16) msglen);
*(((u16 *) frame) + 1) = cpu_to_le16(~msglen);

/* Software tag: channel, sequence number, data offset */
swheader =
Expand Down Expand Up @@ -1768,7 +1768,7 @@ static int dhdsdio_readshared(dhd_bus_t *bus, sdpcm_shared_t *sh)
if (rv < 0)
return rv;

addr = ltoh32(addr);
addr = le32_to_cpu(addr);

DHD_INFO(("sdpcm_shared address 0x%08X\n", addr));

Expand All @@ -1789,13 +1789,13 @@ static int dhdsdio_readshared(dhd_bus_t *bus, sdpcm_shared_t *sh)
return rv;

/* Endianness */
sh->flags = ltoh32(sh->flags);
sh->trap_addr = ltoh32(sh->trap_addr);
sh->assert_exp_addr = ltoh32(sh->assert_exp_addr);
sh->assert_file_addr = ltoh32(sh->assert_file_addr);
sh->assert_line = ltoh32(sh->assert_line);
sh->console_addr = ltoh32(sh->console_addr);
sh->msgtrace_addr = ltoh32(sh->msgtrace_addr);
sh->flags = le32_to_cpu(sh->flags);
sh->trap_addr = le32_to_cpu(sh->trap_addr);
sh->assert_exp_addr = le32_to_cpu(sh->assert_exp_addr);
sh->assert_file_addr = le32_to_cpu(sh->assert_file_addr);
sh->assert_line = le32_to_cpu(sh->assert_line);
sh->console_addr = le32_to_cpu(sh->console_addr);
sh->msgtrace_addr = le32_to_cpu(sh->msgtrace_addr);

if ((sh->flags & SDPCM_SHARED_VERSION_MASK) != SDPCM_SHARED_VERSION) {
DHD_ERROR(("%s: sdpcm_shared version %d in dhd "
Expand Down Expand Up @@ -2008,13 +2008,13 @@ static int dhdsdio_readconsole(dhd_bus_t *bus)

/* Allocate console buffer (one time only) */
if (c->buf == NULL) {
c->bufsize = ltoh32(c->log.buf_size);
c->bufsize = le32_to_cpu(c->log.buf_size);
c->buf = kmalloc(c->bufsize, GFP_ATOMIC);
if (c->buf == NULL)
return BCME_NOMEM;
}

idx = ltoh32(c->log.idx);
idx = le32_to_cpu(c->log.idx);

/* Protect against corrupt value */
if (idx > c->bufsize)
Expand All @@ -2026,7 +2026,7 @@ static int dhdsdio_readconsole(dhd_bus_t *bus)
return BCME_OK;

/* Read the console buffer */
addr = ltoh32(c->log.buf);
addr = le32_to_cpu(c->log.buf);
rv = dhdsdio_membytes(bus, false, addr, c->buf, c->bufsize);
if (rv < 0)
return rv;
Expand Down Expand Up @@ -2589,7 +2589,7 @@ static int dhdsdio_write_vars(dhd_bus_t *bus)
} else {
varsizew = varsize / 4;
varsizew = (~varsizew << 16) | (varsizew & 0x0000FFFF);
varsizew = htol32(varsizew);
varsizew = cpu_to_le32(varsizew);
}

DHD_INFO(("New varsize is %d, length token=0x%08x\n", varsize,
Expand Down Expand Up @@ -4986,7 +4986,7 @@ extern int dhd_bus_console_in(dhd_pub_t *dhdp, unsigned char *msg, uint msglen)

/* Zero cbuf_index */
addr = bus->console_addr + offsetof(hndrte_cons_t, cbuf_idx);
val = htol32(0);
val = cpu_to_le32(0);
rv = dhdsdio_membytes(bus, true, addr, (u8 *)&val, sizeof(val));
if (rv < 0)
goto done;
Expand All @@ -4999,7 +4999,7 @@ extern int dhd_bus_console_in(dhd_pub_t *dhdp, unsigned char *msg, uint msglen)

/* Write length into vcons_in */
addr = bus->console_addr + offsetof(hndrte_cons_t, vcons_in);
val = htol32(msglen);
val = cpu_to_le32(msglen);
rv = dhdsdio_membytes(bus, true, addr, (u8 *)&val, sizeof(val));
if (rv < 0)
goto done;
Expand Down
Loading

0 comments on commit fb5c326

Please sign in to comment.