aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/prism54/islpci_eth.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/prism54/islpci_eth.c')
-rw-r--r--drivers/net/wireless/prism54/islpci_eth.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/drivers/net/wireless/prism54/islpci_eth.c b/drivers/net/wireless/prism54/islpci_eth.c
index b1122912ee2d..dd070cccf324 100644
--- a/drivers/net/wireless/prism54/islpci_eth.c
+++ b/drivers/net/wireless/prism54/islpci_eth.c
@@ -136,7 +136,7 @@ islpci_eth_transmit(struct sk_buff *skb, struct net_device *ndev)
136 printk("islpci_eth_transmit:wds_mac\n"); 136 printk("islpci_eth_transmit:wds_mac\n");
137#endif 137#endif
138 memmove(skb->data + 6, src, skb->len); 138 memmove(skb->data + 6, src, skb->len);
139 memcpy(skb->data, wds_mac, 6); 139 skb_copy_to_linear_data(skb, wds_mac, 6);
140 } else { 140 } else {
141 memmove(skb->data, src, skb->len); 141 memmove(skb->data, src, skb->len);
142 } 142 }
@@ -162,13 +162,16 @@ islpci_eth_transmit(struct sk_buff *skb, struct net_device *ndev)
162 162
163 skb_put(newskb, init_wds ? skb->len + 6 : skb->len); 163 skb_put(newskb, init_wds ? skb->len + 6 : skb->len);
164 if (init_wds) { 164 if (init_wds) {
165 memcpy(newskb->data + 6, skb->data, skb->len); 165 skb_copy_from_linear_data(skb,
166 memcpy(newskb->data, wds_mac, 6); 166 newskb->data + 6,
167 skb->len);
168 skb_copy_to_linear_data(newskb, wds_mac, 6);
167#ifdef ISLPCI_ETH_DEBUG 169#ifdef ISLPCI_ETH_DEBUG
168 printk("islpci_eth_transmit:wds_mac\n"); 170 printk("islpci_eth_transmit:wds_mac\n");
169#endif 171#endif
170 } else 172 } else
171 memcpy(newskb->data, skb->data, skb->len); 173 skb_copy_from_linear_data(skb, newskb->data,
174 skb->len);
172 175
173#if VERBOSE > SHOW_ERROR_MESSAGES 176#if VERBOSE > SHOW_ERROR_MESSAGES
174 DEBUG(SHOW_TRACING, "memcpy %p %p %i wds %i\n", 177 DEBUG(SHOW_TRACING, "memcpy %p %p %i wds %i\n",
@@ -303,7 +306,7 @@ islpci_monitor_rx(islpci_private *priv, struct sk_buff **skb)
303 skb_pull(*skb, sizeof (struct rfmon_header)); 306 skb_pull(*skb, sizeof (struct rfmon_header));
304 307
305 (*skb)->protocol = htons(ETH_P_802_2); 308 (*skb)->protocol = htons(ETH_P_802_2);
306 (*skb)->mac.raw = (*skb)->data; 309 skb_reset_mac_header(*skb);
307 (*skb)->pkt_type = PACKET_OTHERHOST; 310 (*skb)->pkt_type = PACKET_OTHERHOST;
308 311
309 return 0; 312 return 0;
@@ -374,10 +377,6 @@ islpci_eth_receive(islpci_private *priv)
374 DEBUG(SHOW_BUFFER_CONTENTS, "\nrx %p ", skb->data); 377 DEBUG(SHOW_BUFFER_CONTENTS, "\nrx %p ", skb->data);
375 display_buffer((char *) skb->data, skb->len); 378 display_buffer((char *) skb->data, skb->len);
376#endif 379#endif
377
378 /* do some additional sk_buff and network layer parameters */
379 skb->dev = ndev;
380
381 /* take care of monitor mode and spy monitoring. */ 380 /* take care of monitor mode and spy monitoring. */
382 if (unlikely(priv->iw_mode == IW_MODE_MONITOR)) 381 if (unlikely(priv->iw_mode == IW_MODE_MONITOR))
383 discard = islpci_monitor_rx(priv, &skb); 382 discard = islpci_monitor_rx(priv, &skb);
@@ -398,8 +397,10 @@ islpci_eth_receive(islpci_private *priv)
398 /* Update spy records */ 397 /* Update spy records */
399 wireless_spy_update(ndev, annex->addr2, &wstats); 398 wireless_spy_update(ndev, annex->addr2, &wstats);
400 399
401 memcpy(skb->data + sizeof (struct rfmon_header), 400 skb_copy_from_linear_data(skb,
402 skb->data, 2 * ETH_ALEN); 401 (skb->data +
402 sizeof(struct rfmon_header)),
403 2 * ETH_ALEN);
403 skb_pull(skb, sizeof (struct rfmon_header)); 404 skb_pull(skb, sizeof (struct rfmon_header));
404 } 405 }
405 skb->protocol = eth_type_trans(skb, ndev); 406 skb->protocol = eth_type_trans(skb, ndev);