aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/message/fusion/mptlan.c
diff options
context:
space:
mode:
authorDavid Woodhouse <dwmw2@infradead.org>2007-04-27 14:16:19 -0400
committerDavid Woodhouse <dwmw2@infradead.org>2007-04-27 14:16:19 -0400
commitd1da4e50e5d09f02c340927a4fcb7f54202fa033 (patch)
tree7f98317bdd45dbdb7644e9179891c5af6a3a8ef1 /drivers/message/fusion/mptlan.c
parent78ab67da1002d954ea4c3e2b441e2483c41f94e8 (diff)
parenta205752d1ad2d37d6597aaae5a56fc396a770868 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Conflicts: drivers/mtd/Kconfig Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Diffstat (limited to 'drivers/message/fusion/mptlan.c')
-rw-r--r--drivers/message/fusion/mptlan.c36
1 files changed, 19 insertions, 17 deletions
diff --git a/drivers/message/fusion/mptlan.c b/drivers/message/fusion/mptlan.c
index b691292ff599..7dd34bd28efc 100644
--- a/drivers/message/fusion/mptlan.c
+++ b/drivers/message/fusion/mptlan.c
@@ -714,6 +714,7 @@ mpt_lan_sdu_send (struct sk_buff *skb, struct net_device *dev)
714 LANSendRequest_t *pSendReq; 714 LANSendRequest_t *pSendReq;
715 SGETransaction32_t *pTrans; 715 SGETransaction32_t *pTrans;
716 SGESimple64_t *pSimple; 716 SGESimple64_t *pSimple;
717 const unsigned char *mac;
717 dma_addr_t dma; 718 dma_addr_t dma;
718 unsigned long flags; 719 unsigned long flags;
719 int ctx; 720 int ctx;
@@ -753,7 +754,7 @@ mpt_lan_sdu_send (struct sk_buff *skb, struct net_device *dev)
753 /* Set the mac.raw pointer, since this apparently isn't getting 754 /* Set the mac.raw pointer, since this apparently isn't getting
754 * done before we get the skb. Pull the data pointer past the mac data. 755 * done before we get the skb. Pull the data pointer past the mac data.
755 */ 756 */
756 skb->mac.raw = skb->data; 757 skb_reset_mac_header(skb);
757 skb_pull(skb, 12); 758 skb_pull(skb, 12);
758 759
759 dma = pci_map_single(mpt_dev->pcidev, skb->data, skb->len, 760 dma = pci_map_single(mpt_dev->pcidev, skb->data, skb->len,
@@ -784,6 +785,7 @@ mpt_lan_sdu_send (struct sk_buff *skb, struct net_device *dev)
784// IOC_AND_NETDEV_NAMES_s_s(dev), 785// IOC_AND_NETDEV_NAMES_s_s(dev),
785// ctx, skb, skb->data)); 786// ctx, skb, skb->data));
786 787
788 mac = skb_mac_header(skb);
787#ifdef QLOGIC_NAA_WORKAROUND 789#ifdef QLOGIC_NAA_WORKAROUND
788{ 790{
789 struct NAA_Hosed *nh; 791 struct NAA_Hosed *nh;
@@ -793,12 +795,12 @@ mpt_lan_sdu_send (struct sk_buff *skb, struct net_device *dev)
793 drops. */ 795 drops. */
794 read_lock_irq(&bad_naa_lock); 796 read_lock_irq(&bad_naa_lock);
795 for (nh = mpt_bad_naa; nh != NULL; nh=nh->next) { 797 for (nh = mpt_bad_naa; nh != NULL; nh=nh->next) {
796 if ((nh->ieee[0] == skb->mac.raw[0]) && 798 if ((nh->ieee[0] == mac[0]) &&
797 (nh->ieee[1] == skb->mac.raw[1]) && 799 (nh->ieee[1] == mac[1]) &&
798 (nh->ieee[2] == skb->mac.raw[2]) && 800 (nh->ieee[2] == mac[2]) &&
799 (nh->ieee[3] == skb->mac.raw[3]) && 801 (nh->ieee[3] == mac[3]) &&
800 (nh->ieee[4] == skb->mac.raw[4]) && 802 (nh->ieee[4] == mac[4]) &&
801 (nh->ieee[5] == skb->mac.raw[5])) { 803 (nh->ieee[5] == mac[5])) {
802 cur_naa = nh->NAA; 804 cur_naa = nh->NAA;
803 dlprintk ((KERN_INFO "mptlan/sdu_send: using NAA value " 805 dlprintk ((KERN_INFO "mptlan/sdu_send: using NAA value "
804 "= %04x.\n", cur_naa)); 806 "= %04x.\n", cur_naa));
@@ -810,12 +812,12 @@ mpt_lan_sdu_send (struct sk_buff *skb, struct net_device *dev)
810#endif 812#endif
811 813
812 pTrans->TransactionDetails[0] = cpu_to_le32((cur_naa << 16) | 814 pTrans->TransactionDetails[0] = cpu_to_le32((cur_naa << 16) |
813 (skb->mac.raw[0] << 8) | 815 (mac[0] << 8) |
814 (skb->mac.raw[1] << 0)); 816 (mac[1] << 0));
815 pTrans->TransactionDetails[1] = cpu_to_le32((skb->mac.raw[2] << 24) | 817 pTrans->TransactionDetails[1] = cpu_to_le32((mac[2] << 24) |
816 (skb->mac.raw[3] << 16) | 818 (mac[3] << 16) |
817 (skb->mac.raw[4] << 8) | 819 (mac[4] << 8) |
818 (skb->mac.raw[5] << 0)); 820 (mac[5] << 0));
819 821
820 pSimple = (SGESimple64_t *) &pTrans->TransactionDetails[2]; 822 pSimple = (SGESimple64_t *) &pTrans->TransactionDetails[2];
821 823
@@ -930,7 +932,7 @@ mpt_lan_receive_post_turbo(struct net_device *dev, u32 tmsg)
930 pci_dma_sync_single_for_cpu(mpt_dev->pcidev, priv->RcvCtl[ctx].dma, 932 pci_dma_sync_single_for_cpu(mpt_dev->pcidev, priv->RcvCtl[ctx].dma,
931 priv->RcvCtl[ctx].len, PCI_DMA_FROMDEVICE); 933 priv->RcvCtl[ctx].len, PCI_DMA_FROMDEVICE);
932 934
933 memcpy(skb_put(skb, len), old_skb->data, len); 935 skb_copy_from_linear_data(old_skb, skb_put(skb, len), len);
934 936
935 pci_dma_sync_single_for_device(mpt_dev->pcidev, priv->RcvCtl[ctx].dma, 937 pci_dma_sync_single_for_device(mpt_dev->pcidev, priv->RcvCtl[ctx].dma,
936 priv->RcvCtl[ctx].len, PCI_DMA_FROMDEVICE); 938 priv->RcvCtl[ctx].len, PCI_DMA_FROMDEVICE);
@@ -1091,7 +1093,7 @@ mpt_lan_receive_post_reply(struct net_device *dev,
1091 priv->RcvCtl[ctx].dma, 1093 priv->RcvCtl[ctx].dma,
1092 priv->RcvCtl[ctx].len, 1094 priv->RcvCtl[ctx].len,
1093 PCI_DMA_FROMDEVICE); 1095 PCI_DMA_FROMDEVICE);
1094 memcpy(skb_put(skb, l), old_skb->data, l); 1096 skb_copy_from_linear_data(old_skb, skb_put(skb, l), l);
1095 1097
1096 pci_dma_sync_single_for_device(mpt_dev->pcidev, 1098 pci_dma_sync_single_for_device(mpt_dev->pcidev,
1097 priv->RcvCtl[ctx].dma, 1099 priv->RcvCtl[ctx].dma,
@@ -1120,7 +1122,7 @@ mpt_lan_receive_post_reply(struct net_device *dev,
1120 priv->RcvCtl[ctx].len, 1122 priv->RcvCtl[ctx].len,
1121 PCI_DMA_FROMDEVICE); 1123 PCI_DMA_FROMDEVICE);
1122 1124
1123 memcpy(skb_put(skb, len), old_skb->data, len); 1125 skb_copy_from_linear_data(old_skb, skb_put(skb, len), len);
1124 1126
1125 pci_dma_sync_single_for_device(mpt_dev->pcidev, 1127 pci_dma_sync_single_for_device(mpt_dev->pcidev,
1126 priv->RcvCtl[ctx].dma, 1128 priv->RcvCtl[ctx].dma,
@@ -1549,7 +1551,7 @@ mpt_lan_type_trans(struct sk_buff *skb, struct net_device *dev)
1549 struct mpt_lan_ohdr *fch = (struct mpt_lan_ohdr *)skb->data; 1551 struct mpt_lan_ohdr *fch = (struct mpt_lan_ohdr *)skb->data;
1550 struct fcllc *fcllc; 1552 struct fcllc *fcllc;
1551 1553
1552 skb->mac.raw = skb->data; 1554 skb_reset_mac_header(skb);
1553 skb_pull(skb, sizeof(struct mpt_lan_ohdr)); 1555 skb_pull(skb, sizeof(struct mpt_lan_ohdr));
1554 1556
1555 if (fch->dtype == htons(0xffff)) { 1557 if (fch->dtype == htons(0xffff)) {