1 /*        $NetBSD: sunos.h,v 1.24 2015/09/06 06:00:59 dholland Exp $  */
2 
3 #ifndef _COMPAT_SUNOS_SUNOS_H_
4 #define _COMPAT_SUNOS_SUNOS_H_
5 
6 #include <sys/ioccom.h>
7 
8 /* used to ensure `struct sunos' types rename constantly sized. */
9 #ifdef __arch64__
10 typedef u_int32_t   sunos_charp;
11 #else
12 typedef char *                sunos_charp;
13 #endif
14 
15 typedef long        sunos_time_t;
16 
17 #define   SUNM_RDONLY         0x01      /* mount fs read-only */
18 #define   SUNM_NOSUID         0x02      /* mount fs with setuid disallowed */
19 #define   SUNM_NEWTYPE        0x04      /* type is string (char *), not int */
20 #define   SUNM_GRPID          0x08      /* (bsd semantics; ignored) */
21 #define   SUNM_REMOUNT        0x10      /* update existing mount */
22 #define   SUNM_NOSUB          0x20      /* prevent submounts (rejected) */
23 #define   SUNM_MULTI          0x40      /* (ignored) */
24 #define   SUNM_SYS5 0x80      /* Sys 5-specific semantics (rejected) */
25 
26 struct sunos_nfs_args {
27           struct    sockaddr_in *addr;  /* file server address */
28           void *    fh;                           /* file handle to be mounted */
29           int       flags;                        /* flags */
30           int       wsize;                        /* write size in bytes */
31           int       rsize;                        /* read size in bytes */
32           int       timeo;                        /* initial timeout in .1 secs */
33           int       retrans;            /* times to retry send */
34           sunos_charp hostname;                   /* server's hostname */
35           int       acregmin;           /* attr cache file min secs */
36           int       acregmax;           /* attr cache file max secs */
37           int       acdirmin;           /* attr cache dir min secs */
38           int       acdirmax;           /* attr cache dir max secs */
39           sunos_charp netname;                    /* server's netname */
40           struct    pathcnf *pathconf;  /* static pathconf kludge */
41 };
42 /* SunOS nfs flag values: */
43 #define SUNNFS_SOFT 0x1
44 #define SUNNFS_WSIZE          0x2
45 #define SUNNFS_RSIZE          0x4
46 #define SUNNFS_TIMEO          0x8
47 #define SUNNFS_RETRANS        0x10
48 #define SUNNFS_HOSTNAME       0x20
49 #define SUNNFS_INT  0x40
50 #define SUNNFS_NOAC 0x80
51 #define SUNNFS_ACREGMIN       0x100
52 #define SUNNFS_ACREGMAX       0x200
53 #define SUNNFS_ACDIRMIN       0x400
54 #define SUNNFS_ACDIRMAX       0x800
55 #define SUNNFS_SECURE         0x1000
56 #define SUNNFS_NOCTO          0x2000
57 #define SUNNFS_POSIX          0x4000
58 
59 
60 struct sunos_ustat {
61           int32_t   f_tfree;  /* total free */
62           uint32_t f_tinode;  /* total inodes free */
63           char      f_path[6];          /* filsys name */
64           char      f_fpack[6];         /* filsys pack name */
65 };
66 
67 struct sunos_statfs {
68           int       f_type;             /* type of info, zero for now */
69           int       f_bsize;  /* fundamental file system block size */
70           int       f_blocks; /* total blocks in file system */
71           int       f_bfree;  /* free blocks */
72           int       f_bavail; /* free blocks available to non-super-user */
73           int       f_files;  /* total file nodes in file system */
74           int       f_ffree;  /* free file nodes in fs */
75           fsid_t    f_fsid;             /* file system id */
76           int       f_spare[7];         /* spare for later */
77 };
78 
79 
80 struct sunos_utsname {
81           char    sysname[9];
82           char    nodename[9];
83           char    nodeext[65-9];
84           char    release[9];
85           char    version[9];
86           char    machine[9];
87 };
88 
89 
90 struct sunos_ttysize {
91           int       ts_row;
92           int       ts_col;
93 };
94 
95 struct sunos_termio {
96           u_short   c_iflag;
97           u_short   c_oflag;
98           u_short   c_cflag;
99           u_short   c_lflag;
100           char      c_line;
101           unsigned char c_cc[8];
102 };
103 #define SUNOS_TCGETA          _IOR('T', 1, struct sunos_termio)
104 #define SUNOS_TCSETA          _IOW('T', 2, struct sunos_termio)
105 #define SUNOS_TCSETAW         _IOW('T', 3, struct sunos_termio)
106 #define SUNOS_TCSETAF         _IOW('T', 4, struct sunos_termio)
107 #define SUNOS_TCSBRK          _IO('T', 5)
108 
109 struct sunos_termios {
110           u_int     c_iflag;
111           u_int     c_oflag;
112           u_int     c_cflag;
113           u_int     c_lflag;
114           char      c_line;
115           u_char    c_cc[17];
116 };
117 #define SUNOS_TCXONC          _IO('T', 6)
118 #define SUNOS_TCFLSH          _IO('T', 7)
119 #define SUNOS_TCGETS          _IOR('T', 8, struct sunos_termios)
120 #define SUNOS_TCSETS          _IOW('T', 9, struct sunos_termios)
121 #define SUNOS_TCSETSW         _IOW('T', 10, struct sunos_termios)
122 #define SUNOS_TCSETSF         _IOW('T', 11, struct sunos_termios)
123 #define SUNOS_TCSNDBRK        _IO('T', 12)
124 #define SUNOS_TCDRAIN         _IO('T', 13)
125 
126 /* Sun audio compatibility */
127 struct sunos_audio_prinfo {
128           u_int     sample_rate;
129           u_int     channels;
130           u_int     precision;
131           u_int     encoding;
132           u_int     gain;
133           u_int     port;
134           u_int     avail_ports;
135           u_int     reserved0[3];
136           u_int     samples;
137           u_int     eof;
138           u_char    pause;
139           u_char    error;
140           u_char    waiting;
141           u_char    balance;
142           u_short   minordev;
143           u_char    open;
144           u_char    active;
145 };
146 struct sunos_audio_info {
147           struct sunos_audio_prinfo play;
148           struct sunos_audio_prinfo record;
149           u_int monitor_gain;
150           u_int reserved[4];
151 };
152 
153 /* Values for AUDIO_GETDEV ioctl: */
154 #define SUNOS_AUDIO_DEV_UNKNOWN                             0
155 #define SUNOS_AUDIO_DEV_AMD                       1
156 #define SUNOS_AUDIO_DEV_SPEAKERBOX                2
157 #define SUNOS_AUDIO_DEV_CODEC                     3
158 
159 __BEGIN_DECLS
160 /* Defined in arch/<arch>/sunos_machdep.c */
161 void      sunos_sendsig(const ksiginfo_t *, const sigset_t *);
162 __END_DECLS
163 
164 #endif /* _COMPAT_SUNOS_SUNOS_H_ */
165