[Prism54-devel] Re: [PATCH] for freemac

Sebastien sebastien.bourdeauducq at gmail.com
Wed Oct 5 11:55:11 UTC 2005


> Hmm. PCI hw does dma writes to main memory of my PC,
> but where does it write to in USB case?
> To NET2280 registers?

Yes. The official firmware fills the endpoint FIFO by sending data over 
DMA to its address (see NET2280 specs, available from www.netchip.com), 
then it flushes the FIFO by writing to registers, making the NET2280  
emit the URB.

> In PCI world it works (at least for my PCI card).
> Here is a freemac+7.patch:
>
> FreeMAC > mw 0x20000 0x88888888 0x20
> 0002007c
> FreeMAC > mr 0x20000 0x20
> 00020000: 88888888 88888888 88888888 88888888
> 00020010: 88888888 88888888 88888888 88888888
> 00020020: 88888888 88888888 88888888 88888888
> 00020030: 88888888 88888888 88888888 88888888
> 00020040: 88888888 88888888 88888888 88888888
> 00020050: 88888888 88888888 88888888 88888888
> 00020060: 88888888 88888888 88888888 88888888
> 00020070: 88888888 88888888 88888888 88888888
> FreeMAC > dmaw 4 0x10
> dma status:00000003
> FreeMAC > dmar 0 0x20
> 00000000: 00000001 88888888 88888888 88888888

Why do you get 00000001 instead of 88888888 ? This looks like the same 
problem as I have...

> They simply did not happen for me. I saw DMA rx/tx bits set in
> 'enable IRQ' register, but they never appeared in 'trigger IRQ'
> reg.

Did they appear in the unmasked event register for IRQs ?
>
> void event_handle(unsigned events)
> {
>         if (events & ISL38XX_EVENT_HOST) host_interrupt_recv();
>         if (events & ISL38XX_EVENT_TXDMA) {
>                 event_disable(ISL38XX_EVENT_TXDMA, 1);
>                 uartpci_sendstr_nonblock("txdma complete\r\n");
>         }
>         if (events & ISL38XX_EVENT_RXDMA) {
>                 event_disable(ISL38XX_EVENT_RXDMA, 1);
>                 uartpci_sendstr_nonblock("rxdma complete\r\n");
>         }
> }
>
> Maybe my code is suboptimal. 

We probably need to rewrite all this anyway. I think we should do 
something like that :
- when you receive a DATA IRQ, do a blocking DMA (in interrupt handler) 
to retreive a small header containing the size of the frame we want to 
handle
- send a DMA RX request for the full frame, and leave interrupt handler
- when you get the DMA IRQ for the full frame, queue it somewhere for 
the main firmware loop to handle it (I think the addresses we must send 
to the official firmware are related to a similar system...)

Do you have any improvements for this system ? And what's the best way 
to "queue" frame ? Perhaps we should handle frames one by one (ie. only 
poll for new frames once the former has been processed) ?

> However, I found prism54usb a bit too big for
> my purposes. For one, I think we should not
> waste time trying to implement "mgmt" stuff
> present in official firmware. Too damn complicated
> to do in fw. But large part of prism54usb
> is dealing exactly with that stuff.

The "mgmt stuff" is in fact the raw reading of the serial EEPROM 
connected to the ISL38xx chip. This EEPROM stores information about the 
device (how to interface the radio, MAC address, ...)
We have to implement this if we want FreeMAC to do networking.

FullMAC parses the EEPROM and the driver doesn't have to care about it 
at all. With SoftMAC, the driver must request dumps of the EEPROM, 
block per block, reassemble them, parse the EEPROM contents and act 
accordingly.
What should we do in FreeMAC ?

It's also time to define protocol frames' structure.

Regards,
Sebastien


More information about the Prism54-devel mailing list