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

Liew Tsi Chung Tsi-chung.Liew at freescale.com
Wed Jun 25 21:58:13 CEST 2008


Sure.

> Do you provide a patch for those routines too? (if required)
Just the dm9000_rx_status_16bit(). Will re-submit with 8 and 32.

Regards,
TsiChung


-----Original Message-----
From: l.pinguin at gmail.com [mailto:l.pinguin at gmail.com] On Behalf Of Remy
Bohmer
Sent: Wednesday, June 25, 2008 2:50 PM
To: Liew Tsi Chung
Cc: U-Boot-Users; Rigby John; Ben Warren
Subject: Re: [U-Boot-Users] [PATCH] Fix dm9000 receive status and len
little endian issue

Hello Tsi-Chung,

> 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_16bit().

I can imagine that similar problems are also valid for the 32bit code
(and maybe the 8 bit code too) It is probably better to change those
other 2 routines too, to keep them all behave the same.
Do you provide a patch for those routines too? (if required)

Kind Regards,

Remy

>
> Signed-off-by: TsiChung Liew <Tsi-Chung.Liew at freescale.com>
> ---
>  drivers/net/dm9000x.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/dm9000x.c b/drivers/net/dm9000x.c index 
> 844fb76..2895344 100644
> --- a/drivers/net/dm9000x.c
> +++ b/drivers/net/dm9000x.c
> @@ -222,8 +222,8 @@ 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)
> --
> 1.5.4.1
>
>
> ----------------------------------------------------------------------
> --- Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for just about anything 
> Open Source.
> http://sourceforge.net/services/buy/index.php
> _______________________________________________
> U-Boot-Users mailing list
> U-Boot-Users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/u-boot-users
>




More information about the U-Boot mailing list