[realtek] Forcing the speed on rtl8139 at boot
Dieter Jansen
dieter@tplex.com.au
Thu, 22 Feb 2001 17:25:36 +1030
Hi Folks,
I have been having problem for quite a while with a RH Linux 7.0
box with two rtl8139 cards in it. The box is supposed to be used
for IP accounting by sniffing on it's interfaces in promisc mode,
and for ages I couldn't work out why I was not seeing all of the
packets that I _knew_ were there.
The penny finally dropped when I realised that the traffic I was
missing was all between boxes interfaced with 10 MHz cards - if
either end of a conversation was at 100 MHz the sniffer would see
it! So I realised that I really didn't have a clue how my cheap
auto-sensing hub (an Acer 508d) works in this situation - seems
these things are not always just a "flat" hub.
Anyway, the easiest way to ensure I would see all packets was
to force the 100 MHz cards to 10 MHz. I had version rtl8139.c
v1.07, so I downloaded mii-diag.c version 2.00, and a:
mii-diag -F 10baseT eth0
mii-diag -F 10baseT eth1
seemed to do the trick, with all packets now visible.
Based on the sketchy info I could find on the web I tried to
make the change permanent with the following in modules.conf:
alias eth0 rtl8139
alias eth1 rtl8139
options rtl8139 full_duplex=1,0 options=0x40,0x40 debug=2
thinking that would let me check out full and half duplex at
10 MHz, however that's not quite what I got:
eth0: RealTek RTL8139 Fast Ethernet at 0xa800, IRQ 12, xx:xx
eth0: Media type forced to Full Duplex.
eth1: RealTek RTL8139 Fast Ethernet at 0xa400, IRQ 10, xx:xx
eth0: Setting 100mbps full-duplex based on auto-negotiated partner
ability 40a1.
eth0: rtl8129_open() ioaddr 0xa800 IRQ 12 GP Pins 00 full-duplex.
eth1: Setting 100mbps half-duplex based on auto-negotiated partner
ability 40a1.
eth1: rtl8129_open() ioaddr 0xa400 IRQ 10 GP Pins 00 half-duplex.
This suggest that the ful_duplex parameters worked, but that
the options values weren't right: well, they were just a
guess, really ;-)
I've looked at the source code a bit, but haven't been able to
sort out the correct value.
Any advice?
Please email me a copy of any replies, as I'm not subscribed
to the list.
Cheers, Dieter.
--
Dieter Jansen Tetraplex Pty Ltd
dieter@tplex.com.au http://www.tplex.com.au/