[U-Boot] [PATCH] net: e1000: Fix packet length conversion

Miao Yan yanmiaobest at gmail.com
Thu Jan 7 02:43:45 CET 2016


Hi Lian,

2016-01-06 16:41 GMT+08:00 Minghuan Lian <Minghuan.Lian at nxp.com>:
> The length of the receiving packet descriptor is a 16bit integer
> not 32bit. le32_to_cpu should be replaced by le16_to_cpu to
> make the correct conversion. Otherwise, e1000 cannot work on
> some kinds of big-endian platform.


This is a duplication of

https://patchwork.ozlabs.org/patch/559472/



>
> Signed-off-by: Minghuan Lian <Minghuan.Lian at nxp.com>
> ---
>  drivers/net/e1000.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/e1000.c b/drivers/net/e1000.c
> index 2ba03ed..e3c6916 100644
> --- a/drivers/net/e1000.c
> +++ b/drivers/net/e1000.c
> @@ -5169,7 +5169,7 @@ _e1000_poll(struct e1000_hw *hw)
>                 return 0;
>         /* DEBUGOUT("recv: packet len=%d\n", rd->length); */
>         /* Packet received, make sure the data are re-loaded from RAM. */
> -       len = le32_to_cpu(rd->length);
> +       len = le16_to_cpu(rd->length);
>         invalidate_dcache_range((unsigned long)packet,
>                                 (unsigned long)packet +
>                                 roundup(len, ARCH_DMA_MINALIGN));
> --
> 1.9.1
>
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot


More information about the U-Boot mailing list