diff options
author | David Woodhouse <dwmw2@infradead.org> | 2007-05-25 23:36:54 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2007-06-11 14:28:45 -0400 |
commit | 981f187b7c4b237011d4175cae0120d5d203c0fd (patch) | |
tree | b4508fc33a9aed0177c18c3a4db5c4e500fdb646 /drivers/net/wireless/libertas/fw.c | |
parent | 123e0e044091ca35a4766b38ae15032f2d41bcd6 (diff) |
[PATCH] libertas: first pass at fixing up endianness issues
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/libertas/fw.c')
-rw-r--r-- | drivers/net/wireless/libertas/fw.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/net/wireless/libertas/fw.c b/drivers/net/wireless/libertas/fw.c index 5463ee618a1..2dc84ff7a54 100644 --- a/drivers/net/wireless/libertas/fw.c +++ b/drivers/net/wireless/libertas/fw.c @@ -19,7 +19,7 @@ */ static int check_fwfile_format(u8 *data, u32 totlen) { - u8 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; } |