[realtek] Re: autosense to halfduplex

Nikolai Vladychevski niko@isl.net.mx
Mon Jan 14 14:33:02 2002


Donald Becker writes: 

> On Fri, 11 Jan 2002, Nikolai Vladychevski wrote: 
> 
>> when I buy a realtek card, it is alaways configured to autosense the media, 
>> and when it autosenses a hub that can do full duplex it is set to it. I want 
>> it to autosense but always to enter half duplex mode, is this possible? 
> 
> Terminology:
>    autosense:
>      Select 10baseT or 100baseTx based on the partner's link
>      beat signal.  The link should always be set to half duplex.
>    autonegotiation:
>      The link partners negotiate the highest common capability.
>      The communication takes place on the 10baseT link beat bits.
>      This is the only standards-conforming way to use full duplex on
>      twisted pair.
>      If no common capability is negotiated, the link is not usable.
>      If autonegotiation does not complete (e.g. an pre-autonegotiation
>      link partner), the transceiver falls back to autosense. 
> 

ok, but why then if I write with rtl8139-diag one of this values, 
rtl8139-diag -F Autosense -w or rtl8139-diag -F Autonegotiate -w the value 
is the same, it is 0xe113 ? Is this correct? I expected a different value. 

> Autonegotiation is described at
>   http://scyld.com/expert/NWay.html 
> 
> The answer you are looking for is to advertise only half duplex
> capabilities.  You can do this with
>    mii-diag eth0 -A 0x00A0 
> 
> This advertises 10baseT-HD and 100baseTx-HD only. 
> 
> I'll explain the (admittedly obscure) constant
>    0x0100  100baseTx-FD
>    0x0080  100baseTx-HD
>    0x0040  10baseT-FD
>    0x0020  10baseT-HD 
> 
>    0x0001  Ethernet (always set in the report) 
> 
> Normally you could use a text name such as
>    mii-diag -A 100baseTx-FD
> but I didn't put in text names for all of the possible combinations.   
> 

it doesn't work for me as expected: 

bash-2.04# mii-diag eth0 -A 0x00A0
Setting the media capability advertisement register of PHY #32 to 0x00a1.
Basic registers of MII PHY #32:  0000 0000 0000 0000 0000 0000 0000 0000.
Basic mode control register 0x0000: Auto-negotiation disabled, with
Speed fixed at 10 mbps, half-duplex.
Basic mode status register 0x0000 ... 0000.
  Link status: not established.
Link partner information is not exchanged when in fixed speed mode.
  End of basic transceiver information. 

bash-2.04# mii-diag eth0 -A 0x0080
Setting the media capability advertisement register of PHY #32 to 0x0081.
Basic registers of MII PHY #32:  0000 0000 0000 0000 0000 0000 0000 0000.
Basic mode control register 0x0000: Auto-negotiation disabled, with
Speed fixed at 10 mbps, half-duplex.
Basic mode status register 0x0000 ... 0000.
  Link status: not established.
Link partner information is not exchanged when in fixed speed mode.
  End of basic transceiver information. 

bash-2.04#
bash-2.04# mii-diag eth0 -A 10baseT-HD
Setting the media capability advertisement register of PHY #32 to 0x0021.
Basic registers of MII PHY #32:  0000 0000 0000 0000 0000 0000 0000 0000.
Basic mode control register 0x0000: Auto-negotiation disabled, with
Speed fixed at 10 mbps, half-duplex.
Basic mode status register 0x0000 ... 0000.
  Link status: not established.
Link partner information is not exchanged when in fixed speed mode.
  End of basic transceiver information. 

bash-2.04# 

As you can see, it says the speed is fixed at 10 mbps but when I see on the 
hub the light is on 100 mbps. 

I have a few questions, why do Basic registers of MII PHY  #32 do not change 
after executing the command? Also using numbers or text for paramter to -A 
does the same result. After executing mii-diag -A 10baseT-HD I reboot but it 
never enters into 10 mbits .... I don't know if there any problem with the 
utils, the rtl8139-diag shows this for both nic cards:
bash-2.04# rtl-diag -ee
rtl8139-diag.c:v2.04 8/08/2001 Donald Becker (becker@scyld.com)
http://www.scyld.com/diag/index.html
Index #1: Found a RealTek RTL8139 adapter at 0x2100.
Decoded EEPROM contents:
  PCI IDs -- Vendor 0x10ec, Device 0x8139.
  PCI Subsystem IDs -- Vendor 0x10ec, Device 0x8139.
  PCI timer settings -- minimum grant 32, maximum latency 64.
 General purpose pins --  direction 0xe1  value 0x13.
 Station Address 00:48:54:1F:8E:E3.
 Configuration register 0/1 -- 0x8d / 0xc2.
EEPROM active region checksum is 09ec.
EEPROM contents (64 words):
0x00:  8129 10ec 8139 10ec 8139 4020 e113 4800
0x08:  1f54 e38e 8d10 f7c2 8801 43b9 b0f2 031a
0x10:  df43 8a36 df43 8a36 43b9 b0f2 1111 1111
0x18:  0000 0000 0000 0000 0000 0000 0000 0000
0x20:  0000 0000 0000 0000 0000 0000 0000 0000
0x28:  0000 0000 0000 0000 0000 0000 0000 0000
0x30:  0000 0000 0000 0000 0000 0000 0000 0000
0x38:  0000 0000 0000 0000 0000 0000 0000 0000
Index #2: Found a RealTek RTL8139 adapter at 0x2300.
Decoded EEPROM contents:
  PCI IDs -- Vendor 0x10ec, Device 0x8139.
  PCI Subsystem IDs -- Vendor 0x10ec, Device 0x8139.
  PCI timer settings -- minimum grant 32, maximum latency 64.
 General purpose pins --  direction 0xe1  value 0x13.
 Station Address 00:D0:09:D0:30:D1.
 Configuration register 0/1 -- 0x8d / 0xc2.
EEPROM active region checksum is 0a6e.
EEPROM contents (64 words):
0x00:  8129 10ec 8139 10ec 8139 4020 e113 d000
0x08:  d009 d130 8d14 f7c2 8801 43b9 b0f2 0311
0x10:  df43 8a3e ef83 4d26 8389 b0fa 4848 4848
0x18:  0000 4852 0000 0000 0000 0000 0000 0000
0x20:  0000 0000 0000 0000 0000 0000 0000 0000
0x28:  0000 0000 0000 0000 0000 0000 0000 0000
0x30:  0000 0000 0000 0000 0000 0000 0000 0000
0x38:  0000 0000 0000 0000 0000 0000 0000 0000
bash-2.04# 


Thanks in advance
Nikolai