RE: ne2k and 0x378 lp ports

Riley Williams (rhw@MemAlpha.CX)
Wed, 21 Jul 1999 17:30:07 +0100 (GMT)


This message is in MIME format. The first part should be readable text,
while the remaining parts are likely unreadable without MIME-aware tools.
Send mail to mime@docserver.cac.washington.edu for more info.

--1421910094-1033117101-932574607=:7616
Content-Type: TEXT/PLAIN; charset=US-ASCII

Hi Randy, Alan.

Alan: Can you please forward this to whoever maintains the ne-isa
driver - I can't work out who that is...

> NE2000 uses base_io_addr thru base + 0x1f, but all registers in
> that range are not used.

> Base thru base + 0xf are ethernet controller registers. Base +
> 0x10 (16 bits) is a packet data transfer register. Base + 0x1f
> is a reset register.

Ah...16 bits! I hadn't realised that...patch fixed to deal with it...

> Some NE2000 adapters may alias the data transfer register and
> the reset register. Apparently yours does not do this...

Just a thought, but if the register at offset 0x10 is 16-bit, then the
addresses 0x10, 0x11 and 0x1F all need to be separately decoded, and
that essentially requires full decoding, with the faint possibility
that up to two of A1, A2 or A3 is not decoded - at least one of them
needs to be decoded to tell the difference between 0x11 and 0x1F.

I've developed a patch which deals with this situation, and I can
report that the resulting patched kernel is now in use on my systems,
and is working fine on all of them.

The patch is attached, and it has an analysis of the various
situations that may apply, and how it affects them, in the same file
in front of the patch. Here's the said summary...

1. This patch has no affect on the behaviour of the ne-pci driver.

2. This patch does not affect the behaviour of the ne-isa driver as
it applies to non-ISA-bus interfaces.

3. This patch does not affect the behaviour of the ne-isa driver if
the said driver is compiled as a module. Indeed, in this case,
the compiled driver code is unchanged.

4. This patch does not affect the behaviour of the ne-isa driver in
the case where the io address is provided by the user at boot time.

5. This patch does not affect the behaviour of the ne-isa driver in
the case where the entire 32-byte I/O address space is unclaimed
when this driver tries to initialise the port in question. The
full 32-byte region is still claimed by the driver.

6. This patch does not affect the behaviour of the ne-isa driver in
the case where any of the I/O ports at address offsets 0x00 to
0x10 inclusive, or at address offset 0x1F, are already claimed.
The driver will still refuse to auto-probe that address range in
the event that this is true.

7. This patch DOES affect the behaviour of the ISA-bus auto-probe in
the case where all of the I/O ports at address offsets 0x00 to
0x10, and at address offset 0x1F, are currently unclaimed, but
one or more of the I/O ports at address offsets 0x11 to 0x1E are
claimed. However, its application currently depends on a new
configuration option, which is fully documented.

In particular, the problem case that inspired this patch now works, as
do similar problem cases. The original is the following configuration:

a. An ne2000 clone ISA-bus network interface card is based at
io=0x360, and fully decodes all address lines for all ports.

b. The secondary IDE interface is in use, claiming port 0x376, as
well as claiming other ports not relevant to this case.

c. The printer interface based at io=0x378 is NOT present. If this
interface is present, the behaviour is unchanged as the I/O port
at address offset 0x1F has already been claimed, and case (6) of
the above description thus applies.

With the original code, the stated card configuration could not be
auto-probed.

On my system, this is the resulting /proc/ioports extract:

Q> 02f8-02ff : serial(auto)
Q> 0360-0371 : NE2000 <=== Main block.
Q> 0376-0376 : ide1
Q> 037f-037f : NE2000 <=== Reset port.
Q> 0388-038b : OPL3/OPL2

This implementation currently relies on a new configuration option as
I have not yet worked out all of the necessary logic to automatically
determine whether the card fully decodes the address bus. However,
when this logic is completed, this extra configuration option will
vanish and the detection will be fully automatic.

Best wishes from Riley.

+----------------------------------------------------------------------+
| There is something frustrating about the quality and speed of Linux |
| development, ie., the quality is too high and the speed is too high, |
| in other words, I can implement this XXXX feature, but I bet someone |
| else has already done so and is just about to release their patch. |
+----------------------------------------------------------------------+
* ftp://ftp.MemAlpha.cx/pub/rhw/Linux
* http://www.MemAlpha.cx/kernel.versions.html

--1421910094-1033117101-932574607=:7616
Content-Type: APPLICATION/octet-stream; name="ne2k.diff.bz2"
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.LNX.4.10.9907211730070.7616@ps.cus.umist.ac.uk>
Content-Description:
Content-Disposition: attachment; filename="ne2k.diff.bz2"

QlpoOTFBWSZTWVMOOQUAB9D/gHgwCAB/////f///6r////9gEdw7O53a+e8i
7t1rYq9t7ccN3XuBewDyj2716qcpNmqhSVp7unHnca4dsXDQgho1U/Q2pqan
o2qeySegj9KMZMoNDQNogADJoAlCARpqeiJpT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WC7GB5iiGPYVG4LjcK6iWtLWOGD
Zti5M4dwGB4kIzYvaCYi0N+SBr2YT4kr9fl2ILzru1KCDYvCkhNzBCxyUoIS
ECdup2z30CIg+KigItuZcgwF96oo2lyA0MGxsbPGERxdM8IXSURbwnkuyPDs
0YFxRWOhXC0wqiQvuQ0CSgkIqjcQiJmSJsYwIyKJRWdODUskpKibKGNPoV0W
ALsFvhemDUZAsTIWi+5qVu6zWhc7uA0WhAaEpZghkpzrS8T2PYVqt1TwVole
AfPIFy2A0qpBmhlz2IsLAsBTKCGhNM3sQMYFhqM8aVTTrZbIVJoSb/JcOJaU
WhRl90mFLipyTRZ3EIoWnBYaVdkYeqQrKgLRalQIULNJFqmh5IHQviw5iMiJ
HtzHIKpAiOi9lDjeGFECxscyFpKn7dT3s2KDBYDQipspZcHSphyhqsb0YExP
S8yWTtabGS8JBI7s1seeaLhkQnZCiuMo2ywxLPPPv0SoZQwiiKWiV0OXPUYt
eQKSXYXV2CMhmMxbUZSWsWva8WpriVY2yfJiFhuoFY1td3lXoMtTIDS0DJKI
sgYzXfFlkFwx2WwUwk2BpSUrHDLhTkcGhJg202IG0sZPcKa0hB7Gg7X+WpDz
M9RTHfx3jzNxeJq6EoKKlXeEQ2oBXiFcjA3cCh7evhkYYEhfAoY2Yy1Ij8QS
XlpwS73JbcCasxPchv80PQm0EvWgJsDvqhI4kiiTKaZhgd24o64pqGQ0F9DI
Dzgbwr0M3XZ3dVFbAOwYW9Vi4x8UZpdPVmyBobSTTRQHeyETYOd8JEA60ICZ
GTUCN/okmjaYwysVGuyhBDEWtKRpbgbGbfrPJ6/Cl+tAGu4Gtui3wvLsR2Wj
vgCYIxupGdfZOAz2Gm7MaWp15cbI6N7+qoBYvy7f+LuSKcKEgphxyCg=
--1421910094-1033117101-932574607=:7616--

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/