User guide
1
Installing and Configuring Enhanced OS-9
Enhanced OS-9 for X86 PCAT 143
Description
pci_get_config_data() provides a simple means to obtain the PCI
standard information for a given PCI device.
NoteNote
Many PCI devices include additional information after the standard
configuration block. To access it one must use
pci_read_configuration(). For information on the information returned,
refer to the pci_config_reg structure in ’pcicnfg.h’.
Header File
MWOS/SRC/DEFS/HW/pcicnfg.h
Example
#include <const.h>
#include <pcicnfg.h>
#include <stdio.h>
#include <stdlib.h>
main()
{
u_int8 bus, device;
pci_config_reg cnfg;
PCI_config_reg cp = &cnfg;
bus = 0; /* device on bus zero */
device = 11; /* device ID = 11 */
pci_get_config_data(bus, device, 0L, &cnfg);
printf("\n");
printf("BUS:DEV VID DID CLASS RV IL IP\n");
printf("---------------------------------\n");
printf("%03d:%02d %04x %04x %06x %02x %02x %02x ",
bus, device,
cp->vendor_id, cp->device_id,
(cp->rev_class>>8)&0xffffff, cp->rev_class & 0xff,
cp->irq_line, cp->irq_pin );
return EXIT_SUCCESS;
}