PCI definitions

Overview

PCI-related constants and supplementary functions. More…

// global functions

const char* te_pci_class_id2str(unsigned int class);
unsigned int te_pci_class_str2id(const char* label);
const char* te_pci_subclass_id2str(unsigned int subclass);
unsigned int te_pci_subclass_str2id(const char* label);
const char* te_pci_progintf_id2str(unsigned int progintf);
unsigned int te_pci_progintf_str2id(const char* label);
static unsigned int te_pci_subclass2class(unsigned int subclass);
static unsigned int te_pci_subclass_default(unsigned int class);
static unsigned int te_pci_progintf2subclass(unsigned int progintf);
static unsigned int te_pci_progintf_default(unsigned int subclass);
static unsigned int te_pci_progintf2class(unsigned int progintf);

// macros

#define ENDDEF(_name)
#define ITEM(_key, _value)
#define STARTDEF(_name)

Detailed Documentation

PCI-related constants and supplementary functions.

Global Functions

const char* te_pci_class_id2str(unsigned int class)

Provide a string description of a PCI class.

An unknown value will be treated as TE_PCI_CLASS_UNCLASSIFIED_DEVICE.

Parameters:

class

class ID (see te_pci_class)

Returns:

the class label

unsigned int te_pci_class_str2id(const char* label)

Provide a PCI class ID matching a given label.

Parameters:

label

PCI class label

TE_PCI_CLASS_UNCLASSIFIED_DEVICE

if the label is unknown

Returns:

the class ID

const char* te_pci_subclass_id2str(unsigned int subclass)

Provide a string description of a PCI subclass.

If subclass is not defined, the function will return a label for a class part as per te_pci_class_id2str().

Parameters:

subclass

subclass ID (see te_pci_subclass)

Returns:

the subclass label

unsigned int te_pci_subclass_str2id(const char* label)

Provide a PCI class ID matching a given label.

The function may be passed any label accepted by te_pci_class_str2id(), then the shifted value of a class ID will be returned.

Parameters:

label

PCI subclass label

Returns:

the subclass ID

const char* te_pci_progintf_id2str(unsigned int progintf)

Provide a string description of a PCI progintf.

If progintf is not defined, the function will return a label for a subclass part as per te_pci_subclass_id2str().

Parameters:

progintf

programming interface ID (see te_pci_prog_interface)

Returns:

the subclass label

unsigned int te_pci_progintf_str2id(const char* label)

Provide a PCI prog interface ID matching a given label.

The function may be passed any label accepted by te_pci_subclass_str2id(), then the shifted value of a subclass ID will be returned.

Parameters:

label

PCI subclass label

Returns:

the programming interface ID

static unsigned int te_pci_subclass2class(unsigned int subclass)

Get a class part of a PCI subclass ID.

Parameters:

subclass

PCI subclass ID

Returns:

class ID

static unsigned int te_pci_subclass_default(unsigned int class)

Get a default PCI subclass from a PCI class ID.

Parameters:

class

PCI class ID

Returns:

subclass ID

static unsigned int te_pci_progintf2subclass(unsigned int progintf)

Get a subclass part of a PCI programming interface ID.

Parameters:

progintf

Programming interace ID

Returns:

Subclass ID

static unsigned int te_pci_progintf_default(unsigned int subclass)

Get a default PCI programming interface ID from a PCI subclass ID.

Parameters:

subclass

PCI subclass ID

Returns:

programming interface ID

static unsigned int te_pci_progintf2class(unsigned int progintf)

Get a class part of a PCI programming interface ID.

Parameters:

progintf

Programming interace ID

Returns:

Class ID