summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorwdenk <wdenk>2005-02-04 15:38:08 +0000
committerwdenk <wdenk>2005-02-04 15:38:08 +0000
commitf8883cb101061c85c49cc1a3e68b890eab8ab118 (patch)
treebe46ea9e1e7ff03fa34be5a7ee341c64bf741456 /common
parent20a80418f9201f81b718aeb6c872b83bd8e929c0 (diff)
downloadu-boot-imx-f8883cb101061c85c49cc1a3e68b890eab8ab118.zip
u-boot-imx-f8883cb101061c85c49cc1a3e68b890eab8ab118.tar.gz
u-boot-imx-f8883cb101061c85c49cc1a3e68b890eab8ab118.tar.bz2
Fix byteorder problem in usbboot and scsiboot commands.
Diffstat (limited to 'common')
-rw-r--r--common/cmd_scsi.c4
-rw-r--r--common/cmd_usb.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/common/cmd_scsi.c b/common/cmd_scsi.c
index 062b1c9..61309f9 100644
--- a/common/cmd_scsi.c
+++ b/common/cmd_scsi.c
@@ -269,7 +269,7 @@ int do_scsiboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
hdr = (image_header_t *)addr;
- if (hdr->ih_magic == IH_MAGIC) {
+ if (ntohl(hdr->ih_magic) == IH_MAGIC) {
printf("\n** Bad Magic Number **\n");
return 1;
}
@@ -283,7 +283,7 @@ int do_scsiboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
}
print_image_hdr (hdr);
- cnt = (hdr->ih_size + sizeof(image_header_t));
+ cnt = (ntohl(hdr->ih_size) + sizeof(image_header_t));
cnt += info.blksz - 1;
cnt /= info.blksz;
cnt -= 1;
diff --git a/common/cmd_usb.c b/common/cmd_usb.c
index 3227db9..c6b5d14 100644
--- a/common/cmd_usb.c
+++ b/common/cmd_usb.c
@@ -387,7 +387,7 @@ int do_usbboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
hdr = (image_header_t *)addr;
- if (hdr->ih_magic != IH_MAGIC) {
+ if (ntohl(hdr->ih_magic) != IH_MAGIC) {
printf("\n** Bad Magic Number **\n");
return 1;
}
@@ -402,7 +402,7 @@ int do_usbboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
print_image_hdr (hdr);
- cnt = (hdr->ih_size + sizeof(image_header_t));
+ cnt = (ntohl(hdr->ih_size) + sizeof(image_header_t));
cnt += info.blksz - 1;
cnt /= info.blksz;
cnt -= 1;