Firmware download functions

Dan Williams dcbw at redhat.com
Tue Jun 5 12:01:19 EDT 2007


On Tue, 2007-06-05 at 17:09 +0200, Holger Schurig wrote:
> Hi everybody !
> 
> In my current code, I can sucessfully download the helper image 
> and normal firmware image. That's all done in 160 lines of code.
> 
> However, my firmware images are just "flat" files, e.g. files 
> without the fwheader or FWData internal structure. Therefore I 
> wasn't using the functions provided by fw.c.
> 
> On the other side, I cannot just ignore fw.c, because it does 
> many things besides downloading the firmware. For example:
> 
> 
> libertas_init_fw()
> - allocates and initializes wlan_adapter
> - does something with some command timer which I don't really
>   understand yet
> - calls wlan_setup_station_hw(), which downloads the firmware
> - does some 802.11d initialization
> 
> However, even wlan_setup_station_hw() does other things besides 
> downloading the firmware:
> 
> - request the firmware
> - check the firmware format
> - call priv->hw_prog_firmware() to download the firmware
> - release firmware
> - initialized adapter->current_addr
> - read the hardware spec
> - read the current rate
> 
> 
> As a start, the check for the format should be put into if_usb.c, 
> simply because I have a very different format of my firmware.
> 
> Also, it won't really help me if I just request one firmware 
> file, I have two of them (ca. 2600 bytes for helper, ca. 96000 
> for firmware image). So this request/check thingy should go into 
> if_usb.c as well.
> 
> However, after this fw.c is empty of any firmware stuff. 
> Therefore I mandate to put the remaining functions into main.c. 
> Or to rename fw.c into adapter.c.
> 
> Thoughts?

Put them in main.c and lets git rid of fw.c.  The
wlan_adapter/wlan_private init stuff should be in main.c anyway, not in
fw.c.

Dan





More information about the libertas-dev mailing list