summaryrefslogtreecommitdiff
path: root/drivers/staging/rtl8192e
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/staging/rtl8192e')
-rw-r--r--drivers/staging/rtl8192e/rtl819x_BAProc.c10
-rw-r--r--drivers/staging/rtl8192e/rtllib_rx.c12
-rw-r--r--drivers/staging/rtl8192e/rtllib_softmac.c48
-rw-r--r--drivers/staging/rtl8192e/rtllib_tx.c12
4 files changed, 30 insertions, 52 deletions
diff --git a/drivers/staging/rtl8192e/rtl819x_BAProc.c b/drivers/staging/rtl8192e/rtl819x_BAProc.c
index 1d3963136295..1720e1b6ae04 100644
--- a/drivers/staging/rtl8192e/rtl819x_BAProc.c
+++ b/drivers/staging/rtl8192e/rtl819x_BAProc.c
@@ -95,8 +95,7 @@ static struct sk_buff *rtllib_ADDBA(struct rtllib_device *ieee, u8 *Dst,
skb_reserve(skb, ieee->tx_headroom);
- BAReq = (struct rtllib_hdr_3addr *)skb_put(skb,
- sizeof(struct rtllib_hdr_3addr));
+ BAReq = skb_put(skb, sizeof(struct rtllib_hdr_3addr));
ether_addr_copy(BAReq->addr1, Dst);
ether_addr_copy(BAReq->addr2, ieee->dev->dev_addr);
@@ -104,7 +103,7 @@ static struct sk_buff *rtllib_ADDBA(struct rtllib_device *ieee, u8 *Dst,
ether_addr_copy(BAReq->addr3, ieee->current_network.bssid);
BAReq->frame_ctl = cpu_to_le16(RTLLIB_STYPE_MANAGE_ACT);
- tag = (u8 *)skb_put(skb, 9);
+ tag = skb_put(skb, 9);
*tag++ = ACT_CAT_BA;
*tag++ = type;
*tag++ = pBA->DialogToken;
@@ -159,15 +158,14 @@ static struct sk_buff *rtllib_DELBA(struct rtllib_device *ieee, u8 *dst,
skb_reserve(skb, ieee->tx_headroom);
- Delba = (struct rtllib_hdr_3addr *) skb_put(skb,
- sizeof(struct rtllib_hdr_3addr));
+ Delba = skb_put(skb, sizeof(struct rtllib_hdr_3addr));
ether_addr_copy(Delba->addr1, dst);
ether_addr_copy(Delba->addr2, ieee->dev->dev_addr);
ether_addr_copy(Delba->addr3, ieee->current_network.bssid);
Delba->frame_ctl = cpu_to_le16(RTLLIB_STYPE_MANAGE_ACT);
- tag = (u8 *)skb_put(skb, 6);
+ tag = skb_put(skb, 6);
*tag++ = ACT_CAT_BA;
*tag++ = ACT_DELBA;
diff --git a/drivers/staging/rtl8192e/rtllib_rx.c b/drivers/staging/rtl8192e/rtllib_rx.c
index 0033dc6979e7..7bc9cb131bcc 100644
--- a/drivers/staging/rtl8192e/rtllib_rx.c
+++ b/drivers/staging/rtl8192e/rtllib_rx.c
@@ -782,7 +782,6 @@ static u8 parse_subframe(struct rtllib_device *ieee, struct sk_buff *skb,
u8 nPadding_Length = 0;
u16 SeqNum = 0;
struct sk_buff *sub_skb;
- u8 *data_ptr;
/* just for debug purpose */
SeqNum = WLAN_GET_SEQ_SEQ(le16_to_cpu(hdr->seq_ctl));
if ((RTLLIB_QOS_HAS_SEQ(fc)) &&
@@ -817,8 +816,7 @@ static u8 parse_subframe(struct rtllib_device *ieee, struct sk_buff *skb,
if (!sub_skb)
return 0;
skb_reserve(sub_skb, 12);
- data_ptr = (u8 *)skb_put(sub_skb, skb->len);
- memcpy(data_ptr, skb->data, skb->len);
+ skb_put_data(sub_skb, skb->data, skb->len);
sub_skb->dev = ieee->dev;
rxb->subframes[0] = sub_skb;
@@ -870,8 +868,7 @@ static u8 parse_subframe(struct rtllib_device *ieee, struct sk_buff *skb,
if (!sub_skb)
return 0;
skb_reserve(sub_skb, 12);
- data_ptr = (u8 *)skb_put(sub_skb, nSubframe_Length);
- memcpy(data_ptr, skb->data, nSubframe_Length);
+ skb_put_data(sub_skb, skb->data, nSubframe_Length);
sub_skb->dev = ieee->dev;
rxb->subframes[rxb->nr_subframes++] = sub_skb;
@@ -1141,13 +1138,12 @@ static int rtllib_rx_decrypt(struct rtllib_device *ieee, struct sk_buff *skb,
/* copy first fragment (including full headers) into
* beginning of the fragment cache skb
*/
- memcpy(skb_put(frag_skb, flen), skb->data, flen);
+ skb_put_data(frag_skb, skb->data, flen);
} else {
/* append frame payload to the end of the fragment
* cache skb
*/
- memcpy(skb_put(frag_skb, flen), skb->data + hdrlen,
- flen);
+ skb_put_data(frag_skb, skb->data + hdrlen, flen);
}
dev_kfree_skb_any(skb);
skb = NULL;
diff --git a/drivers/staging/rtl8192e/rtllib_softmac.c b/drivers/staging/rtl8192e/rtllib_softmac.c
index 64b0034c9c37..e4be85af31e7 100644
--- a/drivers/staging/rtl8192e/rtllib_softmac.c
+++ b/drivers/staging/rtl8192e/rtllib_softmac.c
@@ -351,8 +351,7 @@ static inline struct sk_buff *rtllib_probe_req(struct rtllib_device *ieee)
skb_reserve(skb, ieee->tx_headroom);
- req = (struct rtllib_probe_request *) skb_put(skb,
- sizeof(struct rtllib_probe_request));
+ req = skb_put(skb, sizeof(struct rtllib_probe_request));
req->header.frame_ctl = cpu_to_le16(RTLLIB_STYPE_PROBE_REQ);
req->header.duration_id = 0;
@@ -360,7 +359,7 @@ static inline struct sk_buff *rtllib_probe_req(struct rtllib_device *ieee)
ether_addr_copy(req->header.addr2, ieee->dev->dev_addr);
eth_broadcast_addr(req->header.addr3);
- tag = (u8 *) skb_put(skb, len + 2 + rate_len);
+ tag = skb_put(skb, len + 2 + rate_len);
*tag++ = MFIE_TYPE_SSID;
*tag++ = len;
@@ -789,8 +788,7 @@ rtllib_authentication_req(struct rtllib_network *beacon,
skb_reserve(skb, ieee->tx_headroom);
- auth = (struct rtllib_authentication *)
- skb_put(skb, sizeof(struct rtllib_authentication));
+ auth = skb_put(skb, sizeof(struct rtllib_authentication));
auth->header.frame_ctl = cpu_to_le16(RTLLIB_STYPE_AUTH);
if (challengelen)
@@ -889,8 +887,7 @@ static struct sk_buff *rtllib_probe_resp(struct rtllib_device *ieee,
skb_reserve(skb, ieee->tx_headroom);
- beacon_buf = (struct rtllib_probe_response *) skb_put(skb,
- (beacon_size - ieee->tx_headroom));
+ beacon_buf = skb_put(skb, (beacon_size - ieee->tx_headroom));
ether_addr_copy(beacon_buf->header.addr1, dest);
ether_addr_copy(beacon_buf->header.addr2, ieee->dev->dev_addr);
ether_addr_copy(beacon_buf->header.addr3, ieee->current_network.bssid);
@@ -984,8 +981,7 @@ static struct sk_buff *rtllib_assoc_resp(struct rtllib_device *ieee, u8 *dest)
skb_reserve(skb, ieee->tx_headroom);
- assoc = (struct rtllib_assoc_response_frame *)
- skb_put(skb, sizeof(struct rtllib_assoc_response_frame));
+ assoc = skb_put(skb, sizeof(struct rtllib_assoc_response_frame));
assoc->header.frame_ctl = cpu_to_le16(RTLLIB_STYPE_ASSOC_RESP);
ether_addr_copy(assoc->header.addr1, dest);
@@ -1016,7 +1012,7 @@ static struct sk_buff *rtllib_assoc_resp(struct rtllib_device *ieee, u8 *dest)
else
ieee->assoc_id++;
- tag = (u8 *) skb_put(skb, rate_len);
+ tag = skb_put(skb, rate_len);
rtllib_MFIE_Brate(ieee, &tag);
rtllib_MFIE_Grate(ieee, &tag);
@@ -1038,8 +1034,7 @@ static struct sk_buff *rtllib_auth_resp(struct rtllib_device *ieee, int status,
skb_reserve(skb, ieee->tx_headroom);
- auth = (struct rtllib_authentication *)
- skb_put(skb, sizeof(struct rtllib_authentication));
+ auth = skb_put(skb, sizeof(struct rtllib_authentication));
auth->status = cpu_to_le16(status);
auth->transaction = cpu_to_le16(2);
@@ -1065,8 +1060,7 @@ static struct sk_buff *rtllib_null_func(struct rtllib_device *ieee, short pwr)
skb_reserve(skb, ieee->tx_headroom);
- hdr = (struct rtllib_hdr_3addr *)skb_put(skb,
- sizeof(struct rtllib_hdr_3addr));
+ hdr = skb_put(skb, sizeof(struct rtllib_hdr_3addr));
ether_addr_copy(hdr->addr1, ieee->current_network.bssid);
ether_addr_copy(hdr->addr2, ieee->dev->dev_addr);
@@ -1092,8 +1086,7 @@ static struct sk_buff *rtllib_pspoll_func(struct rtllib_device *ieee)
skb_reserve(skb, ieee->tx_headroom);
- hdr = (struct rtllib_pspoll_hdr *)skb_put(skb,
- sizeof(struct rtllib_pspoll_hdr));
+ hdr = skb_put(skb, sizeof(struct rtllib_pspoll_hdr));
ether_addr_copy(hdr->bssid, ieee->current_network.bssid);
ether_addr_copy(hdr->ta, ieee->dev->dev_addr);
@@ -1243,8 +1236,7 @@ rtllib_association_req(struct rtllib_network *beacon,
skb_reserve(skb, ieee->tx_headroom);
- hdr = (struct rtllib_assoc_request_frame *)
- skb_put(skb, sizeof(struct rtllib_assoc_request_frame) + 2);
+ hdr = skb_put(skb, sizeof(struct rtllib_assoc_request_frame) + 2);
hdr->header.frame_ctl = cpu_to_le16(RTLLIB_STYPE_ASSOC_REQ);
@@ -1272,8 +1264,7 @@ rtllib_association_req(struct rtllib_network *beacon,
hdr->info_element[0].id = MFIE_TYPE_SSID;
hdr->info_element[0].len = beacon->ssid_len;
- tag = skb_put(skb, beacon->ssid_len);
- memcpy(tag, beacon->ssid, beacon->ssid_len);
+ skb_put_data(skb, beacon->ssid, beacon->ssid_len);
tag = skb_put(skb, rate_len);
@@ -1349,8 +1340,7 @@ rtllib_association_req(struct rtllib_network *beacon,
}
if (wpa_ie_len) {
- tag = skb_put(skb, ieee->wpa_ie_len);
- memcpy(tag, ieee->wpa_ie, ieee->wpa_ie_len);
+ skb_put_data(skb, ieee->wpa_ie, ieee->wpa_ie_len);
if (PMKCacheIdx >= 0) {
tag = skb_put(skb, 18);
@@ -1366,13 +1356,13 @@ rtllib_association_req(struct rtllib_network *beacon,
}
if (wps_ie_len && ieee->wps_ie) {
- tag = skb_put(skb, wps_ie_len);
- memcpy(tag, ieee->wps_ie, wps_ie_len);
+ skb_put_data(skb, ieee->wps_ie, wps_ie_len);
}
- tag = skb_put(skb, turbo_info_len);
- if (turbo_info_len)
+ if (turbo_info_len) {
+ tag = skb_put(skb, turbo_info_len);
rtllib_TURBO_Info(ieee, &tag);
+ }
if (ieee->pHTInfo->bCurrentHTSupport && ieee->pHTInfo->bEnableHT) {
if (ieee->pHTInfo->ePeerHTSpecVer == HT_SPEC_VER_EWC) {
@@ -3092,8 +3082,7 @@ rtllib_disauth_skb(struct rtllib_network *beacon,
skb_reserve(skb, ieee->tx_headroom);
- disauth = (struct rtllib_disauth *) skb_put(skb,
- sizeof(struct rtllib_disauth));
+ disauth = skb_put(skb, sizeof(struct rtllib_disauth));
disauth->header.frame_ctl = cpu_to_le16(RTLLIB_STYPE_DEAUTH);
disauth->header.duration_id = 0;
@@ -3120,8 +3109,7 @@ rtllib_disassociate_skb(struct rtllib_network *beacon,
skb_reserve(skb, ieee->tx_headroom);
- disass = (struct rtllib_disassoc *) skb_put(skb,
- sizeof(struct rtllib_disassoc));
+ disass = skb_put(skb, sizeof(struct rtllib_disassoc));
disass->header.frame_ctl = cpu_to_le16(RTLLIB_STYPE_DISASSOC);
disass->header.duration_id = 0;
diff --git a/drivers/staging/rtl8192e/rtllib_tx.c b/drivers/staging/rtl8192e/rtllib_tx.c
index 78a3ad5b231f..fc88d47dea43 100644
--- a/drivers/staging/rtl8192e/rtllib_tx.c
+++ b/drivers/staging/rtl8192e/rtllib_tx.c
@@ -624,8 +624,7 @@ static int rtllib_xmit_inter(struct sk_buff *skb, struct net_device *dev)
txb->encrypted = 0;
txb->payload_size = cpu_to_le16(skb->len);
- memcpy(skb_put(txb->fragments[0], skb->len), skb->data,
- skb->len);
+ skb_put_data(txb->fragments[0], skb->data, skb->len);
goto success;
}
@@ -818,9 +817,7 @@ static int rtllib_xmit_inter(struct sk_buff *skb, struct net_device *dev)
} else {
tcb_desc->bHwSec = 0;
}
- frag_hdr = (struct rtllib_hdr_3addrqos *)
- skb_put(skb_frag, hdr_len);
- memcpy(frag_hdr, &header, hdr_len);
+ frag_hdr = skb_put_data(skb_frag, &header, hdr_len);
/* If this is not the last fragment, then add the
* MOREFRAGS bit to the frame control
@@ -852,7 +849,7 @@ static int rtllib_xmit_inter(struct sk_buff *skb, struct net_device *dev)
bytes -= SNAP_SIZE + sizeof(u16);
}
- memcpy(skb_put(skb_frag, bytes), skb->data, bytes);
+ skb_put_data(skb_frag, skb->data, bytes);
/* Advance the SKB... */
skb_pull(skb, bytes);
@@ -895,8 +892,7 @@ static int rtllib_xmit_inter(struct sk_buff *skb, struct net_device *dev)
txb->encrypted = 0;
txb->payload_size = cpu_to_le16(skb->len);
- memcpy(skb_put(txb->fragments[0], skb->len), skb->data,
- skb->len);
+ skb_put_data(txb->fragments[0], skb->data, skb->len);
}
success: