libertas: get rid of wlan_cpu_to_le{16,32,64}, use kernel macros

Marcelo Tosatti mtosatti at redhat.unroutablecom
Tue Nov 28 02:56:39 EST 2006


Commit:     2cc736bd55520232338fd64a23ff5f6368590cbb
Parent:     67ce319af79169216374b99a4d5ee184adad23f4
commit 2cc736bd55520232338fd64a23ff5f6368590cbb
Author:     Marcelo Tosatti <mtosatti at redhat.com>
AuthorDate: Wed Nov 15 22:21:01 2006 -0200
Commit:     Marcelo Tosatti <mtosatti at redhat.com>
CommitDate: Wed Nov 15 22:21:01 2006 -0200

    libertas: get rid of wlan_cpu_to_le{16,32,64}, use kernel macros
    
    Subject says it all... This macros are useless.
    
    Signed-off-by: Marcelo Tosatti <mtosatti at redhat.com>
---
 drivers/net/wireless/libertas/if_usb.c       |    8 -
 drivers/net/wireless/libertas/wlan_11d.c     |   18 +-
 drivers/net/wireless/libertas/wlan_cmd.c     |  308 +++++++++++++-------------
 drivers/net/wireless/libertas/wlan_cmdresp.c |   88 ++++---
 drivers/net/wireless/libertas/wlan_defs.h    |    7 -
 drivers/net/wireless/libertas/wlan_fw.c      |    8 -
 drivers/net/wireless/libertas/wlan_ioctl.c   |   20 +-
 drivers/net/wireless/libertas/wlan_join.c    |   68 +++---
 drivers/net/wireless/libertas/wlan_scan.c    |   48 ++--
 9 files changed, 283 insertions(+), 290 deletions(-)

diff --git a/drivers/net/wireless/libertas/if_usb.c b/drivers/net/wireless/libertas/if_usb.c
index 7bcfc14..250448d 100644
--- a/drivers/net/wireless/libertas/if_usb.c
+++ b/drivers/net/wireless/libertas/if_usb.c
@@ -576,7 +576,7 @@ #define MRVDRV_MIN_PKT_LEN	30
 		memcpy(&RecvType, RecvBuff, sizeof(u32));
 		dprintk(1, "Recv length = 0x%x\n", RecvLength);
 		dprintk(1, "Receive type = 0x%X\n", RecvType);
