diff options
author | Moritz Muehlenhoff <jmm@debian.org> | 2009-02-18 18:50:07 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-04-03 21:53:24 (GMT) |
commit | 18c7f792be75c2430cbf16e22dca1ab6a9881a63 (patch) | |
tree | a40ba16d289a168c413cd4df65997924ab81826d /drivers/staging/wlan-ng | |
parent | 465e7417b15348909606c3edce5f018818235a54 (diff) | |
download | linux-fsl-qoriq-18c7f792be75c2430cbf16e22dca1ab6a9881a63.tar.xz |
Staging: wlan-ng: Replace local byteorder macros
Replace hfa384x2host_16(), hfa384x2host_32(), host2hfa384x_16()
and host2hfa384x_32() with standard byteorder macros.
Signed-off-by: Moritz Muehlenhoff <jmm@debian.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/wlan-ng')
-rw-r--r-- | drivers/staging/wlan-ng/hfa384x.h | 14 | ||||
-rw-r--r-- | drivers/staging/wlan-ng/hfa384x_usb.c | 104 | ||||
-rw-r--r-- | drivers/staging/wlan-ng/prism2mgmt.c | 24 | ||||
-rw-r--r-- | drivers/staging/wlan-ng/prism2mib.c | 8 | ||||
-rw-r--r-- | drivers/staging/wlan-ng/prism2sta.c | 132 |
5 files changed, 137 insertions, 145 deletions
diff --git a/drivers/staging/wlan-ng/hfa384x.h b/drivers/staging/wlan-ng/hfa384x.h index ddfa566..f3e8717 100644 --- a/drivers/staging/wlan-ng/hfa384x.h +++ b/drivers/staging/wlan-ng/hfa384x.h @@ -328,14 +328,6 @@ PD Record codes #define HFA384x_STATUS_RESULT_SET(value) (((u16)(value)) << 8) -/* Byte Order */ -#ifdef __KERNEL__ -#define hfa384x2host_16(n) (__le16_to_cpu((u16)(n))) -#define hfa384x2host_32(n) (__le32_to_cpu((u32)(n))) -#define host2hfa384x_16(n) (__cpu_to_le16((u16)(n))) -#define host2hfa384x_32(n) (__cpu_to_le32((u32)(n))) -#endif - /* Host Maintained State Info */ #define HFA384x_STATE_PREINIT 0 #define HFA384x_STATE_INIT 1 @@ -1143,13 +1135,13 @@ static inline int hfa384x_drvr_getconfig16(hfa384x_t *hw, u16 rid, void *val) int result = 0; result = hfa384x_drvr_getconfig(hw, rid, val, sizeof(u16)); if (result == 0) - *((u16 *) val) = hfa384x2host_16(*((u16 *) val)); + *((u16 *) val) = le16_to_cpu(*((u16 *) val)); return result; } static inline int hfa384x_drvr_setconfig16(hfa384x_t *hw, u16 rid, u16 val) { - u16 value = host2hfa384x_16(val); + u16 value = cpu_to_le16(val); return hfa384x_drvr_setconfig(hw, rid, &value, sizeof(value)); } @@ -1166,7 +1158,7 @@ hfa384x_drvr_setconfig_async(hfa384x_t *hw, static inline int hfa384x_drvr_setconfig16_async(hfa384x_t *hw, u16 rid, u16 val) { - u16 value = host2hfa384x_16(val); + u16 value = cpu_to_le16(val); return hfa384x_drvr_setconfig_async(hw, rid, &value, sizeof(value), NULL, NULL); } diff --git a/drivers/staging/wlan-ng/hfa384x_usb.c b/drivers/staging/wlan-ng/hfa384x_usb.c index b986a6f..13a8ace 100644 --- a/drivers/staging/wlan-ng/hfa384x_usb.c +++ b/drivers/staging/wlan-ng/hfa384x_usb.c @@ -647,10 +647,10 @@ static int usbctlx_get_status(const hfa384x_usb_cmdresp_t *cmdresp, hfa384x_cmdresult_t *result) { - result->status = hfa384x2host_16(cmdresp->status); - result->resp0 = hfa384x2host_16(cmdresp->resp0); - result->resp1 = hfa384x2host_16(cmdresp->resp1); - result->resp2 = hfa384x2host_16(cmdresp->resp2); + result->status = le16_to_cpu(cmdresp->status); + result->resp0 = le16_to_cpu(cmdresp->resp0); + result->resp1 = le16_to_cpu(cmdresp->resp1); + result->resp2 = le16_to_cpu(cmdresp->resp2); pr_debug("cmdresult:status=0x%04x " "resp0=0x%04x resp1=0x%04x resp2=0x%04x\n", @@ -663,9 +663,9 @@ static void usbctlx_get_rridresult(const hfa384x_usb_rridresp_t *rridresp, hfa384x_rridresult_t *result) { - result->rid = hfa384x2host_16(rridresp->rid); + result->rid = le16_to_cpu(rridresp->rid); result->riddata = rridresp->data; - result->riddata_len = ((hfa384x2host_16(rridresp->frmlen) - 1) * 2); + result->riddata_len = ((le16_to_cpu(rridresp->frmlen) - 1) * 2); } @@ -865,7 +865,7 @@ static void hfa384x_cb_rrid(hfa384x_t *hw, const hfa384x_usbctlx_t *ctlx) if (ctlx->state != CTLX_COMPLETE) { memset(&rridresult, 0, sizeof(rridresult)); rridresult.rid = - hfa384x2host_16(ctlx->outbuf.rridreq.rid); + le16_to_cpu(ctlx->outbuf.rridreq.rid); } else { usbctlx_get_rridresult(&ctlx->inbuf.rridresp, &rridresult); @@ -1321,7 +1321,7 @@ cleanup: result = completor->complete(completor); } else { printk(KERN_WARNING "CTLX[%d] error: state(%s)\n", - hfa384x2host_16(ctlx->outbuf.type), + le16_to_cpu(ctlx->outbuf.type), ctlxstr(ctlx->state)); result = -EIO; } @@ -1382,11 +1382,11 @@ hfa384x_docmd(hfa384x_t *hw, } /* Initialize the command */ - ctlx->outbuf.cmdreq.type = host2hfa384x_16(HFA384x_USB_CMDREQ); - ctlx->outbuf.cmdreq.cmd = host2hfa384x_16(cmd->cmd); - ctlx->outbuf.cmdreq.parm0 = host2hfa384x_16(cmd->parm0); - ctlx->outbuf.cmdreq.parm1 = host2hfa384x_16(cmd->parm1); - ctlx->outbuf.cmdreq.parm2 = host2hfa384x_16(cmd->parm2); + ctlx->outbuf.cmdreq.type = cpu_to_le16(HFA384x_USB_CMDREQ); + ctlx->outbuf.cmdreq.cmd = cpu_to_le16(cmd->cmd); + ctlx->outbuf.cmdreq.parm0 = cpu_to_le16(cmd->parm0); + ctlx->outbuf.cmdreq.parm1 = cpu_to_le16(cmd->parm1); + ctlx->outbuf.cmdreq.parm2 = cpu_to_le16(cmd->parm2); ctlx->outbufsize = sizeof(ctlx->outbuf.cmdreq); @@ -1473,10 +1473,10 @@ hfa384x_dorrid(hfa384x_t *hw, } /* Initialize the command */ - ctlx->outbuf.rridreq.type = host2hfa384x_16(HFA384x_USB_RRIDREQ); + ctlx->outbuf.rridreq.type = cpu_to_le16(HFA384x_USB_RRIDREQ); ctlx->outbuf.rridreq.frmlen = - host2hfa384x_16(sizeof(ctlx->outbuf.rridreq.rid)); - ctlx->outbuf.rridreq.rid = host2hfa384x_16(rid); + cpu_to_le16(sizeof(ctlx->outbuf.rridreq.rid)); + ctlx->outbuf.rridreq.rid = cpu_to_le16(rid); ctlx->outbufsize = sizeof(ctlx->outbuf.rridreq); @@ -1554,12 +1554,12 @@ hfa384x_dowrid(hfa384x_t *hw, } /* Initialize the command */ - ctlx->outbuf.wridreq.type = host2hfa384x_16(HFA384x_USB_WRIDREQ); - ctlx->outbuf.wridreq.frmlen = host2hfa384x_16((sizeof + ctlx->outbuf.wridreq.type = cpu_to_le16(HFA384x_USB_WRIDREQ); + ctlx->outbuf.wridreq.frmlen = cpu_to_le16((sizeof (ctlx->outbuf.wridreq. rid) + riddatalen + 1) / 2); - ctlx->outbuf.wridreq.rid = host2hfa384x_16(rid); + ctlx->outbuf.wridreq.rid = cpu_to_le16(rid); memcpy(ctlx->outbuf.wridreq.data, riddata, riddatalen); ctlx->outbufsize = sizeof(ctlx->outbuf.wridreq.type) + @@ -1643,12 +1643,12 @@ hfa384x_dormem(hfa384x_t *hw, } /* Initialize the command */ - ctlx->outbuf.rmemreq.type = host2hfa384x_16(HFA384x_USB_RMEMREQ); + ctlx->outbuf.rmemreq.type = cpu_to_le16(HFA384x_USB_RMEMREQ); ctlx->outbuf.rmemreq.frmlen = - host2hfa384x_16(sizeof(ctlx->outbuf.rmemreq.offset) + + cpu_to_le16(sizeof(ctlx->outbuf.rmemreq.offset) + sizeof(ctlx->outbuf.rmemreq.page) + len); - ctlx->outbuf.rmemreq.offset = host2hfa384x_16(offset); - ctlx->outbuf.rmemreq.page = host2hfa384x_16(page); + ctlx->outbuf.rmemreq.offset = cpu_to_le16(offset); + ctlx->outbuf.rmemreq.page = cpu_to_le16(page); ctlx->outbufsize = sizeof(ctlx->outbuf.rmemreq); @@ -1739,12 +1739,12 @@ hfa384x_dowmem(hfa384x_t *hw, } /* Initialize the command */ - ctlx->outbuf.wmemreq.type = host2hfa384x_16(HFA384x_USB_WMEMREQ); + ctlx->outbuf.wmemreq.type = cpu_to_le16(HFA384x_USB_WMEMREQ); ctlx->outbuf.wmemreq.frmlen = - host2hfa384x_16(sizeof(ctlx->outbuf.wmemreq.offset) + + cpu_to_le16(sizeof(ctlx->outbuf.wmemreq.offset) + sizeof(ctlx->outbuf.wmemreq.page) + len); - ctlx->outbuf.wmemreq.offset = host2hfa384x_16(offset); - ctlx->outbuf.wmemreq.page = host2hfa384x_16(page); + ctlx->outbuf.wmemreq.offset = cpu_to_le16(offset); + ctlx->outbuf.wmemreq.page = cpu_to_le16(page); memcpy(ctlx->outbuf.wmemreq.data, data, len); ctlx->outbufsize = sizeof(ctlx->outbuf.wmemreq.type) + @@ -1927,14 +1927,14 @@ int hfa384x_drvr_flashdl_enable(hfa384x_t *hw) sizeof(hw->bufinfo)))) { return result; } - hw->bufinfo.page = hfa384x2host_16(hw->bufinfo.page); - hw->bufinfo.offset = hfa384x2host_16(hw->bufinfo.offset); - hw->bufinfo.len = hfa384x2host_16(hw->bufinfo.len); + hw->bufinfo.page = le16_to_cpu(hw->bufinfo.page); + hw->bufinfo.offset = le16_to_cpu(hw->bufinfo.offset); + hw->bufinfo.len = le16_to_cpu(hw->bufinfo.len); if ((result = hfa384x_drvr_getconfig16(hw, HFA384x_RID_MAXLOADTIME, &(hw->dltimeout)))) { return result; } - hw->dltimeout = hfa384x2host_16(hw->dltimeout); + hw->dltimeout = le16_to_cpu(hw->dltimeout); pr_debug("flashdl_enable\n"); @@ -2477,8 +2477,8 @@ int hfa384x_drvr_readpda(hfa384x_t *hw, void *buf, unsigned int len) pdaok = 1; /* initially assume good */ morepdrs = 1; while (pdaok && morepdrs) { - pdrlen = hfa384x2host_16(pda[currpdr]) * 2; - pdrcode = hfa384x2host_16(pda[currpdr + 1]); + pdrlen = le16_to_cpu(pda[currpdr]) * 2; + pdrcode = le16_to_cpu(pda[currpdr + 1]); /* Test the record length */ if (pdrlen > HFA384x_PDR_LEN_MAX || pdrlen == 0) { printk(KERN_ERR "pdrlen invalid=%d\n", pdrlen); @@ -2499,7 +2499,7 @@ int hfa384x_drvr_readpda(hfa384x_t *hw, void *buf, unsigned int len) /* Move to the next pdr (if necessary) */ if (morepdrs) { /* note the access to pda[], need words here */ - currpdr += hfa384x2host_16(pda[currpdr]) + 1; + currpdr += le16_to_cpu(pda[currpdr]) + 1; } } if (pdaok) { @@ -2741,7 +2741,7 @@ int hfa384x_drvr_txframe(hfa384x_t *hw, struct sk_buff *skb, memset(&hw->txbuff.txfrm.desc, 0, sizeof(hw->txbuff.txfrm.desc)); /* Setup the usb type field */ - hw->txbuff.type = host2hfa384x_16(HFA384x_USB_TXFRM); + hw->txbuff.type = cpu_to_le16(HFA384x_USB_TXFRM); /* Set up the sw_support field to identify this frame */ hw->txbuff.txfrm.desc.sw_support = 0x0123; @@ -2764,7 +2764,7 @@ int hfa384x_drvr_txframe(hfa384x_t *hw, struct sk_buff *skb, HFA384x_TX_TXEX_SET(0) | HFA384x_TX_TXOK_SET(0); #endif hw->txbuff.txfrm.desc.tx_control = - host2hfa384x_16(hw->txbuff.txfrm.desc.tx_control); + cpu_to_le16(hw->txbuff.txfrm.desc.tx_control); /* copy the header over to the txdesc */ memcpy(&(hw->txbuff.txfrm.desc.frame_control), p80211_hdr, @@ -2772,10 +2772,10 @@ int hfa384x_drvr_txframe(hfa384x_t *hw, struct sk_buff *skb, /* if we're using host WEP, increase size by IV+ICV */ if (p80211_wep->data) { - hw->txbuff.txfrm.desc.data_len = host2hfa384x_16(skb->len + 8); + hw->txbuff.txfrm.desc.data_len = cpu_to_le16(skb->len + 8); usbpktlen += 8; } else { - hw->txbuff.txfrm.desc.data_len = host2hfa384x_16(skb->len); + hw->txbuff.txfrm.desc.data_len = cpu_to_le16(skb->len); } usbpktlen += skb->len; @@ -3030,7 +3030,7 @@ static void unlocked_usbctlx_complete(hfa384x_t *hw, hfa384x_usbctlx_t *ctlx) default: printk(KERN_ERR "CTLX[%d] not in a terminating state(%s)\n", - hfa384x2host_16(ctlx->outbuf.type), + le16_to_cpu(ctlx->outbuf.type), ctlxstr(ctlx->state)); break; } /* switch */ @@ -3128,7 +3128,7 @@ static void hfa384x_usbctlxq_run(hfa384x_t *hw) } printk(KERN_ERR "Failed to submit CTLX[%d]: error=%d\n", - hfa384x2host_16(head->outbuf.type), result); + le16_to_cpu(head->outbuf.type), result); unlocked_usbctlx_complete(hw, head); } /* while */ @@ -3257,7 +3257,7 @@ static void hfa384x_usbin_callback(struct urb *urb) /* Note: the check of the sw_support field, the type field doesn't * have bit 12 set like the docs suggest. */ - type = hfa384x2host_16(usbin->type); + type = le16_to_cpu(usbin->type); if (HFA384x_USB_ISRXFRM(type)) { if (action == HANDLE) { if (usbin->txfrm.desc.sw_support == 0x0123) { @@ -3378,7 +3378,7 @@ retry: if (unlocked_usbctlx_cancel_async(hw, ctlx) == 0) run_queue = 1; } else { - const u16 intype = (usbin->type & ~host2hfa384x_16(0x8000)); + const u16 intype = (usbin->type & ~cpu_to_le16(0x8000)); /* * Check that our message is what we're expecting ... @@ -3386,8 +3386,8 @@ retry: if (ctlx->outbuf.type != intype) { printk(KERN_WARNING "Expected IN[%d], received IN[%d] - ignored.\n", - hfa384x2host_16(ctlx->outbuf.type), - hfa384x2host_16(intype)); + le16_to_cpu(ctlx->outbuf.type), + le16_to_cpu(intype)); goto unlock; } @@ -3424,7 +3424,7 @@ retry: printk(KERN_ERR "Matched IN URB, CTLX[%d] in invalid state(%s)." " Discarded.\n", - hfa384x2host_16(ctlx->outbuf.type), + le16_to_cpu(ctlx->outbuf.type), ctlxstr(ctlx->state)); if (unlocked_usbctlx_cancel_async(hw, ctlx) == 0) run_queue = 1; @@ -3461,7 +3461,7 @@ static void hfa384x_usbin_txcompl(wlandevice_t *wlandev, { u16 status; - status = hfa384x2host_16(usbin->type); /* yeah I know it says type... */ + status = le16_to_cpu(usbin->type); /* yeah I know it says type... */ /* Was there an error? */ if (HFA384x_TXSTATUS_ISERROR(status)) @@ -3497,8 +3497,8 @@ static void hfa384x_usbin_rx(wlandevice_t *wlandev, struct sk_buff *skb) u16 fc; /* Byte order convert once up front. */ - usbin->rxfrm.desc.status = hfa384x2host_16(usbin->rxfrm.desc.status); - usbin->rxfrm.desc.time = hfa384x2host_32(usbin->rxfrm.desc.time); + usbin->rxfrm.desc.status = le16_to_cpu(usbin->rxfrm.desc.status); + usbin->rxfrm.desc.time = le32_to_cpu(usbin->rxfrm.desc.time); /* Now handle frame based on port# */ switch (HFA384x_RXSTATUS_MACPORT_GET(usbin->rxfrm.desc.status)) { @@ -3511,7 +3511,7 @@ static void hfa384x_usbin_rx(wlandevice_t *wlandev, struct sk_buff *skb) goto done; } - data_len = hfa384x2host_16(usbin->rxfrm.desc.data_len); + data_len = le16_to_cpu(usbin->rxfrm.desc.data_len); /* How much header data do we have? */ hdrlen = p80211_headerlen(fc); @@ -3607,7 +3607,7 @@ static void hfa384x_int_rxmonitor(wlandevice_t *wlandev, /* Figure out how big the frame is */ fc = le16_to_cpu(rxdesc->frame_control); hdrlen = p80211_headerlen(fc); - datalen = hfa384x2host_16(rxdesc->data_len); + datalen = le16_to_cpu(rxdesc->data_len); /* Allocate an ind message+framesize skb */ skblen = sizeof(p80211_caphdr_t) + hdrlen + datalen + WLAN_CRC_LEN; @@ -3698,7 +3698,7 @@ static void hfa384x_int_rxmonitor(wlandevice_t *wlandev, static void hfa384x_usbin_info(wlandevice_t * wlandev, hfa384x_usbin_t * usbin) { usbin->infofrm.info.framelen = - hfa384x2host_16(usbin->infofrm.info.framelen); + le16_to_cpu(usbin->infofrm.info.framelen); prism2sta_ev_info(wlandev, &usbin->infofrm.info); } @@ -3866,7 +3866,7 @@ retry: /* This is NOT a valid CTLX "success" state! */ printk(KERN_ERR "Illegal CTLX[%d] success state(%s, %d) in OUT URB\n", - hfa384x2host_16(ctlx->outbuf.type), + le16_to_cpu(ctlx->outbuf.type), ctlxstr(ctlx->state), urb->status); break; } /* switch */ diff --git a/drivers/staging/wlan-ng/prism2mgmt.c b/drivers/staging/wlan-ng/prism2mgmt.c index 7dce05d..e7a7939 100644 --- a/drivers/staging/wlan-ng/prism2mgmt.c +++ b/drivers/staging/wlan-ng/prism2mgmt.c @@ -172,7 +172,7 @@ int prism2mgmt_scan(wlandevice_t *wlandev, void *msgp) hw->ident_sta_fw.variant) > HFA384x_FIRMWARE_VERSION(1, 5, 0)) { if (msg->scantype.data != P80211ENUM_scantype_active) - word = host2hfa384x_16(msg->maxchanneltime.data); + word = cpu_to_le16(msg->maxchanneltime.data); else word = 0; @@ -187,7 +187,7 @@ int prism2mgmt_scan(wlandevice_t *wlandev, void *msgp) /* set up the txrate to be 2MBPS. Should be fastest basicrate... */ word = HFA384x_RATEBIT_2; - scanreq.txRate = host2hfa384x_16(word); + scanreq.txRate = cpu_to_le16(word); /* set up the channel list */ word = 0; @@ -198,10 +198,10 @@ int prism2mgmt_scan(wlandevice_t *wlandev, void *msgp) /* channel 1 is BIT 0 ... channel 14 is BIT 13 */ word |= (1 << (channel - 1)); } - scanreq.channelList = host2hfa384x_16(word); + scanreq.channelList = cpu_to_le16(word); /* set up the ssid, if present. */ - scanreq.ssid.len = host2hfa384x_16(msg->ssid.data.len); + scanreq.ssid.len = cpu_to_le16(msg->ssid.data.len); memcpy(scanreq.ssid.data, msg->ssid.data.data, msg->ssid.data.len); /* Enable the MAC port if it's not already enabled */ @@ -230,7 +230,7 @@ int prism2mgmt_scan(wlandevice_t *wlandev, void *msgp) /* Construct a bogus SSID and assign it to OwnSSID and * DesiredSSID */ - wordbuf[0] = host2hfa384x_16(WLAN_SSID_MAXLEN); + wordbuf[0] = cpu_to_le16(WLAN_SSID_MAXLEN); get_random_bytes(&wordbuf[1], WLAN_SSID_MAXLEN); result = hfa384x_drvr_setconfig(hw, HFA384x_RID_CNFOWNSSID, wordbuf, @@ -399,8 +399,8 @@ int prism2mgmt_scan_results(wlandevice_t *wlandev, void *msgp) /* signal and noise */ req->signal.status = P80211ENUM_msgitem_status_data_ok; req->noise.status = P80211ENUM_msgitem_status_data_ok; - req->signal.data = hfa384x2host_16(item->sl); - req->noise.data = hfa384x2host_16(item->anl); + req->signal.data = le16_to_cpu(item->sl); + req->noise.data = le16_to_cpu(item->anl); /* BSSID */ req->bssid.status = P80211ENUM_msgitem_status_data_ok; @@ -409,7 +409,7 @@ int prism2mgmt_scan_results(wlandevice_t *wlandev, void *msgp) /* SSID */ req->ssid.status = P80211ENUM_msgitem_status_data_ok; - req->ssid.data.len = hfa384x2host_16(item->ssid.len); + req->ssid.data.len = le16_to_cpu(item->ssid.len); memcpy(req->ssid.data.data, item->ssid.data, req->ssid.data.len); /* supported rates */ @@ -449,7 +449,7 @@ int prism2mgmt_scan_results(wlandevice_t *wlandev, void *msgp) /* beacon period */ req->beaconperiod.status = P80211ENUM_msgitem_status_data_ok; - req->beaconperiod.data = hfa384x2host_16(item->bcnint); + req->beaconperiod.data = le16_to_cpu(item->bcnint); /* timestamps */ req->timestamp.status = P80211ENUM_msgitem_status_data_ok; @@ -459,14 +459,14 @@ int prism2mgmt_scan_results(wlandevice_t *wlandev, void *msgp) /* atim window */ req->ibssatimwindow.status = P80211ENUM_msgitem_status_data_ok; - req->ibssatimwindow.data = hfa384x2host_16(item->atim); + req->ibssatimwindow.data = le16_to_cpu(item->atim); /* Channel */ req->dschannel.status = P80211ENUM_msgitem_status_data_ok; - req->dschannel.data = hfa384x2host_16(item->chid); + req->dschannel.data = le16_to_cpu(item->chid); /* capinfo bits */ - count = hfa384x2host_16(item->capinfo); + count = le16_to_cpu(item->capinfo); /* privacy flag */ req->privacy.status = P80211ENUM_msgitem_status_data_ok; diff --git a/drivers/staging/wlan-ng/prism2mib.c b/drivers/staging/wlan-ng/prism2mib.c index 546a340..5a6ba86 100644 --- a/drivers/staging/wlan-ng/prism2mib.c +++ b/drivers/staging/wlan-ng/prism2mib.c @@ -730,10 +730,10 @@ static int prism2mib_priv(mibrec_t *mib, HFA384x_RID_CNFWPADATA, (u8 *)&wpa, sizeof(wpa)); - pstr->len = hfa384x2host_16(wpa.datalen); + pstr->len = le16_to_cpu(wpa.datalen); memcpy(pstr->data, wpa.data, pstr->len); } else { - wpa.datalen = host2hfa384x_16(pstr->len); + wpa.datalen = cpu_to_le16(pstr->len); memcpy(wpa.data, pstr->data, pstr->len); result = @@ -768,7 +768,7 @@ static int prism2mib_priv(mibrec_t *mib, void prism2mgmt_pstr2bytestr(hfa384x_bytestr_t *bytestr, p80211pstrd_t *pstr) { - bytestr->len = host2hfa384x_16((u16) (pstr->len)); + bytestr->len = cpu_to_le16((u16) (pstr->len)); memcpy(bytestr->data, pstr->data, pstr->len); } @@ -809,7 +809,7 @@ void prism2mgmt_pstr2bytearea(u8 *bytearea, p80211pstrd_t *pstr) void prism2mgmt_bytestr2pstr(hfa384x_bytestr_t *bytestr, p80211pstrd_t *pstr) { - pstr->len = (u8) (hfa384x2host_16((u16) (bytestr->len))); + pstr->len = (u8) (le16_to_cpu((u16) (bytestr->len))); memcpy(pstr->data, bytestr->data, pstr->len); } diff --git a/drivers/staging/wlan-ng/prism2sta.c b/drivers/staging/wlan-ng/prism2sta.c index fcafed9..9d57f82 100644 --- a/drivers/staging/wlan-ng/prism2sta.c +++ b/drivers/staging/wlan-ng/prism2sta.c @@ -402,11 +402,11 @@ static int prism2sta_mlmerequest(wlandevice_t *wlandev, p80211msg_t *msg) P80211ENUM_msgitem_status_data_ok; qualmsg->link.data = - hfa384x2host_16(hw->qual.CQ_currBSS); + le16_to_cpu(hw->qual.CQ_currBSS); qualmsg->level.data = - hfa384x2host_16(hw->qual.ASL_currBSS); + le16_to_cpu(hw->qual.ASL_currBSS); qualmsg->noise.data = - hfa384x2host_16(hw->qual.ANL_currFC); + le16_to_cpu(hw->qual.ANL_currFC); break; } @@ -630,10 +630,10 @@ static int prism2sta_getcardinfo(wlandevice_t *wlandev) } /* get all the nic id fields in host byte order */ - hw->ident_nic.id = hfa384x2host_16(hw->ident_nic.id); - hw->ident_nic.variant = hfa384x2host_16(hw->ident_nic.variant); - hw->ident_nic.major = hfa384x2host_16(hw->ident_nic.major); - hw->ident_nic.minor = hfa384x2host_16(hw->ident_nic.minor); + hw->ident_nic.id = le16_to_cpu(hw->ident_nic.id); + hw->ident_nic.variant = le16_to_cpu(hw->ident_nic.variant); + hw->ident_nic.major = le16_to_cpu(hw->ident_nic.major); + hw->ident_nic.minor = le16_to_cpu(hw->ident_nic.minor); printk(KERN_INFO "ident: nic h/w: id=0x%02x %d.%d.%d\n", hw->ident_nic.id, hw->ident_nic.major, @@ -649,10 +649,10 @@ static int prism2sta_getcardinfo(wlandevice_t *wlandev) } /* get all the private fw id fields in host byte order */ - hw->ident_pri_fw.id = hfa384x2host_16(hw->ident_pri_fw.id); - hw->ident_pri_fw.variant = hfa384x2host_16(hw->ident_pri_fw.variant); - hw->ident_pri_fw.major = hfa384x2host_16(hw->ident_pri_fw.major); - hw->ident_pri_fw.minor = hfa384x2host_16(hw->ident_pri_fw.minor); + hw->ident_pri_fw.id = le16_to_cpu(hw->ident_pri_fw.id); + hw->ident_pri_fw.variant = le16_to_cpu(hw->ident_pri_fw.variant); + hw->ident_pri_fw.major = le16_to_cpu(hw->ident_pri_fw.major); + hw->ident_pri_fw.minor = le16_to_cpu(hw->ident_pri_fw.minor); printk(KERN_INFO "ident: pri f/w: id=0x%02x %d.%d.%d\n", hw->ident_pri_fw.id, hw->ident_pri_fw.major, @@ -675,10 +675,10 @@ static int prism2sta_getcardinfo(wlandevice_t *wlandev) } /* get all the station fw id fields in host byte order */ - hw->ident_sta_fw.id = hfa384x2host_16(hw->ident_sta_fw.id); - hw->ident_sta_fw.variant = hfa384x2host_16(hw->ident_sta_fw.variant); - hw->ident_sta_fw.major = hfa384x2host_16(hw->ident_sta_fw.major); - hw->ident_sta_fw.minor = hfa384x2host_16(hw->ident_sta_fw.minor); + hw->ident_sta_fw.id = le16_to_cpu(hw->ident_sta_fw.id); + hw->ident_sta_fw.variant = le16_to_cpu(hw->ident_sta_fw.variant); + hw->ident_sta_fw.major = le16_to_cpu(hw->ident_sta_fw.major); + hw->ident_sta_fw.minor = le16_to_cpu(hw->ident_sta_fw.minor); /* strip out the 'special' variant bits */ hw->mm_mods = hw->ident_sta_fw.variant & (BIT(14) | BIT(15)); @@ -709,11 +709,11 @@ static int prism2sta_getcardinfo(wlandevice_t *wlandev) /* get all the Compatibility range, modem interface supplier fields in byte order */ - hw->cap_sup_mfi.role = hfa384x2host_16(hw->cap_sup_mfi.role); - hw->cap_sup_mfi.id = hfa384x2host_16(hw->cap_sup_mfi.id); - hw->cap_sup_mfi.variant = hfa384x2host_16(hw->cap_sup_mfi.variant); - hw->cap_sup_mfi.bottom = hfa384x2host_16(hw->cap_sup_mfi.bottom); - hw->cap_sup_mfi.top = hfa384x2host_16(hw->cap_sup_mfi.top); + hw->cap_sup_mfi.role = le16_to_cpu(hw->cap_sup_mfi.role); + hw->cap_sup_mfi.id = le16_to_cpu(hw->cap_sup_mfi.id); + hw->cap_sup_mfi.variant = le16_to_cpu(hw->cap_sup_mfi.variant); + hw->cap_sup_mfi.bottom = le16_to_cpu(hw->cap_sup_mfi.bottom); + hw->cap_sup_mfi.top = le16_to_cpu(hw->cap_sup_mfi.top); printk(KERN_INFO "MFI:SUP:role=0x%02x:id=0x%02x:var=0x%02x:b/t=%d/%d\n", @@ -732,11 +732,11 @@ static int prism2sta_getcardinfo(wlandevice_t *wlandev) /* get all the Compatibility range, controller interface supplier fields in byte order */ - hw->cap_sup_cfi.role = hfa384x2host_16(hw->cap_sup_cfi.role); - hw->cap_sup_cfi.id = hfa384x2host_16(hw->cap_sup_cfi.id); - hw->cap_sup_cfi.variant = hfa384x2host_16(hw->cap_sup_cfi.variant); - hw->cap_sup_cfi.bottom = hfa384x2host_16(hw->cap_sup_cfi.bottom); - hw->cap_sup_cfi.top = hfa384x2host_16(hw->cap_sup_cfi.top); + hw->cap_sup_cfi.role = le16_to_cpu(hw->cap_sup_cfi.role); + hw->cap_sup_cfi.id = le16_to_cpu(hw->cap_sup_cfi.id); + hw->cap_sup_cfi.variant = le16_to_cpu(hw->cap_sup_cfi.variant); + hw->cap_sup_cfi.bottom = le16_to_cpu(hw->cap_sup_cfi.bottom); + hw->cap_sup_cfi.top = le16_to_cpu(hw->cap_sup_cfi.top); printk(KERN_INFO "CFI:SUP:role=0x%02x:id=0x%02x:var=0x%02x:b/t=%d/%d\n", @@ -755,11 +755,11 @@ static int prism2sta_getcardinfo(wlandevice_t *wlandev) /* get all the Compatibility range, primary firmware supplier fields in byte order */ - hw->cap_sup_pri.role = hfa384x2host_16(hw->cap_sup_pri.role); - hw->cap_sup_pri.id = hfa384x2host_16(hw->cap_sup_pri.id); - hw->cap_sup_pri.variant = hfa384x2host_16(hw->cap_sup_pri.variant); - hw->cap_sup_pri.bottom = hfa384x2host_16(hw->cap_sup_pri.bottom); - hw->cap_sup_pri.top = hfa384x2host_16(hw->cap_sup_pri.top); + hw->cap_sup_pri.role = le16_to_cpu(hw->cap_sup_pri.role); + hw->cap_sup_pri.id = le16_to_cpu(hw->cap_sup_pri.id); + hw->cap_sup_pri.variant = le16_to_cpu(hw->cap_sup_pri.variant); + hw->cap_sup_pri.bottom = le16_to_cpu(hw->cap_sup_pri.bottom); + hw->cap_sup_pri.top = le16_to_cpu(hw->cap_sup_pri.top); printk(KERN_INFO "PRI:SUP:role=0x%02x:id=0x%02x:var=0x%02x:b/t=%d/%d\n", @@ -778,11 +778,11 @@ static int prism2sta_getcardinfo(wlandevice_t *wlandev) /* get all the Compatibility range, station firmware supplier fields in byte order */ - hw->cap_sup_sta.role = hfa384x2host_16(hw->cap_sup_sta.role); - hw->cap_sup_sta.id = hfa384x2host_16(hw->cap_sup_sta.id); - hw->cap_sup_sta.variant = hfa384x2host_16(hw->cap_sup_sta.variant); - hw->cap_sup_sta.bottom = hfa384x2host_16(hw->cap_sup_sta.bottom); - hw->cap_sup_sta.top = hfa384x2host_16(hw->cap_sup_sta.top); + hw->cap_sup_sta.role = le16_to_cpu(hw->cap_sup_sta.role); + hw->cap_sup_sta.id = le16_to_cpu(hw->cap_sup_sta.id); + hw->cap_sup_sta.variant = le16_to_cpu(hw->cap_sup_sta.variant); + hw->cap_sup_sta.bottom = le16_to_cpu(hw->cap_sup_sta.bottom); + hw->cap_sup_sta.top = le16_to_cpu(hw->cap_sup_sta.top); if (hw->cap_sup_sta.id == 0x04) { printk(KERN_INFO @@ -809,13 +809,13 @@ static int prism2sta_getcardinfo(wlandevice_t *wlandev) /* get all the Compatibility range, primary f/w actor, CFI supplier fields in byte order */ - hw->cap_act_pri_cfi.role = hfa384x2host_16(hw->cap_act_pri_cfi.role); - hw->cap_act_pri_cfi.id = hfa384x2host_16(hw->cap_act_pri_cfi.id); + hw->cap_act_pri_cfi.role = le16_to_cpu(hw->cap_act_pri_cfi.role); + hw->cap_act_pri_cfi.id = le16_to_cpu(hw->cap_act_pri_cfi.id); hw->cap_act_pri_cfi.variant = - hfa384x2host_16(hw->cap_act_pri_cfi.variant); + le16_to_cpu(hw->cap_act_pri_cfi.variant); hw->cap_act_pri_cfi.bottom = - hfa384x2host_16(hw->cap_act_pri_cfi.bottom); - hw->cap_act_pri_cfi.top = hfa384x2host_16(hw->cap_act_pri_cfi.top); + le16_to_cpu(hw->cap_act_pri_cfi.bottom); + hw->cap_act_pri_cfi.top = le16_to_cpu(hw->cap_act_pri_cfi.top); printk(KERN_INFO "PRI-CFI:ACT:role=0x%02x:id=0x%02x:var=0x%02x:b/t=%d/%d\n", @@ -834,13 +834,13 @@ static int prism2sta_getcardinfo(wlandevice_t *wlandev) /* get all the Compatibility range, station f/w actor, CFI supplier fields in byte order */ - hw->cap_act_sta_cfi.role = hfa384x2host_16(hw->cap_act_sta_cfi.role); - hw->cap_act_sta_cfi.id = hfa384x2host_16(hw->cap_act_sta_cfi.id); + hw->cap_act_sta_cfi.role = le16_to_cpu(hw->cap_act_sta_cfi.role); + hw->cap_act_sta_cfi.id = le16_to_cpu(hw->cap_act_sta_cfi.id); hw->cap_act_sta_cfi.variant = - hfa384x2host_16(hw->cap_act_sta_cfi.variant); + le16_to_cpu(hw->cap_act_sta_cfi.variant); hw->cap_act_sta_cfi.bottom = - hfa384x2host_16(hw->cap_act_sta_cfi.bottom); - hw->cap_act_sta_cfi.top = hfa384x2host_16(hw->cap_act_sta_cfi.top); + le16_to_cpu(hw->cap_act_sta_cfi.bottom); + hw->cap_act_sta_cfi.top = le16_to_cpu(hw->cap_act_sta_cfi.top); printk(KERN_INFO "STA-CFI:ACT:role=0x%02x:id=0x%02x:var=0x%02x:b/t=%d/%d\n", @@ -859,13 +859,13 @@ static int prism2sta_getcardinfo(wlandevice_t *wlandev) /* get all the Compatibility range, station f/w actor, MFI supplier fields in byte order */ - hw->cap_act_sta_mfi.role = hfa384x2host_16(hw->cap_act_sta_mfi.role); - hw->cap_act_sta_mfi.id = hfa384x2host_16(hw->cap_act_sta_mfi.id); + hw->cap_act_sta_mfi.role = le16_to_cpu(hw->cap_act_sta_mfi.role); + hw->cap_act_sta_mfi.id = le16_to_cpu(hw->cap_act_sta_mfi.id); hw->cap_act_sta_mfi.variant = - hfa384x2host_16(hw->cap_act_sta_mfi.variant); + le16_to_cpu(hw->cap_act_sta_mfi.variant); hw->cap_act_sta_mfi.bottom = - hfa384x2host_16(hw->cap_act_sta_mfi.bottom); - hw->cap_act_sta_mfi.top = hfa384x2host_16(hw->cap_act_sta_mfi.top); + le16_to_cpu(hw->cap_act_sta_mfi.bottom); + hw->cap_act_sta_mfi.top = le16_to_cpu(hw->cap_act_sta_mfi.top); printk(KERN_INFO "STA-MFI:ACT:role=0x%02x:id=0x%02x:var=0x%02x:b/t=%d/%d\n", @@ -1034,12 +1034,12 @@ static void prism2sta_inf_tallies(wlandevice_t *wlandev, dst = (u32 *)&hw->tallies; src32 = (u32 *)&inf->info.commtallies32; for (i = 0; i < cnt; i++, dst++, src32++) - *dst += hfa384x2host_32(*src32); + *dst += le32_to_cpu(*src32); } else { dst = (u32 *)&hw->tallies; src16 = (u16 *)&inf->info.commtallies16; for (i = 0; i < cnt; i++, dst++, src16++) - *dst += hfa384x2host_16(*src16); + *dst += le16_to_cpu(*src16); } return; @@ -1169,24 +1169,24 @@ static void prism2sta_inf_chinforesults(wlandevice_t *wlandev, unsigned int i, n; hw->channel_info.results.scanchannels = - hfa384x2host_16(inf->info.chinforesult.scanchannels); + le16_to_cpu(inf->info.chinforesult.scanchannels); for (i = 0, n = 0; i < HFA384x_CHINFORESULT_MAX; i++) { if (hw->channel_info.results.scanchannels & (1 << i)) { int channel = - hfa384x2host_16(inf->info.chinforesult.result[n]. + le16_to_cpu(inf->info.chinforesult.result[n]. chid) - 1; hfa384x_ChInfoResultSub_t *chinforesult = &hw->channel_info.results.result[channel]; chinforesult->chid = channel; chinforesult->anl = - hfa384x2host_16(inf->info.chinforesult.result[n]. + le16_to_cpu(inf->info.chinforesult.result[n]. anl); chinforesult->pnl = - hfa384x2host_16(inf->info.chinforesult.result[n]. + le16_to_cpu(inf->info.chinforesult.result[n]. pnl); chinforesult->active = - hfa384x2host_16(inf->info.chinforesult.result[n]. + le16_to_cpu(inf->info.chinforesult.result[n]. active); printk(KERN_DEBUG "chinfo: channel %d, %s level (avg/peak)=%d/%d dB, pcf %d\n", @@ -1487,7 +1487,7 @@ static void prism2sta_inf_linkstatus(wlandevice_t *wlandev, { hfa384x_t *hw = (hfa384x_t *) wlandev->priv; - hw->link_status_new = hfa384x2host_16(inf->info.linkstatus.linkstatus); + hw->link_status_new = le16_to_cpu(inf->info.linkstatus.linkstatus); schedule_work(&hw->link_bh); @@ -1520,8 +1520,8 @@ static void prism2sta_inf_assocstatus(wlandevice_t *wlandev, int i; memcpy(&rec, &inf->info.assocstatus, sizeof(rec)); - rec.assocstatus = hfa384x2host_16(rec.assocstatus); - rec.reason = hfa384x2host_16(rec.reason); + rec.assocstatus = le16_to_cpu(rec.assocstatus); + rec.reason = le16_to_cpu(rec.reason); /* ** Find the address in the list of authenticated stations. If it wasn't @@ -1730,7 +1730,7 @@ static void prism2sta_inf_authreq_defer(wlandevice_t *wlandev, ** it was added. */ - rec.status = host2hfa384x_16(rec.status); + rec.status = cpu_to_le16(rec.status); rec.algorithm = inf->info.authreq.algorithm; result = hfa384x_drvr_setconfig(hw, HFA384x_RID_AUTHENTICATESTA, @@ -1768,7 +1768,7 @@ static void prism2sta_inf_psusercnt(wlandevice_t *wlandev, { hfa384x_t *hw = (hfa384x_t *) wlandev->priv; - hw->psusercount = hfa384x2host_16(inf->info.psusercnt.usercnt); + hw->psusercount = le16_to_cpu(inf->info.psusercnt.usercnt); return; } @@ -1792,7 +1792,7 @@ static void prism2sta_inf_psusercnt(wlandevice_t *wlandev, ----------------------------------------------------------------*/ void prism2sta_ev_info(wlandevice_t *wlandev, hfa384x_InfFrame_t *inf) { - inf->infotype = hfa384x2host_16(inf->infotype); + inf->infotype = le16_to_cpu(inf->infotype); /* Dispatch */ switch (inf->infotype) { case HFA384x_IT_HANDOVERADDR: @@ -2020,9 +2020,9 @@ void prism2sta_commsqual_defer(struct work_struct *data) } pr_debug("commsqual %d %d %d\n", - hfa384x2host_16(hw->qual.CQ_currBSS), - hfa384x2host_16(hw->qual.ASL_currBSS), - hfa384x2host_16(hw->qual.ANL_currFC)); + le16_to_cpu(hw->qual.CQ_currBSS), + le16_to_cpu(hw->qual.ASL_currBSS), + le16_to_cpu(hw->qual.ANL_currFC)); } /* Lastly, we need to make sure the BSSID didn't change on us */ |