Merge branch 'e1000-fixes' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik...
[pandora-kernel.git] / drivers / message / fusion / mptlan.c
index 2936204..7dd34bd 100644 (file)
@@ -5,6 +5,7 @@
  *      running LSI Logic Fusion MPT (Message Passing Technology) firmware.
  *
  *  Copyright (c) 2000-2007 LSI Logic Corporation
+ *  (mailto:mpt_linux_developer@lsi.com)
  *
  */
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
@@ -713,6 +714,7 @@ mpt_lan_sdu_send (struct sk_buff *skb, struct net_device *dev)
        LANSendRequest_t *pSendReq;
        SGETransaction32_t *pTrans;
        SGESimple64_t *pSimple;
+       const unsigned char *mac;
        dma_addr_t dma;
        unsigned long flags;
        int ctx;
@@ -752,7 +754,7 @@ mpt_lan_sdu_send (struct sk_buff *skb, struct net_device *dev)
        /* Set the mac.raw pointer, since this apparently isn't getting
         * done before we get the skb. Pull the data pointer past the mac data.
         */
-       skb->mac.raw = skb->data;
+       skb_reset_mac_header(skb);
        skb_pull(skb, 12);
 
         dma = pci_map_single(mpt_dev->pcidev, skb->data, skb->len,
@@ -783,6 +785,7 @@ mpt_lan_sdu_send (struct sk_buff *skb, struct net_device *dev)
 //                     IOC_AND_NETDEV_NAMES_s_s(dev),
 //                     ctx, skb, skb->data));
 
+       mac = skb_mac_header(skb);
 #ifdef QLOGIC_NAA_WORKAROUND
 {
        struct NAA_Hosed *nh;
@@ -792,12 +795,12 @@ mpt_lan_sdu_send (struct sk_buff *skb, struct net_device *dev)
           drops. */
        read_lock_irq(&bad_naa_lock);
        for (nh = mpt_bad_naa; nh != NULL; nh=nh->next) {
-               if ((nh->ieee[0] == skb->mac.raw[0]) &&
-                   (nh->ieee[1] == skb->mac.raw[1]) &&
-                   (nh->ieee[2] == skb->mac.raw[2]) &&
-                   (nh->ieee[3] == skb->mac.raw[3]) &&
-                   (nh->ieee[4] == skb->mac.raw[4]) &&
-                   (nh->ieee[5] == skb->mac.raw[5])) {
+               if ((nh->ieee[0] == mac[0]) &&
+                   (nh->ieee[1] == mac[1]) &&
+                   (nh->ieee[2] == mac[2]) &&
+                   (nh->ieee[3] == mac[3]) &&
+                   (nh->ieee[4] == mac[4]) &&
+                   (nh->ieee[5] == mac[5])) {
                        cur_naa = nh->NAA;
                        dlprintk ((KERN_INFO "mptlan/sdu_send: using NAA value "
                                  "= %04x.\n", cur_naa));
@@ -809,12 +812,12 @@ mpt_lan_sdu_send (struct sk_buff *skb, struct net_device *dev)
 #endif
 
        pTrans->TransactionDetails[0] = cpu_to_le32((cur_naa         << 16) |
-                                                   (skb->mac.raw[0] <<  8) |
-                                                   (skb->mac.raw[1] <<  0));
-       pTrans->TransactionDetails[1] = cpu_to_le32((skb->mac.raw[2] << 24) |
-                                                   (skb->mac.raw[3] << 16) |
-                                                   (skb->mac.raw[4] <<  8) |
-                                                   (skb->mac.raw[5] <<  0));
+                                                   (mac[0] <<  8) |
+                                                   (mac[1] <<  0));
+       pTrans->TransactionDetails[1] = cpu_to_le32((mac[2] << 24) |
+                                                   (mac[3] << 16) |
+                                                   (mac[4] <<  8) |
+                                                   (mac[5] <<  0));
 
        pSimple = (SGESimple64_t *) &pTrans->TransactionDetails[2];
 
@@ -929,7 +932,7 @@ mpt_lan_receive_post_turbo(struct net_device *dev, u32 tmsg)
                pci_dma_sync_single_for_cpu(mpt_dev->pcidev, priv->RcvCtl[ctx].dma,
                                            priv->RcvCtl[ctx].len, PCI_DMA_FROMDEVICE);
 
-               memcpy(skb_put(skb, len), old_skb->data, len);
+               skb_copy_from_linear_data(old_skb, skb_put(skb, len), len);
 
                pci_dma_sync_single_for_device(mpt_dev->pcidev, priv->RcvCtl[ctx].dma,
                                               priv->RcvCtl[ctx].len, PCI_DMA_FROMDEVICE);
@@ -1090,7 +1093,7 @@ mpt_lan_receive_post_reply(struct net_device *dev,
                                                    priv->RcvCtl[ctx].dma,
                                                    priv->RcvCtl[ctx].len,
                                                    PCI_DMA_FROMDEVICE);
-                       memcpy(skb_put(skb, l), old_skb->data, l);
+                       skb_copy_from_linear_data(old_skb, skb_put(skb, l), l);
 
                        pci_dma_sync_single_for_device(mpt_dev->pcidev,
                                                       priv->RcvCtl[ctx].dma,
@@ -1119,7 +1122,7 @@ mpt_lan_receive_post_reply(struct net_device *dev,
                                            priv->RcvCtl[ctx].len,
                                            PCI_DMA_FROMDEVICE);
 
-               memcpy(skb_put(skb, len), old_skb->data, len);
+               skb_copy_from_linear_data(old_skb, skb_put(skb, len), len);
 
                pci_dma_sync_single_for_device(mpt_dev->pcidev,
                                               priv->RcvCtl[ctx].dma,
@@ -1548,7 +1551,7 @@ mpt_lan_type_trans(struct sk_buff *skb, struct net_device *dev)
        struct mpt_lan_ohdr *fch = (struct mpt_lan_ohdr *)skb->data;
        struct fcllc *fcllc;
 
-       skb->mac.raw = skb->data;
+       skb_reset_mac_header(skb);
        skb_pull(skb, sizeof(struct mpt_lan_ohdr));
 
        if (fch->dtype == htons(0xffff)) {