-		RecvType = wlan_le32_to_cpu(RecvType);
+		RecvType = le32_to_cpu(RecvType);
 		dprintk(1, "Receive type after = 0x%X\n", RecvType);
 	} else if (urb->status) {
 		if (!cardp->rx_urb_recall) {
@@ -652,7 +652,7 @@ #define MRVDRV_MIN_PKT_LEN	30
 			libertas_send_tx_feedback(priv);
 			break;
 		}
-		cardp->usb_event_cause = wlan_le32_to_cpu(cardp->usb_event_cause) << 3;
+		cardp->usb_event_cause = le32_to_cpu(cardp->usb_event_cause) << 3;
 		usb_int_cause |= HIS_CardEvent;
 		kfree_skb(skb);
 		if_usb_interrupt(priv, HIS_CardEvent, RX_SUCCESS);
@@ -691,13 +691,13 @@ int libertas_sbi_host_to_card(wlan_priva
 	dprintk(1, "Size after = %d\n", nb);
 
 	if (type == MVMS_CMD) {
-		tmp = wlan_cpu_to_le32(CMD_TYPE_REQUEST);
+		tmp = cpu_to_le32(CMD_TYPE_REQUEST);
 		priv->wlan_dev.dnld_sent = DNLD_CMD_SENT;
 		memcpy(cardp->bulk_out_buffer, (u8 *) & tmp,
 		       MESSAGE_HEADER_LEN);
 
 	} else {
-		tmp = wlan_cpu_to_le32(CMD_TYPE_DATA);
+		tmp = cpu_to_le32(CMD_TYPE_DATA);
 		priv->wlan_dev.dnld_sent = DNLD_DATA_SENT;
 		memcpy(cardp->bulk_out_buffer, (u8 *) & tmp,
 		       MESSAGE_HEADER_LEN);
diff --git a/drivers/net/wireless/libertas/wlan_11d.c b/drivers/net/wireless/libertas/wlan_11d.c
index be8ef8b..a9adeb9 100644
--- a/drivers/net/wireless/libertas/wlan_11d.c
+++ b/drivers/net/wireless/libertas/wlan_11d.c
@@ -636,36 +636,36 @@ int libertas_cmd_802_11d_domain_info(wla
 
 	dprintk(1, "NoOfSubband=%x\n", NoOfSubband);
 
-	cmd->Command = wlan_cpu_to_le16(cmdno);
-	pDomainInfo->Action = wlan_cpu_to_le16(CmdOption);
+	cmd->Command = cpu_to_le16(cmdno);
+	pDomainInfo->Action = cpu_to_le16(CmdOption);
 	if (CmdOption == HostCmd_ACT_GET) {
 		cmd->Size =
-		    wlan_cpu_to_le16(sizeof(pDomainInfo->Action) + S_DS_GEN);
+		    cpu_to_le16(sizeof(pDomainInfo->Action) + S_DS_GEN);
 		HEXDUMP("11D: 802_11D_DOMAIN_INFO:", (u8 *) cmd,
 			(int)(cmd->Size));
 		LEAVE();
 		return WLAN_STATUS_SUCCESS;
 	}
 
-	domain->Header.Type = wlan_cpu_to_le16(TLV_TYPE_DOMAIN);
+	domain->Header.Type = cpu_to_le16(TLV_TYPE_DOMAIN);
 	memcpy(domain->CountryCode, Adapter->DomainReg.CountryCode,
 	       sizeof(domain->CountryCode));
 
 	domain->Header.Len =
-	    wlan_cpu_to_le16(NoOfSubband * sizeof(struct IEEEtypes_SubbandSet) +
+	    cpu_to_le16(NoOfSubband * sizeof(struct IEEEtypes_SubbandSet) +
 			     sizeof(domain->CountryCode));
 
 	if (NoOfSubband) {
 		memcpy(domain->Subband, Adapter->DomainReg.Subband,
 		       NoOfSubband * sizeof(struct IEEEtypes_SubbandSet));
 
-		cmd->Size = wlan_cpu_to_le16(sizeof(pDomainInfo->Action) +
+		cmd->Size = cpu_to_le16(sizeof(pDomainInfo->Action) +
 					     domain->Header.Len +
 					     sizeof(struct MrvlIEtypesHeader) +
 					     S_DS_GEN);
 	} else {
 		cmd->Size =
-		    wlan_cpu_to_le16(sizeof(pDomainInfo->Action) + S_DS_GEN);
+		    cpu_to_le16(sizeof(pDomainInfo->Action) + S_DS_GEN);
 	}
 
 	HEXDUMP("11D:802_11D_DOMAIN_INFO:", (u8 *) cmd, (int)(cmd->Size));
@@ -726,14 +726,14 @@ int libertas_ret_802_11d_domain_info(wla
 	struct HostCmd_DS_802_11D_DOMAIN_INFO_RSP
 	*domaininfo = &resp->params.domaininforesp;
 	struct MrvlIEtypes_DomainParamSet *domain = &domaininfo->Domain;
-	u16 Action = wlan_le16_to_cpu(domaininfo->Action);
+	u16 Action = le16_to_cpu(domaininfo->Action);
 	s16 ret = WLAN_STATUS_SUCCESS;
 	u8 NoOfSubband = 0;
 
 	ENTER();
 
 	HEXDUMP("11D DOMAIN Info Rsp Data:", (u8 *) resp,
-		(int)wlan_le16_to_cpu(resp->Size));
+		(int)le16_to_cpu(resp->Size));
 
 	NoOfSubband = (domain->Header.Len - 3) / sizeof(struct IEEEtypes_SubbandSet);
 	/* countrycode 3 bytes */
diff --git a/drivers/net/wireless/libertas/wlan_cmd.c b/drivers/net/wireless/libertas/wlan_cmd.c
index eef548f..941cf2e 100644
--- a/drivers/net/wireless/libertas/wlan_cmd.c
+++ b/drivers/net/wireless/libertas/wlan_cmd.c
@@ -66,7 +66,7 @@ static u8 Is_Command_Allowed_In_PS(u16 C
 	int i;
 
 	for (i = 0; i < count; i++) {
-		if (Command == wlan_cpu_to_le16(Commands_Allowed_In_PS[i]))
+		if (Command == cpu_to_le16(Commands_Allowed_In_PS[i]))
 			return 1;
 	}
 
@@ -86,9 +86,9 @@ static int wlan_cmd_hw_spec(wlan_private
 
 	ENTER();
 
-	cmd->Command = wlan_cpu_to_le16(HostCmd_CMD_GET_HW_SPEC);
+	cmd->Command = cpu_to_le16(HostCmd_CMD_GET_HW_SPEC);
 	cmd->Size =
-	    wlan_cpu_to_le16(sizeof(struct HostCmd_DS_GET_HW_SPEC) + S_DS_GEN);
+	    cpu_to_le16(sizeof(struct HostCmd_DS_GET_HW_SPEC) + S_DS_GEN);
 	memcpy(hwspec->PermanentAddr, priv->adapter->CurrentAddr, ETH_ALEN);
 
 	LEAVE();
@@ -113,11 +113,11 @@ static int wlan_cmd_802_11_ps_mode(wlan_
 
 	ENTER();
 
-	cmd->Command = wlan_cpu_to_le16(HostCmd_CMD_802_11_PS_MODE);
+	cmd->Command = cpu_to_le16(HostCmd_CMD_802_11_PS_MODE);
 	cmd->Size =
-	    wlan_cpu_to_le16(sizeof(struct HostCmd_DS_802_11_PS_MODE) +
+	    cpu_to_le16(sizeof(struct HostCmd_DS_802_11_PS_MODE) +
 			     S_DS_GEN);
-	psm->Action = wlan_cpu_to_le16(cmd_action);
+	psm->Action = cpu_to_le16(cmd_action);
 	psm->MultipleDtim = 0;
 	switch (Action) {
 	case HostCmd_SubCmd_Enter_PS:
@@ -126,11 +126,11 @@ static int wlan_cmd_802_11_ps_mode(wlan_
 		       Adapter->LocalListenInterval);
 
 		psm->LocalListenInterval =
-		    wlan_cpu_to_le16(Adapter->LocalListenInterval);
+		    cpu_to_le16(Adapter->LocalListenInterval);
 		psm->NullPktInterval =
-		    wlan_cpu_to_le16(Adapter->NullPktInterval);
+		    cpu_to_le16(Adapter->NullPktInterval);
 		psm->MultipleDtim =
-		    wlan_cpu_to_le16(priv->adapter->MultipleDtim);
+		    cpu_to_le16(priv->adapter->MultipleDtim);
 		break;
 
 	case HostCmd_SubCmd_Exit_PS:
@@ -164,16 +164,16 @@ static int wlan_cmd_802_11_inactivity_ti
 {
 	u16 *timeout = (u16 *) pdata_buf;
 
-	cmd->Command = wlan_cpu_to_le16(HostCmd_CMD_802_11_INACTIVITY_TIMEOUT);
+	cmd->Command = cpu_to_le16(HostCmd_CMD_802_11_INACTIVITY_TIMEOUT);
 	cmd->Size =
-	    wlan_cpu_to_le16(sizeof(struct HostCmd_DS_802_11_INACTIVITY_TIMEOUT)
+	    cpu_to_le16(sizeof(struct HostCmd_DS_802_11_INACTIVITY_TIMEOUT)
 			     + S_DS_GEN);
 
-	cmd->params.inactivity_timeout.Action = wlan_cpu_to_le16(cmd_action);
+	cmd->params.inactivity_timeout.Action = cpu_to_le16(cmd_action);
 
 	if (cmd_action)
 		cmd->params.inactivity_timeout.Timeout =
-		    wlan_cpu_to_le16(*timeout);
+		    cpu_to_le16(*timeout);
 	else
 		cmd->params.inactivity_timeout.Timeout = 0;
 
@@ -193,9 +193,9 @@ static int wlan_cmd_802_11_sleep_period(
 					struct HostCmd_DS_COMMAND *cmd,
 					u16 cmd_action, void *pdata_buf)
 {
-	cmd->Command = wlan_cpu_to_le16(HostCmd_CMD_802_11_SLEEP_PERIOD);
+	cmd->Command = cpu_to_le16(HostCmd_CMD_802_11_SLEEP_PERIOD);
 	cmd->Size =
-	    wlan_cpu_to_le16(sizeof(struct HostCmd_DS_802_11_SLEEP_PERIOD) +
+	    cpu_to_le16(sizeof(struct HostCmd_DS_802_11_SLEEP_PERIOD) +
 			     S_DS_GEN);
 	memmove(&cmd->params.ps_sleeppd, pdata_buf,
 		sizeof(struct HostCmd_DS_802_11_SLEEP_PERIOD));
@@ -221,22 +221,22 @@ static int wlan_cmd_802_11_sleep_params(
 	ENTER();
 
 	cmd->Size =
-	    wlan_cpu_to_le16((sizeof(struct HostCmd_DS_802_11_SLEEP_PARAMS)) +
+	    cpu_to_le16((sizeof(struct HostCmd_DS_802_11_SLEEP_PARAMS)) +
 			     S_DS_GEN);
-	cmd->Command = wlan_cpu_to_le16(HostCmd_CMD_802_11_SLEEP_PARAMS);
+	cmd->Command = cpu_to_le16(HostCmd_CMD_802_11_SLEEP_PARAMS);
 
 	if (cmd_action == HostCmd_ACT_GEN_GET) {
 		memset(&Adapter->sp, 0, sizeof(struct sleep_params));
 		memset(sp, 0, sizeof(struct HostCmd_DS_802_11_SLEEP_PARAMS));
-		sp->Action = wlan_cpu_to_le16(cmd_action);
+		sp->Action = cpu_to_le16(cmd_action);
 	} else if (cmd_action == HostCmd_ACT_GEN_SET) {
-		sp->Action = wlan_cpu_to_le16(cmd_action);
-		sp->Error = wlan_cpu_to_le16(Adapter->sp.sp_error);
-		sp->Offset = wlan_cpu_to_le16(Adapter->sp.sp_offset);
-		sp->StableTime = wlan_cpu_to_le16(Adapter->sp.sp_stabletime);
+		sp->Action = cpu_to_le16(cmd_action);
+		sp->Error = cpu_to_le16(Adapter->sp.sp_error);
+		sp->Offset = cpu_to_le16(Adapter->sp.sp_offset);
+		sp->StableTime = cpu_to_le16(Adapter->sp.sp_stabletime);
 		sp->CalControl = (u8) Adapter->sp.sp_calcontrol;
 		sp->ExternalSleepClk = (u8) Adapter->sp.sp_extsleepclk;
-		sp->Reserved = wlan_cpu_to_le16(Adapter->sp.sp_reserved);
+		sp->Reserved = cpu_to_le16(Adapter->sp.sp_reserved);
 	}
 
 	LEAVE();
@@ -263,8 +263,8 @@ static int wlan_cmd_802_11_set_wep(wlan_
 
 	ENTER();
 
-	cmd->Command = wlan_cpu_to_le16(HostCmd_CMD_802_11_SET_WEP);
-	cmd->Size = wlan_cpu_to_le16((sizeof(struct HostCmd_DS_802_11_SET_WEP))
+	cmd->Command = cpu_to_le16(HostCmd_CMD_802_11_SET_WEP);
+	cmd->Size = cpu_to_le16((sizeof(struct HostCmd_DS_802_11_SET_WEP))
 	                             + S_DS_GEN);
 
 	if (cmd_act == HostCmd_ACT_ADD) {
@@ -276,10 +276,10 @@ static int wlan_cmd_802_11_set_wep(wlan_
 			goto done;
 		}
 
-		wep->Action = wlan_cpu_to_le16(HostCmd_ACT_ADD);
+		wep->Action = cpu_to_le16(HostCmd_ACT_ADD);
 
 		/* default tx key index */
-		wep->KeyIndex = wlan_cpu_to_le16((u16)
+		wep->KeyIndex = cpu_to_le16((u16)
 				                 (assoc_req->wep_tx_keyidx &
 				                 (u32)HostCmd_WEP_KEY_INDEX_MASK));
 
@@ -312,10 +312,10 @@ static int wlan_cmd_802_11_set_wep(wlan_
 		}
 	} else if (cmd_act == HostCmd_ACT_REMOVE) {
 		/* ACT_REMOVE clears _all_ WEP keys */
-		wep->Action = wlan_cpu_to_le16(HostCmd_ACT_REMOVE);
+		wep->Action = cpu_to_le16(HostCmd_ACT_REMOVE);
 
 		/* default tx key index */
-		wep->KeyIndex = wlan_cpu_to_le16((u16)
+		wep->KeyIndex = cpu_to_le16((u16)
 				                 (Adapter->wep_tx_keyidx &
 				                 (u32)HostCmd_WEP_KEY_INDEX_MASK));
 	}
@@ -342,15 +342,15 @@ static int wlan_cmd_802_11_enable_rsn(wl
 	struct HostCmd_DS_802_11_ENABLE_RSN *pEnableRSN = &cmd->params.enbrsn;
 	wlan_adapter *Adapter = priv->adapter;
 
-	cmd->Command = wlan_cpu_to_le16(HostCmd_CMD_802_11_ENABLE_RSN);
+	cmd->Command = cpu_to_le16(HostCmd_CMD_802_11_ENABLE_RSN);
 	cmd->Size =
-	    wlan_cpu_to_le16(sizeof(struct HostCmd_DS_802_11_ENABLE_RSN) +
+	    cpu_to_le16(sizeof(struct HostCmd_DS_802_11_ENABLE_RSN) +
 			     S_DS_GEN);
-	pEnableRSN->Action = wlan_cpu_to_le16(cmd_action);
+	pEnableRSN->Action = cpu_to_le16(cmd_action);
 	if (Adapter->SecInfo.WPAEnabled || Adapter->SecInfo.WPA2Enabled) {
-		pEnableRSN->Enable = wlan_cpu_to_le16(HostCmd_ENABLE_RSN);
+		pEnableRSN->Enable = cpu_to_le16(HostCmd_ENABLE_RSN);
 	} else {
-		pEnableRSN->Enable = wlan_cpu_to_le16(HostCmd_DISABLE_RSN);
+		pEnableRSN->Enable = cpu_to_le16(HostCmd_DISABLE_RSN);
 	}
 
 	return WLAN_STATUS_SUCCESS;
@@ -360,24 +360,24 @@ static int wlan_cmd_802_11_enable_rsn(wl
 static void set_one_wpa_key(struct MrvlIEtype_KeyParamSet * pKeyParamSet,
                             struct WLAN_802_11_KEY * pKey)
 {
-	pKeyParamSet->KeyTypeId = wlan_cpu_to_le16(pKey->type);
+	pKeyParamSet->KeyTypeId = cpu_to_le16(pKey->type);
 
 	if (pKey->flags & KEY_INFO_WPA_ENABLED) {
-		pKeyParamSet->KeyInfo = wlan_cpu_to_le16(KEY_INFO_WPA_ENABLED);
+		pKeyParamSet->KeyInfo = cpu_to_le16(KEY_INFO_WPA_ENABLED);
 	} else {
-		pKeyParamSet->KeyInfo = wlan_cpu_to_le16(!KEY_INFO_WPA_ENABLED);
+		pKeyParamSet->KeyInfo = cpu_to_le16(!KEY_INFO_WPA_ENABLED);
 	}
 
 	if (pKey->flags & KEY_INFO_WPA_UNICAST) {
-		pKeyParamSet->KeyInfo |= wlan_cpu_to_le16(KEY_INFO_WPA_UNICAST);
+		pKeyParamSet->KeyInfo |= cpu_to_le16(KEY_INFO_WPA_UNICAST);
 	} else if (pKey->flags & KEY_INFO_WPA_MCAST) {
-		pKeyParamSet->KeyInfo |= wlan_cpu_to_le16(KEY_INFO_WPA_MCAST);
+		pKeyParamSet->KeyInfo |= cpu_to_le16(KEY_INFO_WPA_MCAST);
 	}
 
-	pKeyParamSet->Type = wlan_cpu_to_le16(TLV_TYPE_KEY_MATERIAL);
-	pKeyParamSet->KeyLen = wlan_cpu_to_le16(pKey->len);
+	pKeyParamSet->Type = cpu_to_le16(TLV_TYPE_KEY_MATERIAL);
+	pKeyParamSet->KeyLen = cpu_to_le16(pKey->len);
 	memcpy(pKeyParamSet->Key, pKey->key, pKey->len);
-	pKeyParamSet->Length = wlan_cpu_to_le16(  sizeof(pKeyParamSet->KeyTypeId)
+	pKeyParamSet->Length = cpu_to_le16(  sizeof(pKeyParamSet->KeyTypeId)
 	                                        + sizeof(pKeyParamSet->KeyInfo)
 	                                        + sizeof(pKeyParamSet->KeyLen)
 	                                        + sizeof(pKeyParamSet->Key));
@@ -406,11 +406,11 @@ static int wlan_cmd_802_11_key_material(
 
 	ENTER();
 
-	cmd->Command = wlan_cpu_to_le16(HostCmd_CMD_802_11_KEY_MATERIAL);
-	pKeyMaterial->Action = wlan_cpu_to_le16(cmd_action);
+	cmd->Command = cpu_to_le16(HostCmd_CMD_802_11_KEY_MATERIAL);
+	pKeyMaterial->Action = cpu_to_le16(cmd_action);
 
 	if (cmd_action == HostCmd_ACT_GET) {
-		cmd->Size = wlan_cpu_to_le16(  S_DS_GEN
+		cmd->Size = cpu_to_le16(  S_DS_GEN
 		                             + sizeof (pKeyMaterial->Action));
 		ret = WLAN_STATUS_SUCCESS;
 		goto done;
@@ -430,7 +430,7 @@ static int wlan_cmd_802_11_key_material(
 		index++;
 	}
 
-	cmd->Size = wlan_cpu_to_le16(  S_DS_GEN
+	cmd->Size = cpu_to_le16(  S_DS_GEN
 	                             + sizeof (pKeyMaterial->Action)
 	                             + index * sizeof(struct MrvlIEtype_KeyParamSet));
 
@@ -454,10 +454,10 @@ static int wlan_cmd_802_11_reset(wlan_pr
 {
 	struct HostCmd_DS_802_11_RESET *reset = &cmd->params.reset;
 
-	cmd->Command = wlan_cpu_to_le16(HostCmd_CMD_802_11_RESET);
+	cmd->Command = cpu_to_le16(HostCmd_CMD_802_11_RESET);
 	cmd->Size =
-	    wlan_cpu_to_le16(sizeof(struct HostCmd_DS_802_11_RESET) + S_DS_GEN);
-	reset->Action = wlan_cpu_to_le16(cmd_action);
+	    cpu_to_le16(sizeof(struct HostCmd_DS_802_11_RESET) + S_DS_GEN);
+	reset->Action = cpu_to_le16(cmd_action);
 
 	return WLAN_STATUS_SUCCESS;
 }
@@ -472,9 +472,9 @@ static int wlan_cmd_802_11_reset(wlan_pr
 static int wlan_cmd_802_11_get_log(wlan_private * priv,
 				   struct HostCmd_DS_COMMAND *cmd)
 {
-	cmd->Command = wlan_cpu_to_le16(HostCmd_CMD_802_11_GET_LOG);
+	cmd->Command = cpu_to_le16(HostCmd_CMD_802_11_GET_LOG);
 	cmd->Size =
-	    wlan_cpu_to_le16(sizeof(struct HostCmd_DS_802_11_GET_LOG) +
+	    cpu_to_le16(sizeof(struct HostCmd_DS_802_11_GET_LOG) +
 			     S_DS_GEN);
 
 	return WLAN_STATUS_SUCCESS;
@@ -490,9 +490,9 @@ static int wlan_cmd_802_11_get_log(wlan_
 static int wlan_cmd_802_11_get_stat(wlan_private * priv,
 				    struct HostCmd_DS_COMMAND *cmd)
 {
-	cmd->Command = wlan_cpu_to_le16(HostCmd_CMD_802_11_GET_STAT);
+	cmd->Command = cpu_to_le16(HostCmd_CMD_802_11_GET_STAT);
 	cmd->Size =
-	    wlan_cpu_to_le16(sizeof(struct HostCmd_DS_802_11_GET_STAT) +
+	    cpu_to_le16(sizeof(struct HostCmd_DS_802_11_GET_STAT) +
 			     S_DS_GEN);
 
 	return WLAN_STATUS_SUCCESS;
@@ -521,9 +521,9 @@ static int wlan_cmd_802_11_snmp_mib(wlan
 
 	dprintk(1, "SNMP_CMD: cmd_oid = 0x%x\n", cmd_oid);
 
-	cmd->Command = wlan_cpu_to_le16(HostCmd_CMD_802_11_SNMP_MIB);
+	cmd->Command = cpu_to_le16(HostCmd_CMD_802_11_SNMP_MIB);
 	cmd->Size =
-	    wlan_cpu_to_le16(sizeof(struct HostCmd_DS_802_11_SNMP_MIB) +
+	    cpu_to_le16(sizeof(struct HostCmd_DS_802_11_SNMP_MIB) +
 			     S_DS_GEN);
 
 	switch (cmd_oid) {
@@ -531,8 +531,8 @@ static int wlan_cmd_802_11_snmp_mib(wlan
 	{
 		enum WLAN_802_11_NETWORK_INFRASTRUCTURE mode = 
 			(enum WLAN_802_11_NETWORK_INFRASTRUCTURE) pdata_buf;
-		pSNMPMIB->QueryType = wlan_cpu_to_le16(HostCmd_ACT_GEN_SET);
-		pSNMPMIB->OID = wlan_cpu_to_le16((u16) DesiredBssType_i);
+		pSNMPMIB->QueryType = cpu_to_le16(HostCmd_ACT_GEN_SET);
+		pSNMPMIB->OID = cpu_to_le16((u16) DesiredBssType_i);
 		pSNMPMIB->BufSize = sizeof(u8);
 		if (mode == Wlan802_11Infrastructure)
 			ucTemp = SNMP_MIB_VALUE_INFRA;
@@ -548,14 +548,14 @@ static int wlan_cmd_802_11_snmp_mib(wlan
 		{
 			u32 ulTemp;
 
-			pSNMPMIB->OID = wlan_cpu_to_le16((u16) Dot11D_i);
+			pSNMPMIB->OID = cpu_to_le16((u16) Dot11D_i);
 
 			if (cmd_action == HostCmd_ACT_SET) {
 				pSNMPMIB->QueryType = HostCmd_ACT_GEN_SET;
 				pSNMPMIB->BufSize = sizeof(u16);
 				ulTemp = *(u32 *) pdata_buf;
 				*((unsigned short *)(pSNMPMIB->Value)) =
-				    wlan_cpu_to_le16((u16) ulTemp);
+				    cpu_to_le16((u16) ulTemp);
 			}
 			break;
 		}
@@ -564,19 +564,19 @@ static int wlan_cmd_802_11_snmp_mib(wlan
 		{
 			u32 ulTemp;
 
-			pSNMPMIB->OID = wlan_cpu_to_le16((u16) FragThresh_i);
+			pSNMPMIB->OID = cpu_to_le16((u16) FragThresh_i);
 
 			if (cmd_action == HostCmd_ACT_GET) {
 				pSNMPMIB->QueryType =
-				    wlan_cpu_to_le16(HostCmd_ACT_GEN_GET);
+				    cpu_to_le16(HostCmd_ACT_GEN_GET);
 			} else if (cmd_action == HostCmd_ACT_SET) {
 				pSNMPMIB->QueryType =
-				    wlan_cpu_to_le16(HostCmd_ACT_GEN_SET);
+				    cpu_to_le16(HostCmd_ACT_GEN_SET);
 				pSNMPMIB->BufSize =
-				    wlan_cpu_to_le16(sizeof(u16));
+				    cpu_to_le16(sizeof(u16));
 				ulTemp = *((u32 *) pdata_buf);
 				*((unsigned short *)(pSNMPMIB->Value)) =
-				    wlan_cpu_to_le16((u16) ulTemp);
+				    cpu_to_le16((u16) ulTemp);
 
 			}
 
@@ -587,36 +587,36 @@ static int wlan_cmd_802_11_snmp_mib(wlan
 		{
 
 			u32 ulTemp;
-			pSNMPMIB->OID = wlan_le16_to_cpu((u16) RtsThresh_i);
+			pSNMPMIB->OID = le16_to_cpu((u16) RtsThresh_i);
 
 			if (cmd_action == HostCmd_ACT_GET) {
 				pSNMPMIB->QueryType =
-				    wlan_cpu_to_le16(HostCmd_ACT_GEN_GET);
+				    cpu_to_le16(HostCmd_ACT_GEN_GET);
 			} else if (cmd_action == HostCmd_ACT_SET) {
 				pSNMPMIB->QueryType =
-				    wlan_cpu_to_le16(HostCmd_ACT_GEN_SET);
+				    cpu_to_le16(HostCmd_ACT_GEN_SET);
 				pSNMPMIB->BufSize =
-				    wlan_cpu_to_le16(sizeof(u16));
+				    cpu_to_le16(sizeof(u16));
 				ulTemp = *((u32 *)
 					   pdata_buf);
 				*(unsigned short *)(pSNMPMIB->Value) =
-				    wlan_cpu_to_le16((u16) ulTemp);
+				    cpu_to_le16((u16) ulTemp);
 
 			}
 			break;
 		}
 	case OID_802_11_TX_RETRYCOUNT:
-		pSNMPMIB->OID = wlan_cpu_to_le16((u16) ShortRetryLim_i);
+		pSNMPMIB->OID = cpu_to_le16((u16) ShortRetryLim_i);
 
 		if (cmd_action == HostCmd_ACT_GET) {
 			pSNMPMIB->QueryType =
-			    wlan_cpu_to_le16(HostCmd_ACT_GEN_GET);
+			    cpu_to_le16(HostCmd_ACT_GEN_GET);
 		} else if (cmd_action == HostCmd_ACT_SET) {
 			pSNMPMIB->QueryType =
-			    wlan_cpu_to_le16(HostCmd_ACT_GEN_SET);
-			pSNMPMIB->BufSize = wlan_cpu_to_le16(sizeof(u16));
+			    cpu_to_le16(HostCmd_ACT_GEN_SET);
+			pSNMPMIB->BufSize = cpu_to_le16(sizeof(u16));
 			*((unsigned short *)(pSNMPMIB->Value)) =
-			    wlan_cpu_to_le16((u16) Adapter->TxRetryCount);
+			    cpu_to_le16((u16) Adapter->TxRetryCount);
 		}
 
 		break;
@@ -656,31 +656,31 @@ static int wlan_cmd_802_11_radio_control
 	ENTER();
 
 	cmd->Size =
-	    wlan_cpu_to_le16((sizeof(struct HostCmd_DS_802_11_RADIO_CONTROL)) +
+	    cpu_to_le16((sizeof(struct HostCmd_DS_802_11_RADIO_CONTROL)) +
 			     S_DS_GEN);
-	cmd->Command = wlan_cpu_to_le16(HostCmd_CMD_802_11_RADIO_CONTROL);
+	cmd->Command = cpu_to_le16(HostCmd_CMD_802_11_RADIO_CONTROL);
 
-	pRadioControl->Action = wlan_cpu_to_le16(cmd_action);
+	pRadioControl->Action = cpu_to_le16(cmd_action);
 
 	switch (Adapter->Preamble) {
 	case HostCmd_TYPE_SHORT_PREAMBLE:
-		pRadioControl->Control = wlan_cpu_to_le16(SET_SHORT_PREAMBLE);
+		pRadioControl->Control = cpu_to_le16(SET_SHORT_PREAMBLE);
 		break;
 
 	case HostCmd_TYPE_LONG_PREAMBLE:
-		pRadioControl->Control = wlan_cpu_to_le16(SET_LONG_PREAMBLE);
+		pRadioControl->Control = cpu_to_le16(SET_LONG_PREAMBLE);
 		break;
 
 	case HostCmd_TYPE_AUTO_PREAMBLE:
 	default:
-		pRadioControl->Control = wlan_cpu_to_le16(SET_AUTO_PREAMBLE);
+		pRadioControl->Control = cpu_to_le16(SET_AUTO_PREAMBLE);
 		break;
 	}
 
 	if (Adapter->RadioOn)
-		pRadioControl->Control |= wlan_cpu_to_le16(TURN_ON_RF);
+		pRadioControl->Control |= cpu_to_le16(TURN_ON_RF);
 	else
-		pRadioControl->Control &= wlan_cpu_to_le16(~TURN_ON_RF);
+		pRadioControl->Control &= cpu_to_le16(~TURN_ON_RF);
 
 	LEAVE();
 	return WLAN_STATUS_SUCCESS;
@@ -705,9 +705,9 @@ static int wlan_cmd_802_11_rf_tx_power(w
 	ENTER();
 
 	cmd->Size =
-	    wlan_cpu_to_le16((sizeof(struct HostCmd_DS_802_11_RF_TX_POWER)) +
+	    cpu_to_le16((sizeof(struct HostCmd_DS_802_11_RF_TX_POWER)) +
 			     S_DS_GEN);
-	cmd->Command = wlan_cpu_to_le16(HostCmd_CMD_802_11_RF_TX_POWER);
+	cmd->Command = cpu_to_le16(HostCmd_CMD_802_11_RF_TX_POWER);
 	pRTP->Action = cmd_action;
 
 	dprintk(1, "RF_TX_POWER_CMD: Size:%d Cmd:0x%x Act:%d\n", cmd->Size,
@@ -715,25 +715,25 @@ static int wlan_cmd_802_11_rf_tx_power(w
 
 	switch (cmd_action) {
 	case HostCmd_ACT_TX_POWER_OPT_GET:
-		pRTP->Action = wlan_cpu_to_le16(HostCmd_ACT_GEN_GET);
+		pRTP->Action = cpu_to_le16(HostCmd_ACT_GEN_GET);
 		pRTP->CurrentLevel = 0;
 		break;
 
 	case HostCmd_ACT_TX_POWER_OPT_SET_HIGH:
-		pRTP->Action = wlan_cpu_to_le16(HostCmd_ACT_GEN_SET);
+		pRTP->Action = cpu_to_le16(HostCmd_ACT_GEN_SET);
 		pRTP->CurrentLevel =
-		    wlan_cpu_to_le16(HostCmd_ACT_TX_POWER_INDEX_HIGH);
+		    cpu_to_le16(HostCmd_ACT_TX_POWER_INDEX_HIGH);
 		break;
 
 	case HostCmd_ACT_TX_POWER_OPT_SET_MID:
-		pRTP->Action = wlan_cpu_to_le16(HostCmd_ACT_GEN_SET);
+		pRTP->Action = cpu_to_le16(HostCmd_ACT_GEN_SET);
 		pRTP->CurrentLevel =
-		    wlan_cpu_to_le16(HostCmd_ACT_TX_POWER_INDEX_MID);
+		    cpu_to_le16(HostCmd_ACT_TX_POWER_INDEX_MID);
 		break;
 
 	case HostCmd_ACT_TX_POWER_OPT_SET_LOW:
-		pRTP->Action = wlan_cpu_to_le16(HostCmd_ACT_GEN_SET);
-		pRTP->CurrentLevel = wlan_cpu_to_le16(*((u16 *) pdata_buf));
+		pRTP->Action = cpu_to_le16(HostCmd_ACT_GEN_SET);
+		pRTP->CurrentLevel = cpu_to_le16(*((u16 *) pdata_buf));
 		break;
 	}
 	LEAVE();
@@ -755,16 +755,16 @@ static int wlan_cmd_802_11_rf_antenna(wl
 {
 	struct HostCmd_DS_802_11_RF_ANTENNA *rant = &cmd->params.rant;
 
-	cmd->Command = wlan_cpu_to_le16(HostCmd_CMD_802_11_RF_ANTENNA);
+	cmd->Command = cpu_to_le16(HostCmd_CMD_802_11_RF_ANTENNA);
 	cmd->Size =
-	    wlan_cpu_to_le16(sizeof(struct HostCmd_DS_802_11_RF_ANTENNA) +
+	    cpu_to_le16(sizeof(struct HostCmd_DS_802_11_RF_ANTENNA) +
 			     S_DS_GEN);
 
-	rant->Action = wlan_cpu_to_le16(cmd_action);
+	rant->Action = cpu_to_le16(cmd_action);
 	if ((cmd_action == HostCmd_ACT_SET_RX) ||
 	    (cmd_action == HostCmd_ACT_SET_TX)) {
 		rant->AntennaMode =
-		    wlan_cpu_to_le16((u16) (*(u32 *) pdata_buf));
+		    cpu_to_le16((u16) (*(u32 *) pdata_buf));
 	}
 
 	return WLAN_STATUS_SUCCESS;
@@ -787,9 +787,9 @@ static int wlan_cmd_802_11_rate_adapt_ra
 	wlan_adapter *Adapter = priv->adapter;
 
 	cmd->Size =
-	    wlan_cpu_to_le16(sizeof(struct HostCmd_DS_802_11_RATE_ADAPT_RATESET)
+	    cpu_to_le16(sizeof(struct HostCmd_DS_802_11_RATE_ADAPT_RATESET)
 			     + S_DS_GEN);
-	cmd->Command = wlan_cpu_to_le16(HostCmd_CMD_802_11_RATE_ADAPT_RATESET);
+	cmd->Command = cpu_to_le16(HostCmd_CMD_802_11_RATE_ADAPT_RATESET);
 
 	ENTER();
 
@@ -820,14 +820,14 @@ static int wlan_cmd_802_11_data_rate(wla
 	ENTER();
 
 	cmd->Size =
-	    wlan_cpu_to_le16(sizeof(struct HostCmd_DS_802_11_DATA_RATE) +
+	    cpu_to_le16(sizeof(struct HostCmd_DS_802_11_DATA_RATE) +
 			     S_DS_GEN);
 
-	cmd->Command = wlan_cpu_to_le16(HostCmd_CMD_802_11_DATA_RATE);
+	cmd->Command = cpu_to_le16(HostCmd_CMD_802_11_DATA_RATE);
 
 	memset(pDataRate, 0, sizeof(struct HostCmd_DS_802_11_DATA_RATE));
 
-	pDataRate->Action = wlan_cpu_to_le16(cmd_action);
+	pDataRate->Action = cpu_to_le16(cmd_action);
 
 	if (Action == HostCmd_ACT_SET_TX_FIX_RATE) {
 		pDataRate->DataRate[0] = libertas_data_rate_to_index(Adapter->DataRate);
@@ -857,13 +857,13 @@ static int wlan_cmd_mac_multicast_adr(wl
 	wlan_adapter *Adapter = priv->adapter;
 
 	cmd->Size =
-	    wlan_cpu_to_le16(sizeof(struct HostCmd_DS_MAC_MULTICAST_ADR) +
+	    cpu_to_le16(sizeof(struct HostCmd_DS_MAC_MULTICAST_ADR) +
 			     S_DS_GEN);
-	cmd->Command = wlan_cpu_to_le16(HostCmd_CMD_MAC_MULTICAST_ADR);
+	cmd->Command = cpu_to_le16(HostCmd_CMD_MAC_MULTICAST_ADR);
 
-	pMCastAdr->Action = wlan_cpu_to_le16(cmd_action);
+	pMCastAdr->Action = cpu_to_le16(cmd_action);
 	pMCastAdr->NumOfAdrs =
-	    wlan_cpu_to_le16((u16) Adapter->NumOfMulticastMACAddr);
+	    cpu_to_le16((u16) Adapter->NumOfMulticastMACAddr);
 	memcpy(pMCastAdr->MACList, Adapter->MulticastList,
 	       Adapter->NumOfMulticastMACAddr * ETH_ALEN);
 
@@ -885,15 +885,15 @@ static int wlan_cmd_802_11_rf_channel(wl
 {
 	struct HostCmd_DS_802_11_RF_CHANNEL *rfchan = &cmd->params.rfchannel;
 
-	cmd->Command = wlan_cpu_to_le16(HostCmd_CMD_802_11_RF_CHANNEL);
-	cmd->Size = wlan_cpu_to_le16(sizeof(struct HostCmd_DS_802_11_RF_CHANNEL)
+	cmd->Command = cpu_to_le16(HostCmd_CMD_802_11_RF_CHANNEL);
+	cmd->Size = cpu_to_le16(sizeof(struct HostCmd_DS_802_11_RF_CHANNEL)
 				     + S_DS_GEN);
 
 	if (option == HostCmd_OPT_802_11_RF_CHANNEL_SET) {
-		rfchan->CurrentChannel = wlan_cpu_to_le16(*((u16 *) pdata_buf));
+		rfchan->CurrentChannel = cpu_to_le16(*((u16 *) pdata_buf));
 	}
 
-	rfchan->Action = wlan_cpu_to_le16(option);
+	rfchan->Action = cpu_to_le16(option);
 
 	return WLAN_STATUS_SUCCESS;
 }
@@ -910,9 +910,9 @@ static int wlan_cmd_802_11_rssi(wlan_pri
 {
 	wlan_adapter *Adapter = priv->adapter;
 
-	cmd->Command = wlan_cpu_to_le16(HostCmd_CMD_802_11_RSSI);
+	cmd->Command = cpu_to_le16(HostCmd_CMD_802_11_RSSI);
 	cmd->Size =
-	    wlan_cpu_to_le16(sizeof(struct HostCmd_DS_802_11_RSSI) + S_DS_GEN);
+	    cpu_to_le16(sizeof(struct HostCmd_DS_802_11_RSSI) + S_DS_GEN);
 	cmd->params.rssi.N = priv->adapter->bcn_avg_factor;
 
 	/* reset Beacon SNR/NF/RSSI values */
@@ -951,16 +951,16 @@ static int wlan_cmd_reg_access(wlan_priv
 			struct HostCmd_DS_MAC_REG_ACCESS *macreg;
 
 			CmdPtr->Size =
-			    wlan_cpu_to_le16(sizeof
+			    cpu_to_le16(sizeof
 					     (struct HostCmd_DS_MAC_REG_ACCESS)
 					     + S_DS_GEN);
 			macreg =
 			    (struct HostCmd_DS_MAC_REG_ACCESS *)&CmdPtr->params.
 			    macreg;
 
-			macreg->Action = wlan_cpu_to_le16(cmd_action);
-			macreg->Offset = wlan_cpu_to_le16((u16) offval->offset);
-			macreg->Value = wlan_cpu_to_le32(offval->value);
+			macreg->Action = cpu_to_le16(cmd_action);
+			macreg->Offset = cpu_to_le16((u16) offval->offset);
+			macreg->Value = cpu_to_le32(offval->value);
 
 			break;
 		}
@@ -970,15 +970,15 @@ static int wlan_cmd_reg_access(wlan_priv
 			struct HostCmd_DS_BBP_REG_ACCESS *bbpreg;
 
 			CmdPtr->Size =
-			    wlan_cpu_to_le16(sizeof
+			    cpu_to_le16(sizeof
 					     (struct HostCmd_DS_BBP_REG_ACCESS)
 					     + S_DS_GEN);
 			bbpreg =
 			    (struct HostCmd_DS_BBP_REG_ACCESS *)&CmdPtr->params.
 			    bbpreg;
 
-			bbpreg->Action = wlan_cpu_to_le16(cmd_action);
-			bbpreg->Offset = wlan_cpu_to_le16((u16) offval->offset);
+			bbpreg->Action = cpu_to_le16(cmd_action);
+			bbpreg->Offset = cpu_to_le16((u16) offval->offset);
 			bbpreg->Value = (u8) offval->value;
 
 			break;
@@ -989,15 +989,15 @@ static int wlan_cmd_reg_access(wlan_priv
 			struct HostCmd_DS_RF_REG_ACCESS *rfreg;
 
 			CmdPtr->Size =
-			    wlan_cpu_to_le16(sizeof
+			    cpu_to_le16(sizeof
 					     (struct HostCmd_DS_RF_REG_ACCESS) +
 					     S_DS_GEN);
 			rfreg =
 			    (struct HostCmd_DS_RF_REG_ACCESS *)&CmdPtr->params.
 			    rfreg;
 
-			rfreg->Action = wlan_cpu_to_le16(cmd_action);
-			rfreg->Offset = wlan_cpu_to_le16((u16) offval->offset);
+			rfreg->Action = cpu_to_le16(cmd_action);
+			rfreg->Offset = cpu_to_le16((u16) offval->offset);
 			rfreg->Value = (u8) offval->value;
 
 			break;
@@ -1025,13 +1025,13 @@ static int wlan_cmd_802_11_mac_address(w
 {
 	wlan_adapter *Adapter = priv->adapter;
 
-	cmd->Command = wlan_cpu_to_le16(HostCmd_CMD_802_11_MAC_ADDRESS);
+	cmd->Command = cpu_to_le16(HostCmd_CMD_802_11_MAC_ADDRESS);
 	cmd->Size =
-	    wlan_cpu_to_le16(sizeof(struct HostCmd_DS_802_11_MAC_ADDRESS) +
+	    cpu_to_le16(sizeof(struct HostCmd_DS_802_11_MAC_ADDRESS) +
 			     S_DS_GEN);
 	cmd->Result = 0;
 
-	cmd->params.macadd.Action = wlan_cpu_to_le16(cmd_action);
+	cmd->params.macadd.Action = cpu_to_le16(cmd_action);
 
 	if (cmd_action == HostCmd_ACT_SET) {
 		memcpy(cmd->params.macadd.MacAdd,
@@ -1059,15 +1059,15 @@ static int wlan_cmd_802_11_eeprom_access
 
 	ENTER();
 
-	cmd->Command = wlan_cpu_to_le16(HostCmd_CMD_802_11_EEPROM_ACCESS);
+	cmd->Command = cpu_to_le16(HostCmd_CMD_802_11_EEPROM_ACCESS);
 	cmd->Size =
-	    wlan_cpu_to_le16(sizeof(struct HostCmd_DS_802_11_EEPROM_ACCESS) +
+	    cpu_to_le16(sizeof(struct HostCmd_DS_802_11_EEPROM_ACCESS) +
 			     S_DS_GEN);
 	cmd->Result = 0;
 
-	cmd->params.rdeeprom.Action = wlan_cpu_to_le16(ea->Action);
-	cmd->params.rdeeprom.Offset = wlan_cpu_to_le16(ea->Offset);
-	cmd->params.rdeeprom.ByteCount = wlan_cpu_to_le16(ea->NOB);
+	cmd->params.rdeeprom.Action = cpu_to_le16(ea->Action);
+	cmd->params.rdeeprom.Offset = cpu_to_le16(ea->Offset);
+	cmd->params.rdeeprom.ByteCount = cpu_to_le16(ea->NOB);
 	cmd->params.rdeeprom.Value = 0;
 
 	return WLAN_STATUS_SUCCESS;
@@ -1089,11 +1089,11 @@ static int wlan_cmd_dft_access(wlan_priv
 	struct HostCmd_DS_DFT_ACCESS *dft_access = &cmd->params.dft;
 	dprintk(1, "DFT CMD(%d)\n", cmd_action);
 
-	cmd->Command = wlan_cpu_to_le16(HostCmd_CMD_DFT_ACCESS);
-	cmd->Size = wlan_cpu_to_le16(sizeof(struct HostCmd_DS_DFT_ACCESS)
+	cmd->Command = cpu_to_le16(HostCmd_CMD_DFT_ACCESS);
+	cmd->Size = cpu_to_le16(sizeof(struct HostCmd_DS_DFT_ACCESS)
 				     + S_DS_GEN);
 	cmd->Result = 0;
-	dft_access->action = wlan_cpu_to_le16(cmd_action);
+	dft_access->action = cpu_to_le16(cmd_action);
 
 	switch (cmd_action) {
 	case HostCmd_ACT_DFT_ACCESS_ADD:
@@ -1106,7 +1106,7 @@ static int wlan_cmd_dft_access(wlan_priv
 		HEXDUMP("DFT_DEL: index mac address-", dft_access->addr1, 6);
 		break;
 	case HostCmd_ACT_DFT_ACCESS_LIST:
-		dft_access->id = wlan_cpu_to_le32(*(u32 *) pdata_buf);
+		dft_access->id = cpu_to_le32(*(u32 *) pdata_buf);
 		break;
 	case HostCmd_ACT_DFT_ACCESS_RESET:
 		break;
@@ -1119,7 +1119,7 @@ static int wlan_cmd_dft_access(wlan_priv
 		HEXDUMP("BT_DEL: blinded mac address-", dft_access->addr1, 6);
 		break;
 	case HostCmd_ACT_BT_ACCESS_LIST:
-		dft_access->id = wlan_cpu_to_le32(*(u32 *) pdata_buf);
+		dft_access->id = cpu_to_le32(*(u32 *) pdata_buf);
 		break;
 	case HostCmd_ACT_BT_ACCESS_RESET:
 		break;
@@ -1244,10 +1244,10 @@ static int DownloadCommandToStation(wlan
 
 	CmdSize = CmdPtr->Size;
 
-	Command = wlan_cpu_to_le16(CmdPtr->Command);
+	Command = cpu_to_le16(CmdPtr->Command);
 
 	CmdNode->CmdWaitQWoken = 0;
-	CmdSize = wlan_cpu_to_le16(CmdSize);
+	CmdSize = cpu_to_le16(CmdSize);
 
 	ret = libertas_sbi_host_to_card(priv, MVMS_CMD, (u8 *) CmdPtr, CmdSize);
 
@@ -1293,10 +1293,10 @@ static int wlan_cmd_mac_control(wlan_pri
 
 	ENTER();
 
-	cmd->Command = wlan_cpu_to_le16(HostCmd_CMD_MAC_CONTROL);
+	cmd->Command = cpu_to_le16(HostCmd_CMD_MAC_CONTROL);
 	cmd->Size =
-	    wlan_cpu_to_le16(sizeof(struct HostCmd_DS_MAC_CONTROL) + S_DS_GEN);
-	mac->Action = wlan_cpu_to_le16(priv->adapter->CurrentPacketFilter);
+	    cpu_to_le16(sizeof(struct HostCmd_DS_MAC_CONTROL) + S_DS_GEN);
+	mac->Action = cpu_to_le16(priv->adapter->CurrentPacketFilter);
 
 	dprintk(1, "wlan_cmd_mac_control(): Action=0x%X Size=%d\n",
 	       mac->Action, cmd->Size);
@@ -1448,7 +1448,7 @@ int libertas_prepare_and_send_command(wl
 
 	/* Set sequence number, command and INT option */
 	Adapter->SeqNum++;
-	CmdPtr->SeqNum = wlan_cpu_to_le16(Adapter->SeqNum);
+	CmdPtr->SeqNum = cpu_to_le16(Adapter->SeqNum);
 
 	CmdPtr->Command = cmd_no;
 	CmdPtr->Result = 0;
@@ -1585,9 +1585,9 @@ int libertas_prepare_and_send_command(wl
 	case HostCmd_CMD_802_11_SET_AFC:
 	case HostCmd_CMD_802_11_GET_AFC:
 
-		CmdPtr->Command = wlan_cpu_to_le16(cmd_no);
+		CmdPtr->Command = cpu_to_le16(cmd_no);
 		CmdPtr->Size =
-		    wlan_cpu_to_le16(sizeof(struct HostCmd_DS_802_11_AFC) +
+		    cpu_to_le16(sizeof(struct HostCmd_DS_802_11_AFC) +
 				     S_DS_GEN);
 
 		memmove(&CmdPtr->params.afc,
@@ -1611,9 +1611,9 @@ int libertas_prepare_and_send_command(wl
 		break;
 
 	case HostCmd_CMD_802_11_TPC_CFG:
-		CmdPtr->Command = wlan_cpu_to_le16(HostCmd_CMD_802_11_TPC_CFG);
+		CmdPtr->Command = cpu_to_le16(HostCmd_CMD_802_11_TPC_CFG);
 		CmdPtr->Size =
-		    wlan_cpu_to_le16(sizeof(struct HostCmd_DS_802_11_TPC_CFG) +
+		    cpu_to_le16(sizeof(struct HostCmd_DS_802_11_TPC_CFG) +
 				     S_DS_GEN);
 
 		memmove(&CmdPtr->params.tpccfg,
@@ -1632,21 +1632,21 @@ int libertas_prepare_and_send_command(wl
 				sizeof(struct HostCmd_DS_802_11_LED_CTRL));
 
 			CmdPtr->Command =
-			    wlan_cpu_to_le16(HostCmd_CMD_802_11_LED_GPIO_CTRL);
+			    cpu_to_le16(HostCmd_CMD_802_11_LED_GPIO_CTRL);
 
 #define ACTION_NUMLED_TLVTYPE_LEN_FIELDS_LEN 8
 			CmdPtr->Size =
-			    wlan_cpu_to_le16(gpio->Header.Len + S_DS_GEN +
+			    cpu_to_le16(gpio->Header.Len + S_DS_GEN +
 					     ACTION_NUMLED_TLVTYPE_LEN_FIELDS_LEN);
-			gpio->Header.Len = wlan_cpu_to_le16(gpio->Header.Len);
+			gpio->Header.Len = cpu_to_le16(gpio->Header.Len);
 
 			ret = WLAN_STATUS_SUCCESS;
 			break;
 		}
 	case HostCmd_CMD_802_11_PWR_CFG:
-		CmdPtr->Command = wlan_cpu_to_le16(HostCmd_CMD_802_11_PWR_CFG);
+		CmdPtr->Command = cpu_to_le16(HostCmd_CMD_802_11_PWR_CFG);
 		CmdPtr->Size =
-		    wlan_cpu_to_le16(sizeof(struct HostCmd_DS_802_11_PWR_CFG) +
+		    cpu_to_le16(sizeof(struct HostCmd_DS_802_11_PWR_CFG) +
 				     S_DS_GEN);
 		memmove(&CmdPtr->params.pwrcfg, pdata_buf,
 			sizeof(struct HostCmd_DS_802_11_PWR_CFG));
@@ -1663,17 +1663,17 @@ #define ACTION_NUMLED_TLVTYPE_LEN_FIELDS
 		break;
 
 	case HostCmd_CMD_GET_TSF:
-		CmdPtr->Command = wlan_cpu_to_le16(HostCmd_CMD_GET_TSF);
+		CmdPtr->Command = cpu_to_le16(HostCmd_CMD_GET_TSF);
 		CmdPtr->Size =
-		    wlan_cpu_to_le16(sizeof(struct HostCmd_DS_GET_TSF)
+		    cpu_to_le16(sizeof(struct HostCmd_DS_GET_TSF)
 				     + S_DS_GEN);
 		ret = WLAN_STATUS_SUCCESS;
 		break;
 	case HostCmd_CMD_802_11_TX_RATE_QUERY:
 		CmdPtr->Command =
-		    wlan_cpu_to_le16(HostCmd_CMD_802_11_TX_RATE_QUERY);
+		    cpu_to_le16(HostCmd_CMD_802_11_TX_RATE_QUERY);
 		CmdPtr->Size =
-		    wlan_cpu_to_le16(sizeof(struct HostCmd_TX_RATE_QUERY) +
+		    cpu_to_le16(sizeof(struct HostCmd_TX_RATE_QUERY) +
 				     S_DS_GEN);
 		Adapter->TxRate = 0;
 		ret = WLAN_STATUS_SUCCESS;
@@ -1986,7 +1986,7 @@ int libertas_execute_next_command(wlan_p
 			 * immediately.
 			 */
 			if (CmdPtr->Command !=
-			    wlan_cpu_to_le16(HostCmd_CMD_802_11_PS_MODE)) {
+			    cpu_to_le16(HostCmd_CMD_802_11_PS_MODE)) {
 				/*  Prepare to send Exit PS,
 				 *  this non PS command will be sent later */
 				if ((Adapter->PSState == PS_STATE_SLEEP)
@@ -2012,7 +2012,7 @@ int libertas_execute_next_command(wlan_p
 				       "EXEC_NEXT_CMD: PS cmd- Action=0x%x\n",
 				       psm->Action);
 				if (psm->Action !=
-				    wlan_cpu_to_le16(HostCmd_SubCmd_Exit_PS)) {
+				    cpu_to_le16(HostCmd_SubCmd_Exit_PS)) {
 					dprintk(1,	
 					       "EXEC_NEXT_CMD: Ignore Enter PS cmd\n");
 					list_del((struct list_head *)CmdNode);
diff --git a/drivers/net/wireless/libertas/wlan_cmdresp.c b/drivers/net/wireless/libertas/wlan_cmdresp.c
index 6a25248..fd544f6 100644
--- a/drivers/net/wireless/libertas/wlan_cmdresp.c
+++ b/drivers/net/wireless/libertas/wlan_cmdresp.c
@@ -267,7 +267,7 @@ static int wlan_ret_get_hw_spec(wlan_pri
 	ENTER();
 
 	Adapter->HardwareStatus = WlanHardwareStatusReady;
-	Adapter->fwCapInfo = wlan_le32_to_cpu(hwspec->fwCapInfo);
+	Adapter->fwCapInfo = le32_to_cpu(hwspec->fwCapInfo);
 
 	Adapter->FWReleaseNumber = hwspec->FWReleaseNumber;
 
@@ -280,7 +280,7 @@ static int wlan_ret_get_hw_spec(wlan_pri
 	dprintk(1, "GET_HW_SPEC: HWIfVersion=0x%X  Version=0x%X\n",
 	       hwspec->HWIfVersion, hwspec->Version);
 
-	Adapter->RegionCode = wlan_le16_to_cpu(hwspec->RegionCode);
+	Adapter->RegionCode = le16_to_cpu(hwspec->RegionCode);
 
 	for (i = 0; i < MRVDRV_MAX_REGION_CODE; i++) {
 		/* use the region code to search for the index */
@@ -338,12 +338,12 @@ static int wlan_ret_802_11_sleep_params(
 	dprintk(1, "error=%x offset=%x stabletime=%x calcontrol=%x\n"
 	       " extsleepclk=%x\n", sp->Error, sp->Offset,
 	       sp->StableTime, sp->CalControl, sp->ExternalSleepClk);
-	Adapter->sp.sp_error = wlan_le16_to_cpu(sp->Error);
-	Adapter->sp.sp_offset = wlan_le16_to_cpu(sp->Offset);
-	Adapter->sp.sp_stabletime = wlan_le16_to_cpu(sp->StableTime);
-	Adapter->sp.sp_calcontrol = wlan_le16_to_cpu(sp->CalControl);
-	Adapter->sp.sp_extsleepclk = wlan_le16_to_cpu(sp->ExternalSleepClk);
-	Adapter->sp.sp_reserved = wlan_le16_to_cpu(sp->Reserved);
+	Adapter->sp.sp_error = le16_to_cpu(sp->Error);
+	Adapter->sp.sp_offset = le16_to_cpu(sp->Offset);
+	Adapter->sp.sp_stabletime = le16_to_cpu(sp->StableTime);
+	Adapter->sp.sp_calcontrol = le16_to_cpu(sp->CalControl);
+	Adapter->sp.sp_extsleepclk = le16_to_cpu(sp->ExternalSleepClk);
+	Adapter->sp.sp_reserved = le16_to_cpu(sp->Reserved);
 
 	LEAVE();
 	return WLAN_STATUS_SUCCESS;
@@ -365,7 +365,7 @@ static int wlan_ret_802_11_sleep_period(
 
 	ENTER();
 
-	Adapter->sleep_period.period = wlan_le16_to_cpu(sp_period->Period);
+	Adapter->sleep_period.period = le16_to_cpu(sp_period->Period);
 
 	LEAVE();
 	return WLAN_STATUS_SUCCESS;
@@ -446,35 +446,35 @@ static int wlan_ret_802_11_snmp_mib(wlan
 				    struct HostCmd_DS_COMMAND *resp)
 {
 	struct HostCmd_DS_802_11_SNMP_MIB *smib = &resp->params.smib;
-	u16 OID = wlan_le16_to_cpu(smib->OID);
-	u16 QueryType = wlan_le16_to_cpu(smib->QueryType);
+	u16 OID = le16_to_cpu(smib->OID);
+	u16 QueryType = le16_to_cpu(smib->QueryType);
 
 	ENTER();
 
 	dprintk(1, "SNMP_RESP: value of the OID = %x, QueryType=%x\n", OID,
 	       QueryType);
 	dprintk(1, "SNMP_RESP: Buf size  = %x\n",
-	       wlan_le16_to_cpu(smib->BufSize));
+	       le16_to_cpu(smib->BufSize));
 
 	if (QueryType == HostCmd_ACT_GEN_GET) {
 		switch (OID) {
 		case FragThresh_i:
 			priv->adapter->FragThsd =
-			    wlan_le16_to_cpu(*
+			    le16_to_cpu(*
 					     ((unsigned short *)(smib->Value)));
 			dprintk(1, "SNMP_RESP: FragThsd =%u\n",
 			       priv->adapter->FragThsd);
 			break;
 		case RtsThresh_i:
 			priv->adapter->RTSThsd =
-			    wlan_le16_to_cpu(*
+			    le16_to_cpu(*
 					     ((unsigned short *)(smib->Value)));
 			dprintk(1, "SNMP_RESP: RTSThsd =%u\n",
 			       priv->adapter->RTSThsd);
 			break;
 		case ShortRetryLim_i:
 			priv->adapter->TxRetryCount =
-			    wlan_le16_to_cpu(*
+			    le16_to_cpu(*
 					     ((unsigned short *)(smib->Value)));
 			dprintk(1, "SNMP_RESP: TxRetryCount =%u\n",
 			       priv->adapter->RTSThsd);
@@ -517,23 +517,23 @@ static int wlan_ret_802_11_key_material(
 	struct HostCmd_DS_802_11_KEY_MATERIAL *pKeyMaterial = 
 	    &resp->params.keymaterial;
 	wlan_adapter *adapter = priv->adapter;
-	u16 action = wlan_le16_to_cpu(pKeyMaterial->Action);
+	u16 action = le16_to_cpu(pKeyMaterial->Action);
 
 	ENTER();
 
 	/* Copy the returned key to driver private data */
 	if (action == HostCmd_ACT_GET) {
 		u8 * buf_ptr = (u8 *) &pKeyMaterial->KeyParamSet;
-		u8 * resp_end = (u8 *) (resp + wlan_le16_to_cpu(resp->Size));
+		u8 * resp_end = (u8 *) (resp + le16_to_cpu(resp->Size));
 
 		while (buf_ptr < resp_end) {
 			struct MrvlIEtype_KeyParamSet * pKeyParamSet = 
 			    (struct MrvlIEtype_KeyParamSet *) buf_ptr;
 			struct WLAN_802_11_KEY * pKey;
-			u16 key_info = wlan_le16_to_cpu(pKeyParamSet->KeyInfo);
-			u16 param_set_len = wlan_le16_to_cpu(pKeyParamSet->Length);
+			u16 key_info = le16_to_cpu(pKeyParamSet->KeyInfo);
+			u16 param_set_len = le16_to_cpu(pKeyParamSet->Length);
 			u8 * end;
-			u16 key_len = wlan_le16_to_cpu(pKeyParamSet->KeyLen);
+			u16 key_len = le16_to_cpu(pKeyParamSet->KeyLen);
 
 			end = (u8 *) pKeyParamSet + sizeof (pKeyParamSet->Type)
 			                          + sizeof (pKeyParamSet->Length)
@@ -553,9 +553,9 @@ static int wlan_ret_802_11_key_material(
 			memset(pKey, 0, sizeof(struct WLAN_802_11_KEY));
 			if (key_len > sizeof(pKey->key))
 				break;
-			pKey->type = wlan_le16_to_cpu(pKeyParamSet->KeyTypeId);
-			pKey->flags = wlan_le16_to_cpu(pKeyParamSet->KeyInfo);
-			pKey->len = wlan_le16_to_cpu(pKeyParamSet->KeyLen);
+			pKey->type = le16_to_cpu(pKeyParamSet->KeyTypeId);
+			pKey->flags = le16_to_cpu(pKeyParamSet->KeyInfo);
+			pKey->len = le16_to_cpu(pKeyParamSet->KeyLen);
 			memcpy(pKey->key, pKeyParamSet->Key, pKey->len);
 
 			buf_ptr = end + 1;
@@ -602,7 +602,7 @@ static int wlan_ret_802_11_rf_tx_power(w
 
 	ENTER();
 
-	Adapter->TxPowerLevel = wlan_le16_to_cpu(rtp->CurrentLevel);
+	Adapter->TxPowerLevel = le16_to_cpu(rtp->CurrentLevel);
 
 	dprintk(1, "Current TxPower Level = %d\n", Adapter->TxPowerLevel);
 
@@ -622,18 +622,18 @@ static int wlan_ret_802_11_rf_antenna(wl
 {
 	struct HostCmd_DS_802_11_RF_ANTENNA *pAntenna = &resp->params.rant;
 	wlan_adapter *Adapter = priv->adapter;
-	u16 Action = wlan_le16_to_cpu(pAntenna->Action);
+	u16 Action = le16_to_cpu(pAntenna->Action);
 
 	if (Action == HostCmd_ACT_GET_RX)
 		Adapter->RxAntennaMode =
-		    wlan_le16_to_cpu(pAntenna->AntennaMode);
+		    le16_to_cpu(pAntenna->AntennaMode);
 
 	if (Action == HostCmd_ACT_GET_TX)
 		Adapter->TxAntennaMode =
-		    wlan_le16_to_cpu(pAntenna->AntennaMode);
+		    le16_to_cpu(pAntenna->AntennaMode);
 
 	dprintk(1, "RF_ANT_RESP: Action = 0x%x, Mode = 0x%04x\n",
-	       Action, wlan_le16_to_cpu(pAntenna->AntennaMode));
+	       Action, le16_to_cpu(pAntenna->AntennaMode));
 
 	return WLAN_STATUS_SUCCESS;
 }
@@ -720,8 +720,8 @@ static int wlan_ret_802_11_rf_channel(wl
 	struct HostCmd_DS_802_11_RF_CHANNEL *rfchannel =
 	    &resp->params.rfchannel;
 	wlan_adapter *Adapter = priv->adapter;
-	u16 Action = wlan_le16_to_cpu(rfchannel->Action);
-	u16 newChannel = wlan_le16_to_cpu(rfchannel->CurrentChannel);
+	u16 Action = le16_to_cpu(rfchannel->Action);
+	u16 newChannel = le16_to_cpu(rfchannel->CurrentChannel);
 
 	ENTER();
 
@@ -752,13 +752,13 @@ static int wlan_ret_802_11_rssi(wlan_pri
 	wlan_adapter *Adapter = priv->adapter;
 
 	/* store the non average value */
-	Adapter->SNR[TYPE_BEACON][TYPE_NOAVG] = wlan_le16_to_cpu(rssirsp->SNR);
+	Adapter->SNR[TYPE_BEACON][TYPE_NOAVG] = le16_to_cpu(rssirsp->SNR);
 	Adapter->NF[TYPE_BEACON][TYPE_NOAVG] =
-	    wlan_le16_to_cpu(rssirsp->NoiseFloor);
+	    le16_to_cpu(rssirsp->NoiseFloor);
 
-	Adapter->SNR[TYPE_BEACON][TYPE_AVG] = wlan_le16_to_cpu(rssirsp->AvgSNR);
+	Adapter->SNR[TYPE_BEACON][TYPE_AVG] = le16_to_cpu(rssirsp->AvgSNR);
 	Adapter->NF[TYPE_BEACON][TYPE_AVG] =
-	    wlan_le16_to_cpu(rssirsp->AvgNoiseFloor);
+	    le16_to_cpu(rssirsp->AvgNoiseFloor);
 
 	Adapter->RSSI[TYPE_BEACON][TYPE_NOAVG] =
 	    CAL_RSSI(Adapter->SNR[TYPE_BEACON][TYPE_NOAVG],
@@ -787,19 +787,19 @@ static int wlan_ret_802_11_eeprom_access
 	wlan_adapter *Adapter = priv->adapter;
 	wlan_ioctl_regrdwr *pBuf = (wlan_ioctl_regrdwr *) Adapter->pRdeeprom;
 	dprintk(1, "eeprom read len=%x\n",
-	       wlan_le16_to_cpu(resp->params.rdeeprom.ByteCount));
-	if (pBuf->NOB < wlan_le16_to_cpu(resp->params.rdeeprom.ByteCount)) {
+	       le16_to_cpu(resp->params.rdeeprom.ByteCount));
+	if (pBuf->NOB < le16_to_cpu(resp->params.rdeeprom.ByteCount)) {
 		pBuf->NOB = 0;
 		dprintk(1, "eeprom read return length is too big\n");
 		return WLAN_STATUS_FAILURE;
 	}
-	pBuf->NOB = wlan_le16_to_cpu(resp->params.rdeeprom.ByteCount);
+	pBuf->NOB = le16_to_cpu(resp->params.rdeeprom.ByteCount);
 	if (pBuf->NOB > 0) {
 
 		memcpy(&pBuf->Value, (u8 *) & resp->params.rdeeprom.Value,
-		       wlan_le16_to_cpu(resp->params.rdeeprom.ByteCount));
+		       le16_to_cpu(resp->params.rdeeprom.ByteCount));
 		HEXDUMP("Adapter", (char *)&pBuf->Value,
-			wlan_le16_to_cpu(resp->params.rdeeprom.ByteCount));
+			le16_to_cpu(resp->params.rdeeprom.ByteCount));
 	}
 	return WLAN_STATUS_SUCCESS;
 }
@@ -864,9 +864,9 @@ int libertas_process_rx_command(wlan_pri
 	HEXDUMP("CMD_RESP:", Adapter->CurCmd->BufVirtualAddr,
 		priv->wlan_dev.upld_len);
 
-	RespCmd = wlan_le16_to_cpu(resp->Command);
+	RespCmd = le16_to_cpu(resp->Command);
 
-	Result = wlan_le16_to_cpu(resp->Result);
+	Result = le16_to_cpu(resp->Result);
 
 	dprintk(1, "CMD_RESP: %x Result: %d Length: %d\n", RespCmd,
 	       Result, priv->wlan_dev.upld_len);
@@ -882,7 +882,7 @@ int libertas_process_rx_command(wlan_pri
 	}
 
 	/* Store the response code to CurCmdRetCode. */
-	Adapter->CurCmdRetCode = wlan_le16_to_cpu(resp->Result);
+	Adapter->CurCmdRetCode = le16_to_cpu(resp->Result);
 
 	if (RespCmd == HostCmd_RET_802_11_PS_MODE) {
 		struct HostCmd_DS_802_11_PS_MODE *psmode;
@@ -891,7 +891,7 @@ int libertas_process_rx_command(wlan_pri
 		dprintk(1,
 		       "CMD_RESP: PS_MODE cmd reply result=%#x action=0x%X\n",
 		       resp->Result, psmode->Action);
-		psmode->Action = wlan_cpu_to_le16(psmode->Action);
+		psmode->Action = cpu_to_le16(psmode->Action);
 
 		if (Result) {
 			dprintk(1, "CMD_RESP: PS command failed- %#x \n",
@@ -1105,7 +1105,7 @@ int libertas_process_rx_command(wlan_pri
 	case HostCmd_RET_802_11_INACTIVITY_TIMEOUT:
 		spin_lock_irqsave(&Adapter->driver_lock, flags);
 		*((u16 *) Adapter->CurCmd->pdata_buf) =
-		    wlan_le16_to_cpu(resp->params.inactivity_timeout.Timeout);
+		    le16_to_cpu(resp->params.inactivity_timeout.Timeout);
 		spin_unlock_irqrestore(&Adapter->driver_lock, flags);
 		break;
 
diff --git a/drivers/net/wireless/libertas/wlan_defs.h b/drivers/net/wireless/libertas/wlan_defs.h
index 8b765ed..bf6c113 100644
--- a/drivers/net/wireless/libertas/wlan_defs.h
+++ b/drivers/net/wireless/libertas/wlan_defs.h
@@ -328,13 +328,6 @@ #define SWAP_U8(a,b)	{u8 t; t=a; a=b; b=
 /* SWAP: swap u8 */
 #define SWAP_U16(a,b)	{u16 t; t=a; a=b; b=t;}
 
-#define wlan_le16_to_cpu(x) x
-#define wlan_le32_to_cpu(x) x
-#define wlan_le64_to_cpu(x) x
-#define wlan_cpu_to_le16(x) x
-#define wlan_cpu_to_le32(x) x
-#define wlan_cpu_to_le64(x) x
-
 /** Global Varibale Declaration */
 typedef struct _wlan_private wlan_private;
 typedef struct _wlan_adapter wlan_adapter;
diff --git a/drivers/net/wireless/libertas/wlan_fw.c b/drivers/net/wireless/libertas/wlan_fw.c
index e6356ca..85907ab 100644
--- a/drivers/net/wireless/libertas/wlan_fw.c
+++ b/drivers/net/wireless/libertas/wlan_fw.c
@@ -156,14 +156,14 @@ static int wlan_allocate_adapter(wlan_pr
 	libertas_allocate_cmd_buffer(priv);
 
 	memset(&Adapter->libertas_ps_confirm_sleep, 0, sizeof(struct PS_CMD_ConfirmSleep));
-	Adapter->libertas_ps_confirm_sleep.SeqNum = wlan_cpu_to_le16(++Adapter->SeqNum);
+	Adapter->libertas_ps_confirm_sleep.SeqNum = cpu_to_le16(++Adapter->SeqNum);
 	Adapter->libertas_ps_confirm_sleep.Command =
-	    wlan_cpu_to_le16(HostCmd_CMD_802_11_PS_MODE);
+	    cpu_to_le16(HostCmd_CMD_802_11_PS_MODE);
 	Adapter->libertas_ps_confirm_sleep.Size =
-	    wlan_cpu_to_le16(sizeof(struct PS_CMD_ConfirmSleep));
+	    cpu_to_le16(sizeof(struct PS_CMD_ConfirmSleep));
 	Adapter->libertas_ps_confirm_sleep.Result = 0;
 	Adapter->libertas_ps_confirm_sleep.Action =
-	    wlan_cpu_to_le16(HostCmd_SubCmd_Sleep_Confirmed);
+	    cpu_to_le16(HostCmd_SubCmd_Sleep_Confirmed);
 
 	return WLAN_STATUS_SUCCESS;
 }
diff --git a/drivers/net/wireless/libertas/wlan_ioctl.c b/drivers/net/wireless/libertas/wlan_ioctl.c
index 88dd680..601f03f 100644
--- a/drivers/net/wireless/libertas/wlan_ioctl.c
+++ b/drivers/net/wireless/libertas/wlan_ioctl.c
@@ -1231,7 +1231,7 @@ static int wlan_sleep_period(wlan_privat
 	memset(&Adapter->sleep_period, 0, sizeof(struct sleep_period));
 
 	if (wrq->u.data.length == 0) {
-		sleeppd.Action = wlan_cpu_to_le16(HostCmd_ACT_GEN_GET);
+		sleeppd.Action = cpu_to_le16(HostCmd_ACT_GEN_GET);
 	} else {
 		if (copy_from_user(&data, wrq->u.data.pointer, sizeof(int))) {
 			dprintk(1, "Copy from user failed\n");
@@ -1240,7 +1240,7 @@ static int wlan_sleep_period(wlan_privat
 
 		/* sleep period is between 0 or 10 ... 60 */
 		if ((data <= 60 && data >= 10) || (data == 0)) {
-			sleeppd.Action = wlan_cpu_to_le16(HostCmd_ACT_GEN_SET);
+			sleeppd.Action = cpu_to_le16(HostCmd_ACT_GEN_SET);
 			sleeppd.Period = data;
 		} else
 			return -EINVAL;
@@ -2455,7 +2455,7 @@ #define MAX_U16_VAL	65535
 
 				if (wrq->u.data.length == 0) {
 					cfg.Action =
-					    wlan_cpu_to_le16
+					    cpu_to_le16
 					    (HostCmd_ACT_GEN_GET);
 				} else {
 					if (copy_from_user
@@ -2467,7 +2467,7 @@ #define MAX_U16_VAL	65535
 					}
 
 					cfg.Action =
-					    wlan_cpu_to_le16
+					    cpu_to_le16
 					    (HostCmd_ACT_GEN_SET);
 					cfg.Enable = data[0];
 					cfg.UseSNR = data[1];
@@ -2509,7 +2509,7 @@ #define MAX_U16_VAL	65535
 					return WLAN_STATUS_FAILURE;
 				if (wrq->u.data.length == 0) {
 					cfg.Action =
-					    wlan_cpu_to_le16
+					    cpu_to_le16
 					    (HostCmd_ACT_GEN_GET);
 				} else {
 					if (copy_from_user
@@ -2521,7 +2521,7 @@ #define MAX_U16_VAL	65535
 					}
 
 					cfg.Action =
-					    wlan_cpu_to_le16
+					    cpu_to_le16
 					    (HostCmd_ACT_GEN_SET);
 					cfg.Enable = data[0];
 					cfg.PA_P0 = data[1];
@@ -2644,7 +2644,7 @@ #define MAX_U16_VAL	65535
 					return -ENOTSUPP;
 				if (wrq->u.data.length == 0) {
 					ctrl.Action =
-					    wlan_cpu_to_le16
+					    cpu_to_le16
 					    (HostCmd_ACT_GEN_GET);
 				} else {
 					if (copy_from_user
@@ -2657,11 +2657,11 @@ #define MAX_U16_VAL	65535
 					}
 
 					ctrl.Action =
-					    wlan_cpu_to_le16
+					    cpu_to_le16
 					    (HostCmd_ACT_GEN_SET);
-					ctrl.NumLed = wlan_cpu_to_le16(0);
+					ctrl.NumLed = cpu_to_le16(0);
 					gpio->Header.Type =
-					    wlan_cpu_to_le16(TLV_TYPE_LED_GPIO);
+					    cpu_to_le16(TLV_TYPE_LED_GPIO);
 					gpio->Header.Len = wrq->u.data.length;
 					for (i = 0; i < wrq->u.data.length;
 					     i += 2) {
diff --git a/drivers/net/wireless/libertas/wlan_join.c b/drivers/net/wireless/libertas/wlan_join.c
index b19f285..ce100f7 100644
--- a/drivers/net/wireless/libertas/wlan_join.c
+++ b/drivers/net/wireless/libertas/wlan_join.c
@@ -479,9 +479,9 @@ int libertas_cmd_80211_authenticate(wlan
 	    &cmd->params.auth;
 	u8 *bssid = (u8 *) pdata_buf;
 
-	cmd->Command = wlan_cpu_to_le16(HostCmd_CMD_802_11_AUTHENTICATE);
+	cmd->Command = cpu_to_le16(HostCmd_CMD_802_11_AUTHENTICATE);
 	cmd->Size =
-	    wlan_cpu_to_le16(sizeof(struct HostCmd_DS_802_11_AUTHENTICATE)
+	    cpu_to_le16(sizeof(struct HostCmd_DS_802_11_AUTHENTICATE)
 			     + S_DS_GEN);
 
 	pAuthenticate->AuthType = Adapter->SecInfo.AuthenticationMode;
@@ -508,9 +508,9 @@ int libertas_cmd_80211_deauthenticate(wl
 
 	ENTER();
 
-	cmd->Command = wlan_cpu_to_le16(HostCmd_CMD_802_11_DEAUTHENTICATE);
+	cmd->Command = cpu_to_le16(HostCmd_CMD_802_11_DEAUTHENTICATE);
 	cmd->Size =
-	    wlan_cpu_to_le16(sizeof(struct HostCmd_DS_802_11_DEAUTHENTICATE) +
+	    cpu_to_le16(sizeof(struct HostCmd_DS_802_11_DEAUTHENTICATE) +
 			     S_DS_GEN);
 
 	/* set AP MAC address */
@@ -519,7 +519,7 @@ int libertas_cmd_80211_deauthenticate(wl
 
 	/* Reason code 3 = Station is leaving */
 #define REASON_CODE_STA_LEAVING 3
-	dauth->ReasonCode = wlan_cpu_to_le16(REASON_CODE_STA_LEAVING);
+	dauth->ReasonCode = cpu_to_le16(REASON_CODE_STA_LEAVING);
 
 	LEAVE();
 	return WLAN_STATUS_SUCCESS;
@@ -560,7 +560,7 @@ int libertas_cmd_80211_associate(wlan_pr
 		goto done;
 	}
 
-	cmd->Command = wlan_cpu_to_le16(HostCmd_CMD_802_11_ASSOCIATE);
+	cmd->Command = cpu_to_le16(HostCmd_CMD_802_11_ASSOCIATE);
 
 	/* Save so we know which BSS Desc to use in the response handler */
 	Adapter->pAttemptedBSSDesc = pBSSDesc;
@@ -578,29 +578,29 @@ int libertas_cmd_80211_associate(wlan_pr
 	pos += sizeof(pAsso->DtimPeriod);
 
 	ssid = (struct MrvlIEtypes_SsIdParamSet *) pos;
-	ssid->Header.Type = wlan_cpu_to_le16(TLV_TYPE_SSID);
+	ssid->Header.Type = cpu_to_le16(TLV_TYPE_SSID);
 	ssid->Header.Len = pBSSDesc->Ssid.SsidLength;
 	memcpy(ssid->SsId, pBSSDesc->Ssid.Ssid, ssid->Header.Len);
 	pos += sizeof(ssid->Header) + ssid->Header.Len;
-	ssid->Header.Len = wlan_cpu_to_le16(ssid->Header.Len);
+	ssid->Header.Len = cpu_to_le16(ssid->Header.Len);
 
 	phy = (struct MrvlIEtypes_PhyParamSet *) pos;
-	phy->Header.Type = wlan_cpu_to_le16(TLV_TYPE_PHY_DS);
+	phy->Header.Type = cpu_to_le16(TLV_TYPE_PHY_DS);
 	phy->Header.Len = sizeof(phy->fh_ds.DsParamSet);
 	memcpy(&phy->fh_ds.DsParamSet,
 	       &pBSSDesc->PhyParamSet.DsParamSet.CurrentChan,
 	       sizeof(phy->fh_ds.DsParamSet));
 	pos += sizeof(phy->Header) + phy->Header.Len;
-	phy->Header.Len = wlan_cpu_to_le16(phy->Header.Len);
+	phy->Header.Len = cpu_to_le16(phy->Header.Len);
 
 	ss = (struct MrvlIEtypes_SsParamSet *) pos;
-	ss->Header.Type = wlan_cpu_to_le16(TLV_TYPE_CF);
+	ss->Header.Type = cpu_to_le16(TLV_TYPE_CF);
 	ss->Header.Len = sizeof(ss->cf_ibss.CfParamSet);
 	pos += sizeof(ss->Header) + ss->Header.Len;
-	ss->Header.Len = wlan_cpu_to_le16(ss->Header.Len);
+	ss->Header.Len = cpu_to_le16(ss->Header.Len);
 
 	rates = (struct MrvlIEtypes_RatesParamSet *) pos;
-	rates->Header.Type = wlan_cpu_to_le16(TLV_TYPE_RATES);
+	rates->Header.Type = cpu_to_le16(TLV_TYPE_RATES);
 
 	memcpy(&rates->Rates, &pBSSDesc->libertas_supported_rates, WLAN_SUPPORTED_RATES);
 
@@ -617,18 +617,18 @@ int libertas_cmd_80211_associate(wlan_pr
 	Adapter->CurBssParams.NumOfRates = rates->Header.Len;
 
 	pos += sizeof(rates->Header) + rates->Header.Len;
-	rates->Header.Len = wlan_cpu_to_le16(rates->Header.Len);
+	rates->Header.Len = cpu_to_le16(rates->Header.Len);
 
 	if (Adapter->SecInfo.WPAEnabled || Adapter->SecInfo.WPA2Enabled) {
 		rsn = (struct MrvlIEtypes_RsnParamSet *) pos;
 		rsn->Header.Type = (u16) Adapter->Wpa_ie[0];	/* WPA_IE or WPA2_IE */
-		rsn->Header.Type = wlan_cpu_to_le16(rsn->Header.Type);
+		rsn->Header.Type = cpu_to_le16(rsn->Header.Type);
 		rsn->Header.Len = (u16) Adapter->Wpa_ie[1];
 		memcpy(rsn->RsnIE, &Adapter->Wpa_ie[2], rsn->Header.Len);
 		HEXDUMP("ASSOC_CMD: RSN IE", (u8 *) rsn,
 			sizeof(rsn->Header) + rsn->Header.Len);
 		pos += sizeof(rsn->Header) + rsn->Header.Len;
-		rsn->Header.Len = wlan_cpu_to_le16(rsn->Header.Len);
+		rsn->Header.Len = cpu_to_le16(rsn->Header.Len);
 	}
 
 	/* update CurBssParams */
@@ -652,14 +652,14 @@ #define CAPINFO_ESS_MODE 1
 		goto done;
 	}
 
-	cmd->Size = wlan_cpu_to_le16((u16) (pos - (u8 *) pAsso) + S_DS_GEN);
+	cmd->Size = cpu_to_le16((u16) (pos - (u8 *) pAsso) + S_DS_GEN);
 
 	/* set the Capability info at last */
 	memcpy(&TmpCap, &pBSSDesc->Cap, sizeof(pAsso->CapInfo));
 	TmpCap &= CAPINFO_MASK;
 	dprintk(1, "ASSOC_CMD: TmpCap=%4X CAPINFO_MASK=%4X\n",
 	       TmpCap, CAPINFO_MASK);
-	TmpCap = wlan_cpu_to_le16(TmpCap);
+	TmpCap = cpu_to_le16(TmpCap);
 	memcpy(&pAsso->CapInfo, &TmpCap, sizeof(pAsso->CapInfo));
 
       done:
@@ -693,7 +693,7 @@ int libertas_cmd_80211_ad_hoc_start(wlan
 		goto done;
 	}
 
-	cmd->Command = wlan_cpu_to_le16(HostCmd_CMD_802_11_AD_HOC_START);
+	cmd->Command = cpu_to_le16(HostCmd_CMD_802_11_AD_HOC_START);
 
 	pBSSDesc = &Adapter->CurBssParams.BSSDescriptor;
 	Adapter->pAttemptedBSSDesc = pBSSDesc;
@@ -768,7 +768,7 @@ #define IBSS_PARA_IE_LEN  2
 	pBSSDesc->Cap.Ibss = 1;
 
 	/* ProbeDelay */
-	adhs->ProbeDelay = wlan_cpu_to_le16(HostCmd_SCAN_PROBE_DELAY_TIME);
+	adhs->ProbeDelay = cpu_to_le16(HostCmd_SCAN_PROBE_DELAY_TIME);
 
 	/* set up privacy in Adapter->ScanTable[i] */
 	if (Adapter->SecInfo.WEPStatus == Wlan802_11WEPEnabled) {
@@ -815,11 +815,11 @@ #define AD_HOC_CAP_PRIVACY_ON 1
 	}
 
 	cmd->Size =
-	    wlan_cpu_to_le16(sizeof(struct HostCmd_DS_802_11_AD_HOC_START)
+	    cpu_to_le16(sizeof(struct HostCmd_DS_802_11_AD_HOC_START)
 			     + S_DS_GEN + cmdAppendSize);
 
 	memcpy(&TmpCap, &adhs->Cap, sizeof(u16));
-	TmpCap = wlan_cpu_to_le16(TmpCap);
+	TmpCap = cpu_to_le16(TmpCap);
 	memcpy(&adhs->Cap, &TmpCap, sizeof(u16));
 
 	ret = WLAN_STATUS_SUCCESS;
@@ -838,9 +838,9 @@ #define AD_HOC_CAP_PRIVACY_ON 1
 int libertas_cmd_80211_ad_hoc_stop(wlan_private * priv,
 				struct HostCmd_DS_COMMAND *cmd)
 {
-	cmd->Command = wlan_cpu_to_le16(HostCmd_CMD_802_11_AD_HOC_STOP);
+	cmd->Command = cpu_to_le16(HostCmd_CMD_802_11_AD_HOC_STOP);
 	cmd->Size =
-	    wlan_cpu_to_le16(sizeof(struct HostCmd_DS_802_11_AD_HOC_STOP)
+	    cpu_to_le16(sizeof(struct HostCmd_DS_802_11_AD_HOC_STOP)
 			     + S_DS_GEN);
 
 	return WLAN_STATUS_SUCCESS;
@@ -872,7 +872,7 @@ int libertas_cmd_80211_ad_hoc_join(wlan_
 
 	Adapter->pAttemptedBSSDesc = pBSSDesc;
 
-	cmd->Command = wlan_cpu_to_le16(HostCmd_CMD_802_11_AD_HOC_JOIN);
+	cmd->Command = cpu_to_le16(HostCmd_CMD_802_11_AD_HOC_JOIN);
 
 	pAdHocJoin->BssDescriptor.BSSType = HostCmd_BSS_TYPE_IBSS;
 
@@ -914,11 +914,11 @@ int libertas_cmd_80211_ad_hoc_join(wlan_
 	       (u32) pAdHocJoin->BssDescriptor.DataRates);
 
 	/* FailTimeOut */
-	pAdHocJoin->FailTimeOut = wlan_cpu_to_le16(MRVDRV_ASSOCIATION_TIME_OUT);
+	pAdHocJoin->FailTimeOut = cpu_to_le16(MRVDRV_ASSOCIATION_TIME_OUT);
 
 	/* ProbeDelay */
 	pAdHocJoin->ProbeDelay =
-	    wlan_cpu_to_le16(HostCmd_SCAN_PROBE_DELAY_TIME);
+	    cpu_to_le16(HostCmd_SCAN_PROBE_DELAY_TIME);
 
 	/* Copy Data Rates from the Rates recorded in scan response */
 	memset(pAdHocJoin->BssDescriptor.DataRates, 0,
@@ -954,7 +954,7 @@ int libertas_cmd_80211_ad_hoc_join(wlan_
 	       Adapter->CurBssParams.NumOfRates);
 
 	pAdHocJoin->BssDescriptor.SsParamSet.IbssParamSet.AtimWindow =
-	    wlan_cpu_to_le16(pBSSDesc->ATIMWindow);
+	    cpu_to_le16(pBSSDesc->ATIMWindow);
 
 	if (Adapter->SecInfo.WEPStatus == Wlan802_11WEPEnabled) {
 		pAdHocJoin->BssDescriptor.Cap.Privacy = AD_HOC_CAP_PRIVACY_ON;
@@ -982,12 +982,12 @@ int libertas_cmd_80211_ad_hoc_join(wlan_
 	}
 
 	cmd->Size =
-	    wlan_cpu_to_le16(sizeof(struct HostCmd_DS_802_11_AD_HOC_JOIN)
+	    cpu_to_le16(sizeof(struct HostCmd_DS_802_11_AD_HOC_JOIN)
 			     + S_DS_GEN + cmdAppendSize);
 
 	memcpy(&TmpCap, &pAdHocJoin->BssDescriptor.Cap,
 	       sizeof(struct IEEEtypes_CapInfo));
-	TmpCap = wlan_cpu_to_le16(TmpCap);
+	TmpCap = cpu_to_le16(TmpCap);
 
 	memcpy(&pAdHocJoin->BssDescriptor.Cap,
 	       &TmpCap, sizeof(struct IEEEtypes_CapInfo));
@@ -1043,7 +1043,7 @@ int libertas_ret_80211_associate(wlan_pr
 	}
 
 	HEXDUMP("ASSOC_RESP:", (void *)&resp->params,
-		wlan_le16_to_cpu(resp->Size) - S_DS_GEN);
+		le16_to_cpu(resp->Size) - S_DS_GEN);
 
 	/* Send a Media Connected event, according to the Spec */
 	Adapter->MediaConnectStatus = WlanMediaStateConnected;
@@ -1124,8 +1124,8 @@ int libertas_ret_80211_ad_hoc_start(wlan
 {
 	wlan_adapter *Adapter = priv->adapter;
 	int ret = WLAN_STATUS_SUCCESS;
-	u16 Command = wlan_le16_to_cpu(resp->Command);
-	u16 Result = wlan_le16_to_cpu(resp->Result);
+	u16 Command = le16_to_cpu(resp->Command);
+	u16 Result = le16_to_cpu(resp->Result);
 	struct HostCmd_DS_802_11_AD_HOC_RESULT *pAdHocResult;
 	union iwreq_data wrqu;
 	struct bss_descriptor *pBSSDesc;
@@ -1134,7 +1134,7 @@ int libertas_ret_80211_ad_hoc_start(wlan
 
 	pAdHocResult = &resp->params.result;
 
-	dprintk(1, "ADHOC_S_RESP: Size = %d\n", wlan_le16_to_cpu(resp->Size));
+	dprintk(1, "ADHOC_S_RESP: Size = %d\n", le16_to_cpu(resp->Size));
 	dprintk(1, "ADHOC_S_RESP: Command = %x\n", Command);
 	dprintk(1, "ADHOC_S_RESP: Result = %x\n", Result);
 
diff --git a/drivers/net/wireless/libertas/wlan_scan.c b/drivers/net/wireless/libertas/wlan_scan.c
index c15afa8..9568724 100644
--- a/drivers/net/wireless/libertas/wlan_scan.c
+++ b/drivers/net/wireless/libertas/wlan_scan.c
@@ -392,13 +392,13 @@ static void wlan_scan_create_channel_lis
 
 			if (scanType == HostCmd_SCAN_TYPE_PASSIVE) {
 				scanChanList[chanIdx].MaxScanTime =
-				    wlan_cpu_to_le16
+				    cpu_to_le16
 				    (MRVDRV_PASSIVE_SCAN_CHAN_TIME);
 				scanChanList[chanIdx].ChanScanMode.PassiveScan =
 				    1;
 			} else {
 				scanChanList[chanIdx].MaxScanTime =
-				    wlan_cpu_to_le16
+				    cpu_to_le16
 				    (MRVDRV_ACTIVE_SCAN_CHAN_TIME);
 				scanChanList[chanIdx].ChanScanMode.PassiveScan =
 				    0;
@@ -535,8 +535,8 @@ wlan_scan_setup_scan_config(wlan_private
 			pSsidTlv =
 			    (struct MrvlIEtypes_SsIdParamSet *) pScanCfgOut->
 			    tlvBuffer;
-			pSsidTlv->Header.Type = wlan_cpu_to_le16(TLV_TYPE_SSID);
-			pSsidTlv->Header.Len = wlan_cpu_to_le16(ssidLen);
+			pSsidTlv->Header.Type = cpu_to_le16(TLV_TYPE_SSID);
+			pSsidTlv->Header.Len = cpu_to_le16(ssidLen);
 			memcpy(pSsidTlv->SsId, pUserScanIn->specificSSID,
 			       ssidLen);
 			pTlvPos += sizeof(pSsidTlv->Header) + ssidLen;
@@ -562,15 +562,15 @@ wlan_scan_setup_scan_config(wlan_private
 	if (numProbes) {
 		pNumProbesTlv = (struct MrvlIEtypes_NumProbes *) pTlvPos;
 		pNumProbesTlv->Header.Type =
-		    wlan_cpu_to_le16(TLV_TYPE_NUMPROBES);
+		    cpu_to_le16(TLV_TYPE_NUMPROBES);
 		pNumProbesTlv->Header.Len = sizeof(pNumProbesTlv->NumProbes);
-		pNumProbesTlv->NumProbes = wlan_cpu_to_le16(numProbes);
+		pNumProbesTlv->NumProbes = cpu_to_le16(numProbes);
 
 		pTlvPos +=
 		    sizeof(pNumProbesTlv->Header) + pNumProbesTlv->Header.Len;
 
 		pNumProbesTlv->Header.Len =
-		    wlan_cpu_to_le16(pNumProbesTlv->Header.Len);
+		    cpu_to_le16(pNumProbesTlv->Header.Len);
 	}
 
 	/*
@@ -617,9 +617,9 @@ wlan_scan_setup_scan_config(wlan_private
 			}
 
 			(pScanChanList + chanIdx)->MinScanTime =
-			    wlan_cpu_to_le16(scanDur);
+			    cpu_to_le16(scanDur);
 			(pScanChanList + chanIdx)->MaxScanTime =
-			    wlan_cpu_to_le16(scanDur);
+			    cpu_to_le16(scanDur);
 		}
 
 		/* Check if we are only scanning the current channel */
@@ -684,7 +684,7 @@ static int wlan_scan_channel_list(wlan_p
 		return WLAN_STATUS_FAILURE;
 	}
 
-	pChanTlvOut->Header.Type = wlan_cpu_to_le16(TLV_TYPE_CHANLIST);
+	pChanTlvOut->Header.Type = cpu_to_le16(TLV_TYPE_CHANLIST);
 
 	/* Set the temp channel struct pointer to the start of the desired list */
 	pTmpChan = pScanChanList;
@@ -959,8 +959,8 @@ void wlan_ret_802_11_scan_get_tlv_ptrs(s
 	HEXDUMP("SCAN_RESP: TLV Buf", (u8 *) pTlv, tlvBufSize);
 
 	while (tlvBufLeft >= sizeof(struct MrvlIEtypesHeader)) {
-		tlvType = wlan_le16_to_cpu(pCurrentTlv->Header.Type);
-		tlvLen = wlan_le16_to_cpu(pCurrentTlv->Header.Len);
+		tlvType = le16_to_cpu(pCurrentTlv->Header.Type);
+		tlvLen = le16_to_cpu(pCurrentTlv->Header.Len);
 
 		switch (tlvType) {
 		case TLV_TYPE_TSFTIMESTAMP:
@@ -1026,7 +1026,7 @@ static int InterpretBSSDescriptionWithIE
 	if (*bytesLeft >= sizeof(beaconSize)) {
 		/* Extract & convert beacon size from the command buffer */
 		memcpy(&beaconSize, *pBeaconInfo, sizeof(beaconSize));
-		beaconSize = wlan_le16_to_cpu(beaconSize);
+		beaconSize = le16_to_cpu(beaconSize);
 		*bytesLeft -= sizeof(beaconSize);
 		*pBeaconInfo += sizeof(beaconSize);
 	}
@@ -1071,7 +1071,7 @@ static int InterpretBSSDescriptionWithIE
 	 */
 
 	/* RSSI is 1 byte long */
-	pBSSEntry->Rssi = wlan_le32_to_cpu((long)(*pCurrentPtr));
+	pBSSEntry->Rssi = le32_to_cpu((long)(*pCurrentPtr));
 	dprintk(1, "InterpretIE: RSSI=%02X\n", *pCurrentPtr);
 	pCurrentPtr += 1;
 	bytesLeftForCurrentBeacon -= 1;
@@ -1084,7 +1084,7 @@ static int InterpretBSSDescriptionWithIE
 
 	/* beacon interval is 2 bytes long */
 	memcpy(&fixedIE.BeaconInterval, pCurrentPtr, 2);
-	pBSSEntry->BeaconPeriod = wlan_le16_to_cpu(fixedIE.BeaconInterval);
+	pBSSEntry->BeaconPeriod = le16_to_cpu(fixedIE.BeaconInterval);
 	pCurrentPtr += 2;
 	bytesLeftForCurrentBeacon -= 2;
 
@@ -1092,7 +1092,7 @@ static int InterpretBSSDescriptionWithIE
 	memcpy(&fixedIE.Capabilities, pCurrentPtr, 2);
 	dprintk(1, "InterpretIE: fixedIE.Capabilities=0x%X\n",
 	       fixedIE.Capabilities);
-	fixedIE.Capabilities = wlan_le16_to_cpu(fixedIE.Capabilities);
+	fixedIE.Capabilities = le16_to_cpu(fixedIE.Capabilities);
 	pCap = (struct IEEEtypes_CapInfo *) & fixedIE.Capabilities;
 	memcpy(&pBSSEntry->Cap, pCap, sizeof(struct IEEEtypes_CapInfo));
 	pCurrentPtr += 2;
@@ -1160,7 +1160,7 @@ static int InterpretBSSDescriptionWithIE
 				sizeof(struct IEEEtypes_FhParamSet));
 			pBSSEntry->PhyParamSet.FhParamSet.DwellTime
 			    =
-			    wlan_le16_to_cpu(pBSSEntry->PhyParamSet.FhParamSet.
+			    le16_to_cpu(pBSSEntry->PhyParamSet.FhParamSet.
 					     DwellTime);
 			break;
 
@@ -1184,14 +1184,14 @@ static int InterpretBSSDescriptionWithIE
 		case IBSS_PARAM_SET:
 			pIbss = (struct IEEEtypes_IbssParamSet *) pCurrentPtr;
 			pBSSEntry->ATIMWindow =
-			    wlan_le32_to_cpu(pIbss->AtimWindow);
+			    le32_to_cpu(pIbss->AtimWindow);
 
 			memmove(&pBSSEntry->SsParamSet.IbssParamSet, pIbss,
 				sizeof(struct IEEEtypes_IbssParamSet));
 
 			pBSSEntry->SsParamSet.IbssParamSet.AtimWindow
 			    =
-			    wlan_le16_to_cpu(pBSSEntry->SsParamSet.IbssParamSet.
+			    le16_to_cpu(pBSSEntry->SsParamSet.IbssParamSet.
 					     AtimWindow);
 			break;
 
@@ -2102,10 +2102,10 @@ int libertas_cmd_80211_scan(wlan_private
 	memcpy(pScan->BSSID, pScanCfg->specificBSSID, sizeof(pScan->BSSID));
 	memcpy(pScan->TlvBuffer, pScanCfg->tlvBuffer, pScanCfg->tlvBufferLen);
 
-	cmd->Command = wlan_cpu_to_le16(HostCmd_CMD_802_11_SCAN);
+	cmd->Command = cpu_to_le16(HostCmd_CMD_802_11_SCAN);
 
 	/* Size is equal to the sizeof(fixed portions) + the TLV len + header */
-	cmd->Size = wlan_cpu_to_le16(sizeof(pScan->BSSType)
+	cmd->Size = cpu_to_le16(sizeof(pScan->BSSType)
 				     + sizeof(pScan->BSSID)
 				     + pScanCfg->tlvBufferLen + S_DS_GEN);
 
@@ -2167,10 +2167,10 @@ int libertas_ret_80211_scan(wlan_private
 		return WLAN_STATUS_FAILURE;
 	}
 
-	bytesLeft = wlan_le16_to_cpu(pScan->BSSDescriptSize);
+	bytesLeft = le16_to_cpu(pScan->BSSDescriptSize);
 	dprintk(1, "SCAN_RESP: BSSDescriptSize %d\n", bytesLeft);
 
-	scanRespSize = wlan_le16_to_cpu(resp->Size);
+	scanRespSize = le16_to_cpu(resp->Size);
 	dprintk(1, "SCAN_RESP: returned %d AP before parsing\n",
 	       pScan->NumberOfSets);
 
@@ -2271,7 +2271,7 @@ int libertas_ret_80211_scan(wlan_private
 			if (pTsfTlv) {
 				memcpy(&tsfVal, &pTsfTlv->tsfTable[idx],
 				       sizeof(tsfVal));
-				tsfVal = wlan_le64_to_cpu(tsfVal);
+				tsfVal = le64_to_cpu(tsfVal);
 
 				memcpy(&newBssEntry.networkTSF,
 				       &tsfVal, sizeof(newBssEntry.networkTSF));


More information about the Commits-kernel mailing list