[vortex-bug] Minor bug in 3c59x driver in 2.4.0-test8 ???

Lance Stringham stringhaml@home.com
Mon, 11 Sep 2000 13:24:07 -0700


This is the initialization message from /var/log/messages from before I
made the change in the driver at debug level 2.

kernel: eth0: 3Com PCI 3c905B Cyclone 100baseTx at 0x1000, 
00:10:4b:d0:f6:dd, IRQ 11
kernel: Full duplex capable
kernel:   8K byte-wide RAM 5:3 Rx:Tx split, autoselect/Autonegotiate
interface.
kernel:   Media override to transceiver type 8 (Autonegotiate).
kernel:   MII transceiver found at address 24, status 786d.
kernel:   MII transceiver found at address 0, status 786d.
kernel: 3c59x: Wake-on-LAN functions disabled
kernel:   Enabling bus-master transmits and whole-frame receives.
kernel: eth1: 3Com PCI 3c900 Cyclone 10Mbps TPO at 0x1080, 
00:50:04:12:80:ca, IRQ 10
kernel: Full duplex capable
kernel:   8K byte-wide RAM 5:3 Rx:Tx split, autoselect/Autonegotiate
interface.
kernel:   Media override to transceiver type 8 (Autonegotiate).
kernel:   MII transceiver found at address 24, status 182d.
kernel: 3c59x: Wake-on-LAN functions disabled
kernel:   Enabling bus-master transmits and whole-frame receives.
kernel: eth0: Media override to transceiver 8 (Autonegotiate).
kernel: eth0: MII #24 status 786d, link partner capability 0080, setting
half-duplex.
kernel: eth1: Media override to transceiver 8 (Autonegotiate).
kernel: eth1: MII #24 status 182d, link partner capability 0020, setting
half-duplex.

As you can see it correctly identifies the networks as being half duplex
networks and tries to set the cards to half duplex, but when I looked at
the card settings using the vortex-diag program from Donald Beckers
website, it said the cards were still in full duplex mode. I then tried
using full_duplex=0,0 to force the cards to half duplex but that didn't
seem to work either. Anyways, not being familiar with the driver code,
that was the quickest fix I could come up with, I didn't know if it was
the *right* fix, but it's working for now. I hope all this helps!

Lance Stringham
stringhaml@home.com

PS. please direct any responses directly to me since I am not list.

Andrew Morton wrote:
> 
> Bogdan Costescu wrote:
> >
> > On Sun, 10 Sep 2000, Lance Stringham wrote:
> >
> > > /* Set the full-duplex bit. */
> > > outw( ((vp->info1 & 0x8000) || vp->full_duplex ? 0x20 : 0) |
> >
> > I assume you talk about this ^^^^.
> >
> > > Shouldn't it be an && instead of an || ? I tried changing it to && and
> > > now I don't seem to have any problems changing the duplex mode to
> > > whatever I need.
> >
> > It should be ||. There are 2 ways of setting the full duplex mode: if the
> > card supports it (which is located in info1) and if the users forces it
> > (through full_duplex, although full_duplex is modified in several places).
> > So the logic is that if either the card supports it or the user forces it,
> > it should be enabled. If you modify this to be && and it works to
> > _force_ it, it means that your info1 does not contain the full duplex
> > info.
> 
> Actually, Lance wants to force *HALF* duplex, ignoring the EEPROM
> settings.
> 
> There are two ways to force duplex:
> 
> One is to set bit 9 of the `options' parameter.  This only allows you to
> force full duplex.
> 
> The other is to use `full_duplex=1,0,-1'.
> 
> The second way _should_ allow you to force half-duplex: if you use
> `full_duplex=0' then this should set `vp->full_duplex = 1' and
> `vp->medialock = 1'.  (In the 2.4 driver, medialock is called force_fd).
> 
> But from my reading of the 2.4 driver and of Donald's 0.99Ra, this is
> not coded correctly. It should be something like:
> 
> --- don-Qi-3c59x.c.orig Tue Sep 12 00:51:50 2000
> +++ don-Qi-3c59x.c      Tue Sep 12 00:52:09 2000
> @@ -791,11 +791,10 @@
>                 vp->full_duplex = 0;
>                 vp->bus_master = 0;
>         }
> -       if (find_cnt < MAX_UNITS  &&  full_duplex[find_cnt] > 0)
> +       if (find_cnt < MAX_UNITS  &&  full_duplex[find_cnt] >= 0) {
>                 vp->full_duplex = 1;
> -
> -       if (vp->full_duplex)
>                 vp->medialock = 1;
> +       }
>         vp->options = option;
> 
>         /* Read the station address from the EEPROM. */
> 
> and something similar in the 2.4 driver.
> 
> Lance's proposed change will work for him, but kinda accidentally.
> 
> Drat.
> 
> I think I'd prefer to leave this as a known issue for 2.4.0 and clean
> this stuff up (and do some resyncing with Don) in 2.4.1.  We should be
> trying to restrain ourselves to "critical" things for 2.4.0, although
> this doesn't seem to be happening :(
> 
> > If you have a hub (which does not support full-duplex), the card should be
> > able to autonegotiate half duplex. What is the initialization message from
> > the driver (from /var/log/messages) ?
> >
> > Andrew: I think that something has to be done w.r.t. this. You are setting
> > the full duplex operation based on _both_ info1 and full_duplex, but set
> > flow control based only on full_duplex. IMHO, the info from info1 should
> > be incorporated in full_duplex and the test should be made afterwards only
> > on full_duplex.
> 
> Yes, you're right.