aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/staging/brcm80211/brcmfmac/dhd_cdc.c')
-rw-r--r--drivers/staging/brcm80211/brcmfmac/dhd_cdc.c59
1 files changed, 18 insertions, 41 deletions
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c b/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c
index b7b527f5024c..39a4d001fbd0 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c
@@ -17,11 +17,9 @@
#include <linux/types.h>
#include <linux/netdevice.h>
#include <bcmdefs.h>
-#include <osl.h>
#include <bcmutils.h>
#include <bcmcdc.h>
-#include <bcmendian.h>
#include <dngl_stats.h>
#include <dhd.h>
@@ -65,7 +63,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__));
@@ -93,7 +91,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;
}
@@ -124,11 +122,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);
@@ -146,7 +144,7 @@ retry:
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))
@@ -170,7 +168,7 @@ retry:
/* 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;
}
@@ -191,11 +189,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);
@@ -208,7 +206,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) {
@@ -220,7 +218,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;
}
@@ -276,8 +274,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 */
@@ -286,8 +284,8 @@ 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)))
- bcopy(((char *)buf + slen), &val, sizeof(int));
- dhd->wme_dp = (u8) ltoh32(val);
+ memcpy(&val, (char *)buf + slen, sizeof(int));
+ dhd->wme_dp = (u8) le32_to_cpu(val);
}
prot->pending = false;
@@ -345,26 +343,6 @@ void dhd_prot_hdrpush(dhd_pub_t *dhd, int ifidx, struct sk_buff *pktbuf)
BDC_SET_IF_IDX(h, ifidx);
}
-bool dhd_proto_fcinfo(dhd_pub_t *dhd, struct sk_buff *pktbuf, u8 * fcbits)
-{
-#ifdef BDC
- struct bdc_header *h;
-
- if (pktbuf->len < BDC_HEADER_LEN) {
- DHD_ERROR(("%s: rx data too short (%d < %d)\n",
- __func__, pktbuf->len, BDC_HEADER_LEN));
- return BCME_ERROR;
- }
-
- h = (struct bdc_header *)(pktbuf->data);
-
- *fcbits = h->priority >> BDC_PRIORITY_FC_SHIFT;
- if ((h->flags2 & BDC_FLAG2_FC_FLAG) == BDC_FLAG2_FC_FLAG)
- return true;
-#endif
- return false;
-}
-
int dhd_prot_hdrpull(dhd_pub_t *dhd, int *ifidx, struct sk_buff *pktbuf)
{
#ifdef BDC
@@ -437,8 +415,7 @@ int dhd_prot_attach(dhd_pub_t *dhd)
return 0;
fail:
- if (cdc != NULL)
- kfree(cdc);
+ kfree(cdc);
return BCME_NOMEM;
}
@@ -477,7 +454,7 @@ int dhd_prot_init(dhd_pub_t *dhd)
dhd_os_proto_unblock(dhd);
return ret;
}
- memcpy(dhd->mac.octet, buf, ETH_ALEN);
+ memcpy(dhd->mac, buf, ETH_ALEN);
dhd_os_proto_unblock(dhd);