Subject: Re: Anyone using a "NIC" from thinknic.com?
To: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
From: Jason R Thorpe <thorpej@zembu.com>
List: port-i386
Date: 08/11/2000 07:43:48
On Fri, Aug 11, 2000 at 01:33:26PM +0900, Izumi Tsutsui wrote:
> My macppc requires more extra delay()s in sip_set_filter()
> to make Rx filter work correctly, but I think it is a different
> problem from yours.
Oh, foo. Please commit this patch and pull it up to netbsd-1-5. This
is an obvious oversight on my part (I should know better than to write
un-time-bounded loops :-)
> ---
> Izumi Tsutsui
> tsutsui@ceres.dti.ne.jp
>
> --- if_sip.c.orig Sat May 13 19:42:55 2000
> +++ if_sip.c Fri Aug 11 13:23:34 2000
> @@ -264,6 +264,8 @@
> SIP_CDRXSYNC((sc), (x), BUS_DMASYNC_PREREAD|BUS_DMASYNC_PREWRITE); \
> } while (0)
>
> +#define SIP_TIMEOUT 1000
> +
> void sip_start __P((struct ifnet *));
> void sip_watchdog __P((struct ifnet *));
> int sip_ioctl __P((struct ifnet *, u_long, caddr_t));
> @@ -1328,14 +1330,16 @@
>
> bus_space_write_4(st, sh, SIP_CR, CR_RST);
>
> - for (i = 0; i < 1000; i++) {
> - if ((bus_space_read_4(st, sh, SIP_ISR) &
> - (ISR_TXRCMP|ISR_RXRCMP)) == (ISR_TXRCMP|ISR_RXRCMP))
> - return;
> + for (i = 0; i < SIP_TIMEOUT; i++) {
> + if ((bus_space_read_4(st, sh, SIP_CR) & CR_RST) == 0)
> + break;
> delay(2);
> }
>
> - printf("%s: reset failed to complete\n", sc->sc_dev.dv_xname);
> + if (i == SIP_TIMEOUT)
> + printf("%s: reset failed to complete\n", sc->sc_dev.dv_xname);
> +
> + delay(1000);
> }
>
> /*
>
--
-- Jason R. Thorpe <thorpej@zembu.com>