]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/net/8139cp.c
r8169: use netdev_alloc_skb
[linux-2.6-omap-h63xx.git] / drivers / net / 8139cp.c
index 12c8453f44bce3e337dc3a3f8d440153ee02061c..58bbc3e6d0de1af6960bd727adfaed7b713b2edc 100644 (file)
@@ -107,11 +107,6 @@ MODULE_PARM_DESC (multicast_filter_limit, "8139cp: maximum number of filtered mu
 
 #define PFX                    DRV_NAME ": "
 
-#ifndef TRUE
-#define FALSE 0
-#define TRUE (!FALSE)
-#endif
-
 #define CP_DEF_MSG_ENABLE      (NETIF_MSG_DRV          | \
                                 NETIF_MSG_PROBE        | \
                                 NETIF_MSG_LINK)
@@ -435,20 +430,12 @@ static void cp_vlan_rx_register(struct net_device *dev, struct vlan_group *grp)
 
        spin_lock_irqsave(&cp->lock, flags);
        cp->vlgrp = grp;
-       cp->cpcmd |= RxVlanOn;
-       cpw16(CpCmd, cp->cpcmd);
-       spin_unlock_irqrestore(&cp->lock, flags);
-}
-
-static void cp_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid)
-{
-       struct cp_private *cp = netdev_priv(dev);
-       unsigned long flags;
+       if (grp)
+               cp->cpcmd |= RxVlanOn;
+       else
+               cp->cpcmd &= ~RxVlanOn;
 
-       spin_lock_irqsave(&cp->lock, flags);
-       cp->cpcmd &= ~RxVlanOn;
        cpw16(CpCmd, cp->cpcmd);
-       vlan_group_set_device(cp->vlgrp, vid, NULL);
        spin_unlock_irqrestore(&cp->lock, flags);
 }
 #endif /* CP_VLAN_TAG_USED */
@@ -573,7 +560,6 @@ rx_status_loop:
                }
 
                skb_reserve(new_skb, RX_OFFSET);
-               new_skb->dev = dev;
 
                pci_unmap_single(cp->pdev, mapping,
                                 buflen, PCI_DMA_FROMDEVICE);
@@ -670,7 +656,7 @@ static irqreturn_t cp_interrupt (int irq, void *dev_instance)
        if (status & (TxOK | TxErr | TxEmpty | SWInt))
                cp_tx(cp);
        if (status & LinkChg)
-               mii_check_media(&cp->mii_if, netif_msg_link(cp), FALSE);
+               mii_check_media(&cp->mii_if, netif_msg_link(cp), false);
 
        spin_unlock(&cp->lock);
 
@@ -807,7 +793,7 @@ 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_PARTIAL) {
-                       const struct iphdr *ip = skb->nh.iph;
+                       const struct iphdr *ip = ip_hdr(skb);
                        if (ip->protocol == IPPROTO_TCP)
                                flags |= IPCS | TCPCS;
                        else if (ip->protocol == IPPROTO_UDP)
@@ -826,7 +812,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.
@@ -1082,7 +1068,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,
@@ -1198,7 +1183,7 @@ static int cp_open (struct net_device *dev)
                goto err_out_hw;
 
        netif_carrier_off(dev);
-       mii_check_media(&cp->mii_if, netif_msg_link(cp), TRUE);
+       mii_check_media(&cp->mii_if, netif_msg_link(cp), true);
        netif_start_queue(dev);
 
        return 0;
@@ -1946,7 +1931,6 @@ static int cp_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
 #if CP_VLAN_TAG_USED
        dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX;
        dev->vlan_rx_register = cp_vlan_rx_register;
-       dev->vlan_rx_kill_vid = cp_vlan_rx_kill_vid;
 #endif
 
        if (pci_using_dac)
@@ -2061,7 +2045,7 @@ static int cp_resume (struct pci_dev *pdev)
 
        spin_lock_irqsave (&cp->lock, flags);
 
-       mii_check_media(&cp->mii_if, netif_msg_link(cp), FALSE);
+       mii_check_media(&cp->mii_if, netif_msg_link(cp), false);
 
        spin_unlock_irqrestore (&cp->lock, flags);