[SK_BUFF]: Introduce ip_hdr(), remove skb->nh.iph
[deliverable/linux.git] / drivers / net / via-velocity.c
index 4587f23f4e4b4aa95ba7e2c9e019ae8c9066161b..422eaf8ea12d80851200425f8c2bdcb626657d56 100644 (file)
@@ -265,15 +265,19 @@ static int velocity_set_media_mode(struct velocity_info *vptr, u32 mii_status);
 static int velocity_suspend(struct pci_dev *pdev, pm_message_t state);
 static int velocity_resume(struct pci_dev *pdev);
 
+static DEFINE_SPINLOCK(velocity_dev_list_lock);
+static LIST_HEAD(velocity_dev_list);
+
+#endif
+
+#if defined(CONFIG_PM) && defined(CONFIG_INET)
+
 static int velocity_netdev_event(struct notifier_block *nb, unsigned long notification, void *ptr);
 
 static struct notifier_block velocity_inetaddr_notifier = {
       .notifier_call   = velocity_netdev_event,
 };
 
-static DEFINE_SPINLOCK(velocity_dev_list_lock);
-static LIST_HEAD(velocity_dev_list);
-
 static void velocity_register_notifier(void)
 {
        register_inetaddr_notifier(&velocity_inetaddr_notifier);
@@ -284,12 +288,12 @@ static void velocity_unregister_notifier(void)
        unregister_inetaddr_notifier(&velocity_inetaddr_notifier);
 }
 
-#else                          /* CONFIG_PM */
+#else
 
 #define velocity_register_notifier()   do {} while (0)
 #define velocity_unregister_notifier() do {} while (0)
 
-#endif                         /* !CONFIG_PM */
+#endif
 
 /*
  *     Internal board variants. At the moment we have only one
@@ -1394,7 +1398,6 @@ static int velocity_receive_frame(struct velocity_info *vptr, int idx)
                vptr->stats.multicast++;
 
        skb = rd_info->skb;
-       skb->dev = vptr->dev;
 
        pci_dma_sync_single_for_cpu(vptr->pdev, rd_info->skb_dma,
                                    vptr->rx_buf_sz, PCI_DMA_FROMDEVICE);
@@ -1424,7 +1427,7 @@ static int velocity_receive_frame(struct velocity_info *vptr, int idx)
                   PCI_DMA_FROMDEVICE);
 
        skb_put(skb, pkt_len - 4);
-       skb->protocol = eth_type_trans(skb, skb->dev);
+       skb->protocol = eth_type_trans(skb, vptr->dev);
 
        stats->rx_bytes += pkt_len;
        netif_rx(skb);
@@ -2003,7 +2006,7 @@ static int velocity_xmit(struct sk_buff *skb, struct net_device *dev)
         */
        if ((vptr->flags & VELOCITY_FLAGS_TX_CSUM)
                                 && (skb->ip_summed == CHECKSUM_PARTIAL)) {
-               struct iphdr *ip = skb->nh.iph;
+               const struct iphdr *ip = ip_hdr(skb);
                if (ip->protocol == IPPROTO_TCP)
                        td_ptr->tdesc1.TCR |= TCR0_TCPCK;
                else if (ip->protocol == IPPROTO_UDP)
@@ -3292,6 +3295,8 @@ static int velocity_resume(struct pci_dev *pdev)
        return 0;
 }
 
+#ifdef CONFIG_INET
+
 static int velocity_netdev_event(struct notifier_block *nb, unsigned long notification, void *ptr)
 {
        struct in_ifaddr *ifa = (struct in_ifaddr *) ptr;
@@ -3312,4 +3317,6 @@ static int velocity_netdev_event(struct notifier_block *nb, unsigned long notifi
        }
        return NOTIFY_DONE;
 }
+
+#endif
 #endif
This page took 0.025287 seconds and 5 git commands to generate.