| PCI(3) | Library Functions Manual | PCI(3) | 
pci, pcibus_conf_read,
  pcibus_conf_write,
  pcidev_conf_read,
  pcidev_conf_write,
  pci_findvendor, pci_devinfo,
  pci_conf_print, pci_drvname,
  pci_drvnameonbus —
#include <pci.h>
int
  
  pcibus_conf_read(int
    pcifd, unsigned int
    bus, unsigned int
    dev, unsigned int
    func, unsigned int
    reg, pcireg_t
    *valp);
int
  
  pcibus_conf_write(int
    pcifd, unsigned int
    bus, unsigned int
    dev, unsigned int
    func, unsigned int
    reg, pcireg_t
  val);
int
  
  pcidev_conf_read(int
    devfd, unsigned int
    reg, pcireg_t
    *valp);
int
  
  pcidev_conf_write(int
    devfd, unsigned int
    reg, pcireg_t
  val);
char *
  
  pci_findvendor(pcireg_t
    id_reg);
void
  
  pci_devinfo(pcireg_t
    id_reg, pcireg_t
    class_reg, int
    showclass, char
    *devinfo, size_t
    len);
void
  
  pci_conf_print(int
    pcifd, unsigned int
    bus, unsigned int
    dev, unsigned int
    func);
int
  
  pci_drvname(int
    pcifd, unsigned int
    dev, unsigned int
    func, char
    *drvname, size_t
    len);
int
  
  pci_drvnameonbus(int
    pcifd, u_int bus,
    u_int dev,
    u_int func,
    char *drvname,
    size_t len);
pci library provides support for accessing the PCI
  bus by user programs.
These functions are available in the
    libpci library. Programs should be linked with
    -lpci.
pcibus_conf_read()pcibus_conf_write()pcidev_conf_read()pcidev_conf_write()pci_findvendor()pci_devinfo()pci_conf_print()pci_drvname()pci_drvnameonbus()pci_drvname() but also allows looking up
      via PCI bus number.pcibus_conf_read(),
  pcibus_conf_write(),
  pcidev_conf_read(),
  pcidev_conf_write(),
  pci_devinfo(), and
  pci_drvname() 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_read(),
  pcibus_conf_write(),
  pcidev_conf_read(),
  pcidev_conf_write(),
  pci_findvendor(),
  pci_devinfo(), and
  pci_conf_print() functions first appeared in
  NetBSD 1.6. The pci_drvname()
  function first appeared in NetBSD 7.0.
| September 23, 2016 | NetBSD 9.4 |