Re: Arcnet patch for 2.3.33

Martin Mares (mj@suse.cz)
Sat, 18 Dec 1999 13:53:35 +0100


Hello Avery,

> I'm glad to see the effort you've put in, but I wish you had contacted me
> first. There is a much revised version of the driver available for 2.2.x
> kernels:
>
> http://www.worldvisions.ca/~apenwarr/arcnet/
>
> Because of my limited time I haven't had a chance yet, but this was intended
> to get ported to 2.3.x soon. All the phys_to_virt and friends are gone from
> that version too, although a certain amount of kludgy device list
> manipulation remains. In general, however, the 3.80/3.90 series is _much_
> less hideous than 3.0x.
>
> I know it's a lot to ask, but while it's fresh in your mind, I would be
> truly overwhelmed with joy if you could port the 3.90 driver to 2.3, make
> your probing and resource management changes, and use that for your patch
> instead. I'd rather not maintain the 3.0x series any further, and someone
> who understands the new resource management routines could do the port much
> more easily.

I've tried to do that and I hope I've succeeded :)

The result is available at ftp://atrey.karlin.mff.cuni.cz/pub/local/mj/linux/patches/

- arcnet-3.91-mj1.tar.gz -- a new version of the arcnet package
- l-arcnet-mj1.gz -- this is not a full diff between 3.90 and 3.91-mj1
(I've moved several files, so it would be a large patch totally obscuring
what I've really changed), but a diff between 3.90 with files moved
and 3.91-mj1.
- l-arcnet-2.3.33.gz -- kernel patch against 2.3.33.

The drivers in arcnet-3.91-mj1 and the kernel patch are identical, the only
differences are in Makefiles.

There is a complete changelog and TODO list:

3.91-mj1 changes:
~~~~~~~~~~~~~~~~~

- Ported to 2.3 kernels. `struct device' replaced by `struct net_device',
we now use 2.3 features like alloc_bootmem() etc.

- Integrated back to the kernel. The ARCnet driver now resides in drivers/net/arcnet,
the modules got renamed:

com20020base -> com20020
com20020 -> com20020-isa
com20020pci -> com20020-pci
com20020_cs -> com20020-cs
arc-rimi -> rimi

Includes are back in include/linux/

- Modified the stand-alone ARCnet package to use the new file names and locations.

- All drivers should work in both stand-alone and modular version. To get this,
we use three types of probing:

(1) modular probing: we create struct net_device and call the probe
function immediately.
(2) autoprobe: the probe function is passed no device, so it creates
struct net_device for all devices it finds.
(3) kernel command line arguments given: we create struct net_device
and let its init function point to our probe routine, so that it
gets called later. (Note that we need to call arcnet_init()
explicitly, because we need to ensure the arcnet core is initialized
before the low-level driver.)

- Changed `const char *version' to `#define VERSION', so that we don't get
unreferences variables in non-modular cases.

- Removed unnecessary #include's.

- arcnet: arcdev_new() and arcdev_makename() removed.

- com20020-cs: Changed includes to new PCMCIA support in 2.3 kernels.

- com20020-cs: regdump() only in debug mode

- com20020-cs: Don't crash if out of memory.

- com20020: Removed port and irq parameters from com20020_found() since they
can be found in struct net_device anyway.

- com20020: Marked lots of functions as static and moved their declarations
from com20020.h to com20020.c.

- com20020: If the MAC address is given explicitly, don't rewrite it accidentally.

- com20020-pci: Simplified PCI probing; use 2.3 resources.

- com90xx: Use isa_read*, isa_write* and ioremap() in a 2.3-friendly way.

- com90xx: Call request_mem_region to register the iomem window.

- com90xx: Removed the dev->base_addr hacks.

- com90xx: Use lp->mem_start to remember the ioremap'ed address.

- Removed MAX_ARCNET_DEVS (the allocation of devices is dynamic now)

- Removed D_PROTO from the list of default debug switches.

TODO:
~~~~~
- Should we move the com20020-cs driver under drivers/pcmcia and
configure it along with other PCMCIA devices?
- What about autoloading of modules? The REQUIRE_1201 hack looks ugly :(
- Maintain use counts of modules.
- MODULE_AUTHOR etc.
- Decide on printing of init messages. In modular case, all modules probably
should print their init message as they do now, but for drivers embedded in the
kernel it's probably sufficient to print the version of the generic ARCnet
driver and the list of compiled-in protocols.
- com20020-isa avoids check_region and there's a comment about it being a
temporary solution to some PCMCIA problem. Why?
- Create a function for allocation of device together with private data?
- Port com90io and rimi drivers to the new architecture (and to 2.3, of course).
- Write Configure.help entries for ARCnet options.
- Update documentation in the kernel tree.
- Add a copy of the ChangeLog to the kernel tree?
- ANNOUNCE refers to QUICKSTART file which doesn't exist.
- Manual setting of encap: Isn't it sufficient to define a device private ioctl
for this purpose instead of re-introducing the pseudo-devices?

I will greatly appreciate your comments on my changes -- I've tried my best,
but I expect some of my changes clash with your plans for future development of
the driver. Also, I did test only the generic part, rfc1201 and com90xx as I have
no other arcnet cards here :(

Thanks and have a nice day

-- 
Martin `MJ' Mares <mj@ucw.cz> <mj@suse.cz> http://atrey.karlin.mff.cuni.cz/~mj/
"Compatible: Gracefully accepts erroneous data from any source."

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