diff options
Diffstat (limited to 'drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c')
-rw-r--r-- | drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c b/drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c index cd196cec0dd9..1b4623c3f95e 100644 --- a/drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c +++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c @@ -4,6 +4,8 @@ * ADDBAREQ ADDBARSP and DELBA packet is still on consideration. Temporarily use MANAGE QUEUE instead of Normal Queue. * WB 2008-05-27 * *****************************************************************************************************************************/ +#include <asm/byteorder.h> +#include <asm/unaligned.h> #include "ieee80211.h" #include "rtl819x_BA.h" @@ -110,13 +112,12 @@ static struct sk_buff *ieee80211_ADDBA(struct ieee80211_device *ieee, u8 *Dst, P struct sk_buff *skb = NULL; struct ieee80211_hdr_3addr *BAReq = NULL; u8 *tag = NULL; - __le16 tmp = 0; u16 len = ieee->tx_headroom + 9; //category(1) + action field(1) + Dialog Token(1) + BA Parameter Set(2) + BA Timeout Value(2) + BA Start SeqCtrl(2)(or StatusCode(2)) IEEE80211_DEBUG(IEEE80211_DL_TRACE | IEEE80211_DL_BA, "========>%s(), frame(%d) sentd to:%pM, ieee->dev:%p\n", __func__, type, Dst, ieee->dev); - if (pBA == NULL||ieee == NULL) + if (pBA == NULL) { - IEEE80211_DEBUG(IEEE80211_DL_ERR, "pBA(%p) is NULL or ieee(%p) is NULL\n", pBA, ieee); + IEEE80211_DEBUG(IEEE80211_DL_ERR, "pBA is NULL\n"); return NULL; } skb = dev_alloc_skb(len + sizeof( struct ieee80211_hdr_3addr)); //need to add something others? FIXME @@ -149,17 +150,17 @@ static struct sk_buff *ieee80211_ADDBA(struct ieee80211_device *ieee, u8 *Dst, P { // Status Code printk("=====>to send ADDBARSP\n"); - tmp = cpu_to_le16(StatusCode); - memcpy(tag, (u8 *)&tmp, 2); + + put_unaligned_le16(StatusCode, tag); tag += 2; } // BA Parameter Set - tmp = cpu_to_le16(pBA->BaParamSet.shortData); - memcpy(tag, (u8 *)&tmp, 2); + + put_unaligned_le16(pBA->BaParamSet.shortData, tag); tag += 2; // BA Timeout Value - tmp = cpu_to_le16(pBA->BaTimeoutValue); - memcpy(tag, (u8 *)&tmp, 2); + + put_unaligned_le16(pBA->BaTimeoutValue, tag); tag += 2; if (ACT_ADDBAREQ == type) @@ -196,7 +197,6 @@ static struct sk_buff *ieee80211_DELBA( struct sk_buff *skb = NULL; struct ieee80211_hdr_3addr *Delba = NULL; u8 *tag = NULL; - __le16 tmp = 0; //len = head len + DELBA Parameter Set(2) + Reason Code(2) u16 len = 6 + ieee->tx_headroom; @@ -230,12 +230,12 @@ static struct sk_buff *ieee80211_DELBA( *tag ++= ACT_DELBA; // DELBA Parameter Set - tmp = cpu_to_le16(DelbaParamSet.shortData); - memcpy(tag, (u8 *)&tmp, 2); + + put_unaligned_le16(DelbaParamSet.shortData, tag); tag += 2; // Reason Code - tmp = cpu_to_le16(ReasonCode); - memcpy(tag, (u8 *)&tmp, 2); + + put_unaligned_le16(ReasonCode, tag); tag += 2; IEEE80211_DEBUG_DATA(IEEE80211_DL_DATA|IEEE80211_DL_BA, skb->data, skb->len); |