X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fnet%2F3c59x.c;h=80bdcf8462343434fae03cb3091dade3646854ee;hb=97bf2856c6014879bd04983a3e9dfcdac1e7fe85;hp=80e8ca013e448a96e54af66220810e80b3c794fb;hpb=16c70f8c1b54b61c3b951b6fb220df250fe09b32;p=linux-2.6.git diff --git a/drivers/net/3c59x.c b/drivers/net/3c59x.c index 80e8ca013..80bdcf846 100644 --- a/drivers/net/3c59x.c +++ b/drivers/net/3c59x.c @@ -717,8 +717,8 @@ static int vortex_start_xmit(struct sk_buff *skb, struct net_device *dev); static int boomerang_start_xmit(struct sk_buff *skb, struct net_device *dev); static int vortex_rx(struct net_device *dev); static int boomerang_rx(struct net_device *dev); -static irqreturn_t vortex_interrupt(int irq, void *dev_id, struct pt_regs *regs); -static irqreturn_t boomerang_interrupt(int irq, void *dev_id, struct pt_regs *regs); +static irqreturn_t vortex_interrupt(int irq, void *dev_id); +static irqreturn_t boomerang_interrupt(int irq, void *dev_id); static int vortex_close(struct net_device *dev); static void dump_tx_ring(struct net_device *dev); static void update_stats(void __iomem *ioaddr, struct net_device *dev); @@ -729,7 +729,7 @@ static int vortex_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); #endif static void vortex_tx_timeout(struct net_device *dev); static void acpi_set_WOL(struct net_device *dev); -static struct ethtool_ops vortex_ethtool_ops; +static const struct ethtool_ops vortex_ethtool_ops; static void set_8021q_mode(struct net_device *dev, int enable); /* This driver uses 'options' to pass the media type, full-duplex flag, etc. */ @@ -794,9 +794,9 @@ static void poll_vortex(struct net_device *dev) unsigned long flags; local_save_flags(flags); local_irq_disable(); - (vp->full_bus_master_rx ? boomerang_interrupt:vortex_interrupt)(dev->irq,dev,NULL); + (vp->full_bus_master_rx ? boomerang_interrupt:vortex_interrupt)(dev->irq,dev); local_irq_restore(flags); -} +} #endif #ifdef CONFIG_PM @@ -851,6 +851,7 @@ static struct eisa_device_id vortex_eisa_ids[] = { { "TCM5970", CH_3C597 }, { "" } }; +MODULE_DEVICE_TABLE(eisa, vortex_eisa_ids); static int vortex_eisa_probe(struct device *device); static int vortex_eisa_remove(struct device *device); @@ -904,7 +905,7 @@ static int vortex_eisa_remove(struct device *device) vp = netdev_priv(dev); ioaddr = vp->ioaddr; - + unregister_netdev(dev); iowrite16(TotalReset|0x14, ioaddr + EL3_CMD); release_region(dev->base_addr, VORTEX_TOTAL_SIZE); @@ -935,7 +936,7 @@ static int __init vortex_eisa_init(void) eisa_found = 1; } #endif - + /* Special code to work-around the Compaq PCI BIOS32 problem. */ if (compaq_ioaddr) { vortex_probe1(NULL, ioport_map(compaq_ioaddr, VORTEX_TOTAL_SIZE), @@ -953,7 +954,7 @@ static int __devinit vortex_init_one(struct pci_dev *pdev, struct vortex_chip_info *vci; void __iomem *ioaddr; - /* wake up and enable device */ + /* wake up and enable device */ rc = pci_enable_device(pdev); if (rc < 0) goto out; @@ -1089,7 +1090,7 @@ static int __devinit vortex_probe1(struct device *gendev, if (request_region(dev->base_addr, vci->io_size, print_name) != NULL) vp->must_free_region = 1; - /* enable bus-mastering if necessary */ + /* enable bus-mastering if necessary */ if (vci->flags & PCI_USES_MASTER) pci_set_master(pdev); @@ -1131,7 +1132,7 @@ static int __devinit vortex_probe1(struct device *gendev, vp->tx_ring_dma = vp->rx_ring_dma + sizeof(struct boom_rx_desc) * RX_RING_SIZE; /* if we are a PCI driver, we store info in pdev->driver_data - * instead of a module list */ + * instead of a module list */ if (pdev) pci_set_drvdata(pdev, dev); if (edev) @@ -1393,7 +1394,7 @@ static int __devinit vortex_probe1(struct device *gendev, dev->tx_timeout = vortex_tx_timeout; dev->watchdog_timeo = (watchdog * HZ) / 1000; #ifdef CONFIG_NET_POLL_CONTROLLER - dev->poll_controller = poll_vortex; + dev->poll_controller = poll_vortex; #endif if (pdev) { vp->pm_state_valid = 1; @@ -1848,9 +1849,9 @@ static void vortex_tx_timeout(struct net_device *dev) unsigned long flags; local_irq_save(flags); if (vp->full_bus_master_tx) - boomerang_interrupt(dev->irq, dev, NULL); + boomerang_interrupt(dev->irq, dev); else - vortex_interrupt(dev->irq, dev, NULL); + vortex_interrupt(dev->irq, dev); local_irq_restore(flags); } } @@ -1875,11 +1876,11 @@ static void vortex_tx_timeout(struct net_device *dev) vp->stats.tx_dropped++; netif_wake_queue(dev); } - + /* Issue Tx Enable */ iowrite16(TxEnable, ioaddr + EL3_CMD); dev->trans_start = jiffies; - + /* Switch to register set 7 for normal use. */ EL3WINDOW(7); } @@ -2077,7 +2078,7 @@ boomerang_start_xmit(struct sk_buff *skb, struct net_device *dev) vp->tx_ring[entry].next = 0; #if DO_ZEROCOPY - if (skb->ip_summed != CHECKSUM_HW) + if (skb->ip_summed != CHECKSUM_PARTIAL) vp->tx_ring[entry].status = cpu_to_le32(skb->len | TxIntrUploaded); else vp->tx_ring[entry].status = cpu_to_le32(skb->len | TxIntrUploaded | AddTCPChksum | AddUDPChksum); @@ -2148,7 +2149,7 @@ boomerang_start_xmit(struct sk_buff *skb, struct net_device *dev) */ static irqreturn_t -vortex_interrupt(int irq, void *dev_id, struct pt_regs *regs) +vortex_interrupt(int irq, void *dev_id) { struct net_device *dev = dev_id; struct vortex_private *vp = netdev_priv(dev); @@ -2253,7 +2254,7 @@ handler_exit: */ static irqreturn_t -boomerang_interrupt(int irq, void *dev_id, struct pt_regs *regs) +boomerang_interrupt(int irq, void *dev_id) { struct net_device *dev = dev_id; struct vortex_private *vp = netdev_priv(dev); @@ -2316,10 +2317,10 @@ boomerang_interrupt(int irq, void *dev_id, struct pt_regs *regs) if ((vp->tx_ring[entry].status & DN_COMPLETE) == 0) break; /* It still hasn't been processed. */ #endif - + if (vp->tx_skbuff[entry]) { struct sk_buff *skb = vp->tx_skbuff[entry]; -#if DO_ZEROCOPY +#if DO_ZEROCOPY int i; for (i=0; i<=skb_shinfo(skb)->nr_frags; i++) pci_unmap_single(VORTEX_PCI(vp), @@ -2633,7 +2634,7 @@ vortex_close(struct net_device *dev) "not using them!\n", dev->name); } #endif - + free_irq(dev->irq, dev); if (vp->full_bus_master_rx) { /* Free Boomerang bus master Rx buffers. */ @@ -2675,7 +2676,7 @@ dump_tx_ring(struct net_device *dev) if (vortex_debug > 0) { struct vortex_private *vp = netdev_priv(dev); void __iomem *ioaddr = vp->ioaddr; - + if (vp->full_bus_master_tx) { int i; int stalled = ioread32(ioaddr + PktStatus) & 0x04; /* Possible racy. But it's only debug stuff */ @@ -2873,7 +2874,7 @@ static void vortex_get_drvinfo(struct net_device *dev, } } -static struct ethtool_ops vortex_ethtool_ops = { +static const struct ethtool_ops vortex_ethtool_ops = { .get_drvinfo = vortex_get_drvinfo, .get_strings = vortex_get_strings, .get_msglevel = vortex_get_msglevel, @@ -2928,7 +2929,7 @@ static void set_rx_mode(struct net_device *dev) int new_mode; if (dev->flags & IFF_PROMISC) { - if (vortex_debug > 0) + if (vortex_debug > 3) printk(KERN_NOTICE "%s: Setting promiscuous mode.\n", dev->name); new_mode = SetRxFilter|RxStation|RxMulticast|RxBroadcast|RxProm; } else if ((dev->mc_list) || (dev->flags & IFF_ALLMULTI)) { @@ -3169,7 +3170,7 @@ static int __init vortex_init(void) { int pci_rc, eisa_rc; - pci_rc = pci_module_init(&vortex_driver); + pci_rc = pci_register_driver(&vortex_driver); eisa_rc = vortex_eisa_init(); if (pci_rc == 0) @@ -3190,7 +3191,7 @@ static void __exit vortex_eisa_cleanup(void) /* Take care of the EISA devices */ eisa_driver_unregister(&vortex_eisa_driver); #endif - + if (compaq_net_device) { vp = compaq_net_device->priv; ioaddr = ioport_map(compaq_net_device->base_addr,