Skip to contentSkip to conversation

PATCH: netpoll with xircom_cb

DISCUSSION Petr Konecny 1 participant 1 message Oct 14, 2004 2 messages not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw
Quoted 6 lines · Petr Konecny
Quoted 6 lines

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

Quoted 8 lines

Review

Quoted 8 lines
(quoted diff) +8 -0
+#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

drivers/net/tulip/xircom_cb.c +11 -3
@@ -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