* needed.
*/
-void ei_interrupt(int irq, void *dev_id, struct pt_regs * regs)
+irqreturn_t ei_interrupt(int irq, void *dev_id, struct pt_regs * regs)
{
struct net_device *dev = dev_id;
long e8390_base;
if (dev == NULL)
{
printk ("net_interrupt(): irq %d for unknown device.\n", irq);
- return;
+ return IRQ_NONE;
}
e8390_base = dev->base_addr;
inb_p(e8390_base + EN0_IMR));
#endif
spin_unlock(&ei_local->page_lock);
- return;
+ return IRQ_NONE;
}
/* Change to page 0 and read the intr status reg. */
}
}
spin_unlock(&ei_local->page_lock);
- return;
+ return IRQ_HANDLED;
}
/**
extern void NS8390_init(struct net_device *dev, int startp);
extern int ei_open(struct net_device *dev);
extern int ei_close(struct net_device *dev);
-extern void ei_interrupt(int irq, void *dev_id, struct pt_regs *regs);
+extern irqreturn_t ei_interrupt(int irq, void *dev_id, struct pt_regs *regs);
/* You have one of these per-board */
struct ei_device {
* dev, priv will always refer to the 0th device in Multi-NIC mode.
*/
-static void dgrs_intr(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t dgrs_intr(int irq, void *dev_id, struct pt_regs *regs)
{
struct net_device *dev0 = (struct net_device *) dev_id;
DGRS_PRIV *priv0 = (DGRS_PRIV *) dev0->priv;
ack_intr:
if (priv0->plxreg)
OUTL(dev0->base_addr + PLX_LCL2PCI_DOORBELL, 1);
+
+ return IRQ_HANDLED;
}
/*
static void speedo_refill_rx_buffers(struct net_device *dev, int force);
static int speedo_rx(struct net_device *dev);
static void speedo_tx_buffer_gc(struct net_device *dev);
-static void speedo_interrupt(int irq, void *dev_instance, struct pt_regs *regs);
+static irqreturn_t speedo_interrupt(int irq, void *dev_instance, struct pt_regs *regs);
static int speedo_close(struct net_device *dev);
static struct net_device_stats *speedo_get_stats(struct net_device *dev);
static int speedo_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
/* The interrupt handler does all of the Rx thread work and cleans up
after the Tx thread. */
-static void speedo_interrupt(int irq, void *dev_instance, struct pt_regs *regs)
+static irqreturn_t speedo_interrupt(int irq, void *dev_instance, struct pt_regs *regs)
{
struct net_device *dev = (struct net_device *)dev_instance;
struct speedo_private *sp;
long ioaddr, boguscnt = max_interrupt_work;
unsigned short status;
+ unsigned int handled = 0;
ioaddr = dev->base_addr;
sp = (struct speedo_private *)dev->priv;
printk(KERN_ERR"%s: SMP simultaneous entry of an interrupt handler.\n",
dev->name);
sp->in_interrupt = 0; /* Avoid halting machine. */
- return;
+ return IRQ_NONE;
}
#endif
if ((status & 0xfc00) == 0)
break;
+ handled = 1;
if ((status & 0x5000) || /* Packet received, or Rx error. */
dev->name, inw(ioaddr + SCBStatus));
clear_bit(0, (void*)&sp->in_interrupt);
- return;
+ return IRQ_RETVAL(handled);
}
static inline struct RxFD *speedo_rx_alloc(struct net_device *dev, int entry)
static void epic_init_ring(struct net_device *dev);
static int epic_start_xmit(struct sk_buff *skb, struct net_device *dev);
static int epic_rx(struct net_device *dev);
-static void epic_interrupt(int irq, void *dev_instance, struct pt_regs *regs);
+static irqreturn_t epic_interrupt(int irq, void *dev_instance, struct pt_regs *regs);
static int netdev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
static int epic_close(struct net_device *dev);
static struct net_device_stats *epic_get_stats(struct net_device *dev);
/* The interrupt handler does all of the Rx thread work and cleans up
after the Tx thread. */
-static void epic_interrupt(int irq, void *dev_instance, struct pt_regs *regs)
+static irqreturn_t epic_interrupt(int irq, void *dev_instance, struct pt_regs *regs)
{
struct net_device *dev = dev_instance;
struct epic_private *ep = dev->priv;
long ioaddr = dev->base_addr;
int status, boguscnt = max_interrupt_work;
+ unsigned int handled = 0;
do {
status = inl(ioaddr + INTSTAT);
if ((status & IntrSummary) == 0)
break;
+ handled = 1;
if (status & (RxDone | RxStarted | RxEarlyWarn | RxOverflow))
epic_rx(dev);
printk(KERN_DEBUG "%s: exiting interrupt, intr_status=%#4.4x.\n",
dev->name, status);
- return;
+ return IRQ_RETVAL(handled);
}
static int epic_rx(struct net_device *dev)
memset(mc_filter, 0, sizeof(mc_filter));
for (i = 0, mclist = dev->mc_list; mclist && i < dev->mc_count;
- i++, mclist = mclist->next)
- set_bit(ether_crc_le(ETH_ALEN, mclist->dmi_addr) & 0x3f,
- mc_filter);
+ i++, mclist = mclist->next) {
+ unsigned int bit_nr =
+ ether_crc_le(ETH_ALEN, mclist->dmi_addr) & 0x3f;
+ mc_filter[bit_nr >> 3] |= (1 << bit_nr);
+ }
}
/* ToDo: perhaps we need to stop the Tx and Rx process here? */
if (memcmp(mc_filter, ep->mc_filter, sizeof(mc_filter))) {
static int pcnet32_start_xmit(struct sk_buff *, struct net_device *);
static int pcnet32_rx(struct net_device *);
static void pcnet32_tx_timeout (struct net_device *dev);
-static void pcnet32_interrupt(int, void *, struct pt_regs *);
+static irqreturn_t pcnet32_interrupt(int, void *, struct pt_regs *);
static int pcnet32_close(struct net_device *);
static struct net_device_stats *pcnet32_get_stats(struct net_device *);
static void pcnet32_set_multicast_list(struct net_device *);
spin_lock_init(&lp->lock);
+ SET_MODULE_OWNER(dev);
dev->priv = lp;
lp->name = chipname;
lp->shared_irq = shared;
lp->a.read_csr(ioaddr, 0));
- MOD_INC_USE_COUNT;
-
return 0; /* Always succeed */
}
}
/* The PCNET32 interrupt handler. */
-static void
+static irqreturn_t
pcnet32_interrupt(int irq, void *dev_id, struct pt_regs * regs)
{
struct net_device *dev = dev_id;
if (!dev) {
printk (KERN_DEBUG "%s(): irq %d for unknown device\n",
__FUNCTION__, irq);
- return;
+ return IRQ_NONE;
}
ioaddr = dev->base_addr;
dev->name, lp->a.read_csr (ioaddr, 0));
spin_unlock(&lp->lock);
+
+ return IRQ_HANDLED;
}
static int
lp->tx_dma_addr[i] = 0;
}
- MOD_DEC_USE_COUNT;
-
return 0;
}
** Process I2O outbound message queue until empty.
** =========================================================================
*/
-void
+irqreturn_t
RCProcI2OMsgQ (struct net_device *dev)
{
U32 phyAddrMsg;
unsigned char debug_msg[20];
if (pPab == NULL)
- return;
+ return IRQ_NONE;
phyAddrMsg = pPab->p_atu->OutQueue;
/* any more msgs? */
phyAddrMsg = pPab->p_atu->OutQueue;
}
+
+ return IRQ_HANDLED;
}
/*
** callback functions, TransmitCallbackFunction or ReceiveCallbackFunction,
** if a TX or RX transaction has completed.
*/
-void RCProcI2OMsgQ (struct net_device *dev);
+irqreturn_t RCProcI2OMsgQ (struct net_device *dev);
/*
** Disable and Enable I2O interrupts. I2O interrupts are enabled at Init time
static int RCopen (struct net_device *);
static int RC_xmit_packet (struct sk_buff *, struct net_device *);
-static void RCinterrupt (int, void *, struct pt_regs *);
+static irqreturn_t RCinterrupt (int, void *, struct pt_regs *);
static int RCclose (struct net_device *dev);
static struct net_device_stats *RCget_stats (struct net_device *);
static int RCioctl (struct net_device *, struct ifreq *, int);
* RCProcI2OMsgQ(), which in turn process the message and
* calls one of our callback functions.
*/
-static void
+static irqreturn_t
RCinterrupt (int irq, void *dev_id, struct pt_regs *regs)
{
printk (KERN_DEBUG "%s: shutdown, service irq\n",
dev->name);
- RCProcI2OMsgQ (dev);
+ return RCProcI2OMsgQ (dev);
}
#define REBOOT_REINIT_RETRY_LIMIT 4
static int sis900_start_xmit(struct sk_buff *skb, struct net_device *net_dev);
static int sis900_rx(struct net_device *net_dev);
static void sis900_finish_xmit (struct net_device *net_dev);
-static void sis900_interrupt(int irq, void *dev_instance, struct pt_regs *regs);
+static irqreturn_t sis900_interrupt(int irq, void *dev_instance, struct pt_regs *regs);
static int sis900_close(struct net_device *net_dev);
static int mii_ioctl(struct net_device *net_dev, struct ifreq *rq, int cmd);
static struct net_device_stats *sis900_get_stats(struct net_device *net_dev);
-static u16 sis900_compute_hashtable_index(u8 *addr, u8 revision);
+static u16 sis900_mcast_bitnr(u8 *addr, u8 revision);
static void set_rx_mode(struct net_device *net_dev);
static void sis900_reset(struct net_device *net_dev);
static void sis630_set_eq(struct net_device *net_dev, u8 revision);
* and cleans up after the Tx thread
*/
-static void sis900_interrupt(int irq, void *dev_instance, struct pt_regs *regs)
+static irqreturn_t sis900_interrupt(int irq, void *dev_instance, struct pt_regs *regs)
{
struct net_device *net_dev = dev_instance;
struct sis900_private *sis_priv = net_dev->priv;
int boguscnt = max_interrupt_work;
long ioaddr = net_dev->base_addr;
u32 status;
+ unsigned int handled = 0;
spin_lock (&sis_priv->lock);
if ((status & (HIBERR|TxURN|TxERR|TxIDLE|RxORN|RxERR|RxOK)) == 0)
/* nothing intresting happened */
break;
+ handled = 1;
/* why dow't we break after Tx/Rx case ?? keyword: full-duplex */
if (status & (RxORN | RxERR | RxOK))
net_dev->name, inl(ioaddr + isr));
spin_unlock (&sis_priv->lock);
- return;
+ return IRQ_RETVAL(handled);
}
/**
}
/**
- * sis900_compute_hashtable_index: - compute hashtable index
+ * sis900_mcast_bitnr: - compute hashtable index
* @addr: multicast address
* @revision: revision id of chip
*
* multicast hash table.
*/
-static u16 sis900_compute_hashtable_index(u8 *addr, u8 revision)
+static inline u16 sis900_mcast_bitnr(u8 *addr, u8 revision)
{
u32 crc = ether_crc(6, addr);
struct dev_mc_list *mclist;
rx_mode = RFAAB;
for (i = 0, mclist = net_dev->mc_list; mclist && i < net_dev->mc_count;
- i++, mclist = mclist->next)
- set_bit(sis900_compute_hashtable_index(mclist->dmi_addr, revision),
- mc_filter);
+ i++, mclist = mclist->next) {
+ unsigned int bit_nr =
+ sis900_mcast_bitnr(mclist->dmi_addr, revision);
+ mc_filter[bit_nr >> 4] |= (1 << bit_nr);
+ }
}
/* update Multicast Hash Table in Receive Filter */
static int TLan_Init( struct net_device * );
static int TLan_Open( struct net_device *dev );
static int TLan_StartTx( struct sk_buff *, struct net_device *);
-static void TLan_HandleInterrupt( int, void *, struct pt_regs *);
+static irqreturn_t TLan_HandleInterrupt( int, void *, struct pt_regs *);
static int TLan_Close( struct net_device *);
static struct net_device_stats *TLan_GetStats( struct net_device *);
static void TLan_SetMulticastList( struct net_device *);
*
**************************************************************/
-static void TLan_HandleInterrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t TLan_HandleInterrupt(int irq, void *dev_id, struct pt_regs *regs)
{
u32 ack;
struct net_device *dev;
spin_unlock(&priv->lock);
+ return IRQ_HANDLED;
} /* TLan_HandleInterrupts */