Skip to Content
Linux Device Drivers, Second Edition
book

Linux Device Drivers, Second Edition

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

Quick Reference

This section, as usual, summarizes the symbols introduced in the chapter.

#include <linux/config.h> , CONFIG_PCI

This macro should be used to conditionally compile PCI-related code. When a PCI module is loaded to a non-PCI kernel, insmod complains about several symbols being unresolved.

#include <linux/pci.h>

This header includes symbolic names for the PCI registers and several vendor and device ID values.

int pci_present(void);

This function returns a boolean value that tells whether the computer we’re running on has PCI capabilities or not.

struct pci_dev; , struct pci_bus; , struct pci_driver; , struct pci_device_id;

These structures represent the objects involved in PCI management. The concept of pci_driver is new as of Linux 2.4, and struct pci_device_id is central to it.

struct pci_dev *pci_find_device(unsigned int vendor, unsigned int device, struct pci_dev *from); , struct pci_dev *pci_find_class(unsigned int class, struct pci_dev *from);

These functions are used to look up the device list looking for devices with a specific signature or belonging to a specific class. The return value is NULL if none is found. from is used to continue a search; it must be NULL the first time you call either function, and it must point to the device just found if you are searching for more devices.

int pci_read_config_byte(struct pci_dev *dev, int where, u8 *val); , int pci_read_config_word(struct pci_dev *dev, int where, u16 *val); , int pci_read_config_dword(struct ...
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.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Linux Device Drivers Development

Linux Device Drivers Development

John Madieu
Linux Device Drivers

Linux Device Drivers

Alessandro Rubini
Linux Device Drivers, 3rd Edition

Linux Device Drivers, 3rd Edition

Jonathan Corbet, Alessandro Rubini, Greg Kroah-Hartman

Publisher Resources

ISBN: 0596000081Catalog PageErrata