User guide

146 Enhanced OS-9 for X86 PCAT
1
Installing and Configuring Enhanced OS-9
u_int8 bus, dev;
u_int32 index = 0;
if (pci_find_class_code(NETWORK_ATM_CONTROLLER,
index, &bus, &dev) == SUCCESS)
{
printf("device at bus:%02d dev:%02d func:%02d\n",
bus, dev&0x1f, dev>>5);
}
return EXIT_SUCCESS;
}
pci_read_configuration_byte() - read PCI configuration
byte
Syntax
#include <pcicnfg.h>
u_int8 pci_read_configuration_byte(u_int32 bus, u_int32 dev,
u_int32 func, u_int32 index);
State
System
Description
pci_read_configuration_byte() will return the PCI configuration byte
value for the PCI device at ’bus’ bus number, ’dev’ device number, ’func’
function number, ’index’ offset into the configuration space.
Header Files
MWOS/SRC/DEFS/HW/pcicnfg.h
Example
#include <const.h>
#include <pcicnfg.h>
#include <stdio.h>
#include <stdlib.h>
main()
{
u_int8 bus, dev, func;
u_int8 irqline;
bus = 0; /* device on bus zero */
device = 11; /* device ID = 11 */
func = 0; /* function number = 0 */
irqline = pci_read_configuration_byte(bus, device,