xref: /netbsd-src/sys/compat/netbsd32/netbsd32_ioctl.h (revision 3b01aba77a7a698587faaae455bbfe740923c1f5)
1 /*	$NetBSD: netbsd32_ioctl.h,v 1.5 2001/06/19 00:36:21 fvdl Exp $	*/
2 
3 /*
4  * Copyright (c) 1998 Matthew R. Green
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  * 1. Redistributions of source code must retain the above copyright
11  *    notice, this list of conditions and the following disclaimer.
12  * 2. Redistributions in binary form must reproduce the above copyright
13  *    notice, this list of conditions and the following disclaimer in the
14  *    documentation and/or other materials provided with the distribution.
15  * 3. The name of the author may not be used to endorse or promote products
16  *    derived from this software without specific prior written permission.
17  *
18  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
19  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
20  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
21  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
22  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
25  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28  * SUCH DAMAGE.
29  */
30 
31 /* from arch/sparc/include/fbio.h */
32 #if 0
33 /* unused */
34 #define	FBIOGINFO	_IOR('F', 2, struct fbinfo)
35 #endif
36 
37 #ifdef __sparc__
38 struct netbsd32_fbcmap {
39 	int	index;		/* first element (0 origin) */
40 	int	count;		/* number of elements */
41 	netbsd32_u_charp	red;		/* red color map elements */
42 	netbsd32_u_charp	green;		/* green color map elements */
43 	netbsd32_u_charp	blue;		/* blue color map elements */
44 };
45 #if 1
46 #define	FBIOPUTCMAP32	_IOW('F', 3, struct netbsd32_fbcmap)
47 #define	FBIOGETCMAP32	_IOW('F', 4, struct netbsd32_fbcmap)
48 #endif
49 
50 struct netbsd32_fbcursor {
51 	short set;		/* what to set */
52 	short enable;		/* enable/disable cursor */
53 	struct fbcurpos pos;	/* cursor's position */
54 	struct fbcurpos hot;	/* cursor's hot spot */
55 	struct netbsd32_fbcmap cmap;	/* color map info */
56 	struct fbcurpos size;	/* cursor's bit map size */
57 	netbsd32_charp image;	/* cursor's image bits */
58 	netbsd32_charp mask;	/* cursor's mask bits */
59 };
60 #if 1
61 #define FBIOSCURSOR32	_IOW('F', 24, struct netbsd32_fbcursor)
62 #define FBIOGCURSOR32	_IOWR('F', 25, struct netbsd32_fbcursor)
63 #endif
64 
65 /* from arch/sparc/include/openpromio.h */
66 struct netbsd32_opiocdesc {
67 	int	op_nodeid;		/* passed or returned node id */
68 	int	op_namelen;		/* length of op_name */
69 	netbsd32_charp op_name;		/* pointer to field name */
70 	int	op_buflen;		/* length of op_buf (value-result) */
71 	netbsd32_charp op_buf;		/* pointer to field value */
72 };
73 #if 1
74 #define	OPIOCGET32	_IOWR('O', 1, struct netbsd32_opiocdesc) /* get openprom field */
75 #define	OPIOCSET32	_IOW('O', 2, struct netbsd32_opiocdesc) /* set openprom field */
76 #define	OPIOCNEXTPROP32	_IOWR('O', 3, struct netbsd32_opiocdesc) /* get next property */
77 #endif
78 
79 #endif /* __sparc__ */
80 
81 /* from <sys/audioio.h> */
82 #if 0
83 #define AUDIO_WSEEK	_IOR('A', 25, u_long)
84 #endif
85 
86 /* from <sys/dkio.h> */
87 typedef int32_t netbsd32_disklabel_tp_t;
88 typedef int32_t netbsd32_partition_tp_t;
89 struct netbsd32_partinfo {
90 	netbsd32_disklabel_tp_t disklab;
91 	netbsd32_partition_tp_t part;
92 };
93 #if 1
94 #define DIOCGPART32	_IOW('d', 104, struct netbsd32_partinfo)	/* get partition */
95 #endif
96 
97 struct netbsd32_format_op {
98 	netbsd32_charp df_buf;
99 	int	 df_count;		/* value-result */
100 	daddr_t	 df_startblk;
101 	int	 df_reg[8];		/* result */
102 };
103 #if 1
104 #define DIOCRFORMAT32	_IOWR('d', 105, struct netbsd32_format_op)
105 #define DIOCWFORMAT32	_IOWR('d', 106, struct netbsd32_format_op)
106 #endif
107 
108 /* can wait! */
109 #if 0
110 dev/ccdvar.h:219:#define CCDIOCSET	_IOWR('F', 16, struct ccd_ioctl)   /* enable ccd */
111 dev/ccdvar.h:220:#define CCDIOCCLR	_IOW('F', 17, struct ccd_ioctl)    /* disable ccd */
112 
113 dev/md.h:45:#define MD_GETCONF	_IOR('r', 0, struct md_conf)	/* get unit config */
114 dev/md.h:46:#define MD_SETCONF	_IOW('r', 1, struct md_conf)	/* set unit config */
115 
116 dev/wscons/wsconsio.h:133:#define WSKBDIO_GETMAP		_IOWR('W', 13, struct wskbd_map_data)
117 dev/wscons/wsconsio.h:134:#define WSKBDIO_SETMAP		_IOW('W', 14, struct wskbd_map_data)
118 
119 dev/wscons/wsconsio.h:188:#define WSDISPLAYIO_GETCMAP	_IOW('W', 66, struct wsdisplay_cmap)
120 dev/wscons/wsconsio.h:189:#define WSDISPLAYIO_PUTCMAP	_IOW('W', 67, struct wsdisplay_cmap)
121 
122 dev/wscons/wsconsio.h:227:#define	WSDISPLAYIO_GCURSOR	_IOWR('W', 73, struct wsdisplay_cursor)
123 dev/wscons/wsconsio.h:228:#define	WSDISPLAYIO_SCURSOR	_IOW('W', 74, struct wsdisplay_cursor)
124 
125 dev/wscons/wsconsio.h:241:#define WSDISPLAYIO_SFONT	_IOW('W', 77, struct wsdisplay_font)
126 
127 net/bpf.h:127:#define	BIOCSETF	_IOW('B',103, struct bpf_program)
128 net/bpf.h:138:#define BIOCSTCPF	_IOW('B',114, struct bpf_program)
129 net/bpf.h:139:#define BIOCSUDPF	_IOW('B',115, struct bpf_program)
130 net/if_ppp.h:110:#define PPPIOCSPASS	_IOW('t', 71, struct bpf_program) /* set pass filter */
131 net/if_ppp.h:111:#define PPPIOCSACTIVE	_IOW('t', 70, struct bpf_program) /* set active filt */
132 
133 net/if_atm.h:88:#define SIOCATMENA	_IOWR('a', 123, struct atm_pseudoioctl) /* enable */
134 net/if_atm.h:89:#define SIOCATMDIS	_IOWR('a', 124, struct atm_pseudoioctl) /* disable */
135 
136 net/if_ppp.h:105:#define PPPIOCSCOMPRESS	_IOW('t', 77, struct ppp_option_data)
137 
138 netccitt/x25.h:157:#define	SIOCSIFCONF_X25	_IOW('i', 12, struct ifreq_x25)	/* set ifnet config */
139 netccitt/x25.h:158:#define	SIOCGIFCONF_X25	_IOWR('i',13, struct ifreq_x25)	/* get ifnet config */
140 
141 netinet/ip_fil.h:46:#define	SIOCGETFS	_IOR('r', 64, struct friostat)
142 netinet/ip_fil.h:56:#define	SIOCFRZST	_IOWR('r', 74, struct friostat)
143 
144 netinet/ip_fil.h:42:#define	SIOCADAFR	_IOW('r', 60, struct frentry)
145 netinet/ip_fil.h:43:#define	SIOCRMAFR	_IOW('r', 61, struct frentry)
146 netinet/ip_fil.h:49:#define	SIOCADIFR	_IOW('r', 67, struct frentry)
147 netinet/ip_fil.h:50:#define	SIOCRMIFR	_IOW('r', 68, struct frentry)
148 netinet/ip_fil.h:52:#define	SIOCINAFR	_IOW('r', 70, struct frentry)
149 netinet/ip_fil.h:53:#define	SIOCINIFR	_IOW('r', 71, struct frentry)
150 netinet/ip_fil.h:57:#define	SIOCZRLST	_IOWR('r', 75, struct frentry)
151 
152 netinet/ip_fil.h:78:#define	SIOCAUTHW	_IOWR(r, 76, struct fr_info)
153 netinet/ip_fil.h:79:#define	SIOCAUTHR	_IOWR(r, 77, struct fr_info)
154 
155 netinet/ip_fil.h:60:#define	SIOCATHST	_IOWR('r', 78, struct fr_authstat)
156 
157 netinet/ip_nat.h:22:#define	SIOCADNAT	_IOW('r', 80, struct ipnat)
158 netinet/ip_nat.h:23:#define	SIOCRMNAT	_IOW('r', 81, struct ipnat)
159 
160 netinet/ip_nat.h:24:#define	SIOCGNATS	_IOR('r', 82, struct natstat)
161 
162 netinet/ip_nat.h:25:#define	SIOCGNATL	_IOWR('r', 83, struct natlookup)
163 
164 netinet/ip_nat.h:26:#define SIOCGFRST	_IOR('r', 84, struct ipfrstat)
165 
166 netinet/ip_nat.h:27:#define SIOCGIPST	_IOR('r', 85, struct ips_stat)
167 
168 sys/lkm.h:286:#define	LMRESERV	_IOWR('K', 0, struct lmc_resrv)
169 
170 sys/lkm.h:287:#define	LMLOADBUF	_IOW('K', 1, struct lmc_loadbuf)
171 
172 sys/lkm.h:291:#define	LMLOAD		_IOW('K', 9, struct lmc_load)
173 
174 sys/lkm.h:292:#define	LMUNLOAD	_IOWR('K', 10, struct lmc_unload)
175 
176 sys/lkm.h:293:#define	LMSTAT		_IOWR('K', 11, struct lmc_stat)
177 
178 sys/rnd.h:186:#define RNDGETPOOL      _IOR('R',  103, u_char *)  /* get whole pool */
179 
180 sys/scanio.h:86:#define SCIOCGET	_IOR('S', 1, struct scan_io) /* retrieve parameters */
181 sys/scanio.h:87:#define SCIOCSET	_IOW('S', 2, struct scan_io) /* set parameters */
182 
183 sys/scsiio.h:43:#define SCIOCCOMMAND	_IOWR('Q', 1, scsireq_t)
184 #endif
185 
186 /* from <net/if.h> */
187 
188 typedef int32_t netbsd32_ifreq_tp_t;
189 /*
190  * note that ifr_data is the only one that needs to be changed
191  */
192 struct	netbsd32_ifreq {
193 	char	ifr_name[IFNAMSIZ];		/* if name, e.g. "en0" */
194 	union {
195 		struct	sockaddr ifru_addr;
196 		struct	sockaddr ifru_dstaddr;
197 		struct	sockaddr ifru_broadaddr;
198 		short	ifru_flags;
199 		int	ifru_metric;
200 		int	ifru_mtu;
201 		netbsd32_caddr_t	ifru_data;
202 	} ifr_ifru;
203 #define	ifr_addr	ifr_ifru.ifru_addr	/* address */
204 #define	ifr_dstaddr	ifr_ifru.ifru_dstaddr	/* other end of p-to-p link */
205 #define	ifr_broadaddr	ifr_ifru.ifru_broadaddr	/* broadcast address */
206 #define	ifr_flags	ifr_ifru.ifru_flags	/* flags */
207 #define	ifr_metric	ifr_ifru.ifru_metric	/* metric */
208 #define	ifr_mtu		ifr_ifru.ifru_mtu	/* mtu */
209 #define	ifr_media	ifr_ifru.ifru_metric	/* media options (overload) */
210 #define	ifr_data	ifr_ifru.ifru_data	/* for use by interface */
211 };
212 #if 1
213 /* from <dev/pci/if_devar.h> */
214 #define	SIOCGADDRROM32		_IOW('i', 240, struct netbsd32_ifreq)	/* get 128 bytes of ROM */
215 #define	SIOCGCHIPID32		_IOWR('i', 241, struct netbsd32_ifreq)	/* get chipid */
216 /* from <sys/sockio.h> */
217 #define	SIOCSIFADDR32	 _IOW('i', 12, struct netbsd32_ifreq)	/* set ifnet address */
218 #define	OSIOCGIFADDR32	_IOWR('i', 13, struct netbsd32_ifreq)	/* get ifnet address */
219 #define	SIOCGIFADDR32	_IOWR('i', 33, struct netbsd32_ifreq)	/* get ifnet address */
220 #define	SIOCSIFDSTADDR32	 _IOW('i', 14, struct netbsd32_ifreq)	/* set p-p address */
221 #define	OSIOCGIFDSTADDR32	_IOWR('i', 15, struct netbsd32_ifreq)	/* get p-p address */
222 #define	SIOCGIFDSTADDR32	_IOWR('i', 34, struct netbsd32_ifreq)	/* get p-p address */
223 #define	SIOCSIFFLAGS32	 _IOW('i', 16, struct netbsd32_ifreq)	/* set ifnet flags */
224 #define	SIOCGIFFLAGS32	_IOWR('i', 17, struct netbsd32_ifreq)	/* get ifnet flags */
225 #define	OSIOCGIFBRDADDR32	_IOWR('i', 18, struct netbsd32_ifreq)	/* get broadcast addr */
226 #define	SIOCGIFBRDADDR32	_IOWR('i', 35, struct netbsd32_ifreq)	/* get broadcast addr */
227 #define	SIOCSIFBRDADDR32	 _IOW('i', 19, struct netbsd32_ifreq)	/* set broadcast addr */
228 #define	OSIOCGIFNETMASK32	_IOWR('i', 21, struct netbsd32_ifreq)	/* get net addr mask */
229 #define	SIOCGIFNETMASK32	_IOWR('i', 37, struct netbsd32_ifreq)	/* get net addr mask */
230 #define	SIOCSIFNETMASK32	 _IOW('i', 22, struct netbsd32_ifreq)	/* set net addr mask */
231 #define	SIOCGIFMETRIC32	_IOWR('i', 23, struct netbsd32_ifreq)	/* get IF metric */
232 #define	SIOCSIFMETRIC32	 _IOW('i', 24, struct netbsd32_ifreq)	/* set IF metric */
233 #define	SIOCDIFADDR32	 _IOW('i', 25, struct netbsd32_ifreq)	/* delete IF addr */
234 #define	SIOCADDMULTI32	 _IOW('i', 49, struct netbsd32_ifreq)	/* add m'cast addr */
235 #define	SIOCDELMULTI32	 _IOW('i', 50, struct netbsd32_ifreq)	/* del m'cast addr */
236 #define	SIOCSIFMEDIA32	_IOWR('i', 53, struct netbsd32_ifreq)	/* set net media */
237 #define	SIOCSIFMTU32	 _IOW('i', 127, struct netbsd32_ifreq)	/* set ifnet mtu */
238 #define	SIOCGIFMTU32	_IOWR('i', 126, struct netbsd32_ifreq)	/* get ifnet mtu */
239 #define	SIOCSIFASYNCMAP32  _IOW('i', 125, struct netbsd32_ifreq)	/* set ppp asyncmap */
240 #define	SIOCGIFASYNCMAP32 _IOWR('i', 124, struct netbsd32_ifreq)	/* get ppp asyncmap */
241 /* from <net/bpf.h> */
242 #define BIOCGETIF32	_IOR('B',107, struct netbsd32_ifreq)
243 #define BIOCSETIF32	_IOW('B',108, struct netbsd32_ifreq)
244 /* from <netatalk/phase2.h> */
245 #define SIOCPHASE1_32	_IOW('i', 100, struct netbsd32_ifreq)	/* AppleTalk phase 1 */
246 #define SIOCPHASE2_32	_IOW('i', 101, struct netbsd32_ifreq)	/* AppleTalk phase 2 */
247 #endif
248 
249 /* from <net/if.h> */
250 struct	netbsd32_ifconf {
251 	int	ifc_len;		/* size of associated buffer */
252 	union {
253 		netbsd32_caddr_t	ifcu_buf;
254 		netbsd32_ifreq_tp_t ifcu_req;
255 	} ifc_ifcu;
256 #define	ifc_buf	ifc_ifcu.ifcu_buf	/* buffer address */
257 #define	ifc_req	ifc_ifcu.ifcu_req	/* array of structures returned */
258 };
259 #if 1
260 /* from <sys/sockio.h> */
261 #define	OSIOCGIFCONF32	_IOWR('i', 20, struct netbsd32_ifconf)	/* get ifnet list */
262 #define	SIOCGIFCONF32	_IOWR('i', 36, struct netbsd32_ifconf)	/* get ifnet list */
263 #endif
264 
265 /* from <net/if.h> */
266 struct netbsd32_ifmediareq {
267 	char	ifm_name[IFNAMSIZ];		/* if name, e.g. "en0" */
268 	int	ifm_current;			/* current media options */
269 	int	ifm_mask;			/* don't care mask */
270 	int	ifm_status;			/* media status */
271 	int	ifm_active;			/* active options */
272 	int	ifm_count;			/* # entries in ifm_ulist
273 						   array */
274 	netbsd32_intp	ifm_ulist;		/* media words */
275 };
276 #if 1
277 /* from <sys/sockio.h> */
278 #define	SIOCGIFMEDIA32	_IOWR('i', 54, struct netbsd32_ifmediareq) /* get net media */
279 #endif
280 
281 /* from <net/if.h> */
282 struct  netbsd32_ifdrv {
283 	char		ifd_name[IFNAMSIZ];	/* if name, e.g. "en0" */
284 	unsigned long	ifd_cmd;
285 	size_t		ifd_len;
286 	void		*ifd_data;
287 };
288 #if 1
289 /* from <sys/sockio.h> */
290 #define SIOCSDRVSPEC32	_IOW('i', 123, struct netbsd32_ifdrv)   /* set driver-specific */
291 #endif
292 
293 /* from <netinet/ip_mroute.h> */
294 struct netbsd32_sioc_vif_req {
295 	vifi_t	vifi;			/* vif number */
296 	netbsd32_u_long	icount;		/* input packet count on vif */
297 	netbsd32_u_long	ocount;		/* output packet count on vif */
298 	netbsd32_u_long	ibytes;		/* input byte count on vif */
299 	netbsd32_u_long	obytes;		/* output byte count on vif */
300 };
301 #if 1
302 /* from <sys/sockio.h> */
303 #define	SIOCGETVIFCNT32	_IOWR('u', 51, struct netbsd32_sioc_vif_req)/* vif pkt cnt */
304 #endif
305 
306 struct netbsd32_sioc_sg_req {
307 	struct	in_addr src;
308 	struct	in_addr grp;
309 	u_long	pktcnt;
310 	u_long	bytecnt;
311 	u_long	wrong_if;
312 };
313 #if 1
314 /* from <sys/sockio.h> */
315 #define	SIOCGETSGCNT32	_IOWR('u', 52, struct netbsd32_sioc_sg_req) /* sg pkt cnt */
316 #endif
317