All pastes #974252 Raw Edit

Mine

public c v1 · immutable
·published 2008-04-06 17:59 UTC
rendered paste body
static irqreturn_t cpmac_irq(int irq, void *dev_id){	struct net_device *dev = dev_id;	struct cpmac_priv *priv;	int queue;	u32 status;	static int oldjiffies = 0, counter = 0, treshold = 3;	priv = netdev_priv(dev);	status = cpmac_read(priv->regs, CPMAC_MAC_INT_VECTOR);	if(oldjiffies == jiffies)		counter++;	else		counter = 0;	if(counter > treshold) {		printk("[CPMAC]: possible IRQ storm, interrupt status: 0x%08x, counter: %d\n", status, counter);		counter = 0;		treshold++;	}	oldjiffies = jiffies;	if (unlikely(netif_msg_intr(priv)))		printk(KERN_DEBUG "%s: interrupt status: 0x%08x\n", dev->name,		       status);	if (status & MAC_INT_TX)		cpmac_end_xmit(dev, (status & 7));	if (status & MAC_INT_RX) {		queue = (status >> 8) & 7;		if (netif_rx_schedule_prep(dev, &priv->napi)) {			cpmac_write(priv->regs, CPMAC_RX_INT_CLEAR, 1 << queue);			__netif_rx_schedule(dev, &priv->napi);		}	}	cpmac_write(priv->regs, CPMAC_MAC_EOI_VECTOR, 0);	if (unlikely(status & (MAC_INT_HOST | MAC_INT_STATUS)))		cpmac_check_status(dev);	return IRQ_HANDLED;}