summaryrefslogtreecommitdiff
path: root/drivers/net/dm9000x.c
diff options
context:
space:
mode:
authorTsiChung Liew <Tsi-Chung.Liew@freescale.com>2008-06-25 15:48:52 -0500
committerBen Warren <biggerbadderben@gmail.com>2008-08-18 23:10:43 -0700
commit943b825bf15e6a28ac8328e0f6489478bceef1ea (patch)
treedfcfad1ce85dd05d5ed2c51f2f77f92c9a6632de /drivers/net/dm9000x.c
parentfcd69a1a57fb2af4d26201422095a4be9f36963e (diff)
downloadu-boot-imx-943b825bf15e6a28ac8328e0f6489478bceef1ea.zip
u-boot-imx-943b825bf15e6a28ac8328e0f6489478bceef1ea.tar.gz
u-boot-imx-943b825bf15e6a28ac8328e0f6489478bceef1ea.tar.bz2
Fix dm9000 receive status and len little endian issue
The received status and len was in little endian format and caused the ethernet unable to proceed further. Add __le16_to_cpu() in dm9000_rx_status_8/16/32bit(). Signed-off-by: TsiChung Liew <Tsi-Chung.Liew@freescale.com> Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
Diffstat (limited to 'drivers/net/dm9000x.c')
-rw-r--r--drivers/net/dm9000x.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/drivers/net/dm9000x.c b/drivers/net/dm9000x.c
index 844fb76..e7365fe 100644
--- a/drivers/net/dm9000x.c
+++ b/drivers/net/dm9000x.c
@@ -214,24 +214,28 @@ static void dm9000_rx_status_32bit(u16 *RxStatus, u16 *RxLen)
DM9000_outb(DM9000_MRCMD, DM9000_IO);
tmpdata = DM9000_inl(DM9000_DATA);
- *RxStatus = tmpdata;
- *RxLen = tmpdata >> 16;
+ *RxStatus = __le16_to_cpu(tmpdata);
+ *RxLen = __le16_to_cpu(tmpdata >> 16);
}
static void dm9000_rx_status_16bit(u16 *RxStatus, u16 *RxLen)
{
DM9000_outb(DM9000_MRCMD, DM9000_IO);
- *RxStatus = DM9000_inw(DM9000_DATA);
- *RxLen = DM9000_inw(DM9000_DATA);
+ *RxStatus = __le16_to_cpu(DM9000_inw(DM9000_DATA));
+ *RxLen = __le16_to_cpu(DM9000_inw(DM9000_DATA));
}
static void dm9000_rx_status_8bit(u16 *RxStatus, u16 *RxLen)
{
DM9000_outb(DM9000_MRCMD, DM9000_IO);
- *RxStatus = DM9000_inb(DM9000_DATA) + (DM9000_inb(DM9000_DATA) << 8);
- *RxLen = DM9000_inb(DM9000_DATA) + (DM9000_inb(DM9000_DATA) << 8);
+ *RxStatus =
+ __le16_to_cpu(DM9000_inb(DM9000_DATA) +
+ (DM9000_inb(DM9000_DATA) << 8));
+ *RxLen =
+ __le16_to_cpu(DM9000_inb(DM9000_DATA) +
+ (DM9000_inb(DM9000_DATA) << 8));
}
/*