int
pcibus_conf_read(int pcifd, u_int bus, u_int dev, u_int func, u_int reg, pcireg_t *valp)
int
pcibus_conf_write(int pcifd, u_int bus, u_int dev, u_int func, u_int reg, pcireg_t val)
int
pcidev_conf_read(int devfd, u_int reg, pcireg_t *valp)
int
pcidev_conf_write(int devfd, u_int reg, pcireg_t val)
char *
pci_findvendor(pcireg_t id_reg)
void
pci_devinfo(pcireg_t id_reg, pcireg_t class_reg, char *devinfo, size_t len)
void
pci_conf_print(int pcifd, u_int bus, u_int dev, u_int func)
These functions are available in the libpci library. Programs should be linked with -lpci.
)reg
on the device located at
bus,
dev,
func,
and place the result in
*valp.
pcifd
must be an open file descriptor to a PCI bus within the target PCI domain.
)val
into the PCI configuration register
rag
on the device located at
bus,
dev,
func.
pcifd
must be an open file descriptor to a PCI bus within the target PCI domain.
)reg
on the device associated with the open file descriptor
devfd
and place the result in
*valp.
)val
into the PCI configuration register
reg
on the device associated with the open file descriptor
devfd.
)id_reg.
)id_reg
and PCI class ID register
class_reg.
The description is placed into the buffer pointed to by
devinfo;
the size of that buffer is specified in
len.
)bus,
dev,
func.
pcifd
must be an open file descriptor to a PCI bus within the target PCI domain.
),
pcibus_conf_write(),
pcidev_conf_read(),
and
pcidev_conf_write()
functions return 0 on success and -1 on failure.
The
pci_findvendor()
function returns NULL if the PCI vendor description cannot be
found.
),
pcibus_conf_write(),
pcidev_conf_read(),
pcidev_conf_write(),
pci_findvendor(),
pci_devinfo(),
and
pci_conf_print()
functions first appeared in
NetBSD1.6.