diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-03-16 15:19:35 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-03-16 15:19:35 -0700 |
commit | 6445ced8670f37cfc2c5e24a9de9b413dbfc788d (patch) | |
tree | 7c98481159008a4080cda929ea8c7bc7598a2c39 /drivers/staging/brcm80211/brcmfmac/dhd_cdc.c | |
parent | e6bee325e49f17c65c1fd66e9e8b348c85788341 (diff) | |
parent | 12bb12fac06d6212be9a5ed282c5670d4e90747f (diff) | |
download | kernel_samsung_smdk4412-6445ced8670f37cfc2c5e24a9de9b413dbfc788d.zip kernel_samsung_smdk4412-6445ced8670f37cfc2c5e24a9de9b413dbfc788d.tar.gz kernel_samsung_smdk4412-6445ced8670f37cfc2c5e24a9de9b413dbfc788d.tar.bz2 |
Merge branch 'staging-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6
* 'staging-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6: (961 commits)
staging: hv: fix memory leaks
staging: hv: Remove NULL check before kfree
Staging: hv: Get rid of vmbus_child_dev_add()
Staging: hv: Change the signature for vmbus_child_device_register()
Staging: hv: Get rid of vmbus_cleanup() function
Staging: hv: Get rid of vmbus_dev_rm() function
Staging: hv: Change the signature for vmbus_on_isr()
Staging: hv: Eliminate vmbus_event_dpc()
Staging: hv: Get rid of the function vmbus_msg_dpc()
Staging: hv: Change the signature for vmbus_cleanup()
Staging: hv: Simplify root device management
staging: rtl8192e: Don't copy dev pointer to skb
staging: rtl8192e: Pass priv to cmdpkt functions
staging: rtl8192e: Pass priv to firmware download functions
staging: rtl8192e: Pass priv to rtl8192_interrupt
staging: rtl8192e: Pass rtl8192_priv to dm functions
staging: rtl8192e: Pass ieee80211_device to callbacks
staging: rtl8192e: Pass ieee80211_device to callbacks
staging: rtl8192e: Pass ieee80211_device to callbacks
staging: rtl8192e: Pass ieee80211_device to callbacks
...
Diffstat (limited to 'drivers/staging/brcm80211/brcmfmac/dhd_cdc.c')
-rw-r--r-- | drivers/staging/brcm80211/brcmfmac/dhd_cdc.c | 59 |
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 b7b527f..39a4d00 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); |