diff options
author | kib <kib@FreeBSD.org> | 2011-04-02 15:47:23 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2011-04-02 15:47:23 +0000 |
commit | 72cac8e666303737e54fa33bebcd268891021801 (patch) | |
tree | 0183107513663373d0932ef38218ed55a3e521d2 | |
parent | 400f21cacb7b1afe78af9b598fbf6cf3e1b25cce (diff) | |
download | FreeBSD-src-72cac8e666303737e54fa33bebcd268891021801.zip FreeBSD-src-72cac8e666303737e54fa33bebcd268891021801.tar.gz |
Provide the structures and ioctl number definition for handling
PCIOCGETCONF compat32.
Submitted by: John Wehle <john feith com>
MFC after: 2 weeks
-rw-r--r-- | sys/compat/freebsd32/freebsd32_ioctl.c | 4 | ||||
-rw-r--r-- | sys/compat/freebsd32/freebsd32_ioctl.h | 40 |
2 files changed, 44 insertions, 0 deletions
diff --git a/sys/compat/freebsd32/freebsd32_ioctl.c b/sys/compat/freebsd32/freebsd32_ioctl.c index c163a2a..14fccc5 100644 --- a/sys/compat/freebsd32/freebsd32_ioctl.c +++ b/sys/compat/freebsd32/freebsd32_ioctl.c @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include <sys/malloc.h> #include <sys/mdioctl.h> #include <sys/memrange.h> +#include <sys/pciio.h> #include <sys/proc.h> #include <sys/syscall.h> #include <sys/syscallsubr.h> @@ -58,6 +59,9 @@ CTASSERT((sizeof(struct md_ioctl32)+4) == 436); CTASSERT(sizeof(struct ioc_read_toc_entry32) == 8); CTASSERT(sizeof(struct ioc_toc_header32) == 4); CTASSERT(sizeof(struct mem_range_op32) == 12); +CTASSERT(sizeof(struct pci_conf_io32) == 36); +CTASSERT(sizeof(struct pci_match_conf32) == 44); +CTASSERT(sizeof(struct pci_conf32) == 44); static int diff --git a/sys/compat/freebsd32/freebsd32_ioctl.h b/sys/compat/freebsd32/freebsd32_ioctl.h index ac87a67..e0beb73 100644 --- a/sys/compat/freebsd32/freebsd32_ioctl.h +++ b/sys/compat/freebsd32/freebsd32_ioctl.h @@ -73,6 +73,45 @@ struct mem_range_op32 int mo_arg[2]; }; +struct pci_conf32 { + struct pcisel pc_sel; /* domain+bus+slot+function */ + u_int8_t pc_hdr; /* PCI header type */ + u_int16_t pc_subvendor; /* card vendor ID */ + u_int16_t pc_subdevice; /* card device ID, assigned by + card vendor */ + u_int16_t pc_vendor; /* chip vendor ID */ + u_int16_t pc_device; /* chip device ID, assigned by + chip vendor */ + u_int8_t pc_class; /* chip PCI class */ + u_int8_t pc_subclass; /* chip PCI subclass */ + u_int8_t pc_progif; /* chip PCI programming interface */ + u_int8_t pc_revid; /* chip revision ID */ + char pd_name[PCI_MAXNAMELEN + 1]; /* device name */ + u_int32_t pd_unit; /* device unit number */ +}; + +struct pci_match_conf32 { + struct pcisel pc_sel; /* domain+bus+slot+function */ + char pd_name[PCI_MAXNAMELEN + 1]; /* device name */ + u_int32_t pd_unit; /* Unit number */ + u_int16_t pc_vendor; /* PCI Vendor ID */ + u_int16_t pc_device; /* PCI Device ID */ + u_int8_t pc_class; /* PCI class */ + u_int32_t flags; /* Matching expression */ +}; + +struct pci_conf_io32 { + u_int32_t pat_buf_len; /* pattern buffer length */ + u_int32_t num_patterns; /* number of patterns */ + caddr_t32 patterns; /* struct pci_match_conf ptr */ + u_int32_t match_buf_len; /* match buffer length */ + u_int32_t num_matches; /* number of matches returned */ + caddr_t32 matches; /* struct pci_conf ptr */ + u_int32_t offset; /* offset into device list */ + u_int32_t generation; /* device list generation */ + u_int32_t status; /* request status */ +}; + #define CDIOREADTOCENTRYS_32 _IOWR('c', 5, struct ioc_read_toc_entry32) #define CDIOREADTOCHEADER_32 _IOR('c', 4, struct ioc_toc_header32) #define MDIOCATTACH_32 _IOC(IOC_INOUT, 'm', 0, sizeof(struct md_ioctl32) + 4) @@ -82,5 +121,6 @@ struct mem_range_op32 #define FIODGNAME_32 _IOW('f', 120, struct fiodgname_arg32) #define MEMRANGE_GET32 _IOWR('m', 50, struct mem_range_op32) #define MEMRANGE_SET32 _IOW('m', 51, struct mem_range_op32) +#define PCIOCGETCONF_32 _IOWR('p', 5, struct pci_conf_io32) #endif /* _COMPAT_FREEBSD32_IOCTL_H_ */ |