Arjan> On Thu, Oct 14, 2004 at 03:52:46AM +0200, Petr Konecny wrote:
>> Hi,
>>
>> I have a headless computer with xircom pcmcia card and needed netconsole
>> on it. After looking around in other drivers I concocted this patch. It
>> survived light testing. I have no documentation for the hw, so it maybe
>> totally bogus. What do you think ?
Arjan> looks correct to me,however I have one remark
>> +#ifdef CONFIG_NET_POLL_CONTROLLER
>> +static void xircom_poll_controller(struct net_device *dev)
>> +{
>> + disable_irq(dev->irq);
>> + xircom_interrupt(dev->irq, dev, NULL);
>> + enable_irq(dev->irq);
>> +}
>> +#endif
AFAICS all other drivers call the interrupt routine. They differ only in
disabling interrupts: some use local_irq_disable, some don't disable it
at all, because of a spinlock taken in the interrupt routine. Perhaps
the latter would work with xircom_cb.
Arjan> I think you want to call investigate_read_descriptor() and
Arjan> investigate_read_descriptor() instead of this.
But this works too, at least with netconsole. Patch on top of the last
one.
Petr
--- 2.6old/drivers/net/tulip/xircom_cb.c 2004-10-13 18:49:59.000000000
-0700
+++ 2.6/drivers/net/tulip/xircom_cb.c 2004-10-14 07:55:08.000000000 -0700
@@ -509,9 +509,17 @@
#ifdef CONFIG_NET_POLL_CONTROLLER
static void xircom_poll_controller(struct net_device *dev)
{
- disable_irq(dev->irq);
- xircom_interrupt(dev->irq, dev, NULL);
- enable_irq(dev->irq);
+ struct xircom_private *card = netdev_priv(dev);
+ int i;
+
+ enter("xircom_poll");
+ spin_lock(&card->lock);
+ for (i=0;i<NUMDESCRIPTORS;i++)
+ investigate_write_descriptor(dev,card,i,bufferoffsets[i]);
+ for (i=0;i<NUMDESCRIPTORS;i++)
+ investigate_read_descriptor(dev,card,i,bufferoffsets[i]);
+ spin_unlock(&card->lock);
+ leave("xircom_poll");
}
#endif
|