]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/net/tulip/xircom_cb.c
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6
[linux-2.6-omap-h63xx.git] / drivers / net / tulip / xircom_cb.c
index cf43390d2c80d44943cc056eb373977874dab50d..16a54e6b8d4f002b31e1a2e967785a1fac538e91 100644 (file)
@@ -114,7 +114,7 @@ struct xircom_private {
 /* Function prototypes */
 static int xircom_probe(struct pci_dev *pdev, const struct pci_device_id *id);
 static void xircom_remove(struct pci_dev *pdev);
-static irqreturn_t xircom_interrupt(int irq, void *dev_instance, struct pt_regs *regs);
+static irqreturn_t xircom_interrupt(int irq, void *dev_instance);
 static int xircom_start_xmit(struct sk_buff *skb, struct net_device *dev);
 static int xircom_open(struct net_device *dev);
 static int xircom_close(struct net_device *dev);
@@ -190,7 +190,7 @@ static void netdev_get_drvinfo(struct net_device *dev,
        strcpy(info->bus_info, pci_name(private->pdev));
 }
 
-static struct ethtool_ops netdev_ethtool_ops = {
+static const struct ethtool_ops netdev_ethtool_ops = {
        .get_drvinfo            = netdev_get_drvinfo,
 };
 
@@ -205,7 +205,6 @@ static int __devinit xircom_probe(struct pci_dev *pdev, const struct pci_device_
 {
        struct net_device *dev = NULL;
        struct xircom_private *private;
-       unsigned char chip_rev;
        unsigned long flags;
        unsigned short tmp16;
        enter("xircom_probe");
@@ -224,8 +223,6 @@ static int __devinit xircom_probe(struct pci_dev *pdev, const struct pci_device_
        pci_read_config_word (pdev,PCI_STATUS, &tmp16);
        pci_write_config_word (pdev, PCI_STATUS,tmp16);
 
-       pci_read_config_byte(pdev, PCI_REVISION_ID, &chip_rev);
-
        if (!request_region(pci_resource_start(pdev, 0), 128, "xircom_cb")) {
                printk(KERN_ERR "xircom_probe: failed to allocate io-region\n");
                return -ENODEV;
@@ -286,7 +283,7 @@ static int __devinit xircom_probe(struct pci_dev *pdev, const struct pci_device_
                goto reg_fail;
        }
 
-       printk(KERN_INFO "%s: Xircom cardbus revision %i at irq %i \n", dev->name, chip_rev, pdev->irq);
+       printk(KERN_INFO "%s: Xircom cardbus revision %i at irq %i \n", dev->name, pdev->revision, pdev->irq);
        /* start the transmitter to get a heartbeat */
        /* TODO: send 2 dummy packets here */
        transceiver_voodoo(private);
@@ -334,7 +331,7 @@ static void __devexit xircom_remove(struct pci_dev *pdev)
        leave("xircom_remove");
 }
 
-static irqreturn_t xircom_interrupt(int irq, void *dev_instance, struct pt_regs *regs)
+static irqreturn_t xircom_interrupt(int irq, void *dev_instance)
 {
        struct net_device *dev = (struct net_device *) dev_instance;
        struct xircom_private *card = netdev_priv(dev);
@@ -411,9 +408,9 @@ static int xircom_start_xmit(struct sk_buff *skb, struct net_device *dev)
                           sometimes sends more than you ask it to. */
 
                        memset(&card->tx_buffer[bufferoffsets[desc]/4],0,1536);
-                       memcpy(&(card->tx_buffer[bufferoffsets[desc]/4]),skb->data,skb->len);
-
-
+                       skb_copy_from_linear_data(skb,
+                                 &(card->tx_buffer[bufferoffsets[desc] / 4]),
+                                                 skb->len);
                        /* FIXME: The specification tells us that the length we send HAS to be a multiple of
                           4 bytes. */
 
@@ -513,7 +510,7 @@ static struct net_device_stats *xircom_get_stats(struct net_device *dev)
 static void xircom_poll_controller(struct net_device *dev)
 {
        disable_irq(dev->irq);
-       xircom_interrupt(dev->irq, dev, NULL);
+       xircom_interrupt(dev->irq, dev);
        enable_irq(dev->irq);
 }
 #endif
@@ -1043,7 +1040,7 @@ static int enable_promisc(struct xircom_private *card)
 
 
 /*
-link_status() checks the the links status and will return 0 for no link, 10 for 10mbit link and 100 for.. guess what.
+link_status() checks the links status and will return 0 for no link, 10 for 10mbit link and 100 for.. guess what.
 
 Must be called in locked state with interrupts disabled
 */
@@ -1207,9 +1204,8 @@ static void investigate_read_descriptor(struct net_device *dev,struct xircom_pri
                                card->stats.rx_dropped++;
                                goto out;
                        }
-                       skb->dev = dev;
                        skb_reserve(skb, 2);
-                       eth_copy_and_sum(skb, (unsigned char*)&card->rx_buffer[bufferoffset / 4], pkt_len, 0);
+                       skb_copy_to_linear_data(skb, (unsigned char*)&card->rx_buffer[bufferoffset / 4], pkt_len);
                        skb_put(skb, pkt_len);
                        skb->protocol = eth_type_trans(skb, dev);
                        netif_rx(skb);