public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Ben Warren <biggerbadderben@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] [PATCH] Fix dm9000 receive status and len little endian issue
Date: Wed, 25 Jun 2008 10:00:59 -0700	[thread overview]
Message-ID: <486279CB.2060305@gmail.com> (raw)
In-Reply-To: <1214406118-15778-1-git-send-email-Tsi-Chung.Liew@freescale.com>

Hi Tsi-Chung,

Tsi-Chung Liew wrote:
> From: TsiChung Liew <Tsi-Chung.Liew@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@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
>  }
>  
Instead of adding yet another kludgy CONFIG option, please consider 
changing the accessors to le16_to_cpu() or whatever is appropriate.  The 
definitions of DM9000_inX() are not very portable as it is and we should 
be striving to make the code better, not worse.

regards,
Ben

  reply	other threads:[~2008-06-25 17:00 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-25 15:01 [U-Boot-Users] [PATCH] Fix dm9000 receive status and len little endian issue Tsi-Chung Liew
2008-06-25 17:00 ` Ben Warren [this message]
  -- strict thread matches above, loose matches on Subject: below --
2008-06-25 19:42 Tsi-Chung Liew
2008-06-25 19:50 ` Remy Bohmer
2008-06-25 19:58   ` Liew Tsi Chung
2008-06-25 20:48 Tsi-Chung Liew
2008-06-25 21:01 ` Ben Warren
2008-06-25 21:48   ` Liew Tsi Chung
2008-07-01 17:45   ` Liew Tsi Chung
2008-07-01 18:03     ` Ben Warren
2008-07-02  7:17 ` Ben Warren

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=486279CB.2060305@gmail.com \
    --to=biggerbadderben@gmail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox