Questions on libertas driver

Holger Schurig hs4233 at mail.mn-solutions.de
Mon Jan 28 05:28:12 EST 2008


> libertas DNLD_CMD: 03 00 2e 00 02 00 00 00 00 00 00 00 00 00 00 00 
> libertas DNLD_CMD: ff ff ff ff ff ff 00 00 00 00 00 00 00 00 00 00
> libertas DNLD_CMD: 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> ##inw 00000020<0005
> ##outw 00000018>002e
> ##outsw 0000001a>(0x17 words)
> ##outw 00000000>0004
> ##outw 00000002>0004
> root:~> libertas: Command 3 timed out
> libertas: requeueing command 3 due to timeout (#1)

Your card doesn't generate an interrupt.

After the last "##outw 00000002>0004" the driver is finished so far.
Then the driver waits until the card interrupts back -- or the driver
moans about a time out.

Here's a relevant from this driver, talking to my CF card:

libertas enter: lbs_submit_command():1166
libertas cmd: DNLD_CMD: command 0x0003, seq 2, size 46, jiffies 578632
libertas DNLD_CMD: 03 00 2e 00 02 00 00 00 00 00 00 00 00 00 00 00
libertas DNLD_CMD: ff ff ff ff ff ff 00 00 00 00 00 00 00 00 00 00
libertas DNLD_CMD: 00 00 00 00 00 00 00 00 00 00 00 00 00 00
libertas_cs enter: if_cs_host_to_card(type 1, bytes 46):622
libertas_cs enter: if_cs_send_cmd():290
##inw 00000020<0005

This are bits IF_CS_C_S_TX_DNLD_RDY and IF_CS_C_S_CMD_DNLD_RDY. So we can
download a command. Which we do. First the length, then the data:

##outw 00000018>002e
##outsw 0000001a>(0x17 words)

0x17 * 2 = 0x2e, so this seems all fine. So we poke
IF_CS_H_STATUS_DNLD_OVER into the host status register

##outw 00000000>0004

and create an interrupt on on the embedded ARM processor:

##outw 00000002>0004
libertas_cs leave: if_cs_send_cmd():321, ret 0
libertas_cs leave: if_cs_host_to_card():638, ret 0
libertas leave: lbs_submit_command():1199
libertas leave: lbs_execute_next_command():1879
libertas thread: main-thread 111: intcounter=0 currenttxskb=00000000 dnld_sent=2
libertas thread: main-thread sleeping... Conn=1 IntC=0 PS_mode=0 PS_State=0

... and then we have to wait until we get an interrupt. Here it comes:

libertas_cs enter (INT): if_cs_interrupt():249
##inw 00000022<0008
##outw 00000022>0008
libertas enter (INT): lbs_interrupt():1464
libertas thread (INT): lbs_interrupt: intcounter=0
libertas leave (INT): lbs_interrupt():1472
libertas thread: main-thread 222 (waking up): intcounter=1 currenttxskb=00000000 dnld_sent=2
libertas thread: main-thread 333: intcounter=1 currenttxskb=00000000 dnld_sent=2
libertas_cs enter: if_cs_get_int_status():650

Read the int cause (IF_CS_C_S_CMD_UPLD_RDY) and clear it:

##inw 00000022<0000
##outw 00000022>0000

Forgot about this now:

##inw 00000020<000d
libertas_cs enter: if_cs_receive_cmdres():357
##inw 00000020<000d


Read the data back (e.g. MAC adress of the card etc):

##inw 00000030<0036
##insw 00000012<(0x1b words)
libertas_cs leave: if_cs_receive_cmdres():382, ret 0, len 46
libertas_cs leave: if_cs_get_int_status():684, ret 0, ireg 0xd, hisregcpy 0x0
libertas thread: main-thread 444: intcounter=0 currenttxskb=00000000 dnld_sent=0
libertas thread: main-thread: cmd response ready
libertas enter: lbs_process_rx_command():473
libertas cmd: CMD_RESP: response 0x8003, seq 2, size 46, jiffies 578632
libertas CMD_RESP: 03 80 2e 00 02 00 00 00 02 00 13 02 08 00 40 00
libertas CMD_RESP: 00 16 41 72 f6 a8 40 30 01 00 10 00 05 00 00 00
libertas CMD_RESP: 00 00 00 00 00 00 00 00 00 00 03 03 00 00
libertas leave: lbs_process_rx_command():625, ret 0
libertas enter: lbs_execute_next_command():1744
libertas leave: lbs_execute_next_command():1879



So, basically you don't get an interrupt. MAYBE it's
because of the PCMCIA subsystem (your kernel is way older).
Be my guest to look into if_cs_probe(), this is where this
happens.

For me, the PCMCIA stuff was a little opaque. Part of the
code I wrote by looking at other drivers, part by trying
and part by peeking into drivers/pcmcia/cs.c, ds.c, etc.



More information about the libertas-dev mailing list