mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-12 16:19:53 +00:00
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>
This commit is contained in:
parent
097c2aa89f
commit
44911bfee4
@ -541,7 +541,7 @@ static void netdrv_hw_start (struct net_device *dev);
|
|||||||
#define NETDRV_W32_F(reg, val32) do { writel ((val32), ioaddr + (reg)); readl (ioaddr + (reg)); } while (0)
|
#define NETDRV_W32_F(reg, val32) do { writel ((val32), ioaddr + (reg)); readl (ioaddr + (reg)); } while (0)
|
||||||
|
|
||||||
|
|
||||||
#if MMIO_FLUSH_AUDIT_COMPLETE
|
#ifdef MMIO_FLUSH_AUDIT_COMPLETE
|
||||||
|
|
||||||
/* write MMIO register */
|
/* write MMIO register */
|
||||||
#define NETDRV_W8(reg, val8) writeb ((val8), ioaddr + (reg))
|
#define NETDRV_W8(reg, val8) writeb ((val8), ioaddr + (reg))
|
||||||
@ -603,7 +603,7 @@ static int __devinit netdrv_init_board (struct pci_dev *pdev,
|
|||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
SET_NETDEV_DEV(dev, &pdev->dev);
|
SET_NETDEV_DEV(dev, &pdev->dev);
|
||||||
tp = dev->priv;
|
tp = netdev_priv(dev);
|
||||||
|
|
||||||
/* enable device (incl. PCI PM wakeup), and bus-mastering */
|
/* enable device (incl. PCI PM wakeup), and bus-mastering */
|
||||||
rc = pci_enable_device (pdev);
|
rc = pci_enable_device (pdev);
|
||||||
@ -759,7 +759,7 @@ static int __devinit netdrv_init_one (struct pci_dev *pdev,
|
|||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
tp = dev->priv;
|
tp = netdev_priv(dev);
|
||||||
|
|
||||||
assert (ioaddr != NULL);
|
assert (ioaddr != NULL);
|
||||||
assert (dev != NULL);
|
assert (dev != NULL);
|
||||||
@ -783,7 +783,7 @@ static int __devinit netdrv_init_one (struct pci_dev *pdev,
|
|||||||
dev->base_addr = (unsigned long) ioaddr;
|
dev->base_addr = (unsigned long) ioaddr;
|
||||||
|
|
||||||
/* dev->priv/tp zeroed and aligned in alloc_etherdev */
|
/* dev->priv/tp zeroed and aligned in alloc_etherdev */
|
||||||
tp = dev->priv;
|
tp = netdev_priv(dev);
|
||||||
|
|
||||||
/* note: tp->chipset set in netdrv_init_board */
|
/* note: tp->chipset set in netdrv_init_board */
|
||||||
tp->drv_flags = PCI_COMMAND_IO | PCI_COMMAND_MEMORY |
|
tp->drv_flags = PCI_COMMAND_IO | PCI_COMMAND_MEMORY |
|
||||||
@ -841,7 +841,7 @@ static void __devexit netdrv_remove_one (struct pci_dev *pdev)
|
|||||||
|
|
||||||
assert (dev != NULL);
|
assert (dev != NULL);
|
||||||
|
|
||||||
np = dev->priv;
|
np = netdev_priv(dev);
|
||||||
assert (np != NULL);
|
assert (np != NULL);
|
||||||
|
|
||||||
unregister_netdev (dev);
|
unregister_netdev (dev);
|
||||||
@ -974,7 +974,7 @@ static void mdio_sync (void *mdio_addr)
|
|||||||
|
|
||||||
static int mdio_read (struct net_device *dev, int phy_id, int location)
|
static int mdio_read (struct net_device *dev, int phy_id, int location)
|
||||||
{
|
{
|
||||||
struct netdrv_private *tp = dev->priv;
|
struct netdrv_private *tp = netdev_priv(dev);
|
||||||
void *mdio_addr = tp->mmio_addr + Config4;
|
void *mdio_addr = tp->mmio_addr + Config4;
|
||||||
int mii_cmd = (0xf6 << 10) | (phy_id << 5) | location;
|
int mii_cmd = (0xf6 << 10) | (phy_id << 5) | location;
|
||||||
int retval = 0;
|
int retval = 0;
|
||||||
@ -1017,7 +1017,7 @@ static int mdio_read (struct net_device *dev, int phy_id, int location)
|
|||||||
static void mdio_write (struct net_device *dev, int phy_id, int location,
|
static void mdio_write (struct net_device *dev, int phy_id, int location,
|
||||||
int value)
|
int value)
|
||||||
{
|
{
|
||||||
struct netdrv_private *tp = dev->priv;
|
struct netdrv_private *tp = netdev_priv(dev);
|
||||||
void *mdio_addr = tp->mmio_addr + Config4;
|
void *mdio_addr = tp->mmio_addr + Config4;
|
||||||
int mii_cmd =
|
int mii_cmd =
|
||||||
(0x5002 << 16) | (phy_id << 23) | (location << 18) | value;
|
(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,
|
|||||||
|
|
||||||
static int netdrv_open (struct net_device *dev)
|
static int netdrv_open (struct net_device *dev)
|
||||||
{
|
{
|
||||||
struct netdrv_private *tp = dev->priv;
|
struct netdrv_private *tp = netdev_priv(dev);
|
||||||
int retval;
|
int retval;
|
||||||
#ifdef NETDRV_DEBUG
|
#ifdef NETDRV_DEBUG
|
||||||
void *ioaddr = tp->mmio_addr;
|
void *ioaddr = tp->mmio_addr;
|
||||||
@ -1121,7 +1121,7 @@ static int netdrv_open (struct net_device *dev)
|
|||||||
/* Start the hardware at open or resume. */
|
/* Start the hardware at open or resume. */
|
||||||
static void netdrv_hw_start (struct net_device *dev)
|
static void netdrv_hw_start (struct net_device *dev)
|
||||||
{
|
{
|
||||||
struct netdrv_private *tp = dev->priv;
|
struct netdrv_private *tp = netdev_priv(dev);
|
||||||
void *ioaddr = tp->mmio_addr;
|
void *ioaddr = tp->mmio_addr;
|
||||||
u32 i;
|
u32 i;
|
||||||
|
|
||||||
@ -1191,7 +1191,7 @@ static void netdrv_hw_start (struct net_device *dev)
|
|||||||
/* Initialize the Rx and Tx rings, along with various 'dev' bits. */
|
/* Initialize the Rx and Tx rings, along with various 'dev' bits. */
|
||||||
static void netdrv_init_ring (struct net_device *dev)
|
static void netdrv_init_ring (struct net_device *dev)
|
||||||
{
|
{
|
||||||
struct netdrv_private *tp = dev->priv;
|
struct netdrv_private *tp = netdev_priv(dev);
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
DPRINTK ("ENTER\n");
|
DPRINTK ("ENTER\n");
|
||||||
@ -1213,7 +1213,7 @@ static void netdrv_init_ring (struct net_device *dev)
|
|||||||
static void netdrv_timer (unsigned long data)
|
static void netdrv_timer (unsigned long data)
|
||||||
{
|
{
|
||||||
struct net_device *dev = (struct net_device *) data;
|
struct net_device *dev = (struct net_device *) data;
|
||||||
struct netdrv_private *tp = dev->priv;
|
struct netdrv_private *tp = netdev_priv(dev);
|
||||||
void *ioaddr = tp->mmio_addr;
|
void *ioaddr = tp->mmio_addr;
|
||||||
int next_tick = 60 * HZ;
|
int next_tick = 60 * HZ;
|
||||||
int mii_lpa;
|
int mii_lpa;
|
||||||
@ -1252,9 +1252,10 @@ static void netdrv_timer (unsigned long data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void netdrv_tx_clear (struct netdrv_private *tp)
|
static void netdrv_tx_clear (struct net_device *dev)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
struct netdrv_private *tp = netdev_priv(dev);
|
||||||
|
|
||||||
atomic_set (&tp->cur_tx, 0);
|
atomic_set (&tp->cur_tx, 0);
|
||||||
atomic_set (&tp->dirty_tx, 0);
|
atomic_set (&tp->dirty_tx, 0);
|
||||||
@ -1278,7 +1279,7 @@ static void netdrv_tx_clear (struct netdrv_private *tp)
|
|||||||
|
|
||||||
static void netdrv_tx_timeout (struct net_device *dev)
|
static void netdrv_tx_timeout (struct net_device *dev)
|
||||||
{
|
{
|
||||||
struct netdrv_private *tp = dev->priv;
|
struct netdrv_private *tp = netdev_priv(dev);
|
||||||
void *ioaddr = tp->mmio_addr;
|
void *ioaddr = tp->mmio_addr;
|
||||||
int i;
|
int i;
|
||||||
u8 tmp8;
|
u8 tmp8;
|
||||||
@ -1311,7 +1312,7 @@ static void netdrv_tx_timeout (struct net_device *dev)
|
|||||||
/* Stop a shared interrupt from scavenging while we are. */
|
/* Stop a shared interrupt from scavenging while we are. */
|
||||||
spin_lock_irqsave (&tp->lock, flags);
|
spin_lock_irqsave (&tp->lock, flags);
|
||||||
|
|
||||||
netdrv_tx_clear (tp);
|
netdrv_tx_clear (dev);
|
||||||
|
|
||||||
spin_unlock_irqrestore (&tp->lock, flags);
|
spin_unlock_irqrestore (&tp->lock, flags);
|
||||||
|
|
||||||
@ -1325,7 +1326,7 @@ static void netdrv_tx_timeout (struct net_device *dev)
|
|||||||
|
|
||||||
static int netdrv_start_xmit (struct sk_buff *skb, struct net_device *dev)
|
static int netdrv_start_xmit (struct sk_buff *skb, struct net_device *dev)
|
||||||
{
|
{
|
||||||
struct netdrv_private *tp = dev->priv;
|
struct netdrv_private *tp = netdev_priv(dev);
|
||||||
void *ioaddr = tp->mmio_addr;
|
void *ioaddr = tp->mmio_addr;
|
||||||
int entry;
|
int entry;
|
||||||
|
|
||||||
@ -1525,7 +1526,7 @@ static void netdrv_rx_interrupt (struct net_device *dev,
|
|||||||
DPRINTK ("%s: netdrv_rx() status %4.4x, size %4.4x,"
|
DPRINTK ("%s: netdrv_rx() status %4.4x, size %4.4x,"
|
||||||
" cur %4.4x.\n", dev->name, rx_status,
|
" cur %4.4x.\n", dev->name, rx_status,
|
||||||
rx_size, cur_rx);
|
rx_size, cur_rx);
|
||||||
#if NETDRV_DEBUG > 2
|
#if defined(NETDRV_DEBUG) && (NETDRV_DEBUG > 2)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
DPRINTK ("%s: Frame contents ", dev->name);
|
DPRINTK ("%s: Frame contents ", dev->name);
|
||||||
@ -1648,7 +1649,7 @@ static void netdrv_weird_interrupt (struct net_device *dev,
|
|||||||
static irqreturn_t netdrv_interrupt (int irq, void *dev_instance)
|
static irqreturn_t netdrv_interrupt (int irq, void *dev_instance)
|
||||||
{
|
{
|
||||||
struct net_device *dev = (struct net_device *) dev_instance;
|
struct net_device *dev = (struct net_device *) dev_instance;
|
||||||
struct netdrv_private *tp = dev->priv;
|
struct netdrv_private *tp = netdev_priv(dev);
|
||||||
int boguscnt = max_interrupt_work;
|
int boguscnt = max_interrupt_work;
|
||||||
void *ioaddr = tp->mmio_addr;
|
void *ioaddr = tp->mmio_addr;
|
||||||
int status = 0, link_changed = 0; /* avoid bogus "uninit" warning */
|
int status = 0, link_changed = 0; /* avoid bogus "uninit" warning */
|
||||||
@ -1711,7 +1712,7 @@ static irqreturn_t netdrv_interrupt (int irq, void *dev_instance)
|
|||||||
|
|
||||||
static int netdrv_close (struct net_device *dev)
|
static int netdrv_close (struct net_device *dev)
|
||||||
{
|
{
|
||||||
struct netdrv_private *tp = dev->priv;
|
struct netdrv_private *tp = netdev_priv(dev);
|
||||||
void *ioaddr = tp->mmio_addr;
|
void *ioaddr = tp->mmio_addr;
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
|
|
||||||
@ -1738,10 +1739,10 @@ static int netdrv_close (struct net_device *dev)
|
|||||||
|
|
||||||
spin_unlock_irqrestore (&tp->lock, flags);
|
spin_unlock_irqrestore (&tp->lock, flags);
|
||||||
|
|
||||||
synchronize_irq ();
|
synchronize_irq (dev->irq);
|
||||||
free_irq (dev->irq, dev);
|
free_irq (dev->irq, dev);
|
||||||
|
|
||||||
netdrv_tx_clear (tp);
|
netdrv_tx_clear (dev);
|
||||||
|
|
||||||
pci_free_consistent(tp->pci_dev, RX_BUF_TOT_LEN,
|
pci_free_consistent(tp->pci_dev, RX_BUF_TOT_LEN,
|
||||||
tp->rx_ring, tp->rx_ring_dma);
|
tp->rx_ring, tp->rx_ring_dma);
|
||||||
@ -1762,7 +1763,7 @@ static int netdrv_close (struct net_device *dev)
|
|||||||
|
|
||||||
static int netdrv_ioctl (struct net_device *dev, struct ifreq *rq, int cmd)
|
static int netdrv_ioctl (struct net_device *dev, struct ifreq *rq, int cmd)
|
||||||
{
|
{
|
||||||
struct netdrv_private *tp = dev->priv;
|
struct netdrv_private *tp = netdev_priv(dev);
|
||||||
struct mii_ioctl_data *data = if_mii(rq);
|
struct mii_ioctl_data *data = if_mii(rq);
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
@ -1805,7 +1806,7 @@ static int netdrv_ioctl (struct net_device *dev, struct ifreq *rq, int cmd)
|
|||||||
|
|
||||||
static void netdrv_set_rx_mode (struct net_device *dev)
|
static void netdrv_set_rx_mode (struct net_device *dev)
|
||||||
{
|
{
|
||||||
struct netdrv_private *tp = dev->priv;
|
struct netdrv_private *tp = netdev_priv(dev);
|
||||||
void *ioaddr = tp->mmio_addr;
|
void *ioaddr = tp->mmio_addr;
|
||||||
u32 mc_filter[2]; /* Multicast hash filter */
|
u32 mc_filter[2]; /* Multicast hash filter */
|
||||||
int i, rx_mode;
|
int i, rx_mode;
|
||||||
@ -1862,7 +1863,7 @@ static void netdrv_set_rx_mode (struct net_device *dev)
|
|||||||
static int netdrv_suspend (struct pci_dev *pdev, pm_message_t state)
|
static int netdrv_suspend (struct pci_dev *pdev, pm_message_t state)
|
||||||
{
|
{
|
||||||
struct net_device *dev = pci_get_drvdata (pdev);
|
struct net_device *dev = pci_get_drvdata (pdev);
|
||||||
struct netdrv_private *tp = dev->priv;
|
struct netdrv_private *tp = netdev_priv(dev);
|
||||||
void *ioaddr = tp->mmio_addr;
|
void *ioaddr = tp->mmio_addr;
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
|
|
||||||
@ -1892,7 +1893,7 @@ static int netdrv_suspend (struct pci_dev *pdev, pm_message_t state)
|
|||||||
static int netdrv_resume (struct pci_dev *pdev)
|
static int netdrv_resume (struct pci_dev *pdev)
|
||||||
{
|
{
|
||||||
struct net_device *dev = pci_get_drvdata (pdev);
|
struct net_device *dev = pci_get_drvdata (pdev);
|
||||||
struct netdrv_private *tp = dev->priv;
|
/*struct netdrv_private *tp = netdev_priv(dev);*/
|
||||||
|
|
||||||
if (!netif_running(dev))
|
if (!netif_running(dev))
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user