2000-11-09 18:01:39

by Steven_Snyder

[permalink] [raw]
Subject: Porting Linux v2.2.x Ethernet driver to v2.4.x?



Hello.

I am about to modify a Linux v2.2.x-compatible Ethernet driver to allow it to
work in the new v2.4.x kernel. Are there any documents which describe the
differences in the device driver models (particularly PCI and Ethernet) of the 2
kernel versions? If so, where can I find them?

Thank you.

(Sorry about the advertisement below.)




PLANET PROJECT will connect millions of people worldwide through the combined
technology of 3Com and the Internet. Find out more and register now at
http://www.planetproject.com



2000-11-09 18:11:21

by Dunlap, Randy

[permalink] [raw]
Subject: RE: Porting Linux v2.2.x Ethernet driver to v2.4.x?

Search the lkml archives. Here are 2 instances
to find:

from jamal, 2000-jan-6: [ANNOUNCE] SOFTNETing Network Drivers HOWTO

from kuznet, 2000-feb-14: "softnet" drivers: an attempt to clarify

from dave miller, 2000-feb-9: new network driver interface changes, README
http://www.uwsg.indiana.edu/hypermail/linux/kernel/0002.1/0408.html
from jamal, 2000-feb-10: ditto
http://www.uwsg.indiana.edu/hypermail/linux/kernel/0002.1/0461.html
from dave miller, 2000-feb-12: ditto

_______________________________________________
|randy.dunlap_at_intel.com 503-677-5408|
|NOTE: Any views presented here are mine alone|
|& may not represent the views of my employer.|
-----------------------------------------------

> -----Original Message-----
> From: [email protected] [mailto:[email protected]]
> Sent: Thursday, November 09, 2000 10:01 AM
> To: [email protected]
> Subject: Porting Linux v2.2.x Ethernet driver to v2.4.x?
>
>
>
>
> Hello.
>
> I am about to modify a Linux v2.2.x-compatible Ethernet
> driver to allow it to
> work in the new v2.4.x kernel. Are there any documents which
> describe the
> differences in the device driver models (particularly PCI and
> Ethernet) of the 2
> kernel versions? If so, where can I find them?
>
> Thank you.
>
> (Sorry about the advertisement below.)
>
>
>
>
> PLANET PROJECT will connect millions of people worldwide
> through the combined
> technology of 3Com and the Internet. Find out more and register now at
> http://www.planetproject.com
>
>
> -
> To unsubscribe from this list: send the line "unsubscribe
> linux-kernel" in
> the body of a message to [email protected]
> Please read the FAQ at http://www.tux.org/lkml/
>

2000-11-09 18:11:21

by Jeff Garzik

[permalink] [raw]
Subject: Re: Porting Linux v2.2.x Ethernet driver to v2.4.x?

[email protected] wrote:
>
> Hello.
>
> I am about to modify a Linux v2.2.x-compatible Ethernet driver to allow it to
> work in the new v2.4.x kernel. Are there any documents which describe the
> differences in the device driver models (particularly PCI and Ethernet) of the 2
> kernel versions? If so, where can I find them?

Not all in one place. Read:

Documentation/pci.txt
Documentation/DMA-mapping.txt
Documentation/IO-mapping.txt
and the attached document, regarding netdevice member locking rules.

Your best reference is other PCI ethernet drivers. grep for
'pci_module_init' in drivers/net/*.c of the most recent 2.4.x kernel,
for a good start.

Also... before you start thinking about gunking-up your driver with all
sorts of backwards-compatibility code... remember that most 2.4.x
drivers can easily be backported to 2.2.x with a few magic macros and
static inline functions. I have an example of this sort of thing at
http://gtf.org/garzik/drivers/kcompat24/

Jeff


--
Jeff Garzik |
Building 1024 | Would you like a Twinkie?
MandrakeSoft |

2000-11-09 18:13:11

by Jeff Garzik

[permalink] [raw]
Subject: Re: Porting Linux v2.2.x Ethernet driver to v2.4.x?


Network Devices, the Kernel, and You!


Introduction
============
The following is a random collection of documentation regarding
network devices.




struct net_device synchronization rules
=======================================
dev->open:
Locking: Inside rtnl_lock() semaphore.
Sleeping: OK

dev->stop:
Locking: Inside rtnl_lock() semaphore.
Sleeping: OK

dev->do_ioctl:
Locking: Inside rtnl_lock() semaphore.
Sleeping: OK

dev->get_stats:
Locking: Inside dev_base_lock spinlock.
Sleeping: NO

dev->hard_start_xmit:
Locking: Inside dev->xmit_lock spinlock.
Sleeping: NO

dev->tx_timeout:
Locking: Inside dev->xmit_lock spinlock.
Sleeping: NO

dev->set_multicast_list:
Locking: Inside dev->xmit_lock spinlock.
Sleeping: NO



Attachments:
netdevices.txt (742.00 B)