[PATCH] libertas: remove incorrect vi modelines
[safe/jmp/linux-2.6] / drivers / net / 8139cp.c
index 488241c..e8c9f27 100644 (file)
@@ -448,8 +448,7 @@ static void cp_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid)
        spin_lock_irqsave(&cp->lock, flags);
        cp->cpcmd &= ~RxVlanOn;
        cpw16(CpCmd, cp->cpcmd);
-       if (cp->vlgrp)
-               cp->vlgrp->vlan_devices[vid] = NULL;
+       vlan_group_set_device(cp->vlgrp, vid, NULL);
        spin_unlock_irqrestore(&cp->lock, flags);
 }
 #endif /* CP_VLAN_TAG_USED */
@@ -574,7 +573,6 @@ rx_status_loop:
                }
 
                skb_reserve(new_skb, RX_OFFSET);
-               new_skb->dev = dev;
 
                pci_unmap_single(cp->pdev, mapping,
                                 buflen, PCI_DMA_FROMDEVICE);
@@ -617,13 +615,15 @@ rx_next:
         * this round of polling
         */
        if (rx_work) {
+               unsigned long flags;
+
                if (cpr16(IntrStatus) & cp_rx_intr_mask)
                        goto rx_status_loop;
 
-               local_irq_disable();
+               local_irq_save(flags);
                cpw16_f(IntrMask, cp_intr_mask);
                __netif_rx_complete(dev);
-               local_irq_enable();
+               local_irq_restore(flags);
 
                return 0;       /* done */
        }
@@ -631,8 +631,7 @@ rx_next:
        return 1;               /* not done */
 }
 
-static irqreturn_t
-cp_interrupt (int irq, void *dev_instance, struct pt_regs *regs)
+static irqreturn_t cp_interrupt (int irq, void *dev_instance)
 {
        struct net_device *dev = dev_instance;
        struct cp_private *cp;
@@ -696,7 +695,7 @@ cp_interrupt (int irq, void *dev_instance, struct pt_regs *regs)
 static void cp_poll_controller(struct net_device *dev)
 {
        disable_irq(dev->irq);
-       cp_interrupt(dev->irq, dev, NULL);
+       cp_interrupt(dev->irq, dev);
        enable_irq(dev->irq);
 }
 #endif
@@ -764,17 +763,18 @@ static int cp_start_xmit (struct sk_buff *skb, struct net_device *dev)
        struct cp_private *cp = netdev_priv(dev);
        unsigned entry;
        u32 eor, flags;
+       unsigned long intr_flags;
 #if CP_VLAN_TAG_USED
        u32 vlan_tag = 0;
 #endif
        int mss = 0;
 
-       spin_lock_irq(&cp->lock);
+       spin_lock_irqsave(&cp->lock, intr_flags);
 
        /* This is a hard error, log it. */
        if (TX_BUFFS_AVAIL(cp) <= (skb_shinfo(skb)->nr_frags + 1)) {
                netif_stop_queue(dev);
-               spin_unlock_irq(&cp->lock);
+               spin_unlock_irqrestore(&cp->lock, intr_flags);
                printk(KERN_ERR PFX "%s: BUG! Tx Ring full when queue awake!\n",
                       dev->name);
                return 1;
@@ -805,8 +805,8 @@ static int cp_start_xmit (struct sk_buff *skb, struct net_device *dev)
 
                if (mss)
                        flags |= LargeSend | ((mss & MSSMask) << MSSShift);
-               else if (skb->ip_summed == CHECKSUM_HW) {
-                       const struct iphdr *ip = skb->nh.iph;
+               else if (skb->ip_summed == CHECKSUM_PARTIAL) {
+                       const struct iphdr *ip = ip_hdr(skb);
                        if (ip->protocol == IPPROTO_TCP)
                                flags |= IPCS | TCPCS;
                        else if (ip->protocol == IPPROTO_UDP)
@@ -825,7 +825,7 @@ static int cp_start_xmit (struct sk_buff *skb, struct net_device *dev)
                u32 first_len, first_eor;
                dma_addr_t first_mapping;
                int frag, first_entry = entry;
-               const struct iphdr *ip = skb->nh.iph;
+               const struct iphdr *ip = ip_hdr(skb);
 
                /* We must give this initial chunk to the device last.
                 * Otherwise we could race with the device.
@@ -855,7 +855,7 @@ static int cp_start_xmit (struct sk_buff *skb, struct net_device *dev)
                        if (mss)
                                ctrl |= LargeSend |
                                        ((mss & MSSMask) << MSSShift);
-                       else if (skb->ip_summed == CHECKSUM_HW) {
+                       else if (skb->ip_summed == CHECKSUM_PARTIAL) {
                                if (ip->protocol == IPPROTO_TCP)
                                        ctrl |= IPCS | TCPCS;
                                else if (ip->protocol == IPPROTO_UDP)
@@ -884,7 +884,7 @@ static int cp_start_xmit (struct sk_buff *skb, struct net_device *dev)
                txd->addr = cpu_to_le64(first_mapping);
                wmb();
 
-               if (skb->ip_summed == CHECKSUM_HW) {
+               if (skb->ip_summed == CHECKSUM_PARTIAL) {
                        if (ip->protocol == IPPROTO_TCP)
                                txd->opts1 = cpu_to_le32(first_eor | first_len |
                                                         FirstFrag | DescOwn |
@@ -907,7 +907,7 @@ static int cp_start_xmit (struct sk_buff *skb, struct net_device *dev)
        if (TX_BUFFS_AVAIL(cp) <= (MAX_SKB_FRAGS + 1))
                netif_stop_queue(dev);
 
-       spin_unlock_irq(&cp->lock);
+       spin_unlock_irqrestore(&cp->lock, intr_flags);
 
        cpw8(TxPoll, NormalTxPoll);
        dev->trans_start = jiffies;
@@ -1081,7 +1081,6 @@ static int cp_refill_rx (struct cp_private *cp)
                if (!skb)
                        goto err_out;
 
-               skb->dev = cp->dev;
                skb_reserve(skb, RX_OFFSET);
 
                mapping = pci_map_single(cp->pdev, skb->data, cp->rx_buf_sz,
@@ -1546,7 +1545,7 @@ static void cp_get_ethtool_stats (struct net_device *dev,
        pci_free_consistent(cp->pdev, sizeof(*nic_stats), nic_stats, dma);
 }
 
-static struct ethtool_ops cp_ethtool_ops = {
+static const struct ethtool_ops cp_ethtool_ops = {
        .get_drvinfo            = cp_get_drvinfo,
        .get_regs_len           = cp_get_regs_len,
        .get_stats_count        = cp_get_stats_count,