Home | History | Annotate | Line # | Download | only in netbsd32
netbsd32_ioctl.h revision 1.1
      1 /*	$NetBSD: netbsd32_ioctl.h,v 1.1 1998/08/26 10:20:36 mrg 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 struct sparc32_fbcmap {
     38 	int	index;		/* first element (0 origin) */
     39 	int	count;		/* number of elements */
     40 	sparc32_u_charp	red;		/* red color map elements */
     41 	sparc32_u_charp	green;		/* green color map elements */
     42 	sparc32_u_charp	blue;		/* blue color map elements */
     43 };
     44 #if 0
     45 #define	FBIOPUTCMAP	_IOW('F', 3, struct fbcmap)
     46 #define	FBIOGETCMAP	_IOW('F', 4, struct fbcmap)
     47 #endif
     48 
     49 struct sparc32_fbcursor {
     50 	short set;		/* what to set */
     51 	short enable;		/* enable/disable cursor */
     52 	struct fbcurpos pos;	/* cursor's position */
     53 	struct fbcurpos hot;	/* cursor's hot spot */
     54 	struct sparc32_fbcmap cmap;	/* color map info */
     55 	struct fbcurpos size;	/* cursor's bit map size */
     56 	sparc32_charp image;	/* cursor's image bits */
     57 	sparc32_charp mask;	/* cursor's mask bits */
     58 };
     59 #if 0
     60 #define FBIOSCURSOR	_IOW('F', 24, struct fbcursor)
     61 #define FBIOGCURSOR	_IOWR('F', 25, struct fbcursor)
     62 #endif
     63 
     64 /* from arch/sparc/include/openpromio.h */
     65 struct sparc32_opiocdesc {
     66 	int	op_nodeid;		/* passed or returned node id */
     67 	int	op_namelen;		/* length of op_name */
     68 	sparc32_charp op_name;		/* pointer to field name */
     69 	int	op_buflen;		/* length of op_buf (value-result) */
     70 	sparc32_charp op_buf;		/* pointer to field value */
     71 };
     72 #if 0
     73 #define	OPIOCGET	_IOWR('O', 1, struct opiocdesc) /* get openprom field */
     74 #define	OPIOCSET	_IOW('O', 2, struct opiocdesc) /* set openprom field */
     75 #define	OPIOCNEXTPROP	_IOWR('O', 3, struct opiocdesc) /* get next property */
     76 #endif
     77 
     78 /* from <sys/audioio.h> */
     79 #if 0
     80 #define AUDIO_WSEEK	_IOR('A', 25, u_long)
     81 #endif
     82 
     83 /* from <sys/dkio.h> */
     84 typedef int32_t sparc32_disklabel_tp_t;
     85 typedef int32_t sparc32_partition_tp_t;
     86 struct sparc32_partinfo {
     87 	sparc32_disklabel_tp_t disklab;
     88 	sparc32_partition_tp_t part;
     89 };
     90 #if 0
     91 #define DIOCGPART	_IOW('d', 104, struct partinfo)	/* get partition */
     92 #endif
     93 
     94 struct sparc32_format_op {
     95 	sparc32_charp df_buf;
     96 	int	 df_count;		/* value-result */
     97 	daddr_t	 df_startblk;
     98 	int	 df_reg[8];		/* result */
     99 };
    100 #if 0
    101 #define DIOCRFORMAT	_IOWR('d', 105, struct format_op)
    102 #define DIOCWFORMAT	_IOWR('d', 106, struct format_op)
    103 #endif
    104 
    105 /* can wait! */
    106 #if 0
    107 dev/ccdvar.h:219:#define CCDIOCSET	_IOWR('F', 16, struct ccd_ioctl)   /* enable ccd */
    108 dev/ccdvar.h:220:#define CCDIOCCLR	_IOW('F', 17, struct ccd_ioctl)    /* disable ccd */
    109 
    110 dev/md.h:45:#define MD_GETCONF	_IOR('r', 0, struct md_conf)	/* get unit config */
    111 dev/md.h:46:#define MD_SETCONF	_IOW('r', 1, struct md_conf)	/* set unit config */
    112 
    113 dev/wscons/wsconsio.h:133:#define WSKBDIO_GETMAP		_IOWR('W', 13, struct wskbd_map_data)
    114 dev/wscons/wsconsio.h:134:#define WSKBDIO_SETMAP		_IOW('W', 14, struct wskbd_map_data)
    115 
    116 dev/wscons/wsconsio.h:188:#define WSDISPLAYIO_GETCMAP	_IOW('W', 66, struct wsdisplay_cmap)
    117 dev/wscons/wsconsio.h:189:#define WSDISPLAYIO_PUTCMAP	_IOW('W', 67, struct wsdisplay_cmap)
    118 
    119 dev/wscons/wsconsio.h:227:#define	WSDISPLAYIO_GCURSOR	_IOWR('W', 73, struct wsdisplay_cursor)
    120 dev/wscons/wsconsio.h:228:#define	WSDISPLAYIO_SCURSOR	_IOW('W', 74, struct wsdisplay_cursor)
    121 
    122 dev/wscons/wsconsio.h:241:#define WSDISPLAYIO_SFONT	_IOW('W', 77, struct wsdisplay_font)
    123 
    124 net/bpf.h:127:#define	BIOCSETF	_IOW('B',103, struct bpf_program)
    125 net/bpf.h:138:#define BIOCSTCPF	_IOW('B',114, struct bpf_program)
    126 net/bpf.h:139:#define BIOCSUDPF	_IOW('B',115, struct bpf_program)
    127 net/if_ppp.h:110:#define PPPIOCSPASS	_IOW('t', 71, struct bpf_program) /* set pass filter */
    128 net/if_ppp.h:111:#define PPPIOCSACTIVE	_IOW('t', 70, struct bpf_program) /* set active filt */
    129 
    130 net/if_atm.h:88:#define SIOCATMENA	_IOWR('a', 123, struct atm_pseudoioctl) /* enable */
    131 net/if_atm.h:89:#define SIOCATMDIS	_IOWR('a', 124, struct atm_pseudoioctl) /* disable */
    132 
    133 net/if_ppp.h:105:#define PPPIOCSCOMPRESS	_IOW('t', 77, struct ppp_option_data)
    134 
    135 netccitt/x25.h:157:#define	SIOCSIFCONF_X25	_IOW('i', 12, struct ifreq_x25)	/* set ifnet config */
    136 netccitt/x25.h:158:#define	SIOCGIFCONF_X25	_IOWR('i',13, struct ifreq_x25)	/* get ifnet config */
    137 
    138 netinet/ip_fil.h:46:#define	SIOCGETFS	_IOR('r', 64, struct friostat)
    139 netinet/ip_fil.h:56:#define	SIOCFRZST	_IOWR('r', 74, struct friostat)
    140 
    141 netinet/ip_fil.h:42:#define	SIOCADAFR	_IOW('r', 60, struct frentry)
    142 netinet/ip_fil.h:43:#define	SIOCRMAFR	_IOW('r', 61, struct frentry)
    143 netinet/ip_fil.h:49:#define	SIOCADIFR	_IOW('r', 67, struct frentry)
    144 netinet/ip_fil.h:50:#define	SIOCRMIFR	_IOW('r', 68, struct frentry)
    145 netinet/ip_fil.h:52:#define	SIOCINAFR	_IOW('r', 70, struct frentry)
    146 netinet/ip_fil.h:53:#define	SIOCINIFR	_IOW('r', 71, struct frentry)
    147 netinet/ip_fil.h:57:#define	SIOCZRLST	_IOWR('r', 75, struct frentry)
    148 
    149 netinet/ip_fil.h:78:#define	SIOCAUTHW	_IOWR(r, 76, struct fr_info)
    150 netinet/ip_fil.h:79:#define	SIOCAUTHR	_IOWR(r, 77, struct fr_info)
    151 
    152 netinet/ip_fil.h:60:#define	SIOCATHST	_IOWR('r', 78, struct fr_authstat)
    153 
    154 netinet/ip_nat.h:22:#define	SIOCADNAT	_IOW('r', 80, struct ipnat)
    155 netinet/ip_nat.h:23:#define	SIOCRMNAT	_IOW('r', 81, struct ipnat)
    156 
    157 netinet/ip_nat.h:24:#define	SIOCGNATS	_IOR('r', 82, struct natstat)
    158 
    159 netinet/ip_nat.h:25:#define	SIOCGNATL	_IOWR('r', 83, struct natlookup)
    160 
    161 netinet/ip_nat.h:26:#define SIOCGFRST	_IOR('r', 84, struct ipfrstat)
    162 
    163 netinet/ip_nat.h:27:#define SIOCGIPST	_IOR('r', 85, struct ips_stat)
    164 
    165 sys/lkm.h:286:#define	LMRESERV	_IOWR('K', 0, struct lmc_resrv)
    166 
    167 sys/lkm.h:287:#define	LMLOADBUF	_IOW('K', 1, struct lmc_loadbuf)
    168 
    169 sys/lkm.h:291:#define	LMLOAD		_IOW('K', 9, struct lmc_load)
    170 
    171 sys/lkm.h:292:#define	LMUNLOAD	_IOWR('K', 10, struct lmc_unload)
    172 
    173 sys/lkm.h:293:#define	LMSTAT		_IOWR('K', 11, struct lmc_stat)
    174 
    175 sys/rnd.h:186:#define RNDGETPOOL      _IOR('R',  103, u_char *)  /* get whole pool */
    176 
    177 sys/scanio.h:86:#define SCIOCGET	_IOR('S', 1, struct scan_io) /* retrieve parameters */
    178 sys/scanio.h:87:#define SCIOCSET	_IOW('S', 2, struct scan_io) /* set parameters */
    179 
    180 sys/scsiio.h:43:#define SCIOCCOMMAND	_IOWR('Q', 1, scsireq_t)
    181 #endif
    182 
    183 /* from <net/if.h> */
    184 
    185 typedef int32_t sparc32_ifreq_tp_t;
    186 /*
    187  * note that ifr_data is the only one that needs to be changed
    188  */
    189 struct	sparc32_ifreq {
    190 	char	ifr_name[IFNAMSIZ];		/* if name, e.g. "en0" */
    191 	union {
    192 		struct	sockaddr ifru_addr;
    193 		struct	sockaddr ifru_dstaddr;
    194 		struct	sockaddr ifru_broadaddr;
    195 		short	ifru_flags;
    196 		int	ifru_metric;
    197 		int	ifru_mtu;
    198 		sparc32_caddr_t	ifru_data;
    199 	} ifr_ifru;
    200 #define	ifr_addr	ifr_ifru.ifru_addr	/* address */
    201 #define	ifr_dstaddr	ifr_ifru.ifru_dstaddr	/* other end of p-to-p link */
    202 #define	ifr_broadaddr	ifr_ifru.ifru_broadaddr	/* broadcast address */
    203 #define	ifr_flags	ifr_ifru.ifru_flags	/* flags */
    204 #define	ifr_metric	ifr_ifru.ifru_metric	/* metric */
    205 #define	ifr_mtu		ifr_ifru.ifru_mtu	/* mtu */
    206 #define	ifr_media	ifr_ifru.ifru_metric	/* media options (overload) */
    207 #define	ifr_data	ifr_ifru.ifru_data	/* for use by interface */
    208 };
    209 #if 0
    210 /* from <dev/pci/if_devar.h>
    211 #define	SIOCGADDRROM		_IOW('i', 240, struct ifreq)	/* get 128 bytes of ROM */
    212 #define	SIOCGCHIPID		_IOWR('i', 241, struct ifreq)	/* get chipid */
    213 /* from <sys/sockio.h>
    214 #define	SIOCSIFADDR	 _IOW('i', 12, struct ifreq)	/* set ifnet address */
    215 #define	OSIOCGIFADDR	_IOWR('i', 13, struct ifreq)	/* get ifnet address */
    216 #define	SIOCGIFADDR	_IOWR('i', 33, struct ifreq)	/* get ifnet address */
    217 #define	SIOCSIFDSTADDR	 _IOW('i', 14, struct ifreq)	/* set p-p address */
    218 #define	OSIOCGIFDSTADDR	_IOWR('i', 15, struct ifreq)	/* get p-p address */
    219 #define	SIOCGIFDSTADDR	_IOWR('i', 34, struct ifreq)	/* get p-p address */
    220 #define	SIOCSIFFLAGS	 _IOW('i', 16, struct ifreq)	/* set ifnet flags */
    221 #define	SIOCGIFFLAGS	_IOWR('i', 17, struct ifreq)	/* get ifnet flags */
    222 #define	OSIOCGIFBRDADDR	_IOWR('i', 18, struct ifreq)	/* get broadcast addr */
    223 #define	SIOCGIFBRDADDR	_IOWR('i', 35, struct ifreq)	/* get broadcast addr */
    224 #define	SIOCSIFBRDADDR	 _IOW('i', 19, struct ifreq)	/* set broadcast addr */
    225 #define	OSIOCGIFNETMASK	_IOWR('i', 21, struct ifreq)	/* get net addr mask */
    226 #define	SIOCGIFNETMASK	_IOWR('i', 37, struct ifreq)	/* get net addr mask */
    227 #define	SIOCSIFNETMASK	 _IOW('i', 22, struct ifreq)	/* set net addr mask */
    228 #define	SIOCGIFMETRIC	_IOWR('i', 23, struct ifreq)	/* get IF metric */
    229 #define	SIOCSIFMETRIC	 _IOW('i', 24, struct ifreq)	/* set IF metric */
    230 #define	SIOCDIFADDR	 _IOW('i', 25, struct ifreq)	/* delete IF addr */
    231 #define	SIOCADDMULTI	 _IOW('i', 49, struct ifreq)	/* add m'cast addr */
    232 #define	SIOCDELMULTI	 _IOW('i', 50, struct ifreq)	/* del m'cast addr */
    233 #define	SIOCSIFMEDIA	_IOWR('i', 53, struct ifreq)	/* set net media */
    234 #define	SIOCSIFMTU	 _IOW('i', 127, struct ifreq)	/* set ifnet mtu */
    235 #define	SIOCGIFMTU	_IOWR('i', 126, struct ifreq)	/* get ifnet mtu */
    236 #define	SIOCSIFASYNCMAP  _IOW('i', 125, struct ifreq)	/* set ppp asyncmap */
    237 #define	SIOCGIFASYNCMAP _IOWR('i', 124, struct ifreq)	/* get ppp asyncmap */
    238 /* from <net/bpf.h> */
    239 #define BIOCGETIF	_IOR('B',107, struct ifreq)
    240 #define BIOCSETIF	_IOW('B',108, struct ifreq)
    241 /* from <netatalk/phase2.h>
    242 #define SIOCPHASE1	_IOW('i', 100, struct ifreq)	/* AppleTalk phase 1 */
    243 #define SIOCPHASE2	_IOW('i', 101, struct ifreq)	/* AppleTalk phase 2 */
    244 #endif
    245 
    246 /* from <net/if.h> */
    247 struct	sparc32_ifconf {
    248 	int	ifc_len;		/* size of associated buffer */
    249 	union {
    250 		sparc32_caddr_t	ifcu_buf;
    251 		sparc32_ifreq_tp_t ifcu_req;
    252 	} ifc_ifcu;
    253 #define	ifc_buf	ifc_ifcu.ifcu_buf	/* buffer address */
    254 #define	ifc_req	ifc_ifcu.ifcu_req	/* array of structures returned */
    255 };
    256 #if 0
    257 /* from <sys/sockio.h> */
    258 #define	OSIOCGIFCONF	_IOWR('i', 20, struct ifconf)	/* get ifnet list */
    259 #define	SIOCGIFCONF	_IOWR('i', 36, struct ifconf)	/* get ifnet list */
    260 #endif
    261 
    262 /* from <net/if.h> */
    263 struct sparc32_ifmediareq {
    264 	char	ifm_name[IFNAMSIZ];		/* if name, e.g. "en0" */
    265 	int	ifm_current;			/* current media options */
    266 	int	ifm_mask;			/* don't care mask */
    267 	int	ifm_status;			/* media status */
    268 	int	ifm_active;			/* active options */
    269 	int	ifm_count;			/* # entries in ifm_ulist
    270 						   array */
    271 	sparc32_intp	ifm_ulist;		/* media words */
    272 };
    273 #if 0
    274 /* from <sys/sockio.h> */
    275 #define	SIOCGIFMEDIA	_IOWR('i', 54, struct ifmediareq) /* get net media */
    276 #endif
    277 
    278 /* from <net/if.h> */
    279 struct  sparc32_ifdrv {
    280 	char		ifd_name[IFNAMSIZ];	/* if name, e.g. "en0" */
    281 	unsigned long	ifd_cmd;
    282 	size_t		ifd_len;
    283 	void		*ifd_data;
    284 };
    285 #if 0
    286 /* from <sys/sockio.h> */
    287 #define SIOCSDRVSPEC     _IOW('i', 123, struct ifdrv)   /* set driver-specific */
    288 #endif
    289 
    290 /* from <netinet/ip_mroute.h> */
    291 struct sparc32_sioc_vif_req {
    292 	vifi_t	vifi;			/* vif number */
    293 	sparc32_u_long	icount;		/* input packet count on vif */
    294 	sparc32_u_long	ocount;		/* output packet count on vif */
    295 	sparc32_u_long	ibytes;		/* input byte count on vif */
    296 	sparc32_u_long	obytes;		/* output byte count on vif */
    297 };
    298 #if 0
    299 /* from <sys/sockio.h> */
    300 #define	SIOCGETVIFCNT	_IOWR('u', 51, struct sioc_vif_req)/* vif pkt cnt */
    301 #endif
    302 
    303 struct sparc32_sioc_sg_req {
    304 	struct	in_addr src;
    305 	struct	in_addr grp;
    306 	u_long	pktcnt;
    307 	u_long	bytecnt;
    308 	u_long	wrong_if;
    309 };
    310 #if 0
    311 /* from <sys/sockio.h> */
    312 #define	SIOCGETSGCNT	_IOWR('u', 52, struct sioc_sg_req) /* sg pkt cnt */
    313 #endif
    314