xref: /freebsd/sys/sys/pciio.h (revision bcd92649c9952c9c9e8845dbd34276a60dd16664)
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     u_char		pc_hdr;		/* PCI header type */
15     pcidi_t		pc_devid;	/* device ID */
16     pcidi_t		pc_subid;	/* subvendor ID */
17     u_int32_t		pc_class;	/* device class */
18 };
19 
20 struct	pci_conf_io {
21     size_t		pci_len;	/* length of buffer */
22     struct pci_conf	*pci_buf;	/* buffer */
23 };
24 
25 struct pci_io {
26     struct pcisel	pi_sel;		/* device to operate on */
27     int			pi_reg;		/* configuration register to examine */
28     int			pi_width;	/* width (in bytes) of read or write */
29     u_int32_t		pi_data;	/* data to write or result of read */
30 };
31 
32 
33 #define	PCIOCGETCONF	_IOWR('p', 1, struct pci_conf_io)
34 #define	PCIOCREAD	_IOWR('p', 2, struct pci_io)
35 #define	PCIOCWRITE	_IOWR('p', 3, struct pci_io)
36 
37 #endif /* _PCI_IOCTL_H */
38