Subject: Re: 10/100 ethernet cards - followup (fxp FIX)
To: Ben Harris <bjh21@cam.ac.uk>
From: Sanjay Lal <sanjayl@iqmail.net>
List: port-macppc
Date: 05/04/2000 07:52:52
Ben Harris wrote:

> In article <v0313030bb5369938f64c@[128.84.235.163]> you write:
> >Before I add to the FAQ, let me just make sure I've got it all straight:
>
> A small discovery from me (I'll send-pr this when I get a chance):
>
> Intel 82557-based card (fxp) wedges machine on ifconfig up (only tested
> once) in -current.
>
> --
> Ben Harris

Hmm, I must have forgotten to submit this fix for the fxp driver. Here it
goes (sorry
I dont have the diffs.

In -current the file in question is .../dev/ice/i82557.c  In both cases the
bug
is a endian issue. The driver issued a command to the chip and polls
a bit waiting for it to complete. however due to the endian swap, the wrong
bit is polled, and the kernel hangs an in infinite while loop.  I have
added the htole16() call whithin the while loop.

Regards and thanks
Sanjay Lal
Redback Networks

------------------fxp FIX---------------------------------------

In function fxp_mc_setup().
 /* ...and wait for it to complete. */
   1897         do {
   1898                 FXP_CDMCSSYNC(sc,
   1899                     BUS_DMASYNC_POSTREAD|BUS_DMASYNC_POSTWRITE);
   1900         } while ((htole16(mcsp->cb_status) & FXP_CB_STATUS_C) == 0);

And fxp_init()

   1415         do {
   1416                 FXP_CDCONFIGSYNC(sc,
   1417                     BUS_DMASYNC_POSTREAD|BUS_DMASYNC_POSTWRITE);
   1418         } while ((htole16(cbp->cb_status) & FXP_CB_STATUS_C) == 0);