]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/net/wireless/libertas/fw.c
Merge branch 'for-linus' of git://git.o-hand.com/linux-rpurdie-backlight
[linux-2.6-omap-h63xx.git] / drivers / net / wireless / libertas / fw.c
index eea18725bb903efa6aa0718ce60e2f279042f420..2dc84ff7a54ac4b574f6c82915d187abaf37deaf 100644 (file)
@@ -19,7 +19,7 @@
  */
 static int check_fwfile_format(u8 *data, u32 totlen)
 {
-       u bincmd, exit;
+       u32 bincmd, exit;
        u32 blksize, offset, len;
        int ret;
 
@@ -27,8 +27,10 @@ static int check_fwfile_format(u8 *data, u32 totlen)
        exit = len = 0;
 
        do {
-               bincmd = *data;
-               blksize = *(u32*)(data + offsetof(struct fwheader, datalength));
+               struct fwheader *fwh = (void *)data;
+
+               bincmd = le32_to_cpu(fwh->dnldcmd);
+               blksize = le32_to_cpu(fwh->datalength);
                switch (bincmd) {
                case FW_HAS_DATA_TO_RECV:
                        offset = sizeof(struct fwheader) + blksize;
@@ -72,13 +74,12 @@ static int wlan_setup_station_hw(wlan_private * priv, char *fw_name)
 
        if ((ret = request_firmware(&priv->firmware, fw_name,
                                    priv->hotplug_device)) < 0) {
-               lbs_pr_err("request_firmware() failed with %#x\n",
-                      ret);
+               lbs_pr_err("request_firmware() failed with %#x\n", ret);
                lbs_pr_err("firmware %s not found\n", fw_name);
                goto done;
        }
 
-       if(check_fwfile_format(priv->firmware->data, priv->firmware->size)) {
+       if (check_fwfile_format(priv->firmware->data, priv->firmware->size)) {
                release_firmware(priv->firmware);
                goto done;
        }
@@ -201,6 +202,7 @@ static void wlan_init_adapter(wlan_private * priv)
        adapter->prescan = 1;
 
        memset(&adapter->curbssparams, 0, sizeof(adapter->curbssparams));
+       adapter->curbssparams.channel = DEFAULT_AD_HOC_CHANNEL;
 
        /* PnP and power profile */
        adapter->surpriseremoved = 0;