[PATCH] Flash download works!!!

Jouni Malinen jkmaline at cc.hut.fi
Sun Apr 13 21:50:02 EDT 2003


On Sun, Apr 13, 2003 at 08:04:04PM -0400, Pavel Roskin wrote:

> The problem with flash download appears to lie in the userspace.  When
> dumping the actual data written to the card, I have found that the data is
> different from the data written by prism2dl.  It was shifted by 4 bytes.
> 
> It turned out that the wrong data comes from the prism2_srec.  Function
> combine_info() moves data in the wrong direction when it prepends the
> checksum.

Doh.. What a silly bug. I had one dead card waiting for resurrection so
that I could start debugging this at some point. Thank you for making
this unnecessary ;-). Patch applied to prism2_srec.

> The patch for firmware download is also attached, but it needs some work.
> The card cannot be reset after download, so prism2_srec reports an error.
> It's sufficient to eject and insert the card to see the new firmware.
> Also, maxtimeout needs to be used in hfa384x_cmd_wait(), and it should be
> done in a more graceful way.  At least this patch doesn't kill the card.

Your version of non-volatile downloading code is quite similar to the
one I used in testing. I included extra code for comparing the images
after downloading, but that seemed to be the only major difference.
Anyway, since your code has been tested more, I included it into the CVS
version of Host AP driver. I modified the patch a bit (I just hate long
lines ;-)) and added it into the CVS version of Host AP driver. This
being still quite experimental and untested code, I left it commented
out in the default build. It can be enabled by defining
PRISM2_NON_VOLATILE_DOWNLOAD.

Note for others: At the moment, I do not recommend testing this code
unless you are able to reflash dead cards or can afford to lose some
cards.. ;-). I will uncomment the code in default version after it has
been thoroughly tested.


I would hope that COR sreset could be enough to get the card running
after non-volatile download. I haven't yet tested this, but will start
testing after I can reflash my test card.


> If we want to update primary firmware in the flash, prism2_srec should be
> able to process primary and secondary firmware in one operation.  Flashing
> only primary firmware makes the card unusable.  This was tested both with
> prism2dl and prism2_srec.

I would assume that combined download of PRI&STA would be needed also
for updated primary to RAM. However, this seems to require something
more, since usually I just end up either crashing the card or updating
only STA firmware. With non-volatile upload, combining images should be
easier since there will not be multiple start addresses to start from.

-- 
Jouni Malinen                                            PGP id EFC895FA



More information about the HostAP mailing list