aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/pci-skeleton.c
diff options
context:
space:
mode:
authorJike Song <albcamus@gmail.com>2008-01-24 01:51:36 -0500
committerDavid S. Miller <davem@davemloft.net>2008-02-03 07:28:43 -0500
commit44911bfee4a92f7580cb4dbba36e986003b0ac75 (patch)
tree045e5c09229c4d72d0ccb61d472374c13d083ae3 /drivers/net/pci-skeleton.c
parent097c2aa89f22f55db19fd0f72aede460bcb61f29 (diff)
pci-skeleton: Misc fixes to build neatly
The pci-skeleton.c has several problems with compilation, such as missing args when calling synchronize_irq(). Fix it. Signed-off-by: Jike Song <albcamus@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/pci-skeleton.c')
-rw-r--r--drivers/net/pci-skeleton.c49
1 files changed, 25 insertions, 24 deletions
diff --git a/drivers/net/pci-skeleton.c b/drivers/net/pci-skeleton.c
index ed402e00e730..fffc49befe04 100644
--- a/drivers/net/pci-skeleton.c
+++ b/drivers/net/pci-skeleton.c
@@ -541,7 +541,7 @@ static void netdrv_hw_start (struct net_device *dev);
541#define NETDRV_W32_F(reg, val32) do { writel ((val32), ioaddr + (reg)); readl (ioaddr + (reg)); } while (0) 541#define NETDRV_W32_F(reg, val32) do { writel ((val32), ioaddr + (reg)); readl (ioaddr + (reg)); } while (0)
542 542
543 543
544#if MMIO_FLUSH_AUDIT_COMPLETE 544#ifdef MMIO_FLUSH_AUDIT_COMPLETE
545 545
546/* write MMIO register */ 546/* write MMIO register */
547#define NETDRV_W8(reg, val8) writeb ((val8), ioaddr + (reg)) 547#define NETDRV_W8(reg, val8) writeb ((val8), ioaddr + (reg))
@@ -603,7 +603,7 @@ static int __devinit netdrv_init_board (struct pci_dev *pdev,
603 return -ENOMEM; 603 return -ENOMEM;
604 } 604 }
605 SET_NETDEV_DEV(dev, &pdev->dev); 605 SET_NETDEV_DEV(dev, &pdev->dev);
606 tp = dev->priv; 606 tp = netdev_priv(dev);
607 607
608 /* enable device (incl. PCI PM wakeup), and bus-mastering */ 608 /* enable device (incl. PCI PM wakeup), and bus-mastering */
609 rc = pci_enable_device (pdev); 609 rc = pci_enable_device (pdev);
@@ -759,7 +759,7 @@ static int __devinit netdrv_init_one (struct pci_dev *pdev,
759 return i; 759 return i;
760 } 760 }
761 761
762 tp = dev->priv; 762 tp = netdev_priv(dev);
763 763
764 assert (ioaddr != NULL); 764 assert (ioaddr != NULL);
765 assert (dev != NULL); 765 assert (dev != NULL);
@@ -783,7 +783,7 @@ static int __devinit netdrv_init_one (struct pci_dev *pdev,
783 dev->base_addr = (unsigned long) ioaddr; 783 dev->base_addr = (unsigned long) ioaddr;
784 784
785 /* dev->priv/tp zeroed and aligned in alloc_etherdev */ 785 /* dev->priv/tp zeroed and aligned in alloc_etherdev */
786 tp = dev->priv; 786 tp = netdev_priv(dev);
787 787
788 /* note: tp->chipset set in netdrv_init_board */ 788 /* note: tp->chipset set in netdrv_init_board */
789 tp->drv_flags = PCI_COMMAND_IO | PCI_COMMAND_MEMORY | 789 tp->drv_flags = PCI_COMMAND_IO | PCI_COMMAND_MEMORY |
@@ -841,7 +841,7 @@ static void __devexit netdrv_remove_one (struct pci_dev *pdev)
841 841
842 assert (dev != NULL); 842 assert (dev != NULL);
843 843
844 np = dev->priv; 844 np = netdev_priv(dev);
845 assert (np != NULL); 845 assert (np != NULL);
846 846
847 unregister_netdev (dev); 847 unregister_netdev (dev);
@@ -974,7 +974,7 @@ static void mdio_sync (void *mdio_addr)
974 974
975static int mdio_read (struct net_device *dev, int phy_id, int location) 975static int mdio_read (struct net_device *dev, int phy_id, int location)
976{ 976{
977 struct netdrv_private *tp = dev->priv; 977 struct netdrv_private *tp = netdev_priv(dev);
978 void *mdio_addr = tp->mmio_addr + Config4; 978 void *mdio_addr = tp->mmio_addr + Config4;
979 int mii_cmd = (0xf6 << 10) | (phy_id << 5) | location; 979 int mii_cmd = (0xf6 << 10) | (phy_id << 5) | location;
980 int retval = 0; 980 int retval = 0;
@@ -1017,7 +1017,7 @@ static int mdio_read (struct net_device *dev, int phy_id, int location)
1017static void mdio_write (struct net_device *dev, int phy_id, int location, 1017static void mdio_write (struct net_device *dev, int phy_id, int location,
1018 int value) 1018 int value)
1019{ 1019{
1020 struct netdrv_private *tp = dev->priv; 1020 struct netdrv_private *tp = netdev_priv(dev);
1021 void *mdio_addr = tp->mmio_addr + Config4; 1021 void *mdio_addr = tp->mmio_addr + Config4;
1022 int mii_cmd = 1022 int mii_cmd =
1023 (0x5002 << 16) | (phy_id << 23) | (location << 18) | value; 1023 (0x5002 << 16) | (phy_id << 23) | (location << 18) | value;
@@ -1060,7 +1060,7 @@ static void mdio_write (struct net_device *dev, int phy_id, int location,
1060 1060
1061static int netdrv_open (struct net_device *dev) 1061static int netdrv_open (struct net_device *dev)
1062{ 1062{
1063 struct netdrv_private *tp = dev->priv; 1063 struct netdrv_private *tp = netdev_priv(dev);
1064 int retval; 1064 int retval;
1065#ifdef NETDRV_DEBUG 1065#ifdef NETDRV_DEBUG
1066 void *ioaddr = tp->mmio_addr; 1066 void *ioaddr = tp->mmio_addr;
@@ -1121,7 +1121,7 @@ static int netdrv_open (struct net_device *dev)
1121/* Start the hardware at open or resume. */ 1121/* Start the hardware at open or resume. */
1122static void netdrv_hw_start (struct net_device *dev) 1122static void netdrv_hw_start (struct net_device *dev)
1123{ 1123{
1124 struct netdrv_private *tp = dev->priv; 1124 struct netdrv_private *tp = netdev_priv(dev);
1125 void *ioaddr = tp->mmio_addr; 1125 void *ioaddr = tp->mmio_addr;
1126 u32 i; 1126 u32 i;
1127 1127
@@ -1191,7 +1191,7 @@ static void netdrv_hw_start (struct net_device *dev)
1191/* Initialize the Rx and Tx rings, along with various 'dev' bits. */ 1191/* Initialize the Rx and Tx rings, along with various 'dev' bits. */
1192static void netdrv_init_ring (struct net_device *dev) 1192static void netdrv_init_ring (struct net_device *dev)
1193{ 1193{
1194 struct netdrv_private *tp = dev->priv; 1194 struct netdrv_private *tp = netdev_priv(dev);
1195 int i; 1195 int i;
1196 1196
1197 DPRINTK ("ENTER\n"); 1197 DPRINTK ("ENTER\n");
@@ -1213,7 +1213,7 @@ static void netdrv_init_ring (struct net_device *dev)
1213static void netdrv_timer (unsigned long data) 1213static void netdrv_timer (unsigned long data)
1214{ 1214{
1215 struct net_device *dev = (struct net_device *) data; 1215 struct net_device *dev = (struct net_device *) data;
1216 struct netdrv_private *tp = dev->priv; 1216 struct netdrv_private *tp = netdev_priv(dev);
1217 void *ioaddr = tp->mmio_addr; 1217 void *ioaddr = tp->mmio_addr;
1218 int next_tick = 60 * HZ; 1218 int next_tick = 60 * HZ;
1219 int mii_lpa; 1219 int mii_lpa;
@@ -1252,9 +1252,10 @@ static void netdrv_timer (unsigned long data)
1252} 1252}
1253 1253
1254 1254
1255static void netdrv_tx_clear (struct netdrv_private *tp) 1255static void netdrv_tx_clear (struct net_device *dev)
1256{ 1256{
1257 int i; 1257 int i;
1258 struct netdrv_private *tp = netdev_priv(dev);
1258 1259
1259 atomic_set (&tp->cur_tx, 0); 1260 atomic_set (&tp->cur_tx, 0);
1260 atomic_set (&tp->dirty_tx, 0); 1261 atomic_set (&tp->dirty_tx, 0);
@@ -1278,7 +1279,7 @@ static void netdrv_tx_clear (struct netdrv_private *tp)
1278 1279
1279static void netdrv_tx_timeout (struct net_device *dev) 1280static void netdrv_tx_timeout (struct net_device *dev)
1280{ 1281{
1281 struct netdrv_private *tp = dev->priv; 1282 struct netdrv_private *tp = netdev_priv(dev);
1282 void *ioaddr = tp->mmio_addr; 1283 void *ioaddr = tp->mmio_addr;
1283 int i; 1284 int i;
1284 u8 tmp8; 1285 u8 tmp8;
@@ -1311,7 +1312,7 @@ static void netdrv_tx_timeout (struct net_device *dev)
1311 /* Stop a shared interrupt from scavenging while we are. */ 1312 /* Stop a shared interrupt from scavenging while we are. */
1312 spin_lock_irqsave (&tp->lock, flags); 1313 spin_lock_irqsave (&tp->lock, flags);
1313 1314
1314 netdrv_tx_clear (tp); 1315 netdrv_tx_clear (dev);
1315 1316
1316 spin_unlock_irqrestore (&tp->lock, flags); 1317 spin_unlock_irqrestore (&tp->lock, flags);
1317 1318
@@ -1325,7 +1326,7 @@ static void netdrv_tx_timeout (struct net_device *dev)
1325 1326
1326static int netdrv_start_xmit (struct sk_buff *skb, struct net_device *dev) 1327static int netdrv_start_xmit (struct sk_buff *skb, struct net_device *dev)
1327{ 1328{
1328 struct netdrv_private *tp = dev->priv; 1329 struct netdrv_private *tp = netdev_priv(dev);
1329 void *ioaddr = tp->mmio_addr; 1330 void *ioaddr = tp->mmio_addr;
1330 int entry; 1331 int entry;
1331 1332
@@ -1525,7 +1526,7 @@ static void netdrv_rx_interrupt (struct net_device *dev,
1525 DPRINTK ("%s: netdrv_rx() status %4.4x, size %4.4x," 1526 DPRINTK ("%s: netdrv_rx() status %4.4x, size %4.4x,"
1526 " cur %4.4x.\n", dev->name, rx_status, 1527 " cur %4.4x.\n", dev->name, rx_status,
1527 rx_size, cur_rx); 1528 rx_size, cur_rx);
1528#if NETDRV_DEBUG > 2 1529#if defined(NETDRV_DEBUG) && (NETDRV_DEBUG > 2)
1529 { 1530 {
1530 int i; 1531 int i;
1531 DPRINTK ("%s: Frame contents ", dev->name); 1532 DPRINTK ("%s: Frame contents ", dev->name);
@@ -1648,7 +1649,7 @@ static void netdrv_weird_interrupt (struct net_device *dev,
1648static irqreturn_t netdrv_interrupt (int irq, void *dev_instance) 1649static irqreturn_t netdrv_interrupt (int irq, void *dev_instance)
1649{ 1650{
1650 struct net_device *dev = (struct net_device *) dev_instance; 1651 struct net_device *dev = (struct net_device *) dev_instance;
1651 struct netdrv_private *tp = dev->priv; 1652 struct netdrv_private *tp = netdev_priv(dev);
1652 int boguscnt = max_interrupt_work; 1653 int boguscnt = max_interrupt_work;
1653 void *ioaddr = tp->mmio_addr; 1654 void *ioaddr = tp->mmio_addr;
1654 int status = 0, link_changed = 0; /* avoid bogus "uninit" warning */ 1655 int status = 0, link_changed = 0; /* avoid bogus "uninit" warning */
@@ -1711,7 +1712,7 @@ static irqreturn_t netdrv_interrupt (int irq, void *dev_instance)
1711 1712
1712static int netdrv_close (struct net_device *dev) 1713static int netdrv_close (struct net_device *dev)
1713{ 1714{
1714 struct netdrv_private *tp = dev->priv; 1715 struct netdrv_private *tp = netdev_priv(dev);
1715 void *ioaddr = tp->mmio_addr; 1716 void *ioaddr = tp->mmio_addr;
1716 unsigned long flags; 1717 unsigned long flags;
1717 1718
@@ -1738,10 +1739,10 @@ static int netdrv_close (struct net_device *dev)
1738 1739
1739 spin_unlock_irqrestore (&tp->lock, flags); 1740 spin_unlock_irqrestore (&tp->lock, flags);
1740 1741
1741 synchronize_irq (); 1742 synchronize_irq (dev->irq);
1742 free_irq (dev->irq, dev); 1743 free_irq (dev->irq, dev);
1743 1744
1744 netdrv_tx_clear (tp); 1745 netdrv_tx_clear (dev);
1745 1746
1746 pci_free_consistent(tp->pci_dev, RX_BUF_TOT_LEN, 1747 pci_free_consistent(tp->pci_dev, RX_BUF_TOT_LEN,
1747 tp->rx_ring, tp->rx_ring_dma); 1748 tp->rx_ring, tp->rx_ring_dma);
@@ -1762,7 +1763,7 @@ static int netdrv_close (struct net_device *dev)
1762 1763
1763static int netdrv_ioctl (struct net_device *dev, struct ifreq *rq, int cmd) 1764static int netdrv_ioctl (struct net_device *dev, struct ifreq *rq, int cmd)
1764{ 1765{
1765 struct netdrv_private *tp = dev->priv; 1766 struct netdrv_private *tp = netdev_priv(dev);
1766 struct mii_ioctl_data *data = if_mii(rq); 1767 struct mii_ioctl_data *data = if_mii(rq);
1767 unsigned long flags; 1768 unsigned long flags;
1768 int rc = 0; 1769 int rc = 0;
@@ -1805,7 +1806,7 @@ static int netdrv_ioctl (struct net_device *dev, struct ifreq *rq, int cmd)
1805 1806
1806static void netdrv_set_rx_mode (struct net_device *dev) 1807static void netdrv_set_rx_mode (struct net_device *dev)
1807{ 1808{
1808 struct netdrv_private *tp = dev->priv; 1809 struct netdrv_private *tp = netdev_priv(dev);
1809 void *ioaddr = tp->mmio_addr; 1810 void *ioaddr = tp->mmio_addr;
1810 u32 mc_filter[2]; /* Multicast hash filter */ 1811 u32 mc_filter[2]; /* Multicast hash filter */
1811 int i, rx_mode; 1812 int i, rx_mode;
@@ -1862,7 +1863,7 @@ static void netdrv_set_rx_mode (struct net_device *dev)
1862static int netdrv_suspend (struct pci_dev *pdev, pm_message_t state) 1863static int netdrv_suspend (struct pci_dev *pdev, pm_message_t state)
1863{ 1864{
1864 struct net_device *dev = pci_get_drvdata (pdev); 1865 struct net_device *dev = pci_get_drvdata (pdev);
1865 struct netdrv_private *tp = dev->priv; 1866 struct netdrv_private *tp = netdev_priv(dev);
1866 void *ioaddr = tp->mmio_addr; 1867 void *ioaddr = tp->mmio_addr;
1867 unsigned long flags; 1868 unsigned long flags;
1868 1869
@@ -1892,7 +1893,7 @@ static int netdrv_suspend (struct pci_dev *pdev, pm_message_t state)
1892static int netdrv_resume (struct pci_dev *pdev) 1893static int netdrv_resume (struct pci_dev *pdev)
1893{ 1894{
1894 struct net_device *dev = pci_get_drvdata (pdev); 1895 struct net_device *dev = pci_get_drvdata (pdev);
1895 struct netdrv_private *tp = dev->priv; 1896 /*struct netdrv_private *tp = netdev_priv(dev);*/
1896 1897
1897 if (!netif_running(dev)) 1898 if (!netif_running(dev))
1898 return 0; 1899 return 0;