[U-Boot-Users] [PATCH] Fix dm9000 receive status and len little endian issue

Tsi-Chung Liew Tsi-Chung.Liew at freescale.com
Wed Jun 25 17:01:58 CEST 2008


From: TsiChung Liew <Tsi-Chung.Liew at freescale.com>

The received status and len was in little endian
format and caused the ethernet unable to proceed
further. Add define CFG_DM9000_BYTESWAP_STATUS_LEN in
dm9000_rx_status_16bit() to byte swap RxStatus and RxLen

Signed-off-by: TsiChung Liew <Tsi-Chung.Liew at freescale.com>
---
 drivers/net/dm9000x.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/net/dm9000x.c b/drivers/net/dm9000x.c
index 844fb76..eff676c 100644
--- a/drivers/net/dm9000x.c
+++ b/drivers/net/dm9000x.c
@@ -224,6 +224,10 @@ static void dm9000_rx_status_16bit(u16 *RxStatus, u16 *RxLen)
 
 	*RxStatus = DM9000_inw(DM9000_DATA);
 	*RxLen = DM9000_inw(DM9000_DATA);
+#ifdef CFG_DM9000_BYTESWAP_STATUS_LEN
+	*RxStatus = __sw16(*RxStatus);
+	*RxLen = __sw16(*RxLen);
+#endif
 }
 
 static void dm9000_rx_status_8bit(u16 *RxStatus, u16 *RxLen)
-- 
1.5.4.1





More information about the U-Boot mailing list