Commit bc48a1f5 authored by Allen Pais's avatar Allen Pais Committed by David S. Miller

net: sundance: convert tasklets to use new tasklet_setup() API

In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.
Signed-off-by: default avatarRomain Perier <romain.perier@gmail.com>
Signed-off-by: default avatarAllen Pais <apais@linux.microsoft.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 6660de07
...@@ -367,6 +367,7 @@ struct netdev_private { ...@@ -367,6 +367,7 @@ struct netdev_private {
dma_addr_t tx_ring_dma; dma_addr_t tx_ring_dma;
dma_addr_t rx_ring_dma; dma_addr_t rx_ring_dma;
struct timer_list timer; /* Media monitoring timer. */ struct timer_list timer; /* Media monitoring timer. */
struct net_device *ndev; /* backpointer */
/* ethtool extra stats */ /* ethtool extra stats */
struct { struct {
u64 tx_multiple_collisions; u64 tx_multiple_collisions;
...@@ -429,8 +430,8 @@ static void init_ring(struct net_device *dev); ...@@ -429,8 +430,8 @@ static void init_ring(struct net_device *dev);
static netdev_tx_t start_tx(struct sk_buff *skb, struct net_device *dev); static netdev_tx_t start_tx(struct sk_buff *skb, struct net_device *dev);
static int reset_tx (struct net_device *dev); static int reset_tx (struct net_device *dev);
static irqreturn_t intr_handler(int irq, void *dev_instance); static irqreturn_t intr_handler(int irq, void *dev_instance);
static void rx_poll(unsigned long data); static void rx_poll(struct tasklet_struct *t);
static void tx_poll(unsigned long data); static void tx_poll(struct tasklet_struct *t);
static void refill_rx (struct net_device *dev); static void refill_rx (struct net_device *dev);
static void netdev_error(struct net_device *dev, int intr_status); static void netdev_error(struct net_device *dev, int intr_status);
static void netdev_error(struct net_device *dev, int intr_status); static void netdev_error(struct net_device *dev, int intr_status);
...@@ -531,14 +532,15 @@ static int sundance_probe1(struct pci_dev *pdev, ...@@ -531,14 +532,15 @@ static int sundance_probe1(struct pci_dev *pdev,
cpu_to_le16(eeprom_read(ioaddr, i + EEPROM_SA_OFFSET)); cpu_to_le16(eeprom_read(ioaddr, i + EEPROM_SA_OFFSET));
np = netdev_priv(dev); np = netdev_priv(dev);
np->ndev = dev;
np->base = ioaddr; np->base = ioaddr;
np->pci_dev = pdev; np->pci_dev = pdev;
np->chip_id = chip_idx; np->chip_id = chip_idx;
np->msg_enable = (1 << debug) - 1; np->msg_enable = (1 << debug) - 1;
spin_lock_init(&np->lock); spin_lock_init(&np->lock);
spin_lock_init(&np->statlock); spin_lock_init(&np->statlock);
tasklet_init(&np->rx_tasklet, rx_poll, (unsigned long)dev); tasklet_setup(&np->rx_tasklet, rx_poll);
tasklet_init(&np->tx_tasklet, tx_poll, (unsigned long)dev); tasklet_setup(&np->tx_tasklet, tx_poll);
ring_space = dma_alloc_coherent(&pdev->dev, TX_TOTAL_SIZE, ring_space = dma_alloc_coherent(&pdev->dev, TX_TOTAL_SIZE,
&ring_dma, GFP_KERNEL); &ring_dma, GFP_KERNEL);
...@@ -1054,10 +1056,9 @@ static void init_ring(struct net_device *dev) ...@@ -1054,10 +1056,9 @@ static void init_ring(struct net_device *dev)
} }
} }
static void tx_poll (unsigned long data) static void tx_poll(struct tasklet_struct *t)
{ {
struct net_device *dev = (struct net_device *)data; struct netdev_private *np = from_tasklet(np, t, tx_tasklet);
struct netdev_private *np = netdev_priv(dev);
unsigned head = np->cur_task % TX_RING_SIZE; unsigned head = np->cur_task % TX_RING_SIZE;
struct netdev_desc *txdesc = struct netdev_desc *txdesc =
&np->tx_ring[(np->cur_tx - 1) % TX_RING_SIZE]; &np->tx_ring[(np->cur_tx - 1) % TX_RING_SIZE];
...@@ -1312,10 +1313,10 @@ static irqreturn_t intr_handler(int irq, void *dev_instance) ...@@ -1312,10 +1313,10 @@ static irqreturn_t intr_handler(int irq, void *dev_instance)
return IRQ_RETVAL(handled); return IRQ_RETVAL(handled);
} }
static void rx_poll(unsigned long data) static void rx_poll(struct tasklet_struct *t)
{ {
struct net_device *dev = (struct net_device *)data; struct netdev_private *np = from_tasklet(np, t, rx_tasklet);
struct netdev_private *np = netdev_priv(dev); struct net_device *dev = np->ndev;
int entry = np->cur_rx % RX_RING_SIZE; int entry = np->cur_rx % RX_RING_SIZE;
int boguscnt = np->budget; int boguscnt = np->budget;
void __iomem *ioaddr = np->base; void __iomem *ioaddr = np->base;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment