Commit d59a6c2f authored by Jeff Garzik's avatar Jeff Garzik

net driver cleanup, volume 4

Affected drivers: 3c501, 3c507, 3c509, 3c5154, 3c59x, amd8111e,
at1700, e1000, hp100, lance, smc9194, de2104x, de4x5, tulip,
typhoon.

98% contributed by Andrew Morton.
parent 86ba4c15
...@@ -510,7 +510,7 @@ static int el_start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -510,7 +510,7 @@ static int el_start_xmit(struct sk_buff *skb, struct net_device *dev)
* TCP window. * TCP window.
*/ */
static void el_interrupt(int irq, void *dev_id, struct pt_regs *regs) static irqreturn_t el_interrupt(int irq, void *dev_id, struct pt_regs *regs)
{ {
struct net_device *dev = dev_id; struct net_device *dev = dev_id;
struct net_local *lp; struct net_local *lp;
...@@ -558,7 +558,7 @@ static void el_interrupt(int irq, void *dev_id, struct pt_regs *regs) ...@@ -558,7 +558,7 @@ static void el_interrupt(int irq, void *dev_id, struct pt_regs *regs)
} }
lp->loading=2; /* Force a reload */ lp->loading=2; /* Force a reload */
spin_unlock(&lp->lock); spin_unlock(&lp->lock);
return; goto out;
} }
if (el_debug > 6) if (el_debug > 6)
...@@ -606,7 +606,7 @@ static void el_interrupt(int irq, void *dev_id, struct pt_regs *regs) ...@@ -606,7 +606,7 @@ static void el_interrupt(int irq, void *dev_id, struct pt_regs *regs)
outb(AX_XMIT, AX_CMD); outb(AX_XMIT, AX_CMD);
lp->stats.collisions++; lp->stats.collisions++;
spin_unlock(&lp->lock); spin_unlock(&lp->lock);
return; goto out;
} }
else else
{ {
...@@ -675,7 +675,8 @@ static void el_interrupt(int irq, void *dev_id, struct pt_regs *regs) ...@@ -675,7 +675,8 @@ static void el_interrupt(int irq, void *dev_id, struct pt_regs *regs)
inb(RX_STATUS); /* Be certain that interrupts are cleared. */ inb(RX_STATUS); /* Be certain that interrupts are cleared. */
inb(TX_STATUS); inb(TX_STATUS);
spin_unlock(&lp->lock); spin_unlock(&lp->lock);
return; out:
return IRQ_HANDLED;
} }
......
...@@ -8,7 +8,7 @@ static int el1_probe1(struct net_device *dev, int ioaddr); ...@@ -8,7 +8,7 @@ static int el1_probe1(struct net_device *dev, int ioaddr);
static int el_open(struct net_device *dev); static int el_open(struct net_device *dev);
static void el_timeout(struct net_device *dev); static void el_timeout(struct net_device *dev);
static int el_start_xmit(struct sk_buff *skb, struct net_device *dev); static int el_start_xmit(struct sk_buff *skb, struct net_device *dev);
static void el_interrupt(int irq, void *dev_id, struct pt_regs *regs); static irqreturn_t el_interrupt(int irq, void *dev_id, struct pt_regs *regs);
static void el_receive(struct net_device *dev); static void el_receive(struct net_device *dev);
static void el_reset(struct net_device *dev); static void el_reset(struct net_device *dev);
static int el1_close(struct net_device *dev); static int el1_close(struct net_device *dev);
......
...@@ -291,7 +291,7 @@ extern int el16_probe(struct net_device *dev); /* Called from Space.c */ ...@@ -291,7 +291,7 @@ extern int el16_probe(struct net_device *dev); /* Called from Space.c */
static int el16_probe1(struct net_device *dev, int ioaddr); static int el16_probe1(struct net_device *dev, int ioaddr);
static int el16_open(struct net_device *dev); static int el16_open(struct net_device *dev);
static int el16_send_packet(struct sk_buff *skb, struct net_device *dev); static int el16_send_packet(struct sk_buff *skb, struct net_device *dev);
static void el16_interrupt(int irq, void *dev_id, struct pt_regs *regs); static irqreturn_t el16_interrupt(int irq, void *dev_id, struct pt_regs *regs);
static void el16_rx(struct net_device *dev); static void el16_rx(struct net_device *dev);
static int el16_close(struct net_device *dev); static int el16_close(struct net_device *dev);
static struct net_device_stats *el16_get_stats(struct net_device *dev); static struct net_device_stats *el16_get_stats(struct net_device *dev);
...@@ -516,7 +516,7 @@ static int el16_send_packet (struct sk_buff *skb, struct net_device *dev) ...@@ -516,7 +516,7 @@ static int el16_send_packet (struct sk_buff *skb, struct net_device *dev)
/* The typical workload of the driver: /* The typical workload of the driver:
Handle the network interface interrupts. */ Handle the network interface interrupts. */
static void el16_interrupt(int irq, void *dev_id, struct pt_regs *regs) static irqreturn_t el16_interrupt(int irq, void *dev_id, struct pt_regs *regs)
{ {
struct net_device *dev = dev_id; struct net_device *dev = dev_id;
struct net_local *lp; struct net_local *lp;
...@@ -526,7 +526,7 @@ static void el16_interrupt(int irq, void *dev_id, struct pt_regs *regs) ...@@ -526,7 +526,7 @@ static void el16_interrupt(int irq, void *dev_id, struct pt_regs *regs)
if (dev == NULL) { if (dev == NULL) {
printk ("net_interrupt(): irq %d for unknown device.\n", irq); printk ("net_interrupt(): irq %d for unknown device.\n", irq);
return; return IRQ_NONE;
} }
ioaddr = dev->base_addr; ioaddr = dev->base_addr;
...@@ -616,6 +616,7 @@ static void el16_interrupt(int irq, void *dev_id, struct pt_regs *regs) ...@@ -616,6 +616,7 @@ static void el16_interrupt(int irq, void *dev_id, struct pt_regs *regs)
/* Enable the 82586's interrupt input. */ /* Enable the 82586's interrupt input. */
outb(0x84, ioaddr + MISC_CTRL); outb(0x84, ioaddr + MISC_CTRL);
spin_unlock(&lp->lock); spin_unlock(&lp->lock);
return IRQ_HANDLED;
} }
static int el16_close(struct net_device *dev) static int el16_close(struct net_device *dev)
......
...@@ -192,7 +192,7 @@ static ushort id_read_eeprom(int index); ...@@ -192,7 +192,7 @@ static ushort id_read_eeprom(int index);
static ushort read_eeprom(int ioaddr, int index); static ushort read_eeprom(int ioaddr, int index);
static int el3_open(struct net_device *dev); static int el3_open(struct net_device *dev);
static int el3_start_xmit(struct sk_buff *skb, struct net_device *dev); static int el3_start_xmit(struct sk_buff *skb, struct net_device *dev);
static void el3_interrupt(int irq, void *dev_id, struct pt_regs *regs); static irqreturn_t el3_interrupt(int irq, void *dev_id, struct pt_regs *regs);
static void update_stats(struct net_device *dev); static void update_stats(struct net_device *dev);
static struct net_device_stats *el3_get_stats(struct net_device *dev); static struct net_device_stats *el3_get_stats(struct net_device *dev);
static int el3_rx(struct net_device *dev); static int el3_rx(struct net_device *dev);
...@@ -882,7 +882,7 @@ el3_start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -882,7 +882,7 @@ el3_start_xmit(struct sk_buff *skb, struct net_device *dev)
} }
/* The EL3 interrupt handler. */ /* The EL3 interrupt handler. */
static void static irqreturn_t
el3_interrupt(int irq, void *dev_id, struct pt_regs *regs) el3_interrupt(int irq, void *dev_id, struct pt_regs *regs)
{ {
struct net_device *dev = (struct net_device *)dev_id; struct net_device *dev = (struct net_device *)dev_id;
...@@ -892,7 +892,7 @@ el3_interrupt(int irq, void *dev_id, struct pt_regs *regs) ...@@ -892,7 +892,7 @@ el3_interrupt(int irq, void *dev_id, struct pt_regs *regs)
if (dev == NULL) { if (dev == NULL) {
printk ("el3_interrupt(): irq %d for unknown device.\n", irq); printk ("el3_interrupt(): irq %d for unknown device.\n", irq);
return; return IRQ_NONE;
} }
lp = (struct el3_private *)dev->priv; lp = (struct el3_private *)dev->priv;
...@@ -967,7 +967,7 @@ el3_interrupt(int irq, void *dev_id, struct pt_regs *regs) ...@@ -967,7 +967,7 @@ el3_interrupt(int irq, void *dev_id, struct pt_regs *regs)
inw(ioaddr + EL3_STATUS)); inw(ioaddr + EL3_STATUS));
} }
spin_unlock(&lp->lock); spin_unlock(&lp->lock);
return; return IRQ_HANDLED;
} }
......
/* /*
Written 1997-1998 by Donald Becker. Written 1997-1998 by Donald Becker.
...@@ -387,7 +386,7 @@ static int corkscrew_start_xmit(struct sk_buff *skb, ...@@ -387,7 +386,7 @@ static int corkscrew_start_xmit(struct sk_buff *skb,
static int corkscrew_rx(struct net_device *dev); static int corkscrew_rx(struct net_device *dev);
static void corkscrew_timeout(struct net_device *dev); static void corkscrew_timeout(struct net_device *dev);
static int boomerang_rx(struct net_device *dev); static int boomerang_rx(struct net_device *dev);
static void corkscrew_interrupt(int irq, void *dev_id, static irqreturn_t corkscrew_interrupt(int irq, void *dev_id,
struct pt_regs *regs); struct pt_regs *regs);
static int corkscrew_close(struct net_device *dev); static int corkscrew_close(struct net_device *dev);
static void update_stats(int addr, struct net_device *dev); static void update_stats(int addr, struct net_device *dev);
...@@ -1150,7 +1149,7 @@ static int corkscrew_start_xmit(struct sk_buff *skb, ...@@ -1150,7 +1149,7 @@ static int corkscrew_start_xmit(struct sk_buff *skb,
/* The interrupt handler does all of the Rx thread work and cleans up /* The interrupt handler does all of the Rx thread work and cleans up
after the Tx thread. */ after the Tx thread. */
static void corkscrew_interrupt(int irq, void *dev_id, static irqreturn_t corkscrew_interrupt(int irq, void *dev_id,
struct pt_regs *regs) struct pt_regs *regs)
{ {
/* Use the now-standard shared IRQ implementation. */ /* Use the now-standard shared IRQ implementation. */
...@@ -1289,6 +1288,7 @@ static void corkscrew_interrupt(int irq, void *dev_id, ...@@ -1289,6 +1288,7 @@ static void corkscrew_interrupt(int irq, void *dev_id,
if (corkscrew_debug > 4) if (corkscrew_debug > 4)
printk("%s: exiting interrupt, status %4.4x.\n", dev->name, status); printk("%s: exiting interrupt, status %4.4x.\n", dev->name, status);
return IRQ_HANDLED;
} }
static int corkscrew_rx(struct net_device *dev) static int corkscrew_rx(struct net_device *dev)
......
...@@ -885,8 +885,8 @@ static int vortex_start_xmit(struct sk_buff *skb, struct net_device *dev); ...@@ -885,8 +885,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 boomerang_start_xmit(struct sk_buff *skb, struct net_device *dev);
static int vortex_rx(struct net_device *dev); static int vortex_rx(struct net_device *dev);
static int boomerang_rx(struct net_device *dev); static int boomerang_rx(struct net_device *dev);
static void vortex_interrupt(int irq, void *dev_id, struct pt_regs *regs); static irqreturn_t vortex_interrupt(int irq, void *dev_id, struct pt_regs *regs);
static void boomerang_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 int vortex_close(struct net_device *dev); static int vortex_close(struct net_device *dev);
static void dump_tx_ring(struct net_device *dev); static void dump_tx_ring(struct net_device *dev);
static void update_stats(long ioaddr, struct net_device *dev); static void update_stats(long ioaddr, struct net_device *dev);
...@@ -2208,13 +2208,15 @@ boomerang_start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -2208,13 +2208,15 @@ boomerang_start_xmit(struct sk_buff *skb, struct net_device *dev)
* full_bus_master_tx == 0 && full_bus_master_rx == 0 * full_bus_master_tx == 0 && full_bus_master_rx == 0
*/ */
static void vortex_interrupt(int irq, void *dev_id, struct pt_regs *regs) static irqreturn_t
vortex_interrupt(int irq, void *dev_id, struct pt_regs *regs)
{ {
struct net_device *dev = dev_id; struct net_device *dev = dev_id;
struct vortex_private *vp = (struct vortex_private *)dev->priv; struct vortex_private *vp = (struct vortex_private *)dev->priv;
long ioaddr; long ioaddr;
int status; int status;
int work_done = max_interrupt_work; int work_done = max_interrupt_work;
int handled = 0;
ioaddr = dev->base_addr; ioaddr = dev->base_addr;
spin_lock(&vp->lock); spin_lock(&vp->lock);
...@@ -2226,6 +2228,7 @@ static void vortex_interrupt(int irq, void *dev_id, struct pt_regs *regs) ...@@ -2226,6 +2228,7 @@ static void vortex_interrupt(int irq, void *dev_id, struct pt_regs *regs)
if ((status & IntLatch) == 0) if ((status & IntLatch) == 0)
goto handler_exit; /* No interrupt: shared IRQs cause this */ goto handler_exit; /* No interrupt: shared IRQs cause this */
handled = 1;
if (status & IntReq) { if (status & IntReq) {
status |= vp->deferred; status |= vp->deferred;
...@@ -2302,6 +2305,7 @@ static void vortex_interrupt(int irq, void *dev_id, struct pt_regs *regs) ...@@ -2302,6 +2305,7 @@ static void vortex_interrupt(int irq, void *dev_id, struct pt_regs *regs)
dev->name, status); dev->name, status);
handler_exit: handler_exit:
spin_unlock(&vp->lock); spin_unlock(&vp->lock);
return IRQ_RETVAL(handled);
} }
/* /*
...@@ -2309,13 +2313,15 @@ static void vortex_interrupt(int irq, void *dev_id, struct pt_regs *regs) ...@@ -2309,13 +2313,15 @@ static void vortex_interrupt(int irq, void *dev_id, struct pt_regs *regs)
* full_bus_master_tx == 1 && full_bus_master_rx == 1 * full_bus_master_tx == 1 && full_bus_master_rx == 1
*/ */
static void boomerang_interrupt(int irq, void *dev_id, struct pt_regs *regs) static irqreturn_t
boomerang_interrupt(int irq, void *dev_id, struct pt_regs *regs)
{ {
struct net_device *dev = dev_id; struct net_device *dev = dev_id;
struct vortex_private *vp = (struct vortex_private *)dev->priv; struct vortex_private *vp = (struct vortex_private *)dev->priv;
long ioaddr; long ioaddr;
int status; int status;
int work_done = max_interrupt_work; int work_done = max_interrupt_work;
int handled;
ioaddr = dev->base_addr; ioaddr = dev->base_addr;
...@@ -2330,14 +2336,18 @@ static void boomerang_interrupt(int irq, void *dev_id, struct pt_regs *regs) ...@@ -2330,14 +2336,18 @@ static void boomerang_interrupt(int irq, void *dev_id, struct pt_regs *regs)
if (vortex_debug > 6) if (vortex_debug > 6)
printk(KERN_DEBUG "boomerang_interrupt. status=0x%4x\n", status); printk(KERN_DEBUG "boomerang_interrupt. status=0x%4x\n", status);
if ((status & IntLatch) == 0) if ((status & IntLatch) == 0) {
handled = 0;
goto handler_exit; /* No interrupt: shared IRQs can cause this */ goto handler_exit; /* No interrupt: shared IRQs can cause this */
}
if (status == 0xffff) { /* h/w no longer present (hotplug)? */ if (status == 0xffff) { /* h/w no longer present (hotplug)? */
if (vortex_debug > 1) if (vortex_debug > 1)
printk(KERN_DEBUG "boomerang_interrupt(1): status = 0xffff\n"); printk(KERN_DEBUG "boomerang_interrupt(1): status = 0xffff\n");
handled = 0;
goto handler_exit; goto handler_exit;
} }
handled = 1;
if (status & IntReq) { if (status & IntReq) {
status |= vp->deferred; status |= vp->deferred;
...@@ -2432,6 +2442,7 @@ static void boomerang_interrupt(int irq, void *dev_id, struct pt_regs *regs) ...@@ -2432,6 +2442,7 @@ static void boomerang_interrupt(int irq, void *dev_id, struct pt_regs *regs)
dev->name, status); dev->name, status);
handler_exit: handler_exit:
spin_unlock(&vp->lock); spin_unlock(&vp->lock);
return IRQ_RETVAL(handled);
} }
static int vortex_rx(struct net_device *dev) static int vortex_rx(struct net_device *dev)
......
...@@ -780,16 +780,18 @@ static struct net_device_stats *amd8111e_get_stats(struct net_device * dev) ...@@ -780,16 +780,18 @@ static struct net_device_stats *amd8111e_get_stats(struct net_device * dev)
/* /*
This is device interrupt function. It handles transmit, receive and link change interrupts. This is device interrupt function. It handles transmit, receive and link change interrupts.
*/ */
static void amd8111e_interrupt(int irq, void *dev_id, struct pt_regs *regs) static irqreturn_t
amd8111e_interrupt(int irq, void *dev_id, struct pt_regs *regs)
{ {
struct net_device * dev = (struct net_device *) dev_id; struct net_device * dev = (struct net_device *) dev_id;
struct amd8111e_priv *lp = dev->priv; struct amd8111e_priv *lp = dev->priv;
void * mmio = lp->mmio; void * mmio = lp->mmio;
unsigned int intr0; unsigned int intr0;
int handled = 0;
if(dev == NULL) if(dev == NULL)
return; return IRQ_NONE;
spin_lock (&lp->lock); spin_lock (&lp->lock);
/* disabling interrupt */ /* disabling interrupt */
...@@ -803,6 +805,7 @@ static void amd8111e_interrupt(int irq, void *dev_id, struct pt_regs *regs) ...@@ -803,6 +805,7 @@ static void amd8111e_interrupt(int irq, void *dev_id, struct pt_regs *regs)
if (!(intr0 & INTR)) if (!(intr0 & INTR))
goto err_no_interrupt; goto err_no_interrupt;
handled = 1;
/* Current driver processes 3 interrupts : RINT,TINT,LCINT */ /* Current driver processes 3 interrupts : RINT,TINT,LCINT */
writel(intr0, mmio + INT0); writel(intr0, mmio + INT0);
...@@ -823,7 +826,7 @@ static void amd8111e_interrupt(int irq, void *dev_id, struct pt_regs *regs) ...@@ -823,7 +826,7 @@ static void amd8111e_interrupt(int irq, void *dev_id, struct pt_regs *regs)
err_no_interrupt: err_no_interrupt:
writel( VAL0 | INTREN,mmio + CMD0); writel( VAL0 | INTREN,mmio + CMD0);
spin_unlock(&lp->lock); spin_unlock(&lp->lock);
return; return IRQ_RETVAL(handled);
} }
/* /*
......
...@@ -202,7 +202,7 @@ static int at1700_probe1(struct net_device *dev, int ioaddr); ...@@ -202,7 +202,7 @@ static int at1700_probe1(struct net_device *dev, int ioaddr);
static int read_eeprom(long ioaddr, int location); static int read_eeprom(long ioaddr, int location);
static int net_open(struct net_device *dev); static int net_open(struct net_device *dev);
static int net_send_packet(struct sk_buff *skb, struct net_device *dev); static int net_send_packet(struct sk_buff *skb, struct net_device *dev);
static void net_interrupt(int irq, void *dev_id, struct pt_regs *regs); static irqreturn_t net_interrupt(int irq, void *dev_id, struct pt_regs *regs);
static void net_rx(struct net_device *dev); static void net_rx(struct net_device *dev);
static int net_close(struct net_device *dev); static int net_close(struct net_device *dev);
static struct net_device_stats *net_get_stats(struct net_device *dev); static struct net_device_stats *net_get_stats(struct net_device *dev);
...@@ -696,16 +696,17 @@ static int net_send_packet (struct sk_buff *skb, struct net_device *dev) ...@@ -696,16 +696,17 @@ static int net_send_packet (struct sk_buff *skb, struct net_device *dev)
/* The typical workload of the driver: /* The typical workload of the driver:
Handle the network interface interrupts. */ Handle the network interface interrupts. */
static void static irqreturn_t
net_interrupt(int irq, void *dev_id, struct pt_regs *regs) net_interrupt(int irq, void *dev_id, struct pt_regs *regs)
{ {
struct net_device *dev = dev_id; struct net_device *dev = dev_id;
struct net_local *lp; struct net_local *lp;
int ioaddr, status; int ioaddr, status;
int handled = 0;
if (dev == NULL) { if (dev == NULL) {
printk ("at1700_interrupt(): irq %d for unknown device.\n", irq); printk ("at1700_interrupt(): irq %d for unknown device.\n", irq);
return; return IRQ_NONE;
} }
ioaddr = dev->base_addr; ioaddr = dev->base_addr;
...@@ -726,6 +727,7 @@ net_interrupt(int irq, void *dev_id, struct pt_regs *regs) ...@@ -726,6 +727,7 @@ net_interrupt(int irq, void *dev_id, struct pt_regs *regs)
Tx interrupt. Thus we flag on rx_started, so that we prevent Tx interrupt. Thus we flag on rx_started, so that we prevent
the interrupt routine (net_interrupt) to dive into net_rx the interrupt routine (net_interrupt) to dive into net_rx
again. */ again. */
handled = 1;
lp->rx_started = 1; lp->rx_started = 1;
outb(0x00, ioaddr + RX_INTR); /* Disable RX intr. */ outb(0x00, ioaddr + RX_INTR); /* Disable RX intr. */
net_rx(dev); net_rx(dev);
...@@ -733,6 +735,7 @@ net_interrupt(int irq, void *dev_id, struct pt_regs *regs) ...@@ -733,6 +735,7 @@ net_interrupt(int irq, void *dev_id, struct pt_regs *regs)
lp->rx_started = 0; lp->rx_started = 0;
} }
if (status & 0x00ff) { if (status & 0x00ff) {
handled = 1;
if (status & 0x02) { if (status & 0x02) {
/* More than 16 collisions occurred */ /* More than 16 collisions occurred */
if (net_debug > 4) if (net_debug > 4)
...@@ -760,7 +763,7 @@ net_interrupt(int irq, void *dev_id, struct pt_regs *regs) ...@@ -760,7 +763,7 @@ net_interrupt(int irq, void *dev_id, struct pt_regs *regs)
} }
spin_unlock (&lp->lock); spin_unlock (&lp->lock);
return; return IRQ_RETVAL(handled);
} }
/* We have a good packet(s), get it/them out of the buffers. */ /* We have a good packet(s), get it/them out of the buffers. */
...@@ -914,9 +917,11 @@ set_rx_mode(struct net_device *dev) ...@@ -914,9 +917,11 @@ set_rx_mode(struct net_device *dev)
memset(mc_filter, 0, sizeof(mc_filter)); memset(mc_filter, 0, sizeof(mc_filter));
for (i = 0, mclist = dev->mc_list; mclist && i < dev->mc_count; for (i = 0, mclist = dev->mc_list; mclist && i < dev->mc_count;
i++, mclist = mclist->next) i++, mclist = mclist->next) {
set_bit(ether_crc_le(ETH_ALEN, mclist->dmi_addr) >> 26, unsigned int bit =
mc_filter); ether_crc_le(ETH_ALEN, mclist->dmi_addr) >> 26;
mc_filter[bit >> 3] |= (1 << bit);
}
outb(0x02, ioaddr + RX_MODE); /* Use normal mode. */ outb(0x02, ioaddr + RX_MODE); /* Use normal mode. */
} }
......
...@@ -154,7 +154,7 @@ static int e1000_set_mac(struct net_device *netdev, void *p); ...@@ -154,7 +154,7 @@ static int e1000_set_mac(struct net_device *netdev, void *p);
static void e1000_update_stats(struct e1000_adapter *adapter); static void e1000_update_stats(struct e1000_adapter *adapter);
static inline void e1000_irq_disable(struct e1000_adapter *adapter); static inline void e1000_irq_disable(struct e1000_adapter *adapter);
static inline void e1000_irq_enable(struct e1000_adapter *adapter); static inline void e1000_irq_enable(struct e1000_adapter *adapter);
static void e1000_intr(int irq, void *data, struct pt_regs *regs); static irqreturn_t e1000_intr(int irq, void *data, struct pt_regs *regs);
#ifdef CONFIG_E1000_NAPI #ifdef CONFIG_E1000_NAPI
static int e1000_clean(struct net_device *netdev, int *budget); static int e1000_clean(struct net_device *netdev, int *budget);
static boolean_t e1000_clean_rx_irq(struct e1000_adapter *adapter, static boolean_t e1000_clean_rx_irq(struct e1000_adapter *adapter,
...@@ -1981,7 +1981,7 @@ e1000_irq_enable(struct e1000_adapter *adapter) ...@@ -1981,7 +1981,7 @@ e1000_irq_enable(struct e1000_adapter *adapter)
* @pt_regs: CPU registers structure * @pt_regs: CPU registers structure
**/ **/
static void static irqreturn_t
e1000_intr(int irq, void *data, struct pt_regs *regs) e1000_intr(int irq, void *data, struct pt_regs *regs)
{ {
struct net_device *netdev = data; struct net_device *netdev = data;
...@@ -1992,7 +1992,7 @@ e1000_intr(int irq, void *data, struct pt_regs *regs) ...@@ -1992,7 +1992,7 @@ e1000_intr(int irq, void *data, struct pt_regs *regs)
#endif #endif
if(!icr) if(!icr)
return; /* Not our interrupt */ return IRQ_NONE; /* Not our interrupt */
if(icr & (E1000_ICR_RXSEQ | E1000_ICR_LSC)) { if(icr & (E1000_ICR_RXSEQ | E1000_ICR_LSC)) {
adapter->hw.get_link_status = 1; adapter->hw.get_link_status = 1;
...@@ -2016,6 +2016,7 @@ e1000_intr(int irq, void *data, struct pt_regs *regs) ...@@ -2016,6 +2016,7 @@ e1000_intr(int irq, void *data, struct pt_regs *regs)
!e1000_clean_tx_irq(adapter)) !e1000_clean_tx_irq(adapter))
break; break;
#endif #endif
return IRQ_HANDLED;
} }
#ifdef CONFIG_E1000_NAPI #ifdef CONFIG_E1000_NAPI
......
...@@ -320,7 +320,7 @@ static void hp100_misc_interrupt(struct net_device *dev); ...@@ -320,7 +320,7 @@ static void hp100_misc_interrupt(struct net_device *dev);
static void hp100_update_stats(struct net_device *dev); static void hp100_update_stats(struct net_device *dev);
static void hp100_clear_stats(struct hp100_private *lp, int ioaddr); static void hp100_clear_stats(struct hp100_private *lp, int ioaddr);
static void hp100_set_multicast_list(struct net_device *dev); static void hp100_set_multicast_list(struct net_device *dev);
static void hp100_interrupt(int irq, void *dev_id, struct pt_regs *regs); static irqreturn_t hp100_interrupt(int irq, void *dev_id, struct pt_regs *regs);
static void hp100_start_interface(struct net_device *dev); static void hp100_start_interface(struct net_device *dev);
static void hp100_stop_interface(struct net_device *dev); static void hp100_stop_interface(struct net_device *dev);
static void hp100_load_eeprom(struct net_device *dev, u_short ioaddr); static void hp100_load_eeprom(struct net_device *dev, u_short ioaddr);
...@@ -2271,7 +2271,7 @@ static void hp100_set_multicast_list(struct net_device *dev) ...@@ -2271,7 +2271,7 @@ static void hp100_set_multicast_list(struct net_device *dev)
* hardware interrupt handling * hardware interrupt handling
*/ */
static void hp100_interrupt(int irq, void *dev_id, struct pt_regs *regs) static irqreturn_t hp100_interrupt(int irq, void *dev_id, struct pt_regs *regs)
{ {
struct net_device *dev = (struct net_device *) dev_id; struct net_device *dev = (struct net_device *) dev_id;
struct hp100_private *lp = (struct hp100_private *) dev->priv; struct hp100_private *lp = (struct hp100_private *) dev->priv;
...@@ -2280,7 +2280,7 @@ static void hp100_interrupt(int irq, void *dev_id, struct pt_regs *regs) ...@@ -2280,7 +2280,7 @@ static void hp100_interrupt(int irq, void *dev_id, struct pt_regs *regs)
u_int val; u_int val;
if (dev == NULL) if (dev == NULL)
return; return IRQ_NONE;
ioaddr = dev->base_addr; ioaddr = dev->base_addr;
spin_lock(&lp->lock); spin_lock(&lp->lock);
...@@ -2302,7 +2302,7 @@ static void hp100_interrupt(int irq, void *dev_id, struct pt_regs *regs) ...@@ -2302,7 +2302,7 @@ static void hp100_interrupt(int irq, void *dev_id, struct pt_regs *regs)
if (val == 0) { /* might be a shared interrupt */ if (val == 0) { /* might be a shared interrupt */
spin_unlock(&lp->lock); spin_unlock(&lp->lock);
hp100_ints_on(); hp100_ints_on();
return; return IRQ_NONE;
} }
/* We're only interested in those interrupts we really enabled. */ /* We're only interested in those interrupts we really enabled. */
/* val &= hp100_inw( IRQ_MASK ); */ /* val &= hp100_inw( IRQ_MASK ); */
...@@ -2394,6 +2394,7 @@ static void hp100_interrupt(int irq, void *dev_id, struct pt_regs *regs) ...@@ -2394,6 +2394,7 @@ static void hp100_interrupt(int irq, void *dev_id, struct pt_regs *regs)
spin_unlock(&lp->lock); spin_unlock(&lp->lock);
hp100_ints_on(); hp100_ints_on();
return IRQ_HANDLED;
} }
/* /*
......
...@@ -278,7 +278,7 @@ static int lance_open_fail(struct net_device *dev); ...@@ -278,7 +278,7 @@ static int lance_open_fail(struct net_device *dev);
static void lance_init_ring(struct net_device *dev, int mode); static void lance_init_ring(struct net_device *dev, int mode);
static int lance_start_xmit(struct sk_buff *skb, struct net_device *dev); static int lance_start_xmit(struct sk_buff *skb, struct net_device *dev);
static int lance_rx(struct net_device *dev); static int lance_rx(struct net_device *dev);
static void lance_interrupt(int irq, void *dev_id, struct pt_regs *regs); static irqreturn_t lance_interrupt(int irq, void *dev_id, struct pt_regs *regs);
static int lance_close(struct net_device *dev); static int lance_close(struct net_device *dev);
static struct net_device_stats *lance_get_stats(struct net_device *dev); static struct net_device_stats *lance_get_stats(struct net_device *dev);
static void set_multicast_list(struct net_device *dev); static void set_multicast_list(struct net_device *dev);
...@@ -945,7 +945,7 @@ static int lance_start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -945,7 +945,7 @@ static int lance_start_xmit(struct sk_buff *skb, struct net_device *dev)
} }
/* The LANCE interrupt handler. */ /* The LANCE interrupt handler. */
static void static irqreturn_t
lance_interrupt(int irq, void *dev_id, struct pt_regs * regs) lance_interrupt(int irq, void *dev_id, struct pt_regs * regs)
{ {
struct net_device *dev = dev_id; struct net_device *dev = dev_id;
...@@ -955,7 +955,7 @@ lance_interrupt(int irq, void *dev_id, struct pt_regs * regs) ...@@ -955,7 +955,7 @@ lance_interrupt(int irq, void *dev_id, struct pt_regs * regs)
if (dev == NULL) { if (dev == NULL) {
printk ("lance_interrupt(): irq %d for unknown device.\n", irq); printk ("lance_interrupt(): irq %d for unknown device.\n", irq);
return; return IRQ_NONE;
} }
ioaddr = dev->base_addr; ioaddr = dev->base_addr;
...@@ -1066,6 +1066,7 @@ lance_interrupt(int irq, void *dev_id, struct pt_regs * regs) ...@@ -1066,6 +1066,7 @@ lance_interrupt(int irq, void *dev_id, struct pt_regs * regs)
inw(dev->base_addr + LANCE_DATA)); inw(dev->base_addr + LANCE_DATA));
spin_unlock (&lp->devlock); spin_unlock (&lp->devlock);
return IRQ_HANDLED;
} }
static int static int
......
...@@ -234,7 +234,7 @@ static void smc_set_multicast_list(struct net_device *dev); ...@@ -234,7 +234,7 @@ static void smc_set_multicast_list(struct net_device *dev);
/* /*
. Handles the actual interrupt . Handles the actual interrupt
*/ */
static void smc_interrupt(int irq, void *, struct pt_regs *regs); static irqreturn_t smc_interrupt(int irq, void *, struct pt_regs *regs);
/* /*
. This is a separate procedure to handle the receipt of a packet, to . This is a separate procedure to handle the receipt of a packet, to
. leave the interrupt code looking slightly cleaner . leave the interrupt code looking slightly cleaner
...@@ -1133,7 +1133,7 @@ static void smc_timeout(struct net_device *dev) ...@@ -1133,7 +1133,7 @@ static void smc_timeout(struct net_device *dev)
. .
---------------------------------------------------------------------*/ ---------------------------------------------------------------------*/
static void smc_interrupt(int irq, void * dev_id, struct pt_regs * regs) static irqreturn_t smc_interrupt(int irq, void * dev_id, struct pt_regs * regs)
{ {
struct net_device *dev = dev_id; struct net_device *dev = dev_id;
int ioaddr = dev->base_addr; int ioaddr = dev->base_addr;
...@@ -1146,7 +1146,7 @@ static void smc_interrupt(int irq, void * dev_id, struct pt_regs * regs) ...@@ -1146,7 +1146,7 @@ static void smc_interrupt(int irq, void * dev_id, struct pt_regs * regs)
/* state registers */ /* state registers */
word saved_bank; word saved_bank;
word saved_pointer; word saved_pointer;
int handled = 0;
PRINTK3((CARDNAME": SMC interrupt started \n")); PRINTK3((CARDNAME": SMC interrupt started \n"));
...@@ -1171,6 +1171,8 @@ static void smc_interrupt(int irq, void * dev_id, struct pt_regs * regs) ...@@ -1171,6 +1171,8 @@ static void smc_interrupt(int irq, void * dev_id, struct pt_regs * regs)
if (!status ) if (!status )
break; break;
handled = 1;
PRINTK3((KERN_WARNING CARDNAME PRINTK3((KERN_WARNING CARDNAME
": Handling interrupt status %x \n", status )); ": Handling interrupt status %x \n", status ));
...@@ -1242,7 +1244,7 @@ static void smc_interrupt(int irq, void * dev_id, struct pt_regs * regs) ...@@ -1242,7 +1244,7 @@ static void smc_interrupt(int irq, void * dev_id, struct pt_regs * regs)
SMC_SELECT_BANK( saved_bank ); SMC_SELECT_BANK( saved_bank );
PRINTK3((CARDNAME ": Interrupt done\n")); PRINTK3((CARDNAME ": Interrupt done\n"));
return; return IRQ_RETVAL(handled);
} }
/*------------------------------------------------------------- /*-------------------------------------------------------------
......
...@@ -492,7 +492,7 @@ static void de_rx (struct de_private *de) ...@@ -492,7 +492,7 @@ static void de_rx (struct de_private *de)
de->rx_tail = rx_tail; de->rx_tail = rx_tail;
} }
static void de_interrupt (int irq, void *dev_instance, struct pt_regs *regs) static irqreturn_t de_interrupt (int irq, void *dev_instance, struct pt_regs *regs)
{ {
struct net_device *dev = dev_instance; struct net_device *dev = dev_instance;
struct de_private *de = dev->priv; struct de_private *de = dev->priv;
...@@ -500,7 +500,7 @@ static void de_interrupt (int irq, void *dev_instance, struct pt_regs *regs) ...@@ -500,7 +500,7 @@ static void de_interrupt (int irq, void *dev_instance, struct pt_regs *regs)
status = dr32(MacStatus); status = dr32(MacStatus);
if ((!(status & (IntrOK|IntrErr))) || (status == 0xFFFF)) if ((!(status & (IntrOK|IntrErr))) || (status == 0xFFFF))
return; return IRQ_NONE;
if (netif_msg_intr(de)) if (netif_msg_intr(de))
printk(KERN_DEBUG "%s: intr, status %08x mode %08x desc %u/%u/%u\n", printk(KERN_DEBUG "%s: intr, status %08x mode %08x desc %u/%u/%u\n",
...@@ -532,6 +532,8 @@ static void de_interrupt (int irq, void *dev_instance, struct pt_regs *regs) ...@@ -532,6 +532,8 @@ static void de_interrupt (int irq, void *dev_instance, struct pt_regs *regs)
printk(KERN_ERR "%s: PCI bus error, status=%08x, PCI status=%04x\n", printk(KERN_ERR "%s: PCI bus error, status=%08x, PCI status=%04x\n",
dev->name, status, pci_status); dev->name, status, pci_status);
} }
return IRQ_HANDLED;
} }
static void de_tx (struct de_private *de) static void de_tx (struct de_private *de)
......
...@@ -909,7 +909,7 @@ static struct { ...@@ -909,7 +909,7 @@ static struct {
*/ */
static int de4x5_open(struct net_device *dev); static int de4x5_open(struct net_device *dev);
static int de4x5_queue_pkt(struct sk_buff *skb, struct net_device *dev); static int de4x5_queue_pkt(struct sk_buff *skb, struct net_device *dev);
static void de4x5_interrupt(int irq, void *dev_id, struct pt_regs *regs); static irqreturn_t de4x5_interrupt(int irq, void *dev_id, struct pt_regs *regs);
static int de4x5_close(struct net_device *dev); static int de4x5_close(struct net_device *dev);
static struct net_device_stats *de4x5_get_stats(struct net_device *dev); static struct net_device_stats *de4x5_get_stats(struct net_device *dev);
static void de4x5_local_stats(struct net_device *dev, char *buf, int pkt_len); static void de4x5_local_stats(struct net_device *dev, char *buf, int pkt_len);
...@@ -1349,6 +1349,7 @@ de4x5_hw_init(struct net_device *dev, u_long iobase, struct pci_dev *pdev) ...@@ -1349,6 +1349,7 @@ de4x5_hw_init(struct net_device *dev, u_long iobase, struct pci_dev *pdev)
} }
/* The DE4X5-specific entries in the device structure. */ /* The DE4X5-specific entries in the device structure. */
SET_MODULE_OWNER(dev);
dev->open = &de4x5_open; dev->open = &de4x5_open;
dev->hard_start_xmit = &de4x5_queue_pkt; dev->hard_start_xmit = &de4x5_queue_pkt;
dev->stop = &de4x5_close; dev->stop = &de4x5_close;
...@@ -1433,8 +1434,6 @@ de4x5_open(struct net_device *dev) ...@@ -1433,8 +1434,6 @@ de4x5_open(struct net_device *dev)
printk("\tsigr: 0x%08x\n", inl(DE4X5_SIGR)); printk("\tsigr: 0x%08x\n", inl(DE4X5_SIGR));
} }
MOD_INC_USE_COUNT;
return status; return status;
} }
...@@ -1617,17 +1616,18 @@ de4x5_queue_pkt(struct sk_buff *skb, struct net_device *dev) ...@@ -1617,17 +1616,18 @@ de4x5_queue_pkt(struct sk_buff *skb, struct net_device *dev)
** is high and descriptor status bits cannot be set before the associated ** is high and descriptor status bits cannot be set before the associated
** interrupt is asserted and this routine entered. ** interrupt is asserted and this routine entered.
*/ */
static void static irqreturn_t
de4x5_interrupt(int irq, void *dev_id, struct pt_regs *regs) de4x5_interrupt(int irq, void *dev_id, struct pt_regs *regs)
{ {
struct net_device *dev = (struct net_device *)dev_id; struct net_device *dev = (struct net_device *)dev_id;
struct de4x5_private *lp; struct de4x5_private *lp;
s32 imr, omr, sts, limit; s32 imr, omr, sts, limit;
u_long iobase; u_long iobase;
unsigned int handled = 0;
if (dev == NULL) { if (dev == NULL) {
printk ("de4x5_interrupt(): irq %d for unknown device.\n", irq); printk ("de4x5_interrupt(): irq %d for unknown device.\n", irq);
return; return IRQ_NONE;
} }
lp = (struct de4x5_private *)dev->priv; lp = (struct de4x5_private *)dev->priv;
spin_lock(&lp->lock); spin_lock(&lp->lock);
...@@ -1645,6 +1645,7 @@ de4x5_interrupt(int irq, void *dev_id, struct pt_regs *regs) ...@@ -1645,6 +1645,7 @@ de4x5_interrupt(int irq, void *dev_id, struct pt_regs *regs)
outl(sts, DE4X5_STS); /* Reset the board interrupts */ outl(sts, DE4X5_STS); /* Reset the board interrupts */
if (!(sts & lp->irq_mask)) break;/* All done */ if (!(sts & lp->irq_mask)) break;/* All done */
handled = 1;
if (sts & (STS_RI | STS_RU)) /* Rx interrupt (packet[s] arrived) */ if (sts & (STS_RI | STS_RU)) /* Rx interrupt (packet[s] arrived) */
de4x5_rx(dev); de4x5_rx(dev);
...@@ -1665,7 +1666,7 @@ de4x5_interrupt(int irq, void *dev_id, struct pt_regs *regs) ...@@ -1665,7 +1666,7 @@ de4x5_interrupt(int irq, void *dev_id, struct pt_regs *regs)
printk("%s: Fatal bus error occurred, sts=%#8x, device stopped.\n", printk("%s: Fatal bus error occurred, sts=%#8x, device stopped.\n",
dev->name, sts); dev->name, sts);
spin_unlock(&lp->lock); spin_unlock(&lp->lock);
return; return IRQ_HANDLED;
} }
} }
...@@ -1681,7 +1682,7 @@ de4x5_interrupt(int irq, void *dev_id, struct pt_regs *regs) ...@@ -1681,7 +1682,7 @@ de4x5_interrupt(int irq, void *dev_id, struct pt_regs *regs)
ENABLE_IRQs; ENABLE_IRQs;
spin_unlock(&lp->lock); spin_unlock(&lp->lock);
return; return IRQ_RETVAL(handled);
} }
static int static int
...@@ -1924,8 +1925,6 @@ de4x5_close(struct net_device *dev) ...@@ -1924,8 +1925,6 @@ de4x5_close(struct net_device *dev)
de4x5_free_rx_buffs(dev); de4x5_free_rx_buffs(dev);
de4x5_free_tx_buffs(dev); de4x5_free_tx_buffs(dev);
MOD_DEC_USE_COUNT;
/* Put the adapter to sleep to save power */ /* Put the adapter to sleep to save power */
yawn(dev, SLEEP); yawn(dev, SLEEP);
......
...@@ -291,7 +291,7 @@ static int tulip_rx(struct net_device *dev) ...@@ -291,7 +291,7 @@ static int tulip_rx(struct net_device *dev)
#endif #endif
} }
static inline void phy_interrupt (struct net_device *dev) static inline unsigned int phy_interrupt (struct net_device *dev)
{ {
#ifdef __hppa__ #ifdef __hppa__
int csr12 = inl(dev->base_addr + CSR12) & 0xff; int csr12 = inl(dev->base_addr + CSR12) & 0xff;
...@@ -307,13 +307,17 @@ static inline void phy_interrupt (struct net_device *dev) ...@@ -307,13 +307,17 @@ static inline void phy_interrupt (struct net_device *dev)
spin_unlock(&tp->lock); spin_unlock(&tp->lock);
/* clear irq ack bit */ /* clear irq ack bit */
outl(csr12 & ~0x02, dev->base_addr + CSR12); outl(csr12 & ~0x02, dev->base_addr + CSR12);
return 1;
} }
#endif #endif
return 0;
} }
/* The interrupt handler does all of the Rx thread work and cleans up /* The interrupt handler does all of the Rx thread work and cleans up
after the Tx thread. */ after the Tx thread. */
void tulip_interrupt(int irq, void *dev_instance, struct pt_regs *regs) irqreturn_t tulip_interrupt(int irq, void *dev_instance, struct pt_regs *regs)
{ {
struct net_device *dev = (struct net_device *)dev_instance; struct net_device *dev = (struct net_device *)dev_instance;
struct tulip_private *tp = (struct tulip_private *)dev->priv; struct tulip_private *tp = (struct tulip_private *)dev->priv;
...@@ -328,15 +332,16 @@ void tulip_interrupt(int irq, void *dev_instance, struct pt_regs *regs) ...@@ -328,15 +332,16 @@ void tulip_interrupt(int irq, void *dev_instance, struct pt_regs *regs)
int maxtx = TX_RING_SIZE; int maxtx = TX_RING_SIZE;
int maxoi = TX_RING_SIZE; int maxoi = TX_RING_SIZE;
unsigned int work_count = tulip_max_interrupt_work; unsigned int work_count = tulip_max_interrupt_work;
unsigned int handled = 0;
/* Let's see whether the interrupt really is for us */ /* Let's see whether the interrupt really is for us */
csr5 = inl(ioaddr + CSR5); csr5 = inl(ioaddr + CSR5);
if (tp->flags & HAS_PHY_IRQ) if (tp->flags & HAS_PHY_IRQ)
phy_interrupt (dev); handled = phy_interrupt (dev);
if ((csr5 & (NormalIntr|AbnormalIntr)) == 0) if ((csr5 & (NormalIntr|AbnormalIntr)) == 0)
return; return IRQ_RETVAL(handled);
tp->nir++; tp->nir++;
...@@ -578,4 +583,5 @@ void tulip_interrupt(int irq, void *dev_instance, struct pt_regs *regs) ...@@ -578,4 +583,5 @@ void tulip_interrupt(int irq, void *dev_instance, struct pt_regs *regs)
printk(KERN_DEBUG "%s: exiting interrupt, csr5=%#4.4x.\n", printk(KERN_DEBUG "%s: exiting interrupt, csr5=%#4.4x.\n",
dev->name, inl(ioaddr + CSR5)); dev->name, inl(ioaddr + CSR5));
return IRQ_HANDLED;
} }
...@@ -423,7 +423,7 @@ int tulip_read_eeprom(long ioaddr, int location, int addr_len); ...@@ -423,7 +423,7 @@ int tulip_read_eeprom(long ioaddr, int location, int addr_len);
/* interrupt.c */ /* interrupt.c */
extern unsigned int tulip_max_interrupt_work; extern unsigned int tulip_max_interrupt_work;
extern int tulip_rx_copybreak; extern int tulip_rx_copybreak;
void tulip_interrupt(int irq, void *dev_instance, struct pt_regs *regs); irqreturn_t tulip_interrupt(int irq, void *dev_instance, struct pt_regs *regs);
int tulip_refill_rx(struct net_device *dev); int tulip_refill_rx(struct net_device *dev);
/* media.c */ /* media.c */
......
...@@ -1790,7 +1790,7 @@ typhoon_poll(struct net_device *dev, int *total_budget) ...@@ -1790,7 +1790,7 @@ typhoon_poll(struct net_device *dev, int *total_budget)
return (done ? 0 : 1); return (done ? 0 : 1);
} }
static void static irqreturn_t
typhoon_interrupt(int irq, void *dev_instance, struct pt_regs *rgs) typhoon_interrupt(int irq, void *dev_instance, struct pt_regs *rgs)
{ {
struct net_device *dev = (struct net_device *) dev_instance; struct net_device *dev = (struct net_device *) dev_instance;
...@@ -1799,7 +1799,7 @@ typhoon_interrupt(int irq, void *dev_instance, struct pt_regs *rgs) ...@@ -1799,7 +1799,7 @@ typhoon_interrupt(int irq, void *dev_instance, struct pt_regs *rgs)
intr_status = readl(ioaddr + TYPHOON_REG_INTR_STATUS); intr_status = readl(ioaddr + TYPHOON_REG_INTR_STATUS);
if(!intr_status) if(!intr_status)
return; return IRQ_NONE;
writel(intr_status, ioaddr + TYPHOON_REG_INTR_STATUS); writel(intr_status, ioaddr + TYPHOON_REG_INTR_STATUS);
...@@ -1811,6 +1811,7 @@ typhoon_interrupt(int irq, void *dev_instance, struct pt_regs *rgs) ...@@ -1811,6 +1811,7 @@ typhoon_interrupt(int irq, void *dev_instance, struct pt_regs *rgs)
printk(KERN_ERR "%s: Error, poll already scheduled\n", printk(KERN_ERR "%s: Error, poll already scheduled\n",
dev->name); dev->name);
} }
return IRQ_HANDLED;
} }
static void static void
......
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