Skip to contentSkip to conversation

Problem with exclusive interrupt in hostap_cs

DISCUSSION Larry Finger 3 participants 6 messages Apr 20, 2009 – Jul 28, 2009 2 messages not in the archive Networking drivers (wireless)

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive

Jouni,

This was posted on the PCMCIA mailing list by Jack Schneider:

Quoted 7 lines

Hi, folks Using Debian Lenny OS with 2.6.28.2-486 kernel.
I have a very old DEC VP575 laptop which I want to use as back-up server. I need two net connections. When I use a single pccard, wired, all is well. If I insert my second card, WIFI-Intersil Prism2.5 I get the following /var/log/messages error:
pcmcia: request for exclusive IRQ couuld not be fulfilled.
pcmcia: the driver needs updating to supported shared IRQ lines

The two drivers being loaded are hostap_cs and xirc2ps_cs. The latter one is coded to handle shared interrupts, but hostap_cs is not.

I would have no problem changing the driver interrupt registration in the link->irq structure, but I was not quite sure how change prism2_interrupt() to detect the shared case when the interrupt status register is 0xFFFF.

Could you please take a look at this?

Thanks,

Larry

#2 lore raw
Quoted 4 lines · Larry Finger

I would have no problem changing the driver interrupt registration in the link->irq structure, but I was not quite sure how change prism2_interrupt() to detect the shared case when the interrupt status register is 0xFFFF.

Another option would be for Jack to try the orinoco_cs driver.

//Peter

#4 lore raw
In reply to a message not in the archive
Quoted 6 lines · Jack Schneider

Hi, All
Tried the orinoco_cs driver last nite and got an error, something like; device not supported..

Thanks for trying..

I took a second look at the code and found that other drivers are using the routine prism2_interrupt() with shared interrupts, thus the patch below should be all that is needed.

I trust that you will be able to build the patched driver.

Larry

drivers/net/wireless/hostap/hostap_cs.c +2 -1
Index: wireless-testing/drivers/net/wireless/hostap/hostap_cs.c
===================================================================
@@ -666,7 +666,8 @@ static int prism2_config(struct pcmcia_d
 	 * irq structure is initialized.
 	 */
 	if (link->conf.Attributes & CONF_ENABLE_IRQ) {
-		link->irq.Attributes = IRQ_TYPE_EXCLUSIVE | IRQ_HANDLE_PRESENT;
+		link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING |
+				       IRQ_HANDLE_PRESENT;
 		link->irq.IRQInfo1 = IRQ_LEVEL_ID;
 		link->irq.Handler = prism2_interrupt;
 		link->irq.Instance = dev;
#5 lore raw

Hi Larry,

Quoted 14 lines · Larry Finger

I took a second look at the code and found that other drivers are using the routine prism2_interrupt() with shared interrupts, thus the patch below should be all that is needed.

I trust that you will be able to build the patched driver.

Larry

Index: wireless-testing/drivers/net/wireless/hostap/hostap_cs.c
===================================================================

drivers/net/wireless/hostap/hostap_cs.c static int prism2_config(struct pcmcia_d · line 673

Quoted 9 lines
drivers/net/wireless/hostap/hostap_cs.c +2 -1
@@ -666,7 +666,8 @@ static int prism2_config(struct pcmcia_d
 	 * irq structure is initialized.
 	 */
 	if (link->conf.Attributes & CONF_ENABLE_IRQ) {
-		link->irq.Attributes = IRQ_TYPE_EXCLUSIVE | IRQ_HANDLE_PRESENT;
+		link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING |
+				       IRQ_HANDLE_PRESENT;
 		link->irq.IRQInfo1 = IRQ_LEVEL_ID;
 		link->irq.Handler = prism2_interrupt;
 		link->irq.Instance = dev;

Do you think this could be queued up by now? Looks okay to me...

Regards,

Wolfram

Signature · 2 lines
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
#6 lore raw
Quoted 15 lines · Wolfram Sang

Hi Larry,

Quoted 11 lines · Larry Finger

I took a second look at the code and found that other drivers are using the
routine prism2_interrupt() with shared interrupts, thus the patch below should
be all that is needed.

I trust that you will be able to build the patched driver.

Larry

Quoted 16 lines
Quoted 5 lines

Index: wireless-testing/drivers/net/wireless/hostap/hostap_cs.c
===================================================================

drivers/net/wireless/hostap/hostap_cs.c static int prism2_config(struct pcmcia_d · line 673

Quoted 9 lines
drivers/net/wireless/hostap/hostap_cs.c +2 -1
@@ -666,7 +666,8 @@ static int prism2_config(struct pcmcia_d
      * irq structure is initialized.
      */
     if (link->conf.Attributes & CONF_ENABLE_IRQ) {
-        link->irq.Attributes = IRQ_TYPE_EXCLUSIVE | IRQ_HANDLE_PRESENT;
+        link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING |
+                       IRQ_HANDLE_PRESENT;
         link->irq.IRQInfo1 = IRQ_LEVEL_ID;
         link->irq.Handler = prism2_interrupt;
         link->irq.Instance = dev;

Do you think this could be queued up by now? Looks okay to me...

As Dominik was missing and there was no action on the linux-pcmcia list, I took advantage of the fact that this is a wireless device and submitted the patch to John Linville. It is commit e4a01604b8e5656f3a059f52b3e8f2560740c057 in the wireless-testing tree and was sent to DaveM on July 24 for linux-next. It will be in 2.6.32.

Larry

#7 lore raw
Quoted 6 lines

As Dominik was missing and there was no action on the linux-pcmcia list, I took advantage of the fact that this is a wireless device and submitted the patch to John Linville. It is commit e4a01604b8e5656f3a059f52b3e8f2560740c057 in the wireless-testing tree and was sent to DaveM on July 24 for linux-next. It will be in 2.6.32.

Great. IMHO the netdev-tree was the more apropriate one anyhow. It seems it got into linux-next shortly after I checked, so sorry for the noise!

Regards,

Wolfram

Signature · 2 lines
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |