Chapter 2. Basic Flow for PCI Drivers

Table of Contents

Outline
Full Code Example
Constructor
1) Check and increment the device index.
2) Create a card instance
3) Create a main component
4) Set the driver ID and name strings.
5) Create other components, such as mixer, MIDI, etc.
6) Register the card instance.
7) Set the PCI driver data and return zero.
Destructor
Header Files

Outline

The minimum flow for PCI soundcards is as follows:

  • define the PCI ID table (see the section PCI Entries ).

  • create probe() callback.

  • create remove() callback.

  • create a pci_driver structure containing the three pointers above.

  • create an init() function just calling the pci_register_driver() to register the pci_driver table defined above.

  • create an exit() function to call the pci_unregister_driver() function.