#include <asm/bitops.h>
 #include <linux/list.h>
 #include <linux/usb.h>
+#include <linux/byteorder/generic.h>
 
 #include "wlan_compat.h"
 
        switch( HFA384x_RXSTATUS_MACPORT_GET(usbin->rxfrm.desc.status) )
        {
        case 0:
-               fc = ieee2host16(usbin->rxfrm.desc.frame_control);
+               fc = le16_to_cpu(usbin->rxfrm.desc.frame_control);
 
                /* If exclude and we receive an unencrypted, drop it */
                if ( (wlandev->hostwep & HOSTWEP_EXCLUDEUNENCRYPTED) &&
 
        /* Don't forget the status, time, and data_len fields are in host order */
        /* Figure out how big the frame is */
-       fc = ieee2host16(rxdesc->frame_control);
+       fc = le16_to_cpu(rxdesc->frame_control);
        hdrlen = p80211_headerlen(fc);
        datalen = hfa384x2host_16(rxdesc->data_len);
 
 
 #include <linux/netdevice.h>
 #include <linux/etherdevice.h>
 #include <linux/if_ether.h>
+#include <linux/byteorder/generic.h>
 
 #include <asm/byteorder.h>
 
 
        /* Set up the 802.11 header */
        /* It's a data frame */
-       fc = host2ieee16( WLAN_SET_FC_FTYPE(WLAN_FTYPE_DATA) |
+       fc = cpu_to_le16( WLAN_SET_FC_FTYPE(WLAN_FTYPE_DATA) |
                          WLAN_SET_FC_FSTYPE(WLAN_FSTYPE_DATAONLY));
 
        switch ( wlandev->macmode ) {
                memcpy(p80211_hdr->a3.a3, wlandev->bssid, ETH_ALEN);
                break;
        case WLAN_MACMODE_ESS_STA:
-               fc |= host2ieee16(WLAN_SET_FC_TODS(1));
+               fc |= cpu_to_le16(WLAN_SET_FC_TODS(1));
                memcpy(p80211_hdr->a3.a1, wlandev->bssid, ETH_ALEN);
                memcpy(p80211_hdr->a3.a2, wlandev->netdev->dev_addr, ETH_ALEN);
                memcpy(p80211_hdr->a3.a3, &e_hdr.daddr, ETH_ALEN);
                break;
        case WLAN_MACMODE_ESS_AP:
-               fc |= host2ieee16(WLAN_SET_FC_FROMDS(1));
+               fc |= cpu_to_le16(WLAN_SET_FC_FROMDS(1));
                memcpy(p80211_hdr->a3.a1, &e_hdr.daddr, ETH_ALEN);
                memcpy(p80211_hdr->a3.a2, wlandev->bssid, ETH_ALEN);
                memcpy(p80211_hdr->a3.a3, &e_hdr.saddr, ETH_ALEN);
                        WLAN_LOG_WARNING("Host en-WEP failed, dropping frame (%d).\n", foo);
                        return 2;
                }
-               fc |= host2ieee16(WLAN_SET_FC_ISWEP(1));
+               fc |= cpu_to_le16(WLAN_SET_FC_ISWEP(1));
        }
 
 
        w_hdr = (p80211_hdr_t *) skb->data;
 
         /* setup some vars for convenience */
-       fc = ieee2host16(w_hdr->a3.fc);
+       fc = le16_to_cpu(w_hdr->a3.fc);
        if ( (WLAN_GET_FC_TODS(fc) == 0) && (WLAN_GET_FC_FROMDS(fc) == 0) ) {
                memcpy(daddr, w_hdr->a3.a1, WLAN_ETHADDR_LEN);
                memcpy(saddr, w_hdr->a3.a2, WLAN_ETHADDR_LEN);
                   (e_llc->ctl == 0x03) &&
                   (((memcmp( e_snap->oui, oui_rfc1042, WLAN_IEEE_OUI_LEN)==0) &&
                    (ethconv == WLAN_ETHCONV_8021h) &&
-                   (p80211_stt_findproto(ieee2host16(e_snap->type)))) ||
+                   (p80211_stt_findproto(le16_to_cpu(e_snap->type)))) ||
                    (memcmp( e_snap->oui, oui_rfc1042, WLAN_IEEE_OUI_LEN)!=0)))
        {
                WLAN_LOG_DEBUG(3, "SNAP+RFC1042 len: %d\n", payload_length);
 
 #include <linux/wireless.h>
 #include <linux/netdevice.h>
 #include <linux/workqueue.h>
+#include <linux/byteorder/generic.h>
 
 #include <asm/io.h>
 #include <linux/delay.h>
 
        /* If necessary, set the 802.11 WEP bit */
        if ((wlandev->hostwep & (HOSTWEP_PRIVACYINVOKED | HOSTWEP_ENCRYPT)) == HOSTWEP_PRIVACYINVOKED) {
-               p80211_hdr->a3.fc |= host2ieee16(WLAN_SET_FC_ISWEP(1));
+               p80211_hdr->a3.fc |= cpu_to_le16(WLAN_SET_FC_ISWEP(1));
        }
 
        result = hfa384x_drvr_txframe(hw, skb, p80211_hdr, p80211_wep);
 
 #define URB_ASYNC_UNLINK 0
 #define USB_QUEUE_BULK 0
 
-/*=============================================================*/
-/*------ Hardware Portability Macros --------------------------*/
-/*=============================================================*/
-
-#define ieee2host16(n) __le16_to_cpu(n)
-#define ieee2host32(n) __le32_to_cpu(n)
-#define host2ieee16(n) __cpu_to_le16(n)
-#define host2ieee32(n) __cpu_to_le32(n)
-
 /*=============================================================*/
 /*--- General Macros ------------------------------------------*/
 /*=============================================================*/