[PATCH] libertas: More endianness fixes.
authorDavid Woodhouse <dwmw2@infradead.org>
Sat, 26 May 2007 03:38:14 +0000 (23:38 -0400)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 11 Jun 2007 18:28:45 +0000 (14:28 -0400)
Now it at least manages to load the firmware.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/libertas/if_usb.c
drivers/net/wireless/libertas/if_usb.h

index b544fcdcd0e739da98e9428372a2710765dd4578..998317571ec26cdc3b97342b2da376a0d2f2561f 100644 (file)
@@ -313,7 +313,7 @@ static int if_prog_firmware(wlan_private * priv)
 
        /*
        lbs_deb_usbd(&cardp->udev->dev,
-                   "Data length = %d\n", fwdata->fwheader.datalength);
+                   "Data length = %d\n", le32_to_cpu(fwdata->fwheader.datalength));
        */
 
        cardp->fwseqnum = cardp->fwseqnum + 1;
@@ -332,7 +332,7 @@ static int if_prog_firmware(wlan_private * priv)
                memcpy(cardp->bulk_out_buffer, fwheader, FW_DATA_XMIT_SIZE);
                usb_tx_block(priv, cardp->bulk_out_buffer, FW_DATA_XMIT_SIZE);
 
-       } else if (fwdata->fwheader.dnldcmd == FW_HAS_LAST_BLOCK) {
+       } else if (fwdata->fwheader.dnldcmd == cpu_to_le32(FW_HAS_LAST_BLOCK)) {
                /*
                lbs_deb_usbd(&cardp->udev->dev,
                            "Host has finished FW downloading\n");
index 3ed46a33fd214bb840fc6987a0239d4852be2f66..156bb485e1a6f9929ec0b668815bc54c0974471a 100644 (file)
@@ -100,7 +100,7 @@ struct fwsyncheader {
 #define FW_HAS_LAST_BLOCK              0x00000004
 
 #define FW_DATA_XMIT_SIZE \
-       sizeof(struct fwheader) + fwdata->fwheader.datalength + sizeof(u32)
+       sizeof(struct fwheader) + le32_to_cpu(fwdata->fwheader.datalength) + sizeof(u32)
 
 int usb_tx_block(wlan_private *priv, u8 *payload, u16 nb);
 void if_usb_free(struct usb_card_rec *cardp);