xref: /freebsd/sys/sys/pciio.h (revision 3e0f6b97b257a96f7275e4442204263e44b16686)
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     struct pci_device	*pc_dvp;	/* device driver pointer or NULL */
19     struct pcicb	*pc_cb;		/* pointer to bus parameters */
20 };
21 
22 struct	pci_conf_io {
23     size_t		pci_len;	/* length of buffer */
24     struct pci_conf	*pci_buf;	/* buffer */
25 };
26 
27 struct pci_io {
28     struct pcisel	pi_sel;		/* device to operate on */
29     int			pi_reg;		/* configuration register to examine */
30     int			pi_width;	/* width (in bytes) of read or write */
31     u_int32_t		pi_data;	/* data to write or result of read */
32 };
33 
34 
35 #define	PCIOCGETCONF	_IOWR('p', 1, struct pci_conf_io)
36 #define	PCIOCREAD	_IOWR('p', 2, struct pci_io)
37 #define	PCIOCWRITE	_IOWR('p', 3, struct pci_io)
38 #define	PCIOCATTACHED	_IOWR('p', 4, struct pci_io)
39 
40 #endif /* _PCI_IOCTL_H */
41