xref: /freebsd/sys/compat/freebsd32/freebsd32_ioctl.h (revision 87842989f8ee11e93fd9e39fa01f718d7bbd49b8)
1ae528485SDavid E. O'Brien /*-
251369649SPedro F. Giffuni  * SPDX-License-Identifier: BSD-3-Clause
351369649SPedro F. Giffuni  *
4ae528485SDavid E. O'Brien  * Copyright (c) 2008 David E. O'Brien
5ae528485SDavid E. O'Brien  * All rights reserved.
6ae528485SDavid E. O'Brien  *
7ae528485SDavid E. O'Brien  * Redistribution and use in source and binary forms, with or without
8ae528485SDavid E. O'Brien  * modification, are permitted provided that the following conditions
9ae528485SDavid E. O'Brien  * are met:
10ae528485SDavid E. O'Brien  * 1. Redistributions of source code must retain the above copyright
11ae528485SDavid E. O'Brien  *    notice, this list of conditions and the following disclaimer.
12ae528485SDavid E. O'Brien  * 2. Redistributions in binary form must reproduce the above copyright
13ae528485SDavid E. O'Brien  *    notice, this list of conditions and the following disclaimer in the
14ae528485SDavid E. O'Brien  *    documentation and/or other materials provided with the distribution.
15ae528485SDavid E. O'Brien  * 3. Neither the name of the author nor the names of its contributors
16ae528485SDavid E. O'Brien  *    may be used to endorse or promote products derived from this software
17ae528485SDavid E. O'Brien  *    without specific prior written permission.
18ae528485SDavid E. O'Brien  *
19ae528485SDavid E. O'Brien  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
20ae528485SDavid E. O'Brien  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21ae528485SDavid E. O'Brien  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22ae528485SDavid E. O'Brien  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
23ae528485SDavid E. O'Brien  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24ae528485SDavid E. O'Brien  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25ae528485SDavid E. O'Brien  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26ae528485SDavid E. O'Brien  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27ae528485SDavid E. O'Brien  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28ae528485SDavid E. O'Brien  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29ae528485SDavid E. O'Brien  * SUCH DAMAGE.
30ae528485SDavid E. O'Brien  *
31ae528485SDavid E. O'Brien  * $FreeBSD$
32ae528485SDavid E. O'Brien  */
33ae528485SDavid E. O'Brien 
34ae528485SDavid E. O'Brien #ifndef _COMPAT_FREEBSD32_IOCTL_H_
35ae528485SDavid E. O'Brien #define	_COMPAT_FREEBSD32_IOCTL_H_
36ae528485SDavid E. O'Brien 
37fcaf473cSAlexander Motin #include <cam/scsi/scsi_sg.h>
38fcaf473cSAlexander Motin 
39ae528485SDavid E. O'Brien typedef __uint32_t caddr_t32;
40c750e17cSDavid E. O'Brien 
41c750e17cSDavid E. O'Brien struct ioc_read_toc_entry32 {
42c750e17cSDavid E. O'Brien 	u_char	address_format;
43c750e17cSDavid E. O'Brien 	u_char	starting_track;
44c750e17cSDavid E. O'Brien 	u_short	data_len;
45c750e17cSDavid E. O'Brien 	uint32_t data;		/* struct cd_toc_entry* */
46c750e17cSDavid E. O'Brien };
47c750e17cSDavid E. O'Brien 
487eac36edSEd Schouten struct fiodgname_arg32 {
497eac36edSEd Schouten 	int		len;
507eac36edSEd Schouten 	caddr_t32	buf;
517eac36edSEd Schouten };
527eac36edSEd Schouten 
53bfac1583SKonstantin Belousov struct mem_range_op32
54bfac1583SKonstantin Belousov {
55bfac1583SKonstantin Belousov 	caddr_t32	mo_desc;
56bfac1583SKonstantin Belousov 	int		mo_arg[2];
57bfac1583SKonstantin Belousov };
58bfac1583SKonstantin Belousov 
594ee107ddSKonstantin Belousov struct pci_conf32 {
604ee107ddSKonstantin Belousov 	struct pcisel	pc_sel;		/* domain+bus+slot+function */
614ee107ddSKonstantin Belousov 	u_int8_t	pc_hdr;		/* PCI header type */
624ee107ddSKonstantin Belousov 	u_int16_t	pc_subvendor;	/* card vendor ID */
634ee107ddSKonstantin Belousov 	u_int16_t	pc_subdevice;	/* card device ID, assigned by
644ee107ddSKonstantin Belousov 					   card vendor */
654ee107ddSKonstantin Belousov 	u_int16_t	pc_vendor;	/* chip vendor ID */
664ee107ddSKonstantin Belousov 	u_int16_t	pc_device;	/* chip device ID, assigned by
674ee107ddSKonstantin Belousov 					   chip vendor */
684ee107ddSKonstantin Belousov 	u_int8_t	pc_class;	/* chip PCI class */
694ee107ddSKonstantin Belousov 	u_int8_t	pc_subclass;	/* chip PCI subclass */
704ee107ddSKonstantin Belousov 	u_int8_t	pc_progif;	/* chip PCI programming interface */
714ee107ddSKonstantin Belousov 	u_int8_t	pc_revid;	/* chip revision ID */
724ee107ddSKonstantin Belousov 	char		pd_name[PCI_MAXNAMELEN + 1];  /* device name */
734ee107ddSKonstantin Belousov 	u_int32_t	pd_unit;	/* device unit number */
744ee107ddSKonstantin Belousov };
754ee107ddSKonstantin Belousov 
764ee107ddSKonstantin Belousov struct pci_match_conf32 {
774ee107ddSKonstantin Belousov 	struct pcisel		pc_sel;		/* domain+bus+slot+function */
784ee107ddSKonstantin Belousov 	char			pd_name[PCI_MAXNAMELEN + 1];  /* device name */
794ee107ddSKonstantin Belousov 	u_int32_t		pd_unit;	/* Unit number */
804ee107ddSKonstantin Belousov 	u_int16_t		pc_vendor;	/* PCI Vendor ID */
814ee107ddSKonstantin Belousov 	u_int16_t		pc_device;	/* PCI Device ID */
824ee107ddSKonstantin Belousov 	u_int8_t		pc_class;	/* PCI class */
834ee107ddSKonstantin Belousov 	u_int32_t		flags;		/* Matching expression */
844ee107ddSKonstantin Belousov };
854ee107ddSKonstantin Belousov 
864ee107ddSKonstantin Belousov struct pci_conf_io32 {
874ee107ddSKonstantin Belousov 	u_int32_t		pat_buf_len;	/* pattern buffer length */
884ee107ddSKonstantin Belousov 	u_int32_t		num_patterns;	/* number of patterns */
894ee107ddSKonstantin Belousov 	caddr_t32		patterns;	/* struct pci_match_conf ptr */
904ee107ddSKonstantin Belousov 	u_int32_t		match_buf_len;	/* match buffer length */
914ee107ddSKonstantin Belousov 	u_int32_t		num_matches;	/* number of matches returned */
924ee107ddSKonstantin Belousov 	caddr_t32		matches;	/* struct pci_conf ptr */
934ee107ddSKonstantin Belousov 	u_int32_t		offset;		/* offset into device list */
944ee107ddSKonstantin Belousov 	u_int32_t		generation;	/* device list generation */
954ee107ddSKonstantin Belousov 	u_int32_t		status;		/* request status */
964ee107ddSKonstantin Belousov };
974ee107ddSKonstantin Belousov 
98*87842989SKonstantin Belousov struct pci_bar_mmap32 {
99*87842989SKonstantin Belousov 	uint32_t	pbm_map_base;
100*87842989SKonstantin Belousov 	uint32_t	pbm_map_length;
101*87842989SKonstantin Belousov 	uint32_t	pbm_bar_length1, pbm_bar_length2;
102*87842989SKonstantin Belousov 	int		pbm_bar_off;
103*87842989SKonstantin Belousov 	struct pcisel	pbm_sel;
104*87842989SKonstantin Belousov 	int		pbm_reg;
105*87842989SKonstantin Belousov 	int		pbm_flags;
106*87842989SKonstantin Belousov 	int		pbm_memattr;
107*87842989SKonstantin Belousov };
108*87842989SKonstantin Belousov 
109c750e17cSDavid E. O'Brien #define	CDIOREADTOCENTRYS_32 _IOWR('c', 5, struct ioc_read_toc_entry32)
1107eac36edSEd Schouten #define	FIODGNAME_32	_IOW('f', 120, struct fiodgname_arg32)
111bfac1583SKonstantin Belousov #define	MEMRANGE_GET32	_IOWR('m', 50, struct mem_range_op32)
112bfac1583SKonstantin Belousov #define	MEMRANGE_SET32	_IOW('m', 51, struct mem_range_op32)
1134ee107ddSKonstantin Belousov #define	PCIOCGETCONF_32	_IOWR('p', 5, struct pci_conf_io32)
114fcaf473cSAlexander Motin #define	SG_IO_32	_IOWR(SGIOC, 0x85, struct sg_io_hdr32)
115*87842989SKonstantin Belousov #define	PCIOCBARMMAP_32	_IOWR('p', 8, struct pci_bar_mmap32)
116ae528485SDavid E. O'Brien 
117ae528485SDavid E. O'Brien #endif	/* _COMPAT_FREEBSD32_IOCTL_H_ */
118