Skip to Content
Linux Device Drivers Development
book

Linux Device Drivers Development

by John Madieu
October 2017
Intermediate to advanced
586 pages
14h 8m
English
Packt Publishing
Content preview from Linux Device Drivers Development

Driver data structures

When you deal with NIC devices, there are two data structures that you need to play with:

  • The struct sk_buff structure, defined in include/linux/skbuff.h, which is the fundamental data structure in the Linux networking code, and which should be included in your code:
#include <linux/skbuff.h>  

Each packet sent or received is handled using this data structure.

  • The struct net_device structure; this is the structure by which any NIC device is represented in the kernel. It is the interface by which data transit takes place. It is defined in include/linux/netdevice.h, which should also be included in your code:
#include <linux/netdevice.h> 

Other files that you should include in the code are include/linux/etherdevice.h ...

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, Second Edition

Linux Device Drivers, Second Edition

Jonathan Corbet, Alessandro Rubini
Linux Device Drivers, 3rd Edition

Linux Device Drivers, 3rd Edition

Jonathan Corbet, Alessandro Rubini, Greg Kroah-Hartman

Publisher Resources

ISBN: 9781785280009Supplemental Content