1 #ifndef _PCI_IOCTL_H 2 #define _PCI_IOCTL_H 1 3 4 #include <sys/ioccom.h> 5 6 struct pcisel { 7 u_char pc_bus; /* bus number */ 8 u_char pc_dev; /* device on this bus */ 9 u_char pc_func; /* function on this device */ 10 }; 11 12 struct pci_conf { 13 struct pcisel pc_sel; /* bus+slot+function */ 14 pcidi_t pc_devid; /* device ID */ 15 pcidi_t pc_subid; /* subvendor ID */ 16 u_int32_t pc_class; /* device class */ 17 }; 18 19 struct pci_conf_io { 20 size_t pci_len; /* length of buffer */ 21 struct pci_conf *pci_buf; /* buffer */ 22 }; 23 24 struct pci_io { 25 struct pcisel pi_sel; /* device to operate on */ 26 int pi_reg; /* configuration register to examine */ 27 int pi_width; /* width (in bytes) of read or write */ 28 u_int32_t pi_data; /* data to write or result of read */ 29 }; 30 31 32 #define PCIOCGETCONF _IOWR('p', 1, struct pci_conf_io) 33 #define PCIOCREAD _IOWR('p', 2, struct pci_io) 34 #define PCIOCWRITE _IOWR('p', 3, struct pci_io) 35 36 #endif /* _PCI_IOCTL_H */ 37