Re: [PATCH] support for ISAPnP code with ne2000 network driver

Paul Gortmaker (p_gortmaker@yahoo.com)
Wed, 15 Sep 1999 02:28:34 -0400


Richard Guenther wrote:

> Attached is a patch to support initializing a ISAPnP ne2k clone
> with the ne.c driver. Unfortunately, deactivating the card at
> module unload seems to be impossible (or at least hard) due to
> a lack of a private field in struct net_dev. At least it works
> for me, but probably other ID's have to be added to the isapnp
> card list.

Hi, some comments:

1) The fact that the PnP probe you added is a clone of the PCI probe routine
in the driver brings up an issue that should be considered before we go this
route - an issue that is being discussed re PCI probing now. i.e. we should
have isapnp.c contain some sort of function for probing a list of device
IDs rather than going down the same path again and start adding code
duplication to a bunch of drivers.

2) If PnP is built into a modular driver then the ne.o module all of a
sudden requires isapnp.o to be loaded - even for users with non-PnP
NE2000 cards. (You can pretty much guarantee that distribution maintainers
would ship a ne.o module with PnP support enabled if it was an available
option). Even with PnP cards the current setup allows you to load the isapnp
module, activate the card(s) via /proc and then unload - i.e. it doesn't
require leaving the isapnp module loaded.

3) In your patch, the probe/ID table aren't in #ifdef CONFIG_ISAPNP.
While this is not strictly required for it to compile thanks to the dummy
functions in isapnp.h, it makes for a smaller driver module since __initXXX
doesn't (currently) do anything for modules. (This can cost you an extra
page if it causes the module to exceed a PAGE_SIZE boundary)

4) You can handle the issue of deactiviation via keeping a linked list
of PnP ne2k cards you find - you can swipe the code for this directly
from ne2k-pci.c

I think having the PnP probe in the driver is probably a win in terms of
idiot proofing novice installs but (1) should be sorted first and I'm not
keen on what (2) implies. Fixing (3) is trivial. Since use of PnP ISA
ne2k cards isn't reliant on adding the PnP probe (e.g. just disable PnP on
the card) and since the PnP probe routines are new and currently unused
in any other driver so we could leave this post 2.4 release. (Otherwise
we should add it to all the other drivers for ISA PnP devices b4 2.4.0)

Paul.

_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

-
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/