Merge branch 'for-linus' of master.kernel.org:/pub/scm/linux/kernel/git/roland/infiniband
[pandora-kernel.git] / drivers / net / wireless / prism54 / islpci_eth.c
index bfbafe9..dd070cc 100644 (file)
@@ -1,5 +1,4 @@
 /*
- *  
  *  Copyright (C) 2002 Intersil Americas Inc.
  *  Copyright (C) 2004 Aurelien Alleaume <slts@free.fr>
  *  This program is free software; you can redistribute it and/or modify
@@ -48,7 +47,7 @@ islpci_eth_cleanup_transmit(islpci_private *priv,
                /* read the index of the first fragment to be freed */
                index = priv->free_data_tx % ISL38XX_CB_TX_QSIZE;
 
-               /* check for holes in the arrays caused by multi fragment frames 
+               /* check for holes in the arrays caused by multi fragment frames
                 * searching for the last fragment of a frame */
                if (priv->pci_map_tx_address[index] != (dma_addr_t) NULL) {
                        /* entry is the last fragment of a frame
@@ -137,7 +136,7 @@ islpci_eth_transmit(struct sk_buff *skb, struct net_device *ndev)
                                printk("islpci_eth_transmit:wds_mac\n");
 #endif
                                memmove(skb->data + 6, src, skb->len);
-                               memcpy(skb->data, wds_mac, 6);
+                               skb_copy_to_linear_data(skb, wds_mac, 6);
                        } else {
                                memmove(skb->data, src, skb->len);
                        }
@@ -163,13 +162,16 @@ islpci_eth_transmit(struct sk_buff *skb, struct net_device *ndev)
 
                        skb_put(newskb, init_wds ? skb->len + 6 : skb->len);
                        if (init_wds) {
-                               memcpy(newskb->data + 6, skb->data, skb->len);
-                               memcpy(newskb->data, wds_mac, 6);
+                               skb_copy_from_linear_data(skb,
+                                                         newskb->data + 6,
+                                                         skb->len);
+                               skb_copy_to_linear_data(newskb, wds_mac, 6);
 #ifdef ISLPCI_ETH_DEBUG
                                printk("islpci_eth_transmit:wds_mac\n");
 #endif
                        } else
-                               memcpy(newskb->data, skb->data, skb->len);
+                               skb_copy_from_linear_data(skb, newskb->data,
+                                                         skb->len);
 
 #if VERBOSE > SHOW_ERROR_MESSAGES
                        DEBUG(SHOW_TRACING, "memcpy %p %p %i wds %i\n",
@@ -285,7 +287,7 @@ islpci_monitor_rx(islpci_private *priv, struct sk_buff **skb)
                    (struct avs_80211_1_header *) skb_push(*skb,
                                                           sizeof (struct
                                                                   avs_80211_1_header));
-               
+
                avs->version = cpu_to_be32(P80211CAPTURE_VERSION);
                avs->length = cpu_to_be32(sizeof (struct avs_80211_1_header));
                avs->mactime = cpu_to_be64(le64_to_cpu(clock));
@@ -304,7 +306,7 @@ islpci_monitor_rx(islpci_private *priv, struct sk_buff **skb)
                skb_pull(*skb, sizeof (struct rfmon_header));
 
        (*skb)->protocol = htons(ETH_P_802_2);
-       (*skb)->mac.raw = (*skb)->data;
+       skb_reset_mac_header(*skb);
        (*skb)->pkt_type = PACKET_OTHERHOST;
 
        return 0;
@@ -375,10 +377,6 @@ islpci_eth_receive(islpci_private *priv)
        DEBUG(SHOW_BUFFER_CONTENTS, "\nrx %p ", skb->data);
        display_buffer((char *) skb->data, skb->len);
 #endif
-
-       /* do some additional sk_buff and network layer parameters */
-       skb->dev = ndev;
-
        /* take care of monitor mode and spy monitoring. */
        if (unlikely(priv->iw_mode == IW_MODE_MONITOR))
                discard = islpci_monitor_rx(priv, &skb);
@@ -391,7 +389,7 @@ islpci_eth_receive(islpci_private *priv)
                        struct rx_annex_header *annex =
                            (struct rx_annex_header *) skb->data;
                        wstats.level = annex->rfmon.rssi;
-                       /* The noise value can be a bit outdated if nobody's 
+                       /* The noise value can be a bit outdated if nobody's
                         * reading wireless stats... */
                        wstats.noise = priv->local_iwstatistics.qual.noise;
                        wstats.qual = wstats.level - wstats.noise;
@@ -399,8 +397,10 @@ islpci_eth_receive(islpci_private *priv)
                        /* Update spy records */
                        wireless_spy_update(ndev, annex->addr2, &wstats);
 
-                       memcpy(skb->data + sizeof (struct rfmon_header),
-                              skb->data, 2 * ETH_ALEN);
+                       skb_copy_from_linear_data(skb,
+                                                 (skb->data +
+                                                  sizeof(struct rfmon_header)),
+                                                 2 * ETH_ALEN);
                        skb_pull(skb, sizeof (struct rfmon_header));
                }
                skb->protocol = eth_type_trans(skb, ndev);
@@ -481,9 +481,9 @@ islpci_eth_receive(islpci_private *priv)
 }
 
 void
-islpci_do_reset_and_wake(void *data)
+islpci_do_reset_and_wake(struct work_struct *work)
 {
-       islpci_private *priv = data;
+       islpci_private *priv = container_of(work, islpci_private, reset_task);
 
        islpci_reset(priv, 1);
        priv->reset_task_pending = 0;