Skip to Content
Linux Device Drivers, Second Edition
book

Linux Device Drivers, Second Edition

by Jonathan Corbet, Alessandro Rubini
June 2001
Intermediate to advanced content levelIntermediate to advanced
592 pages
19h 20m
English
O'Reilly Media, Inc.
Content preview from Linux Device Drivers, Second Edition

Backward Compatibility

Version 2.3.43 of the kernel saw a major rework of the networking subsystem. The new “softnet” implementation was a great improvement in terms of performance and clean design. It also, of course, brought changes to the network driver interface—though fewer than one might have expected.

Differences in Linux 2.2

First of all, Linux 2.3.14 renamed the network device structure, which had always been struct device, to struct net_device. The new name is certainly more appropriate, since the structure was never meant to describe devices in general.

Prior to version 2.3.43, the functions netif_start_queue, netif_stop_queue, and netif_wake_queue did not exist. Packet transmission was, instead, controlled by three fields in the device structure, and sysdep.h implements the three functions using the three fields when compiling for 2.2 or 2.0.

unsigned char start;

This variable indicated that the interface was ready for operations; it was normally set to 1 in the driver’s open method. The current implementation is to call netif_start_queue instead.

unsigned long interrupt;

interrupt was used to indicate that the device was servicing an interrupt—accordingly, it was set to 1 at the beginning of the interrupt handler and to 0 before returning. It was never a substitute for proper locking, and its use has been replaced with internal spinlocks.

unsigned long tbusy;

When nonzero, this variable indicated that the device could handle no more outgoing packets. Where ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Linux Device Drivers, 3rd Edition

Linux Device Drivers, 3rd Edition

Jonathan Corbet, Alessandro Rubini, Greg Kroah-Hartman

Publisher Resources

ISBN: 0596000081Supplemental ContentCatalog PageErrata