About This Book 1 Review of Device Driver Concepts 2 PCI Bus Architectures 3 Structure of a PCI Bus Device Driver 4 Data Structures That PCI Bus Device Drivers Use 5 Device Configuration on the PCI Bus 6 PCI Bus Device Driver Example A PCI Bus-Specific Reference Information B PCI Bus Device Driver Source Listing C Summary Tables
Table of Contents
Audience
New and Changed Features
Scope of the Book
Organization
Related Documentation
Hardware Documentation
Bus-Specific Device Driver Documentation
Programming Tools Documentation
System Management Documentation
Porting Documentation
Reference Pages
Reader's Comments
Conventions
1.1 Gathering Information
1.2 Designing a Device Driver
1.3 Allocating Data Structures
1.4 Writing Portable Device Drivers
1.5 Reviewing Device Driver Kits Delivery Process
1.6 Identifying the Method for Registering Device Interrupt Handlers
2.1 PCI Bus Hardware Architecture
2.1.1 Address Spaces
2.1.2 Data Sizes
2.1.3 Byte Ordering
2.1.4 Interrupt Vectors
2.1.5 Multifunction Devices
2.1.6 Interrupt Priorities
2.2 PCI Bus Software Architecture
2.2.1 Accessing Device Registers in I/O Space and Memory Space
2.2.2 Direct Memory Access-to-Host Memory Transfers
2.2.3 Registering Device Interrupt Handlers
3.1 Include Files Section
3.2 Autoconfiguration Support Section
3.2.1 Setting Up the probe Interface
3.2.2 Setting Up the slave Interface
4.1 The pci_config_hdr Data Structure
4.1.1 The vendor_id, device_id, and rev_id Members
4.1.2 The command Member
4.1.3 The status Member
4.1.4 The class_code Member
4.1.4.1 The base Member
4.1.4.2 The sub_class Member
4.1.4.3 The pio_int Member
4.1.5 The cache_line_size Member
4.1.6 The latency_timer Member
4.1.7 The hdr_type Member
4.1.8 The bist Member
4.1.9 The bar0, bar1, bar2, bar3, bar4, and bar5 Members
4.1.10 The cis_ptr Member
4.1.11 The sub_vendor_id and sub_device_id Members
4.1.12 The exp_rom_bar Member
4.1.12.1 The pci_rom_exp_header Data Structure
4.1.12.2 The pci_rom_data Data Structure
4.1.13 The intr_line Member
4.1.14 The intr_pin Member
4.1.15 The min_gnt and max_lat Members
4.1.16 The config_base Member
4.1.17 The private Member
4.2 PCI_Option Entries
4.2.1 The PCI_SE_Rev Attribute
4.2.2 The Vendor_Id Attribute
4.2.3 The Device_Id Attribute
4.2.4 The Rev Attribute
4.2.5 The Base Attribute
4.2.6 The Sub Attribute
4.2.7 The Pif Attribute
4.2.8 The Sub_Vid and Sub_Did Attributes
4.2.9 The Vid_Mo_Flag Attribute
4.2.10 The Did_Mo_Flag Attribute
4.2.11 The Rev_Mo_Flag Attribute
4.2.12 The Base_Mo_Flag Attribute
4.2.13 The Sub_Mo_Flag Attribute
4.2.14 The Pif_Mo_Flag Attribute
4.2.15 The Sub_Vid_Mo_Flag Attribute
4.2.16 The Sub_Did_Mo_Flag Attribute
4.2.17 The Driver_Name Attribute
4.2.18 The Type Attribute
4.2.19 The Adpt_Config Attribute
4.3 The /etc/sysconfigtab Database File
5.1 Console Power-On Self-Test Code
5.2 Multifunction Devices
5.3 Maskable Matching of Devices to Drivers
5.4 Configuration of the PCI-to-PCI Bridge
5.5 Shared Interrupt Support
6.1 Overview of the /dev/pnvram Device Driver
6.2 The pnvram.h Header File
6.3 Defining Data Structures
6.4 Include Files Section
6.5 Declarations Section
6.6 Autoconfiguration Support Section
6.6.1 Implementing the pnvram_probe Interface
6.6.2 Implementing the pnvram_attach Interface
6.6.3 Implementing the pnvram_ssn Interface
6.7 Status Section
6.8 Battery Status Section
6.8.1 Implementing the pnvram_battery_status Interface
6.8.2 Implementing the pnvram_battery_enable Interface
6.8.3 Implementing the pnvram_battery_disable Interface
6.9 Read and Write Device Section
6.9.1 Implementing the pnvram_read Interface
6.9.2 Implementing the pnvram_write Interface
6.10 Zero NVRAM Section
6.11 Interrupt Section
A.1 Conventions for Reference Pages
A.1.1 Conventions for Header File
A.1.2 Conventions for Data Structures
A.1.3 Conventions for Device Driver Interfaces
A.2 Header File
pci.h
A.3 Data Structures
pci_config_hdr
PCI_Option
pci_rom_exp_header
pci_rom_data
A.4 Device Driver Interfaces
xxprobe
xxslave
C.1 List of Header Files
C.2 List of Kernel Support Interfaces
C.3 List of Global Variables
C.4 List of Data Structures
C.5 List of Device Driver Interfaces
C.6 List of Bus Configuration Interfaces
Figures
3-1 Sections of a Character and a Block Device Driver
6-1 Relationship of the /dev/pnvram and /dev/presto Device Drivers