found one more bug

Holger Schurig hs4233 at mail.mn-solutions.de
Fri Jun 6 08:12:56 EDT 2008


Hi Dan !

I think I slowly find out what is going on. Here I have a case of 
a lost interrupt.

Here is what happen when I get a RX interrupt:

1 00:00:09 kernel: libertas_cs cs (INT): cause  0x0002    RX

The IF_CS_CARD_INT_CAUSE has the IF_CS_BIT_RX set, this
means that we can retrieve a data packet. This is also
mirrored in the IF_CS_CARD_STATUS register:

1 00:00:09 kernel: libertas_cs cs (INT): status 0x0007 tx rx cmd

Here it says we can send a packet, retrieve a packet, or
send a command now. We do retrieve 163 bytes:

1 00:00:09 kernel: libertas_cs cs (INT): rx 163

After this, I check the same register again and now the "rx" bit
there has been cleared:

1 00:00:09 kernel: libertas_cs cs (INT): status 0x0005 tx    cmd



Now I get a "TX done" interrupt, as IF_CS_CARD_INT_CAUSE tells 
us:

1 00:00:09 kernel: libertas_cs cs (INT): cause  0x0001 TX

This info is mirrored by the IF_CS_CARD_STATUS register
as well:

1 00:00:09 kernel: libertas_cs cs (INT): status 0x0005 tx    cmd

I send the notification about this upstream and check the status 
again:

1 00:00:09 kernel: libertas_cs cs (INT): tx
1 00:00:09 kernel: libertas_cs cs (INT): status 0x0007 tx rx cmd

Now, compared to the last  IF_CS_CARD_STATUS call, and still in 
the same ISR, I see the IF_CS_BIT_RX bit suddenly set. From now 
on the firmware won't create anymore interrupts, but I guess 
this is because my driver treated the firmware wronly. I think I 
need to have a shadow copy if the status register in my *card 
structure.



More information about the libertas-dev mailing list