Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 300550
b: refs/heads/master
c: c4a9f08
h: refs/heads/master
v: v3
  • Loading branch information
Francois Romieu committed Apr 7, 2012
1 parent 820b37f commit 75121c3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 24 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c0bd55efd7b7ea8346ec3b5ce8414f978fede1f5
refs/heads/master: c4a9f0854bbea281f3d332c8c2b2b65a67b11616
34 changes: 11 additions & 23 deletions trunk/drivers/net/ethernet/silan/sc92031.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,7 @@
#define SC92031_NAME "sc92031"

/* BAR 0 is MMIO, BAR 1 is PIO */
#ifndef SC92031_USE_BAR
#define SC92031_USE_BAR 0
#endif
#define SC92031_USE_PIO 0

/* Maximum number of multicast addresses to filter (vs. Rx-all-multicast). */
static int multicast_filter_limit = 64;
Expand Down Expand Up @@ -366,7 +364,7 @@ static void sc92031_disable_interrupts(struct net_device *dev)
mmiowb();

/* wait for any concurrent interrupt/tasklet to finish */
synchronize_irq(dev->irq);
synchronize_irq(priv->pdev->irq);
tasklet_disable(&priv->tasklet);
}

Expand Down Expand Up @@ -1114,10 +1112,13 @@ static void sc92031_tx_timeout(struct net_device *dev)
#ifdef CONFIG_NET_POLL_CONTROLLER
static void sc92031_poll_controller(struct net_device *dev)
{
disable_irq(dev->irq);
if (sc92031_interrupt(dev->irq, dev) != IRQ_NONE)
struct sc92031_priv *priv = netdev_priv(dev);
const int irq = priv->pdev->irq;

disable_irq(irq);
if (sc92031_interrupt(irq, dev) != IRQ_NONE)
sc92031_tasklet((unsigned long)dev);
enable_irq(dev->irq);
enable_irq(irq);
}
#endif

Expand Down Expand Up @@ -1402,7 +1403,6 @@ static int __devinit sc92031_probe(struct pci_dev *pdev,
struct net_device *dev;
struct sc92031_priv *priv;
u32 mac0, mac1;
unsigned long base_addr;

err = pci_enable_device(pdev);
if (unlikely(err < 0))
Expand All @@ -1422,7 +1422,7 @@ static int __devinit sc92031_probe(struct pci_dev *pdev,
if (unlikely(err < 0))
goto out_request_regions;

port_base = pci_iomap(pdev, SC92031_USE_BAR, 0);
port_base = pci_iomap(pdev, SC92031_USE_PIO, 0);
if (unlikely(!port_base)) {
err = -EIO;
goto out_iomap;
Expand All @@ -1437,14 +1437,6 @@ static int __devinit sc92031_probe(struct pci_dev *pdev,
pci_set_drvdata(pdev, dev);
SET_NETDEV_DEV(dev, &pdev->dev);

#if SC92031_USE_BAR == 0
dev->mem_start = pci_resource_start(pdev, SC92031_USE_BAR);
dev->mem_end = pci_resource_end(pdev, SC92031_USE_BAR);
#elif SC92031_USE_BAR == 1
dev->base_addr = pci_resource_start(pdev, SC92031_USE_BAR);
#endif
dev->irq = pdev->irq;

/* faked with skb_copy_and_csum_dev */
dev->features = NETIF_F_SG | NETIF_F_HIGHDMA |
NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM;
Expand Down Expand Up @@ -1478,13 +1470,9 @@ static int __devinit sc92031_probe(struct pci_dev *pdev,
if (err < 0)
goto out_register_netdev;

#if SC92031_USE_BAR == 0
base_addr = dev->mem_start;
#elif SC92031_USE_BAR == 1
base_addr = dev->base_addr;
#endif
printk(KERN_INFO "%s: SC92031 at 0x%lx, %pM, IRQ %d\n", dev->name,
base_addr, dev->dev_addr, dev->irq);
(long)pci_resource_start(pdev, SC92031_USE_PIO), dev->dev_addr,
pdev->irq);

return 0;

Expand Down

0 comments on commit 75121c3

Please sign in to comment.