Skip to contentSkip to conversation

Porting Linux v2.2.x Ethernet driver to v2.4.x?

DISCUSSION [email protected] 2 participants 3 messages Nov 9, 2000

lore
Share & tools
lore
#0 lore raw

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/

#1 lore raw
Quoted 7 lines · [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

Signature · 7 lines
Jeff Garzik             |
Building 1024           | Would you like a Twinkie?
MandrakeSoft            |
-
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/
#2 lore raw
In reply to [email protected]

...and the attached document, referred to in the previous mail. :) I
think I posted this recently, but it's small so a repost is no big deal.

Signature · 3 lines
Jeff Garzik             |
Building 1024           | Would you like a Twinkie?
MandrakeSoft            |

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