*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->NetBSD man pages -> pci (3)              
Title
Content
Arch
Section
 

PCI(3)

Contents


NAME    [Toc]    [Back]

     pci - library interface for PCI bus access

LIBRARY    [Toc]    [Back]

     library ``libpci''

SYNOPSIS    [Toc]    [Back]

     #include <pci.h>

     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);

     void
     pci_conf_print(int pcifd, u_int bus, u_int dev, u_int func);

DESCRIPTION    [Toc]    [Back]

     The 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.

CONFIGURATION SPACE FUNCTIONS    [Toc]    [Back]

     The following functions are used to access PCI configuration space:

     pcibus_conf_read()
           Access the PCI configuration register 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.

     pcibus_conf_write()
           Write the value specified by 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.

     pcidev_conf_read()
           Access the PCI configuration register reg on the device associated
           with the open file descriptor devfd and place the result in *valp.

     pcidev_conf_write()
           Write the value specified by val into the PCI configuration register
 reg on the device associated with the open file descriptor
           devfd.

MISCELLANEOUS FUNCTIONS    [Toc]    [Back]

     The following miscellaneous functions are available:

     pci_findvendor()
           Return an ASCII description of the PCI vendor in the PCI ID register
 id_reg.

     pci_devinfo()
           Return an ASCII description of the PCI vendor, PCI product, and PCI
           class specified by the PCI ID register id_reg and PCI class ID register
 class_reg.  The description is placed into the buffer pointed
           to by devinfo.  The buffer should be at least 256 bytes long.

     pci_conf_print()
           Print the PCI configuration information for the device located at
           bus, dev, func.  pcifd must be an open file descriptor to a PCI bus
           within the target PCI domain.

RETURN VALUES    [Toc]    [Back]

     The pcibus_conf_read(), 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.

SEE ALSO    [Toc]    [Back]

      
      
     pci(4)

HISTORY    [Toc]    [Back]

     The 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.

BSD                           September 12, 2001                           BSD
[ Back ]
 Similar pages
Name OS Title
cons NetBSD console access interface
cnbell NetBSD console access interface
cngetc NetBSD console access interface
cngetsn NetBSD console access interface
cnpollc NetBSD console access interface
cnputc NetBSD console access interface
ifaccess.conf Tru64 Interface access filter configuration file
hosts_access FreeBSD access control library
request_set NetBSD access control library
request_init NetBSD access control library
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service