[PR 17] GRETH: Fixed autonego timeout overflow problem

Gedare Bloom gedare at rtems.org
Mon Feb 6 16:13:30 UTC 2012


This is filed at PR1465 and looks good.

On Mon, Feb 6, 2012 at 9:15 AM, Daniel Hellstrom <daniel at gaisler.com> wrote:
> Signed-off-by: Daniel Hellstrom <daniel at gaisler.com>
> ---
>  c/src/libchip/network/greth.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/c/src/libchip/network/greth.c b/c/src/libchip/network/greth.c
> index aff4d0f..b0e70b4 100644
> --- a/c/src/libchip/network/greth.c
> +++ b/c/src/libchip/network/greth.c
> @@ -339,7 +339,7 @@ greth_initialize_hardware (struct greth_softc *sc)
>             while (!(((phystatus = read_mii(phyaddr, 1)) >> 5) & 1)) {
>                     if ( rtems_clock_get_tod_timeval(&tnow) != RTEMS_SUCCESSFUL )
>                       printk("rtems_clock_get_tod_timeval failed\n\r");
> -                    msecs = (tnow.tv_sec-tstart.tv_sec)*1000+(tnow.tv_usec-tstart.tv_usec)/1000;
> +                    msecs = (int)(tnow.tv_sec-tstart.tv_sec)*1000+((int)tnow.tv_usec-(int)tstart.tv_usec)/1000;
>                     if ( msecs > GRETH_AUTONEGO_TIMEOUT_MS ){
>                             sc->auto_neg_time = msecs;
>                             sc->auto_neg = -1; /* Failed */
> --
> 1.7.0.4
>
> _______________________________________________
> rtems-devel mailing list
> rtems-devel at rtems.org
> http://www.rtems.org/mailman/listinfo/rtems-devel




More information about the devel mailing list