Symbol: ch
bin/cat/cat.c
159
int ch;
bin/cat/cat.c
164
while ((ch = getopt(argc, argv, SUPPORTED_FLAGS)) != -1)
bin/cat/cat.c
165
switch (ch) {
bin/cat/cat.c
292
int ch, gobble, line, prev;
bin/cat/cat.c
300
for (prev = '\n'; (ch = getc(fp)) != EOF; prev = ch) {
bin/cat/cat.c
303
if (ch == '\n') {
bin/cat/cat.c
311
if (!bflag || ch != '\n') {
bin/cat/cat.c
322
if (ch == '\n') {
bin/cat/cat.c
325
} else if (ch == '\t') {
bin/cat/cat.c
332
(void)ungetc(ch, fp);
bin/cat/cat.c
342
if ((ch = getc(fp)) == EOF)
bin/cat/cat.c
344
wch = ch;
bin/cat/cat.c
356
ch = toascii(wch);
bin/cat/cat.c
357
ch = (ch == '\177') ? '?' : (ch | 0100);
bin/cat/cat.c
358
if (putchar('^') == EOF || putchar(ch) == EOF)
bin/cat/cat.c
364
ch = -1;
bin/cat/cat.c
367
if (putchar(ch) == EOF)
bin/chflags/chflags.c
64
int ch, e, fts_options, oct, rval;
bin/chflags/chflags.c
68
while ((ch = getopt(argc, argv, "HLPRfhvx")) != -1)
bin/chflags/chflags.c
69
switch (ch) {
bin/chio/chio.c
123
int ch, i;
bin/chio/chio.c
125
while ((ch = getopt(argc, argv, "f:")) != -1) {
bin/chio/chio.c
126
switch (ch) {
bin/chmod/chmod.c
109
argv[optind - 1][1] == ch &&
bin/chmod/chmod.c
64
int Hflag, Lflag, Rflag, ch, fflag, fts_options, hflag, rval;
bin/chmod/chmod.c
71
while ((ch = getopt(argc, argv, "HLPRXfghorstuvwx")) != -1)
bin/chmod/chmod.c
72
switch (ch) {
bin/cp/cp.c
108
int ch, fts_options, r;
bin/cp/cp.c
113
while ((ch = getopt_long(argc, argv, "+HLPRafilNnprsvx", long_opts,
bin/cp/cp.c
115
switch (ch) {
bin/cp/utils.c
107
int ch, checkch, from_fd, rval, to_fd;
bin/cp/utils.c
153
checkch = ch = getchar();
bin/cp/utils.c
154
while (ch != '\n' && ch != EOF)
bin/cp/utils.c
155
ch = getchar();
bin/cpuset/cpuset.c
146
int ch;
bin/cpuset/cpuset.c
154
while ((ch = getopt(argc, argv, "Ccd:gij:l:n:p:rs:t:x:")) != -1) {
bin/cpuset/cpuset.c
155
switch (ch) {
bin/date/date.c
100
while ((ch = getopt(argc, argv, "f:I::jnRr:uv:z:")) != -1)
bin/date/date.c
101
switch((char)ch) {
bin/date/date.c
83
int ch, rflag;
bin/dd/conv.c
102
int ch;
bin/dd/conv.c
128
ch = 0;
bin/dd/conv.c
132
for (cnt = 0; cnt < maxlen && (ch = *inp++) != '\n';
bin/dd/conv.c
134
*outp++ = t[ch];
bin/dd/conv.c
136
for (cnt = 0; cnt < maxlen && (ch = *inp++) != '\n';
bin/dd/conv.c
138
*outp++ = ch;
bin/dd/conv.c
143
if (ch != '\n' && (size_t)in.dbcnt < cbsz) {
bin/dd/conv.c
150
if (ch == '\n')
bin/df/df.c
107
int ch, rv;
bin/df/df.c
119
while ((ch = getopt_long(argc, argv, "+abcgHhiklmnPt:T,", long_options,
bin/df/df.c
121
switch (ch) {
bin/domainname/domainname.c
45
int ch;
bin/domainname/domainname.c
48
while ((ch = getopt(argc, argv, "")) != -1)
bin/domainname/domainname.c
49
switch (ch) {
bin/getfacl/getfacl.c
228
int ch, error, i;
bin/getfacl/getfacl.c
237
while ((ch = getopt_long(argc, argv, "+dhinqsv", long_options,
bin/getfacl/getfacl.c
239
switch(ch) {
bin/hostname/hostname.c
45
int ch, sflag, dflag;
bin/hostname/hostname.c
50
while ((ch = getopt(argc, argv, "fsd")) != -1)
bin/hostname/hostname.c
51
switch (ch) {
bin/kenv/kenv.c
66
int ch, error;
bin/kenv/kenv.c
70
while ((ch = getopt(argc, argv, "hlNqsuv")) != -1) {
bin/kenv/kenv.c
71
switch (ch) {
bin/ln/ln.c
230
int ch, first;
bin/ln/ln.c
333
first = ch = getchar();
bin/ln/ln.c
334
while(ch != '\n' && ch != EOF)
bin/ln/ln.c
335
ch = getchar();
bin/ln/ln.c
66
int ch, exitval;
bin/ln/ln.c
90
while ((ch = getopt(argc, argv, "FLPfhinsvw")) != -1)
bin/ln/ln.c
91
switch (ch) {
bin/ls/ls.c
235
int ch, fts_options, notused;
bin/ls/ls.c
278
while ((ch = getopt_long(argc, argv,
bin/ls/ls.c
281
switch (ch) {
bin/ls/util.c
170
unsigned char ch;
bin/ls/util.c
198
ch = (unsigned char)s[i];
bin/ls/util.c
200
putchar('0' + (ch >> 6));
bin/ls/util.c
201
putchar('0' + ((ch >> 3) & 7));
bin/ls/util.c
202
putchar('0' + (ch & 7));
bin/mkdir/mkdir.c
52
int ch, exitval, success, pflag;
bin/mkdir/mkdir.c
59
while ((ch = getopt(argc, argv, "m:pv")) != -1)
bin/mkdir/mkdir.c
60
switch(ch) {
bin/mv/mv.c
164
int ask, ch, first;
bin/mv/mv.c
196
first = ch = getchar();
bin/mv/mv.c
197
while (ch != '\n' && ch != EOF)
bin/mv/mv.c
198
ch = getchar();
bin/mv/mv.c
73
int ch, rval;
bin/mv/mv.c
75
while ((ch = getopt(argc, argv, "fhinv")) != -1)
bin/mv/mv.c
76
switch (ch) {
bin/nproc/nproc.c
79
int ch, cpus, ignore;
bin/nproc/nproc.c
85
while ((ch = getopt_long(argc, argv, "", long_opts, NULL)) != -1) {
bin/nproc/nproc.c
86
switch (ch) {
bin/pax/cpio.h
106
#define SHRT_EXT(ch) ((((unsigned)(ch)[0])<<8) | (((unsigned)(ch)[1])&0xff))
bin/pax/cpio.h
107
#define RSHRT_EXT(ch) ((((unsigned)(ch)[1])<<8) | (((unsigned)(ch)[0])&0xff))
bin/pkill/pkill.c
137
int i, ch, bestidx, rv, criteria, pidfromfile, pidfilelock;
bin/pkill/pkill.c
188
while ((ch = getopt(argc, argv, "DF:G:ILM:N:P:SU:ac:d:fg:ij:lnoqs:t:u:vx")) != -1)
bin/pkill/pkill.c
189
switch (ch) {
bin/pkill/pkill.c
652
int ch, first;
bin/pkill/pkill.c
662
first = ch = getchar();
bin/pkill/pkill.c
663
while (ch != '\n' && ch != EOF)
bin/pkill/pkill.c
664
ch = getchar();
bin/ps/ps.c
179
int all, ch, elem, flag, _fmt, i, lineno, linelen, left;
bin/ps/ps.c
250
while ((ch = getopt(argc, argv, PS_ARGS)) != -1)
bin/ps/ps.c
251
switch (ch) {
bin/realpath/realpath.c
47
int ch, qflag, rval;
bin/realpath/realpath.c
50
while ((ch = getopt(argc, argv, "q")) != -1) {
bin/realpath/realpath.c
51
switch (ch) {
bin/rm/rm.c
389
int ch, first;
bin/rm/rm.c
420
first = ch = getchar();
bin/rm/rm.c
421
while (ch != '\n' && ch != EOF)
bin/rm/rm.c
422
ch = getchar();
bin/rm/rm.c
452
int ch;
bin/rm/rm.c
488
first = ch = getchar();
bin/rm/rm.c
489
while (ch != '\n' && ch != EOF)
bin/rm/rm.c
490
ch = getchar();
bin/rm/rm.c
491
if (ch == EOF)
bin/rm/rm.c
73
int ch;
bin/rm/rm.c
98
while ((ch = getopt(argc, argv, "dfiIPRrvWx")) != -1)
bin/rm/rm.c
99
switch(ch) {
bin/rmdir/rmdir.c
47
int ch, errors;
bin/rmdir/rmdir.c
49
while ((ch = getopt(argc, argv, "pv")) != -1)
bin/rmdir/rmdir.c
50
switch(ch) {
bin/setfacl/setfacl.c
352
int carried_error, ch, entry_number, fts_options;
bin/setfacl/setfacl.c
365
while ((ch = getopt(argc, argv, "HLM:PRX:a:bdhkm:nx:")) != -1)
bin/setfacl/setfacl.c
366
switch(ch) {
bin/sh/cd.c
329
int ch, phys;
bin/sh/cd.c
332
while ((ch = nextopt("LP")) != '\0') {
bin/sh/cd.c
333
switch (ch) {
bin/sh/cd.c
80
int ch, phys, print = 0, getcwderr = 0;
bin/sh/cd.c
85
while ((ch = nextopt("eLP")) != '\0') {
bin/sh/cd.c
86
switch (ch) {
bin/sh/eval.c
1259
int ch;
bin/sh/eval.c
1264
while ((ch = nextopt("pvV")) != '\0') {
bin/sh/eval.c
1265
switch (ch) {
bin/sh/expand.c
1506
int ch;
bin/sh/expand.c
1511
while ((ch = nextopt("f:p")) != '\0') {
bin/sh/expand.c
1512
switch (ch) {
bin/sh/histedit.c
772
sh_complete(EditLine *sel, int ch __unused)
bin/sh/jobs.c
314
int ch, mode;
bin/sh/jobs.c
317
while ((ch = nextopt("lps")) != '\0') {
bin/sh/jobs.c
318
switch (ch) {
bin/sh/output.c
111
byteseq(int ch, struct output *file)
bin/sh/output.c
116
seq[1] = (ch >> 6 & 0x3) + '0';
bin/sh/output.c
117
seq[2] = (ch >> 3 & 0x7) + '0';
bin/sh/output.c
118
seq[3] = (ch & 0x7) + '0';
bin/sh/var.c
653
int ch, values;
bin/sh/var.c
658
while ((ch = nextopt("p")) != '\0') {
bin/sh/var.c
659
switch (ch) {
bin/stty/stty.c
51
int ch;
bin/stty/stty.c
61
(ch = getopt(argc, argv, "aef:g")) != -1)
bin/stty/stty.c
62
switch(ch) {
bin/timeout/timeout.c
279
int ch, sig;
bin/timeout/timeout.c
299
while ((ch = getopt_long(argc, argv, optstr, longopts, NULL)) != -1) {
bin/timeout/timeout.c
300
switch (ch) {
bin/uuidgen/uuidgen.c
111
int ch, count, i, iterate, status, version;
bin/uuidgen/uuidgen.c
118
while ((ch = getopt(argc, argv, "1crn:o:")) != -1)
bin/uuidgen/uuidgen.c
119
switch (ch) {
cddl/usr.sbin/zfsd/case_file.cc
503
unsigned ch, numChildren;
cddl/usr.sbin/zfsd/case_file.cc
511
for (ch = 0; ch < numChildren; ch++) {
cddl/usr.sbin/zfsd/case_file.cc
513
Vdev vdev(pool_config, vdevChildren[ch]);
cddl/usr.sbin/zfsd/case_file.cc
518
result = find_parent(pool_config, vdevChildren[ch], child_guid);
cddl/usr.sbin/zfsd/zfsd_main.cc
72
int ch;
cddl/usr.sbin/zfsd/zfsd_main.cc
74
while ((ch = getopt(argc, argv, "d")) != -1) {
cddl/usr.sbin/zfsd/zfsd_main.cc
75
switch (ch) {
crypto/heimdal/appl/ftp/ftp/cmds.c
718
int ch, ointer;
crypto/heimdal/appl/ftp/ftp/cmds.c
740
for (tp2 = tmpbuf;(ch = (unsigned char)*tp++);)
crypto/heimdal/appl/ftp/ftp/cmds.c
741
*tp2++ = tolower(ch);
crypto/heimdal/appl/ftp/ftp/ftp.c
1079
int i, n, ch;
crypto/heimdal/appl/ftp/ftp/ftp.c
1085
if ((ch = sec_getc (fout)) == EOF)
crypto/heimdal/appl/ftp/ftp/ftp.c
1087
if (ch == '\n')
crypto/heimdal/appl/ftp/ftp/security.c
331
char ch = c;
crypto/heimdal/appl/ftp/ftp/security.c
335
buffer_write(&out_buffer, &ch, 1);
crypto/heimdal/appl/ftp/ftpd/security.c
331
char ch = c;
crypto/heimdal/appl/ftp/ftpd/security.c
335
buffer_write(&out_buffer, &ch, 1);
crypto/heimdal/appl/rcp/rcp.c
423
char ch, *cp, *np, *targ, *why, *vect[1], buf[BUFSIZ];
crypto/heimdal/appl/rcp/rcp.c
450
if (read(remin, &ch, sizeof(ch)) != sizeof(ch))
crypto/heimdal/appl/rcp/rcp.c
452
*cp++ = ch;
crypto/heimdal/appl/rcp/rcp.c
453
} while (cp < &buf[BUFSIZ - 1] && ch != '\n');
crypto/heimdal/appl/rcp/rcp.c
470
if (ch == '\n')
crypto/heimdal/appl/rcp/rcp.c
649
char ch, *cp, resp, rbuf[BUFSIZ];
crypto/heimdal/appl/rcp/rcp.c
664
if (read(remin, &ch, sizeof(ch)) != sizeof(ch))
crypto/heimdal/appl/rcp/rcp.c
666
*cp++ = ch;
crypto/heimdal/appl/rcp/rcp.c
667
} while (cp < &rbuf[BUFSIZ] && ch != '\n');
crypto/heimdal/appl/telnet/telnet/main.c
159
int ch;
crypto/heimdal/appl/telnet/telnet/main.c
196
while((ch = getopt(argc, argv,
crypto/heimdal/appl/telnet/telnet/main.c
198
switch(ch) {
crypto/heimdal/appl/telnet/telnet/main.c
270
forward_option = ch;
crypto/heimdal/appl/telnet/telnet/main.c
274
prompt, ch);
crypto/heimdal/appl/telnet/telnetd/state.c
196
cc_t ch;
crypto/heimdal/appl/telnet/telnetd/state.c
203
ch = *slctab[SLC_EC].sptr;
crypto/heimdal/appl/telnet/telnetd/state.c
205
ch = *slctab[SLC_EL].sptr;
crypto/heimdal/appl/telnet/telnetd/state.c
206
if (ch != (cc_t)(_POSIX_VDISABLE))
crypto/heimdal/appl/telnet/telnetd/state.c
207
*pfrontp++ = (unsigned char)ch;
crypto/heimdal/appl/telnet/telnetd/telnetd.c
153
int ch;
crypto/heimdal/appl/telnet/telnetd/telnetd.c
183
while ((ch = getopt(argc, argv, valid_opts)) != -1) {
crypto/heimdal/appl/telnet/telnetd/telnetd.c
184
switch(ch) {
crypto/heimdal/appl/telnet/telnetd/telnetd.c
343
fprintf(stderr, "telnetd: %c: unknown option\n", ch);
crypto/heimdal/lib/com_err/com_err.c
140
int ch;
crypto/heimdal/lib/com_err/com_err.c
151
ch = (num >> BITS_PER_CHAR * i) & ((1 << BITS_PER_CHAR) - 1);
crypto/heimdal/lib/com_err/com_err.c
152
if (ch != 0)
crypto/heimdal/lib/com_err/com_err.c
153
*p++ = char_set[ch-1];
crypto/heimdal/lib/roken/glob.c
797
g_strchr(const Char *str, int ch)
crypto/heimdal/lib/roken/glob.c
800
if (*str == ch)
crypto/heimdal/lib/roken/iruserok.c
118
while ((ch = getc(hostf)) != '\n' && ch != EOF);
crypto/heimdal/lib/roken/iruserok.c
93
int ch;
crypto/heimdal/lib/wind/utf8.c
181
uint32_t ch;
crypto/heimdal/lib/wind/utf8.c
185
ch = in[i];
crypto/heimdal/lib/wind/utf8.c
187
if (ch < 0x80) {
crypto/heimdal/lib/wind/utf8.c
189
} else if (ch < 0x800) {
crypto/heimdal/lib/wind/utf8.c
191
} else if (ch < 0x10000) {
crypto/heimdal/lib/wind/utf8.c
193
} else if (ch <= 0x10FFFF) {
crypto/heimdal/lib/wind/utf8.c
206
out[3] = (ch | 0x80) & 0xbf;
crypto/heimdal/lib/wind/utf8.c
207
ch = ch >> 6;
crypto/heimdal/lib/wind/utf8.c
209
out[2] = (ch | 0x80) & 0xbf;
crypto/heimdal/lib/wind/utf8.c
210
ch = ch >> 6;
crypto/heimdal/lib/wind/utf8.c
212
out[1] = (ch | 0x80) & 0xbf;
crypto/heimdal/lib/wind/utf8.c
213
ch = ch >> 6;
crypto/heimdal/lib/wind/utf8.c
215
out[0] = ch | first_char[len - 1];
crypto/heimdal/lib/wind/utf8.c
460
uint16_t ch;
crypto/heimdal/lib/wind/utf8.c
464
ch = in[i];
crypto/heimdal/lib/wind/utf8.c
466
if (ch < 0x80) {
crypto/heimdal/lib/wind/utf8.c
468
} else if (ch < 0x800) {
crypto/heimdal/lib/wind/utf8.c
481
out[2] = (ch | 0x80) & 0xbf;
crypto/heimdal/lib/wind/utf8.c
482
ch = ch >> 6;
crypto/heimdal/lib/wind/utf8.c
484
out[1] = (ch | 0x80) & 0xbf;
crypto/heimdal/lib/wind/utf8.c
485
ch = ch >> 6;
crypto/heimdal/lib/wind/utf8.c
487
out[0] = ch | first_char[len - 1];
crypto/krb5/src/appl/sample/sserver/sserver.c
112
while ((ch = getopt(argc, argv, "p:S:s:")) != -1) {
crypto/krb5/src/appl/sample/sserver/sserver.c
113
switch (ch) {
crypto/krb5/src/appl/sample/sserver/sserver.c
91
int ch;
crypto/krb5/src/appl/simple/client/sim_client.c
105
while ((ch = getopt(argc, argv, "p:m:h:s:")) != -1)
crypto/krb5/src/appl/simple/client/sim_client.c
106
switch (ch) {
crypto/krb5/src/appl/simple/client/sim_client.c
76
int ch;
crypto/krb5/src/appl/simple/server/sim_server.c
101
while ((ch = getopt(argc, argv, "p:s:S:")) != -1) {
crypto/krb5/src/appl/simple/server/sim_server.c
102
switch (ch) {
crypto/krb5/src/appl/simple/server/sim_server.c
76
int ch;
crypto/krb5/src/ccapi/common/win/OldCC/opts.cxx
34
char ch
crypto/krb5/src/ccapi/common/win/OldCC/opts.cxx
37
return (m_ValidOpts[ch % 256] != 0);
crypto/krb5/src/ccapi/common/win/OldCC/opts.cxx
42
char ch,
crypto/krb5/src/ccapi/common/win/OldCC/opts.cxx
46
if (IsValidOpt(ch))
crypto/krb5/src/ccapi/common/win/OldCC/opts.cxx
47
fprintf(stderr, " -%c %s\n", ch, text);
crypto/krb5/src/ccapi/common/win/OldCC/opts.cxx
93
char ch = tolower(*(argv[i]+1));
crypto/krb5/src/ccapi/common/win/OldCC/opts.cxx
94
if (!IsValidOpt(ch))
crypto/krb5/src/ccapi/common/win/OldCC/opts.cxx
96
switch (ch) {
crypto/krb5/src/ccapi/common/win/OldCC/opts.hxx
51
bool IsValidOpt(char ch);
crypto/krb5/src/ccapi/common/win/OldCC/opts.hxx
52
void PrintOpt(char ch, char* text);
crypto/krb5/src/kadmin/dbutil/dump.c
511
int ch;
crypto/krb5/src/kadmin/dbutil/dump.c
513
if ((ch = fgetc(f)) != ';' || (ch = fgetc(f)) != '\n') {
crypto/krb5/src/kadmin/dbutil/dump.c
516
while (ch != '\n') {
crypto/krb5/src/kadmin/dbutil/dump.c
517
putc(ch, stderr);
crypto/krb5/src/kadmin/dbutil/dump.c
518
ch = fgetc(f);
crypto/krb5/src/kadmin/dbutil/dump.c
520
putc(ch, stderr);
crypto/krb5/src/kadmin/dbutil/t_tdumputil.c
53
int ch, csv = 0, i, nf;
crypto/krb5/src/kadmin/dbutil/t_tdumputil.c
58
while ((ch = getopt(argc, argv, "T:c")) != -1) {
crypto/krb5/src/kadmin/dbutil/t_tdumputil.c
59
switch (ch) {
crypto/krb5/src/kadmin/dbutil/tabdump.c
646
int ch;
crypto/krb5/src/kadmin/dbutil/tabdump.c
656
while ((ch = getopt(argc, argv, "Hceno:")) != -1) {
crypto/krb5/src/kadmin/dbutil/tabdump.c
657
switch (ch) {
crypto/krb5/src/lib/krb5/os/localaddr.c
206
int ch, flags = ifp->ifa_flags;
crypto/krb5/src/lib/krb5/os/localaddr.c
208
ch = '<';
crypto/krb5/src/lib/krb5/os/localaddr.c
209
#define X(F) if (flags & IFF_##F) { printf ("%c%s", ch, #F); flags &= ~IFF_##F; ch = ','; }
crypto/krb5/src/lib/krb5/unicode/ucdata/ucdata.c
626
krb5_ui_4 ch, last, lindex, sindex;
crypto/krb5/src/lib/krb5/unicode/ucdata/ucdata.c
631
ch = str[i];
crypto/krb5/src/lib/krb5/unicode/ucdata/ucdata.c
636
krb5_ui_4 vindex = ch - VBase;
crypto/krb5/src/lib/krb5/unicode/ucdata/ucdata.c
650
krb5_ui_4 tindex = ch - TBase;
crypto/krb5/src/lib/krb5/unicode/ucdata/ucdata.c
660
last = ch;
crypto/krb5/src/lib/krb5/unicode/ucdata/ucdata.c
661
str[rlen] = ch;
crypto/krb5/src/lib/krb5/unicode/ucdata/ucdata.c
671
krb5_ui_4 cl, prevcl, st, ch, co;
crypto/krb5/src/lib/krb5/unicode/ucdata/ucdata.c
679
ch = str[i];
crypto/krb5/src/lib/krb5/unicode/ucdata/ucdata.c
680
cl = uccombining_class(ch);
crypto/krb5/src/lib/krb5/unicode/ucdata/ucdata.c
681
if (uccomp(st, ch, &co) && (prevcl < cl || prevcl == 0))
crypto/krb5/src/lib/krb5/unicode/ucdata/ucdata.c
686
st = ch;
crypto/krb5/src/lib/krb5/unicode/ucdata/ucdata.c
689
str[copos++] = ch;
crypto/krb5/src/plugins/kdb/db2/libdb2/recno/rec_get.c
123
int ch;
crypto/krb5/src/plugins/kdb/db2/libdb2/recno/rec_get.c
139
for (p = t->bt_rdata.data;; *p++ = ch)
crypto/krb5/src/plugins/kdb/db2/libdb2/recno/rec_get.c
140
if ((ch = getc(t->bt_rfp)) == EOF || !--len) {
crypto/krb5/src/plugins/kdb/db2/libdb2/recno/rec_get.c
141
if (ch != EOF)
crypto/krb5/src/plugins/kdb/db2/libdb2/recno/rec_get.c
142
*p = ch;
crypto/krb5/src/plugins/kdb/db2/libdb2/recno/rec_get.c
151
if (ch == EOF)
crypto/krb5/src/plugins/kdb/db2/libdb2/recno/rec_get.c
178
int bval, ch;
crypto/krb5/src/plugins/kdb/db2/libdb2/recno/rec_get.c
184
sz = t->bt_rdata.size;; *p++ = ch, --sz) {
crypto/krb5/src/plugins/kdb/db2/libdb2/recno/rec_get.c
185
if ((ch = getc(t->bt_rfp)) == EOF || ch == bval) {
crypto/krb5/src/plugins/kdb/db2/libdb2/recno/rec_get.c
188
if (ch == EOF && data.size == 0)
crypto/krb5/src/plugins/kdb/db2/libdb2/recno/rec_get.c
206
if (ch == EOF)
crypto/krb5/src/plugins/kdb/db2/libdb2/test/dbtest.c
132
int ch, oflags, sflag;
crypto/krb5/src/plugins/kdb/db2/libdb2/test/dbtest.c
139
while ((ch = getopt(argc, argv, "f:i:lo:s")) != -1)
crypto/krb5/src/plugins/kdb/db2/libdb2/test/dbtest.c
140
switch (ch) {
crypto/krb5/src/plugins/preauth/spake/spake_client.c
114
krb5_spake_challenge *ch;
crypto/krb5/src/plugins/preauth/spake/spake_client.c
133
ch = &st->msg->u.challenge;
crypto/krb5/src/plugins/preauth/spake/spake_client.c
134
if (!group_is_permitted(gstate, ch->group))
crypto/krb5/src/plugins/preauth/spake/spake_client.c
138
if (!contains_sf_none(ch->factors))
crypto/krb5/src/plugins/preauth/spake/spake_client.c
182
krb5_spake_challenge *ch, const krb5_data *der_msg,
crypto/krb5/src/plugins/preauth/spake/spake_client.c
202
if (!group_is_permitted(gstate, ch->group)) {
crypto/krb5/src/plugins/preauth/spake/spake_client.c
203
TRACE_SPAKE_REJECT_CHALLENGE(context, ch->group);
crypto/krb5/src/plugins/preauth/spake/spake_client.c
212
ret = update_thash(context, gstate, ch->group, &st->thash, st->support,
crypto/krb5/src/plugins/preauth/spake/spake_client.c
217
TRACE_SPAKE_RECEIVE_CHALLENGE(context, ch->group, &ch->pubkey);
crypto/krb5/src/plugins/preauth/spake/spake_client.c
221
if (!contains_sf_none(ch->factors))
crypto/krb5/src/plugins/preauth/spake/spake_client.c
230
ret = derive_wbytes(context, ch->group, st->initial_key, &wbytes);
crypto/krb5/src/plugins/preauth/spake/spake_client.c
233
ret = group_keygen(context, gstate, ch->group, &wbytes, &clpriv, &clpub);
crypto/krb5/src/plugins/preauth/spake/spake_client.c
236
ret = group_result(context, gstate, ch->group, &wbytes, &clpriv,
crypto/krb5/src/plugins/preauth/spake/spake_client.c
237
&ch->pubkey, &st->spakeresult);
crypto/krb5/src/plugins/preauth/spake/spake_client.c
241
ret = update_thash(context, gstate, ch->group, &st->thash, &clpub, NULL);
crypto/krb5/src/plugins/preauth/spake/spake_client.c
247
ret = derive_key(context, gstate, ch->group, st->initial_key, &wbytes,
crypto/krb5/src/plugins/preauth/spake/spake_client.c
256
ret = derive_key(context, gstate, ch->group, st->initial_key, &wbytes,
crypto/krb5/src/util/et/et_name.c
34
long ch;
crypto/krb5/src/util/et/et_name.c
42
ch = (num >> BITS_PER_CHAR * i) & ((1 << BITS_PER_CHAR) - 1);
crypto/krb5/src/util/et/et_name.c
43
if (ch != 0)
crypto/krb5/src/util/et/et_name.c
44
*p++ = char_set[ch-1];
crypto/krb5/src/util/profile/argv_parse.c
103
if (ch == '\\') {
crypto/krb5/src/util/profile/argv_parse.c
104
ch = *++cp;
crypto/krb5/src/util/profile/argv_parse.c
105
switch (ch) {
crypto/krb5/src/util/profile/argv_parse.c
107
ch = '\\'; cp--; break;
crypto/krb5/src/util/profile/argv_parse.c
109
ch = '\n'; break;
crypto/krb5/src/util/profile/argv_parse.c
111
ch = '\t'; break;
crypto/krb5/src/util/profile/argv_parse.c
113
ch = '\b'; break;
crypto/krb5/src/util/profile/argv_parse.c
116
*outcp++ = ch;
crypto/krb5/src/util/profile/argv_parse.c
53
char **argv, **new_argv, *buf, ch;
crypto/krb5/src/util/profile/argv_parse.c
63
for (cp = in_buf; (ch = *cp); cp++) {
crypto/krb5/src/util/profile/argv_parse.c
65
if (isspace((int) ch))
crypto/krb5/src/util/profile/argv_parse.c
83
if (ch == '"')
crypto/krb5/src/util/profile/argv_parse.c
86
*outcp++ = ch;
crypto/krb5/src/util/profile/argv_parse.c
90
if (isspace((int) ch)) {
crypto/krb5/src/util/profile/argv_parse.c
99
if (ch == '"') {
crypto/krb5/src/util/profile/prof_parse.c
126
if (ch == '}') {
crypto/krb5/src/util/profile/prof_parse.c
482
char ch;
crypto/krb5/src/util/profile/prof_parse.c
491
while ((ch = *str++)) {
crypto/krb5/src/util/profile/prof_parse.c
492
switch (ch) {
crypto/krb5/src/util/profile/prof_parse.c
509
buf[0] = ch;
crypto/krb5/src/util/profile/prof_parse.c
77
char *cp, ch, *tag, *value;
crypto/krb5/src/util/profile/prof_parse.c
89
ch = *cp;
crypto/krb5/src/util/profile/prof_parse.c
90
if (ch == 0)
crypto/krb5/src/util/profile/prof_parse.c
92
if (ch == '[') {
crypto/krb5/src/util/support/fnmatch.c
57
foldcase(int ch, int flags)
crypto/krb5/src/util/support/fnmatch.c
60
if ((flags & FNM_CASEFOLD) != 0 && isupper(ch))
crypto/krb5/src/util/support/fnmatch.c
61
return tolower(ch);
crypto/krb5/src/util/support/fnmatch.c
62
return ch;
crypto/krb5/src/util/support/fnmatch.c
65
#define FOLDCASE(ch, flags) foldcase((unsigned char)(ch), (flags))
crypto/krb5/src/util/support/utf8.c
105
krb5_ucs4 ch;
crypto/krb5/src/util/support/utf8.c
116
ch = c[0] & mask[len];
crypto/krb5/src/util/support/utf8.c
122
ch <<= 6;
crypto/krb5/src/util/support/utf8.c
123
ch |= c[i] & 0x3f;
crypto/krb5/src/util/support/utf8.c
126
if (ch > 0x10ffff)
crypto/krb5/src/util/support/utf8.c
129
*out = ch;
crypto/krb5/src/util/support/utf8_conv.c
113
ch = (krb5_ucs4)(utf8[0] & mask[chlen]);
crypto/krb5/src/util/support/utf8_conv.c
121
ch <<= 6;
crypto/krb5/src/util/support/utf8_conv.c
122
ch |= (krb5_ucs4)(utf8[i] & 0x3f);
crypto/krb5/src/util/support/utf8_conv.c
124
if (!IS_VALID_UNICODE(ch))
crypto/krb5/src/util/support/utf8_conv.c
129
if (IS_BMP(ch)) {
crypto/krb5/src/util/support/utf8_conv.c
130
k5_buf_add_uint16_le(&buf, ch);
crypto/krb5/src/util/support/utf8_conv.c
134
k5_buf_add_uint16_le(&buf, HIGH_SURROGATE(ch));
crypto/krb5/src/util/support/utf8_conv.c
135
k5_buf_add_uint16_le(&buf, LOW_SURROGATE(ch));
crypto/krb5/src/util/support/utf8_conv.c
157
krb5_ucs4 ch;
crypto/krb5/src/util/support/utf8_conv.c
179
ch = COMPOSE(ch1, ch2);
crypto/krb5/src/util/support/utf8_conv.c
181
ch = ch1;
crypto/krb5/src/util/support/utf8_conv.c
184
chlen = krb5int_ucs4_to_utf8(ch, NULL);
crypto/krb5/src/util/support/utf8_conv.c
188
(void)krb5int_ucs4_to_utf8(ch, p);
crypto/krb5/src/util/support/utf8_conv.c
95
krb5_ucs4 ch;
crypto/openssh/clientloop.c
1178
u_char ch;
crypto/openssh/clientloop.c
1189
ch = buf[i];
crypto/openssh/clientloop.c
1197
switch (ch) {
crypto/openssh/clientloop.c
1215
if (ch == 'Z' - 64)
crypto/openssh/clientloop.c
1218
snprintf(b, sizeof b, "%c", ch);
crypto/openssh/clientloop.c
1264
efc->escape_char, ch)) != 0)
crypto/openssh/clientloop.c
1268
if (ch == 'V' && options.log_level >
crypto/openssh/clientloop.c
1271
if (ch == 'v' && options.log_level <
crypto/openssh/clientloop.c
1276
efc->escape_char, ch,
crypto/openssh/clientloop.c
1344
if (ch != efc->escape_char) {
crypto/openssh/clientloop.c
1358
if (last_was_cr && ch == efc->escape_char) {
crypto/openssh/clientloop.c
1372
last_was_cr = (ch == '\r' || ch == '\n');
crypto/openssh/clientloop.c
1373
if ((r = sshbuf_put_u8(bin, ch)) != 0)
crypto/openssh/misc.c
1003
(ch = hexchar(src + 1)) == -1) {
crypto/openssh/misc.c
1007
*dst++ = ch;
crypto/openssh/misc.c
1036
char *uridup, *cp, *tmp, ch;
crypto/openssh/misc.c
1077
if ((cp = hpdelim2(&tmp, &ch)) == NULL || *cp == '\0')
crypto/openssh/misc.c
1084
if (ch == ':') {
crypto/openssh/misc.c
989
int ch;
crypto/openssh/monitor_fdpass.c
125
char ch;
crypto/openssh/monitor_fdpass.c
130
vec.iov_base = &ch;
crypto/openssh/monitor_fdpass.c
64
char ch = '\0';
crypto/openssh/monitor_fdpass.c
83
vec.iov_base = &ch;
crypto/openssh/openbsd-compat/base64.c
199
int ch;
crypto/openssh/openbsd-compat/base64.c
205
while ((ch = *src++) != '\0') {
crypto/openssh/openbsd-compat/base64.c
206
if (isspace(ch)) /* Skip whitespace anywhere. */
crypto/openssh/openbsd-compat/base64.c
209
if (ch == Pad64)
crypto/openssh/openbsd-compat/base64.c
212
pos = strchr(Base64, ch);
crypto/openssh/openbsd-compat/base64.c
264
if (ch == Pad64) { /* We got a pad char. */
crypto/openssh/openbsd-compat/base64.c
265
ch = *src++; /* Skip it, get next. */
crypto/openssh/openbsd-compat/base64.c
273
for (; ch != '\0'; ch = *src++)
crypto/openssh/openbsd-compat/base64.c
274
if (!isspace(ch))
crypto/openssh/openbsd-compat/base64.c
277
if (ch != Pad64)
crypto/openssh/openbsd-compat/base64.c
279
ch = *src++; /* Skip the = */
crypto/openssh/openbsd-compat/base64.c
288
for (; ch != '\0'; ch = *src++)
crypto/openssh/openbsd-compat/base64.c
289
if (!isspace(ch))
crypto/openssh/openbsd-compat/bsd-snprintf.c
182
char ch;
crypto/openssh/openbsd-compat/bsd-snprintf.c
199
ch = *format++;
crypto/openssh/openbsd-compat/bsd-snprintf.c
202
if (ch == '\0')
crypto/openssh/openbsd-compat/bsd-snprintf.c
207
if (ch == '%')
crypto/openssh/openbsd-compat/bsd-snprintf.c
210
DOPR_OUTCH(buffer, currlen, maxlen, ch);
crypto/openssh/openbsd-compat/bsd-snprintf.c
211
ch = *format++;
crypto/openssh/openbsd-compat/bsd-snprintf.c
214
switch (ch) {
crypto/openssh/openbsd-compat/bsd-snprintf.c
217
ch = *format++;
crypto/openssh/openbsd-compat/bsd-snprintf.c
221
ch = *format++;
crypto/openssh/openbsd-compat/bsd-snprintf.c
225
ch = *format++;
crypto/openssh/openbsd-compat/bsd-snprintf.c
229
ch = *format++;
crypto/openssh/openbsd-compat/bsd-snprintf.c
233
ch = *format++;
crypto/openssh/openbsd-compat/bsd-snprintf.c
241
if (isdigit((unsigned char)ch)) {
crypto/openssh/openbsd-compat/bsd-snprintf.c
242
min = 10*min + char_to_int (ch);
crypto/openssh/openbsd-compat/bsd-snprintf.c
243
ch = *format++;
crypto/openssh/openbsd-compat/bsd-snprintf.c
244
} else if (ch == '*') {
crypto/openssh/openbsd-compat/bsd-snprintf.c
246
ch = *format++;
crypto/openssh/openbsd-compat/bsd-snprintf.c
253
if (ch == '.') {
crypto/openssh/openbsd-compat/bsd-snprintf.c
255
ch = *format++;
crypto/openssh/openbsd-compat/bsd-snprintf.c
261
if (isdigit((unsigned char)ch)) {
crypto/openssh/openbsd-compat/bsd-snprintf.c
264
max = 10*max + char_to_int (ch);
crypto/openssh/openbsd-compat/bsd-snprintf.c
265
ch = *format++;
crypto/openssh/openbsd-compat/bsd-snprintf.c
266
} else if (ch == '*') {
crypto/openssh/openbsd-compat/bsd-snprintf.c
268
ch = *format++;
crypto/openssh/openbsd-compat/bsd-snprintf.c
275
switch (ch) {
crypto/openssh/openbsd-compat/bsd-snprintf.c
278
ch = *format++;
crypto/openssh/openbsd-compat/bsd-snprintf.c
282
ch = *format++;
crypto/openssh/openbsd-compat/bsd-snprintf.c
286
ch = *format++;
crypto/openssh/openbsd-compat/bsd-snprintf.c
287
if (ch == 'l') { /* It's a long long */
crypto/openssh/openbsd-compat/bsd-snprintf.c
289
ch = *format++;
crypto/openssh/openbsd-compat/bsd-snprintf.c
294
ch = *format++;
crypto/openssh/openbsd-compat/bsd-snprintf.c
298
ch = *format++;
crypto/openssh/openbsd-compat/bsd-snprintf.c
306
switch (ch) {
crypto/openssh/openbsd-compat/bsd-snprintf.c
469
DOPR_OUTCH(buffer, currlen, maxlen, ch);
crypto/openssh/openbsd-compat/bsd-snprintf.c
473
ch = *format++;
crypto/openssh/openbsd-compat/bsd-snprintf.c
479
ch = *format++;
crypto/openssh/openbsd-compat/glob.c
1039
g_strchr(const Char *str, int ch)
crypto/openssh/openbsd-compat/glob.c
1042
if (*str == ch)
crypto/openssh/openbsd-compat/readpassphrase.c
132
while ((nr = read(input, &ch, 1)) == 1 && ch != '\n' && ch != '\r') {
crypto/openssh/openbsd-compat/readpassphrase.c
135
ch &= 0x7f;
crypto/openssh/openbsd-compat/readpassphrase.c
136
if (isalpha((unsigned char)ch)) {
crypto/openssh/openbsd-compat/readpassphrase.c
138
ch = (char)tolower((unsigned char)ch);
crypto/openssh/openbsd-compat/readpassphrase.c
140
ch = (char)toupper((unsigned char)ch);
crypto/openssh/openbsd-compat/readpassphrase.c
142
*p++ = ch;
crypto/openssh/openbsd-compat/readpassphrase.c
58
char ch, *p, *end;
crypto/openssh/regress/check-perm.c
163
int ch, mode = -1;
crypto/openssh/regress/check-perm.c
168
while ((ch = getopt(argc, argv, "hm:")) != -1) {
crypto/openssh/regress/check-perm.c
169
switch (ch) {
crypto/openssh/regress/misc/ssh-verify-attestation/ssh-verify-attestation.c
330
int r, ch, credtype = -1;
crypto/openssh/regress/misc/ssh-verify-attestation/ssh-verify-attestation.c
346
while ((ch = getopt(argc, argv, "UAv")) != -1) {
crypto/openssh/regress/misc/ssh-verify-attestation/ssh-verify-attestation.c
347
switch (ch) {
crypto/openssh/regress/modpipe.c
84
int ch;
crypto/openssh/regress/modpipe.c
91
while ((ch = getopt(argc, argv, "wm:")) != -1) {
crypto/openssh/regress/modpipe.c
92
switch (ch) {
crypto/openssh/regress/netcat.c
1017
char ch = '\0';
crypto/openssh/regress/netcat.c
1036
vec.iov_base = &ch;
crypto/openssh/regress/netcat.c
151
int ch, s, ret, socksv;
crypto/openssh/regress/netcat.c
171
while ((ch = getopt(argc, argv,
crypto/openssh/regress/netcat.c
173
switch (ch) {
crypto/openssh/regress/unittests/test_helper/test_helper.c
130
int ch;
crypto/openssh/regress/unittests/test_helper/test_helper.c
150
while ((ch = getopt(argc, argv, "Ffvqd:")) != -1) {
crypto/openssh/regress/unittests/test_helper/test_helper.c
151
switch (ch) {
crypto/openssh/scp.c
1674
char ch, *cp, *np, *targ, *why, *vect[1], buf[2048], visbuf[2048];
crypto/openssh/scp.c
1716
if (atomicio(read, remin, &ch, sizeof(ch)) != sizeof(ch))
crypto/openssh/scp.c
1718
*cp++ = ch;
crypto/openssh/scp.c
1719
} while (cp < &buf[sizeof(buf) - 1] && ch != '\n');
crypto/openssh/scp.c
1740
if (ch == '\n')
crypto/openssh/scp.c
2081
char ch, *cp, resp, rbuf[2048], visbuf[2048];
crypto/openssh/scp.c
2096
if (atomicio(read, remin, &ch, sizeof(ch)) != sizeof(ch))
crypto/openssh/scp.c
2098
*cp++ = ch;
crypto/openssh/scp.c
2099
} while (cp < &rbuf[sizeof(rbuf) - 1] && ch != '\n');
crypto/openssh/scp.c
474
int ch, fflag, tflag, status, r, n;
crypto/openssh/scp.c
511
while ((ch = getopt(argc, argv,
crypto/openssh/scp.c
513
switch (ch) {
crypto/openssh/scp.c
525
addargs(&args, "-%c", ch);
crypto/openssh/scp.c
526
addargs(&remote_remote_args, "-%c", ch);
crypto/openssh/scp.c
542
addargs(&remote_remote_args, "-%c", ch);
crypto/openssh/scp.c
544
addargs(&args, "-%c", ch);
crypto/openssh/sftp-server.c
1906
int i, r, in, out, ch, skipargs = 0, log_stderr = 0;
crypto/openssh/sftp-server.c
1920
while (!skipargs && (ch = getopt(argc, argv,
crypto/openssh/sftp-server.c
1922
switch (ch) {
crypto/openssh/sftp.c
2128
complete(EditLine *el, int ch)
crypto/openssh/sftp.c
2440
int r, in, out, ch, err, tmp, port = -1, noisy = 0;
crypto/openssh/sftp.c
2471
while ((ch = getopt(argc, argv,
crypto/openssh/sftp.c
2473
switch (ch) {
crypto/openssh/sftp.c
2479
addargs(&args, "-%c", ch);
crypto/openssh/sftp.c
2487
addargs(&args, "-%c", ch);
crypto/openssh/sftp.c
2494
addargs(&args, "-%c", ch);
crypto/openssh/sftp.c
401
int ch;
crypto/openssh/sftp.c
407
while ((ch = getopt(argc, argv, "afPpRr")) != -1) {
crypto/openssh/sftp.c
408
switch (ch) {
crypto/openssh/sftp.c
436
int ch;
crypto/openssh/sftp.c
442
while ((ch = getopt(argc, argv, "s")) != -1) {
crypto/openssh/sftp.c
443
switch (ch) {
crypto/openssh/sftp.c
460
int ch;
crypto/openssh/sftp.c
466
while ((ch = getopt(argc, argv, "l")) != -1) {
crypto/openssh/sftp.c
467
switch (ch) {
crypto/openssh/sftp.c
484
int ch;
crypto/openssh/sftp.c
490
while ((ch = getopt(argc, argv, "1Safhlnrt")) != -1) {
crypto/openssh/sftp.c
491
switch (ch) {
crypto/openssh/sftp.c
537
int ch;
crypto/openssh/sftp.c
543
while ((ch = getopt(argc, argv, "hi")) != -1) {
crypto/openssh/sftp.c
544
switch (ch) {
crypto/openssh/sftp.c
564
int ch;
crypto/openssh/sftp.c
570
while ((ch = getopt(argc, argv, "h")) != -1) {
crypto/openssh/sftp.c
571
switch (ch) {
crypto/openssh/sftp.c
588
int ch;
crypto/openssh/sftp.c
593
while ((ch = getopt(argc, argv, "")) != -1) {
crypto/openssh/sftp.c
594
switch (ch) {
crypto/openssh/ssh-add.c
815
int r, i, ch, deleting = 0, ret = 0, key_only = 0, cert_only = 0;
crypto/openssh/ssh-add.c
849
while ((ch = getopt(argc, argv, "vkKlLCcdDTxXE:e:h:H:M:m:qs:S:t:")) != -1) {
crypto/openssh/ssh-add.c
850
switch (ch) {
crypto/openssh/ssh-add.c
881
lflag = ch;
crypto/openssh/ssh-add.c
887
xflag = ch;
crypto/openssh/ssh-agent.c
2245
int sock = -1, ch, result, saved_errno;
crypto/openssh/ssh-agent.c
2282
while ((ch = getopt(ac, av, "cDdksE:a:O:P:t:x")) != -1) {
crypto/openssh/ssh-agent.c
2283
switch (ch) {
crypto/openssh/ssh-pkcs11-helper.c
343
int r, ch, in, out, log_stderr = 0;
crypto/openssh/ssh-pkcs11-helper.c
357
while ((ch = getopt(argc, argv, "v")) != -1) {
crypto/openssh/ssh-pkcs11-helper.c
358
switch (ch) {
crypto/openssh/ssh-sk-helper.c
279
int in, out, ch, r, vflag = 0;
crypto/openssh/ssh-sk-helper.c
286
while ((ch = getopt(argc, argv, "v")) != -1) {
crypto/openssh/ssh-sk-helper.c
287
switch (ch) {
crypto/openssl/apps/lib/s_cb.c
1400
X509_STORE *vfy = NULL, *ch = NULL;
crypto/openssl/apps/lib/s_cb.c
1420
ch = X509_STORE_new();
crypto/openssl/apps/lib/s_cb.c
1421
if (ch == NULL)
crypto/openssl/apps/lib/s_cb.c
1423
if (chCAfile != NULL && !X509_STORE_load_file(ch, chCAfile))
crypto/openssl/apps/lib/s_cb.c
1425
if (chCApath != NULL && !X509_STORE_load_path(ch, chCApath))
crypto/openssl/apps/lib/s_cb.c
1427
if (chCAstore != NULL && !X509_STORE_load_store(ch, chCAstore))
crypto/openssl/apps/lib/s_cb.c
1429
if (SSL_CTX_set1_chain_cert_store(ctx, ch) == 0)
crypto/openssl/apps/lib/s_cb.c
1435
X509_STORE_free(ch);
crypto/openssl/apps/rehash.c
199
unsigned char ch;
crypto/openssl/apps/rehash.c
204
ch = filename[i];
crypto/openssl/apps/rehash.c
205
if (!isxdigit(ch))
crypto/openssl/apps/rehash.c
208
hash += OPENSSL_hexchar2int(ch);
crypto/openssl/crypto/bio/bio_dump.c
35
unsigned char ch;
crypto/openssl/crypto/bio/bio_dump.c
57
ch = *(s + i * dump_width + j) & 0xff;
crypto/openssl/crypto/bio/bio_dump.c
58
BIO_snprintf(buf + n, 4, "%02x%c", ch,
crypto/openssl/crypto/bio/bio_dump.c
72
ch = *(s + i * dump_width + j) & 0xff;
crypto/openssl/crypto/bio/bio_dump.c
74
buf[n++] = ((ch >= ' ') && (ch <= '~')) ? ch : '.';
crypto/openssl/crypto/bio/bio_dump.c
76
buf[n++] = ((ch >= os_toascii[' ']) && (ch <= os_toascii['~']))
crypto/openssl/crypto/bio/bio_dump.c
77
? os_toebcdic[ch]
crypto/openssl/crypto/bio/bio_print.c
108
ch = *format++;
crypto/openssl/crypto/bio/bio_print.c
111
if (ch == '\0' || (buffer == NULL && currlen >= *maxlen))
crypto/openssl/crypto/bio/bio_print.c
116
if (ch == '%')
crypto/openssl/crypto/bio/bio_print.c
118
else if (!doapr_outch(sbuffer, buffer, &currlen, maxlen, ch))
crypto/openssl/crypto/bio/bio_print.c
120
ch = *format++;
crypto/openssl/crypto/bio/bio_print.c
123
switch (ch) {
crypto/openssl/crypto/bio/bio_print.c
126
ch = *format++;
crypto/openssl/crypto/bio/bio_print.c
130
ch = *format++;
crypto/openssl/crypto/bio/bio_print.c
134
ch = *format++;
crypto/openssl/crypto/bio/bio_print.c
138
ch = *format++;
crypto/openssl/crypto/bio/bio_print.c
142
ch = *format++;
crypto/openssl/crypto/bio/bio_print.c
150
if (ossl_isdigit(ch)) {
crypto/openssl/crypto/bio/bio_print.c
151
min = 10 * min + char_to_int(ch);
crypto/openssl/crypto/bio/bio_print.c
152
ch = *format++;
crypto/openssl/crypto/bio/bio_print.c
153
} else if (ch == '*') {
crypto/openssl/crypto/bio/bio_print.c
155
ch = *format++;
crypto/openssl/crypto/bio/bio_print.c
161
if (ch == '.') {
crypto/openssl/crypto/bio/bio_print.c
163
ch = *format++;
crypto/openssl/crypto/bio/bio_print.c
168
if (ossl_isdigit(ch)) {
crypto/openssl/crypto/bio/bio_print.c
171
max = 10 * max + char_to_int(ch);
crypto/openssl/crypto/bio/bio_print.c
172
ch = *format++;
crypto/openssl/crypto/bio/bio_print.c
173
} else if (ch == '*') {
crypto/openssl/crypto/bio/bio_print.c
175
ch = *format++;
crypto/openssl/crypto/bio/bio_print.c
181
switch (ch) {
crypto/openssl/crypto/bio/bio_print.c
184
ch = *format++;
crypto/openssl/crypto/bio/bio_print.c
192
ch = *format++;
crypto/openssl/crypto/bio/bio_print.c
197
ch = *format++;
crypto/openssl/crypto/bio/bio_print.c
201
ch = *format++;
crypto/openssl/crypto/bio/bio_print.c
205
ch = *format++;
crypto/openssl/crypto/bio/bio_print.c
213
switch (ch) {
crypto/openssl/crypto/bio/bio_print.c
262
ch == 'o' ? 8 : (ch == 'u' ? 10 : 16),
crypto/openssl/crypto/bio/bio_print.c
339
if (!doapr_outch(sbuffer, buffer, &currlen, maxlen, ch))
crypto/openssl/crypto/bio/bio_print.c
350
ch = *format++;
crypto/openssl/crypto/bio/bio_print.c
92
char ch;
crypto/openssl/crypto/o_str.c
214
unsigned char ch, cl;
crypto/openssl/crypto/o_str.c
220
ch = *p++;
crypto/openssl/crypto/o_str.c
222
if (ch == sep && sep != CH_ZERO)
crypto/openssl/crypto/o_str.c
230
chi = OPENSSL_hexchar2int(ch);
crypto/openssl/crypto/packet.c
444
int WPACKET_memset(WPACKET *pkt, int ch, size_t len)
crypto/openssl/crypto/packet.c
455
memset(dest, ch, len);
crypto/openssl/crypto/property/property_parse.c
604
static void put_char(char ch, char **buf, size_t *remain, size_t *needed)
crypto/openssl/crypto/property/property_parse.c
613
**buf = ch;
crypto/openssl/crypto/srp/srp_vfy.c
311
static SRP_gN_cache *SRP_gN_new_init(const char *ch)
crypto/openssl/crypto/srp/srp_vfy.c
320
len = t_fromb64(tmp, sizeof(tmp), ch);
crypto/openssl/crypto/srp/srp_vfy.c
324
if ((newgN->b64_bn = OPENSSL_strdup(ch)) == NULL)
crypto/openssl/crypto/srp/srp_vfy.c
361
static BIGNUM *SRP_gN_place_bn(STACK_OF(SRP_gN_cache) *gN_cache, char *ch)
crypto/openssl/crypto/srp/srp_vfy.c
370
if (strcmp(cache->b64_bn, ch) == 0)
crypto/openssl/crypto/srp/srp_vfy.c
374
SRP_gN_cache *newgN = SRP_gN_new_init(ch);
crypto/openssl/include/internal/packet.h
888
int WPACKET_memset(WPACKET *pkt, int ch, size_t len);
crypto/openssl/include/internal/quic_channel.h
182
int ossl_quic_channel_init(QUIC_CHANNEL *ch);
crypto/openssl/include/internal/quic_channel.h
186
void ossl_quic_channel_free(QUIC_CHANNEL *ch);
crypto/openssl/include/internal/quic_channel.h
189
int ossl_quic_channel_set_mutator(QUIC_CHANNEL *ch,
crypto/openssl/include/internal/quic_channel.h
210
int ossl_quic_channel_start(QUIC_CHANNEL *ch);
crypto/openssl/include/internal/quic_channel.h
213
void ossl_quic_channel_local_close(QUIC_CHANNEL *ch, uint64_t app_error_code,
crypto/openssl/include/internal/quic_channel.h
219
int ossl_quic_channel_schedule_new_token(QUIC_CHANNEL *ch,
crypto/openssl/include/internal/quic_channel.h
226
int ossl_quic_channel_on_handshake_confirmed(QUIC_CHANNEL *ch);
crypto/openssl/include/internal/quic_channel.h
242
void ossl_quic_channel_raise_protocol_error_loc(QUIC_CHANNEL *ch,
crypto/openssl/include/internal/quic_channel.h
251
#define ossl_quic_channel_raise_protocol_error(ch, error_code, frame_type, reason) \
crypto/openssl/include/internal/quic_channel.h
252
ossl_quic_channel_raise_protocol_error_loc((ch), (error_code), \
crypto/openssl/include/internal/quic_channel.h
260
#define ossl_quic_channel_raise_protocol_error_state(ch, error_code, frame_type, reason, state) \
crypto/openssl/include/internal/quic_channel.h
261
ossl_quic_channel_raise_protocol_error_loc((ch), (error_code), \
crypto/openssl/include/internal/quic_channel.h
273
int ossl_quic_channel_net_error(QUIC_CHANNEL *ch);
crypto/openssl/include/internal/quic_channel.h
276
void ossl_quic_channel_restore_err_state(QUIC_CHANNEL *ch);
crypto/openssl/include/internal/quic_channel.h
279
void ossl_quic_channel_on_remote_conn_close(QUIC_CHANNEL *ch,
crypto/openssl/include/internal/quic_channel.h
281
void ossl_quic_channel_on_new_conn_id(QUIC_CHANNEL *ch,
crypto/openssl/include/internal/quic_channel.h
285
int ossl_quic_channel_on_new_conn(QUIC_CHANNEL *ch, const BIO_ADDR *peer,
crypto/openssl/include/internal/quic_channel.h
290
void ossl_quic_channel_subtick(QUIC_CHANNEL *ch, QUIC_TICK_RESULT *r,
crypto/openssl/include/internal/quic_channel.h
294
void ossl_quic_channel_raise_net_error(QUIC_CHANNEL *ch);
crypto/openssl/include/internal/quic_channel.h
297
void ossl_quic_channel_on_stateless_reset(QUIC_CHANNEL *ch);
crypto/openssl/include/internal/quic_channel.h
299
void ossl_quic_channel_inject(QUIC_CHANNEL *ch, QUIC_URXE *e);
crypto/openssl/include/internal/quic_channel.h
301
void ossl_quic_channel_inject_pkt(QUIC_CHANNEL *ch, OSSL_QRX_PKT *qpkt);
crypto/openssl/include/internal/quic_channel.h
309
QUIC_REACTOR *ossl_quic_channel_get_reactor(QUIC_CHANNEL *ch);
crypto/openssl/include/internal/quic_channel.h
312
QUIC_STREAM_MAP *ossl_quic_channel_get_qsm(QUIC_CHANNEL *ch);
crypto/openssl/include/internal/quic_channel.h
315
OSSL_STATM *ossl_quic_channel_get_statm(QUIC_CHANNEL *ch);
crypto/openssl/include/internal/quic_channel.h
318
SSL *ossl_quic_channel_get0_tls(QUIC_CHANNEL *ch);
crypto/openssl/include/internal/quic_channel.h
321
size_t ossl_quic_channel_get_short_header_conn_id_len(QUIC_CHANNEL *ch);
crypto/openssl/include/internal/quic_channel.h
327
int ossl_quic_channel_get_peer_addr(QUIC_CHANNEL *ch, BIO_ADDR *peer_addr);
crypto/openssl/include/internal/quic_channel.h
328
int ossl_quic_channel_set_peer_addr(QUIC_CHANNEL *ch, const BIO_ADDR *peer_addr);
crypto/openssl/include/internal/quic_channel.h
334
QUIC_STREAM *ossl_quic_channel_get_stream_by_id(QUIC_CHANNEL *ch,
crypto/openssl/include/internal/quic_channel.h
338
int ossl_quic_channel_is_term_any(const QUIC_CHANNEL *ch);
crypto/openssl/include/internal/quic_channel.h
340
ossl_quic_channel_get_terminate_cause(const QUIC_CHANNEL *ch);
crypto/openssl/include/internal/quic_channel.h
341
int ossl_quic_channel_is_closing(const QUIC_CHANNEL *ch);
crypto/openssl/include/internal/quic_channel.h
342
int ossl_quic_channel_is_terminated(const QUIC_CHANNEL *ch);
crypto/openssl/include/internal/quic_channel.h
343
int ossl_quic_channel_is_active(const QUIC_CHANNEL *ch);
crypto/openssl/include/internal/quic_channel.h
344
int ossl_quic_channel_is_handshake_complete(const QUIC_CHANNEL *ch);
crypto/openssl/include/internal/quic_channel.h
345
int ossl_quic_channel_is_handshake_confirmed(const QUIC_CHANNEL *ch);
crypto/openssl/include/internal/quic_channel.h
347
QUIC_PORT *ossl_quic_channel_get0_port(QUIC_CHANNEL *ch);
crypto/openssl/include/internal/quic_channel.h
348
QUIC_ENGINE *ossl_quic_channel_get0_engine(QUIC_CHANNEL *ch);
crypto/openssl/include/internal/quic_channel.h
349
QUIC_DEMUX *ossl_quic_channel_get0_demux(QUIC_CHANNEL *ch);
crypto/openssl/include/internal/quic_channel.h
351
SSL *ossl_quic_channel_get0_ssl(QUIC_CHANNEL *ch);
crypto/openssl/include/internal/quic_channel.h
366
CRYPTO_MUTEX *ossl_quic_channel_get_mutex(QUIC_CHANNEL *ch);
crypto/openssl/include/internal/quic_channel.h
373
QUIC_STREAM *ossl_quic_channel_new_stream_local(QUIC_CHANNEL *ch, int is_uni);
crypto/openssl/include/internal/quic_channel.h
381
QUIC_STREAM *ossl_quic_channel_new_stream_remote(QUIC_CHANNEL *ch,
crypto/openssl/include/internal/quic_channel.h
390
void ossl_quic_channel_set_incoming_stream_auto_reject(QUIC_CHANNEL *ch,
crypto/openssl/include/internal/quic_channel.h
399
void ossl_quic_channel_reject_stream(QUIC_CHANNEL *ch, QUIC_STREAM *qs);
crypto/openssl/include/internal/quic_channel.h
402
int ossl_quic_channel_replace_local_cid(QUIC_CHANNEL *ch,
crypto/openssl/include/internal/quic_channel.h
406
void ossl_quic_channel_set_msg_callback(QUIC_CHANNEL *ch,
crypto/openssl/include/internal/quic_channel.h
409
void ossl_quic_channel_set_msg_callback_arg(QUIC_CHANNEL *ch,
crypto/openssl/include/internal/quic_channel.h
413
void ossl_quic_channel_set_txku_threshold_override(QUIC_CHANNEL *ch,
crypto/openssl/include/internal/quic_channel.h
417
uint64_t ossl_quic_channel_get_tx_key_epoch(QUIC_CHANNEL *ch);
crypto/openssl/include/internal/quic_channel.h
418
uint64_t ossl_quic_channel_get_rx_key_epoch(QUIC_CHANNEL *ch);
crypto/openssl/include/internal/quic_channel.h
421
int ossl_quic_channel_trigger_txku(QUIC_CHANNEL *ch);
crypto/openssl/include/internal/quic_channel.h
422
int ossl_quic_channel_has_pending(const QUIC_CHANNEL *ch);
crypto/openssl/include/internal/quic_channel.h
425
int ossl_quic_channel_ping(QUIC_CHANNEL *ch);
crypto/openssl/include/internal/quic_channel.h
431
uint16_t ossl_quic_channel_get_diag_num_rx_ack(QUIC_CHANNEL *ch);
crypto/openssl/include/internal/quic_channel.h
436
void ossl_quic_channel_get_diag_local_cid(QUIC_CHANNEL *ch, QUIC_CONN_ID *cid);
crypto/openssl/include/internal/quic_channel.h
442
int ossl_quic_channel_is_new_local_stream_admissible(QUIC_CHANNEL *ch, int is_uni);
crypto/openssl/include/internal/quic_channel.h
448
uint64_t ossl_quic_channel_get_local_stream_count_avail(const QUIC_CHANNEL *ch,
crypto/openssl/include/internal/quic_channel.h
450
uint64_t ossl_quic_channel_get_remote_stream_count_avail(const QUIC_CHANNEL *ch,
crypto/openssl/include/internal/quic_channel.h
456
int ossl_quic_channel_have_generated_transport_params(const QUIC_CHANNEL *ch);
crypto/openssl/include/internal/quic_channel.h
459
void ossl_quic_channel_set_max_idle_timeout_request(QUIC_CHANNEL *ch, uint64_t ms);
crypto/openssl/include/internal/quic_channel.h
461
uint64_t ossl_quic_channel_get_max_idle_timeout_request(const QUIC_CHANNEL *ch);
crypto/openssl/include/internal/quic_channel.h
463
uint64_t ossl_quic_channel_get_max_idle_timeout_peer_request(const QUIC_CHANNEL *ch);
crypto/openssl/include/internal/quic_channel.h
465
uint64_t ossl_quic_channel_get_max_idle_timeout_actual(const QUIC_CHANNEL *ch);
crypto/openssl/include/internal/quic_channel.h
467
int ossl_quic_bind_channel(QUIC_CHANNEL *ch, const BIO_ADDR *peer,
crypto/openssl/include/internal/quic_port.h
50
SSL *(*get_conn_user_ssl)(QUIC_CHANNEL *ch, void *arg);
crypto/openssl/include/internal/quic_thread_assist.h
46
QUIC_CHANNEL *ch;
crypto/openssl/include/internal/quic_thread_assist.h
59
QUIC_CHANNEL *ch);
crypto/openssl/ssl/quic/json_enc.c
312
static void json_write_char(OSSL_JSON_ENC *json, char ch)
crypto/openssl/ssl/quic/json_enc.c
318
if (!wbuf_write_char(&json->wbuf, ch))
crypto/openssl/ssl/quic/json_enc.c
405
static void composite_begin(OSSL_JSON_ENC *json, int type, char ch)
crypto/openssl/ssl/quic/json_enc.c
411
json_write_char(json, ch);
crypto/openssl/ssl/quic/json_enc.c
420
static void composite_end(OSSL_JSON_ENC *json, int type, char ch)
crypto/openssl/ssl/quic/json_enc.c
447
json_write_char(json, ch);
crypto/openssl/ssl/quic/quic_channel.c
100
static void ch_record_state_transition(QUIC_CHANNEL *ch, uint32_t new_state);
crypto/openssl/ssl/quic/quic_channel.c
1011
for (i = QUIC_ENC_LEVEL_INITIAL; i < ch->rx_enc_level; ++i)
crypto/openssl/ssl/quic/quic_channel.c
1012
if (i != QUIC_ENC_LEVEL_0RTT && !crypto_ensure_empty(ch->crypto_recv[ossl_quic_enc_level_to_pn_space(i)])) {
crypto/openssl/ssl/quic/quic_channel.c
1014
ossl_quic_channel_raise_protocol_error(ch, OSSL_QUIC_ERR_PROTOCOL_VIOLATION,
crypto/openssl/ssl/quic/quic_channel.c
1020
rstream = ch->crypto_recv[ossl_quic_enc_level_to_pn_space(ch->rx_enc_level)];
crypto/openssl/ssl/quic/quic_channel.c
1030
QUIC_CHANNEL *ch = arg;
crypto/openssl/ssl/quic/quic_channel.c
1033
uint32_t rx_pn_space = ossl_quic_enc_level_to_pn_space(ch->rx_enc_level);
crypto/openssl/ssl/quic/quic_channel.c
1035
rstream = ch->crypto_recv[rx_pn_space];
crypto/openssl/ssl/quic/quic_channel.c
1039
ossl_statm_get_rtt_info(ossl_quic_channel_get_statm(ch), &rtt_info);
crypto/openssl/ssl/quic/quic_channel.c
1040
if (!ossl_quic_rxfc_on_retire(&ch->crypto_rxfc[rx_pn_space], bytes_read,
crypto/openssl/ssl/quic/quic_channel.c
105
static QLOG *ch_get_qlog(QUIC_CHANNEL *ch)
crypto/openssl/ssl/quic/quic_channel.c
1053
QUIC_CHANNEL *ch = arg;
crypto/openssl/ssl/quic/quic_channel.c
1081
if (enc_level <= ch->tx_enc_level)
crypto/openssl/ssl/quic/quic_channel.c
1088
if (!ossl_qtx_provide_secret(ch->qtx, enc_level,
crypto/openssl/ssl/quic/quic_channel.c
1093
ch->tx_enc_level = enc_level;
crypto/openssl/ssl/quic/quic_channel.c
1096
if (enc_level <= ch->rx_enc_level)
crypto/openssl/ssl/quic/quic_channel.c
110
if (ch->qlog != NULL)
crypto/openssl/ssl/quic/quic_channel.c
1108
if (!crypto_ensure_empty(ch->crypto_recv[ossl_quic_enc_level_to_pn_space(i)])) {
crypto/openssl/ssl/quic/quic_channel.c
111
return ch->qlog;
crypto/openssl/ssl/quic/quic_channel.c
1110
ossl_quic_channel_raise_protocol_error(ch, OSSL_QUIC_ERR_PROTOCOL_VIOLATION,
crypto/openssl/ssl/quic/quic_channel.c
1116
if (!ossl_qrx_provide_secret(ch->qrx, enc_level,
crypto/openssl/ssl/quic/quic_channel.c
1121
ch->have_new_rx_secret = 1;
crypto/openssl/ssl/quic/quic_channel.c
1122
ch->rx_enc_level = enc_level;
crypto/openssl/ssl/quic/quic_channel.c
113
if (!ch->use_qlog)
crypto/openssl/ssl/quic/quic_channel.c
1130
QUIC_CHANNEL *ch = arg;
crypto/openssl/ssl/quic/quic_channel.c
1132
if (!ossl_assert(!ch->handshake_complete))
crypto/openssl/ssl/quic/quic_channel.c
1135
if (!ossl_assert(ch->tx_enc_level == QUIC_ENC_LEVEL_1RTT))
crypto/openssl/ssl/quic/quic_channel.c
1143
ossl_quic_tx_packetiser_set_validated(ch->txp);
crypto/openssl/ssl/quic/quic_channel.c
1145
if (!ch->got_remote_transport_params) {
crypto/openssl/ssl/quic/quic_channel.c
1150
ossl_quic_channel_raise_protocol_error(ch, OSSL_QUIC_ERR_CRYPTO_MISSING_EXT,
crypto/openssl/ssl/quic/quic_channel.c
1157
OPENSSL_free(ch->local_transport_params);
crypto/openssl/ssl/quic/quic_channel.c
1158
ch->local_transport_params = NULL;
crypto/openssl/ssl/quic/quic_channel.c
116
if (ch->is_server && ch->init_dcid.id_len == 0)
crypto/openssl/ssl/quic/quic_channel.c
1161
ossl_qrx_allow_1rtt_processing(ch->qrx);
crypto/openssl/ssl/quic/quic_channel.c
1164
ossl_quic_tx_packetiser_notify_handshake_complete(ch->txp);
crypto/openssl/ssl/quic/quic_channel.c
1166
ch->handshake_complete = 1;
crypto/openssl/ssl/quic/quic_channel.c
1168
if (ch->pending_new_token != NULL) {
crypto/openssl/ssl/quic/quic_channel.c
1177
ossl_quic_channel_schedule_new_token(ch,
crypto/openssl/ssl/quic/quic_channel.c
1178
ch->pending_new_token,
crypto/openssl/ssl/quic/quic_channel.c
1179
ch->pending_new_token_len);
crypto/openssl/ssl/quic/quic_channel.c
1180
OPENSSL_free(ch->pending_new_token);
crypto/openssl/ssl/quic/quic_channel.c
1181
ch->pending_new_token = NULL;
crypto/openssl/ssl/quic/quic_channel.c
1182
ch->pending_new_token_len = 0;
crypto/openssl/ssl/quic/quic_channel.c
1185
if (ch->is_server) {
crypto/openssl/ssl/quic/quic_channel.c
1189
ossl_quic_channel_on_handshake_confirmed(ch);
crypto/openssl/ssl/quic/quic_channel.c
119
qti.odcid = ch->init_dcid;
crypto/openssl/ssl/quic/quic_channel.c
1191
ossl_quic_tx_packetiser_schedule_handshake_done(ch->txp);
crypto/openssl/ssl/quic/quic_channel.c
1194
ch_record_state_transition(ch, ch->state);
crypto/openssl/ssl/quic/quic_channel.c
120
qti.title = ch->qlog_title;
crypto/openssl/ssl/quic/quic_channel.c
1200
QUIC_CHANNEL *ch = arg;
crypto/openssl/ssl/quic/quic_channel.c
1208
&& ch->handshake_complete
crypto/openssl/ssl/quic/quic_channel.c
1209
&& ossl_quic_tls_is_cert_request(ch->qtls))
crypto/openssl/ssl/quic/quic_channel.c
1210
ossl_quic_channel_raise_protocol_error(ch,
crypto/openssl/ssl/quic/quic_channel.c
1223
&& ch->handshake_complete
crypto/openssl/ssl/quic/quic_channel.c
1224
&& ossl_quic_tls_has_bad_max_early_data(ch->qtls))
crypto/openssl/ssl/quic/quic_channel.c
1225
ossl_quic_channel_raise_protocol_error(ch,
crypto/openssl/ssl/quic/quic_channel.c
123
qti.is_server = ch->is_server;
crypto/openssl/ssl/quic/quic_channel.c
1230
ossl_quic_channel_raise_protocol_error(ch,
crypto/openssl/ssl/quic/quic_channel.c
125
qti.now_cb_arg = ch;
crypto/openssl/ssl/quic/quic_channel.c
126
if ((ch->qlog = ossl_qlog_new_from_env(&qti)) == NULL) {
crypto/openssl/ssl/quic/quic_channel.c
127
ch->use_qlog = 0; /* don't try again */
crypto/openssl/ssl/quic/quic_channel.c
1283
QUIC_CHANNEL *ch = arg;
crypto/openssl/ssl/quic/quic_channel.c
1285
ossl_quic_stream_map_update_state(&ch->qsm, s);
crypto/openssl/ssl/quic/quic_channel.c
1302
QUIC_CHANNEL *ch = arg;
crypto/openssl/ssl/quic/quic_channel.c
131
return ch->qlog;
crypto/openssl/ssl/quic/quic_channel.c
1329
SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(ch->tls);
crypto/openssl/ssl/quic/quic_channel.c
1335
if (ch->is_server && sc->hello_retry_request != SSL_HRR_NONE
crypto/openssl/ssl/quic/quic_channel.c
1336
&& ch->got_remote_transport_params) {
crypto/openssl/ssl/quic/quic_channel.c
1337
ch->max_local_streams_bidi = 0;
crypto/openssl/ssl/quic/quic_channel.c
1338
ch->max_local_streams_uni = 0;
crypto/openssl/ssl/quic/quic_channel.c
1339
ch->got_local_transport_params = 0;
crypto/openssl/ssl/quic/quic_channel.c
1340
OPENSSL_free(ch->local_transport_params);
crypto/openssl/ssl/quic/quic_channel.c
1341
ch->local_transport_params = NULL;
crypto/openssl/ssl/quic/quic_channel.c
1342
} else if (ch->got_remote_transport_params) {
crypto/openssl/ssl/quic/quic_channel.c
1348
ossl_quic_channel_raise_protocol_error(ch, OSSL_QUIC_ERR_INTERNAL_ERROR, 0,
crypto/openssl/ssl/quic/quic_channel.c
1364
if (ch->is_server) {
crypto/openssl/ssl/quic/quic_channel.c
1376
if (!ossl_quic_conn_id_eq(&ch->init_dcid, &cid)) {
crypto/openssl/ssl/quic/quic_channel.c
1386
if (ch->is_server) {
crypto/openssl/ssl/quic/quic_channel.c
1396
if (!ch->doing_retry) {
crypto/openssl/ssl/quic/quic_channel.c
140
QUIC_CHANNEL *ch = arg;
crypto/openssl/ssl/quic/quic_channel.c
1407
if (!ossl_quic_conn_id_eq(&ch->retry_scid, &cid)) {
crypto/openssl/ssl/quic/quic_channel.c
142
return ch_get_qlog(ch);
crypto/openssl/ssl/quic/quic_channel.c
1427
if (!ossl_quic_conn_id_eq(&ch->init_scid, &cid)) {
crypto/openssl/ssl/quic/quic_channel.c
1447
ossl_quic_txfc_bump_cwm(&ch->conn_txfc, v);
crypto/openssl/ssl/quic/quic_channel.c
1467
ch->rx_init_max_stream_data_bidi_remote = v;
crypto/openssl/ssl/quic/quic_channel.c
1487
ch->rx_init_max_stream_data_bidi_local = v;
crypto/openssl/ssl/quic/quic_channel.c
1490
ossl_quic_stream_map_visit(&ch->qsm, txfc_bump_cwm_bidi, &v);
crypto/openssl/ssl/quic/quic_channel.c
1506
ch->rx_init_max_stream_data_uni = v;
crypto/openssl/ssl/quic/quic_channel.c
1509
ossl_quic_stream_map_visit(&ch->qsm, txfc_bump_cwm_uni, &v);
crypto/openssl/ssl/quic/quic_channel.c
1526
ch->rx_ack_delay_exp = (unsigned char)v;
crypto/openssl/ssl/quic/quic_channel.c
1543
ch->rx_max_ack_delay = v;
crypto/openssl/ssl/quic/quic_channel.c
1544
ossl_ackm_set_rx_max_ack_delay(ch->ackm,
crypto/openssl/ssl/quic/quic_channel.c
1545
ossl_ms2time(ch->rx_max_ack_delay));
crypto/openssl/ssl/quic/quic_channel.c
1563
assert(ch->max_local_streams_bidi == 0);
crypto/openssl/ssl/quic/quic_channel.c
1564
ch->max_local_streams_bidi = v;
crypto/openssl/ssl/quic/quic_channel.c
157
static int ch_init(QUIC_CHANNEL *ch)
crypto/openssl/ssl/quic/quic_channel.c
1581
assert(ch->max_local_streams_uni == 0);
crypto/openssl/ssl/quic/quic_channel.c
1582
ch->max_local_streams_uni = v;
crypto/openssl/ssl/quic/quic_channel.c
1598
ch->max_idle_timeout_remote_req = v;
crypto/openssl/ssl/quic/quic_channel.c
1600
ch->max_idle_timeout = min_u64_ignore_0(ch->max_idle_timeout_local_req,
crypto/openssl/ssl/quic/quic_channel.c
1601
ch->max_idle_timeout_remote_req);
crypto/openssl/ssl/quic/quic_channel.c
1603
ch_update_idle(ch);
crypto/openssl/ssl/quic/quic_channel.c
1621
ch->rx_max_udp_payload_size = v;
crypto/openssl/ssl/quic/quic_channel.c
1638
ch->rx_active_conn_id_limit = v;
crypto/openssl/ssl/quic/quic_channel.c
1652
if (ch->is_server) {
crypto/openssl/ssl/quic/quic_channel.c
1662
if (!ossl_quic_srtm_add(ch->srtm, ch, ch->cur_remote_seq_num,
crypto/openssl/ssl/quic/quic_channel.c
167
if (ch->port == NULL || ch->lcidm == NULL || ch->srtm == NULL)
crypto/openssl/ssl/quic/quic_channel.c
1687
if (ch->is_server) {
crypto/openssl/ssl/quic/quic_channel.c
1692
if (ch->cur_remote_dcid.id_len == 0) {
crypto/openssl/ssl/quic/quic_channel.c
170
rx_short_dcid_len = ossl_quic_port_get_rx_short_dcid_len(ch->port);
crypto/openssl/ssl/quic/quic_channel.c
171
tx_init_dcid_len = ossl_quic_port_get_tx_init_dcid_len(ch->port);
crypto/openssl/ssl/quic/quic_channel.c
174
if (!ch->is_server
crypto/openssl/ssl/quic/quic_channel.c
175
&& !ossl_quic_gen_rand_conn_id(ch->port->engine->libctx, tx_init_dcid_len,
crypto/openssl/ssl/quic/quic_channel.c
1751
if (!ch->is_server) {
crypto/openssl/ssl/quic/quic_channel.c
1757
if (ch->doing_retry && !got_retry_scid) {
crypto/openssl/ssl/quic/quic_channel.c
176
&ch->init_dcid))
crypto/openssl/ssl/quic/quic_channel.c
1763
ch->got_remote_transport_params = 1;
crypto/openssl/ssl/quic/quic_channel.c
1766
QLOG_EVENT_BEGIN(ch_get_qlog(ch), transport, parameters_set)
crypto/openssl/ssl/quic/quic_channel.c
1771
&ch->init_dcid);
crypto/openssl/ssl/quic/quic_channel.c
1774
&ch->init_dcid);
crypto/openssl/ssl/quic/quic_channel.c
1777
&ch->retry_scid);
crypto/openssl/ssl/quic/quic_channel.c
1780
ossl_quic_txfc_get_cwm(&ch->conn_txfc));
crypto/openssl/ssl/quic/quic_channel.c
1783
ch->rx_init_max_stream_data_bidi_local);
crypto/openssl/ssl/quic/quic_channel.c
1786
ch->rx_init_max_stream_data_bidi_remote);
crypto/openssl/ssl/quic/quic_channel.c
1789
ch->rx_init_max_stream_data_uni);
crypto/openssl/ssl/quic/quic_channel.c
1792
ch->max_local_streams_bidi);
crypto/openssl/ssl/quic/quic_channel.c
1795
ch->max_local_streams_uni);
crypto/openssl/ssl/quic/quic_channel.c
1797
QLOG_U64("ack_delay_exponent", ch->rx_ack_delay_exp);
crypto/openssl/ssl/quic/quic_channel.c
1799
QLOG_U64("max_ack_delay", ch->rx_max_ack_delay);
crypto/openssl/ssl/quic/quic_channel.c
180
qtx_args.libctx = ch->port->engine->libctx;
crypto/openssl/ssl/quic/quic_channel.c
1801
QLOG_U64("max_udp_payload_size", ch->rx_max_udp_payload_size);
crypto/openssl/ssl/quic/quic_channel.c
1805
QLOG_U64("active_connection_id_limit", ch->rx_active_conn_id_limit);
crypto/openssl/ssl/quic/quic_channel.c
182
qtx_args.get_qlog_cb_arg = ch;
crypto/openssl/ssl/quic/quic_channel.c
1830
ossl_quic_stream_map_visit(&ch->qsm, do_update, ch);
crypto/openssl/ssl/quic/quic_channel.c
1833
if (ch->is_server && !ch_generate_transport_params(ch)) {
crypto/openssl/ssl/quic/quic_channel.c
1834
ossl_quic_channel_raise_protocol_error(ch, OSSL_QUIC_ERR_INTERNAL_ERROR, 0,
crypto/openssl/ssl/quic/quic_channel.c
184
ch->rx_max_udp_payload_size = qtx_args.mdpl;
crypto/openssl/ssl/quic/quic_channel.c
1842
ossl_quic_channel_raise_protocol_error(ch, OSSL_QUIC_ERR_TRANSPORT_PARAMETER_ERROR,
crypto/openssl/ssl/quic/quic_channel.c
1852
static int ch_generate_transport_params(QUIC_CHANNEL *ch)
crypto/openssl/ssl/quic/quic_channel.c
186
ch->ping_deadline = ossl_time_infinite();
crypto/openssl/ssl/quic/quic_channel.c
1870
if (ch->odcid.id_len == 0)
crypto/openssl/ssl/quic/quic_channel.c
1871
id_to_use = &ch->init_dcid;
crypto/openssl/ssl/quic/quic_channel.c
1873
id_to_use = &ch->odcid;
crypto/openssl/ssl/quic/quic_channel.c
1875
if (ch->local_transport_params != NULL || ch->got_local_transport_params)
crypto/openssl/ssl/quic/quic_channel.c
188
ch->qtx = ossl_qtx_new(&qtx_args);
crypto/openssl/ssl/quic/quic_channel.c
189
if (ch->qtx == NULL)
crypto/openssl/ssl/quic/quic_channel.c
1891
if (ch->is_server) {
crypto/openssl/ssl/quic/quic_channel.c
1897
&ch->cur_local_cid))
crypto/openssl/ssl/quic/quic_channel.c
1899
if (ch->odcid.id_len != 0)
crypto/openssl/ssl/quic/quic_channel.c
1902
&ch->init_dcid))
crypto/openssl/ssl/quic/quic_channel.c
1906
&ch->init_scid))
crypto/openssl/ssl/quic/quic_channel.c
1911
ch->max_idle_timeout_local_req))
crypto/openssl/ssl/quic/quic_channel.c
192
ch->txpim = ossl_quic_txpim_new();
crypto/openssl/ssl/quic/quic_channel.c
1922
if (ch->tx_max_ack_delay != QUIC_DEFAULT_MAX_ACK_DELAY
crypto/openssl/ssl/quic/quic_channel.c
1924
ch->tx_max_ack_delay))
crypto/openssl/ssl/quic/quic_channel.c
1928
ossl_quic_rxfc_get_cwm(&ch->conn_rxfc)))
crypto/openssl/ssl/quic/quic_channel.c
193
if (ch->txpim == NULL)
crypto/openssl/ssl/quic/quic_channel.c
1933
ch->tx_init_max_stream_data_bidi_local))
crypto/openssl/ssl/quic/quic_channel.c
1937
ch->tx_init_max_stream_data_bidi_remote))
crypto/openssl/ssl/quic/quic_channel.c
1941
ch->tx_init_max_stream_data_uni))
crypto/openssl/ssl/quic/quic_channel.c
1945
ossl_quic_rxfc_get_cwm(&ch->max_streams_bidi_rxfc)))
crypto/openssl/ssl/quic/quic_channel.c
1949
ossl_quic_rxfc_get_cwm(&ch->max_streams_uni_rxfc)))
crypto/openssl/ssl/quic/quic_channel.c
196
ch->cfq = ossl_quic_cfq_new();
crypto/openssl/ssl/quic/quic_channel.c
1960
ch->local_transport_params = (unsigned char *)buf_mem->data;
crypto/openssl/ssl/quic/quic_channel.c
1963
if (!ossl_quic_tls_set_transport_params(ch->qtls, ch->local_transport_params,
crypto/openssl/ssl/quic/quic_channel.c
1968
QLOG_EVENT_BEGIN(ch_get_qlog(ch), transport, parameters_set)
crypto/openssl/ssl/quic/quic_channel.c
197
if (ch->cfq == NULL)
crypto/openssl/ssl/quic/quic_channel.c
1971
if (ch->is_server) {
crypto/openssl/ssl/quic/quic_channel.c
1972
QLOG_CID("original_destination_connection_id", &ch->init_dcid);
crypto/openssl/ssl/quic/quic_channel.c
1973
QLOG_CID("initial_source_connection_id", &ch->cur_local_cid);
crypto/openssl/ssl/quic/quic_channel.c
1977
QLOG_U64("max_idle_timeout", ch->max_idle_timeout);
crypto/openssl/ssl/quic/quic_channel.c
1980
QLOG_U64("max_ack_delay", ch->tx_max_ack_delay);
crypto/openssl/ssl/quic/quic_channel.c
1981
QLOG_U64("initial_max_data", ossl_quic_rxfc_get_cwm(&ch->conn_rxfc));
crypto/openssl/ssl/quic/quic_channel.c
1983
ch->tx_init_max_stream_data_bidi_local);
crypto/openssl/ssl/quic/quic_channel.c
1985
ch->tx_init_max_stream_data_bidi_remote);
crypto/openssl/ssl/quic/quic_channel.c
1987
ch->tx_init_max_stream_data_uni);
crypto/openssl/ssl/quic/quic_channel.c
1989
ossl_quic_rxfc_get_cwm(&ch->max_streams_bidi_rxfc));
crypto/openssl/ssl/quic/quic_channel.c
1991
ossl_quic_rxfc_get_cwm(&ch->max_streams_uni_rxfc));
crypto/openssl/ssl/quic/quic_channel.c
1995
ch->got_local_transport_params = 1;
crypto/openssl/ssl/quic/quic_channel.c
200
if (!ossl_quic_txfc_init(&ch->conn_txfc, NULL))
crypto/openssl/ssl/quic/quic_channel.c
2015
void ossl_quic_channel_subtick(QUIC_CHANNEL *ch, QUIC_TICK_RESULT *res,
crypto/openssl/ssl/quic/quic_channel.c
2037
if (ch->state == QUIC_CHANNEL_STATE_IDLE
crypto/openssl/ssl/quic/quic_channel.c
2038
|| ossl_quic_channel_is_terminated(ch)) {
crypto/openssl/ssl/quic/quic_channel.c
2050
if (ossl_quic_channel_is_terminating(ch)) {
crypto/openssl/ssl/quic/quic_channel.c
2051
now = get_time(ch);
crypto/openssl/ssl/quic/quic_channel.c
2053
if (ossl_time_compare(now, ch->terminate_deadline) >= 0) {
crypto/openssl/ssl/quic/quic_channel.c
2054
ch_on_terminating_timeout(ch);
crypto/openssl/ssl/quic/quic_channel.c
2063
if (!ch->port->engine->inhibit_tick) {
crypto/openssl/ssl/quic/quic_channel.c
2065
ch_rxku_tick(ch);
crypto/openssl/ssl/quic/quic_channel.c
2069
ch->did_tls_tick = 0;
crypto/openssl/ssl/quic/quic_channel.c
207
ch->tx_init_max_stream_data_bidi_local = DEFAULT_INIT_STREAM_RXFC_WND;
crypto/openssl/ssl/quic/quic_channel.c
2070
ch->have_new_rx_secret = 0;
crypto/openssl/ssl/quic/quic_channel.c
2071
ch_rx(ch, channel_only, &notify_other_threads);
crypto/openssl/ssl/quic/quic_channel.c
2077
if (!ch->did_tls_tick)
crypto/openssl/ssl/quic/quic_channel.c
2078
ch_tick_tls(ch, channel_only, &notify_other_threads);
crypto/openssl/ssl/quic/quic_channel.c
208
ch->tx_init_max_stream_data_bidi_remote = DEFAULT_INIT_STREAM_RXFC_WND;
crypto/openssl/ssl/quic/quic_channel.c
2087
} while (ch->have_new_rx_secret);
crypto/openssl/ssl/quic/quic_channel.c
209
ch->tx_init_max_stream_data_uni = DEFAULT_INIT_STREAM_RXFC_WND;
crypto/openssl/ssl/quic/quic_channel.c
2097
now = get_time(ch);
crypto/openssl/ssl/quic/quic_channel.c
2098
if (ossl_time_compare(now, ch->idle_deadline) >= 0) {
crypto/openssl/ssl/quic/quic_channel.c
2103
if (!ch->port->engine->inhibit_tick)
crypto/openssl/ssl/quic/quic_channel.c
2104
ch_on_idle_timeout(ch);
crypto/openssl/ssl/quic/quic_channel.c
211
if (!ossl_quic_rxfc_init(&ch->conn_rxfc, NULL,
crypto/openssl/ssl/quic/quic_channel.c
2113
if (!ch->port->engine->inhibit_tick) {
crypto/openssl/ssl/quic/quic_channel.c
2114
deadline = ossl_ackm_get_loss_detection_deadline(ch->ackm);
crypto/openssl/ssl/quic/quic_channel.c
2117
ossl_ackm_on_timeout(ch->ackm);
crypto/openssl/ssl/quic/quic_channel.c
2120
if (ossl_time_compare(now, ch->ping_deadline) >= 0) {
crypto/openssl/ssl/quic/quic_channel.c
2121
int pn_space = ossl_quic_enc_level_to_pn_space(ch->tx_enc_level);
crypto/openssl/ssl/quic/quic_channel.c
2123
ossl_quic_tx_packetiser_schedule_ack_eliciting(ch->txp, pn_space);
crypto/openssl/ssl/quic/quic_channel.c
2132
ch_update_ping_deadline(ch);
crypto/openssl/ssl/quic/quic_channel.c
2136
ch_tx(ch, &notify_other_threads);
crypto/openssl/ssl/quic/quic_channel.c
2139
ossl_quic_stream_map_gc(&ch->qsm);
crypto/openssl/ssl/quic/quic_channel.c
214
get_time, ch))
crypto/openssl/ssl/quic/quic_channel.c
2143
res->tick_deadline = ch_determine_next_tick_deadline(ch);
crypto/openssl/ssl/quic/quic_channel.c
2150
res->net_read_desired = !ossl_quic_channel_is_terminated(ch);
crypto/openssl/ssl/quic/quic_channel.c
2154
= (!ossl_quic_channel_is_terminated(ch)
crypto/openssl/ssl/quic/quic_channel.c
2155
&& ossl_qtx_get_queue_len_datagrams(ch->qtx) > 0);
crypto/openssl/ssl/quic/quic_channel.c
2160
static int ch_tick_tls(QUIC_CHANNEL *ch, int channel_only, int *notify_other_threads)
crypto/openssl/ssl/quic/quic_channel.c
2169
ch->did_tls_tick = 1;
crypto/openssl/ssl/quic/quic_channel.c
2170
ossl_quic_tls_tick(ch->qtls);
crypto/openssl/ssl/quic/quic_channel.c
2172
if (ossl_quic_tls_get_error(ch->qtls, &error_code, &error_msg,
crypto/openssl/ssl/quic/quic_channel.c
2174
ossl_quic_channel_raise_protocol_error_state(ch, error_code, 0,
crypto/openssl/ssl/quic/quic_channel.c
218
if (!ossl_quic_rxfc_init_standalone(&ch->crypto_rxfc[pn_space],
crypto/openssl/ssl/quic/quic_channel.c
2186
static void ch_rx_check_forged_pkt_limit(QUIC_CHANNEL *ch)
crypto/openssl/ssl/quic/quic_channel.c
2198
if ((ch->el_discarded & (1U << enc_level)) != 0)
crypto/openssl/ssl/quic/quic_channel.c
220
get_time, ch))
crypto/openssl/ssl/quic/quic_channel.c
2201
if (enc_level > ch->rx_enc_level)
crypto/openssl/ssl/quic/quic_channel.c
2204
l = ossl_qrx_get_max_forged_pkt_count(ch->qrx, enc_level);
crypto/openssl/ssl/quic/quic_channel.c
2209
if (ossl_qrx_get_cur_forged_pkt_count(ch->qrx) < limit)
crypto/openssl/ssl/quic/quic_channel.c
2212
ossl_quic_channel_raise_protocol_error(ch, OSSL_QUIC_ERR_AEAD_LIMIT_REACHED, 0,
crypto/openssl/ssl/quic/quic_channel.c
2217
static int ch_rx(QUIC_CHANNEL *ch, int channel_only, int *notify_other_threads)
crypto/openssl/ssl/quic/quic_channel.c
2220
const int closing = ossl_quic_channel_is_closing(ch);
crypto/openssl/ssl/quic/quic_channel.c
2222
if (!ch->is_server && !ch->have_sent_any_pkt)
crypto/openssl/ssl/quic/quic_channel.c
223
if (!ossl_quic_rxfc_init_standalone(&ch->max_streams_bidi_rxfc,
crypto/openssl/ssl/quic/quic_channel.c
2230
assert(ch->qrx_pkt == NULL);
crypto/openssl/ssl/quic/quic_channel.c
2232
if (!ossl_qrx_read_pkt(ch->qrx, &ch->qrx_pkt))
crypto/openssl/ssl/quic/quic_channel.c
2238
ch->txp, ch->qrx_pkt->hdr->len);
crypto/openssl/ssl/quic/quic_channel.c
2241
ch_update_idle(ch);
crypto/openssl/ssl/quic/quic_channel.c
2242
ch_update_ping_deadline(ch);
crypto/openssl/ssl/quic/quic_channel.c
2245
ch_rx_handle_packet(ch, channel_only); /* best effort */
crypto/openssl/ssl/quic/quic_channel.c
225
get_time, ch))
crypto/openssl/ssl/quic/quic_channel.c
2252
ossl_qrx_pkt_release(ch->qrx_pkt);
crypto/openssl/ssl/quic/quic_channel.c
2253
ch->qrx_pkt = NULL;
crypto/openssl/ssl/quic/quic_channel.c
2255
ch->have_sent_ack_eliciting_since_rx = 0;
crypto/openssl/ssl/quic/quic_channel.c
2259
ch_rx_check_forged_pkt_limit(ch);
crypto/openssl/ssl/quic/quic_channel.c
2269
ch->conn_close_queued = 1;
crypto/openssl/ssl/quic/quic_channel.c
228
if (!ossl_quic_rxfc_init_standalone(&ch->max_streams_uni_rxfc,
crypto/openssl/ssl/quic/quic_channel.c
230
get_time, ch))
crypto/openssl/ssl/quic/quic_channel.c
2300
static void ch_rx_handle_packet(QUIC_CHANNEL *ch, int channel_only)
crypto/openssl/ssl/quic/quic_channel.c
2303
int old_have_processed_any_pkt = ch->have_processed_any_pkt;
crypto/openssl/ssl/quic/quic_channel.c
2308
assert(ch->qrx_pkt != NULL);
crypto/openssl/ssl/quic/quic_channel.c
2315
if (!ossl_quic_channel_is_active(ch))
crypto/openssl/ssl/quic/quic_channel.c
2318
if (ossl_quic_pkt_type_is_encrypted(ch->qrx_pkt->hdr->type)) {
crypto/openssl/ssl/quic/quic_channel.c
2319
if (!ch->have_received_enc_pkt) {
crypto/openssl/ssl/quic/quic_channel.c
2320
ch->cur_remote_dcid = ch->init_scid = ch->qrx_pkt->hdr->src_conn_id;
crypto/openssl/ssl/quic/quic_channel.c
2321
ch->have_received_enc_pkt = 1;
crypto/openssl/ssl/quic/quic_channel.c
2327
ossl_quic_tx_packetiser_set_cur_dcid(ch->txp, &ch->init_scid);
crypto/openssl/ssl/quic/quic_channel.c
233
if (!ossl_statm_init(&ch->statm))
crypto/openssl/ssl/quic/quic_channel.c
2330
enc_level = ossl_quic_pkt_type_to_enc_level(ch->qrx_pkt->hdr->type);
crypto/openssl/ssl/quic/quic_channel.c
2331
if ((ch->el_discarded & (1U << enc_level)) != 0)
crypto/openssl/ssl/quic/quic_channel.c
2346
if (!ch->is_server
crypto/openssl/ssl/quic/quic_channel.c
2347
&& ch->qrx_pkt->peer != NULL
crypto/openssl/ssl/quic/quic_channel.c
2348
&& (BIO_ADDR_family(&ch->cur_peer_addr) == AF_INET
crypto/openssl/ssl/quic/quic_channel.c
2350
|| BIO_ADDR_family(&ch->cur_peer_addr) == AF_INET6
crypto/openssl/ssl/quic/quic_channel.c
2353
&& !bio_addr_eq(ch->qrx_pkt->peer, &ch->cur_peer_addr))
crypto/openssl/ssl/quic/quic_channel.c
2356
if (!ch->is_server
crypto/openssl/ssl/quic/quic_channel.c
2357
&& ch->have_received_enc_pkt
crypto/openssl/ssl/quic/quic_channel.c
2358
&& ossl_quic_pkt_type_has_scid(ch->qrx_pkt->hdr->type)) {
crypto/openssl/ssl/quic/quic_channel.c
236
ch->have_statm = 1;
crypto/openssl/ssl/quic/quic_channel.c
2364
if (!ossl_quic_conn_id_eq(&ch->qrx_pkt->hdr->src_conn_id,
crypto/openssl/ssl/quic/quic_channel.c
2365
&ch->init_scid))
crypto/openssl/ssl/quic/quic_channel.c
2369
if (ossl_quic_pkt_type_has_version(ch->qrx_pkt->hdr->type)
crypto/openssl/ssl/quic/quic_channel.c
237
ch->cc_method = &ossl_cc_newreno_method;
crypto/openssl/ssl/quic/quic_channel.c
2370
&& ch->qrx_pkt->hdr->version != QUIC_VERSION_1)
crypto/openssl/ssl/quic/quic_channel.c
2378
if (ch->qrx_pkt->hdr->type == QUIC_PKT_TYPE_VERSION_NEG) {
crypto/openssl/ssl/quic/quic_channel.c
238
if ((ch->cc_data = ch->cc_method->new(get_time, ch)) == NULL)
crypto/openssl/ssl/quic/quic_channel.c
2384
if (ch->qrx_pkt->hdr->version != 0)
crypto/openssl/ssl/quic/quic_channel.c
2409
ch->have_processed_any_pkt = 1;
crypto/openssl/ssl/quic/quic_channel.c
241
if ((ch->ackm = ossl_ackm_new(get_time, ch, &ch->statm,
crypto/openssl/ssl/quic/quic_channel.c
2419
if (!PACKET_buf_init(&vpkt, ch->qrx_pkt->hdr->data,
crypto/openssl/ssl/quic/quic_channel.c
242
ch->cc_method, ch->cc_data,
crypto/openssl/ssl/quic/quic_channel.c
2420
ch->qrx_pkt->hdr->len))
crypto/openssl/ssl/quic/quic_channel.c
243
ch->is_server))
crypto/openssl/ssl/quic/quic_channel.c
2436
ossl_quic_tx_packetiser_set_protocol_version(ch->txp, QUIC_VERSION_1);
crypto/openssl/ssl/quic/quic_channel.c
2441
if (!ch_restart(ch))
crypto/openssl/ssl/quic/quic_channel.c
2442
ossl_quic_channel_raise_protocol_error(ch,
crypto/openssl/ssl/quic/quic_channel.c
2453
ossl_quic_channel_raise_protocol_error(ch, OSSL_QUIC_ERR_CONNECTION_REFUSED,
crypto/openssl/ssl/quic/quic_channel.c
2458
ch->have_processed_any_pkt = 1;
crypto/openssl/ssl/quic/quic_channel.c
2465
if (ossl_quic_pkt_type_is_encrypted(ch->qrx_pkt->hdr->type)
crypto/openssl/ssl/quic/quic_channel.c
2466
&& ch->qrx_pkt->hdr->reserved != 0) {
crypto/openssl/ssl/quic/quic_channel.c
2467
ossl_quic_channel_raise_protocol_error(ch, OSSL_QUIC_ERR_PROTOCOL_VIOLATION,
crypto/openssl/ssl/quic/quic_channel.c
247
if (!ossl_quic_stream_map_init(&ch->qsm, get_stream_limit, ch,
crypto/openssl/ssl/quic/quic_channel.c
2472
iovec.buf = ch->qrx_pkt->hdr->data;
crypto/openssl/ssl/quic/quic_channel.c
2473
iovec.buf_len = ch->qrx_pkt->hdr->len;
crypto/openssl/ssl/quic/quic_channel.c
2474
ossl_qlog_event_transport_packet_received(ch_get_qlog(ch), ch->qrx_pkt->hdr,
crypto/openssl/ssl/quic/quic_channel.c
2475
ch->qrx_pkt->pn, &iovec, 1,
crypto/openssl/ssl/quic/quic_channel.c
2476
ch->qrx_pkt->datagram_id);
crypto/openssl/ssl/quic/quic_channel.c
2479
switch (ch->qrx_pkt->hdr->type) {
crypto/openssl/ssl/quic/quic_channel.c
248
&ch->max_streams_bidi_rxfc,
crypto/openssl/ssl/quic/quic_channel.c
2481
if (ch->doing_retry || ch->is_server)
crypto/openssl/ssl/quic/quic_channel.c
249
&ch->max_streams_uni_rxfc,
crypto/openssl/ssl/quic/quic_channel.c
2493
if (ch->have_received_enc_pkt)
crypto/openssl/ssl/quic/quic_channel.c
2496
if (ch->qrx_pkt->hdr->len <= QUIC_RETRY_INTEGRITY_TAG_LEN)
crypto/openssl/ssl/quic/quic_channel.c
250
ch->is_server))
crypto/openssl/ssl/quic/quic_channel.c
2509
if (!ossl_quic_validate_retry_integrity_tag(ch->port->engine->libctx,
crypto/openssl/ssl/quic/quic_channel.c
2510
ch->port->engine->propq,
crypto/openssl/ssl/quic/quic_channel.c
2511
ch->qrx_pkt->hdr,
crypto/openssl/ssl/quic/quic_channel.c
2512
&ch->init_dcid))
crypto/openssl/ssl/quic/quic_channel.c
2516
if (!ch_retry(ch, ch->qrx_pkt->hdr->data,
crypto/openssl/ssl/quic/quic_channel.c
2517
ch->qrx_pkt->hdr->len - QUIC_RETRY_INTEGRITY_TAG_LEN,
crypto/openssl/ssl/quic/quic_channel.c
2518
&ch->qrx_pkt->hdr->src_conn_id, old_have_processed_any_pkt))
crypto/openssl/ssl/quic/quic_channel.c
2519
ossl_quic_channel_raise_protocol_error(ch, OSSL_QUIC_ERR_INTERNAL_ERROR,
crypto/openssl/ssl/quic/quic_channel.c
2524
if (!ch->is_server)
crypto/openssl/ssl/quic/quic_channel.c
253
ch->have_qsm = 1;
crypto/openssl/ssl/quic/quic_channel.c
2538
if (ch->is_server && ch->qrx_pkt->hdr->type == QUIC_PKT_TYPE_HANDSHAKE)
crypto/openssl/ssl/quic/quic_channel.c
2543
ch_discard_el(ch, QUIC_ENC_LEVEL_INITIAL);
crypto/openssl/ssl/quic/quic_channel.c
2545
if (ch->rxku_in_progress
crypto/openssl/ssl/quic/quic_channel.c
2546
&& ch->qrx_pkt->hdr->type == QUIC_PKT_TYPE_1RTT
crypto/openssl/ssl/quic/quic_channel.c
2547
&& ch->qrx_pkt->pn >= ch->rxku_trigger_pn
crypto/openssl/ssl/quic/quic_channel.c
2548
&& ch->qrx_pkt->key_epoch < ossl_qrx_get_key_epoch(ch->qrx)) {
crypto/openssl/ssl/quic/quic_channel.c
255
if (!ch->is_server
crypto/openssl/ssl/quic/quic_channel.c
2557
ossl_quic_channel_raise_protocol_error(ch, OSSL_QUIC_ERR_KEY_UPDATE_ERROR,
crypto/openssl/ssl/quic/quic_channel.c
256
&& !ossl_quic_lcidm_generate_initial(ch->lcidm, ch, &ch->init_scid))
crypto/openssl/ssl/quic/quic_channel.c
2562
if (!ch->is_server
crypto/openssl/ssl/quic/quic_channel.c
2563
&& ch->qrx_pkt->hdr->type == QUIC_PKT_TYPE_INITIAL
crypto/openssl/ssl/quic/quic_channel.c
2564
&& ch->qrx_pkt->hdr->token_len > 0) {
crypto/openssl/ssl/quic/quic_channel.c
2582
ossl_quic_channel_raise_protocol_error(ch, OSSL_QUIC_ERR_PROTOCOL_VIOLATION,
crypto/openssl/ssl/quic/quic_channel.c
2588
ossl_quic_handle_frames(ch, ch->qrx_pkt); /* best effort */
crypto/openssl/ssl/quic/quic_channel.c
259
txp_args.cur_scid = ch->init_scid;
crypto/openssl/ssl/quic/quic_channel.c
2590
if (ch->did_crypto_frame)
crypto/openssl/ssl/quic/quic_channel.c
2591
ch_tick_tls(ch, channel_only, NULL);
crypto/openssl/ssl/quic/quic_channel.c
260
txp_args.cur_dcid = ch->init_dcid;
crypto/openssl/ssl/quic/quic_channel.c
2602
static int ch_tx(QUIC_CHANNEL *ch, int *notify_other_threads)
crypto/openssl/ssl/quic/quic_channel.c
2614
if (ossl_quic_channel_is_draining(ch))
crypto/openssl/ssl/quic/quic_channel.c
2617
if (ossl_quic_channel_is_closing(ch)) {
crypto/openssl/ssl/quic/quic_channel.c
262
txp_args.qtx = ch->qtx;
crypto/openssl/ssl/quic/quic_channel.c
2628
if (!ch->conn_close_queued)
crypto/openssl/ssl/quic/quic_channel.c
263
txp_args.txpim = ch->txpim;
crypto/openssl/ssl/quic/quic_channel.c
2631
ch->conn_close_queued = 0;
crypto/openssl/ssl/quic/quic_channel.c
2635
ch_maybe_trigger_spontaneous_txku(ch);
crypto/openssl/ssl/quic/quic_channel.c
2637
ch->rxku_pending_confirm_done = 0;
crypto/openssl/ssl/quic/quic_channel.c
264
txp_args.cfq = ch->cfq;
crypto/openssl/ssl/quic/quic_channel.c
2648
res = ossl_quic_tx_packetiser_generate(ch->txp, &status);
crypto/openssl/ssl/quic/quic_channel.c
265
txp_args.ackm = ch->ackm;
crypto/openssl/ssl/quic/quic_channel.c
2650
ch->have_sent_any_pkt = 1; /* Packet(s) were sent */
crypto/openssl/ssl/quic/quic_channel.c
2651
ch->port->have_sent_any_pkt = 1;
crypto/openssl/ssl/quic/quic_channel.c
2659
&& !ch->have_sent_ack_eliciting_since_rx) {
crypto/openssl/ssl/quic/quic_channel.c
266
txp_args.qsm = &ch->qsm;
crypto/openssl/ssl/quic/quic_channel.c
2660
ch_update_idle(ch);
crypto/openssl/ssl/quic/quic_channel.c
2661
ch->have_sent_ack_eliciting_since_rx = 1;
crypto/openssl/ssl/quic/quic_channel.c
2664
if (!ch->is_server && status.sent_handshake)
crypto/openssl/ssl/quic/quic_channel.c
2669
ch_discard_el(ch, QUIC_ENC_LEVEL_INITIAL);
crypto/openssl/ssl/quic/quic_channel.c
267
txp_args.conn_txfc = &ch->conn_txfc;
crypto/openssl/ssl/quic/quic_channel.c
2671
if (ch->rxku_pending_confirm_done)
crypto/openssl/ssl/quic/quic_channel.c
2672
ch->rxku_pending_confirm = 0;
crypto/openssl/ssl/quic/quic_channel.c
2674
ch_update_ping_deadline(ch);
crypto/openssl/ssl/quic/quic_channel.c
268
txp_args.conn_rxfc = &ch->conn_rxfc;
crypto/openssl/ssl/quic/quic_channel.c
269
txp_args.max_streams_bidi_rxfc = &ch->max_streams_bidi_rxfc;
crypto/openssl/ssl/quic/quic_channel.c
2690
ossl_quic_channel_raise_protocol_error(ch, OSSL_QUIC_ERR_INTERNAL_ERROR,
crypto/openssl/ssl/quic/quic_channel.c
2698
switch (ossl_qtx_flush_net(ch->qtx)) {
crypto/openssl/ssl/quic/quic_channel.c
270
txp_args.max_streams_uni_rxfc = &ch->max_streams_uni_rxfc;
crypto/openssl/ssl/quic/quic_channel.c
2707
ossl_quic_port_raise_net_error(ch->port, ch);
crypto/openssl/ssl/quic/quic_channel.c
271
txp_args.cc_method = ch->cc_method;
crypto/openssl/ssl/quic/quic_channel.c
2716
if (ossl_qtx_get_queue_len_datagrams(ch->qtx) > 0)
crypto/openssl/ssl/quic/quic_channel.c
272
txp_args.cc_data = ch->cc_data;
crypto/openssl/ssl/quic/quic_channel.c
2723
static OSSL_TIME ch_determine_next_tick_deadline(QUIC_CHANNEL *ch)
crypto/openssl/ssl/quic/quic_channel.c
2728
if (ossl_quic_channel_is_terminated(ch))
crypto/openssl/ssl/quic/quic_channel.c
2731
deadline = ossl_ackm_get_loss_detection_deadline(ch->ackm);
crypto/openssl/ssl/quic/quic_channel.c
274
txp_args.now_arg = ch;
crypto/openssl/ssl/quic/quic_channel.c
2740
if (ossl_qtx_is_enc_level_provisioned(ch->qtx, i)) {
crypto/openssl/ssl/quic/quic_channel.c
2742
ossl_ackm_get_ack_deadline(ch->ackm,
crypto/openssl/ssl/quic/quic_channel.c
2751
if (!ossl_time_is_infinite(ch->ping_deadline))
crypto/openssl/ssl/quic/quic_channel.c
2752
deadline = ossl_time_min(deadline, ch->ping_deadline);
crypto/openssl/ssl/quic/quic_channel.c
2756
ossl_quic_tx_packetiser_get_deadline(ch->txp));
crypto/openssl/ssl/quic/quic_channel.c
2759
if (ossl_quic_channel_is_terminating(ch))
crypto/openssl/ssl/quic/quic_channel.c
276
txp_args.get_qlog_cb_arg = ch;
crypto/openssl/ssl/quic/quic_channel.c
2761
ch->terminate_deadline);
crypto/openssl/ssl/quic/quic_channel.c
2762
else if (!ossl_time_is_infinite(ch->idle_deadline))
crypto/openssl/ssl/quic/quic_channel.c
2764
ch->idle_deadline);
crypto/openssl/ssl/quic/quic_channel.c
2767
if (ch->rxku_in_progress)
crypto/openssl/ssl/quic/quic_channel.c
2768
deadline = ossl_time_min(deadline, ch->rxku_update_end_deadline);
crypto/openssl/ssl/quic/quic_channel.c
2782
static void ch_record_state_transition(QUIC_CHANNEL *ch, uint32_t new_state)
crypto/openssl/ssl/quic/quic_channel.c
2784
uint32_t old_state = ch->state;
crypto/openssl/ssl/quic/quic_channel.c
2786
ch->state = new_state;
crypto/openssl/ssl/quic/quic_channel.c
2788
ossl_qlog_event_connectivity_connection_state_updated(ch_get_qlog(ch),
crypto/openssl/ssl/quic/quic_channel.c
2791
ch->handshake_complete,
crypto/openssl/ssl/quic/quic_channel.c
2792
ch->handshake_confirmed);
crypto/openssl/ssl/quic/quic_channel.c
280
ch->crypto_send[pn_space] = ossl_quic_sstream_new(INIT_CRYPTO_SEND_BUF_LEN);
crypto/openssl/ssl/quic/quic_channel.c
2801
int ossl_quic_channel_start(QUIC_CHANNEL *ch)
crypto/openssl/ssl/quic/quic_channel.c
2805
if (ch->is_server)
crypto/openssl/ssl/quic/quic_channel.c
281
if (ch->crypto_send[pn_space] == NULL)
crypto/openssl/ssl/quic/quic_channel.c
2812
if (ch->state != QUIC_CHANNEL_STATE_IDLE)
crypto/openssl/ssl/quic/quic_channel.c
2817
if (!ossl_quic_tx_packetiser_set_peer(ch->txp, &ch->cur_peer_addr))
crypto/openssl/ssl/quic/quic_channel.c
2823
if (!ch->is_server
crypto/openssl/ssl/quic/quic_channel.c
2824
&& ossl_quic_get_peer_token(ch->port->channel_ctx,
crypto/openssl/ssl/quic/quic_channel.c
2825
&ch->cur_peer_addr,
crypto/openssl/ssl/quic/quic_channel.c
2827
&& !ossl_quic_tx_packetiser_set_initial_token(ch->txp, token->token,
crypto/openssl/ssl/quic/quic_channel.c
2834
if (!ossl_quic_provide_initial_secret(ch->port->engine->libctx,
crypto/openssl/ssl/quic/quic_channel.c
2835
ch->port->engine->propq,
crypto/openssl/ssl/quic/quic_channel.c
2836
&ch->init_dcid,
crypto/openssl/ssl/quic/quic_channel.c
2837
ch->is_server,
crypto/openssl/ssl/quic/quic_channel.c
2838
ch->qrx, ch->qtx))
crypto/openssl/ssl/quic/quic_channel.c
284
txp_args.crypto[pn_space] = ch->crypto_send[pn_space];
crypto/openssl/ssl/quic/quic_channel.c
2846
if (!ch->is_server && !ch->got_local_transport_params
crypto/openssl/ssl/quic/quic_channel.c
2847
&& !ch_generate_transport_params(ch))
crypto/openssl/ssl/quic/quic_channel.c
2851
ch_record_state_transition(ch, QUIC_CHANNEL_STATE_ACTIVE);
crypto/openssl/ssl/quic/quic_channel.c
2852
ch->doing_proactive_ver_neg = 0; /* not currently supported */
crypto/openssl/ssl/quic/quic_channel.c
2854
ossl_qlog_event_connectivity_connection_started(ch_get_qlog(ch),
crypto/openssl/ssl/quic/quic_channel.c
2855
&ch->init_dcid);
crypto/openssl/ssl/quic/quic_channel.c
2858
if (!ch_tick_tls(ch, /*channel_only=*/0, NULL))
crypto/openssl/ssl/quic/quic_channel.c
2861
ossl_quic_reactor_tick(ossl_quic_port_get0_reactor(ch->port), 0); /* best effort */
crypto/openssl/ssl/quic/quic_channel.c
287
ch->txp = ossl_quic_tx_packetiser_new(&txp_args);
crypto/openssl/ssl/quic/quic_channel.c
2871
void ossl_quic_channel_local_close(QUIC_CHANNEL *ch, uint64_t app_error_code,
crypto/openssl/ssl/quic/quic_channel.c
2876
if (ossl_quic_channel_is_term_any(ch))
crypto/openssl/ssl/quic/quic_channel.c
288
if (ch->txp == NULL)
crypto/openssl/ssl/quic/quic_channel.c
2883
ch_start_terminating(ch, &tcause, 0);
crypto/openssl/ssl/quic/quic_channel.c
2895
static int ch_restart(QUIC_CHANNEL *ch)
crypto/openssl/ssl/quic/quic_channel.c
2901
return ossl_ackm_mark_packet_pseudo_lost(ch->ackm, QUIC_PN_SPACE_INITIAL,
crypto/openssl/ssl/quic/quic_channel.c
2906
static int ch_retry(QUIC_CHANNEL *ch,
crypto/openssl/ssl/quic/quic_channel.c
2919
if (ossl_quic_conn_id_eq(&ch->init_dcid, retry_scid))
crypto/openssl/ssl/quic/quic_channel.c
292
if (!ch->is_server)
crypto/openssl/ssl/quic/quic_channel.c
2923
if (!ossl_quic_tx_packetiser_set_cur_dcid(ch->txp, retry_scid))
crypto/openssl/ssl/quic/quic_channel.c
293
ossl_quic_tx_packetiser_set_validated(ch->txp);
crypto/openssl/ssl/quic/quic_channel.c
2933
if (!ossl_quic_tx_packetiser_set_initial_token(ch->txp, buf,
crypto/openssl/ssl/quic/quic_channel.c
2940
ossl_quic_channel_raise_protocol_error(ch, OSSL_QUIC_ERR_INVALID_TOKEN, 0,
crypto/openssl/ssl/quic/quic_channel.c
2946
ch->retry_scid = *retry_scid;
crypto/openssl/ssl/quic/quic_channel.c
2947
ch->doing_retry = 1;
crypto/openssl/ssl/quic/quic_channel.c
295
ossl_quic_tx_packetiser_set_ack_tx_cb(ch->txp, ch_on_txp_ack_tx, ch);
crypto/openssl/ssl/quic/quic_channel.c
2966
if (!ossl_ackm_mark_packet_pseudo_lost(ch->ackm, QUIC_PN_SPACE_INITIAL,
crypto/openssl/ssl/quic/quic_channel.c
2974
if (!ossl_quic_provide_initial_secret(ch->port->engine->libctx,
crypto/openssl/ssl/quic/quic_channel.c
2975
ch->port->engine->propq,
crypto/openssl/ssl/quic/quic_channel.c
2976
&ch->retry_scid,
crypto/openssl/ssl/quic/quic_channel.c
2978
ch->qrx, ch->qtx))
crypto/openssl/ssl/quic/quic_channel.c
2985
static int ch_discard_el(QUIC_CHANNEL *ch,
crypto/openssl/ssl/quic/quic_channel.c
2991
if ((ch->el_discarded & (1U << enc_level)) != 0)
crypto/openssl/ssl/quic/quic_channel.c
2996
ossl_quic_tx_packetiser_discard_enc_level(ch->txp, enc_level);
crypto/openssl/ssl/quic/quic_channel.c
2997
ossl_qrx_discard_enc_level(ch->qrx, enc_level);
crypto/openssl/ssl/quic/quic_channel.c
2998
ossl_qtx_discard_enc_level(ch->qtx, enc_level);
crypto/openssl/ssl/quic/quic_channel.c
3003
ossl_ackm_on_pkt_space_discarded(ch->ackm, pn_space);
crypto/openssl/ssl/quic/quic_channel.c
3006
if (!ossl_assert(ch->crypto_send[pn_space] != NULL)
crypto/openssl/ssl/quic/quic_channel.c
3007
|| !ossl_assert(ch->crypto_recv[pn_space] != NULL))
crypto/openssl/ssl/quic/quic_channel.c
3011
ossl_quic_sstream_free(ch->crypto_send[pn_space]);
crypto/openssl/ssl/quic/quic_channel.c
3012
ch->crypto_send[pn_space] = NULL;
crypto/openssl/ssl/quic/quic_channel.c
3014
ossl_quic_rstream_free(ch->crypto_recv[pn_space]);
crypto/openssl/ssl/quic/quic_channel.c
3015
ch->crypto_recv[pn_space] = NULL;
crypto/openssl/ssl/quic/quic_channel.c
3018
ch->el_discarded |= (1U << enc_level);
crypto/openssl/ssl/quic/quic_channel.c
3023
int ossl_quic_channel_on_handshake_confirmed(QUIC_CHANNEL *ch)
crypto/openssl/ssl/quic/quic_channel.c
3025
if (ch->handshake_confirmed)
crypto/openssl/ssl/quic/quic_channel.c
3028
if (!ch->handshake_complete) {
crypto/openssl/ssl/quic/quic_channel.c
3033
ossl_quic_channel_raise_protocol_error(ch, OSSL_QUIC_ERR_PROTOCOL_VIOLATION,
crypto/openssl/ssl/quic/quic_channel.c
3040
ch_discard_el(ch, QUIC_ENC_LEVEL_HANDSHAKE);
crypto/openssl/ssl/quic/quic_channel.c
3041
ch->handshake_confirmed = 1;
crypto/openssl/ssl/quic/quic_channel.c
3042
ch_record_state_transition(ch, ch->state);
crypto/openssl/ssl/quic/quic_channel.c
3043
ossl_ackm_on_handshake_confirmed(ch->ackm);
crypto/openssl/ssl/quic/quic_channel.c
307
if (ch->qrx == NULL && ch->is_tserver_ch == 0) {
crypto/openssl/ssl/quic/quic_channel.c
309
qrx_args.libctx = ch->port->engine->libctx;
crypto/openssl/ssl/quic/quic_channel.c
310
qrx_args.demux = ch->port->demux;
crypto/openssl/ssl/quic/quic_channel.c
3123
static void ch_start_terminating(QUIC_CHANNEL *ch,
crypto/openssl/ssl/quic/quic_channel.c
3128
if (!ch->have_sent_any_pkt)
crypto/openssl/ssl/quic/quic_channel.c
3131
switch (ch->state) {
crypto/openssl/ssl/quic/quic_channel.c
3134
copy_tcause(&ch->terminate_cause, tcause);
crypto/openssl/ssl/quic/quic_channel.c
3135
ch_on_terminating_timeout(ch);
crypto/openssl/ssl/quic/quic_channel.c
3139
copy_tcause(&ch->terminate_cause, tcause);
crypto/openssl/ssl/quic/quic_channel.c
314
if ((ch->qrx = ossl_qrx_new(&qrx_args)) == NULL)
crypto/openssl/ssl/quic/quic_channel.c
3141
ossl_qlog_event_connectivity_connection_closed(ch_get_qlog(ch), tcause);
crypto/openssl/ssl/quic/quic_channel.c
3144
ch_record_state_transition(ch, tcause->remote ? QUIC_CHANNEL_STATE_TERMINATING_DRAINING : QUIC_CHANNEL_STATE_TERMINATING_CLOSING);
crypto/openssl/ssl/quic/quic_channel.c
3150
ch->terminate_deadline
crypto/openssl/ssl/quic/quic_channel.c
3151
= ossl_time_add(get_time(ch),
crypto/openssl/ssl/quic/quic_channel.c
3152
ossl_time_multiply(ossl_ackm_get_pto_duration(ch->ackm),
crypto/openssl/ssl/quic/quic_channel.c
3159
f.error_code = ch->terminate_cause.error_code;
crypto/openssl/ssl/quic/quic_channel.c
3160
f.frame_type = ch->terminate_cause.frame_type;
crypto/openssl/ssl/quic/quic_channel.c
3161
f.is_app = ch->terminate_cause.app;
crypto/openssl/ssl/quic/quic_channel.c
3162
f.reason = (char *)ch->terminate_cause.reason;
crypto/openssl/ssl/quic/quic_channel.c
3163
f.reason_len = ch->terminate_cause.reason_len;
crypto/openssl/ssl/quic/quic_channel.c
3164
ossl_quic_tx_packetiser_schedule_conn_close(ch->txp, &f);
crypto/openssl/ssl/quic/quic_channel.c
3172
ch->conn_close_queued = 1;
crypto/openssl/ssl/quic/quic_channel.c
3175
ch_on_terminating_timeout(ch);
crypto/openssl/ssl/quic/quic_channel.c
318
if (ch->qrx != NULL) {
crypto/openssl/ssl/quic/quic_channel.c
3181
ch_on_terminating_timeout(ch);
crypto/openssl/ssl/quic/quic_channel.c
3189
ch_record_state_transition(ch, QUIC_CHANNEL_STATE_TERMINATING_DRAINING);
crypto/openssl/ssl/quic/quic_channel.c
3199
ch_on_terminating_timeout(ch);
crypto/openssl/ssl/quic/quic_channel.c
3210
void ossl_quic_channel_on_remote_conn_close(QUIC_CHANNEL *ch,
crypto/openssl/ssl/quic/quic_channel.c
3215
if (!ossl_quic_channel_is_active(ch))
crypto/openssl/ssl/quic/quic_channel.c
3224
ch_start_terminating(ch, &tcause, 0);
crypto/openssl/ssl/quic/quic_channel.c
3232
static int ch_enqueue_retire_conn_id(QUIC_CHANNEL *ch, uint64_t seq_num)
crypto/openssl/ssl/quic/quic_channel.c
3238
ossl_quic_srtm_remove(ch->srtm, ch, seq_num);
crypto/openssl/ssl/quic/quic_channel.c
324
if (!ossl_qrx_set_late_validation_cb(ch->qrx,
crypto/openssl/ssl/quic/quic_channel.c
3255
if (ossl_quic_cfq_add_frame(ch->cfq, 1, QUIC_PN_SPACE_APP,
crypto/openssl/ssl/quic/quic_channel.c
326
ch))
crypto/openssl/ssl/quic/quic_channel.c
3267
ossl_quic_channel_raise_protocol_error(ch,
crypto/openssl/ssl/quic/quic_channel.c
3275
void ossl_quic_channel_on_new_conn_id(QUIC_CHANNEL *ch,
crypto/openssl/ssl/quic/quic_channel.c
3278
uint64_t new_remote_seq_num = ch->cur_remote_seq_num;
crypto/openssl/ssl/quic/quic_channel.c
3279
uint64_t new_retire_prior_to = ch->cur_retire_prior_to;
crypto/openssl/ssl/quic/quic_channel.c
3281
if (!ossl_quic_channel_is_active(ch))
crypto/openssl/ssl/quic/quic_channel.c
3285
if (ch->cur_remote_dcid.id_len == 0) {
crypto/openssl/ssl/quic/quic_channel.c
3287
ossl_quic_channel_raise_protocol_error(ch,
crypto/openssl/ssl/quic/quic_channel.c
329
if (!ossl_qrx_set_key_update_cb(ch->qrx,
crypto/openssl/ssl/quic/quic_channel.c
331
ch))
crypto/openssl/ssl/quic/quic_channel.c
3311
ossl_quic_channel_raise_protocol_error(ch,
crypto/openssl/ssl/quic/quic_channel.c
3333
if (new_retire_prior_to - ch->cur_retire_prior_to > 10) {
crypto/openssl/ssl/quic/quic_channel.c
3334
ossl_quic_channel_raise_protocol_error(ch,
crypto/openssl/ssl/quic/quic_channel.c
3342
if (new_remote_seq_num > ch->cur_remote_seq_num) {
crypto/openssl/ssl/quic/quic_channel.c
3344
if (!ossl_quic_srtm_add(ch->srtm, ch, new_remote_seq_num,
crypto/openssl/ssl/quic/quic_channel.c
3347
ch, OSSL_QUIC_ERR_CONNECTION_ID_LIMIT_ERROR,
crypto/openssl/ssl/quic/quic_channel.c
3353
ch->cur_remote_seq_num = new_remote_seq_num;
crypto/openssl/ssl/quic/quic_channel.c
3354
ch->cur_remote_dcid = f->conn_id;
crypto/openssl/ssl/quic/quic_channel.c
3355
ossl_quic_tx_packetiser_set_cur_dcid(ch->txp, &ch->cur_remote_dcid);
crypto/openssl/ssl/quic/quic_channel.c
336
ch->crypto_recv[pn_space] = ossl_quic_rstream_new(NULL, NULL, 0);
crypto/openssl/ssl/quic/quic_channel.c
337
if (ch->crypto_recv[pn_space] == NULL)
crypto/openssl/ssl/quic/quic_channel.c
3378
while (new_retire_prior_to > ch->cur_retire_prior_to) {
crypto/openssl/ssl/quic/quic_channel.c
3379
if (!ch_enqueue_retire_conn_id(ch, ch->cur_retire_prior_to))
crypto/openssl/ssl/quic/quic_channel.c
3381
++ch->cur_retire_prior_to;
crypto/openssl/ssl/quic/quic_channel.c
3385
static void ch_save_err_state(QUIC_CHANNEL *ch)
crypto/openssl/ssl/quic/quic_channel.c
3387
if (ch->err_state == NULL)
crypto/openssl/ssl/quic/quic_channel.c
3388
ch->err_state = OSSL_ERR_STATE_new();
crypto/openssl/ssl/quic/quic_channel.c
3390
if (ch->err_state == NULL)
crypto/openssl/ssl/quic/quic_channel.c
3393
OSSL_ERR_STATE_save(ch->err_state);
crypto/openssl/ssl/quic/quic_channel.c
3396
void ossl_quic_channel_inject(QUIC_CHANNEL *ch, QUIC_URXE *e)
crypto/openssl/ssl/quic/quic_channel.c
3398
ossl_qrx_inject_urxe(ch->qrx, e);
crypto/openssl/ssl/quic/quic_channel.c
3401
void ossl_quic_channel_inject_pkt(QUIC_CHANNEL *ch, OSSL_QRX_PKT *qpkt)
crypto/openssl/ssl/quic/quic_channel.c
3403
ossl_qrx_inject_pkt(ch->qrx, qpkt);
crypto/openssl/ssl/quic/quic_channel.c
3406
void ossl_quic_channel_on_stateless_reset(QUIC_CHANNEL *ch)
crypto/openssl/ssl/quic/quic_channel.c
3412
ch_start_terminating(ch, &tcause, 0);
crypto/openssl/ssl/quic/quic_channel.c
3415
void ossl_quic_channel_raise_net_error(QUIC_CHANNEL *ch)
crypto/openssl/ssl/quic/quic_channel.c
3419
if (ch->net_error)
crypto/openssl/ssl/quic/quic_channel.c
342
tls_args.s = ch->tls;
crypto/openssl/ssl/quic/quic_channel.c
3422
ch->net_error = 1;
crypto/openssl/ssl/quic/quic_channel.c
3432
ch_start_terminating(ch, &tcause, 1);
crypto/openssl/ssl/quic/quic_channel.c
3435
int ossl_quic_channel_net_error(QUIC_CHANNEL *ch)
crypto/openssl/ssl/quic/quic_channel.c
3437
return ch->net_error;
crypto/openssl/ssl/quic/quic_channel.c
344
tls_args.crypto_send_cb_arg = ch;
crypto/openssl/ssl/quic/quic_channel.c
3440
void ossl_quic_channel_restore_err_state(QUIC_CHANNEL *ch)
crypto/openssl/ssl/quic/quic_channel.c
3442
if (ch == NULL)
crypto/openssl/ssl/quic/quic_channel.c
3445
if (!ossl_quic_port_is_running(ch->port))
crypto/openssl/ssl/quic/quic_channel.c
3446
ossl_quic_port_restore_err_state(ch->port);
crypto/openssl/ssl/quic/quic_channel.c
3448
OSSL_ERR_STATE_restore(ch->err_state);
crypto/openssl/ssl/quic/quic_channel.c
3451
void ossl_quic_channel_raise_protocol_error_loc(QUIC_CHANNEL *ch,
crypto/openssl/ssl/quic/quic_channel.c
346
tls_args.crypto_recv_rcd_cb_arg = ch;
crypto/openssl/ssl/quic/quic_channel.c
3469
if (ch->protocol_error)
crypto/openssl/ssl/quic/quic_channel.c
348
tls_args.crypto_release_rcd_cb_arg = ch;
crypto/openssl/ssl/quic/quic_channel.c
350
tls_args.yield_secret_cb_arg = ch;
crypto/openssl/ssl/quic/quic_channel.c
3513
ch_save_err_state(ch);
crypto/openssl/ssl/quic/quic_channel.c
352
tls_args.got_transport_params_cb_arg = ch;
crypto/openssl/ssl/quic/quic_channel.c
3520
ch->protocol_error = 1;
crypto/openssl/ssl/quic/quic_channel.c
3521
ch_start_terminating(ch, &tcause, 0);
crypto/openssl/ssl/quic/quic_channel.c
3528
static void ch_on_terminating_timeout(QUIC_CHANNEL *ch)
crypto/openssl/ssl/quic/quic_channel.c
3530
ch_record_state_transition(ch, QUIC_CHANNEL_STATE_TERMINATED);
crypto/openssl/ssl/quic/quic_channel.c
3538
static OSSL_TIME ch_get_effective_idle_timeout_duration(QUIC_CHANNEL *ch)
crypto/openssl/ssl/quic/quic_channel.c
354
tls_args.handshake_complete_cb_arg = ch;
crypto/openssl/ssl/quic/quic_channel.c
3542
if (ch->max_idle_timeout == 0)
crypto/openssl/ssl/quic/quic_channel.c
3553
pto = ossl_ackm_get_pto_duration(ch->ackm);
crypto/openssl/ssl/quic/quic_channel.c
3554
return ossl_time_max(ossl_ms2time(ch->max_idle_timeout),
crypto/openssl/ssl/quic/quic_channel.c
356
tls_args.alert_cb_arg = ch;
crypto/openssl/ssl/quic/quic_channel.c
3562
static void ch_update_idle(QUIC_CHANNEL *ch)
crypto/openssl/ssl/quic/quic_channel.c
3564
ch->idle_deadline = ossl_time_add(get_time(ch),
crypto/openssl/ssl/quic/quic_channel.c
3565
ch_get_effective_idle_timeout_duration(ch));
crypto/openssl/ssl/quic/quic_channel.c
357
tls_args.is_server = ch->is_server;
crypto/openssl/ssl/quic/quic_channel.c
3572
static void ch_update_ping_deadline(QUIC_CHANNEL *ch)
crypto/openssl/ssl/quic/quic_channel.c
3576
idle_duration = ch_get_effective_idle_timeout_duration(ch);
crypto/openssl/ssl/quic/quic_channel.c
3578
ch->ping_deadline = ossl_time_infinite();
crypto/openssl/ssl/quic/quic_channel.c
3590
ch->ping_deadline = ossl_time_add(get_time(ch), max_span);
crypto/openssl/ssl/quic/quic_channel.c
3594
static void ch_on_idle_timeout(QUIC_CHANNEL *ch)
crypto/openssl/ssl/quic/quic_channel.c
360
if ((ch->qtls = ossl_quic_tls_new(&tls_args)) == NULL)
crypto/openssl/ssl/quic/quic_channel.c
3601
ch->terminate_cause.app = 0;
crypto/openssl/ssl/quic/quic_channel.c
3602
ch->terminate_cause.error_code = OSSL_QUIC_LOCAL_ERR_IDLE_TIMEOUT;
crypto/openssl/ssl/quic/quic_channel.c
3603
ch->terminate_cause.frame_type = 0;
crypto/openssl/ssl/quic/quic_channel.c
3605
ch_record_state_transition(ch, QUIC_CHANNEL_STATE_TERMINATED);
crypto/openssl/ssl/quic/quic_channel.c
3624
static int ch_on_new_conn_common(QUIC_CHANNEL *ch, const BIO_ADDR *peer,
crypto/openssl/ssl/quic/quic_channel.c
363
ch->tx_max_ack_delay = DEFAULT_MAX_ACK_DELAY;
crypto/openssl/ssl/quic/quic_channel.c
3630
if (!BIO_ADDR_copy(&ch->cur_peer_addr, peer))
crypto/openssl/ssl/quic/quic_channel.c
3633
ch->init_dcid = *peer_dcid;
crypto/openssl/ssl/quic/quic_channel.c
3634
ch->cur_remote_dcid = *peer_scid;
crypto/openssl/ssl/quic/quic_channel.c
3635
ch->odcid.id_len = 0;
crypto/openssl/ssl/quic/quic_channel.c
3638
ch->odcid = *peer_odcid;
crypto/openssl/ssl/quic/quic_channel.c
364
ch->rx_max_ack_delay = QUIC_DEFAULT_MAX_ACK_DELAY;
crypto/openssl/ssl/quic/quic_channel.c
3641
if (!ossl_quic_tx_packetiser_set_peer(ch->txp, &ch->cur_peer_addr))
crypto/openssl/ssl/quic/quic_channel.c
3645
if (!ossl_quic_tx_packetiser_set_cur_dcid(ch->txp, &ch->cur_remote_dcid))
crypto/openssl/ssl/quic/quic_channel.c
3648
if (!ossl_quic_tx_packetiser_set_cur_scid(ch->txp, &ch->cur_local_cid))
crypto/openssl/ssl/quic/quic_channel.c
365
ch->rx_ack_delay_exp = QUIC_DEFAULT_ACK_DELAY_EXP;
crypto/openssl/ssl/quic/quic_channel.c
3652
ossl_qtx_set_qlog_cb(ch->qtx, ch_get_qlog_cb, ch);
crypto/openssl/ssl/quic/quic_channel.c
3653
ossl_quic_tx_packetiser_set_qlog_cb(ch->txp, ch_get_qlog_cb, ch);
crypto/openssl/ssl/quic/quic_channel.c
3659
if (!ossl_quic_provide_initial_secret(ch->port->engine->libctx,
crypto/openssl/ssl/quic/quic_channel.c
366
ch->rx_active_conn_id_limit = QUIC_MIN_ACTIVE_CONN_ID_LIMIT;
crypto/openssl/ssl/quic/quic_channel.c
3660
ch->port->engine->propq,
crypto/openssl/ssl/quic/quic_channel.c
3661
&ch->init_dcid,
crypto/openssl/ssl/quic/quic_channel.c
3663
NULL, ch->qtx))
crypto/openssl/ssl/quic/quic_channel.c
3667
if (!ossl_quic_lcidm_enrol_odcid(ch->lcidm, ch, peer_odcid == NULL ? &ch->init_dcid : peer_odcid))
crypto/openssl/ssl/quic/quic_channel.c
367
ch->tx_enc_level = QUIC_ENC_LEVEL_INITIAL;
crypto/openssl/ssl/quic/quic_channel.c
3671
ch_record_state_transition(ch, QUIC_CHANNEL_STATE_ACTIVE);
crypto/openssl/ssl/quic/quic_channel.c
3672
ch->doing_proactive_ver_neg = 0; /* not currently supported */
crypto/openssl/ssl/quic/quic_channel.c
3677
int ossl_quic_channel_on_new_conn(QUIC_CHANNEL *ch, const BIO_ADDR *peer,
crypto/openssl/ssl/quic/quic_channel.c
368
ch->rx_enc_level = QUIC_ENC_LEVEL_INITIAL;
crypto/openssl/ssl/quic/quic_channel.c
3681
if (!ossl_assert(ch->state == QUIC_CHANNEL_STATE_IDLE && ch->is_server))
crypto/openssl/ssl/quic/quic_channel.c
3685
if (!ossl_quic_lcidm_generate_initial(ch->lcidm, ch, &ch->cur_local_cid))
crypto/openssl/ssl/quic/quic_channel.c
3688
return ch_on_new_conn_common(ch, peer, peer_scid, peer_dcid, NULL);
crypto/openssl/ssl/quic/quic_channel.c
369
ch->txku_threshold_override = UINT64_MAX;
crypto/openssl/ssl/quic/quic_channel.c
371
ch->max_idle_timeout_local_req = QUIC_DEFAULT_IDLE_TIMEOUT;
crypto/openssl/ssl/quic/quic_channel.c
3714
int ossl_quic_bind_channel(QUIC_CHANNEL *ch, const BIO_ADDR *peer,
crypto/openssl/ssl/quic/quic_channel.c
372
ch->max_idle_timeout_remote_req = 0;
crypto/openssl/ssl/quic/quic_channel.c
3722
if (!ossl_assert(ch->state == QUIC_CHANNEL_STATE_IDLE && ch->is_server))
crypto/openssl/ssl/quic/quic_channel.c
3725
ch->cur_local_cid = *peer_dcid;
crypto/openssl/ssl/quic/quic_channel.c
3726
if (!ossl_quic_lcidm_bind_channel(ch->lcidm, ch, peer_dcid))
crypto/openssl/ssl/quic/quic_channel.c
373
ch->max_idle_timeout = ch->max_idle_timeout_local_req;
crypto/openssl/ssl/quic/quic_channel.c
3733
return ch_on_new_conn_common(ch, peer, peer_scid, peer_dcid, peer_odcid);
crypto/openssl/ssl/quic/quic_channel.c
3736
SSL *ossl_quic_channel_get0_ssl(QUIC_CHANNEL *ch)
crypto/openssl/ssl/quic/quic_channel.c
3738
return ch->tls;
crypto/openssl/ssl/quic/quic_channel.c
3741
static int ch_init_new_stream(QUIC_CHANNEL *ch, QUIC_STREAM *qs,
crypto/openssl/ssl/quic/quic_channel.c
3746
int local_init = (ch->is_server == server_init);
crypto/openssl/ssl/quic/quic_channel.c
375
ossl_ackm_set_tx_max_ack_delay(ch->ackm, ossl_ms2time(ch->tx_max_ack_delay));
crypto/openssl/ssl/quic/quic_channel.c
3758
if (!ossl_quic_txfc_init(&qs->txfc, &ch->conn_txfc))
crypto/openssl/ssl/quic/quic_channel.c
376
ossl_ackm_set_rx_max_ack_delay(ch->ackm, ossl_ms2time(ch->rx_max_ack_delay));
crypto/openssl/ssl/quic/quic_channel.c
3761
if (ch->got_remote_transport_params) {
crypto/openssl/ssl/quic/quic_channel.c
3771
cwm = ch->rx_init_max_stream_data_uni;
crypto/openssl/ssl/quic/quic_channel.c
3773
cwm = ch->rx_init_max_stream_data_bidi_local;
crypto/openssl/ssl/quic/quic_channel.c
3775
cwm = ch->rx_init_max_stream_data_bidi_remote;
crypto/openssl/ssl/quic/quic_channel.c
378
ch_update_idle(ch);
crypto/openssl/ssl/quic/quic_channel.c
3785
rxfc_wnd = ch->tx_init_max_stream_data_uni;
crypto/openssl/ssl/quic/quic_channel.c
3787
rxfc_wnd = ch->tx_init_max_stream_data_bidi_local;
crypto/openssl/ssl/quic/quic_channel.c
3789
rxfc_wnd = ch->tx_init_max_stream_data_bidi_remote;
crypto/openssl/ssl/quic/quic_channel.c
379
ossl_list_ch_insert_tail(&ch->port->channel_list, ch);
crypto/openssl/ssl/quic/quic_channel.c
3791
if (!ossl_quic_rxfc_init(&qs->rxfc, &ch->conn_rxfc,
crypto/openssl/ssl/quic/quic_channel.c
3794
get_time, ch))
crypto/openssl/ssl/quic/quic_channel.c
380
ch->on_port_list = 1;
crypto/openssl/ssl/quic/quic_channel.c
3807
static uint64_t *ch_get_local_stream_next_ordinal_ptr(QUIC_CHANNEL *ch,
crypto/openssl/ssl/quic/quic_channel.c
3810
return is_uni ? &ch->next_local_stream_ordinal_uni
crypto/openssl/ssl/quic/quic_channel.c
3811
: &ch->next_local_stream_ordinal_bidi;
crypto/openssl/ssl/quic/quic_channel.c
3814
static const uint64_t *ch_get_local_stream_max_ptr(const QUIC_CHANNEL *ch,
crypto/openssl/ssl/quic/quic_channel.c
3817
return is_uni ? &ch->max_local_streams_uni
crypto/openssl/ssl/quic/quic_channel.c
3818
: &ch->max_local_streams_bidi;
crypto/openssl/ssl/quic/quic_channel.c
3821
static const QUIC_RXFC *ch_get_remote_stream_count_rxfc(const QUIC_CHANNEL *ch,
crypto/openssl/ssl/quic/quic_channel.c
3824
return is_uni ? &ch->max_streams_uni_rxfc
crypto/openssl/ssl/quic/quic_channel.c
3825
: &ch->max_streams_bidi_rxfc;
crypto/openssl/ssl/quic/quic_channel.c
3828
int ossl_quic_channel_is_new_local_stream_admissible(QUIC_CHANNEL *ch,
crypto/openssl/ssl/quic/quic_channel.c
3831
const uint64_t *p_next_ordinal = ch_get_local_stream_next_ordinal_ptr(ch, is_uni);
crypto/openssl/ssl/quic/quic_channel.c
3833
return ossl_quic_stream_map_is_local_allowed_by_stream_limit(&ch->qsm,
crypto/openssl/ssl/quic/quic_channel.c
3838
uint64_t ossl_quic_channel_get_local_stream_count_avail(const QUIC_CHANNEL *ch,
crypto/openssl/ssl/quic/quic_channel.c
384
ch_cleanup(ch);
crypto/openssl/ssl/quic/quic_channel.c
3843
p_next_ordinal = ch_get_local_stream_next_ordinal_ptr((QUIC_CHANNEL *)ch,
crypto/openssl/ssl/quic/quic_channel.c
3845
p_max = ch_get_local_stream_max_ptr(ch, is_uni);
crypto/openssl/ssl/quic/quic_channel.c
3850
uint64_t ossl_quic_channel_get_remote_stream_count_avail(const QUIC_CHANNEL *ch,
crypto/openssl/ssl/quic/quic_channel.c
3853
return ossl_quic_rxfc_get_credit(ch_get_remote_stream_count_rxfc(ch, is_uni));
crypto/openssl/ssl/quic/quic_channel.c
3856
QUIC_STREAM *ossl_quic_channel_new_stream_local(QUIC_CHANNEL *ch, int is_uni)
crypto/openssl/ssl/quic/quic_channel.c
3863
type = ch->is_server ? QUIC_STREAM_INITIATOR_SERVER
crypto/openssl/ssl/quic/quic_channel.c
3866
p_next_ordinal = ch_get_local_stream_next_ordinal_ptr(ch, is_uni);
crypto/openssl/ssl/quic/quic_channel.c
3878
if ((qs = ossl_quic_stream_map_alloc(&ch->qsm, stream_id, type)) == NULL)
crypto/openssl/ssl/quic/quic_channel.c
388
static void ch_cleanup(QUIC_CHANNEL *ch)
crypto/openssl/ssl/quic/quic_channel.c
3882
if (!ch_init_new_stream(ch, qs, /*can_send=*/1, /*can_recv=*/!is_uni))
crypto/openssl/ssl/quic/quic_channel.c
3889
ossl_quic_stream_map_release(&ch->qsm, qs);
crypto/openssl/ssl/quic/quic_channel.c
3893
QUIC_STREAM *ossl_quic_channel_new_stream_remote(QUIC_CHANNEL *ch,
crypto/openssl/ssl/quic/quic_channel.c
3900
peer_role = ch->is_server
crypto/openssl/ssl/quic/quic_channel.c
3909
qs = ossl_quic_stream_map_alloc(&ch->qsm, stream_id,
crypto/openssl/ssl/quic/quic_channel.c
3914
if (!ch_init_new_stream(ch, qs, /*can_send=*/!is_uni, /*can_recv=*/1))
crypto/openssl/ssl/quic/quic_channel.c
3917
if (ch->incoming_stream_auto_reject)
crypto/openssl/ssl/quic/quic_channel.c
3918
ossl_quic_channel_reject_stream(ch, qs);
crypto/openssl/ssl/quic/quic_channel.c
392
if (ch->ackm != NULL)
crypto/openssl/ssl/quic/quic_channel.c
3920
ossl_quic_stream_map_push_accept_queue(&ch->qsm, qs);
crypto/openssl/ssl/quic/quic_channel.c
3925
ossl_quic_stream_map_release(&ch->qsm, qs);
crypto/openssl/ssl/quic/quic_channel.c
3929
void ossl_quic_channel_set_incoming_stream_auto_reject(QUIC_CHANNEL *ch,
crypto/openssl/ssl/quic/quic_channel.c
3933
ch->incoming_stream_auto_reject = (enable != 0);
crypto/openssl/ssl/quic/quic_channel.c
3934
ch->incoming_stream_auto_reject_aec = aec;
crypto/openssl/ssl/quic/quic_channel.c
3937
void ossl_quic_channel_reject_stream(QUIC_CHANNEL *ch, QUIC_STREAM *qs)
crypto/openssl/ssl/quic/quic_channel.c
3939
ossl_quic_stream_map_stop_sending_recv_part(&ch->qsm, qs,
crypto/openssl/ssl/quic/quic_channel.c
3940
ch->incoming_stream_auto_reject_aec);
crypto/openssl/ssl/quic/quic_channel.c
3942
ossl_quic_stream_map_reset_stream_send_part(&ch->qsm, qs,
crypto/openssl/ssl/quic/quic_channel.c
3943
ch->incoming_stream_auto_reject_aec);
crypto/openssl/ssl/quic/quic_channel.c
3946
ossl_quic_stream_map_update_state(&ch->qsm, qs);
crypto/openssl/ssl/quic/quic_channel.c
3950
int ossl_quic_channel_replace_local_cid(QUIC_CHANNEL *ch,
crypto/openssl/ssl/quic/quic_channel.c
3954
if (!ossl_quic_lcidm_debug_remove(ch->lcidm, &ch->cur_local_cid))
crypto/openssl/ssl/quic/quic_channel.c
3956
ch->cur_local_cid = *conn_id;
crypto/openssl/ssl/quic/quic_channel.c
3958
if (!ossl_quic_tx_packetiser_set_cur_scid(ch->txp, &ch->cur_local_cid))
crypto/openssl/ssl/quic/quic_channel.c
396
ossl_ackm_on_pkt_space_discarded(ch->ackm, pn_space);
crypto/openssl/ssl/quic/quic_channel.c
3961
if (!ossl_quic_lcidm_debug_add(ch->lcidm, ch, &ch->cur_local_cid,
crypto/openssl/ssl/quic/quic_channel.c
3967
void ossl_quic_channel_set_msg_callback(QUIC_CHANNEL *ch,
crypto/openssl/ssl/quic/quic_channel.c
3971
ch->msg_callback = msg_callback;
crypto/openssl/ssl/quic/quic_channel.c
3972
ch->msg_callback_ssl = msg_callback_ssl;
crypto/openssl/ssl/quic/quic_channel.c
3973
ossl_qtx_set_msg_callback(ch->qtx, msg_callback, msg_callback_ssl);
crypto/openssl/ssl/quic/quic_channel.c
3974
ossl_quic_tx_packetiser_set_msg_callback(ch->txp, msg_callback,
crypto/openssl/ssl/quic/quic_channel.c
398
ossl_quic_lcidm_cull(ch->lcidm, ch);
crypto/openssl/ssl/quic/quic_channel.c
3980
if (ch->is_tserver_ch == 0)
crypto/openssl/ssl/quic/quic_channel.c
3981
ossl_qrx_set_msg_callback(ch->qrx, msg_callback, msg_callback_ssl);
crypto/openssl/ssl/quic/quic_channel.c
3984
void ossl_quic_channel_set_msg_callback_arg(QUIC_CHANNEL *ch,
crypto/openssl/ssl/quic/quic_channel.c
3987
ch->msg_callback_arg = msg_callback_arg;
crypto/openssl/ssl/quic/quic_channel.c
3988
ossl_qtx_set_msg_callback_arg(ch->qtx, msg_callback_arg);
crypto/openssl/ssl/quic/quic_channel.c
3989
ossl_quic_tx_packetiser_set_msg_callback_arg(ch->txp, msg_callback_arg);
crypto/openssl/ssl/quic/quic_channel.c
399
ossl_quic_srtm_cull(ch->srtm, ch);
crypto/openssl/ssl/quic/quic_channel.c
3995
if (ch->is_tserver_ch == 0)
crypto/openssl/ssl/quic/quic_channel.c
3996
ossl_qrx_set_msg_callback_arg(ch->qrx, msg_callback_arg);
crypto/openssl/ssl/quic/quic_channel.c
3999
void ossl_quic_channel_set_txku_threshold_override(QUIC_CHANNEL *ch,
crypto/openssl/ssl/quic/quic_channel.c
400
ossl_quic_tx_packetiser_free(ch->txp);
crypto/openssl/ssl/quic/quic_channel.c
4002
ch->txku_threshold_override = tx_pkt_threshold;
crypto/openssl/ssl/quic/quic_channel.c
4005
uint64_t ossl_quic_channel_get_tx_key_epoch(QUIC_CHANNEL *ch)
crypto/openssl/ssl/quic/quic_channel.c
4007
return ossl_qtx_get_key_epoch(ch->qtx);
crypto/openssl/ssl/quic/quic_channel.c
401
ossl_quic_txpim_free(ch->txpim);
crypto/openssl/ssl/quic/quic_channel.c
4010
uint64_t ossl_quic_channel_get_rx_key_epoch(QUIC_CHANNEL *ch)
crypto/openssl/ssl/quic/quic_channel.c
4012
return ossl_qrx_get_key_epoch(ch->qrx);
crypto/openssl/ssl/quic/quic_channel.c
4015
int ossl_quic_channel_trigger_txku(QUIC_CHANNEL *ch)
crypto/openssl/ssl/quic/quic_channel.c
4017
if (!txku_allowed(ch))
crypto/openssl/ssl/quic/quic_channel.c
402
ossl_quic_cfq_free(ch->cfq);
crypto/openssl/ssl/quic/quic_channel.c
4020
ch->ku_locally_initiated = 1;
crypto/openssl/ssl/quic/quic_channel.c
4021
ch_trigger_txku(ch);
crypto/openssl/ssl/quic/quic_channel.c
4025
int ossl_quic_channel_ping(QUIC_CHANNEL *ch)
crypto/openssl/ssl/quic/quic_channel.c
4027
int pn_space = ossl_quic_enc_level_to_pn_space(ch->tx_enc_level);
crypto/openssl/ssl/quic/quic_channel.c
4029
ossl_quic_tx_packetiser_schedule_ack_eliciting(ch->txp, pn_space);
crypto/openssl/ssl/quic/quic_channel.c
403
ossl_qtx_free(ch->qtx);
crypto/openssl/ssl/quic/quic_channel.c
4034
uint16_t ossl_quic_channel_get_diag_num_rx_ack(QUIC_CHANNEL *ch)
crypto/openssl/ssl/quic/quic_channel.c
4036
return ch->diag_num_rx_ack;
crypto/openssl/ssl/quic/quic_channel.c
4039
void ossl_quic_channel_get_diag_local_cid(QUIC_CHANNEL *ch, QUIC_CONN_ID *cid)
crypto/openssl/ssl/quic/quic_channel.c
404
if (ch->cc_data != NULL)
crypto/openssl/ssl/quic/quic_channel.c
4041
*cid = ch->cur_local_cid;
crypto/openssl/ssl/quic/quic_channel.c
4044
int ossl_quic_channel_have_generated_transport_params(const QUIC_CHANNEL *ch)
crypto/openssl/ssl/quic/quic_channel.c
4046
return ch->got_local_transport_params;
crypto/openssl/ssl/quic/quic_channel.c
4049
void ossl_quic_channel_set_max_idle_timeout_request(QUIC_CHANNEL *ch, uint64_t ms)
crypto/openssl/ssl/quic/quic_channel.c
405
ch->cc_method->free(ch->cc_data);
crypto/openssl/ssl/quic/quic_channel.c
4051
ch->max_idle_timeout_local_req = ms;
crypto/openssl/ssl/quic/quic_channel.c
4053
uint64_t ossl_quic_channel_get_max_idle_timeout_request(const QUIC_CHANNEL *ch)
crypto/openssl/ssl/quic/quic_channel.c
4055
return ch->max_idle_timeout_local_req;
crypto/openssl/ssl/quic/quic_channel.c
4058
uint64_t ossl_quic_channel_get_max_idle_timeout_peer_request(const QUIC_CHANNEL *ch)
crypto/openssl/ssl/quic/quic_channel.c
406
if (ch->have_statm)
crypto/openssl/ssl/quic/quic_channel.c
4060
return ch->max_idle_timeout_remote_req;
crypto/openssl/ssl/quic/quic_channel.c
4063
uint64_t ossl_quic_channel_get_max_idle_timeout_actual(const QUIC_CHANNEL *ch)
crypto/openssl/ssl/quic/quic_channel.c
4065
return ch->max_idle_timeout;
crypto/openssl/ssl/quic/quic_channel.c
407
ossl_statm_destroy(&ch->statm);
crypto/openssl/ssl/quic/quic_channel.c
408
ossl_ackm_free(ch->ackm);
crypto/openssl/ssl/quic/quic_channel.c
410
if (ch->have_qsm)
crypto/openssl/ssl/quic/quic_channel.c
411
ossl_quic_stream_map_cleanup(&ch->qsm);
crypto/openssl/ssl/quic/quic_channel.c
414
ossl_quic_sstream_free(ch->crypto_send[pn_space]);
crypto/openssl/ssl/quic/quic_channel.c
415
ossl_quic_rstream_free(ch->crypto_recv[pn_space]);
crypto/openssl/ssl/quic/quic_channel.c
418
ossl_qrx_pkt_release(ch->qrx_pkt);
crypto/openssl/ssl/quic/quic_channel.c
419
ch->qrx_pkt = NULL;
crypto/openssl/ssl/quic/quic_channel.c
421
ossl_quic_tls_free(ch->qtls);
crypto/openssl/ssl/quic/quic_channel.c
422
ossl_qrx_free(ch->qrx);
crypto/openssl/ssl/quic/quic_channel.c
423
OPENSSL_free(ch->local_transport_params);
crypto/openssl/ssl/quic/quic_channel.c
424
OPENSSL_free((char *)ch->terminate_cause.reason);
crypto/openssl/ssl/quic/quic_channel.c
425
OSSL_ERR_STATE_free(ch->err_state);
crypto/openssl/ssl/quic/quic_channel.c
426
OPENSSL_free(ch->ack_range_scratch);
crypto/openssl/ssl/quic/quic_channel.c
427
OPENSSL_free(ch->pending_new_token);
crypto/openssl/ssl/quic/quic_channel.c
429
if (ch->on_port_list) {
crypto/openssl/ssl/quic/quic_channel.c
430
ossl_list_ch_remove(&ch->port->channel_list, ch);
crypto/openssl/ssl/quic/quic_channel.c
431
ch->on_port_list = 0;
crypto/openssl/ssl/quic/quic_channel.c
435
if (ch->qlog != NULL)
crypto/openssl/ssl/quic/quic_channel.c
436
ossl_qlog_flush(ch->qlog); /* best effort */
crypto/openssl/ssl/quic/quic_channel.c
438
OPENSSL_free(ch->qlog_title);
crypto/openssl/ssl/quic/quic_channel.c
439
ossl_qlog_free(ch->qlog);
crypto/openssl/ssl/quic/quic_channel.c
443
int ossl_quic_channel_init(QUIC_CHANNEL *ch)
crypto/openssl/ssl/quic/quic_channel.c
445
return ch_init(ch);
crypto/openssl/ssl/quic/quic_channel.c
46
DEFINE_LIST_OF_IMPL(ch, QUIC_CHANNEL);
crypto/openssl/ssl/quic/quic_channel.c
461
QUIC_CHANNEL *ch = NULL;
crypto/openssl/ssl/quic/quic_channel.c
463
if ((ch = OPENSSL_zalloc(sizeof(*ch))) == NULL)
crypto/openssl/ssl/quic/quic_channel.c
466
ch->port = args->port;
crypto/openssl/ssl/quic/quic_channel.c
467
ch->is_server = args->is_server;
crypto/openssl/ssl/quic/quic_channel.c
468
ch->tls = args->tls;
crypto/openssl/ssl/quic/quic_channel.c
469
ch->lcidm = args->lcidm;
crypto/openssl/ssl/quic/quic_channel.c
470
ch->srtm = args->srtm;
crypto/openssl/ssl/quic/quic_channel.c
471
ch->qrx = args->qrx;
crypto/openssl/ssl/quic/quic_channel.c
472
ch->is_tserver_ch = args->is_tserver_ch;
crypto/openssl/ssl/quic/quic_channel.c
474
ch->use_qlog = args->use_qlog;
crypto/openssl/ssl/quic/quic_channel.c
476
if (ch->use_qlog && args->qlog_title != NULL) {
crypto/openssl/ssl/quic/quic_channel.c
477
if ((ch->qlog_title = OPENSSL_strdup(args->qlog_title)) == NULL) {
crypto/openssl/ssl/quic/quic_channel.c
478
OPENSSL_free(ch);
crypto/openssl/ssl/quic/quic_channel.c
48
static void ch_save_err_state(QUIC_CHANNEL *ch);
crypto/openssl/ssl/quic/quic_channel.c
484
return ch;
crypto/openssl/ssl/quic/quic_channel.c
487
void ossl_quic_channel_free(QUIC_CHANNEL *ch)
crypto/openssl/ssl/quic/quic_channel.c
489
if (ch == NULL)
crypto/openssl/ssl/quic/quic_channel.c
49
static int ch_rx(QUIC_CHANNEL *ch, int channel_only, int *notify_other_threads);
crypto/openssl/ssl/quic/quic_channel.c
492
ch_cleanup(ch);
crypto/openssl/ssl/quic/quic_channel.c
493
OPENSSL_free(ch);
crypto/openssl/ssl/quic/quic_channel.c
497
int ossl_quic_channel_set_mutator(QUIC_CHANNEL *ch,
crypto/openssl/ssl/quic/quic_channel.c
50
static int ch_tx(QUIC_CHANNEL *ch, int *notify_other_threads);
crypto/openssl/ssl/quic/quic_channel.c
502
if (ch->qtx == NULL)
crypto/openssl/ssl/quic/quic_channel.c
505
ossl_qtx_set_mutator(ch->qtx, mutatecb, finishmutatecb, mutatearg);
crypto/openssl/ssl/quic/quic_channel.c
509
int ossl_quic_channel_get_peer_addr(QUIC_CHANNEL *ch, BIO_ADDR *peer_addr)
crypto/openssl/ssl/quic/quic_channel.c
51
static int ch_tick_tls(QUIC_CHANNEL *ch, int channel_only, int *notify_other_threads);
crypto/openssl/ssl/quic/quic_channel.c
511
if (!ch->addressed_mode)
crypto/openssl/ssl/quic/quic_channel.c
514
return BIO_ADDR_copy(peer_addr, &ch->cur_peer_addr);
crypto/openssl/ssl/quic/quic_channel.c
517
int ossl_quic_channel_set_peer_addr(QUIC_CHANNEL *ch, const BIO_ADDR *peer_addr)
crypto/openssl/ssl/quic/quic_channel.c
519
if (ch->state != QUIC_CHANNEL_STATE_IDLE)
crypto/openssl/ssl/quic/quic_channel.c
52
static void ch_rx_handle_packet(QUIC_CHANNEL *ch, int channel_only);
crypto/openssl/ssl/quic/quic_channel.c
523
BIO_ADDR_clear(&ch->cur_peer_addr);
crypto/openssl/ssl/quic/quic_channel.c
524
ch->addressed_mode = 0;
crypto/openssl/ssl/quic/quic_channel.c
528
if (!BIO_ADDR_copy(&ch->cur_peer_addr, peer_addr)) {
crypto/openssl/ssl/quic/quic_channel.c
529
ch->addressed_mode = 0;
crypto/openssl/ssl/quic/quic_channel.c
53
static OSSL_TIME ch_determine_next_tick_deadline(QUIC_CHANNEL *ch);
crypto/openssl/ssl/quic/quic_channel.c
532
ch->addressed_mode = 1;
crypto/openssl/ssl/quic/quic_channel.c
537
QUIC_REACTOR *ossl_quic_channel_get_reactor(QUIC_CHANNEL *ch)
crypto/openssl/ssl/quic/quic_channel.c
539
return ossl_quic_port_get0_reactor(ch->port);
crypto/openssl/ssl/quic/quic_channel.c
54
static int ch_retry(QUIC_CHANNEL *ch,
crypto/openssl/ssl/quic/quic_channel.c
542
QUIC_STREAM_MAP *ossl_quic_channel_get_qsm(QUIC_CHANNEL *ch)
crypto/openssl/ssl/quic/quic_channel.c
544
return &ch->qsm;
crypto/openssl/ssl/quic/quic_channel.c
547
OSSL_STATM *ossl_quic_channel_get_statm(QUIC_CHANNEL *ch)
crypto/openssl/ssl/quic/quic_channel.c
549
return &ch->statm;
crypto/openssl/ssl/quic/quic_channel.c
552
SSL *ossl_quic_channel_get0_tls(QUIC_CHANNEL *ch)
crypto/openssl/ssl/quic/quic_channel.c
554
return ch->tls;
crypto/openssl/ssl/quic/quic_channel.c
562
int ossl_quic_channel_schedule_new_token(QUIC_CHANNEL *ch,
crypto/openssl/ssl/quic/quic_channel.c
59
static int ch_restart(QUIC_CHANNEL *ch);
crypto/openssl/ssl/quic/quic_channel.c
590
cfq_item = ossl_quic_cfq_add_frame(ch->cfq, 1,
crypto/openssl/ssl/quic/quic_channel.c
606
size_t ossl_quic_channel_get_short_header_conn_id_len(QUIC_CHANNEL *ch)
crypto/openssl/ssl/quic/quic_channel.c
608
return ossl_quic_port_get_rx_short_dcid_len(ch->port);
crypto/openssl/ssl/quic/quic_channel.c
61
static void ch_cleanup(QUIC_CHANNEL *ch);
crypto/openssl/ssl/quic/quic_channel.c
611
QUIC_STREAM *ossl_quic_channel_get_stream_by_id(QUIC_CHANNEL *ch,
crypto/openssl/ssl/quic/quic_channel.c
614
return ossl_quic_stream_map_get_by_id(&ch->qsm, stream_id);
crypto/openssl/ssl/quic/quic_channel.c
617
int ossl_quic_channel_is_active(const QUIC_CHANNEL *ch)
crypto/openssl/ssl/quic/quic_channel.c
619
return ch != NULL && ch->state == QUIC_CHANNEL_STATE_ACTIVE;
crypto/openssl/ssl/quic/quic_channel.c
62
static int ch_generate_transport_params(QUIC_CHANNEL *ch);
crypto/openssl/ssl/quic/quic_channel.c
622
int ossl_quic_channel_is_closing(const QUIC_CHANNEL *ch)
crypto/openssl/ssl/quic/quic_channel.c
624
return ch->state == QUIC_CHANNEL_STATE_TERMINATING_CLOSING;
crypto/openssl/ssl/quic/quic_channel.c
627
static int ossl_quic_channel_is_draining(const QUIC_CHANNEL *ch)
crypto/openssl/ssl/quic/quic_channel.c
629
return ch->state == QUIC_CHANNEL_STATE_TERMINATING_DRAINING;
crypto/openssl/ssl/quic/quic_channel.c
632
static int ossl_quic_channel_is_terminating(const QUIC_CHANNEL *ch)
crypto/openssl/ssl/quic/quic_channel.c
634
return ossl_quic_channel_is_closing(ch)
crypto/openssl/ssl/quic/quic_channel.c
635
|| ossl_quic_channel_is_draining(ch);
crypto/openssl/ssl/quic/quic_channel.c
638
int ossl_quic_channel_is_terminated(const QUIC_CHANNEL *ch)
crypto/openssl/ssl/quic/quic_channel.c
640
return ch->state == QUIC_CHANNEL_STATE_TERMINATED;
crypto/openssl/ssl/quic/quic_channel.c
643
int ossl_quic_channel_is_term_any(const QUIC_CHANNEL *ch)
crypto/openssl/ssl/quic/quic_channel.c
645
return ossl_quic_channel_is_terminating(ch)
crypto/openssl/ssl/quic/quic_channel.c
646
|| ossl_quic_channel_is_terminated(ch);
crypto/openssl/ssl/quic/quic_channel.c
650
ossl_quic_channel_get_terminate_cause(const QUIC_CHANNEL *ch)
crypto/openssl/ssl/quic/quic_channel.c
652
return ossl_quic_channel_is_term_any(ch) ? &ch->terminate_cause : NULL;
crypto/openssl/ssl/quic/quic_channel.c
655
int ossl_quic_channel_is_handshake_complete(const QUIC_CHANNEL *ch)
crypto/openssl/ssl/quic/quic_channel.c
657
return ch->handshake_complete;
crypto/openssl/ssl/quic/quic_channel.c
660
int ossl_quic_channel_is_handshake_confirmed(const QUIC_CHANNEL *ch)
crypto/openssl/ssl/quic/quic_channel.c
662
return ch->handshake_confirmed;
crypto/openssl/ssl/quic/quic_channel.c
665
QUIC_DEMUX *ossl_quic_channel_get0_demux(QUIC_CHANNEL *ch)
crypto/openssl/ssl/quic/quic_channel.c
667
return ch->port->demux;
crypto/openssl/ssl/quic/quic_channel.c
670
QUIC_PORT *ossl_quic_channel_get0_port(QUIC_CHANNEL *ch)
crypto/openssl/ssl/quic/quic_channel.c
672
return ch->port;
crypto/openssl/ssl/quic/quic_channel.c
675
QUIC_ENGINE *ossl_quic_channel_get0_engine(QUIC_CHANNEL *ch)
crypto/openssl/ssl/quic/quic_channel.c
677
return ossl_quic_port_get0_engine(ch->port);
crypto/openssl/ssl/quic/quic_channel.c
680
CRYPTO_MUTEX *ossl_quic_channel_get_mutex(QUIC_CHANNEL *ch)
crypto/openssl/ssl/quic/quic_channel.c
682
return ossl_quic_port_get0_mutex(ch->port);
crypto/openssl/ssl/quic/quic_channel.c
685
int ossl_quic_channel_has_pending(const QUIC_CHANNEL *ch)
crypto/openssl/ssl/quic/quic_channel.c
687
return ossl_quic_demux_has_pending(ch->port->demux)
crypto/openssl/ssl/quic/quic_channel.c
688
|| ossl_qrx_processed_read_pending(ch->qrx);
crypto/openssl/ssl/quic/quic_channel.c
699
QUIC_CHANNEL *ch = arg;
crypto/openssl/ssl/quic/quic_channel.c
701
return ossl_quic_port_get_time(ch->port);
crypto/openssl/ssl/quic/quic_channel.c
707
QUIC_CHANNEL *ch = arg;
crypto/openssl/ssl/quic/quic_channel.c
709
return uni ? ch->max_local_streams_uni : ch->max_local_streams_bidi;
crypto/openssl/ssl/quic/quic_channel.c
718
QUIC_CHANNEL *ch = arg;
crypto/openssl/ssl/quic/quic_channel.c
721
if (!ossl_ackm_is_rx_pn_processable(ch->ackm, pn, pn_space))
crypto/openssl/ssl/quic/quic_channel.c
732
static void ch_trigger_txku(QUIC_CHANNEL *ch)
crypto/openssl/ssl/quic/quic_channel.c
735
= ossl_quic_tx_packetiser_get_next_pn(ch->txp, QUIC_PN_SPACE_APP);
crypto/openssl/ssl/quic/quic_channel.c
738
|| !ossl_qtx_trigger_key_update(ch->qtx)) {
crypto/openssl/ssl/quic/quic_channel.c
739
ossl_quic_channel_raise_protocol_error(ch, OSSL_QUIC_ERR_INTERNAL_ERROR, 0,
crypto/openssl/ssl/quic/quic_channel.c
744
ch->txku_in_progress = 1;
crypto/openssl/ssl/quic/quic_channel.c
745
ch->txku_pn = next_pn;
crypto/openssl/ssl/quic/quic_channel.c
746
ch->rxku_expected = ch->ku_locally_initiated;
crypto/openssl/ssl/quic/quic_channel.c
750
static int txku_in_progress(QUIC_CHANNEL *ch)
crypto/openssl/ssl/quic/quic_channel.c
752
if (ch->txku_in_progress
crypto/openssl/ssl/quic/quic_channel.c
753
&& ossl_ackm_get_largest_acked(ch->ackm, QUIC_PN_SPACE_APP) >= ch->txku_pn) {
crypto/openssl/ssl/quic/quic_channel.c
754
OSSL_TIME pto = ossl_ackm_get_pto_duration(ch->ackm);
crypto/openssl/ssl/quic/quic_channel.c
765
ch->txku_in_progress = 0;
crypto/openssl/ssl/quic/quic_channel.c
766
ch->txku_cooldown_deadline = ossl_time_add(get_time(ch),
crypto/openssl/ssl/quic/quic_channel.c
770
return ch->txku_in_progress;
crypto/openssl/ssl/quic/quic_channel.c
774
static int txku_allowed(QUIC_CHANNEL *ch)
crypto/openssl/ssl/quic/quic_channel.c
776
return ch->tx_enc_level == QUIC_ENC_LEVEL_1RTT /* Sanity check. */
crypto/openssl/ssl/quic/quic_channel.c
778
&& ch->handshake_confirmed
crypto/openssl/ssl/quic/quic_channel.c
779
&& !txku_in_progress(ch);
crypto/openssl/ssl/quic/quic_channel.c
783
static int txku_recommendable(QUIC_CHANNEL *ch)
crypto/openssl/ssl/quic/quic_channel.c
785
if (!txku_allowed(ch))
crypto/openssl/ssl/quic/quic_channel.c
790
ossl_time_compare(get_time(ch), ch->txku_cooldown_deadline) >= 0
crypto/openssl/ssl/quic/quic_channel.c
792
&& !ch->rxku_in_progress
crypto/openssl/ssl/quic/quic_channel.c
793
&& !ch->rxku_pending_confirm;
crypto/openssl/ssl/quic/quic_channel.c
797
static int txku_desirable(QUIC_CHANNEL *ch)
crypto/openssl/ssl/quic/quic_channel.c
803
cur_pkt_count = ossl_qtx_get_cur_epoch_pkt_count(ch->qtx, enc_level);
crypto/openssl/ssl/quic/quic_channel.c
804
max_pkt_count = ossl_qtx_get_max_epoch_pkt_count(ch->qtx, enc_level);
crypto/openssl/ssl/quic/quic_channel.c
807
if (ch->txku_threshold_override != UINT64_MAX)
crypto/openssl/ssl/quic/quic_channel.c
808
thresh_pkt_count = ch->txku_threshold_override;
crypto/openssl/ssl/quic/quic_channel.c
814
static void ch_maybe_trigger_spontaneous_txku(QUIC_CHANNEL *ch)
crypto/openssl/ssl/quic/quic_channel.c
816
if (!txku_recommendable(ch) || !txku_desirable(ch))
crypto/openssl/ssl/quic/quic_channel.c
819
ch->ku_locally_initiated = 1;
crypto/openssl/ssl/quic/quic_channel.c
820
ch_trigger_txku(ch);
crypto/openssl/ssl/quic/quic_channel.c
824
static int rxku_allowed(QUIC_CHANNEL *ch)
crypto/openssl/ssl/quic/quic_channel.c
83
static int ch_retry(QUIC_CHANNEL *ch,
crypto/openssl/ssl/quic/quic_channel.c
841
return ch->handshake_confirmed && !ch->rxku_pending_confirm;
crypto/openssl/ssl/quic/quic_channel.c
857
QUIC_CHANNEL *ch = arg;
crypto/openssl/ssl/quic/quic_channel.c
865
assert(!ch->rxku_in_progress);
crypto/openssl/ssl/quic/quic_channel.c
867
if (!rxku_allowed(ch))
crypto/openssl/ssl/quic/quic_channel.c
871
else if (ch->ku_locally_initiated)
crypto/openssl/ssl/quic/quic_channel.c
88
static void ch_update_idle(QUIC_CHANNEL *ch);
crypto/openssl/ssl/quic/quic_channel.c
887
ossl_quic_channel_raise_protocol_error(ch, OSSL_QUIC_ERR_KEY_UPDATE_ERROR,
crypto/openssl/ssl/quic/quic_channel.c
89
static int ch_discard_el(QUIC_CHANNEL *ch,
crypto/openssl/ssl/quic/quic_channel.c
892
pto = ossl_ackm_get_pto_duration(ch->ackm);
crypto/openssl/ssl/quic/quic_channel.c
894
ch->ku_locally_initiated = 0;
crypto/openssl/ssl/quic/quic_channel.c
895
ch->rxku_in_progress = 1;
crypto/openssl/ssl/quic/quic_channel.c
896
ch->rxku_pending_confirm = 1;
crypto/openssl/ssl/quic/quic_channel.c
897
ch->rxku_trigger_pn = pn;
crypto/openssl/ssl/quic/quic_channel.c
898
ch->rxku_update_end_deadline = ossl_time_add(get_time(ch), pto);
crypto/openssl/ssl/quic/quic_channel.c
899
ch->rxku_expected = 0;
crypto/openssl/ssl/quic/quic_channel.c
903
ch_trigger_txku(ch);
crypto/openssl/ssl/quic/quic_channel.c
91
static void ch_on_idle_timeout(QUIC_CHANNEL *ch);
crypto/openssl/ssl/quic/quic_channel.c
92
static void ch_update_idle(QUIC_CHANNEL *ch);
crypto/openssl/ssl/quic/quic_channel.c
920
ossl_quic_tx_packetiser_schedule_ack(ch->txp, QUIC_PN_SPACE_APP);
crypto/openssl/ssl/quic/quic_channel.c
925
static void ch_rxku_tick(QUIC_CHANNEL *ch)
crypto/openssl/ssl/quic/quic_channel.c
927
if (!ch->rxku_in_progress
crypto/openssl/ssl/quic/quic_channel.c
928
|| ossl_time_compare(get_time(ch), ch->rxku_update_end_deadline) < 0)
crypto/openssl/ssl/quic/quic_channel.c
93
static void ch_update_ping_deadline(QUIC_CHANNEL *ch);
crypto/openssl/ssl/quic/quic_channel.c
931
ch->rxku_update_end_deadline = ossl_time_infinite();
crypto/openssl/ssl/quic/quic_channel.c
932
ch->rxku_in_progress = 0;
crypto/openssl/ssl/quic/quic_channel.c
934
if (!ossl_qrx_key_update_timeout(ch->qrx, /*normal=*/1))
crypto/openssl/ssl/quic/quic_channel.c
935
ossl_quic_channel_raise_protocol_error(ch, OSSL_QUIC_ERR_INTERNAL_ERROR, 0,
crypto/openssl/ssl/quic/quic_channel.c
94
static void ch_on_terminating_timeout(QUIC_CHANNEL *ch);
crypto/openssl/ssl/quic/quic_channel.c
943
QUIC_CHANNEL *ch = arg;
crypto/openssl/ssl/quic/quic_channel.c
945
if (pn_space != QUIC_PN_SPACE_APP || !ch->rxku_pending_confirm
crypto/openssl/ssl/quic/quic_channel.c
946
|| !ossl_quic_frame_ack_contains_pn(ack, ch->rxku_trigger_pn))
crypto/openssl/ssl/quic/quic_channel.c
95
static void ch_start_terminating(QUIC_CHANNEL *ch,
crypto/openssl/ssl/quic/quic_channel.c
953
ch->rxku_pending_confirm_done = 1;
crypto/openssl/ssl/quic/quic_channel.c
964
QUIC_CHANNEL *ch = arg;
crypto/openssl/ssl/quic/quic_channel.c
965
uint32_t enc_level = ch->tx_enc_level;
crypto/openssl/ssl/quic/quic_channel.c
967
QUIC_SSTREAM *sstream = ch->crypto_send[pn_space];
crypto/openssl/ssl/quic/quic_channel.c
993
QUIC_CHANNEL *ch = arg;
crypto/openssl/ssl/quic/quic_channel_local.h
38
OSSL_LIST_MEMBER(ch, QUIC_CHANNEL);
crypto/openssl/ssl/quic/quic_impl.c
130
ossl_quic_channel_restore_err_state(ctx->qc->ch);
crypto/openssl/ssl/quic/quic_impl.c
1465
qsm = ossl_quic_channel_get_qsm(qc->ch);
crypto/openssl/ssl/quic/quic_impl.c
1475
QUIC_STREAM_MAP *qsm = ossl_quic_channel_get_qsm(qc->ch);
crypto/openssl/ssl/quic/quic_impl.c
1486
return ossl_quic_channel_is_terminated(qc->ch);
crypto/openssl/ssl/quic/quic_impl.c
1494
return ossl_quic_channel_is_term_any(qc->ch)
crypto/openssl/ssl/quic/quic_impl.c
1501
return ossl_quic_channel_is_term_any(qc->ch);
crypto/openssl/ssl/quic/quic_impl.c
1525
if (ossl_quic_channel_is_terminated(ctx.qc->ch)) {
crypto/openssl/ssl/quic/quic_impl.c
1553
if (wait_peer && !ossl_quic_channel_is_term_any(ctx.qc->ch)) {
crypto/openssl/ssl/quic/quic_impl.c
1564
if (!ossl_quic_channel_is_term_any(ctx.qc->ch)) {
crypto/openssl/ssl/quic/quic_impl.c
1582
ossl_quic_channel_local_close(ctx.qc->ch,
crypto/openssl/ssl/quic/quic_impl.c
1588
if (ossl_quic_channel_is_terminated(ctx.qc->ch)) {
crypto/openssl/ssl/quic/quic_impl.c
1605
ret = ossl_quic_channel_is_terminated(ctx.qc->ch);
crypto/openssl/ssl/quic/quic_impl.c
1660
ossl_quic_channel_set_msg_callback_arg(ctx.qc->ch, parg);
crypto/openssl/ssl/quic/quic_impl.c
1769
if (ossl_quic_channel_is_handshake_complete(args->qc->ch))
crypto/openssl/ssl/quic/quic_impl.c
1780
assert(qc->ch != NULL);
crypto/openssl/ssl/quic/quic_impl.c
1782
if (!ossl_quic_channel_set_peer_addr(qc->ch, &qc->init_peer_addr))
crypto/openssl/ssl/quic/quic_impl.c
1824
qc->ch = ossl_quic_port_create_outgoing(qc->port, qc->tls);
crypto/openssl/ssl/quic/quic_impl.c
1825
if (qc->ch == NULL) {
crypto/openssl/ssl/quic/quic_impl.c
1851
if (!ossl_quic_channel_start(qc->ch)) {
crypto/openssl/ssl/quic/quic_impl.c
1852
ossl_quic_channel_restore_err_state(qc->ch);
crypto/openssl/ssl/quic/quic_impl.c
1860
if (!ossl_quic_thread_assist_init_start(&qc->thread_assist, qc->ch)) {
crypto/openssl/ssl/quic/quic_impl.c
1880
if (ossl_quic_channel_is_handshake_complete(qc->ch))
crypto/openssl/ssl/quic/quic_impl.c
1919
ossl_quic_channel_set_peer_addr(qc->ch, &qc->init_peer_addr);
crypto/openssl/ssl/quic/quic_impl.c
1940
if (ossl_quic_channel_is_handshake_complete(qc->ch))
crypto/openssl/ssl/quic/quic_impl.c
1948
if (ossl_quic_channel_is_handshake_complete(qc->ch))
crypto/openssl/ssl/quic/quic_impl.c
1952
if (ossl_quic_channel_is_term_any(qc->ch)) {
crypto/openssl/ssl/quic/quic_impl.c
1990
assert(ossl_quic_channel_is_handshake_complete(qc->ch));
crypto/openssl/ssl/quic/quic_impl.c
2104
args->qs = ossl_quic_stream_map_get_by_id(ossl_quic_channel_get_qsm(args->qc->ch),
crypto/openssl/ssl/quic/quic_impl.c
2107
args->qs = ossl_quic_stream_map_get_by_id(ossl_quic_channel_get_qsm(args->qc->ch),
crypto/openssl/ssl/quic/quic_impl.c
2145
qs = ossl_quic_stream_map_get_by_id(ossl_quic_channel_get_qsm(qc->ch),
crypto/openssl/ssl/quic/quic_impl.c
2148
qs = ossl_quic_stream_map_get_by_id(ossl_quic_channel_get_qsm(qc->ch),
crypto/openssl/ssl/quic/quic_impl.c
2154
qs = ossl_quic_stream_map_get_by_id(ossl_quic_channel_get_qsm(qc->ch),
crypto/openssl/ssl/quic/quic_impl.c
2162
if (ossl_quic_channel_is_term_any(qc->ch)) {
crypto/openssl/ssl/quic/quic_impl.c
2189
ossl_statm_get_rtt_info(ossl_quic_channel_get_statm(qc->ch), &rtt_info);
crypto/openssl/ssl/quic/quic_impl.c
2190
ossl_quic_stream_map_remove_from_accept_queue(ossl_quic_channel_get_qsm(qc->ch),
crypto/openssl/ssl/quic/quic_impl.c
2256
if (ossl_quic_channel_is_new_local_stream_admissible(qc->ch, args->is_uni))
crypto/openssl/ssl/quic/quic_impl.c
2282
&& !ossl_quic_channel_is_new_local_stream_admissible(qc->ch, is_uni)) {
crypto/openssl/ssl/quic/quic_impl.c
2308
qs = ossl_quic_channel_new_stream_local(qc->ch, is_uni);
crypto/openssl/ssl/quic/quic_impl.c
2326
ossl_quic_stream_map_release(ossl_quic_channel_get_qsm(qc->ch), qs);
crypto/openssl/ssl/quic/quic_impl.c
2375
net_error = ossl_quic_channel_net_error(ctx.qc->ch);
crypto/openssl/ssl/quic/quic_impl.c
2454
ossl_quic_stream_map_update_state(ossl_quic_channel_get_qsm(xso->conn->ch),
crypto/openssl/ssl/quic/quic_impl.c
2467
ossl_quic_reactor_tick(ossl_quic_channel_get_reactor(xso->conn->ch), 0);
crypto/openssl/ssl/quic/quic_impl.c
2778
qsm = ossl_quic_channel_get_qsm(xso->conn->ch);
crypto/openssl/ssl/quic/quic_impl.c
2923
qsm = ossl_quic_channel_get_qsm(xso->conn->ch);
crypto/openssl/ssl/quic/quic_impl.c
2973
ossl_statm_get_rtt_info(ossl_quic_channel_get_statm(qc->ch), &rtt_info);
crypto/openssl/ssl/quic/quic_impl.c
2981
QUIC_STREAM_MAP *qsm = ossl_quic_channel_get_qsm(ctx->qc->ch);
crypto/openssl/ssl/quic/quic_impl.c
2987
ossl_quic_stream_map_update_state(ossl_quic_channel_get_qsm(qc->ch),
crypto/openssl/ssl/quic/quic_impl.c
31
static QUIC_CONNECTION *create_qc_from_incoming_conn(QUIC_LISTENER *ql, QUIC_CHANNEL *ch);
crypto/openssl/ssl/quic/quic_impl.c
3168
|| ossl_quic_channel_has_pending(ctx.qc->ch)
crypto/openssl/ssl/quic/quic_impl.c
3169
|| ossl_quic_channel_is_term_any(ctx.qc->ch);
crypto/openssl/ssl/quic/quic_impl.c
3535
ossl_quic_channel_set_incoming_stream_auto_reject(qc->ch,
crypto/openssl/ssl/quic/quic_impl.c
3586
value_out = ossl_quic_channel_get_max_idle_timeout_request(ctx->qc->ch);
crypto/openssl/ssl/quic/quic_impl.c
3596
if (ossl_quic_channel_have_generated_transport_params(ctx->qc->ch)) {
crypto/openssl/ssl/quic/quic_impl.c
3602
ossl_quic_channel_set_max_idle_timeout_request(ctx->qc->ch, value_in);
crypto/openssl/ssl/quic/quic_impl.c
3614
if (!ossl_quic_channel_is_handshake_complete(ctx->qc->ch)) {
crypto/openssl/ssl/quic/quic_impl.c
3621
? ossl_quic_channel_get_max_idle_timeout_actual(ctx->qc->ch)
crypto/openssl/ssl/quic/quic_impl.c
3622
: ossl_quic_channel_get_max_idle_timeout_peer_request(ctx->qc->ch);
crypto/openssl/ssl/quic/quic_impl.c
3656
? ossl_quic_channel_get_remote_stream_count_avail(ctx->qc->ch, is_uni)
crypto/openssl/ssl/quic/quic_impl.c
3657
: ossl_quic_channel_get_local_stream_count_avail(ctx->qc->ch, is_uni);
crypto/openssl/ssl/quic/quic_impl.c
3865
QUIC_STREAM_MAP *qsm = ossl_quic_channel_get_qsm(qc->ch);
crypto/openssl/ssl/quic/quic_impl.c
3902
qsm = ossl_quic_channel_get_qsm(ctx.qc->ch);
crypto/openssl/ssl/quic/quic_impl.c
3931
ossl_statm_get_rtt_info(ossl_quic_channel_get_statm(ctx.qc->ch), &rtt_info);
crypto/openssl/ssl/quic/quic_impl.c
3959
v = ossl_quic_stream_map_get_total_accept_queue_len(ossl_quic_channel_get_qsm(ctx.qc->ch));
crypto/openssl/ssl/quic/quic_impl.c
3982
qsm = ossl_quic_channel_get_qsm(ctx.qc->ch);
crypto/openssl/ssl/quic/quic_impl.c
4026
} else if (ossl_quic_channel_is_term_any(qc->ch)) {
crypto/openssl/ssl/quic/quic_impl.c
4185
tc = ossl_quic_channel_get_terminate_cause(ctx.qc->ch);
crypto/openssl/ssl/quic/quic_impl.c
4229
if (!ossl_quic_channel_trigger_txku(ctx.qc->ch)) {
crypto/openssl/ssl/quic/quic_impl.c
4270
static SSL *alloc_port_user_ssl(QUIC_CHANNEL *ch, void *arg)
crypto/openssl/ssl/quic/quic_impl.c
4273
QUIC_CONNECTION *qc = create_qc_from_incoming_conn(ql, ch);
crypto/openssl/ssl/quic/quic_impl.c
4506
qc->ch = ossl_quic_port_create_outgoing(qc->port, qc->tls);
crypto/openssl/ssl/quic/quic_impl.c
4507
if (qc->ch == NULL) {
crypto/openssl/ssl/quic/quic_impl.c
4512
ossl_quic_channel_set_msg_callback(qc->ch, ql->obj.ssl.ctx->msg_callback, &qc->obj.ssl);
crypto/openssl/ssl/quic/quic_impl.c
4513
ossl_quic_channel_set_msg_callback_arg(qc->ch, ql->obj.ssl.ctx->msg_callback_arg);
crypto/openssl/ssl/quic/quic_impl.c
4694
static QUIC_CONNECTION *create_qc_from_incoming_conn(QUIC_LISTENER *ql, QUIC_CHANNEL *ch)
crypto/openssl/ssl/quic/quic_impl.c
4710
ossl_quic_channel_get_peer_addr(ch, &qc->init_peer_addr); /* best effort */
crypto/openssl/ssl/quic/quic_impl.c
4714
qc->ch = ch;
crypto/openssl/ssl/quic/quic_impl.c
4718
qc->tls = ossl_quic_channel_get0_tls(ch);
crypto/openssl/ssl/quic/quic_impl.c
5070
ossl_quic_channel_set_msg_callback(ctx.qc->ch, (ossl_msg_cb)fp,
crypto/openssl/ssl/quic/quic_impl.c
5132
if (ossl_quic_channel_is_term_any(ctx.qc->ch)) {
crypto/openssl/ssl/quic/quic_impl.c
5134
if (!ossl_quic_channel_is_closing(ctx.qc->ch))
crypto/openssl/ssl/quic/quic_impl.c
5210
return ossl_quic_channel_is_term_any(qc->ch);
crypto/openssl/ssl/quic/quic_impl.c
5217
return ossl_quic_channel_is_terminated(qc->ch);
crypto/openssl/ssl/quic/quic_impl.c
522
if (qc->shutting_down || ossl_quic_channel_is_term_any(qc->ch))
crypto/openssl/ssl/quic/quic_impl.c
5224
return ossl_quic_stream_map_get_accept_queue_len(ossl_quic_channel_get_qsm(qc->ch),
crypto/openssl/ssl/quic/quic_impl.c
5234
&& ossl_quic_channel_get_local_stream_count_avail(qc->ch, is_uni) > 0;
crypto/openssl/ssl/quic/quic_impl.c
525
if (req_active && !ossl_quic_channel_is_active(qc->ch))
crypto/openssl/ssl/quic/quic_impl.c
5400
return ctx.qc->ch;
crypto/openssl/ssl/quic/quic_impl.c
640
ossl_quic_channel_set_msg_callback(qc->ch, ctx->msg_callback, &qc->obj.ssl);
crypto/openssl/ssl/quic/quic_impl.c
641
ossl_quic_channel_set_msg_callback_arg(qc->ch, ctx->msg_callback_arg);
crypto/openssl/ssl/quic/quic_impl.c
697
ossl_quic_channel_free(qc->ch);
crypto/openssl/ssl/quic/quic_impl.c
698
qc->ch = NULL;
crypto/openssl/ssl/quic/quic_impl.c
784
ossl_quic_stream_map_reset_stream_send_part(ossl_quic_channel_get_qsm(ctx.qc->ch),
crypto/openssl/ssl/quic/quic_impl.c
790
ossl_quic_stream_map_stop_sending_recv_part(ossl_quic_channel_get_qsm(ctx.qc->ch),
crypto/openssl/ssl/quic/quic_impl.c
795
ossl_quic_stream_map_update_state(ossl_quic_channel_get_qsm(ctx.qc->ch),
crypto/openssl/ssl/quic/quic_local.h
146
QUIC_CHANNEL *ch;
crypto/openssl/ssl/quic/quic_port.c
1428
static void generate_new_token(QUIC_CHANNEL *ch, BIO_ADDR *peer)
crypto/openssl/ssl/quic/quic_port.c
1438
if (!ch->is_server)
crypto/openssl/ssl/quic/quic_port.c
1452
if (!RAND_bytes_ex(ch->port->engine->libctx, rscid.id, 8, 0)) {
crypto/openssl/ssl/quic/quic_port.c
1459
if (!generate_token(peer, ch->init_dcid, rscid, &token, 0)
crypto/openssl/ssl/quic/quic_port.c
1461
|| !encrypt_validation_token(ch->port, buffer, token_buf_len, NULL,
crypto/openssl/ssl/quic/quic_port.c
1464
|| !encrypt_validation_token(ch->port, buffer, token_buf_len, ct_buf,
crypto/openssl/ssl/quic/quic_port.c
1472
ch->pending_new_token = ct_buf;
crypto/openssl/ssl/quic/quic_port.c
1473
ch->pending_new_token_len = ct_len;
crypto/openssl/ssl/quic/quic_port.c
1488
QUIC_CHANNEL *ch = NULL, *new_ch = NULL;
crypto/openssl/ssl/quic/quic_port.c
1506
(void **)&ch)) {
crypto/openssl/ssl/quic/quic_port.c
1507
assert(ch != NULL);
crypto/openssl/ssl/quic/quic_port.c
1508
ossl_quic_channel_inject(ch, e);
crypto/openssl/ssl/quic/quic_port.c
1726
QUIC_CHANNEL *ch;
crypto/openssl/ssl/quic/quic_port.c
1745
OSSL_LIST_FOREACH(ch, ch, &port->channel_list)
crypto/openssl/ssl/quic/quic_port.c
1746
if (ch != triggering_ch)
crypto/openssl/ssl/quic/quic_port.c
1747
ossl_quic_channel_raise_net_error(ch);
crypto/openssl/ssl/quic/quic_port.c
431
QUIC_CHANNEL *ch;
crypto/openssl/ssl/quic/quic_port.c
439
OSSL_LIST_FOREACH(ch, ch, &port->channel_list)
crypto/openssl/ssl/quic/quic_port.c
440
ossl_qtx_set_bio(ch->qtx, net_wbio);
crypto/openssl/ssl/quic/quic_port.c
457
static SSL *port_new_handshake_layer(QUIC_PORT *port, QUIC_CHANNEL *ch)
crypto/openssl/ssl/quic/quic_port.c
471
user_ssl = port->get_conn_user_ssl(ch, port->user_ssl_arg);
crypto/openssl/ssl/quic/quic_port.c
513
QUIC_CHANNEL *ch;
crypto/openssl/ssl/quic/quic_port.c
533
ch = ossl_quic_channel_alloc(&args);
crypto/openssl/ssl/quic/quic_port.c
534
if (ch == NULL)
crypto/openssl/ssl/quic/quic_port.c
540
ch->tls = (tls != NULL) ? tls : port_new_handshake_layer(port, ch);
crypto/openssl/ssl/quic/quic_port.c
542
if (ch->tls == NULL) {
crypto/openssl/ssl/quic/quic_port.c
543
OPENSSL_free(ch);
crypto/openssl/ssl/quic/quic_port.c
551
ch->use_qlog = 1;
crypto/openssl/ssl/quic/quic_port.c
552
if (ch->tls->ctx->qlog_title != NULL) {
crypto/openssl/ssl/quic/quic_port.c
553
if ((ch->qlog_title = OPENSSL_strdup(ch->tls->ctx->qlog_title)) == NULL) {
crypto/openssl/ssl/quic/quic_port.c
554
OPENSSL_free(ch);
crypto/openssl/ssl/quic/quic_port.c
563
if (!ossl_quic_channel_init(ch)) {
crypto/openssl/ssl/quic/quic_port.c
564
OPENSSL_free(ch);
crypto/openssl/ssl/quic/quic_port.c
568
ossl_qtx_set_bio(ch->qtx, port->net_wbio);
crypto/openssl/ssl/quic/quic_port.c
569
return ch;
crypto/openssl/ssl/quic/quic_port.c
580
QUIC_CHANNEL *ch;
crypto/openssl/ssl/quic/quic_port.c
588
ch = port_make_channel(port, tls, NULL, /* is_server= */ 1,
crypto/openssl/ssl/quic/quic_port.c
590
port->tserver_ch = ch;
crypto/openssl/ssl/quic/quic_port.c
592
return ch;
crypto/openssl/ssl/quic/quic_port.c
597
QUIC_CHANNEL *ch;
crypto/openssl/ssl/quic/quic_port.c
599
ch = ossl_list_incoming_ch_head(&port->incoming_channel_list);
crypto/openssl/ssl/quic/quic_port.c
600
if (ch == NULL)
crypto/openssl/ssl/quic/quic_port.c
603
ossl_list_incoming_ch_remove(&port->incoming_channel_list, ch);
crypto/openssl/ssl/quic/quic_port.c
604
return ch;
crypto/openssl/ssl/quic/quic_port.c
614
QUIC_CHANNEL *ch;
crypto/openssl/ssl/quic/quic_port.c
620
ch = ossl_quic_port_pop_incoming(port);
crypto/openssl/ssl/quic/quic_port.c
621
if (ch == NULL)
crypto/openssl/ssl/quic/quic_port.c
624
tls = ossl_quic_channel_get0_tls(ch);
crypto/openssl/ssl/quic/quic_port.c
639
ossl_quic_channel_free(ch);
crypto/openssl/ssl/quic/quic_port.c
664
QUIC_CHANNEL *ch;
crypto/openssl/ssl/quic/quic_port.c
677
OSSL_LIST_FOREACH(ch, ch, &port->channel_list)
crypto/openssl/ssl/quic/quic_port.c
681
ossl_quic_channel_subtick(ch, &subr, flags);
crypto/openssl/ssl/quic/quic_port.c
736
QUIC_CHANNEL *ch;
crypto/openssl/ssl/quic/quic_port.c
743
ch = port->tserver_ch;
crypto/openssl/ssl/quic/quic_port.c
745
ossl_quic_channel_bind_qrx(ch, qrx);
crypto/openssl/ssl/quic/quic_port.c
746
ossl_qrx_set_msg_callback(ch->qrx, ch->msg_callback,
crypto/openssl/ssl/quic/quic_port.c
747
ch->msg_callback_ssl);
crypto/openssl/ssl/quic/quic_port.c
748
ossl_qrx_set_msg_callback_arg(ch->qrx, ch->msg_callback_arg);
crypto/openssl/ssl/quic/quic_port.c
750
ch = port_make_channel(port, NULL, qrx, /* is_server= */ 1,
crypto/openssl/ssl/quic/quic_port.c
754
if (ch == NULL)
crypto/openssl/ssl/quic/quic_port.c
766
if (!ossl_quic_provide_initial_secret(ch->port->engine->libctx,
crypto/openssl/ssl/quic/quic_port.c
767
ch->port->engine->propq,
crypto/openssl/ssl/quic/quic_port.c
769
ch->qrx, NULL))
crypto/openssl/ssl/quic/quic_port.c
778
ossl_quic_tx_packetiser_set_validated(ch->txp);
crypto/openssl/ssl/quic/quic_port.c
779
if (!ossl_quic_bind_channel(ch, peer, scid, dcid, odcid)) {
crypto/openssl/ssl/quic/quic_port.c
780
ossl_quic_channel_free(ch);
crypto/openssl/ssl/quic/quic_port.c
788
if (!ossl_quic_channel_on_new_conn(ch, peer, scid, dcid)) {
crypto/openssl/ssl/quic/quic_port.c
789
ossl_quic_channel_free(ch);
crypto/openssl/ssl/quic/quic_port.c
794
ossl_list_incoming_ch_insert_tail(&port->incoming_channel_list, ch);
crypto/openssl/ssl/quic/quic_port.c
795
*new_ch = ch;
crypto/openssl/ssl/quic/quic_port.c
96
DEFINE_LIST_OF_IMPL(ch, QUIC_CHANNEL);
crypto/openssl/ssl/quic/quic_port_local.h
28
DECLARE_LIST_OF(ch, QUIC_CHANNEL);
crypto/openssl/ssl/quic/quic_port_local.h
54
SSL *(*get_conn_user_ssl)(QUIC_CHANNEL *ch, void *arg);
crypto/openssl/ssl/quic/quic_port_local.h
67
OSSL_LIST(ch)
crypto/openssl/ssl/quic/quic_rx_depack.c
1011
static int depack_do_frame_conn_close(PACKET *pkt, QUIC_CHANNEL *ch,
crypto/openssl/ssl/quic/quic_rx_depack.c
1017
ossl_quic_channel_raise_protocol_error(ch,
crypto/openssl/ssl/quic/quic_rx_depack.c
1024
ossl_quic_channel_on_remote_conn_close(ch, &frame_data);
crypto/openssl/ssl/quic/quic_rx_depack.c
1029
QUIC_CHANNEL *ch,
crypto/openssl/ssl/quic/quic_rx_depack.c
1034
ossl_quic_channel_raise_protocol_error(ch,
crypto/openssl/ssl/quic/quic_rx_depack.c
1041
ossl_quic_channel_on_handshake_confirmed(ch);
crypto/openssl/ssl/quic/quic_rx_depack.c
1047
static int depack_process_frames(QUIC_CHANNEL *ch, PACKET *pkt,
crypto/openssl/ssl/quic/quic_rx_depack.c
1060
ossl_quic_channel_raise_protocol_error(ch,
crypto/openssl/ssl/quic/quic_rx_depack.c
1073
if (ch->msg_callback != NULL)
crypto/openssl/ssl/quic/quic_rx_depack.c
1077
ossl_quic_channel_raise_protocol_error(ch,
crypto/openssl/ssl/quic/quic_rx_depack.c
1085
ossl_quic_channel_raise_protocol_error(ch,
crypto/openssl/ssl/quic/quic_rx_depack.c
1113
if (!depack_do_frame_ping(pkt, ch, enc_level, ackm_data))
crypto/openssl/ssl/quic/quic_rx_depack.c
1126
ossl_quic_channel_raise_protocol_error(ch,
crypto/openssl/ssl/quic/quic_rx_depack.c
1132
if (!depack_do_frame_ack(pkt, ch, packet_space, received,
crypto/openssl/ssl/quic/quic_rx_depack.c
1141
ossl_quic_channel_raise_protocol_error(ch,
crypto/openssl/ssl/quic/quic_rx_depack.c
1148
if (!depack_do_frame_reset_stream(pkt, ch, ackm_data))
crypto/openssl/ssl/quic/quic_rx_depack.c
1155
ossl_quic_channel_raise_protocol_error(ch,
crypto/openssl/ssl/quic/quic_rx_depack.c
1162
if (!depack_do_frame_stop_sending(pkt, ch, ackm_data))
crypto/openssl/ssl/quic/quic_rx_depack.c
1168
ossl_quic_channel_raise_protocol_error(ch,
crypto/openssl/ssl/quic/quic_rx_depack.c
1174
if (!depack_do_frame_crypto(pkt, ch, parent_pkt, ackm_data, &datalen))
crypto/openssl/ssl/quic/quic_rx_depack.c
118
ossl_quic_channel_raise_protocol_error(ch,
crypto/openssl/ssl/quic/quic_rx_depack.c
1180
ossl_quic_channel_raise_protocol_error(ch,
crypto/openssl/ssl/quic/quic_rx_depack.c
1191
if (ch->is_server) {
crypto/openssl/ssl/quic/quic_rx_depack.c
1192
ossl_quic_channel_raise_protocol_error(ch,
crypto/openssl/ssl/quic/quic_rx_depack.c
1199
if (!depack_do_frame_new_token(pkt, ch, ackm_data))
crypto/openssl/ssl/quic/quic_rx_depack.c
1214
ossl_quic_channel_raise_protocol_error(ch,
crypto/openssl/ssl/quic/quic_rx_depack.c
1220
if (!depack_do_frame_stream(pkt, ch, parent_pkt, ackm_data,
crypto/openssl/ssl/quic/quic_rx_depack.c
1229
ossl_quic_channel_raise_protocol_error(ch,
crypto/openssl/ssl/quic/quic_rx_depack.c
1235
if (!depack_do_frame_max_data(pkt, ch, ackm_data))
crypto/openssl/ssl/quic/quic_rx_depack.c
1242
ossl_quic_channel_raise_protocol_error(ch,
crypto/openssl/ssl/quic/quic_rx_depack.c
1248
if (!depack_do_frame_max_stream_data(pkt, ch, ackm_data))
crypto/openssl/ssl/quic/quic_rx_depack.c
1257
ossl_quic_channel_raise_protocol_error(ch,
crypto/openssl/ssl/quic/quic_rx_depack.c
1263
if (!depack_do_frame_max_streams(pkt, ch, ackm_data,
crypto/openssl/ssl/quic/quic_rx_depack.c
127
if (!ossl_ackm_on_rx_ack_frame(ch->ackm, &ack,
crypto/openssl/ssl/quic/quic_rx_depack.c
1272
ossl_quic_channel_raise_protocol_error(ch,
crypto/openssl/ssl/quic/quic_rx_depack.c
1278
if (!depack_do_frame_data_blocked(pkt, ch, ackm_data))
crypto/openssl/ssl/quic/quic_rx_depack.c
1285
ossl_quic_channel_raise_protocol_error(ch,
crypto/openssl/ssl/quic/quic_rx_depack.c
1291
if (!depack_do_frame_stream_data_blocked(pkt, ch, ackm_data))
crypto/openssl/ssl/quic/quic_rx_depack.c
1300
ossl_quic_channel_raise_protocol_error(ch,
crypto/openssl/ssl/quic/quic_rx_depack.c
1306
if (!depack_do_frame_streams_blocked(pkt, ch, ackm_data,
crypto/openssl/ssl/quic/quic_rx_depack.c
131
++ch->diag_num_rx_ack;
crypto/openssl/ssl/quic/quic_rx_depack.c
1315
ossl_quic_channel_raise_protocol_error(ch,
crypto/openssl/ssl/quic/quic_rx_depack.c
1321
if (!depack_do_frame_new_conn_id(pkt, ch, ackm_data))
crypto/openssl/ssl/quic/quic_rx_depack.c
1328
ossl_quic_channel_raise_protocol_error(ch,
crypto/openssl/ssl/quic/quic_rx_depack.c
1334
if (!depack_do_frame_retire_conn_id(pkt, ch, ackm_data))
crypto/openssl/ssl/quic/quic_rx_depack.c
1341
ossl_quic_channel_raise_protocol_error(ch,
crypto/openssl/ssl/quic/quic_rx_depack.c
1347
if (!depack_do_frame_path_challenge(pkt, ch, ackm_data))
crypto/openssl/ssl/quic/quic_rx_depack.c
135
ossl_quic_channel_raise_protocol_error(ch,
crypto/openssl/ssl/quic/quic_rx_depack.c
1354
ossl_quic_channel_raise_protocol_error(ch,
crypto/openssl/ssl/quic/quic_rx_depack.c
1360
if (!depack_do_frame_path_response(pkt, ch, ackm_data))
crypto/openssl/ssl/quic/quic_rx_depack.c
1368
ossl_quic_channel_raise_protocol_error(ch,
crypto/openssl/ssl/quic/quic_rx_depack.c
1377
if (!depack_do_frame_conn_close(pkt, ch, frame_type))
crypto/openssl/ssl/quic/quic_rx_depack.c
1384
ossl_quic_channel_raise_protocol_error(ch,
crypto/openssl/ssl/quic/quic_rx_depack.c
1390
if (!depack_do_frame_handshake_done(pkt, ch, ackm_data))
crypto/openssl/ssl/quic/quic_rx_depack.c
1396
ossl_quic_channel_raise_protocol_error(ch,
crypto/openssl/ssl/quic/quic_rx_depack.c
1403
if (ch->msg_callback != NULL) {
crypto/openssl/ssl/quic/quic_rx_depack.c
1416
ch->msg_callback(0, OSSL_QUIC1_VERSION, ctype, sof, framelen,
crypto/openssl/ssl/quic/quic_rx_depack.c
1417
ch->msg_callback_ssl, ch->msg_callback_arg);
crypto/openssl/ssl/quic/quic_rx_depack.c
1425
int ossl_quic_handle_frames(QUIC_CHANNEL *ch, OSSL_QRX_PKT *qpacket)
crypto/openssl/ssl/quic/quic_rx_depack.c
143
QUIC_CHANNEL *ch,
crypto/openssl/ssl/quic/quic_rx_depack.c
1432
if (ch == NULL)
crypto/openssl/ssl/quic/quic_rx_depack.c
1435
ch->did_crypto_frame = 0;
crypto/openssl/ssl/quic/quic_rx_depack.c
1464
ossl_quic_tx_packetiser_set_validated(ch->txp);
crypto/openssl/ssl/quic/quic_rx_depack.c
1466
ossl_quic_tx_packetiser_add_unvalidated_credit(ch->txp, dgram_len);
crypto/openssl/ssl/quic/quic_rx_depack.c
1470
|| !depack_process_frames(ch, &pkt, qpacket,
crypto/openssl/ssl/quic/quic_rx_depack.c
1476
ossl_ackm_on_rx_packet(ch->ackm, &ackm_data);
crypto/openssl/ssl/quic/quic_rx_depack.c
151
ossl_quic_channel_raise_protocol_error(ch,
crypto/openssl/ssl/quic/quic_rx_depack.c
158
if (!depack_do_implicit_stream_create(ch, frame_data.stream_id,
crypto/openssl/ssl/quic/quic_rx_depack.c
167
ossl_quic_channel_raise_protocol_error(ch,
crypto/openssl/ssl/quic/quic_rx_depack.c
187
ossl_quic_channel_raise_protocol_error(ch,
crypto/openssl/ssl/quic/quic_rx_depack.c
197
ossl_quic_channel_raise_protocol_error(ch,
crypto/openssl/ssl/quic/quic_rx_depack.c
210
ossl_quic_stream_map_notify_reset_recv_part(&ch->qsm, stream,
crypto/openssl/ssl/quic/quic_rx_depack.c
214
ossl_quic_stream_map_update_state(&ch->qsm, stream);
crypto/openssl/ssl/quic/quic_rx_depack.c
219
QUIC_CHANNEL *ch,
crypto/openssl/ssl/quic/quic_rx_depack.c
226
ossl_quic_channel_raise_protocol_error(ch,
crypto/openssl/ssl/quic/quic_rx_depack.c
233
if (!depack_do_implicit_stream_create(ch, frame_data.stream_id,
crypto/openssl/ssl/quic/quic_rx_depack.c
242
ossl_quic_channel_raise_protocol_error(ch,
crypto/openssl/ssl/quic/quic_rx_depack.c
258
ossl_quic_stream_map_reset_stream_send_part(&ch->qsm, stream,
crypto/openssl/ssl/quic/quic_rx_depack.c
263
static int depack_do_frame_crypto(PACKET *pkt, QUIC_CHANNEL *ch,
crypto/openssl/ssl/quic/quic_rx_depack.c
275
ossl_quic_channel_raise_protocol_error(ch,
crypto/openssl/ssl/quic/quic_rx_depack.c
285
rstream = ch->crypto_recv[ackm_data->pkt_space];
crypto/openssl/ssl/quic/quic_rx_depack.c
294
rxfc = &ch->crypto_rxfc[ackm_data->pkt_space];
crypto/openssl/ssl/quic/quic_rx_depack.c
298
ossl_quic_channel_raise_protocol_error(ch,
crypto/openssl/ssl/quic/quic_rx_depack.c
306
ossl_quic_channel_raise_protocol_error(ch, OSSL_QUIC_ERR_CRYPTO_BUFFER_EXCEEDED,
crypto/openssl/ssl/quic/quic_rx_depack.c
314
ossl_quic_channel_raise_protocol_error(ch,
crypto/openssl/ssl/quic/quic_rx_depack.c
32
static int depack_do_implicit_stream_create(QUIC_CHANNEL *ch,
crypto/openssl/ssl/quic/quic_rx_depack.c
321
ch->did_crypto_frame = 1;
crypto/openssl/ssl/quic/quic_rx_depack.c
327
static int depack_do_frame_new_token(PACKET *pkt, QUIC_CHANNEL *ch,
crypto/openssl/ssl/quic/quic_rx_depack.c
334
ossl_quic_channel_raise_protocol_error(ch,
crypto/openssl/ssl/quic/quic_rx_depack.c
347
ossl_quic_channel_raise_protocol_error(ch,
crypto/openssl/ssl/quic/quic_rx_depack.c
355
if (!ossl_quic_set_peer_token(ossl_quic_port_get_channel_ctx(ch->port),
crypto/openssl/ssl/quic/quic_rx_depack.c
356
&ch->cur_peer_addr, token, token_len))
crypto/openssl/ssl/quic/quic_rx_depack.c
367
static int depack_do_implicit_stream_create(QUIC_CHANNEL *ch,
crypto/openssl/ssl/quic/quic_rx_depack.c
378
stream = ossl_quic_stream_map_get_by_id(&ch->qsm, stream_id);
crypto/openssl/ssl/quic/quic_rx_depack.c
402
peer_role = ch->is_server
crypto/openssl/ssl/quic/quic_rx_depack.c
420
? &ch->next_remote_stream_ordinal_uni
crypto/openssl/ssl/quic/quic_rx_depack.c
421
: &ch->next_remote_stream_ordinal_bidi;
crypto/openssl/ssl/quic/quic_rx_depack.c
425
? &ch->max_streams_uni_rxfc
crypto/openssl/ssl/quic/quic_rx_depack.c
426
: &ch->max_streams_bidi_rxfc;
crypto/openssl/ssl/quic/quic_rx_depack.c
431
ossl_quic_channel_raise_protocol_error(ch,
crypto/openssl/ssl/quic/quic_rx_depack.c
439
ossl_quic_channel_raise_protocol_error(ch, OSSL_QUIC_ERR_STREAM_LIMIT_ERROR,
crypto/openssl/ssl/quic/quic_rx_depack.c
44
static int depack_do_frame_ping(PACKET *pkt, QUIC_CHANNEL *ch,
crypto/openssl/ssl/quic/quic_rx_depack.c
452
stream = ossl_quic_channel_new_stream_remote(ch, cur_stream_id);
crypto/openssl/ssl/quic/quic_rx_depack.c
454
ossl_quic_channel_raise_protocol_error(ch,
crypto/openssl/ssl/quic/quic_rx_depack.c
468
? &ch->next_local_stream_ordinal_uni
crypto/openssl/ssl/quic/quic_rx_depack.c
469
: &ch->next_local_stream_ordinal_bidi;
crypto/openssl/ssl/quic/quic_rx_depack.c
476
ossl_quic_channel_raise_protocol_error(ch,
crypto/openssl/ssl/quic/quic_rx_depack.c
496
static int depack_do_frame_stream(PACKET *pkt, QUIC_CHANNEL *ch,
crypto/openssl/ssl/quic/quic_rx_depack.c
50
ossl_quic_channel_raise_protocol_error(ch,
crypto/openssl/ssl/quic/quic_rx_depack.c
511
ossl_quic_channel_raise_protocol_error(ch,
crypto/openssl/ssl/quic/quic_rx_depack.c
518
if (!depack_do_implicit_stream_create(ch, frame_data.stream_id,
crypto/openssl/ssl/quic/quic_rx_depack.c
530
ossl_quic_channel_raise_protocol_error(ch,
crypto/openssl/ssl/quic/quic_rx_depack.c
542
ossl_quic_channel_raise_protocol_error(ch,
crypto/openssl/ssl/quic/quic_rx_depack.c
552
ossl_quic_channel_raise_protocol_error(ch,
crypto/openssl/ssl/quic/quic_rx_depack.c
57
ossl_quic_tx_packetiser_schedule_ack_eliciting(ch->txp, enc_level);
crypto/openssl/ssl/quic/quic_rx_depack.c
585
ossl_quic_stream_map_notify_size_known_recv_part(&ch->qsm, stream,
crypto/openssl/ssl/quic/quic_rx_depack.c
61
static int depack_do_frame_ack(PACKET *pkt, QUIC_CHANNEL *ch,
crypto/openssl/ssl/quic/quic_rx_depack.c
614
ossl_quic_channel_raise_protocol_error(ch,
crypto/openssl/ssl/quic/quic_rx_depack.c
629
ossl_quic_channel_raise_protocol_error(ch,
crypto/openssl/ssl/quic/quic_rx_depack.c
637
ossl_quic_stream_map_notify_totally_received(&ch->qsm, stream);
crypto/openssl/ssl/quic/quic_rx_depack.c
646
QUIC_CHANNEL *ch = arg;
crypto/openssl/ssl/quic/quic_rx_depack.c
648
ossl_quic_stream_map_update_state(&ch->qsm, s);
crypto/openssl/ssl/quic/quic_rx_depack.c
653
QUIC_CHANNEL *ch = arg;
crypto/openssl/ssl/quic/quic_rx_depack.c
658
ossl_quic_stream_map_update_state(&ch->qsm, s);
crypto/openssl/ssl/quic/quic_rx_depack.c
663
QUIC_CHANNEL *ch = arg;
crypto/openssl/ssl/quic/quic_rx_depack.c
668
ossl_quic_stream_map_update_state(&ch->qsm, s);
crypto/openssl/ssl/quic/quic_rx_depack.c
671
static int depack_do_frame_max_data(PACKET *pkt, QUIC_CHANNEL *ch,
crypto/openssl/ssl/quic/quic_rx_depack.c
677
ossl_quic_channel_raise_protocol_error(ch,
crypto/openssl/ssl/quic/quic_rx_depack.c
684
ossl_quic_txfc_bump_cwm(&ch->conn_txfc, max_data);
crypto/openssl/ssl/quic/quic_rx_depack.c
685
ossl_quic_stream_map_visit(&ch->qsm, update_streams, ch);
crypto/openssl/ssl/quic/quic_rx_depack.c
69
uint32_t ack_delay_exp = ch->rx_ack_delay_exp;
crypto/openssl/ssl/quic/quic_rx_depack.c
690
QUIC_CHANNEL *ch,
crypto/openssl/ssl/quic/quic_rx_depack.c
699
ossl_quic_channel_raise_protocol_error(ch,
crypto/openssl/ssl/quic/quic_rx_depack.c
706
if (!depack_do_implicit_stream_create(ch, stream_id,
crypto/openssl/ssl/quic/quic_rx_depack.c
715
ossl_quic_channel_raise_protocol_error(ch,
crypto/openssl/ssl/quic/quic_rx_depack.c
724
ossl_quic_stream_map_update_state(&ch->qsm, stream);
crypto/openssl/ssl/quic/quic_rx_depack.c
729
QUIC_CHANNEL *ch,
crypto/openssl/ssl/quic/quic_rx_depack.c
736
ossl_quic_channel_raise_protocol_error(ch,
crypto/openssl/ssl/quic/quic_rx_depack.c
744
ossl_quic_channel_raise_protocol_error(ch,
crypto/openssl/ssl/quic/quic_rx_depack.c
753
if (max_streams > ch->max_local_streams_bidi)
crypto/openssl/ssl/quic/quic_rx_depack.c
754
ch->max_local_streams_bidi = max_streams;
crypto/openssl/ssl/quic/quic_rx_depack.c
757
ossl_quic_stream_map_visit(&ch->qsm, update_streams_bidi, ch);
crypto/openssl/ssl/quic/quic_rx_depack.c
76
if (ch->num_ack_range_scratch < (size_t)total_ranges) {
crypto/openssl/ssl/quic/quic_rx_depack.c
760
if (max_streams > ch->max_local_streams_uni)
crypto/openssl/ssl/quic/quic_rx_depack.c
761
ch->max_local_streams_uni = max_streams;
crypto/openssl/ssl/quic/quic_rx_depack.c
764
ossl_quic_stream_map_visit(&ch->qsm, update_streams_uni, ch);
crypto/openssl/ssl/quic/quic_rx_depack.c
767
ossl_quic_channel_raise_protocol_error(ch,
crypto/openssl/ssl/quic/quic_rx_depack.c
77
if ((p = OPENSSL_realloc(ch->ack_range_scratch,
crypto/openssl/ssl/quic/quic_rx_depack.c
778
QUIC_CHANNEL *ch,
crypto/openssl/ssl/quic/quic_rx_depack.c
784
ossl_quic_channel_raise_protocol_error(ch,
crypto/openssl/ssl/quic/quic_rx_depack.c
796
QUIC_CHANNEL *ch,
crypto/openssl/ssl/quic/quic_rx_depack.c
805
ossl_quic_channel_raise_protocol_error(ch,
crypto/openssl/ssl/quic/quic_rx_depack.c
816
if (!depack_do_implicit_stream_create(ch, stream_id,
crypto/openssl/ssl/quic/quic_rx_depack.c
83
ch->ack_range_scratch = p;
crypto/openssl/ssl/quic/quic_rx_depack.c
830
ossl_quic_channel_raise_protocol_error(ch,
crypto/openssl/ssl/quic/quic_rx_depack.c
84
ch->num_ack_range_scratch = (size_t)total_ranges;
crypto/openssl/ssl/quic/quic_rx_depack.c
843
QUIC_CHANNEL *ch,
crypto/openssl/ssl/quic/quic_rx_depack.c
850
ossl_quic_channel_raise_protocol_error(ch,
crypto/openssl/ssl/quic/quic_rx_depack.c
864
ossl_quic_channel_raise_protocol_error(ch,
crypto/openssl/ssl/quic/quic_rx_depack.c
87
ack.ack_ranges = ch->ack_range_scratch;
crypto/openssl/ssl/quic/quic_rx_depack.c
876
QUIC_CHANNEL *ch,
crypto/openssl/ssl/quic/quic_rx_depack.c
882
ossl_quic_channel_raise_protocol_error(ch,
crypto/openssl/ssl/quic/quic_rx_depack.c
889
ossl_quic_channel_on_new_conn_id(ch, &frame_data);
crypto/openssl/ssl/quic/quic_rx_depack.c
895
QUIC_CHANNEL *ch,
crypto/openssl/ssl/quic/quic_rx_depack.c
901
ossl_quic_channel_raise_protocol_error(ch,
crypto/openssl/ssl/quic/quic_rx_depack.c
921
if (!ch->is_server) {
crypto/openssl/ssl/quic/quic_rx_depack.c
922
ossl_quic_channel_raise_protocol_error(ch,
crypto/openssl/ssl/quic/quic_rx_depack.c
938
QUIC_CHANNEL *ch,
crypto/openssl/ssl/quic/quic_rx_depack.c
94
&& (qpacket->key_epoch < ossl_qrx_get_key_epoch(ch->qrx)
crypto/openssl/ssl/quic/quic_rx_depack.c
947
ossl_quic_channel_raise_protocol_error(ch,
crypto/openssl/ssl/quic/quic_rx_depack.c
95
|| ch->rxku_expected)
crypto/openssl/ssl/quic/quic_rx_depack.c
96
&& ack.ack_ranges[0].end >= ch->txku_pn) {
crypto/openssl/ssl/quic/quic_rx_depack.c
975
if (!ossl_quic_cfq_add_frame(ch->cfq, 0, QUIC_PN_SPACE_APP,
crypto/openssl/ssl/quic/quic_rx_depack.c
986
ossl_quic_channel_raise_protocol_error(ch, OSSL_QUIC_ERR_INTERNAL_ERROR,
crypto/openssl/ssl/quic/quic_rx_depack.c
993
QUIC_CHANNEL *ch,
crypto/openssl/ssl/quic/quic_rx_depack.c
999
ossl_quic_channel_raise_protocol_error(ch,
crypto/openssl/ssl/quic/quic_thread_assist.c
105
CRYPTO_MUTEX *m = ossl_quic_channel_get_mutex(qta->ch);
crypto/openssl/ssl/quic/quic_thread_assist.c
134
qta->ch = NULL;
crypto/openssl/ssl/quic/quic_thread_assist.c
23
CRYPTO_MUTEX *m = ossl_quic_channel_get_mutex(qta->ch);
crypto/openssl/ssl/quic/quic_thread_assist.c
25
QUIC_ENGINE *eng = ossl_quic_channel_get0_engine(qta->ch);
crypto/openssl/ssl/quic/quic_thread_assist.c
29
rtor = ossl_quic_channel_get_reactor(qta->ch);
crypto/openssl/ssl/quic/quic_thread_assist.c
67
QUIC_CHANNEL *ch)
crypto/openssl/ssl/quic/quic_thread_assist.c
69
CRYPTO_MUTEX *mutex = ossl_quic_channel_get_mutex(ch);
crypto/openssl/ssl/quic/quic_thread_assist.c
74
qta->ch = ch;
crypto/openssl/ssl/quic/quic_trace.c
571
QUIC_CHANNEL *ch;
crypto/openssl/ssl/quic/quic_trace.c
591
ch = ossl_quic_conn_get_channel(ssl);
crypto/openssl/ssl/quic/quic_trace.c
592
id_len = ossl_quic_channel_get_short_header_conn_id_len(ch);
crypto/openssl/ssl/quic/quic_tserver.c
136
if ((srv->ch = ossl_quic_port_create_incoming(srv->port, srv->tls)) == NULL)
crypto/openssl/ssl/quic/quic_tserver.c
147
qc->ch = srv->ch;
crypto/openssl/ssl/quic/quic_tserver.c
157
ossl_quic_channel_free(srv->ch);
crypto/openssl/ssl/quic/quic_tserver.c
176
ossl_quic_channel_free(srv->ch);
crypto/openssl/ssl/quic/quic_tserver.c
195
return ossl_quic_channel_set_mutator(srv->ch, mutatecb, finishmutatecb,
crypto/openssl/ssl/quic/quic_tserver.c
204
return ossl_statem_set_mutator(ossl_quic_channel_get0_ssl(srv->ch),
crypto/openssl/ssl/quic/quic_tserver.c
212
ossl_quic_reactor_tick(ossl_quic_channel_get_reactor(srv->ch), 0);
crypto/openssl/ssl/quic/quic_tserver.c
214
if (ossl_quic_channel_is_active(srv->ch))
crypto/openssl/ssl/quic/quic_tserver.c
222
return ossl_quic_channel_is_active(srv->ch);
crypto/openssl/ssl/quic/quic_tserver.c
228
return ossl_quic_channel_is_term_any(srv->ch);
crypto/openssl/ssl/quic/quic_tserver.c
234
return ossl_quic_channel_get_terminate_cause(srv->ch);
crypto/openssl/ssl/quic/quic_tserver.c
240
return ossl_quic_channel_is_terminated(srv->ch);
crypto/openssl/ssl/quic/quic_tserver.c
245
return ossl_quic_channel_get_short_header_conn_id_len(srv->ch);
crypto/openssl/ssl/quic/quic_tserver.c
250
return ossl_quic_channel_is_handshake_confirmed(srv->ch);
crypto/openssl/ssl/quic/quic_tserver.c
262
qs = ossl_quic_stream_map_get_by_id(ossl_quic_channel_get_qsm(srv->ch),
crypto/openssl/ssl/quic/quic_tserver.c
275
if (!is_client_init || !ossl_quic_channel_is_active(srv->ch))
crypto/openssl/ssl/quic/quic_tserver.c
299
ossl_statm_get_rtt_info(ossl_quic_channel_get_statm(srv->ch), &rtt_info);
crypto/openssl/ssl/quic/quic_tserver.c
307
ossl_quic_stream_map_notify_totally_read(ossl_quic_channel_get_qsm(srv->ch),
crypto/openssl/ssl/quic/quic_tserver.c
311
ossl_quic_stream_map_update_state(ossl_quic_channel_get_qsm(srv->ch), qs);
crypto/openssl/ssl/quic/quic_tserver.c
323
qs = ossl_quic_stream_map_get_by_id(ossl_quic_channel_get_qsm(srv->ch),
crypto/openssl/ssl/quic/quic_tserver.c
35
QUIC_CHANNEL *ch;
crypto/openssl/ssl/quic/quic_tserver.c
355
ossl_quic_stream_map_notify_totally_read(ossl_quic_channel_get_qsm(srv->ch),
crypto/openssl/ssl/quic/quic_tserver.c
357
ossl_quic_stream_map_update_state(ossl_quic_channel_get_qsm(srv->ch), qs);
crypto/openssl/ssl/quic/quic_tserver.c
372
if (!ossl_quic_channel_is_active(srv->ch))
crypto/openssl/ssl/quic/quic_tserver.c
375
qs = ossl_quic_stream_map_get_by_id(ossl_quic_channel_get_qsm(srv->ch),
crypto/openssl/ssl/quic/quic_tserver.c
389
ossl_quic_stream_map_update_state(ossl_quic_channel_get_qsm(srv->ch), qs);
crypto/openssl/ssl/quic/quic_tserver.c
400
if (!ossl_quic_channel_is_active(srv->ch))
crypto/openssl/ssl/quic/quic_tserver.c
403
qs = ossl_quic_stream_map_get_by_id(ossl_quic_channel_get_qsm(srv->ch),
crypto/openssl/ssl/quic/quic_tserver.c
410
ossl_quic_stream_map_update_state(ossl_quic_channel_get_qsm(srv->ch), qs);
crypto/openssl/ssl/quic/quic_tserver.c
423
if (!ossl_quic_channel_is_active(srv->ch))
crypto/openssl/ssl/quic/quic_tserver.c
426
if ((qs = ossl_quic_channel_new_stream_local(srv->ch, is_uni)) == NULL)
crypto/openssl/ssl/quic/quic_tserver.c
449
qs = ossl_quic_stream_map_get_by_id(ossl_quic_channel_get_qsm(srv->ch),
crypto/openssl/ssl/quic/quic_tserver.c
466
qs = ossl_quic_stream_map_get_by_id(ossl_quic_channel_get_qsm(srv->ch),
crypto/openssl/ssl/quic/quic_tserver.c
481
return ossl_quic_channel_replace_local_cid(srv->ch, conn_id);
crypto/openssl/ssl/quic/quic_tserver.c
486
QUIC_STREAM_MAP *qsm = ossl_quic_channel_get_qsm(srv->ch);
crypto/openssl/ssl/quic/quic_tserver.c
502
qs = ossl_quic_stream_map_get_by_id(ossl_quic_channel_get_qsm(srv->ch),
crypto/openssl/ssl/quic/quic_tserver.c
513
ossl_quic_channel_get_reactor(srv->ch));
crypto/openssl/ssl/quic/quic_tserver.c
519
ossl_quic_channel_get_reactor(srv->ch));
crypto/openssl/ssl/quic/quic_tserver.c
525
ossl_quic_channel_get_reactor(srv->ch));
crypto/openssl/ssl/quic/quic_tserver.c
530
ossl_quic_channel_local_close(srv->ch, app_error_code, NULL);
crypto/openssl/ssl/quic/quic_tserver.c
532
if (ossl_quic_channel_is_terminated(srv->ch))
crypto/openssl/ssl/quic/quic_tserver.c
535
ossl_quic_reactor_tick(ossl_quic_channel_get_reactor(srv->ch), 0);
crypto/openssl/ssl/quic/quic_tserver.c
537
return ossl_quic_channel_is_terminated(srv->ch);
crypto/openssl/ssl/quic/quic_tserver.c
542
if (ossl_quic_channel_is_terminated(srv->ch))
crypto/openssl/ssl/quic/quic_tserver.c
545
if (!ossl_quic_channel_ping(srv->ch))
crypto/openssl/ssl/quic/quic_tserver.c
548
ossl_quic_reactor_tick(ossl_quic_channel_get_reactor(srv->ch), 0);
crypto/openssl/ssl/quic/quic_tserver.c
554
return srv->ch;
crypto/openssl/ssl/quic/quic_tserver.c
564
ossl_quic_channel_set_msg_callback(srv->ch, f, srv->ssl);
crypto/openssl/ssl/quic/quic_tserver.c
565
ossl_quic_channel_set_msg_callback_arg(srv->ch, arg);
crypto/openssl/ssl/rio/rio_notifier.c
347
static const unsigned char ch = 0;
crypto/openssl/ssl/rio/rio_notifier.c
355
wr = writesocket(nfy->wfd, (void *)&ch, sizeof(ch));
crypto/openssl/ssl/ssl_ciph.c
1003
ch = *l;
crypto/openssl/ssl/ssl_ciph.c
1007
while (((ch >= 'A') && (ch <= 'Z')) || ((ch >= '0') && (ch <= '9')) || ((ch >= 'a') && (ch <= 'z')) || (ch == '-') || (ch == '_') || (ch == '.') || (ch == '='))
crypto/openssl/ssl/ssl_ciph.c
1009
while (isalnum((unsigned char)ch) || (ch == '-') || (ch == '_') || (ch == '.')
crypto/openssl/ssl/ssl_ciph.c
1010
|| (ch == '='))
crypto/openssl/ssl/ssl_ciph.c
1013
ch = *(++l);
crypto/openssl/ssl/ssl_ciph.c
1033
if (ch == '+') {
crypto/openssl/ssl/ssl_ciph.c
965
char ch;
crypto/openssl/ssl/ssl_ciph.c
970
ch = *l;
crypto/openssl/ssl/ssl_ciph.c
972
if (ch == '\0')
crypto/openssl/ssl/ssl_ciph.c
974
if (ch == '-') {
crypto/openssl/ssl/ssl_ciph.c
977
} else if (ch == '+') {
crypto/openssl/ssl/ssl_ciph.c
980
} else if (ch == '!') {
crypto/openssl/ssl/ssl_ciph.c
983
} else if (ch == '@') {
crypto/openssl/ssl/ssl_ciph.c
990
if (ITEM_SEP(ch)) {
crypto/openssl/test/errtest.c
24
#define IS_HEX(ch) ((ch >= '0' && ch <= '9') || (ch >= 'A' && ch <= 'F'))
crypto/openssl/test/quic_multistream_test.c
1613
QUIC_CHANNEL *ch = ossl_quic_conn_get_channel(h->c_conn);
crypto/openssl/test/quic_multistream_test.c
1616
ossl_quic_engine_set_inhibit_tick(ossl_quic_channel_get0_engine(ch), 0);
crypto/openssl/test/quic_multistream_test.c
1912
QUIC_CHANNEL *ch = ossl_quic_conn_get_channel(h->c_conn);
crypto/openssl/test/quic_multistream_test.c
1914
ossl_quic_engine_set_inhibit_tick(ossl_quic_channel_get0_engine(ch),
crypto/openssl/test/quic_multistream_test.c
3441
QUIC_CHANNEL *ch = ossl_quic_tserver_get_channel(h->s_priv);
crypto/openssl/test/quic_multistream_test.c
3464
ossl_quic_channel_get_diag_local_cid(ch, &new_cid);
crypto/openssl/test/quic_multistream_test.c
3828
QUIC_CHANNEL *ch = ossl_quic_tserver_get_channel(ACQUIRE_S());
crypto/openssl/test/quic_multistream_test.c
3830
h->scratch0 = ossl_quic_channel_get_diag_num_rx_ack(ch);
crypto/openssl/test/quic_multistream_test.c
3840
QUIC_CHANNEL *ch = ossl_quic_tserver_get_channel(ACQUIRE_S());
crypto/openssl/test/quic_multistream_test.c
3843
count = ossl_quic_channel_get_diag_num_rx_ack(ch);
crypto/openssl/test/quic_multistream_test.c
418
QUIC_CHANNEL *ch = ossl_quic_conn_get_channel(h->c_conn);
crypto/openssl/test/quic_multistream_test.c
420
ossl_quic_channel_set_txku_threshold_override(ch, hl->check_op->arg2);
crypto/openssl/test/quic_multistream_test.c
434
QUIC_CHANNEL *ch = ossl_quic_conn_get_channel(h->c_conn);
crypto/openssl/test/quic_multistream_test.c
435
int64_t txke = (int64_t)ossl_quic_channel_get_tx_key_epoch(ch);
crypto/openssl/test/quic_multistream_test.c
436
int64_t rxke = (int64_t)ossl_quic_channel_get_rx_key_epoch(ch);
crypto/openssl/test/quic_multistream_test.c
455
QUIC_CHANNEL *ch = ossl_quic_conn_get_channel(h->c_conn);
crypto/openssl/test/quic_multistream_test.c
456
uint64_t txke = ossl_quic_channel_get_tx_key_epoch(ch);
crypto/openssl/test/quic_multistream_test.c
5050
QUIC_CHANNEL *ch = ossl_quic_conn_get_channel(h->c_conn);
crypto/openssl/test/quic_multistream_test.c
5053
if (!ossl_quic_channel_set_mutator(ch, script_74_alter_version,
crypto/openssl/test/quic_multistream_test.c
5270
QUIC_CHANNEL *ch = ossl_quic_tserver_get_channel(ACQUIRE_S_NOHL());
crypto/openssl/test/quic_multistream_test.c
5282
ossl_quic_channel_get_diag_local_cid(ch, &new_cid);
crypto/openssl/test/radix/quic_ops.c
483
QUIC_CHANNEL *ch;
crypto/openssl/test/radix/quic_ops.c
490
ch = ossl_quic_conn_get_channel(ssl);
crypto/openssl/test/radix/quic_ops.c
491
ossl_quic_engine_set_inhibit_tick(ossl_quic_channel_get0_engine(ch), 0);
crypto/openssl/test/threadstest.c
1202
uint8_t ch = 0;
crypto/openssl/test/threadstest.c
1207
if (!TEST_int_eq(RAND_bytes_ex(multi_libctx, &ch, 1, 64), 1))
crypto/openssl/test/threadstest.c
1217
if (ch & 2)
crypto/openssl/test/threadstest.c
1218
r = BIO_sendmmsg(ch & 1 ? multi_bio2 : multi_bio1, &msg,
crypto/openssl/test/threadstest.c
1221
r = BIO_recvmmsg(ch & 1 ? multi_bio2 : multi_bio1, &msg,
lib/libc/db/recno/rec_get.c
117
int ch;
lib/libc/db/recno/rec_get.c
131
for (p = t->bt_rdata.data;; *p++ = ch)
lib/libc/db/recno/rec_get.c
132
if ((ch = getc(t->bt_rfp)) == EOF || !--len) {
lib/libc/db/recno/rec_get.c
133
if (ch != EOF)
lib/libc/db/recno/rec_get.c
134
*p = ch;
lib/libc/db/recno/rec_get.c
143
if (ch == EOF)
lib/libc/db/recno/rec_get.c
170
int bval, ch;
lib/libc/db/recno/rec_get.c
176
sz = t->bt_rdata.size;; *p++ = ch, --sz) {
lib/libc/db/recno/rec_get.c
177
if ((ch = getc(t->bt_rfp)) == EOF || ch == bval) {
lib/libc/db/recno/rec_get.c
180
if (ch == EOF && data.size == 0)
lib/libc/db/recno/rec_get.c
196
if (ch == EOF)
lib/libc/db/test/dbtest.c
85
int ch, oflags, sflag;
lib/libc/db/test/dbtest.c
92
while ((ch = getopt(argc, argv, "f:i:lo:s")) != -1)
lib/libc/db/test/dbtest.c
93
switch (ch) {
lib/libc/gen/glob-compat11.c
1006
g_strchr(const Char *str, wchar_t ch)
lib/libc/gen/glob-compat11.c
1010
if (*str == ch)
lib/libc/gen/glob.c
1068
g_strchr(const Char *str, wchar_t ch)
lib/libc/gen/glob.c
1072
if (*str == ch)
lib/libc/gen/readpassphrase.c
127
while ((nr = _read(input, &ch, 1)) == 1 && ch != '\n' && ch != '\r') {
lib/libc/gen/readpassphrase.c
130
ch &= 0x7f;
lib/libc/gen/readpassphrase.c
131
if (isalpha((unsigned char)ch)) {
lib/libc/gen/readpassphrase.c
133
ch = (char)tolower((unsigned char)ch);
lib/libc/gen/readpassphrase.c
135
ch = (char)toupper((unsigned char)ch);
lib/libc/gen/readpassphrase.c
137
*p++ = ch;
lib/libc/gen/readpassphrase.c
47
char ch, *p, *end;
lib/libc/gen/syslog.c
138
char ch, *p;
lib/libc/gen/syslog.c
242
for ( ; (ch = *fmt); ++fmt) {
lib/libc/gen/syslog.c
243
if (ch == '%' && fmt[1] == 'm') {
lib/libc/gen/syslog.c
247
} else if (ch == '%' && fmt[1] == '%') {
lib/libc/gen/syslog.c
249
fputc(ch, fmt_fp);
lib/libc/gen/syslog.c
250
fputc(ch, fmt_fp);
lib/libc/gen/syslog.c
252
fputc(ch, fmt_fp);
lib/libc/iconv/citrus_memstream.c
114
struct _citrus_region *r, char ch)
lib/libc/iconv/citrus_memstream.c
123
chr = memchr(head, ch, _memstream_remainder(ms));
lib/libc/iconv/citrus_memstream.c
140
int ch;
lib/libc/iconv/citrus_memstream.c
142
while ((ch = _memstream_peek(ms)) != EOF) {
lib/libc/iconv/citrus_memstream.c
143
if (!_bcs_isspace(ch))
lib/libc/iconv/citrus_memstream.h
141
_citrus_memory_stream_ungetc(struct _citrus_memory_stream *ms, int ch)
lib/libc/iconv/citrus_memstream.h
144
if (ch != EOF && ms->ms_pos > 0)
lib/libc/iconv/citrus_prop.c
112
int base, ch, neg; \
lib/libc/iconv/citrus_prop.c
115
ch = _memstream_getc(ms); \
lib/libc/iconv/citrus_prop.c
117
switch (ch) { \
lib/libc/iconv/citrus_prop.c
121
ch = _memstream_getc(ms); \
lib/libc/iconv/citrus_prop.c
124
if (ch == '0') { \
lib/libc/iconv/citrus_prop.c
126
ch = _memstream_getc(ms); \
lib/libc/iconv/citrus_prop.c
127
if (ch == 'x' || ch == 'X') { \
lib/libc/iconv/citrus_prop.c
128
ch = _memstream_getc(ms); \
lib/libc/iconv/citrus_prop.c
129
if (_bcs_isxdigit(ch) == 0) { \
lib/libc/iconv/citrus_prop.c
130
_memstream_ungetc(ms, ch); \
lib/libc/iconv/citrus_prop.c
136
} else if (_bcs_isdigit(ch) == 0) \
lib/libc/iconv/citrus_prop.c
138
_memstream_ungetc(ms, ch); \
lib/libc/iconv/citrus_prop.c
150
int base, ch;
lib/libc/iconv/citrus_prop.c
152
ch = _memstream_getc(ms);
lib/libc/iconv/citrus_prop.c
153
if (ch != '\\')
lib/libc/iconv/citrus_prop.c
154
*result = ch;
lib/libc/iconv/citrus_prop.c
156
ch = _memstream_getc(ms);
lib/libc/iconv/citrus_prop.c
158
switch (ch) {
lib/libc/iconv/citrus_prop.c
182
_memstream_ungetc(ms, ch);
lib/libc/iconv/citrus_prop.c
191
*result = ch;
lib/libc/iconv/citrus_prop.c
201
int ch, errnum;
lib/libc/iconv/citrus_prop.c
204
ch = _memstream_getc(ms);
lib/libc/iconv/citrus_prop.c
205
if (ch != '\'') {
lib/libc/iconv/citrus_prop.c
206
_memstream_ungetc(ms, ch);
lib/libc/iconv/citrus_prop.c
209
errnum = _citrus_prop_read_character_common(ms, &ch);
lib/libc/iconv/citrus_prop.c
212
obj->u.chr = ch;
lib/libc/iconv/citrus_prop.c
213
ch = _memstream_getc(ms);
lib/libc/iconv/citrus_prop.c
214
if (ch != '\'')
lib/libc/iconv/citrus_prop.c
250
int ch, errnum, quot;
lib/libc/iconv/citrus_prop.c
287
ch = _memstream_getc(ms);
lib/libc/iconv/citrus_prop.c
288
if (quot == ch || (quot == EOF &&
lib/libc/iconv/citrus_prop.c
289
(ch == ';' || _bcs_isspace(ch)))) {
lib/libc/iconv/citrus_prop.c
295
_memstream_ungetc(ms, ch);
lib/libc/iconv/citrus_prop.c
296
errnum = _citrus_prop_read_character_common(ms, &ch);
lib/libc/iconv/citrus_prop.c
301
s[n] = ch;
lib/libc/iconv/citrus_prop.c
323
int ch;
lib/libc/iconv/citrus_prop.c
327
ch = _memstream_getc(ms);
lib/libc/iconv/citrus_prop.c
328
if (ch != '_' && _bcs_isalnum(ch) == 0)
lib/libc/iconv/citrus_prop.c
330
s[m] = ch;
lib/libc/iconv/citrus_prop.c
332
ch = _memstream_getc(ms);
lib/libc/iconv/citrus_prop.c
333
if (ch == '_' || _bcs_isalnum(ch) != 0)
lib/libc/iconv/citrus_prop.c
337
_memstream_ungetc(ms, ch);
lib/libc/iconv/citrus_prop.c
347
int ch, errnum;
lib/libc/iconv/citrus_prop.c
363
ch = _memstream_getc(ms);
lib/libc/iconv/citrus_prop.c
364
if (ch != '=' && ch != ':')
lib/libc/iconv/citrus_prop.c
365
_memstream_ungetc(ms, ch);
lib/libc/iconv/citrus_prop.c
373
ch = _memstream_getc(ms);
lib/libc/iconv/citrus_prop.c
380
if (ch != '-')
lib/libc/iconv/citrus_prop.c
386
ch = _memstream_getc(ms);
lib/libc/iconv/citrus_prop.c
421
} while (ch == ',');
lib/libc/iconv/citrus_prop.c
422
if (ch != ';')
lib/libc/iconv/citrus_prop.c
423
_memstream_ungetc(ms, ch);
lib/libc/iconv/citrus_prop.c
432
int ch, errnum;
lib/libc/iconv/citrus_prop.c
437
ch = _memstream_getc(&ms);
lib/libc/iconv/citrus_prop.c
438
if (ch == EOF || ch == '\0')
lib/libc/iconv/citrus_prop.c
440
_memstream_ungetc(&ms, ch);
lib/libc/iconv/citrus_prop.c
83
int ch, cutlim, n; \
lib/libc/iconv/citrus_prop.c
90
ch = _memstream_getc(ms); \
lib/libc/iconv/citrus_prop.c
91
p = strchr(xdigit, _bcs_toupper(ch)); \
lib/libc/iconv/citrus_prop.c
99
_memstream_ungetc(ms, ch); \
lib/libc/inet/inet_cidr_pton.c
101
if (ch == '\0' || ch == '/')
lib/libc/inet/inet_cidr_pton.c
103
if (ch != '.')
lib/libc/inet/inet_cidr_pton.c
109
if (ch == '/' && dst > odst) {
lib/libc/inet/inet_cidr_pton.c
113
} else if (ch != '\0')
lib/libc/inet/inet_cidr_pton.c
154
int ch, saw_xdigit;
lib/libc/inet/inet_cidr_pton.c
169
while ((ch = *src++) != '\0') {
lib/libc/inet/inet_cidr_pton.c
172
if ((pch = strchr((xdigits = xdigits_l), ch)) == NULL)
lib/libc/inet/inet_cidr_pton.c
173
pch = strchr((xdigits = xdigits_u), ch);
lib/libc/inet/inet_cidr_pton.c
182
if (ch == ':') {
lib/libc/inet/inet_cidr_pton.c
200
if (ch == '.' && ((tp + NS_INADDRSZ) <= endp) &&
lib/libc/inet/inet_cidr_pton.c
206
if (ch == '/') {
lib/libc/inet/inet_cidr_pton.c
254
char *cp, ch;
lib/libc/inet/inet_cidr_pton.c
259
ch = *src++;
lib/libc/inet/inet_cidr_pton.c
260
cp = strchr(digits, ch);
lib/libc/inet/inet_cidr_pton.c
84
int n, ch, tmp, bits;
lib/libc/inet/inet_cidr_pton.c
88
while (ch = *src++, (isascii(ch) && isdigit(ch))) {
lib/libc/inet/inet_cidr_pton.c
91
n = strchr(digits, ch) - digits;
lib/libc/inet/inet_cidr_pton.c
97
} while ((ch = *src++) != '\0' && isascii(ch) && isdigit(ch));
lib/libc/inet/inet_net_pton.c
102
while ((ch = (unsigned char)*src++) != '\0' &&
lib/libc/inet/inet_net_pton.c
103
isascii(ch) && isxdigit(ch)) {
lib/libc/inet/inet_net_pton.c
104
if (isupper(ch))
lib/libc/inet/inet_net_pton.c
105
ch = tolower(ch);
lib/libc/inet/inet_net_pton.c
106
n = strchr(xdigits, ch) - xdigits;
lib/libc/inet/inet_net_pton.c
124
} else if (isascii(ch) && isdigit(ch)) {
lib/libc/inet/inet_net_pton.c
129
n = strchr(digits, ch) - digits;
lib/libc/inet/inet_net_pton.c
135
} while ((ch = (unsigned char)*src++) != '\0' &&
lib/libc/inet/inet_net_pton.c
136
isascii(ch) && isdigit(ch));
lib/libc/inet/inet_net_pton.c
140
if (ch == '\0' || ch == '/')
lib/libc/inet/inet_net_pton.c
142
if (ch != '.')
lib/libc/inet/inet_net_pton.c
144
ch = (unsigned char)*src++;
lib/libc/inet/inet_net_pton.c
145
if (!isascii(ch) || !isdigit(ch))
lib/libc/inet/inet_net_pton.c
152
if (ch == '/' && isascii((unsigned char)src[0]) &&
lib/libc/inet/inet_net_pton.c
155
ch = (unsigned char)*src++; /* Skip over the /. */
lib/libc/inet/inet_net_pton.c
158
n = strchr(digits, ch) - digits;
lib/libc/inet/inet_net_pton.c
164
} while ((ch = (unsigned char)*src++) != '\0' &&
lib/libc/inet/inet_net_pton.c
165
isascii(ch) && isdigit(ch));
lib/libc/inet/inet_net_pton.c
166
if (ch != '\0')
lib/libc/inet/inet_net_pton.c
171
if (ch != '\0')
lib/libc/inet/inet_net_pton.c
91
int n, ch, tmp, dirty, bits;
lib/libc/inet/inet_net_pton.c
94
ch = (unsigned char)*src++;
lib/libc/inet/inet_net_pton.c
95
if (ch == '0' && (src[0] == 'x' || src[0] == 'X')
lib/libc/inet/inet_pton.c
100
} else if (ch == '.' && saw_digit) {
lib/libc/inet/inet_pton.c
134
int ch, seen_xdigits;
lib/libc/inet/inet_pton.c
147
while ((ch = *src++) != '\0') {
lib/libc/inet/inet_pton.c
150
if ((pch = strchr((xdigits = xdigits_l), ch)) == NULL)
lib/libc/inet/inet_pton.c
151
pch = strchr((xdigits = xdigits_u), ch);
lib/libc/inet/inet_pton.c
159
if (ch == ':') {
lib/libc/inet/inet_pton.c
177
if (ch == '.' && ((tp + NS_INADDRSZ) <= endp) &&
lib/libc/inet/inet_pton.c
78
int saw_digit, octets, ch;
lib/libc/inet/inet_pton.c
84
while ((ch = *src++) != '\0') {
lib/libc/inet/inet_pton.c
87
if ((pch = strchr(digits, ch)) != NULL) {
lib/libc/locale/big5.c
107
if ((bs->ch & ~0xFF) != 0) {
lib/libc/locale/big5.c
123
if (bs->ch != 0) {
lib/libc/locale/big5.c
128
wc = (bs->ch << 8) | (*s & 0xFF);
lib/libc/locale/big5.c
131
bs->ch = 0;
lib/libc/locale/big5.c
140
bs->ch = wc;
lib/libc/locale/big5.c
165
if (bs->ch != 0) {
lib/libc/locale/big5.c
64
wchar_t ch;
lib/libc/locale/big5.c
86
return (ps == NULL || ((const _BIG5State *)ps)->ch == 0);
lib/libc/locale/collate.c
911
collate_chain_t *ch = NULL;
lib/libc/locale/collate.c
940
if (len > 1 && (ch = chainsearch(table, buf, &i)) != NULL) {
lib/libc/locale/collate.c
941
int e = ch->pri[0];
lib/libc/locale/euc.c
106
wchar_t ch;
lib/libc/locale/euc.c
318
unsigned char ch, chs;
lib/libc/locale/euc.c
339
if (((ch = (unsigned char)*s) & 0x80) == 0) {
lib/libc/locale/euc.c
341
*pwc = ch;
lib/libc/locale/euc.c
342
return (ch != '\0' ? 1 : 0);
lib/libc/locale/euc.c
345
if (ch >= 0xa1) {
lib/libc/locale/euc.c
348
} else if (ch == cs2) {
lib/libc/locale/euc.c
350
} else if (ch == cs3) {
lib/libc/locale/euc.c
359
es->ch = 0;
lib/libc/locale/euc.c
362
wc = es->ch;
lib/libc/locale/euc.c
374
es->ch = wc;
lib/libc/locale/gb18030.c
129
ch = (unsigned char)*s++;
lib/libc/locale/gb18030.c
130
if (ch <= 0x7f) {
lib/libc/locale/gb18030.c
132
wch = ch;
lib/libc/locale/gb18030.c
133
} else if (ch >= 0x81 && ch <= 0xfe) {
lib/libc/locale/gb18030.c
134
wch = ch;
lib/libc/locale/gb18030.c
137
ch = (unsigned char)*s++;
lib/libc/locale/gb18030.c
138
if ((ch >= 0x40 && ch <= 0x7e) || (ch >= 0x80 && ch <= 0xfe)) {
lib/libc/locale/gb18030.c
139
wch = (wch << 8) | ch;
lib/libc/locale/gb18030.c
141
} else if (ch >= 0x30 && ch <= 0x39) {
lib/libc/locale/gb18030.c
147
wch = ((wch & 0x7f) << 8) | ch;
lib/libc/locale/gb18030.c
150
ch = (unsigned char)*s++;
lib/libc/locale/gb18030.c
151
if (ch < 0x81 || ch > 0xfe)
lib/libc/locale/gb18030.c
153
wch = (wch << 8) | ch;
lib/libc/locale/gb18030.c
156
ch = (unsigned char)*s++;
lib/libc/locale/gb18030.c
157
if (ch < 0x30 || ch > 0x39)
lib/libc/locale/gb18030.c
159
wch = (wch << 8) | ch;
lib/libc/locale/gb18030.c
97
int ch, len, ocount;
lib/libc/locale/gbk.c
109
if ((gs->ch & ~0xFF) != 0) {
lib/libc/locale/gbk.c
125
if (gs->ch != 0) {
lib/libc/locale/gbk.c
130
wc = (gs->ch << 8) | (*s & 0xFF);
lib/libc/locale/gbk.c
133
gs->ch = 0;
lib/libc/locale/gbk.c
142
gs->ch = wc;
lib/libc/locale/gbk.c
167
if (gs->ch != 0) {
lib/libc/locale/gbk.c
66
wchar_t ch;
lib/libc/locale/gbk.c
88
return (ps == NULL || ((const _GBKState *)ps)->ch == 0);
lib/libc/locale/mskanji.c
102
if ((ms->ch & ~0xFF) != 0) {
lib/libc/locale/mskanji.c
118
if (ms->ch != 0) {
lib/libc/locale/mskanji.c
123
wc = (ms->ch << 8) | (*s & 0xFF);
lib/libc/locale/mskanji.c
126
ms->ch = 0;
lib/libc/locale/mskanji.c
133
ms->ch = wc;
lib/libc/locale/mskanji.c
159
if (ms->ch != 0) {
lib/libc/locale/mskanji.c
68
wchar_t ch;
lib/libc/locale/mskanji.c
90
return (ps == NULL || ((const _MSKanjiState *)ps)->ch == 0);
lib/libc/locale/utf8.c
130
ch = (unsigned char)*s;
lib/libc/locale/utf8.c
131
if ((ch & 0x80) == 0) {
lib/libc/locale/utf8.c
134
*pwc = ch;
lib/libc/locale/utf8.c
135
return (ch != '\0' ? 1 : 0);
lib/libc/locale/utf8.c
137
if ((ch & 0xe0) == 0xc0) {
lib/libc/locale/utf8.c
141
} else if ((ch & 0xf0) == 0xe0) {
lib/libc/locale/utf8.c
145
} else if ((ch & 0xf8) == 0xf0) {
lib/libc/locale/utf8.c
168
wch = us->ch;
lib/libc/locale/utf8.c
186
us->ch = wch;
lib/libc/locale/utf8.c
59
wchar_t ch;
lib/libc/locale/utf8.c
97
int ch, i, mask, want;
lib/libc/nameser/ns_name.c
868
special(int ch) {
lib/libc/nameser/ns_name.c
869
switch (ch) {
lib/libc/nameser/ns_name.c
893
printable(int ch) {
lib/libc/nameser/ns_name.c
894
return (ch > 0x20 && ch < 0x7f);
lib/libc/nameser/ns_name.c
902
mklower(int ch) {
lib/libc/nameser/ns_name.c
903
if (ch >= 0x41 && ch <= 0x5A)
lib/libc/nameser/ns_name.c
904
return (ch + 0x20);
lib/libc/nameser/ns_name.c
905
return (ch);
lib/libc/nameser/ns_ttl.c
103
while ((ch = *src++) != '\0') {
lib/libc/nameser/ns_ttl.c
104
if (!isascii(ch) || !isprint(ch))
lib/libc/nameser/ns_ttl.c
106
if (isdigit(ch)) {
lib/libc/nameser/ns_ttl.c
108
tmp += (ch - '0');
lib/libc/nameser/ns_ttl.c
114
if (islower(ch))
lib/libc/nameser/ns_ttl.c
115
ch = toupper(ch);
lib/libc/nameser/ns_ttl.c
116
switch (ch) {
lib/libc/nameser/ns_ttl.c
84
int ch;
lib/libc/nameser/ns_ttl.c
86
for (p = odst; (ch = *p) != '\0'; p++)
lib/libc/nameser/ns_ttl.c
87
if (isascii(ch) && isupper(ch))
lib/libc/nameser/ns_ttl.c
88
*p = tolower(ch);
lib/libc/nameser/ns_ttl.c
97
int ch, digits, dirty;
lib/libc/net/base64.c
194
int tarindex, state, ch;
lib/libc/net/base64.c
201
while ((ch = *src++) != '\0') {
lib/libc/net/base64.c
202
if (isspace((unsigned char)ch)) /* Skip whitespace anywhere. */
lib/libc/net/base64.c
205
if (ch == Pad64)
lib/libc/net/base64.c
208
pos = strchr(Base64, ch);
lib/libc/net/base64.c
268
if (ch == Pad64) { /* We got a pad char. */
lib/libc/net/base64.c
269
ch = *src++; /* Skip it, get next. */
lib/libc/net/base64.c
277
for ((void)NULL; ch != '\0'; ch = *src++)
lib/libc/net/base64.c
278
if (!isspace((unsigned char)ch))
lib/libc/net/base64.c
281
if (ch != Pad64)
lib/libc/net/base64.c
283
ch = *src++; /* Skip the = */
lib/libc/net/base64.c
292
for ((void)NULL; ch != '\0'; ch = *src++)
lib/libc/net/base64.c
293
if (!isspace((unsigned char)ch))
lib/libc/net/ip6opt.c
82
struct cmsghdr *ch = (struct cmsghdr *)bp;
lib/libc/net/ip6opt.c
88
ch->cmsg_level = IPPROTO_IPV6;
lib/libc/net/ip6opt.c
89
ch->cmsg_type = type;
lib/libc/net/ip6opt.c
90
ch->cmsg_len = CMSG_LEN(0);
lib/libc/net/ip6opt.c
92
*cmsgp = ch;
lib/libc/net/rcmd.c
564
int ch;
lib/libc/net/rcmd.c
586
while ((ch = getc(hostf)) != '\n' && ch != EOF);
lib/libc/net/rthdr.c
69
struct cmsghdr *ch = (struct cmsghdr *)bp;
lib/libc/net/rthdr.c
72
rthdr = (struct ip6_rthdr *)CMSG_DATA(ch);
lib/libc/net/rthdr.c
74
ch->cmsg_level = IPPROTO_IPV6;
lib/libc/net/rthdr.c
75
ch->cmsg_type = IPV6_RTHDR;
lib/libc/net/rthdr.c
80
ch->cmsg_len = CMSG_LEN(sizeof(struct ip6_rthdr0) -
lib/libc/net/rthdr.c
83
ch->cmsg_len = CMSG_LEN(sizeof(struct ip6_rthdr0));
lib/libc/net/rthdr.c
88
return (ch);
lib/libc/posix1e/acl_support.c
314
char *ch;
lib/libc/posix1e/acl_support.c
316
ch = string;
lib/libc/posix1e/acl_support.c
317
while (*ch) {
lib/libc/posix1e/acl_support.c
318
switch(*ch) {
lib/libc/posix1e/acl_support.c
333
ch++;
lib/libc/regex/engine.c
1016
assert(!NONCHAR(ch) || ch != OPND(s));
lib/libc/regex/engine.c
1017
if (ch == OPND(s))
lib/libc/regex/engine.c
1021
if ((ch == BOL || ch == BOLEOL) && (sflags & SBOS) != 0)
lib/libc/regex/engine.c
1025
if ((ch == EOL || ch == BOLEOL) && (sflags & SEOS) != 0)
lib/libc/regex/engine.c
1029
if (ch == BOL || ch == BOLEOL)
lib/libc/regex/engine.c
1033
if (ch == EOL || ch == BOLEOL)
lib/libc/regex/engine.c
1037
if (ch == BOW)
lib/libc/regex/engine.c
1041
if (ch == EOW)
lib/libc/regex/engine.c
1045
if (ch == BOW || ch == EOW)
lib/libc/regex/engine.c
1049
if (ch == NWBND)
lib/libc/regex/engine.c
1053
if (!NONCHAR(ch))
lib/libc/regex/engine.c
1058
if (!NONCHAR(ch) && CHIN(cs, ch))
lib/libc/regex/engine.c
107
static states step(struct re_guts *g, sopno start, sopno stop, states bef, wint_t ch, states aft, int sflags);
lib/libc/regex/engine.c
1134
int ch,
lib/libc/regex/engine.c
1145
if (ch != '\0')
lib/libc/regex/engine.c
1146
fprintf(d, " %s", pchar(ch));
lib/libc/regex/engine.c
1192
pchar(int ch)
lib/libc/regex/engine.c
1196
if (isprint((uch)ch) || ch == ' ')
lib/libc/regex/engine.c
1197
sprintf(pbuf, "%c", ch);
lib/libc/regex/engine.c
1199
sprintf(pbuf, "\\%o", ch);
lib/libc/regex/engine.c
123
static void print(struct match *m, const char *caption, states st, int ch, FILE *d);
lib/libc/regex/engine.c
129
static const char *pchar(int ch);
lib/libc/regex/engine.c
997
wint_t ch, /* character or NONCHAR code */
lib/libc/regex/grot/debug.c
199
regchar(ch)
lib/libc/regex/grot/debug.c
200
int ch;
lib/libc/regex/grot/debug.c
204
if (isprint(ch) || ch == ' ')
lib/libc/regex/grot/debug.c
205
sprintf(buf, "%c", ch);
lib/libc/regex/grot/debug.c
207
sprintf(buf, "\\%o", ch);
lib/libc/regex/regcomp.c
1023
wint_t ch;
lib/libc/regex/regcomp.c
1062
if ((ch = singleton(cs)) != OUT) { /* optimize singleton sets */
lib/libc/regex/regcomp.c
1063
ordinary(p, ch);
lib/libc/regex/regcomp.c
1313
may_escape(struct parse *p, const wint_t ch)
lib/libc/regex/regcomp.c
1318
if (iswalpha(ch) || ch == '\'' || ch == '`')
lib/libc/regex/regcomp.c
133
static bool may_escape(struct parse *p, const wint_t ch);
lib/libc/regex/regcomp.c
1331
switch(ch) {
lib/libc/regex/regcomp.c
134
static wint_t othercase(wint_t ch);
lib/libc/regex/regcomp.c
135
static void bothcases(struct parse *p, wint_t ch);
lib/libc/regex/regcomp.c
136
static void ordinary(struct parse *p, wint_t ch);
lib/libc/regex/regcomp.c
1362
othercase(wint_t ch)
lib/libc/regex/regcomp.c
1364
assert(iswalpha(ch));
lib/libc/regex/regcomp.c
1365
if (iswupper(ch))
lib/libc/regex/regcomp.c
1366
return(towlower(ch));
lib/libc/regex/regcomp.c
1367
else if (iswlower(ch))
lib/libc/regex/regcomp.c
1368
return(towupper(ch));
lib/libc/regex/regcomp.c
1370
return(ch);
lib/libc/regex/regcomp.c
1380
bothcases(struct parse *p, wint_t ch)
lib/libc/regex/regcomp.c
1388
assert(othercase(ch) != ch); /* p_bracket() would recurse */
lib/libc/regex/regcomp.c
1391
n = wcrtomb(bracket, ch, &mbs);
lib/libc/regex/regcomp.c
1407
ordinary(struct parse *p, wint_t ch)
lib/libc/regex/regcomp.c
1411
if ((p->g->cflags&REG_ICASE) && iswalpha(ch) && othercase(ch) != ch)
lib/libc/regex/regcomp.c
1412
bothcases(p, ch);
lib/libc/regex/regcomp.c
1413
else if ((ch & OPDMASK) == ch)
lib/libc/regex/regcomp.c
1414
EMIT(OCHAR, ch);
lib/libc/regex/regcomp.c
142
static void CHadd(struct parse *p, cset *cs, wint_t ch);
lib/libc/regex/regcomp.c
1422
CHadd(p, cs, ch);
lib/libc/regex/regcomp.c
1641
CHadd(struct parse *p, cset *cs, wint_t ch)
lib/libc/regex/regcomp.c
1644
assert(ch >= 0);
lib/libc/regex/regcomp.c
1645
if (ch < NC)
lib/libc/regex/regcomp.c
1646
cs->bmp[ch >> 3] |= 1 << (ch & 7);
lib/libc/regex/regcomp.c
1655
cs->wides[cs->nwides++] = ch;
lib/libc/regex/regcomp.c
1658
if ((nch = towlower(ch)) < NC)
lib/libc/regex/regcomp.c
1660
if ((nch = towupper(ch)) < NC)
lib/libc/regex/regcomp.c
2117
int ch;
lib/libc/regex/regcomp.c
2133
for (ch = CHAR_MIN; ch < (CHAR_MAX + 1); ch++)
lib/libc/regex/regcomp.c
2134
g->charjump[ch] = g->mlen;
lib/libc/regex/regex2.h
129
CHIN1(cset *cs, wint_t ch)
lib/libc/regex/regex2.h
133
assert(ch >= 0);
lib/libc/regex/regex2.h
134
if (ch < NC)
lib/libc/regex/regex2.h
135
return (((cs->bmp[ch >> 3] & (1 << (ch & 7))) != 0) ^
lib/libc/regex/regex2.h
139
if (ch == towlower(cs->wides[i]) ||
lib/libc/regex/regex2.h
140
ch == towupper(cs->wides[i]))
lib/libc/regex/regex2.h
142
} else if (ch == cs->wides[i])
lib/libc/regex/regex2.h
146
if (cs->ranges[i].min <= ch && ch <= cs->ranges[i].max)
lib/libc/regex/regex2.h
149
if (iswctype(ch, cs->types[i]))
lib/libc/regex/regex2.h
155
CHIN(cset *cs, wint_t ch)
lib/libc/regex/regex2.h
158
assert(ch >= 0);
lib/libc/regex/regex2.h
159
if (ch < NC)
lib/libc/regex/regex2.h
160
return (((cs->bmp[ch >> 3] & (1 << (ch & 7))) != 0) ^
lib/libc/regex/regex2.h
163
return (CHIN1(cs, ch) || CHIN1(cs, towlower(ch)) ||
lib/libc/regex/regex2.h
164
CHIN1(cs, towupper(ch)));
lib/libc/regex/regex2.h
166
return (CHIN1(cs, ch));
lib/libc/resolv/res_comp.c
154
int pch = PERIOD, ch = *dn++;
lib/libc/resolv/res_comp.c
156
while (ch != '\0') {
lib/libc/resolv/res_comp.c
159
if (periodchar(ch)) {
lib/libc/resolv/res_comp.c
162
if (!borderchar(ch))
lib/libc/resolv/res_comp.c
165
if (!borderchar(ch))
lib/libc/resolv/res_comp.c
168
if (!middlechar(ch))
lib/libc/resolv/res_comp.c
171
pch = ch, ch = nch;
lib/libc/resolv/res_comp.c
197
int ch, escaped = 0;
lib/libc/resolv/res_comp.c
204
while ((ch = *dn++) != '\0') {
lib/libc/resolv/res_comp.c
205
if (!domainchar(ch))
lib/libc/resolv/res_comp.c
207
if (!escaped && periodchar(ch))
lib/libc/resolv/res_comp.c
211
else if (bslashchar(ch))
lib/libc/resolv/res_comp.c
214
if (periodchar(ch))
lib/libc/resolv/res_comp.c
225
int ch;
lib/libc/resolv/res_comp.c
227
while ((ch = *dn++) != '\0')
lib/libc/resolv/res_comp.c
228
if (!domainchar(ch))
lib/libc/resolv/res_init.c
106
#define ISSORTMASK(ch) (strchr(sort_mask, ch) != NULL)
lib/libc/stdio/printf-pos.c
250
int ch; /* character from fmt */
lib/libc/stdio/printf-pos.c
264
while ((ch = *fmt) != '\0' && ch != '%')
lib/libc/stdio/printf-pos.c
266
if (ch == '\0')
lib/libc/stdio/printf-pos.c
272
rflag: ch = *fmt++;
lib/libc/stdio/printf-pos.c
273
reswitch: switch (ch) {
lib/libc/stdio/printf-pos.c
286
if ((ch = *fmt++) == '*') {
lib/libc/stdio/printf-pos.c
291
while (is_digit(ch)) {
lib/libc/stdio/printf-pos.c
292
ch = *fmt++;
lib/libc/stdio/printf-pos.c
301
n = 10 * n + to_digit(ch);
lib/libc/stdio/printf-pos.c
307
ch = *fmt++;
lib/libc/stdio/printf-pos.c
308
} while (is_digit(ch));
lib/libc/stdio/printf-pos.c
309
if (ch == '$') {
lib/libc/stdio/printf-pos.c
422
if (ch == '\0')
lib/libc/stdio/printf-pos.c
439
wchar_t ch; /* character from fmt */
lib/libc/stdio/printf-pos.c
453
while ((ch = *fmt) != '\0' && ch != '%')
lib/libc/stdio/printf-pos.c
455
if (ch == '\0')
lib/libc/stdio/printf-pos.c
461
rflag: ch = *fmt++;
lib/libc/stdio/printf-pos.c
462
reswitch: switch (ch) {
lib/libc/stdio/printf-pos.c
475
if ((ch = *fmt++) == '*') {
lib/libc/stdio/printf-pos.c
480
while (is_digit(ch)) {
lib/libc/stdio/printf-pos.c
481
ch = *fmt++;
lib/libc/stdio/printf-pos.c
490
n = 10 * n + to_digit(ch);
lib/libc/stdio/printf-pos.c
496
ch = *fmt++;
lib/libc/stdio/printf-pos.c
497
} while (is_digit(ch));
lib/libc/stdio/printf-pos.c
498
if (ch == '$') {
lib/libc/stdio/printf-pos.c
611
if (ch == '\0')
lib/libc/stdio/putc.c
57
putc_unlocked(int ch, FILE *fp)
lib/libc/stdio/putc.c
60
return (__sputc(ch, fp));
lib/libc/stdio/putchar.c
62
putchar_unlocked(int ch)
lib/libc/stdio/putchar.c
65
return (__sputc(ch, stdout));
lib/libc/stdio/vfprintf.c
305
int ch; /* character from fmt */
lib/libc/stdio/vfprintf.c
475
for (cp = fmt; (ch = *fmt) != '\0' && ch != '%'; fmt++)
lib/libc/stdio/vfprintf.c
486
if (ch == '\0')
lib/libc/stdio/vfprintf.c
498
rflag: ch = *fmt++;
lib/libc/stdio/vfprintf.c
499
reswitch: switch (ch) {
lib/libc/stdio/vfprintf.c
534
if ((ch = *fmt++) == '*') {
lib/libc/stdio/vfprintf.c
539
while (is_digit(ch)) {
lib/libc/stdio/vfprintf.c
540
prec = 10 * prec + to_digit(ch);
lib/libc/stdio/vfprintf.c
541
ch = *fmt++;
lib/libc/stdio/vfprintf.c
556
n = 10 * n + to_digit(ch);
lib/libc/stdio/vfprintf.c
557
ch = *fmt++;
lib/libc/stdio/vfprintf.c
558
} while (is_digit(ch));
lib/libc/stdio/vfprintf.c
559
if (ch == '$') {
lib/libc/stdio/vfprintf.c
655
ox[1] = ch;
lib/libc/stdio/vfprintf.c
703
if (ch == 'a') {
lib/libc/stdio/vfprintf.c
734
expchar = ch;
lib/libc/stdio/vfprintf.c
746
expchar = ch - ('g' - 'e');
lib/libc/stdio/vfprintf.c
772
cp = (ch >= 'a') ? "nan" : "NAN";
lib/libc/stdio/vfprintf.c
775
cp = (ch >= 'a') ? "inf" : "INF";
lib/libc/stdio/vfprintf.c
782
if (ch == 'g' || ch == 'G') {
lib/libc/stdio/vfprintf.c
921
ox[1] = ch;
lib/libc/stdio/vfprintf.c
962
if (ch == '\0')
lib/libc/stdio/vfprintf.c
967
*cp = ch;
lib/libc/stdio/vfwprintf.c
1019
if (ch == '\0')
lib/libc/stdio/vfwprintf.c
1024
*cp = ch;
lib/libc/stdio/vfwprintf.c
383
wchar_t ch; /* character from fmt */
lib/libc/stdio/vfwprintf.c
544
for (cp = fmt; (ch = *fmt) != '\0' && ch != '%'; fmt++)
lib/libc/stdio/vfwprintf.c
555
if (ch == '\0')
lib/libc/stdio/vfwprintf.c
567
rflag: ch = *fmt++;
lib/libc/stdio/vfwprintf.c
568
reswitch: switch (ch) {
lib/libc/stdio/vfwprintf.c
603
if ((ch = *fmt++) == '*') {
lib/libc/stdio/vfwprintf.c
608
while (is_digit(ch)) {
lib/libc/stdio/vfwprintf.c
609
prec = 10 * prec + to_digit(ch);
lib/libc/stdio/vfwprintf.c
610
ch = *fmt++;
lib/libc/stdio/vfwprintf.c
625
n = 10 * n + to_digit(ch);
lib/libc/stdio/vfwprintf.c
626
ch = *fmt++;
lib/libc/stdio/vfwprintf.c
627
} while (is_digit(ch));
lib/libc/stdio/vfwprintf.c
628
if (ch == '$') {
lib/libc/stdio/vfwprintf.c
724
ox[1] = ch;
lib/libc/stdio/vfwprintf.c
760
if (ch == 'a') {
lib/libc/stdio/vfwprintf.c
794
expchar = ch;
lib/libc/stdio/vfwprintf.c
806
expchar = ch - ('g' - 'e');
lib/libc/stdio/vfwprintf.c
835
cp = (ch >= 'a') ? L"nan" : L"NAN";
lib/libc/stdio/vfwprintf.c
838
cp = (ch >= 'a') ? L"inf" : L"INF";
lib/libc/stdio/vfwprintf.c
844
if (ch == 'g' || ch == 'G') {
lib/libc/stdio/vfwprintf.c
978
ox[1] = ch;
lib/libc/stdio/xprintf.c
267
int ch;
lib/libc/stdio/xprintf.c
437
ch = printf_tbl[pi->spec].arginfo(
lib/libc/stdio/xprintf.c
439
if (ch > 0)
lib/libc/stdio/xprintf.c
441
if (ch > 1)
lib/libc/stdio/xprintf.c
443
nextarg += ch;
lib/libc/stdio/xprintf.c
453
for (ch = 1; ch < maxarg; ch++) {
lib/libc/stdio/xprintf.c
455
fprintf(stderr, "arg %d %x\n", ch, argt[ch]);
lib/libc/stdio/xprintf.c
457
switch(argt[ch]) {
lib/libc/stdio/xprintf.c
459
args[ch].intarg = (char)va_arg (ap, int);
lib/libc/stdio/xprintf.c
462
args[ch].intarg = va_arg (ap, int);
lib/libc/stdio/xprintf.c
465
args[ch].intarg = (short)va_arg (ap, int);
lib/libc/stdio/xprintf.c
468
args[ch].longarg = va_arg (ap, long);
lib/libc/stdio/xprintf.c
471
args[ch].intmaxarg = va_arg (ap, intmax_t);
lib/libc/stdio/xprintf.c
474
args[ch].intmaxarg = va_arg (ap, quad_t);
lib/libc/stdio/xprintf.c
477
args[ch].intmaxarg = va_arg (ap, long long);
lib/libc/stdio/xprintf.c
480
args[ch].intmaxarg = va_arg (ap, size_t);
lib/libc/stdio/xprintf.c
483
args[ch].intmaxarg = va_arg (ap, ptrdiff_t);
lib/libc/stdio/xprintf.c
486
args[ch].wintarg = va_arg (ap, wint_t);
lib/libc/stdio/xprintf.c
489
args[ch].pvoidarg = va_arg (ap, void *);
lib/libc/stdio/xprintf.c
492
args[ch].pchararg = va_arg (ap, char *);
lib/libc/stdio/xprintf.c
495
args[ch].pwchararg = va_arg (ap, wchar_t *);
lib/libc/stdio/xprintf.c
498
args[ch].doublearg = va_arg (ap, double);
lib/libc/stdio/xprintf.c
501
args[ch].longdoublearg = va_arg (ap, long double);
lib/libc/stdio/xprintf.c
505
argt[ch], fmt0);
lib/libc/stdlib/radixsort.c
294
u_char ch;
lib/libc/stdlib/radixsort.c
300
(ch = tr[*s]) != endch; s++, t++)
lib/libc/stdlib/radixsort.c
301
if (ch != tr[*t])
lib/libc/stdlib/radixsort.c
303
if (ch >= tr[*t])
lib/libc/stdlib/set_constraint_handler_s.c
71
constraint_handler_t ch;
lib/libc/stdlib/set_constraint_handler_s.c
75
ch = _ch != NULL ? *_ch : NULL;
lib/libc/stdlib/set_constraint_handler_s.c
78
if (ch != NULL)
lib/libc/stdlib/set_constraint_handler_s.c
79
ch(msg, NULL, error);
lib/libc/string/memset_explicit.c
13
__memset_explicit_hook(void *buf, int ch, size_t len)
lib/libc/string/memset_explicit.c
16
(void)ch;
lib/libc/string/memset_explicit.c
21
__ssp_real(memset_explicit)(void *buf, int ch, size_t len)
lib/libc/string/memset_explicit.c
23
memset(buf, ch, len);
lib/libc/string/memset_explicit.c
24
__memset_explicit_hook(buf, ch, len);
lib/libc/string/strrchr.c
36
strrchr(const char *p, int ch)
lib/libc/string/strrchr.c
41
c = ch;
lib/libdpv/dprompt.c
87
char ch;
lib/libdpv/dprompt.c
91
ch = *spin_cp;
lib/libdpv/dprompt.c
97
return (ch);
lib/libfetch/fetch.c
297
fetch_hexval(char ch)
lib/libfetch/fetch.c
300
if (ch >= '0' && ch <= '9')
lib/libfetch/fetch.c
301
return (ch - '0');
lib/libfetch/fetch.c
302
else if (ch >= 'a' && ch <= 'f')
lib/libfetch/fetch.c
303
return (ch - 'a' + 10);
lib/libfetch/fetch.c
304
else if (ch >= 'A' && ch <= 'F')
lib/libfetch/fetch.c
305
return (ch - 'A' + 10);
lib/libfetch/http.c
213
char ch;
lib/libfetch/http.c
259
if (fetch_read(io->conn, &ch, 1) != 1 || ch != '\r' ||
lib/libfetch/http.c
260
fetch_read(io->conn, &ch, 1) != 1 || ch != '\n')
lib/libiconv_modules/BIG5/citrus_big5.c
296
psenc->ch[0] = *s0++;
lib/libiconv_modules/BIG5/citrus_big5.c
307
c = _citrus_BIG5_check(ei, psenc->ch[0] & 0xff);
lib/libiconv_modules/BIG5/citrus_big5.c
314
psenc->ch[psenc->chlen] = *s0++;
lib/libiconv_modules/BIG5/citrus_big5.c
321
wchar = psenc->ch[0] & 0xff;
lib/libiconv_modules/BIG5/citrus_big5.c
324
if (!_citrus_BIG5_check2(ei, psenc->ch[1] & 0xff))
lib/libiconv_modules/BIG5/citrus_big5.c
326
wchar = ((psenc->ch[0] & 0xff) << 8) | (psenc->ch[1] & 0xff);
lib/libiconv_modules/BIG5/citrus_big5.c
91
char ch[2];
lib/libiconv_modules/DECHanyu/citrus_dechanyu.c
174
int ch;
lib/libiconv_modules/DECHanyu/citrus_dechanyu.c
188
ch = *s0++ & 0xFF;
lib/libiconv_modules/DECHanyu/citrus_dechanyu.c
189
if (is_singlebyte(ch)) {
lib/libiconv_modules/DECHanyu/citrus_dechanyu.c
191
*pwc = (wchar_t)ch;
lib/libiconv_modules/DECHanyu/citrus_dechanyu.c
192
*nresult = (size_t)((ch == 0) ? 0 : 1);
lib/libiconv_modules/DECHanyu/citrus_dechanyu.c
196
if (!is_leadbyte(ch))
lib/libiconv_modules/DECHanyu/citrus_dechanyu.c
198
psenc->ch[psenc->chlen++] = ch;
lib/libiconv_modules/DECHanyu/citrus_dechanyu.c
201
ch = psenc->ch[0] & 0xFF;
lib/libiconv_modules/DECHanyu/citrus_dechanyu.c
202
if (!is_leadbyte(ch))
lib/libiconv_modules/DECHanyu/citrus_dechanyu.c
206
ch = psenc->ch[0] & 0xFF;
lib/libiconv_modules/DECHanyu/citrus_dechanyu.c
207
if (is_hanyu1(ch)) {
lib/libiconv_modules/DECHanyu/citrus_dechanyu.c
208
ch = psenc->ch[1] & 0xFF;
lib/libiconv_modules/DECHanyu/citrus_dechanyu.c
209
if (is_hanyu2(ch)) {
lib/libiconv_modules/DECHanyu/citrus_dechanyu.c
221
if (is_hanyu1(ch)) {
lib/libiconv_modules/DECHanyu/citrus_dechanyu.c
224
ch = *s0++ & 0xFF;
lib/libiconv_modules/DECHanyu/citrus_dechanyu.c
225
if (!is_hanyu2(ch))
lib/libiconv_modules/DECHanyu/citrus_dechanyu.c
227
psenc->ch[psenc->chlen++] = ch;
lib/libiconv_modules/DECHanyu/citrus_dechanyu.c
231
ch = *s0++ & 0xFF;
lib/libiconv_modules/DECHanyu/citrus_dechanyu.c
232
if (!is_leadbyte(ch))
lib/libiconv_modules/DECHanyu/citrus_dechanyu.c
234
psenc->ch[psenc->chlen++] = ch;
lib/libiconv_modules/DECHanyu/citrus_dechanyu.c
240
ch = *s0++ & 0xFF;
lib/libiconv_modules/DECHanyu/citrus_dechanyu.c
241
if (!is_leadbyte(ch))
lib/libiconv_modules/DECHanyu/citrus_dechanyu.c
243
psenc->ch[psenc->chlen++] = ch;
lib/libiconv_modules/DECHanyu/citrus_dechanyu.c
246
ch = psenc->ch[2] & 0xFF;
lib/libiconv_modules/DECHanyu/citrus_dechanyu.c
247
if (!is_leadbyte(ch))
lib/libiconv_modules/DECHanyu/citrus_dechanyu.c
252
wc |= (wchar_t)(ch << 8);
lib/libiconv_modules/DECHanyu/citrus_dechanyu.c
253
ch = *s0++ & 0xFF;
lib/libiconv_modules/DECHanyu/citrus_dechanyu.c
254
if (!is_trailbyte(ch))
lib/libiconv_modules/DECHanyu/citrus_dechanyu.c
256
wc |= (wchar_t)ch;
lib/libiconv_modules/DECHanyu/citrus_dechanyu.c
281
int ch;
lib/libiconv_modules/DECHanyu/citrus_dechanyu.c
288
ch = wc & 0xFF;
lib/libiconv_modules/DECHanyu/citrus_dechanyu.c
293
psenc->ch[psenc->chlen++] = (wc >> 24) & 0xFF;
lib/libiconv_modules/DECHanyu/citrus_dechanyu.c
294
psenc->ch[psenc->chlen++] = (wc >> 16) & 0xFF;
lib/libiconv_modules/DECHanyu/citrus_dechanyu.c
297
ch = (wc >> 8) & 0xFF;
lib/libiconv_modules/DECHanyu/citrus_dechanyu.c
298
if (!is_leadbyte(ch))
lib/libiconv_modules/DECHanyu/citrus_dechanyu.c
300
psenc->ch[psenc->chlen++] = ch;
lib/libiconv_modules/DECHanyu/citrus_dechanyu.c
301
ch = wc & 0xFF;
lib/libiconv_modules/DECHanyu/citrus_dechanyu.c
302
if (!is_trailbyte(ch))
lib/libiconv_modules/DECHanyu/citrus_dechanyu.c
305
psenc->ch[psenc->chlen++] = ch;
lib/libiconv_modules/DECHanyu/citrus_dechanyu.c
310
memcpy(s, psenc->ch, psenc->chlen);
lib/libiconv_modules/DECHanyu/citrus_dechanyu.c
56
char ch[4];
lib/libiconv_modules/EUC/citrus_euc.c
215
psenc->ch[0] = *s0++;
lib/libiconv_modules/EUC/citrus_euc.c
227
c = ei->count[cs = _citrus_EUC_cs(psenc->ch[0] & 0xff)];
lib/libiconv_modules/EUC/citrus_euc.c
233
psenc->ch[psenc->chlen] = *s0++;
lib/libiconv_modules/EUC/citrus_euc.c
244
s1 = &psenc->ch[1];
lib/libiconv_modules/EUC/citrus_euc.c
249
s1 = &psenc->ch[0];
lib/libiconv_modules/EUC/citrus_euc.c
88
char ch[3];
lib/libiconv_modules/EUCTW/citrus_euctw.c
201
psenc->ch[0] = *s0++;
lib/libiconv_modules/EUCTW/citrus_euctw.c
213
c = _citrus_EUCTW_count(cs = _citrus_EUCTW_cs(psenc->ch[0] & 0xff));
lib/libiconv_modules/EUCTW/citrus_euctw.c
219
psenc->ch[psenc->chlen] = *s0++;
lib/libiconv_modules/EUCTW/citrus_euctw.c
227
if (psenc->ch[0] & 0x80)
lib/libiconv_modules/EUCTW/citrus_euctw.c
229
wchar = psenc->ch[0] & 0xff;
lib/libiconv_modules/EUCTW/citrus_euctw.c
232
if (!(psenc->ch[0] & 0x80) || !(psenc->ch[1] & 0x80))
lib/libiconv_modules/EUCTW/citrus_euctw.c
234
wchar = ((psenc->ch[0] & 0xff) << 8) | (psenc->ch[1] & 0xff);
lib/libiconv_modules/EUCTW/citrus_euctw.c
238
if ((unsigned char)psenc->ch[1] < 0xa1 ||
lib/libiconv_modules/EUCTW/citrus_euctw.c
239
0xa7 < (unsigned char)psenc->ch[1])
lib/libiconv_modules/EUCTW/citrus_euctw.c
241
if (!(psenc->ch[2] & 0x80) || !(psenc->ch[3] & 0x80))
lib/libiconv_modules/EUCTW/citrus_euctw.c
243
wchar = ((psenc->ch[2] & 0xff) << 8) | (psenc->ch[3] & 0xff);
lib/libiconv_modules/EUCTW/citrus_euctw.c
244
wchar |= ('G' + psenc->ch[1] - 0xa1) << 24;
lib/libiconv_modules/EUCTW/citrus_euctw.c
83
char ch[4];
lib/libiconv_modules/GBK2K/citrus_gbk2k.c
147
#define _PSENC (psenc->ch[psenc->chlen - 1])
lib/libiconv_modules/GBK2K/citrus_gbk2k.c
148
#define _PUSH_PSENC(c) (psenc->ch[psenc->chlen++] = (c))
lib/libiconv_modules/GBK2K/citrus_gbk2k.c
222
s1 = &psenc->ch[0];
lib/libiconv_modules/GBK2K/citrus_gbk2k.c
295
memcpy(s, psenc->ch, psenc->chlen);
lib/libiconv_modules/GBK2K/citrus_gbk2k.c
312
uint8_t ch, cl;
lib/libiconv_modules/GBK2K/citrus_gbk2k.c
323
ch = (uint8_t)(wc >> 8);
lib/libiconv_modules/GBK2K/citrus_gbk2k.c
325
if (ch >= 0xA1 && cl >= 0xA1) {
lib/libiconv_modules/GBK2K/citrus_gbk2k.c
57
char ch[4];
lib/libiconv_modules/HZ/citrus_hz.c
104
#define ESC(escape) ((escape)->ch)
lib/libiconv_modules/HZ/citrus_hz.c
108
find_escape(escape_list *set, int ch)
lib/libiconv_modules/HZ/citrus_hz.c
113
if (ESC(escape) == ch)
lib/libiconv_modules/HZ/citrus_hz.c
135
char ch[ROWCOL_MAX];
lib/libiconv_modules/HZ/citrus_hz.c
187
int bit, ch, head, len, tail;
lib/libiconv_modules/HZ/citrus_hz.c
208
psenc->ch[psenc->chlen++] = *s0++;
lib/libiconv_modules/HZ/citrus_hz.c
211
ch = (unsigned char)psenc->ch[tail++];
lib/libiconv_modules/HZ/citrus_hz.c
213
if ((ch & ~0x80) <= 0x1F) {
lib/libiconv_modules/HZ/citrus_hz.c
216
wc = (wchar_t)ch;
lib/libiconv_modules/HZ/citrus_hz.c
219
if (ch & 0x80) {
lib/libiconv_modules/HZ/citrus_hz.c
222
ch &= ~0x80;
lib/libiconv_modules/HZ/citrus_hz.c
225
if (ch == ESCAPE_CHAR)
lib/libiconv_modules/HZ/citrus_hz.c
231
} else if (tail == 2 && psenc->ch[0] == ESCAPE_CHAR) {
lib/libiconv_modules/HZ/citrus_hz.c
234
if (ch == ESCAPE_CHAR) {
lib/libiconv_modules/HZ/citrus_hz.c
236
} else if (ch == '\n') {
lib/libiconv_modules/HZ/citrus_hz.c
247
if (ESC(init) != ch)
lib/libiconv_modules/HZ/citrus_hz.c
253
SET(psenc->inuse), ch);
lib/libiconv_modules/HZ/citrus_hz.c
256
ESC(init) != ch)
lib/libiconv_modules/HZ/citrus_hz.c
265
} else if (ch & 0x80) {
lib/libiconv_modules/HZ/citrus_hz.c
268
ch &= ~0x80;
lib/libiconv_modules/HZ/citrus_hz.c
274
if (range->start > ch || range->end < ch)
lib/libiconv_modules/HZ/citrus_hz.c
277
wc |= ch;
lib/libiconv_modules/HZ/citrus_hz.c
308
int bit, ch;
lib/libiconv_modules/HZ/citrus_hz.c
340
ch = (wc >> 24) & 0xFF;
lib/libiconv_modules/HZ/citrus_hz.c
341
candidate = find_escape(E0SET(ei), ch);
lib/libiconv_modules/HZ/citrus_hz.c
343
candidate = find_escape(E1SET(ei), ch);
lib/libiconv_modules/HZ/citrus_hz.c
367
psenc->ch[psenc->chlen++] = ESCAPE_CHAR;
lib/libiconv_modules/HZ/citrus_hz.c
368
psenc->ch[psenc->chlen++] = ESC(init);
lib/libiconv_modules/HZ/citrus_hz.c
373
psenc->ch[psenc->chlen++] = ESCAPE_CHAR;
lib/libiconv_modules/HZ/citrus_hz.c
374
psenc->ch[psenc->chlen++] = ESC(candidate);
lib/libiconv_modules/HZ/citrus_hz.c
380
ch = (wc >> (len * 8)) & 0xFF;
lib/libiconv_modules/HZ/citrus_hz.c
381
if (range->start > ch || range->end < ch)
lib/libiconv_modules/HZ/citrus_hz.c
383
psenc->ch[psenc->chlen++] = ch | bit;
lib/libiconv_modules/HZ/citrus_hz.c
385
memcpy(s, psenc->ch, psenc->chlen);
lib/libiconv_modules/HZ/citrus_hz.c
410
psenc->ch[psenc->chlen++] = ESCAPE_CHAR;
lib/libiconv_modules/HZ/citrus_hz.c
411
psenc->ch[psenc->chlen++] = ESC(candidate);
lib/libiconv_modules/HZ/citrus_hz.c
416
memcpy(s, psenc->ch, psenc->chlen);
lib/libiconv_modules/HZ/citrus_hz.c
434
: ((psenc->ch[0] == ESCAPE_CHAR)
lib/libiconv_modules/HZ/citrus_hz.c
516
if (escape->ch != '\0')
lib/libiconv_modules/HZ/citrus_hz.c
518
escape->ch = *s++;
lib/libiconv_modules/HZ/citrus_hz.c
519
if (escape->ch == ESCAPE_CHAR || *s != '\0')
lib/libiconv_modules/HZ/citrus_hz.c
98
int ch;
lib/libiconv_modules/ISO2022/citrus_iso2022.c
1279
*rstate = (psenc->ch[0] == '\033') ?
lib/libiconv_modules/ISO2022/citrus_iso2022.c
866
if (psenc->chlen > sizeof(psenc->ch)) {
lib/libiconv_modules/ISO2022/citrus_iso2022.c
875
p = psenc->ch;
lib/libiconv_modules/ISO2022/citrus_iso2022.c
876
while (psenc->chlen < sizeof(psenc->ch)) {
lib/libiconv_modules/ISO2022/citrus_iso2022.c
878
psenc->ch[psenc->chlen++] = *s0++;
lib/libiconv_modules/ISO2022/citrus_iso2022.c
882
wchar = _ISO2022_sgetwchar(ei, p, psenc->chlen - (p-psenc->ch),
lib/libiconv_modules/ISO2022/citrus_iso2022.c
887
memmove(psenc->ch, result, psenc->chlen - c);
lib/libiconv_modules/ISO2022/citrus_iso2022.c
926
if (n < sizeof(psenc->ch)) {
lib/libiconv_modules/ISO2022/citrus_iso2022.c
927
memcpy(psenc->ch, s0 - c, n);
lib/libiconv_modules/ISO2022/citrus_iso2022.c
97
char ch[7]; /* longest escape sequence (ESC & V ESC $ ( F) */
lib/libiconv_modules/JOHAB/citrus_johab.c
174
psenc->ch[psenc->chlen++] = l;
lib/libiconv_modules/JOHAB/citrus_johab.c
177
l = psenc->ch[0] & 0xFF;
lib/libiconv_modules/JOHAB/citrus_johab.c
57
char ch[2];
lib/libiconv_modules/MSKanji/citrus_mskanji.c
177
psenc->ch[0] = *s0++;
lib/libiconv_modules/MSKanji/citrus_mskanji.c
188
len = _mskanji1(psenc->ch[0] & 0xff) ? 2 : 1;
lib/libiconv_modules/MSKanji/citrus_mskanji.c
192
psenc->ch[psenc->chlen] = *s0++;
lib/libiconv_modules/MSKanji/citrus_mskanji.c
201
wchar = psenc->ch[0] & 0xff;
lib/libiconv_modules/MSKanji/citrus_mskanji.c
204
if (!_mskanji2(psenc->ch[1] & 0xff))
lib/libiconv_modules/MSKanji/citrus_mskanji.c
206
wchar = ((psenc->ch[0] & 0xff) << 8) | (psenc->ch[1] & 0xff);
lib/libiconv_modules/MSKanji/citrus_mskanji.c
90
char ch[2];
lib/libiconv_modules/UES/citrus_ues.c
100
to_int(int ch)
lib/libiconv_modules/UES/citrus_ues.c
103
if (ch >= '0' && ch <= '9')
lib/libiconv_modules/UES/citrus_ues.c
104
return (ch - '0');
lib/libiconv_modules/UES/citrus_ues.c
105
else if (ch >= 'A' && ch <= 'F')
lib/libiconv_modules/UES/citrus_ues.c
106
return ((ch - 'A') + 10);
lib/libiconv_modules/UES/citrus_ues.c
107
else if (ch >= 'a' && ch <= 'f')
lib/libiconv_modules/UES/citrus_ues.c
108
return ((ch - 'a') + 10);
lib/libiconv_modules/UES/citrus_ues.c
193
int ch, head, num, tail;
lib/libiconv_modules/UES/citrus_ues.c
212
psenc->ch[psenc->chlen++] = *s0++;
lib/libiconv_modules/UES/citrus_ues.c
214
ch = (unsigned char)psenc->ch[head++];
lib/libiconv_modules/UES/citrus_ues.c
215
if (ch == ESCAPE) {
lib/libiconv_modules/UES/citrus_ues.c
219
psenc->ch[psenc->chlen++] = *s0++;
lib/libiconv_modules/UES/citrus_ues.c
221
switch (psenc->ch[head]) {
lib/libiconv_modules/UES/citrus_ues.c
244
psenc->ch[psenc->chlen++] = *s0++;
lib/libiconv_modules/UES/citrus_ues.c
246
num = to_int((int)(unsigned char)psenc->ch[head]);
lib/libiconv_modules/UES/citrus_ues.c
283
ch = (unsigned char)psenc->ch[0];
lib/libiconv_modules/UES/citrus_ues.c
286
memmove(&psenc->ch[0], &psenc->ch[1], head);
lib/libiconv_modules/UES/citrus_ues.c
287
wc = (wchar_t)ch;
lib/libiconv_modules/UES/citrus_ues.c
311
psenc->ch[psenc->chlen++] = (char)wc;
lib/libiconv_modules/UES/citrus_ues.c
315
psenc->chlen = to_str(&psenc->ch[0], wc, UCS2_BIT);
lib/libiconv_modules/UES/citrus_ues.c
320
psenc->chlen += to_str(&psenc->ch[0], hi, UCS2_BIT);
lib/libiconv_modules/UES/citrus_ues.c
321
psenc->chlen += to_str(&psenc->ch[6], lo, UCS2_BIT);
lib/libiconv_modules/UES/citrus_ues.c
325
psenc->chlen = to_str(&psenc->ch[0], wc, UCS4_BIT);
lib/libiconv_modules/UES/citrus_ues.c
330
memcpy(s, psenc->ch, psenc->chlen);
lib/libiconv_modules/UES/citrus_ues.c
57
char ch[12];
lib/libiconv_modules/UTF1632/citrus_utf1632.c
127
psenc->ch[chlenbak++] = *s0++;
lib/libiconv_modules/UTF1632/citrus_utf1632.c
135
if (psenc->ch[0] == 0xFE && psenc->ch[1] == 0xFF) {
lib/libiconv_modules/UTF1632/citrus_utf1632.c
139
} else if (psenc->ch[0] == 0xFF && psenc->ch[1] == 0xFE) {
lib/libiconv_modules/UTF1632/citrus_utf1632.c
146
if (psenc->ch[0] == 0x00 && psenc->ch[1] == 0x00 &&
lib/libiconv_modules/UTF1632/citrus_utf1632.c
147
psenc->ch[2] == 0xFE && psenc->ch[3] == 0xFF) {
lib/libiconv_modules/UTF1632/citrus_utf1632.c
151
} else if (psenc->ch[0] == 0xFF && psenc->ch[1] == 0xFE &&
lib/libiconv_modules/UTF1632/citrus_utf1632.c
152
psenc->ch[2] == 0x00 && psenc->ch[3] == 0x00) {
lib/libiconv_modules/UTF1632/citrus_utf1632.c
168
wc = (psenc->ch[0] |
lib/libiconv_modules/UTF1632/citrus_utf1632.c
169
((wchar_t)psenc->ch[1] << 8));
lib/libiconv_modules/UTF1632/citrus_utf1632.c
172
wc = (psenc->ch[1] |
lib/libiconv_modules/UTF1632/citrus_utf1632.c
173
((wchar_t)psenc->ch[0] << 8));
lib/libiconv_modules/UTF1632/citrus_utf1632.c
189
if (psenc->ch[3] < 0xDC || psenc->ch[3] > 0xDF)
lib/libiconv_modules/UTF1632/citrus_utf1632.c
191
wc |= psenc->ch[2];
lib/libiconv_modules/UTF1632/citrus_utf1632.c
192
wc |= (wchar_t)(psenc->ch[3] & 3) << 8;
lib/libiconv_modules/UTF1632/citrus_utf1632.c
195
if (psenc->ch[2]<0xDC || psenc->ch[2]>0xDF)
lib/libiconv_modules/UTF1632/citrus_utf1632.c
197
wc |= psenc->ch[3];
lib/libiconv_modules/UTF1632/citrus_utf1632.c
198
wc |= (wchar_t)(psenc->ch[2] & 3) << 8;
lib/libiconv_modules/UTF1632/citrus_utf1632.c
209
wc = (psenc->ch[0] |
lib/libiconv_modules/UTF1632/citrus_utf1632.c
210
((wchar_t)psenc->ch[1] << 8) |
lib/libiconv_modules/UTF1632/citrus_utf1632.c
211
((wchar_t)psenc->ch[2] << 16) |
lib/libiconv_modules/UTF1632/citrus_utf1632.c
212
((wchar_t)psenc->ch[3] << 24));
lib/libiconv_modules/UTF1632/citrus_utf1632.c
215
wc = (psenc->ch[3] |
lib/libiconv_modules/UTF1632/citrus_utf1632.c
216
((wchar_t)psenc->ch[2] << 8) |
lib/libiconv_modules/UTF1632/citrus_utf1632.c
217
((wchar_t)psenc->ch[1] << 16) |
lib/libiconv_modules/UTF1632/citrus_utf1632.c
218
((wchar_t)psenc->ch[0] << 24));
lib/libiconv_modules/UTF1632/citrus_utf1632.c
60
uint8_t ch[4];
lib/libiconv_modules/UTF7/citrus_utf7.c
170
psenc->ch[psenc->chlen++] = *s0++;
lib/libiconv_modules/UTF7/citrus_utf7.c
172
if (SHIFT7BIT((int)psenc->ch[i]))
lib/libiconv_modules/UTF7/citrus_utf7.c
177
if (psenc->ch[i] == BASE64_IN)
lib/libiconv_modules/UTF7/citrus_utf7.c
180
if (!ISDIRECT(ei, (int)psenc->ch[i]))
lib/libiconv_modules/UTF7/citrus_utf7.c
182
*u16 = (uint16_t)psenc->ch[i];
lib/libiconv_modules/UTF7/citrus_utf7.c
187
if (psenc->ch[i] == BASE64_OUT && psenc->cache == 0) {
lib/libiconv_modules/UTF7/citrus_utf7.c
193
len = FINDLEN(ei, (int)psenc->ch[i]);
lib/libiconv_modules/UTF7/citrus_utf7.c
199
if (psenc->ch[i] != BASE64_OUT) {
lib/libiconv_modules/UTF7/citrus_utf7.c
200
if (!ISDIRECT(ei, (int)psenc->ch[i]))
lib/libiconv_modules/UTF7/citrus_utf7.c
202
*u16 = (uint16_t)psenc->ch[i];
lib/libiconv_modules/UTF7/citrus_utf7.c
312
psenc->ch[psenc->chlen++] = base64[i];
lib/libiconv_modules/UTF7/citrus_utf7.c
316
psenc->ch[psenc->chlen++] = BASE64_OUT;
lib/libiconv_modules/UTF7/citrus_utf7.c
321
psenc->ch[psenc->chlen++] = (char)u16;
lib/libiconv_modules/UTF7/citrus_utf7.c
323
psenc->ch[psenc->chlen++] = BASE64_OUT;
lib/libiconv_modules/UTF7/citrus_utf7.c
328
psenc->ch[psenc->chlen++] = BASE64_IN;
lib/libiconv_modules/UTF7/citrus_utf7.c
336
psenc->ch[psenc->chlen++] = base64[i];
lib/libiconv_modules/UTF7/citrus_utf7.c
339
memcpy(s, psenc->ch, psenc->chlen);
lib/libiconv_modules/UTF7/citrus_utf7.c
400
psenc->ch[psenc->chlen++] = base64[pos];
lib/libiconv_modules/UTF7/citrus_utf7.c
401
psenc->ch[psenc->chlen++] = BASE64_OUT;
lib/libiconv_modules/UTF7/citrus_utf7.c
413
memcpy(s, psenc->ch, psenc->chlen);
lib/libiconv_modules/UTF7/citrus_utf7.c
68
char ch[4]; /* BASE64_IN, 3 * 6 = 18, most closed to UTF16_BIT */
lib/libiconv_modules/UTF8/citrus_utf8.c
115
char ch[6];
lib/libiconv_modules/UTF8/citrus_utf8.c
200
psenc->ch[psenc->chlen++] = *s0++;
lib/libiconv_modules/UTF8/citrus_utf8.c
203
c = _UTF8_count[psenc->ch[0] & 0xff];
lib/libiconv_modules/UTF8/citrus_utf8.c
208
wchar = psenc->ch[0] & 0xff;
lib/libiconv_modules/UTF8/citrus_utf8.c
213
psenc->ch[psenc->chlen++] = *s0++;
lib/libiconv_modules/UTF8/citrus_utf8.c
215
wchar = psenc->ch[0] & (0x7f >> c);
lib/libiconv_modules/UTF8/citrus_utf8.c
217
if ((psenc->ch[i] & 0xc0) != 0x80)
lib/libiconv_modules/UTF8/citrus_utf8.c
220
wchar |= (psenc->ch[i] & 0x3f);
lib/libiconv_modules/VIQR/citrus_viqr.c
131
mnemonic_list_find(mnemonic_list_t *ml, int ch)
lib/libiconv_modules/VIQR/citrus_viqr.c
136
if (m->ascii == ch)
lib/libiconv_modules/VIQR/citrus_viqr.c
164
int ch;
lib/libiconv_modules/VIQR/citrus_viqr.c
166
ch = (unsigned char)*s++;
lib/libiconv_modules/VIQR/citrus_viqr.c
167
if (ch == '\0')
lib/libiconv_modules/VIQR/citrus_viqr.c
169
m0 = mnemonic_list_find(&m->child, ch);
lib/libiconv_modules/VIQR/citrus_viqr.c
171
m0 = mnemonic_create(m, ch, (wchar_t)ch);
lib/libiconv_modules/VIQR/citrus_viqr.c
177
for (m0 = NULL; (ch = (unsigned char)*s) != '\0'; ++s) {
lib/libiconv_modules/VIQR/citrus_viqr.c
178
m0 = mnemonic_list_find(&m->child, ch);
lib/libiconv_modules/VIQR/citrus_viqr.c
180
m0 = mnemonic_create(m, ch, invalid);
lib/libiconv_modules/VIQR/citrus_viqr.c
212
char ch[MB_LEN_MAX];
lib/libiconv_modules/VIQR/citrus_viqr.c
263
int ch, escape;
lib/libiconv_modules/VIQR/citrus_viqr.c
281
psenc->ch[psenc->chlen++] = *s0++;
lib/libiconv_modules/VIQR/citrus_viqr.c
283
ch = (unsigned char)psenc->ch[i++];
lib/libiconv_modules/VIQR/citrus_viqr.c
284
if (ch == ESCAPE) {
lib/libiconv_modules/VIQR/citrus_viqr.c
292
m0 = mnemonic_list_find(&m->child, ch);
lib/libiconv_modules/VIQR/citrus_viqr.c
303
if (ch == ESCAPE && m != ei->mroot)
lib/libiconv_modules/VIQR/citrus_viqr.c
306
memmove(&psenc->ch[0], &psenc->ch[i], psenc->chlen);
lib/libiconv_modules/VIQR/citrus_viqr.c
307
wc = (m == ei->mroot) ? (wchar_t)ch : m->value;
lib/libiconv_modules/VIQR/citrus_viqr.c
323
int ch = 0;
lib/libiconv_modules/VIQR/citrus_viqr.c
338
ch = (unsigned int)wc;
lib/libiconv_modules/VIQR/citrus_viqr.c
341
m = mnemonic_list_find(&m->child, psenc->ch[0]);
lib/libiconv_modules/VIQR/citrus_viqr.c
344
psenc->ch[0] = ESCAPE;
lib/libiconv_modules/VIQR/citrus_viqr.c
346
if (mnemonic_list_find(&m->child, ch) == NULL) {
lib/libiconv_modules/VIQR/citrus_viqr.c
350
psenc->ch[psenc->chlen++] = ch;
lib/libiconv_modules/VIQR/citrus_viqr.c
362
psenc->ch[psenc->chlen++] = *p++;
lib/libiconv_modules/VIQR/citrus_viqr.c
366
memcpy(s, psenc->ch, psenc->chlen);
lib/libiconv_modules/VIQR/citrus_viqr.c
369
psenc->ch[0] = ch;
lib/libiconv_modules/ZW/citrus_zw.c
115
int ch, len;
lib/libiconv_modules/ZW/citrus_zw.c
132
ch = (unsigned char)*s0++; \
lib/libiconv_modules/ZW/citrus_zw.c
133
if (len++ > MB_LEN_MAX || ch > 0x7F)\
lib/libiconv_modules/ZW/citrus_zw.c
135
psenc->ch[psenc->chlen++] = ch; \
lib/libiconv_modules/ZW/citrus_zw.c
144
switch (psenc->ch[0]) {
lib/libiconv_modules/ZW/citrus_zw.c
154
ch = (unsigned char)psenc->ch[0];
lib/libiconv_modules/ZW/citrus_zw.c
155
if (ch > 0x7F)
lib/libiconv_modules/ZW/citrus_zw.c
157
wc = (wchar_t)ch;
lib/libiconv_modules/ZW/citrus_zw.c
164
ch = (unsigned char)psenc->ch[0];
lib/libiconv_modules/ZW/citrus_zw.c
165
if (ch != 'z') {
lib/libiconv_modules/ZW/citrus_zw.c
166
if (ch != '\n' && ch != '\0')
lib/libiconv_modules/ZW/citrus_zw.c
168
wc = (wchar_t)ch;
lib/libiconv_modules/ZW/citrus_zw.c
179
if (psenc->ch[0] != 'W') {
lib/libiconv_modules/ZW/citrus_zw.c
191
ch = (unsigned char)psenc->ch[0];
lib/libiconv_modules/ZW/citrus_zw.c
192
if (ch == '\0') {
lib/libiconv_modules/ZW/citrus_zw.c
194
wc = (wchar_t)ch;
lib/libiconv_modules/ZW/citrus_zw.c
197
} else if (ch == '\n') {
lib/libiconv_modules/ZW/citrus_zw.c
205
if (psenc->ch[0] == ' ') {
lib/libiconv_modules/ZW/citrus_zw.c
206
ch = (unsigned char)psenc->ch[1];
lib/libiconv_modules/ZW/citrus_zw.c
207
wc = (wchar_t)ch;
lib/libiconv_modules/ZW/citrus_zw.c
210
} else if (psenc->ch[0] == '#') {
lib/libiconv_modules/ZW/citrus_zw.c
211
ch = (unsigned char)psenc->ch[1];
lib/libiconv_modules/ZW/citrus_zw.c
212
if (ch == '\n') {
lib/libiconv_modules/ZW/citrus_zw.c
214
wc = (wchar_t)ch;
lib/libiconv_modules/ZW/citrus_zw.c
217
} else if (ch == ' ') {
lib/libiconv_modules/ZW/citrus_zw.c
218
wc = (wchar_t)ch;
lib/libiconv_modules/ZW/citrus_zw.c
223
ch = (unsigned char)psenc->ch[0];
lib/libiconv_modules/ZW/citrus_zw.c
224
if (ch < 0x21 || ch > 0x7E)
lib/libiconv_modules/ZW/citrus_zw.c
226
wc = (wchar_t)(ch << 8);
lib/libiconv_modules/ZW/citrus_zw.c
227
ch = (unsigned char)psenc->ch[1];
lib/libiconv_modules/ZW/citrus_zw.c
228
if (ch < 0x21 || ch > 0x7E) {
lib/libiconv_modules/ZW/citrus_zw.c
233
wc |= (wchar_t)ch;
lib/libiconv_modules/ZW/citrus_zw.c
258
int ch;
lib/libiconv_modules/ZW/citrus_zw.c
263
ch = (unsigned char)wc;
lib/libiconv_modules/ZW/citrus_zw.c
266
if (ch == '\0' || ch == '\n')
lib/libiconv_modules/ZW/citrus_zw.c
267
psenc->ch[psenc->chlen++] = ch;
lib/libiconv_modules/ZW/citrus_zw.c
272
psenc->ch[psenc->chlen++] = 'z';
lib/libiconv_modules/ZW/citrus_zw.c
273
psenc->ch[psenc->chlen++] = 'W';
lib/libiconv_modules/ZW/citrus_zw.c
274
psenc->ch[psenc->chlen++] = ' ';
lib/libiconv_modules/ZW/citrus_zw.c
275
psenc->ch[psenc->chlen++] = ch;
lib/libiconv_modules/ZW/citrus_zw.c
283
if (ch == '\0') {
lib/libiconv_modules/ZW/citrus_zw.c
284
psenc->ch[psenc->chlen++] = '\n';
lib/libiconv_modules/ZW/citrus_zw.c
285
psenc->ch[psenc->chlen++] = '\0';
lib/libiconv_modules/ZW/citrus_zw.c
287
} else if (ch == '\n') {
lib/libiconv_modules/ZW/citrus_zw.c
288
psenc->ch[psenc->chlen++] = '#';
lib/libiconv_modules/ZW/citrus_zw.c
289
psenc->ch[psenc->chlen++] = '\n';
lib/libiconv_modules/ZW/citrus_zw.c
292
psenc->ch[psenc->chlen++] = ' ';
lib/libiconv_modules/ZW/citrus_zw.c
293
psenc->ch[psenc->chlen++] = ch;
lib/libiconv_modules/ZW/citrus_zw.c
305
psenc->ch[psenc->chlen++] = 'z';
lib/libiconv_modules/ZW/citrus_zw.c
306
psenc->ch[psenc->chlen++] = 'W';
lib/libiconv_modules/ZW/citrus_zw.c
313
ch = (wc >> 8) & 0xFF;
lib/libiconv_modules/ZW/citrus_zw.c
314
if (ch < 0x21 || ch > 0x7E)
lib/libiconv_modules/ZW/citrus_zw.c
316
psenc->ch[psenc->chlen++] = ch;
lib/libiconv_modules/ZW/citrus_zw.c
317
ch = wc & 0xFF;
lib/libiconv_modules/ZW/citrus_zw.c
318
if (ch < 0x21 || ch > 0x7E)
lib/libiconv_modules/ZW/citrus_zw.c
320
psenc->ch[psenc->chlen++] = ch;
lib/libiconv_modules/ZW/citrus_zw.c
330
memcpy(s, psenc->ch, psenc->chlen);
lib/libiconv_modules/ZW/citrus_zw.c
350
psenc->ch[psenc->chlen++] = '\n';
lib/libiconv_modules/ZW/citrus_zw.c
356
memcpy(s, psenc->ch, psenc->chlen);
lib/libiconv_modules/ZW/citrus_zw.c
391
*rstate = (psenc->ch[0] == '#') ?
lib/libiconv_modules/ZW/citrus_zw.c
65
char ch[4];
lib/libipsec/ipsec_dump_policy.c
257
int ch;
lib/libipsec/ipsec_dump_policy.c
260
ch = '#';
lib/libipsec/ipsec_dump_policy.c
262
ch = ':';
lib/libipsec/ipsec_dump_policy.c
264
ch, xisr->sadb_x_ipsecrequest_reqid);
lib/libiscsiutil/chap.c
207
unsigned char *hex, *tmp, ch;
lib/libiscsiutil/chap.c
219
ch = bin[i];
lib/libiscsiutil/chap.c
220
tmp += sprintf(tmp, "%02x", ch);
lib/libnvmf/nvmf_tcp.c
228
const struct nvme_tcp_common_pdu_hdr *ch;
lib/libnvmf/nvmf_tcp.c
236
ch = pdu->hdr;
lib/libnvmf/nvmf_tcp.c
237
hlen = ch->hlen;
lib/libnvmf/nvmf_tcp.c
238
plen = le32toh(ch->plen);
lib/libnvmf/nvmf_tcp.c
239
if (hlen < sizeof(*ch) || hlen > plen)
lib/libnvmf/nvmf_tcp.c
240
hlen = sizeof(*ch);
lib/libnvmf/nvmf_tcp.c
242
error = nvmf_tcp_validate_pdu_header(ch,
lib/libnvmf/nvmf_tcp.c
251
fes, fei, ch, pdu_len, hlen);
lib/libnvmf/nvmf_tcp.c
257
if ((ch->flags & NVME_TCP_CH_FLAGS_HDGSTF) != 0) {
lib/libnvmf/nvmf_tcp.c
258
digest = compute_digest(ch, ch->hlen);
lib/libnvmf/nvmf_tcp.c
259
memcpy(&rx_digest, (const char *)ch + ch->hlen,
lib/libnvmf/nvmf_tcp.c
264
NVME_TCP_TERM_REQ_FES_HDGST_ERROR, rx_digest, ch,
lib/libnvmf/nvmf_tcp.c
271
if ((ch->flags & NVME_TCP_CH_FLAGS_DDGSTF) != 0) {
lib/libnvmf/nvmf_tcp.c
272
digest = compute_digest((const char *)ch + ch->pdo, data_len);
lib/libnvmf/nvmf_tcp.c
273
memcpy(&rx_digest, (const char *)ch + plen - sizeof(rx_digest),
lib/libnvmf/nvmf_tcp.c
311
struct nvme_tcp_common_pdu_hdr ch;
lib/libnvmf/nvmf_tcp.c
316
error = nvmf_tcp_read_buffer(qp->s, &ch, sizeof(ch));
lib/libnvmf/nvmf_tcp.c
320
plen = le32toh(ch.plen);
lib/libnvmf/nvmf_tcp.c
326
if (plen < sizeof(ch) || ch.hlen > plen) {
lib/libnvmf/nvmf_tcp.c
327
pdu->hdr = &ch;
lib/libnvmf/nvmf_tcp.c
328
error = nvmf_tcp_validate_pdu(qp, pdu, sizeof(ch));
lib/libnvmf/nvmf_tcp.c
336
memcpy(pdu->hdr, &ch, sizeof(ch));
lib/libnvmf/nvmf_tcp.c
337
error = nvmf_tcp_read_buffer(qp->s, pdu->hdr + 1, plen - sizeof(ch));
lib/libnvmf/nvmf_tcp.c
428
struct nvme_tcp_common_pdu_hdr *ch;
lib/libnvmf/nvmf_tcp.c
448
ch = hdr;
lib/libnvmf/nvmf_tcp.c
449
ch->hlen = hlen;
lib/libnvmf/nvmf_tcp.c
451
ch->flags |= NVME_TCP_CH_FLAGS_HDGSTF;
lib/libnvmf/nvmf_tcp.c
453
ch->flags |= NVME_TCP_CH_FLAGS_DDGSTF;
lib/libnvmf/nvmf_tcp.c
454
ch->pdo = pdo;
lib/libnvmf/nvmf_tcp.c
455
ch->plen = htole32(plen);
lib/libnvmf/nvmf_tcp.c
788
const struct nvme_tcp_common_pdu_hdr *ch, size_t pdu_len)
lib/libnvmf/nvmf_tcp.c
795
hlen = ch->hlen;
lib/libnvmf/nvmf_tcp.c
796
plen = le32toh(ch->plen);
lib/libnvmf/nvmf_tcp.c
797
if (hlen < sizeof(*ch) || hlen > plen)
lib/libnvmf/nvmf_tcp.c
798
hlen = sizeof(*ch);
lib/libnvmf/nvmf_tcp.c
808
if (na->na_controller != ((ch->pdu_type & 0x01) == 0)) {
lib/libnvmf/nvmf_tcp.c
809
na_error(na, "NVMe/TCP: Invalid PDU type %u", ch->pdu_type);
lib/libnvmf/nvmf_tcp.c
811
NVME_TCP_TERM_REQ_FES_INVALID_HEADER_FIELD, 0, ch, pdu_len,
lib/libnvmf/nvmf_tcp.c
816
switch (ch->pdu_type) {
lib/libnvmf/nvmf_tcp.c
821
na_error(na, "NVMe/TCP: Invalid PDU type %u", ch->pdu_type);
lib/libnvmf/nvmf_tcp.c
823
NVME_TCP_TERM_REQ_FES_INVALID_HEADER_FIELD, 0, ch, pdu_len,
lib/libnvmf/nvmf_tcp.c
829
if (ch->flags != 0) {
lib/libnvmf/nvmf_tcp.c
831
ch->flags);
lib/libnvmf/nvmf_tcp.c
833
NVME_TCP_TERM_REQ_FES_INVALID_HEADER_FIELD, 1, ch, pdu_len,
lib/libnvmf/nvmf_tcp.c
839
if (ch->hlen != 128) {
lib/libnvmf/nvmf_tcp.c
841
ch->hlen);
lib/libnvmf/nvmf_tcp.c
843
NVME_TCP_TERM_REQ_FES_INVALID_HEADER_FIELD, 2, ch, pdu_len,
lib/libnvmf/nvmf_tcp.c
849
if (ch->pdo != 0) {
lib/libnvmf/nvmf_tcp.c
850
na_error(na, "NVMe/TCP: Invalid PDU data offset %u", ch->pdo);
lib/libnvmf/nvmf_tcp.c
852
NVME_TCP_TERM_REQ_FES_INVALID_HEADER_FIELD, 3, ch, pdu_len,
lib/libnvmf/nvmf_tcp.c
861
NVME_TCP_TERM_REQ_FES_INVALID_HEADER_FIELD, 4, ch, pdu_len,
lib/libnvmf/nvmf_tcp.c
867
pdu = (const struct nvme_tcp_ic_req *)ch;
lib/libnvmf/nvmf_tcp.c
873
8, ch, pdu_len, hlen);
lib/libnvmf/nvmf_tcp.c
880
NVME_TCP_TERM_REQ_FES_INVALID_HEADER_FIELD, 10, ch, pdu_len,
lib/libnvmf/nvmf_tcp.c
888
NVME_TCP_TERM_REQ_FES_INVALID_HEADER_FIELD, 11, ch, pdu_len,
lib/libtacplus/taclib.c
1239
char *ch, *end;
lib/libtacplus/taclib.c
1256
ch = candidate->data + attr_len;
lib/libtacplus/taclib.c
1264
while ((*ch == '=' || *ch == '*' || *ch == ' ' ||
lib/libtacplus/taclib.c
1265
*ch == '\t') && ch != end) {
lib/libtacplus/taclib.c
1266
if (*ch == '=' || *ch == '*')
lib/libtacplus/taclib.c
1268
ch++;
lib/libtacplus/taclib.c
1284
value.len = end - ch;
lib/libtacplus/taclib.c
1285
value.data = ch;
lib/libtacplus/taclib_private.h
187
#define is_alpha(ch) /* alphabetical */ \
lib/libtacplus/taclib_private.h
188
(((ch) >= 'A' && (ch) <= 'Z') || ((ch) >= 'a' && (ch) <= 'z'))
lib/libtacplus/taclib_private.h
189
#define is_num(ch) /* numerical */ \
lib/libtacplus/taclib_private.h
190
((ch) >= '0' && (ch) <= '9')
lib/libtacplus/taclib_private.h
191
#define is_alnum(ch) /* alphanumerical */ \
lib/libtacplus/taclib_private.h
192
(is_alpha(ch) || is_num(ch))
lib/libtacplus/taclib_private.h
193
#define is_arg(ch) /* valid in an argument name */ \
lib/libtacplus/taclib_private.h
194
(is_alnum(ch) || (ch) == '_' || (ch) == '-')
lib/libutil/property.c
108
ch = buf[0];
lib/libutil/property.c
114
if (isspace((unsigned char)ch))
lib/libutil/property.c
117
else if (ch == '#' || ch == ';') {
lib/libutil/property.c
121
else if (isalnum((unsigned char)ch) || ch == '_') {
lib/libutil/property.c
127
hold_n[n++] = ch;
lib/libutil/property.c
136
if (ch == '\n')
lib/libutil/property.c
141
if (ch == '\n' || !ch) {
lib/libutil/property.c
147
else if (isspace((unsigned char)ch))
lib/libutil/property.c
149
else if (ch == '=') {
lib/libutil/property.c
155
hold_n[n++] = ch;
lib/libutil/property.c
159
if (v == 0 && ch == '\n') {
lib/libutil/property.c
164
else if (v == 0 && isspace((unsigned char)ch))
lib/libutil/property.c
166
else if (ch == '{') {
lib/libutil/property.c
170
else if (ch == '\n' || !ch) {
lib/libutil/property.c
182
hold_v[v++] = ch;
lib/libutil/property.c
193
else if (ch == '}' && !--blevel) {
lib/libutil/property.c
199
hold_v[v++] = ch;
lib/libutil/property.c
200
if (ch == '{')
lib/libutil/property.c
78
int ch = 0, blevel = 0;
lib/libutil/property.c
89
ch = buf[bp++];
lib/libutil/tests/humanize_number_test.c
407
int ch;
lib/libutil/tests/humanize_number_test.c
410
while ((ch = getopt(argc, argv, "nEh?vl:")) != -1) {
lib/libutil/tests/humanize_number_test.c
411
switch (ch) {
lib/libutil/tests/pidfile_test.c
131
char ch;
lib/libutil/tests/pidfile_test.c
191
if (read(fd[0], &ch, 1) != 1) {
lib/libvgl/keyboard.c
90
unsigned char ch = 0;
lib/libvgl/keyboard.c
92
read (0, &ch, 1);
lib/libvgl/keyboard.c
93
return (int)ch;
lib/libvgl/text.c
74
VGLBitmapPutChar(VGLBitmap *Object, int x, int y, byte ch,
lib/libvgl/text.c
85
if (VGLTextFont->BitmapArray[(ch*Bpc)+(lin*Bpl)+(b/8)]&(1<<(b%8)))
lib/libvgl/vgl.h
158
void VGLBitmapPutChar(VGLBitmap *Object, int x, int y, byte ch, u_long fgcol, u_long bgcol, int fill, int dir);
lib/virtual_oss/bt/sbc_encode.c
126
uint8_t ch;
lib/virtual_oss/bt/sbc_encode.c
129
for (ch = 0; ch != sbc->channels; ch++) {
lib/virtual_oss/bt/sbc_encode.c
135
x |= (uint32_t)ABS(sbc->samples[block][ch][sb]);
lib/virtual_oss/bt/sbc_encode.c
141
sbc->scalefactor[ch][sb] = 16 - lx;
lib/virtual_oss/bt/sbc_encode.c
154
int ch, sb, start_chan = 0;
lib/virtual_oss/bt/sbc_encode.c
165
for (ch = start_chan; ch < sbc->channels; ch++) {
lib/virtual_oss/bt/sbc_encode.c
167
bitneed[ch][sb] = sbc->scalefactor[ch][sb];
lib/virtual_oss/bt/sbc_encode.c
169
if (bitneed[ch][sb] > max_bitneed)
lib/virtual_oss/bt/sbc_encode.c
170
max_bitneed = bitneed[ch][sb];
lib/virtual_oss/bt/sbc_encode.c
174
for (ch = start_chan; ch < sbc->channels; ch++) {
lib/virtual_oss/bt/sbc_encode.c
176
if (sbc->scalefactor[ch][sb] == 0) {
lib/virtual_oss/bt/sbc_encode.c
177
bitneed[ch][sb] = -5;
lib/virtual_oss/bt/sbc_encode.c
180
loudness = sbc->scalefactor[ch][sb] -
lib/virtual_oss/bt/sbc_encode.c
183
loudness = sbc->scalefactor[ch][sb] -
lib/virtual_oss/bt/sbc_encode.c
187
bitneed[ch][sb] = loudness / 2;
lib/virtual_oss/bt/sbc_encode.c
189
bitneed[ch][sb] = loudness;
lib/virtual_oss/bt/sbc_encode.c
191
if (bitneed[ch][sb] > max_bitneed)
lib/virtual_oss/bt/sbc_encode.c
192
max_bitneed = bitneed[ch][sb];
lib/virtual_oss/bt/sbc_encode.c
203
for (ch = start_chan; ch < sbc->channels; ch++) {
lib/virtual_oss/bt/sbc_encode.c
205
if ((bitneed[ch][sb] > bitslice + 1) &&
lib/virtual_oss/bt/sbc_encode.c
206
(bitneed[ch][sb] < bitslice + 16))
lib/virtual_oss/bt/sbc_encode.c
208
else if (bitneed[ch][sb] == bitslice + 1)
lib/virtual_oss/bt/sbc_encode.c
219
for (ch = start_chan; ch < sbc->channels; ch++) {
lib/virtual_oss/bt/sbc_encode.c
221
if (bitneed[ch][sb] < bitslice + 2) {
lib/virtual_oss/bt/sbc_encode.c
222
sbc->bits[ch][sb] = 0;
lib/virtual_oss/bt/sbc_encode.c
224
sbc->bits[ch][sb] = bitneed[ch][sb] - bitslice;
lib/virtual_oss/bt/sbc_encode.c
225
if (sbc->bits[ch][sb] > 16)
lib/virtual_oss/bt/sbc_encode.c
226
sbc->bits[ch][sb] = 16;
lib/virtual_oss/bt/sbc_encode.c
232
ch = start_chan;
lib/virtual_oss/bt/sbc_encode.c
234
ch = 0;
lib/virtual_oss/bt/sbc_encode.c
237
if ((sbc->bits[ch][sb] >= 2) && (sbc->bits[ch][sb] < 16)) {
lib/virtual_oss/bt/sbc_encode.c
238
sbc->bits[ch][sb]++;
lib/virtual_oss/bt/sbc_encode.c
240
} else if ((bitneed[ch][sb] == bitslice + 1) &&
lib/virtual_oss/bt/sbc_encode.c
242
sbc->bits[ch][sb] = 2;
lib/virtual_oss/bt/sbc_encode.c
247
else if (ch == 1) {
lib/virtual_oss/bt/sbc_encode.c
248
ch = 0;
lib/virtual_oss/bt/sbc_encode.c
251
ch = 1;
lib/virtual_oss/bt/sbc_encode.c
255
ch = start_chan;
lib/virtual_oss/bt/sbc_encode.c
257
ch = 0;
lib/virtual_oss/bt/sbc_encode.c
260
if (sbc->bits[ch][sb] < 16) {
lib/virtual_oss/bt/sbc_encode.c
261
sbc->bits[ch][sb]++;
lib/virtual_oss/bt/sbc_encode.c
266
else if (ch == 1) {
lib/virtual_oss/bt/sbc_encode.c
267
ch = 0;
lib/virtual_oss/bt/sbc_encode.c
270
ch = 1;
libexec/comsat/comsat.c
206
unsigned char *cp, ch;
libexec/comsat/comsat.c
240
for (cp = line; (ch = *cp) && ch != '\n'; ++cp, --charcnt) {
libexec/comsat/comsat.c
244
if (((ch & 0x80) && ch < 0xA0) ||
libexec/comsat/comsat.c
245
(!(ch & 0x80) && !isprint(ch) &&
libexec/comsat/comsat.c
246
!isspace(ch) && ch != '\a' && ch != '\b')
libexec/comsat/comsat.c
248
if (ch & 0x80) {
libexec/comsat/comsat.c
249
ch &= ~0x80;
libexec/comsat/comsat.c
252
if (iscntrl(ch)) {
libexec/comsat/comsat.c
253
ch ^= 0x40;
libexec/comsat/comsat.c
257
(void)fputc(ch, tp);
libexec/fingerd/fingerd.c
212
while ((ch = getc(fp)) != EOF) {
libexec/fingerd/fingerd.c
213
if (ch == '\n')
libexec/fingerd/fingerd.c
215
putchar(ch);
libexec/fingerd/fingerd.c
58
int ch;
libexec/fingerd/fingerd.c
71
while ((ch = getopt(argc, argv, "dklp:s")) != -1)
libexec/fingerd/fingerd.c
72
switch (ch) {
libexec/getty/chat.c
237
cleanchr(char **buf, unsigned char ch)
libexec/getty/chat.c
243
if (ch & 0x80) {
libexec/getty/chat.c
246
ch &= 0x7f;
libexec/getty/chat.c
250
if (ch < 32) {
libexec/getty/chat.c
252
tmp[l++] = ch + '@';
libexec/getty/chat.c
253
} else if (ch == 127) {
libexec/getty/chat.c
257
tmp[l++] = ch;
libexec/getty/chat.c
338
unsigned char ch;
libexec/getty/chat.c
340
if (read(STDIN_FILENO, &ch, 1) == 1) {
libexec/getty/chat.c
344
cleanchr(NULL, ch), i);
libexec/getty/chat.c
346
if (ch == str[i])
libexec/getty/chat.c
347
got[i++] = ch;
libexec/getty/chat.c
396
unsigned char ch = (unsigned char)*str++;
libexec/getty/chat.c
400
else if (ch == PAUSE_CH)
libexec/getty/chat.c
404
if (write(STDOUT_FILENO, &ch, 1) != 1)
libexec/mknetid/mknetid.c
106
int ch;
libexec/mknetid/mknetid.c
112
while ((ch = getopt(argc, argv, "g:p:h:n:d:q")) != -1) {
libexec/mknetid/mknetid.c
113
switch(ch) {
libexec/mknetid/parse_group.c
108
int ch;
libexec/mknetid/parse_group.c
110
while ((ch = getc(_gr_fp)) != '\n' && ch != EOF)
libexec/pppoed/pppoed.c
505
int ch, cs, ds, ret, optF, optd, optn, sz, f;
libexec/pppoed/pppoed.c
517
while ((ch = getopt(argc, argv, "FP:a:de:l:n:p:")) != -1) {
libexec/pppoed/pppoed.c
518
switch (ch) {
libexec/revnetgroup/revnetgroup.c
75
int ch;
libexec/revnetgroup/revnetgroup.c
82
while ((ch = getopt(argc, argv, "uhf:")) != -1) {
libexec/revnetgroup/revnetgroup.c
83
switch(ch) {
libexec/rpc.rquotad/rquotad.c
59
int ch;
libexec/rpc.rquotad/rquotad.c
61
while ((ch = getopt(argc, argv, "d")) != -1) {
libexec/rpc.rquotad/rquotad.c
62
switch (ch) {
libexec/rtld-elf/rtld_printf.c
128
int ch, n, sign;
libexec/rtld-elf/rtld_printf.c
147
while ((ch = (u_char)*fmt++) != '%' || stop) {
libexec/rtld-elf/rtld_printf.c
148
if (ch == '\0')
libexec/rtld-elf/rtld_printf.c
150
PCHAR(ch);
libexec/rtld-elf/rtld_printf.c
156
reswitch: switch (ch = (u_char)*fmt++) {
libexec/rtld-elf/rtld_printf.c
170
PCHAR(ch);
libexec/rtld-elf/rtld_printf.c
192
n = n * 10 + ch - '0';
libexec/rtld-elf/rtld_printf.c
193
ch = *fmt;
libexec/rtld-elf/rtld_printf.c
194
if (ch < '0' || ch > '9')
libexec/rtld-elf/rtld_printf.c
73
snprintf_func(int ch, struct snprintf_arg *const info)
libexec/rtld-elf/rtld_printf.c
79
*info->str++ = ch;
libexec/rtld-elf/rtld_printf.c
86
*info->str++ = ch;
libexec/tftpd/tftpd.c
119
int ch;
libexec/tftpd/tftpd.c
131
while ((ch = getopt(argc, argv, "bcCd::F:lnoOp:s:Su:U:wW")) != -1) {
libexec/tftpd/tftpd.c
132
switch (ch) {
libexec/tftpd/tftpd.c
192
"ignoring unknown option -%c", ch);
libexec/ypxfr/ypxfr_main.c
161
int ch;
libexec/ypxfr/ypxfr_main.c
187
while ((ch = getopt(argc, argv, "fcd:h:s:p:C:")) != -1) {
libexec/ypxfr/ypxfr_main.c
189
switch (ch) {
sbin/adjkerntz/adjkerntz.c
80
int ch;
sbin/adjkerntz/adjkerntz.c
86
while ((ch = getopt(argc, argv, "ais")) != -1)
sbin/adjkerntz/adjkerntz.c
87
switch((char)ch) {
sbin/bsdlabel/bsdlabel.c
132
int ch, error, fd;
sbin/bsdlabel/bsdlabel.c
142
while ((ch = getopt(argc, argv, "ABb:efm:nRrw")) != -1)
sbin/bsdlabel/bsdlabel.c
143
switch (ch) {
sbin/camcontrol/modeedit.c
413
int ch;
sbin/camcontrol/modeedit.c
451
while ((ch = fgetc(pagedb)) != EOF) {
sbin/camcontrol/modeedit.c
457
if (ch == '#') {
sbin/camcontrol/modeedit.c
459
ch = fgetc(pagedb);
sbin/camcontrol/modeedit.c
460
} while (ch != '\n' && ch != EOF);
sbin/camcontrol/modeedit.c
464
c = ch;
sbin/ccdconfig/ccdconfig.c
92
int ch, options = 0, action = CCD_CONFIG;
sbin/ccdconfig/ccdconfig.c
94
while ((ch = getopt(argc, argv, "cCf:guUv")) != -1) {
sbin/ccdconfig/ccdconfig.c
95
switch (ch) {
sbin/ddb/ddb_capture.c
202
int ch;
sbin/ddb/ddb_capture.c
207
while ((ch = getopt(argc, argv, "M:N:")) != -1) {
sbin/ddb/ddb_capture.c
208
switch (ch) {
sbin/decryptcore/decryptcore.c
313
int ch, debug, error, ofd;
sbin/decryptcore/decryptcore.c
331
while ((ch = getopt(argc, argv, "Lc:d:e:fk:n:p:v")) != -1) {
sbin/decryptcore/decryptcore.c
332
switch (ch) {
sbin/devd/devd.cc
1307
int ch;
sbin/devd/devd.cc
1311
while ((ch = getopt(argc, argv, "df:l:nq")) != -1) {
sbin/devd/devd.cc
1312
switch (ch) {
sbin/devd/devd.cc
644
config::is_id_char(char ch) const
sbin/devd/devd.cc
646
return (ch != '\0' && (isalpha(ch) || isdigit(ch) || ch == '_' ||
sbin/devd/devd.cc
647
ch == '-'));
sbin/devfs/devfs.c
61
int ch;
sbin/devfs/devfs.c
64
while ((ch = getopt(ac, av, "m:")) != -1)
sbin/devfs/devfs.c
65
switch (ch) {
sbin/devfs/rule.c
84
int ch;
sbin/devfs/rule.c
88
while ((ch = getopt(ac, av, "s:")) != -1)
sbin/devfs/rule.c
89
switch (ch) {
sbin/devmatch/devmatch.c
579
int ch;
sbin/devmatch/devmatch.c
581
while ((ch = getopt_long(argc, argv, "adh:p:quv",
sbin/devmatch/devmatch.c
583
switch (ch) {
sbin/dhclient/dhclient.c
2718
int pch = PERIOD, ch = *dn++;
sbin/dhclient/dhclient.c
2720
while (ch != '\0') {
sbin/dhclient/dhclient.c
2723
if (periodchar(ch)) {
sbin/dhclient/dhclient.c
2726
if (!borderchar(ch))
sbin/dhclient/dhclient.c
2729
if (!borderchar(ch))
sbin/dhclient/dhclient.c
2732
if (!middlechar(ch))
sbin/dhclient/dhclient.c
2735
pch = ch, ch = nch;
sbin/dhclient/dhclient.c
2743
int pch = PERIOD, ch = *srch++;
sbin/dhclient/dhclient.c
2750
while (whitechar(ch))
sbin/dhclient/dhclient.c
2751
ch = *srch++;
sbin/dhclient/dhclient.c
2753
while (ch != '\0') {
sbin/dhclient/dhclient.c
2756
if (periodchar(ch) || whitechar(ch)) {
sbin/dhclient/dhclient.c
2759
if (!borderchar(ch))
sbin/dhclient/dhclient.c
2762
if (!borderchar(ch))
sbin/dhclient/dhclient.c
2765
if (!middlechar(ch))
sbin/dhclient/dhclient.c
2768
if (!whitechar(ch)) {
sbin/dhclient/dhclient.c
2769
pch = ch;
sbin/dhclient/dhclient.c
2778
ch = nch;
sbin/dhclient/dhclient.c
376
int ch, fd, quiet = 0, i = 0;
sbin/dhclient/dhclient.c
389
while ((ch = getopt(argc, argv, "bc:dl:np:qu")) != -1)
sbin/dhclient/dhclient.c
390
switch (ch) {
sbin/dhclient/errwarn.c
175
char ch;
sbin/dhclient/errwarn.c
186
for (fmt_left = size; (ch = *s); ++s) {
sbin/dhclient/errwarn.c
187
if (ch == '%' && s[1] == 'm') {
sbin/dhclient/errwarn.c
197
*t++ = ch;
sbin/dmesg/dmesg.c
71
int ch, clear;
sbin/dmesg/dmesg.c
78
while ((ch = getopt(argc, argv, "acM:N:")) != -1)
sbin/dmesg/dmesg.c
79
switch(ch) {
sbin/dump/main.c
113
int ch, mode, mntflags;
sbin/dump/main.c
134
while ((ch = getopt(argc, argv,
sbin/dump/main.c
136
switch (ch) {
sbin/dump/main.c
140
level = 10 * level + ch - '0';
sbin/dump/main.c
236
lastdump(ch);
sbin/dumpfs/dumpfs.c
86
int ch, dofreespace, domarshal, dolabel, dosb, eval;
sbin/dumpfs/dumpfs.c
90
while ((ch = getopt(argc, argv, "lfms")) != -1) {
sbin/dumpfs/dumpfs.c
91
switch (ch) {
sbin/dumpon/dumpon.c
466
int ch, error, fd;
sbin/dumpon/dumpon.c
479
while ((ch = getopt(argc, argv, "C:c:g:i:k:lrs:vZz")) != -1)
sbin/dumpon/dumpon.c
480
switch ((char)ch) {
sbin/etherswitchcfg/etherswitchcfg.c
734
int ch;
sbin/etherswitchcfg/etherswitchcfg.c
740
while ((ch = getopt(argc, argv, "f:mv?")) != -1)
sbin/etherswitchcfg/etherswitchcfg.c
741
switch(ch) {
sbin/fdisk/fdisk.c
1001
*end = ch;
sbin/fdisk/fdisk.c
996
char ch;
sbin/fdisk/fdisk.c
999
ch = *end; *end = '\0';
sbin/ffsinfo/ffsinfo.c
120
int ch;
sbin/ffsinfo/ffsinfo.c
139
while ((ch = getopt(argc, argv, "g:i:l:o:")) != -1) {
sbin/ffsinfo/ffsinfo.c
140
switch (ch) {
sbin/fsck_ffs/main.c
69
int ch;
sbin/fsck_ffs/main.c
78
while ((ch = getopt(argc, argv, "b:Bc:CdEfFm:npRrSyZz")) != -1) {
sbin/fsck_ffs/main.c
79
switch (ch) {
sbin/fsck_msdosfs/main.c
67
int ch;
sbin/fsck_msdosfs/main.c
71
while ((ch = getopt(argc, argv, "BCfFnpyM")) != -1) {
sbin/fsck_msdosfs/main.c
72
switch (ch) {
sbin/fsdb/fsdb.c
101
while (-1 != (ch = getopt(argc, argv, "fdr"))) {
sbin/fsdb/fsdb.c
102
switch (ch) {
sbin/fsdb/fsdb.c
98
int ch, rval;
sbin/geom/core/geom.c
232
find_option(struct g_command *cmd, char ch)
sbin/geom/core/geom.c
241
if (opt->go_char == ch)
sbin/geom/core/geom.c
320
int ch, vcount;
sbin/geom/core/geom.c
343
while ((ch = getopt(*argc, *argv, opts)) != -1) {
sbin/geom/core/geom.c
345
if (ch == 'v' && (cmd->gc_flags & G_FLAG_VERBOSE) != 0)
sbin/geom/core/geom.c
348
opt = find_option(cmd, ch);
sbin/geom/core/geom.c
350
if (ch == 'v' && (cmd->gc_flags & G_FLAG_VERBOSE) != 0) {
sbin/geom/core/geom.c
812
int ch;
sbin/geom/core/geom.c
822
while ((ch = getopt(argc, argv, "hp:t")) != -1) {
sbin/geom/core/geom.c
823
switch (ch) {
sbin/ggate/ggatec/ggatec.c
565
int ch;
sbin/ggate/ggatec/ggatec.c
567
ch = getopt(argc, argv, "fno:p:q:R:S:s:t:u:v");
sbin/ggate/ggatec/ggatec.c
568
if (ch == -1)
sbin/ggate/ggatec/ggatec.c
570
switch (ch) {
sbin/ggate/ggated/ggated.c
1041
int ch, sfd, tmpsfd;
sbin/ggate/ggated/ggated.c
1046
while ((ch = getopt(argc, argv, "a:hnp:F:R:S:v")) != -1) {
sbin/ggate/ggated/ggated.c
1047
switch (ch) {
sbin/ggate/ggatel/ggatel.c
237
int ch;
sbin/ggate/ggatel/ggatel.c
239
ch = getopt(argc, argv, "fo:s:t:u:v");
sbin/ggate/ggatel/ggatel.c
240
if (ch == -1)
sbin/ggate/ggatel/ggatel.c
242
switch (ch) {
sbin/growfs/growfs.c
1307
int error, j, fsi, fso, ch, ret, Nflag = 0, yflag = 0;
sbin/growfs/growfs.c
1313
while ((ch = getopt(argc, argv, "Ns:vy")) != -1) {
sbin/growfs/growfs.c
1314
switch(ch) {
sbin/hastctl/hastctl.c
440
int ch;
sbin/hastctl/hastctl.c
442
ch = getopt(argc, argv, optstr);
sbin/hastctl/hastctl.c
443
if (ch == -1)
sbin/hastctl/hastctl.c
445
switch (ch) {
sbin/hastd/hastd.c
1193
int ch;
sbin/hastd/hastd.c
1195
ch = getopt(argc, argv, "c:dFhP:");
sbin/hastd/hastd.c
1196
if (ch == -1)
sbin/hastd/hastd.c
1198
switch (ch) {
sbin/ifconfig/ifieee80211.c
3977
if (mi->ch[i].rssi[0] != 0) {
sbin/ifconfig/ifieee80211.c
3989
mi->ch[0].rssi[0] / 2.0,
sbin/ifconfig/ifieee80211.c
3990
mi->ch[1].rssi[0] / 2.0,
sbin/ifconfig/ifieee80211.c
3991
mi->ch[2].rssi[0] / 2.0,
sbin/ifconfig/ifieee80211.c
3992
mi->ch[3].rssi[0] / 2.0,
sbin/ifconfig/ifieee80211.c
3993
mi->ch[0].noise[0],
sbin/ifconfig/ifieee80211.c
3994
mi->ch[1].noise[0],
sbin/ifconfig/ifieee80211.c
3995
mi->ch[2].noise[0],
sbin/ifconfig/ifieee80211.c
3996
mi->ch[3].noise[0]);
sbin/ipfw/ipfw2.c
4073
char *host, *ch, buf[INET6_ADDRSTRLEN];
sbin/ipfw/ipfw2.c
4078
if ((ch = strpbrk(av, "/,")) != NULL) {
sbin/ipfw/ipfw2.c
4079
len = ch - av;
sbin/ipfw/ipfw2.c
4104
char *host, *ch, buf[INET6_ADDRSTRLEN];
sbin/ipfw/ipfw2.c
4109
if ((ch = strpbrk(av, "/,")) != NULL) {
sbin/ipfw/ipfw2.c
4110
len = ch - av;
sbin/ipfw/main.c
108
int ch, ac;
sbin/ipfw/main.c
278
while ((ch = getopt(ac, av, "abcdDefhinNp:qs:STtvx")) != -1)
sbin/ipfw/main.c
279
switch (ch) {
sbin/ipfw/main.c
364
while ((ch = getopt(ac, av, "hns:v")) != -1)
sbin/ipfw/main.c
365
switch (ch) {
sbin/mdconfig/mdconfig.c
102
int ch, i, vflag;
sbin/mdconfig/mdconfig.c
118
while ((ch = getopt(argc, argv, "ab:df:lno:rs:S:t:u:vx:y:L:")) != -1) {
sbin/mdconfig/mdconfig.c
119
switch (ch) {
sbin/mdmfs/mdmfs.c
107
int ch, idx;
sbin/mdmfs/mdmfs.c
143
while ((ch = getopt(argc, argv,
sbin/mdmfs/mdmfs.c
145
switch (ch) {
sbin/mount/mount.c
209
int all, ch, i, init_flags, late, failok, mntsize, rval, have_fstab, ro;
sbin/mount/mount.c
224
while ((ch = getopt(argc, argv, "adF:fLlno:prt:uvw")) != -1)
sbin/mount/mount.c
225
switch (ch) {
sbin/mount/mount_fs.c
68
int ch;
sbin/mount/mount_fs.c
82
while ((ch = getopt(argc, argv, "o:")) != -1) {
sbin/mount/mount_fs.c
83
switch(ch) {
sbin/mount_cd9660/mount_cd9660.c
77
int ch, mntflags;
sbin/mount_cd9660/mount_cd9660.c
88
while ((ch = getopt(argc, argv, "begG:jm:M:o:rs:U:vC:")) != -1)
sbin/mount_cd9660/mount_cd9660.c
89
switch (ch) {
sbin/mount_fusefs/mount_fusefs.c
129
int ch = 0;
sbin/mount_fusefs/mount_fusefs.c
180
switch(ch) {
sbin/mount_fusefs/mount_fusefs.c
251
} while ((ch = getopt_long(argc, argv, "AvVho:SD:O:s:m:", longopts, NULL)) != -1);
sbin/mount_nullfs/mount_nullfs.c
66
int ch, iovlen;
sbin/mount_nullfs/mount_nullfs.c
74
while ((ch = getopt(argc, argv, "o:")) != -1)
sbin/mount_nullfs/mount_nullfs.c
75
switch(ch) {
sbin/mount_udf/mount_udf.c
79
int ch, iovlen, mntflags, udf_flags, verbose;
sbin/mount_udf/mount_udf.c
84
while ((ch = getopt(argc, argv, "o:vC:")) != -1)
sbin/mount_udf/mount_udf.c
85
switch (ch) {
sbin/mount_unionfs/mount_unionfs.c
118
int ch, iovlen;
sbin/mount_unionfs/mount_unionfs.c
128
while ((ch = getopt(argc, argv, "bo:")) != -1) {
sbin/mount_unionfs/mount_unionfs.c
129
switch (ch) {
sbin/newfs/newfs.c
125
int ch, rval;
sbin/newfs/newfs.c
131
while ((ch = getopt(argc, argv,
sbin/newfs/newfs.c
133
switch (ch) {
sbin/newfs_msdos/newfs_msdos.c
78
int ch;
sbin/newfs_msdos/newfs_msdos.c
82
while ((ch = getopt(argc, argv, opts)) != -1)
sbin/newfs_msdos/newfs_msdos.c
83
switch (ch) {
sbin/nfsiod/nfsiod.c
59
int ch;
sbin/nfsiod/nfsiod.c
75
while ((ch = getopt(argc, argv, "n:")) != -1)
sbin/nfsiod/nfsiod.c
76
switch (ch) {
sbin/nvmecontrol/comnd.c
163
find_long(struct option *lopts, int ch)
sbin/nvmecontrol/comnd.c
167
for (i = 0; lopts[i].val != ch && lopts[i].name != NULL; i++)
sbin/nvmecontrol/comnd.c
175
int i, n, idx, ch;
sbin/nvmecontrol/comnd.c
212
while ((ch = getopt_long(argc, argv, shortopts, lopts, &idx)) != -1) {
sbin/nvmecontrol/comnd.c
217
if (ch != 0)
sbin/nvmecontrol/comnd.c
218
idx = find_long(lopts, ch);
sbin/nvmecontrol/modules/samsung/samsung.c
144
printf(" Capacitor Health : %u\n", le16dec(&temp->ch));
sbin/nvmecontrol/modules/samsung/samsung.c
54
uint16_t ch; /* Capacitor Health */
sbin/pfctl/pfctl.c
3656
int ch;
sbin/pfctl/pfctl.c
3667
while ((ch = getopt(argc, argv,
sbin/pfctl/pfctl.c
3669
switch (ch) {
sbin/pfctl/pfctl.c
3821
ch = *tblcmdopt;
sbin/pfctl/pfctl.c
3822
if (ch == 'l') {
sbin/pfctl/pfctl.c
3826
mode = strchr("st", ch) ? O_RDONLY : O_RDWR;
sbin/pfctl/pfctl_table.c
480
char ch, buf[256] = "{error}";
sbin/pfctl/pfctl_table.c
485
ch = (fback < sizeof(fb)/sizeof(*fb)) ? fb[fback] : '?';
sbin/pfctl/pfctl_table.c
488
printf("%c %c%s", ch, (ad->pfra_not?'!':' '), buf);
sbin/pflowctl/pflowctl.c
554
int ch;
sbin/pflowctl/pflowctl.c
564
while ((ch = getopt(argc, argv,
sbin/pflowctl/pflowctl.c
566
switch (ch) {
sbin/ping/ping.c
217
int almost_done, ch, df, hold, i, icmp_len, mib[4], preload;
sbin/ping/ping.c
267
while ((ch = getopt(argc, argv, PING4OPTS)) != -1) {
sbin/ping/ping.c
268
switch(ch) {
sbin/ping/ping6.c
276
int almost_done, ch, hold, packlen, preload, optval, error;
sbin/ping/ping6.c
318
while ((ch = getopt(argc, argv, PING6OPTS)) != -1) {
sbin/ping/ping6.c
319
switch (ch) {
sbin/ping/ping6.c
470
errx(1, "-%c is not supported on this platform", ch);
sbin/quotacheck/quotacheck.c
128
int i, argnum, maxrun, errs, ch;
sbin/quotacheck/quotacheck.c
133
while ((ch = getopt(argc, argv, "ac:guvl:")) != -1) {
sbin/quotacheck/quotacheck.c
134
switch(ch) {
sbin/rcorder/rcorder.c
177
int ch;
sbin/rcorder/rcorder.c
179
while ((ch = getopt(argc, argv, "dgk:ps:")) != -1)
sbin/rcorder/rcorder.c
180
switch (ch) {
sbin/reboot/reboot.c
267
int ch, howto = 0, i, sverrno;
sbin/reboot/reboot.c
286
while ((ch = getopt(argc, argv, getopts)) != -1) {
sbin/reboot/reboot.c
287
switch(ch) {
sbin/recoverdisk/recoverdisk.c
743
int ch;
sbin/recoverdisk/recoverdisk.c
751
while ((ch = getopt(argc, argv, "b:i:l:p:m:r:w:s:t:u:v")) != -1) {
sbin/recoverdisk/recoverdisk.c
752
switch (ch) {
sbin/restore/main.c
128
ch, command);
sbin/restore/main.c
129
command = ch;
sbin/restore/main.c
71
int ch;
sbin/restore/main.c
87
while ((ch = getopt(argc, argv, "b:dDf:himNP:Rrs:tuvxy")) != -1)
sbin/restore/main.c
88
switch(ch) {
sbin/route/route.c
176
int ch;
sbin/route/route.c
185
while ((ch = getopt(argc, argv, "46nqdtvj:")) != -1)
sbin/route/route.c
186
switch(ch) {
sbin/routed/rtquery/rtquery.c
120
int ch, bsize;
sbin/routed/rtquery/rtquery.c
129
while ((ch = getopt(argc, argv, "np1w:r:t:a:")) != -1)
sbin/routed/rtquery/rtquery.c
130
switch (ch) {
sbin/savecore/savecore.c
1435
int i, ch, error, savedirfd;
sbin/savecore/savecore.c
1450
while ((ch = getopt(argc, argv, "CcfkLm:uvZz")) != -1)
sbin/savecore/savecore.c
1451
switch(ch) {
sbin/shutdown/shutdown.c
106
int arglen, ch, len, readstdin;
sbin/shutdown/shutdown.c
139
while ((ch = getopt(argc, argv, "-cfhknopqr")) != -1)
sbin/shutdown/shutdown.c
140
switch (ch) {
sbin/swapon/swapon.c
77
int ret, ch, doall;
sbin/swapon/swapon.c
92
while ((ch = getopt(argc, argv, "AadEfghklLmqsUF:")) != -1) {
sbin/swapon/swapon.c
93
switch(ch) {
sbin/sysctl/sysctl.c
142
int ch;
sbin/sysctl/sysctl.c
150
while ((ch = getopt(argc, argv, "AaB:bdeFf:hiJj:lNnoqTtVWwXx")) != -1) {
sbin/sysctl/sysctl.c
151
switch (ch) {
sbin/tunefs/tunefs.c
103
while ((ch = getopt(argc, argv, "Aa:e:f:j:J:k:L:l:m:N:n:o:ps:S:t:"))
sbin/tunefs/tunefs.c
105
switch (ch) {
sbin/tunefs/tunefs.c
93
int ch, found_arg, i;
sbin/umount/umount.c
88
int errs, ch, mntsize, error, nfsforce, ret;
sbin/umount/umount.c
94
while ((ch = getopt(argc, argv, "AadF:fh:Nnt:v")) != -1)
sbin/umount/umount.c
95
switch (ch) {
secure/lib/libcrypt/crypt-des.c
198
ascii_to_bin(char ch)
secure/lib/libcrypt/crypt-des.c
200
if (ch > 'z')
secure/lib/libcrypt/crypt-des.c
202
if (ch >= 'a')
secure/lib/libcrypt/crypt-des.c
203
return(ch - 'a' + 38);
secure/lib/libcrypt/crypt-des.c
204
if (ch > 'Z')
secure/lib/libcrypt/crypt-des.c
206
if (ch >= 'A')
secure/lib/libcrypt/crypt-des.c
207
return(ch - 'A' + 12);
secure/lib/libcrypt/crypt-des.c
208
if (ch > '9')
secure/lib/libcrypt/crypt-des.c
210
if (ch >= '.')
secure/lib/libcrypt/crypt-des.c
211
return(ch - '.');
share/examples/ppi/ppilcd.c
108
while ((ch = getopt(argc, argv, "Dd:f:o:v")) != -1) {
share/examples/ppi/ppilcd.c
109
switch(ch) {
share/examples/ppi/ppilcd.c
158
while ((ch = fgetc(stdin)) != EOF)
share/examples/ppi/ppilcd.c
159
do_char(driver, (char)ch);
share/examples/ppi/ppilcd.c
196
do_char(struct lcd_driver *driver, char ch)
share/examples/ppi/ppilcd.c
201
switch(ch) {
share/examples/ppi/ppilcd.c
224
driver->l_command(ch);
share/examples/ppi/ppilcd.c
229
if (ch == '\\') {
share/examples/ppi/ppilcd.c
232
if (vflag || isprint(ch))
share/examples/ppi/ppilcd.c
233
driver->l_putc(ch);
share/examples/ppi/ppilcd.c
84
static void do_char(struct lcd_driver *driver, char ch);
share/examples/ppi/ppilcd.c
98
int ch, i;
share/examples/scsi_target/scsi_target.c
105
int ch;
share/examples/scsi_target/scsi_target.c
123
while ((ch = getopt(argc, argv, "AdSTYb:c:s:W:")) != -1) {
share/examples/scsi_target/scsi_target.c
124
switch(ch) {
stand/common/commands.c
365
int nl, ch;
stand/common/commands.c
370
while ((ch = getopt(argc, argv, "n")) != -1) {
stand/common/commands.c
371
switch (ch) {
stand/common/commands.c
508
int verbose, ch, i;
stand/common/commands.c
514
while ((ch = getopt(argc, argv, "v")) != -1) {
stand/common/commands.c
515
switch (ch) {
stand/common/interp_parse.c
60
isdelim(int ch)
stand/common/interp_parse.c
63
if (ch == '{')
stand/common/interp_parse.c
65
else if (ch == '(')
stand/common/interp_parse.c
71
isquote(int ch)
stand/common/interp_parse.c
74
return (ch == '\'');
stand/common/interp_parse.c
78
isdquote(int ch)
stand/common/interp_parse.c
81
return (ch == '"');
stand/common/ls.c
63
int result, ch;
stand/common/ls.c
71
while ((ch = getopt(argc, argv, "l")) != -1) {
stand/common/ls.c
72
switch (ch) {
stand/common/module.c
121
int dofile, dokld, ch, error;
stand/common/module.c
135
while ((ch = getopt(argc, argv, args)) != -1) {
stand/common/module.c
136
switch(ch) {
stand/common/module.c
240
int ch, num;
stand/common/module.c
250
while ((ch = getopt(argc, argv, "n:")) != -1) {
stand/common/module.c
251
switch(ch) {
stand/common/module.c
305
int ch, verbose, ret = 0;
stand/common/module.c
310
while ((ch = getopt(argc, argv, "v")) != -1) {
stand/common/module.c
311
switch(ch) {
stand/common/module.c
373
int ch;
stand/common/module.c
379
while ((ch = getopt(argc, argv, "vd")) != -1) {
stand/common/module.c
380
switch(ch) {
stand/common/module.c
416
int ch, error;
stand/common/module.c
422
while ((ch = getopt(argc, argv, "vd")) != -1) {
stand/common/module.c
423
switch(ch) {
stand/common/module.c
512
int ch, match;
stand/common/module.c
520
while ((ch = getopt(argc, argv, "v")) != -1) {
stand/common/module.c
521
switch(ch) {
stand/common/pnp.c
35
int ch;
stand/common/pnp.c
45
while ((ch = getopt(argc, argv, "v")) != -1) {
stand/common/pnp.c
46
switch(ch) {
stand/efi/libefi/efi_console.c
1197
unsigned char ch = c;
stand/efi/libefi/efi_console.c
1204
input_byte(ch);
stand/efi/libefi/efi_console.c
1208
teken_input(&gfx_state.tg_teken, &ch, sizeof (ch));
stand/efi/libefi/efi_console.c
625
char buf[16], *ch;
stand/efi/libefi/efi_console.c
634
ch = buf;
stand/efi/libefi/efi_console.c
635
while (*ch)
stand/efi/libefi/efi_console.c
636
efi_cons_rawputchar(*ch++);
stand/efi/libefi/env.c
846
int ch, rv;
stand/efi/libefi/env.c
861
while ((ch = getopt(argc, argv, "ag:lv:")) != -1) {
stand/efi/libefi/env.c
862
switch (ch) {
stand/fdt/fdt_loader_cmd.c
1247
char ch;
stand/fdt/fdt_loader_cmd.c
1260
ch = *(d + i);
stand/fdt/fdt_loader_cmd.c
1261
if (isprint(ch) || (ch == '\0' && i > 0)) {
stand/fdt/fdt_loader_cmd.c
1263
if (ch == '\0')
stand/ficl/float.c
835
unsigned char ch, digit;
stand/ficl/float.c
860
while ((count--) && ((ch = *cp++) != 0))
stand/ficl/float.c
868
if (ch == '-')
stand/ficl/float.c
873
if (ch == '+')
stand/ficl/float.c
884
if (ch == '.')
stand/ficl/float.c
888
else if ((ch == 'e') || (ch == 'E'))
stand/ficl/float.c
894
digit = (unsigned char)(ch - '0');
stand/ficl/float.c
909
if ((ch == 'e') || (ch == 'E'))
stand/ficl/float.c
915
digit = (unsigned char)(ch - '0');
stand/ficl/float.c
930
if (ch == '-')
stand/ficl/float.c
935
else if (ch == '+')
stand/ficl/float.c
946
digit = (unsigned char)(ch - '0');
stand/ficl/loader.c
423
char ch;
stand/ficl/loader.c
434
while ((status = read(fd, &ch, 1)) > 0 && ch != '\n')
stand/ficl/loader.c
435
cp[i++] = ch;
stand/ficl/loader.c
795
char ch;
stand/ficl/loader.c
801
i = read(fd, &ch, 1);
stand/ficl/loader.c
802
stackPushINT(pVM->pStack, i > 0 ? ch : -1);
stand/ficl/vm.c
318
char ch = 0;
stand/ficl/vm.c
335
ch = *pSrc;
stand/ficl/vm.c
336
if (isspace(ch))
stand/ficl/vm.c
344
if ((pEnd != pSrc) && isspace(ch)) /* skip one trailing delimiter */
stand/ficl/vm.c
394
char ch;
stand/ficl/vm.c
404
for (ch = *pSrc; (pSrc != pEnd)
stand/ficl/vm.c
405
&& (ch != delim)
stand/ficl/vm.c
406
&& (ch != '\r')
stand/ficl/vm.c
407
&& (ch != '\n'); ch = *++pSrc)
stand/ficl/words.c
1042
char ch = *cp;
stand/ficl/words.c
1044
while ((cp != pEnd) && (ch != '\r') && (ch != '\n'))
stand/ficl/words.c
1046
ch = *++cp;
stand/ficl/words.c
1058
if ( (cp != pEnd) && (ch != *cp)
stand/ficl/words.c
212
unsigned ch;
stand/ficl/words.c
243
while ((count--) && ((ch = *cp++) != '\0'))
stand/ficl/words.c
245
if (!isalnum(ch))
stand/ficl/words.c
248
digit = ch - '0';
stand/ficl/words.c
251
digit = tolower(ch) - 'a' + 10;
stand/ficl/words.c
2673
char ch;
stand/ficl/words.c
2678
for (ch = *pSrc; (pEnd != pSrc) && (ch != ')'); ch = *++pSrc)
stand/ficl/words.c
2679
*pDest++ = ch;
stand/ficl/words.c
2682
if ((pEnd != pSrc) && (ch == ')'))
stand/ficl/words.c
3065
FICL_UNS ch;
stand/ficl/words.c
3076
for (ch = *cp; count > 0; ch = *++cp, count--)
stand/ficl/words.c
3078
if (ch < '0')
stand/ficl/words.c
3081
digit = ch - '0';
stand/ficl/words.c
3084
digit = tolower(ch) - 'a' + 10;
stand/ficl/words.c
3613
char ch;
stand/ficl/words.c
3619
ch = (char)POPINT();
stand/ficl/words.c
3625
*cp++ = ch;
stand/i386/libi386/textvidc.c
344
char buf[16], *ch;
stand/i386/libi386/textvidc.c
353
ch = buf;
stand/i386/libi386/textvidc.c
354
while (*ch)
stand/i386/libi386/textvidc.c
355
vidc_rawputchar(*ch++);
stand/i386/libi386/vidconsole.c
1043
unsigned char ch = c;
stand/i386/libi386/vidconsole.c
1046
teken_input(&gfx_state.tg_teken, &ch, sizeof (ch));
stand/i386/libi386/vidconsole.c
316
uint8_t ch;
stand/i386/libi386/vidconsole.c
337
addr[idx].ch = vga_get_cp437(px->c);
stand/kboot/kboot/hostcons.c
72
uint8_t ch = c;
stand/kboot/kboot/hostcons.c
74
host_write(1, &ch, 1);
stand/kboot/kboot/hostcons.c
80
uint8_t ch;
stand/kboot/kboot/hostcons.c
83
rv = host_read(0, &ch, 1);
stand/kboot/kboot/hostcons.c
85
return (ch);
stand/liblua/lstd.c
165
char ch;
stand/liblua/lstd.c
170
r = read(stream->fd, &ch, 1);
stand/liblua/lstd.c
172
return ch;
stand/libofw/ofw_console.c
100
if (OF_read(stdin, &ch, 1) > 0 && ch != '\0')
stand/libofw/ofw_console.c
101
return (ch);
stand/libofw/ofw_console.c
109
unsigned char ch;
stand/libofw/ofw_console.c
114
if (OF_read(stdin, &ch, 1) > 0) {
stand/libofw/ofw_console.c
115
saved_char = ch;
stand/libofw/ofw_console.c
87
unsigned char ch = '\0';
stand/libofw/ofw_net.c
169
char *ch = ptr;
stand/libofw/ofw_net.c
173
printf("%02x%02x%02x%02x ", ch[i], ch[i+1],
stand/libofw/ofw_net.c
174
ch[i+2], ch[i+3]);
stand/libofw/ofw_net.c
199
char *ch;
stand/libofw/ofw_net.c
203
if ((ch = strchr(path, ':')) != NULL)
stand/libofw/ofw_net.c
204
*ch = '\0';
stand/libsa/printf.c
110
*(pbuf->buf)++ = ch;
stand/libsa/printf.c
256
int ch, n;
stand/libsa/printf.c
280
while ((ch = (u_char)*fmt++) != '%' || stop) {
stand/libsa/printf.c
281
if (ch == '\0') {
stand/libsa/printf.c
285
PCHAR(ch);
stand/libsa/printf.c
291
reswitch: switch (ch = (u_char)*fmt++) {
stand/libsa/printf.c
305
PCHAR(ch);
stand/libsa/printf.c
326
n = n * 10 + ch - '0';
stand/libsa/printf.c
327
ch = *fmt;
stand/libsa/printf.c
328
if (ch < '0' || ch > '9')
stand/libsa/printf.c
99
snprint_func(int ch, void *arg)
stand/libsa/uuid_from_string.c
37
hex2int(int ch)
stand/libsa/uuid_from_string.c
39
if (ch >= '0' && ch <= '9')
stand/libsa/uuid_from_string.c
40
return ch - '0';
stand/libsa/uuid_from_string.c
41
if (ch >= 'a' && ch <= 'f')
stand/libsa/uuid_from_string.c
42
return 10 + ch - 'a';
stand/libsa/uuid_from_string.c
43
if (ch >= 'A' && ch <= 'F')
stand/libsa/uuid_from_string.c
44
return 10 + ch - 'A';
stand/powerpc/ofw/main.c
145
char *ch;
stand/powerpc/ofw/main.c
193
ch = strchr(bootpath, ':');
stand/powerpc/ofw/main.c
194
*ch = '\0';
stand/userboot/test/test.c
69
test_putc(void *arg, int ch)
stand/userboot/test/test.c
71
char c = ch;
stand/userboot/userboot.h
68
void (*putc)(void *arg, int ch);
sys/arm/allwinner/a10_ahci.c
265
ahci_a10_ch_start(struct ahci_channel *ch)
sys/arm/allwinner/a10_ahci.c
273
reg = ATA_INL(ch->r_mem, AHCI_P0DMACR);
sys/arm/allwinner/a10_ahci.c
276
ATA_OUTL(ch->r_mem, AHCI_P0DMACR, reg);
sys/arm/allwinner/a10_codec.c
623
struct a10codec_chinfo *ch = arg;
sys/arm/allwinner/a10_codec.c
628
ch->physaddr = segs[0].ds_addr;
sys/arm/allwinner/a10_codec.c
632
a10codec_transfer(struct a10codec_chinfo *ch)
sys/arm/allwinner/a10_codec.c
637
if (ch->dir == PCMDIR_PLAY) {
sys/arm/allwinner/a10_codec.c
638
src = ch->physaddr + ch->pos;
sys/arm/allwinner/a10_codec.c
639
dst = ch->fifo;
sys/arm/allwinner/a10_codec.c
641
src = ch->fifo;
sys/arm/allwinner/a10_codec.c
642
dst = ch->physaddr + ch->pos;
sys/arm/allwinner/a10_codec.c
645
error = SUNXI_DMA_TRANSFER(ch->dmac, ch->dmachan, src, dst,
sys/arm/allwinner/a10_codec.c
646
ch->blocksize);
sys/arm/allwinner/a10_codec.c
648
ch->run = 0;
sys/arm/allwinner/a10_codec.c
649
device_printf(ch->parent->dev, "DMA transfer failed: %d\n",
sys/arm/allwinner/a10_codec.c
655
a10codec_dmaconfig(struct a10codec_chinfo *ch)
sys/arm/allwinner/a10_codec.c
657
struct a10codec_info *sc = ch->parent;
sys/arm/allwinner/a10_codec.c
664
if (ch->dir == PCMDIR_PLAY) {
sys/arm/allwinner/a10_codec.c
674
SUNXI_DMA_SET_CONFIG(ch->dmac, ch->dmachan, &conf);
sys/arm/allwinner/a10_codec.c
680
struct a10codec_chinfo *ch = priv;
sys/arm/allwinner/a10_codec.c
683
bufsize = ch->buffer->bufsize;
sys/arm/allwinner/a10_codec.c
685
ch->pos += ch->blocksize;
sys/arm/allwinner/a10_codec.c
686
if (ch->pos >= bufsize)
sys/arm/allwinner/a10_codec.c
687
ch->pos -= bufsize;
sys/arm/allwinner/a10_codec.c
689
if (ch->run) {
sys/arm/allwinner/a10_codec.c
690
chn_intr(ch->channel);
sys/arm/allwinner/a10_codec.c
691
a10codec_transfer(ch);
sys/arm/allwinner/a10_codec.c
696
a10codec_fs(struct a10codec_chinfo *ch)
sys/arm/allwinner/a10_codec.c
698
switch (ch->speed) {
sys/arm/allwinner/a10_codec.c
721
a10codec_start(struct a10codec_chinfo *ch)
sys/arm/allwinner/a10_codec.c
723
struct a10codec_info *sc = ch->parent;
sys/arm/allwinner/a10_codec.c
726
ch->pos = 0;
sys/arm/allwinner/a10_codec.c
728
if (ch->dir == PCMDIR_PLAY) {
sys/arm/allwinner/a10_codec.c
737
sc->cfg->mute(sc, 0, ch->dir);
sys/arm/allwinner/a10_codec.c
740
a10codec_dmaconfig(ch);
sys/arm/allwinner/a10_codec.c
744
(AFMT_CHANNEL(ch->format) == 1 ? DAC_FIFOC_MONO_EN : 0) |
sys/arm/allwinner/a10_codec.c
745
(a10codec_fs(ch) << DAC_FIFOC_FS_SHIFT) |
sys/arm/allwinner/a10_codec.c
763
sc->cfg->mute(sc, 0, ch->dir);
sys/arm/allwinner/a10_codec.c
766
a10codec_dmaconfig(ch);
sys/arm/allwinner/a10_codec.c
772
(AFMT_CHANNEL(ch->format) == 1 ? ADC_FIFOC_MONO_EN : 0) |
sys/arm/allwinner/a10_codec.c
773
(a10codec_fs(ch) << ADC_FIFOC_FS_SHIFT) |
sys/arm/allwinner/a10_codec.c
783
a10codec_transfer(ch);
sys/arm/allwinner/a10_codec.c
787
a10codec_stop(struct a10codec_chinfo *ch)
sys/arm/allwinner/a10_codec.c
789
struct a10codec_info *sc = ch->parent;
sys/arm/allwinner/a10_codec.c
792
SUNXI_DMA_HALT(ch->dmac, ch->dmachan);
sys/arm/allwinner/a10_codec.c
794
sc->cfg->mute(sc, 1, ch->dir);
sys/arm/allwinner/a10_codec.c
796
if (ch->dir == PCMDIR_PLAY) {
sys/arm/allwinner/a10_codec.c
810
struct a10codec_chinfo *ch = dir == PCMDIR_PLAY ? &sc->play : &sc->rec;
sys/arm/allwinner/a10_codec.c
824
ch->parent = sc;
sys/arm/allwinner/a10_codec.c
825
ch->channel = c;
sys/arm/allwinner/a10_codec.c
826
ch->buffer = b;
sys/arm/allwinner/a10_codec.c
827
ch->dir = dir;
sys/arm/allwinner/a10_codec.c
828
ch->fifo = rman_get_start(sc->res[0]) +
sys/arm/allwinner/a10_codec.c
831
ch->dmac = OF_device_from_xref(xref);
sys/arm/allwinner/a10_codec.c
832
if (ch->dmac == NULL) {
sys/arm/allwinner/a10_codec.c
837
ch->dmachan = SUNXI_DMA_ALLOC(ch->dmac, false, a10codec_dmaintr, ch);
sys/arm/allwinner/a10_codec.c
838
if (ch->dmachan == NULL) {
sys/arm/allwinner/a10_codec.c
843
error = bus_dmamem_alloc(sc->dmat, &ch->dmaaddr,
sys/arm/allwinner/a10_codec.c
844
BUS_DMA_NOWAIT | BUS_DMA_COHERENT, &ch->dmamap);
sys/arm/allwinner/a10_codec.c
849
error = bus_dmamap_load(sc->dmat, ch->dmamap, ch->dmaaddr,
sys/arm/allwinner/a10_codec.c
850
sc->dmasize, a10codec_dmamap_cb, ch, BUS_DMA_NOWAIT);
sys/arm/allwinner/a10_codec.c
855
memset(ch->dmaaddr, 0, sc->dmasize);
sys/arm/allwinner/a10_codec.c
857
if (sndbuf_setup(ch->buffer, ch->dmaaddr, sc->dmasize) != 0) {
sys/arm/allwinner/a10_codec.c
862
return (ch);
sys/arm/allwinner/a10_codec.c
868
struct a10codec_chinfo *ch = data;
sys/arm/allwinner/a10_codec.c
869
struct a10codec_info *sc = ch->parent;
sys/arm/allwinner/a10_codec.c
871
SUNXI_DMA_FREE(ch->dmac, ch->dmachan);
sys/arm/allwinner/a10_codec.c
872
bus_dmamap_unload(sc->dmat, ch->dmamap);
sys/arm/allwinner/a10_codec.c
873
bus_dmamem_free(sc->dmat, ch->dmaaddr, ch->dmamap);
sys/arm/allwinner/a10_codec.c
881
struct a10codec_chinfo *ch = data;
sys/arm/allwinner/a10_codec.c
883
ch->format = format;
sys/arm/allwinner/a10_codec.c
891
struct a10codec_chinfo *ch = data;
sys/arm/allwinner/a10_codec.c
905
ch->speed = speed;
sys/arm/allwinner/a10_codec.c
910
if (ch->dir == PCMDIR_PLAY) {
sys/arm/allwinner/a10_codec.c
911
ch->speed = speed;
sys/arm/allwinner/a10_codec.c
913
ch->speed = 48000;
sys/arm/allwinner/a10_codec.c
917
ch->speed = 48000;
sys/arm/allwinner/a10_codec.c
920
ch->speed = 24000;
sys/arm/allwinner/a10_codec.c
923
ch->speed = 12000;
sys/arm/allwinner/a10_codec.c
926
ch->speed = 48000;
sys/arm/allwinner/a10_codec.c
930
return (ch->speed);
sys/arm/allwinner/a10_codec.c
936
struct a10codec_chinfo *ch = data;
sys/arm/allwinner/a10_codec.c
938
ch->blocksize = blocksize & ~3;
sys/arm/allwinner/a10_codec.c
940
return (ch->blocksize);
sys/arm/allwinner/a10_codec.c
946
struct a10codec_chinfo *ch = data;
sys/arm/allwinner/a10_codec.c
947
struct a10codec_info *sc = ch->parent;
sys/arm/allwinner/a10_codec.c
955
ch->run = 1;
sys/arm/allwinner/a10_codec.c
956
a10codec_stop(ch);
sys/arm/allwinner/a10_codec.c
957
a10codec_start(ch);
sys/arm/allwinner/a10_codec.c
961
ch->run = 0;
sys/arm/allwinner/a10_codec.c
962
a10codec_stop(ch);
sys/arm/allwinner/a10_codec.c
975
struct a10codec_chinfo *ch = data;
sys/arm/allwinner/a10_codec.c
977
return (ch->pos);
sys/arm/allwinner/a10_codec.c
983
struct a10codec_chinfo *ch = data;
sys/arm/allwinner/a10_codec.c
985
if (ch->dir == PCMDIR_PLAY) {
sys/arm/allwinner/a10_dmac.c
211
a10dmac_read_ctl(struct a10dmac_channel *ch)
sys/arm/allwinner/a10_dmac.c
213
if (ch->ch_type == CH_NDMA) {
sys/arm/allwinner/a10_dmac.c
214
return (DMACH_READ(ch, AWIN_NDMA_CTL_REG));
sys/arm/allwinner/a10_dmac.c
216
return (DMACH_READ(ch, AWIN_DDMA_CTL_REG));
sys/arm/allwinner/a10_dmac.c
221
a10dmac_write_ctl(struct a10dmac_channel *ch, uint32_t val)
sys/arm/allwinner/a10_dmac.c
223
if (ch->ch_type == CH_NDMA) {
sys/arm/allwinner/a10_dmac.c
224
DMACH_WRITE(ch, AWIN_NDMA_CTL_REG, val);
sys/arm/allwinner/a10_dmac.c
226
DMACH_WRITE(ch, AWIN_DDMA_CTL_REG, val);
sys/arm/allwinner/a10_dmac.c
233
struct a10dmac_channel *ch = priv;
sys/arm/allwinner/a10_dmac.c
298
if (ch->ch_type == CH_NDMA) {
sys/arm/allwinner/a10_dmac.c
304
DMACH_WRITE(ch, AWIN_NDMA_CTL_REG, val);
sys/arm/allwinner/a10_dmac.c
314
DMACH_WRITE(ch, AWIN_DDMA_CTL_REG, val);
sys/arm/allwinner/a10_dmac.c
321
DMACH_WRITE(ch, AWIN_DDMA_PARA_REG,
sys/arm/allwinner/a10_dmac.c
336
struct a10dmac_channel *ch = NULL;
sys/arm/allwinner/a10_dmac.c
351
ch = &ch_list[index];
sys/arm/allwinner/a10_dmac.c
352
ch->ch_callback = cb;
sys/arm/allwinner/a10_dmac.c
353
ch->ch_callbackarg = cbarg;
sys/arm/allwinner/a10_dmac.c
356
if (ch->ch_type == CH_NDMA)
sys/arm/allwinner/a10_dmac.c
367
return (ch);
sys/arm/allwinner/a10_dmac.c
373
struct a10dmac_channel *ch = priv;
sys/arm/allwinner/a10_dmac.c
374
struct a10dmac_softc *sc = ch->ch_sc;
sys/arm/allwinner/a10_dmac.c
380
cfg = a10dmac_read_ctl(ch);
sys/arm/allwinner/a10_dmac.c
381
if (ch->ch_type == CH_NDMA) {
sys/arm/allwinner/a10_dmac.c
382
sta = AWIN_DMA_IRQ_NDMA_END(ch->ch_index);
sys/arm/allwinner/a10_dmac.c
385
sta = AWIN_DMA_IRQ_DDMA_END(ch->ch_index);
sys/arm/allwinner/a10_dmac.c
389
a10dmac_write_ctl(ch, cfg);
sys/arm/allwinner/a10_dmac.c
393
ch->ch_callback = NULL;
sys/arm/allwinner/a10_dmac.c
394
ch->ch_callbackarg = NULL;
sys/arm/allwinner/a10_dmac.c
403
struct a10dmac_channel *ch = priv;
sys/arm/allwinner/a10_dmac.c
406
cfg = a10dmac_read_ctl(ch);
sys/arm/allwinner/a10_dmac.c
407
if (ch->ch_type == CH_NDMA) {
sys/arm/allwinner/a10_dmac.c
411
DMACH_WRITE(ch, AWIN_NDMA_SRC_ADDR_REG, src);
sys/arm/allwinner/a10_dmac.c
412
DMACH_WRITE(ch, AWIN_NDMA_DEST_ADDR_REG, dst);
sys/arm/allwinner/a10_dmac.c
413
DMACH_WRITE(ch, AWIN_NDMA_BC_REG, nbytes);
sys/arm/allwinner/a10_dmac.c
416
a10dmac_write_ctl(ch, cfg);
sys/arm/allwinner/a10_dmac.c
421
DMACH_WRITE(ch, AWIN_DDMA_SRC_START_ADDR_REG, src);
sys/arm/allwinner/a10_dmac.c
422
DMACH_WRITE(ch, AWIN_DDMA_DEST_START_ADDR_REG, dst);
sys/arm/allwinner/a10_dmac.c
423
DMACH_WRITE(ch, AWIN_DDMA_BC_REG, nbytes);
sys/arm/allwinner/a10_dmac.c
426
a10dmac_write_ctl(ch, cfg);
sys/arm/allwinner/a10_dmac.c
435
struct a10dmac_channel *ch = priv;
sys/arm/allwinner/a10_dmac.c
438
cfg = a10dmac_read_ctl(ch);
sys/arm/allwinner/a10_dmac.c
439
if (ch->ch_type == CH_NDMA) {
sys/arm/allwinner/a10_dmac.c
444
a10dmac_write_ctl(ch, cfg);
sys/arm/allwinner/a10_dmac.c
88
#define DMACH_READ(ch, reg) \
sys/arm/allwinner/a10_dmac.c
89
DMA_READ((ch)->ch_sc, (reg) + (ch)->ch_regoff)
sys/arm/allwinner/a10_dmac.c
90
#define DMACH_WRITE(ch, reg, val) \
sys/arm/allwinner/a10_dmac.c
91
DMA_WRITE((ch)->ch_sc, (reg) + (ch)->ch_regoff, (val))
sys/arm/allwinner/a31_dmac.c
307
struct a31dmac_channel *ch;
sys/arm/allwinner/a31_dmac.c
312
ch = priv;
sys/arm/allwinner/a31_dmac.c
313
ch->physaddr = segs[0].ds_addr;
sys/arm/allwinner/a31_dmac.c
353
struct a31dmac_channel *ch;
sys/arm/allwinner/a31_dmac.c
358
ch = priv;
sys/arm/allwinner/a31_dmac.c
440
ch->desc->config = htole32(config);
sys/arm/allwinner/a31_dmac.c
441
ch->desc->para = htole32(para);
sys/arm/allwinner/a31_dmac.c
450
struct a31dmac_channel *ch;
sys/arm/allwinner/a31_dmac.c
455
ch = NULL;
sys/arm/allwinner/a31_dmac.c
460
ch = &sc->chans[index];
sys/arm/allwinner/a31_dmac.c
461
ch->callback = cb;
sys/arm/allwinner/a31_dmac.c
462
ch->callbackarg = cbarg;
sys/arm/allwinner/a31_dmac.c
472
return (ch);
sys/arm/allwinner/a31_dmac.c
478
struct a31dmac_channel *ch;
sys/arm/allwinner/a31_dmac.c
483
ch = priv;
sys/arm/allwinner/a31_dmac.c
484
sc = ch->sc;
sys/arm/allwinner/a31_dmac.c
485
index = ch->index;
sys/arm/allwinner/a31_dmac.c
494
ch->callback = NULL;
sys/arm/allwinner/a31_dmac.c
495
ch->callbackarg = NULL;
sys/arm/allwinner/a31_dmac.c
504
struct a31dmac_channel *ch;
sys/arm/allwinner/a31_dmac.c
507
ch = priv;
sys/arm/allwinner/a31_dmac.c
508
sc = ch->sc;
sys/arm/allwinner/a31_dmac.c
510
ch->desc->srcaddr = htole32((uint32_t)src);
sys/arm/allwinner/a31_dmac.c
511
ch->desc->dstaddr = htole32((uint32_t)dst);
sys/arm/allwinner/a31_dmac.c
512
ch->desc->bcnt = htole32(nbytes);
sys/arm/allwinner/a31_dmac.c
513
ch->desc->next = htole32(DMA_NULL);
sys/arm/allwinner/a31_dmac.c
515
DMA_WRITE(sc, DMA_STAR_ADDR_REG(ch->index), (uint32_t)ch->physaddr);
sys/arm/allwinner/a31_dmac.c
516
DMA_WRITE(sc, DMA_EN_REG(ch->index), DMA_EN);
sys/arm/allwinner/a31_dmac.c
524
struct a31dmac_channel *ch;
sys/arm/allwinner/a31_dmac.c
527
ch = priv;
sys/arm/allwinner/a31_dmac.c
528
sc = ch->sc;
sys/arm/allwinner/a31_dmac.c
530
DMA_WRITE(sc, DMA_EN_REG(ch->index), 0);
sys/arm/allwinner/a31_dmac.c
56
#define DMA_IRQ_EN_REG(ch) (DMA_IRQ_EN_REG0 + ((ch) / 8) * 4)
sys/arm/allwinner/a31_dmac.c
57
#define DMA_PKG_IRQ_EN(ch) (1 << (((ch) % 8) * 4 + 1))
sys/arm/allwinner/a31_dmac.c
61
#define DMA_IRQ_PEND_REG(ch) (DMA_IRQ_PEND_REG0 + ((ch) / 8) * 4)
sys/arm/broadcom/bcm2835/bcm2835_audio.c
251
struct bcm2835_audio_chinfo *ch ;
sys/arm/broadcom/bcm2835/bcm2835_audio.c
253
ch = (void *) ((((size_t)m.u.complete.callback) << 32)
sys/arm/broadcom/bcm2835/bcm2835_audio.c
256
ch = (void *) (m.u.complete.cookie);
sys/arm/broadcom/bcm2835/bcm2835_audio.c
265
ch->callbacks++;
sys/arm/broadcom/bcm2835/bcm2835_audio.c
267
ch->underruns++;
sys/arm/broadcom/bcm2835/bcm2835_audio.c
270
if (ch->playback_state != PLAYBACK_IDLE) {
sys/arm/broadcom/bcm2835/bcm2835_audio.c
277
if (ch->playback_state != PLAYBACK_IDLE) {
sys/arm/broadcom/bcm2835/bcm2835_audio.c
279
if ((ch->available_space + count)> VCHIQ_AUDIO_BUFFER_SIZE) {
sys/arm/broadcom/bcm2835/bcm2835_audio.c
282
ch->available_space, count, perr);
sys/arm/broadcom/bcm2835/bcm2835_audio.c
285
(uintmax_t)ch->retrieved_samples,
sys/arm/broadcom/bcm2835/bcm2835_audio.c
286
(uintmax_t)ch->submitted_samples);
sys/arm/broadcom/bcm2835/bcm2835_audio.c
289
ch->available_space += count;
sys/arm/broadcom/bcm2835/bcm2835_audio.c
290
ch->retrieved_samples += count;
sys/arm/broadcom/bcm2835/bcm2835_audio.c
297
ch->available_space = VCHIQ_AUDIO_BUFFER_SIZE;
sys/arm/broadcom/bcm2835/bcm2835_audio.c
298
perr = ch->retrieved_samples; // shd be != 0
sys/arm/broadcom/bcm2835/bcm2835_audio.c
301
if ((ch->available_space >= 1*VCHIQ_AUDIO_PACKET_SIZE)){
sys/arm/broadcom/bcm2835/bcm2835_audio.c
375
bcm2835_audio_reset_channel(struct bcm2835_audio_chinfo *ch)
sys/arm/broadcom/bcm2835/bcm2835_audio.c
378
ch->available_space = VCHIQ_AUDIO_BUFFER_SIZE;
sys/arm/broadcom/bcm2835/bcm2835_audio.c
379
ch->unsubmittedptr = 0;
sys/arm/broadcom/bcm2835/bcm2835_audio.c
380
sndbuf_reset(ch->buffer);
sys/arm/broadcom/bcm2835/bcm2835_audio.c
384
bcm2835_audio_start(struct bcm2835_audio_chinfo *ch)
sys/arm/broadcom/bcm2835/bcm2835_audio.c
388
struct bcm2835_audio_info *sc = ch->parent;
sys/arm/broadcom/bcm2835/bcm2835_audio.c
403
bcm2835_audio_stop(struct bcm2835_audio_chinfo *ch)
sys/arm/broadcom/bcm2835/bcm2835_audio.c
407
struct bcm2835_audio_info *sc = ch->parent;
sys/arm/broadcom/bcm2835/bcm2835_audio.c
489
bcm2835_audio_buffer_should_sleep(struct bcm2835_audio_chinfo *ch)
sys/arm/broadcom/bcm2835/bcm2835_audio.c
492
ch->log_vars.slept_for_lack_of_space = 0;
sys/arm/broadcom/bcm2835/bcm2835_audio.c
493
if (ch->playback_state != PLAYBACK_PLAYING)
sys/arm/broadcom/bcm2835/bcm2835_audio.c
498
if (sndbuf_getready(ch->buffer)
sys/arm/broadcom/bcm2835/bcm2835_audio.c
500
ch->unsubmittedptr,
sys/arm/broadcom/bcm2835/bcm2835_audio.c
501
sndbuf_getreadyptr(ch->buffer),
sys/arm/broadcom/bcm2835/bcm2835_audio.c
502
ch->buffer->bufsize
sys/arm/broadcom/bcm2835/bcm2835_audio.c
504
ch->starved++;
sys/arm/broadcom/bcm2835/bcm2835_audio.c
509
if (ch->available_space < VCHIQ_AUDIO_PACKET_SIZE) {
sys/arm/broadcom/bcm2835/bcm2835_audio.c
510
ch->log_vars.slept_for_lack_of_space = 1;
sys/arm/broadcom/bcm2835/bcm2835_audio.c
518
bcm2835_audio_write_samples(struct bcm2835_audio_chinfo *ch, void *buf, uint32_t count)
sys/arm/broadcom/bcm2835/bcm2835_audio.c
520
struct bcm2835_audio_info *sc = ch->parent;
sys/arm/broadcom/bcm2835/bcm2835_audio.c
532
m.u.write.callback = (uint32_t)(((size_t) ch) >> 32) & 0xffffffff;
sys/arm/broadcom/bcm2835/bcm2835_audio.c
533
m.u.write.cookie = (uint32_t)(((size_t) ch) & 0xffffffff);
sys/arm/broadcom/bcm2835/bcm2835_audio.c
536
m.u.write.cookie = (uint32_t) ch;
sys/arm/broadcom/bcm2835/bcm2835_audio.c
563
struct bcm2835_audio_chinfo *ch = &sc->pch;
sys/arm/broadcom/bcm2835/bcm2835_audio.c
570
ch->playback_state = PLAYBACK_IDLE;
sys/arm/broadcom/bcm2835/bcm2835_audio.c
582
bcm2835_audio_buffer_should_sleep(ch)) {
sys/arm/broadcom/bcm2835/bcm2835_audio.c
585
(ch->log_vars.slept_for_lack_of_space)) {
sys/arm/broadcom/bcm2835/bcm2835_audio.c
598
speed = ch->spd;
sys/arm/broadcom/bcm2835/bcm2835_audio.c
599
format = ch->fmt;
sys/arm/broadcom/bcm2835/bcm2835_audio.c
603
if (ch->playback_state == PLAYBACK_IDLE)
sys/arm/broadcom/bcm2835/bcm2835_audio.c
610
(ch->playback_state == PLAYBACK_PLAYING)) {
sys/arm/broadcom/bcm2835/bcm2835_audio.c
611
bcm2835_audio_stop(ch);
sys/arm/broadcom/bcm2835/bcm2835_audio.c
614
ch->playback_state = PLAYBACK_IDLE;
sys/arm/broadcom/bcm2835/bcm2835_audio.c
615
long sub_total = ch->submitted_samples;
sys/arm/broadcom/bcm2835/bcm2835_audio.c
616
long retd = ch->retrieved_samples;
sys/arm/broadcom/bcm2835/bcm2835_audio.c
626
(ch->playback_state == PLAYBACK_IDLE)) {
sys/arm/broadcom/bcm2835/bcm2835_audio.c
628
unsigned int bsize = ch->buffer->bufsize;
sys/arm/broadcom/bcm2835/bcm2835_audio.c
630
ch->playback_state = PLAYBACK_PLAYING;
sys/arm/broadcom/bcm2835/bcm2835_audio.c
631
ch->log_vars.bsize = bsize;
sys/arm/broadcom/bcm2835/bcm2835_audio.c
634
bcm2835_audio_start(ch);
sys/arm/broadcom/bcm2835/bcm2835_audio.c
637
if (ch->playback_state == PLAYBACK_IDLE)
sys/arm/broadcom/bcm2835/bcm2835_audio.c
640
if (sndbuf_getready(ch->buffer) == 0)
sys/arm/broadcom/bcm2835/bcm2835_audio.c
646
count = i_count = sndbuf_getready(ch->buffer)
sys/arm/broadcom/bcm2835/bcm2835_audio.c
647
- MOD_DIFF(ch->unsubmittedptr,
sys/arm/broadcom/bcm2835/bcm2835_audio.c
648
sndbuf_getreadyptr(ch->buffer),
sys/arm/broadcom/bcm2835/bcm2835_audio.c
649
ch->buffer->bufsize);
sys/arm/broadcom/bcm2835/bcm2835_audio.c
650
size = ch->buffer->bufsize;
sys/arm/broadcom/bcm2835/bcm2835_audio.c
651
readyptr = ch->unsubmittedptr;
sys/arm/broadcom/bcm2835/bcm2835_audio.c
657
if (size != ch->log_vars.bsize) {
sys/arm/broadcom/bcm2835/bcm2835_audio.c
658
ch->log_vars.bsize = size;
sys/arm/broadcom/bcm2835/bcm2835_audio.c
661
available = ch->available_space;
sys/arm/broadcom/bcm2835/bcm2835_audio.c
677
if(count > ch->available_space){
sys/arm/broadcom/bcm2835/bcm2835_audio.c
678
count = ch->available_space;
sys/arm/broadcom/bcm2835/bcm2835_audio.c
703
buf = ch->buffer->buf + readyptr;
sys/arm/broadcom/bcm2835/bcm2835_audio.c
705
bcm2835_audio_write_samples(ch, buf, count);
sys/arm/broadcom/bcm2835/bcm2835_audio.c
707
ch->unsubmittedptr = (ch->unsubmittedptr + count) %
sys/arm/broadcom/bcm2835/bcm2835_audio.c
708
ch->buffer->bufsize;
sys/arm/broadcom/bcm2835/bcm2835_audio.c
709
ch->available_space -= count;
sys/arm/broadcom/bcm2835/bcm2835_audio.c
710
ch->submitted_samples += count;
sys/arm/broadcom/bcm2835/bcm2835_audio.c
712
long sub_total = ch->submitted_samples;
sys/arm/broadcom/bcm2835/bcm2835_audio.c
713
long retd = ch->retrieved_samples;
sys/arm/broadcom/bcm2835/bcm2835_audio.c
714
KASSERT(ch->available_space >= 0, ("ch->available_space == %d\n", ch->available_space));
sys/arm/broadcom/bcm2835/bcm2835_audio.c
750
struct bcm2835_audio_chinfo *ch = &sc->pch;
sys/arm/broadcom/bcm2835/bcm2835_audio.c
756
ch->parent = sc;
sys/arm/broadcom/bcm2835/bcm2835_audio.c
757
ch->channel = c;
sys/arm/broadcom/bcm2835/bcm2835_audio.c
758
ch->buffer = b;
sys/arm/broadcom/bcm2835/bcm2835_audio.c
761
ch->spd = 44100;
sys/arm/broadcom/bcm2835/bcm2835_audio.c
762
ch->fmt = SND_FORMAT(AFMT_S16_LE, 2, 0);
sys/arm/broadcom/bcm2835/bcm2835_audio.c
763
ch->blksz = VCHIQ_AUDIO_PACKET_SIZE;
sys/arm/broadcom/bcm2835/bcm2835_audio.c
767
if (sndbuf_setup(ch->buffer, buffer, sc->bufsz) != 0) {
sys/arm/broadcom/bcm2835/bcm2835_audio.c
773
ch->log_vars = DEFAULT_LOG_VALUES;
sys/arm/broadcom/bcm2835/bcm2835_audio.c
779
return ch;
sys/arm/broadcom/bcm2835/bcm2835_audio.c
785
struct bcm2835_audio_chinfo *ch = data;
sys/arm/broadcom/bcm2835/bcm2835_audio.c
788
buffer = ch->buffer->buf;
sys/arm/broadcom/bcm2835/bcm2835_audio.c
798
struct bcm2835_audio_chinfo *ch = data;
sys/arm/broadcom/bcm2835/bcm2835_audio.c
799
struct bcm2835_audio_info *sc = ch->parent;
sys/arm/broadcom/bcm2835/bcm2835_audio.c
802
ch->fmt = format;
sys/arm/broadcom/bcm2835/bcm2835_audio.c
812
struct bcm2835_audio_chinfo *ch = data;
sys/arm/broadcom/bcm2835/bcm2835_audio.c
813
struct bcm2835_audio_info *sc = ch->parent;
sys/arm/broadcom/bcm2835/bcm2835_audio.c
816
ch->spd = speed;
sys/arm/broadcom/bcm2835/bcm2835_audio.c
820
return ch->spd;
sys/arm/broadcom/bcm2835/bcm2835_audio.c
826
struct bcm2835_audio_chinfo *ch = data;
sys/arm/broadcom/bcm2835/bcm2835_audio.c
828
return ch->blksz;
sys/arm/broadcom/bcm2835/bcm2835_audio.c
834
struct bcm2835_audio_chinfo *ch = data;
sys/arm/broadcom/bcm2835/bcm2835_audio.c
835
struct bcm2835_audio_info *sc = ch->parent;
sys/arm/broadcom/bcm2835/bcm2835_audio.c
844
ch->submitted_samples = 0;
sys/arm/broadcom/bcm2835/bcm2835_audio.c
845
ch->retrieved_samples = 0;
sys/arm/broadcom/bcm2835/bcm2835_audio.c
863
struct bcm2835_audio_chinfo *ch = data;
sys/arm/broadcom/bcm2835/bcm2835_audio.c
864
struct bcm2835_audio_info *sc = ch->parent;
sys/arm/broadcom/bcm2835/bcm2835_audio.c
868
ret = ch->unsubmittedptr;
sys/arm/broadcom/bcm2835/bcm2835_dma.c
126
static void bcm_dma_reg_dump(int ch);
sys/arm/broadcom/bcm2835/bcm2835_dma.c
131
int ch;
sys/arm/broadcom/bcm2835/bcm2835_dma.c
173
bcm_dma_reset(device_t dev, int ch)
sys/arm/broadcom/bcm2835/bcm2835_dma.c
180
if (ch < 0 || ch >= BCM_DMA_CH_MAX)
sys/arm/broadcom/bcm2835/bcm2835_dma.c
183
cs = bus_read_4(sc->sc_mem, BCM_DMA_CS(ch));
sys/arm/broadcom/bcm2835/bcm2835_dma.c
187
bus_write_4(sc->sc_mem, BCM_DMA_CS(ch), 0);
sys/arm/broadcom/bcm2835/bcm2835_dma.c
191
cs = bus_read_4(sc->sc_mem, BCM_DMA_CS(ch));
sys/arm/broadcom/bcm2835/bcm2835_dma.c
196
"Can't abort DMA transfer at channel %d\n", ch);
sys/arm/broadcom/bcm2835/bcm2835_dma.c
199
bus_write_4(sc->sc_mem, BCM_DMA_CBNEXT(ch), 0);
sys/arm/broadcom/bcm2835/bcm2835_dma.c
202
bus_write_4(sc->sc_mem, BCM_DMA_CS(ch),
sys/arm/broadcom/bcm2835/bcm2835_dma.c
207
bus_write_4(sc->sc_mem, BCM_DMA_CBADDR(ch), 0);
sys/arm/broadcom/bcm2835/bcm2835_dma.c
208
bus_write_4(sc->sc_mem, BCM_DMA_CBNEXT(ch), 0);
sys/arm/broadcom/bcm2835/bcm2835_dma.c
211
cb = sc->sc_dma_ch[ch].cb;
sys/arm/broadcom/bcm2835/bcm2835_dma.c
221
struct bcm_dma_ch *ch;
sys/arm/broadcom/bcm2835/bcm2835_dma.c
268
ch = &sc->sc_dma_ch[i];
sys/arm/broadcom/bcm2835/bcm2835_dma.c
270
bzero(ch, sizeof(struct bcm_dma_ch));
sys/arm/broadcom/bcm2835/bcm2835_dma.c
271
ch->ch = i;
sys/arm/broadcom/bcm2835/bcm2835_dma.c
272
ch->flags = BCM_DMA_CH_UNMAP;
sys/arm/broadcom/bcm2835/bcm2835_dma.c
279
&ch->dma_map);
sys/arm/broadcom/bcm2835/bcm2835_dma.c
297
err = bus_dmamap_load(sc->sc_dma_tag, ch->dma_map, cb_virt,
sys/arm/broadcom/bcm2835/bcm2835_dma.c
305
ch->cb = cb_virt;
sys/arm/broadcom/bcm2835/bcm2835_dma.c
306
ch->vc_cb = cb_phys;
sys/arm/broadcom/bcm2835/bcm2835_dma.c
307
ch->flags = BCM_DMA_CH_FREE;
sys/arm/broadcom/bcm2835/bcm2835_dma.c
308
ch->cb->info = INFO_WAIT_RESP;
sys/arm/broadcom/bcm2835/bcm2835_dma.c
325
int ch = BCM_DMA_CH_INVALID;
sys/arm/broadcom/bcm2835/bcm2835_dma.c
340
ch = i;
sys/arm/broadcom/bcm2835/bcm2835_dma.c
341
sc->sc_dma_ch[ch].flags &= ~BCM_DMA_CH_FREE;
sys/arm/broadcom/bcm2835/bcm2835_dma.c
342
sc->sc_dma_ch[ch].flags |= BCM_DMA_CH_USED;
sys/arm/broadcom/bcm2835/bcm2835_dma.c
347
ch = req_ch;
sys/arm/broadcom/bcm2835/bcm2835_dma.c
348
sc->sc_dma_ch[ch].flags &= ~BCM_DMA_CH_FREE;
sys/arm/broadcom/bcm2835/bcm2835_dma.c
349
sc->sc_dma_ch[ch].flags |= BCM_DMA_CH_USED;
sys/arm/broadcom/bcm2835/bcm2835_dma.c
353
return (ch);
sys/arm/broadcom/bcm2835/bcm2835_dma.c
360
bcm_dma_free(int ch)
sys/arm/broadcom/bcm2835/bcm2835_dma.c
367
if (ch < 0 || ch >= BCM_DMA_CH_MAX)
sys/arm/broadcom/bcm2835/bcm2835_dma.c
371
if (sc->sc_dma_ch[ch].flags & BCM_DMA_CH_USED) {
sys/arm/broadcom/bcm2835/bcm2835_dma.c
372
sc->sc_dma_ch[ch].flags |= BCM_DMA_CH_FREE;
sys/arm/broadcom/bcm2835/bcm2835_dma.c
373
sc->sc_dma_ch[ch].flags &= ~BCM_DMA_CH_USED;
sys/arm/broadcom/bcm2835/bcm2835_dma.c
374
sc->sc_dma_ch[ch].intr_func = NULL;
sys/arm/broadcom/bcm2835/bcm2835_dma.c
375
sc->sc_dma_ch[ch].intr_arg = NULL;
sys/arm/broadcom/bcm2835/bcm2835_dma.c
378
bcm_dma_reset(sc->sc_dev, ch);
sys/arm/broadcom/bcm2835/bcm2835_dma.c
390
bcm_dma_setup_intr(int ch, void (*func)(int, void *), void *arg)
sys/arm/broadcom/bcm2835/bcm2835_dma.c
398
if (ch < 0 || ch >= BCM_DMA_CH_MAX)
sys/arm/broadcom/bcm2835/bcm2835_dma.c
401
if (!(sc->sc_dma_ch[ch].flags & BCM_DMA_CH_USED))
sys/arm/broadcom/bcm2835/bcm2835_dma.c
404
sc->sc_dma_ch[ch].intr_func = func;
sys/arm/broadcom/bcm2835/bcm2835_dma.c
405
sc->sc_dma_ch[ch].intr_arg = arg;
sys/arm/broadcom/bcm2835/bcm2835_dma.c
406
cb = sc->sc_dma_ch[ch].cb;
sys/arm/broadcom/bcm2835/bcm2835_dma.c
427
bcm_dma_setup_src(int ch, int dreq, int inc_addr, int width)
sys/arm/broadcom/bcm2835/bcm2835_dma.c
432
if (ch < 0 || ch >= BCM_DMA_CH_MAX)
sys/arm/broadcom/bcm2835/bcm2835_dma.c
435
if (!(sc->sc_dma_ch[ch].flags & BCM_DMA_CH_USED))
sys/arm/broadcom/bcm2835/bcm2835_dma.c
438
info = sc->sc_dma_ch[ch].cb->info;
sys/arm/broadcom/bcm2835/bcm2835_dma.c
457
sc->sc_dma_ch[ch].cb->info = info;
sys/arm/broadcom/bcm2835/bcm2835_dma.c
477
bcm_dma_setup_dst(int ch, int dreq, int inc_addr, int width)
sys/arm/broadcom/bcm2835/bcm2835_dma.c
482
if (ch < 0 || ch >= BCM_DMA_CH_MAX)
sys/arm/broadcom/bcm2835/bcm2835_dma.c
485
if (!(sc->sc_dma_ch[ch].flags & BCM_DMA_CH_USED))
sys/arm/broadcom/bcm2835/bcm2835_dma.c
488
info = sc->sc_dma_ch[ch].cb->info;
sys/arm/broadcom/bcm2835/bcm2835_dma.c
507
sc->sc_dma_ch[ch].cb->info = info;
sys/arm/broadcom/bcm2835/bcm2835_dma.c
531
bcm_dma_reg_dump(int ch)
sys/arm/broadcom/bcm2835/bcm2835_dma.c
540
if (ch < 0 || ch >= BCM_DMA_CH_MAX)
sys/arm/broadcom/bcm2835/bcm2835_dma.c
543
printf("DMA%d: ", ch);
sys/arm/broadcom/bcm2835/bcm2835_dma.c
545
reg = bus_read_4(sc->sc_mem, BCM_DMA_CH(ch) + i*4);
sys/arm/broadcom/bcm2835/bcm2835_dma.c
562
bcm_dma_start(int ch, vm_paddr_t src, vm_paddr_t dst, int len)
sys/arm/broadcom/bcm2835/bcm2835_dma.c
570
if (ch < 0 || ch >= BCM_DMA_CH_MAX)
sys/arm/broadcom/bcm2835/bcm2835_dma.c
573
if (!(sc->sc_dma_ch[ch].flags & BCM_DMA_CH_USED))
sys/arm/broadcom/bcm2835/bcm2835_dma.c
576
cb = sc->sc_dma_ch[ch].cb;
sys/arm/broadcom/bcm2835/bcm2835_dma.c
583
sc->sc_dma_ch[ch].dma_map, BUS_DMASYNC_PREWRITE);
sys/arm/broadcom/bcm2835/bcm2835_dma.c
585
bus_write_4(sc->sc_mem, BCM_DMA_CBADDR(ch),
sys/arm/broadcom/bcm2835/bcm2835_dma.c
586
sc->sc_dma_ch[ch].vc_cb);
sys/arm/broadcom/bcm2835/bcm2835_dma.c
587
bus_write_4(sc->sc_mem, BCM_DMA_CS(ch), CS_ACTIVE);
sys/arm/broadcom/bcm2835/bcm2835_dma.c
590
bcm_dma_cb_dump(sc->sc_dma_ch[ch].cb);
sys/arm/broadcom/bcm2835/bcm2835_dma.c
591
bcm_dma_reg_dump(ch);
sys/arm/broadcom/bcm2835/bcm2835_dma.c
604
bcm_dma_length(int ch)
sys/arm/broadcom/bcm2835/bcm2835_dma.c
612
if (ch < 0 || ch >= BCM_DMA_CH_MAX)
sys/arm/broadcom/bcm2835/bcm2835_dma.c
615
if (!(sc->sc_dma_ch[ch].flags & BCM_DMA_CH_USED))
sys/arm/broadcom/bcm2835/bcm2835_dma.c
618
cb = sc->sc_dma_ch[ch].cb;
sys/arm/broadcom/bcm2835/bcm2835_dma.c
627
struct bcm_dma_ch *ch = (struct bcm_dma_ch *)arg;
sys/arm/broadcom/bcm2835/bcm2835_dma.c
631
cs = bus_read_4(sc->sc_mem, BCM_DMA_CS(ch->ch));
sys/arm/broadcom/bcm2835/bcm2835_dma.c
639
if (!(ch->flags & BCM_DMA_CH_USED))
sys/arm/broadcom/bcm2835/bcm2835_dma.c
647
debug = bus_read_4(sc->sc_mem, BCM_DMA_DEBUG(ch->ch));
sys/arm/broadcom/bcm2835/bcm2835_dma.c
649
debug & DEBUG_ERROR_MASK, ch->ch);
sys/arm/broadcom/bcm2835/bcm2835_dma.c
650
bus_write_4(sc->sc_mem, BCM_DMA_DEBUG(ch->ch),
sys/arm/broadcom/bcm2835/bcm2835_dma.c
652
bcm_dma_reset(sc->sc_dev, ch->ch);
sys/arm/broadcom/bcm2835/bcm2835_dma.c
657
bus_write_4(sc->sc_mem, BCM_DMA_CS(ch->ch),
sys/arm/broadcom/bcm2835/bcm2835_dma.c
661
bus_dmamap_sync(sc->sc_dma_tag, ch->dma_map,
sys/arm/broadcom/bcm2835/bcm2835_dma.c
665
if (ch->intr_func)
sys/arm/broadcom/bcm2835/bcm2835_dma.c
666
ch->intr_func(ch->ch, ch->intr_arg);
sys/arm/broadcom/bcm2835/bcm2835_dma.h
57
int bcm_dma_free(int ch);
sys/arm/broadcom/bcm2835/bcm2835_dma.h
58
int bcm_dma_setup_intr(int ch, void (*func)(int, void *), void *arg);
sys/arm/broadcom/bcm2835/bcm2835_dma.h
59
int bcm_dma_setup_src(int ch, int dreq, int inc_addr, int width);
sys/arm/broadcom/bcm2835/bcm2835_dma.h
60
int bcm_dma_setup_dst(int ch, int dreq, int inc_addr, int width);
sys/arm/broadcom/bcm2835/bcm2835_dma.h
61
int bcm_dma_start(int ch, vm_paddr_t src, vm_paddr_t dst, int len);
sys/arm/broadcom/bcm2835/bcm2835_dma.h
62
uint32_t bcm_dma_length(int ch);
sys/arm/broadcom/bcm2835/bcm2835_sdhci.c
183
static void bcm_sdhci_dma_intr(int ch, void *arg);
sys/arm/broadcom/bcm2835/bcm2835_sdhci.c
667
bcm_sdhci_dma_intr(int ch, void *arg)
sys/arm/freescale/imx/imx6_ipu.c
255
#define IPU_READ_CH_PARAM(_sc, ch, param) bus_read_region_4( \
sys/arm/freescale/imx/imx6_ipu.c
256
(_sc)->sc_mem_res, CPMEM_BASE + ch * (sizeof(*param)),\
sys/arm/freescale/imx/imx6_ipu.c
258
#define IPU_WRITE_CH_PARAM(_sc, ch, param) bus_write_region_4( \
sys/arm/freescale/imx/imx6_ipu.c
259
(_sc)->sc_mem_res, CPMEM_BASE + ch * (sizeof(*param)),\
sys/arm/freescale/imx/imx6_ssi.c
287
struct sc_chinfo *ch;
sys/arm/freescale/imx/imx6_ssi.c
294
ch = &scp->chan[0];
sys/arm/freescale/imx/imx6_ssi.c
295
ch->dir = dir;
sys/arm/freescale/imx/imx6_ssi.c
296
ch->run = 0;
sys/arm/freescale/imx/imx6_ssi.c
297
ch->buffer = b;
sys/arm/freescale/imx/imx6_ssi.c
298
ch->channel = c;
sys/arm/freescale/imx/imx6_ssi.c
299
ch->parent = scp;
sys/arm/freescale/imx/imx6_ssi.c
302
if (sndbuf_setup(ch->buffer, sc->buf_base, sc->dma_size) != 0) {
sys/arm/freescale/imx/imx6_ssi.c
307
return ch;
sys/arm/freescale/imx/imx6_ssi.c
313
struct sc_chinfo *ch = data;
sys/arm/freescale/imx/imx6_ssi.c
314
struct sc_pcminfo *scp = ch->parent;
sys/arm/freescale/imx/imx6_ssi.c
331
struct sc_chinfo *ch = data;
sys/arm/freescale/imx/imx6_ssi.c
333
ch->format = format;
sys/arm/freescale/imx/imx6_ssi.c
342
struct sc_chinfo *ch;
sys/arm/freescale/imx/imx6_ssi.c
348
ch = data;
sys/arm/freescale/imx/imx6_ssi.c
349
scp = ch->parent;
sys/arm/freescale/imx/imx6_ssi.c
393
struct sc_chinfo *ch = data;
sys/arm/freescale/imx/imx6_ssi.c
394
struct sc_pcminfo *scp = ch->parent;
sys/arm/freescale/imx/imx6_ssi.c
397
sndbuf_resize(ch->buffer, sc->dma_size / blocksize, blocksize);
sys/arm/freescale/imx/imx6_ssi.c
401
return (ch->buffer->blksz);
sys/arm/freescale/imx/imx6_ssi.c
409
struct sc_chinfo *ch;
sys/arm/freescale/imx/imx6_ssi.c
414
ch = &scp->chan[0];
sys/arm/freescale/imx/imx6_ssi.c
418
bufsize = ch->buffer->bufsize;
sys/arm/freescale/imx/imx6_ssi.c
424
if (ch->run)
sys/arm/freescale/imx/imx6_ssi.c
425
chn_intr(ch->channel);
sys/arm/freescale/imx/imx6_ssi.c
477
struct sc_chinfo *ch;
sys/arm/freescale/imx/imx6_ssi.c
481
ch = &scp->chan[0];
sys/arm/freescale/imx/imx6_ssi.c
490
conf->period = ch->buffer->blksz;
sys/arm/freescale/imx/imx6_ssi.c
491
conf->num_bd = ch->buffer->blkcnt;
sys/arm/freescale/imx/imx6_ssi.c
500
fmt = ch->buffer->fmt;
sys/arm/freescale/imx/imx6_ssi.c
561
struct sc_chinfo *ch;
sys/arm/freescale/imx/imx6_ssi.c
564
ch = data;
sys/arm/freescale/imx/imx6_ssi.c
565
scp = ch->parent;
sys/arm/freescale/imx/imx6_ssi.c
575
ch->run = 1;
sys/arm/freescale/imx/imx6_ssi.c
586
ch->run = 0;
sys/arm/freescale/imx/imx6_ssi.c
602
struct sc_chinfo *ch;
sys/arm/freescale/imx/imx6_ssi.c
605
ch = data;
sys/arm/freescale/imx/imx6_ssi.c
606
scp = ch->parent;
sys/arm/freescale/vybrid/vf_edma.c
105
ch = &edma_map[i];
sys/arm/freescale/vybrid/vf_edma.c
106
if (ch->enabled == 1) {
sys/arm/freescale/vybrid/vf_edma.c
107
if (ch->ih != NULL) {
sys/arm/freescale/vybrid/vf_edma.c
108
ch->ih(ch->ih_user, i);
sys/arm/freescale/vybrid/vf_edma.c
138
struct edma_channel *ch;
sys/arm/freescale/vybrid/vf_edma.c
140
ch = &edma_map[chnum];
sys/arm/freescale/vybrid/vf_edma.c
141
ch->enabled = 0;
sys/arm/freescale/vybrid/vf_edma.c
143
dmamux_configure(ch->mux_num, ch->mux_src, ch->mux_chn, 0);
sys/arm/freescale/vybrid/vf_edma.c
151
struct edma_channel *ch;
sys/arm/freescale/vybrid/vf_edma.c
167
ch = NULL;
sys/arm/freescale/vybrid/vf_edma.c
169
ch = &edma_map[i];
sys/arm/freescale/vybrid/vf_edma.c
170
if (ch->enabled == 0) {
sys/arm/freescale/vybrid/vf_edma.c
173
ch = NULL;
sys/arm/freescale/vybrid/vf_edma.c
176
if (ch == NULL) {
sys/arm/freescale/vybrid/vf_edma.c
183
ch->enabled = 1;
sys/arm/freescale/vybrid/vf_edma.c
184
ch->mux_num = mux_num;
sys/arm/freescale/vybrid/vf_edma.c
185
ch->mux_src = mux_src;
sys/arm/freescale/vybrid/vf_edma.c
186
ch->mux_chn = (chnum - channel_first); /* 0 to 15 */
sys/arm/freescale/vybrid/vf_edma.c
188
dmamux_configure(ch->mux_num, ch->mux_src, ch->mux_chn, 1);
sys/arm/freescale/vybrid/vf_edma.c
208
struct edma_channel *ch;
sys/arm/freescale/vybrid/vf_edma.c
214
ch = &edma_map[chnum];
sys/arm/freescale/vybrid/vf_edma.c
215
ch->ih = tcd->ih;
sys/arm/freescale/vybrid/vf_edma.c
216
ch->ih_user = tcd->ih_user;
sys/arm/freescale/vybrid/vf_edma.c
93
struct edma_channel *ch;
sys/arm/freescale/vybrid/vf_sai.c
249
struct sc_chinfo *ch;
sys/arm/freescale/vybrid/vf_sai.c
256
ch = &scp->chan[0];
sys/arm/freescale/vybrid/vf_sai.c
257
ch->dir = dir;
sys/arm/freescale/vybrid/vf_sai.c
258
ch->run = 0;
sys/arm/freescale/vybrid/vf_sai.c
259
ch->buffer = b;
sys/arm/freescale/vybrid/vf_sai.c
260
ch->channel = c;
sys/arm/freescale/vybrid/vf_sai.c
261
ch->parent = scp;
sys/arm/freescale/vybrid/vf_sai.c
264
if (sndbuf_setup(ch->buffer, sc->buf_base, sc->dma_size) != 0) {
sys/arm/freescale/vybrid/vf_sai.c
269
return ch;
sys/arm/freescale/vybrid/vf_sai.c
275
struct sc_chinfo *ch = data;
sys/arm/freescale/vybrid/vf_sai.c
276
struct sc_pcminfo *scp = ch->parent;
sys/arm/freescale/vybrid/vf_sai.c
293
struct sc_chinfo *ch = data;
sys/arm/freescale/vybrid/vf_sai.c
295
ch->format = format;
sys/arm/freescale/vybrid/vf_sai.c
304
struct sc_chinfo *ch;
sys/arm/freescale/vybrid/vf_sai.c
310
ch = data;
sys/arm/freescale/vybrid/vf_sai.c
311
scp = ch->parent;
sys/arm/freescale/vybrid/vf_sai.c
366
struct sc_chinfo *ch = data;
sys/arm/freescale/vybrid/vf_sai.c
367
struct sc_pcminfo *scp = ch->parent;
sys/arm/freescale/vybrid/vf_sai.c
370
sndbuf_resize(ch->buffer, sc->dma_size / blocksize, blocksize);
sys/arm/freescale/vybrid/vf_sai.c
372
sc->period = ch->buffer->blksz;
sys/arm/freescale/vybrid/vf_sai.c
381
struct sc_chinfo *ch;
sys/arm/freescale/vybrid/vf_sai.c
386
ch = &scp->chan[0];
sys/arm/freescale/vybrid/vf_sai.c
395
if (ch->run)
sys/arm/freescale/vybrid/vf_sai.c
396
chn_intr(ch->channel);
sys/arm/freescale/vybrid/vf_sai.c
512
struct sc_chinfo *ch = data;
sys/arm/freescale/vybrid/vf_sai.c
513
struct sc_pcminfo *scp = ch->parent;
sys/arm/freescale/vybrid/vf_sai.c
523
ch->run = 1;
sys/arm/freescale/vybrid/vf_sai.c
531
ch->run = 0;
sys/arm/freescale/vybrid/vf_sai.c
544
struct sc_chinfo *ch;
sys/arm/freescale/vybrid/vf_sai.c
547
ch = data;
sys/arm/freescale/vybrid/vf_sai.c
548
scp = ch->parent;
sys/arm/mv/mvreg.h
142
#define SATA_EDMA_BASE(ch) (EDMA_REGISTERS_OFFSET + \
sys/arm/mv/mvreg.h
143
((ch) * EDMA_REGISTERS_SIZE))
sys/arm/mv/mvreg.h
150
#define SATA_CR_COALDIS(ch) (1 << (24 + ch))
sys/arm/mv/mvreg.h
161
#define SATA_ICR_DMADONE(ch) (1 << (ch))
sys/arm/mv/mvreg.h
163
#define SATA_ICR_DEV(ch) (1 << (8 + ch))
sys/arm/mv/mvreg.h
166
#define SATA_MICR_ERR(ch) (1 << (2 * ch))
sys/arm/mv/mvreg.h
167
#define SATA_MICR_DONE(ch) (1 << ((2 * ch) + 1))
sys/arm/mv/mvreg.h
168
#define SATA_MICR_DMADONE(ch) (1 << (4 + ch))
sys/arm/mv/mvreg.h
174
#define SATA_SHADOWR_BASE(ch) (SATA_EDMA_BASE(ch) + 0x100)
sys/arm/mv/mvreg.h
175
#define SATA_SHADOWR_CONTROL(ch) (SATA_EDMA_BASE(ch) + 0x120)
sys/arm/mv/mvreg.h
178
#define SATA_SATA_SSTATUS(ch) (SATA_EDMA_BASE(ch) + 0x300)
sys/arm/mv/mvreg.h
179
#define SATA_SATA_SERROR(ch) (SATA_EDMA_BASE(ch) + 0x304)
sys/arm/mv/mvreg.h
180
#define SATA_SATA_SCONTROL(ch) (SATA_EDMA_BASE(ch) + 0x308)
sys/arm/mv/mvreg.h
181
#define SATA_SATA_FISICR(ch) (SATA_EDMA_BASE(ch) + 0x364)
sys/arm/mv/mvreg.h
184
#define SATA_EDMA_CFG(ch) (SATA_EDMA_BASE(ch) + 0x000)
sys/arm/mv/mvreg.h
188
#define SATA_EDMA_IECR(ch) (SATA_EDMA_BASE(ch) + 0x008)
sys/arm/mv/mvreg.h
190
#define SATA_EDMA_IEMR(ch) (SATA_EDMA_BASE(ch) + 0x00C)
sys/arm/mv/mvreg.h
191
#define SATA_EDMA_REQBAHR(ch) (SATA_EDMA_BASE(ch) + 0x010)
sys/arm/mv/mvreg.h
192
#define SATA_EDMA_REQIPR(ch) (SATA_EDMA_BASE(ch) + 0x014)
sys/arm/mv/mvreg.h
193
#define SATA_EDMA_REQOPR(ch) (SATA_EDMA_BASE(ch) + 0x018)
sys/arm/mv/mvreg.h
194
#define SATA_EDMA_RESBAHR(ch) (SATA_EDMA_BASE(ch) + 0x01C)
sys/arm/mv/mvreg.h
195
#define SATA_EDMA_RESIPR(ch) (SATA_EDMA_BASE(ch) + 0x020)
sys/arm/mv/mvreg.h
196
#define SATA_EDMA_RESOPR(ch) (SATA_EDMA_BASE(ch) + 0x024)
sys/arm/mv/mvreg.h
198
#define SATA_EDMA_CMD(ch) (SATA_EDMA_BASE(ch) + 0x028)
sys/arm/mv/mvreg.h
203
#define SATA_EDMA_STATUS(ch) (SATA_EDMA_BASE(ch) + 0x030)
sys/arm/ti/ti_edma3.c
282
ti_edma3_enable_event_intr(unsigned int ch)
sys/arm/ti/ti_edma3.c
286
if (ch >= TI_EDMA3_NUM_DMA_CHS)
sys/arm/ti/ti_edma3.c
289
if (ch < 32) {
sys/arm/ti/ti_edma3.c
290
ti_edma3_cc_wr_4(TI_EDMA3CC_S_IESR(0), 1 << ch);
sys/arm/ti/ti_edma3.c
292
ti_edma3_cc_wr_4(TI_EDMA3CC_S_IESRH(0), 1 << (ch - 32));
sys/arm/ti/ti_edma3.c
299
ti_edma3_request_dma_ch(unsigned int ch, unsigned int tccn, unsigned int eqn)
sys/arm/ti/ti_edma3.c
303
if (ch >= TI_EDMA3_NUM_DMA_CHS)
sys/arm/ti/ti_edma3.c
307
if (ch < 32) {
sys/arm/ti/ti_edma3.c
309
reg |= (0x01 << ch);
sys/arm/ti/ti_edma3.c
313
reg |= (0x01 << (ch - 32));
sys/arm/ti/ti_edma3.c
318
reg = ti_edma3_cc_rd_4(TI_EDMA3CC_DMAQNUM(ch >> 3));
sys/arm/ti/ti_edma3.c
319
reg &= TI_EDMA3CC_DMAQNUM_CLR(ch);
sys/arm/ti/ti_edma3.c
320
reg |= TI_EDMA3CC_DMAQNUM_SET((ch), eqn);
sys/arm/ti/ti_edma3.c
321
ti_edma3_cc_wr_4(TI_EDMA3CC_DMAQNUM(ch >> 3), reg);
sys/arm/ti/ti_edma3.c
324
reg = ti_edma3_cc_rd_4(TI_EDMA3CC_OPT(ch));
sys/arm/ti/ti_edma3.c
326
reg |= TI_EDMA3CC_OPT_TCC_SET(ch);
sys/arm/ti/ti_edma3.c
327
ti_edma3_cc_wr_4(TI_EDMA3CC_OPT(ch), reg);
sys/arm/ti/ti_edma3.c
333
ti_edma3_request_qdma_ch(unsigned int ch, unsigned int tccn, unsigned int eqn)
sys/arm/ti/ti_edma3.c
337
if (ch >= TI_EDMA3_NUM_DMA_CHS)
sys/arm/ti/ti_edma3.c
342
reg |= (0x01 << ch);
sys/arm/ti/ti_edma3.c
347
reg |= TI_EDMA3CC_QDMAQNUM_SET(ch, eqn);
sys/arm/ti/ti_edma3.c
351
reg = ti_edma3_cc_rd_4(TI_EDMA3CC_OPT(ch));
sys/arm/ti/ti_edma3.c
353
reg |= TI_EDMA3CC_OPT_TCC_SET(ch);
sys/arm/ti/ti_edma3.c
354
ti_edma3_cc_wr_4(TI_EDMA3CC_OPT(ch), reg);
sys/arm/ti/ti_edma3.c
360
ti_edma3_enable_transfer_manual(unsigned int ch)
sys/arm/ti/ti_edma3.c
362
if (ch >= TI_EDMA3_NUM_DMA_CHS)
sys/arm/ti/ti_edma3.c
366
if (ch < 32) {
sys/arm/ti/ti_edma3.c
367
ti_edma3_cc_wr_4(TI_EDMA3CC_S_ESR(0), 1 << ch);
sys/arm/ti/ti_edma3.c
369
ti_edma3_cc_wr_4(TI_EDMA3CC_S_ESRH(0), 1 << (ch - 32));
sys/arm/ti/ti_edma3.c
376
ti_edma3_enable_transfer_qdma(unsigned int ch)
sys/arm/ti/ti_edma3.c
378
if (ch >= TI_EDMA3_NUM_QDMA_CHS)
sys/arm/ti/ti_edma3.c
382
ti_edma3_cc_wr_4(TI_EDMA3CC_S_QEESR(0), (1 << ch));
sys/arm/ti/ti_edma3.c
388
ti_edma3_enable_transfer_event(unsigned int ch)
sys/arm/ti/ti_edma3.c
390
if (ch >= TI_EDMA3_NUM_DMA_CHS)
sys/arm/ti/ti_edma3.c
395
if(ch < 32) {
sys/arm/ti/ti_edma3.c
396
ti_edma3_cc_wr_4(TI_EDMA3CC_S_SECR(0), (1 << ch));
sys/arm/ti/ti_edma3.c
397
ti_edma3_cc_wr_4(TI_EDMA3CC_EMCR, (1 << ch));
sys/arm/ti/ti_edma3.c
398
ti_edma3_cc_wr_4(TI_EDMA3CC_S_EESR(0), (1 << ch));
sys/arm/ti/ti_edma3.c
400
ti_edma3_cc_wr_4(TI_EDMA3CC_S_SECRH(0), 1 << (ch - 32));
sys/arm/ti/ti_edma3.c
401
ti_edma3_cc_wr_4(TI_EDMA3CC_EMCRH, 1 << (ch - 32));
sys/arm/ti/ti_edma3.c
402
ti_edma3_cc_wr_4(TI_EDMA3CC_S_EESRH(0), 1 << (ch - 32));
sys/arm/ti/ti_edma3.c
409
ti_edma3_param_write(unsigned int ch, struct ti_edma3cc_param_set *prs)
sys/arm/ti/ti_edma3.c
411
bus_write_region_4(ti_edma3_sc->mem_res[0], TI_EDMA3CC_OPT(ch),
sys/arm/ti/ti_edma3.c
416
ti_edma3_param_read(unsigned int ch, struct ti_edma3cc_param_set *prs)
sys/arm/ti/ti_edma3.c
418
bus_read_region_4(ti_edma3_sc->mem_res[0], TI_EDMA3CC_OPT(ch),
sys/arm/ti/ti_edma3.h
72
int ti_edma3_request_dma_ch(unsigned int ch, unsigned int tccn, unsigned int eqn);
sys/arm/ti/ti_edma3.h
73
int ti_edma3_request_qdma_ch(unsigned int ch, unsigned int tccn, unsigned int eqn);
sys/arm/ti/ti_edma3.h
74
int ti_edma3_enable_transfer_manual(unsigned int ch);
sys/arm/ti/ti_edma3.h
75
int ti_edma3_enable_transfer_qdma(unsigned int ch);
sys/arm/ti/ti_edma3.h
76
int ti_edma3_enable_transfer_event(unsigned int ch);
sys/arm/ti/ti_edma3.h
78
void ti_edma3_param_write(unsigned int ch, struct ti_edma3cc_param_set *prs);
sys/arm/ti/ti_edma3.h
79
void ti_edma3_param_read(unsigned int ch, struct ti_edma3cc_param_set *prs);
sys/arm/ti/ti_sdma.c
1017
ti_sdma_sync_params(unsigned int ch, unsigned int trigger, unsigned int mode)
sys/arm/ti/ti_sdma.c
1028
if ((sc->sc_active_channels & (1 << ch)) == 0) {
sys/arm/ti/ti_sdma.c
1033
ccr = sc->sc_channel[ch].reg_ccr;
sys/arm/ti/ti_sdma.c
1053
sc->sc_channel[ch].reg_ccr = ccr;
sys/arm/ti/ti_sdma.c
1055
sc->sc_channel[ch].need_reg_write = 1;
sys/arm/ti/ti_sdma.c
1080
ti_sdma_set_addr_mode(unsigned int ch, unsigned int src_mode,
sys/arm/ti/ti_sdma.c
1092
if ((sc->sc_active_channels & (1 << ch)) == 0) {
sys/arm/ti/ti_sdma.c
1097
ccr = sc->sc_channel[ch].reg_ccr;
sys/arm/ti/ti_sdma.c
1105
sc->sc_channel[ch].reg_ccr = ccr;
sys/arm/ti/ti_sdma.c
1107
sc->sc_channel[ch].need_reg_write = 1;
sys/arm/ti/ti_sdma.c
218
unsigned int ch, j;
sys/arm/ti/ti_sdma.c
231
for (ch = 0; ch < NUM_DMA_CHANNELS; ch++) {
sys/arm/ti/ti_sdma.c
232
if (intr & (1 << ch)) {
sys/arm/ti/ti_sdma.c
233
channel = &sc->sc_channel[ch];
sys/arm/ti/ti_sdma.c
236
csr = ti_sdma_read_4(sc, DMA4_CSR(ch));
sys/arm/ti/ti_sdma.c
239
"%d\n", ch);
sys/arm/ti/ti_sdma.c
244
if ((sc->sc_active_channels & (1 << ch)) == 0) {
sys/arm/ti/ti_sdma.c
246
"channel %d\n", j, ch);
sys/arm/ti/ti_sdma.c
254
ch);
sys/arm/ti/ti_sdma.c
257
"on channel %u\n", ch);
sys/arm/ti/ti_sdma.c
260
"on channel %u\n", ch);
sys/arm/ti/ti_sdma.c
263
"channel %u\n", ch);
sys/arm/ti/ti_sdma.c
273
ti_sdma_write_4(sc, DMA4_CSR(ch), DMA4_CSR_CLEAR_MASK);
sys/arm/ti/ti_sdma.c
274
ti_sdma_write_4(sc, DMA4_IRQSTATUS_L(j), (1 << ch));
sys/arm/ti/ti_sdma.c
278
channel->callback(ch, csr, channel->callback_data);
sys/arm/ti/ti_sdma.c
313
ti_sdma_activate_channel(unsigned int *ch,
sys/arm/ti/ti_sdma.c
314
void (*callback)(unsigned int ch, uint32_t status, void *data),
sys/arm/ti/ti_sdma.c
326
if (ch == NULL)
sys/arm/ti/ti_sdma.c
341
*ch = i;
sys/arm/ti/ti_sdma.c
347
channel = &sc->sc_channel[*ch];
sys/arm/ti/ti_sdma.c
378
for (addr = DMA4_CCR(*ch); addr <= DMA4_COLOR(*ch); addr += 4)
sys/arm/ti/ti_sdma.c
399
ti_sdma_deactivate_channel(unsigned int ch)
sys/arm/ti/ti_sdma.c
412
if ((sc->sc_active_channels & (1 << ch)) == 0) {
sys/arm/ti/ti_sdma.c
418
sc->sc_active_channels &= ~(1 << ch);
sys/arm/ti/ti_sdma.c
421
ti_sdma_write_4(sc, DMA4_CICR(ch), 0);
sys/arm/ti/ti_sdma.c
424
ti_sdma_write_4(sc, DMA4_CCR(ch), 0);
sys/arm/ti/ti_sdma.c
427
ti_sdma_write_4(sc, DMA4_CSR(ch), DMA4_CSR_CLEAR_MASK);
sys/arm/ti/ti_sdma.c
429
ti_sdma_write_4(sc, DMA4_IRQSTATUS_L(j), (1 << ch));
sys/arm/ti/ti_sdma.c
433
for (addr = DMA4_CCR(ch); addr <= DMA4_COLOR(ch); addr += 4)
sys/arm/ti/ti_sdma.c
454
ti_sdma_disable_channel_irq(unsigned int ch)
sys/arm/ti/ti_sdma.c
466
if ((sc->sc_active_channels & (1 << ch)) == 0) {
sys/arm/ti/ti_sdma.c
472
sc->sc_channel[ch].reg_cicr = 0x0000;
sys/arm/ti/ti_sdma.c
473
ti_sdma_write_4(sc, DMA4_CICR(ch), 0x0000);
sys/arm/ti/ti_sdma.c
478
irq_enable &= ~(1 << ch);
sys/arm/ti/ti_sdma.c
484
sc->sc_channel[ch].need_reg_write = 1;
sys/arm/ti/ti_sdma.c
513
ti_sdma_enable_channel_irq(unsigned int ch, uint32_t flags)
sys/arm/ti/ti_sdma.c
524
if ((sc->sc_active_channels & (1 << ch)) == 0) {
sys/arm/ti/ti_sdma.c
533
sc->sc_channel[ch].reg_cicr = flags;
sys/arm/ti/ti_sdma.c
536
ti_sdma_write_4(sc, DMA4_CICR(ch), flags);
sys/arm/ti/ti_sdma.c
540
irq_enable |= (1 << ch);
sys/arm/ti/ti_sdma.c
545
sc->sc_channel[ch].need_reg_write = 1;
sys/arm/ti/ti_sdma.c
579
ti_sdma_get_channel_status(unsigned int ch, uint32_t *status)
sys/arm/ti/ti_sdma.c
590
if ((sc->sc_active_channels & (1 << ch)) == 0) {
sys/arm/ti/ti_sdma.c
597
csr = ti_sdma_read_4(sc, DMA4_CSR(ch));
sys/arm/ti/ti_sdma.c
622
ti_sdma_start_xfer(unsigned int ch, unsigned int src_paddr,
sys/arm/ti/ti_sdma.c
636
if ((sc->sc_active_channels & (1 << ch)) == 0) {
sys/arm/ti/ti_sdma.c
641
channel = &sc->sc_channel[ch];
sys/arm/ti/ti_sdma.c
644
ti_sdma_write_4(sc, DMA4_CSDP(ch),
sys/arm/ti/ti_sdma.c
648
ti_sdma_write_4(sc, DMA4_CEN(ch), elmcnt);
sys/arm/ti/ti_sdma.c
651
ti_sdma_write_4(sc, DMA4_CFN(ch), frmcnt);
sys/arm/ti/ti_sdma.c
654
ti_sdma_write_4(sc, DMA4_CSSA(ch), src_paddr);
sys/arm/ti/ti_sdma.c
655
ti_sdma_write_4(sc, DMA4_CDSA(ch), dst_paddr);
sys/arm/ti/ti_sdma.c
658
ti_sdma_write_4(sc, DMA4_CCR(ch), channel->reg_ccr);
sys/arm/ti/ti_sdma.c
661
ti_sdma_write_4(sc, DMA4_CSE(ch), 0x0001);
sys/arm/ti/ti_sdma.c
664
ti_sdma_write_4(sc, DMA4_CSF(ch), 0x0001);
sys/arm/ti/ti_sdma.c
667
ti_sdma_write_4(sc, DMA4_CDE(ch), 0x0001);
sys/arm/ti/ti_sdma.c
670
ti_sdma_write_4(sc, DMA4_CDF(ch), 0x0001);
sys/arm/ti/ti_sdma.c
673
ti_sdma_write_4(sc, DMA4_CSR(ch), 0x1FFE);
sys/arm/ti/ti_sdma.c
676
ccr = ti_sdma_read_4(sc, DMA4_CCR(ch));
sys/arm/ti/ti_sdma.c
678
ti_sdma_write_4(sc, DMA4_CCR(ch), ccr);
sys/arm/ti/ti_sdma.c
716
ti_sdma_start_xfer_packet(unsigned int ch, unsigned int src_paddr,
sys/arm/ti/ti_sdma.c
730
if ((sc->sc_active_channels & (1 << ch)) == 0) {
sys/arm/ti/ti_sdma.c
735
channel = &sc->sc_channel[ch];
sys/arm/ti/ti_sdma.c
739
ti_sdma_write_4(sc, DMA4_CSDP(ch),
sys/arm/ti/ti_sdma.c
743
ti_sdma_write_4(sc, DMA4_CEN(ch), elmcnt);
sys/arm/ti/ti_sdma.c
746
ti_sdma_write_4(sc, DMA4_CFN(ch), frmcnt);
sys/arm/ti/ti_sdma.c
749
ti_sdma_write_4(sc, DMA4_CSSA(ch), src_paddr);
sys/arm/ti/ti_sdma.c
750
ti_sdma_write_4(sc, DMA4_CDSA(ch), dst_paddr);
sys/arm/ti/ti_sdma.c
753
ti_sdma_write_4(sc, DMA4_CCR(ch),
sys/arm/ti/ti_sdma.c
757
ti_sdma_write_4(sc, DMA4_CSE(ch), 0x0001);
sys/arm/ti/ti_sdma.c
761
ti_sdma_write_4(sc, DMA4_CSF(ch), pktsize);
sys/arm/ti/ti_sdma.c
763
ti_sdma_write_4(sc, DMA4_CDF(ch), pktsize);
sys/arm/ti/ti_sdma.c
766
ti_sdma_write_4(sc, DMA4_CDE(ch), 0x0001);
sys/arm/ti/ti_sdma.c
769
ti_sdma_write_4(sc, DMA4_CSR(ch), 0x1FFE);
sys/arm/ti/ti_sdma.c
772
ccr = ti_sdma_read_4(sc, DMA4_CCR(ch));
sys/arm/ti/ti_sdma.c
774
ti_sdma_write_4(sc, DMA4_CCR(ch), ccr);
sys/arm/ti/ti_sdma.c
797
ti_sdma_stop_xfer(unsigned int ch)
sys/arm/ti/ti_sdma.c
808
if ((sc->sc_active_channels & (1 << ch)) == 0) {
sys/arm/ti/ti_sdma.c
814
ti_sdma_write_4(sc, DMA4_CICR(ch), 0);
sys/arm/ti/ti_sdma.c
817
ti_sdma_write_4(sc, DMA4_CCR(ch), 0);
sys/arm/ti/ti_sdma.c
820
ti_sdma_write_4(sc, DMA4_CSR(ch), DMA4_CSR_CLEAR_MASK);
sys/arm/ti/ti_sdma.c
822
ti_sdma_write_4(sc, DMA4_IRQSTATUS_L(j), (1 << ch));
sys/arm/ti/ti_sdma.c
826
sc->sc_channel[ch].need_reg_write = 1;
sys/arm/ti/ti_sdma.c
847
ti_sdma_set_xfer_endianess(unsigned int ch, unsigned int src, unsigned int dst)
sys/arm/ti/ti_sdma.c
857
if ((sc->sc_active_channels & (1 << ch)) == 0) {
sys/arm/ti/ti_sdma.c
862
sc->sc_channel[ch].reg_csdp &= ~DMA4_CSDP_SRC_ENDIANISM(1);
sys/arm/ti/ti_sdma.c
863
sc->sc_channel[ch].reg_csdp |= DMA4_CSDP_SRC_ENDIANISM(src);
sys/arm/ti/ti_sdma.c
865
sc->sc_channel[ch].reg_csdp &= ~DMA4_CSDP_DST_ENDIANISM(1);
sys/arm/ti/ti_sdma.c
866
sc->sc_channel[ch].reg_csdp |= DMA4_CSDP_DST_ENDIANISM(dst);
sys/arm/ti/ti_sdma.c
868
sc->sc_channel[ch].need_reg_write = 1;
sys/arm/ti/ti_sdma.c
892
ti_sdma_set_xfer_burst(unsigned int ch, unsigned int src, unsigned int dst)
sys/arm/ti/ti_sdma.c
902
if ((sc->sc_active_channels & (1 << ch)) == 0) {
sys/arm/ti/ti_sdma.c
907
sc->sc_channel[ch].reg_csdp &= ~DMA4_CSDP_SRC_BURST_MODE(0x3);
sys/arm/ti/ti_sdma.c
908
sc->sc_channel[ch].reg_csdp |= DMA4_CSDP_SRC_BURST_MODE(src);
sys/arm/ti/ti_sdma.c
91
void (*callback)(unsigned int ch, uint32_t ch_status, void *data);
sys/arm/ti/ti_sdma.c
910
sc->sc_channel[ch].reg_csdp &= ~DMA4_CSDP_DST_BURST_MODE(0x3);
sys/arm/ti/ti_sdma.c
911
sc->sc_channel[ch].reg_csdp |= DMA4_CSDP_DST_BURST_MODE(dst);
sys/arm/ti/ti_sdma.c
913
sc->sc_channel[ch].need_reg_write = 1;
sys/arm/ti/ti_sdma.c
934
ti_sdma_set_xfer_data_type(unsigned int ch, unsigned int type)
sys/arm/ti/ti_sdma.c
944
if ((sc->sc_active_channels & (1 << ch)) == 0) {
sys/arm/ti/ti_sdma.c
949
sc->sc_channel[ch].reg_csdp &= ~DMA4_CSDP_DATA_TYPE(0x3);
sys/arm/ti/ti_sdma.c
950
sc->sc_channel[ch].reg_csdp |= DMA4_CSDP_DATA_TYPE(type);
sys/arm/ti/ti_sdma.c
952
sc->sc_channel[ch].need_reg_write = 1;
sys/arm/ti/ti_sdma.c
972
ti_sdma_set_callback(unsigned int ch,
sys/arm/ti/ti_sdma.c
973
void (*callback)(unsigned int ch, uint32_t status, void *data),
sys/arm/ti/ti_sdma.c
984
if ((sc->sc_active_channels & (1 << ch)) == 0) {
sys/arm/ti/ti_sdma.c
989
sc->sc_channel[ch].callback = callback;
sys/arm/ti/ti_sdma.c
990
sc->sc_channel[ch].callback_data = data;
sys/arm/ti/ti_sdma.c
992
sc->sc_channel[ch].need_reg_write = 1;
sys/arm/ti/ti_sdma.h
100
int ti_sdma_enable_channel_irq(unsigned int ch, uint32_t flags);
sys/arm/ti/ti_sdma.h
101
int ti_sdma_disable_channel_irq(unsigned int ch);
sys/arm/ti/ti_sdma.h
102
int ti_sdma_get_channel_status(unsigned int ch, uint32_t *status);
sys/arm/ti/ti_sdma.h
103
int ti_sdma_set_xfer_endianess(unsigned int ch, unsigned int src, unsigned int dst);
sys/arm/ti/ti_sdma.h
104
int ti_sdma_set_xfer_burst(unsigned int ch, unsigned int src, unsigned int dst);
sys/arm/ti/ti_sdma.h
105
int ti_sdma_set_xfer_data_type(unsigned int ch, unsigned int type);
sys/arm/ti/ti_sdma.h
106
int ti_sdma_set_callback(unsigned int ch,
sys/arm/ti/ti_sdma.h
107
void (*callback)(unsigned int ch, uint32_t status, void *data), void *data);
sys/arm/ti/ti_sdma.h
108
int ti_sdma_sync_params(unsigned int ch, unsigned int trigger, unsigned int mode);
sys/arm/ti/ti_sdma.h
109
int ti_sdma_set_addr_mode(unsigned int ch, unsigned int src_mode, unsigned int dst_mode);
sys/arm/ti/ti_sdma.h
91
int ti_sdma_activate_channel(unsigned int *ch,
sys/arm/ti/ti_sdma.h
92
void (*callback)(unsigned int ch, uint32_t status, void *data), void *data);
sys/arm/ti/ti_sdma.h
93
int ti_sdma_deactivate_channel(unsigned int ch);
sys/arm/ti/ti_sdma.h
94
int ti_sdma_start_xfer(unsigned int ch, unsigned int src_paddr,
sys/arm/ti/ti_sdma.h
96
int ti_sdma_start_xfer_packet(unsigned int ch, unsigned int src_paddr,
sys/arm/ti/ti_sdma.h
99
int ti_sdma_stop_xfer(unsigned int ch);
sys/arm/ti/ti_spi.c
119
ti_spi_set_clock(struct ti_spi_softc *sc, int ch, int freq)
sys/arm/ti/ti_spi.c
139
reg = TI_SPI_READ(sc, MCSPI_CTRL_CH(ch));
sys/arm/ti/ti_spi.c
142
TI_SPI_WRITE(sc, MCSPI_CTRL_CH(ch), reg);
sys/arm/ti/ti_spi.c
144
reg = TI_SPI_READ(sc, MCSPI_CONF_CH(ch));
sys/arm/ti/ti_spi.c
146
TI_SPI_WRITE(sc, MCSPI_CONF_CH(ch), reg | conf);
sys/cam/ctl/ctl_ha.c
137
ctl_ha_evt(struct ha_softc *softc, ctl_ha_channel ch, ctl_ha_event evt,
sys/cam/ctl/ctl_ha.c
142
if (ch < CTL_HA_CHAN_MAX) {
sys/cam/ctl/ctl_ha.c
143
if (softc->ha_handler[ch])
sys/cam/ctl/ctl_ha.c
144
softc->ha_handler[ch](ch, evt, param);
sys/cam/scsi/scsi_ch.c
211
PERIPHDRIVER_DECLARE(ch, chdriver);
sys/cddl/dev/dtrace/dtrace_debug.c
233
int ch, n;
sys/cddl/dev/dtrace/dtrace_debug.c
250
while ((ch = (u_char)*fmt++) != '%' || stop) {
sys/cddl/dev/dtrace/dtrace_debug.c
251
if (ch == '\0') {
sys/cddl/dev/dtrace/dtrace_debug.c
255
dtrace_debug__putc(cpu, ch);
sys/cddl/dev/dtrace/dtrace_debug.c
261
reswitch: switch (ch = (u_char)*fmt++) {
sys/cddl/dev/dtrace/dtrace_debug.c
275
dtrace_debug__putc(cpu, ch);
sys/cddl/dev/dtrace/dtrace_debug.c
296
n = n * 10 + ch - '0';
sys/cddl/dev/dtrace/dtrace_debug.c
297
ch = *fmt;
sys/cddl/dev/dtrace/dtrace_debug.c
298
if (ch < '0' || ch > '9')
sys/compat/linuxkpi/common/include/linux/string.h
187
u8 ch;
sys/compat/linuxkpi/common/include/linux/string.h
189
ch = c;
sys/compat/linuxkpi/common/include/linux/string.h
194
if (*ptr != ch)
sys/compat/linuxkpi/common/include/linux/string.h
249
strnchr(const char *cp, size_t n, int ch)
sys/compat/linuxkpi/common/include/linux/string.h
254
if (*p == ch)
sys/compat/linuxkpi/common/include/linux/string.h
294
memcpy_and_pad(void *dst, size_t dstlen, const void *src, size_t len, int ch)
sys/compat/linuxkpi/common/include/linux/string.h
302
memset((char *)dst + len, ch, dstlen - len);
sys/ddb/db_capture.c
180
char ch;
sys/ddb/db_capture.c
191
ch = '\0';
sys/ddb/db_capture.c
192
return (SYSCTL_OUT(req, &ch, sizeof(ch)));
sys/ddb/db_capture.c
220
db_capture_writech(char ch)
sys/ddb/db_capture.c
223
return (db_capture_write(&ch, sizeof(ch)));
sys/ddb/db_script.c
227
db_command_trimmable(char ch)
sys/ddb/db_script.c
230
switch (ch) {
sys/ddb/ddb.h
317
void db_capture_writech(char ch);
sys/dev/ahci/ahci.c
1006
struct ahci_channel *ch = device_get_softc(dev);
sys/dev/ahci/ahci.c
1009
ATA_OUTL(ch->r_mem, AHCI_P_IE, 0);
sys/dev/ahci/ahci.c
1011
ahci_stop(ch);
sys/dev/ahci/ahci.c
1012
ahci_stop_fr(ch);
sys/dev/ahci/ahci.c
1013
ATA_OUTL(ch->r_mem, AHCI_P_CMD, 0);
sys/dev/ahci/ahci.c
1015
ATA_OUTL(ch->r_mem, AHCI_P_SCTL, 0);
sys/dev/ahci/ahci.c
1017
ATA_OUTL(ch->r_mem, AHCI_P_CMD, AHCI_P_CMD_SLUMBER);
sys/dev/ahci/ahci.c
1020
ATA_OUTL(ch->r_mem, AHCI_P_SCTL, ATA_SC_DET_DISABLE);
sys/dev/ahci/ahci.c
1027
struct ahci_channel *ch = device_get_softc(dev);
sys/dev/ahci/ahci.c
1029
mtx_lock(&ch->mtx);
sys/dev/ahci/ahci.c
1030
xpt_freeze_simq(ch->sim, 1);
sys/dev/ahci/ahci.c
1032
if (ch->resetting) {
sys/dev/ahci/ahci.c
1033
ch->resetting = 0;
sys/dev/ahci/ahci.c
1034
callout_stop(&ch->reset_timer);
sys/dev/ahci/ahci.c
1035
xpt_release_simq(ch->sim, TRUE);
sys/dev/ahci/ahci.c
1037
while (ch->oslots)
sys/dev/ahci/ahci.c
1038
msleep(ch, &ch->mtx, PRIBIO, "ahcisusp", hz/100);
sys/dev/ahci/ahci.c
1040
mtx_unlock(&ch->mtx);
sys/dev/ahci/ahci.c
1047
struct ahci_channel *ch = device_get_softc(dev);
sys/dev/ahci/ahci.c
1049
mtx_lock(&ch->mtx);
sys/dev/ahci/ahci.c
105
ahci_ch_detval(struct ahci_channel *ch, uint32_t val)
sys/dev/ahci/ahci.c
1051
ahci_reset(ch);
sys/dev/ahci/ahci.c
1052
xpt_release_simq(ch->sim, TRUE);
sys/dev/ahci/ahci.c
1053
mtx_unlock(&ch->mtx);
sys/dev/ahci/ahci.c
108
return ch->disablephy ? ATA_SC_DET_DISABLE : val;
sys/dev/ahci/ahci.c
1080
struct ahci_channel *ch = device_get_softc(dev);
sys/dev/ahci/ahci.c
1089
0, NULL, NULL, &ch->dma.work_tag);
sys/dev/ahci/ahci.c
1092
error = bus_dmamem_alloc(ch->dma.work_tag, (void **)&ch->dma.work,
sys/dev/ahci/ahci.c
1093
BUS_DMA_ZERO, &ch->dma.work_map);
sys/dev/ahci/ahci.c
1096
error = bus_dmamap_load(ch->dma.work_tag, ch->dma.work_map, ch->dma.work,
sys/dev/ahci/ahci.c
1099
bus_dmamem_free(ch->dma.work_tag, ch->dma.work, ch->dma.work_map);
sys/dev/ahci/ahci.c
1102
ch->dma.work_bus = dcba.maddr;
sys/dev/ahci/ahci.c
1104
if (ch->chcaps & AHCI_P_CMD_FBSCP)
sys/dev/ahci/ahci.c
1111
0, NULL, NULL, &ch->dma.rfis_tag);
sys/dev/ahci/ahci.c
1114
error = bus_dmamem_alloc(ch->dma.rfis_tag, (void **)&ch->dma.rfis, 0,
sys/dev/ahci/ahci.c
1115
&ch->dma.rfis_map);
sys/dev/ahci/ahci.c
1118
error = bus_dmamap_load(ch->dma.rfis_tag, ch->dma.rfis_map, ch->dma.rfis,
sys/dev/ahci/ahci.c
1121
bus_dmamem_free(ch->dma.rfis_tag, ch->dma.rfis, ch->dma.rfis_map);
sys/dev/ahci/ahci.c
1124
ch->dma.rfis_bus = dcba.maddr;
sys/dev/ahci/ahci.c
1130
0, busdma_lock_mutex, &ch->mtx, &ch->dma.data_tag);
sys/dev/ahci/ahci.c
1153
struct ahci_channel *ch = device_get_softc(dev);
sys/dev/ahci/ahci.c
1155
if (ch->dma.data_tag) {
sys/dev/ahci/ahci.c
1156
bus_dma_tag_destroy(ch->dma.data_tag);
sys/dev/ahci/ahci.c
1157
ch->dma.data_tag = NULL;
sys/dev/ahci/ahci.c
1159
if (ch->dma.rfis_bus) {
sys/dev/ahci/ahci.c
1160
bus_dmamap_unload(ch->dma.rfis_tag, ch->dma.rfis_map);
sys/dev/ahci/ahci.c
1161
bus_dmamem_free(ch->dma.rfis_tag, ch->dma.rfis, ch->dma.rfis_map);
sys/dev/ahci/ahci.c
1162
ch->dma.rfis_bus = 0;
sys/dev/ahci/ahci.c
1163
ch->dma.rfis = NULL;
sys/dev/ahci/ahci.c
1165
if (ch->dma.work_bus) {
sys/dev/ahci/ahci.c
1166
bus_dmamap_unload(ch->dma.work_tag, ch->dma.work_map);
sys/dev/ahci/ahci.c
1167
bus_dmamem_free(ch->dma.work_tag, ch->dma.work, ch->dma.work_map);
sys/dev/ahci/ahci.c
1168
ch->dma.work_bus = 0;
sys/dev/ahci/ahci.c
1169
ch->dma.work = NULL;
sys/dev/ahci/ahci.c
1171
if (ch->dma.work_tag) {
sys/dev/ahci/ahci.c
1172
bus_dma_tag_destroy(ch->dma.work_tag);
sys/dev/ahci/ahci.c
1173
ch->dma.work_tag = NULL;
sys/dev/ahci/ahci.c
1180
struct ahci_channel *ch = device_get_softc(dev);
sys/dev/ahci/ahci.c
1184
bzero(ch->slot, sizeof(ch->slot));
sys/dev/ahci/ahci.c
1185
for (i = 0; i < ch->numslots; i++) {
sys/dev/ahci/ahci.c
1186
struct ahci_slot *slot = &ch->slot[i];
sys/dev/ahci/ahci.c
1188
slot->ch = ch;
sys/dev/ahci/ahci.c
1193
callout_init_mtx(&slot->timeout, &ch->mtx, 0);
sys/dev/ahci/ahci.c
1195
if (bus_dmamap_create(ch->dma.data_tag, 0, &slot->dma.data_map))
sys/dev/ahci/ahci.c
1196
device_printf(ch->dev, "FAILURE - create data_map\n");
sys/dev/ahci/ahci.c
1203
struct ahci_channel *ch = device_get_softc(dev);
sys/dev/ahci/ahci.c
1207
for (i = 0; i < ch->numslots; i++) {
sys/dev/ahci/ahci.c
1208
struct ahci_slot *slot = &ch->slot[i];
sys/dev/ahci/ahci.c
1212
bus_dmamap_destroy(ch->dma.data_tag, slot->dma.data_map);
sys/dev/ahci/ahci.c
1219
ahci_phy_check_events(struct ahci_channel *ch, u_int32_t serr)
sys/dev/ahci/ahci.c
1222
if (((ch->pm_level == 0) && (serr & ATA_SE_PHY_CHANGED)) ||
sys/dev/ahci/ahci.c
1223
((ch->pm_level != 0 || ch->listening) && (serr & ATA_SE_EXCHANGED))) {
sys/dev/ahci/ahci.c
1224
u_int32_t status = ATA_INL(ch->r_mem, AHCI_P_SSTS);
sys/dev/ahci/ahci.c
1229
device_printf(ch->dev, "CONNECT requested\n");
sys/dev/ahci/ahci.c
1231
device_printf(ch->dev, "DISCONNECT requested\n");
sys/dev/ahci/ahci.c
1233
ahci_reset(ch);
sys/dev/ahci/ahci.c
1237
cam_sim_path(ch->sim),
sys/dev/ahci/ahci.c
1249
ahci_cpd_check_events(struct ahci_channel *ch)
sys/dev/ahci/ahci.c
1255
if (ch->pm_level == 0)
sys/dev/ahci/ahci.c
1258
status = ATA_INL(ch->r_mem, AHCI_P_CMD);
sys/dev/ahci/ahci.c
1263
dev = ch->dev;
sys/dev/ahci/ahci.c
1269
ahci_reset(ch);
sys/dev/ahci/ahci.c
1272
if (xpt_create_path(&ccb->ccb_h.path, NULL, cam_sim_path(ch->sim),
sys/dev/ahci/ahci.c
1281
ahci_notify_events(struct ahci_channel *ch, u_int32_t status)
sys/dev/ahci/ahci.c
1286
if (ch->caps & AHCI_CAP_SSNTF)
sys/dev/ahci/ahci.c
1287
ATA_OUTL(ch->r_mem, AHCI_P_SNTF, status);
sys/dev/ahci/ahci.c
1289
device_printf(ch->dev, "SNTF 0x%04x\n", status);
sys/dev/ahci/ahci.c
1294
xpt_path_path_id(ch->path), i, 0) == CAM_REQ_CMP) {
sys/dev/ahci/ahci.c
1302
ahci_done(struct ahci_channel *ch, union ccb *ccb)
sys/dev/ahci/ahci.c
1305
mtx_assert(&ch->mtx, MA_OWNED);
sys/dev/ahci/ahci.c
1307
ch->batch == 0) {
sys/dev/ahci/ahci.c
1312
STAILQ_INSERT_TAIL(&ch->doneq, &ccb->ccb_h, sim_links.stqe);
sys/dev/ahci/ahci.c
1318
struct ahci_channel *ch = (struct ahci_channel *)arg;
sys/dev/ahci/ahci.c
1322
istatus = ATA_INL(ch->r_mem, AHCI_P_IS);
sys/dev/ahci/ahci.c
1324
mtx_lock(&ch->mtx);
sys/dev/ahci/ahci.c
1325
ahci_ch_intr_main(ch, istatus);
sys/dev/ahci/ahci.c
1326
mtx_unlock(&ch->mtx);
sys/dev/ahci/ahci.c
1332
struct ahci_channel *ch = (struct ahci_channel *)arg;
sys/dev/ahci/ahci.c
1338
istatus = ATA_INL(ch->r_mem, AHCI_P_IS);
sys/dev/ahci/ahci.c
1340
mtx_lock(&ch->mtx);
sys/dev/ahci/ahci.c
1341
ch->batch = 1;
sys/dev/ahci/ahci.c
1342
ahci_ch_intr_main(ch, istatus);
sys/dev/ahci/ahci.c
1343
ch->batch = 0;
sys/dev/ahci/ahci.c
1348
STAILQ_CONCAT(&tmp_doneq, &ch->doneq);
sys/dev/ahci/ahci.c
1349
mtx_unlock(&ch->mtx);
sys/dev/ahci/ahci.c
1359
struct ahci_channel *ch = (struct ahci_channel *)arg;
sys/dev/ahci/ahci.c
1362
if (ch->numrslots != 0)
sys/dev/ahci/ahci.c
1364
work = ATA_INL(ch->r_mem, AHCI_P_CMD);
sys/dev/ahci/ahci.c
1365
if (ch->pm_level == 4)
sys/dev/ahci/ahci.c
1369
ATA_OUTL(ch->r_mem, AHCI_P_CMD, work);
sys/dev/ahci/ahci.c
1373
ahci_ch_intr_main(struct ahci_channel *ch, uint32_t istatus)
sys/dev/ahci/ahci.c
1380
ATA_OUTL(ch->r_mem, AHCI_P_IS, istatus);
sys/dev/ahci/ahci.c
1382
if (ch->numtslots != 0)
sys/dev/ahci/ahci.c
1383
cstatus = ATA_INL(ch->r_mem, AHCI_P_SACT);
sys/dev/ahci/ahci.c
1386
if (ch->numrslots != ch->numtslots)
sys/dev/ahci/ahci.c
1387
cstatus |= ATA_INL(ch->r_mem, AHCI_P_CI);
sys/dev/ahci/ahci.c
1390
(ch->pm_present || ch->curr[0].atapi != 0)) {
sys/dev/ahci/ahci.c
1391
if (ch->caps & AHCI_CAP_SSNTF)
sys/dev/ahci/ahci.c
1392
sntf = ATA_INL(ch->r_mem, AHCI_P_SNTF);
sys/dev/ahci/ahci.c
1393
else if (ch->fbs_enabled) {
sys/dev/ahci/ahci.c
1394
u_int8_t *fis = ch->dma.rfis + 0x58;
sys/dev/ahci/ahci.c
1404
u_int8_t *fis = ch->dma.rfis + 0x58;
sys/dev/ahci/ahci.c
1413
serr = ATA_INL(ch->r_mem, AHCI_P_SERR);
sys/dev/ahci/ahci.c
1415
ATA_OUTL(ch->r_mem, AHCI_P_SERR, serr);
sys/dev/ahci/ahci.c
1416
reset = ahci_phy_check_events(ch, serr);
sys/dev/ahci/ahci.c
1421
ahci_cpd_check_events(ch);
sys/dev/ahci/ahci.c
1425
if (ch->quirks & AHCI_Q_NOCCS) {
sys/dev/ahci/ahci.c
1430
cstatus |= ch->rslots;
sys/dev/ahci/ahci.c
1435
ccs = (ATA_INL(ch->r_mem, AHCI_P_CMD) &
sys/dev/ahci/ahci.c
1442
if (ch->fbs_enabled) {
sys/dev/ahci/ahci.c
1443
uint32_t fbs = ATA_INL(ch->r_mem, AHCI_P_FBS);
sys/dev/ahci/ahci.c
1449
if (ch->numrslotspd[i] == 0)
sys/dev/ahci/ahci.c
1460
err = ch->rslots & cstatus;
sys/dev/ahci/ahci.c
1467
ok = ch->rslots & ~cstatus;
sys/dev/ahci/ahci.c
1468
for (i = 0; i < ch->numslots; i++) {
sys/dev/ahci/ahci.c
1470
ahci_end_transaction(&ch->slot[i], AHCI_ERR_NONE);
sys/dev/ahci/ahci.c
1474
if (ch->frozen) {
sys/dev/ahci/ahci.c
1475
union ccb *fccb = ch->frozen;
sys/dev/ahci/ahci.c
1476
ch->frozen = NULL;
sys/dev/ahci/ahci.c
1482
ahci_done(ch, fccb);
sys/dev/ahci/ahci.c
1484
for (i = 0; i < ch->numslots; i++) {
sys/dev/ahci/ahci.c
1489
ch->slot[i].ccb->ccb_h.target_id != port)
sys/dev/ahci/ahci.c
1494
if (ch->numtslotspd[
sys/dev/ahci/ahci.c
1495
ch->slot[i].ccb->ccb_h.target_id] == 0) {
sys/dev/ahci/ahci.c
1507
ch->fatalerr = 1;
sys/dev/ahci/ahci.c
1510
if (ch->numtslots == 0 && i != ccs && port != -2)
sys/dev/ahci/ahci.c
1516
ahci_end_transaction(&ch->slot[i], et);
sys/dev/ahci/ahci.c
1522
if (ch->rslots != 0 && !ch->recoverycmd)
sys/dev/ahci/ahci.c
1523
ATA_OUTL(ch->r_mem, AHCI_P_FBS, AHCI_P_FBS_EN | AHCI_P_FBS_DEC);
sys/dev/ahci/ahci.c
1527
ahci_notify_events(ch, sntf);
sys/dev/ahci/ahci.c
1532
ahci_check_collision(struct ahci_channel *ch, union ccb *ccb)
sys/dev/ahci/ahci.c
1539
if (((~ch->oslots) & (0xffffffff >> (32 -
sys/dev/ahci/ahci.c
1540
ch->curr[t].tags))) == 0)
sys/dev/ahci/ahci.c
1543
if (ch->fbs_enabled) {
sys/dev/ahci/ahci.c
1545
if (ch->numrslotspd[t] != 0 && ch->numtslotspd[t] == 0)
sys/dev/ahci/ahci.c
1549
if (ch->numrslots != 0 && ch->numtslots == 0)
sys/dev/ahci/ahci.c
1552
if (ch->numtslots != 0 &&
sys/dev/ahci/ahci.c
1553
ch->taggedtarget != ccb->ccb_h.target_id)
sys/dev/ahci/ahci.c
1558
if (ch->fbs_enabled) {
sys/dev/ahci/ahci.c
1560
if (ch->numrslotspd[t] != 0 && ch->numtslotspd[t] != 0)
sys/dev/ahci/ahci.c
1564
if (ch->numrslots != 0 && ch->numtslots != 0)
sys/dev/ahci/ahci.c
1571
if (ch->numrslots != 0)
sys/dev/ahci/ahci.c
1575
if (ch->aslots != 0)
sys/dev/ahci/ahci.c
1582
ahci_begin_transaction(struct ahci_channel *ch, union ccb *ccb)
sys/dev/ahci/ahci.c
1588
tags = ch->numslots;
sys/dev/ahci/ahci.c
1591
tags = ch->curr[ccb->ccb_h.target_id].tags;
sys/dev/ahci/ahci.c
1592
if (ch->lastslot + 1 < tags)
sys/dev/ahci/ahci.c
1593
tag = ffs(~(ch->oslots >> (ch->lastslot + 1)));
sys/dev/ahci/ahci.c
1596
if (tag == 0 || tag + ch->lastslot >= tags)
sys/dev/ahci/ahci.c
1597
tag = ffs(~ch->oslots) - 1;
sys/dev/ahci/ahci.c
1599
tag += ch->lastslot;
sys/dev/ahci/ahci.c
1600
ch->lastslot = tag;
sys/dev/ahci/ahci.c
1602
slot = &ch->slot[tag];
sys/dev/ahci/ahci.c
1605
if (ch->numrslots == 0 && ch->pm_level > 3)
sys/dev/ahci/ahci.c
1606
callout_stop(&ch->pm_timer);
sys/dev/ahci/ahci.c
1608
ch->oslots |= (1 << tag);
sys/dev/ahci/ahci.c
1609
ch->numrslots++;
sys/dev/ahci/ahci.c
1610
ch->numrslotspd[ccb->ccb_h.target_id]++;
sys/dev/ahci/ahci.c
1613
ch->numtslots++;
sys/dev/ahci/ahci.c
1614
ch->numtslotspd[ccb->ccb_h.target_id]++;
sys/dev/ahci/ahci.c
1615
ch->taggedtarget = ccb->ccb_h.target_id;
sys/dev/ahci/ahci.c
1619
ch->aslots |= (1 << tag);
sys/dev/ahci/ahci.c
1622
bus_dmamap_load_ccb(ch->dma.data_tag, slot->dma.data_map, ccb,
sys/dev/ahci/ahci.c
1635
struct ahci_channel *ch = slot->ch;
sys/dev/ahci/ahci.c
1641
device_printf(ch->dev, "DMA load error\n");
sys/dev/ahci/ahci.c
1647
ctp = (struct ahci_cmd_tab *)(ch->dma.work + slot->ct_offset);
sys/dev/ahci/ahci.c
1655
bus_dmamap_sync(ch->dma.data_tag, slot->dma.data_map,
sys/dev/ahci/ahci.c
1665
struct ahci_channel *ch = slot->ch;
sys/dev/ahci/ahci.c
1671
uint8_t *fis = ch->dma.rfis + 0x40;
sys/dev/ahci/ahci.c
1676
ctp = (struct ahci_cmd_tab *)(ch->dma.work + slot->ct_offset);
sys/dev/ahci/ahci.c
1678
if (!(fis_size = ahci_setup_fis(ch, ctp, ccb, slot->slot))) {
sys/dev/ahci/ahci.c
1679
device_printf(ch->dev, "Setting up SATA FIS failed\n");
sys/dev/ahci/ahci.c
1685
(ch->dma.work + AHCI_CL_OFFSET + (AHCI_CL_SIZE * slot->slot));
sys/dev/ahci/ahci.c
1699
ahci_stop(ch);
sys/dev/ahci/ahci.c
1700
ahci_clo(ch);
sys/dev/ahci/ahci.c
1701
ahci_start(ch, 0);
sys/dev/ahci/ahci.c
1713
clp->cmd_table_phys = htole64(ch->dma.work_bus + slot->ct_offset);
sys/dev/ahci/ahci.c
1714
bus_dmamap_sync(ch->dma.work_tag, ch->dma.work_map,
sys/dev/ahci/ahci.c
1716
bus_dmamap_sync(ch->dma.rfis_tag, ch->dma.rfis_map,
sys/dev/ahci/ahci.c
1721
ATA_OUTL(ch->r_mem, AHCI_P_SACT, 1 << slot->slot);
sys/dev/ahci/ahci.c
1724
if (ch->fbs_enabled) {
sys/dev/ahci/ahci.c
1725
ATA_OUTL(ch->r_mem, AHCI_P_FBS, AHCI_P_FBS_EN |
sys/dev/ahci/ahci.c
1730
ch->rslots |= (1 << slot->slot);
sys/dev/ahci/ahci.c
1731
ATA_OUTL(ch->r_mem, AHCI_P_CI, (1 << slot->slot));
sys/dev/ahci/ahci.c
1740
if (!(ATA_INL(ch->r_mem, AHCI_P_CI) & (1 << slot->slot)))
sys/dev/ahci/ahci.c
1742
if ((ATA_INL(ch->r_mem, AHCI_P_TFD) & ATA_S_ERROR) &&
sys/dev/ahci/ahci.c
1745
device_printf(ch->dev,
sys/dev/ahci/ahci.c
1747
slot->slot, ATA_INL(ch->r_mem, AHCI_P_TFD));
sys/dev/ahci/ahci.c
1754
(ch->quirks & AHCI_Q_ATI_PMP_BUG) &&
sys/dev/ahci/ahci.c
1755
(ATA_INL(ch->r_mem, AHCI_P_IS) & AHCI_P_IX_IPM)) {
sys/dev/ahci/ahci.c
1766
if (ch->quirks & AHCI_Q_MRVL_SR_DEL)
sys/dev/ahci/ahci.c
1776
if ((ch->quirks & AHCI_Q_NOBSYRES) == 0 &&
sys/dev/ahci/ahci.c
1777
(ch->quirks & AHCI_Q_ATI_PMP_BUG) == 0 &&
sys/dev/ahci/ahci.c
1780
bus_dmamap_sync(ch->dma.rfis_tag,
sys/dev/ahci/ahci.c
1781
ch->dma.rfis_map, BUS_DMASYNC_POSTREAD);
sys/dev/ahci/ahci.c
1783
bus_dmamap_sync(ch->dma.rfis_tag,
sys/dev/ahci/ahci.c
1784
ch->dma.rfis_map, BUS_DMASYNC_PREREAD);
sys/dev/ahci/ahci.c
1792
device_printf(ch->dev, "Poll timeout on slot %d port %d\n",
sys/dev/ahci/ahci.c
1794
device_printf(ch->dev, "is %08x cs %08x ss %08x "
sys/dev/ahci/ahci.c
1796
ATA_INL(ch->r_mem, AHCI_P_IS),
sys/dev/ahci/ahci.c
1797
ATA_INL(ch->r_mem, AHCI_P_CI),
sys/dev/ahci/ahci.c
1798
ATA_INL(ch->r_mem, AHCI_P_SACT), ch->rslots,
sys/dev/ahci/ahci.c
1799
ATA_INL(ch->r_mem, AHCI_P_TFD),
sys/dev/ahci/ahci.c
1800
ATA_INL(ch->r_mem, AHCI_P_SERR),
sys/dev/ahci/ahci.c
1801
ATA_INL(ch->r_mem, AHCI_P_CMD));
sys/dev/ahci/ahci.c
1807
ch->eslots |= (1 << slot->slot);
sys/dev/ahci/ahci.c
1819
ahci_process_timeout(struct ahci_channel *ch)
sys/dev/ahci/ahci.c
1823
mtx_assert(&ch->mtx, MA_OWNED);
sys/dev/ahci/ahci.c
1825
for (i = 0; i < ch->numslots; i++) {
sys/dev/ahci/ahci.c
1827
if (ch->slot[i].state < AHCI_SLOT_RUNNING)
sys/dev/ahci/ahci.c
1829
ahci_end_transaction(&ch->slot[i], AHCI_ERR_TIMEOUT);
sys/dev/ahci/ahci.c
1835
ahci_rearm_timeout(struct ahci_channel *ch)
sys/dev/ahci/ahci.c
1839
mtx_assert(&ch->mtx, MA_OWNED);
sys/dev/ahci/ahci.c
1840
for (i = 0; i < ch->numslots; i++) {
sys/dev/ahci/ahci.c
1841
struct ahci_slot *slot = &ch->slot[i];
sys/dev/ahci/ahci.c
1846
if ((ch->toslots & (1 << i)) == 0)
sys/dev/ahci/ahci.c
1859
struct ahci_channel *ch = slot->ch;
sys/dev/ahci/ahci.c
1860
device_t dev = ch->dev;
sys/dev/ahci/ahci.c
1872
sstatus = ATA_INL(ch->r_mem, AHCI_P_SACT);
sys/dev/ahci/ahci.c
1873
ccs = (ATA_INL(ch->r_mem, AHCI_P_CMD) & AHCI_P_CMD_CCS_MASK)
sys/dev/ahci/ahci.c
1876
ch->fbs_enabled || ch->wrongccs)
sys/dev/ahci/ahci.c
1878
else if ((ch->rslots & (1 << ccs)) == 0) {
sys/dev/ahci/ahci.c
1879
ch->wrongccs = 1;
sys/dev/ahci/ahci.c
1893
ATA_INL(ch->r_mem, AHCI_P_IS), ATA_INL(ch->r_mem, AHCI_P_CI),
sys/dev/ahci/ahci.c
1894
ATA_INL(ch->r_mem, AHCI_P_SACT), ch->rslots,
sys/dev/ahci/ahci.c
1895
ATA_INL(ch->r_mem, AHCI_P_TFD), ATA_INL(ch->r_mem, AHCI_P_SERR),
sys/dev/ahci/ahci.c
1896
ATA_INL(ch->r_mem, AHCI_P_CMD));
sys/dev/ahci/ahci.c
1899
if (ch->frozen) {
sys/dev/ahci/ahci.c
1900
union ccb *fccb = ch->frozen;
sys/dev/ahci/ahci.c
1901
ch->frozen = NULL;
sys/dev/ahci/ahci.c
1907
ahci_done(ch, fccb);
sys/dev/ahci/ahci.c
1909
if (!ch->fbs_enabled && !ch->wrongccs) {
sys/dev/ahci/ahci.c
1911
ch->fatalerr = 1;
sys/dev/ahci/ahci.c
1913
ahci_end_transaction(&ch->slot[slot->slot], AHCI_ERR_TIMEOUT);
sys/dev/ahci/ahci.c
1915
for (i = 0; i < ch->numslots; i++) {
sys/dev/ahci/ahci.c
1917
if (ch->slot[i].state < AHCI_SLOT_RUNNING)
sys/dev/ahci/ahci.c
1919
ahci_end_transaction(&ch->slot[i], AHCI_ERR_INNOCENT);
sys/dev/ahci/ahci.c
1923
if (ch->toslots == 0)
sys/dev/ahci/ahci.c
1924
xpt_freeze_simq(ch->sim, 1);
sys/dev/ahci/ahci.c
1925
ch->toslots |= (1 << slot->slot);
sys/dev/ahci/ahci.c
1926
if ((ch->rslots & ~ch->toslots) == 0)
sys/dev/ahci/ahci.c
1927
ahci_process_timeout(ch);
sys/dev/ahci/ahci.c
1930
ch->rslots & ~ch->toslots);
sys/dev/ahci/ahci.c
1938
struct ahci_channel *ch = slot->ch;
sys/dev/ahci/ahci.c
1944
bus_dmamap_sync(ch->dma.work_tag, ch->dma.work_map,
sys/dev/ahci/ahci.c
1947
(ch->dma.work + AHCI_CL_OFFSET + (AHCI_CL_SIZE * slot->slot));
sys/dev/ahci/ahci.c
1957
u_int8_t *fis = ch->dma.rfis + 0x40;
sys/dev/ahci/ahci.c
1959
bus_dmamap_sync(ch->dma.rfis_tag, ch->dma.rfis_map,
sys/dev/ahci/ahci.c
1961
if (ch->fbs_enabled) {
sys/dev/ahci/ahci.c
1966
uint16_t tfd = ATA_INL(ch->r_mem, AHCI_P_TFD);
sys/dev/ahci/ahci.c
1985
if ((ch->quirks & AHCI_Q_ALTSIG) &&
sys/dev/ahci/ahci.c
1988
sig = ATA_INL(ch->r_mem, AHCI_P_SIG);
sys/dev/ahci/ahci.c
1998
(ch->quirks & AHCI_Q_NOCOUNT) == 0) {
sys/dev/ahci/ahci.c
2004
(ch->quirks & AHCI_Q_NOCOUNT) == 0) {
sys/dev/ahci/ahci.c
2010
bus_dmamap_sync(ch->dma.data_tag, slot->dma.data_map,
sys/dev/ahci/ahci.c
2013
bus_dmamap_unload(ch->dma.data_tag, slot->dma.data_map);
sys/dev/ahci/ahci.c
2016
ch->eslots |= (1 << slot->slot);
sys/dev/ahci/ahci.c
2018
if ((et != AHCI_ERR_NONE) && (!ch->recoverycmd) &&
sys/dev/ahci/ahci.c
2032
ch->fatalerr = 1;
sys/dev/ahci/ahci.c
2048
ch->fatalerr = 1;
sys/dev/ahci/ahci.c
2049
if (!ch->recoverycmd) {
sys/dev/ahci/ahci.c
2050
xpt_freeze_simq(ch->sim, 1);
sys/dev/ahci/ahci.c
2057
if (!ch->recoverycmd) {
sys/dev/ahci/ahci.c
2058
xpt_freeze_simq(ch->sim, 1);
sys/dev/ahci/ahci.c
2065
ch->fatalerr = 1;
sys/dev/ahci/ahci.c
2069
ch->oslots &= ~(1 << slot->slot);
sys/dev/ahci/ahci.c
2070
ch->rslots &= ~(1 << slot->slot);
sys/dev/ahci/ahci.c
2071
ch->aslots &= ~(1 << slot->slot);
sys/dev/ahci/ahci.c
2075
ch->numrslots--;
sys/dev/ahci/ahci.c
2076
ch->numrslotspd[ccb->ccb_h.target_id]--;
sys/dev/ahci/ahci.c
2079
ch->numtslots--;
sys/dev/ahci/ahci.c
2080
ch->numtslotspd[ccb->ccb_h.target_id]--;
sys/dev/ahci/ahci.c
2084
lastto = (ch->toslots == (1 << slot->slot));
sys/dev/ahci/ahci.c
2085
ch->toslots &= ~(1 << slot->slot);
sys/dev/ahci/ahci.c
2087
xpt_release_simq(ch->sim, TRUE);
sys/dev/ahci/ahci.c
2096
ahci_begin_transaction(ch, ccb);
sys/dev/ahci/ahci.c
2101
ahci_process_read_log(ch, ccb);
sys/dev/ahci/ahci.c
2104
ahci_process_request_sense(ch, ccb);
sys/dev/ahci/ahci.c
2109
ch->hold[slot->slot] = ccb;
sys/dev/ahci/ahci.c
2110
ch->numhslots++;
sys/dev/ahci/ahci.c
2112
ahci_done(ch, ccb);
sys/dev/ahci/ahci.c
2114
if (ch->rslots == 0) {
sys/dev/ahci/ahci.c
2116
if (ch->toslots != 0 || ch->fatalerr) {
sys/dev/ahci/ahci.c
2117
ahci_reset(ch);
sys/dev/ahci/ahci.c
2120
if (ch->eslots != 0) {
sys/dev/ahci/ahci.c
2121
ahci_stop(ch);
sys/dev/ahci/ahci.c
2122
ahci_clo(ch);
sys/dev/ahci/ahci.c
2123
ahci_start(ch, 1);
sys/dev/ahci/ahci.c
2126
if (!ch->recoverycmd && ch->numhslots)
sys/dev/ahci/ahci.c
2127
ahci_issue_recovery(ch);
sys/dev/ahci/ahci.c
2130
} else if ((ch->rslots & ~ch->toslots) == 0 &&
sys/dev/ahci/ahci.c
2132
ahci_rearm_timeout(ch);
sys/dev/ahci/ahci.c
2134
if (ch->frozen && !ahci_check_collision(ch, ch->frozen)) {
sys/dev/ahci/ahci.c
2135
union ccb *fccb = ch->frozen;
sys/dev/ahci/ahci.c
2136
ch->frozen = NULL;
sys/dev/ahci/ahci.c
2137
ahci_begin_transaction(ch, fccb);
sys/dev/ahci/ahci.c
2138
xpt_release_simq(ch->sim, TRUE);
sys/dev/ahci/ahci.c
2141
if (ch->numrslots == 0 && ch->pm_level > 3 &&
sys/dev/ahci/ahci.c
2142
(ch->curr[ch->pm_present ? 15 : 0].caps & CTS_SATA_CAPS_D_PMREQ)) {
sys/dev/ahci/ahci.c
2143
callout_schedule(&ch->pm_timer,
sys/dev/ahci/ahci.c
2144
(ch->pm_level == 4) ? hz / 1000 : hz / 8);
sys/dev/ahci/ahci.c
2149
ahci_issue_recovery(struct ahci_channel *ch)
sys/dev/ahci/ahci.c
2157
for (i = 0; i < ch->numslots; i++) {
sys/dev/ahci/ahci.c
2158
if (ch->hold[i])
sys/dev/ahci/ahci.c
2163
device_printf(ch->dev, "Unable to allocate recovery command\n");
sys/dev/ahci/ahci.c
2166
for (i = 0; i < ch->numslots; i++) {
sys/dev/ahci/ahci.c
2167
if (ch->hold[i] == NULL)
sys/dev/ahci/ahci.c
2169
ch->hold[i]->ccb_h.status &= ~CAM_STATUS_MASK;
sys/dev/ahci/ahci.c
2170
ch->hold[i]->ccb_h.status |= CAM_RESRC_UNAVAIL;
sys/dev/ahci/ahci.c
2171
ahci_done(ch, ch->hold[i]);
sys/dev/ahci/ahci.c
2172
ch->hold[i] = NULL;
sys/dev/ahci/ahci.c
2173
ch->numhslots--;
sys/dev/ahci/ahci.c
2175
ahci_reset(ch);
sys/dev/ahci/ahci.c
2178
xpt_setup_ccb(&ccb->ccb_h, ch->hold[i]->ccb_h.path,
sys/dev/ahci/ahci.c
2179
ch->hold[i]->ccb_h.pinfo.priority);
sys/dev/ahci/ahci.c
2180
if (ch->hold[i]->ccb_h.func_code == XPT_ATA_IO) {
sys/dev/ahci/ahci.c
2190
device_printf(ch->dev,
sys/dev/ahci/ahci.c
2212
csio->data_ptr = (void *)&ch->hold[i]->csio.sense_data;
sys/dev/ahci/ahci.c
2213
csio->dxfer_len = ch->hold[i]->csio.sense_len;
sys/dev/ahci/ahci.c
2220
ch->recoverycmd = 1;
sys/dev/ahci/ahci.c
2221
xpt_freeze_simq(ch->sim, 1);
sys/dev/ahci/ahci.c
2222
ahci_begin_transaction(ch, ccb);
sys/dev/ahci/ahci.c
2226
ahci_process_read_log(struct ahci_channel *ch, union ccb *ccb)
sys/dev/ahci/ahci.c
2232
ch->recoverycmd = 0;
sys/dev/ahci/ahci.c
2237
for (i = 0; i < ch->numslots; i++) {
sys/dev/ahci/ahci.c
2238
if (!ch->hold[i])
sys/dev/ahci/ahci.c
2240
if (ch->hold[i]->ccb_h.func_code != XPT_ATA_IO)
sys/dev/ahci/ahci.c
2243
res = &ch->hold[i]->ataio.res;
sys/dev/ahci/ahci.c
2256
ch->hold[i]->ccb_h.status &= ~CAM_STATUS_MASK;
sys/dev/ahci/ahci.c
2257
ch->hold[i]->ccb_h.status |= CAM_REQUEUE_REQ;
sys/dev/ahci/ahci.c
2259
ahci_done(ch, ch->hold[i]);
sys/dev/ahci/ahci.c
2260
ch->hold[i] = NULL;
sys/dev/ahci/ahci.c
2261
ch->numhslots--;
sys/dev/ahci/ahci.c
2265
device_printf(ch->dev, "Error while READ LOG EXT\n");
sys/dev/ahci/ahci.c
2267
device_printf(ch->dev, "Non-queued command error in READ LOG EXT\n");
sys/dev/ahci/ahci.c
2269
for (i = 0; i < ch->numslots; i++) {
sys/dev/ahci/ahci.c
2270
if (!ch->hold[i])
sys/dev/ahci/ahci.c
2272
if (ch->hold[i]->ccb_h.func_code != XPT_ATA_IO)
sys/dev/ahci/ahci.c
2274
ahci_done(ch, ch->hold[i]);
sys/dev/ahci/ahci.c
2275
ch->hold[i] = NULL;
sys/dev/ahci/ahci.c
2276
ch->numhslots--;
sys/dev/ahci/ahci.c
2281
xpt_release_simq(ch->sim, TRUE);
sys/dev/ahci/ahci.c
2285
ahci_process_request_sense(struct ahci_channel *ch, union ccb *ccb)
sys/dev/ahci/ahci.c
2289
ch->recoverycmd = 0;
sys/dev/ahci/ahci.c
2293
ch->hold[i]->ccb_h.status |= CAM_AUTOSNS_VALID;
sys/dev/ahci/ahci.c
2295
ch->hold[i]->ccb_h.status &= ~CAM_STATUS_MASK;
sys/dev/ahci/ahci.c
2296
ch->hold[i]->ccb_h.status |= CAM_AUTOSENSE_FAIL;
sys/dev/ahci/ahci.c
2298
ahci_done(ch, ch->hold[i]);
sys/dev/ahci/ahci.c
2299
ch->hold[i] = NULL;
sys/dev/ahci/ahci.c
2300
ch->numhslots--;
sys/dev/ahci/ahci.c
2302
xpt_release_simq(ch->sim, TRUE);
sys/dev/ahci/ahci.c
2306
ahci_start(struct ahci_channel *ch, int fbs)
sys/dev/ahci/ahci.c
2311
if (ch->start)
sys/dev/ahci/ahci.c
2312
ch->start(ch);
sys/dev/ahci/ahci.c
2315
ATA_OUTL(ch->r_mem, AHCI_P_SERR, 0xFFFFFFFF);
sys/dev/ahci/ahci.c
2317
ATA_OUTL(ch->r_mem, AHCI_P_IS, 0xFFFFFFFF);
sys/dev/ahci/ahci.c
2319
if (ch->chcaps & AHCI_P_CMD_FBSCP) {
sys/dev/ahci/ahci.c
2320
ch->fbs_enabled = (fbs && ch->pm_present) ? 1 : 0;
sys/dev/ahci/ahci.c
2321
ATA_OUTL(ch->r_mem, AHCI_P_FBS,
sys/dev/ahci/ahci.c
2322
ch->fbs_enabled ? AHCI_P_FBS_EN : 0);
sys/dev/ahci/ahci.c
2325
cmd = ATA_INL(ch->r_mem, AHCI_P_CMD);
sys/dev/ahci/ahci.c
2327
ATA_OUTL(ch->r_mem, AHCI_P_CMD, cmd | AHCI_P_CMD_ST |
sys/dev/ahci/ahci.c
2328
(ch->pm_present ? AHCI_P_CMD_PMA : 0));
sys/dev/ahci/ahci.c
2332
ahci_stop(struct ahci_channel *ch)
sys/dev/ahci/ahci.c
2338
cmd = ATA_INL(ch->r_mem, AHCI_P_CMD);
sys/dev/ahci/ahci.c
2339
ATA_OUTL(ch->r_mem, AHCI_P_CMD, cmd & ~AHCI_P_CMD_ST);
sys/dev/ahci/ahci.c
2345
device_printf(ch->dev, "stopping AHCI engine failed\n");
sys/dev/ahci/ahci.c
2348
} while (ATA_INL(ch->r_mem, AHCI_P_CMD) & AHCI_P_CMD_CR);
sys/dev/ahci/ahci.c
2349
ch->eslots = 0;
sys/dev/ahci/ahci.c
2353
ahci_clo(struct ahci_channel *ch)
sys/dev/ahci/ahci.c
2359
if (ch->caps & AHCI_CAP_SCLO) {
sys/dev/ahci/ahci.c
2360
cmd = ATA_INL(ch->r_mem, AHCI_P_CMD);
sys/dev/ahci/ahci.c
2362
ATA_OUTL(ch->r_mem, AHCI_P_CMD, cmd);
sys/dev/ahci/ahci.c
2367
device_printf(ch->dev, "executing CLO failed\n");
sys/dev/ahci/ahci.c
2370
} while (ATA_INL(ch->r_mem, AHCI_P_CMD) & AHCI_P_CMD_CLO);
sys/dev/ahci/ahci.c
2375
ahci_stop_fr(struct ahci_channel *ch)
sys/dev/ahci/ahci.c
2381
cmd = ATA_INL(ch->r_mem, AHCI_P_CMD);
sys/dev/ahci/ahci.c
2382
ATA_OUTL(ch->r_mem, AHCI_P_CMD, cmd & ~AHCI_P_CMD_FRE);
sys/dev/ahci/ahci.c
2388
device_printf(ch->dev, "stopping AHCI FR engine failed\n");
sys/dev/ahci/ahci.c
2391
} while (ATA_INL(ch->r_mem, AHCI_P_CMD) & AHCI_P_CMD_FR);
sys/dev/ahci/ahci.c
2395
ahci_start_fr(struct ahci_channel *ch)
sys/dev/ahci/ahci.c
2400
cmd = ATA_INL(ch->r_mem, AHCI_P_CMD);
sys/dev/ahci/ahci.c
2401
ATA_OUTL(ch->r_mem, AHCI_P_CMD, cmd | AHCI_P_CMD_FRE);
sys/dev/ahci/ahci.c
2405
ahci_wait_ready(struct ahci_channel *ch, int t, int t0)
sys/dev/ahci/ahci.c
2410
while ((val = ATA_INL(ch->r_mem, AHCI_P_TFD)) &
sys/dev/ahci/ahci.c
2414
device_printf(ch->dev,
sys/dev/ahci/ahci.c
2425
device_printf(ch->dev, "AHCI reset: device ready after %dms\n",
sys/dev/ahci/ahci.c
2433
struct ahci_channel *ch = arg;
sys/dev/ahci/ahci.c
2435
if (ch->resetting == 0)
sys/dev/ahci/ahci.c
2437
ch->resetting--;
sys/dev/ahci/ahci.c
2438
if (ahci_wait_ready(ch, ch->resetting == 0 ? -1 : 0,
sys/dev/ahci/ahci.c
2439
(310 - ch->resetting) * 100) == 0) {
sys/dev/ahci/ahci.c
2440
ch->resetting = 0;
sys/dev/ahci/ahci.c
2441
ahci_start(ch, 1);
sys/dev/ahci/ahci.c
2442
xpt_release_simq(ch->sim, TRUE);
sys/dev/ahci/ahci.c
2445
if (ch->resetting == 0) {
sys/dev/ahci/ahci.c
2446
ahci_clo(ch);
sys/dev/ahci/ahci.c
2447
ahci_start(ch, 1);
sys/dev/ahci/ahci.c
2448
xpt_release_simq(ch->sim, TRUE);
sys/dev/ahci/ahci.c
2451
callout_schedule(&ch->reset_timer, hz / 10);
sys/dev/ahci/ahci.c
2455
ahci_reset(struct ahci_channel *ch)
sys/dev/ahci/ahci.c
2457
struct ahci_controller *ctlr = device_get_softc(device_get_parent(ch->dev));
sys/dev/ahci/ahci.c
2460
xpt_freeze_simq(ch->sim, 1);
sys/dev/ahci/ahci.c
2462
device_printf(ch->dev, "AHCI reset...\n");
sys/dev/ahci/ahci.c
2464
if (ch->resetting) {
sys/dev/ahci/ahci.c
2465
ch->resetting = 0;
sys/dev/ahci/ahci.c
2466
callout_stop(&ch->reset_timer);
sys/dev/ahci/ahci.c
2467
xpt_release_simq(ch->sim, TRUE);
sys/dev/ahci/ahci.c
2470
if (ch->frozen) {
sys/dev/ahci/ahci.c
2471
union ccb *fccb = ch->frozen;
sys/dev/ahci/ahci.c
2472
ch->frozen = NULL;
sys/dev/ahci/ahci.c
2478
ahci_done(ch, fccb);
sys/dev/ahci/ahci.c
2481
ahci_stop(ch);
sys/dev/ahci/ahci.c
2482
for (i = 0; i < ch->numslots; i++) {
sys/dev/ahci/ahci.c
2484
if (ch->slot[i].state < AHCI_SLOT_RUNNING)
sys/dev/ahci/ahci.c
2487
ahci_end_transaction(&ch->slot[i], AHCI_ERR_INNOCENT);
sys/dev/ahci/ahci.c
2489
for (i = 0; i < ch->numslots; i++) {
sys/dev/ahci/ahci.c
2490
if (!ch->hold[i])
sys/dev/ahci/ahci.c
2492
ahci_done(ch, ch->hold[i]);
sys/dev/ahci/ahci.c
2493
ch->hold[i] = NULL;
sys/dev/ahci/ahci.c
2494
ch->numhslots--;
sys/dev/ahci/ahci.c
2496
if (ch->toslots != 0)
sys/dev/ahci/ahci.c
2497
xpt_release_simq(ch->sim, TRUE);
sys/dev/ahci/ahci.c
2498
ch->eslots = 0;
sys/dev/ahci/ahci.c
2499
ch->toslots = 0;
sys/dev/ahci/ahci.c
2500
ch->wrongccs = 0;
sys/dev/ahci/ahci.c
2501
ch->fatalerr = 0;
sys/dev/ahci/ahci.c
2503
xpt_async(AC_BUS_RESET, ch->path, NULL);
sys/dev/ahci/ahci.c
2505
ATA_OUTL(ch->r_mem, AHCI_P_IE, 0);
sys/dev/ahci/ahci.c
2507
if (!ahci_sata_phy_reset(ch)) {
sys/dev/ahci/ahci.c
2509
device_printf(ch->dev,
sys/dev/ahci/ahci.c
2511
ch->devices = 0;
sys/dev/ahci/ahci.c
2513
ATA_OUTL(ch->r_mem, AHCI_P_IE,
sys/dev/ahci/ahci.c
2514
(((ch->pm_level != 0) ? AHCI_P_IX_CPD | AHCI_P_IX_MP : 0) |
sys/dev/ahci/ahci.c
2516
xpt_release_simq(ch->sim, TRUE);
sys/dev/ahci/ahci.c
2520
device_printf(ch->dev, "AHCI reset: device found\n");
sys/dev/ahci/ahci.c
2522
if (ahci_wait_ready(ch, dumping ? 31000 : 0, 0)) {
sys/dev/ahci/ahci.c
2524
ahci_clo(ch);
sys/dev/ahci/ahci.c
2526
ch->resetting = 310;
sys/dev/ahci/ahci.c
2528
ch->devices = 1;
sys/dev/ahci/ahci.c
2530
ATA_OUTL(ch->r_mem, AHCI_P_IE,
sys/dev/ahci/ahci.c
2531
(((ch->pm_level != 0) ? AHCI_P_IX_CPD | AHCI_P_IX_MP : 0) |
sys/dev/ahci/ahci.c
2534
((ch->pm_level == 0) ? AHCI_P_IX_PRC : 0) | AHCI_P_IX_PC |
sys/dev/ahci/ahci.c
2537
if (ch->resetting)
sys/dev/ahci/ahci.c
2538
callout_reset(&ch->reset_timer, hz / 10, ahci_reset_to, ch);
sys/dev/ahci/ahci.c
2540
ahci_start(ch, 1);
sys/dev/ahci/ahci.c
2541
xpt_release_simq(ch->sim, TRUE);
sys/dev/ahci/ahci.c
2546
ahci_setup_fis(struct ahci_channel *ch, struct ahci_cmd_tab *ctp, union ccb *ccb, int tag)
sys/dev/ahci/ahci.c
2557
ch->curr[ccb->ccb_h.target_id].mode >= ATA_DMA)
sys/dev/ahci/ahci.c
2603
ahci_sata_connect(struct ahci_channel *ch)
sys/dev/ahci/ahci.c
2612
timeoutslot = ((ch->quirks & AHCI_Q_SLOWDEV) ? 5000 : 1000);
sys/dev/ahci/ahci.c
2614
status = ATA_INL(ch->r_mem, AHCI_P_SSTS);
sys/dev/ahci/ahci.c
2623
device_printf(ch->dev, "SATA offline status=%08x\n",
sys/dev/ahci/ahci.c
2634
device_printf(ch->dev,
sys/dev/ahci/ahci.c
2641
device_printf(ch->dev, "SATA connect time=%dus status=%08x\n",
sys/dev/ahci/ahci.c
2645
ATA_OUTL(ch->r_mem, AHCI_P_SERR, 0xffffffff);
sys/dev/ahci/ahci.c
2650
ahci_sata_phy_reset(struct ahci_channel *ch)
sys/dev/ahci/ahci.c
2655
if (ch->listening) {
sys/dev/ahci/ahci.c
2656
val = ATA_INL(ch->r_mem, AHCI_P_CMD);
sys/dev/ahci/ahci.c
2658
ATA_OUTL(ch->r_mem, AHCI_P_CMD, val);
sys/dev/ahci/ahci.c
2659
ch->listening = 0;
sys/dev/ahci/ahci.c
2661
sata_rev = ch->user[ch->pm_present ? 15 : 0].revision;
sys/dev/ahci/ahci.c
2670
detval = ahci_ch_detval(ch, ATA_SC_DET_RESET);
sys/dev/ahci/ahci.c
2671
ATA_OUTL(ch->r_mem, AHCI_P_SCTL,
sys/dev/ahci/ahci.c
2675
detval = ahci_ch_detval(ch, ATA_SC_DET_IDLE);
sys/dev/ahci/ahci.c
2676
ATA_OUTL(ch->r_mem, AHCI_P_SCTL,
sys/dev/ahci/ahci.c
2677
detval | val | ((ch->pm_level > 0) ? 0 :
sys/dev/ahci/ahci.c
2679
if (!ahci_sata_connect(ch)) {
sys/dev/ahci/ahci.c
2680
if (ch->caps & AHCI_CAP_SSS) {
sys/dev/ahci/ahci.c
2681
val = ATA_INL(ch->r_mem, AHCI_P_CMD);
sys/dev/ahci/ahci.c
2683
ATA_OUTL(ch->r_mem, AHCI_P_CMD, val);
sys/dev/ahci/ahci.c
2684
ch->listening = 1;
sys/dev/ahci/ahci.c
2685
} else if (ch->pm_level > 0)
sys/dev/ahci/ahci.c
2686
ATA_OUTL(ch->r_mem, AHCI_P_SCTL, ATA_SC_DET_DISABLE);
sys/dev/ahci/ahci.c
2693
ahci_check_ids(struct ahci_channel *ch, union ccb *ccb)
sys/dev/ahci/ahci.c
2696
if (ccb->ccb_h.target_id > ((ch->caps & AHCI_CAP_SPM) ? 15 : 0)) {
sys/dev/ahci/ahci.c
2698
ahci_done(ch, ccb);
sys/dev/ahci/ahci.c
2703
ahci_done(ch, ccb);
sys/dev/ahci/ahci.c
2712
struct ahci_channel *ch;
sys/dev/ahci/ahci.c
2717
ch = (struct ahci_channel *)cam_sim_softc(sim);
sys/dev/ahci/ahci.c
2722
if (ahci_check_ids(ch, ccb))
sys/dev/ahci/ahci.c
2724
if (ch->devices == 0 ||
sys/dev/ahci/ahci.c
2725
(ch->pm_present == 0 &&
sys/dev/ahci/ahci.c
2732
if (ahci_check_collision(ch, ccb)) {
sys/dev/ahci/ahci.c
2734
ch->frozen = ccb;
sys/dev/ahci/ahci.c
2736
xpt_freeze_simq(ch->sim, 1);
sys/dev/ahci/ahci.c
2739
ahci_begin_transaction(ch, ccb);
sys/dev/ahci/ahci.c
2750
if (ahci_check_ids(ch, ccb))
sys/dev/ahci/ahci.c
2753
d = &ch->curr[ccb->ccb_h.target_id];
sys/dev/ahci/ahci.c
2755
d = &ch->user[ccb->ccb_h.target_id];
sys/dev/ahci/ahci.c
2763
d->tags = min(ch->numslots, cts->xport_specific.sata.tags);
sys/dev/ahci/ahci.c
2765
ch->pm_present = cts->xport_specific.sata.pm_present;
sys/dev/ahci/ahci.c
2780
if (ahci_check_ids(ch, ccb))
sys/dev/ahci/ahci.c
2783
d = &ch->curr[ccb->ccb_h.target_id];
sys/dev/ahci/ahci.c
2785
d = &ch->user[ccb->ccb_h.target_id];
sys/dev/ahci/ahci.c
2794
(ccb->ccb_h.target_id == 0 && !ch->pm_present))) {
sys/dev/ahci/ahci.c
2795
status = ATA_INL(ch->r_mem, AHCI_P_SSTS) & ATA_SS_SPD_MASK;
sys/dev/ahci/ahci.c
2803
if (ch->pm_level) {
sys/dev/ahci/ahci.c
2804
if (ch->caps & (AHCI_CAP_PSC | AHCI_CAP_SSC))
sys/dev/ahci/ahci.c
2806
if (ch->caps2 & AHCI_CAP2_APST)
sys/dev/ahci/ahci.c
2809
if ((ch->caps & AHCI_CAP_SNCQ) &&
sys/dev/ahci/ahci.c
2810
(ch->quirks & AHCI_Q_NOAA) == 0)
sys/dev/ahci/ahci.c
2814
ch->user[ccb->ccb_h.target_id].caps;
sys/dev/ahci/ahci.c
2826
cts->xport_specific.sata.pm_present = ch->pm_present;
sys/dev/ahci/ahci.c
2837
ahci_reset(ch);
sys/dev/ahci/ahci.c
2850
if (ch->caps & AHCI_CAP_SNCQ)
sys/dev/ahci/ahci.c
2852
if (ch->caps & AHCI_CAP_SPM)
sys/dev/ahci/ahci.c
2856
if ((ch->quirks & AHCI_Q_NOAUX) == 0)
sys/dev/ahci/ahci.c
2859
if (ch->caps & AHCI_CAP_SPM)
sys/dev/ahci/ahci.c
2877
if (ch->quirks & AHCI_Q_MAXIO_64K)
sys/dev/ahci/ahci.c
2879
cpi->hba_vendor = ch->vendorid;
sys/dev/ahci/ahci.c
2880
cpi->hba_device = ch->deviceid;
sys/dev/ahci/ahci.c
2881
cpi->hba_subvendor = ch->subvendorid;
sys/dev/ahci/ahci.c
2882
cpi->hba_subdevice = ch->subdeviceid;
sys/dev/ahci/ahci.c
2890
ahci_done(ch, ccb);
sys/dev/ahci/ahci.c
2896
struct ahci_channel *ch = (struct ahci_channel *)cam_sim_softc(sim);
sys/dev/ahci/ahci.c
2900
istatus = ATA_INL(ch->r_mem, AHCI_P_IS);
sys/dev/ahci/ahci.c
2902
ahci_ch_intr_main(ch, istatus);
sys/dev/ahci/ahci.c
2903
if (ch->resetting != 0 &&
sys/dev/ahci/ahci.c
2904
(--ch->resetpolldiv <= 0 || !callout_pending(&ch->reset_timer))) {
sys/dev/ahci/ahci.c
2905
ch->resetpolldiv = 1000;
sys/dev/ahci/ahci.c
2906
ahci_reset_to(ch);
sys/dev/ahci/ahci.c
64
static void ahci_ch_intr_main(struct ahci_channel *ch, uint32_t istatus);
sys/dev/ahci/ahci.c
65
static void ahci_begin_transaction(struct ahci_channel *ch, union ccb *ccb);
sys/dev/ahci/ahci.c
70
static int ahci_setup_fis(struct ahci_channel *ch, struct ahci_cmd_tab *ctp, union ccb *ccb, int tag);
sys/dev/ahci/ahci.c
723
ahci_attached(device_t dev, struct ahci_channel *ch)
sys/dev/ahci/ahci.c
728
ctlr->ch[ch->unit] = ch;
sys/dev/ahci/ahci.c
733
ahci_detached(device_t dev, struct ahci_channel *ch)
sys/dev/ahci/ahci.c
738
mtx_lock(&ch->mtx);
sys/dev/ahci/ahci.c
739
ctlr->ch[ch->unit] = NULL;
sys/dev/ahci/ahci.c
740
mtx_unlock(&ch->mtx);
sys/dev/ahci/ahci.c
748
struct ahci_channel *ch;
sys/dev/ahci/ahci.c
752
ch = ctlr->ch[n];
sys/dev/ahci/ahci.c
753
if (ch != NULL)
sys/dev/ahci/ahci.c
754
mtx_lock(&ch->mtx);
sys/dev/ahci/ahci.c
756
return (ch);
sys/dev/ahci/ahci.c
76
static void ahci_reset(struct ahci_channel *ch);
sys/dev/ahci/ahci.c
760
ahci_putch(struct ahci_channel *ch)
sys/dev/ahci/ahci.c
763
mtx_unlock(&ch->mtx);
sys/dev/ahci/ahci.c
77
static void ahci_start(struct ahci_channel *ch, int fbs);
sys/dev/ahci/ahci.c
777
struct ahci_channel *ch;
sys/dev/ahci/ahci.c
78
static void ahci_stop(struct ahci_channel *ch);
sys/dev/ahci/ahci.c
780
ch = arg1;
sys/dev/ahci/ahci.c
781
value = ch->disablephy;
sys/dev/ahci/ahci.c
786
mtx_lock(&ch->mtx);
sys/dev/ahci/ahci.c
787
ch->disablephy = value;
sys/dev/ahci/ahci.c
789
ahci_ch_deinit(ch->dev);
sys/dev/ahci/ahci.c
79
static void ahci_clo(struct ahci_channel *ch);
sys/dev/ahci/ahci.c
791
ahci_ch_init(ch->dev);
sys/dev/ahci/ahci.c
792
ahci_phy_check_events(ch, ATA_SE_PHY_CHANGED | ATA_SE_EXCHANGED);
sys/dev/ahci/ahci.c
794
mtx_unlock(&ch->mtx);
sys/dev/ahci/ahci.c
80
static void ahci_start_fr(struct ahci_channel *ch);
sys/dev/ahci/ahci.c
803
struct ahci_channel *ch = device_get_softc(dev);
sys/dev/ahci/ahci.c
81
static void ahci_stop_fr(struct ahci_channel *ch);
sys/dev/ahci/ahci.c
810
ch->dev = dev;
sys/dev/ahci/ahci.c
811
ch->unit = (intptr_t)device_get_ivars(dev);
sys/dev/ahci/ahci.c
812
ch->caps = ctlr->caps;
sys/dev/ahci/ahci.c
813
ch->caps2 = ctlr->caps2;
sys/dev/ahci/ahci.c
814
ch->start = ctlr->ch_start;
sys/dev/ahci/ahci.c
815
ch->quirks = ctlr->quirks;
sys/dev/ahci/ahci.c
816
ch->vendorid = ctlr->vendorid;
sys/dev/ahci/ahci.c
817
ch->deviceid = ctlr->deviceid;
sys/dev/ahci/ahci.c
818
ch->subvendorid = ctlr->subvendorid;
sys/dev/ahci/ahci.c
819
ch->subdeviceid = ctlr->subdeviceid;
sys/dev/ahci/ahci.c
82
static int ahci_phy_check_events(struct ahci_channel *ch, u_int32_t serr);
sys/dev/ahci/ahci.c
820
ch->numslots = ((ch->caps & AHCI_CAP_NCS) >> AHCI_CAP_NCS_SHIFT) + 1;
sys/dev/ahci/ahci.c
821
mtx_init(&ch->mtx, "AHCI channel lock", NULL, MTX_DEF);
sys/dev/ahci/ahci.c
822
ch->pm_level = 0;
sys/dev/ahci/ahci.c
824
device_get_unit(dev), "pm_level", &ch->pm_level);
sys/dev/ahci/ahci.c
825
STAILQ_INIT(&ch->doneq);
sys/dev/ahci/ahci.c
826
if (ch->pm_level > 3)
sys/dev/ahci/ahci.c
827
callout_init_mtx(&ch->pm_timer, &ch->mtx, 0);
sys/dev/ahci/ahci.c
828
callout_init_mtx(&ch->reset_timer, &ch->mtx, 0);
sys/dev/ahci/ahci.c
83
static uint32_t ahci_ch_detval(struct ahci_channel *ch, uint32_t val);
sys/dev/ahci/ahci.c
830
if ((ctlr->quirks & AHCI_Q_SATA1_UNIT0) && ch->unit == 0)
sys/dev/ahci/ahci.c
832
if (ch->quirks & AHCI_Q_SATA2)
sys/dev/ahci/ahci.c
837
ch->user[i].revision = sata_rev;
sys/dev/ahci/ahci.c
838
ch->user[i].mode = 0;
sys/dev/ahci/ahci.c
839
ch->user[i].bytecount = 8192;
sys/dev/ahci/ahci.c
840
ch->user[i].tags = ch->numslots;
sys/dev/ahci/ahci.c
841
ch->user[i].caps = 0;
sys/dev/ahci/ahci.c
842
ch->curr[i] = ch->user[i];
sys/dev/ahci/ahci.c
843
if (ch->pm_level) {
sys/dev/ahci/ahci.c
844
ch->user[i].caps = CTS_SATA_CAPS_H_PMREQ |
sys/dev/ahci/ahci.c
848
ch->user[i].caps |= CTS_SATA_CAPS_H_DMAAA |
sys/dev/ahci/ahci.c
85
static int ahci_sata_connect(struct ahci_channel *ch);
sys/dev/ahci/ahci.c
852
if (!(ch->r_mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY,
sys/dev/ahci/ahci.c
855
ch->chcaps = ATA_INL(ch->r_mem, AHCI_P_CMD);
sys/dev/ahci/ahci.c
858
ch->chcaps |= AHCI_P_CMD_FBSCP;
sys/dev/ahci/ahci.c
859
if (ch->caps2 & AHCI_CAP2_SDS)
sys/dev/ahci/ahci.c
86
static int ahci_sata_phy_reset(struct ahci_channel *ch);
sys/dev/ahci/ahci.c
860
ch->chscaps = ATA_INL(ch->r_mem, AHCI_P_DEVSLP);
sys/dev/ahci/ahci.c
863
(ch->chcaps & AHCI_P_CMD_HPCP) ? " HPCP":"",
sys/dev/ahci/ahci.c
864
(ch->chcaps & AHCI_P_CMD_MPSP) ? " MPSP":"",
sys/dev/ahci/ahci.c
865
(ch->chcaps & AHCI_P_CMD_CPD) ? " CPD":"",
sys/dev/ahci/ahci.c
866
(ch->chcaps & AHCI_P_CMD_ESP) ? " ESP":"",
sys/dev/ahci/ahci.c
867
(ch->chcaps & AHCI_P_CMD_FBSCP) ? " FBSCP":"",
sys/dev/ahci/ahci.c
868
(ch->chscaps & AHCI_P_DEVSLP_DSP) ? " DSP":"");
sys/dev/ahci/ahci.c
87
static int ahci_wait_ready(struct ahci_channel *ch, int t, int t0);
sys/dev/ahci/ahci.c
872
mtx_lock(&ch->mtx);
sys/dev/ahci/ahci.c
875
if (!(ch->r_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ,
sys/dev/ahci/ahci.c
881
if ((bus_setup_intr(dev, ch->r_irq, ATA_INTR_FLAGS, NULL,
sys/dev/ahci/ahci.c
883
ch, &ch->ih))) {
sys/dev/ahci/ahci.c
889
devq = cam_simq_alloc(ch->numslots);
sys/dev/ahci/ahci.c
89
static void ahci_issue_recovery(struct ahci_channel *ch);
sys/dev/ahci/ahci.c
896
ch->sim = cam_sim_alloc(ahciaction, ahcipoll, "ahcich", ch,
sys/dev/ahci/ahci.c
897
device_get_unit(dev), (struct mtx *)&ch->mtx,
sys/dev/ahci/ahci.c
898
(ch->quirks & AHCI_Q_NOCCS) ? 1 : min(2, ch->numslots),
sys/dev/ahci/ahci.c
899
(ch->caps & AHCI_CAP_SNCQ) ? ch->numslots : 0,
sys/dev/ahci/ahci.c
90
static void ahci_process_read_log(struct ahci_channel *ch, union ccb *ccb);
sys/dev/ahci/ahci.c
901
if (ch->sim == NULL) {
sys/dev/ahci/ahci.c
907
if (xpt_bus_register(ch->sim, dev, 0) != CAM_SUCCESS) {
sys/dev/ahci/ahci.c
91
static void ahci_process_request_sense(struct ahci_channel *ch, union ccb *ccb);
sys/dev/ahci/ahci.c
912
if (xpt_create_path(&ch->path, /*periph*/NULL, cam_sim_path(ch->sim),
sys/dev/ahci/ahci.c
918
if (ch->pm_level > 3) {
sys/dev/ahci/ahci.c
919
callout_reset(&ch->pm_timer,
sys/dev/ahci/ahci.c
920
(ch->pm_level == 4) ? hz / 1000 : hz / 8,
sys/dev/ahci/ahci.c
921
ahci_ch_pm, ch);
sys/dev/ahci/ahci.c
923
mtx_unlock(&ch->mtx);
sys/dev/ahci/ahci.c
924
ahci_attached(device_get_parent(dev), ch);
sys/dev/ahci/ahci.c
928
CTLFLAG_RW | CTLTYPE_UINT | CTLFLAG_MPSAFE, ch,
sys/dev/ahci/ahci.c
933
xpt_bus_deregister(cam_sim_path(ch->sim));
sys/dev/ahci/ahci.c
935
cam_sim_free(ch->sim, /*free_devq*/TRUE);
sys/dev/ahci/ahci.c
937
bus_release_resource(dev, SYS_RES_IRQ, ATA_IRQ_RID, ch->r_irq);
sys/dev/ahci/ahci.c
939
bus_release_resource(dev, SYS_RES_MEMORY, ch->unit, ch->r_mem);
sys/dev/ahci/ahci.c
940
mtx_unlock(&ch->mtx);
sys/dev/ahci/ahci.c
941
mtx_destroy(&ch->mtx);
sys/dev/ahci/ahci.c
948
struct ahci_channel *ch = device_get_softc(dev);
sys/dev/ahci/ahci.c
950
ahci_detached(device_get_parent(dev), ch);
sys/dev/ahci/ahci.c
951
mtx_lock(&ch->mtx);
sys/dev/ahci/ahci.c
952
xpt_async(AC_LOST_DEVICE, ch->path, NULL);
sys/dev/ahci/ahci.c
954
if (ch->resetting) {
sys/dev/ahci/ahci.c
955
ch->resetting = 0;
sys/dev/ahci/ahci.c
956
xpt_release_simq(ch->sim, TRUE);
sys/dev/ahci/ahci.c
958
xpt_free_path(ch->path);
sys/dev/ahci/ahci.c
959
xpt_bus_deregister(cam_sim_path(ch->sim));
sys/dev/ahci/ahci.c
960
cam_sim_free(ch->sim, /*free_devq*/TRUE);
sys/dev/ahci/ahci.c
961
mtx_unlock(&ch->mtx);
sys/dev/ahci/ahci.c
963
if (ch->pm_level > 3)
sys/dev/ahci/ahci.c
964
callout_drain(&ch->pm_timer);
sys/dev/ahci/ahci.c
965
callout_drain(&ch->reset_timer);
sys/dev/ahci/ahci.c
966
bus_teardown_intr(dev, ch->r_irq, ch->ih);
sys/dev/ahci/ahci.c
967
bus_release_resource(dev, SYS_RES_IRQ, ATA_IRQ_RID, ch->r_irq);
sys/dev/ahci/ahci.c
973
bus_release_resource(dev, SYS_RES_MEMORY, ch->unit, ch->r_mem);
sys/dev/ahci/ahci.c
974
mtx_destroy(&ch->mtx);
sys/dev/ahci/ahci.c
981
struct ahci_channel *ch = device_get_softc(dev);
sys/dev/ahci/ahci.c
985
ATA_OUTL(ch->r_mem, AHCI_P_IE, 0);
sys/dev/ahci/ahci.c
987
work = ch->dma.work_bus + AHCI_CL_OFFSET;
sys/dev/ahci/ahci.c
988
ATA_OUTL(ch->r_mem, AHCI_P_CLB, work & 0xffffffff);
sys/dev/ahci/ahci.c
989
ATA_OUTL(ch->r_mem, AHCI_P_CLBU, work >> 32);
sys/dev/ahci/ahci.c
990
work = ch->dma.rfis_bus;
sys/dev/ahci/ahci.c
991
ATA_OUTL(ch->r_mem, AHCI_P_FB, work & 0xffffffff);
sys/dev/ahci/ahci.c
992
ATA_OUTL(ch->r_mem, AHCI_P_FBU, work >> 32);
sys/dev/ahci/ahci.c
994
ATA_OUTL(ch->r_mem, AHCI_P_CMD,
sys/dev/ahci/ahci.c
996
((ch->pm_level == 2 || ch->pm_level == 3) ? AHCI_P_CMD_ALPE : 0) |
sys/dev/ahci/ahci.c
997
((ch->pm_level > 2) ? AHCI_P_CMD_ASP : 0 )));
sys/dev/ahci/ahci.c
998
ahci_start_fr(ch);
sys/dev/ahci/ahci.c
999
ahci_start(ch, 1);
sys/dev/ahci/ahci.h
320
#define AHCI_WORK_SIZE (AHCI_CT_OFFSET + AHCI_CT_SIZE * ch->numslots)
sys/dev/ahci/ahci.h
387
struct ahci_channel *ch; /* Channel */
sys/dev/ahci/ahci.h
538
struct ahci_channel *ch[AHCI_MAX_PORTS]; /* Attached channels */
sys/dev/ahci/ahci.h
672
void ahci_attached(device_t dev, struct ahci_channel *ch);
sys/dev/ahci/ahci.h
673
void ahci_detached(device_t dev, struct ahci_channel *ch);
sys/dev/ahci/ahci.h
675
void ahci_putch(struct ahci_channel *ch);
sys/dev/ahci/ahciem.c
373
struct ahci_channel *ch;
sys/dev/ahci/ahciem.c
468
ch = ahci_getch(device_get_parent(dev), i);
sys/dev/ahci/ahciem.c
469
if (ch == NULL) {
sys/dev/ahci/ahciem.c
473
if (ch->pm_present)
sys/dev/ahci/ahciem.c
475
else if (ch->devices)
sys/dev/ahci/ahciem.c
477
else if (ch->disablephy)
sys/dev/ahci/ahciem.c
481
if (ch->disablephy)
sys/dev/ahci/ahciem.c
483
ahci_putch(ch);
sys/dev/ahci/ahciem.c
554
ch = ahci_getch(device_get_parent(dev), i);
sys/dev/ahci/ahciem.c
555
if (ch == NULL) {
sys/dev/ahci/ahciem.c
559
if (ch->devices == 0 || ch->pm_present)
sys/dev/ahci/ahciem.c
562
scsi_ulto4b(cam_sim_path(ch->sim), elmb->bus);
sys/dev/ahci/ahciem.c
564
ahci_putch(ch);
sys/dev/aic7xxx/aicasm/aicasm.c
119
int ch;
sys/dev/aic7xxx/aicasm/aicasm.c
144
while ((ch = getopt(argc, argv, "d:i:l:n:o:p:r:I:X")) != -1) {
sys/dev/aic7xxx/aicasm/aicasm.c
145
switch(ch) {
sys/dev/aic7xxx/aicasm/aicasm.c
179
appname, ch, optarg);
sys/dev/ata/ata-all.c
1005
if (ch->devices & (ATA_ATA_MASTER << ccb->ccb_h.target_id)) {
sys/dev/ata/ata-all.c
1029
d = &ch->curr[ccb->ccb_h.target_id];
sys/dev/ata/ata-all.c
1031
d = &ch->user[ccb->ccb_h.target_id];
sys/dev/ata/ata-all.c
1032
if (ch->flags & ATA_SATA) {
sys/dev/ata/ata-all.c
1037
d->mode = ATA_SETMODE(ch->dev,
sys/dev/ata/ata-all.c
104
if (ch->r_irq)
sys/dev/ata/ata-all.c
1052
d->mode = ATA_SETMODE(ch->dev,
sys/dev/ata/ata-all.c
1076
d = &ch->curr[ccb->ccb_h.target_id];
sys/dev/ata/ata-all.c
1078
d = &ch->user[ccb->ccb_h.target_id];
sys/dev/ata/ata-all.c
108
ch->dev = dev;
sys/dev/ata/ata-all.c
1081
if (ch->flags & ATA_SATA) {
sys/dev/ata/ata-all.c
109
ch->state = ATA_IDLE;
sys/dev/ata/ata-all.c
1098
if (ch->pm_level) {
sys/dev/ata/ata-all.c
110
bzero(&ch->state_mtx, sizeof(struct mtx));
sys/dev/ata/ata-all.c
1103
ch->user[ccb->ccb_h.target_id].caps;
sys/dev/ata/ata-all.c
111
mtx_init(&ch->state_mtx, "ATA state lock", NULL, MTX_DEF);
sys/dev/ata/ata-all.c
112
TASK_INIT(&ch->conntask, 0, ata_conn_event, dev);
sys/dev/ata/ata-all.c
1123
if (!(ch->flags & ATA_NO_48BIT_DMA))
sys/dev/ata/ata-all.c
1127
ch->user[ccb->ccb_h.target_id].caps;
sys/dev/ata/ata-all.c
114
ch->user[i].revision = 0;
sys/dev/ata/ata-all.c
1156
if (ch->flags & ATA_NO_SLAVE)
sys/dev/ata/ata-all.c
1163
if (ch->flags & ATA_SATA)
sys/dev/ata/ata-all.c
1171
if (ch->flags & ATA_SATA)
sys/dev/ata/ata-all.c
1178
cpi->maxio = ch->dma.max_iosize ? ch->dma.max_iosize : DFLTPHYS;
sys/dev/ata/ata-all.c
1199
struct ata_channel *ch = (struct ata_channel *)cam_sim_softc(sim);
sys/dev/ata/ata-all.c
1201
ata_interrupt_locked(ch);
sys/dev/ata/ata-all.c
122
ch->user[i].revision = mode;
sys/dev/ata/ata-all.c
123
ch->user[i].mode = 0;
sys/dev/ata/ata-all.c
134
ch->user[i].mode = mode;
sys/dev/ata/ata-all.c
135
if (ch->flags & ATA_SATA)
sys/dev/ata/ata-all.c
136
ch->user[i].bytecount = 8192;
sys/dev/ata/ata-all.c
138
ch->user[i].bytecount = 65536;
sys/dev/ata/ata-all.c
139
ch->user[i].caps = 0;
sys/dev/ata/ata-all.c
140
ch->curr[i] = ch->user[i];
sys/dev/ata/ata-all.c
141
if (ch->flags & ATA_SATA) {
sys/dev/ata/ata-all.c
142
if (ch->pm_level > 0)
sys/dev/ata/ata-all.c
143
ch->user[i].caps |= CTS_SATA_CAPS_H_PMREQ;
sys/dev/ata/ata-all.c
144
if (ch->pm_level > 1)
sys/dev/ata/ata-all.c
145
ch->user[i].caps |= CTS_SATA_CAPS_D_PMREQ;
sys/dev/ata/ata-all.c
147
if (!(ch->flags & ATA_NO_48BIT_DMA))
sys/dev/ata/ata-all.c
148
ch->user[i].caps |= CTS_ATA_CAPS_H_DMA48;
sys/dev/ata/ata-all.c
151
callout_init(&ch->poll_callout, 1);
sys/dev/ata/ata-all.c
154
if (ch->dma.alloc)
sys/dev/ata/ata-all.c
155
ch->dma.alloc(dev);
sys/dev/ata/ata-all.c
159
ch->r_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid,
sys/dev/ata/ata-all.c
161
if (!ch->r_irq) {
sys/dev/ata/ata-all.c
165
if ((error = bus_setup_intr(dev, ch->r_irq, ATA_INTR_FLAGS, NULL,
sys/dev/ata/ata-all.c
166
ata_interrupt, ch, &ch->ih))) {
sys/dev/ata/ata-all.c
167
bus_release_resource(dev, SYS_RES_IRQ, rid, ch->r_irq);
sys/dev/ata/ata-all.c
172
if (ch->flags & ATA_PERIODIC_POLL)
sys/dev/ata/ata-all.c
173
callout_reset(&ch->poll_callout, hz, ata_periodic_poll, ch);
sys/dev/ata/ata-all.c
174
mtx_lock(&ch->state_mtx);
sys/dev/ata/ata-all.c
183
ch->sim = cam_sim_alloc(ataaction, atapoll, "ata", ch,
sys/dev/ata/ata-all.c
184
device_get_unit(dev), &ch->state_mtx, 1, 0, devq);
sys/dev/ata/ata-all.c
185
if (ch->sim == NULL) {
sys/dev/ata/ata-all.c
191
if (xpt_bus_register(ch->sim, dev, 0) != CAM_SUCCESS) {
sys/dev/ata/ata-all.c
196
if (xpt_create_path(&ch->path, /*periph*/NULL, cam_sim_path(ch->sim),
sys/dev/ata/ata-all.c
202
mtx_unlock(&ch->state_mtx);
sys/dev/ata/ata-all.c
206
xpt_bus_deregister(cam_sim_path(ch->sim));
sys/dev/ata/ata-all.c
208
cam_sim_free(ch->sim, /*free_devq*/TRUE);
sys/dev/ata/ata-all.c
209
ch->sim = NULL;
sys/dev/ata/ata-all.c
211
bus_release_resource(dev, SYS_RES_IRQ, rid, ch->r_irq);
sys/dev/ata/ata-all.c
212
mtx_unlock(&ch->state_mtx);
sys/dev/ata/ata-all.c
213
if (ch->flags & ATA_PERIODIC_POLL)
sys/dev/ata/ata-all.c
214
callout_drain(&ch->poll_callout);
sys/dev/ata/ata-all.c
221
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/ata-all.c
224
if (!ch->r_irq)
sys/dev/ata/ata-all.c
228
mtx_lock(&ch->state_mtx);
sys/dev/ata/ata-all.c
229
ch->state |= ATA_STALL_QUEUE;
sys/dev/ata/ata-all.c
230
mtx_unlock(&ch->state_mtx);
sys/dev/ata/ata-all.c
231
if (ch->flags & ATA_PERIODIC_POLL)
sys/dev/ata/ata-all.c
232
callout_drain(&ch->poll_callout);
sys/dev/ata/ata-all.c
234
taskqueue_drain(taskqueue_thread, &ch->conntask);
sys/dev/ata/ata-all.c
236
mtx_lock(&ch->state_mtx);
sys/dev/ata/ata-all.c
237
xpt_async(AC_LOST_DEVICE, ch->path, NULL);
sys/dev/ata/ata-all.c
238
xpt_free_path(ch->path);
sys/dev/ata/ata-all.c
239
xpt_bus_deregister(cam_sim_path(ch->sim));
sys/dev/ata/ata-all.c
240
cam_sim_free(ch->sim, /*free_devq*/TRUE);
sys/dev/ata/ata-all.c
241
ch->sim = NULL;
sys/dev/ata/ata-all.c
242
mtx_unlock(&ch->state_mtx);
sys/dev/ata/ata-all.c
245
bus_teardown_intr(dev, ch->r_irq, ch->ih);
sys/dev/ata/ata-all.c
246
bus_release_resource(dev, SYS_RES_IRQ, ATA_IRQ_RID, ch->r_irq);
sys/dev/ata/ata-all.c
247
ch->r_irq = NULL;
sys/dev/ata/ata-all.c
250
if (ch->dma.free)
sys/dev/ata/ata-all.c
251
ch->dma.free(dev);
sys/dev/ata/ata-all.c
253
mtx_destroy(&ch->state_mtx);
sys/dev/ata/ata-all.c
261
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/ata-all.c
264
mtx_lock(&ch->state_mtx);
sys/dev/ata/ata-all.c
265
if (ch->sim == NULL) {
sys/dev/ata/ata-all.c
266
mtx_unlock(&ch->state_mtx);
sys/dev/ata/ata-all.c
273
cam_sim_path(ch->sim),
sys/dev/ata/ata-all.c
279
mtx_unlock(&ch->state_mtx);
sys/dev/ata/ata-all.c
285
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/ata-all.c
288
xpt_freeze_simq(ch->sim, 1);
sys/dev/ata/ata-all.c
289
if ((request = ch->running)) {
sys/dev/ata/ata-all.c
290
ch->running = NULL;
sys/dev/ata/ata-all.c
291
if (ch->state == ATA_ACTIVE)
sys/dev/ata/ata-all.c
292
ch->state = ATA_IDLE;
sys/dev/ata/ata-all.c
294
if (ch->dma.unload)
sys/dev/ata/ata-all.c
295
ch->dma.unload(request);
sys/dev/ata/ata-all.c
302
xpt_async(AC_BUS_RESET, ch->path, NULL);
sys/dev/ata/ata-all.c
303
xpt_release_simq(ch->sim, TRUE);
sys/dev/ata/ata-all.c
310
struct ata_channel *ch;
sys/dev/ata/ata-all.c
313
if (!dev || !(ch = device_get_softc(dev)))
sys/dev/ata/ata-all.c
316
if (ch->flags & ATA_PERIODIC_POLL)
sys/dev/ata/ata-all.c
317
callout_drain(&ch->poll_callout);
sys/dev/ata/ata-all.c
318
mtx_lock(&ch->state_mtx);
sys/dev/ata/ata-all.c
319
xpt_freeze_simq(ch->sim, 1);
sys/dev/ata/ata-all.c
320
while (ch->state != ATA_IDLE)
sys/dev/ata/ata-all.c
321
msleep(ch, &ch->state_mtx, PRIBIO, "atasusp", hz/100);
sys/dev/ata/ata-all.c
322
mtx_unlock(&ch->state_mtx);
sys/dev/ata/ata-all.c
329
struct ata_channel *ch;
sys/dev/ata/ata-all.c
333
if (!dev || !(ch = device_get_softc(dev)))
sys/dev/ata/ata-all.c
336
mtx_lock(&ch->state_mtx);
sys/dev/ata/ata-all.c
338
xpt_release_simq(ch->sim, TRUE);
sys/dev/ata/ata-all.c
339
mtx_unlock(&ch->state_mtx);
sys/dev/ata/ata-all.c
340
if (ch->flags & ATA_PERIODIC_POLL)
sys/dev/ata/ata-all.c
341
callout_reset(&ch->poll_callout, hz, ata_periodic_poll, ch);
sys/dev/ata/ata-all.c
348
struct ata_channel *ch = (struct ata_channel *)data;
sys/dev/ata/ata-all.c
350
mtx_lock(&ch->state_mtx);
sys/dev/ata/ata-all.c
352
mtx_unlock(&ch->state_mtx);
sys/dev/ata/ata-all.c
358
struct ata_channel *ch = (struct ata_channel *)data;
sys/dev/ata/ata-all.c
362
if (ch->hw.status && !ch->hw.status(ch->dev))
sys/dev/ata/ata-all.c
366
if (!(request = ch->running))
sys/dev/ata/ata-all.c
372
if (ch->state == ATA_IDLE) {
sys/dev/ata/ata-all.c
381
if (ch->hw.end_transaction(request) == ATA_OP_FINISHED) {
sys/dev/ata/ata-all.c
382
ch->running = NULL;
sys/dev/ata/ata-all.c
383
if (ch->state == ATA_ACTIVE)
sys/dev/ata/ata-all.c
384
ch->state = ATA_IDLE;
sys/dev/ata/ata-all.c
385
ata_cam_end_transaction(ch->dev, request);
sys/dev/ata/ata-all.c
393
struct ata_channel *ch = (struct ata_channel *)data;
sys/dev/ata/ata-all.c
395
callout_reset(&ch->poll_callout, hz, ata_periodic_poll, ch);
sys/dev/ata/ata-all.c
396
ata_interrupt(ch);
sys/dev/ata/ata-all.c
412
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/ata-all.c
415
ch->r_io[ATA_ERROR].res = ch->r_io[ATA_FEATURE].res;
sys/dev/ata/ata-all.c
416
ch->r_io[ATA_ERROR].offset = ch->r_io[ATA_FEATURE].offset;
sys/dev/ata/ata-all.c
417
ch->r_io[ATA_IREASON].res = ch->r_io[ATA_COUNT].res;
sys/dev/ata/ata-all.c
418
ch->r_io[ATA_IREASON].offset = ch->r_io[ATA_COUNT].offset;
sys/dev/ata/ata-all.c
419
ch->r_io[ATA_STATUS].res = ch->r_io[ATA_COMMAND].res;
sys/dev/ata/ata-all.c
420
ch->r_io[ATA_STATUS].offset = ch->r_io[ATA_COMMAND].offset;
sys/dev/ata/ata-all.c
421
ch->r_io[ATA_ALTSTAT].res = ch->r_io[ATA_CONTROL].res;
sys/dev/ata/ata-all.c
422
ch->r_io[ATA_ALTSTAT].offset = ch->r_io[ATA_CONTROL].offset;
sys/dev/ata/ata-all.c
696
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/ata-all.c
698
return (ch->devices & (ATA_ATAPI_MASTER << target));
sys/dev/ata/ata-all.c
705
struct ata_channel *ch;
sys/dev/ata/ata-all.c
708
ch = device_get_softc(request->parent);
sys/dev/ata/ata-all.c
718
if (ch->state == ATA_ACTIVE) {
sys/dev/ata/ata-all.c
720
if (ch->dma.unload)
sys/dev/ata/ata-all.c
721
ch->dma.unload(request);
sys/dev/ata/ata-all.c
722
ch->running = NULL;
sys/dev/ata/ata-all.c
723
ch->state = ATA_IDLE;
sys/dev/ata/ata-all.c
724
ata_cam_end_transaction(ch->dev, request);
sys/dev/ata/ata-all.c
726
mtx_unlock(&ch->state_mtx);
sys/dev/ata/ata-all.c
732
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/ata-all.c
735
request = &ch->request;
sys/dev/ata/ata-all.c
777
ch->curr[ccb->ccb_h.target_id].bytecount);
sys/dev/ata/ata-all.c
787
if (ch->curr[ccb->ccb_h.target_id].atapi == 16)
sys/dev/ata/ata-all.c
790
ch->curr[ccb->ccb_h.target_id].mode >= ATA_DMA)
sys/dev/ata/ata-all.c
797
ch->curr[ccb->ccb_h.target_id].bytecount);
sys/dev/ata/ata-all.c
801
callout_init_mtx(&request->callout, &ch->state_mtx, CALLOUT_RETURNUNLOCKED);
sys/dev/ata/ata-all.c
805
ch->running = request;
sys/dev/ata/ata-all.c
806
ch->state = ATA_ACTIVE;
sys/dev/ata/ata-all.c
807
if (ch->hw.begin_transaction(request) == ATA_OP_FINISHED) {
sys/dev/ata/ata-all.c
808
ch->running = NULL;
sys/dev/ata/ata-all.c
809
ch->state = ATA_IDLE;
sys/dev/ata/ata-all.c
818
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/ata-all.c
821
ch->requestsense = 1;
sys/dev/ata/ata-all.c
832
if (ch->curr[ccb->ccb_h.target_id].atapi == 16)
sys/dev/ata/ata-all.c
834
if (ch->curr[ccb->ccb_h.target_id].mode >= ATA_DMA)
sys/dev/ata/ata-all.c
838
ch->curr[ccb->ccb_h.target_id].bytecount);
sys/dev/ata/ata-all.c
841
callout_init_mtx(&request->callout, &ch->state_mtx, CALLOUT_RETURNUNLOCKED);
sys/dev/ata/ata-all.c
844
ch->running = request;
sys/dev/ata/ata-all.c
845
ch->state = ATA_ACTIVE;
sys/dev/ata/ata-all.c
846
if (ch->hw.begin_transaction(request) == ATA_OP_FINISHED) {
sys/dev/ata/ata-all.c
847
ch->running = NULL;
sys/dev/ata/ata-all.c
848
ch->state = ATA_IDLE;
sys/dev/ata/ata-all.c
857
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/ata-all.c
861
ch->requestsense = 0;
sys/dev/ata/ata-all.c
883
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/ata-all.c
887
if (ch->requestsense) {
sys/dev/ata/ata-all.c
894
xpt_freeze_simq(ch->sim, 1);
sys/dev/ata/ata-all.c
954
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/ata-all.c
956
if (ccb->ccb_h.target_id > ((ch->flags & ATA_NO_SLAVE) ? 0 : 1)) {
sys/dev/ata/ata-all.c
96
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/ata-all.c
979
struct ata_channel *ch;
sys/dev/ata/ata-all.c
984
ch = (struct ata_channel *)cam_sim_softc(sim);
sys/dev/ata/ata-all.c
985
dev = ch->dev;
sys/dev/ata/ata-all.c
992
if ((ch->devices & ((ATA_ATA_MASTER | ATA_ATAPI_MASTER)
sys/dev/ata/ata-all.c
997
if (ch->running)
sys/dev/ata/ata-all.h
488
int ata_sata_scr_read(struct ata_channel *ch, int port, int reg, uint32_t *val);
sys/dev/ata/ata-all.h
489
int ata_sata_scr_write(struct ata_channel *ch, int port, int reg, uint32_t val);
sys/dev/ata/ata-all.h
536
#define ATA_IDX_INB(ch, idx) \
sys/dev/ata/ata-all.h
537
ATA_INB(ch->r_io[idx].res, ch->r_io[idx].offset)
sys/dev/ata/ata-all.h
539
#define ATA_IDX_INW(ch, idx) \
sys/dev/ata/ata-all.h
540
ATA_INW(ch->r_io[idx].res, ch->r_io[idx].offset)
sys/dev/ata/ata-all.h
542
#define ATA_IDX_INW_STRM(ch, idx) \
sys/dev/ata/ata-all.h
543
ATA_INW_STRM(ch->r_io[idx].res, ch->r_io[idx].offset)
sys/dev/ata/ata-all.h
545
#define ATA_IDX_INL(ch, idx) \
sys/dev/ata/ata-all.h
546
ATA_INL(ch->r_io[idx].res, ch->r_io[idx].offset)
sys/dev/ata/ata-all.h
548
#define ATA_IDX_INSW(ch, idx, addr, count) \
sys/dev/ata/ata-all.h
549
ATA_INSW(ch->r_io[idx].res, ch->r_io[idx].offset, addr, count)
sys/dev/ata/ata-all.h
551
#define ATA_IDX_INSW_STRM(ch, idx, addr, count) \
sys/dev/ata/ata-all.h
552
ATA_INSW_STRM(ch->r_io[idx].res, ch->r_io[idx].offset, addr, count)
sys/dev/ata/ata-all.h
554
#define ATA_IDX_INSL(ch, idx, addr, count) \
sys/dev/ata/ata-all.h
555
ATA_INSL(ch->r_io[idx].res, ch->r_io[idx].offset, addr, count)
sys/dev/ata/ata-all.h
557
#define ATA_IDX_INSL_STRM(ch, idx, addr, count) \
sys/dev/ata/ata-all.h
558
ATA_INSL_STRM(ch->r_io[idx].res, ch->r_io[idx].offset, addr, count)
sys/dev/ata/ata-all.h
560
#define ATA_IDX_OUTB(ch, idx, value) \
sys/dev/ata/ata-all.h
561
ATA_OUTB(ch->r_io[idx].res, ch->r_io[idx].offset, value)
sys/dev/ata/ata-all.h
563
#define ATA_IDX_OUTW(ch, idx, value) \
sys/dev/ata/ata-all.h
564
ATA_OUTW(ch->r_io[idx].res, ch->r_io[idx].offset, value)
sys/dev/ata/ata-all.h
566
#define ATA_IDX_OUTW_STRM(ch, idx, value) \
sys/dev/ata/ata-all.h
567
ATA_OUTW_STRM(ch->r_io[idx].res, ch->r_io[idx].offset, value)
sys/dev/ata/ata-all.h
569
#define ATA_IDX_OUTL(ch, idx, value) \
sys/dev/ata/ata-all.h
570
ATA_OUTL(ch->r_io[idx].res, ch->r_io[idx].offset, value)
sys/dev/ata/ata-all.h
572
#define ATA_IDX_OUTSW(ch, idx, addr, count) \
sys/dev/ata/ata-all.h
573
ATA_OUTSW(ch->r_io[idx].res, ch->r_io[idx].offset, addr, count)
sys/dev/ata/ata-all.h
575
#define ATA_IDX_OUTSW_STRM(ch, idx, addr, count) \
sys/dev/ata/ata-all.h
576
ATA_OUTSW_STRM(ch->r_io[idx].res, ch->r_io[idx].offset, addr, count)
sys/dev/ata/ata-all.h
578
#define ATA_IDX_OUTSL(ch, idx, addr, count) \
sys/dev/ata/ata-all.h
579
ATA_OUTSL(ch->r_io[idx].res, ch->r_io[idx].offset, addr, count)
sys/dev/ata/ata-all.h
581
#define ATA_IDX_OUTSL_STRM(ch, idx, addr, count) \
sys/dev/ata/ata-all.h
582
ATA_OUTSL_STRM(ch->r_io[idx].res, ch->r_io[idx].offset, addr, count)
sys/dev/ata/ata-dma.c
100
if (bus_dma_tag_create(ch->dma.dmatag, PAGE_SIZE, 64 * 1024,
sys/dev/ata/ata-dma.c
101
ch->dma.max_address, BUS_SPACE_MAXADDR,
sys/dev/ata/ata-dma.c
103
0, NULL, NULL, &ch->dma.work_tag))
sys/dev/ata/ata-dma.c
106
if (bus_dmamem_alloc(ch->dma.work_tag, (void **)&ch->dma.work,
sys/dev/ata/ata-dma.c
108
&ch->dma.work_map))
sys/dev/ata/ata-dma.c
111
if (bus_dmamap_load(ch->dma.work_tag, ch->dma.work_map, ch->dma.work,
sys/dev/ata/ata-dma.c
114
bus_dmamem_free(ch->dma.work_tag, ch->dma.work, ch->dma.work_map);
sys/dev/ata/ata-dma.c
117
ch->dma.work_bus = dcba.maddr;
sys/dev/ata/ata-dma.c
128
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/ata-dma.c
130
if (ch->dma.work_bus) {
sys/dev/ata/ata-dma.c
131
bus_dmamap_unload(ch->dma.work_tag, ch->dma.work_map);
sys/dev/ata/ata-dma.c
132
bus_dmamem_free(ch->dma.work_tag, ch->dma.work, ch->dma.work_map);
sys/dev/ata/ata-dma.c
133
ch->dma.work_bus = 0;
sys/dev/ata/ata-dma.c
134
ch->dma.work = NULL;
sys/dev/ata/ata-dma.c
136
if (ch->dma.work_tag) {
sys/dev/ata/ata-dma.c
137
bus_dma_tag_destroy(ch->dma.work_tag);
sys/dev/ata/ata-dma.c
138
ch->dma.work_tag = NULL;
sys/dev/ata/ata-dma.c
140
if (ch->dma.dmatag) {
sys/dev/ata/ata-dma.c
141
bus_dma_tag_destroy(ch->dma.dmatag);
sys/dev/ata/ata-dma.c
142
ch->dma.dmatag = NULL;
sys/dev/ata/ata-dma.c
158
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/ata-dma.c
163
bzero(ch->dma.slot, sizeof(struct ata_dmaslot) * ATA_DMA_SLOTS);
sys/dev/ata/ata-dma.c
164
for (i = 0; i < ch->dma.dma_slots; i++) {
sys/dev/ata/ata-dma.c
165
struct ata_dmaslot *slot = &ch->dma.slot[i];
sys/dev/ata/ata-dma.c
167
if (bus_dma_tag_create(ch->dma.dmatag, PAGE_SIZE, PAGE_SIZE,
sys/dev/ata/ata-dma.c
168
ch->dma.max_address, BUS_SPACE_MAXADDR,
sys/dev/ata/ata-dma.c
171
device_printf(ch->dev, "FAILURE - create sg_tag\n");
sys/dev/ata/ata-dma.c
177
device_printf(ch->dev, "FAILURE - alloc sg_map\n");
sys/dev/ata/ata-dma.c
183
device_printf(ch->dev, "FAILURE - load sg\n");
sys/dev/ata/ata-dma.c
188
if (bus_dma_tag_create(ch->dma.dmatag,
sys/dev/ata/ata-dma.c
189
ch->dma.alignment, ch->dma.boundary,
sys/dev/ata/ata-dma.c
190
ch->dma.max_address, BUS_SPACE_MAXADDR,
sys/dev/ata/ata-dma.c
191
NULL, NULL, ch->dma.max_iosize,
sys/dev/ata/ata-dma.c
192
ATA_DMA_ENTRIES, ch->dma.segsize,
sys/dev/ata/ata-dma.c
194
device_printf(ch->dev, "FAILURE - create data_tag\n");
sys/dev/ata/ata-dma.c
199
device_printf(ch->dev, "FAILURE - create data_map\n");
sys/dev/ata/ata-dma.c
214
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/ata-dma.c
219
struct ata_dmaslot *slot = &ch->dma.slot[i];
sys/dev/ata/ata-dma.c
266
struct ata_channel *ch = device_get_softc(request->parent);
sys/dev/ata/ata-dma.c
282
if (request->bytecount & (ch->dma.alignment - 1)) {
sys/dev/ata/ata-dma.c
285
request->bytecount, ch->dma.alignment);
sys/dev/ata/ata-dma.c
288
if (request->bytecount > ch->dma.max_iosize) {
sys/dev/ata/ata-dma.c
291
request->bytecount, ch->dma.max_iosize);
sys/dev/ata/ata-dma.c
296
request->dma = &ch->dma.slot[0];
sys/dev/ata/ata-dma.c
306
ch->dma.setprd, &dspa, BUS_DMA_NOWAIT);
sys/dev/ata/ata-dma.c
310
ch->dma.setprd, &dspa, BUS_DMA_NOWAIT);
sys/dev/ata/ata-dma.c
67
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/ata-dma.c
70
if (ch->dma.alloc == NULL)
sys/dev/ata/ata-dma.c
71
ch->dma.alloc = ata_dmaalloc;
sys/dev/ata/ata-dma.c
72
if (ch->dma.free == NULL)
sys/dev/ata/ata-dma.c
73
ch->dma.free = ata_dmafree;
sys/dev/ata/ata-dma.c
74
if (ch->dma.setprd == NULL)
sys/dev/ata/ata-dma.c
75
ch->dma.setprd = ata_dmasetprd;
sys/dev/ata/ata-dma.c
76
if (ch->dma.load == NULL)
sys/dev/ata/ata-dma.c
77
ch->dma.load = ata_dmaload;
sys/dev/ata/ata-dma.c
78
if (ch->dma.unload == NULL)
sys/dev/ata/ata-dma.c
79
ch->dma.unload = ata_dmaunload;
sys/dev/ata/ata-dma.c
80
if (ch->dma.alignment == 0)
sys/dev/ata/ata-dma.c
81
ch->dma.alignment = 2;
sys/dev/ata/ata-dma.c
82
if (ch->dma.boundary == 0)
sys/dev/ata/ata-dma.c
83
ch->dma.boundary = 65536;
sys/dev/ata/ata-dma.c
84
if (ch->dma.segsize == 0)
sys/dev/ata/ata-dma.c
85
ch->dma.segsize = 65536;
sys/dev/ata/ata-dma.c
86
if (ch->dma.max_iosize == 0)
sys/dev/ata/ata-dma.c
87
ch->dma.max_iosize = (ATA_DMA_ENTRIES - 1) * PAGE_SIZE;
sys/dev/ata/ata-dma.c
88
if (ch->dma.max_address == 0)
sys/dev/ata/ata-dma.c
89
ch->dma.max_address = BUS_SPACE_MAXADDR_32BIT;
sys/dev/ata/ata-dma.c
90
if (ch->dma.dma_slots == 0)
sys/dev/ata/ata-dma.c
91
ch->dma.dma_slots = 1;
sys/dev/ata/ata-dma.c
93
if (bus_dma_tag_create(bus_get_dma_tag(dev), ch->dma.alignment, 0,
sys/dev/ata/ata-dma.c
94
ch->dma.max_address, BUS_SPACE_MAXADDR,
sys/dev/ata/ata-dma.c
95
NULL, NULL, ch->dma.max_iosize,
sys/dev/ata/ata-dma.c
96
ATA_DMA_ENTRIES, ch->dma.segsize,
sys/dev/ata/ata-dma.c
97
0, NULL, NULL, &ch->dma.dmatag))
sys/dev/ata/ata-isa.c
100
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/ata-isa.c
105
if (ch->attached)
sys/dev/ata/ata-isa.c
107
ch->attached = 1;
sys/dev/ata/ata-isa.c
131
ch->r_io[i].res = io;
sys/dev/ata/ata-isa.c
132
ch->r_io[i].offset = i;
sys/dev/ata/ata-isa.c
134
ch->r_io[ATA_CONTROL].res = ctlio;
sys/dev/ata/ata-isa.c
135
ch->r_io[ATA_CONTROL].offset = 0;
sys/dev/ata/ata-isa.c
136
ch->r_io[ATA_IDX_ADDR].res = io;
sys/dev/ata/ata-isa.c
140
ch->unit = 0;
sys/dev/ata/ata-isa.c
141
ch->flags |= ATA_USE_16BIT;
sys/dev/ata/ata-isa.c
149
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/ata-isa.c
152
if (!ch->attached)
sys/dev/ata/ata-isa.c
154
ch->attached = 0;
sys/dev/ata/ata-isa.c
159
ch->r_io[ATA_CONTROL].res);
sys/dev/ata/ata-isa.c
161
ch->r_io[ATA_IDX_ADDR].res);
sys/dev/ata/ata-isa.c
168
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/ata-isa.c
170
if (!ch->attached)
sys/dev/ata/ata-isa.c
179
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/ata-isa.c
181
if (!ch->attached)
sys/dev/ata/ata-lowlevel.c
106
if (ch->hw.command(request)) {
sys/dev/ata/ata-lowlevel.c
118
request->status = ATA_IDX_INB(ch, ATA_STATUS);
sys/dev/ata/ata-lowlevel.c
121
request->error = ATA_IDX_INB(ch, ATA_ERROR);
sys/dev/ata/ata-lowlevel.c
122
ch->hw.tf_read(request);
sys/dev/ata/ata-lowlevel.c
128
if (ata_wait(ch, request->unit, (ATA_S_READY | ATA_S_DRQ)) < 0) {
sys/dev/ata/ata-lowlevel.c
142
if ((error = ch->dma.load(request, NULL, &dummy))) {
sys/dev/ata/ata-lowlevel.c
149
if ((ch->flags & ATA_DMA_BEFORE_CMD) &&
sys/dev/ata/ata-lowlevel.c
150
ch->dma.start && ch->dma.start(request)) {
sys/dev/ata/ata-lowlevel.c
157
if (ch->hw.command(request)) {
sys/dev/ata/ata-lowlevel.c
165
if (!(ch->flags & ATA_DMA_BEFORE_CMD) &&
sys/dev/ata/ata-lowlevel.c
166
ch->dma.start && ch->dma.start(request)) {
sys/dev/ata/ata-lowlevel.c
177
ATA_IDX_OUTB(ch, ATA_DRIVE, ATA_D_IBM | ATA_DEV(request->unit));
sys/dev/ata/ata-lowlevel.c
179
if (!(ATA_IDX_INB(ch, ATA_ALTSTAT) & ATA_S_DSC))
sys/dev/ata/ata-lowlevel.c
185
if (ch->hw.command(request)) {
sys/dev/ata/ata-lowlevel.c
196
ATA_IDX_OUTB(ch, ATA_DRIVE, ATA_D_IBM | ATA_DEV(request->unit));
sys/dev/ata/ata-lowlevel.c
198
if (!(ATA_IDX_INB(ch, ATA_ALTSTAT) & ATA_S_DSC))
sys/dev/ata/ata-lowlevel.c
204
if ((error = ch->dma.load(request, NULL, &dummy))) {
sys/dev/ata/ata-lowlevel.c
211
if (ch->hw.command(request)) {
sys/dev/ata/ata-lowlevel.c
218
if (ch->dma.start && ch->dma.start(request)) {
sys/dev/ata/ata-lowlevel.c
228
if (ch->dma.unload) {
sys/dev/ata/ata-lowlevel.c
229
ch->dma.unload(request);
sys/dev/ata/ata-lowlevel.c
243
struct ata_channel *ch = device_get_softc(request->parent);
sys/dev/ata/ata-lowlevel.c
249
request->status = ATA_IDX_INB(ch, ATA_STATUS);
sys/dev/ata/ata-lowlevel.c
262
ch->hw.tf_read(request);
sys/dev/ata/ata-lowlevel.c
267
request->error = ATA_IDX_INB(ch, ATA_ERROR);
sys/dev/ata/ata-lowlevel.c
279
if (ata_wait(ch, request->unit, flags) < 0) {
sys/dev/ata/ata-lowlevel.c
301
if (ata_wait(ch, request->unit, (ATA_S_READY | ATA_S_DRQ)) < 0) {
sys/dev/ata/ata-lowlevel.c
304
request->status = ATA_IDX_INB(ch, ATA_STATUS);
sys/dev/ata/ata-lowlevel.c
325
if (ch->dma.stop)
sys/dev/ata/ata-lowlevel.c
326
request->dma->status = ch->dma.stop(request);
sys/dev/ata/ata-lowlevel.c
330
request->error = ATA_IDX_INB(ch, ATA_ERROR);
sys/dev/ata/ata-lowlevel.c
339
ch->hw.tf_read(request);
sys/dev/ata/ata-lowlevel.c
343
ch->dma.unload(request);
sys/dev/ata/ata-lowlevel.c
350
length = ATA_IDX_INB(ch, ATA_CYL_LSB)|(ATA_IDX_INB(ch, ATA_CYL_MSB)<<8);
sys/dev/ata/ata-lowlevel.c
356
switch ((ATA_IDX_INB(ch, ATA_IREASON) & (ATA_I_CMD | ATA_I_IN)) |
sys/dev/ata/ata-lowlevel.c
367
ATA_IDX_OUTSW_STRM(ch, ATA_DATA, (int16_t *)request->u.atapi.ccb,
sys/dev/ata/ata-lowlevel.c
425
request->error = ATA_IDX_INB(ch, ATA_ERROR);
sys/dev/ata/ata-lowlevel.c
440
if (ch->dma.stop)
sys/dev/ata/ata-lowlevel.c
441
request->dma->status = ch->dma.stop(request);
sys/dev/ata/ata-lowlevel.c
445
request->error = ATA_IDX_INB(ch, ATA_ERROR);
sys/dev/ata/ata-lowlevel.c
452
ch->dma.unload(request);
sys/dev/ata/ata-lowlevel.c
472
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/ata-lowlevel.c
479
ATA_IDX_OUTB(ch, ATA_DRIVE, ATA_D_IBM | ATA_D_LBA | ATA_DEV(ATA_MASTER));
sys/dev/ata/ata-lowlevel.c
481
ostat0 = ATA_IDX_INB(ch, ATA_STATUS);
sys/dev/ata/ata-lowlevel.c
482
if (((ostat0 & 0xf8) != 0xf8 || (ch->flags & ATA_KNOWN_PRESENCE)) &&
sys/dev/ata/ata-lowlevel.c
489
if (!(ch->flags & ATA_NO_SLAVE)) {
sys/dev/ata/ata-lowlevel.c
490
ATA_IDX_OUTB(ch, ATA_DRIVE, ATA_D_IBM | ATA_D_LBA | ATA_DEV(ATA_SLAVE));
sys/dev/ata/ata-lowlevel.c
492
ostat1 = ATA_IDX_INB(ch, ATA_STATUS);
sys/dev/ata/ata-lowlevel.c
493
if (((ostat1 & 0xf8) != 0xf8 || (ch->flags & ATA_KNOWN_PRESENCE)) &&
sys/dev/ata/ata-lowlevel.c
506
ch->devices = 0;
sys/dev/ata/ata-lowlevel.c
511
ATA_IDX_OUTB(ch, ATA_DRIVE, ATA_D_IBM | ATA_D_LBA | ATA_DEV(ATA_MASTER));
sys/dev/ata/ata-lowlevel.c
513
ATA_IDX_OUTB(ch, ATA_CONTROL, ATA_A_IDS | ATA_A_RESET);
sys/dev/ata/ata-lowlevel.c
515
ATA_IDX_OUTB(ch, ATA_CONTROL, ATA_A_IDS);
sys/dev/ata/ata-lowlevel.c
517
ATA_IDX_INB(ch, ATA_ERROR);
sys/dev/ata/ata-lowlevel.c
522
ATA_IDX_OUTB(ch, ATA_DRIVE, ATA_D_IBM | ATA_DEV(ATA_MASTER));
sys/dev/ata/ata-lowlevel.c
524
if (ch->flags & ATA_STATUS_IS_LONG)
sys/dev/ata/ata-lowlevel.c
525
stat0 = ATA_IDX_INL(ch, ATA_STATUS) & 0xff;
sys/dev/ata/ata-lowlevel.c
527
stat0 = ATA_IDX_INB(ch, ATA_STATUS);
sys/dev/ata/ata-lowlevel.c
528
err = ATA_IDX_INB(ch, ATA_ERROR);
sys/dev/ata/ata-lowlevel.c
529
lsb = ATA_IDX_INB(ch, ATA_CYL_LSB);
sys/dev/ata/ata-lowlevel.c
530
msb = ATA_IDX_INB(ch, ATA_CYL_MSB);
sys/dev/ata/ata-lowlevel.c
541
ch->devices |= ATA_ATAPI_MASTER;
sys/dev/ata/ata-lowlevel.c
544
ch->devices |= ATA_ATA_MASTER;
sys/dev/ata/ata-lowlevel.c
55
static int ata_wait(struct ata_channel *ch, int unit, u_int8_t);
sys/dev/ata/ata-lowlevel.c
555
ATA_IDX_OUTB(ch, ATA_DRIVE, ATA_D_IBM | ATA_DEV(ATA_SLAVE));
sys/dev/ata/ata-lowlevel.c
557
if (ch->flags & ATA_STATUS_IS_LONG)
sys/dev/ata/ata-lowlevel.c
558
stat1 = ATA_IDX_INL(ch, ATA_STATUS) & 0xff;
sys/dev/ata/ata-lowlevel.c
560
stat1 = ATA_IDX_INB(ch, ATA_STATUS);
sys/dev/ata/ata-lowlevel.c
561
err = ATA_IDX_INB(ch, ATA_ERROR);
sys/dev/ata/ata-lowlevel.c
562
lsb = ATA_IDX_INB(ch, ATA_CYL_LSB);
sys/dev/ata/ata-lowlevel.c
563
msb = ATA_IDX_INB(ch, ATA_CYL_MSB);
sys/dev/ata/ata-lowlevel.c
574
ch->devices |= ATA_ATAPI_SLAVE;
sys/dev/ata/ata-lowlevel.c
577
ch->devices |= ATA_ATA_SLAVE;
sys/dev/ata/ata-lowlevel.c
586
if ((ch->flags & ATA_KNOWN_PRESENCE) == 0 &&
sys/dev/ata/ata-lowlevel.c
601
stat0, stat1, ch->devices);
sys/dev/ata/ata-lowlevel.c
608
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/ata-lowlevel.c
610
if (ATA_IDX_INB(ch, ATA_ALTSTAT) & ATA_S_BUSY) {
sys/dev/ata/ata-lowlevel.c
612
if (ATA_IDX_INB(ch, ATA_ALTSTAT) & ATA_S_BUSY)
sys/dev/ata/ata-lowlevel.c
619
ata_wait(struct ata_channel *ch, int unit, u_int8_t mask)
sys/dev/ata/ata-lowlevel.c
628
status = ATA_IDX_INB(ch, ATA_ALTSTAT);
sys/dev/ata/ata-lowlevel.c
632
ATA_IDX_OUTB(ch, ATA_DRIVE, ATA_D_IBM | ATA_DEV(unit));
sys/dev/ata/ata-lowlevel.c
661
status = ATA_IDX_INB(ch, ATA_ALTSTAT);
sys/dev/ata/ata-lowlevel.c
67
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/ata-lowlevel.c
672
struct ata_channel *ch = device_get_softc(request->parent);
sys/dev/ata/ata-lowlevel.c
675
ATA_IDX_OUTB(ch, ATA_DRIVE, ATA_D_IBM | ATA_D_LBA | ATA_DEV(request->unit));
sys/dev/ata/ata-lowlevel.c
678
if (ata_wait(ch, request->unit, 0) < 0) {
sys/dev/ata/ata-lowlevel.c
685
ATA_IDX_OUTB(ch, ATA_CONTROL, ATA_A_4BIT);
sys/dev/ata/ata-lowlevel.c
69
ch->hw.begin_transaction = ata_begin_transaction;
sys/dev/ata/ata-lowlevel.c
693
ATA_IDX_OUTB(ch, ATA_FEATURE, ATA_F_DMA);
sys/dev/ata/ata-lowlevel.c
694
ATA_IDX_OUTB(ch, ATA_CYL_LSB, 0);
sys/dev/ata/ata-lowlevel.c
695
ATA_IDX_OUTB(ch, ATA_CYL_MSB, 0);
sys/dev/ata/ata-lowlevel.c
698
ATA_IDX_OUTB(ch, ATA_FEATURE, 0);
sys/dev/ata/ata-lowlevel.c
699
ATA_IDX_OUTB(ch, ATA_CYL_LSB, request->transfersize);
sys/dev/ata/ata-lowlevel.c
70
ch->hw.end_transaction = ata_end_transaction;
sys/dev/ata/ata-lowlevel.c
700
ATA_IDX_OUTB(ch, ATA_CYL_MSB, request->transfersize >> 8);
sys/dev/ata/ata-lowlevel.c
702
ATA_IDX_OUTB(ch, ATA_COMMAND, ATA_PACKET_CMD);
sys/dev/ata/ata-lowlevel.c
709
res = ata_wait(ch, request->unit, 0);
sys/dev/ata/ata-lowlevel.c
71
ch->hw.status = ata_generic_status;
sys/dev/ata/ata-lowlevel.c
72
ch->hw.softreset = NULL;
sys/dev/ata/ata-lowlevel.c
720
int reason = ATA_IDX_INB(ch, ATA_IREASON);
sys/dev/ata/ata-lowlevel.c
721
int status = ATA_IDX_INB(ch, ATA_STATUS);
sys/dev/ata/ata-lowlevel.c
73
ch->hw.command = ata_generic_command;
sys/dev/ata/ata-lowlevel.c
739
ATA_IDX_OUTSW_STRM(ch, ATA_DATA, (int16_t *)request->u.atapi.ccb,
sys/dev/ata/ata-lowlevel.c
74
ch->hw.tf_read = ata_tf_read;
sys/dev/ata/ata-lowlevel.c
743
ch->hw.tf_write(request);
sys/dev/ata/ata-lowlevel.c
746
ATA_IDX_OUTB(ch, ATA_COMMAND, request->u.ata.command);
sys/dev/ata/ata-lowlevel.c
75
ch->hw.tf_write = ata_tf_write;
sys/dev/ata/ata-lowlevel.c
754
struct ata_channel *ch = device_get_softc(request->parent);
sys/dev/ata/ata-lowlevel.c
757
ATA_IDX_OUTB(ch, ATA_CONTROL, ATA_A_4BIT | ATA_A_HOB);
sys/dev/ata/ata-lowlevel.c
758
request->u.ata.count = (ATA_IDX_INB(ch, ATA_COUNT) << 8);
sys/dev/ata/ata-lowlevel.c
76
ch->hw.pm_read = NULL;
sys/dev/ata/ata-lowlevel.c
760
((u_int64_t)(ATA_IDX_INB(ch, ATA_SECTOR)) << 24) |
sys/dev/ata/ata-lowlevel.c
761
((u_int64_t)(ATA_IDX_INB(ch, ATA_CYL_LSB)) << 32) |
sys/dev/ata/ata-lowlevel.c
762
((u_int64_t)(ATA_IDX_INB(ch, ATA_CYL_MSB)) << 40);
sys/dev/ata/ata-lowlevel.c
764
ATA_IDX_OUTB(ch, ATA_CONTROL, ATA_A_4BIT);
sys/dev/ata/ata-lowlevel.c
765
request->u.ata.count |= ATA_IDX_INB(ch, ATA_COUNT);
sys/dev/ata/ata-lowlevel.c
767
(ATA_IDX_INB(ch, ATA_SECTOR) |
sys/dev/ata/ata-lowlevel.c
768
(ATA_IDX_INB(ch, ATA_CYL_LSB) << 8) |
sys/dev/ata/ata-lowlevel.c
769
(ATA_IDX_INB(ch, ATA_CYL_MSB) << 16));
sys/dev/ata/ata-lowlevel.c
77
ch->hw.pm_write = NULL;
sys/dev/ata/ata-lowlevel.c
772
request->u.ata.count = ATA_IDX_INB(ch, ATA_COUNT);
sys/dev/ata/ata-lowlevel.c
773
request->u.ata.lba = ATA_IDX_INB(ch, ATA_SECTOR) |
sys/dev/ata/ata-lowlevel.c
774
(ATA_IDX_INB(ch, ATA_CYL_LSB) << 8) |
sys/dev/ata/ata-lowlevel.c
775
(ATA_IDX_INB(ch, ATA_CYL_MSB) << 16) |
sys/dev/ata/ata-lowlevel.c
776
((ATA_IDX_INB(ch, ATA_DRIVE) & 0xf) << 24);
sys/dev/ata/ata-lowlevel.c
783
struct ata_channel *ch = device_get_softc(request->parent);
sys/dev/ata/ata-lowlevel.c
786
ATA_IDX_OUTB(ch, ATA_FEATURE, request->u.ata.feature >> 8);
sys/dev/ata/ata-lowlevel.c
787
ATA_IDX_OUTB(ch, ATA_FEATURE, request->u.ata.feature);
sys/dev/ata/ata-lowlevel.c
788
ATA_IDX_OUTB(ch, ATA_COUNT, request->u.ata.count >> 8);
sys/dev/ata/ata-lowlevel.c
789
ATA_IDX_OUTB(ch, ATA_COUNT, request->u.ata.count);
sys/dev/ata/ata-lowlevel.c
790
ATA_IDX_OUTB(ch, ATA_SECTOR, request->u.ata.lba >> 24);
sys/dev/ata/ata-lowlevel.c
791
ATA_IDX_OUTB(ch, ATA_SECTOR, request->u.ata.lba);
sys/dev/ata/ata-lowlevel.c
792
ATA_IDX_OUTB(ch, ATA_CYL_LSB, request->u.ata.lba >> 32);
sys/dev/ata/ata-lowlevel.c
793
ATA_IDX_OUTB(ch, ATA_CYL_LSB, request->u.ata.lba >> 8);
sys/dev/ata/ata-lowlevel.c
794
ATA_IDX_OUTB(ch, ATA_CYL_MSB, request->u.ata.lba >> 40);
sys/dev/ata/ata-lowlevel.c
795
ATA_IDX_OUTB(ch, ATA_CYL_MSB, request->u.ata.lba >> 16);
sys/dev/ata/ata-lowlevel.c
796
ATA_IDX_OUTB(ch, ATA_DRIVE, ATA_D_LBA | ATA_DEV(request->unit));
sys/dev/ata/ata-lowlevel.c
799
ATA_IDX_OUTB(ch, ATA_FEATURE, request->u.ata.feature);
sys/dev/ata/ata-lowlevel.c
800
ATA_IDX_OUTB(ch, ATA_COUNT, request->u.ata.count);
sys/dev/ata/ata-lowlevel.c
801
ATA_IDX_OUTB(ch, ATA_SECTOR, request->u.ata.lba);
sys/dev/ata/ata-lowlevel.c
802
ATA_IDX_OUTB(ch, ATA_CYL_LSB, request->u.ata.lba >> 8);
sys/dev/ata/ata-lowlevel.c
803
ATA_IDX_OUTB(ch, ATA_CYL_MSB, request->u.ata.lba >> 16);
sys/dev/ata/ata-lowlevel.c
804
ATA_IDX_OUTB(ch, ATA_DRIVE,
sys/dev/ata/ata-lowlevel.c
813
struct ata_channel *ch = device_get_softc(request->parent);
sys/dev/ata/ata-lowlevel.c
84
struct ata_channel *ch = device_get_softc(request->parent);
sys/dev/ata/ata-lowlevel.c
856
if (__predict_false((ch->flags & ATA_USE_16BIT) ||
sys/dev/ata/ata-lowlevel.c
862
ATA_IDX_INW_STRM(ch, ATA_DATA);
sys/dev/ata/ata-lowlevel.c
868
ATA_IDX_INSW_STRM(ch, ATA_DATA, (void*)addr,
sys/dev/ata/ata-lowlevel.c
874
ATA_IDX_INW_STRM(ch, ATA_DATA);
sys/dev/ata/ata-lowlevel.c
878
ATA_IDX_INSL_STRM(ch, ATA_DATA, (void*)addr, size / 4);
sys/dev/ata/ata-lowlevel.c
892
ATA_IDX_INW(ch, ATA_DATA);
sys/dev/ata/ata-lowlevel.c
899
struct ata_channel *ch = device_get_softc(request->parent);
sys/dev/ata/ata-lowlevel.c
90
if ((ch->flags & ATA_NO_ATAPI_DMA) &&
sys/dev/ata/ata-lowlevel.c
93
if ((ch->flags & ATA_ATAPI_DMA_RO) &&
sys/dev/ata/ata-lowlevel.c
935
ATA_IDX_OUTW_STRM(ch, ATA_DATA, *(uint16_t *)&buf);
sys/dev/ata/ata-lowlevel.c
943
if (__predict_false((ch->flags & ATA_USE_16BIT) ||
sys/dev/ata/ata-lowlevel.c
950
ATA_IDX_OUTW_STRM(ch, ATA_DATA,
sys/dev/ata/ata-lowlevel.c
955
ATA_IDX_OUTSW_STRM(ch, ATA_DATA, (void*)addr,
sys/dev/ata/ata-lowlevel.c
962
ATA_IDX_OUTSL_STRM(ch, ATA_DATA,
sys/dev/ata/ata-lowlevel.c
975
ATA_IDX_OUTW_STRM(ch, ATA_DATA, *(uint16_t *)&buf);
sys/dev/ata/ata-lowlevel.c
983
ATA_IDX_OUTW(ch, ATA_DATA, 0);
sys/dev/ata/ata-pci.c
393
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/ata-pci.c
410
ch->r_io[i].res = io;
sys/dev/ata/ata-pci.c
411
ch->r_io[i].offset = i;
sys/dev/ata/ata-pci.c
413
ch->r_io[ATA_CONTROL].res = ctlio;
sys/dev/ata/ata-pci.c
414
ch->r_io[ATA_CONTROL].offset = ctlr->legacy ? 0 : 2;
sys/dev/ata/ata-pci.c
415
ch->r_io[ATA_IDX_ADDR].res = io;
sys/dev/ata/ata-pci.c
419
ch->r_io[i].res = ctlr->r_res1;
sys/dev/ata/ata-pci.c
420
ch->r_io[i].offset = (i - ATA_BMCMD_PORT) + (ch->unit*ATA_BMIOSIZE);
sys/dev/ata/ata-pci.c
431
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/ata-pci.c
436
ch->r_io[ATA_CONTROL].res);
sys/dev/ata/ata-pci.c
438
ch->r_io[ATA_IDX_ADDR].res);
sys/dev/ata/ata-pci.c
448
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/ata-pci.c
451
((ch->flags & ATA_ALWAYS_DMASTAT) ||
sys/dev/ata/ata-pci.c
452
(ch->dma.flags & ATA_DMA_ACTIVE))) {
sys/dev/ata/ata-pci.c
453
int bmstat = ATA_IDX_INB(ch, ATA_BMSTAT_PORT) & ATA_BMSTAT_MASK;
sys/dev/ata/ata-pci.c
457
ATA_IDX_OUTB(ch, ATA_BMSTAT_PORT, bmstat & ~ATA_BMSTAT_ERROR);
sys/dev/ata/ata-pci.c
460
if (ATA_IDX_INB(ch, ATA_ALTSTAT) & ATA_S_BUSY) {
sys/dev/ata/ata-pci.c
462
if (ATA_IDX_INB(ch, ATA_ALTSTAT) & ATA_S_BUSY)
sys/dev/ata/ata-pci.c
471
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/ata-pci.c
474
ch->hw.status = ata_pci_status;
sys/dev/ata/ata-pci.c
480
struct ata_channel *ch = device_get_softc(request->parent);
sys/dev/ata/ata-pci.c
484
ATA_IDX_OUTB(ch, ATA_BMSTAT_PORT, (ATA_IDX_INB(ch, ATA_BMSTAT_PORT) |
sys/dev/ata/ata-pci.c
486
ATA_IDX_OUTL(ch, ATA_BMDTP_PORT, request->dma->sg_bus);
sys/dev/ata/ata-pci.c
487
ch->dma.flags |= ATA_DMA_ACTIVE;
sys/dev/ata/ata-pci.c
488
ATA_IDX_OUTB(ch, ATA_BMCMD_PORT,
sys/dev/ata/ata-pci.c
489
(ATA_IDX_INB(ch, ATA_BMCMD_PORT) & ~ATA_BMCMD_WRITE_READ) |
sys/dev/ata/ata-pci.c
498
struct ata_channel *ch = device_get_softc(request->parent);
sys/dev/ata/ata-pci.c
503
ATA_IDX_OUTB(ch, ATA_BMCMD_PORT,
sys/dev/ata/ata-pci.c
504
ATA_IDX_INB(ch, ATA_BMCMD_PORT) & ~ATA_BMCMD_START_STOP);
sys/dev/ata/ata-pci.c
505
ch->dma.flags &= ~ATA_DMA_ACTIVE;
sys/dev/ata/ata-pci.c
506
error = ATA_IDX_INB(ch, ATA_BMSTAT_PORT) & ATA_BMSTAT_MASK;
sys/dev/ata/ata-pci.c
507
ATA_IDX_OUTB(ch, ATA_BMSTAT_PORT, ATA_BMSTAT_INTERRUPT | ATA_BMSTAT_ERROR);
sys/dev/ata/ata-pci.c
514
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/ata-pci.c
517
ATA_IDX_OUTB(ch, ATA_BMCMD_PORT,
sys/dev/ata/ata-pci.c
518
ATA_IDX_INB(ch, ATA_BMCMD_PORT) & ~ATA_BMCMD_START_STOP);
sys/dev/ata/ata-pci.c
519
ch->dma.flags &= ~ATA_DMA_ACTIVE;
sys/dev/ata/ata-pci.c
520
ATA_IDX_OUTB(ch, ATA_BMSTAT_PORT, ATA_BMSTAT_INTERRUPT | ATA_BMSTAT_ERROR);
sys/dev/ata/ata-pci.c
521
if ((request = ch->running)) {
sys/dev/ata/ata-pci.c
523
ch->dma.unload(request);
sys/dev/ata/ata-pci.c
530
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/ata-pci.c
533
ch->dma.start = ata_pci_dmastart;
sys/dev/ata/ata-pci.c
534
ch->dma.stop = ata_pci_dmastop;
sys/dev/ata/ata-pci.c
535
ch->dma.reset = ata_pci_dmareset;
sys/dev/ata/ata-pci.c
626
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/ata-pci.c
629
if (ch->attached)
sys/dev/ata/ata-pci.c
631
ch->attached = 1;
sys/dev/ata/ata-pci.c
633
ch->dev = dev;
sys/dev/ata/ata-pci.c
634
ch->unit = (intptr_t)device_get_ivars(dev);
sys/dev/ata/ata-pci.c
637
device_get_unit(dev), "pm_level", &ch->pm_level);
sys/dev/ata/ata-pci.c
649
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/ata-pci.c
652
if (!ch->attached)
sys/dev/ata/ata-pci.c
654
ch->attached = 0;
sys/dev/ata/ata-pci.c
668
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/ata-pci.c
671
if (!ch->attached)
sys/dev/ata/ata-pci.c
687
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/ata-pci.c
690
if (!ch->attached)
sys/dev/ata/ata-pci.c
703
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/ata-pci.c
706
if (ch->dma.reset)
sys/dev/ata/ata-pci.c
707
ch->dma.reset(dev);
sys/dev/ata/ata-pci.c
731
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/ata-pci.c
733
if (ch->flags & ATA_SATA) {
sys/dev/ata/ata-pci.c
789
struct ata_channel *ch;
sys/dev/ata/ata-pci.c
793
if ((ch = ctlr->interrupt[unit].argument))
sys/dev/ata/ata-pci.c
794
ctlr->interrupt[unit].function(ch);
sys/dev/ata/ata-sata.c
100
if (ch->r_io[reg].res) {
sys/dev/ata/ata-sata.c
101
ATA_IDX_OUTL(ch, reg, val);
sys/dev/ata/ata-sata.c
108
ata_sata_connect(struct ata_channel *ch, int port, int quick)
sys/dev/ata/ata-sata.c
117
if (ata_sata_scr_read(ch, port, ATA_SSTATUS, &status))
sys/dev/ata/ata-sata.c
130
device_printf(ch->dev, "SATA connect timeout status=%08x\n",
sys/dev/ata/ata-sata.c
133
device_printf(ch->dev, "p%d: SATA connect timeout status=%08x\n",
sys/dev/ata/ata-sata.c
137
device_printf(ch->dev, "SATA connect time=%dms status=%08x\n",
sys/dev/ata/ata-sata.c
140
device_printf(ch->dev, "p%d: SATA connect time=%dms status=%08x\n",
sys/dev/ata/ata-sata.c
146
ata_sata_scr_write(ch, port, ATA_SERROR, 0xffffffff);
sys/dev/ata/ata-sata.c
154
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/ata-sata.c
158
sata_rev = ch->user[port < 0 ? 0 : port].revision;
sys/dev/ata/ata-sata.c
163
if (ata_sata_scr_read(ch, port, ATA_SCONTROL, &val))
sys/dev/ata/ata-sata.c
166
ata_sata_scr_write(ch, port, ATA_SCONTROL,
sys/dev/ata/ata-sata.c
167
ATA_SC_DET_IDLE | ((ch->pm_level > 0) ? 0 :
sys/dev/ata/ata-sata.c
169
return ata_sata_connect(ch, port, quick);
sys/dev/ata/ata-sata.c
190
if (ata_sata_scr_write(ch, port, ATA_SCONTROL, ATA_SC_DET_RESET |
sys/dev/ata/ata-sata.c
194
if (ata_sata_scr_read(ch, port, ATA_SCONTROL, &val))
sys/dev/ata/ata-sata.c
201
if (ata_sata_scr_write(ch, port, ATA_SCONTROL,
sys/dev/ata/ata-sata.c
202
ATA_SC_DET_IDLE | val1 | ((ch->pm_level > 0) ? 0 :
sys/dev/ata/ata-sata.c
206
if (ata_sata_scr_read(ch, port, ATA_SCONTROL, &val))
sys/dev/ata/ata-sata.c
209
return ata_sata_connect(ch, port, 0);
sys/dev/ata/ata-sata.c
214
ata_sata_scr_write(ch, port, ATA_SERROR, 0xffffffff);
sys/dev/ata/ata-sata.c
236
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/ata-sata.c
238
if (ch->r_io[ATA_SSTATUS].res)
sys/dev/ata/ata-sata.c
239
return ((ATA_IDX_INL(ch, ATA_SSTATUS) & 0x0f0) >> 4);
sys/dev/ata/ata-sata.c
287
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/ata-sata.c
292
if (ch->hw.pm_read(dev, ATA_PM, 0, &pm_chipid)) {
sys/dev/ata/ata-sata.c
298
if (ch->hw.pm_read(dev, ATA_PM, 1, &pm_revision)) {
sys/dev/ata/ata-sata.c
304
if (ch->hw.pm_read(dev, ATA_PM, 2, &pm_ports)) {
sys/dev/ata/ata-sata.c
351
signature = ch->hw.softreset(dev, port);
sys/dev/ata/ata-sata.c
359
ch->devices |= (ATA_ATA_MASTER << port);
sys/dev/ata/ata-sata.c
362
ch->devices |= (ATA_ATAPI_MASTER << port);
sys/dev/ata/ata-sata.c
51
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/ata-sata.c
54
if (ata_sata_scr_read(ch, port, ATA_SERROR, &error))
sys/dev/ata/ata-sata.c
63
ata_sata_scr_write(ch, port, ATA_SERROR, error);
sys/dev/ata/ata-sata.c
66
if ((error & ATA_SE_PHY_CHANGED) && (ch->pm_level == 0)) {
sys/dev/ata/ata-sata.c
68
if (ata_sata_scr_read(ch, port, ATA_SSTATUS, &status)) {
sys/dev/ata/ata-sata.c
77
taskqueue_enqueue(taskqueue_thread, &ch->conntask);
sys/dev/ata/ata-sata.c
82
ata_sata_scr_read(struct ata_channel *ch, int port, int reg, uint32_t *val)
sys/dev/ata/ata-sata.c
85
if (ch->hw.pm_read != NULL)
sys/dev/ata/ata-sata.c
86
return (ch->hw.pm_read(ch->dev, port, reg, val));
sys/dev/ata/ata-sata.c
87
if (ch->r_io[reg].res) {
sys/dev/ata/ata-sata.c
88
*val = ATA_IDX_INL(ch, reg);
sys/dev/ata/ata-sata.c
95
ata_sata_scr_write(struct ata_channel *ch, int port, int reg, uint32_t val)
sys/dev/ata/ata-sata.c
98
if (ch->hw.pm_write != NULL)
sys/dev/ata/ata-sata.c
99
return (ch->hw.pm_write(ch->dev, port, reg, val));
sys/dev/ata/chipsets/ata-acard.c
112
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/chipsets/ata-acard.c
118
ch->hw.status = ata_acard_status;
sys/dev/ata/chipsets/ata-acard.c
119
ch->flags |= ATA_NO_ATAPI_DMA;
sys/dev/ata/chipsets/ata-acard.c
126
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/chipsets/ata-acard.c
128
if (ch->dma.flags & ATA_DMA_ACTIVE) {
sys/dev/ata/chipsets/ata-acard.c
129
int bmstat = ATA_IDX_INB(ch, ATA_BMSTAT_PORT) & ATA_BMSTAT_MASK;
sys/dev/ata/chipsets/ata-acard.c
134
ATA_IDX_OUTB(ch, ATA_BMSTAT_PORT, bmstat & ~ATA_BMSTAT_ERROR);
sys/dev/ata/chipsets/ata-acard.c
136
ATA_IDX_OUTB(ch, ATA_BMCMD_PORT,
sys/dev/ata/chipsets/ata-acard.c
137
ATA_IDX_INB(ch, ATA_BMCMD_PORT) & ~ATA_BMCMD_START_STOP);
sys/dev/ata/chipsets/ata-acard.c
140
if (ATA_IDX_INB(ch, ATA_ALTSTAT) & ATA_S_BUSY) {
sys/dev/ata/chipsets/ata-acard.c
142
if (ATA_IDX_INB(ch, ATA_ALTSTAT) & ATA_S_BUSY)
sys/dev/ata/chipsets/ata-acard.c
153
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/chipsets/ata-acard.c
154
int devno = (ch->unit << 1) + target;
sys/dev/ata/chipsets/ata-acard.c
177
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/chipsets/ata-acard.c
178
int devno = (ch->unit << 1) + target;
sys/dev/ata/chipsets/ata-acerlabs.c
195
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/chipsets/ata-acerlabs.c
202
ch->flags |= ATA_CHECKS_CABLE;
sys/dev/ata/chipsets/ata-acerlabs.c
205
ch->flags |= ATA_NO_48BIT_DMA;
sys/dev/ata/chipsets/ata-acerlabs.c
206
if (ch->dma.max_iosize > 256 * 512)
sys/dev/ata/chipsets/ata-acerlabs.c
207
ch->dma.max_iosize = 256 * 512;
sys/dev/ata/chipsets/ata-acerlabs.c
210
ch->flags |= ATA_NO_ATAPI_DMA;
sys/dev/ata/chipsets/ata-acerlabs.c
220
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/chipsets/ata-acerlabs.c
223
int unit01 = (ch->unit & 1), unit10 = (ch->unit & 2);
sys/dev/ata/chipsets/ata-acerlabs.c
236
ch->r_io[i].res = io;
sys/dev/ata/chipsets/ata-acerlabs.c
237
ch->r_io[i].offset = i + (unit10 ? 8 : 0);
sys/dev/ata/chipsets/ata-acerlabs.c
239
ch->r_io[ATA_CONTROL].res = ctlio;
sys/dev/ata/chipsets/ata-acerlabs.c
240
ch->r_io[ATA_CONTROL].offset = 2 + (unit10 ? 4 : 0);
sys/dev/ata/chipsets/ata-acerlabs.c
241
ch->r_io[ATA_IDX_ADDR].res = io;
sys/dev/ata/chipsets/ata-acerlabs.c
245
ch->r_io[i].res = ctlr->r_res1;
sys/dev/ata/chipsets/ata-acerlabs.c
246
ch->r_io[i].offset = (i - ATA_BMCMD_PORT)+(ch->unit * ATA_BMIOSIZE);
sys/dev/ata/chipsets/ata-acerlabs.c
249
ch->flags |= ATA_NO_SLAVE;
sys/dev/ata/chipsets/ata-acerlabs.c
250
ch->flags |= ATA_SATA;
sys/dev/ata/chipsets/ata-acerlabs.c
261
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/chipsets/ata-acerlabs.c
278
~(0x04 << ch->unit), 1);
sys/dev/ata/chipsets/ata-acerlabs.c
281
(0x04 << ch->unit), 1);
sys/dev/ata/chipsets/ata-acerlabs.c
295
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/chipsets/ata-acerlabs.c
296
int devno = (ch->unit << 1) + target;
sys/dev/ata/chipsets/ata-acerlabs.c
309
pci_read_config(parent, 0x4a, 1) & (1 << ch->unit)) {
sys/dev/ata/chipsets/ata-acerlabs.c
316
ch->flags |= ATA_ATAPI_DMA_RO;
sys/dev/ata/chipsets/ata-acerlabs.c
317
if (ch->devices & ATA_ATAPI_MASTER &&
sys/dev/ata/chipsets/ata-acerlabs.c
318
ch->devices & ATA_ATAPI_SLAVE) {
sys/dev/ata/chipsets/ata-acerlabs.c
338
pci_write_config(parent, 0x58 + (ch->unit << 2),
sys/dev/ata/chipsets/ata-amd.c
111
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/chipsets/ata-amd.c
112
int devno = (ch->unit << 1) + target;
sys/dev/ata/chipsets/ata-amd.c
145
struct ata_channel *ch;
sys/dev/ata/chipsets/ata-amd.c
149
ch = device_get_softc(dev);
sys/dev/ata/chipsets/ata-amd.c
152
ch->flags |= ATA_CHECKS_CABLE;
sys/dev/ata/chipsets/ata-ati.c
179
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/chipsets/ata-ati.c
183
ch->flags |= ATA_SATA;
sys/dev/ata/chipsets/ata-ati.c
191
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/chipsets/ata-ati.c
199
if (ch->unit == ((satacfg & 0x10) >> 4))
sys/dev/ata/chipsets/ata-ati.c
200
ch->flags |= ATA_SATA;
sys/dev/ata/chipsets/ata-ati.c
209
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/chipsets/ata-ati.c
210
int devno = (ch->unit << 1) + target;
sys/dev/ata/chipsets/ata-cypress.c
103
pci_write_config(parent, ch->unit ? 0x4e : 0x4c, 0x2020, 2);
sys/dev/ata/chipsets/ata-cypress.c
97
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/chipsets/ata-cyrix.c
100
int devno = (ch->unit << 1) + target;
sys/dev/ata/chipsets/ata-cyrix.c
114
ATA_OUTL(ch->r_io[ATA_BMCMD_PORT].res,
sys/dev/ata/chipsets/ata-cyrix.c
119
ATA_OUTL(ch->r_io[ATA_BMCMD_PORT].res,
sys/dev/ata/chipsets/ata-cyrix.c
126
ATA_OUTL(ch->r_io[ATA_BMCMD_PORT].res,
sys/dev/ata/chipsets/ata-cyrix.c
88
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/chipsets/ata-cyrix.c
90
ch->dma.alignment = 16;
sys/dev/ata/chipsets/ata-cyrix.c
91
ch->dma.max_iosize = 64 * DEV_BSIZE;
sys/dev/ata/chipsets/ata-cyrix.c
99
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/chipsets/ata-highpoint.c
143
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/chipsets/ata-highpoint.c
148
ch->flags |= ATA_ALWAYS_DMASTAT;
sys/dev/ata/chipsets/ata-highpoint.c
149
ch->flags |= ATA_CHECKS_CABLE;
sys/dev/ata/chipsets/ata-highpoint.c
151
ch->flags |= ATA_NO_ATAPI_DMA;
sys/dev/ata/chipsets/ata-highpoint.c
160
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/chipsets/ata-highpoint.c
161
int devno = (ch->unit << 1) + target;
sys/dev/ata/chipsets/ata-highpoint.c
199
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/chipsets/ata-highpoint.c
203
reg = ch->unit ? 0x57 : 0x53;
sys/dev/ata/chipsets/ata-highpoint.c
212
res = pci_read_config(parent, 0x5a, 1) & (ch->unit ? 0x1:0x2);
sys/dev/ata/chipsets/ata-intel.c
313
struct ata_channel *ch;
sys/dev/ata/chipsets/ata-intel.c
322
ch = device_get_softc(dev);
sys/dev/ata/chipsets/ata-intel.c
326
ch->r_io[ATA_IDX_ADDR].res = ctlr->r_res2;
sys/dev/ata/chipsets/ata-intel.c
327
ch->r_io[ATA_IDX_ADDR].offset = 0x00;
sys/dev/ata/chipsets/ata-intel.c
328
ch->r_io[ATA_IDX_DATA].res = ctlr->r_res2;
sys/dev/ata/chipsets/ata-intel.c
329
ch->r_io[ATA_IDX_DATA].offset = 0x04;
sys/dev/ata/chipsets/ata-intel.c
332
ch->flags |= ATA_ALWAYS_DMASTAT;
sys/dev/ata/chipsets/ata-intel.c
334
smap = ATA_INTEL_SMAP(ctlr, ch);
sys/dev/ata/chipsets/ata-intel.c
339
ch->flags |= ATA_SATA;
sys/dev/ata/chipsets/ata-intel.c
340
ch->flags |= ATA_NO_SLAVE;
sys/dev/ata/chipsets/ata-intel.c
341
smap[0] = (map & 0x01) ^ ch->unit;
sys/dev/ata/chipsets/ata-intel.c
343
} else if ((map & 0x02) == 0 && ch->unit == 0) {
sys/dev/ata/chipsets/ata-intel.c
344
ch->flags |= ATA_SATA;
sys/dev/ata/chipsets/ata-intel.c
347
} else if ((map & 0x02) != 0 && ch->unit == 1) {
sys/dev/ata/chipsets/ata-intel.c
348
ch->flags |= ATA_SATA;
sys/dev/ata/chipsets/ata-intel.c
353
ch->flags |= ATA_SATA;
sys/dev/ata/chipsets/ata-intel.c
354
ch->flags |= ATA_NO_SLAVE;
sys/dev/ata/chipsets/ata-intel.c
355
smap[0] = (ch->unit == 0) ? 0 : 1;
sys/dev/ata/chipsets/ata-intel.c
360
ch->flags |= ATA_SATA;
sys/dev/ata/chipsets/ata-intel.c
361
smap[0] = (ch->unit == 0) ? 0 : 1;
sys/dev/ata/chipsets/ata-intel.c
362
smap[1] = (ch->unit == 0) ? 2 : 3;
sys/dev/ata/chipsets/ata-intel.c
363
} else if (map == 0x02 && ch->unit == 0) {
sys/dev/ata/chipsets/ata-intel.c
364
ch->flags |= ATA_SATA;
sys/dev/ata/chipsets/ata-intel.c
367
} else if (map == 0x01 && ch->unit == 1) {
sys/dev/ata/chipsets/ata-intel.c
368
ch->flags |= ATA_SATA;
sys/dev/ata/chipsets/ata-intel.c
373
if (ch->flags & ATA_SATA) {
sys/dev/ata/chipsets/ata-intel.c
375
ch->hw.pm_read = ata_intel_sata_cscr_read;
sys/dev/ata/chipsets/ata-intel.c
376
ch->hw.pm_write = ata_intel_sata_cscr_write;
sys/dev/ata/chipsets/ata-intel.c
379
ch->hw.pm_read = ata_intel_sata_ahci_read;
sys/dev/ata/chipsets/ata-intel.c
380
ch->hw.pm_write = ata_intel_sata_ahci_write;
sys/dev/ata/chipsets/ata-intel.c
382
ch->hw.pm_read = ata_intel_sata_sidpr_read;
sys/dev/ata/chipsets/ata-intel.c
383
ch->hw.pm_write = ata_intel_sata_sidpr_write;
sys/dev/ata/chipsets/ata-intel.c
386
if (ch->hw.pm_write != NULL) {
sys/dev/ata/chipsets/ata-intel.c
387
ch->flags |= ATA_PERIODIC_POLL;
sys/dev/ata/chipsets/ata-intel.c
388
ch->hw.status = ata_intel_sata_status;
sys/dev/ata/chipsets/ata-intel.c
389
ata_sata_scr_write(ch, 0,
sys/dev/ata/chipsets/ata-intel.c
391
if ((ch->flags & ATA_NO_SLAVE) == 0) {
sys/dev/ata/chipsets/ata-intel.c
392
ata_sata_scr_write(ch, 1,
sys/dev/ata/chipsets/ata-intel.c
399
ch->flags |= ATA_USE_16BIT;
sys/dev/ata/chipsets/ata-intel.c
401
ch->flags |= ATA_CHECKS_CABLE;
sys/dev/ata/chipsets/ata-intel.c
410
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/chipsets/ata-intel.c
416
if ((ch->flags & ATA_SATA) == 0)
sys/dev/ata/chipsets/ata-intel.c
420
smap = ATA_INTEL_SMAP(ctlr, ch);
sys/dev/ata/chipsets/ata-intel.c
422
if ((ch->flags & ATA_NO_SLAVE) == 0)
sys/dev/ata/chipsets/ata-intel.c
437
if ((pcs == mask) && (ATA_IDX_INB(ch, ATA_STATUS) != 0xff))
sys/dev/ata/chipsets/ata-intel.c
445
if (ch->hw.pm_read != NULL) {
sys/dev/ata/chipsets/ata-intel.c
447
if ((ch->flags & ATA_NO_SLAVE) == 0)
sys/dev/ata/chipsets/ata-intel.c
452
if ((ch->flags & ATA_NO_SLAVE) == 0)
sys/dev/ata/chipsets/ata-intel.c
459
ch->devices &= (devs | (devs * ATA_ATAPI_MASTER));
sys/dev/ata/chipsets/ata-intel.c
461
ch->devices = 0;
sys/dev/ata/chipsets/ata-intel.c
479
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/chipsets/ata-intel.c
480
int devno = (ch->unit << 1) + target;
sys/dev/ata/chipsets/ata-intel.c
495
if (ch->flags & ATA_SATA)
sys/dev/ata/chipsets/ata-intel.c
536
if (ch->unit) {
sys/dev/ata/chipsets/ata-intel.c
579
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/chipsets/ata-intel.c
582
if (ata_sata_scr_read(ch, target, ATA_SSTATUS, &status) == 0)
sys/dev/ata/chipsets/ata-intel.c
590
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/chipsets/ata-intel.c
593
if ((ch->flags & ATA_NO_SLAVE) == 0)
sys/dev/ata/chipsets/ata-intel.c
603
struct ata_channel *ch;
sys/dev/ata/chipsets/ata-intel.c
610
ch = device_get_softc(dev);
sys/dev/ata/chipsets/ata-intel.c
612
smap = ATA_INTEL_SMAP(ctlr, ch);
sys/dev/ata/chipsets/ata-intel.c
635
struct ata_channel *ch;
sys/dev/ata/chipsets/ata-intel.c
641
ch = device_get_softc(dev);
sys/dev/ata/chipsets/ata-intel.c
642
smap = ATA_INTEL_SMAP(ctlr, ch);
sys/dev/ata/chipsets/ata-intel.c
669
struct ata_channel *ch;
sys/dev/ata/chipsets/ata-intel.c
674
ch = device_get_softc(dev);
sys/dev/ata/chipsets/ata-intel.c
690
ATA_IDX_OUTL(ch, ATA_IDX_ADDR, ((ch->unit * 2 + port) << 8) + reg);
sys/dev/ata/chipsets/ata-intel.c
691
*result = ATA_IDX_INL(ch, ATA_IDX_DATA);
sys/dev/ata/chipsets/ata-intel.c
700
struct ata_channel *ch;
sys/dev/ata/chipsets/ata-intel.c
707
ch = device_get_softc(dev);
sys/dev/ata/chipsets/ata-intel.c
709
smap = ATA_INTEL_SMAP(ctlr, ch);
sys/dev/ata/chipsets/ata-intel.c
732
struct ata_channel *ch;
sys/dev/ata/chipsets/ata-intel.c
738
ch = device_get_softc(dev);
sys/dev/ata/chipsets/ata-intel.c
739
smap = ATA_INTEL_SMAP(ctlr, ch);
sys/dev/ata/chipsets/ata-intel.c
766
struct ata_channel *ch;
sys/dev/ata/chipsets/ata-intel.c
771
ch = device_get_softc(dev);
sys/dev/ata/chipsets/ata-intel.c
787
ATA_IDX_OUTL(ch, ATA_IDX_ADDR, ((ch->unit * 2 + port) << 8) + reg);
sys/dev/ata/chipsets/ata-intel.c
788
ATA_IDX_OUTL(ch, ATA_IDX_DATA, value);
sys/dev/ata/chipsets/ata-intel.c
796
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/chipsets/ata-intel.c
800
port = (ch->flags & ATA_NO_SLAVE) ? 0 : 1;
sys/dev/ata/chipsets/ata-intel.c
823
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/chipsets/ata-intel.c
829
ch_offset = 0x200 + ch->unit * 0x200;
sys/dev/ata/chipsets/ata-intel.c
832
ch->r_io[i].res = ctlr->r_res2;
sys/dev/ata/chipsets/ata-intel.c
835
ch->r_io[ATA_DATA].offset = ch_offset + 0x00;
sys/dev/ata/chipsets/ata-intel.c
836
ch->r_io[ATA_FEATURE].offset = ch_offset + 0x06;
sys/dev/ata/chipsets/ata-intel.c
837
ch->r_io[ATA_COUNT].offset = ch_offset + 0x08;
sys/dev/ata/chipsets/ata-intel.c
838
ch->r_io[ATA_SECTOR].offset = ch_offset + 0x0c;
sys/dev/ata/chipsets/ata-intel.c
839
ch->r_io[ATA_CYL_LSB].offset = ch_offset + 0x10;
sys/dev/ata/chipsets/ata-intel.c
840
ch->r_io[ATA_CYL_MSB].offset = ch_offset + 0x14;
sys/dev/ata/chipsets/ata-intel.c
841
ch->r_io[ATA_DRIVE].offset = ch_offset + 0x18;
sys/dev/ata/chipsets/ata-intel.c
842
ch->r_io[ATA_COMMAND].offset = ch_offset + 0x1d;
sys/dev/ata/chipsets/ata-intel.c
843
ch->r_io[ATA_ERROR].offset = ch_offset + 0x04;
sys/dev/ata/chipsets/ata-intel.c
844
ch->r_io[ATA_STATUS].offset = ch_offset + 0x1c;
sys/dev/ata/chipsets/ata-intel.c
845
ch->r_io[ATA_ALTSTAT].offset = ch_offset + 0x28;
sys/dev/ata/chipsets/ata-intel.c
846
ch->r_io[ATA_CONTROL].offset = ch_offset + 0x29;
sys/dev/ata/chipsets/ata-intel.c
849
ch->r_io[ATA_SSTATUS].offset = ch_offset + 0x100;
sys/dev/ata/chipsets/ata-intel.c
850
ch->r_io[ATA_SERROR].offset = ch_offset + 0x104;
sys/dev/ata/chipsets/ata-intel.c
851
ch->r_io[ATA_SCONTROL].offset = ch_offset + 0x108;
sys/dev/ata/chipsets/ata-intel.c
854
ch->r_io[ATA_BMCMD_PORT].offset = ch_offset + 0x70;
sys/dev/ata/chipsets/ata-intel.c
855
ch->r_io[ATA_BMSTAT_PORT].offset = ch_offset + 0x72;
sys/dev/ata/chipsets/ata-intel.c
856
ch->r_io[ATA_BMDTP_PORT].offset = ch_offset + 0x74;
sys/dev/ata/chipsets/ata-intel.c
858
ch->flags |= ATA_NO_SLAVE;
sys/dev/ata/chipsets/ata-intel.c
859
ch->flags |= ATA_SATA;
sys/dev/ata/chipsets/ata-intel.c
861
ch->hw.status = ata_intel_31244_status;
sys/dev/ata/chipsets/ata-intel.c
862
ch->hw.tf_write = ata_intel_31244_tf_write;
sys/dev/ata/chipsets/ata-intel.c
866
ATA_INL(ctlr->r_res2, 0x04) | (0x01 << (ch->unit << 3)));
sys/dev/ata/chipsets/ata-intel.c
891
struct ata_channel *ch = device_get_softc(request->parent);
sys/dev/ata/chipsets/ata-intel.c
894
ATA_IDX_OUTW(ch, ATA_FEATURE, request->u.ata.feature);
sys/dev/ata/chipsets/ata-intel.c
895
ATA_IDX_OUTW(ch, ATA_COUNT, request->u.ata.count);
sys/dev/ata/chipsets/ata-intel.c
896
ATA_IDX_OUTW(ch, ATA_SECTOR, ((request->u.ata.lba >> 16) & 0xff00) |
sys/dev/ata/chipsets/ata-intel.c
898
ATA_IDX_OUTW(ch, ATA_CYL_LSB, ((request->u.ata.lba >> 24) & 0xff00) |
sys/dev/ata/chipsets/ata-intel.c
900
ATA_IDX_OUTW(ch, ATA_CYL_MSB, ((request->u.ata.lba >> 32) & 0xff00) |
sys/dev/ata/chipsets/ata-intel.c
902
ATA_IDX_OUTW(ch, ATA_DRIVE, ATA_D_LBA | ATA_DEV(request->unit));
sys/dev/ata/chipsets/ata-intel.c
905
ATA_IDX_OUTB(ch, ATA_FEATURE, request->u.ata.feature);
sys/dev/ata/chipsets/ata-intel.c
906
ATA_IDX_OUTB(ch, ATA_COUNT, request->u.ata.count);
sys/dev/ata/chipsets/ata-intel.c
907
ATA_IDX_OUTB(ch, ATA_SECTOR, request->u.ata.lba);
sys/dev/ata/chipsets/ata-intel.c
908
ATA_IDX_OUTB(ch, ATA_CYL_LSB, request->u.ata.lba >> 8);
sys/dev/ata/chipsets/ata-intel.c
909
ATA_IDX_OUTB(ch, ATA_CYL_MSB, request->u.ata.lba >> 16);
sys/dev/ata/chipsets/ata-intel.c
910
ATA_IDX_OUTB(ch, ATA_DRIVE,
sys/dev/ata/chipsets/ata-intel.c
919
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/chipsets/ata-intel.c
92
#define ATA_INTEL_SMAP(ctlr, ch) \
sys/dev/ata/chipsets/ata-intel.c
924
ch->devices = 0;
sys/dev/ata/chipsets/ata-intel.c
93
&((struct ata_intel_data *)((ctlr)->chipset_data))->smap[(ch)->unit * 2]
sys/dev/ata/chipsets/ata-ite.c
115
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/chipsets/ata-ite.c
119
ch->flags |= ATA_CHECKS_CABLE;
sys/dev/ata/chipsets/ata-ite.c
120
ch->flags |= ATA_NO_ATAPI_DMA;
sys/dev/ata/chipsets/ata-ite.c
129
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/chipsets/ata-ite.c
130
int devno = (ch->unit << 1) + target;
sys/dev/ata/chipsets/ata-ite.c
142
(ch->unit ? (1<<3) : (1<<2)))) {
sys/dev/ata/chipsets/ata-ite.c
153
0x56 + (ch->unit << 2) + target,
sys/dev/ata/chipsets/ata-ite.c
165
pci_write_config(parent, 0x54 + (ch->unit << 2),
sys/dev/ata/chipsets/ata-ite.c
166
max(timings[ch->unit << 1], timings[(ch->unit << 1) + 1]), 1);
sys/dev/ata/chipsets/ata-jmicron.c
131
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/chipsets/ata-jmicron.c
135
ch->flags |= ATA_CHECKS_CABLE;
sys/dev/ata/chipsets/ata-marvell.c
145
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/chipsets/ata-marvell.c
150
ch->flags |= ATA_USE_16BIT;
sys/dev/ata/chipsets/ata-marvell.c
151
ch->flags |= ATA_CHECKS_CABLE;
sys/dev/ata/chipsets/ata-marvell.c
159
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/chipsets/ata-marvell.c
164
ATA_IDX_INB(ch, ATA_BMDEVSPEC_0) & 0x01) {
sys/dev/ata/chipsets/ata-marvell.c
65
#define ATA_MV_HOST_BASE(ch) \
sys/dev/ata/chipsets/ata-marvell.c
66
((ch->unit & 3) * 0x0100) + (ch->unit > 3 ? 0x30000 : 0x20000)
sys/dev/ata/chipsets/ata-marvell.c
67
#define ATA_MV_EDMA_BASE(ch) \
sys/dev/ata/chipsets/ata-marvell.c
68
((ch->unit & 3) * 0x2000) + (ch->unit > 3 ? 0x30000 : 0x20000)
sys/dev/ata/chipsets/ata-national.c
101
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/chipsets/ata-national.c
102
int devno = (ch->unit << 1) + target;
sys/dev/ata/chipsets/ata-national.c
90
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/chipsets/ata-national.c
92
ch->dma.alignment = 16;
sys/dev/ata/chipsets/ata-national.c
93
ch->dma.max_iosize = 64 * DEV_BSIZE;
sys/dev/ata/chipsets/ata-netcell.c
89
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/chipsets/ata-netcell.c
96
ch->flags |= ATA_USE_16BIT;
sys/dev/ata/chipsets/ata-netcell.c
98
ch->flags |= ATA_CHECKS_CABLE;
sys/dev/ata/chipsets/ata-nvidia.c
250
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/chipsets/ata-nvidia.c
256
ch->r_io[ATA_SSTATUS].res = ctlr->r_res2;
sys/dev/ata/chipsets/ata-nvidia.c
257
ch->r_io[ATA_SSTATUS].offset = (ch->unit << 6);
sys/dev/ata/chipsets/ata-nvidia.c
258
ch->r_io[ATA_SERROR].res = ctlr->r_res2;
sys/dev/ata/chipsets/ata-nvidia.c
259
ch->r_io[ATA_SERROR].offset = 0x04 + (ch->unit << 6);
sys/dev/ata/chipsets/ata-nvidia.c
260
ch->r_io[ATA_SCONTROL].res = ctlr->r_res2;
sys/dev/ata/chipsets/ata-nvidia.c
261
ch->r_io[ATA_SCONTROL].offset = 0x08 + (ch->unit << 6);
sys/dev/ata/chipsets/ata-nvidia.c
263
ch->hw.status = ata_nvidia_status;
sys/dev/ata/chipsets/ata-nvidia.c
264
ch->flags |= ATA_NO_SLAVE;
sys/dev/ata/chipsets/ata-nvidia.c
265
ch->flags |= ATA_SATA;
sys/dev/ata/chipsets/ata-nvidia.c
272
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/chipsets/ata-nvidia.c
276
ch->flags |= ATA_SATA;
sys/dev/ata/chipsets/ata-nvidia.c
284
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/chipsets/ata-nvidia.c
286
int shift = ch->unit << (ctlr->chip->cfg1 & NVQ ? 4 : 2);
sys/dev/ata/chipsets/ata-nvidia.c
312
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/chipsets/ata-nvidia.c
317
ch->devices = 0;
sys/dev/ata/chipsets/ata-nvidia.c
325
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/chipsets/ata-nvidia.c
326
int devno = (ch->unit << 1) + target;
sys/dev/ata/chipsets/ata-promise.c
1016
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/chipsets/ata-promise.c
1019
((ctlr->chip->cfg2 == PR_CMBO) && (ch->unit < 2)) ||
sys/dev/ata/chipsets/ata-promise.c
1021
((ctlr->chip->cfg2 == PR_CMBO2) && (ch->unit < 2)))
sys/dev/ata/chipsets/ata-promise.c
1032
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/chipsets/ata-promise.c
1035
((ctlr->chip->cfg2 == PR_CMBO) && (ch->unit < 2)) ||
sys/dev/ata/chipsets/ata-promise.c
1037
((ctlr->chip->cfg2 == PR_CMBO2) && (ch->unit < 2)))
sys/dev/ata/chipsets/ata-promise.c
1047
struct ata_channel *ch;
sys/dev/ata/chipsets/ata-promise.c
1053
if ((ch = ctlr->interrupt[unit].argument))
sys/dev/ata/chipsets/ata-promise.c
1054
ctlr->interrupt[unit].function(ch);
sys/dev/ata/chipsets/ata-promise.c
1056
if ((ch = ctlr->interrupt[unit].argument))
sys/dev/ata/chipsets/ata-promise.c
1058
htole32((ch->unit * ATA_PDC_CHN_OFFSET) +
sys/dev/ata/chipsets/ata-promise.c
1062
if ((ch = ctlr->interrupt[unit].argument))
sys/dev/ata/chipsets/ata-promise.c
1063
ctlr->interrupt[unit].function(ch);
sys/dev/ata/chipsets/ata-promise.c
1067
if ((ch = ctlr->interrupt[unit].argument))
sys/dev/ata/chipsets/ata-promise.c
1068
ATA_OUTL(ctlr->r_res2, 0x000c0240 + (ch->unit << 7),
sys/dev/ata/chipsets/ata-promise.c
1069
htole32((ch->unit * ATA_PDC_CHN_OFFSET) +
sys/dev/ata/chipsets/ata-promise.c
1080
struct ata_channel *ch = device_get_softc(request->parent);
sys/dev/ata/chipsets/ata-promise.c
1101
ATA_OUTL(ctlr->r_res2, 0x000c0400 + ((ch->unit + 1) << 2), 0x00000001);
sys/dev/ata/chipsets/ata-promise.c
1110
(window + (ch->unit * ATA_PDC_CHN_OFFSET) + ATA_PDC_APKT_OFFSET);
sys/dev/ata/chipsets/ata-promise.c
1111
wordp[0] = htole32(0x08 | ((ch->unit + 1)<<16) | (0x00 << 24));
sys/dev/ata/chipsets/ata-promise.c
1116
ATA_OUTL(ctlr->r_res2, 0x000c0400 + ((ch->unit + 1) << 2), 0x00000001);
sys/dev/ata/chipsets/ata-promise.c
1117
ATA_OUTL(ctlr->r_res2, 0x000c0240 + (ch->unit << 7),
sys/dev/ata/chipsets/ata-promise.c
1118
htole32((ch->unit * ATA_PDC_CHN_OFFSET)+ATA_PDC_APKT_OFFSET));
sys/dev/ata/chipsets/ata-promise.c
1127
(window + (ch->unit * ATA_PDC_CHN_OFFSET) + ATA_PDC_HSG_OFFSET);
sys/dev/ata/chipsets/ata-promise.c
1135
(window + (ch->unit * ATA_PDC_CHN_OFFSET) + ATA_PDC_LSG_OFFSET);
sys/dev/ata/chipsets/ata-promise.c
1136
wordp[0] = htole32((ch->unit * ATA_PDC_BUF_OFFSET) + ATA_PDC_BUF_BASE);
sys/dev/ata/chipsets/ata-promise.c
1140
(window + (ch->unit * ATA_PDC_CHN_OFFSET) + ATA_PDC_ASG_OFFSET);
sys/dev/ata/chipsets/ata-promise.c
1141
wordp[0] = htole32((ch->unit * ATA_PDC_BUF_OFFSET) + ATA_PDC_BUF_BASE);
sys/dev/ata/chipsets/ata-promise.c
1145
(window + (ch->unit * ATA_PDC_CHN_OFFSET) + ATA_PDC_HPKT_OFFSET);
sys/dev/ata/chipsets/ata-promise.c
1147
wordp[0] = htole32(0x14 | ((ch->unit+9)<<16) | ((ch->unit+5)<<24));
sys/dev/ata/chipsets/ata-promise.c
1149
wordp[0] = htole32(0x00 | ((ch->unit+13)<<16) | (0x00<<24));
sys/dev/ata/chipsets/ata-promise.c
1150
wordp[1] = htole32((ch->unit * ATA_PDC_CHN_OFFSET)+ATA_PDC_HSG_OFFSET);
sys/dev/ata/chipsets/ata-promise.c
1151
wordp[2] = htole32((ch->unit * ATA_PDC_CHN_OFFSET)+ATA_PDC_LSG_OFFSET);
sys/dev/ata/chipsets/ata-promise.c
1155
(window + (ch->unit * ATA_PDC_CHN_OFFSET) + ATA_PDC_APKT_OFFSET);
sys/dev/ata/chipsets/ata-promise.c
1157
wordp[0] = htole32(0x04 | ((ch->unit+5)<<16) | (0x00<<24));
sys/dev/ata/chipsets/ata-promise.c
1159
wordp[0] = htole32(0x10 | ((ch->unit+1)<<16) | ((ch->unit+13)<<24));
sys/dev/ata/chipsets/ata-promise.c
1160
wordp[1] = htole32((ch->unit * ATA_PDC_CHN_OFFSET)+ATA_PDC_ASG_OFFSET);
sys/dev/ata/chipsets/ata-promise.c
1166
ATA_OUTL(ctlr->r_res2, 0x000c0400 + ((ch->unit+5)<<2), 0x00000001);
sys/dev/ata/chipsets/ata-promise.c
1167
ATA_OUTL(ctlr->r_res2, 0x000c0400 + ((ch->unit+9)<<2), 0x00000001);
sys/dev/ata/chipsets/ata-promise.c
1168
ATA_OUTL(ctlr->r_res2, 0x000c0240 + (ch->unit << 7),
sys/dev/ata/chipsets/ata-promise.c
1169
htole32((ch->unit * ATA_PDC_CHN_OFFSET) + ATA_PDC_APKT_OFFSET));
sys/dev/ata/chipsets/ata-promise.c
1172
ATA_OUTL(ctlr->r_res2, 0x000c0400 + ((ch->unit+1)<<2), 0x00000001);
sys/dev/ata/chipsets/ata-promise.c
1173
ATA_OUTL(ctlr->r_res2, 0x000c0400 + ((ch->unit+13)<<2), 0x00000001);
sys/dev/ata/chipsets/ata-promise.c
1175
htole32((ch->unit * ATA_PDC_CHN_OFFSET) + ATA_PDC_HPKT_OFFSET));
sys/dev/ata/chipsets/ata-promise.c
359
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/chipsets/ata-promise.c
365
ch->dma.start = ata_promise_dmastart;
sys/dev/ata/chipsets/ata-promise.c
366
ch->dma.stop = ata_promise_dmastop;
sys/dev/ata/chipsets/ata-promise.c
367
ch->dma.reset = ata_promise_dmareset;
sys/dev/ata/chipsets/ata-promise.c
370
ch->hw.status = ata_promise_status;
sys/dev/ata/chipsets/ata-promise.c
371
ch->flags |= ATA_NO_ATAPI_DMA;
sys/dev/ata/chipsets/ata-promise.c
372
ch->flags |= ATA_CHECKS_CABLE;
sys/dev/ata/chipsets/ata-promise.c
380
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/chipsets/ata-promise.c
382
if (ATA_INL(ctlr->r_res1, 0x1c) & (ch->unit ? 0x00004000 : 0x00000400)) {
sys/dev/ata/chipsets/ata-promise.c
392
struct ata_channel *ch = device_get_softc(request->parent);
sys/dev/ata/chipsets/ata-promise.c
396
ATA_INB(ctlr->r_res1, 0x11) | (ch->unit ? 0x08 : 0x02));
sys/dev/ata/chipsets/ata-promise.c
397
ATA_OUTL(ctlr->r_res1, ch->unit ? 0x24 : 0x20,
sys/dev/ata/chipsets/ata-promise.c
401
ATA_IDX_OUTB(ch, ATA_BMSTAT_PORT, (ATA_IDX_INB(ch, ATA_BMSTAT_PORT) |
sys/dev/ata/chipsets/ata-promise.c
403
ATA_IDX_OUTL(ch, ATA_BMDTP_PORT, request->dma->sg_bus);
sys/dev/ata/chipsets/ata-promise.c
404
ATA_IDX_OUTB(ch, ATA_BMCMD_PORT,
sys/dev/ata/chipsets/ata-promise.c
407
ch->dma.flags |= ATA_DMA_ACTIVE;
sys/dev/ata/chipsets/ata-promise.c
415
struct ata_channel *ch = device_get_softc(request->parent);
sys/dev/ata/chipsets/ata-promise.c
420
ATA_INB(ctlr->r_res1, 0x11) & ~(ch->unit ? 0x08 : 0x02));
sys/dev/ata/chipsets/ata-promise.c
421
ATA_OUTL(ctlr->r_res1, ch->unit ? 0x24 : 0x20, 0);
sys/dev/ata/chipsets/ata-promise.c
423
error = ATA_IDX_INB(ch, ATA_BMSTAT_PORT);
sys/dev/ata/chipsets/ata-promise.c
424
ATA_IDX_OUTB(ch, ATA_BMCMD_PORT,
sys/dev/ata/chipsets/ata-promise.c
425
ATA_IDX_INB(ch, ATA_BMCMD_PORT) & ~ATA_BMCMD_START_STOP);
sys/dev/ata/chipsets/ata-promise.c
426
ATA_IDX_OUTB(ch, ATA_BMSTAT_PORT, ATA_BMSTAT_INTERRUPT | ATA_BMSTAT_ERROR);
sys/dev/ata/chipsets/ata-promise.c
427
ch->dma.flags &= ~ATA_DMA_ACTIVE;
sys/dev/ata/chipsets/ata-promise.c
434
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/chipsets/ata-promise.c
436
ATA_IDX_OUTB(ch, ATA_BMCMD_PORT,
sys/dev/ata/chipsets/ata-promise.c
437
ATA_IDX_INB(ch, ATA_BMCMD_PORT) & ~ATA_BMCMD_START_STOP);
sys/dev/ata/chipsets/ata-promise.c
438
ATA_IDX_OUTB(ch, ATA_BMSTAT_PORT, ATA_BMSTAT_INTERRUPT | ATA_BMSTAT_ERROR);
sys/dev/ata/chipsets/ata-promise.c
439
ch->flags &= ~ATA_DMA_ACTIVE;
sys/dev/ata/chipsets/ata-promise.c
447
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/chipsets/ata-promise.c
448
int devno = (ch->unit << 1) + target;
sys/dev/ata/chipsets/ata-promise.c
474
(ch->unit ? 1 << 11 : 1 << 10))) {
sys/dev/ata/chipsets/ata-promise.c
481
ATA_IDX_OUTB(ch, ATA_BMDEVSPEC_0, 0x0b);
sys/dev/ata/chipsets/ata-promise.c
483
ATA_IDX_INB(ch, ATA_BMDEVSPEC_1) & 0x04) {
sys/dev/ata/chipsets/ata-promise.c
493
(ch->unit << 7)) & 0x01000000)) {
sys/dev/ata/chipsets/ata-promise.c
509
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/chipsets/ata-promise.c
514
ch->hw.status = ata_promise_tx2_status;
sys/dev/ata/chipsets/ata-promise.c
515
ch->flags |= ATA_CHECKS_CABLE;
sys/dev/ata/chipsets/ata-promise.c
522
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/chipsets/ata-promise.c
524
ATA_IDX_OUTB(ch, ATA_BMDEVSPEC_0, 0x0b);
sys/dev/ata/chipsets/ata-promise.c
525
if (ATA_IDX_INB(ch, ATA_BMDEVSPEC_1) & 0x20) {
sys/dev/ata/chipsets/ata-promise.c
535
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/chipsets/ata-promise.c
542
ch->r_io[i].res = ctlr->r_res2;
sys/dev/ata/chipsets/ata-promise.c
543
ch->r_io[i].offset = offset + 0x0200 + (i << 2) + (ch->unit << 7);
sys/dev/ata/chipsets/ata-promise.c
545
ch->r_io[ATA_CONTROL].res = ctlr->r_res2;
sys/dev/ata/chipsets/ata-promise.c
546
ch->r_io[ATA_CONTROL].offset = offset + 0x0238 + (ch->unit << 7);
sys/dev/ata/chipsets/ata-promise.c
547
ch->r_io[ATA_IDX_ADDR].res = ctlr->r_res2;
sys/dev/ata/chipsets/ata-promise.c
550
((ctlr->chip->cfg2 & (PR_CMBO | PR_CMBO2)) && ch->unit < 2)) {
sys/dev/ata/chipsets/ata-promise.c
551
ch->r_io[ATA_SSTATUS].res = ctlr->r_res2;
sys/dev/ata/chipsets/ata-promise.c
552
ch->r_io[ATA_SSTATUS].offset = 0x400 + (ch->unit << 8);
sys/dev/ata/chipsets/ata-promise.c
553
ch->r_io[ATA_SERROR].res = ctlr->r_res2;
sys/dev/ata/chipsets/ata-promise.c
554
ch->r_io[ATA_SERROR].offset = 0x404 + (ch->unit << 8);
sys/dev/ata/chipsets/ata-promise.c
555
ch->r_io[ATA_SCONTROL].res = ctlr->r_res2;
sys/dev/ata/chipsets/ata-promise.c
556
ch->r_io[ATA_SCONTROL].offset = 0x408 + (ch->unit << 8);
sys/dev/ata/chipsets/ata-promise.c
557
ch->flags |= ATA_NO_SLAVE;
sys/dev/ata/chipsets/ata-promise.c
558
ch->flags |= ATA_SATA;
sys/dev/ata/chipsets/ata-promise.c
560
ch->flags |= ATA_USE_16BIT;
sys/dev/ata/chipsets/ata-promise.c
561
ch->flags |= ATA_CHECKS_CABLE;
sys/dev/ata/chipsets/ata-promise.c
565
ch->hw.command = ata_promise_sx4_command;
sys/dev/ata/chipsets/ata-promise.c
568
ch->hw.command = ata_promise_mio_command;
sys/dev/ata/chipsets/ata-promise.c
569
ch->hw.status = ata_promise_mio_status;
sys/dev/ata/chipsets/ata-promise.c
570
ch->hw.softreset = ata_promise_mio_softreset;
sys/dev/ata/chipsets/ata-promise.c
571
ch->hw.pm_read = ata_promise_mio_pm_read;
sys/dev/ata/chipsets/ata-promise.c
572
ch->hw.pm_write = ata_promise_mio_pm_write;
sys/dev/ata/chipsets/ata-promise.c
589
struct ata_channel *ch;
sys/dev/ata/chipsets/ata-promise.c
603
if ((ch = ctlr->interrupt[unit].argument))
sys/dev/ata/chipsets/ata-promise.c
604
ctlr->interrupt[unit].function(ch);
sys/dev/ata/chipsets/ata-promise.c
614
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/chipsets/ata-promise.c
635
ATA_OUTL(ctlr->r_res2, stat_reg, status & (0x00000011 << ch->unit));
sys/dev/ata/chipsets/ata-promise.c
638
if (status & (0x00000001 << ch->unit)) {
sys/dev/ata/chipsets/ata-promise.c
641
taskqueue_enqueue(taskqueue_thread, &ch->conntask);
sys/dev/ata/chipsets/ata-promise.c
645
if (status & (0x00000010 << ch->unit)) {
sys/dev/ata/chipsets/ata-promise.c
648
taskqueue_enqueue(taskqueue_thread, &ch->conntask);
sys/dev/ata/chipsets/ata-promise.c
652
return (vector & (1 << (ch->unit + 1)));
sys/dev/ata/chipsets/ata-promise.c
659
struct ata_channel *ch = device_get_softc(request->parent);
sys/dev/ata/chipsets/ata-promise.c
661
u_int32_t *wordp = (u_int32_t *)ch->dma.work;
sys/dev/ata/chipsets/ata-promise.c
663
ATA_OUTL(ctlr->r_res2, (ch->unit + 1) << 2, 0x00000001);
sys/dev/ata/chipsets/ata-promise.c
666
((ctlr->chip->cfg2 == PR_CMBO2) && (ch->unit < 2))) {
sys/dev/ata/chipsets/ata-promise.c
668
ATA_OUTB(ctlr->r_res2, 0x4e8 + (ch->unit << 8), request->unit & 0x0f);
sys/dev/ata/chipsets/ata-promise.c
678
wordp[0] = htole32(0x04 | ((ch->unit + 1) << 16) | (0x00 << 24));
sys/dev/ata/chipsets/ata-promise.c
683
wordp[0] = htole32(0x00 | ((ch->unit + 1) << 16) | (0x00 << 24));
sys/dev/ata/chipsets/ata-promise.c
690
ATA_OUTL(ctlr->r_res2, 0x0240 + (ch->unit << 7), ch->dma.work_bus);
sys/dev/ata/chipsets/ata-promise.c
698
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/chipsets/ata-promise.c
706
ATA_OUTL(ctlr->r_res2, 0xc0260 + (ch->unit << 7), ch->unit + 1);
sys/dev/ata/chipsets/ata-promise.c
708
ATA_OUTL(ctlr->r_res2, 0xc0260 + (ch->unit << 7),
sys/dev/ata/chipsets/ata-promise.c
709
(ATA_INL(ctlr->r_res2, 0xc0260 + (ch->unit << 7)) &
sys/dev/ata/chipsets/ata-promise.c
710
~0x00003f9f) | (ch->unit + 1));
sys/dev/ata/chipsets/ata-promise.c
728
((ctlr->chip->cfg2 == PR_CMBO) && (ch->unit < 2))) {
sys/dev/ata/chipsets/ata-promise.c
730
ATA_OUTL(ctlr->r_res2, 0x06c, (0x00110000 << ch->unit));
sys/dev/ata/chipsets/ata-promise.c
734
ATA_OUTL(ctlr->r_res2, 0x0260 + (ch->unit << 7), (1 << 11));
sys/dev/ata/chipsets/ata-promise.c
736
ATA_OUTL(ctlr->r_res2, 0x0260 + (ch->unit << 7),
sys/dev/ata/chipsets/ata-promise.c
737
(ATA_INL(ctlr->r_res2, 0x0260 + (ch->unit << 7)) &
sys/dev/ata/chipsets/ata-promise.c
738
~0x00003f9f) | (ch->unit + 1));
sys/dev/ata/chipsets/ata-promise.c
741
((ctlr->chip->cfg2 == PR_CMBO) && (ch->unit < 2))) {
sys/dev/ata/chipsets/ata-promise.c
745
ch->devices = 0;
sys/dev/ata/chipsets/ata-promise.c
748
ATA_OUTL(ctlr->r_res2, 0x06c, (0x00000011 << ch->unit));
sys/dev/ata/chipsets/ata-promise.c
757
((ctlr->chip->cfg2 == PR_CMBO2) && (ch->unit < 2))) {
sys/dev/ata/chipsets/ata-promise.c
762
ATA_OUTL(ctlr->r_res2, 0x060, (0x00110000 << ch->unit));
sys/dev/ata/chipsets/ata-promise.c
766
ATA_OUTL(ctlr->r_res2, 0x0260 + (ch->unit << 7), (1 << 11));
sys/dev/ata/chipsets/ata-promise.c
768
ATA_OUTL(ctlr->r_res2, 0x0260 + (ch->unit << 7),
sys/dev/ata/chipsets/ata-promise.c
769
(ATA_INL(ctlr->r_res2, 0x0260 + (ch->unit << 7)) &
sys/dev/ata/chipsets/ata-promise.c
770
~0x00003f9f) | (ch->unit + 1));
sys/dev/ata/chipsets/ata-promise.c
773
((ctlr->chip->cfg2 == PR_CMBO2) && (ch->unit < 2))) {
sys/dev/ata/chipsets/ata-promise.c
775
ATA_OUTL(ctlr->r_res2, 0x414 + (ch->unit << 8),
sys/dev/ata/chipsets/ata-promise.c
776
(ATA_INL(ctlr->r_res2, 0x414 + (ch->unit << 8)) &
sys/dev/ata/chipsets/ata-promise.c
780
u_int32_t signature = ch->hw.softreset(dev, ATA_PM);
sys/dev/ata/chipsets/ata-promise.c
787
ch->devices = ATA_ATA_MASTER;
sys/dev/ata/chipsets/ata-promise.c
790
ch->devices = ATA_PORTMULTIPLIER;
sys/dev/ata/chipsets/ata-promise.c
794
ch->devices = ATA_ATAPI_MASTER;
sys/dev/ata/chipsets/ata-promise.c
800
ch->devices = ATA_ATA_MASTER;
sys/dev/ata/chipsets/ata-promise.c
804
ch->devices);
sys/dev/ata/chipsets/ata-promise.c
807
ch->devices = 0;
sys/dev/ata/chipsets/ata-promise.c
810
ATA_OUTL(ctlr->r_res2, 0x060, (0x00000011 << ch->unit));
sys/dev/ata/chipsets/ata-promise.c
813
ATA_OUTL(ctlr->r_res2, 0x4e8 + (ch->unit << 8), 0x00);
sys/dev/ata/chipsets/ata-promise.c
825
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/chipsets/ata-promise.c
829
*result = ATA_IDX_INL(ch, reg);
sys/dev/ata/chipsets/ata-promise.c
848
ATA_OUTB(ctlr->r_res2, 0x4e8 + (ch->unit << 8), 0x0f);
sys/dev/ata/chipsets/ata-promise.c
850
ATA_IDX_OUTB(ch, ATA_FEATURE, reg);
sys/dev/ata/chipsets/ata-promise.c
851
ATA_IDX_OUTB(ch, ATA_DRIVE, port);
sys/dev/ata/chipsets/ata-promise.c
853
ATA_IDX_OUTB(ch, ATA_COMMAND, ATA_READ_PM);
sys/dev/ata/chipsets/ata-promise.c
856
u_int8_t status = ATA_IDX_INB(ch, ATA_STATUS);
sys/dev/ata/chipsets/ata-promise.c
865
*result = ATA_IDX_INB(ch, ATA_COUNT) |
sys/dev/ata/chipsets/ata-promise.c
866
(ATA_IDX_INB(ch, ATA_SECTOR) << 8) |
sys/dev/ata/chipsets/ata-promise.c
867
(ATA_IDX_INB(ch, ATA_CYL_LSB) << 16) |
sys/dev/ata/chipsets/ata-promise.c
868
(ATA_IDX_INB(ch, ATA_CYL_MSB) << 24);
sys/dev/ata/chipsets/ata-promise.c
876
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/chipsets/ata-promise.c
880
ATA_IDX_OUTL(ch, reg, value);
sys/dev/ata/chipsets/ata-promise.c
899
ATA_OUTB(ctlr->r_res2, 0x4e8 + (ch->unit << 8), 0x0f);
sys/dev/ata/chipsets/ata-promise.c
901
ATA_IDX_OUTB(ch, ATA_FEATURE, reg);
sys/dev/ata/chipsets/ata-promise.c
902
ATA_IDX_OUTB(ch, ATA_DRIVE, port);
sys/dev/ata/chipsets/ata-promise.c
903
ATA_IDX_OUTB(ch, ATA_COUNT, value & 0xff);
sys/dev/ata/chipsets/ata-promise.c
904
ATA_IDX_OUTB(ch, ATA_SECTOR, (value >> 8) & 0xff);
sys/dev/ata/chipsets/ata-promise.c
905
ATA_IDX_OUTB(ch, ATA_CYL_LSB, (value >> 16) & 0xff);
sys/dev/ata/chipsets/ata-promise.c
906
ATA_IDX_OUTB(ch, ATA_CYL_MSB, (value >> 24) & 0xff);
sys/dev/ata/chipsets/ata-promise.c
908
ATA_IDX_OUTB(ch, ATA_COMMAND, ATA_WRITE_PM);
sys/dev/ata/chipsets/ata-promise.c
911
u_int8_t status = ATA_IDX_INB(ch, ATA_STATUS);
sys/dev/ata/chipsets/ata-promise.c
920
return ATA_IDX_INB(ch, ATA_ERROR);
sys/dev/ata/chipsets/ata-promise.c
928
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/chipsets/ata-promise.c
932
ATA_OUTB(ctlr->r_res2, 0x4e8 + (ch->unit << 8), port & 0x0f);
sys/dev/ata/chipsets/ata-promise.c
935
ATA_IDX_OUTB(ch, ATA_DRIVE, ATA_D_IBM | ATA_D_LBA | ATA_DEV(ATA_MASTER));
sys/dev/ata/chipsets/ata-promise.c
937
ATA_IDX_OUTB(ch, ATA_CONTROL, ATA_A_IDS | ATA_A_RESET);
sys/dev/ata/chipsets/ata-promise.c
939
ATA_IDX_OUTB(ch, ATA_CONTROL, ATA_A_IDS);
sys/dev/ata/chipsets/ata-promise.c
941
ATA_IDX_INB(ch, ATA_ERROR);
sys/dev/ata/chipsets/ata-promise.c
947
/* err = */ ATA_IDX_INB(ch, ATA_ERROR);
sys/dev/ata/chipsets/ata-promise.c
948
stat = ATA_IDX_INB(ch, ATA_STATUS);
sys/dev/ata/chipsets/ata-promise.c
955
return ATA_IDX_INB(ch, ATA_COUNT) |
sys/dev/ata/chipsets/ata-promise.c
956
(ATA_IDX_INB(ch, ATA_SECTOR) << 8) |
sys/dev/ata/chipsets/ata-promise.c
957
(ATA_IDX_INB(ch, ATA_CYL_LSB) << 16) |
sys/dev/ata/chipsets/ata-promise.c
958
(ATA_IDX_INB(ch, ATA_CYL_MSB) << 24);
sys/dev/ata/chipsets/ata-promise.c
975
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/chipsets/ata-promise.c
978
ch->dma.setprd = ata_promise_mio_setprd;
sys/dev/ata/chipsets/ata-promise.c
979
ch->dma.max_iosize = 65536;
sys/dev/ata/chipsets/ata-serverworks.c
103
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/chipsets/ata-serverworks.c
109
if (!(ATA_INL(ctlr->r_res2, 0x1f80) & (1 << ch->unit)))
sys/dev/ata/chipsets/ata-serverworks.c
117
ATA_IDX_INL(ch,ATA_STATUS);
sys/dev/ata/chipsets/ata-serverworks.c
174
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/chipsets/ata-serverworks.c
178
ch_offset = ch->unit * 0x100;
sys/dev/ata/chipsets/ata-serverworks.c
181
ch->r_io[i].res = ctlr->r_res2;
sys/dev/ata/chipsets/ata-serverworks.c
184
ch->r_io[ATA_DATA].offset = ch_offset + 0x00;
sys/dev/ata/chipsets/ata-serverworks.c
185
ch->r_io[ATA_FEATURE].offset = ch_offset + 0x04;
sys/dev/ata/chipsets/ata-serverworks.c
186
ch->r_io[ATA_COUNT].offset = ch_offset + 0x08;
sys/dev/ata/chipsets/ata-serverworks.c
187
ch->r_io[ATA_SECTOR].offset = ch_offset + 0x0c;
sys/dev/ata/chipsets/ata-serverworks.c
188
ch->r_io[ATA_CYL_LSB].offset = ch_offset + 0x10;
sys/dev/ata/chipsets/ata-serverworks.c
189
ch->r_io[ATA_CYL_MSB].offset = ch_offset + 0x14;
sys/dev/ata/chipsets/ata-serverworks.c
190
ch->r_io[ATA_DRIVE].offset = ch_offset + 0x18;
sys/dev/ata/chipsets/ata-serverworks.c
191
ch->r_io[ATA_COMMAND].offset = ch_offset + 0x1c;
sys/dev/ata/chipsets/ata-serverworks.c
192
ch->r_io[ATA_CONTROL].offset = ch_offset + 0x20;
sys/dev/ata/chipsets/ata-serverworks.c
196
ch->r_io[ATA_BMCMD_PORT].offset = ch_offset + 0x30;
sys/dev/ata/chipsets/ata-serverworks.c
197
ch->r_io[ATA_BMSTAT_PORT].offset = ch_offset + 0x32;
sys/dev/ata/chipsets/ata-serverworks.c
198
ch->r_io[ATA_BMDTP_PORT].offset = ch_offset + 0x34;
sys/dev/ata/chipsets/ata-serverworks.c
201
ch->r_io[ATA_SSTATUS].offset = ch_offset + 0x40;
sys/dev/ata/chipsets/ata-serverworks.c
202
ch->r_io[ATA_SERROR].offset = ch_offset + 0x44;
sys/dev/ata/chipsets/ata-serverworks.c
203
ch->r_io[ATA_SCONTROL].offset = ch_offset + 0x48;
sys/dev/ata/chipsets/ata-serverworks.c
205
ch->flags |= ATA_NO_SLAVE | ATA_SATA | ATA_KNOWN_PRESENCE;
sys/dev/ata/chipsets/ata-serverworks.c
207
ch->hw.tf_read = ata_serverworks_tf_read;
sys/dev/ata/chipsets/ata-serverworks.c
208
ch->hw.tf_write = ata_serverworks_tf_write;
sys/dev/ata/chipsets/ata-serverworks.c
228
ch->flags |= ATA_DMA_BEFORE_CMD;
sys/dev/ata/chipsets/ata-serverworks.c
235
ch->hw.status = ata_serverworks_status;
sys/dev/ata/chipsets/ata-serverworks.c
236
ch->flags |= ATA_STATUS_IS_LONG;
sys/dev/ata/chipsets/ata-serverworks.c
240
ch->dma.max_iosize = 64 * DEV_BSIZE;
sys/dev/ata/chipsets/ata-serverworks.c
258
struct ata_channel *ch = device_get_softc(request->parent);
sys/dev/ata/chipsets/ata-serverworks.c
263
request->u.ata.count = ATA_IDX_INW(ch, ATA_COUNT);
sys/dev/ata/chipsets/ata-serverworks.c
264
temp = ATA_IDX_INW(ch, ATA_SECTOR);
sys/dev/ata/chipsets/ata-serverworks.c
267
temp = ATA_IDX_INW(ch, ATA_CYL_LSB);
sys/dev/ata/chipsets/ata-serverworks.c
270
temp = ATA_IDX_INW(ch, ATA_CYL_MSB);
sys/dev/ata/chipsets/ata-serverworks.c
275
request->u.ata.count = ATA_IDX_INW(ch, ATA_COUNT) & 0x00ff;
sys/dev/ata/chipsets/ata-serverworks.c
276
request->u.ata.lba = (ATA_IDX_INW(ch, ATA_SECTOR) & 0x00ff) |
sys/dev/ata/chipsets/ata-serverworks.c
277
((ATA_IDX_INW(ch, ATA_CYL_LSB) & 0x00ff) << 8) |
sys/dev/ata/chipsets/ata-serverworks.c
278
((ATA_IDX_INW(ch, ATA_CYL_MSB) & 0x00ff) << 16) |
sys/dev/ata/chipsets/ata-serverworks.c
279
((ATA_IDX_INW(ch, ATA_DRIVE) & 0xf) << 24);
sys/dev/ata/chipsets/ata-serverworks.c
286
struct ata_channel *ch = device_get_softc(request->parent);
sys/dev/ata/chipsets/ata-serverworks.c
289
ATA_IDX_OUTW(ch, ATA_FEATURE, request->u.ata.feature);
sys/dev/ata/chipsets/ata-serverworks.c
290
ATA_IDX_OUTW(ch, ATA_COUNT, request->u.ata.count);
sys/dev/ata/chipsets/ata-serverworks.c
291
ATA_IDX_OUTW(ch, ATA_SECTOR, ((request->u.ata.lba >> 16) & 0xff00) |
sys/dev/ata/chipsets/ata-serverworks.c
293
ATA_IDX_OUTW(ch, ATA_CYL_LSB, ((request->u.ata.lba >> 24) & 0xff00) |
sys/dev/ata/chipsets/ata-serverworks.c
295
ATA_IDX_OUTW(ch, ATA_CYL_MSB, ((request->u.ata.lba >> 32) & 0xff00) |
sys/dev/ata/chipsets/ata-serverworks.c
297
ATA_IDX_OUTW(ch, ATA_DRIVE, ATA_D_LBA | ATA_DEV(request->unit));
sys/dev/ata/chipsets/ata-serverworks.c
300
ATA_IDX_OUTW(ch, ATA_FEATURE, request->u.ata.feature);
sys/dev/ata/chipsets/ata-serverworks.c
301
ATA_IDX_OUTW(ch, ATA_COUNT, request->u.ata.count);
sys/dev/ata/chipsets/ata-serverworks.c
302
ATA_IDX_OUTW(ch, ATA_SECTOR, request->u.ata.lba);
sys/dev/ata/chipsets/ata-serverworks.c
303
ATA_IDX_OUTW(ch, ATA_CYL_LSB, request->u.ata.lba >> 8);
sys/dev/ata/chipsets/ata-serverworks.c
304
ATA_IDX_OUTW(ch, ATA_CYL_MSB, request->u.ata.lba >> 16);
sys/dev/ata/chipsets/ata-serverworks.c
305
ATA_IDX_OUTW(ch, ATA_DRIVE,
sys/dev/ata/chipsets/ata-serverworks.c
316
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/chipsets/ata-serverworks.c
317
int devno = (ch->unit << 1) + target;
sys/dev/ata/chipsets/ata-serverworks.c
373
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/chipsets/ata-serverworks.c
378
ch->devices = 0;
sys/dev/ata/chipsets/ata-siliconimage.c
178
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/chipsets/ata-siliconimage.c
185
ch->hw.status = ata_cmd_status;
sys/dev/ata/chipsets/ata-siliconimage.c
187
ch->flags |= ATA_NO_ATAPI_DMA;
sys/dev/ata/chipsets/ata-siliconimage.c
195
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/chipsets/ata-siliconimage.c
199
(ch->unit ? 0x08 : 0x04))) {
sys/dev/ata/chipsets/ata-siliconimage.c
201
reg71 & ~(ch->unit ? 0x04 : 0x08), 1);
sys/dev/ata/chipsets/ata-siliconimage.c
212
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/chipsets/ata-siliconimage.c
213
int devno = (ch->unit << 1) + target;
sys/dev/ata/chipsets/ata-siliconimage.c
215
int ureg = ch->unit ? 0x7b : 0x73;
sys/dev/ata/chipsets/ata-siliconimage.c
245
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/chipsets/ata-siliconimage.c
246
int unit01 = (ch->unit & 1), unit10 = (ch->unit & 2);
sys/dev/ata/chipsets/ata-siliconimage.c
250
ch->r_io[i].res = ctlr->r_res2;
sys/dev/ata/chipsets/ata-siliconimage.c
251
ch->r_io[i].offset = 0x80 + i + (unit01 << 6) + (unit10 << 8);
sys/dev/ata/chipsets/ata-siliconimage.c
253
ch->r_io[ATA_CONTROL].res = ctlr->r_res2;
sys/dev/ata/chipsets/ata-siliconimage.c
254
ch->r_io[ATA_CONTROL].offset = 0x8a + (unit01 << 6) + (unit10 << 8);
sys/dev/ata/chipsets/ata-siliconimage.c
255
ch->r_io[ATA_IDX_ADDR].res = ctlr->r_res2;
sys/dev/ata/chipsets/ata-siliconimage.c
258
ch->r_io[ATA_BMCMD_PORT].res = ctlr->r_res2;
sys/dev/ata/chipsets/ata-siliconimage.c
259
ch->r_io[ATA_BMCMD_PORT].offset = 0x00 + (unit01 << 3) + (unit10 << 8);
sys/dev/ata/chipsets/ata-siliconimage.c
260
ch->r_io[ATA_BMSTAT_PORT].res = ctlr->r_res2;
sys/dev/ata/chipsets/ata-siliconimage.c
261
ch->r_io[ATA_BMSTAT_PORT].offset = 0x02 + (unit01 << 3) + (unit10 << 8);
sys/dev/ata/chipsets/ata-siliconimage.c
262
ch->r_io[ATA_BMDTP_PORT].res = ctlr->r_res2;
sys/dev/ata/chipsets/ata-siliconimage.c
263
ch->r_io[ATA_BMDTP_PORT].offset = 0x04 + (unit01 << 3) + (unit10 << 8);
sys/dev/ata/chipsets/ata-siliconimage.c
266
ch->r_io[ATA_SSTATUS].res = ctlr->r_res2;
sys/dev/ata/chipsets/ata-siliconimage.c
267
ch->r_io[ATA_SSTATUS].offset = 0x104 + (unit01 << 7) + (unit10 << 8);
sys/dev/ata/chipsets/ata-siliconimage.c
268
ch->r_io[ATA_SERROR].res = ctlr->r_res2;
sys/dev/ata/chipsets/ata-siliconimage.c
269
ch->r_io[ATA_SERROR].offset = 0x108 + (unit01 << 7) + (unit10 << 8);
sys/dev/ata/chipsets/ata-siliconimage.c
270
ch->r_io[ATA_SCONTROL].res = ctlr->r_res2;
sys/dev/ata/chipsets/ata-siliconimage.c
271
ch->r_io[ATA_SCONTROL].offset = 0x100 + (unit01 << 7) + (unit10 << 8);
sys/dev/ata/chipsets/ata-siliconimage.c
272
ch->flags |= ATA_NO_SLAVE;
sys/dev/ata/chipsets/ata-siliconimage.c
273
ch->flags |= ATA_SATA;
sys/dev/ata/chipsets/ata-siliconimage.c
274
ch->flags |= ATA_KNOWN_PRESENCE;
sys/dev/ata/chipsets/ata-siliconimage.c
282
ch->dma.boundary = 8192;
sys/dev/ata/chipsets/ata-siliconimage.c
283
ch->dma.segsize = 15 * DEV_BSIZE;
sys/dev/ata/chipsets/ata-siliconimage.c
287
ch->hw.status = ata_sii_status;
sys/dev/ata/chipsets/ata-siliconimage.c
289
ch->flags |= ATA_CHECKS_CABLE;
sys/dev/ata/chipsets/ata-siliconimage.c
308
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/chipsets/ata-siliconimage.c
309
int offset0 = ((ch->unit & 1) << 3) + ((ch->unit & 2) << 8);
sys/dev/ata/chipsets/ata-siliconimage.c
310
int offset1 = ((ch->unit & 1) << 6) + ((ch->unit & 2) << 8);
sys/dev/ata/chipsets/ata-siliconimage.c
327
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/chipsets/ata-siliconimage.c
328
int offset = ((ch->unit & 1) << 7) + ((ch->unit & 2) << 8);
sys/dev/ata/chipsets/ata-siliconimage.c
339
ch->devices = 0;
sys/dev/ata/chipsets/ata-siliconimage.c
347
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/chipsets/ata-siliconimage.c
348
int rego = (ch->unit << 4) + (target << 1);
sys/dev/ata/chipsets/ata-siliconimage.c
349
int mreg = ch->unit ? 0x84 : 0x80;
sys/dev/ata/chipsets/ata-siliconimage.c
367
(ch->unit ? 0x02 : 0x01))) {
sys/dev/ata/chipsets/ata-sis.c
204
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/chipsets/ata-sis.c
205
int offset = ch->unit << ((ctlr->chip->chipid == ATA_SIS182) ? 5 : 6);
sys/dev/ata/chipsets/ata-sis.c
211
ch->r_io[ATA_SSTATUS].res = ctlr->r_res2;
sys/dev/ata/chipsets/ata-sis.c
212
ch->r_io[ATA_SSTATUS].offset = 0x00 + offset;
sys/dev/ata/chipsets/ata-sis.c
213
ch->r_io[ATA_SERROR].res = ctlr->r_res2;
sys/dev/ata/chipsets/ata-sis.c
214
ch->r_io[ATA_SERROR].offset = 0x04 + offset;
sys/dev/ata/chipsets/ata-sis.c
215
ch->r_io[ATA_SCONTROL].res = ctlr->r_res2;
sys/dev/ata/chipsets/ata-sis.c
216
ch->r_io[ATA_SCONTROL].offset = 0x08 + offset;
sys/dev/ata/chipsets/ata-sis.c
217
ch->flags |= ATA_NO_SLAVE;
sys/dev/ata/chipsets/ata-sis.c
218
ch->flags |= ATA_SATA;
sys/dev/ata/chipsets/ata-sis.c
228
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/chipsets/ata-sis.c
233
ch->devices = 0;
sys/dev/ata/chipsets/ata-sis.c
241
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/chipsets/ata-sis.c
242
int devno = (ch->unit << 1) + target;
sys/dev/ata/chipsets/ata-sis.c
248
pci_read_config(parent, ch->unit ? 0x52 : 0x50,2) & 0x8000) {
sys/dev/ata/chipsets/ata-sis.c
254
pci_read_config(parent, 0x48, 1)&(ch->unit ? 0x20 : 0x10)) {
sys/dev/ata/chipsets/ata-via.c
210
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/chipsets/ata-via.c
219
rid = PCIR_BAR(ch->unit);
sys/dev/ata/chipsets/ata-via.c
226
ch->r_io[i].res = r_io;
sys/dev/ata/chipsets/ata-via.c
227
ch->r_io[i].offset = i;
sys/dev/ata/chipsets/ata-via.c
229
ch->r_io[ATA_CONTROL].res = r_io;
sys/dev/ata/chipsets/ata-via.c
230
ch->r_io[ATA_CONTROL].offset = 2 + ATA_IOSIZE;
sys/dev/ata/chipsets/ata-via.c
231
ch->r_io[ATA_IDX_ADDR].res = r_io;
sys/dev/ata/chipsets/ata-via.c
234
ch->r_io[i].res = ctlr->r_res1;
sys/dev/ata/chipsets/ata-via.c
235
ch->r_io[i].offset = (i - ATA_BMCMD_PORT)+(ch->unit * ATA_BMIOSIZE);
sys/dev/ata/chipsets/ata-via.c
238
if (ch->unit >= 2)
sys/dev/ata/chipsets/ata-via.c
247
ch->r_io[ATA_SSTATUS].res = ctlr->r_res2;
sys/dev/ata/chipsets/ata-via.c
248
ch->r_io[ATA_SSTATUS].offset = (ch->unit << ctlr->chip->cfg1);
sys/dev/ata/chipsets/ata-via.c
249
ch->r_io[ATA_SERROR].res = ctlr->r_res2;
sys/dev/ata/chipsets/ata-via.c
250
ch->r_io[ATA_SERROR].offset = 0x04 + (ch->unit << ctlr->chip->cfg1);
sys/dev/ata/chipsets/ata-via.c
251
ch->r_io[ATA_SCONTROL].res = ctlr->r_res2;
sys/dev/ata/chipsets/ata-via.c
252
ch->r_io[ATA_SCONTROL].offset = 0x08 + (ch->unit << ctlr->chip->cfg1);
sys/dev/ata/chipsets/ata-via.c
253
ch->hw.status = ata_via_status;
sys/dev/ata/chipsets/ata-via.c
254
ch->flags |= ATA_NO_SLAVE;
sys/dev/ata/chipsets/ata-via.c
255
ch->flags |= ATA_SATA;
sys/dev/ata/chipsets/ata-via.c
256
ch->flags |= ATA_PERIODIC_POLL;
sys/dev/ata/chipsets/ata-via.c
258
ata_sata_scr_write(ch, -1, ATA_SERROR, 0xffffffff);
sys/dev/ata/chipsets/ata-via.c
267
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/chipsets/ata-via.c
273
rid = PCIR_BAR(ch->unit);
sys/dev/ata/chipsets/ata-via.c
275
SYS_RES_IOPORT, rid, ch->r_io[ATA_CONTROL].res);
sys/dev/ata/chipsets/ata-via.c
292
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/chipsets/ata-via.c
294
if ((ctlr->chip->cfg2 & VIABAR) && (ch->unit > 1))
sys/dev/ata/chipsets/ata-via.c
300
ch->devices = 0;
sys/dev/ata/chipsets/ata-via.c
317
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/chipsets/ata-via.c
319
if ((ctlr->chip->cfg2 & VIABAR) && (ch->unit > 1)) {
sys/dev/ata/chipsets/ata-via.c
346
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/chipsets/ata-via.c
347
int devno = (ch->unit << 1) + target;
sys/dev/ata/chipsets/ata-via.c
404
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/chipsets/ata-via.c
408
if (ch->unit == 0) {
sys/dev/ata/chipsets/ata-via.c
409
ch->hw.status = ata_via_sata_status;
sys/dev/ata/chipsets/ata-via.c
410
ch->hw.pm_read = ata_via_sata_scr_read;
sys/dev/ata/chipsets/ata-via.c
411
ch->hw.pm_write = ata_via_sata_scr_write;
sys/dev/ata/chipsets/ata-via.c
412
ch->flags |= ATA_PERIODIC_POLL;
sys/dev/ata/chipsets/ata-via.c
413
ch->flags |= ATA_SATA;
sys/dev/ata/chipsets/ata-via.c
414
ata_sata_scr_write(ch, 0, ATA_SERROR, 0xffffffff);
sys/dev/ata/chipsets/ata-via.c
415
ata_sata_scr_write(ch, 1, ATA_SERROR, 0xffffffff);
sys/dev/ata/chipsets/ata-via.c
424
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/chipsets/ata-via.c
426
if (ch->unit == 0) {
sys/dev/ata/chipsets/ata-via.c
438
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/chipsets/ata-via.c
440
if (ch->unit == 0)
sys/dev/ata/chipsets/ata-via.c
448
struct ata_channel *ch = device_get_softc(dev);
sys/dev/ata/chipsets/ata-via.c
452
if (ch->unit == 0) {
sys/dev/ata/chipsets/ata-via.c
456
ATA_IDX_OUTB(ch, ATA_DRIVE, ATA_D_IBM | ATA_D_LBA |
sys/dev/ata/chipsets/ata-via.c
459
status = ATA_IDX_INB(ch, ATA_STATUS);
sys/dev/ata/chipsets/ata-via.c
466
ATA_IDX_OUTB(ch, ATA_DRIVE, ATA_D_IBM | ATA_D_LBA |
sys/dev/ata/chipsets/ata-via.c
469
status = ATA_IDX_INB(ch, ATA_STATUS);
sys/dev/ata/chipsets/ata-via.c
477
ch->devices = 0;
sys/dev/ath/ath_hal/ar9002/ar9280.c
175
uint32_t f, ch, ch2;
sys/dev/ath/ath_hal/ar9002/ar9280.c
182
ch = (((f - 4800) * 10) / 25) + 1;
sys/dev/ath/ath_hal/ar9002/ar9280.c
184
ch2 = ((ch * 25) / 5) + 9600;
sys/dev/ath/if_ath_btcoex.h
42
const struct ieee80211_channel *ch);
sys/dev/ath/if_ath_lna_div.h
84
const struct ieee80211_channel *ch);
sys/dev/ath/if_ath_spectral.c
143
ath_spectral_enable(struct ath_softc *sc, struct ieee80211_channel *ch)
sys/dev/ath/if_ath_spectral.h
38
struct ieee80211_channel *ch);
sys/dev/atkbdc/psm.c
5364
int ch;
sys/dev/atkbdc/psm.c
5370
ch = (status[0] & 0x07) - 1; /* channel # */
sys/dev/atkbdc/psm.c
5371
if ((ch <= 0) || (ch > 4))
sys/dev/axgbe/if_axgbe_pci.c
929
xgbe_dump_dma_registers(struct xgbe_prv_data *pdata, int ch)
sys/dev/axgbe/if_axgbe_pci.c
965
if (ch >= 0) {
sys/dev/axgbe/if_axgbe_pci.c
966
if (i != ch)
sys/dev/bhnd/nvram/bhnd_nvram_data_bcm.c
721
char ch;
sys/dev/bhnd/nvram/bhnd_nvram_data_bcm.c
731
ch = '\0';
sys/dev/bhnd/nvram/bhnd_nvram_data_bcm.c
732
error = bhnd_nvram_io_write(bcm->data, io_size-1, &ch,
sys/dev/bhnd/nvram/bhnd_nvram_data_bcm.c
733
sizeof(ch));
sys/dev/bhnd/nvram/bhnd_nvram_data_spromvar.h
166
char ch[BHND_SPROM_ARRAY_MAXLEN];
sys/dev/bhnd/nvram/bhnd_nvram_value.c
1804
NV_STORE_INLINE(uint8_t, ch);
sys/dev/bhnd/nvram/bhnd_nvram_value.c
1832
NV_COPY_ARRRAY_INLINE(uint8_t, ch);
sys/dev/bhnd/nvram/bhnd_nvram_value.c
1862
if (ilen > sizeof(value->data.ch))
sys/dev/bhnd/nvram/bhnd_nvram_value.c
1866
memcpy(&value->data.ch, inp, ilen);
sys/dev/bhnd/nvram/bhnd_nvram_value.h
234
unsigned char ch[8]; /**< 8-bit character data */
sys/dev/cfe/cfe_console.c
200
unsigned char ch;
sys/dev/cfe/cfe_console.c
202
if (cfe_read(conhandle, &ch, 1) == 1) {
sys/dev/cfe/cfe_console.c
204
kdb_alt_break(ch, &alt_break_state);
sys/dev/cfe/cfe_console.c
206
return (ch);
sys/dev/cxgbe/common/t4_hw.c
13275
cmd.u.params.ch = channel;
sys/dev/cxgbe/common/t4_hw.c
13303
cmd.u.params.ch = channel;
sys/dev/cxgbe/common/t4_hw.c
13328
cmd.u.params.ch = channel;
sys/dev/cxgbe/common/t4_hw.c
13351
cmd.u.params.ch = channel;
sys/dev/cxgbe/common/t4_hw.c
6564
int ch;
sys/dev/cxgbe/common/t4_hw.c
6567
for (ch = 0; ch < NUM_TLS_TX_CH_INSTANCES; ch++) {
sys/dev/cxgbe/common/t4_hw.c
6568
snprintf(name, sizeof(name), "TLSTX%u_CH%u_INT_CAUSE", idx, ch);
sys/dev/cxgbe/common/t4_hw.c
6570
ii.cause_reg = t7_tlstx_reg(idx, ch, A_TLS_TX_CH_INT_CAUSE);
sys/dev/cxgbe/common/t4_hw.c
6571
ii.enable_reg = t7_tlstx_reg(idx, ch, A_TLS_TX_CH_INT_ENABLE);
sys/dev/cxgbe/firmware/t4fw_interface.h
9947
__u8 ch;
sys/dev/cxgbe/nvmf/nvmf_che.c
1019
error = nvmf_tcp_validate_pdu_header(ch, qp->qp.nq_controller,
sys/dev/cxgbe/nvmf/nvmf_che.c
1030
if ((ch->flags & NVME_TCP_CH_FLAGS_DDGSTF) != 0) {
sys/dev/cxgbe/nvmf/nvmf_che.c
1150
struct nvme_tcp_common_pdu_hdr *ch;
sys/dev/cxgbe/nvmf/nvmf_che.c
1172
ch = mtod(top, void *);
sys/dev/cxgbe/nvmf/nvmf_che.c
1173
memcpy(ch, hdr, hlen);
sys/dev/cxgbe/nvmf/nvmf_che.c
1174
ch->hlen = hlen;
sys/dev/cxgbe/nvmf/nvmf_che.c
1177
ch->flags |= NVME_TCP_CH_FLAGS_HDGSTF;
sys/dev/cxgbe/nvmf/nvmf_che.c
1181
ch->flags |= NVME_TCP_CH_FLAGS_DDGSTF;
sys/dev/cxgbe/nvmf/nvmf_che.c
1184
ch->pdo = pdo;
sys/dev/cxgbe/nvmf/nvmf_che.c
1185
ch->plen = htole32(plen);
sys/dev/cxgbe/nvmf/nvmf_che.c
914
const struct nvme_tcp_common_pdu_hdr *ch;
sys/dev/cxgbe/nvmf/nvmf_che.c
922
ch = pdu->hdr;
sys/dev/cxgbe/nvmf/nvmf_che.c
923
hlen = ch->hlen;
sys/dev/cxgbe/nvmf/nvmf_che.c
924
plen = le32toh(ch->plen);
sys/dev/cxgbe/nvmf/nvmf_che.c
925
if (hlen < sizeof(*ch) || hlen > plen)
sys/dev/cxgbe/nvmf/nvmf_che.c
926
hlen = sizeof(*ch);
sys/dev/cxgbe/nvmf/nvmf_che.c
936
rx_digest = le32dec(mtodo(m, ch->hlen));
sys/dev/cxgbe/nvmf/nvmf_che.c
943
printf("NVMe/TCP: Invalid PDU type %u\n", ch->pdu_type);
sys/dev/cxgbe/nvmf/nvmf_che.c
952
printf("NVMe/TCP: Invalid PDU header flags %#x\n", ch->flags);
sys/dev/cxgbe/nvmf/nvmf_che.c
979
switch (ch->pdu_type) {
sys/dev/cxgbe/nvmf/nvmf_che.c
995
cpl_error, ch->pdu_type);
sys/dev/dcons/dcons.c
102
c = ch->buf[ch->pos];
sys/dev/dcons/dcons.c
103
ch->pos ++;
sys/dev/dcons/dcons.c
104
if (ch->pos >= ch->size) {
sys/dev/dcons/dcons.c
105
ch->gen = next_gen;
sys/dev/dcons/dcons.c
106
ch->pos = 0;
sys/dev/dcons/dcons.c
115
struct dcons_ch *ch;
sys/dev/dcons/dcons.c
117
ch = &dc->o;
sys/dev/dcons/dcons.c
119
ch->buf[ch->pos] = c;
sys/dev/dcons/dcons.c
120
ch->pos ++;
sys/dev/dcons/dcons.c
121
if (ch->pos >= ch->size) {
sys/dev/dcons/dcons.c
122
ch->gen = DCONS_NEXT_GEN(ch->gen);
sys/dev/dcons/dcons.c
123
ch->pos = 0;
sys/dev/dcons/dcons.c
125
*ch->ptr = DCONS_MAKE_PTR(ch);
sys/dev/dcons/dcons.c
52
struct dcons_ch *ch;
sys/dev/dcons/dcons.c
54
ch = &dc->i;
sys/dev/dcons/dcons.c
56
ptr = ntohl(*ch->ptr);
sys/dev/dcons/dcons.c
59
if (gen == ch->gen && pos == ch->pos)
sys/dev/dcons/dcons.c
62
next_gen = DCONS_NEXT_GEN(ch->gen);
sys/dev/dcons/dcons.c
64
if ((gen != ch->gen && gen != next_gen)
sys/dev/dcons/dcons.c
65
|| (gen == ch->gen && pos < ch->pos)) {
sys/dev/dcons/dcons.c
68
ch->gen = gen;
sys/dev/dcons/dcons.c
69
ch->pos = pos;
sys/dev/dcons/dcons.c
81
struct dcons_ch *ch;
sys/dev/dcons/dcons.c
83
ch = &dc->i;
sys/dev/dcons/dcons.c
85
ptr = ntohl(*ch->ptr);
sys/dev/dcons/dcons.c
88
if (gen == ch->gen && pos == ch->pos)
sys/dev/dcons/dcons.c
91
next_gen = DCONS_NEXT_GEN(ch->gen);
sys/dev/dcons/dcons.c
93
if ((gen != ch->gen && gen != next_gen)
sys/dev/dcons/dcons.c
94
|| (gen == ch->gen && pos < ch->pos)) {
sys/dev/dcons/dcons.c
97
ch->gen = gen;
sys/dev/dcons/dcons.c
98
ch->pos = pos;
sys/dev/dcons/dcons_os.c
217
char ch;
sys/dev/dcons/dcons_os.c
221
while (ttydisc_getc(tp, &ch, sizeof ch) != 0)
sys/dev/dcons/dcons_os.c
222
dcons_os_putc(dc, ch);
sys/dev/dpaa2/dpaa2_buf.c
113
error = DPAA2_SWP_RELEASE_BUFS(ch->io_dev, bpid, paddr, bufn);
sys/dev/dpaa2/dpaa2_buf.c
59
struct dpaa2_channel *ch = (struct dpaa2_channel *)arg;
sys/dev/dpaa2/dpaa2_buf.c
67
KASSERT(ch->rx_dmat != NULL, ("%s: no DMA tag?", __func__));
sys/dev/dpaa2/dpaa2_buf.c
83
error = DPAA2_SWP_RELEASE_BUFS(ch->io_dev, bpid, paddr,
sys/dev/dpaa2/dpaa2_buf.c
99
DPAA2_BUF_INIT_TAGOPT(buf, ch->rx_dmat, ch);
sys/dev/dpaa2/dpaa2_channel.c
121
struct dpaa2_channel *ch = NULL;
sys/dev/dpaa2/dpaa2_channel.c
148
ch = malloc(sizeof(struct dpaa2_channel), M_DPAA2_CH, M_WAITOK | M_ZERO);
sys/dev/dpaa2/dpaa2_channel.c
149
ch->ni_dev = dev;
sys/dev/dpaa2/dpaa2_channel.c
150
ch->io_dev = iodev;
sys/dev/dpaa2/dpaa2_channel.c
151
ch->con_dev = condev;
sys/dev/dpaa2/dpaa2_channel.c
152
ch->id = consc->attr.chan_id;
sys/dev/dpaa2/dpaa2_channel.c
153
ch->flowid = flowid;
sys/dev/dpaa2/dpaa2_channel.c
154
ch->tx_frames = 0; /* for debug purposes */
sys/dev/dpaa2/dpaa2_channel.c
155
ch->tx_dropped = 0; /* for debug purposes */
sys/dev/dpaa2/dpaa2_channel.c
156
ch->store_sz = 0;
sys/dev/dpaa2/dpaa2_channel.c
157
ch->store_idx = 0;
sys/dev/dpaa2/dpaa2_channel.c
158
ch->recycled_n = 0;
sys/dev/dpaa2/dpaa2_channel.c
159
ch->rxq_n = 0;
sys/dev/dpaa2/dpaa2_channel.c
161
NET_TASK_INIT(&ch->cleanup_task, 0, cleanup_task_fn, ch);
sys/dev/dpaa2/dpaa2_channel.c
162
NET_TASK_INIT(&ch->bp_task, 0, dpaa2_chan_bp_task, ch);
sys/dev/dpaa2/dpaa2_channel.c
164
ch->cleanup_tq = taskqueue_create("dpaa2_ch cleanup", M_WAITOK,
sys/dev/dpaa2/dpaa2_channel.c
165
taskqueue_thread_enqueue, &ch->cleanup_tq);
sys/dev/dpaa2/dpaa2_channel.c
166
taskqueue_start_threads_cpuset(&ch->cleanup_tq, 1, PI_NET,
sys/dev/dpaa2/dpaa2_channel.c
167
&iosc->cpu_mask, "dpaa2_ch%d cleanup", ch->id);
sys/dev/dpaa2/dpaa2_channel.c
169
error = dpaa2_chan_setup_dma(dev, ch, sc->buf_align);
sys/dev/dpaa2/dpaa2_channel.c
175
mtx_init(&ch->xmit_mtx, "dpaa2_ch_xmit", NULL, MTX_DEF);
sys/dev/dpaa2/dpaa2_channel.c
177
ch->xmit_br = buf_ring_alloc(DPAA2_TX_BUFRING_SZ, M_DEVBUF, M_NOWAIT,
sys/dev/dpaa2/dpaa2_channel.c
178
&ch->xmit_mtx);
sys/dev/dpaa2/dpaa2_channel.c
179
if (ch->xmit_br == NULL) {
sys/dev/dpaa2/dpaa2_channel.c
185
DPAA2_BUF_INIT(&ch->store);
sys/dev/dpaa2/dpaa2_channel.c
188
ctx = &ch->ctx;
sys/dev/dpaa2/dpaa2_channel.c
191
ctx->fq_chan_id = ch->id;
sys/dev/dpaa2/dpaa2_channel.c
192
ctx->io_dev = ch->io_dev;
sys/dev/dpaa2/dpaa2_channel.c
193
ctx->channel = ch;
sys/dev/dpaa2/dpaa2_channel.c
194
error = DPAA2_SWP_CONF_WQ_CHANNEL(ch->io_dev, ctx);
sys/dev/dpaa2/dpaa2_channel.c
214
error = dpaa2_buf_seed_pool(dev, bpdev, ch, DPAA2_NI_BUFS_INIT,
sys/dev/dpaa2/dpaa2_channel.c
221
error = dpaa2_chan_alloc_storage(dev, ch, DPAA2_ETH_STORE_SIZE,
sys/dev/dpaa2/dpaa2_channel.c
228
ch->store_sz = DPAA2_ETH_STORE_FRAMES;
sys/dev/dpaa2/dpaa2_channel.c
232
error = dpaa2_chan_setup_fq(dev, ch, DPAA2_NI_QUEUE_TX_CONF);
sys/dev/dpaa2/dpaa2_channel.c
238
error = dpaa2_chan_setup_fq(dev, ch, DPAA2_NI_QUEUE_RX);
sys/dev/dpaa2/dpaa2_channel.c
247
"priorities=%d\n", ioinfo->id, coninfo->id, ch->id,
sys/dev/dpaa2/dpaa2_channel.c
251
*channel = ch;
sys/dev/dpaa2/dpaa2_channel.c
259
if (ch->store.vaddr != NULL) {
sys/dev/dpaa2/dpaa2_channel.c
260
bus_dmamem_free(ch->store.dmat, ch->store.vaddr, ch->store.dmap);
sys/dev/dpaa2/dpaa2_channel.c
262
if (ch->store.dmat != NULL) {
sys/dev/dpaa2/dpaa2_channel.c
263
bus_dma_tag_destroy(ch->store.dmat);
sys/dev/dpaa2/dpaa2_channel.c
265
ch->store.dmat = NULL;
sys/dev/dpaa2/dpaa2_channel.c
266
ch->store.vaddr = NULL;
sys/dev/dpaa2/dpaa2_channel.c
267
ch->store.paddr = 0;
sys/dev/dpaa2/dpaa2_channel.c
268
ch->store.nseg = 0;
sys/dev/dpaa2/dpaa2_channel.c
270
buf_ring_free(ch->xmit_br, M_DEVBUF);
sys/dev/dpaa2/dpaa2_channel.c
272
mtx_destroy(&ch->xmit_mtx);
sys/dev/dpaa2/dpaa2_channel.c
291
dpaa2_chan_setup_fq(device_t dev, struct dpaa2_channel *ch,
sys/dev/dpaa2/dpaa2_channel.c
300
fq = &ch->txc_queue;
sys/dev/dpaa2/dpaa2_channel.c
301
fq->chan = ch;
sys/dev/dpaa2/dpaa2_channel.c
302
fq->flowid = ch->flowid;
sys/dev/dpaa2/dpaa2_channel.c
313
fq = &ch->rx_queues[i];
sys/dev/dpaa2/dpaa2_channel.c
314
fq->chan = ch;
sys/dev/dpaa2/dpaa2_channel.c
315
fq->flowid = ch->flowid;
sys/dev/dpaa2/dpaa2_channel.c
319
ch->rxq_n++;
sys/dev/dpaa2/dpaa2_channel.c
325
fq->chan = ch;
sys/dev/dpaa2/dpaa2_channel.c
343
dpaa2_chan_next_frame(struct dpaa2_channel *ch, struct dpaa2_dq **dq)
sys/dev/dpaa2/dpaa2_channel.c
345
struct dpaa2_buf *buf = &ch->store;
sys/dev/dpaa2/dpaa2_channel.c
347
struct dpaa2_dq *msg = &msgs[ch->store_idx];
sys/dev/dpaa2/dpaa2_channel.c
350
ch->store_idx++;
sys/dev/dpaa2/dpaa2_channel.c
354
ch->store_idx = 0;
sys/dev/dpaa2/dpaa2_channel.c
361
ch->store_idx = 0;
sys/dev/dpaa2/dpaa2_channel.c
372
dpaa2_chan_setup_dma(device_t dev, struct dpaa2_channel *ch,
sys/dev/dpaa2/dpaa2_channel.c
377
mtx_init(&ch->dma_mtx, "dpaa2_ch_dma_mtx", NULL, MTX_DEF);
sys/dev/dpaa2/dpaa2_channel.c
391
&ch->rx_dmat);
sys/dev/dpaa2/dpaa2_channel.c
409
&ch->tx_dmat);
sys/dev/dpaa2/dpaa2_channel.c
427
&ch->sgt_dmat);
sys/dev/dpaa2/dpaa2_channel.c
436
bus_dma_tag_destroy(ch->tx_dmat);
sys/dev/dpaa2/dpaa2_channel.c
438
bus_dma_tag_destroy(ch->rx_dmat);
sys/dev/dpaa2/dpaa2_channel.c
440
mtx_destroy(&ch->dma_mtx);
sys/dev/dpaa2/dpaa2_channel.c
441
ch->rx_dmat = NULL;
sys/dev/dpaa2/dpaa2_channel.c
442
ch->tx_dmat = NULL;
sys/dev/dpaa2/dpaa2_channel.c
443
ch->sgt_dmat = NULL;
sys/dev/dpaa2/dpaa2_channel.c
452
dpaa2_chan_alloc_storage(device_t dev, struct dpaa2_channel *ch, bus_size_t size,
sys/dev/dpaa2/dpaa2_channel.c
455
struct dpaa2_buf *buf = &ch->store;
sys/dev/dpaa2/dpaa2_channel.c
520
struct dpaa2_channel *ch = (struct dpaa2_channel *)arg;
sys/dev/dpaa2/dpaa2_channel.c
521
struct dpaa2_ni_softc *sc = device_get_softc(ch->ni_dev);
sys/dev/dpaa2/dpaa2_channel.c
533
error = DPAA2_SWP_QUERY_BP(ch->io_dev, bpsc->attr.bpid, &bpconf);
sys/dev/dpaa2/dpaa2_channel.c
542
mtx_assert(&ch->dma_mtx, MA_NOTOWNED);
sys/dev/dpaa2/dpaa2_channel.c
543
mtx_lock(&ch->dma_mtx);
sys/dev/dpaa2/dpaa2_channel.c
544
(void)dpaa2_buf_seed_pool(ch->ni_dev, bpdev, ch, buf_num,
sys/dev/dpaa2/dpaa2_channel.c
545
DPAA2_RX_BUF_SIZE, &ch->dma_mtx);
sys/dev/dpaa2/dpaa2_channel.c
546
mtx_unlock(&ch->dma_mtx);
sys/dev/dpaa2/dpaa2_ni.c
1250
struct dpaa2_channel *ch = fq->chan;
sys/dev/dpaa2/dpaa2_ni.c
1329
DPAA2_BUF_INIT_TAGOPT(buf, ch->tx_dmat, tx);
sys/dev/dpaa2/dpaa2_ni.c
1334
DPAA2_BUF_INIT_TAGOPT(buf->sgt, ch->sgt_dmat, buf);
sys/dev/dpaa2/dpaa2_ni.c
2485
struct dpaa2_channel *ch;
sys/dev/dpaa2/dpaa2_ni.c
2497
ch = sc->channels[i];
sys/dev/dpaa2/dpaa2_ni.c
2498
for (int j = 0; j < ch->rxq_n; j++) {
sys/dev/dpaa2/dpaa2_ni.c
2499
if (fqid == ch->rx_queues[j].fqid) {
sys/dev/dpaa2/dpaa2_ni.c
2500
chidx = ch->flowid;
sys/dev/dpaa2/dpaa2_ni.c
2511
ch = sc->channels[chidx];
sys/dev/dpaa2/dpaa2_ni.c
2512
error = buf_ring_enqueue(ch->xmit_br, m);
sys/dev/dpaa2/dpaa2_ni.c
2517
taskqueue_enqueue(ch->cleanup_tq, &ch->cleanup_task);
sys/dev/dpaa2/dpaa2_ni.c
2830
struct dpaa2_channel *ch = (struct dpaa2_channel *)arg;
sys/dev/dpaa2/dpaa2_ni.c
2831
struct dpaa2_ni_softc *sc = device_get_softc(ch->ni_dev);
sys/dev/dpaa2/dpaa2_ni.c
2835
rxc = dpaa2_ni_rx_cleanup(ch);
sys/dev/dpaa2/dpaa2_ni.c
2836
txc = dpaa2_ni_tx_cleanup(ch);
sys/dev/dpaa2/dpaa2_ni.c
2849
error = DPAA2_SWP_CONF_WQ_CHANNEL(ch->io_dev, &ch->ctx);
sys/dev/dpaa2/dpaa2_ni.c
2852
__func__, ch->id, error);
sys/dev/dpaa2/dpaa2_ni.c
2860
dpaa2_ni_rx_cleanup(struct dpaa2_channel *ch)
sys/dev/dpaa2/dpaa2_ni.c
2862
struct dpaa2_io_softc *iosc = device_get_softc(ch->io_dev);
sys/dev/dpaa2/dpaa2_ni.c
2865
struct dpaa2_buf *buf = &ch->store;
sys/dev/dpaa2/dpaa2_ni.c
2870
error = dpaa2_swp_pull(swp, ch->id, buf, DPAA2_ETH_STORE_FRAMES);
sys/dev/dpaa2/dpaa2_ni.c
2872
device_printf(ch->ni_dev, "%s: failed to pull frames: "
sys/dev/dpaa2/dpaa2_ni.c
2873
"chan_id=%d, error=%d\n", __func__, ch->id, error);
sys/dev/dpaa2/dpaa2_ni.c
2876
error = dpaa2_ni_consume_frames(ch, &fq, &consumed);
sys/dev/dpaa2/dpaa2_ni.c
2881
device_printf(ch->ni_dev, "%s: timeout to consume "
sys/dev/dpaa2/dpaa2_ni.c
2882
"frames: chan_id=%d\n", __func__, ch->id);
sys/dev/dpaa2/dpaa2_ni.c
2890
dpaa2_ni_tx_cleanup(struct dpaa2_channel *ch)
sys/dev/dpaa2/dpaa2_ni.c
2892
struct dpaa2_ni_softc *sc = device_get_softc(ch->ni_dev);
sys/dev/dpaa2/dpaa2_ni.c
2893
struct dpaa2_ni_tx_ring *tx = &ch->txc_queue.tx_rings[0];
sys/dev/dpaa2/dpaa2_ni.c
2898
mtx_assert(&ch->xmit_mtx, MA_NOTOWNED);
sys/dev/dpaa2/dpaa2_ni.c
2899
mtx_lock(&ch->xmit_mtx);
sys/dev/dpaa2/dpaa2_ni.c
2900
m = buf_ring_dequeue_sc(ch->xmit_br);
sys/dev/dpaa2/dpaa2_ni.c
2901
mtx_unlock(&ch->xmit_mtx);
sys/dev/dpaa2/dpaa2_ni.c
2907
dpaa2_ni_tx(sc, ch, tx, m);
sys/dev/dpaa2/dpaa2_ni.c
2915
dpaa2_ni_tx(struct dpaa2_ni_softc *sc, struct dpaa2_channel *ch,
sys/dev/dpaa2/dpaa2_ni.c
2948
KASSERT(btx->fq->chan == ch, ("%s: unexpected channel", __func__));
sys/dev/dpaa2/dpaa2_ni.c
3113
dpaa2_ni_rx(struct dpaa2_channel *ch, struct dpaa2_ni_fq *fq,
sys/dev/dpaa2/dpaa2_ni.c
3217
ch->recycled[ch->recycled_n++] = buf;
sys/dev/dpaa2/dpaa2_ni.c
3220
if (ch->recycled_n == DPAA2_SWP_BUFS_PER_CMD) {
sys/dev/dpaa2/dpaa2_ni.c
3222
taskqueue_enqueue(sc->bp_taskq, &ch->bp_task);
sys/dev/dpaa2/dpaa2_ni.c
3224
for (int i = 0; i < ch->recycled_n; i++) {
sys/dev/dpaa2/dpaa2_ni.c
3225
buf = ch->recycled[i];
sys/dev/dpaa2/dpaa2_ni.c
3248
error = DPAA2_SWP_RELEASE_BUFS(ch->io_dev, bpsc->attr.bpid,
sys/dev/dpaa2/dpaa2_ni.c
3255
ch->recycled_n = 0;
sys/dev/dpaa2/dpaa2_ni.c
3265
dpaa2_ni_rx_err(struct dpaa2_channel *ch, struct dpaa2_ni_fq *fq,
sys/dev/dpaa2/dpaa2_ni.c
3304
error = DPAA2_SWP_RELEASE_BUFS(ch->io_dev, bpsc->attr.bpid, &paddr, 1);
sys/dev/dpaa2/dpaa2_ni.c
3318
dpaa2_ni_tx_conf(struct dpaa2_channel *ch, struct dpaa2_ni_fq *fq,
sys/dev/drm2/drm_dp_helper.h
321
int (*ch)(device_t idev, int mode, uint8_t write_byte, uint8_t *read_byte),
sys/dev/drm2/drm_dp_iic_helper.c
220
int (*ch)(device_t idev, int mode, uint8_t write_byte, uint8_t *read_byte),
sys/dev/drm2/drm_dp_iic_helper.c
249
data->aux_ch = ch;
sys/dev/drm2/drm_modes.c
1097
char *ch;
sys/dev/drm2/drm_modes.c
1098
xres = simple_strtol(name, &ch, 10);
sys/dev/drm2/drm_modes.c
1099
if ((ch != NULL) && (*ch == 'x'))
sys/dev/drm2/drm_modes.c
1102
i = ch - name;
sys/dev/fb/s3_pci.c
308
u_char *data, int ch, int count)
sys/dev/fb/s3_pci.c
311
ch, count);
sys/dev/fb/s3_pci.c
316
u_char *data, int ch, int count)
sys/dev/fb/s3_pci.c
319
ch, count);
sys/dev/fb/splash_txt.c
68
u_char ch, attr;
sys/dev/fb/splash_txt.c
76
ch = *pdata++;
sys/dev/fb/splash_txt.c
80
sc->scr_map[ch], (int)attr << 8);
sys/dev/fb/vesa.c
1416
u_char *data, int ch, int count)
sys/dev/fb/vesa.c
1420
ch, count));
sys/dev/fb/vesa.c
1425
u_char *data, int ch, int count)
sys/dev/fb/vesa.c
1429
ch, count));
sys/dev/fb/vga.c
1790
u_char *data, int ch, int count)
sys/dev/fb/vga.c
1835
bcopy_fromio((uintptr_t)segment + ch*32, data, fontsize*count);
sys/dev/fb/vga.c
1837
for (c = ch; count > 0; ++c, --count) {
sys/dev/fb/vga.c
1870
u_char *data, int ch, int count)
sys/dev/fb/vga.c
1915
bcopy_toio(data, (uintptr_t)segment + ch*32, fontsize*count);
sys/dev/fb/vga.c
1917
for (c = ch; count > 0; ++c, --count) {
sys/dev/firewire/firewire.h
45
unsigned char ch:6;
sys/dev/firewire/fwdev.c
585
it->flag |= (0x3f & ichreq->ch);
sys/dev/firewire/fwdev.c
591
ichreq->ch = it->flag & 0x3f;
sys/dev/firewire/fwdev.c
611
ir->flag |= (0x3f & ichreq->ch);
sys/dev/firewire/fwdev.c
618
ichreq->ch = ir->flag & 0x3f;
sys/dev/firewire/fwohci.c
1061
int s, ch, err = 0;
sys/dev/firewire/fwohci.c
1072
ch = ATRQ_CH;
sys/dev/firewire/fwohci.c
1075
ch = ATRS_CH;
sys/dev/firewire/fwohci.c
1097
dump_db(sc, ch);
sys/dev/firewire/fwohci.c
2244
dump_dma(struct fwohci_softc *sc, uint32_t ch)
sys/dev/firewire/fwohci.c
2248
if (ch == 0) {
sys/dev/firewire/fwohci.c
2250
} else if (ch == 1) {
sys/dev/firewire/fwohci.c
2252
} else if (ch == 2) {
sys/dev/firewire/fwohci.c
2254
} else if (ch == 3) {
sys/dev/firewire/fwohci.c
2256
} else if (ch < IRX_CH) {
sys/dev/firewire/fwohci.c
2257
off = OHCI_ITCTL(ch - ITX_CH);
sys/dev/firewire/fwohci.c
2259
off = OHCI_IRCTL(ch - IRX_CH);
sys/dev/firewire/fwohci.c
2266
ch,
sys/dev/firewire/fwohci.c
2273
ch,
sys/dev/firewire/fwohci.c
2284
device_printf(sc->fc.dev, "dma %d ch: Nostat\n", ch);
sys/dev/firewire/fwohci.c
2289
dump_db(struct fwohci_softc *sc, uint32_t ch)
sys/dev/firewire/fwohci.c
2302
if (ch == 0) {
sys/dev/firewire/fwohci.c
2305
} else if (ch == 1) {
sys/dev/firewire/fwohci.c
2308
} else if (ch == 2) {
sys/dev/firewire/fwohci.c
2311
} else if (ch == 3) {
sys/dev/firewire/fwohci.c
2314
} else if (ch < IRX_CH) {
sys/dev/firewire/fwohci.c
2315
off = OHCI_ITCTL(ch - ITX_CH);
sys/dev/firewire/fwohci.c
2316
dbch = &sc->it[ch - ITX_CH];
sys/dev/firewire/fwohci.c
2318
off = OHCI_IRCTL(ch - IRX_CH);
sys/dev/firewire/fwohci.c
2319
dbch = &sc->ir[ch - IRX_CH];
sys/dev/firewire/fwohci.c
2324
device_printf(sc->fc.dev, "No DB is attached ch=%d\n", ch);
sys/dev/firewire/fwohci.c
2365
printf("Prev DB %d\n", ch);
sys/dev/firewire/fwohci.c
2366
print_db(pp, prev, ch, dbch->ndesc);
sys/dev/firewire/fwohci.c
2368
printf("Current DB %d\n", ch);
sys/dev/firewire/fwohci.c
2369
print_db(cp, curr, ch, dbch->ndesc);
sys/dev/firewire/fwohci.c
2371
printf("Next DB %d\n", ch);
sys/dev/firewire/fwohci.c
2372
print_db(np, next, ch, dbch->ndesc);
sys/dev/firewire/fwohci.c
2375
printf("dbdump err ch = %d cmd = 0x%08x\n", ch, cmd);
sys/dev/firewire/fwohci.c
2382
uint32_t ch, uint32_t max)
sys/dev/firewire/fwohci.c
2394
ch,
sys/dev/firewire/fwphyreg.h
116
ch:1,
sys/dev/firewire/fwphyreg.h
145
ch:1,
sys/dev/hyperv/utilities/hv_snapshot.c
292
hv_vss_respond_host(uint8_t *rcv_buf, struct vmbus_channel *ch,
sys/dev/hyperv/utilities/hv_snapshot.c
302
error = vmbus_chan_send(ch, VMBUS_CHANPKT_TYPE_INBAND, 0,
sys/dev/ice/ice_flex_pipe.c
831
struct ice_ptg_ptype **ch;
sys/dev/ice/ice_flex_pipe.c
846
ch = &hw->blk[blk].xlt1.ptg_tbl[ptg].first_ptype;
sys/dev/ice/ice_flex_pipe.c
849
*ch = p->next_ptype;
sys/dev/ice/ice_flex_pipe.c
853
ch = &p->next_ptype;
sys/dev/ichsmb/ichsmb.c
374
#define DISP(ch) (((ch) < 0x20 || (ch) >= 0x7e) ? '.' : (ch))
sys/dev/ichsmb/ichsmb.c
440
#define DISP(ch) (((ch) < 0x20 || (ch) >= 0x7e) ? '.' : (ch))
sys/dev/ida/ida.c
547
callout_reset(&ida->ch, hz * 5, ida_timeout, ida);
sys/dev/ida/ida.c
702
callout_reset(&ida->ch, hz * 5, ida_timeout, ida);
sys/dev/ida/ida.c
704
callout_stop(&ida->ch);
sys/dev/ida/ida.c
85
callout_stop(&ida->ch);
sys/dev/ida/ida.c
87
callout_drain(&ida->ch);
sys/dev/ida/ida_pci.c
245
callout_init_mtx(&ida->ch, &ida->lock, 0);
sys/dev/ida/idavar.h
133
struct callout ch;
sys/dev/kbd/kbd.c
1201
make_accent_char(keyboard_t *kbd, u_int ch, int *accents)
sys/dev/kbd/kbd.c
1213
if (ch == ' ')
sys/dev/kbd/kbd.c
1220
if (acc->map[i][0] == ch)
sys/dev/mgb/if_mgb.c
1230
int ch, error = 0;
sys/dev/mgb/if_mgb.c
1234
for (ch = 0; ch < scctx->isc_nrxqsets; ch++)
sys/dev/mgb/if_mgb.c
1235
if ((error = mgb_dma_rx_ring_init(sc, ch)))
sys/dev/mgb/if_mgb.c
1238
for (ch = 0; ch < scctx->isc_nrxqsets; ch++)
sys/dev/mgb/if_mgb.c
1239
if ((error = mgb_dma_tx_ring_init(sc, ch)))
sys/dev/mgb/if_mgb.h
100
#define MGB_DMAC_CMD_VAL(s, o, ch) (1 << ((s) + (o) + (ch)))
sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls_rx.c
103
ch = priv->params.num_channels;
sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls_rx.c
106
ch = temp % ch;
sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls_rx.c
109
ch = (flowid % 128) % ch;
sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls_rx.c
110
return (ch);
sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls_rx.c
97
u32 ch;
sys/dev/mlx5/mlx5_en/mlx5_en_main.c
4096
mlx5e_disable_tx_dma(struct mlx5e_channel *ch)
sys/dev/mlx5/mlx5_en/mlx5_en_main.c
4100
for (i = 0; i < ch->priv->num_tc; i++)
sys/dev/mlx5/mlx5_en/mlx5_en_main.c
4101
mlx5e_drain_sq(&ch->sq[i]);
sys/dev/mlx5/mlx5_en/mlx5_en_main.c
4147
mlx5e_enable_tx_dma(struct mlx5e_channel *ch)
sys/dev/mlx5/mlx5_en/mlx5_en_main.c
4151
for (i = 0; i < ch->priv->num_tc; i++)
sys/dev/mlx5/mlx5_en/mlx5_en_main.c
4152
mlx5e_resume_sq(&ch->sq[i]);
sys/dev/mlx5/mlx5_en/mlx5_en_main.c
4156
mlx5e_disable_rx_dma(struct mlx5e_channel *ch)
sys/dev/mlx5/mlx5_en/mlx5_en_main.c
4158
struct mlx5e_rq *rq = &ch->rq;
sys/dev/mlx5/mlx5_en/mlx5_en_main.c
4192
mlx5e_enable_rx_dma(struct mlx5e_channel *ch)
sys/dev/mlx5/mlx5_en/mlx5_en_main.c
4194
struct mlx5e_rq *rq = &ch->rq;
sys/dev/mlx5/mlx5_en/mlx5_en_main.c
4421
u32 ch = priv->params.num_channels;
sys/dev/mlx5/mlx5_en/mlx5_en_main.c
4427
ch = temp % ch;
sys/dev/mlx5/mlx5_en/mlx5_en_main.c
4430
ch = (params->hdr.flowid % 128) % ch;
sys/dev/mlx5/mlx5_en/mlx5_en_main.c
4438
pch = priv->channel + ch;
sys/dev/mlx5/mlx5_en/mlx5_en_tx.c
141
u32 ch;
sys/dev/mlx5/mlx5_en/mlx5_en_tx.c
153
ch = priv->params.num_channels;
sys/dev/mlx5/mlx5_en/mlx5_en_tx.c
162
ch = temp % ch;
sys/dev/mlx5/mlx5_en/mlx5_en_tx.c
165
ch = (mb->m_pkthdr.flowid % 128) % ch;
sys/dev/mlx5/mlx5_en/mlx5_en_tx.c
167
ch = m_ether_tcpip_hash(MBUF_HASHFLAG_L3 |
sys/dev/mlx5/mlx5_en/mlx5_en_tx.c
168
MBUF_HASHFLAG_L4, mb, mlx5e_hash_value) % ch;
sys/dev/mlx5/mlx5_en/mlx5_en_tx.c
172
sq = &priv->channel[ch].sq[tc];
sys/dev/mvs/mvs.c
1016
struct mvs_channel *ch = device_get_softc(dev);
sys/dev/mvs/mvs.c
1023
val = ATA_INL(ch->r_mem, EDMA_RESQIP);
sys/dev/mvs/mvs.c
1025
val = ATA_INL(ch->r_mem, EDMA_RESQIP);
sys/dev/mvs/mvs.c
1028
bus_dmamap_sync(ch->dma.workrp_tag, ch->dma.workrp_map,
sys/dev/mvs/mvs.c
1030
fin_idx = cin_idx = ch->in_idx;
sys/dev/mvs/mvs.c
1031
ch->in_idx = in_idx;
sys/dev/mvs/mvs.c
1034
(ch->dma.workrp + MVS_CRPB_OFFSET +
sys/dev/mvs/mvs.c
1046
cin_idx, fin_idx, in_idx, slot, flags, ch->rslots);
sys/dev/mvs/mvs.c
1049
if (ch->numtslots != 0 ||
sys/dev/mvs/mvs.c
1055
if (ch->slot[slot].state >= MVS_SLOT_RUNNING) {
sys/dev/mvs/mvs.c
1056
ccb = ch->slot[slot].ccb;
sys/dev/mvs/mvs.c
1060
mvs_end_transaction(&ch->slot[slot], MVS_ERR_NONE);
sys/dev/mvs/mvs.c
1065
ch->rslots);
sys/dev/mvs/mvs.c
1074
bus_dmamap_sync(ch->dma.workrp_tag, ch->dma.workrp_map,
sys/dev/mvs/mvs.c
1076
if (cin_idx == ch->in_idx) {
sys/dev/mvs/mvs.c
1077
ATA_OUTL(ch->r_mem, EDMA_RESQOP,
sys/dev/mvs/mvs.c
1078
ch->dma.workrp_bus | (cin_idx << EDMA_RESQP_ERPQP_SHIFT));
sys/dev/mvs/mvs.c
1086
struct mvs_channel *ch = device_get_softc(dev);
sys/dev/mvs/mvs.c
1092
if (ch->numdslots != 0)
sys/dev/mvs/mvs.c
1095
if (ch->numpslots != 0)
sys/dev/mvs/mvs.c
1098
if (!ch->fbs_enabled) {
sys/dev/mvs/mvs.c
1100
if (ch->numtslots != 0 &&
sys/dev/mvs/mvs.c
1101
ch->taggedtarget != ccb->ccb_h.target_id)
sys/dev/mvs/mvs.c
1107
if (ch->numtslots != 0)
sys/dev/mvs/mvs.c
1110
if (ch->numpslots != 0)
sys/dev/mvs/mvs.c
1115
if (ch->numrslots != 0)
sys/dev/mvs/mvs.c
1120
if (ch->numrslots != 0)
sys/dev/mvs/mvs.c
1125
if (ch->numrslots != 0)
sys/dev/mvs/mvs.c
1129
if (ch->aslots != 0)
sys/dev/mvs/mvs.c
1137
struct mvs_channel *ch = device_get_softc(dev);
sys/dev/mvs/mvs.c
1140
res->status = ATA_INB(ch->r_mem, ATA_ALTSTAT);
sys/dev/mvs/mvs.c
1141
res->error = ATA_INB(ch->r_mem, ATA_ERROR);
sys/dev/mvs/mvs.c
1142
res->device = ATA_INB(ch->r_mem, ATA_DRIVE);
sys/dev/mvs/mvs.c
1143
ATA_OUTB(ch->r_mem, ATA_CONTROL, ATA_A_HOB);
sys/dev/mvs/mvs.c
1144
res->sector_count_exp = ATA_INB(ch->r_mem, ATA_COUNT);
sys/dev/mvs/mvs.c
1145
res->lba_low_exp = ATA_INB(ch->r_mem, ATA_SECTOR);
sys/dev/mvs/mvs.c
1146
res->lba_mid_exp = ATA_INB(ch->r_mem, ATA_CYL_LSB);
sys/dev/mvs/mvs.c
1147
res->lba_high_exp = ATA_INB(ch->r_mem, ATA_CYL_MSB);
sys/dev/mvs/mvs.c
1148
ATA_OUTB(ch->r_mem, ATA_CONTROL, 0);
sys/dev/mvs/mvs.c
1149
res->sector_count = ATA_INB(ch->r_mem, ATA_COUNT);
sys/dev/mvs/mvs.c
1150
res->lba_low = ATA_INB(ch->r_mem, ATA_SECTOR);
sys/dev/mvs/mvs.c
1151
res->lba_mid = ATA_INB(ch->r_mem, ATA_CYL_LSB);
sys/dev/mvs/mvs.c
1152
res->lba_high = ATA_INB(ch->r_mem, ATA_CYL_MSB);
sys/dev/mvs/mvs.c
1158
struct mvs_channel *ch = device_get_softc(dev);
sys/dev/mvs/mvs.c
116
struct mvs_channel *ch = device_get_softc(dev);
sys/dev/mvs/mvs.c
1161
ATA_OUTB(ch->r_mem, ATA_DRIVE, cmd->device);
sys/dev/mvs/mvs.c
1162
ATA_OUTB(ch->r_mem, ATA_CONTROL, cmd->control);
sys/dev/mvs/mvs.c
1163
ATA_OUTB(ch->r_mem, ATA_FEATURE, cmd->features_exp);
sys/dev/mvs/mvs.c
1164
ATA_OUTB(ch->r_mem, ATA_FEATURE, cmd->features);
sys/dev/mvs/mvs.c
1165
ATA_OUTB(ch->r_mem, ATA_COUNT, cmd->sector_count_exp);
sys/dev/mvs/mvs.c
1166
ATA_OUTB(ch->r_mem, ATA_COUNT, cmd->sector_count);
sys/dev/mvs/mvs.c
1167
ATA_OUTB(ch->r_mem, ATA_SECTOR, cmd->lba_low_exp);
sys/dev/mvs/mvs.c
1168
ATA_OUTB(ch->r_mem, ATA_SECTOR, cmd->lba_low);
sys/dev/mvs/mvs.c
1169
ATA_OUTB(ch->r_mem, ATA_CYL_LSB, cmd->lba_mid_exp);
sys/dev/mvs/mvs.c
1170
ATA_OUTB(ch->r_mem, ATA_CYL_LSB, cmd->lba_mid);
sys/dev/mvs/mvs.c
1171
ATA_OUTB(ch->r_mem, ATA_CYL_MSB, cmd->lba_high_exp);
sys/dev/mvs/mvs.c
1172
ATA_OUTB(ch->r_mem, ATA_CYL_MSB, cmd->lba_high);
sys/dev/mvs/mvs.c
1173
ATA_OUTB(ch->r_mem, ATA_COMMAND, cmd->command);
sys/dev/mvs/mvs.c
1180
struct mvs_channel *ch = device_get_softc(dev);
sys/dev/mvs/mvs.c
1184
if (ch->pm_level > 0)
sys/dev/mvs/mvs.c
1193
slotn = ffs(~ch->oslots) - 1;
sys/dev/mvs/mvs.c
1196
if (ch->quirks & MVS_Q_GENIIE)
sys/dev/mvs/mvs.c
1197
tag = ffs(~ch->otagspd[ccb->ccb_h.target_id]) - 1;
sys/dev/mvs/mvs.c
120
ch->dev = dev;
sys/dev/mvs/mvs.c
1203
slot = &ch->slot[slotn];
sys/dev/mvs/mvs.c
1207
if (ch->numrslots == 0 && ch->pm_level > 3)
sys/dev/mvs/mvs.c
1208
callout_stop(&ch->pm_timer);
sys/dev/mvs/mvs.c
121
ch->unit = (intptr_t)device_get_ivars(dev);
sys/dev/mvs/mvs.c
1210
ch->oslots |= (1 << slot->slot);
sys/dev/mvs/mvs.c
1211
ch->numrslots++;
sys/dev/mvs/mvs.c
1212
ch->numrslotspd[ccb->ccb_h.target_id]++;
sys/dev/mvs/mvs.c
1215
ch->otagspd[ccb->ccb_h.target_id] |= (1 << slot->tag);
sys/dev/mvs/mvs.c
1216
ch->numtslots++;
sys/dev/mvs/mvs.c
1217
ch->numtslotspd[ccb->ccb_h.target_id]++;
sys/dev/mvs/mvs.c
1218
ch->taggedtarget = ccb->ccb_h.target_id;
sys/dev/mvs/mvs.c
122
ch->quirks = ctlr->quirks;
sys/dev/mvs/mvs.c
1221
ch->numdslots++;
sys/dev/mvs/mvs.c
1224
ch->numpslots++;
sys/dev/mvs/mvs.c
1229
ch->aslots |= (1 << slot->slot);
sys/dev/mvs/mvs.c
123
mtx_init(&ch->mtx, "MVS channel lock", NULL, MTX_DEF);
sys/dev/mvs/mvs.c
1234
ch->numpslots++;
sys/dev/mvs/mvs.c
1237
ch->curr[ccb->ccb_h.target_id].mode >= ATA_DMA &&
sys/dev/mvs/mvs.c
1238
(ch->quirks & MVS_Q_SOC) == 0 &&
sys/dev/mvs/mvs.c
124
ch->pm_level = 0;
sys/dev/mvs/mvs.c
1248
ch->basic_dma = 1;
sys/dev/mvs/mvs.c
1252
if (ch->numpslots == 0 || ch->basic_dma) {
sys/dev/mvs/mvs.c
1254
bus_dmamap_load_ccb(ch->dma.data_tag, slot->dma.data_map,
sys/dev/mvs/mvs.c
126
device_get_unit(dev), "pm_level", &ch->pm_level);
sys/dev/mvs/mvs.c
1265
struct mvs_channel *ch = device_get_softc(slot->dev);
sys/dev/mvs/mvs.c
127
if (ch->pm_level > 3)
sys/dev/mvs/mvs.c
1276
if (nsegs == 1 && ch->basic_dma == 0 && (ch->quirks & MVS_Q_GENIIE)) {
sys/dev/mvs/mvs.c
128
callout_init_mtx(&ch->pm_timer, &ch->mtx, 0);
sys/dev/mvs/mvs.c
1282
eprd = (struct mvs_eprd *)(ch->dma.workrq + slot->eprd_offset);
sys/dev/mvs/mvs.c
129
callout_init_mtx(&ch->reset_timer, &ch->mtx, 0);
sys/dev/mvs/mvs.c
1291
bus_dmamap_sync(ch->dma.data_tag, slot->dma.data_map,
sys/dev/mvs/mvs.c
1294
if (ch->basic_dma)
sys/dev/mvs/mvs.c
1304
struct mvs_channel *ch = device_get_softc(dev);
sys/dev/mvs/mvs.c
1311
ch->rslots |= (1 << slot->slot);
sys/dev/mvs/mvs.c
1312
ATA_OUTB(ch->r_mem, SATA_SATAICTL, port << SATA_SATAICTL_PMPTX_SHIFT);
sys/dev/mvs/mvs.c
1320
ccb->ataio.res.status = ATA_INB(ch->r_mem, ATA_STATUS);
sys/dev/mvs/mvs.c
1325
ch->donecount = 0;
sys/dev/mvs/mvs.c
133
ch->user[i].revision = sata_rev;
sys/dev/mvs/mvs.c
1330
ch->transfersize = min(ccb->ataio.dxfer_len,
sys/dev/mvs/mvs.c
1331
ch->curr[port].bytecount);
sys/dev/mvs/mvs.c
1333
ch->transfersize = min(ccb->ataio.dxfer_len, 512);
sys/dev/mvs/mvs.c
1335
ch->fake_busy = 1;
sys/dev/mvs/mvs.c
134
ch->user[i].mode = 0;
sys/dev/mvs/mvs.c
1341
xpt_freeze_simq(ch->sim, 1);
sys/dev/mvs/mvs.c
1342
ch->toslots |= (1 << slot->slot);
sys/dev/mvs/mvs.c
1346
ATA_OUTSW_STRM(ch->r_mem, ATA_DATA,
sys/dev/mvs/mvs.c
1347
(uint16_t *)(ccb->ataio.data_ptr + ch->donecount),
sys/dev/mvs/mvs.c
1348
ch->transfersize / 2);
sys/dev/mvs/mvs.c
135
ch->user[i].bytecount = (ch->quirks & MVS_Q_GENIIE) ? 8192 : 2048;
sys/dev/mvs/mvs.c
1351
ch->donecount = 0;
sys/dev/mvs/mvs.c
1352
ch->transfersize = min(ccb->csio.dxfer_len,
sys/dev/mvs/mvs.c
1353
ch->curr[port].bytecount);
sys/dev/mvs/mvs.c
1355
if (ch->basic_dma) {
sys/dev/mvs/mvs.c
1356
ATA_OUTB(ch->r_mem, ATA_FEATURE, ATA_F_DMA);
sys/dev/mvs/mvs.c
1357
ATA_OUTB(ch->r_mem, ATA_CYL_LSB, 0);
sys/dev/mvs/mvs.c
1358
ATA_OUTB(ch->r_mem, ATA_CYL_MSB, 0);
sys/dev/mvs/mvs.c
136
ch->user[i].tags = MVS_MAX_SLOTS;
sys/dev/mvs/mvs.c
1360
ATA_OUTB(ch->r_mem, ATA_FEATURE, 0);
sys/dev/mvs/mvs.c
1361
ATA_OUTB(ch->r_mem, ATA_CYL_LSB, ch->transfersize);
sys/dev/mvs/mvs.c
1362
ATA_OUTB(ch->r_mem, ATA_CYL_MSB, ch->transfersize >> 8);
sys/dev/mvs/mvs.c
1364
ATA_OUTB(ch->r_mem, ATA_COMMAND, ATA_PACKET_CMD);
sys/dev/mvs/mvs.c
1365
ch->fake_busy = 1;
sys/dev/mvs/mvs.c
1369
xpt_freeze_simq(ch->sim, 1);
sys/dev/mvs/mvs.c
137
ch->curr[i] = ch->user[i];
sys/dev/mvs/mvs.c
1370
ch->toslots |= (1 << slot->slot);
sys/dev/mvs/mvs.c
1376
int reason = ATA_INB(ch->r_mem, ATA_IREASON);
sys/dev/mvs/mvs.c
1377
int status = ATA_INB(ch->r_mem, ATA_STATUS);
sys/dev/mvs/mvs.c
138
if (ch->pm_level) {
sys/dev/mvs/mvs.c
1387
xpt_freeze_simq(ch->sim, 1);
sys/dev/mvs/mvs.c
1388
ch->toslots |= (1 << slot->slot);
sys/dev/mvs/mvs.c
139
ch->user[i].caps = CTS_SATA_CAPS_H_PMREQ |
sys/dev/mvs/mvs.c
1393
ATA_OUTSW_STRM(ch->r_mem, ATA_DATA,
sys/dev/mvs/mvs.c
1396
ch->curr[port].atapi / 2);
sys/dev/mvs/mvs.c
1398
if (ch->basic_dma) {
sys/dev/mvs/mvs.c
1400
eprd = ch->dma.workrq_bus + slot->eprd_offset;
sys/dev/mvs/mvs.c
1401
ATA_OUTL(ch->r_mem, DMA_DTLBA, eprd);
sys/dev/mvs/mvs.c
1402
ATA_OUTL(ch->r_mem, DMA_DTHBA, (eprd >> 16) >> 16);
sys/dev/mvs/mvs.c
1403
ATA_OUTL(ch->r_mem, DMA_C, DMA_C_START |
sys/dev/mvs/mvs.c
1418
struct mvs_channel *ch = device_get_softc(dev);
sys/dev/mvs/mvs.c
1427
eprd = ch->dma.workrq_bus + slot->eprd_offset;
sys/dev/mvs/mvs.c
1429
if (ch->quirks & MVS_Q_GENIIE) {
sys/dev/mvs/mvs.c
143
ch->user[i].caps |= CTS_SATA_CAPS_H_AN;
sys/dev/mvs/mvs.c
1431
(ch->dma.workrq + MVS_CRQB_OFFSET + (MVS_CRQB_SIZE * ch->out_idx));
sys/dev/mvs/mvs.c
145
rid = ch->unit;
sys/dev/mvs/mvs.c
146
if (!(ch->r_mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY,
sys/dev/mvs/mvs.c
1468
(ch->dma.workrq + MVS_CRQB_OFFSET + (MVS_CRQB_SIZE * ch->out_idx));
sys/dev/mvs/mvs.c
1513
bus_dmamap_sync(ch->dma.workrq_tag, ch->dma.workrq_map,
sys/dev/mvs/mvs.c
1515
bus_dmamap_sync(ch->dma.workrp_tag, ch->dma.workrp_map,
sys/dev/mvs/mvs.c
1518
ch->rslots |= (1 << slot->slot);
sys/dev/mvs/mvs.c
152
mtx_lock(&ch->mtx);
sys/dev/mvs/mvs.c
1520
ch->out_idx = (ch->out_idx + 1) & (MVS_MAX_SLOTS - 1);
sys/dev/mvs/mvs.c
1521
ATA_OUTL(ch->r_mem, EDMA_REQQIP,
sys/dev/mvs/mvs.c
1522
ch->dma.workrq_bus + MVS_CRQB_OFFSET + (MVS_CRQB_SIZE * ch->out_idx));
sys/dev/mvs/mvs.c
1533
struct mvs_channel *ch = device_get_softc(dev);
sys/dev/mvs/mvs.c
1536
mtx_assert(&ch->mtx, MA_OWNED);
sys/dev/mvs/mvs.c
154
if (!(ch->r_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ,
sys/dev/mvs/mvs.c
1540
if (ch->slot[i].state < MVS_SLOT_RUNNING)
sys/dev/mvs/mvs.c
1542
mvs_end_transaction(&ch->slot[i], MVS_ERR_TIMEOUT);
sys/dev/mvs/mvs.c
1550
struct mvs_channel *ch = device_get_softc(dev);
sys/dev/mvs/mvs.c
1553
mtx_assert(&ch->mtx, MA_OWNED);
sys/dev/mvs/mvs.c
1555
struct mvs_slot *slot = &ch->slot[i];
sys/dev/mvs/mvs.c
1560
if ((ch->toslots & (1 << i)) == 0)
sys/dev/mvs/mvs.c
1574
struct mvs_channel *ch = device_get_softc(dev);
sys/dev/mvs/mvs.c
1582
ATA_INL(ch->r_mem, EDMA_IEC),
sys/dev/mvs/mvs.c
1583
ATA_INL(ch->r_mem, SATA_SS), ATA_INL(ch->r_mem, SATA_SE),
sys/dev/mvs/mvs.c
1584
ATA_INL(ch->r_mem, EDMA_S), ATA_INL(ch->r_mem, DMA_C),
sys/dev/mvs/mvs.c
1585
ATA_INL(ch->r_mem, DMA_S), ch->rslots,
sys/dev/mvs/mvs.c
1586
ATA_INB(ch->r_mem, ATA_ALTSTAT));
sys/dev/mvs/mvs.c
1590
if (ch->toslots == 0)
sys/dev/mvs/mvs.c
1591
xpt_freeze_simq(ch->sim, 1);
sys/dev/mvs/mvs.c
1592
ch->toslots |= (1 << slot->slot);
sys/dev/mvs/mvs.c
1593
if ((ch->rslots & ~ch->toslots) == 0)
sys/dev/mvs/mvs.c
1597
ch->rslots & ~ch->toslots);
sys/dev/mvs/mvs.c
160
if ((bus_setup_intr(dev, ch->r_irq, ATA_INTR_FLAGS, NULL,
sys/dev/mvs/mvs.c
1605
struct mvs_channel *ch = device_get_softc(dev);
sys/dev/mvs/mvs.c
1609
bus_dmamap_sync(ch->dma.workrq_tag, ch->dma.workrq_map,
sys/dev/mvs/mvs.c
161
mvs_ch_intr_locked, dev, &ch->ih))) {
sys/dev/mvs/mvs.c
1625
ch->basic_dma == 0)
sys/dev/mvs/mvs.c
1626
ccb->csio.resid = ccb->csio.dxfer_len - ch->donecount;
sys/dev/mvs/mvs.c
1628
if (ch->numpslots == 0 || ch->basic_dma) {
sys/dev/mvs/mvs.c
1630
bus_dmamap_sync(ch->dma.data_tag, slot->dma.data_map,
sys/dev/mvs/mvs.c
1633
bus_dmamap_unload(ch->dma.data_tag, slot->dma.data_map);
sys/dev/mvs/mvs.c
1637
ch->eslots |= (1 << slot->slot);
sys/dev/mvs/mvs.c
1639
if ((et != MVS_ERR_NONE) && (!ch->recoverycmd) &&
sys/dev/mvs/mvs.c
1653
ch->fatalerr = 1;
sys/dev/mvs/mvs.c
1669
ch->fatalerr = 1;
sys/dev/mvs/mvs.c
1670
if (!ch->recoverycmd) {
sys/dev/mvs/mvs.c
1671
xpt_freeze_simq(ch->sim, 1);
sys/dev/mvs/mvs.c
1678
if (!ch->recoverycmd) {
sys/dev/mvs/mvs.c
1679
xpt_freeze_simq(ch->sim, 1);
sys/dev/mvs/mvs.c
1686
ch->fatalerr = 1;
sys/dev/mvs/mvs.c
1690
ch->oslots &= ~(1 << slot->slot);
sys/dev/mvs/mvs.c
1691
ch->rslots &= ~(1 << slot->slot);
sys/dev/mvs/mvs.c
1692
ch->aslots &= ~(1 << slot->slot);
sys/dev/mvs/mvs.c
1696
ch->numrslots--;
sys/dev/mvs/mvs.c
1697
ch->numrslotspd[ccb->ccb_h.target_id]--;
sys/dev/mvs/mvs.c
1700
ch->otagspd[ccb->ccb_h.target_id] &= ~(1 << slot->tag);
sys/dev/mvs/mvs.c
1701
ch->numtslots--;
sys/dev/mvs/mvs.c
1702
ch->numtslotspd[ccb->ccb_h.target_id]--;
sys/dev/mvs/mvs.c
1704
ch->numdslots--;
sys/dev/mvs/mvs.c
1706
ch->numpslots--;
sys/dev/mvs/mvs.c
1709
ch->numpslots--;
sys/dev/mvs/mvs.c
1710
ch->basic_dma = 0;
sys/dev/mvs/mvs.c
1714
lastto = (ch->toslots == (1 << slot->slot));
sys/dev/mvs/mvs.c
1715
ch->toslots &= ~(1 << slot->slot);
sys/dev/mvs/mvs.c
1717
xpt_release_simq(ch->sim, TRUE);
sys/dev/mvs/mvs.c
1729
ch->hold[slot->slot] = ccb;
sys/dev/mvs/mvs.c
1730
ch->holdtag[slot->slot] = slot->tag;
sys/dev/mvs/mvs.c
1731
ch->numhslots++;
sys/dev/mvs/mvs.c
1735
if (ch->rslots == 0) {
sys/dev/mvs/mvs.c
1737
if (ch->toslots != 0 || ch->fatalerr) {
sys/dev/mvs/mvs.c
174
ch->sim = cam_sim_alloc(mvsaction, mvspoll, "mvsch", ch,
sys/dev/mvs/mvs.c
1741
if (ch->eslots != 0) {
sys/dev/mvs/mvs.c
1743
ch->eslots = 0;
sys/dev/mvs/mvs.c
1746
if (!ch->recoverycmd && ch->numhslots)
sys/dev/mvs/mvs.c
175
device_get_unit(dev), &ch->mtx,
sys/dev/mvs/mvs.c
1750
} else if ((ch->rslots & ~ch->toslots) == 0 &&
sys/dev/mvs/mvs.c
1754
if (ch->frozen && !mvs_check_collision(dev, ch->frozen)) {
sys/dev/mvs/mvs.c
1755
union ccb *fccb = ch->frozen;
sys/dev/mvs/mvs.c
1756
ch->frozen = NULL;
sys/dev/mvs/mvs.c
1758
xpt_release_simq(ch->sim, TRUE);
sys/dev/mvs/mvs.c
176
2, (ch->quirks & MVS_Q_GENI) ? 0 : MVS_MAX_SLOTS - 1,
sys/dev/mvs/mvs.c
1761
if (ch->numrslots == 0 && ch->pm_level > 3 &&
sys/dev/mvs/mvs.c
1762
(ch->curr[ch->pm_present ? 15 : 0].caps & CTS_SATA_CAPS_D_PMREQ)) {
sys/dev/mvs/mvs.c
1763
callout_schedule(&ch->pm_timer,
sys/dev/mvs/mvs.c
1764
(ch->pm_level == 4) ? hz / 1000 : hz / 8);
sys/dev/mvs/mvs.c
1771
struct mvs_channel *ch = device_get_softc(dev);
sys/dev/mvs/mvs.c
1779
if (ch->hold[i])
sys/dev/mvs/mvs.c
178
if (ch->sim == NULL) {
sys/dev/mvs/mvs.c
1788
if (ch->hold[i] == NULL)
sys/dev/mvs/mvs.c
1790
ch->hold[i]->ccb_h.status &= ~CAM_STATUS_MASK;
sys/dev/mvs/mvs.c
1791
ch->hold[i]->ccb_h.status |= CAM_RESRC_UNAVAIL;
sys/dev/mvs/mvs.c
1792
xpt_done(ch->hold[i]);
sys/dev/mvs/mvs.c
1793
ch->hold[i] = NULL;
sys/dev/mvs/mvs.c
1794
ch->numhslots--;
sys/dev/mvs/mvs.c
1799
xpt_setup_ccb(&ccb->ccb_h, ch->hold[i]->ccb_h.path,
sys/dev/mvs/mvs.c
1800
ch->hold[i]->ccb_h.pinfo.priority);
sys/dev/mvs/mvs.c
1801
if (ch->hold[i]->ccb_h.func_code == XPT_ATA_IO) {
sys/dev/mvs/mvs.c
1833
csio->data_ptr = (void *)&ch->hold[i]->csio.sense_data;
sys/dev/mvs/mvs.c
1834
csio->dxfer_len = ch->hold[i]->csio.sense_len;
sys/dev/mvs/mvs.c
184
if (xpt_bus_register(ch->sim, dev, 0) != CAM_SUCCESS) {
sys/dev/mvs/mvs.c
1841
ch->recoverycmd = 1;
sys/dev/mvs/mvs.c
1842
xpt_freeze_simq(ch->sim, 1);
sys/dev/mvs/mvs.c
1849
struct mvs_channel *ch = device_get_softc(dev);
sys/dev/mvs/mvs.c
1854
ch->recoverycmd = 0;
sys/dev/mvs/mvs.c
1860
if (!ch->hold[i])
sys/dev/mvs/mvs.c
1862
if (ch->hold[i]->ccb_h.target_id != ccb->ccb_h.target_id)
sys/dev/mvs/mvs.c
1864
if ((data[0] & 0x1F) == ch->holdtag[i]) {
sys/dev/mvs/mvs.c
1865
res = &ch->hold[i]->ataio.res;
sys/dev/mvs/mvs.c
1878
ch->hold[i]->ccb_h.status &= ~CAM_STATUS_MASK;
sys/dev/mvs/mvs.c
1879
ch->hold[i]->ccb_h.status |= CAM_REQUEUE_REQ;
sys/dev/mvs/mvs.c
1881
xpt_done(ch->hold[i]);
sys/dev/mvs/mvs.c
1882
ch->hold[i] = NULL;
sys/dev/mvs/mvs.c
1883
ch->numhslots--;
sys/dev/mvs/mvs.c
189
if (xpt_create_path(&ch->path, /*periph*/NULL, cam_sim_path(ch->sim),
sys/dev/mvs/mvs.c
1893
if (!ch->hold[i])
sys/dev/mvs/mvs.c
1895
if (ch->hold[i]->ccb_h.target_id != ccb->ccb_h.target_id)
sys/dev/mvs/mvs.c
1897
xpt_done(ch->hold[i]);
sys/dev/mvs/mvs.c
1898
ch->hold[i] = NULL;
sys/dev/mvs/mvs.c
1899
ch->numhslots--;
sys/dev/mvs/mvs.c
1904
xpt_release_simq(ch->sim, TRUE);
sys/dev/mvs/mvs.c
1910
struct mvs_channel *ch = device_get_softc(dev);
sys/dev/mvs/mvs.c
1913
ch->recoverycmd = 0;
sys/dev/mvs/mvs.c
1917
ch->hold[i]->ccb_h.status |= CAM_AUTOSNS_VALID;
sys/dev/mvs/mvs.c
1919
ch->hold[i]->ccb_h.status &= ~CAM_STATUS_MASK;
sys/dev/mvs/mvs.c
1920
ch->hold[i]->ccb_h.status |= CAM_AUTOSENSE_FAIL;
sys/dev/mvs/mvs.c
1922
xpt_done(ch->hold[i]);
sys/dev/mvs/mvs.c
1923
ch->hold[i] = NULL;
sys/dev/mvs/mvs.c
1924
ch->numhslots--;
sys/dev/mvs/mvs.c
1926
xpt_release_simq(ch->sim, TRUE);
sys/dev/mvs/mvs.c
195
if (ch->pm_level > 3) {
sys/dev/mvs/mvs.c
1950
struct mvs_channel *ch = device_get_softc(dev);
sys/dev/mvs/mvs.c
1951
union ccb *fccb = ch->frozen;
sys/dev/mvs/mvs.c
1954
ch->frozen = NULL;
sys/dev/mvs/mvs.c
196
callout_reset(&ch->pm_timer,
sys/dev/mvs/mvs.c
1968
struct mvs_channel *ch = device_get_softc(dev);
sys/dev/mvs/mvs.c
197
(ch->pm_level == 4) ? hz / 1000 : hz / 8,
sys/dev/mvs/mvs.c
1971
if (ch->resetting == 0)
sys/dev/mvs/mvs.c
1973
ch->resetting--;
sys/dev/mvs/mvs.c
1978
(310 - ch->resetting) * 100);
sys/dev/mvs/mvs.c
1980
ch->resetting = 0;
sys/dev/mvs/mvs.c
1981
xpt_release_simq(ch->sim, TRUE);
sys/dev/mvs/mvs.c
1984
if (ch->resetting == 0) {
sys/dev/mvs/mvs.c
1987
xpt_release_simq(ch->sim, TRUE);
sys/dev/mvs/mvs.c
1990
callout_schedule(&ch->reset_timer, hz / 10);
sys/dev/mvs/mvs.c
1996
struct mvs_channel *ch = device_get_softc(dev);
sys/dev/mvs/mvs.c
1999
if (ch->quirks & MVS_Q_SOC65) {
sys/dev/mvs/mvs.c
200
mtx_unlock(&ch->mtx);
sys/dev/mvs/mvs.c
2000
val = ATA_INL(ch->r_mem, SATA_PHYM3);
sys/dev/mvs/mvs.c
2005
ATA_OUTL(ch->r_mem, SATA_PHYM3, val);
sys/dev/mvs/mvs.c
2007
val = ATA_INL(ch->r_mem, SATA_PHYM4);
sys/dev/mvs/mvs.c
2010
ATA_OUTL(ch->r_mem, SATA_PHYM4, val);
sys/dev/mvs/mvs.c
2012
val = ATA_INL(ch->r_mem, SATA_PHYM9_GEN2);
sys/dev/mvs/mvs.c
2016
ATA_OUTL(ch->r_mem, SATA_PHYM9_GEN2, val);
sys/dev/mvs/mvs.c
2018
val = ATA_INL(ch->r_mem, SATA_PHYM9_GEN1);
sys/dev/mvs/mvs.c
2022
ATA_OUTL(ch->r_mem, SATA_PHYM9_GEN1, val);
sys/dev/mvs/mvs.c
2029
struct mvs_channel *ch = device_get_softc(dev);
sys/dev/mvs/mvs.c
2032
xpt_freeze_simq(ch->sim, 1);
sys/dev/mvs/mvs.c
2036
if (ch->resetting) {
sys/dev/mvs/mvs.c
2037
ch->resetting = 0;
sys/dev/mvs/mvs.c
2038
callout_stop(&ch->reset_timer);
sys/dev/mvs/mvs.c
2039
xpt_release_simq(ch->sim, TRUE);
sys/dev/mvs/mvs.c
204
xpt_bus_deregister(cam_sim_path(ch->sim));
sys/dev/mvs/mvs.c
2045
ATA_OUTL(ch->r_mem, DMA_C, 0);
sys/dev/mvs/mvs.c
2048
if (ch->slot[i].state < MVS_SLOT_RUNNING)
sys/dev/mvs/mvs.c
2051
mvs_end_transaction(&ch->slot[i], MVS_ERR_INNOCENT);
sys/dev/mvs/mvs.c
2054
if (!ch->hold[i])
sys/dev/mvs/mvs.c
2056
xpt_done(ch->hold[i]);
sys/dev/mvs/mvs.c
2057
ch->hold[i] = NULL;
sys/dev/mvs/mvs.c
2058
ch->numhslots--;
sys/dev/mvs/mvs.c
206
cam_sim_free(ch->sim, /*free_devq*/TRUE);
sys/dev/mvs/mvs.c
2060
if (ch->toslots != 0)
sys/dev/mvs/mvs.c
2061
xpt_release_simq(ch->sim, TRUE);
sys/dev/mvs/mvs.c
2062
ch->eslots = 0;
sys/dev/mvs/mvs.c
2063
ch->toslots = 0;
sys/dev/mvs/mvs.c
2064
ch->fatalerr = 0;
sys/dev/mvs/mvs.c
2065
ch->fake_busy = 0;
sys/dev/mvs/mvs.c
2067
xpt_async(AC_BUS_RESET, ch->path, NULL);
sys/dev/mvs/mvs.c
2068
ATA_OUTL(ch->r_mem, EDMA_IEM, 0);
sys/dev/mvs/mvs.c
2069
ATA_OUTL(ch->r_mem, EDMA_CMD, EDMA_CMD_EATARST);
sys/dev/mvs/mvs.c
2071
ATA_OUTL(ch->r_mem, EDMA_CMD, 0);
sys/dev/mvs/mvs.c
2077
ch->devices = 0;
sys/dev/mvs/mvs.c
2078
ATA_OUTL(ch->r_mem, SATA_SE, 0xffffffff);
sys/dev/mvs/mvs.c
2079
ATA_OUTL(ch->r_mem, EDMA_IEC, 0);
sys/dev/mvs/mvs.c
208
bus_release_resource(dev, SYS_RES_IRQ, ATA_IRQ_RID, ch->r_irq);
sys/dev/mvs/mvs.c
2080
ATA_OUTL(ch->r_mem, EDMA_IEM, ~EDMA_IE_TRANSIENT);
sys/dev/mvs/mvs.c
2081
xpt_release_simq(ch->sim, TRUE);
sys/dev/mvs/mvs.c
2093
ch->resetting = 310;
sys/dev/mvs/mvs.c
2096
ch->devices = 1;
sys/dev/mvs/mvs.c
2097
ATA_OUTL(ch->r_mem, SATA_SE, 0xffffffff);
sys/dev/mvs/mvs.c
2098
ATA_OUTL(ch->r_mem, EDMA_IEC, 0);
sys/dev/mvs/mvs.c
2099
ATA_OUTL(ch->r_mem, EDMA_IEM, ~EDMA_IE_TRANSIENT);
sys/dev/mvs/mvs.c
210
bus_release_resource(dev, SYS_RES_MEMORY, ch->unit, ch->r_mem);
sys/dev/mvs/mvs.c
2100
if (ch->resetting)
sys/dev/mvs/mvs.c
2101
callout_reset(&ch->reset_timer, hz / 10, mvs_reset_to, dev);
sys/dev/mvs/mvs.c
2103
xpt_release_simq(ch->sim, TRUE);
sys/dev/mvs/mvs.c
2109
struct mvs_channel *ch = device_get_softc(dev);
sys/dev/mvs/mvs.c
211
mtx_unlock(&ch->mtx);
sys/dev/mvs/mvs.c
2115
ATA_OUTB(ch->r_mem, SATA_SATAICTL, port << SATA_SATAICTL_PMPTX_SHIFT);
sys/dev/mvs/mvs.c
2116
ATA_OUTB(ch->r_mem, ATA_CONTROL, ATA_A_RESET);
sys/dev/mvs/mvs.c
2118
ATA_OUTB(ch->r_mem, ATA_CONTROL, 0);
sys/dev/mvs/mvs.c
212
mtx_destroy(&ch->mtx);
sys/dev/mvs/mvs.c
2141
if (stuck && ch->pm_present && port != 15) {
sys/dev/mvs/mvs.c
2142
ATA_OUTB(ch->r_mem, SATA_SATAICTL,
sys/dev/mvs/mvs.c
2144
ATA_OUTB(ch->r_mem, ATA_CONTROL, ATA_A_RESET);
sys/dev/mvs/mvs.c
2146
ATA_OUTB(ch->r_mem, ATA_CONTROL, 0);
sys/dev/mvs/mvs.c
2154
mvs_sata_connect(struct mvs_channel *ch)
sys/dev/mvs/mvs.c
2161
status = ATA_INL(ch->r_mem, SATA_SS);
sys/dev/mvs/mvs.c
2170
device_printf(ch->dev, "SATA offline status=%08x\n",
sys/dev/mvs/mvs.c
2181
device_printf(ch->dev,
sys/dev/mvs/mvs.c
2188
device_printf(ch->dev, "SATA connect time=%dus status=%08x\n",
sys/dev/mvs/mvs.c
219
struct mvs_channel *ch = device_get_softc(dev);
sys/dev/mvs/mvs.c
2192
ATA_OUTL(ch->r_mem, SATA_SE, 0xffffffff);
sys/dev/mvs/mvs.c
2199
struct mvs_channel *ch = device_get_softc(dev);
sys/dev/mvs/mvs.c
2203
sata_rev = ch->user[ch->pm_present ? 15 : 0].revision;
sys/dev/mvs/mvs.c
221
mtx_lock(&ch->mtx);
sys/dev/mvs/mvs.c
2212
ATA_OUTL(ch->r_mem, SATA_SC,
sys/dev/mvs/mvs.c
2216
ATA_OUTL(ch->r_mem, SATA_SC,
sys/dev/mvs/mvs.c
2217
SATA_SC_DET_IDLE | val | ((ch->pm_level > 0) ? 0 :
sys/dev/mvs/mvs.c
2219
if (!mvs_sata_connect(ch)) {
sys/dev/mvs/mvs.c
222
xpt_async(AC_LOST_DEVICE, ch->path, NULL);
sys/dev/mvs/mvs.c
2220
if (ch->pm_level > 0)
sys/dev/mvs/mvs.c
2221
ATA_OUTL(ch->r_mem, SATA_SC, SATA_SC_DET_DISABLE);
sys/dev/mvs/mvs.c
2230
struct mvs_channel *ch = device_get_softc(dev);
sys/dev/mvs/mvs.c
2232
if (ccb->ccb_h.target_id > ((ch->quirks & MVS_Q_GENI) ? 0 : 15)) {
sys/dev/mvs/mvs.c
224
if (ch->resetting) {
sys/dev/mvs/mvs.c
225
ch->resetting = 0;
sys/dev/mvs/mvs.c
2255
struct mvs_channel *ch;
sys/dev/mvs/mvs.c
226
xpt_release_simq(ch->sim, TRUE);
sys/dev/mvs/mvs.c
2260
ch = (struct mvs_channel *)cam_sim_softc(sim);
sys/dev/mvs/mvs.c
2261
dev = ch->dev;
sys/dev/mvs/mvs.c
2268
if (ch->devices == 0 ||
sys/dev/mvs/mvs.c
2269
(ch->pm_present == 0 &&
sys/dev/mvs/mvs.c
2278
ch->frozen = ccb;
sys/dev/mvs/mvs.c
228
xpt_free_path(ch->path);
sys/dev/mvs/mvs.c
2280
xpt_freeze_simq(ch->sim, 1);
sys/dev/mvs/mvs.c
229
xpt_bus_deregister(cam_sim_path(ch->sim));
sys/dev/mvs/mvs.c
2297
d = &ch->curr[ccb->ccb_h.target_id];
sys/dev/mvs/mvs.c
2299
d = &ch->user[ccb->ccb_h.target_id];
sys/dev/mvs/mvs.c
230
cam_sim_free(ch->sim, /*free_devq*/TRUE);
sys/dev/mvs/mvs.c
2305
d->bytecount = min((ch->quirks & MVS_Q_GENIIE) ? 8192 : 2048,
sys/dev/mvs/mvs.c
231
mtx_unlock(&ch->mtx);
sys/dev/mvs/mvs.c
2311
ch->pm_present = cts->xport_specific.sata.pm_present;
sys/dev/mvs/mvs.c
2329
d = &ch->curr[ccb->ccb_h.target_id];
sys/dev/mvs/mvs.c
233
if (ch->pm_level > 3)
sys/dev/mvs/mvs.c
2331
d = &ch->user[ccb->ccb_h.target_id];
sys/dev/mvs/mvs.c
234
callout_drain(&ch->pm_timer);
sys/dev/mvs/mvs.c
2340
(ccb->ccb_h.target_id == 0 && !ch->pm_present))) {
sys/dev/mvs/mvs.c
2341
status = ATA_INL(ch->r_mem, SATA_SS) & SATA_SS_SPD_MASK;
sys/dev/mvs/mvs.c
235
callout_drain(&ch->reset_timer);
sys/dev/mvs/mvs.c
2353
ch->user[ccb->ccb_h.target_id].caps;
sys/dev/mvs/mvs.c
236
bus_teardown_intr(dev, ch->r_irq, ch->ih);
sys/dev/mvs/mvs.c
2360
(ch->quirks & MVS_Q_GENIIE) == 0*/)
sys/dev/mvs/mvs.c
2368
cts->xport_specific.sata.pm_present = ch->pm_present;
sys/dev/mvs/mvs.c
237
bus_release_resource(dev, SYS_RES_IRQ, ATA_IRQ_RID, ch->r_irq);
sys/dev/mvs/mvs.c
2393
if (!(ch->quirks & MVS_Q_GENI)) {
sys/dev/mvs/mvs.c
2396
if ((ch->quirks & MVS_Q_GENIIE) || ch->pm_present == 0)
sys/dev/mvs/mvs.c
2402
if (!(ch->quirks & MVS_Q_GENI))
sys/dev/mvs/mvs.c
2419
if ((ch->quirks & MVS_Q_SOC) == 0) {
sys/dev/mvs/mvs.c
243
bus_release_resource(dev, SYS_RES_MEMORY, ch->unit, ch->r_mem);
sys/dev/mvs/mvs.c
2438
struct mvs_channel *ch = (struct mvs_channel *)cam_sim_softc(sim);
sys/dev/mvs/mvs.c
244
mtx_destroy(&ch->mtx);
sys/dev/mvs/mvs.c
2441
arg.arg = ch->dev;
sys/dev/mvs/mvs.c
2444
if (ch->resetting != 0 &&
sys/dev/mvs/mvs.c
2445
(--ch->resetpolldiv <= 0 || !callout_pending(&ch->reset_timer))) {
sys/dev/mvs/mvs.c
2446
ch->resetpolldiv = 1000;
sys/dev/mvs/mvs.c
2447
mvs_reset_to(ch->dev);
sys/dev/mvs/mvs.c
251
struct mvs_channel *ch = device_get_softc(dev);
sys/dev/mvs/mvs.c
255
ATA_OUTL(ch->r_mem, EDMA_IEM, 0);
sys/dev/mvs/mvs.c
257
ch->curr_mode = MVS_EDMA_UNKNOWN;
sys/dev/mvs/mvs.c
260
ATA_OUTL(ch->r_mem, SATA_FISIC, 0);
sys/dev/mvs/mvs.c
261
reg = ATA_INL(ch->r_mem, SATA_FISC);
sys/dev/mvs/mvs.c
263
ATA_OUTL(ch->r_mem, SATA_FISC, reg);
sys/dev/mvs/mvs.c
264
reg = ATA_INL(ch->r_mem, SATA_FISIM);
sys/dev/mvs/mvs.c
266
ATA_OUTL(ch->r_mem, SATA_FISC, reg);
sys/dev/mvs/mvs.c
268
ATA_OUTL(ch->r_mem, SATA_SE, 0xffffffff);
sys/dev/mvs/mvs.c
270
ATA_OUTL(ch->r_mem, EDMA_IEC, 0);
sys/dev/mvs/mvs.c
272
ATA_OUTL(ch->r_mem, EDMA_IEM, ~EDMA_IE_TRANSIENT);
sys/dev/mvs/mvs.c
279
struct mvs_channel *ch = device_get_softc(dev);
sys/dev/mvs/mvs.c
284
ATA_OUTL(ch->r_mem, EDMA_IEM, 0);
sys/dev/mvs/mvs.c
291
struct mvs_channel *ch = device_get_softc(dev);
sys/dev/mvs/mvs.c
293
mtx_lock(&ch->mtx);
sys/dev/mvs/mvs.c
294
xpt_freeze_simq(ch->sim, 1);
sys/dev/mvs/mvs.c
295
while (ch->oslots)
sys/dev/mvs/mvs.c
296
msleep(ch, &ch->mtx, PRIBIO, "mvssusp", hz/100);
sys/dev/mvs/mvs.c
298
if (ch->resetting) {
sys/dev/mvs/mvs.c
299
ch->resetting = 0;
sys/dev/mvs/mvs.c
300
callout_stop(&ch->reset_timer);
sys/dev/mvs/mvs.c
301
xpt_release_simq(ch->sim, TRUE);
sys/dev/mvs/mvs.c
304
mtx_unlock(&ch->mtx);
sys/dev/mvs/mvs.c
311
struct mvs_channel *ch = device_get_softc(dev);
sys/dev/mvs/mvs.c
313
mtx_lock(&ch->mtx);
sys/dev/mvs/mvs.c
316
xpt_release_simq(ch->sim, TRUE);
sys/dev/mvs/mvs.c
317
mtx_unlock(&ch->mtx);
sys/dev/mvs/mvs.c
329
struct mvs_channel *ch = device_get_softc(dev);
sys/dev/mvs/mvs.c
336
0, NULL, NULL, &ch->dma.workrq_tag))
sys/dev/mvs/mvs.c
338
if (bus_dmamem_alloc(ch->dma.workrq_tag, (void **)&ch->dma.workrq, 0,
sys/dev/mvs/mvs.c
339
&ch->dma.workrq_map))
sys/dev/mvs/mvs.c
341
if (bus_dmamap_load(ch->dma.workrq_tag, ch->dma.workrq_map,
sys/dev/mvs/mvs.c
342
ch->dma.workrq, MVS_WORKRQ_SIZE, mvs_dmasetupc_cb, &dcba, 0) ||
sys/dev/mvs/mvs.c
344
bus_dmamem_free(ch->dma.workrq_tag,
sys/dev/mvs/mvs.c
345
ch->dma.workrq, ch->dma.workrq_map);
sys/dev/mvs/mvs.c
348
ch->dma.workrq_bus = dcba.maddr;
sys/dev/mvs/mvs.c
353
0, NULL, NULL, &ch->dma.workrp_tag))
sys/dev/mvs/mvs.c
355
if (bus_dmamem_alloc(ch->dma.workrp_tag, (void **)&ch->dma.workrp, 0,
sys/dev/mvs/mvs.c
356
&ch->dma.workrp_map))
sys/dev/mvs/mvs.c
358
if (bus_dmamap_load(ch->dma.workrp_tag, ch->dma.workrp_map,
sys/dev/mvs/mvs.c
359
ch->dma.workrp, MVS_WORKRP_SIZE, mvs_dmasetupc_cb, &dcba, 0) ||
sys/dev/mvs/mvs.c
361
bus_dmamem_free(ch->dma.workrp_tag,
sys/dev/mvs/mvs.c
362
ch->dma.workrp, ch->dma.workrp_map);
sys/dev/mvs/mvs.c
365
ch->dma.workrp_bus = dcba.maddr;
sys/dev/mvs/mvs.c
371
0, busdma_lock_mutex, &ch->mtx, &ch->dma.data_tag)) {
sys/dev/mvs/mvs.c
393
struct mvs_channel *ch = device_get_softc(dev);
sys/dev/mvs/mvs.c
395
if (ch->dma.data_tag) {
sys/dev/mvs/mvs.c
396
bus_dma_tag_destroy(ch->dma.data_tag);
sys/dev/mvs/mvs.c
397
ch->dma.data_tag = NULL;
sys/dev/mvs/mvs.c
399
if (ch->dma.workrp_bus) {
sys/dev/mvs/mvs.c
400
bus_dmamap_unload(ch->dma.workrp_tag, ch->dma.workrp_map);
sys/dev/mvs/mvs.c
401
bus_dmamem_free(ch->dma.workrp_tag,
sys/dev/mvs/mvs.c
402
ch->dma.workrp, ch->dma.workrp_map);
sys/dev/mvs/mvs.c
403
ch->dma.workrp_bus = 0;
sys/dev/mvs/mvs.c
404
ch->dma.workrp = NULL;
sys/dev/mvs/mvs.c
406
if (ch->dma.workrp_tag) {
sys/dev/mvs/mvs.c
407
bus_dma_tag_destroy(ch->dma.workrp_tag);
sys/dev/mvs/mvs.c
408
ch->dma.workrp_tag = NULL;
sys/dev/mvs/mvs.c
410
if (ch->dma.workrq_bus) {
sys/dev/mvs/mvs.c
411
bus_dmamap_unload(ch->dma.workrq_tag, ch->dma.workrq_map);
sys/dev/mvs/mvs.c
412
bus_dmamem_free(ch->dma.workrq_tag,
sys/dev/mvs/mvs.c
413
ch->dma.workrq, ch->dma.workrq_map);
sys/dev/mvs/mvs.c
414
ch->dma.workrq_bus = 0;
sys/dev/mvs/mvs.c
415
ch->dma.workrq = NULL;
sys/dev/mvs/mvs.c
417
if (ch->dma.workrq_tag) {
sys/dev/mvs/mvs.c
418
bus_dma_tag_destroy(ch->dma.workrq_tag);
sys/dev/mvs/mvs.c
419
ch->dma.workrq_tag = NULL;
sys/dev/mvs/mvs.c
426
struct mvs_channel *ch = device_get_softc(dev);
sys/dev/mvs/mvs.c
430
bzero(ch->slot, sizeof(ch->slot));
sys/dev/mvs/mvs.c
432
struct mvs_slot *slot = &ch->slot[i];
sys/dev/mvs/mvs.c
439
callout_init_mtx(&slot->timeout, &ch->mtx, 0);
sys/dev/mvs/mvs.c
441
if (bus_dmamap_create(ch->dma.data_tag, 0, &slot->dma.data_map))
sys/dev/mvs/mvs.c
442
device_printf(ch->dev, "FAILURE - create data_map\n");
sys/dev/mvs/mvs.c
449
struct mvs_channel *ch = device_get_softc(dev);
sys/dev/mvs/mvs.c
454
struct mvs_slot *slot = &ch->slot[i];
sys/dev/mvs/mvs.c
458
bus_dmamap_destroy(ch->dma.data_tag, slot->dma.data_map);
sys/dev/mvs/mvs.c
467
struct mvs_channel *ch = device_get_softc(dev);
sys/dev/mvs/mvs.c
471
work = ch->dma.workrq_bus;
sys/dev/mvs/mvs.c
472
ATA_OUTL(ch->r_mem, EDMA_REQQBAH, work >> 32);
sys/dev/mvs/mvs.c
473
ATA_OUTL(ch->r_mem, EDMA_REQQIP, work & 0xffffffff);
sys/dev/mvs/mvs.c
474
ATA_OUTL(ch->r_mem, EDMA_REQQOP, work & 0xffffffff);
sys/dev/mvs/mvs.c
475
bus_dmamap_sync(ch->dma.workrq_tag, ch->dma.workrq_map,
sys/dev/mvs/mvs.c
478
memset(ch->dma.workrp, 0xff, MVS_WORKRP_SIZE);
sys/dev/mvs/mvs.c
479
work = ch->dma.workrp_bus;
sys/dev/mvs/mvs.c
480
ATA_OUTL(ch->r_mem, EDMA_RESQBAH, work >> 32);
sys/dev/mvs/mvs.c
481
ATA_OUTL(ch->r_mem, EDMA_RESQIP, work & 0xffffffff);
sys/dev/mvs/mvs.c
482
ATA_OUTL(ch->r_mem, EDMA_RESQOP, work & 0xffffffff);
sys/dev/mvs/mvs.c
483
bus_dmamap_sync(ch->dma.workrp_tag, ch->dma.workrp_map,
sys/dev/mvs/mvs.c
485
ch->out_idx = 0;
sys/dev/mvs/mvs.c
486
ch->in_idx = 0;
sys/dev/mvs/mvs.c
492
struct mvs_channel *ch = device_get_softc(dev);
sys/dev/mvs/mvs.c
496
if (mode == ch->curr_mode)
sys/dev/mvs/mvs.c
499
if (ch->curr_mode != MVS_EDMA_OFF) {
sys/dev/mvs/mvs.c
500
ATA_OUTL(ch->r_mem, EDMA_CMD, EDMA_CMD_EDSEDMA);
sys/dev/mvs/mvs.c
502
while (ATA_INL(ch->r_mem, EDMA_CMD) & EDMA_CMD_EENEDMA) {
sys/dev/mvs/mvs.c
510
ch->curr_mode = mode;
sys/dev/mvs/mvs.c
511
ch->fbs_enabled = 0;
sys/dev/mvs/mvs.c
512
ch->fake_busy = 0;
sys/dev/mvs/mvs.c
517
if (ch->pm_present) {
sys/dev/mvs/mvs.c
519
if (ch->quirks & MVS_Q_GENIIE) {
sys/dev/mvs/mvs.c
521
ch->fbs_enabled = 1;
sys/dev/mvs/mvs.c
524
if (ch->quirks & MVS_Q_GENI)
sys/dev/mvs/mvs.c
526
else if (ch->quirks & MVS_Q_GENII)
sys/dev/mvs/mvs.c
528
if (ch->quirks & MVS_Q_CT)
sys/dev/mvs/mvs.c
536
ATA_OUTL(ch->r_mem, EDMA_CFG, ecfg);
sys/dev/mvs/mvs.c
538
if (ch->quirks & MVS_Q_GENIIE) {
sys/dev/mvs/mvs.c
540
fcfg = ATA_INL(ch->r_mem, SATA_FISC);
sys/dev/mvs/mvs.c
541
ltm = ATA_INL(ch->r_mem, SATA_LTM);
sys/dev/mvs/mvs.c
542
hc = ATA_INL(ch->r_mem, EDMA_HC);
sys/dev/mvs/mvs.c
543
if (ch->fbs_enabled) {
sys/dev/mvs/mvs.c
559
ATA_OUTL(ch->r_mem, SATA_FISC, fcfg);
sys/dev/mvs/mvs.c
560
ATA_OUTL(ch->r_mem, SATA_LTM, ltm);
sys/dev/mvs/mvs.c
561
ATA_OUTL(ch->r_mem, EDMA_HC, hc);
sys/dev/mvs/mvs.c
564
unkn = ATA_INL(ch->r_mem, EDMA_UNKN_RESD);
sys/dev/mvs/mvs.c
569
ATA_OUTL(ch->r_mem, EDMA_UNKN_RESD, unkn);
sys/dev/mvs/mvs.c
573
ATA_OUTL(ch->r_mem, EDMA_CMD, EDMA_CMD_EENEDMA);
sys/dev/mvs/mvs.c
595
struct mvs_channel *ch = device_get_softc(dev);
sys/dev/mvs/mvs.c
597
if (ch->pm_level == 0) {
sys/dev/mvs/mvs.c
598
u_int32_t status = ATA_INL(ch->r_mem, SATA_SS);
sys/dev/mvs/mvs.c
613
cam_sim_path(ch->sim),
sys/dev/mvs/mvs.c
625
struct mvs_channel *ch = device_get_softc(dev);
sys/dev/mvs/mvs.c
631
fis = ATA_INL(ch->r_mem, SATA_FISDW0);
sys/dev/mvs/mvs.c
635
d = ch->pm_present ? 15 : 0;
sys/dev/mvs/mvs.c
639
xpt_path_path_id(ch->path), d, 0) == CAM_REQ_CMP) {
sys/dev/mvs/mvs.c
650
struct mvs_channel *ch = device_get_softc(dev);
sys/dev/mvs/mvs.c
652
mtx_lock(&ch->mtx);
sys/dev/mvs/mvs.c
654
mtx_unlock(&ch->mtx);
sys/dev/mvs/mvs.c
661
struct mvs_channel *ch = device_get_softc(dev);
sys/dev/mvs/mvs.c
664
if (ch->numrslots != 0)
sys/dev/mvs/mvs.c
667
work = ATA_INL(ch->r_mem, SATA_SC);
sys/dev/mvs/mvs.c
669
if (ch->pm_level == 4)
sys/dev/mvs/mvs.c
673
ATA_OUTL(ch->r_mem, SATA_SC, work);
sys/dev/mvs/mvs.c
679
struct mvs_channel *ch = device_get_softc(dev);
sys/dev/mvs/mvs.c
683
work = ATA_INL(ch->r_mem, SATA_SS);
sys/dev/mvs/mvs.c
687
work = ATA_INL(ch->r_mem, SATA_SC);
sys/dev/mvs/mvs.c
690
ATA_OUTL(ch->r_mem, SATA_SC, work);
sys/dev/mvs/mvs.c
692
while ((ATA_INL(ch->r_mem, SATA_SS) & SATA_SS_IPM_ACTIVE) == 0 &&
sys/dev/mvs/mvs.c
703
struct mvs_channel *ch = device_get_softc(dev);
sys/dev/mvs/mvs.c
707
int edma = (ch->numtslots != 0 || ch->numdslots != 0);
sys/dev/mvs/mvs.c
714
iec = ATA_INL(ch->r_mem, EDMA_IEC);
sys/dev/mvs/mvs.c
716
serr = ATA_INL(ch->r_mem, SATA_SE);
sys/dev/mvs/mvs.c
717
ATA_OUTL(ch->r_mem, SATA_SE, serr);
sys/dev/mvs/mvs.c
725
if (ch->quirks & MVS_Q_GENI)
sys/dev/mvs/mvs.c
728
else if (ch->quirks & MVS_Q_GENII)
sys/dev/mvs/mvs.c
73
static int mvs_sata_connect(struct mvs_channel *ch);
sys/dev/mvs/mvs.c
731
fisic = ATA_INL(ch->r_mem, SATA_FISIC);
sys/dev/mvs/mvs.c
734
ch->curr_mode = MVS_EDMA_UNKNOWN;
sys/dev/mvs/mvs.c
735
ATA_OUTL(ch->r_mem, EDMA_IEC, ~iec);
sys/dev/mvs/mvs.c
739
if (ch->numpslots != 0) {
sys/dev/mvs/mvs.c
742
if (ch->quirks & MVS_Q_GENIIE)
sys/dev/mvs/mvs.c
743
ccs = EDMA_S_EIOID(ATA_INL(ch->r_mem, EDMA_S));
sys/dev/mvs/mvs.c
745
ccs = EDMA_S_EDEVQUETAG(ATA_INL(ch->r_mem, EDMA_S));
sys/dev/mvs/mvs.c
747
if (ch->fbs_enabled) {
sys/dev/mvs/mvs.c
750
if (ch->numrslotspd[i] == 0)
sys/dev/mvs/mvs.c
763
uint16_t p = ATA_INL(ch->r_mem, SATA_SATAITC) >> 16;
sys/dev/mvs/mvs.c
773
if (((ch->rslots >> i) & 1) == 0)
sys/dev/mvs/mvs.c
776
ch->slot[i].ccb->ccb_h.target_id != port)
sys/dev/mvs/mvs.c
780
if (ch->numtslots == 0) {
sys/dev/mvs/mvs.c
792
ch->fatalerr = 1;
sys/dev/mvs/mvs.c
795
if (ch->numtslots == 0 &&
sys/dev/mvs/mvs.c
802
mvs_end_transaction(&ch->slot[i], et);
sys/dev/mvs/mvs.c
809
ATA_OUTL(ch->r_mem, SATA_FISIC, ~fisic);
sys/dev/mvs/mvs.c
823
struct mvs_channel *ch = device_get_softc(dev);
sys/dev/mvs/mvs.c
824
uint8_t status = ATA_INB(ch->r_mem, clear ? ATA_STATUS : ATA_ALTSTAT);
sys/dev/mvs/mvs.c
826
if (ch->fake_busy) {
sys/dev/mvs/mvs.c
828
ch->fake_busy = 0;
sys/dev/mvs/mvs.c
838
struct mvs_channel *ch = device_get_softc(dev);
sys/dev/mvs/mvs.c
839
struct mvs_slot *slot = &ch->slot[0]; /* PIO is always in slot 0. */
sys/dev/mvs/mvs.c
875
xpt_freeze_simq(ch->sim, 1);
sys/dev/mvs/mvs.c
876
ch->toslots |= (1 << slot->slot);
sys/dev/mvs/mvs.c
879
ATA_INSW_STRM(ch->r_mem, ATA_DATA,
sys/dev/mvs/mvs.c
880
(uint16_t *)(ccb->ataio.data_ptr + ch->donecount),
sys/dev/mvs/mvs.c
881
ch->transfersize / 2);
sys/dev/mvs/mvs.c
884
ch->donecount += ch->transfersize;
sys/dev/mvs/mvs.c
886
if (ccb->ataio.dxfer_len > ch->donecount) {
sys/dev/mvs/mvs.c
888
ch->transfersize = min(ccb->ataio.dxfer_len - ch->donecount,
sys/dev/mvs/mvs.c
889
ch->transfersize);
sys/dev/mvs/mvs.c
896
xpt_freeze_simq(ch->sim, 1);
sys/dev/mvs/mvs.c
897
ch->toslots |= (1 << slot->slot);
sys/dev/mvs/mvs.c
900
ATA_OUTSW_STRM(ch->r_mem, ATA_DATA,
sys/dev/mvs/mvs.c
901
(uint16_t *)(ccb->ataio.data_ptr + ch->donecount),
sys/dev/mvs/mvs.c
902
ch->transfersize / 2);
sys/dev/mvs/mvs.c
910
} else if (ch->basic_dma) { /* ATAPI DMA */
sys/dev/mvs/mvs.c
913
else if (ATA_INL(ch->r_mem, DMA_S) & DMA_S_ERR)
sys/dev/mvs/mvs.c
916
ATA_OUTL(ch->r_mem, DMA_C, 0);
sys/dev/mvs/mvs.c
919
length = ATA_INB(ch->r_mem,ATA_CYL_LSB) |
sys/dev/mvs/mvs.c
920
(ATA_INB(ch->r_mem,ATA_CYL_MSB) << 8);
sys/dev/mvs/mvs.c
921
size = min(ch->transfersize, length);
sys/dev/mvs/mvs.c
922
ireason = ATA_INB(ch->r_mem,ATA_IREASON);
sys/dev/mvs/mvs.c
937
ATA_OUTSW_STRM(ch->r_mem, ATA_DATA,
sys/dev/mvs/mvs.c
938
(uint16_t *)(ccb->csio.data_ptr + ch->donecount),
sys/dev/mvs/mvs.c
940
for (resid = ch->transfersize + (size & 1);
sys/dev/mvs/mvs.c
942
ATA_OUTW(ch->r_mem, ATA_DATA, 0);
sys/dev/mvs/mvs.c
943
ch->donecount += length;
sys/dev/mvs/mvs.c
945
ch->transfersize = min(ccb->csio.dxfer_len - ch->donecount,
sys/dev/mvs/mvs.c
946
ch->curr[ccb->ccb_h.target_id].bytecount);
sys/dev/mvs/mvs.c
957
ATA_INSW_STRM(ch->r_mem, ATA_DATA,
sys/dev/mvs/mvs.c
958
(uint16_t *)(ccb->csio.data_ptr + ch->donecount),
sys/dev/mvs/mvs.c
962
ATA_INSW_STRM(ch->r_mem, ATA_DATA, (void*)buf, 1);
sys/dev/mvs/mvs.c
963
((uint8_t *)ccb->csio.data_ptr + ch->donecount +
sys/dev/mvs/mvs.c
966
for (resid = ch->transfersize + (size & 1);
sys/dev/mvs/mvs.c
968
ATA_INW(ch->r_mem, ATA_DATA);
sys/dev/mvs/mvs.c
969
ch->donecount += length;
sys/dev/mvs/mvs.c
971
ch->transfersize = min(ccb->csio.dxfer_len - ch->donecount,
sys/dev/mvs/mvs.c
972
ch->curr[ccb->ccb_h.target_id].bytecount);
sys/dev/mvs/mvs.c
980
ATA_INSW_STRM(ch->r_mem, ATA_DATA,
sys/dev/mvs/mvs.c
981
(uint16_t *)(ccb->csio.data_ptr + ch->donecount),
sys/dev/mvs/mvs.c
983
ch->donecount += length;
sys/dev/mvs/mvs.c
986
ATA_OUTSW_STRM(ch->r_mem, ATA_DATA,
sys/dev/mvs/mvs.c
987
(uint16_t *)(ccb->csio.data_ptr + ch->donecount),
sys/dev/mvs/mvs.c
989
ch->donecount += length;
sys/dev/mwl/if_mwl.c
2443
CVT(mi->ch[0].rssi[0], mn->mn_ai.rssi_a);
sys/dev/mwl/if_mwl.c
2444
CVT(mi->ch[1].rssi[0], mn->mn_ai.rssi_b);
sys/dev/mwl/if_mwl.c
2445
CVT(mi->ch[2].rssi[0], mn->mn_ai.rssi_c);
sys/dev/mwl/if_mwl.c
2447
mi->ch[0].noise[0] = mn->mn_ai.nf_a;
sys/dev/mwl/if_mwl.c
2448
mi->ch[1].noise[0] = mn->mn_ai.nf_b;
sys/dev/mwl/if_mwl.c
2449
mi->ch[2].noise[0] = mn->mn_ai.nf_c;
sys/dev/nvmf/nvmf_tcp.c
1050
const struct nvme_tcp_common_pdu_hdr *ch, struct nvmf_tcp_rxpdu *pdu)
sys/dev/nvmf/nvmf_tcp.c
1053
pdu->m = pullup_pdu_hdr(pdu->m, ch->hlen);
sys/dev/nvmf/nvmf_tcp.c
1056
switch (ch->pdu_type) {
sys/dev/nvmf/nvmf_tcp.c
1082
struct nvme_tcp_common_pdu_hdr ch;
sys/dev/nvmf/nvmf_tcp.c
1118
if (avail == 0 || (!have_header && avail < sizeof(ch))) {
sys/dev/nvmf/nvmf_tcp.c
1128
iov[0].iov_base = &ch;
sys/dev/nvmf/nvmf_tcp.c
1129
iov[0].iov_len = sizeof(ch);
sys/dev/nvmf/nvmf_tcp.c
1132
uio.uio_resid = sizeof(ch);
sys/dev/nvmf/nvmf_tcp.c
1144
needed = le32toh(ch.plen);
sys/dev/nvmf/nvmf_tcp.c
1151
if (needed < sizeof(ch) || ch.hlen > needed)
sys/dev/nvmf/nvmf_tcp.c
1152
needed = sizeof(ch);
sys/dev/nvmf/nvmf_tcp.c
1182
pdu.hdr = &ch;
sys/dev/nvmf/nvmf_tcp.c
1187
error = nvmf_tcp_dispatch_pdu(qp, &ch, &pdu);
sys/dev/nvmf/nvmf_tcp.c
308
const struct nvme_tcp_common_pdu_hdr *ch;
sys/dev/nvmf/nvmf_tcp.c
317
ch = pdu->hdr;
sys/dev/nvmf/nvmf_tcp.c
318
hlen = ch->hlen;
sys/dev/nvmf/nvmf_tcp.c
319
plen = le32toh(ch->plen);
sys/dev/nvmf/nvmf_tcp.c
320
if (hlen < sizeof(*ch) || hlen > plen)
sys/dev/nvmf/nvmf_tcp.c
321
hlen = sizeof(*ch);
sys/dev/nvmf/nvmf_tcp.c
323
error = nvmf_tcp_validate_pdu_header(ch, qp->qp.nq_controller,
sys/dev/nvmf/nvmf_tcp.c
333
if ((ch->flags & NVME_TCP_CH_FLAGS_HDGSTF) != 0) {
sys/dev/nvmf/nvmf_tcp.c
334
digest = mbuf_crc32c(m, 0, ch->hlen);
sys/dev/nvmf/nvmf_tcp.c
335
m_copydata(m, ch->hlen, sizeof(rx_digest), (caddr_t)&rx_digest);
sys/dev/nvmf/nvmf_tcp.c
347
if ((ch->flags & NVME_TCP_CH_FLAGS_DDGSTF) != 0) {
sys/dev/nvmf/nvmf_tcp.c
348
digest = mbuf_crc32c(m, ch->pdo, data_len);
sys/dev/nvmf/nvmf_tcp.c
437
struct nvme_tcp_common_pdu_hdr *ch;
sys/dev/nvmf/nvmf_tcp.c
461
ch = mtod(top, void *);
sys/dev/nvmf/nvmf_tcp.c
462
memcpy(ch, hdr, hlen);
sys/dev/nvmf/nvmf_tcp.c
463
ch->hlen = hlen;
sys/dev/nvmf/nvmf_tcp.c
465
ch->flags |= NVME_TCP_CH_FLAGS_HDGSTF;
sys/dev/nvmf/nvmf_tcp.c
467
ch->flags |= NVME_TCP_CH_FLAGS_DDGSTF;
sys/dev/nvmf/nvmf_tcp.c
468
ch->pdo = pdo;
sys/dev/nvmf/nvmf_tcp.c
469
ch->plen = htole32(plen);
sys/dev/nvmf/nvmf_tcp.c
473
digest = compute_digest(ch, hlen);
sys/dev/nvmf/nvmf_tcp.c
474
memcpy((char *)ch + hlen, &digest, sizeof(digest));
sys/dev/nvmf/nvmf_tcp.c
479
memset((char *)ch + pdo - pad, 0, pad);
sys/dev/nvmf/nvmf_tcp.h
101
switch (ch->pdu_type) {
sys/dev/nvmf/nvmf_tcp.h
127
if ((ch->flags & ~valid_flags) != 0) {
sys/dev/nvmf/nvmf_tcp.h
128
printf("NVMe/TCP: Invalid PDU header flags %#x\n", ch->flags);
sys/dev/nvmf/nvmf_tcp.h
145
(ch->flags & (NVME_TCP_CH_FLAGS_HDGSTF |
sys/dev/nvmf/nvmf_tcp.h
147
printf("NVMe/TCP: Invalid PDU header flags %#x\n", ch->flags);
sys/dev/nvmf/nvmf_tcp.h
154
if (ch->pdu_type == NVME_TCP_PDU_TYPE_C2H_DATA &&
sys/dev/nvmf/nvmf_tcp.h
155
(ch->flags & (NVME_TCP_C2H_DATA_FLAGS_LAST_PDU |
sys/dev/nvmf/nvmf_tcp.h
158
printf("NVMe/TCP: Invalid PDU header flags %#x\n", ch->flags);
sys/dev/nvmf/nvmf_tcp.h
165
switch (ch->pdu_type) {
sys/dev/nvmf/nvmf_tcp.h
189
if (ch->hlen != expected_hlen) {
sys/dev/nvmf/nvmf_tcp.h
190
printf("NVMe/TCP: Invalid PDU header length %u\n", ch->hlen);
sys/dev/nvmf/nvmf_tcp.h
197
switch (ch->pdu_type) {
sys/dev/nvmf/nvmf_tcp.h
205
if (ch->pdo != 0) {
sys/dev/nvmf/nvmf_tcp.h
207
ch->pdo);
sys/dev/nvmf/nvmf_tcp.h
217
if (data_len == 0 && ch->pdo == 0)
sys/dev/nvmf/nvmf_tcp.h
220
if (ch->pdo < full_hlen || ch->pdo > plen ||
sys/dev/nvmf/nvmf_tcp.h
221
ch->pdo % rxpda != 0) {
sys/dev/nvmf/nvmf_tcp.h
223
ch->pdo);
sys/dev/nvmf/nvmf_tcp.h
232
if (plen < ch->hlen) {
sys/dev/nvmf/nvmf_tcp.h
239
switch (ch->pdu_type) {
sys/dev/nvmf/nvmf_tcp.h
251
if ((ch->flags & NVME_TCP_CH_FLAGS_DDGSTF) != 0 &&
sys/dev/nvmf/nvmf_tcp.h
254
ch->pdu_type);
sys/dev/nvmf/nvmf_tcp.h
264
ch->pdu_type, data_len);
sys/dev/nvmf/nvmf_tcp.h
272
if ((ch->flags & NVME_TCP_CH_FLAGS_DDGSTF) != 0)
sys/dev/nvmf/nvmf_tcp.h
34
nvmf_tcp_validate_pdu_header(const struct nvme_tcp_common_pdu_hdr *ch,
sys/dev/nvmf/nvmf_tcp.h
42
plen = le32toh(ch->plen);
sys/dev/nvmf/nvmf_tcp.h
43
full_hlen = ch->hlen;
sys/dev/nvmf/nvmf_tcp.h
44
if ((ch->flags & NVME_TCP_CH_FLAGS_HDGSTF) != 0)
sys/dev/nvmf/nvmf_tcp.h
49
data_len = plen - ch->pdo;
sys/dev/nvmf/nvmf_tcp.h
59
if (controller != ((ch->pdu_type & 0x01) == 0)) {
sys/dev/nvmf/nvmf_tcp.h
60
printf("NVMe/TCP: Invalid PDU type %u\n", ch->pdu_type);
sys/dev/nvmf/nvmf_tcp.h
66
switch (ch->pdu_type) {
sys/dev/nvmf/nvmf_tcp.h
94
printf("NVMe/TCP: Invalid PDU type %u\n", ch->pdu_type);
sys/dev/ofw/ofw_console.c
210
unsigned char ch;
sys/dev/ofw/ofw_console.c
212
if (OF_read(stdin, &ch, 1) > 0) {
sys/dev/ofw/ofw_console.c
214
kdb_alt_break(ch, &alt_break_state);
sys/dev/ofw/ofw_console.c
216
return (ch);
sys/dev/ppbus/lpt.c
656
char ch;
sys/dev/ppbus/lpt.c
663
ch = *(sc->sc_cp);
sys/dev/ppbus/lpt.c
696
ppb_wdtr(ppbus, ch);
sys/dev/qat/qat_common/qat_uclo.c
540
qat_uclo_calc_checksum(unsigned int reg, int ch)
sys/dev/qat/qat_common/qat_uclo.c
544
unsigned int inbyte = (unsigned int)((reg >> 0x18) ^ ch);
sys/dev/qat_c2xxx/qat_ae.c
1781
qat_aefw_csum_calc(u_int reg, int ch)
sys/dev/qat_c2xxx/qat_ae.c
1785
u_int inbyte = (u_int)((reg >> 0x18) ^ ch);
sys/dev/scc/scc_core.c
100
struct scc_chan *ch;
sys/dev/scc/scc_core.c
146
ch = &sc->sc_chan[c];
sys/dev/scc/scc_core.c
154
ch->ch_irid = c * ipc;
sys/dev/scc/scc_core.c
155
ch->ch_ires = bus_alloc_resource_any(dev, SYS_RES_IRQ,
sys/dev/scc/scc_core.c
156
&ch->ch_irid, RF_ACTIVE | RF_SHAREABLE);
sys/dev/scc/scc_core.c
170
ch = &sc->sc_chan[c];
sys/dev/scc/scc_core.c
171
resource_list_init(&ch->ch_rlist);
sys/dev/scc/scc_core.c
172
ch->ch_nr = c + 1;
sys/dev/scc/scc_core.c
174
if (!SCC_ENABLED(sc, ch))
sys/dev/scc/scc_core.c
177
ch->ch_enabled = 1;
sys/dev/scc/scc_core.c
178
resource_list_add(&ch->ch_rlist, sc->sc_rtype, 0, start,
sys/dev/scc/scc_core.c
180
rle = resource_list_find(&ch->ch_rlist, sc->sc_rtype, 0);
sys/dev/scc/scc_core.c
181
rle->res = &ch->ch_rres;
sys/dev/scc/scc_core.c
187
resource_list_add(&ch->ch_rlist, SYS_RES_IRQ, 0, c, c, 1);
sys/dev/scc/scc_core.c
188
rle = resource_list_find(&ch->ch_rlist, SYS_RES_IRQ, 0);
sys/dev/scc/scc_core.c
189
rle->res = (ch->ch_ires != NULL) ? ch->ch_ires :
sys/dev/scc/scc_core.c
193
m = &ch->ch_mode[mode];
sys/dev/scc/scc_core.c
194
m->m_chan = ch;
sys/dev/scc/scc_core.c
196
if ((cl->cl_modes & m->m_mode) == 0 || ch->ch_sysdev)
sys/dev/scc/scc_core.c
204
ch->ch_sysdev |= m->m_sysdev;
sys/dev/scc/scc_core.c
210
sysdev |= ch->ch_sysdev;
sys/dev/scc/scc_core.c
233
ch = &sc->sc_chan[c];
sys/dev/scc/scc_core.c
234
if (ch->ch_ires == NULL)
sys/dev/scc/scc_core.c
236
error = bus_setup_intr(dev, ch->ch_ires,
sys/dev/scc/scc_core.c
238
&ch->ch_icookie);
sys/dev/scc/scc_core.c
240
error = bus_setup_intr(dev, ch->ch_ires,
sys/dev/scc/scc_core.c
242
(driver_intr_t *)scc_bfe_intr, sc, &ch->ch_icookie);
sys/dev/scc/scc_core.c
248
bus_release_resource(dev, SYS_RES_IRQ, ch->ch_irid,
sys/dev/scc/scc_core.c
249
ch->ch_ires);
sys/dev/scc/scc_core.c
250
ch->ch_ires = NULL;
sys/dev/scc/scc_core.c
263
ch = &sc->sc_chan[c];
sys/dev/scc/scc_core.c
265
m = &ch->ch_mode[mode];
sys/dev/scc/scc_core.c
293
ch = &sc->sc_chan[c];
sys/dev/scc/scc_core.c
294
if (ch->ch_ires == NULL)
sys/dev/scc/scc_core.c
296
bus_release_resource(dev, SYS_RES_IRQ, ch->ch_irid,
sys/dev/scc/scc_core.c
297
ch->ch_ires);
sys/dev/scc/scc_core.c
306
struct scc_chan *ch;
sys/dev/scc/scc_core.c
318
ch = &sc->sc_chan[chan];
sys/dev/scc/scc_core.c
320
m = &ch->ch_mode[mode];
sys/dev/scc/scc_core.c
334
ch = &sc->sc_chan[chan];
sys/dev/scc/scc_core.c
335
if (ch->ch_ires == NULL)
sys/dev/scc/scc_core.c
337
bus_teardown_intr(dev, ch->ch_ires, ch->ch_icookie);
sys/dev/scc/scc_core.c
338
bus_release_resource(dev, SYS_RES_IRQ, ch->ch_irid,
sys/dev/scc/scc_core.c
339
ch->ch_ires);
sys/dev/scc/scc_core.c
413
struct scc_chan *ch;
sys/dev/scc/scc_core.c
424
ch = m->m_chan;
sys/dev/scc/scc_core.c
425
rle = resource_list_find(&ch->ch_rlist, type, 0);
sys/dev/scc/scc_core.c
436
struct scc_chan *ch;
sys/dev/scc/scc_core.c
443
ch = m->m_chan;
sys/dev/scc/scc_core.c
444
rle = resource_list_find(&ch->ch_rlist, type, rid);
sys/dev/scc/scc_core.c
458
struct scc_chan *ch;
sys/dev/scc/scc_core.c
469
ch = m->m_chan;
sys/dev/scc/scc_core.c
473
*result = ch->ch_nr;
sys/dev/scc/scc_core.c
500
struct scc_chan *ch;
sys/dev/scc/scc_core.c
507
ch = m->m_chan;
sys/dev/scc/scc_core.c
508
rle = resource_list_find(&ch->ch_rlist, rman_get_type(res),
sys/dev/scc/scc_core.c
517
struct scc_chan *ch;
sys/dev/scc/scc_core.c
536
ch = &sc->sc_chan[c];
sys/dev/scc/scc_core.c
537
if (ch->ch_ires == NULL)
sys/dev/scc/scc_core.c
539
bus_teardown_intr(dev, ch->ch_ires, ch->ch_icookie);
sys/dev/scc/scc_core.c
540
bus_setup_intr(dev, ch->ch_ires,
sys/dev/scc/scc_core.c
542
(driver_intr_t *)scc_bfe_intr, sc, &ch->ch_icookie);
sys/dev/scc/scc_core.c
57
struct scc_chan *ch;
sys/dev/scc/scc_core.c
71
ch = &sc->sc_chan[c];
sys/dev/scc/scc_core.c
72
if (!(ch->ch_ipend & isrc))
sys/dev/scc/scc_core.c
74
m = &ch->ch_mode[0];
sys/dev/scc/scc_core.c
78
ch->ch_ipend &= ~isrc;
sys/dev/scc/scc_core.c
82
ch = &sc->sc_chan[c];
sys/dev/scc/scc_core.c
83
if (!ch->ch_ipend)
sys/dev/scc/scc_core.c
85
m = &ch->ch_mode[0];
sys/dev/scc/scc_core.c
89
SCC_ICLEAR(sc, ch);
sys/dev/scc/scc_dev_quicc.c
105
quicc_bfe_iclear(struct scc_softc *sc, struct scc_chan *ch)
sys/dev/scc/scc_dev_quicc.c
112
if (ch->ch_ipend & SER_INT_RXREADY) {
sys/dev/scc/scc_dev_quicc.c
113
rb = quicc_read2(bas, QUICC_PRAM_SCC_RBASE(ch->ch_nr - 1));
sys/dev/scc/scc_dev_quicc.c
126
struct scc_chan *ch;
sys/dev/scc/scc_dev_quicc.c
133
ch = &sc->sc_chan[c];
sys/dev/scc/scc_dev_quicc.c
134
if (!ch->ch_enabled)
sys/dev/scc/scc_dev_quicc.c
136
ch->ch_ipend = 0;
sys/dev/scc/scc_dev_quicc.c
142
ch->ch_ipend |= SER_INT_RXREADY;
sys/dev/scc/scc_dev_quicc.c
144
ch->ch_ipend |= SER_INT_TXIDLE;
sys/dev/scc/scc_dev_quicc.c
146
ch->ch_ipend |= SER_INT_OVERRUN;
sys/dev/scc/scc_dev_quicc.c
148
ch->ch_ipend |= SER_INT_BREAK;
sys/dev/scc/scc_dev_quicc.c
150
ipend |= ch->ch_ipend;
sys/dev/scc/scc_dev_quicc.c
89
quicc_bfe_enabled(struct scc_softc *sc, struct scc_chan *ch)
sys/dev/scc/scc_dev_quicc.c
96
unit = ch->ch_nr - 1;
sys/dev/scc/scc_dev_z8530.c
109
z8530_bfe_iclear(struct scc_softc *sc, struct scc_chan *ch)
sys/dev/scc/scc_dev_z8530.c
115
c = (ch->ch_nr == 1) ? CHAN_A : CHAN_B;
sys/dev/scc/scc_dev_z8530.c
117
if (ch->ch_ipend & SER_INT_TXIDLE) {
sys/dev/scc/scc_dev_z8530.c
121
if (ch->ch_ipend & SER_INT_RXREADY) {
sys/dev/scc/scc_dev_z8530.c
125
if (ch->ch_ipend & (SER_INT_OVERRUN|SER_INT_BREAK))
sys/dev/scc/scc_dev_z8530.c
142
struct scc_chan *ch[2];
sys/dev/scc/scc_dev_z8530.c
147
ch[0] = &sc->sc_chan[0];
sys/dev/scc/scc_dev_z8530.c
148
ch[1] = &sc->sc_chan[1];
sys/dev/scc/scc_dev_z8530.c
149
ch[0]->ch_ipend = 0;
sys/dev/scc/scc_dev_z8530.c
150
ch[1]->ch_ipend = 0;
sys/dev/scc/scc_dev_z8530.c
155
ch[0]->ch_ipend |= SER_INT_RXREADY;
sys/dev/scc/scc_dev_z8530.c
157
ch[1]->ch_ipend |= SER_INT_RXREADY;
sys/dev/scc/scc_dev_z8530.c
159
ch[0]->ch_ipend |= SER_INT_TXIDLE;
sys/dev/scc/scc_dev_z8530.c
161
ch[1]->ch_ipend |= SER_INT_TXIDLE;
sys/dev/scc/scc_dev_z8530.c
165
ch[0]->ch_ipend |= SER_INT_BREAK;
sys/dev/scc/scc_dev_z8530.c
166
sig = ch[0]->ch_hwsig;
sys/dev/scc/scc_dev_z8530.c
171
ch[0]->ch_hwsig = sig;
sys/dev/scc/scc_dev_z8530.c
172
ch[0]->ch_ipend |= SER_INT_SIGCHG;
sys/dev/scc/scc_dev_z8530.c
176
ch[0]->ch_ipend |= SER_INT_OVERRUN;
sys/dev/scc/scc_dev_z8530.c
181
ch[1]->ch_ipend |= SER_INT_BREAK;
sys/dev/scc/scc_dev_z8530.c
182
sig = ch[1]->ch_hwsig;
sys/dev/scc/scc_dev_z8530.c
187
ch[1]->ch_hwsig = sig;
sys/dev/scc/scc_dev_z8530.c
188
ch[1]->ch_ipend |= SER_INT_SIGCHG;
sys/dev/scc/scc_dev_z8530.c
192
ch[1]->ch_ipend |= SER_INT_OVERRUN;
sys/dev/scc/scc_dev_z8530.c
196
return (ch[0]->ch_ipend | ch[1]->ch_ipend);
sys/dev/scc/scc_dev_z8530.c
93
scc_getmreg(struct scc_bas *bas, int ch, int reg)
sys/dev/scc/scc_dev_z8530.c
96
scc_setreg(bas, ch + REG_CTRL, reg);
sys/dev/scc/scc_dev_z8530.c
98
return (scc_getreg(bas, ch + REG_CTRL));
sys/dev/sdio/sdiob.c
668
uint8_t ch, tuple_id, tuple_len, tuple_count, v;
sys/dev/sdio/sdiob.c
702
ret = sdio_read_direct_sc(sc, 0, addr + i, &ch);
sys/dev/sdio/sdiob.c
705
"(%#02x)\n", __func__, count, start, i, ch);
sys/dev/sdio/sdiob.c
706
if (ch == 0xff)
sys/dev/sdio/sdiob.c
708
cis1_info_buf[i] = ch;
sys/dev/sdio/sdiob.c
709
if (ch == 0) {
sys/dev/siis/siis.c
1002
ch->aslots |= (1 << slot->slot);
sys/dev/siis/siis.c
1007
bus_dmamap_load_ccb(ch->dma.data_tag, slot->dma.data_map,
sys/dev/siis/siis.c
1018
struct siis_channel *ch = device_get_softc(slot->dev);
sys/dev/siis/siis.c
1023
mtx_assert(&ch->mtx, MA_OWNED);
sys/dev/siis/siis.c
1026
if (!ch->recoverycmd)
sys/dev/siis/siis.c
1027
xpt_freeze_simq(ch->sim, 1);
sys/dev/siis/siis.c
1035
ctp = (struct siis_cmd *)(ch->dma.work + slot->prb_offset);
sys/dev/siis/siis.c
1047
bus_dmamap_sync(ch->dma.data_tag, slot->dma.data_map,
sys/dev/siis/siis.c
1059
struct siis_channel *ch = device_get_softc(dev);
sys/dev/siis/siis.c
1064
mtx_assert(&ch->mtx, MA_OWNED);
sys/dev/siis/siis.c
1066
ctp = (struct siis_cmd *)(ch->dma.work + slot->prb_offset);
sys/dev/siis/siis.c
1105
device_printf(ch->dev, "Setting up SATA FIS failed\n");
sys/dev/siis/siis.c
1106
if (!ch->recoverycmd)
sys/dev/siis/siis.c
1107
xpt_freeze_simq(ch->sim, 1);
sys/dev/siis/siis.c
1111
bus_dmamap_sync(ch->dma.work_tag, ch->dma.work_map,
sys/dev/siis/siis.c
1115
ch->rslots |= (1 << slot->slot);
sys/dev/siis/siis.c
1116
prb_bus = ch->dma.work_bus + slot->prb_offset;
sys/dev/siis/siis.c
1117
ATA_OUTL(ch->r_mem, SIIS_P_CACTL(slot->slot), prb_bus);
sys/dev/siis/siis.c
1118
ATA_OUTL(ch->r_mem, SIIS_P_CACTH(slot->slot), prb_bus >> 32);
sys/dev/siis/siis.c
1129
struct siis_channel *ch = device_get_softc(dev);
sys/dev/siis/siis.c
1132
mtx_assert(&ch->mtx, MA_OWNED);
sys/dev/siis/siis.c
1133
if (!ch->recoverycmd && !ch->recovery) {
sys/dev/siis/siis.c
1134
xpt_freeze_simq(ch->sim, ch->numrslots);
sys/dev/siis/siis.c
1135
ch->recovery = 1;
sys/dev/siis/siis.c
1140
if (ch->slot[i].state < SIIS_SLOT_RUNNING)
sys/dev/siis/siis.c
1142
siis_end_transaction(&ch->slot[i], SIIS_ERR_TIMEOUT);
sys/dev/siis/siis.c
1150
struct siis_channel *ch = device_get_softc(dev);
sys/dev/siis/siis.c
1153
mtx_assert(&ch->mtx, MA_OWNED);
sys/dev/siis/siis.c
1155
struct siis_slot *slot = &ch->slot[i];
sys/dev/siis/siis.c
1160
if ((ch->toslots & (1 << i)) == 0)
sys/dev/siis/siis.c
1174
struct siis_channel *ch = device_get_softc(dev);
sys/dev/siis/siis.c
1177
mtx_assert(&ch->mtx, MA_OWNED);
sys/dev/siis/siis.c
1186
xpt_freeze_simq(ch->sim, ch->numrslots);
sys/dev/siis/siis.c
1193
__func__, ATA_INL(ch->r_mem, SIIS_P_IS),
sys/dev/siis/siis.c
1194
ATA_INL(ch->r_mem, SIIS_P_SS), ch->rslots,
sys/dev/siis/siis.c
1195
ATA_INL(ch->r_mem, SIIS_P_CMDERR), ATA_INL(ch->r_mem, SIIS_P_STS),
sys/dev/siis/siis.c
1196
ATA_INL(ch->r_mem, SIIS_P_SERR));
sys/dev/siis/siis.c
1198
if (ch->toslots == 0)
sys/dev/siis/siis.c
1199
xpt_freeze_simq(ch->sim, 1);
sys/dev/siis/siis.c
1200
ch->toslots |= (1 << slot->slot);
sys/dev/siis/siis.c
1201
if ((ch->rslots & ~ch->toslots) == 0)
sys/dev/siis/siis.c
1205
ch->rslots & ~ch->toslots);
sys/dev/siis/siis.c
1213
struct siis_channel *ch = device_get_softc(dev);
sys/dev/siis/siis.c
1217
mtx_assert(&ch->mtx, MA_OWNED);
sys/dev/siis/siis.c
1218
bus_dmamap_sync(ch->dma.work_tag, ch->dma.work_map,
sys/dev/siis/siis.c
1230
res->status = ATA_INB(ch->r_mem, offs + 2);
sys/dev/siis/siis.c
1231
res->error = ATA_INB(ch->r_mem, offs + 3);
sys/dev/siis/siis.c
1232
res->lba_low = ATA_INB(ch->r_mem, offs + 4);
sys/dev/siis/siis.c
1233
res->lba_mid = ATA_INB(ch->r_mem, offs + 5);
sys/dev/siis/siis.c
1234
res->lba_high = ATA_INB(ch->r_mem, offs + 6);
sys/dev/siis/siis.c
1235
res->device = ATA_INB(ch->r_mem, offs + 7);
sys/dev/siis/siis.c
1236
res->lba_low_exp = ATA_INB(ch->r_mem, offs + 8);
sys/dev/siis/siis.c
1237
res->lba_mid_exp = ATA_INB(ch->r_mem, offs + 9);
sys/dev/siis/siis.c
1238
res->lba_high_exp = ATA_INB(ch->r_mem, offs + 10);
sys/dev/siis/siis.c
1239
res->sector_count = ATA_INB(ch->r_mem, offs + 12);
sys/dev/siis/siis.c
1240
res->sector_count_exp = ATA_INB(ch->r_mem, offs + 13);
sys/dev/siis/siis.c
1244
ch->numrslots == 1) {
sys/dev/siis/siis.c
1246
ATA_INL(ch->r_mem, SIIS_P_LRAM_SLOT(slot->slot) + 4);
sys/dev/siis/siis.c
1250
ch->numrslots == 1) {
sys/dev/siis/siis.c
1252
ATA_INL(ch->r_mem, SIIS_P_LRAM_SLOT(slot->slot) + 4);
sys/dev/siis/siis.c
1256
bus_dmamap_sync(ch->dma.data_tag, slot->dma.data_map,
sys/dev/siis/siis.c
1259
bus_dmamap_unload(ch->dma.data_tag, slot->dma.data_map);
sys/dev/siis/siis.c
1262
if (et != SIIS_ERR_NONE || ch->recovery) {
sys/dev/siis/siis.c
1263
ch->eslots |= (1 << slot->slot);
sys/dev/siis/siis.c
1267
if (et != SIIS_ERR_NONE && (!ch->recoverycmd) &&
sys/dev/siis/siis.c
1280
ch->fatalerr = 1;
sys/dev/siis/siis.c
1296
ch->fatalerr = 1;
sys/dev/siis/siis.c
1300
ch->fatalerr = 1;
sys/dev/siis/siis.c
1307
ch->oslots &= ~(1 << slot->slot);
sys/dev/siis/siis.c
1308
ch->rslots &= ~(1 << slot->slot);
sys/dev/siis/siis.c
1309
ch->aslots &= ~(1 << slot->slot);
sys/dev/siis/siis.c
1313
ch->numrslots--;
sys/dev/siis/siis.c
1316
ch->numtslots[ccb->ccb_h.target_id]--;
sys/dev/siis/siis.c
1320
lastto = (ch->toslots == (1 << slot->slot));
sys/dev/siis/siis.c
1321
ch->toslots &= ~(1 << slot->slot);
sys/dev/siis/siis.c
1323
xpt_release_simq(ch->sim, TRUE);
sys/dev/siis/siis.c
1335
ch->hold[slot->slot] = ccb;
sys/dev/siis/siis.c
1336
ch->numhslots++;
sys/dev/siis/siis.c
1340
if (ch->rslots == 0) {
sys/dev/siis/siis.c
1342
if (ch->toslots != 0 || ch->fatalerr) {
sys/dev/siis/siis.c
1346
if (ch->eslots != 0)
sys/dev/siis/siis.c
1349
if (!ch->recoverycmd && ch->numhslots)
sys/dev/siis/siis.c
1353
} else if ((ch->rslots & ~ch->toslots) == 0 &&
sys/dev/siis/siis.c
1357
if (ch->frozen && !siis_check_collision(dev, ch->frozen)) {
sys/dev/siis/siis.c
1358
union ccb *fccb = ch->frozen;
sys/dev/siis/siis.c
1359
ch->frozen = NULL;
sys/dev/siis/siis.c
1361
xpt_release_simq(ch->sim, TRUE);
sys/dev/siis/siis.c
1368
struct siis_channel *ch = device_get_softc(dev);
sys/dev/siis/siis.c
1376
if (ch->hold[i])
sys/dev/siis/siis.c
1387
if (ch->hold[i] == NULL)
sys/dev/siis/siis.c
1389
ch->hold[i]->ccb_h.status &= ~CAM_STATUS_MASK;
sys/dev/siis/siis.c
1390
ch->hold[i]->ccb_h.status |= CAM_RESRC_UNAVAIL;
sys/dev/siis/siis.c
1391
xpt_done(ch->hold[i]);
sys/dev/siis/siis.c
1392
ch->hold[i] = NULL;
sys/dev/siis/siis.c
1393
ch->numhslots--;
sys/dev/siis/siis.c
1398
xpt_setup_ccb(&ccb->ccb_h, ch->hold[i]->ccb_h.path,
sys/dev/siis/siis.c
1399
ch->hold[i]->ccb_h.pinfo.priority);
sys/dev/siis/siis.c
1400
if (ch->hold[i]->ccb_h.func_code == XPT_ATA_IO) {
sys/dev/siis/siis.c
1432
csio->data_ptr = (void *)&ch->hold[i]->csio.sense_data;
sys/dev/siis/siis.c
1433
csio->dxfer_len = ch->hold[i]->csio.sense_len;
sys/dev/siis/siis.c
1439
ch->recoverycmd = 1;
sys/dev/siis/siis.c
1446
struct siis_channel *ch = device_get_softc(dev);
sys/dev/siis/siis.c
1451
ch->recoverycmd = 0;
sys/dev/siis/siis.c
1456
if (!ch->hold[i])
sys/dev/siis/siis.c
1458
if (ch->hold[i]->ccb_h.target_id != ccb->ccb_h.target_id)
sys/dev/siis/siis.c
1461
res = &ch->hold[i]->ataio.res;
sys/dev/siis/siis.c
1474
ch->hold[i]->ccb_h.status &= ~CAM_STATUS_MASK;
sys/dev/siis/siis.c
1475
ch->hold[i]->ccb_h.status |= CAM_REQUEUE_REQ;
sys/dev/siis/siis.c
1477
xpt_done(ch->hold[i]);
sys/dev/siis/siis.c
1478
ch->hold[i] = NULL;
sys/dev/siis/siis.c
1479
ch->numhslots--;
sys/dev/siis/siis.c
1488
if (!ch->hold[i])
sys/dev/siis/siis.c
1490
if (ch->hold[i]->ccb_h.target_id != ccb->ccb_h.target_id)
sys/dev/siis/siis.c
1492
xpt_done(ch->hold[i]);
sys/dev/siis/siis.c
1493
ch->hold[i] = NULL;
sys/dev/siis/siis.c
1494
ch->numhslots--;
sys/dev/siis/siis.c
1504
struct siis_channel *ch = device_get_softc(dev);
sys/dev/siis/siis.c
1507
ch->recoverycmd = 0;
sys/dev/siis/siis.c
1511
ch->hold[i]->ccb_h.status |= CAM_AUTOSNS_VALID;
sys/dev/siis/siis.c
1513
ch->hold[i]->ccb_h.status &= ~CAM_STATUS_MASK;
sys/dev/siis/siis.c
1514
ch->hold[i]->ccb_h.status |= CAM_AUTOSENSE_FAIL;
sys/dev/siis/siis.c
1516
xpt_done(ch->hold[i]);
sys/dev/siis/siis.c
1517
ch->hold[i] = NULL;
sys/dev/siis/siis.c
1518
ch->numhslots--;
sys/dev/siis/siis.c
1525
struct siis_channel *ch = device_get_softc(dev);
sys/dev/siis/siis.c
1528
ch->eslots = 0;
sys/dev/siis/siis.c
1529
ch->recovery = 0;
sys/dev/siis/siis.c
1530
ATA_OUTL(ch->r_mem, SIIS_P_CTLCLR, SIIS_P_CTL_RESUME);
sys/dev/siis/siis.c
1532
ATA_OUTL(ch->r_mem, SIIS_P_PMPSTS(i), 0),
sys/dev/siis/siis.c
1533
ATA_OUTL(ch->r_mem, SIIS_P_PMPQACT(i), 0);
sys/dev/siis/siis.c
1535
ATA_OUTL(ch->r_mem, SIIS_P_CTLSET, SIIS_P_CTL_PORT_INIT);
sys/dev/siis/siis.c
1542
struct siis_channel *ch = device_get_softc(dev);
sys/dev/siis/siis.c
1546
ATA_OUTL(ch->r_mem, SIIS_P_CTLSET, SIIS_P_CTL_DEV_RESET);
sys/dev/siis/siis.c
1547
while (((val = ATA_INL(ch->r_mem, SIIS_P_STS)) &
sys/dev/siis/siis.c
1562
struct siis_channel *ch = device_get_softc(dev);
sys/dev/siis/siis.c
1566
while (((val = ATA_INL(ch->r_mem, SIIS_P_STS)) &
sys/dev/siis/siis.c
1581
struct siis_channel *ch = device_get_softc(dev);
sys/dev/siis/siis.c
1585
xpt_freeze_simq(ch->sim, 1);
sys/dev/siis/siis.c
1588
if (!ch->recoverycmd && !ch->recovery)
sys/dev/siis/siis.c
1589
xpt_freeze_simq(ch->sim, ch->numrslots);
sys/dev/siis/siis.c
1591
if (ch->frozen) {
sys/dev/siis/siis.c
1592
union ccb *fccb = ch->frozen;
sys/dev/siis/siis.c
1593
ch->frozen = NULL;
sys/dev/siis/siis.c
1605
if (ch->slot[i].state < SIIS_SLOT_RUNNING)
sys/dev/siis/siis.c
1608
siis_end_transaction(&ch->slot[i], SIIS_ERR_INNOCENT);
sys/dev/siis/siis.c
1612
if (!ch->hold[i])
sys/dev/siis/siis.c
1614
xpt_done(ch->hold[i]);
sys/dev/siis/siis.c
1615
ch->hold[i] = NULL;
sys/dev/siis/siis.c
1616
ch->numhslots--;
sys/dev/siis/siis.c
1618
if (ch->toslots != 0)
sys/dev/siis/siis.c
1619
xpt_release_simq(ch->sim, TRUE);
sys/dev/siis/siis.c
1620
ch->eslots = 0;
sys/dev/siis/siis.c
1621
ch->recovery = 0;
sys/dev/siis/siis.c
1622
ch->toslots = 0;
sys/dev/siis/siis.c
1623
ch->fatalerr = 0;
sys/dev/siis/siis.c
1625
ATA_OUTL(ch->r_mem, SIIS_P_IECLR, 0x0000FFFF);
sys/dev/siis/siis.c
1627
sata_rev = ch->user[ch->pm_present ? 15 : 0].revision;
sys/dev/siis/siis.c
1636
ATA_OUTL(ch->r_mem, SIIS_P_SCTL,
sys/dev/siis/siis.c
1637
ATA_SC_DET_IDLE | val | ((ch->pm_level > 0) ? 0 :
sys/dev/siis/siis.c
1642
if (!siis_sata_connect(ch)) {
sys/dev/siis/siis.c
1643
ch->devices = 0;
sys/dev/siis/siis.c
1645
ATA_OUTL(ch->r_mem, SIIS_P_IESET, SIIS_P_IX_ENABLED);
sys/dev/siis/siis.c
1650
xpt_async(AC_BUS_RESET, ch->path, NULL);
sys/dev/siis/siis.c
1651
xpt_release_simq(ch->sim, TRUE);
sys/dev/siis/siis.c
1660
ATA_OUTL(ch->r_mem, SIIS_P_CTLSET, SIIS_P_CTL_PORT_RESET);
sys/dev/siis/siis.c
1663
ATA_OUTL(ch->r_mem, SIIS_P_CTLCLR, SIIS_P_CTL_PORT_RESET);
sys/dev/siis/siis.c
1664
ATA_OUTL(ch->r_mem, SIIS_P_CTLCLR, SIIS_P_CTL_32BIT);
sys/dev/siis/siis.c
1665
if (ch->pm_present)
sys/dev/siis/siis.c
1666
ATA_OUTL(ch->r_mem, SIIS_P_CTLSET, SIIS_P_CTL_PME);
sys/dev/siis/siis.c
1668
ATA_OUTL(ch->r_mem, SIIS_P_CTLCLR, SIIS_P_CTL_PME);
sys/dev/siis/siis.c
1674
ch->devices = 1;
sys/dev/siis/siis.c
1676
ATA_OUTL(ch->r_mem, SIIS_P_IS, 0xFFFFFFFF);
sys/dev/siis/siis.c
1677
ATA_OUTL(ch->r_mem, SIIS_P_IESET, SIIS_P_IX_ENABLED);
sys/dev/siis/siis.c
1679
device_printf(dev, "SIIS reset done: devices=%08x\n", ch->devices);
sys/dev/siis/siis.c
1681
xpt_async(AC_BUS_RESET, ch->path, NULL);
sys/dev/siis/siis.c
1682
xpt_release_simq(ch->sim, TRUE);
sys/dev/siis/siis.c
1688
struct siis_channel *ch = device_get_softc(dev);
sys/dev/siis/siis.c
1698
ch->curr[ccb->ccb_h.target_id].mode >= ATA_DMA)
sys/dev/siis/siis.c
1744
siis_sata_connect(struct siis_channel *ch)
sys/dev/siis/siis.c
1751
status = ATA_INL(ch->r_mem, SIIS_P_SSTS);
sys/dev/siis/siis.c
1760
device_printf(ch->dev, "SATA offline status=%08x\n",
sys/dev/siis/siis.c
1771
device_printf(ch->dev,
sys/dev/siis/siis.c
1778
device_printf(ch->dev, "SATA connect time=%dus status=%08x\n",
sys/dev/siis/siis.c
1782
ATA_OUTL(ch->r_mem, SIIS_P_SERR, 0xffffffff);
sys/dev/siis/siis.c
1807
struct siis_channel *ch;
sys/dev/siis/siis.c
1812
ch = (struct siis_channel *)cam_sim_softc(sim);
sys/dev/siis/siis.c
1813
dev = ch->dev;
sys/dev/siis/siis.c
1814
mtx_assert(&ch->mtx, MA_OWNED);
sys/dev/siis/siis.c
1821
if (ch->devices == 0 ||
sys/dev/siis/siis.c
1822
(ch->pm_present == 0 &&
sys/dev/siis/siis.c
1831
ch->frozen = ccb;
sys/dev/siis/siis.c
1833
xpt_freeze_simq(ch->sim, 1);
sys/dev/siis/siis.c
1850
d = &ch->curr[ccb->ccb_h.target_id];
sys/dev/siis/siis.c
1852
d = &ch->user[ccb->ccb_h.target_id];
sys/dev/siis/siis.c
1862
ch->pm_present = cts->xport_specific.sata.pm_present;
sys/dev/siis/siis.c
1863
if (ch->pm_present)
sys/dev/siis/siis.c
1864
ATA_OUTL(ch->r_mem, SIIS_P_CTLSET, SIIS_P_CTL_PME);
sys/dev/siis/siis.c
1866
ATA_OUTL(ch->r_mem, SIIS_P_CTLCLR, SIIS_P_CTL_PME);
sys/dev/siis/siis.c
1885
d = &ch->curr[ccb->ccb_h.target_id];
sys/dev/siis/siis.c
1887
d = &ch->user[ccb->ccb_h.target_id];
sys/dev/siis/siis.c
1896
(ccb->ccb_h.target_id == 0 && !ch->pm_present))) {
sys/dev/siis/siis.c
1897
status = ATA_INL(ch->r_mem, SIIS_P_SSTS) & ATA_SS_SPD_MASK;
sys/dev/siis/siis.c
1905
if (ch->pm_level)
sys/dev/siis/siis.c
1909
ch->user[ccb->ccb_h.target_id].caps;
sys/dev/siis/siis.c
1916
(ch->quirks & SIIS_Q_SNTF) == 0)
sys/dev/siis/siis.c
1924
cts->xport_specific.sata.pm_present = ch->pm_present;
sys/dev/siis/siis.c
1984
struct siis_channel *ch = (struct siis_channel *)cam_sim_softc(sim);
sys/dev/siis/siis.c
1986
siis_ch_intr(ch->dev);
sys/dev/siis/siis.c
461
struct siis_channel *ch = device_get_softc(dev);
sys/dev/siis/siis.c
465
ch->dev = dev;
sys/dev/siis/siis.c
466
ch->unit = (intptr_t)device_get_ivars(dev);
sys/dev/siis/siis.c
467
ch->quirks = ctlr->quirks;
sys/dev/siis/siis.c
468
ch->pm_level = 0;
sys/dev/siis/siis.c
470
device_get_unit(dev), "pm_level", &ch->pm_level);
sys/dev/siis/siis.c
474
ch->user[i].revision = sata_rev;
sys/dev/siis/siis.c
475
ch->user[i].mode = 0;
sys/dev/siis/siis.c
476
ch->user[i].bytecount = 8192;
sys/dev/siis/siis.c
477
ch->user[i].tags = SIIS_MAX_SLOTS;
sys/dev/siis/siis.c
478
ch->curr[i] = ch->user[i];
sys/dev/siis/siis.c
479
if (ch->pm_level)
sys/dev/siis/siis.c
480
ch->user[i].caps = CTS_SATA_CAPS_H_PMREQ;
sys/dev/siis/siis.c
481
ch->user[i].caps |= CTS_SATA_CAPS_H_AN;
sys/dev/siis/siis.c
483
mtx_init(&ch->mtx, "SIIS channel lock", NULL, MTX_DEF);
sys/dev/siis/siis.c
484
rid = ch->unit;
sys/dev/siis/siis.c
485
if (!(ch->r_mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY,
sys/dev/siis/siis.c
491
mtx_lock(&ch->mtx);
sys/dev/siis/siis.c
493
if (!(ch->r_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ,
sys/dev/siis/siis.c
499
if ((bus_setup_intr(dev, ch->r_irq, ATA_INTR_FLAGS, NULL,
sys/dev/siis/siis.c
500
siis_ch_intr_locked, dev, &ch->ih))) {
sys/dev/siis/siis.c
513
ch->sim = cam_sim_alloc(siisaction, siispoll, "siisch", ch,
sys/dev/siis/siis.c
514
device_get_unit(dev), &ch->mtx, 2, SIIS_MAX_SLOTS, devq);
sys/dev/siis/siis.c
515
if (ch->sim == NULL) {
sys/dev/siis/siis.c
521
if (xpt_bus_register(ch->sim, dev, 0) != CAM_SUCCESS) {
sys/dev/siis/siis.c
526
if (xpt_create_path(&ch->path, /*periph*/NULL, cam_sim_path(ch->sim),
sys/dev/siis/siis.c
532
mtx_unlock(&ch->mtx);
sys/dev/siis/siis.c
533
ch->led = led_create(siis_ch_led, dev, device_get_nameunit(dev));
sys/dev/siis/siis.c
537
xpt_bus_deregister(cam_sim_path(ch->sim));
sys/dev/siis/siis.c
539
cam_sim_free(ch->sim, /*free_devq*/TRUE);
sys/dev/siis/siis.c
541
bus_release_resource(dev, SYS_RES_IRQ, ATA_IRQ_RID, ch->r_irq);
sys/dev/siis/siis.c
543
bus_release_resource(dev, SYS_RES_MEMORY, ch->unit, ch->r_mem);
sys/dev/siis/siis.c
544
mtx_unlock(&ch->mtx);
sys/dev/siis/siis.c
545
mtx_destroy(&ch->mtx);
sys/dev/siis/siis.c
552
struct siis_channel *ch = device_get_softc(dev);
sys/dev/siis/siis.c
554
led_destroy(ch->led);
sys/dev/siis/siis.c
555
mtx_lock(&ch->mtx);
sys/dev/siis/siis.c
556
xpt_async(AC_LOST_DEVICE, ch->path, NULL);
sys/dev/siis/siis.c
557
xpt_free_path(ch->path);
sys/dev/siis/siis.c
558
xpt_bus_deregister(cam_sim_path(ch->sim));
sys/dev/siis/siis.c
559
cam_sim_free(ch->sim, /*free_devq*/TRUE);
sys/dev/siis/siis.c
560
mtx_unlock(&ch->mtx);
sys/dev/siis/siis.c
562
bus_teardown_intr(dev, ch->r_irq, ch->ih);
sys/dev/siis/siis.c
563
bus_release_resource(dev, SYS_RES_IRQ, ATA_IRQ_RID, ch->r_irq);
sys/dev/siis/siis.c
569
bus_release_resource(dev, SYS_RES_MEMORY, ch->unit, ch->r_mem);
sys/dev/siis/siis.c
570
mtx_destroy(&ch->mtx);
sys/dev/siis/siis.c
577
struct siis_channel *ch = device_get_softc(dev);
sys/dev/siis/siis.c
580
ATA_OUTL(ch->r_mem, SIIS_P_CTLCLR, SIIS_P_CTL_PORT_RESET);
sys/dev/siis/siis.c
581
ATA_OUTL(ch->r_mem, SIIS_P_CTLCLR, SIIS_P_CTL_32BIT);
sys/dev/siis/siis.c
582
if (ch->pm_present)
sys/dev/siis/siis.c
583
ATA_OUTL(ch->r_mem, SIIS_P_CTLSET, SIIS_P_CTL_PME);
sys/dev/siis/siis.c
585
ATA_OUTL(ch->r_mem, SIIS_P_CTLCLR, SIIS_P_CTL_PME);
sys/dev/siis/siis.c
587
ATA_OUTL(ch->r_mem, SIIS_P_IESET, SIIS_P_IX_ENABLED);
sys/dev/siis/siis.c
594
struct siis_channel *ch = device_get_softc(dev);
sys/dev/siis/siis.c
597
ATA_OUTL(ch->r_mem, SIIS_P_CTLSET, SIIS_P_CTL_PORT_RESET);
sys/dev/siis/siis.c
604
struct siis_channel *ch = device_get_softc(dev);
sys/dev/siis/siis.c
606
mtx_lock(&ch->mtx);
sys/dev/siis/siis.c
607
xpt_freeze_simq(ch->sim, 1);
sys/dev/siis/siis.c
608
while (ch->oslots)
sys/dev/siis/siis.c
609
msleep(ch, &ch->mtx, PRIBIO, "siissusp", hz/100);
sys/dev/siis/siis.c
611
mtx_unlock(&ch->mtx);
sys/dev/siis/siis.c
618
struct siis_channel *ch = device_get_softc(dev);
sys/dev/siis/siis.c
620
mtx_lock(&ch->mtx);
sys/dev/siis/siis.c
623
xpt_release_simq(ch->sim, TRUE);
sys/dev/siis/siis.c
624
mtx_unlock(&ch->mtx);
sys/dev/siis/siis.c
649
struct siis_channel *ch;
sys/dev/siis/siis.c
652
ch = device_get_softc(dev);
sys/dev/siis/siis.c
655
ATA_OUTL(ch->r_mem, SIIS_P_CTLCLR, SIIS_P_CTL_LED_ON);
sys/dev/siis/siis.c
657
ATA_OUTL(ch->r_mem, SIIS_P_CTLSET, SIIS_P_CTL_LED_ON);
sys/dev/siis/siis.c
668
struct siis_channel *ch = device_get_softc(dev);
sys/dev/siis/siis.c
675
0, NULL, NULL, &ch->dma.work_tag))
sys/dev/siis/siis.c
677
if (bus_dmamem_alloc(ch->dma.work_tag, (void **)&ch->dma.work, 0,
sys/dev/siis/siis.c
678
&ch->dma.work_map))
sys/dev/siis/siis.c
680
if (bus_dmamap_load(ch->dma.work_tag, ch->dma.work_map, ch->dma.work,
sys/dev/siis/siis.c
682
bus_dmamem_free(ch->dma.work_tag, ch->dma.work, ch->dma.work_map);
sys/dev/siis/siis.c
685
ch->dma.work_bus = dcba.maddr;
sys/dev/siis/siis.c
691
0, busdma_lock_mutex, &ch->mtx, &ch->dma.data_tag)) {
sys/dev/siis/siis.c
713
struct siis_channel *ch = device_get_softc(dev);
sys/dev/siis/siis.c
715
if (ch->dma.data_tag) {
sys/dev/siis/siis.c
716
bus_dma_tag_destroy(ch->dma.data_tag);
sys/dev/siis/siis.c
717
ch->dma.data_tag = NULL;
sys/dev/siis/siis.c
719
if (ch->dma.work_bus) {
sys/dev/siis/siis.c
720
bus_dmamap_unload(ch->dma.work_tag, ch->dma.work_map);
sys/dev/siis/siis.c
721
bus_dmamem_free(ch->dma.work_tag, ch->dma.work, ch->dma.work_map);
sys/dev/siis/siis.c
722
ch->dma.work_bus = 0;
sys/dev/siis/siis.c
723
ch->dma.work_map = NULL;
sys/dev/siis/siis.c
724
ch->dma.work = NULL;
sys/dev/siis/siis.c
726
if (ch->dma.work_tag) {
sys/dev/siis/siis.c
727
bus_dma_tag_destroy(ch->dma.work_tag);
sys/dev/siis/siis.c
728
ch->dma.work_tag = NULL;
sys/dev/siis/siis.c
735
struct siis_channel *ch = device_get_softc(dev);
sys/dev/siis/siis.c
739
bzero(ch->slot, sizeof(ch->slot));
sys/dev/siis/siis.c
741
struct siis_slot *slot = &ch->slot[i];
sys/dev/siis/siis.c
748
callout_init_mtx(&slot->timeout, &ch->mtx, 0);
sys/dev/siis/siis.c
750
if (bus_dmamap_create(ch->dma.data_tag, 0, &slot->dma.data_map))
sys/dev/siis/siis.c
751
device_printf(ch->dev, "FAILURE - create data_map\n");
sys/dev/siis/siis.c
758
struct siis_channel *ch = device_get_softc(dev);
sys/dev/siis/siis.c
763
struct siis_slot *slot = &ch->slot[i];
sys/dev/siis/siis.c
767
bus_dmamap_destroy(ch->dma.data_tag, slot->dma.data_map);
sys/dev/siis/siis.c
776
struct siis_channel *ch = device_get_softc(dev);
sys/dev/siis/siis.c
781
if (ch->quirks & SIIS_Q_SNTF) {
sys/dev/siis/siis.c
782
status = ATA_INL(ch->r_mem, SIIS_P_SNTF);
sys/dev/siis/siis.c
783
ATA_OUTL(ch->r_mem, SIIS_P_SNTF, status);
sys/dev/siis/siis.c
789
status = (ch->pm_present) ? 0x8000 : 0x0001;
sys/dev/siis/siis.c
797
xpt_path_path_id(ch->path), i, 0) == CAM_REQ_CMP) {
sys/dev/siis/siis.c
808
struct siis_channel *ch = device_get_softc(dev);
sys/dev/siis/siis.c
811
if (ch->pm_level == 0) {
sys/dev/siis/siis.c
812
u_int32_t status = ATA_INL(ch->r_mem, SIIS_P_SSTS);
sys/dev/siis/siis.c
827
cam_sim_path(ch->sim),
sys/dev/siis/siis.c
840
struct siis_channel *ch = device_get_softc(dev);
sys/dev/siis/siis.c
842
mtx_lock(&ch->mtx);
sys/dev/siis/siis.c
844
mtx_unlock(&ch->mtx);
sys/dev/siis/siis.c
85
static int siis_sata_connect(struct siis_channel *ch);
sys/dev/siis/siis.c
851
struct siis_channel *ch = device_get_softc(dev);
sys/dev/siis/siis.c
856
mtx_assert(&ch->mtx, MA_OWNED);
sys/dev/siis/siis.c
858
sstatus = ATA_INL(ch->r_mem, SIIS_P_SS);
sys/dev/siis/siis.c
859
ok = ch->rslots & ~sstatus;
sys/dev/siis/siis.c
863
siis_end_transaction(&ch->slot[i], SIIS_ERR_NONE);
sys/dev/siis/siis.c
869
istatus = ATA_INL(ch->r_mem, SIIS_P_IS) &
sys/dev/siis/siis.c
871
ATA_OUTL(ch->r_mem, SIIS_P_IS, istatus);
sys/dev/siis/siis.c
880
estatus = ATA_INL(ch->r_mem, SIIS_P_CMDERR);
sys/dev/siis/siis.c
881
ctx = ATA_INL(ch->r_mem, SIIS_P_CTX);
sys/dev/siis/siis.c
888
if (!ch->recoverycmd && !ch->recovery) {
sys/dev/siis/siis.c
889
xpt_freeze_simq(ch->sim, ch->numrslots);
sys/dev/siis/siis.c
890
ch->recovery = 1;
sys/dev/siis/siis.c
892
if (ch->frozen) {
sys/dev/siis/siis.c
893
union ccb *fccb = ch->frozen;
sys/dev/siis/siis.c
894
ch->frozen = NULL;
sys/dev/siis/siis.c
906
tslots = ch->numtslots[port];
sys/dev/siis/siis.c
909
if (((ch->rslots >> i) & 1) == 0)
sys/dev/siis/siis.c
911
if (ch->slot[i].ccb->ccb_h.target_id != port)
sys/dev/siis/siis.c
923
siis_end_transaction(&ch->slot[i], et);
sys/dev/siis/siis.c
929
if (ch->rslots != 0 && !ch->recoverycmd)
sys/dev/siis/siis.c
930
ATA_OUTL(ch->r_mem, SIIS_P_CTLSET, SIIS_P_CTL_RESUME);
sys/dev/siis/siis.c
941
if (((ch->rslots >> i) & 1) == 0)
sys/dev/siis/siis.c
943
siis_end_transaction(&ch->slot[i], et);
sys/dev/siis/siis.c
953
struct siis_channel *ch = device_get_softc(dev);
sys/dev/siis/siis.c
955
mtx_assert(&ch->mtx, MA_OWNED);
sys/dev/siis/siis.c
959
if (((~ch->oslots) & (0x7fffffff >> (31 -
sys/dev/siis/siis.c
960
ch->curr[ccb->ccb_h.target_id].tags))) == 0)
sys/dev/siis/siis.c
966
if (ch->numrslots != 0)
sys/dev/siis/siis.c
970
if (ch->aslots != 0)
sys/dev/siis/siis.c
979
struct siis_channel *ch = device_get_softc(dev);
sys/dev/siis/siis.c
983
mtx_assert(&ch->mtx, MA_OWNED);
sys/dev/siis/siis.c
988
tags = ch->curr[ccb->ccb_h.target_id].tags;
sys/dev/siis/siis.c
989
tag = fls((~ch->oslots) & (0x7fffffff >> (31 - tags))) - 1;
sys/dev/siis/siis.c
991
slot = &ch->slot[tag];
sys/dev/siis/siis.c
994
ch->oslots |= (1 << slot->slot);
sys/dev/siis/siis.c
995
ch->numrslots++;
sys/dev/siis/siis.c
998
ch->numtslots[ccb->ccb_h.target_id]++;
sys/dev/sound/dummy.c
112
ch = &sc->chans[i];
sys/dev/sound/dummy.c
113
if (!ch->run)
sys/dev/sound/dummy.c
115
if (ch->dir == PCMDIR_PLAY) {
sys/dev/sound/dummy.c
116
ch->ptr += ch->buf->blksz;
sys/dev/sound/dummy.c
117
ch->ptr %= ch->buf->bufsize;
sys/dev/sound/dummy.c
119
sndbuf_fillsilence(ch->buf);
sys/dev/sound/dummy.c
121
chn_intr(ch->chan);
sys/dev/sound/dummy.c
131
struct dummy_chan *ch =data;
sys/dev/sound/dummy.c
134
buf = ch->buf->buf;
sys/dev/sound/dummy.c
145
struct dummy_chan *ch;
sys/dev/sound/dummy.c
153
ch = &sc->chans[sc->chnum++];
sys/dev/sound/dummy.c
154
ch->sc = sc;
sys/dev/sound/dummy.c
155
ch->dir = dir;
sys/dev/sound/dummy.c
156
ch->chan = c;
sys/dev/sound/dummy.c
157
ch->buf = b;
sys/dev/sound/dummy.c
158
ch->caps = &sc->caps;
sys/dev/sound/dummy.c
164
if (sndbuf_setup(ch->buf, buf, bufsz) != 0) {
sys/dev/sound/dummy.c
165
dummy_chan_free(obj, ch);
sys/dev/sound/dummy.c
169
return (ch);
sys/dev/sound/dummy.c
175
struct dummy_chan *ch = data;
sys/dev/sound/dummy.c
178
for (i = 0; ch->caps->fmtlist[i]; i++)
sys/dev/sound/dummy.c
179
if (format == ch->caps->fmtlist[i])
sys/dev/sound/dummy.c
188
struct dummy_chan *ch = data;
sys/dev/sound/dummy.c
190
RANGE(speed, ch->caps->minspeed, ch->caps->maxspeed);
sys/dev/sound/dummy.c
198
struct dummy_chan *ch = data;
sys/dev/sound/dummy.c
200
return (ch->buf->blksz);
sys/dev/sound/dummy.c
206
struct dummy_chan *ch = data;
sys/dev/sound/dummy.c
207
struct dummy_softc *sc = ch->sc;
sys/dev/sound/dummy.c
218
ch->ptr = 0;
sys/dev/sound/dummy.c
219
ch->run = 1;
sys/dev/sound/dummy.c
224
ch->run = 0;
sys/dev/sound/dummy.c
240
struct dummy_chan *ch = data;
sys/dev/sound/dummy.c
242
return (ch->run ? ch->ptr : 0);
sys/dev/sound/dummy.c
248
struct dummy_chan *ch = data;
sys/dev/sound/dummy.c
250
return (ch->caps);
sys/dev/sound/dummy.c
79
struct dummy_chan *ch;
sys/dev/sound/dummy.c
85
ch = &sc->chans[i];
sys/dev/sound/dummy.c
86
if (ch->run)
sys/dev/sound/dummy.c
98
struct dummy_chan *ch;
sys/dev/sound/pci/als4000.c
209
struct sc_chinfo *ch;
sys/dev/sound/pci/als4000.c
213
ch = &sc->pch;
sys/dev/sound/pci/als4000.c
214
ch->gcr_fifo_status = ALS_GCR_FIFO0_STATUS;
sys/dev/sound/pci/als4000.c
216
ch = &sc->rch;
sys/dev/sound/pci/als4000.c
217
ch->gcr_fifo_status = ALS_GCR_FIFO1_STATUS;
sys/dev/sound/pci/als4000.c
219
ch->dir = dir;
sys/dev/sound/pci/als4000.c
220
ch->parent = sc;
sys/dev/sound/pci/als4000.c
221
ch->channel = c;
sys/dev/sound/pci/als4000.c
222
ch->bps = 1;
sys/dev/sound/pci/als4000.c
223
ch->format = SND_FORMAT(AFMT_U8, 1, 0);
sys/dev/sound/pci/als4000.c
224
ch->speed = 8000;
sys/dev/sound/pci/als4000.c
225
ch->buffer = b;
sys/dev/sound/pci/als4000.c
228
if (sndbuf_alloc(ch->buffer, sc->parent_dmat, 0, sc->bufsz) != 0)
sys/dev/sound/pci/als4000.c
231
return ch;
sys/dev/sound/pci/als4000.c
237
struct sc_chinfo *ch = data;
sys/dev/sound/pci/als4000.c
239
ch->format = format;
sys/dev/sound/pci/als4000.c
246
struct sc_chinfo *ch = data, *other;
sys/dev/sound/pci/als4000.c
247
struct sc_info *sc = ch->parent;
sys/dev/sound/pci/als4000.c
249
other = (ch->dir == PCMDIR_PLAY) ? &sc->rch : &sc->pch;
sys/dev/sound/pci/als4000.c
253
ch->speed = other->speed;
sys/dev/sound/pci/als4000.c
257
ch->speed = speed;
sys/dev/sound/pci/als4000.c
264
struct sc_chinfo *ch = data;
sys/dev/sound/pci/als4000.c
265
struct sc_info *sc = ch->parent;
sys/dev/sound/pci/als4000.c
270
sndbuf_resize(ch->buffer, 2, blocksize);
sys/dev/sound/pci/als4000.c
277
struct sc_chinfo *ch = data;
sys/dev/sound/pci/als4000.c
278
struct sc_info *sc = ch->parent;
sys/dev/sound/pci/als4000.c
282
pos = als_gcr_rd(ch->parent, ch->gcr_fifo_status) & 0xffff;
sys/dev/sound/pci/als4000.c
284
sz = ch->buffer->bufsize;
sys/dev/sound/pci/als4000.c
295
als_set_speed(struct sc_chinfo *ch)
sys/dev/sound/pci/als4000.c
297
struct sc_info *sc = ch->parent;
sys/dev/sound/pci/als4000.c
300
other = (ch->dir == PCMDIR_PLAY) ? &sc->rch : &sc->pch;
sys/dev/sound/pci/als4000.c
303
als_esp_wr(sc, ch->speed >> 8);
sys/dev/sound/pci/als4000.c
304
als_esp_wr(sc, ch->speed & 0xff);
sys/dev/sound/pci/als4000.c
307
other->speed, ch->speed));
sys/dev/sound/pci/als4000.c
345
als_playback_start(struct sc_chinfo *ch)
sys/dev/sound/pci/als4000.c
348
struct sc_info *sc = ch->parent;
sys/dev/sound/pci/als4000.c
351
buf = ch->buffer->buf_addr;
sys/dev/sound/pci/als4000.c
352
bufsz = ch->buffer->bufsize;
sys/dev/sound/pci/als4000.c
354
if (ch->format & AFMT_16BIT)
sys/dev/sound/pci/als4000.c
359
als_set_speed(ch);
sys/dev/sound/pci/als4000.c
364
p = als_get_playback_command(ch->format);
sys/dev/sound/pci/als4000.c
372
ch->dma_active = 1;
sys/dev/sound/pci/als4000.c
376
als_playback_stop(struct sc_chinfo *ch)
sys/dev/sound/pci/als4000.c
379
struct sc_info *sc = ch->parent;
sys/dev/sound/pci/als4000.c
382
active = ch->dma_active;
sys/dev/sound/pci/als4000.c
384
p = als_get_playback_command(ch->format);
sys/dev/sound/pci/als4000.c
387
ch->dma_active = 0;
sys/dev/sound/pci/als4000.c
394
struct sc_chinfo *ch = data;
sys/dev/sound/pci/als4000.c
395
struct sc_info *sc = ch->parent;
sys/dev/sound/pci/als4000.c
403
als_playback_start(ch);
sys/dev/sound/pci/als4000.c
407
als_playback_stop(ch);
sys/dev/sound/pci/als4000.c
449
als_capture_start(struct sc_chinfo *ch)
sys/dev/sound/pci/als4000.c
451
struct sc_info *sc = ch->parent;
sys/dev/sound/pci/als4000.c
454
buf = ch->buffer->buf_addr;
sys/dev/sound/pci/als4000.c
455
bufsz = ch->buffer->bufsize;
sys/dev/sound/pci/als4000.c
457
if (ch->format & AFMT_16BIT)
sys/dev/sound/pci/als4000.c
462
als_set_speed(ch);
sys/dev/sound/pci/als4000.c
470
dma_prog = ALS_FIFO1_RUN | als_get_fifo_format(sc, ch->format);
sys/dev/sound/pci/als4000.c
473
ch->dma_active = 1;
sys/dev/sound/pci/als4000.c
477
als_capture_stop(struct sc_chinfo *ch)
sys/dev/sound/pci/als4000.c
479
struct sc_info *sc = ch->parent;
sys/dev/sound/pci/als4000.c
482
active = ch->dma_active;
sys/dev/sound/pci/als4000.c
486
ch->dma_active = 0;
sys/dev/sound/pci/als4000.c
493
struct sc_chinfo *ch = data;
sys/dev/sound/pci/als4000.c
494
struct sc_info *sc = ch->parent;
sys/dev/sound/pci/als4000.c
499
als_capture_start(ch);
sys/dev/sound/pci/als4000.c
503
als_capture_stop(ch);
sys/dev/sound/pci/atiixp.c
328
atiixp_flush_dma(struct atiixp_chinfo *ch)
sys/dev/sound/pci/atiixp.c
330
atiixp_wr(ch->parent, ATI_REG_FIFO_FLUSH, ch->flush_bit);
sys/dev/sound/pci/atiixp.c
334
atiixp_enable_dma(struct atiixp_chinfo *ch)
sys/dev/sound/pci/atiixp.c
338
value = atiixp_rd(ch->parent, ATI_REG_CMD);
sys/dev/sound/pci/atiixp.c
339
if (!(value & ch->enable_bit)) {
sys/dev/sound/pci/atiixp.c
340
value |= ch->enable_bit;
sys/dev/sound/pci/atiixp.c
341
atiixp_wr(ch->parent, ATI_REG_CMD, value);
sys/dev/sound/pci/atiixp.c
346
atiixp_disable_dma(struct atiixp_chinfo *ch)
sys/dev/sound/pci/atiixp.c
350
value = atiixp_rd(ch->parent, ATI_REG_CMD);
sys/dev/sound/pci/atiixp.c
351
if (value & ch->enable_bit) {
sys/dev/sound/pci/atiixp.c
352
value &= ~ch->enable_bit;
sys/dev/sound/pci/atiixp.c
353
atiixp_wr(ch->parent, ATI_REG_CMD, value);
sys/dev/sound/pci/atiixp.c
439
struct atiixp_chinfo *ch;
sys/dev/sound/pci/atiixp.c
445
ch = &sc->pch;
sys/dev/sound/pci/atiixp.c
446
ch->linkptr_bit = ATI_REG_OUT_DMA_LINKPTR;
sys/dev/sound/pci/atiixp.c
447
ch->enable_bit = ATI_REG_CMD_OUT_DMA_EN | ATI_REG_CMD_SEND_EN;
sys/dev/sound/pci/atiixp.c
448
ch->flush_bit = ATI_REG_FIFO_OUT_FLUSH;
sys/dev/sound/pci/atiixp.c
449
ch->dt_cur_bit = ATI_REG_OUT_DMA_DT_CUR;
sys/dev/sound/pci/atiixp.c
451
ch->caps_32bit = 1;
sys/dev/sound/pci/atiixp.c
453
ch = &sc->rch;
sys/dev/sound/pci/atiixp.c
454
ch->linkptr_bit = ATI_REG_IN_DMA_LINKPTR;
sys/dev/sound/pci/atiixp.c
455
ch->enable_bit = ATI_REG_CMD_IN_DMA_EN | ATI_REG_CMD_RECEIVE_EN;
sys/dev/sound/pci/atiixp.c
456
ch->flush_bit = ATI_REG_FIFO_IN_FLUSH;
sys/dev/sound/pci/atiixp.c
457
ch->dt_cur_bit = ATI_REG_IN_DMA_DT_CUR;
sys/dev/sound/pci/atiixp.c
459
ch->caps_32bit = 1;
sys/dev/sound/pci/atiixp.c
462
ch->buffer = b;
sys/dev/sound/pci/atiixp.c
463
ch->parent = sc;
sys/dev/sound/pci/atiixp.c
464
ch->channel = c;
sys/dev/sound/pci/atiixp.c
465
ch->dir = dir;
sys/dev/sound/pci/atiixp.c
466
ch->blkcnt = sc->blkcnt;
sys/dev/sound/pci/atiixp.c
467
ch->blksz = sc->bufsz / ch->blkcnt;
sys/dev/sound/pci/atiixp.c
471
if (sndbuf_alloc(ch->buffer, sc->parent_dmat, 0, sc->bufsz) == -1)
sys/dev/sound/pci/atiixp.c
476
ch->sgd_table = &sc->sgd_table[num * ATI_IXP_DMA_CHSEGS_MAX];
sys/dev/sound/pci/atiixp.c
477
ch->sgd_addr = sc->sgd_addr + (num * ATI_IXP_DMA_CHSEGS_MAX *
sys/dev/sound/pci/atiixp.c
479
atiixp_disable_dma(ch);
sys/dev/sound/pci/atiixp.c
482
return (ch);
sys/dev/sound/pci/atiixp.c
488
struct atiixp_chinfo *ch = data;
sys/dev/sound/pci/atiixp.c
489
struct atiixp_info *sc = ch->parent;
sys/dev/sound/pci/atiixp.c
493
if (ch->dir == PCMDIR_REC) {
sys/dev/sound/pci/atiixp.c
516
ch->fmt = format;
sys/dev/sound/pci/atiixp.c
533
struct atiixp_chinfo *ch = data;
sys/dev/sound/pci/atiixp.c
534
struct atiixp_info *sc = ch->parent;
sys/dev/sound/pci/atiixp.c
538
if (blksz > (ch->buffer->maxsize / ATI_IXP_DMA_CHSEGS_MIN))
sys/dev/sound/pci/atiixp.c
539
blksz = ch->buffer->maxsize / ATI_IXP_DMA_CHSEGS_MIN;
sys/dev/sound/pci/atiixp.c
547
while ((blksz * blkcnt) > ch->buffer->maxsize) {
sys/dev/sound/pci/atiixp.c
556
if ((ch->buffer->blksz != blksz ||
sys/dev/sound/pci/atiixp.c
557
ch->buffer->blkcnt != blkcnt) &&
sys/dev/sound/pci/atiixp.c
558
sndbuf_resize(ch->buffer, blkcnt, blksz) != 0)
sys/dev/sound/pci/atiixp.c
562
ch->blksz = ch->buffer->blksz;
sys/dev/sound/pci/atiixp.c
563
ch->blkcnt = ch->buffer->blkcnt;
sys/dev/sound/pci/atiixp.c
571
struct atiixp_chinfo *ch = data;
sys/dev/sound/pci/atiixp.c
572
struct atiixp_info *sc = ch->parent;
sys/dev/sound/pci/atiixp.c
576
return (ch->blksz);
sys/dev/sound/pci/atiixp.c
580
atiixp_buildsgdt(struct atiixp_chinfo *ch)
sys/dev/sound/pci/atiixp.c
582
struct atiixp_info *sc = ch->parent;
sys/dev/sound/pci/atiixp.c
586
addr = ch->buffer->buf_addr;
sys/dev/sound/pci/atiixp.c
589
blksz = ch->blksz * ch->blkcnt;
sys/dev/sound/pci/atiixp.c
592
blksz = ch->blksz;
sys/dev/sound/pci/atiixp.c
593
blkcnt = ch->blkcnt;
sys/dev/sound/pci/atiixp.c
597
ch->sgd_table[i].addr = htole32(addr + (i * blksz));
sys/dev/sound/pci/atiixp.c
598
ch->sgd_table[i].status = htole16(0);
sys/dev/sound/pci/atiixp.c
599
ch->sgd_table[i].size = htole16(blksz >> 2);
sys/dev/sound/pci/atiixp.c
600
ch->sgd_table[i].next = htole32((uint32_t)ch->sgd_addr +
sys/dev/sound/pci/atiixp.c
606
atiixp_dmapos(struct atiixp_chinfo *ch)
sys/dev/sound/pci/atiixp.c
608
struct atiixp_info *sc = ch->parent;
sys/dev/sound/pci/atiixp.c
612
reg = ch->dt_cur_bit;
sys/dev/sound/pci/atiixp.c
613
addr = ch->buffer->buf_addr;
sys/dev/sound/pci/atiixp.c
614
sz = ch->blkcnt * ch->blksz;
sys/dev/sound/pci/atiixp.c
625
if ((ptr & ~(ch->blksz - 1)) != ch->ptr) {
sys/dev/sound/pci/atiixp.c
628
delta = (sz + ptr - ch->prevptr) % sz;
sys/dev/sound/pci/atiixp.c
630
if (delta < ch->blksz)
sys/dev/sound/pci/atiixp.c
638
(ch->dir == PCMDIR_PLAY) ?
sys/dev/sound/pci/atiixp.c
640
ch->prevptr, ptr,
sys/dev/sound/pci/atiixp.c
641
ch->ptr, ch->blkcnt,
sys/dev/sound/pci/atiixp.c
642
delta, ch->blksz,
sys/dev/sound/pci/atiixp.c
643
(delta < ch->blksz) ?
sys/dev/sound/pci/atiixp.c
645
ch->ptr = ptr & ~(ch->blksz - 1);
sys/dev/sound/pci/atiixp.c
647
ch->prevptr = ptr;
sys/dev/sound/pci/atiixp.c
655
(ch->dir == PCMDIR_PLAY) ? "PLAY" : "REC", ptr);
sys/dev/sound/pci/atiixp.c
661
atiixp_poll_channel(struct atiixp_chinfo *ch)
sys/dev/sound/pci/atiixp.c
666
if (!(ch->flags & ATI_IXP_CHN_RUNNING))
sys/dev/sound/pci/atiixp.c
669
sz = ch->blksz * ch->blkcnt;
sys/dev/sound/pci/atiixp.c
670
ptr = atiixp_dmapos(ch);
sys/dev/sound/pci/atiixp.c
671
ch->ptr = ptr;
sys/dev/sound/pci/atiixp.c
673
ptr &= ~(ch->blksz - 1);
sys/dev/sound/pci/atiixp.c
674
delta = (sz + ptr - ch->prevptr) % sz;
sys/dev/sound/pci/atiixp.c
676
if (delta < ch->blksz)
sys/dev/sound/pci/atiixp.c
679
ch->prevptr = ptr;
sys/dev/sound/pci/atiixp.c
720
struct atiixp_chinfo *ch = data;
sys/dev/sound/pci/atiixp.c
721
struct atiixp_info *sc = ch->parent;
sys/dev/sound/pci/atiixp.c
732
atiixp_flush_dma(ch);
sys/dev/sound/pci/atiixp.c
733
atiixp_buildsgdt(ch);
sys/dev/sound/pci/atiixp.c
734
atiixp_wr(sc, ch->linkptr_bit, 0);
sys/dev/sound/pci/atiixp.c
735
atiixp_enable_dma(ch);
sys/dev/sound/pci/atiixp.c
736
atiixp_wr(sc, ch->linkptr_bit,
sys/dev/sound/pci/atiixp.c
737
(uint32_t)ch->sgd_addr | ATI_REG_LINKPTR_EN);
sys/dev/sound/pci/atiixp.c
739
ch->ptr = 0;
sys/dev/sound/pci/atiixp.c
740
ch->prevptr = 0;
sys/dev/sound/pci/atiixp.c
741
pollticks = ((uint64_t)hz * ch->blksz) /
sys/dev/sound/pci/atiixp.c
742
((uint64_t)ch->buffer->align * ch->buffer->spd);
sys/dev/sound/pci/atiixp.c
766
ch->flags |= ATI_IXP_CHN_RUNNING;
sys/dev/sound/pci/atiixp.c
770
atiixp_disable_dma(ch);
sys/dev/sound/pci/atiixp.c
771
atiixp_flush_dma(ch);
sys/dev/sound/pci/atiixp.c
772
ch->flags &= ~ATI_IXP_CHN_RUNNING;
sys/dev/sound/pci/atiixp.c
779
ch = &sc->pch;
sys/dev/sound/pci/atiixp.c
781
ch = &sc->rch;
sys/dev/sound/pci/atiixp.c
782
pollticks = ((uint64_t)hz * ch->blksz) /
sys/dev/sound/pci/atiixp.c
783
((uint64_t)ch->buffer->align *
sys/dev/sound/pci/atiixp.c
784
ch->buffer->spd);
sys/dev/sound/pci/atiixp.c
826
struct atiixp_chinfo *ch = data;
sys/dev/sound/pci/atiixp.c
827
struct atiixp_info *sc = ch->parent;
sys/dev/sound/pci/atiixp.c
832
ptr = ch->ptr;
sys/dev/sound/pci/atiixp.c
834
ptr = atiixp_dmapos(ch);
sys/dev/sound/pci/atiixp.c
843
struct atiixp_chinfo *ch = data;
sys/dev/sound/pci/atiixp.c
845
if (ch->caps_32bit)
sys/dev/sound/pci/cmi.c
254
cmi_dma_prog(struct sc_info *sc, struct sc_chinfo *ch, u_int32_t base)
sys/dev/sound/pci/cmi.c
258
ch->phys_buf = ch->buffer->buf_addr;
sys/dev/sound/pci/cmi.c
260
cmi_wr(sc, base, ch->phys_buf, 4);
sys/dev/sound/pci/cmi.c
261
sz = (u_int32_t)ch->buffer->bufsize;
sys/dev/sound/pci/cmi.c
263
s = sz / ch->bps - 1;
sys/dev/sound/pci/cmi.c
266
i = sz / (ch->bps * CMI_INTR_PER_BUFFER) - 1;
sys/dev/sound/pci/cmi.c
271
cmi_ch0_start(struct sc_info *sc, struct sc_chinfo *ch)
sys/dev/sound/pci/cmi.c
273
cmi_dma_prog(sc, ch, CMPCI_REG_DMA0_BASE);
sys/dev/sound/pci/cmi.c
279
ch->dma_active = 1;
sys/dev/sound/pci/cmi.c
283
cmi_ch0_stop(struct sc_info *sc, struct sc_chinfo *ch)
sys/dev/sound/pci/cmi.c
285
u_int32_t r = ch->dma_active;
sys/dev/sound/pci/cmi.c
291
ch->dma_active = 0;
sys/dev/sound/pci/cmi.c
296
cmi_ch1_start(struct sc_info *sc, struct sc_chinfo *ch)
sys/dev/sound/pci/cmi.c
298
cmi_dma_prog(sc, ch, CMPCI_REG_DMA1_BASE);
sys/dev/sound/pci/cmi.c
304
ch->dma_active = 1;
sys/dev/sound/pci/cmi.c
308
cmi_ch1_stop(struct sc_info *sc, struct sc_chinfo *ch)
sys/dev/sound/pci/cmi.c
310
u_int32_t r = ch->dma_active;
sys/dev/sound/pci/cmi.c
316
ch->dma_active = 0;
sys/dev/sound/pci/cmi.c
349
struct sc_chinfo *ch = (dir == PCMDIR_PLAY) ? &sc->pch : &sc->rch;
sys/dev/sound/pci/cmi.c
351
ch->parent = sc;
sys/dev/sound/pci/cmi.c
352
ch->channel = c;
sys/dev/sound/pci/cmi.c
353
ch->bps = 1;
sys/dev/sound/pci/cmi.c
354
ch->fmt = SND_FORMAT(AFMT_U8, 1, 0);
sys/dev/sound/pci/cmi.c
355
ch->spd = 8000;
sys/dev/sound/pci/cmi.c
356
ch->buffer = b;
sys/dev/sound/pci/cmi.c
357
ch->dma_active = 0;
sys/dev/sound/pci/cmi.c
358
if (sndbuf_alloc(ch->buffer, sc->parent_dmat, 0, sc->bufsz) != 0) {
sys/dev/sound/pci/cmi.c
363
ch->dir = dir;
sys/dev/sound/pci/cmi.c
365
if (ch->dir == PCMDIR_PLAY) {
sys/dev/sound/pci/cmi.c
366
cmi_dma_prog(sc, ch, CMPCI_REG_DMA0_BASE);
sys/dev/sound/pci/cmi.c
368
cmi_dma_prog(sc, ch, CMPCI_REG_DMA1_BASE);
sys/dev/sound/pci/cmi.c
372
return ch;
sys/dev/sound/pci/cmi.c
378
struct sc_chinfo *ch = data;
sys/dev/sound/pci/cmi.c
379
struct sc_info *sc = ch->parent;
sys/dev/sound/pci/cmi.c
384
ch->bps = 2;
sys/dev/sound/pci/cmi.c
387
ch->bps = 1;
sys/dev/sound/pci/cmi.c
392
ch->bps *= 2;
sys/dev/sound/pci/cmi.c
398
if (ch->dir == PCMDIR_PLAY) {
sys/dev/sound/pci/cmi.c
399
cmi_partial_wr4(ch->parent,
sys/dev/sound/pci/cmi.c
405
cmi_partial_wr4(ch->parent,
sys/dev/sound/pci/cmi.c
412
ch->fmt = format;
sys/dev/sound/pci/cmi.c
420
struct sc_chinfo *ch = data;
sys/dev/sound/pci/cmi.c
421
struct sc_info *sc = ch->parent;
sys/dev/sound/pci/cmi.c
426
if (ch->dir == PCMDIR_PLAY) {
sys/dev/sound/pci/cmi.c
429
cmi_spdif_speed(ch->parent, speed);
sys/dev/sound/pci/cmi.c
431
cmi_partial_wr4(ch->parent,
sys/dev/sound/pci/cmi.c
436
if (speed >= 44100 && ch->parent->spdif_enabled) {
sys/dev/sound/pci/cmi.c
438
cmi_spdif_speed(ch->parent, speed);
sys/dev/sound/pci/cmi.c
440
rsp = cmi_rd(ch->parent, CMPCI_REG_FUNC_1, 4);
sys/dev/sound/pci/cmi.c
444
cmi_partial_wr4(ch->parent,
sys/dev/sound/pci/cmi.c
449
rsp = cmi_rd(ch->parent, CMPCI_REG_FUNC_1, 4);
sys/dev/sound/pci/cmi.c
454
ch->spd = cmpci_regvalue_to_rate(r);
sys/dev/sound/pci/cmi.c
457
(ch->dir == PCMDIR_PLAY) ? "play" : "rec",
sys/dev/sound/pci/cmi.c
458
speed, ch->spd, cmpci_regvalue_to_rate(rsp)));
sys/dev/sound/pci/cmi.c
460
return ch->spd;
sys/dev/sound/pci/cmi.c
466
struct sc_chinfo *ch = data;
sys/dev/sound/pci/cmi.c
467
struct sc_info *sc = ch->parent;
sys/dev/sound/pci/cmi.c
473
sndbuf_resize(ch->buffer, CMI_INTR_PER_BUFFER, blocksize);
sys/dev/sound/pci/cmi.c
481
struct sc_chinfo *ch = data;
sys/dev/sound/pci/cmi.c
482
struct sc_info *sc = ch->parent;
sys/dev/sound/pci/cmi.c
488
if (ch->dir == PCMDIR_PLAY) {
sys/dev/sound/pci/cmi.c
491
cmi_ch0_start(sc, ch);
sys/dev/sound/pci/cmi.c
495
cmi_ch0_stop(sc, ch);
sys/dev/sound/pci/cmi.c
501
cmi_ch1_start(sc, ch);
sys/dev/sound/pci/cmi.c
505
cmi_ch1_stop(sc, ch);
sys/dev/sound/pci/cmi.c
516
struct sc_chinfo *ch = data;
sys/dev/sound/pci/cmi.c
517
struct sc_info *sc = ch->parent;
sys/dev/sound/pci/cmi.c
521
if (ch->dir == PCMDIR_PLAY) {
sys/dev/sound/pci/cmi.c
528
sz = ch->buffer->bufsize;
sys/dev/sound/pci/cmi.c
529
bufptr = (physptr - ch->phys_buf + sz - ch->bps) % sz;
sys/dev/sound/pci/cs4281.c
105
static u_int32_t adcdac_go(struct sc_chinfo *ch, u_int32_t go);
sys/dev/sound/pci/cs4281.c
106
static void adcdac_prog(struct sc_chinfo *ch);
sys/dev/sound/pci/cs4281.c
319
struct sc_chinfo *ch = (dir == PCMDIR_PLAY) ? &sc->pch : &sc->rch;
sys/dev/sound/pci/cs4281.c
321
ch->buffer = b;
sys/dev/sound/pci/cs4281.c
322
if (sndbuf_alloc(ch->buffer, sc->parent_dmat, 0, sc->bufsz) != 0) {
sys/dev/sound/pci/cs4281.c
325
ch->parent = sc;
sys/dev/sound/pci/cs4281.c
326
ch->channel = c;
sys/dev/sound/pci/cs4281.c
328
ch->fmt = SND_FORMAT(AFMT_U8, 1, 0);
sys/dev/sound/pci/cs4281.c
329
ch->spd = 8000;
sys/dev/sound/pci/cs4281.c
330
ch->bps = 1;
sys/dev/sound/pci/cs4281.c
331
ch->blksz = ch->buffer->bufsize;
sys/dev/sound/pci/cs4281.c
333
ch->dma_chan = (dir == PCMDIR_PLAY) ? CS4281_DMA_PLAY : CS4281_DMA_REC;
sys/dev/sound/pci/cs4281.c
334
ch->dma_setup = 0;
sys/dev/sound/pci/cs4281.c
336
adcdac_go(ch, 0);
sys/dev/sound/pci/cs4281.c
337
adcdac_prog(ch);
sys/dev/sound/pci/cs4281.c
339
return ch;
sys/dev/sound/pci/cs4281.c
345
struct sc_chinfo *ch = data;
sys/dev/sound/pci/cs4281.c
346
struct sc_info *sc = ch->parent;
sys/dev/sound/pci/cs4281.c
349
go = adcdac_go(ch, 0);
sys/dev/sound/pci/cs4281.c
353
ch->blksz = min(blocksize, sc->bufsz / 2);
sys/dev/sound/pci/cs4281.c
354
sndbuf_resize(ch->buffer, 2, ch->blksz);
sys/dev/sound/pci/cs4281.c
355
ch->dma_setup = 0;
sys/dev/sound/pci/cs4281.c
356
adcdac_prog(ch);
sys/dev/sound/pci/cs4281.c
357
adcdac_go(ch, go);
sys/dev/sound/pci/cs4281.c
359
DEB(printf("cs4281chan_setblocksize: blksz %d Setting %d\n", blocksize, ch->blksz));
sys/dev/sound/pci/cs4281.c
361
return ch->blksz;
sys/dev/sound/pci/cs4281.c
367
struct sc_chinfo *ch = data;
sys/dev/sound/pci/cs4281.c
368
struct sc_info *sc = ch->parent;
sys/dev/sound/pci/cs4281.c
371
go = adcdac_go(ch, 0); /* pause */
sys/dev/sound/pci/cs4281.c
372
r = (ch->dma_chan == CS4281_DMA_PLAY) ? CS4281PCI_DACSR : CS4281PCI_ADCSR;
sys/dev/sound/pci/cs4281.c
375
adcdac_go(ch, go); /* unpause */
sys/dev/sound/pci/cs4281.c
377
ch->spd = cs4281_rv_to_rate(v);
sys/dev/sound/pci/cs4281.c
378
return ch->spd;
sys/dev/sound/pci/cs4281.c
384
struct sc_chinfo *ch = data;
sys/dev/sound/pci/cs4281.c
385
struct sc_info *sc = ch->parent;
sys/dev/sound/pci/cs4281.c
388
go = adcdac_go(ch, 0); /* pause */
sys/dev/sound/pci/cs4281.c
390
if (ch->dma_chan == CS4281_DMA_PLAY)
sys/dev/sound/pci/cs4281.c
396
cs4281_wr(sc, CS4281PCI_DMR(ch->dma_chan), v);
sys/dev/sound/pci/cs4281.c
398
adcdac_go(ch, go); /* unpause */
sys/dev/sound/pci/cs4281.c
400
ch->fmt = format;
sys/dev/sound/pci/cs4281.c
401
ch->bps = cs4281_format_to_bps(format);
sys/dev/sound/pci/cs4281.c
402
ch->dma_setup = 0;
sys/dev/sound/pci/cs4281.c
410
struct sc_chinfo *ch = data;
sys/dev/sound/pci/cs4281.c
411
struct sc_info *sc = ch->parent;
sys/dev/sound/pci/cs4281.c
415
sz = ch->buffer->bufsize;
sys/dev/sound/pci/cs4281.c
416
dba = cs4281_rd(sc, CS4281PCI_DBA(ch->dma_chan));
sys/dev/sound/pci/cs4281.c
417
dca = cs4281_rd(sc, CS4281PCI_DCA(ch->dma_chan));
sys/dev/sound/pci/cs4281.c
426
struct sc_chinfo *ch = data;
sys/dev/sound/pci/cs4281.c
430
adcdac_prog(ch);
sys/dev/sound/pci/cs4281.c
431
adcdac_go(ch, 1);
sys/dev/sound/pci/cs4281.c
435
adcdac_go(ch, 0);
sys/dev/sound/pci/cs4281.c
470
adcdac_go(struct sc_chinfo *ch, u_int32_t go)
sys/dev/sound/pci/cs4281.c
472
struct sc_info *sc = ch->parent;
sys/dev/sound/pci/cs4281.c
475
going = !(cs4281_rd(sc, CS4281PCI_DCR(ch->dma_chan)) & CS4281PCI_DCR_MSK);
sys/dev/sound/pci/cs4281.c
478
cs4281_clr4(sc, CS4281PCI_DCR(ch->dma_chan), CS4281PCI_DCR_MSK);
sys/dev/sound/pci/cs4281.c
480
cs4281_set4(sc, CS4281PCI_DCR(ch->dma_chan), CS4281PCI_DCR_MSK);
sys/dev/sound/pci/cs4281.c
488
adcdac_prog(struct sc_chinfo *ch)
sys/dev/sound/pci/cs4281.c
490
struct sc_info *sc = ch->parent;
sys/dev/sound/pci/cs4281.c
493
if (!ch->dma_setup) {
sys/dev/sound/pci/cs4281.c
494
go = adcdac_go(ch, 0);
sys/dev/sound/pci/cs4281.c
495
cs4281_wr(sc, CS4281PCI_DBA(ch->dma_chan),
sys/dev/sound/pci/cs4281.c
496
ch->buffer->buf_addr);
sys/dev/sound/pci/cs4281.c
497
cs4281_wr(sc, CS4281PCI_DBC(ch->dma_chan),
sys/dev/sound/pci/cs4281.c
498
ch->buffer->bufsize / ch->bps - 1);
sys/dev/sound/pci/cs4281.c
499
ch->dma_setup = 1;
sys/dev/sound/pci/cs4281.c
500
adcdac_go(ch, go);
sys/dev/sound/pci/csapcm.c
478
csa_setupchan(struct csa_chinfo *ch)
sys/dev/sound/pci/csapcm.c
480
struct csa_info *csa = ch->parent;
sys/dev/sound/pci/csapcm.c
484
if (ch->dir == PCMDIR_PLAY) {
sys/dev/sound/pci/csapcm.c
486
csa_writemem(resp, BA1_PBA, ch->buffer->buf_addr);
sys/dev/sound/pci/csapcm.c
490
if (!(ch->fmt & AFMT_SIGNED))
sys/dev/sound/pci/csapcm.c
492
if (ch->fmt & AFMT_BIGENDIAN)
sys/dev/sound/pci/csapcm.c
494
if (AFMT_CHANNEL(ch->fmt) < 2)
sys/dev/sound/pci/csapcm.c
496
if (ch->fmt & AFMT_8BIT)
sys/dev/sound/pci/csapcm.c
501
if (ch->fmt & AFMT_16BIT)
sys/dev/sound/pci/csapcm.c
503
if (AFMT_CHANNEL(ch->fmt) > 1)
sys/dev/sound/pci/csapcm.c
512
csa_setplaysamplerate(resp, ch->spd);
sys/dev/sound/pci/csapcm.c
513
} else if (ch->dir == PCMDIR_REC) {
sys/dev/sound/pci/csapcm.c
515
csa_writemem(resp, BA1_CBA, ch->buffer->buf_addr);
sys/dev/sound/pci/csapcm.c
521
csa_setcapturesamplerate(resp, ch->spd);
sys/dev/sound/pci/csapcm.c
533
struct csa_chinfo *ch = (dir == PCMDIR_PLAY)? &csa->pch : &csa->rch;
sys/dev/sound/pci/csapcm.c
535
ch->parent = csa;
sys/dev/sound/pci/csapcm.c
536
ch->channel = c;
sys/dev/sound/pci/csapcm.c
537
ch->buffer = b;
sys/dev/sound/pci/csapcm.c
538
ch->dir = dir;
sys/dev/sound/pci/csapcm.c
539
if (sndbuf_alloc(ch->buffer, csa->parent_dmat, 0, CS461x_BUFFSIZE) != 0)
sys/dev/sound/pci/csapcm.c
541
return ch;
sys/dev/sound/pci/csapcm.c
547
struct csa_chinfo *ch = data;
sys/dev/sound/pci/csapcm.c
549
ch->fmt = format;
sys/dev/sound/pci/csapcm.c
556
struct csa_chinfo *ch = data;
sys/dev/sound/pci/csapcm.c
558
ch->spd = speed;
sys/dev/sound/pci/csapcm.c
559
return ch->spd; /* XXX calc real speed */
sys/dev/sound/pci/csapcm.c
571
struct csa_chinfo *ch = data;
sys/dev/sound/pci/csapcm.c
572
struct csa_info *csa = ch->parent;
sys/dev/sound/pci/csapcm.c
579
csa_setupchan(ch);
sys/dev/sound/pci/csapcm.c
580
if (ch->dir == PCMDIR_PLAY)
sys/dev/sound/pci/csapcm.c
585
if (ch->dir == PCMDIR_PLAY)
sys/dev/sound/pci/csapcm.c
597
struct csa_chinfo *ch = data;
sys/dev/sound/pci/csapcm.c
598
struct csa_info *csa = ch->parent;
sys/dev/sound/pci/csapcm.c
604
if (ch->dir == PCMDIR_PLAY) {
sys/dev/sound/pci/csapcm.c
605
ptr = csa_readmem(resp, BA1_PBA) - ch->buffer->buf_addr;
sys/dev/sound/pci/csapcm.c
606
if ((ch->fmt & AFMT_U8) != 0 || (ch->fmt & AFMT_S8) != 0)
sys/dev/sound/pci/csapcm.c
609
ptr = csa_readmem(resp, BA1_CBA) - ch->buffer->buf_addr;
sys/dev/sound/pci/csapcm.c
610
if ((ch->fmt & AFMT_U8) != 0 || (ch->fmt & AFMT_S8) != 0)
sys/dev/sound/pci/csapcm.c
620
struct csa_chinfo *ch = data;
sys/dev/sound/pci/csapcm.c
621
return (ch->dir == PCMDIR_PLAY)? &csa_playcaps : &csa_reccaps;
sys/dev/sound/pci/emu10k1.c
1000
ch->fmt = format;
sys/dev/sound/pci/emu10k1.c
1007
struct sc_rchinfo *ch = data;
sys/dev/sound/pci/emu10k1.c
1009
if (ch->num == 0) {
sys/dev/sound/pci/emu10k1.c
1010
if (ch->parent->audigy)
sys/dev/sound/pci/emu10k1.c
1015
if (ch->num == 1)
sys/dev/sound/pci/emu10k1.c
1017
if (ch->num == 2)
sys/dev/sound/pci/emu10k1.c
1019
ch->spd = speed;
sys/dev/sound/pci/emu10k1.c
1020
return ch->spd;
sys/dev/sound/pci/emu10k1.c
1026
struct sc_rchinfo *ch = data;
sys/dev/sound/pci/emu10k1.c
1027
struct sc_info *sc = ch->parent;
sys/dev/sound/pci/emu10k1.c
1029
ch->blksz = blocksize;
sys/dev/sound/pci/emu10k1.c
1040
struct sc_rchinfo *ch = data;
sys/dev/sound/pci/emu10k1.c
1041
struct sc_info *sc = ch->parent;
sys/dev/sound/pci/emu10k1.c
1075
ch->run = 1;
sys/dev/sound/pci/emu10k1.c
1076
emu_wrptr(sc, 0, ch->sizereg, sz);
sys/dev/sound/pci/emu10k1.c
1077
if (ch->num == 0) {
sys/dev/sound/pci/emu10k1.c
1080
if (AFMT_CHANNEL(ch->fmt) > 1)
sys/dev/sound/pci/emu10k1.c
1082
val |= audigy_recval(ch->spd);
sys/dev/sound/pci/emu10k1.c
1085
if (AFMT_CHANNEL(ch->fmt) > 1)
sys/dev/sound/pci/emu10k1.c
1087
val |= emu_recval(ch->spd);
sys/dev/sound/pci/emu10k1.c
1090
emu_wrptr(sc, 0, ch->setupreg, 0);
sys/dev/sound/pci/emu10k1.c
1091
emu_wrptr(sc, 0, ch->setupreg, val);
sys/dev/sound/pci/emu10k1.c
1094
val |= ch->irqmask;
sys/dev/sound/pci/emu10k1.c
1100
ch->run = 0;
sys/dev/sound/pci/emu10k1.c
1101
emu_wrptr(sc, 0, ch->sizereg, 0);
sys/dev/sound/pci/emu10k1.c
1102
if (ch->setupreg)
sys/dev/sound/pci/emu10k1.c
1103
emu_wrptr(sc, 0, ch->setupreg, 0);
sys/dev/sound/pci/emu10k1.c
1105
val &= ~ch->irqmask;
sys/dev/sound/pci/emu10k1.c
1122
struct sc_rchinfo *ch = data;
sys/dev/sound/pci/emu10k1.c
1123
struct sc_info *sc = ch->parent;
sys/dev/sound/pci/emu10k1.c
1127
r = emu_rdptr(sc, 0, ch->idxreg) & 0x0000ffff;
sys/dev/sound/pci/emu10k1.c
1136
struct sc_rchinfo *ch = data;
sys/dev/sound/pci/emu10k1.c
1138
return &emu_reccaps[ch->num];
sys/dev/sound/pci/emu10k1.c
1746
u_int32_t spcs, ch, tmp, i;
sys/dev/sound/pci/emu10k1.c
1782
for (ch = 0; ch < NUM_G; ch++) {
sys/dev/sound/pci/emu10k1.c
1783
emu_wrptr(sc, ch, EMU_CHAN_DCYSUSV, ENV_OFF);
sys/dev/sound/pci/emu10k1.c
1784
emu_wrptr(sc, ch, EMU_CHAN_IP, 0);
sys/dev/sound/pci/emu10k1.c
1785
emu_wrptr(sc, ch, EMU_CHAN_VTFT, 0xffff);
sys/dev/sound/pci/emu10k1.c
1786
emu_wrptr(sc, ch, EMU_CHAN_CVCF, 0xffff);
sys/dev/sound/pci/emu10k1.c
1787
emu_wrptr(sc, ch, EMU_CHAN_PTRX, 0);
sys/dev/sound/pci/emu10k1.c
1788
emu_wrptr(sc, ch, EMU_CHAN_CPF, 0);
sys/dev/sound/pci/emu10k1.c
1789
emu_wrptr(sc, ch, EMU_CHAN_CCR, 0);
sys/dev/sound/pci/emu10k1.c
1791
emu_wrptr(sc, ch, EMU_CHAN_PSST, 0);
sys/dev/sound/pci/emu10k1.c
1792
emu_wrptr(sc, ch, EMU_CHAN_DSL, 0x10);
sys/dev/sound/pci/emu10k1.c
1793
emu_wrptr(sc, ch, EMU_CHAN_CCCA, 0);
sys/dev/sound/pci/emu10k1.c
1794
emu_wrptr(sc, ch, EMU_CHAN_Z1, 0);
sys/dev/sound/pci/emu10k1.c
1795
emu_wrptr(sc, ch, EMU_CHAN_Z2, 0);
sys/dev/sound/pci/emu10k1.c
1796
emu_wrptr(sc, ch, EMU_CHAN_FXRT, 0xd01c0000);
sys/dev/sound/pci/emu10k1.c
1798
emu_wrptr(sc, ch, EMU_CHAN_ATKHLDM, 0);
sys/dev/sound/pci/emu10k1.c
1799
emu_wrptr(sc, ch, EMU_CHAN_DCYSUSM, 0);
sys/dev/sound/pci/emu10k1.c
1800
emu_wrptr(sc, ch, EMU_CHAN_IFATN, 0xffff);
sys/dev/sound/pci/emu10k1.c
1801
emu_wrptr(sc, ch, EMU_CHAN_PEFE, 0);
sys/dev/sound/pci/emu10k1.c
1802
emu_wrptr(sc, ch, EMU_CHAN_FMMOD, 0);
sys/dev/sound/pci/emu10k1.c
1803
emu_wrptr(sc, ch, EMU_CHAN_TREMFRQ, 24); /* 1 Hz */
sys/dev/sound/pci/emu10k1.c
1804
emu_wrptr(sc, ch, EMU_CHAN_FM2FRQ2, 24); /* 1 Hz */
sys/dev/sound/pci/emu10k1.c
1805
emu_wrptr(sc, ch, EMU_CHAN_TEMPENV, 0);
sys/dev/sound/pci/emu10k1.c
1808
emu_wrptr(sc, ch, EMU_CHAN_LFOVAL2, 0);
sys/dev/sound/pci/emu10k1.c
1809
emu_wrptr(sc, ch, EMU_CHAN_LFOVAL1, 0);
sys/dev/sound/pci/emu10k1.c
1810
emu_wrptr(sc, ch, EMU_CHAN_ATKHLDV, 0);
sys/dev/sound/pci/emu10k1.c
1811
emu_wrptr(sc, ch, EMU_CHAN_ENVVOL, 0);
sys/dev/sound/pci/emu10k1.c
1812
emu_wrptr(sc, ch, EMU_CHAN_ENVVAL, 0);
sys/dev/sound/pci/emu10k1.c
1816
emu_wrptr(sc, ch, 0x4c, 0);
sys/dev/sound/pci/emu10k1.c
1817
emu_wrptr(sc, ch, 0x4d, 0);
sys/dev/sound/pci/emu10k1.c
1818
emu_wrptr(sc, ch, 0x4e, 0);
sys/dev/sound/pci/emu10k1.c
1819
emu_wrptr(sc, ch, 0x4f, 0);
sys/dev/sound/pci/emu10k1.c
1821
emu_wrptr(sc, ch, EMU_A_CHAN_FXRT1, 0x03020100);
sys/dev/sound/pci/emu10k1.c
1822
emu_wrptr(sc, ch, EMU_A_CHAN_FXRT2, 0x3f3f3f3f);
sys/dev/sound/pci/emu10k1.c
1823
emu_wrptr(sc, ch, EMU_A_CHAN_SENDAMOUNTS, 0);
sys/dev/sound/pci/emu10k1.c
1826
sc->voice[ch].vnum = ch;
sys/dev/sound/pci/emu10k1.c
1827
sc->voice[ch].slave = NULL;
sys/dev/sound/pci/emu10k1.c
1828
sc->voice[ch].busy = 0;
sys/dev/sound/pci/emu10k1.c
1829
sc->voice[ch].ismaster = 0;
sys/dev/sound/pci/emu10k1.c
1830
sc->voice[ch].running = 0;
sys/dev/sound/pci/emu10k1.c
1831
sc->voice[ch].b16 = 0;
sys/dev/sound/pci/emu10k1.c
1832
sc->voice[ch].stereo = 0;
sys/dev/sound/pci/emu10k1.c
1833
sc->voice[ch].speed = 0;
sys/dev/sound/pci/emu10k1.c
1834
sc->voice[ch].start = 0;
sys/dev/sound/pci/emu10k1.c
1835
sc->voice[ch].end = 0;
sys/dev/sound/pci/emu10k1.c
1836
sc->voice[ch].channel = NULL;
sys/dev/sound/pci/emu10k1.c
1905
for (ch = 0; ch < NUM_G; ch++) {
sys/dev/sound/pci/emu10k1.c
1906
emu_wrptr(sc, ch, EMU_CHAN_MAPA, tmp | EMU_CHAN_MAP_PTI_MASK);
sys/dev/sound/pci/emu10k1.c
1907
emu_wrptr(sc, ch, EMU_CHAN_MAPB, tmp | EMU_CHAN_MAP_PTI_MASK);
sys/dev/sound/pci/emu10k1.c
1986
u_int32_t ch;
sys/dev/sound/pci/emu10k1.c
1989
for (ch = 0; ch < NUM_G; ch++)
sys/dev/sound/pci/emu10k1.c
1990
emu_wrptr(sc, ch, EMU_CHAN_DCYSUSV, ENV_OFF);
sys/dev/sound/pci/emu10k1.c
1991
for (ch = 0; ch < NUM_G; ch++) {
sys/dev/sound/pci/emu10k1.c
1992
emu_wrptr(sc, ch, EMU_CHAN_VTFT, 0);
sys/dev/sound/pci/emu10k1.c
1993
emu_wrptr(sc, ch, EMU_CHAN_CVCF, 0);
sys/dev/sound/pci/emu10k1.c
1994
emu_wrptr(sc, ch, EMU_CHAN_PTRX, 0);
sys/dev/sound/pci/emu10k1.c
1995
emu_wrptr(sc, ch, EMU_CHAN_CPF, 0);
sys/dev/sound/pci/emu10k1.c
619
emu_vsetup(struct sc_pchinfo *ch)
sys/dev/sound/pci/emu10k1.c
621
struct emu_voice *v = ch->master;
sys/dev/sound/pci/emu10k1.c
623
if (ch->fmt) {
sys/dev/sound/pci/emu10k1.c
624
v->b16 = (ch->fmt & AFMT_16BIT) ? 1 : 0;
sys/dev/sound/pci/emu10k1.c
625
v->stereo = (AFMT_CHANNEL(ch->fmt) > 1) ? 1 : 0;
sys/dev/sound/pci/emu10k1.c
631
if (ch->spd) {
sys/dev/sound/pci/emu10k1.c
632
v->speed = ch->spd;
sys/dev/sound/pci/emu10k1.c
812
struct sc_pchinfo *ch;
sys/dev/sound/pci/emu10k1.c
816
ch = &sc->pch[sc->pnum++];
sys/dev/sound/pci/emu10k1.c
817
ch->buffer = b;
sys/dev/sound/pci/emu10k1.c
818
ch->parent = sc;
sys/dev/sound/pci/emu10k1.c
819
ch->channel = c;
sys/dev/sound/pci/emu10k1.c
820
ch->blksz = sc->bufsz / 2;
sys/dev/sound/pci/emu10k1.c
821
ch->fmt = SND_FORMAT(AFMT_U8, 1, 0);
sys/dev/sound/pci/emu10k1.c
822
ch->spd = 8000;
sys/dev/sound/pci/emu10k1.c
824
ch->master = emu_valloc(sc);
sys/dev/sound/pci/emu10k1.c
825
ch->slave = emu_valloc(sc);
sys/dev/sound/pci/emu10k1.c
827
r = (emu_vinit(sc, ch->master, ch->slave, sc->bufsz, ch->buffer))
sys/dev/sound/pci/emu10k1.c
828
? NULL : ch;
sys/dev/sound/pci/emu10k1.c
836
struct sc_pchinfo *ch = data;
sys/dev/sound/pci/emu10k1.c
837
struct sc_info *sc = ch->parent;
sys/dev/sound/pci/emu10k1.c
841
r = emu_memfree(sc, ch->buffer->buf);
sys/dev/sound/pci/emu10k1.c
850
struct sc_pchinfo *ch = data;
sys/dev/sound/pci/emu10k1.c
852
ch->fmt = format;
sys/dev/sound/pci/emu10k1.c
859
struct sc_pchinfo *ch = data;
sys/dev/sound/pci/emu10k1.c
861
ch->spd = speed;
sys/dev/sound/pci/emu10k1.c
862
return ch->spd;
sys/dev/sound/pci/emu10k1.c
868
struct sc_pchinfo *ch = data;
sys/dev/sound/pci/emu10k1.c
869
struct sc_info *sc = ch->parent;
sys/dev/sound/pci/emu10k1.c
871
ch->blksz = blocksize;
sys/dev/sound/pci/emu10k1.c
881
struct sc_pchinfo *ch = data;
sys/dev/sound/pci/emu10k1.c
882
struct sc_info *sc = ch->parent;
sys/dev/sound/pci/emu10k1.c
889
emu_vsetup(ch);
sys/dev/sound/pci/emu10k1.c
890
emu_vwrite(sc, ch->master);
sys/dev/sound/pci/emu10k1.c
895
ch->master->b16 ? 16 : 8,
sys/dev/sound/pci/emu10k1.c
896
ch->master->stereo ? "stereo" : "mono",
sys/dev/sound/pci/emu10k1.c
897
ch->master->speed);
sys/dev/sound/pci/emu10k1.c
898
emu_vdump(sc, ch->master);
sys/dev/sound/pci/emu10k1.c
899
emu_vdump(sc, ch->slave);
sys/dev/sound/pci/emu10k1.c
902
ch->run = (go == PCMTRIG_START) ? 1 : 0;
sys/dev/sound/pci/emu10k1.c
903
emu_vtrigger(sc, ch->master, ch->run);
sys/dev/sound/pci/emu10k1.c
911
struct sc_pchinfo *ch = data;
sys/dev/sound/pci/emu10k1.c
912
struct sc_info *sc = ch->parent;
sys/dev/sound/pci/emu10k1.c
916
r = emu_vpos(sc, ch->master);
sys/dev/sound/pci/emu10k1.c
947
struct sc_rchinfo *ch;
sys/dev/sound/pci/emu10k1.c
950
ch = &sc->rch[sc->rnum];
sys/dev/sound/pci/emu10k1.c
951
ch->buffer = b;
sys/dev/sound/pci/emu10k1.c
952
ch->parent = sc;
sys/dev/sound/pci/emu10k1.c
953
ch->channel = c;
sys/dev/sound/pci/emu10k1.c
954
ch->blksz = sc->bufsz / 2;
sys/dev/sound/pci/emu10k1.c
955
ch->fmt = SND_FORMAT(AFMT_U8, 1, 0);
sys/dev/sound/pci/emu10k1.c
956
ch->spd = 8000;
sys/dev/sound/pci/emu10k1.c
957
ch->num = sc->rnum;
sys/dev/sound/pci/emu10k1.c
960
ch->idxreg = sc->audigy ? EMU_A_ADCIDX : EMU_ADCIDX;
sys/dev/sound/pci/emu10k1.c
961
ch->basereg = EMU_ADCBA;
sys/dev/sound/pci/emu10k1.c
962
ch->sizereg = EMU_ADCBS;
sys/dev/sound/pci/emu10k1.c
963
ch->setupreg = EMU_ADCCR;
sys/dev/sound/pci/emu10k1.c
964
ch->irqmask = EMU_INTE_ADCBUFENABLE;
sys/dev/sound/pci/emu10k1.c
968
ch->idxreg = EMU_FXIDX;
sys/dev/sound/pci/emu10k1.c
969
ch->basereg = EMU_FXBA;
sys/dev/sound/pci/emu10k1.c
970
ch->sizereg = EMU_FXBS;
sys/dev/sound/pci/emu10k1.c
971
ch->setupreg = EMU_FXWC;
sys/dev/sound/pci/emu10k1.c
972
ch->irqmask = EMU_INTE_EFXBUFENABLE;
sys/dev/sound/pci/emu10k1.c
976
ch->idxreg = EMU_MICIDX;
sys/dev/sound/pci/emu10k1.c
977
ch->basereg = EMU_MICBA;
sys/dev/sound/pci/emu10k1.c
978
ch->sizereg = EMU_MICBS;
sys/dev/sound/pci/emu10k1.c
979
ch->setupreg = 0;
sys/dev/sound/pci/emu10k1.c
980
ch->irqmask = EMU_INTE_MICBUFENABLE;
sys/dev/sound/pci/emu10k1.c
984
if (sndbuf_alloc(ch->buffer, sc->parent_dmat, 0, sc->bufsz) != 0)
sys/dev/sound/pci/emu10k1.c
988
emu_wrptr(sc, 0, ch->basereg, ch->buffer->buf_addr);
sys/dev/sound/pci/emu10k1.c
989
emu_wrptr(sc, 0, ch->sizereg, 0); /* off */
sys/dev/sound/pci/emu10k1.c
991
return ch;
sys/dev/sound/pci/emu10k1.c
998
struct sc_rchinfo *ch = data;
sys/dev/sound/pci/emu10kx-pcm.c
1010
struct emu_pcm_rchinfo *ch = c_devinfo;
sys/dev/sound/pci/emu10kx-pcm.c
1011
struct emu_pcm_info *sc = ch->pcm;
sys/dev/sound/pci/emu10kx-pcm.c
1014
r = emu_rdptr(sc->card, 0, ch->idxreg) & 0x0000ffff;
sys/dev/sound/pci/emu10kx-pcm.c
1042
struct emu_pcm_rchinfo *ch;
sys/dev/sound/pci/emu10kx-pcm.c
1048
ch = &(sc->rch_efx);
sys/dev/sound/pci/emu10kx-pcm.c
1049
ch->fmt = SND_FORMAT(AFMT_S16_LE, 1, 0);
sys/dev/sound/pci/emu10kx-pcm.c
1050
ch->spd = sc->is_emu10k1 ? 48000*32 : 48000 * 64;
sys/dev/sound/pci/emu10kx-pcm.c
1051
ch->idxreg = EMU_FXIDX;
sys/dev/sound/pci/emu10kx-pcm.c
1052
ch->basereg = EMU_FXBA;
sys/dev/sound/pci/emu10kx-pcm.c
1053
ch->sizereg = EMU_FXBS;
sys/dev/sound/pci/emu10kx-pcm.c
1054
ch->irqmask = EMU_INTE_EFXBUFENABLE;
sys/dev/sound/pci/emu10kx-pcm.c
1055
ch->iprmask = EMU_IPR_EFXBUFFULL | EMU_IPR_EFXBUFHALFFULL;
sys/dev/sound/pci/emu10kx-pcm.c
1056
ch->buffer = b;
sys/dev/sound/pci/emu10kx-pcm.c
1057
ch->pcm = sc;
sys/dev/sound/pci/emu10kx-pcm.c
1058
ch->channel = c;
sys/dev/sound/pci/emu10kx-pcm.c
1059
ch->blksz = sc->bufsz / 2;
sys/dev/sound/pci/emu10kx-pcm.c
1061
if (sndbuf_alloc(ch->buffer, emu_gettag(sc->card), 0, sc->bufsz) != 0)
sys/dev/sound/pci/emu10kx-pcm.c
1064
emu_wrptr(sc->card, 0, ch->basereg, ch->buffer->buf_addr);
sys/dev/sound/pci/emu10kx-pcm.c
1065
emu_wrptr(sc->card, 0, ch->sizereg, 0); /* off */
sys/dev/sound/pci/emu10kx-pcm.c
1066
return (ch);
sys/dev/sound/pci/emu10kx-pcm.c
1080
struct emu_pcm_rchinfo *ch = c_devinfo;
sys/dev/sound/pci/emu10kx-pcm.c
1083
return (ch->spd);
sys/dev/sound/pci/emu10kx-pcm.c
1089
struct emu_pcm_rchinfo *ch = c_devinfo;
sys/dev/sound/pci/emu10kx-pcm.c
1091
ch->blksz = blocksize;
sys/dev/sound/pci/emu10kx-pcm.c
1098
if (ch->blksz < (ch->pcm->bufsz / 2))
sys/dev/sound/pci/emu10kx-pcm.c
1099
ch->blksz = ch->pcm->bufsz / 2;
sys/dev/sound/pci/emu10kx-pcm.c
1100
return (ch->blksz);
sys/dev/sound/pci/emu10kx-pcm.c
1106
struct emu_pcm_rchinfo *ch = c_devinfo;
sys/dev/sound/pci/emu10kx-pcm.c
1107
struct emu_pcm_info *sc = ch->pcm;
sys/dev/sound/pci/emu10kx-pcm.c
1136
ch->run = 1;
sys/dev/sound/pci/emu10kx-pcm.c
1137
emu_wrptr(sc->card, 0, ch->sizereg, sz);
sys/dev/sound/pci/emu10kx-pcm.c
1138
ch->ihandle = emu_intr_register(sc->card, ch->irqmask, ch->iprmask, &emu_pcm_intr, sc);
sys/dev/sound/pci/emu10kx-pcm.c
1155
ch->run = 0;
sys/dev/sound/pci/emu10kx-pcm.c
1162
emu_wrptr(sc->card, 0, ch->sizereg, 0);
sys/dev/sound/pci/emu10kx-pcm.c
1163
(void)emu_intr_unregister(sc->card, ch->ihandle);
sys/dev/sound/pci/emu10kx-pcm.c
1180
struct emu_pcm_rchinfo *ch = c_devinfo;
sys/dev/sound/pci/emu10kx-pcm.c
1181
struct emu_pcm_info *sc = ch->pcm;
sys/dev/sound/pci/emu10kx-pcm.c
1184
r = emu_rdptr(sc->card, 0, ch->idxreg) & 0x0000ffff;
sys/dev/sound/pci/emu10kx-pcm.c
1192
struct emu_pcm_rchinfo *ch = c_devinfo;
sys/dev/sound/pci/emu10kx-pcm.c
1193
struct emu_pcm_info *sc = ch->pcm;
sys/dev/sound/pci/emu10kx-pcm.c
1204
struct emu_pcm_rchinfo *ch = c_devinfo;
sys/dev/sound/pci/emu10kx-pcm.c
1205
struct emu_pcm_info *sc = ch->pcm;
sys/dev/sound/pci/emu10kx-pcm.c
709
struct emu_pcm_pchinfo *ch;
sys/dev/sound/pci/emu10kx-pcm.c
717
ch = &(sc->pch[sc->pnum++]);
sys/dev/sound/pci/emu10kx-pcm.c
718
ch->buffer = b;
sys/dev/sound/pci/emu10kx-pcm.c
719
ch->pcm = sc;
sys/dev/sound/pci/emu10kx-pcm.c
720
ch->channel = c;
sys/dev/sound/pci/emu10kx-pcm.c
721
ch->blksz = sc->bufsz;
sys/dev/sound/pci/emu10kx-pcm.c
722
ch->fmt = SND_FORMAT(AFMT_U8, 1, 0);
sys/dev/sound/pci/emu10kx-pcm.c
723
ch->spd = 8000;
sys/dev/sound/pci/emu10kx-pcm.c
724
ch->master = emu_valloc(sc->card);
sys/dev/sound/pci/emu10kx-pcm.c
729
ch->slave = emu_valloc(sc->card);
sys/dev/sound/pci/emu10kx-pcm.c
730
ch->timer = emu_timer_create(sc->card);
sys/dev/sound/pci/emu10kx-pcm.c
731
r = (emu_vinit(sc->card, ch->master, ch->slave, EMU_PLAY_BUFSZ, ch->buffer)) ? NULL : ch;
sys/dev/sound/pci/emu10kx-pcm.c
738
struct emu_pcm_pchinfo *ch = c_devinfo;
sys/dev/sound/pci/emu10kx-pcm.c
739
struct emu_pcm_info *sc = ch->pcm;
sys/dev/sound/pci/emu10kx-pcm.c
741
emu_timer_clear(sc->card, ch->timer);
sys/dev/sound/pci/emu10kx-pcm.c
742
if (ch->slave != NULL)
sys/dev/sound/pci/emu10kx-pcm.c
743
emu_vfree(sc->card, ch->slave);
sys/dev/sound/pci/emu10kx-pcm.c
744
emu_vfree(sc->card, ch->master);
sys/dev/sound/pci/emu10kx-pcm.c
751
struct emu_pcm_pchinfo *ch = c_devinfo;
sys/dev/sound/pci/emu10kx-pcm.c
753
ch->fmt = format;
sys/dev/sound/pci/emu10kx-pcm.c
760
struct emu_pcm_pchinfo *ch = c_devinfo;
sys/dev/sound/pci/emu10kx-pcm.c
762
ch->spd = speed;
sys/dev/sound/pci/emu10kx-pcm.c
763
return (ch->spd);
sys/dev/sound/pci/emu10kx-pcm.c
769
struct emu_pcm_pchinfo *ch = c_devinfo;
sys/dev/sound/pci/emu10kx-pcm.c
770
struct emu_pcm_info *sc = ch->pcm;
sys/dev/sound/pci/emu10kx-pcm.c
772
if (blocksize > ch->pcm->bufsz)
sys/dev/sound/pci/emu10kx-pcm.c
773
blocksize = ch->pcm->bufsz;
sys/dev/sound/pci/emu10kx-pcm.c
775
ch->blksz = blocksize;
sys/dev/sound/pci/emu10kx-pcm.c
776
emu_timer_set(sc->card, ch->timer, ch->blksz / ch->buffer->align);
sys/dev/sound/pci/emu10kx-pcm.c
778
return (ch->blksz);
sys/dev/sound/pci/emu10kx-pcm.c
784
struct emu_pcm_pchinfo *ch = c_devinfo;
sys/dev/sound/pci/emu10kx-pcm.c
785
struct emu_pcm_info *sc = ch->pcm;
sys/dev/sound/pci/emu10kx-pcm.c
792
emu_vsetup(ch->master, ch->fmt, ch->spd);
sys/dev/sound/pci/emu10kx-pcm.c
793
if (AFMT_CHANNEL(ch->fmt) > 1)
sys/dev/sound/pci/emu10kx-pcm.c
794
emu_vroute(sc->card, &(sc->rt), ch->master);
sys/dev/sound/pci/emu10kx-pcm.c
796
emu_vroute(sc->card, &(sc->rt_mono), ch->master);
sys/dev/sound/pci/emu10kx-pcm.c
797
emu_vwrite(sc->card, ch->master);
sys/dev/sound/pci/emu10kx-pcm.c
798
emu_timer_set(sc->card, ch->timer, ch->blksz /
sys/dev/sound/pci/emu10kx-pcm.c
799
ch->buffer->align);
sys/dev/sound/pci/emu10kx-pcm.c
800
emu_timer_enable(sc->card, ch->timer, 1);
sys/dev/sound/pci/emu10kx-pcm.c
803
ch->run = (go == PCMTRIG_START) ? 1 : 0;
sys/dev/sound/pci/emu10kx-pcm.c
804
emu_vtrigger(sc->card, ch->master, ch->run);
sys/dev/sound/pci/emu10kx-pcm.c
812
struct emu_pcm_pchinfo *ch = c_devinfo;
sys/dev/sound/pci/emu10kx-pcm.c
813
struct emu_pcm_info *sc = ch->pcm;
sys/dev/sound/pci/emu10kx-pcm.c
816
r = emu_vpos(sc->card, ch->master);
sys/dev/sound/pci/emu10kx-pcm.c
824
struct emu_pcm_pchinfo *ch = c_devinfo;
sys/dev/sound/pci/emu10kx-pcm.c
825
struct emu_pcm_info *sc = ch->pcm;
sys/dev/sound/pci/emu10kx-pcm.c
861
struct emu_pcm_rchinfo *ch;
sys/dev/sound/pci/emu10kx-pcm.c
864
ch = &sc->rch_adc;
sys/dev/sound/pci/emu10kx-pcm.c
865
ch->buffer = b;
sys/dev/sound/pci/emu10kx-pcm.c
866
ch->pcm = sc;
sys/dev/sound/pci/emu10kx-pcm.c
867
ch->channel = c;
sys/dev/sound/pci/emu10kx-pcm.c
868
ch->blksz = sc->bufsz / 2; /* We rise interrupt for half-full buffer */
sys/dev/sound/pci/emu10kx-pcm.c
869
ch->fmt = SND_FORMAT(AFMT_U8, 1, 0);
sys/dev/sound/pci/emu10kx-pcm.c
870
ch->spd = 8000;
sys/dev/sound/pci/emu10kx-pcm.c
871
ch->idxreg = sc->is_emu10k1 ? EMU_ADCIDX : EMU_A_ADCIDX;
sys/dev/sound/pci/emu10kx-pcm.c
872
ch->basereg = EMU_ADCBA;
sys/dev/sound/pci/emu10kx-pcm.c
873
ch->sizereg = EMU_ADCBS;
sys/dev/sound/pci/emu10kx-pcm.c
874
ch->setupreg = EMU_ADCCR;
sys/dev/sound/pci/emu10kx-pcm.c
875
ch->irqmask = EMU_INTE_ADCBUFENABLE;
sys/dev/sound/pci/emu10kx-pcm.c
876
ch->iprmask = EMU_IPR_ADCBUFFULL | EMU_IPR_ADCBUFHALFFULL;
sys/dev/sound/pci/emu10kx-pcm.c
878
if (sndbuf_alloc(ch->buffer, emu_gettag(sc->card), 0, sc->bufsz) != 0)
sys/dev/sound/pci/emu10kx-pcm.c
881
ch->timer = emu_timer_create(sc->card);
sys/dev/sound/pci/emu10kx-pcm.c
882
emu_wrptr(sc->card, 0, ch->basereg, ch->buffer->buf_addr);
sys/dev/sound/pci/emu10kx-pcm.c
883
emu_wrptr(sc->card, 0, ch->sizereg, 0); /* off */
sys/dev/sound/pci/emu10kx-pcm.c
884
return (ch);
sys/dev/sound/pci/emu10kx-pcm.c
891
struct emu_pcm_rchinfo *ch = c_devinfo;
sys/dev/sound/pci/emu10kx-pcm.c
892
struct emu_pcm_info *sc = ch->pcm;
sys/dev/sound/pci/emu10kx-pcm.c
894
emu_timer_clear(sc->card, ch->timer);
sys/dev/sound/pci/emu10kx-pcm.c
901
struct emu_pcm_rchinfo *ch = c_devinfo;
sys/dev/sound/pci/emu10kx-pcm.c
903
ch->fmt = format;
sys/dev/sound/pci/emu10kx-pcm.c
910
struct emu_pcm_rchinfo *ch = c_devinfo;
sys/dev/sound/pci/emu10kx-pcm.c
912
if (ch->pcm->is_emu10k1) {
sys/dev/sound/pci/emu10kx-pcm.c
917
ch->spd = speed;
sys/dev/sound/pci/emu10kx-pcm.c
918
return (ch->spd);
sys/dev/sound/pci/emu10kx-pcm.c
924
struct emu_pcm_rchinfo *ch = c_devinfo;
sys/dev/sound/pci/emu10kx-pcm.c
925
struct emu_pcm_info *sc = ch->pcm;
sys/dev/sound/pci/emu10kx-pcm.c
927
ch->blksz = blocksize;
sys/dev/sound/pci/emu10kx-pcm.c
933
if (ch->blksz < (ch->pcm->bufsz / 2)) {
sys/dev/sound/pci/emu10kx-pcm.c
934
emu_timer_set(sc->card, ch->timer, ch->blksz /
sys/dev/sound/pci/emu10kx-pcm.c
935
ch->buffer->align);
sys/dev/sound/pci/emu10kx-pcm.c
936
emu_timer_enable(sc->card, ch->timer, 1);
sys/dev/sound/pci/emu10kx-pcm.c
938
emu_timer_enable(sc->card, ch->timer, 0);
sys/dev/sound/pci/emu10kx-pcm.c
940
return (ch->blksz);
sys/dev/sound/pci/emu10kx-pcm.c
946
struct emu_pcm_rchinfo *ch = c_devinfo;
sys/dev/sound/pci/emu10kx-pcm.c
947
struct emu_pcm_info *sc = ch->pcm;
sys/dev/sound/pci/emu10kx-pcm.c
976
ch->run = 1;
sys/dev/sound/pci/emu10kx-pcm.c
977
emu_wrptr(sc->card, 0, ch->sizereg, sz);
sys/dev/sound/pci/emu10kx-pcm.c
979
if (AFMT_CHANNEL(ch->fmt) > 1)
sys/dev/sound/pci/emu10kx-pcm.c
981
val |= sc->is_emu10k1 ? emu_k1_recval(ch->spd) : emu_k2_recval(ch->spd);
sys/dev/sound/pci/emu10kx-pcm.c
982
emu_wrptr(sc->card, 0, ch->setupreg, 0);
sys/dev/sound/pci/emu10kx-pcm.c
983
emu_wrptr(sc->card, 0, ch->setupreg, val);
sys/dev/sound/pci/emu10kx-pcm.c
984
ch->ihandle = emu_intr_register(sc->card, ch->irqmask, ch->iprmask, &emu_pcm_intr, sc);
sys/dev/sound/pci/emu10kx-pcm.c
989
ch->run = 0;
sys/dev/sound/pci/emu10kx-pcm.c
990
emu_wrptr(sc->card, 0, ch->sizereg, 0);
sys/dev/sound/pci/emu10kx-pcm.c
991
if (ch->setupreg)
sys/dev/sound/pci/emu10kx-pcm.c
992
emu_wrptr(sc->card, 0, ch->setupreg, 0);
sys/dev/sound/pci/emu10kx-pcm.c
993
(void)emu_intr_unregister(sc->card, ch->ihandle);
sys/dev/sound/pci/emu10kx.c
2647
uint32_t ch, tmp;
sys/dev/sound/pci/emu10kx.c
2722
for (ch = 0; ch < NUM_G; ch++) {
sys/dev/sound/pci/emu10kx.c
2723
emu_wrptr(sc, ch, EMU_CHAN_MAPA, tmp | EMU_CHAN_MAP_PTI_MASK);
sys/dev/sound/pci/emu10kx.c
2724
emu_wrptr(sc, ch, EMU_CHAN_MAPB, tmp | EMU_CHAN_MAP_PTI_MASK);
sys/dev/sound/pci/emu10kx.c
2731
for (ch = 0; ch < NUM_G; ch++) {
sys/dev/sound/pci/emu10kx.c
2732
emu_wrptr(sc, ch, EMU_CHAN_DCYSUSV, 0);
sys/dev/sound/pci/emu10kx.c
2733
emu_wrptr(sc, ch, EMU_CHAN_IP, 0);
sys/dev/sound/pci/emu10kx.c
2734
emu_wrptr(sc, ch, EMU_CHAN_VTFT, 0xffff);
sys/dev/sound/pci/emu10kx.c
2735
emu_wrptr(sc, ch, EMU_CHAN_CVCF, 0xffff);
sys/dev/sound/pci/emu10kx.c
2736
emu_wrptr(sc, ch, EMU_CHAN_PTRX, 0);
sys/dev/sound/pci/emu10kx.c
2737
emu_wrptr(sc, ch, EMU_CHAN_CPF, 0);
sys/dev/sound/pci/emu10kx.c
2738
emu_wrptr(sc, ch, EMU_CHAN_CCR, 0);
sys/dev/sound/pci/emu10kx.c
2740
emu_wrptr(sc, ch, EMU_CHAN_PSST, 0);
sys/dev/sound/pci/emu10kx.c
2741
emu_wrptr(sc, ch, EMU_CHAN_DSL, 0x10);
sys/dev/sound/pci/emu10kx.c
2742
emu_wrptr(sc, ch, EMU_CHAN_CCCA, 0);
sys/dev/sound/pci/emu10kx.c
2743
emu_wrptr(sc, ch, EMU_CHAN_Z1, 0);
sys/dev/sound/pci/emu10kx.c
2744
emu_wrptr(sc, ch, EMU_CHAN_Z2, 0);
sys/dev/sound/pci/emu10kx.c
2745
emu_wrptr(sc, ch, EMU_CHAN_FXRT, 0xd01c0000);
sys/dev/sound/pci/emu10kx.c
2747
emu_wrptr(sc, ch, EMU_CHAN_ATKHLDM, 0);
sys/dev/sound/pci/emu10kx.c
2748
emu_wrptr(sc, ch, EMU_CHAN_DCYSUSM, 0);
sys/dev/sound/pci/emu10kx.c
2749
emu_wrptr(sc, ch, EMU_CHAN_IFATN, 0xffff);
sys/dev/sound/pci/emu10kx.c
2750
emu_wrptr(sc, ch, EMU_CHAN_PEFE, 0);
sys/dev/sound/pci/emu10kx.c
2751
emu_wrptr(sc, ch, EMU_CHAN_FMMOD, 0);
sys/dev/sound/pci/emu10kx.c
2752
emu_wrptr(sc, ch, EMU_CHAN_TREMFRQ, 24); /* 1 Hz */
sys/dev/sound/pci/emu10kx.c
2753
emu_wrptr(sc, ch, EMU_CHAN_FM2FRQ2, 24); /* 1 Hz */
sys/dev/sound/pci/emu10kx.c
2754
emu_wrptr(sc, ch, EMU_CHAN_TEMPENV, 0);
sys/dev/sound/pci/emu10kx.c
2757
emu_wrptr(sc, ch, EMU_CHAN_LFOVAL2, 0);
sys/dev/sound/pci/emu10kx.c
2758
emu_wrptr(sc, ch, EMU_CHAN_LFOVAL1, 0);
sys/dev/sound/pci/emu10kx.c
2759
emu_wrptr(sc, ch, EMU_CHAN_ATKHLDV, 0);
sys/dev/sound/pci/emu10kx.c
2760
emu_wrptr(sc, ch, EMU_CHAN_ENVVOL, 0);
sys/dev/sound/pci/emu10kx.c
2761
emu_wrptr(sc, ch, EMU_CHAN_ENVVAL, 0);
sys/dev/sound/pci/emu10kx.c
2764
emu_wrptr(sc, ch, 0x4c, 0x0);
sys/dev/sound/pci/emu10kx.c
2765
emu_wrptr(sc, ch, 0x4d, 0x0);
sys/dev/sound/pci/emu10kx.c
2766
emu_wrptr(sc, ch, 0x4e, 0x0);
sys/dev/sound/pci/emu10kx.c
2767
emu_wrptr(sc, ch, 0x4f, 0x0);
sys/dev/sound/pci/emu10kx.c
2768
emu_wrptr(sc, ch, EMU_A_CHAN_FXRT1, 0x3f3f3f3f);
sys/dev/sound/pci/emu10kx.c
2769
emu_wrptr(sc, ch, EMU_A_CHAN_FXRT2, 0x3f3f3f3f);
sys/dev/sound/pci/emu10kx.c
2770
emu_wrptr(sc, ch, EMU_A_CHAN_SENDAMOUNTS, 0x0);
sys/dev/sound/pci/emu10kx.c
2887
uint32_t ch;
sys/dev/sound/pci/emu10kx.c
2891
for (ch = 0; ch < NUM_G; ch++)
sys/dev/sound/pci/emu10kx.c
2892
emu_wrptr(sc, ch, EMU_CHAN_DCYSUSV, 0);
sys/dev/sound/pci/emu10kx.c
2893
for (ch = 0; ch < NUM_G; ch++) {
sys/dev/sound/pci/emu10kx.c
2894
emu_wrptr(sc, ch, EMU_CHAN_VTFT, 0);
sys/dev/sound/pci/emu10kx.c
2895
emu_wrptr(sc, ch, EMU_CHAN_CVCF, 0);
sys/dev/sound/pci/emu10kx.c
2896
emu_wrptr(sc, ch, EMU_CHAN_PTRX, 0);
sys/dev/sound/pci/emu10kx.c
2897
emu_wrptr(sc, ch, EMU_CHAN_CPF, 0);
sys/dev/sound/pci/envy24.c
1137
envy24_setvolume(struct sc_info *sc, unsigned ch)
sys/dev/sound/pci/envy24.c
1140
device_printf(sc->dev, "envy24_setvolume(sc, %d)\n", ch);
sys/dev/sound/pci/envy24.c
1149
envy24_wrmt(sc, ENVY24_MT_VOLIDX, ch * 2, 1);
sys/dev/sound/pci/envy24.c
1150
envy24_wrmt(sc, ENVY24_MT_VOLUME, 0x7f00 | sc->left[ch], 2);
sys/dev/sound/pci/envy24.c
1151
envy24_wrmt(sc, ENVY24_MT_VOLIDX, ch * 2 + 1, 1);
sys/dev/sound/pci/envy24.c
1152
envy24_wrmt(sc, ENVY24_MT_VOLUME, (sc->right[ch] << 8) | 0x7f, 2);
sys/dev/sound/pci/envy24.c
1156
envy24_mutevolume(struct sc_info *sc, unsigned ch)
sys/dev/sound/pci/envy24.c
1161
device_printf(sc->dev, "envy24_mutevolume(sc, %d)\n", ch);
sys/dev/sound/pci/envy24.c
1164
envy24_wrmt(sc, ENVY24_MT_VOLIDX, ch * 2, 1);
sys/dev/sound/pci/envy24.c
1166
envy24_wrmt(sc, ENVY24_MT_VOLIDX, ch * 2 + 1, 1);
sys/dev/sound/pci/envy24.c
1393
envy24_p32sl(struct sc_chinfo *ch)
sys/dev/sound/pci/envy24.c
1401
length = sndbuf_getready(ch->buffer) / 8;
sys/dev/sound/pci/envy24.c
1402
dmabuf = ch->parent->pbuf;
sys/dev/sound/pci/envy24.c
1403
data = (u_int32_t *)ch->data;
sys/dev/sound/pci/envy24.c
1404
src = sndbuf_getreadyptr(ch->buffer) / 4;
sys/dev/sound/pci/envy24.c
1405
dst = src / 2 + ch->offset;
sys/dev/sound/pci/envy24.c
1406
ssize = ch->size / 4;
sys/dev/sound/pci/envy24.c
1407
dsize = ch->size / 8;
sys/dev/sound/pci/envy24.c
1408
slot = ch->num * 2;
sys/dev/sound/pci/envy24.c
1423
envy24_p16sl(struct sc_chinfo *ch)
sys/dev/sound/pci/envy24.c
1432
device_printf(ch->parent->dev, "envy24_p16sl()\n");
sys/dev/sound/pci/envy24.c
1434
length = sndbuf_getready(ch->buffer) / 4;
sys/dev/sound/pci/envy24.c
1435
dmabuf = ch->parent->pbuf;
sys/dev/sound/pci/envy24.c
1436
data = (u_int16_t *)ch->data;
sys/dev/sound/pci/envy24.c
1437
src = sndbuf_getreadyptr(ch->buffer) / 2;
sys/dev/sound/pci/envy24.c
1438
dst = src / 2 + ch->offset;
sys/dev/sound/pci/envy24.c
1439
ssize = ch->size / 2;
sys/dev/sound/pci/envy24.c
1440
dsize = ch->size / 4;
sys/dev/sound/pci/envy24.c
1441
slot = ch->num * 2;
sys/dev/sound/pci/envy24.c
1443
device_printf(ch->parent->dev, "envy24_p16sl():%lu-->%lu(%lu)\n", src, dst, length);
sys/dev/sound/pci/envy24.c
1468
envy24_p8u(struct sc_chinfo *ch)
sys/dev/sound/pci/envy24.c
1476
length = sndbuf_getready(ch->buffer) / 2;
sys/dev/sound/pci/envy24.c
1477
dmabuf = ch->parent->pbuf;
sys/dev/sound/pci/envy24.c
1478
data = (u_int8_t *)ch->data;
sys/dev/sound/pci/envy24.c
1479
src = sndbuf_getreadyptr(ch->buffer);
sys/dev/sound/pci/envy24.c
1480
dst = src / 2 + ch->offset;
sys/dev/sound/pci/envy24.c
1481
ssize = ch->size;
sys/dev/sound/pci/envy24.c
1482
dsize = ch->size / 4;
sys/dev/sound/pci/envy24.c
1483
slot = ch->num * 2;
sys/dev/sound/pci/envy24.c
1498
envy24_r32sl(struct sc_chinfo *ch)
sys/dev/sound/pci/envy24.c
1506
length = sndbuf_getfree(ch->buffer) / 8;
sys/dev/sound/pci/envy24.c
1507
dmabuf = ch->parent->rbuf;
sys/dev/sound/pci/envy24.c
1508
data = (u_int32_t *)ch->data;
sys/dev/sound/pci/envy24.c
1509
dst = sndbuf_getfreeptr(ch->buffer) / 4;
sys/dev/sound/pci/envy24.c
1510
src = dst / 2 + ch->offset;
sys/dev/sound/pci/envy24.c
1511
dsize = ch->size / 4;
sys/dev/sound/pci/envy24.c
1512
ssize = ch->size / 8;
sys/dev/sound/pci/envy24.c
1513
slot = (ch->num - ENVY24_CHAN_REC_ADC1) * 2;
sys/dev/sound/pci/envy24.c
1528
envy24_r16sl(struct sc_chinfo *ch)
sys/dev/sound/pci/envy24.c
1536
length = sndbuf_getfree(ch->buffer) / 4;
sys/dev/sound/pci/envy24.c
1537
dmabuf = ch->parent->rbuf;
sys/dev/sound/pci/envy24.c
1538
data = (u_int16_t *)ch->data;
sys/dev/sound/pci/envy24.c
1539
dst = sndbuf_getfreeptr(ch->buffer) / 2;
sys/dev/sound/pci/envy24.c
1540
src = dst / 2 + ch->offset;
sys/dev/sound/pci/envy24.c
1541
dsize = ch->size / 2;
sys/dev/sound/pci/envy24.c
1542
ssize = ch->size / 8;
sys/dev/sound/pci/envy24.c
1543
slot = (ch->num - ENVY24_CHAN_REC_ADC1) * 2;
sys/dev/sound/pci/envy24.c
1564
struct sc_chinfo *ch;
sys/dev/sound/pci/envy24.c
1578
ch = &sc->chan[num];
sys/dev/sound/pci/envy24.c
1579
ch->size = 8 * ENVY24_SAMPLE_NUM;
sys/dev/sound/pci/envy24.c
1580
ch->data = malloc(ch->size, M_ENVY24, M_NOWAIT);
sys/dev/sound/pci/envy24.c
1581
if (ch->data == NULL) {
sys/dev/sound/pci/envy24.c
1582
ch->size = 0;
sys/dev/sound/pci/envy24.c
1583
ch = NULL;
sys/dev/sound/pci/envy24.c
1586
ch->buffer = b;
sys/dev/sound/pci/envy24.c
1587
ch->channel = c;
sys/dev/sound/pci/envy24.c
1588
ch->parent = sc;
sys/dev/sound/pci/envy24.c
1589
ch->dir = dir;
sys/dev/sound/pci/envy24.c
1591
ch->num = envy24_chanmap[num];
sys/dev/sound/pci/envy24.c
1593
sndbuf_setup(ch->buffer, ch->data, ch->size);
sys/dev/sound/pci/envy24.c
1596
ch->unit = 4;
sys/dev/sound/pci/envy24.c
1597
ch->blk = 10240;
sys/dev/sound/pci/envy24.c
1601
return ch;
sys/dev/sound/pci/envy24.c
1607
struct sc_chinfo *ch = data;
sys/dev/sound/pci/envy24.c
1608
struct sc_info *sc = ch->parent;
sys/dev/sound/pci/envy24.c
1614
free(ch->data, M_ENVY24);
sys/dev/sound/pci/envy24.c
1615
ch->data = NULL;
sys/dev/sound/pci/envy24.c
1624
struct sc_chinfo *ch = data;
sys/dev/sound/pci/envy24.c
1625
struct sc_info *sc = ch->parent;
sys/dev/sound/pci/envy24.c
1635
if (ch->dir == PCMDIR_PLAY)
sys/dev/sound/pci/envy24.c
1652
ch->format = format;
sys/dev/sound/pci/envy24.c
1653
ch->emldma = emltab[i].emldma;
sys/dev/sound/pci/envy24.c
1654
if (ch->unit > emltab[i].unit)
sys/dev/sound/pci/envy24.c
1655
ch->blk *= ch->unit / emltab[i].unit;
sys/dev/sound/pci/envy24.c
1657
ch->blk /= emltab[i].unit / ch->unit;
sys/dev/sound/pci/envy24.c
1658
ch->unit = emltab[i].unit;
sys/dev/sound/pci/envy24.c
1661
ch->size = ch->unit * ENVY24_SAMPLE_NUM;
sys/dev/sound/pci/envy24.c
1663
if (ch->dir == PCMDIR_PLAY)
sys/dev/sound/pci/envy24.c
1664
bsize = ch->blk * 4 / ENVY24_PLAY_BUFUNIT;
sys/dev/sound/pci/envy24.c
1666
bsize = ch->blk * 4 / ENVY24_REC_BUFUNIT;
sys/dev/sound/pci/envy24.c
1667
bsize *= ch->unit;
sys/dev/sound/pci/envy24.c
1668
bcnt = ch->size / bsize;
sys/dev/sound/pci/envy24.c
1669
sndbuf_resize(ch->buffer, bcnt, bsize);
sys/dev/sound/pci/envy24.c
1690
struct sc_chinfo *ch = data;
sys/dev/sound/pci/envy24.c
1695
device_printf(ch->parent->dev, "envy24chan_setspeed(obj, data, %d)\n", speed);
sys/dev/sound/pci/envy24.c
1704
ch->speed = prev;
sys/dev/sound/pci/envy24.c
1707
device_printf(ch->parent->dev, "envy24chan_setspeed(): return %d\n", ch->speed);
sys/dev/sound/pci/envy24.c
1709
return ch->speed;
sys/dev/sound/pci/envy24.c
1715
struct sc_chinfo *ch = data;
sys/dev/sound/pci/envy24.c
1725
for (size = ch->size / 2; size > 0; size /= 2) {
sys/dev/sound/pci/envy24.c
1732
ch->blk = prev / ch->unit;
sys/dev/sound/pci/envy24.c
1733
if (ch->dir == PCMDIR_PLAY)
sys/dev/sound/pci/envy24.c
1734
ch->blk *= ENVY24_PLAY_BUFUNIT / 4;
sys/dev/sound/pci/envy24.c
1736
ch->blk *= ENVY24_REC_BUFUNIT / 4;
sys/dev/sound/pci/envy24.c
1739
if (ch->dir == PCMDIR_PLAY)
sys/dev/sound/pci/envy24.c
1740
bsize = ch->blk * 4 / ENVY24_PLAY_BUFUNIT;
sys/dev/sound/pci/envy24.c
1742
bsize = ch->blk * 4 / ENVY24_REC_BUFUNIT;
sys/dev/sound/pci/envy24.c
1743
bsize *= ch->unit;
sys/dev/sound/pci/envy24.c
1744
bcnt = ch->size / bsize;
sys/dev/sound/pci/envy24.c
1745
sndbuf_resize(ch->buffer, bcnt, bsize);
sys/dev/sound/pci/envy24.c
1758
struct sc_chinfo *ch = data;
sys/dev/sound/pci/envy24.c
1759
struct sc_info *sc = ch->parent;
sys/dev/sound/pci/envy24.c
1769
if (ch->dir == PCMDIR_PLAY)
sys/dev/sound/pci/envy24.c
1780
sc->speed = envy24_setspeed(sc, ch->speed);
sys/dev/sound/pci/envy24.c
1784
else if (ch->speed != 0 && ch->speed != sc->speed) {
sys/dev/sound/pci/envy24.c
1788
if (ch->speed == 0)
sys/dev/sound/pci/envy24.c
1789
ch->channel->speed = sc->speed;
sys/dev/sound/pci/envy24.c
1794
ch->offset = 0;
sys/dev/sound/pci/envy24.c
1795
sc->blk[slot] = ch->blk;
sys/dev/sound/pci/envy24.c
1798
ptr = envy24_gethwptr(sc, ch->dir);
sys/dev/sound/pci/envy24.c
1799
ch->offset = ((ptr / ch->blk + 1) * ch->blk %
sys/dev/sound/pci/envy24.c
1800
(ch->size / 4)) * 4 / ch->unit;
sys/dev/sound/pci/envy24.c
1801
if (ch->blk < sc->blk[slot])
sys/dev/sound/pci/envy24.c
1802
sc->blk[slot] = ch->blk;
sys/dev/sound/pci/envy24.c
1804
if (ch->dir == PCMDIR_PLAY) {
sys/dev/sound/pci/envy24.c
1805
ch->emldma(ch);
sys/dev/sound/pci/envy24.c
1806
envy24_setvolume(sc, ch->num);
sys/dev/sound/pci/envy24.c
1808
envy24_updintr(sc, ch->dir);
sys/dev/sound/pci/envy24.c
1810
envy24_start(sc, ch->dir);
sys/dev/sound/pci/envy24.c
1811
ch->run = 1;
sys/dev/sound/pci/envy24.c
1817
if (ch->run != 1) {
sys/dev/sound/pci/envy24.c
1821
ch->emldma(ch);
sys/dev/sound/pci/envy24.c
1827
if (ch->run != 1) {
sys/dev/sound/pci/envy24.c
1831
ch->emldma(ch);
sys/dev/sound/pci/envy24.c
1834
if (ch->run) {
sys/dev/sound/pci/envy24.c
1838
ch->run = 0;
sys/dev/sound/pci/envy24.c
1840
if (ch->dir == PCMDIR_PLAY)
sys/dev/sound/pci/envy24.c
1841
envy24_mutevolume(sc, ch->num);
sys/dev/sound/pci/envy24.c
1843
envy24_stop(sc, ch->dir);
sys/dev/sound/pci/envy24.c
1847
else if (ch->blk == sc->blk[slot]) {
sys/dev/sound/pci/envy24.c
1850
if (sc->chan[i].dir == ch->dir &&
sys/dev/sound/pci/envy24.c
1855
if (ch->blk != sc->blk[slot])
sys/dev/sound/pci/envy24.c
1856
envy24_updintr(sc, ch->dir);
sys/dev/sound/pci/envy24.c
1870
struct sc_chinfo *ch = data;
sys/dev/sound/pci/envy24.c
1871
struct sc_info *sc = ch->parent;
sys/dev/sound/pci/envy24.c
1878
ptr = envy24_gethwptr(sc, ch->dir);
sys/dev/sound/pci/envy24.c
1879
rtn = ptr * ch->unit;
sys/dev/sound/pci/envy24.c
1892
struct sc_chinfo *ch = data;
sys/dev/sound/pci/envy24.c
1893
struct sc_info *sc = ch->parent;
sys/dev/sound/pci/envy24.c
1900
if (ch->dir == PCMDIR_PLAY) {
sys/dev/sound/pci/envy24.c
1988
int ch = envy24_mixmap[dev];
sys/dev/sound/pci/envy24.c
1996
if (dev != 0 && ch == -1)
sys/dev/sound/pci/envy24.c
1998
hwch = envy24_chanmap[ch];
sys/dev/sound/pci/envy24.c
2018
if (hwch > ENVY24_CHAN_PLAY_SPDIF || sc->chan[ch].run)
sys/dev/sound/pci/envy24.c
2030
int ch = envy24_mixmap[src];
sys/dev/sound/pci/envy24.c
2035
if (ch > ENVY24_CHAN_PLAY_SPDIF)
sys/dev/sound/pci/envy24.c
2036
sc->src = ch;
sys/dev/sound/pci/envy24.c
2057
struct sc_chinfo *ch;
sys/dev/sound/pci/envy24.c
2080
ch = &sc->chan[i];
sys/dev/sound/pci/envy24.c
2082
if (ch->run)
sys/dev/sound/pci/envy24.c
2083
device_printf(sc->dev, "envy24_intr(): chan[%d].blk = %d\n", i, ch->blk);
sys/dev/sound/pci/envy24.c
2085
if (ch->run && ch->blk <= feed) {
sys/dev/sound/pci/envy24.c
2087
chn_intr(ch->channel);
sys/dev/sound/pci/envy24.c
2103
ch = &sc->chan[i];
sys/dev/sound/pci/envy24.c
2104
if (ch->run && ch->blk <= feed) {
sys/dev/sound/pci/envy24.c
2106
chn_intr(ch->channel);
sys/dev/sound/pci/envy24ht.c
1098
envy24ht_setvolume(struct sc_info *sc, unsigned ch)
sys/dev/sound/pci/envy24ht.c
1101
device_printf(sc->dev, "envy24ht_setvolume(sc, %d)\n", ch);
sys/dev/sound/pci/envy24ht.c
1102
envy24ht_wrmt(sc, ENVY24HT_MT_VOLIDX, ch * 2, 1);
sys/dev/sound/pci/envy24ht.c
1103
envy24ht_wrmt(sc, ENVY24HT_MT_VOLUME, 0x7f00 | sc->left[ch], 2);
sys/dev/sound/pci/envy24ht.c
1104
envy24ht_wrmt(sc, ENVY24HT_MT_VOLIDX, ch * 2 + 1, 1);
sys/dev/sound/pci/envy24ht.c
1105
envy24ht_wrmt(sc, ENVY24HT_MT_VOLUME, (sc->right[ch] << 8) | 0x7f, 2);
sys/dev/sound/pci/envy24ht.c
1110
envy24ht_mutevolume(struct sc_info *sc, unsigned ch)
sys/dev/sound/pci/envy24ht.c
1115
device_printf(sc->dev, "envy24ht_mutevolume(sc, %d)\n", ch);
sys/dev/sound/pci/envy24ht.c
1117
envy24ht_wrmt(sc, ENVY24HT_MT_VOLIDX, ch * 2, 1);
sys/dev/sound/pci/envy24ht.c
1119
envy24ht_wrmt(sc, ENVY24HT_MT_VOLIDX, ch * 2 + 1, 1);
sys/dev/sound/pci/envy24ht.c
1302
envy24ht_p32sl(struct sc_chinfo *ch)
sys/dev/sound/pci/envy24ht.c
1310
length = sndbuf_getready(ch->buffer) / 8;
sys/dev/sound/pci/envy24ht.c
1311
dmabuf = ch->parent->pbuf;
sys/dev/sound/pci/envy24ht.c
1312
data = (u_int32_t *)ch->data;
sys/dev/sound/pci/envy24ht.c
1313
src = sndbuf_getreadyptr(ch->buffer) / 4;
sys/dev/sound/pci/envy24ht.c
1314
dst = src / 2 + ch->offset;
sys/dev/sound/pci/envy24ht.c
1315
ssize = ch->size / 4;
sys/dev/sound/pci/envy24ht.c
1316
dsize = ch->size / 8;
sys/dev/sound/pci/envy24ht.c
1317
slot = ch->num * 2;
sys/dev/sound/pci/envy24ht.c
1332
envy24ht_p16sl(struct sc_chinfo *ch)
sys/dev/sound/pci/envy24ht.c
1341
device_printf(ch->parent->dev, "envy24ht_p16sl()\n");
sys/dev/sound/pci/envy24ht.c
1343
length = sndbuf_getready(ch->buffer) / 4;
sys/dev/sound/pci/envy24ht.c
1344
dmabuf = ch->parent->pbuf;
sys/dev/sound/pci/envy24ht.c
1345
data = (u_int16_t *)ch->data;
sys/dev/sound/pci/envy24ht.c
1346
src = sndbuf_getreadyptr(ch->buffer) / 2;
sys/dev/sound/pci/envy24ht.c
1347
dst = src / 2 + ch->offset;
sys/dev/sound/pci/envy24ht.c
1348
ssize = ch->size / 2;
sys/dev/sound/pci/envy24ht.c
1349
dsize = ch->size / 4;
sys/dev/sound/pci/envy24ht.c
1350
slot = ch->num * 2;
sys/dev/sound/pci/envy24ht.c
1352
device_printf(ch->parent->dev, "envy24ht_p16sl():%lu-->%lu(%lu)\n", src, dst, length);
sys/dev/sound/pci/envy24ht.c
1377
envy24ht_p8u(struct sc_chinfo *ch)
sys/dev/sound/pci/envy24ht.c
1385
length = sndbuf_getready(ch->buffer) / 2;
sys/dev/sound/pci/envy24ht.c
1386
dmabuf = ch->parent->pbuf;
sys/dev/sound/pci/envy24ht.c
1387
data = (u_int8_t *)ch->data;
sys/dev/sound/pci/envy24ht.c
1388
src = sndbuf_getreadyptr(ch->buffer);
sys/dev/sound/pci/envy24ht.c
1389
dst = src / 2 + ch->offset;
sys/dev/sound/pci/envy24ht.c
1390
ssize = ch->size;
sys/dev/sound/pci/envy24ht.c
1391
dsize = ch->size / 4;
sys/dev/sound/pci/envy24ht.c
1392
slot = ch->num * 2;
sys/dev/sound/pci/envy24ht.c
1407
envy24ht_r32sl(struct sc_chinfo *ch)
sys/dev/sound/pci/envy24ht.c
1415
length = sndbuf_getfree(ch->buffer) / 8;
sys/dev/sound/pci/envy24ht.c
1416
dmabuf = ch->parent->rbuf;
sys/dev/sound/pci/envy24ht.c
1417
data = (u_int32_t *)ch->data;
sys/dev/sound/pci/envy24ht.c
1418
dst = sndbuf_getfreeptr(ch->buffer) / 4;
sys/dev/sound/pci/envy24ht.c
1419
src = dst / 2 + ch->offset;
sys/dev/sound/pci/envy24ht.c
1420
dsize = ch->size / 4;
sys/dev/sound/pci/envy24ht.c
1421
ssize = ch->size / 8;
sys/dev/sound/pci/envy24ht.c
1422
slot = (ch->num - ENVY24HT_CHAN_REC_ADC1) * 2;
sys/dev/sound/pci/envy24ht.c
1437
envy24ht_r16sl(struct sc_chinfo *ch)
sys/dev/sound/pci/envy24ht.c
1445
length = sndbuf_getfree(ch->buffer) / 4;
sys/dev/sound/pci/envy24ht.c
1446
dmabuf = ch->parent->rbuf;
sys/dev/sound/pci/envy24ht.c
1447
data = (u_int16_t *)ch->data;
sys/dev/sound/pci/envy24ht.c
1448
dst = sndbuf_getfreeptr(ch->buffer) / 2;
sys/dev/sound/pci/envy24ht.c
1449
src = dst / 2 + ch->offset;
sys/dev/sound/pci/envy24ht.c
1450
dsize = ch->size / 2;
sys/dev/sound/pci/envy24ht.c
1451
ssize = ch->size / 8;
sys/dev/sound/pci/envy24ht.c
1452
slot = (ch->num - ENVY24HT_CHAN_REC_ADC1) * 2;
sys/dev/sound/pci/envy24ht.c
1473
struct sc_chinfo *ch;
sys/dev/sound/pci/envy24ht.c
1489
ch = &sc->chan[num];
sys/dev/sound/pci/envy24ht.c
1490
ch->size = 8 * ENVY24HT_SAMPLE_NUM;
sys/dev/sound/pci/envy24ht.c
1491
ch->data = malloc(ch->size, M_ENVY24HT, M_NOWAIT);
sys/dev/sound/pci/envy24ht.c
1492
if (ch->data == NULL) {
sys/dev/sound/pci/envy24ht.c
1493
ch->size = 0;
sys/dev/sound/pci/envy24ht.c
1494
ch = NULL;
sys/dev/sound/pci/envy24ht.c
1497
ch->buffer = b;
sys/dev/sound/pci/envy24ht.c
1498
ch->channel = c;
sys/dev/sound/pci/envy24ht.c
1499
ch->parent = sc;
sys/dev/sound/pci/envy24ht.c
1500
ch->dir = dir;
sys/dev/sound/pci/envy24ht.c
1502
ch->num = envy24ht_chanmap[num];
sys/dev/sound/pci/envy24ht.c
1504
sndbuf_setup(ch->buffer, ch->data, ch->size);
sys/dev/sound/pci/envy24ht.c
1507
ch->unit = 4;
sys/dev/sound/pci/envy24ht.c
1508
ch->blk = 10240;
sys/dev/sound/pci/envy24ht.c
1512
return ch;
sys/dev/sound/pci/envy24ht.c
1518
struct sc_chinfo *ch = data;
sys/dev/sound/pci/envy24ht.c
1519
struct sc_info *sc = ch->parent;
sys/dev/sound/pci/envy24ht.c
1525
free(ch->data, M_ENVY24HT);
sys/dev/sound/pci/envy24ht.c
1526
ch->data = NULL;
sys/dev/sound/pci/envy24ht.c
1535
struct sc_chinfo *ch = data;
sys/dev/sound/pci/envy24ht.c
1536
struct sc_info *sc = ch->parent;
sys/dev/sound/pci/envy24ht.c
1546
if (ch->dir == PCMDIR_PLAY)
sys/dev/sound/pci/envy24ht.c
1563
ch->format = format;
sys/dev/sound/pci/envy24ht.c
1564
ch->emldma = emltab[i].emldma;
sys/dev/sound/pci/envy24ht.c
1565
if (ch->unit > emltab[i].unit)
sys/dev/sound/pci/envy24ht.c
1566
ch->blk *= ch->unit / emltab[i].unit;
sys/dev/sound/pci/envy24ht.c
1568
ch->blk /= emltab[i].unit / ch->unit;
sys/dev/sound/pci/envy24ht.c
1569
ch->unit = emltab[i].unit;
sys/dev/sound/pci/envy24ht.c
1572
ch->size = ch->unit * ENVY24HT_SAMPLE_NUM;
sys/dev/sound/pci/envy24ht.c
1574
if (ch->dir == PCMDIR_PLAY)
sys/dev/sound/pci/envy24ht.c
1575
bsize = ch->blk * 4 / ENVY24HT_PLAY_BUFUNIT;
sys/dev/sound/pci/envy24ht.c
1577
bsize = ch->blk * 4 / ENVY24HT_REC_BUFUNIT;
sys/dev/sound/pci/envy24ht.c
1578
bsize *= ch->unit;
sys/dev/sound/pci/envy24ht.c
1579
bcnt = ch->size / bsize;
sys/dev/sound/pci/envy24ht.c
1580
sndbuf_resize(ch->buffer, bcnt, bsize);
sys/dev/sound/pci/envy24ht.c
1601
struct sc_chinfo *ch = data;
sys/dev/sound/pci/envy24ht.c
1606
device_printf(ch->parent->dev, "envy24htchan_setspeed(obj, data, %d)\n", speed);
sys/dev/sound/pci/envy24ht.c
1615
ch->speed = prev;
sys/dev/sound/pci/envy24ht.c
1618
device_printf(ch->parent->dev, "envy24htchan_setspeed(): return %d\n", ch->speed);
sys/dev/sound/pci/envy24ht.c
1620
return ch->speed;
sys/dev/sound/pci/envy24ht.c
1626
struct sc_chinfo *ch = data;
sys/dev/sound/pci/envy24ht.c
1636
for (size = ch->size / 2; size > 0; size /= 2) {
sys/dev/sound/pci/envy24ht.c
1643
ch->blk = prev / ch->unit;
sys/dev/sound/pci/envy24ht.c
1644
if (ch->dir == PCMDIR_PLAY)
sys/dev/sound/pci/envy24ht.c
1645
ch->blk *= ENVY24HT_PLAY_BUFUNIT / 4;
sys/dev/sound/pci/envy24ht.c
1647
ch->blk *= ENVY24HT_REC_BUFUNIT / 4;
sys/dev/sound/pci/envy24ht.c
1650
if (ch->dir == PCMDIR_PLAY)
sys/dev/sound/pci/envy24ht.c
1651
bsize = ch->blk * 4 / ENVY24HT_PLAY_BUFUNIT;
sys/dev/sound/pci/envy24ht.c
1653
bsize = ch->blk * 4 / ENVY24HT_REC_BUFUNIT;
sys/dev/sound/pci/envy24ht.c
1654
bsize *= ch->unit;
sys/dev/sound/pci/envy24ht.c
1655
bcnt = ch->size / bsize;
sys/dev/sound/pci/envy24ht.c
1656
sndbuf_resize(ch->buffer, bcnt, bsize);
sys/dev/sound/pci/envy24ht.c
1669
struct sc_chinfo *ch = data;
sys/dev/sound/pci/envy24ht.c
1670
struct sc_info *sc = ch->parent;
sys/dev/sound/pci/envy24ht.c
1680
if (ch->dir == PCMDIR_PLAY)
sys/dev/sound/pci/envy24ht.c
1691
sc->speed = envy24ht_setspeed(sc, ch->speed);
sys/dev/sound/pci/envy24ht.c
1695
else if (ch->speed != 0 && ch->speed != sc->speed) {
sys/dev/sound/pci/envy24ht.c
1699
if (ch->speed == 0)
sys/dev/sound/pci/envy24ht.c
1700
ch->channel->speed = sc->speed;
sys/dev/sound/pci/envy24ht.c
1705
ch->offset = 0;
sys/dev/sound/pci/envy24ht.c
1706
sc->blk[slot] = ch->blk;
sys/dev/sound/pci/envy24ht.c
1709
ptr = envy24ht_gethwptr(sc, ch->dir);
sys/dev/sound/pci/envy24ht.c
1710
ch->offset = ((ptr / ch->blk + 1) * ch->blk %
sys/dev/sound/pci/envy24ht.c
1711
(ch->size / 4)) * 4 / ch->unit;
sys/dev/sound/pci/envy24ht.c
1712
if (ch->blk < sc->blk[slot])
sys/dev/sound/pci/envy24ht.c
1713
sc->blk[slot] = ch->blk;
sys/dev/sound/pci/envy24ht.c
1715
if (ch->dir == PCMDIR_PLAY) {
sys/dev/sound/pci/envy24ht.c
1716
ch->emldma(ch);
sys/dev/sound/pci/envy24ht.c
1717
envy24ht_setvolume(sc, ch->num);
sys/dev/sound/pci/envy24ht.c
1719
envy24ht_updintr(sc, ch->dir);
sys/dev/sound/pci/envy24ht.c
1721
envy24ht_start(sc, ch->dir);
sys/dev/sound/pci/envy24ht.c
1722
ch->run = 1;
sys/dev/sound/pci/envy24ht.c
1728
if (ch->run != 1) {
sys/dev/sound/pci/envy24ht.c
1732
ch->emldma(ch);
sys/dev/sound/pci/envy24ht.c
1738
if (ch->run != 1) {
sys/dev/sound/pci/envy24ht.c
1742
ch->emldma(ch);
sys/dev/sound/pci/envy24ht.c
1745
if (ch->run) {
sys/dev/sound/pci/envy24ht.c
1749
ch->run = 0;
sys/dev/sound/pci/envy24ht.c
1751
if (ch->dir == PCMDIR_PLAY)
sys/dev/sound/pci/envy24ht.c
1752
envy24ht_mutevolume(sc, ch->num);
sys/dev/sound/pci/envy24ht.c
1754
envy24ht_stop(sc, ch->dir);
sys/dev/sound/pci/envy24ht.c
1779
struct sc_chinfo *ch = data;
sys/dev/sound/pci/envy24ht.c
1780
struct sc_info *sc = ch->parent;
sys/dev/sound/pci/envy24ht.c
1787
ptr = envy24ht_gethwptr(sc, ch->dir);
sys/dev/sound/pci/envy24ht.c
1788
rtn = ptr * ch->unit;
sys/dev/sound/pci/envy24ht.c
1801
struct sc_chinfo *ch = data;
sys/dev/sound/pci/envy24ht.c
1802
struct sc_info *sc = ch->parent;
sys/dev/sound/pci/envy24ht.c
1809
if (ch->dir == PCMDIR_PLAY) {
sys/dev/sound/pci/envy24ht.c
1902
int ch = envy24ht_mixmap[dev];
sys/dev/sound/pci/envy24ht.c
1910
if (dev != 0 && ch == -1)
sys/dev/sound/pci/envy24ht.c
1912
hwch = envy24ht_chanmap[ch];
sys/dev/sound/pci/envy24ht.c
1932
if (hwch > ENVY24HT_CHAN_PLAY_SPDIF || sc->chan[ch].run)
sys/dev/sound/pci/envy24ht.c
1944
int ch = envy24ht_mixmap[src];
sys/dev/sound/pci/envy24ht.c
1949
if (ch > ENVY24HT_CHAN_PLAY_SPDIF)
sys/dev/sound/pci/envy24ht.c
1950
sc->src = ch;
sys/dev/sound/pci/envy24ht.c
1971
struct sc_chinfo *ch;
sys/dev/sound/pci/envy24ht.c
1994
ch = &sc->chan[i];
sys/dev/sound/pci/envy24ht.c
1996
if (ch->run)
sys/dev/sound/pci/envy24ht.c
1997
device_printf(sc->dev, "envy24ht_intr(): chan[%d].blk = %d\n", i, ch->blk);
sys/dev/sound/pci/envy24ht.c
1999
if (ch->run && ch->blk <= feed) {
sys/dev/sound/pci/envy24ht.c
2001
chn_intr(ch->channel);
sys/dev/sound/pci/envy24ht.c
2017
ch = &sc->chan[i];
sys/dev/sound/pci/envy24ht.c
2018
if (ch->run && ch->blk <= feed) {
sys/dev/sound/pci/envy24ht.c
2020
chn_intr(ch->channel);
sys/dev/sound/pci/es137x.c
1489
es->ch[ES_DAC2].caps.maxspeed = val;
sys/dev/sound/pci/es137x.c
1490
es->ch[ES_DAC2].caps.minspeed = val;
sys/dev/sound/pci/es137x.c
1491
es->ch[ES_ADC].caps.maxspeed = val;
sys/dev/sound/pci/es137x.c
1492
es->ch[ES_ADC].caps.minspeed = val;
sys/dev/sound/pci/es137x.c
1499
es->ch[ES_DAC2].caps = es_caps;
sys/dev/sound/pci/es137x.c
1500
es->ch[ES_ADC].caps = es_caps;
sys/dev/sound/pci/es137x.c
1651
if (es->ch[ES_DAC2].channel != NULL &&
sys/dev/sound/pci/es137x.c
1652
es->ch[ES_ADC].channel != NULL) {
sys/dev/sound/pci/es137x.c
1668
if (es->ch[ES_DAC1].channel != NULL &&
sys/dev/sound/pci/es137x.c
1669
es->ch[ES_DAC2].channel != NULL) {
sys/dev/sound/pci/es137x.c
226
struct es_chinfo ch[ES_NCHANS];
sys/dev/sound/pci/es137x.c
446
struct es_chinfo *ch;
sys/dev/sound/pci/es137x.c
469
if (es->ch[index].channel != NULL) {
sys/dev/sound/pci/es137x.c
478
ch = &es->ch[index];
sys/dev/sound/pci/es137x.c
479
ch->index = index;
sys/dev/sound/pci/es137x.c
480
ch->num = es->num++;
sys/dev/sound/pci/es137x.c
481
ch->caps = es_caps;
sys/dev/sound/pci/es137x.c
483
if (ch->index == ES_DAC1) {
sys/dev/sound/pci/es137x.c
484
ch->caps.maxspeed = ES1370_DAC1_MAXSPEED;
sys/dev/sound/pci/es137x.c
485
ch->caps.minspeed = ES1370_DAC1_MINSPEED;
sys/dev/sound/pci/es137x.c
490
ch->caps.maxspeed = fixed_rate;
sys/dev/sound/pci/es137x.c
491
ch->caps.minspeed = fixed_rate;
sys/dev/sound/pci/es137x.c
495
ch->parent = es;
sys/dev/sound/pci/es137x.c
496
ch->channel = c;
sys/dev/sound/pci/es137x.c
497
ch->buffer = b;
sys/dev/sound/pci/es137x.c
498
ch->bufsz = es->bufsz;
sys/dev/sound/pci/es137x.c
499
ch->blkcnt = es->blkcnt;
sys/dev/sound/pci/es137x.c
500
ch->blksz = ch->bufsz / ch->blkcnt;
sys/dev/sound/pci/es137x.c
501
ch->dir = dir;
sys/dev/sound/pci/es137x.c
503
if (sndbuf_alloc(ch->buffer, es->parent_dmat, 0, ch->bufsz) != 0)
sys/dev/sound/pci/es137x.c
507
if (ch->index == ES_DAC1) {
sys/dev/sound/pci/es137x.c
511
ch->buffer->buf_addr, 4);
sys/dev/sound/pci/es137x.c
513
(ch->bufsz >> 2) - 1, 4);
sys/dev/sound/pci/es137x.c
518
ch->buffer->buf_addr, 4);
sys/dev/sound/pci/es137x.c
520
(ch->bufsz >> 2) - 1, 4);
sys/dev/sound/pci/es137x.c
525
ch->buffer->buf_addr, 4);
sys/dev/sound/pci/es137x.c
527
(ch->bufsz >> 2) - 1, 4);
sys/dev/sound/pci/es137x.c
530
return (ch);
sys/dev/sound/pci/es137x.c
536
struct es_chinfo *ch = data;
sys/dev/sound/pci/es137x.c
537
struct es_info *es = ch->parent;
sys/dev/sound/pci/es137x.c
540
if (ch->dir == PCMDIR_PLAY) {
sys/dev/sound/pci/es137x.c
541
if (ch->index == ES_DAC1) {
sys/dev/sound/pci/es137x.c
563
ch->fmt = format;
sys/dev/sound/pci/es137x.c
570
struct es_chinfo *ch = data;
sys/dev/sound/pci/es137x.c
571
struct es_info *es = ch->parent;
sys/dev/sound/pci/es137x.c
575
if (ch->caps.minspeed == ch->caps.maxspeed) {
sys/dev/sound/pci/es137x.c
577
return (ch->caps.maxspeed);
sys/dev/sound/pci/es137x.c
579
if (speed < ch->caps.minspeed)
sys/dev/sound/pci/es137x.c
580
speed = ch->caps.minspeed;
sys/dev/sound/pci/es137x.c
581
if (speed > ch->caps.maxspeed)
sys/dev/sound/pci/es137x.c
582
speed = ch->caps.maxspeed;
sys/dev/sound/pci/es137x.c
583
if (ch->index == ES_DAC1) {
sys/dev/sound/pci/es137x.c
615
struct es_chinfo *ch = data;
sys/dev/sound/pci/es137x.c
616
struct es_info *es = ch->parent;
sys/dev/sound/pci/es137x.c
621
if (ch->dir == PCMDIR_PLAY)
sys/dev/sound/pci/es137x.c
622
i = es1371_dac_rate(es, speed, ch->index); /* play */
sys/dev/sound/pci/es137x.c
624
i = es1371_adc_rate(es, speed, ch->index); /* record */
sys/dev/sound/pci/es137x.c
635
struct es_chinfo *ch = data;
sys/dev/sound/pci/es137x.c
636
struct es_info *es = ch->parent;
sys/dev/sound/pci/es137x.c
640
if (blksz > (ch->buffer->maxsize / ES_DMA_SEGS_MIN))
sys/dev/sound/pci/es137x.c
641
blksz = ch->buffer->maxsize / ES_DMA_SEGS_MIN;
sys/dev/sound/pci/es137x.c
649
while ((blksz * blkcnt) > ch->buffer->maxsize) {
sys/dev/sound/pci/es137x.c
658
if ((ch->buffer->blksz != blksz ||
sys/dev/sound/pci/es137x.c
659
ch->buffer->blkcnt != blkcnt) &&
sys/dev/sound/pci/es137x.c
660
sndbuf_resize(ch->buffer, blkcnt, blksz) != 0)
sys/dev/sound/pci/es137x.c
664
ch->bufsz = ch->buffer->bufsize;
sys/dev/sound/pci/es137x.c
665
ch->blksz = ch->buffer->blksz;
sys/dev/sound/pci/es137x.c
666
ch->blkcnt = ch->buffer->blkcnt;
sys/dev/sound/pci/es137x.c
674
struct es_chinfo *ch = data;
sys/dev/sound/pci/es137x.c
675
struct es_info *es = ch->parent;
sys/dev/sound/pci/es137x.c
679
return (ch->blksz);
sys/dev/sound/pci/es137x.c
682
#define es_chan_active(es) ((es)->ch[ES_DAC1].active + \
sys/dev/sound/pci/es137x.c
683
(es)->ch[ES_DAC2].active + \
sys/dev/sound/pci/es137x.c
684
(es)->ch[ES_ADC].active)
sys/dev/sound/pci/es137x.c
687
es_poll_channel(struct es_chinfo *ch)
sys/dev/sound/pci/es137x.c
693
if (ch == NULL || ch->channel == NULL || ch->active == 0)
sys/dev/sound/pci/es137x.c
696
es = ch->parent;
sys/dev/sound/pci/es137x.c
697
if (ch->dir == PCMDIR_PLAY) {
sys/dev/sound/pci/es137x.c
698
if (ch->index == ES_DAC1)
sys/dev/sound/pci/es137x.c
704
sz = ch->blksz * ch->blkcnt;
sys/dev/sound/pci/es137x.c
708
ch->ptr = ptr;
sys/dev/sound/pci/es137x.c
710
ptr &= ~(ch->blksz - 1);
sys/dev/sound/pci/es137x.c
711
delta = (sz + ptr - ch->prevptr) % sz;
sys/dev/sound/pci/es137x.c
713
if (delta < ch->blksz)
sys/dev/sound/pci/es137x.c
716
ch->prevptr = ptr;
sys/dev/sound/pci/es137x.c
738
if (es_poll_channel(&es->ch[i]) != 0)
sys/dev/sound/pci/es137x.c
750
chn_intr(es->ch[i].channel);
sys/dev/sound/pci/es137x.c
757
struct es_chinfo *ch = data;
sys/dev/sound/pci/es137x.c
758
struct es_info *es = ch->parent;
sys/dev/sound/pci/es137x.c
765
cnt = (ch->blksz / ch->buffer->align) - 1;
sys/dev/sound/pci/es137x.c
766
if (ch->fmt & AFMT_16BIT)
sys/dev/sound/pci/es137x.c
768
if (AFMT_CHANNEL(ch->fmt) > 1)
sys/dev/sound/pci/es137x.c
770
if (ch->dir == PCMDIR_PLAY) {
sys/dev/sound/pci/es137x.c
772
if (ch->index == ES_DAC1) {
sys/dev/sound/pci/es137x.c
786
(ch->bufsz >> 2) - 1, 4);
sys/dev/sound/pci/es137x.c
803
(ch->bufsz >> 2) - 1, 4);
sys/dev/sound/pci/es137x.c
806
es->ctrl &= ~((ch->index == ES_DAC1) ?
sys/dev/sound/pci/es137x.c
822
(ch->bufsz >> 2) - 1, 4);
sys/dev/sound/pci/es137x.c
830
ch->ptr = 0;
sys/dev/sound/pci/es137x.c
831
ch->prevptr = 0;
sys/dev/sound/pci/es137x.c
838
ch->active = 1;
sys/dev/sound/pci/es137x.c
840
ch->active = 0;
sys/dev/sound/pci/es137x.c
855
struct es_chinfo *ch = data;
sys/dev/sound/pci/es137x.c
856
struct es_info *es = ch->parent;
sys/dev/sound/pci/es137x.c
861
cnt = ch->ptr;
sys/dev/sound/pci/es137x.c
863
if (ch->dir == PCMDIR_PLAY) {
sys/dev/sound/pci/es137x.c
864
if (ch->index == ES_DAC1)
sys/dev/sound/pci/es137x.c
885
struct es_chinfo *ch = data;
sys/dev/sound/pci/es137x.c
887
return (&ch->caps);
sys/dev/sound/pci/es137x.c
948
chn_intr(es->ch[ES_ADC].channel);
sys/dev/sound/pci/es137x.c
950
chn_intr(es->ch[ES_DAC1].channel);
sys/dev/sound/pci/es137x.c
952
chn_intr(es->ch[ES_DAC2].channel);
sys/dev/sound/pci/fm801.c
332
struct fm801_chinfo *ch = (dir == PCMDIR_PLAY)? &fm801->pch : &fm801->rch;
sys/dev/sound/pci/fm801.c
335
ch->parent = fm801;
sys/dev/sound/pci/fm801.c
336
ch->channel = c;
sys/dev/sound/pci/fm801.c
337
ch->buffer = b;
sys/dev/sound/pci/fm801.c
338
ch->dir = dir;
sys/dev/sound/pci/fm801.c
339
if (sndbuf_alloc(ch->buffer, fm801->parent_dmat, 0, fm801->bufsz) != 0)
sys/dev/sound/pci/fm801.c
341
return (void *)ch;
sys/dev/sound/pci/fm801.c
347
struct fm801_chinfo *ch = data;
sys/dev/sound/pci/fm801.c
348
struct fm801_info *fm801 = ch->parent;
sys/dev/sound/pci/fm801.c
356
if(ch->dir == PCMDIR_PLAY) {
sys/dev/sound/pci/fm801.c
363
if(ch->dir == PCMDIR_REC ) {
sys/dev/sound/pci/fm801.c
393
struct fm801_chinfo *ch = data;
sys/dev/sound/pci/fm801.c
394
struct fm801_info *fm801 = ch->parent;
sys/dev/sound/pci/fm801.c
399
if(ch->dir == PCMDIR_PLAY) {
sys/dev/sound/pci/fm801.c
405
if(ch->dir == PCMDIR_REC ) {
sys/dev/sound/pci/fm801.c
411
ch->spd = fm801_rates[i].rate;
sys/dev/sound/pci/fm801.c
419
struct fm801_chinfo *ch = data;
sys/dev/sound/pci/fm801.c
420
struct fm801_info *fm801 = ch->parent;
sys/dev/sound/pci/fm801.c
427
if(ch->dir == PCMDIR_PLAY)
sys/dev/sound/pci/fm801.c
430
if(ch->dir == PCMDIR_REC)
sys/dev/sound/pci/fm801.c
433
DPRINT("fm801ch_setblocksize %d (dir %d)\n",blocksize, ch->dir);
sys/dev/sound/pci/fm801.c
441
struct fm801_chinfo *ch = data;
sys/dev/sound/pci/fm801.c
442
struct fm801_info *fm801 = ch->parent;
sys/dev/sound/pci/fm801.c
443
u_int32_t baseaddr = ch->buffer->buf_addr;
sys/dev/sound/pci/fm801.c
451
if (ch->dir == PCMDIR_PLAY) {
sys/dev/sound/pci/fm801.c
469
} else if(ch->dir == PCMDIR_REC) {
sys/dev/sound/pci/fm801.c
496
struct fm801_chinfo *ch = data;
sys/dev/sound/pci/fm801.c
497
struct fm801_info *fm801 = ch->parent;
sys/dev/sound/pci/fm801.c
500
if (ch->dir == PCMDIR_PLAY) {
sys/dev/sound/pci/fm801.c
506
if (ch->dir == PCMDIR_REC) {
sys/dev/sound/pci/hda/hdaa.c
1760
struct hdaa_chan *ch = data;
sys/dev/sound/pci/hda/hdaa.c
1761
struct hdaa_pcm_devinfo *pdevinfo = ch->pdevinfo;
sys/dev/sound/pci/hda/hdaa.c
1766
ch->caps.minspeed = ch->caps.maxspeed = 48000;
sys/dev/sound/pci/hda/hdaa.c
1767
ch->pcmrates[0] = 48000;
sys/dev/sound/pci/hda/hdaa.c
1768
ch->pcmrates[1] = 0;
sys/dev/sound/pci/hda/hdaa.c
1770
ch->dir = dir;
sys/dev/sound/pci/hda/hdaa.c
1771
ch->b = b;
sys/dev/sound/pci/hda/hdaa.c
1772
ch->c = c;
sys/dev/sound/pci/hda/hdaa.c
1773
ch->blksz = pdevinfo->chan_size / pdevinfo->chan_blkcnt;
sys/dev/sound/pci/hda/hdaa.c
1774
ch->blkcnt = pdevinfo->chan_blkcnt;
sys/dev/sound/pci/hda/hdaa.c
1777
if (sndbuf_alloc(ch->b, bus_get_dma_tag(devinfo->dev),
sys/dev/sound/pci/hda/hdaa.c
1783
return (ch);
sys/dev/sound/pci/hda/hdaa.c
1789
struct hdaa_chan *ch = data;
sys/dev/sound/pci/hda/hdaa.c
1792
for (i = 0; ch->caps.fmtlist[i] != 0; i++) {
sys/dev/sound/pci/hda/hdaa.c
1793
if (format == ch->caps.fmtlist[i]) {
sys/dev/sound/pci/hda/hdaa.c
1794
ch->fmt = format;
sys/dev/sound/pci/hda/hdaa.c
1805
struct hdaa_chan *ch = data;
sys/dev/sound/pci/hda/hdaa.c
1810
for (i = 0; ch->pcmrates[i] != 0; i++) {
sys/dev/sound/pci/hda/hdaa.c
1811
spd = ch->pcmrates[i];
sys/dev/sound/pci/hda/hdaa.c
1813
ch->spd = spd;
sys/dev/sound/pci/hda/hdaa.c
1818
for (i = 0; ch->pcmrates[i] != 0; i++) {
sys/dev/sound/pci/hda/hdaa.c
1819
spd = ch->pcmrates[i];
sys/dev/sound/pci/hda/hdaa.c
1820
threshold = spd + ((ch->pcmrates[i + 1] != 0) ?
sys/dev/sound/pci/hda/hdaa.c
1821
((ch->pcmrates[i + 1] - spd) >> 1) : 0);
sys/dev/sound/pci/hda/hdaa.c
1825
ch->spd = spd;
sys/dev/sound/pci/hda/hdaa.c
1830
hdaa_stream_format(struct hdaa_chan *ch)
sys/dev/sound/pci/hda/hdaa.c
1836
if (ch->fmt & AFMT_S16_LE)
sys/dev/sound/pci/hda/hdaa.c
1837
fmt |= ch->bit16 << 4;
sys/dev/sound/pci/hda/hdaa.c
1838
else if (ch->fmt & AFMT_S32_LE)
sys/dev/sound/pci/hda/hdaa.c
1839
fmt |= ch->bit32 << 4;
sys/dev/sound/pci/hda/hdaa.c
1843
if (hda_rate_tab[i].valid && ch->spd == hda_rate_tab[i].rate) {
sys/dev/sound/pci/hda/hdaa.c
1850
fmt |= (AFMT_CHANNEL(ch->fmt) - 1);
sys/dev/sound/pci/hda/hdaa.c
1868
hdaa_audio_setup(struct hdaa_chan *ch)
sys/dev/sound/pci/hda/hdaa.c
1870
struct hdaa_audio_as *as = &ch->devinfo->as[ch->as];
sys/dev/sound/pci/hda/hdaa.c
1895
totalchn = AFMT_CHANNEL(ch->fmt);
sys/dev/sound/pci/hda/hdaa.c
1896
totalextchn = AFMT_EXTCHANNEL(ch->fmt);
sys/dev/sound/pci/hda/hdaa.c
1898
device_printf(ch->pdevinfo->dev,
sys/dev/sound/pci/hda/hdaa.c
1900
(ch->dir == PCMDIR_PLAY) ? "PLAY" : "REC",
sys/dev/sound/pci/hda/hdaa.c
1901
ch->fmt, totalchn - totalextchn, totalextchn, ch->spd);
sys/dev/sound/pci/hda/hdaa.c
1903
fmt = hdaa_stream_format(ch);
sys/dev/sound/pci/hda/hdaa.c
1908
convmapid = (ch->dir == PCMDIR_PLAY);
sys/dev/sound/pci/hda/hdaa.c
1911
if (ch->fmt & AFMT_AC3)
sys/dev/sound/pci/hda/hdaa.c
1915
for (i = 0; ch->io[i] != -1; i++) {
sys/dev/sound/pci/hda/hdaa.c
1916
w = hdaa_widget_get(ch->devinfo, ch->io[i]);
sys/dev/sound/pci/hda/hdaa.c
1923
c = (ch->sid << 4);
sys/dev/sound/pci/hda/hdaa.c
1932
c = (ch->sid << 4) | chn;
sys/dev/sound/pci/hda/hdaa.c
1935
hda_command(ch->devinfo->dev,
sys/dev/sound/pci/hda/hdaa.c
1936
HDA_CMD_SET_CONV_FMT(0, ch->io[i], fmt));
sys/dev/sound/pci/hda/hdaa.c
1938
hda_command(ch->devinfo->dev,
sys/dev/sound/pci/hda/hdaa.c
1939
HDA_CMD_SET_DIGITAL_CONV_FMT1(0, ch->io[i], dfmt));
sys/dev/sound/pci/hda/hdaa.c
1941
hda_command(ch->devinfo->dev,
sys/dev/sound/pci/hda/hdaa.c
1942
HDA_CMD_SET_CONV_STREAM_CHAN(0, ch->io[i], c));
sys/dev/sound/pci/hda/hdaa.c
1944
hda_command(ch->devinfo->dev,
sys/dev/sound/pci/hda/hdaa.c
1945
HDA_CMD_SET_STRIPE_CONTROL(0, w->nid, ch->stripectl));
sys/dev/sound/pci/hda/hdaa.c
1950
hda_command(ch->devinfo->dev,
sys/dev/sound/pci/hda/hdaa.c
1951
HDA_CMD_SET_CONV_CHAN_COUNT(0, ch->io[i], cchn));
sys/dev/sound/pci/hda/hdaa.c
1954
device_printf(ch->pdevinfo->dev,
sys/dev/sound/pci/hda/hdaa.c
1958
(ch->dir == PCMDIR_PLAY) ? "PLAY" : "REC",
sys/dev/sound/pci/hda/hdaa.c
1959
ch->io[i], fmt, dfmt, c, cchn, ch->stripectl);
sys/dev/sound/pci/hda/hdaa.c
1962
if (as->dacs[ch->asindex][j] != ch->io[i])
sys/dev/sound/pci/hda/hdaa.c
1965
wp = hdaa_widget_get(ch->devinfo, nid);
sys/dev/sound/pci/hda/hdaa.c
1974
hda_command(ch->devinfo->dev,
sys/dev/sound/pci/hda/hdaa.c
1988
if ((ch->fmt & AFMT_AC3) && (cchn == 7))
sys/dev/sound/pci/hda/hdaa.c
1990
hda_command(ch->devinfo->dev,
sys/dev/sound/pci/hda/hdaa.c
1996
hda_command(ch->devinfo->dev,
sys/dev/sound/pci/hda/hdaa.c
1998
hda_command(ch->devinfo->dev,
sys/dev/sound/pci/hda/hdaa.c
2002
hda_command(ch->devinfo->dev,
sys/dev/sound/pci/hda/hdaa.c
2005
hda_command(ch->devinfo->dev,
sys/dev/sound/pci/hda/hdaa.c
2009
hda_command(ch->devinfo->dev,
sys/dev/sound/pci/hda/hdaa.c
2013
hda_command(ch->devinfo->dev,
sys/dev/sound/pci/hda/hdaa.c
2015
hda_command(ch->devinfo->dev,
sys/dev/sound/pci/hda/hdaa.c
2017
hda_command(ch->devinfo->dev,
sys/dev/sound/pci/hda/hdaa.c
2020
hda_command(ch->devinfo->dev,
sys/dev/sound/pci/hda/hdaa.c
2022
hda_command(ch->devinfo->dev,
sys/dev/sound/pci/hda/hdaa.c
2024
hda_command(ch->devinfo->dev,
sys/dev/sound/pci/hda/hdaa.c
2029
hda_command(ch->devinfo->dev,
sys/dev/sound/pci/hda/hdaa.c
2032
hda_command(ch->devinfo->dev,
sys/dev/sound/pci/hda/hdaa.c
2034
hda_command(ch->devinfo->dev,
sys/dev/sound/pci/hda/hdaa.c
2036
hda_command(ch->devinfo->dev,
sys/dev/sound/pci/hda/hdaa.c
2038
hda_command(ch->devinfo->dev,
sys/dev/sound/pci/hda/hdaa.c
2043
hda_command(ch->devinfo->dev,
sys/dev/sound/pci/hda/hdaa.c
2045
hda_command(ch->devinfo->dev,
sys/dev/sound/pci/hda/hdaa.c
2082
struct hdaa_chan *ch = data;
sys/dev/sound/pci/hda/hdaa.c
2084
blksz -= blksz % lcm(HDA_DMA_ALIGNMENT, ch->b->align);
sys/dev/sound/pci/hda/hdaa.c
2086
if (blksz > (ch->b->maxsize / HDA_BDL_MIN))
sys/dev/sound/pci/hda/hdaa.c
2087
blksz = ch->b->maxsize / HDA_BDL_MIN;
sys/dev/sound/pci/hda/hdaa.c
2095
while ((blksz * blkcnt) > ch->b->maxsize) {
sys/dev/sound/pci/hda/hdaa.c
2104
if ((ch->b->blksz != blksz ||
sys/dev/sound/pci/hda/hdaa.c
2105
ch->b->blkcnt != blkcnt) &&
sys/dev/sound/pci/hda/hdaa.c
2106
sndbuf_resize(ch->b, blkcnt, blksz) != 0)
sys/dev/sound/pci/hda/hdaa.c
2107
device_printf(ch->devinfo->dev, "%s: failed blksz=%u blkcnt=%u\n",
sys/dev/sound/pci/hda/hdaa.c
2110
ch->blksz = ch->b->blksz;
sys/dev/sound/pci/hda/hdaa.c
2111
ch->blkcnt = ch->b->blkcnt;
sys/dev/sound/pci/hda/hdaa.c
2119
struct hdaa_chan *ch = data;
sys/dev/sound/pci/hda/hdaa.c
2121
hdaa_channel_setfragments(obj, data, blksz, ch->pdevinfo->chan_blkcnt);
sys/dev/sound/pci/hda/hdaa.c
2123
return (ch->blksz);
sys/dev/sound/pci/hda/hdaa.c
2127
hdaa_channel_stop(struct hdaa_chan *ch)
sys/dev/sound/pci/hda/hdaa.c
2129
struct hdaa_devinfo *devinfo = ch->devinfo;
sys/dev/sound/pci/hda/hdaa.c
2133
if ((ch->flags & HDAA_CHN_RUNNING) == 0)
sys/dev/sound/pci/hda/hdaa.c
2135
ch->flags &= ~HDAA_CHN_RUNNING;
sys/dev/sound/pci/hda/hdaa.c
2137
ch->dir == PCMDIR_PLAY ? 1 : 0, ch->sid);
sys/dev/sound/pci/hda/hdaa.c
2138
for (i = 0; ch->io[i] != -1; i++) {
sys/dev/sound/pci/hda/hdaa.c
2139
w = hdaa_widget_get(ch->devinfo, ch->io[i]);
sys/dev/sound/pci/hda/hdaa.c
2144
HDA_CMD_SET_DIGITAL_CONV_FMT1(0, ch->io[i], 0));
sys/dev/sound/pci/hda/hdaa.c
2147
HDA_CMD_SET_CONV_STREAM_CHAN(0, ch->io[i],
sys/dev/sound/pci/hda/hdaa.c
2151
ch->dir == PCMDIR_PLAY ? 1 : 0, ch->sid);
sys/dev/sound/pci/hda/hdaa.c
2155
hdaa_channel_start(struct hdaa_chan *ch)
sys/dev/sound/pci/hda/hdaa.c
2157
struct hdaa_devinfo *devinfo = ch->devinfo;
sys/dev/sound/pci/hda/hdaa.c
2160
fmt = hdaa_stream_format(ch);
sys/dev/sound/pci/hda/hdaa.c
2161
ch->stripectl = fls(ch->stripecap & hdaa_allowed_stripes(fmt) &
sys/dev/sound/pci/hda/hdaa.c
2163
ch->sid = HDAC_STREAM_ALLOC(device_get_parent(devinfo->dev), devinfo->dev,
sys/dev/sound/pci/hda/hdaa.c
2164
ch->dir == PCMDIR_PLAY ? 1 : 0, fmt, ch->stripectl, &ch->dmapos);
sys/dev/sound/pci/hda/hdaa.c
2165
if (ch->sid <= 0)
sys/dev/sound/pci/hda/hdaa.c
2167
hdaa_audio_setup(ch);
sys/dev/sound/pci/hda/hdaa.c
2169
ch->dir == PCMDIR_PLAY ? 1 : 0, ch->sid);
sys/dev/sound/pci/hda/hdaa.c
2171
ch->dir == PCMDIR_PLAY ? 1 : 0, ch->sid,
sys/dev/sound/pci/hda/hdaa.c
2172
ch->b->buf_addr, ch->blksz, ch->blkcnt);
sys/dev/sound/pci/hda/hdaa.c
2173
ch->flags |= HDAA_CHN_RUNNING;
sys/dev/sound/pci/hda/hdaa.c
2180
struct hdaa_chan *ch = data;
sys/dev/sound/pci/hda/hdaa.c
2186
hdaa_lock(ch->devinfo);
sys/dev/sound/pci/hda/hdaa.c
2189
error = hdaa_channel_start(ch);
sys/dev/sound/pci/hda/hdaa.c
2193
hdaa_channel_stop(ch);
sys/dev/sound/pci/hda/hdaa.c
2198
hdaa_unlock(ch->devinfo);
sys/dev/sound/pci/hda/hdaa.c
2206
struct hdaa_chan *ch = data;
sys/dev/sound/pci/hda/hdaa.c
2207
struct hdaa_devinfo *devinfo = ch->devinfo;
sys/dev/sound/pci/hda/hdaa.c
2211
if (ch->dmapos != NULL) {
sys/dev/sound/pci/hda/hdaa.c
2212
ptr = *(ch->dmapos);
sys/dev/sound/pci/hda/hdaa.c
2216
ch->dir == PCMDIR_PLAY ? 1 : 0, ch->sid);
sys/dev/sound/pci/hda/hdaa.c
2223
ptr %= ch->blksz * ch->blkcnt;
sys/dev/sound/pci/hda/hdaa.c
267
struct hdaa_chan *ch = &devinfo->chans[as->chans[0]];
sys/dev/sound/pci/hda/hdaa.c
2788
struct hdaa_chan *ch;
sys/dev/sound/pci/hda/hdaa.c
2807
ch = &devinfo->chans[as->chans[j]];
sys/dev/sound/pci/hda/hdaa.c
2808
for (i = 0; ch->io[i] >= 0; i++) {
sys/dev/sound/pci/hda/hdaa.c
2809
w = hdaa_widget_get(devinfo, ch->io[i]);
sys/dev/sound/pci/hda/hdaa.c
2813
ch->io[i], 0);
sys/dev/sound/pci/hda/hdaa.c
336
if (ch->channels == 1)
sys/dev/sound/pci/hda/hdaa.c
362
total = ch->channels;
sys/dev/sound/pci/hda/hdaa.c
5292
hdaa_pcmchannel_setup(struct hdaa_chan *ch)
sys/dev/sound/pci/hda/hdaa.c
5294
struct hdaa_devinfo *devinfo = ch->devinfo;
sys/dev/sound/pci/hda/hdaa.c
5301
ch->caps = hdaa_caps;
sys/dev/sound/pci/hda/hdaa.c
5302
ch->caps.fmtlist = ch->fmtlist;
sys/dev/sound/pci/hda/hdaa.c
5303
ch->bit16 = 1;
sys/dev/sound/pci/hda/hdaa.c
5304
ch->bit32 = 0;
sys/dev/sound/pci/hda/hdaa.c
5305
ch->pcmrates[0] = 48000;
sys/dev/sound/pci/hda/hdaa.c
5306
ch->pcmrates[1] = 0;
sys/dev/sound/pci/hda/hdaa.c
5307
ch->stripecap = 0xff;
sys/dev/sound/pci/hda/hdaa.c
5318
if (ch->as < 0)
sys/dev/sound/pci/hda/hdaa.c
5321
if (as[ch->as].dacs[ch->asindex][i] <= 0)
sys/dev/sound/pci/hda/hdaa.c
5325
if (ch->io[j] == as[ch->as].dacs[ch->asindex][i])
sys/dev/sound/pci/hda/hdaa.c
5331
w = hdaa_widget_get(devinfo, as[ch->as].dacs[ch->asindex][i]);
sys/dev/sound/pci/hda/hdaa.c
5349
ch->io[ret++] = as[ch->as].dacs[ch->asindex][i];
sys/dev/sound/pci/hda/hdaa.c
5350
ch->stripecap &= w->wclass.conv.stripecap;
sys/dev/sound/pci/hda/hdaa.c
5352
if (i == 15 && as[ch->as].hpredir >= 0)
sys/dev/sound/pci/hda/hdaa.c
5359
ch->io[ret] = -1;
sys/dev/sound/pci/hda/hdaa.c
5360
ch->channels = channels;
sys/dev/sound/pci/hda/hdaa.c
5362
if (as[ch->as].fakeredir)
sys/dev/sound/pci/hda/hdaa.c
5365
if ((!onlystereo) || as[ch->as].mixed)
sys/dev/sound/pci/hda/hdaa.c
5368
as[ch->as].pinset = pinset;
sys/dev/sound/pci/hda/hdaa.c
5370
ch->supp_stream_formats = fmtcap;
sys/dev/sound/pci/hda/hdaa.c
5371
ch->supp_pcm_size_rate = pcmcap;
sys/dev/sound/pci/hda/hdaa.c
5384
ch->bit16 = 1;
sys/dev/sound/pci/hda/hdaa.c
5386
ch->bit16 = 0;
sys/dev/sound/pci/hda/hdaa.c
5388
ch->bit32 = 3;
sys/dev/sound/pci/hda/hdaa.c
5390
ch->bit32 = 2;
sys/dev/sound/pci/hda/hdaa.c
5392
ch->bit32 = 4;
sys/dev/sound/pci/hda/hdaa.c
5394
ch->fmtlist[i++] = SND_FORMAT(AFMT_S16_LE, 1, 0);
sys/dev/sound/pci/hda/hdaa.c
5395
if (ch->bit32)
sys/dev/sound/pci/hda/hdaa.c
5396
ch->fmtlist[i++] = SND_FORMAT(AFMT_S32_LE, 1, 0);
sys/dev/sound/pci/hda/hdaa.c
5399
ch->fmtlist[i++] = SND_FORMAT(AFMT_S16_LE, 2, 0);
sys/dev/sound/pci/hda/hdaa.c
5400
if (ch->bit32)
sys/dev/sound/pci/hda/hdaa.c
5401
ch->fmtlist[i++] = SND_FORMAT(AFMT_S32_LE, 2, 0);
sys/dev/sound/pci/hda/hdaa.c
5404
ch->fmtlist[i++] = SND_FORMAT(AFMT_S16_LE, 3, 0);
sys/dev/sound/pci/hda/hdaa.c
5405
if (ch->bit32)
sys/dev/sound/pci/hda/hdaa.c
5406
ch->fmtlist[i++] = SND_FORMAT(AFMT_S32_LE, 3, 0);
sys/dev/sound/pci/hda/hdaa.c
5407
ch->fmtlist[i++] = SND_FORMAT(AFMT_S16_LE, 3, 1);
sys/dev/sound/pci/hda/hdaa.c
5408
if (ch->bit32)
sys/dev/sound/pci/hda/hdaa.c
5409
ch->fmtlist[i++] = SND_FORMAT(AFMT_S32_LE, 3, 1);
sys/dev/sound/pci/hda/hdaa.c
5412
ch->fmtlist[i++] = SND_FORMAT(AFMT_S16_LE, 4, 0);
sys/dev/sound/pci/hda/hdaa.c
5413
if (ch->bit32)
sys/dev/sound/pci/hda/hdaa.c
5414
ch->fmtlist[i++] = SND_FORMAT(AFMT_S32_LE, 4, 0);
sys/dev/sound/pci/hda/hdaa.c
5416
ch->fmtlist[i++] = SND_FORMAT(AFMT_S16_LE, 4, 1);
sys/dev/sound/pci/hda/hdaa.c
5417
if (ch->bit32)
sys/dev/sound/pci/hda/hdaa.c
5418
ch->fmtlist[i++] = SND_FORMAT(AFMT_S32_LE, 4, 1);
sys/dev/sound/pci/hda/hdaa.c
5422
ch->fmtlist[i++] = SND_FORMAT(AFMT_S16_LE, 5, 0);
sys/dev/sound/pci/hda/hdaa.c
5423
if (ch->bit32)
sys/dev/sound/pci/hda/hdaa.c
5424
ch->fmtlist[i++] = SND_FORMAT(AFMT_S32_LE, 5, 0);
sys/dev/sound/pci/hda/hdaa.c
5425
ch->fmtlist[i++] = SND_FORMAT(AFMT_S16_LE, 5, 1);
sys/dev/sound/pci/hda/hdaa.c
5426
if (ch->bit32)
sys/dev/sound/pci/hda/hdaa.c
5427
ch->fmtlist[i++] = SND_FORMAT(AFMT_S32_LE, 5, 1);
sys/dev/sound/pci/hda/hdaa.c
5430
ch->fmtlist[i++] = SND_FORMAT(AFMT_S16_LE, 6, 1);
sys/dev/sound/pci/hda/hdaa.c
5431
if (ch->bit32)
sys/dev/sound/pci/hda/hdaa.c
5432
ch->fmtlist[i++] = SND_FORMAT(AFMT_S32_LE, 6, 1);
sys/dev/sound/pci/hda/hdaa.c
5434
ch->fmtlist[i++] = SND_FORMAT(AFMT_S16_LE, 6, 0);
sys/dev/sound/pci/hda/hdaa.c
5435
if (ch->bit32)
sys/dev/sound/pci/hda/hdaa.c
5436
ch->fmtlist[i++] = SND_FORMAT(AFMT_S32_LE, 6, 0);
sys/dev/sound/pci/hda/hdaa.c
5440
ch->fmtlist[i++] = SND_FORMAT(AFMT_S16_LE, 7, 0);
sys/dev/sound/pci/hda/hdaa.c
5441
if (ch->bit32)
sys/dev/sound/pci/hda/hdaa.c
5442
ch->fmtlist[i++] = SND_FORMAT(AFMT_S32_LE, 7, 0);
sys/dev/sound/pci/hda/hdaa.c
5443
ch->fmtlist[i++] = SND_FORMAT(AFMT_S16_LE, 7, 1);
sys/dev/sound/pci/hda/hdaa.c
5444
if (ch->bit32)
sys/dev/sound/pci/hda/hdaa.c
5445
ch->fmtlist[i++] = SND_FORMAT(AFMT_S32_LE, 7, 1);
sys/dev/sound/pci/hda/hdaa.c
5448
ch->fmtlist[i++] = SND_FORMAT(AFMT_S16_LE, 8, 1);
sys/dev/sound/pci/hda/hdaa.c
5449
if (ch->bit32)
sys/dev/sound/pci/hda/hdaa.c
5450
ch->fmtlist[i++] = SND_FORMAT(AFMT_S32_LE, 8, 1);
sys/dev/sound/pci/hda/hdaa.c
5454
ch->fmtlist[i++] = SND_FORMAT(AFMT_AC3, 2, 0);
sys/dev/sound/pci/hda/hdaa.c
5456
ch->fmtlist[i++] = SND_FORMAT(AFMT_AC3, 8, 1);
sys/dev/sound/pci/hda/hdaa.c
5459
ch->fmtlist[i] = 0;
sys/dev/sound/pci/hda/hdaa.c
5462
ch->pcmrates[i++] = 8000;
sys/dev/sound/pci/hda/hdaa.c
5464
ch->pcmrates[i++] = 11025;
sys/dev/sound/pci/hda/hdaa.c
5466
ch->pcmrates[i++] = 16000;
sys/dev/sound/pci/hda/hdaa.c
5468
ch->pcmrates[i++] = 22050;
sys/dev/sound/pci/hda/hdaa.c
5470
ch->pcmrates[i++] = 32000;
sys/dev/sound/pci/hda/hdaa.c
5472
ch->pcmrates[i++] = 44100;
sys/dev/sound/pci/hda/hdaa.c
5474
ch->pcmrates[i++] = 48000;
sys/dev/sound/pci/hda/hdaa.c
5476
ch->pcmrates[i++] = 88200;
sys/dev/sound/pci/hda/hdaa.c
5478
ch->pcmrates[i++] = 96000;
sys/dev/sound/pci/hda/hdaa.c
5480
ch->pcmrates[i++] = 176400;
sys/dev/sound/pci/hda/hdaa.c
5482
ch->pcmrates[i++] = 192000;
sys/dev/sound/pci/hda/hdaa.c
5484
ch->pcmrates[i] = 0;
sys/dev/sound/pci/hda/hdaa.c
5486
ch->caps.minspeed = ch->pcmrates[0];
sys/dev/sound/pci/hda/hdaa.c
5487
ch->caps.maxspeed = ch->pcmrates[i - 1];
sys/dev/sound/pci/hda/hdaa.c
6803
struct hdaa_chan *ch;
sys/dev/sound/pci/hda/hdaa.c
6807
ch = &devinfo->chans[i];
sys/dev/sound/pci/hda/hdaa.c
6808
if (!(ch->flags & HDAA_CHN_RUNNING))
sys/dev/sound/pci/hda/hdaa.c
6810
if (ch->dir == ((dir == 1) ? PCMDIR_PLAY : PCMDIR_REC) &&
sys/dev/sound/pci/hda/hdaa.c
6811
ch->sid == stream) {
sys/dev/sound/pci/hda/hdaa.c
6813
chn_intr(ch->c);
sys/dev/sound/pci/hda/hdaa.c
6933
struct hdaa_chan *ch;
sys/dev/sound/pci/hda/hdaa.c
6937
ch = &devinfo->chans[as->chans[0]];
sys/dev/sound/pci/hda/hdaa.c
6938
val = (ch->bit32 == 4) ? 32 : ((ch->bit32 == 3) ? 24 :
sys/dev/sound/pci/hda/hdaa.c
6939
((ch->bit32 == 2) ? 20 : 0));
sys/dev/sound/pci/hda/hdaa.c
6943
pcmcap = ch->supp_pcm_size_rate;
sys/dev/sound/pci/hda/hdaa.c
6945
ch->bit32 = 4;
sys/dev/sound/pci/hda/hdaa.c
6947
ch->bit32 = 3;
sys/dev/sound/pci/hda/hdaa.c
6949
ch->bit32 = 2;
sys/dev/sound/pci/hda/hdaa.c
6953
devinfo->chans[as->chans[i]].bit32 = ch->bit32;
sys/dev/sound/pci/hdsp-pcm.c
1025
struct sc_chinfo *ch;
sys/dev/sound/pci/hdsp-pcm.c
1032
ch = &scp->chan[i];
sys/dev/sound/pci/hdsp-pcm.c
1034
chn_intr(ch->channel);
sys/dev/sound/pci/hdsp-pcm.c
213
hdsp_hw_mixer(struct sc_chinfo *ch, unsigned int dst,
sys/dev/sound/pci/hdsp-pcm.c
221
scp = ch->parent;
sys/dev/sound/pci/hdsp-pcm.c
227
if (ch->dir != PCMDIR_PLAY)
sys/dev/sound/pci/hdsp-pcm.c
265
hdspchan_setgain(struct sc_chinfo *ch)
sys/dev/sound/pci/hdsp-pcm.c
273
ports = ch->ports;
sys/dev/sound/pci/hdsp-pcm.c
285
volume = ch->lvol * HDSP_MAX_GAIN / 100;
sys/dev/sound/pci/hdsp-pcm.c
288
hdsp_hw_mixer(ch, offset, offset, volume);
sys/dev/sound/pci/hdsp-pcm.c
294
volume = ch->rvol * HDSP_MAX_GAIN / 100;
sys/dev/sound/pci/hdsp-pcm.c
337
struct sc_chinfo *ch;
sys/dev/sound/pci/hdsp-pcm.c
348
ch = &scp->chan[i];
sys/dev/sound/pci/hdsp-pcm.c
349
if ((dev == SOUND_MIXER_VOLUME && ch->dir == PCMDIR_PLAY) ||
sys/dev/sound/pci/hdsp-pcm.c
350
(dev == SOUND_MIXER_RECLEV && ch->dir == PCMDIR_REC)) {
sys/dev/sound/pci/hdsp-pcm.c
351
ch->lvol = left;
sys/dev/sound/pci/hdsp-pcm.c
352
ch->rvol = right;
sys/dev/sound/pci/hdsp-pcm.c
353
if (ch->run)
sys/dev/sound/pci/hdsp-pcm.c
354
hdspchan_setgain(ch);
sys/dev/sound/pci/hdsp-pcm.c
369
hdspchan_enable(struct sc_chinfo *ch, int value)
sys/dev/sound/pci/hdsp-pcm.c
377
scp = ch->parent;
sys/dev/sound/pci/hdsp-pcm.c
380
if (ch->dir == PCMDIR_PLAY)
sys/dev/sound/pci/hdsp-pcm.c
385
ch->run = value;
sys/dev/sound/pci/hdsp-pcm.c
388
slots = hdsp_port_slot_map(ch->ports, sc->speed);
sys/dev/sound/pci/hdsp-pcm.c
404
struct sc_chinfo *ch;
sys/dev/sound/pci/hdsp-pcm.c
421
ch = &scp->chan[j];
sys/dev/sound/pci/hdsp-pcm.c
422
if (ch->run) {
sys/dev/sound/pci/hdsp-pcm.c
551
buffer_copy(struct sc_chinfo *ch)
sys/dev/sound/pci/hdsp-pcm.c
560
scp = ch->parent;
sys/dev/sound/pci/hdsp-pcm.c
563
channels = AFMT_CHANNEL(ch->format); /* Number of PCM channels. */
sys/dev/sound/pci/hdsp-pcm.c
569
if (ch->dir == PCMDIR_PLAY) {
sys/dev/sound/pci/hdsp-pcm.c
571
pos = sndbuf_getreadyptr(ch->buffer) / channels;
sys/dev/sound/pci/hdsp-pcm.c
572
length = sndbuf_getready(ch->buffer) / channels;
sys/dev/sound/pci/hdsp-pcm.c
577
offset = (ch->position + buffer_size) - pos;
sys/dev/sound/pci/hdsp-pcm.c
585
pos = sndbuf_getfreeptr(ch->buffer) / channels;
sys/dev/sound/pci/hdsp-pcm.c
606
slots = hdsp_port_slot_map(ch->ports, sc->speed);
sys/dev/sound/pci/hdsp-pcm.c
611
if (ch->dir == PCMDIR_PLAY) {
sys/dev/sound/pci/hdsp-pcm.c
612
buffer_mux_port(sc->pbuf, ch->data, row, slots, pos,
sys/dev/sound/pci/hdsp-pcm.c
614
buffer_mux_port(sc->pbuf, ch->data, row, slots, 0,
sys/dev/sound/pci/hdsp-pcm.c
617
buffer_demux_port(sc->rbuf, ch->data, row, slots, pos,
sys/dev/sound/pci/hdsp-pcm.c
619
buffer_demux_port(sc->rbuf, ch->data, row, slots, 0,
sys/dev/sound/pci/hdsp-pcm.c
627
ch->position = ((pos + length) * 4) % buffer_size;
sys/dev/sound/pci/hdsp-pcm.c
631
clean(struct sc_chinfo *ch)
sys/dev/sound/pci/hdsp-pcm.c
639
scp = ch->parent;
sys/dev/sound/pci/hdsp-pcm.c
643
if (ch->dir == PCMDIR_PLAY)
sys/dev/sound/pci/hdsp-pcm.c
647
slots = hdsp_port_slot_map(ch->ports, sc->speed);
sys/dev/sound/pci/hdsp-pcm.c
658
ch->position = 0;
sys/dev/sound/pci/hdsp-pcm.c
668
struct sc_chinfo *ch;
sys/dev/sound/pci/hdsp-pcm.c
671
ch = data;
sys/dev/sound/pci/hdsp-pcm.c
672
scp = ch->parent;
sys/dev/sound/pci/hdsp-pcm.c
680
free(ch->data, M_HDSP);
sys/dev/sound/pci/hdsp-pcm.c
681
ch->data = NULL;
sys/dev/sound/pci/hdsp-pcm.c
682
free(ch->caps, M_HDSP);
sys/dev/sound/pci/hdsp-pcm.c
683
ch->caps = NULL;
sys/dev/sound/pci/hdsp-pcm.c
694
struct sc_chinfo *ch;
sys/dev/sound/pci/hdsp-pcm.c
704
ch = &scp->chan[num];
sys/dev/sound/pci/hdsp-pcm.c
707
ch->ports = hdsp_channel_play_ports(scp->hc);
sys/dev/sound/pci/hdsp-pcm.c
709
ch->ports = hdsp_channel_rec_ports(scp->hc);
sys/dev/sound/pci/hdsp-pcm.c
711
ch->run = 0;
sys/dev/sound/pci/hdsp-pcm.c
712
ch->lvol = 0;
sys/dev/sound/pci/hdsp-pcm.c
713
ch->rvol = 0;
sys/dev/sound/pci/hdsp-pcm.c
716
ch->cap_fmts[0] =
sys/dev/sound/pci/hdsp-pcm.c
717
SND_FORMAT(AFMT_S32_LE, hdsp_port_slot_count(ch->ports, 48000), 0);
sys/dev/sound/pci/hdsp-pcm.c
718
ch->cap_fmts[1] =
sys/dev/sound/pci/hdsp-pcm.c
719
SND_FORMAT(AFMT_S32_LE, hdsp_port_slot_count(ch->ports, 96000), 0);
sys/dev/sound/pci/hdsp-pcm.c
720
ch->cap_fmts[2] =
sys/dev/sound/pci/hdsp-pcm.c
721
SND_FORMAT(AFMT_S32_LE, hdsp_port_slot_count(ch->ports, 192000), 0);
sys/dev/sound/pci/hdsp-pcm.c
722
ch->cap_fmts[3] = 0;
sys/dev/sound/pci/hdsp-pcm.c
724
ch->caps = malloc(sizeof(struct pcmchan_caps), M_HDSP, M_NOWAIT);
sys/dev/sound/pci/hdsp-pcm.c
725
*(ch->caps) = (struct pcmchan_caps) {32000, 192000, ch->cap_fmts, 0};
sys/dev/sound/pci/hdsp-pcm.c
729
ch->cap_fmts[2] = SND_FORMAT(AFMT_S32_LE, 2, 0);
sys/dev/sound/pci/hdsp-pcm.c
730
ch->caps->maxspeed = 96000;
sys/dev/sound/pci/hdsp-pcm.c
734
ch->size = HDSP_CHANBUF_SIZE * hdsp_port_slot_count_max(ch->ports);
sys/dev/sound/pci/hdsp-pcm.c
735
ch->data = malloc(ch->size, M_HDSP, M_NOWAIT);
sys/dev/sound/pci/hdsp-pcm.c
736
ch->position = 0;
sys/dev/sound/pci/hdsp-pcm.c
738
ch->buffer = b;
sys/dev/sound/pci/hdsp-pcm.c
739
ch->channel = c;
sys/dev/sound/pci/hdsp-pcm.c
740
ch->parent = scp;
sys/dev/sound/pci/hdsp-pcm.c
742
ch->dir = dir;
sys/dev/sound/pci/hdsp-pcm.c
746
if (sndbuf_setup(ch->buffer, ch->data, ch->size) != 0) {
sys/dev/sound/pci/hdsp-pcm.c
748
hdspchan_free(obj, ch);
sys/dev/sound/pci/hdsp-pcm.c
752
return (ch);
sys/dev/sound/pci/hdsp-pcm.c
759
struct sc_chinfo *ch;
sys/dev/sound/pci/hdsp-pcm.c
762
ch = data;
sys/dev/sound/pci/hdsp-pcm.c
763
scp = ch->parent;
sys/dev/sound/pci/hdsp-pcm.c
772
hdspchan_enable(ch, 1);
sys/dev/sound/pci/hdsp-pcm.c
773
hdspchan_setgain(ch);
sys/dev/sound/pci/hdsp-pcm.c
782
clean(ch);
sys/dev/sound/pci/hdsp-pcm.c
783
hdspchan_enable(ch, 0);
sys/dev/sound/pci/hdsp-pcm.c
789
if(ch->run)
sys/dev/sound/pci/hdsp-pcm.c
790
buffer_copy(ch);
sys/dev/sound/pci/hdsp-pcm.c
803
struct sc_chinfo *ch;
sys/dev/sound/pci/hdsp-pcm.c
807
ch = data;
sys/dev/sound/pci/hdsp-pcm.c
808
scp = ch->parent;
sys/dev/sound/pci/hdsp-pcm.c
817
pos *= AFMT_CHANNEL(ch->format); /* Hardbuf with multiple channels. */
sys/dev/sound/pci/hdsp-pcm.c
825
struct sc_chinfo *ch;
sys/dev/sound/pci/hdsp-pcm.c
827
ch = data;
sys/dev/sound/pci/hdsp-pcm.c
830
struct sc_pcminfo *scp = ch->parent;
sys/dev/sound/pci/hdsp-pcm.c
834
ch->format = format;
sys/dev/sound/pci/hdsp-pcm.c
844
struct sc_chinfo *ch;
sys/dev/sound/pci/hdsp-pcm.c
849
ch = data;
sys/dev/sound/pci/hdsp-pcm.c
850
scp = ch->parent;
sys/dev/sound/pci/hdsp-pcm.c
906
struct sc_chinfo *ch;
sys/dev/sound/pci/hdsp-pcm.c
911
ch = data;
sys/dev/sound/pci/hdsp-pcm.c
912
scp = ch->parent;
sys/dev/sound/pci/hdsp-pcm.c
961
sndbuf_resize(ch->buffer, 2,
sys/dev/sound/pci/hdsp-pcm.c
962
(sc->period * AFMT_CHANNEL(ch->format) * sizeof(uint32_t)));
sys/dev/sound/pci/hdsp-pcm.c
970
return (ch->buffer->blksz);
sys/dev/sound/pci/hdsp-pcm.c
984
struct sc_chinfo *ch;
sys/dev/sound/pci/hdsp-pcm.c
986
ch = data;
sys/dev/sound/pci/hdsp-pcm.c
989
device_printf(ch->parent->dev, "hdspchan_getcaps()\n");
sys/dev/sound/pci/hdsp-pcm.c
992
if (ch->caps != NULL)
sys/dev/sound/pci/hdsp-pcm.c
993
return (ch->caps);
sys/dev/sound/pci/hdspe-pcm.c
1016
struct sc_chinfo *ch;
sys/dev/sound/pci/hdspe-pcm.c
1023
ch = &scp->chan[i];
sys/dev/sound/pci/hdspe-pcm.c
1025
chn_intr(ch->channel);
sys/dev/sound/pci/hdspe-pcm.c
232
hdspe_hw_mixer(struct sc_chinfo *ch, unsigned int dst,
sys/dev/sound/pci/hdspe-pcm.c
239
scp = ch->parent;
sys/dev/sound/pci/hdspe-pcm.c
243
if (ch->dir == PCMDIR_PLAY)
sys/dev/sound/pci/hdspe-pcm.c
254
hdspechan_setgain(struct sc_chinfo *ch)
sys/dev/sound/pci/hdspe-pcm.c
261
sc = ch->parent->sc;
sys/dev/sound/pci/hdspe-pcm.c
264
ports = ch->ports;
sys/dev/sound/pci/hdspe-pcm.c
274
volume = ch->lvol * HDSPE_MAX_GAIN / 100;
sys/dev/sound/pci/hdspe-pcm.c
276
hdspe_hw_mixer(ch, slot, slot, volume);
sys/dev/sound/pci/hdspe-pcm.c
278
volume = ch->rvol * HDSPE_MAX_GAIN / 100;
sys/dev/sound/pci/hdspe-pcm.c
321
struct sc_chinfo *ch;
sys/dev/sound/pci/hdspe-pcm.c
332
ch = &scp->chan[i];
sys/dev/sound/pci/hdspe-pcm.c
333
if ((dev == SOUND_MIXER_VOLUME && ch->dir == PCMDIR_PLAY) ||
sys/dev/sound/pci/hdspe-pcm.c
334
(dev == SOUND_MIXER_RECLEV && ch->dir == PCMDIR_REC)) {
sys/dev/sound/pci/hdspe-pcm.c
335
ch->lvol = left;
sys/dev/sound/pci/hdspe-pcm.c
336
ch->rvol = right;
sys/dev/sound/pci/hdspe-pcm.c
337
if (ch->run)
sys/dev/sound/pci/hdspe-pcm.c
338
hdspechan_setgain(ch);
sys/dev/sound/pci/hdspe-pcm.c
353
hdspechan_enable(struct sc_chinfo *ch, int value)
sys/dev/sound/pci/hdspe-pcm.c
361
scp = ch->parent;
sys/dev/sound/pci/hdspe-pcm.c
364
if (ch->dir == PCMDIR_PLAY)
sys/dev/sound/pci/hdspe-pcm.c
369
ch->run = value;
sys/dev/sound/pci/hdspe-pcm.c
372
ports = ch->ports;
sys/dev/sound/pci/hdspe-pcm.c
393
struct sc_chinfo *ch;
sys/dev/sound/pci/hdspe-pcm.c
405
ch = &scp->chan[j];
sys/dev/sound/pci/hdspe-pcm.c
406
if (ch->run)
sys/dev/sound/pci/hdspe-pcm.c
539
buffer_copy(struct sc_chinfo *ch)
sys/dev/sound/pci/hdspe-pcm.c
549
scp = ch->parent;
sys/dev/sound/pci/hdspe-pcm.c
552
n = AFMT_CHANNEL(ch->format); /* n channels */
sys/dev/sound/pci/hdspe-pcm.c
556
if (n == hdspe_channel_count(ch->ports, 2))
sys/dev/sound/pci/hdspe-pcm.c
558
else if (n == hdspe_channel_count(ch->ports, 4))
sys/dev/sound/pci/hdspe-pcm.c
564
if (ch->dir == PCMDIR_PLAY) {
sys/dev/sound/pci/hdspe-pcm.c
566
pos = sndbuf_getreadyptr(ch->buffer) / n;
sys/dev/sound/pci/hdspe-pcm.c
567
length = sndbuf_getready(ch->buffer) / n;
sys/dev/sound/pci/hdspe-pcm.c
572
offset = (ch->position + HDSPE_CHANBUF_SIZE) - pos;
sys/dev/sound/pci/hdspe-pcm.c
580
pos = sndbuf_getfreeptr(ch->buffer) / n;
sys/dev/sound/pci/hdspe-pcm.c
594
ports = ch->ports;
sys/dev/sound/pci/hdspe-pcm.c
601
if (ch->dir == PCMDIR_PLAY)
sys/dev/sound/pci/hdspe-pcm.c
602
buffer_mux_port(sc->pbuf, ch->data, row, ch->ports, pos,
sys/dev/sound/pci/hdspe-pcm.c
605
buffer_demux_port(sc->rbuf, ch->data, row, ch->ports,
sys/dev/sound/pci/hdspe-pcm.c
615
ch->position = ((pos + length) * 4) % HDSPE_CHANBUF_SIZE;
sys/dev/sound/pci/hdspe-pcm.c
619
clean(struct sc_chinfo *ch)
sys/dev/sound/pci/hdspe-pcm.c
627
scp = ch->parent;
sys/dev/sound/pci/hdspe-pcm.c
631
if (ch->dir == PCMDIR_PLAY)
sys/dev/sound/pci/hdspe-pcm.c
635
ports = ch->ports;
sys/dev/sound/pci/hdspe-pcm.c
649
ch->position = 0;
sys/dev/sound/pci/hdspe-pcm.c
659
struct sc_chinfo *ch;
sys/dev/sound/pci/hdspe-pcm.c
662
ch = data;
sys/dev/sound/pci/hdspe-pcm.c
663
scp = ch->parent;
sys/dev/sound/pci/hdspe-pcm.c
671
free(ch->data, M_HDSPE);
sys/dev/sound/pci/hdspe-pcm.c
672
ch->data = NULL;
sys/dev/sound/pci/hdspe-pcm.c
673
free(ch->caps, M_HDSPE);
sys/dev/sound/pci/hdspe-pcm.c
674
ch->caps = NULL;
sys/dev/sound/pci/hdspe-pcm.c
685
struct sc_chinfo *ch;
sys/dev/sound/pci/hdspe-pcm.c
695
ch = &scp->chan[num];
sys/dev/sound/pci/hdspe-pcm.c
698
ch->ports = hdspe_channel_play_ports(scp->hc);
sys/dev/sound/pci/hdspe-pcm.c
700
ch->ports = hdspe_channel_rec_ports(scp->hc);
sys/dev/sound/pci/hdspe-pcm.c
702
ch->run = 0;
sys/dev/sound/pci/hdspe-pcm.c
703
ch->lvol = 0;
sys/dev/sound/pci/hdspe-pcm.c
704
ch->rvol = 0;
sys/dev/sound/pci/hdspe-pcm.c
707
ch->cap_fmts[0] =
sys/dev/sound/pci/hdspe-pcm.c
708
SND_FORMAT(AFMT_S32_LE, hdspe_channel_count(ch->ports, 2), 0);
sys/dev/sound/pci/hdspe-pcm.c
709
ch->cap_fmts[1] =
sys/dev/sound/pci/hdspe-pcm.c
710
SND_FORMAT(AFMT_S32_LE, hdspe_channel_count(ch->ports, 4), 0);
sys/dev/sound/pci/hdspe-pcm.c
711
ch->cap_fmts[2] =
sys/dev/sound/pci/hdspe-pcm.c
712
SND_FORMAT(AFMT_S32_LE, hdspe_channel_count(ch->ports, 8), 0);
sys/dev/sound/pci/hdspe-pcm.c
713
ch->cap_fmts[3] = 0;
sys/dev/sound/pci/hdspe-pcm.c
714
ch->caps = malloc(sizeof(struct pcmchan_caps), M_HDSPE, M_NOWAIT);
sys/dev/sound/pci/hdspe-pcm.c
715
*(ch->caps) = (struct pcmchan_caps) {32000, 192000, ch->cap_fmts, 0};
sys/dev/sound/pci/hdspe-pcm.c
718
ch->size = HDSPE_CHANBUF_SIZE * hdspe_channel_count(ch->ports, 8);
sys/dev/sound/pci/hdspe-pcm.c
719
ch->data = malloc(ch->size, M_HDSPE, M_NOWAIT);
sys/dev/sound/pci/hdspe-pcm.c
720
ch->position = 0;
sys/dev/sound/pci/hdspe-pcm.c
722
ch->buffer = b;
sys/dev/sound/pci/hdspe-pcm.c
723
ch->channel = c;
sys/dev/sound/pci/hdspe-pcm.c
724
ch->parent = scp;
sys/dev/sound/pci/hdspe-pcm.c
726
ch->dir = dir;
sys/dev/sound/pci/hdspe-pcm.c
730
if (sndbuf_setup(ch->buffer, ch->data, ch->size) != 0) {
sys/dev/sound/pci/hdspe-pcm.c
732
hdspechan_free(obj, ch);
sys/dev/sound/pci/hdspe-pcm.c
736
return (ch);
sys/dev/sound/pci/hdspe-pcm.c
743
struct sc_chinfo *ch;
sys/dev/sound/pci/hdspe-pcm.c
746
ch = data;
sys/dev/sound/pci/hdspe-pcm.c
747
scp = ch->parent;
sys/dev/sound/pci/hdspe-pcm.c
756
hdspechan_enable(ch, 1);
sys/dev/sound/pci/hdspe-pcm.c
757
hdspechan_setgain(ch);
sys/dev/sound/pci/hdspe-pcm.c
766
clean(ch);
sys/dev/sound/pci/hdspe-pcm.c
767
hdspechan_enable(ch, 0);
sys/dev/sound/pci/hdspe-pcm.c
773
if(ch->run)
sys/dev/sound/pci/hdspe-pcm.c
774
buffer_copy(ch);
sys/dev/sound/pci/hdspe-pcm.c
787
struct sc_chinfo *ch;
sys/dev/sound/pci/hdspe-pcm.c
791
ch = data;
sys/dev/sound/pci/hdspe-pcm.c
792
scp = ch->parent;
sys/dev/sound/pci/hdspe-pcm.c
800
pos *= AFMT_CHANNEL(ch->format); /* Hardbuf with multiple channels. */
sys/dev/sound/pci/hdspe-pcm.c
808
struct sc_chinfo *ch;
sys/dev/sound/pci/hdspe-pcm.c
810
ch = data;
sys/dev/sound/pci/hdspe-pcm.c
813
struct sc_pcminfo *scp = ch->parent;
sys/dev/sound/pci/hdspe-pcm.c
817
ch->format = format;
sys/dev/sound/pci/hdspe-pcm.c
827
struct sc_chinfo *ch;
sys/dev/sound/pci/hdspe-pcm.c
833
ch = data;
sys/dev/sound/pci/hdspe-pcm.c
834
scp = ch->parent;
sys/dev/sound/pci/hdspe-pcm.c
901
struct sc_chinfo *ch;
sys/dev/sound/pci/hdspe-pcm.c
906
ch = data;
sys/dev/sound/pci/hdspe-pcm.c
907
scp = ch->parent;
sys/dev/sound/pci/hdspe-pcm.c
956
sndbuf_resize(ch->buffer,
sys/dev/sound/pci/hdspe-pcm.c
957
(HDSPE_CHANBUF_SIZE * AFMT_CHANNEL(ch->format)) / (sc->period * 4),
sys/dev/sound/pci/hdspe-pcm.c
961
return (ch->buffer->blksz);
sys/dev/sound/pci/hdspe-pcm.c
974
struct sc_chinfo *ch;
sys/dev/sound/pci/hdspe-pcm.c
976
ch = data;
sys/dev/sound/pci/hdspe-pcm.c
979
struct sc_pcminfo *scl = ch->parent;
sys/dev/sound/pci/hdspe-pcm.c
983
if (ch->caps != NULL)
sys/dev/sound/pci/hdspe-pcm.c
984
return (ch->caps);
sys/dev/sound/pci/ich.c
1175
sc->ch[i].run_save = sc->ch[i].run;
sys/dev/sound/pci/ich.c
1176
if (sc->ch[i].run) {
sys/dev/sound/pci/ich.c
1178
ichchan_trigger(0, &sc->ch[i], PCMTRIG_ABORT);
sys/dev/sound/pci/ich.c
1212
struct sc_chinfo *ch = &sc->ch[i];
sys/dev/sound/pci/ich.c
1213
if (sc->ch[i].run_save) {
sys/dev/sound/pci/ich.c
1214
ichchan_setblocksize(0, ch, ch->blksz);
sys/dev/sound/pci/ich.c
1215
ichchan_setspeed(0, ch, ch->spd);
sys/dev/sound/pci/ich.c
1216
ichchan_trigger(0, ch, PCMTRIG_START);
sys/dev/sound/pci/ich.c
190
struct sc_chinfo ch[3];
sys/dev/sound/pci/ich.c
298
ich_filldtbl(struct sc_chinfo *ch)
sys/dev/sound/pci/ich.c
300
struct sc_info *sc = ch->parent;
sys/dev/sound/pci/ich.c
304
base = ch->buffer->buf_addr;
sys/dev/sound/pci/ich.c
305
if ((ch->blksz * ch->blkcnt) > ch->buffer->maxsize)
sys/dev/sound/pci/ich.c
306
ch->blksz = ch->buffer->maxsize / ch->blkcnt;
sys/dev/sound/pci/ich.c
307
if ((ch->buffer->blksz != ch->blksz ||
sys/dev/sound/pci/ich.c
308
ch->buffer->blkcnt != ch->blkcnt) &&
sys/dev/sound/pci/ich.c
309
sndbuf_resize(ch->buffer, ch->blkcnt, ch->blksz) != 0)
sys/dev/sound/pci/ich.c
311
__func__, ch->blksz, ch->blkcnt);
sys/dev/sound/pci/ich.c
312
ch->blksz = ch->buffer->blksz;
sys/dev/sound/pci/ich.c
315
ch->dtbl[i].buffer = base + (ch->blksz * (i % ch->blkcnt));
sys/dev/sound/pci/ich.c
316
ch->dtbl[i].length = ICH_BDC_IOC
sys/dev/sound/pci/ich.c
317
| (ch->blksz / ch->parent->sample_size);
sys/dev/sound/pci/ich.c
371
struct sc_chinfo *ch;
sys/dev/sound/pci/ich.c
376
ch = &sc->ch[num];
sys/dev/sound/pci/ich.c
377
ch->num = num;
sys/dev/sound/pci/ich.c
378
ch->buffer = b;
sys/dev/sound/pci/ich.c
379
ch->channel = c;
sys/dev/sound/pci/ich.c
380
ch->parent = sc;
sys/dev/sound/pci/ich.c
381
ch->run = 0;
sys/dev/sound/pci/ich.c
382
ch->dtbl = sc->dtbl + (ch->num * ICH_DTBL_LENGTH);
sys/dev/sound/pci/ich.c
383
ch->desc_addr = sc->desc_addr +
sys/dev/sound/pci/ich.c
384
(ch->num * ICH_DTBL_LENGTH * sizeof(struct ich_desc));
sys/dev/sound/pci/ich.c
385
ch->blkcnt = sc->blkcnt;
sys/dev/sound/pci/ich.c
386
ch->blksz = sc->bufsz / ch->blkcnt;
sys/dev/sound/pci/ich.c
388
switch(ch->num) {
sys/dev/sound/pci/ich.c
391
ch->regbase = ICH_REG_PO_BASE;
sys/dev/sound/pci/ich.c
392
ch->spdreg = (sc->hasvra) ? AC97_REGEXT_FDACRATE : 0;
sys/dev/sound/pci/ich.c
393
ch->imask = ICH_GLOB_STA_POINT;
sys/dev/sound/pci/ich.c
398
ch->regbase = ICH_REG_PI_BASE;
sys/dev/sound/pci/ich.c
399
ch->spdreg = (sc->hasvra) ? AC97_REGEXT_LADCRATE : 0;
sys/dev/sound/pci/ich.c
400
ch->imask = ICH_GLOB_STA_PIINT;
sys/dev/sound/pci/ich.c
405
ch->regbase = ICH_REG_MC_BASE;
sys/dev/sound/pci/ich.c
406
ch->spdreg = (sc->hasvrm) ? AC97_REGEXT_MADCRATE : 0;
sys/dev/sound/pci/ich.c
407
ch->imask = ICH_GLOB_STA_MINT;
sys/dev/sound/pci/ich.c
415
ch->spdreg = 0;
sys/dev/sound/pci/ich.c
418
if (sndbuf_alloc(ch->buffer, sc->chan_dmat,
sys/dev/sound/pci/ich.c
424
ich_wr(sc, ch->regbase + ICH_REG_X_BDBAR, (uint32_t)(ch->desc_addr), 4);
sys/dev/sound/pci/ich.c
427
return (ch);
sys/dev/sound/pci/ich.c
435
struct sc_chinfo *ch = data;
sys/dev/sound/pci/ich.c
436
struct sc_info *sc = ch->parent;
sys/dev/sound/pci/ich.c
449
struct sc_chinfo *ch = data;
sys/dev/sound/pci/ich.c
450
struct sc_info *sc = ch->parent;
sys/dev/sound/pci/ich.c
459
if (ch->spdreg) {
sys/dev/sound/pci/ich.c
472
ch->spd = ((uint64_t)ac97_setrate(sc->codec, ch->spdreg, r) *
sys/dev/sound/pci/ich.c
475
ch->spd = 48000;
sys/dev/sound/pci/ich.c
477
return (ch->spd);
sys/dev/sound/pci/ich.c
483
struct sc_chinfo *ch = data;
sys/dev/sound/pci/ich.c
484
struct sc_info *sc = ch->parent;
sys/dev/sound/pci/ich.c
494
blocksize = ch->buffer->maxsize / ch->blkcnt;
sys/dev/sound/pci/ich.c
499
ch->blksz = blocksize;
sys/dev/sound/pci/ich.c
500
ich_filldtbl(ch);
sys/dev/sound/pci/ich.c
502
ich_wr(sc, ch->regbase + ICH_REG_X_LVI, ch->blkcnt - 1, 1);
sys/dev/sound/pci/ich.c
505
return (ch->blksz);
sys/dev/sound/pci/ich.c
511
struct sc_chinfo *ch = data;
sys/dev/sound/pci/ich.c
512
struct sc_info *sc = ch->parent;
sys/dev/sound/pci/ich.c
523
ch->run = 1;
sys/dev/sound/pci/ich.c
525
ich_wr(sc, ch->regbase + ICH_REG_X_BDBAR, (uint32_t)(ch->desc_addr), 4);
sys/dev/sound/pci/ich.c
526
ich_wr(sc, ch->regbase + ICH_REG_X_CR, ICH_X_CR_RPBM | ICH_X_CR_LVBIE | ICH_X_CR_IOCE, 1);
sys/dev/sound/pci/ich.c
532
ich_resetchan(sc, ch->num);
sys/dev/sound/pci/ich.c
534
ch->run = 0;
sys/dev/sound/pci/ich.c
545
struct sc_chinfo *ch = data;
sys/dev/sound/pci/ich.c
546
struct sc_info *sc = ch->parent;
sys/dev/sound/pci/ich.c
557
ch->civ = ich_rd(sc, ch->regbase + ICH_REG_X_CIV, 1) % ch->blkcnt;
sys/dev/sound/pci/ich.c
560
pos = ch->civ * ch->blksz;
sys/dev/sound/pci/ich.c
568
struct sc_chinfo *ch = data;
sys/dev/sound/pci/ich.c
571
struct sc_info *sc = ch->parent;
sys/dev/sound/pci/ich.c
574
device_printf(ch->parent->dev,
sys/dev/sound/pci/ich.c
579
return ((ch->spdreg) ? &ich_vrcaps : &ich_caps);
sys/dev/sound/pci/ich.c
601
struct sc_chinfo *ch;
sys/dev/sound/pci/ich.c
622
ch = &sc->ch[i];
sys/dev/sound/pci/ich.c
623
if ((ch->imask & gs) == 0)
sys/dev/sound/pci/ich.c
625
gs &= ~ch->imask;
sys/dev/sound/pci/ich.c
626
st = ich_rd(sc, ch->regbase +
sys/dev/sound/pci/ich.c
632
if (ch->run) {
sys/dev/sound/pci/ich.c
634
chn_intr(ch->channel);
sys/dev/sound/pci/ich.c
637
lvi = ich_rd(sc, ch->regbase + ICH_REG_X_LVI, 1);
sys/dev/sound/pci/ich.c
638
cbi = ch->civ % ch->blkcnt;
sys/dev/sound/pci/ich.c
640
cbi = ch->blkcnt - 1;
sys/dev/sound/pci/ich.c
643
lbi = lvi % ch->blkcnt;
sys/dev/sound/pci/ich.c
647
lvi += cbi + ch->blkcnt - lbi;
sys/dev/sound/pci/ich.c
649
ich_wr(sc, ch->regbase + ICH_REG_X_LVI, lvi, 1);
sys/dev/sound/pci/ich.c
652
ich_wr(sc, ch->regbase +
sys/dev/sound/pci/ich.c
710
struct sc_chinfo *ch;
sys/dev/sound/pci/ich.c
717
ch = &sc->ch[1];
sys/dev/sound/pci/ich.c
731
KASSERT(ch->regbase == ICH_REG_PI_BASE, ("wrong direction"));
sys/dev/sound/pci/ich.c
733
oblkcnt = ch->blkcnt;
sys/dev/sound/pci/ich.c
734
ch->blkcnt = 2;
sys/dev/sound/pci/ich.c
737
ichchan_setblocksize(0, ch, ch->buffer->maxsize >> 1);
sys/dev/sound/pci/ich.c
754
ociv = ich_rd(sc, ch->regbase + ICH_REG_X_CIV, 1);
sys/dev/sound/pci/ich.c
756
ich_wr(sc, ch->regbase + ICH_REG_X_BDBAR, (uint32_t)(ch->desc_addr), 4);
sys/dev/sound/pci/ich.c
760
ich_wr(sc, ch->regbase + ICH_REG_X_CR, ICH_X_CR_RPBM, 1);
sys/dev/sound/pci/ich.c
767
nciv = ich_rd(sc, ch->regbase + ICH_REG_X_CIV, 1);
sys/dev/sound/pci/ich.c
771
ich_wr(sc, ch->regbase + ICH_REG_X_CR, 0, 1);
sys/dev/sound/pci/ich.c
775
ich_wr(sc, ch->regbase + ICH_REG_X_CR, ICH_X_CR_RR, 1);
sys/dev/sound/pci/ich.c
776
ch->blkcnt = oblkcnt;
sys/dev/sound/pci/ich.c
791
actual_48k_rate = ((uint64_t)ch->blksz * 250000) / wait_us;
sys/dev/sound/pci/maestro3.c
1003
("m3_rchan_trigger(adc=%d, go=0x%x{%s})\n", ch->adc_idx, go,
sys/dev/sound/pci/maestro3.c
1010
if (ch->active) {
sys/dev/sound/pci/maestro3.c
1013
ch->active = 1;
sys/dev/sound/pci/maestro3.c
1014
ch->ptr = 0;
sys/dev/sound/pci/maestro3.c
1015
ch->prevptr = 0;
sys/dev/sound/pci/maestro3.c
1026
m3_wr_assp_data(sc, ch->adc_data + CDATA_INSTANCE_READY, 1);
sys/dev/sound/pci/maestro3.c
1031
if (ch->active == 0) {
sys/dev/sound/pci/maestro3.c
1034
ch->active = 0;
sys/dev/sound/pci/maestro3.c
1044
m3_wr_assp_data(sc, ch->adc_data + CDATA_INSTANCE_READY, 0);
sys/dev/sound/pci/maestro3.c
1059
m3_rchan_getptr_internal(struct sc_rchinfo *ch)
sys/dev/sound/pci/maestro3.c
1061
struct sc_info *sc = ch->parent;
sys/dev/sound/pci/maestro3.c
1064
bus_base = ch->buffer->buf_addr;
sys/dev/sound/pci/maestro3.c
1065
hi = m3_rd_assp_data(sc, ch->adc_data + CDATA_HOST_SRC_CURRENTH);
sys/dev/sound/pci/maestro3.c
1066
lo = m3_rd_assp_data(sc, ch->adc_data + CDATA_HOST_SRC_CURRENTL);
sys/dev/sound/pci/maestro3.c
1070
ch->adc_idx, bus_crnt - bus_base));
sys/dev/sound/pci/maestro3.c
1078
struct sc_rchinfo *ch = chdata;
sys/dev/sound/pci/maestro3.c
1079
struct sc_info *sc = ch->parent;
sys/dev/sound/pci/maestro3.c
1083
ptr = ch->ptr;
sys/dev/sound/pci/maestro3.c
1092
struct sc_rchinfo *ch = chdata;
sys/dev/sound/pci/maestro3.c
1094
M3_DEBUG(CALL, ("m3_rchan_getcaps(adc=%d)\n", ch->adc_idx));
sys/dev/sound/pci/maestro3.c
377
struct sc_pchinfo *ch;
sys/dev/sound/pci/maestro3.c
427
ch = &sc->pch[idx];
sys/dev/sound/pci/maestro3.c
428
ch->dac_idx = idx;
sys/dev/sound/pci/maestro3.c
429
ch->dac_data = dac_data;
sys/dev/sound/pci/maestro3.c
430
if (ch->dac_data + data_bytes/2 >= 0x1c00) {
sys/dev/sound/pci/maestro3.c
436
ch->buffer = b;
sys/dev/sound/pci/maestro3.c
437
ch->parent = sc;
sys/dev/sound/pci/maestro3.c
438
ch->channel = c;
sys/dev/sound/pci/maestro3.c
439
ch->fmt = SND_FORMAT(AFMT_U8, 1, 0);
sys/dev/sound/pci/maestro3.c
440
ch->spd = 8000;
sys/dev/sound/pci/maestro3.c
442
if (sndbuf_alloc(ch->buffer, sc->parent_dmat, 0, sc->bufsz) != 0) {
sys/dev/sound/pci/maestro3.c
447
ch->bufsize = ch->buffer->bufsize;
sys/dev/sound/pci/maestro3.c
450
bus_addr = ch->buffer->buf_addr;
sys/dev/sound/pci/maestro3.c
455
m3_wr_assp_data(sc, ch->dac_data + CDATA_HOST_SRC_ADDRL, LO(bus_addr));
sys/dev/sound/pci/maestro3.c
456
m3_wr_assp_data(sc, ch->dac_data + CDATA_HOST_SRC_ADDRH, HI(bus_addr));
sys/dev/sound/pci/maestro3.c
457
m3_wr_assp_data(sc, ch->dac_data + CDATA_HOST_SRC_END_PLUS_1L,
sys/dev/sound/pci/maestro3.c
458
LO(bus_addr + ch->bufsize));
sys/dev/sound/pci/maestro3.c
459
m3_wr_assp_data(sc, ch->dac_data + CDATA_HOST_SRC_END_PLUS_1H,
sys/dev/sound/pci/maestro3.c
460
HI(bus_addr + ch->bufsize));
sys/dev/sound/pci/maestro3.c
461
m3_wr_assp_data(sc, ch->dac_data + CDATA_HOST_SRC_CURRENTL,
sys/dev/sound/pci/maestro3.c
463
m3_wr_assp_data(sc, ch->dac_data + CDATA_HOST_SRC_CURRENTH,
sys/dev/sound/pci/maestro3.c
467
m3_wr_assp_data(sc, ch->dac_data + CDATA_IN_BUF_BEGIN, dsp_in_buf);
sys/dev/sound/pci/maestro3.c
468
m3_wr_assp_data(sc, ch->dac_data + CDATA_IN_BUF_END_PLUS_1,
sys/dev/sound/pci/maestro3.c
470
m3_wr_assp_data(sc, ch->dac_data + CDATA_IN_BUF_HEAD, dsp_in_buf);
sys/dev/sound/pci/maestro3.c
471
m3_wr_assp_data(sc, ch->dac_data + CDATA_IN_BUF_TAIL, dsp_in_buf);
sys/dev/sound/pci/maestro3.c
472
m3_wr_assp_data(sc, ch->dac_data + CDATA_OUT_BUF_BEGIN, dsp_out_buf);
sys/dev/sound/pci/maestro3.c
473
m3_wr_assp_data(sc, ch->dac_data + CDATA_OUT_BUF_END_PLUS_1,
sys/dev/sound/pci/maestro3.c
475
m3_wr_assp_data(sc, ch->dac_data + CDATA_OUT_BUF_HEAD, dsp_out_buf);
sys/dev/sound/pci/maestro3.c
476
m3_wr_assp_data(sc, ch->dac_data + CDATA_OUT_BUF_TAIL, dsp_out_buf);
sys/dev/sound/pci/maestro3.c
479
m3_wr_assp_data(sc, ch->dac_data + SRC3_DIRECTION_OFFSET + 12,
sys/dev/sound/pci/maestro3.c
480
ch->dac_data + 40 + 8);
sys/dev/sound/pci/maestro3.c
481
m3_wr_assp_data(sc, ch->dac_data + SRC3_DIRECTION_OFFSET + 19,
sys/dev/sound/pci/maestro3.c
484
m3_wr_assp_data(sc, ch->dac_data + SRC3_DIRECTION_OFFSET + 22, 0);
sys/dev/sound/pci/maestro3.c
486
m3_wr_assp_data(sc, ch->dac_data + CDATA_DMA_CONTROL,
sys/dev/sound/pci/maestro3.c
492
m3_wr_assp_data(sc, ch->dac_data + pv[i].addr, pv[i].val);
sys/dev/sound/pci/maestro3.c
498
ch->dac_data >> DP_SHIFT_COUNT);
sys/dev/sound/pci/maestro3.c
500
ch->dac_data >> DP_SHIFT_COUNT);
sys/dev/sound/pci/maestro3.c
502
ch->dac_data >> DP_SHIFT_COUNT);
sys/dev/sound/pci/maestro3.c
505
m3_pchan_trigger_locked(NULL, ch, PCMTRIG_START);
sys/dev/sound/pci/maestro3.c
507
m3_pchan_trigger_locked(NULL, ch, PCMTRIG_STOP);
sys/dev/sound/pci/maestro3.c
512
return (ch);
sys/dev/sound/pci/maestro3.c
518
struct sc_pchinfo *ch = chdata;
sys/dev/sound/pci/maestro3.c
519
struct sc_info *sc = ch->parent;
sys/dev/sound/pci/maestro3.c
522
M3_DEBUG(CHANGE, ("m3_pchan_free(dac=%d)\n", ch->dac_idx));
sys/dev/sound/pci/maestro3.c
542
struct sc_pchinfo *ch = chdata;
sys/dev/sound/pci/maestro3.c
543
struct sc_info *sc = ch->parent;
sys/dev/sound/pci/maestro3.c
549
ch->dac_idx, format,
sys/dev/sound/pci/maestro3.c
555
m3_wr_assp_data(sc, ch->dac_data + SRC3_MODE_OFFSET, data);
sys/dev/sound/pci/maestro3.c
559
m3_wr_assp_data(sc, ch->dac_data + SRC3_WORD_LENGTH_OFFSET, data);
sys/dev/sound/pci/maestro3.c
561
ch->fmt = format;
sys/dev/sound/pci/maestro3.c
570
struct sc_pchinfo *ch = chdata;
sys/dev/sound/pci/maestro3.c
571
struct sc_info *sc = ch->parent;
sys/dev/sound/pci/maestro3.c
576
ch->dac_idx, speed));
sys/dev/sound/pci/maestro3.c
582
m3_wr_assp_data(sc, ch->dac_data + CDATA_FREQUENCY, freq);
sys/dev/sound/pci/maestro3.c
583
ch->spd = speed;
sys/dev/sound/pci/maestro3.c
593
struct sc_pchinfo *ch = chdata;
sys/dev/sound/pci/maestro3.c
596
ch->dac_idx, blocksize));
sys/dev/sound/pci/maestro3.c
598
return (ch->buffer->blksz);
sys/dev/sound/pci/maestro3.c
604
struct sc_pchinfo *ch = chdata;
sys/dev/sound/pci/maestro3.c
605
struct sc_info *sc = ch->parent;
sys/dev/sound/pci/maestro3.c
637
struct sc_pchinfo *ch = chdata;
sys/dev/sound/pci/maestro3.c
638
struct sc_info *sc = ch->parent;
sys/dev/sound/pci/maestro3.c
646
("m3_pchan_trigger(dac=%d, go=0x%x{%s})\n", ch->dac_idx, go,
sys/dev/sound/pci/maestro3.c
653
if (ch->active) {
sys/dev/sound/pci/maestro3.c
656
ch->active = 1;
sys/dev/sound/pci/maestro3.c
657
ch->ptr = 0;
sys/dev/sound/pci/maestro3.c
658
ch->prevptr = 0;
sys/dev/sound/pci/maestro3.c
669
m3_wr_assp_data(sc, ch->dac_data + CDATA_INSTANCE_READY, 1);
sys/dev/sound/pci/maestro3.c
676
if (ch->active == 0) {
sys/dev/sound/pci/maestro3.c
679
ch->active = 0;
sys/dev/sound/pci/maestro3.c
691
m3_wr_assp_data(sc, ch->dac_data + CDATA_INSTANCE_READY, 0);
sys/dev/sound/pci/maestro3.c
707
m3_pchan_getptr_internal(struct sc_pchinfo *ch)
sys/dev/sound/pci/maestro3.c
709
struct sc_info *sc = ch->parent;
sys/dev/sound/pci/maestro3.c
712
bus_base = ch->buffer->buf_addr;
sys/dev/sound/pci/maestro3.c
713
hi = m3_rd_assp_data(sc, ch->dac_data + CDATA_HOST_SRC_CURRENTH);
sys/dev/sound/pci/maestro3.c
714
lo = m3_rd_assp_data(sc, ch->dac_data + CDATA_HOST_SRC_CURRENTL);
sys/dev/sound/pci/maestro3.c
718
ch->dac_idx, bus_crnt - bus_base));
sys/dev/sound/pci/maestro3.c
726
struct sc_pchinfo *ch = chdata;
sys/dev/sound/pci/maestro3.c
727
struct sc_info *sc = ch->parent;
sys/dev/sound/pci/maestro3.c
731
ptr = ch->ptr;
sys/dev/sound/pci/maestro3.c
740
struct sc_pchinfo *ch = chdata;
sys/dev/sound/pci/maestro3.c
742
M3_DEBUG(CALL, ("m3_pchan_getcaps(dac=%d)\n", ch->dac_idx));
sys/dev/sound/pci/maestro3.c
754
struct sc_rchinfo *ch;
sys/dev/sound/pci/maestro3.c
806
ch = &sc->rch[idx];
sys/dev/sound/pci/maestro3.c
807
ch->adc_idx = idx;
sys/dev/sound/pci/maestro3.c
808
ch->adc_data = adc_data;
sys/dev/sound/pci/maestro3.c
809
if (ch->adc_data + data_bytes/2 >= 0x1c00) {
sys/dev/sound/pci/maestro3.c
815
ch->buffer = b;
sys/dev/sound/pci/maestro3.c
816
ch->parent = sc;
sys/dev/sound/pci/maestro3.c
817
ch->channel = c;
sys/dev/sound/pci/maestro3.c
818
ch->fmt = SND_FORMAT(AFMT_U8, 1, 0);
sys/dev/sound/pci/maestro3.c
819
ch->spd = 8000;
sys/dev/sound/pci/maestro3.c
821
if (sndbuf_alloc(ch->buffer, sc->parent_dmat, 0, sc->bufsz) != 0) {
sys/dev/sound/pci/maestro3.c
826
ch->bufsize = ch->buffer->bufsize;
sys/dev/sound/pci/maestro3.c
829
bus_addr = ch->buffer->buf_addr;
sys/dev/sound/pci/maestro3.c
834
m3_wr_assp_data(sc, ch->adc_data + CDATA_HOST_SRC_ADDRL, LO(bus_addr));
sys/dev/sound/pci/maestro3.c
835
m3_wr_assp_data(sc, ch->adc_data + CDATA_HOST_SRC_ADDRH, HI(bus_addr));
sys/dev/sound/pci/maestro3.c
836
m3_wr_assp_data(sc, ch->adc_data + CDATA_HOST_SRC_END_PLUS_1L,
sys/dev/sound/pci/maestro3.c
837
LO(bus_addr + ch->bufsize));
sys/dev/sound/pci/maestro3.c
838
m3_wr_assp_data(sc, ch->adc_data + CDATA_HOST_SRC_END_PLUS_1H,
sys/dev/sound/pci/maestro3.c
839
HI(bus_addr + ch->bufsize));
sys/dev/sound/pci/maestro3.c
840
m3_wr_assp_data(sc, ch->adc_data + CDATA_HOST_SRC_CURRENTL,
sys/dev/sound/pci/maestro3.c
842
m3_wr_assp_data(sc, ch->adc_data + CDATA_HOST_SRC_CURRENTH,
sys/dev/sound/pci/maestro3.c
846
m3_wr_assp_data(sc, ch->adc_data + CDATA_IN_BUF_BEGIN, dsp_in_buf);
sys/dev/sound/pci/maestro3.c
847
m3_wr_assp_data(sc, ch->adc_data + CDATA_IN_BUF_END_PLUS_1,
sys/dev/sound/pci/maestro3.c
849
m3_wr_assp_data(sc, ch->adc_data + CDATA_IN_BUF_HEAD, dsp_in_buf);
sys/dev/sound/pci/maestro3.c
850
m3_wr_assp_data(sc, ch->adc_data + CDATA_IN_BUF_TAIL, dsp_in_buf);
sys/dev/sound/pci/maestro3.c
851
m3_wr_assp_data(sc, ch->adc_data + CDATA_OUT_BUF_BEGIN, dsp_out_buf);
sys/dev/sound/pci/maestro3.c
852
m3_wr_assp_data(sc, ch->adc_data + CDATA_OUT_BUF_END_PLUS_1,
sys/dev/sound/pci/maestro3.c
854
m3_wr_assp_data(sc, ch->adc_data + CDATA_OUT_BUF_HEAD, dsp_out_buf);
sys/dev/sound/pci/maestro3.c
855
m3_wr_assp_data(sc, ch->adc_data + CDATA_OUT_BUF_TAIL, dsp_out_buf);
sys/dev/sound/pci/maestro3.c
858
m3_wr_assp_data(sc, ch->adc_data + SRC3_DIRECTION_OFFSET + 12,
sys/dev/sound/pci/maestro3.c
859
ch->adc_data + 40 + 8);
sys/dev/sound/pci/maestro3.c
860
m3_wr_assp_data(sc, ch->adc_data + CDATA_DMA_CONTROL,
sys/dev/sound/pci/maestro3.c
866
m3_wr_assp_data(sc, ch->adc_data + rv[i].addr, rv[i].val);
sys/dev/sound/pci/maestro3.c
872
ch->adc_data >> DP_SHIFT_COUNT);
sys/dev/sound/pci/maestro3.c
874
ch->adc_data >> DP_SHIFT_COUNT);
sys/dev/sound/pci/maestro3.c
876
ch->adc_data >> DP_SHIFT_COUNT);
sys/dev/sound/pci/maestro3.c
879
m3_rchan_trigger_locked(NULL, ch, PCMTRIG_START);
sys/dev/sound/pci/maestro3.c
881
m3_rchan_trigger_locked(NULL, ch, PCMTRIG_STOP);
sys/dev/sound/pci/maestro3.c
886
return (ch);
sys/dev/sound/pci/maestro3.c
892
struct sc_rchinfo *ch = chdata;
sys/dev/sound/pci/maestro3.c
893
struct sc_info *sc = ch->parent;
sys/dev/sound/pci/maestro3.c
896
M3_DEBUG(CHANGE, ("m3_rchan_free(adc=%d)\n", ch->adc_idx));
sys/dev/sound/pci/maestro3.c
916
struct sc_rchinfo *ch = chdata;
sys/dev/sound/pci/maestro3.c
917
struct sc_info *sc = ch->parent;
sys/dev/sound/pci/maestro3.c
923
ch->adc_idx, format,
sys/dev/sound/pci/maestro3.c
929
m3_wr_assp_data(sc, ch->adc_data + SRC3_MODE_OFFSET, data);
sys/dev/sound/pci/maestro3.c
933
m3_wr_assp_data(sc, ch->adc_data + SRC3_WORD_LENGTH_OFFSET, data);
sys/dev/sound/pci/maestro3.c
934
ch->fmt = format;
sys/dev/sound/pci/maestro3.c
943
struct sc_rchinfo *ch = chdata;
sys/dev/sound/pci/maestro3.c
944
struct sc_info *sc = ch->parent;
sys/dev/sound/pci/maestro3.c
949
ch->adc_idx, speed));
sys/dev/sound/pci/maestro3.c
955
m3_wr_assp_data(sc, ch->adc_data + CDATA_FREQUENCY, freq);
sys/dev/sound/pci/maestro3.c
956
ch->spd = speed;
sys/dev/sound/pci/maestro3.c
966
struct sc_rchinfo *ch = chdata;
sys/dev/sound/pci/maestro3.c
969
ch->adc_idx, blocksize));
sys/dev/sound/pci/maestro3.c
971
return (ch->buffer->blksz);
sys/dev/sound/pci/maestro3.c
977
struct sc_rchinfo *ch = chdata;
sys/dev/sound/pci/maestro3.c
978
struct sc_info *sc = ch->parent;
sys/dev/sound/pci/maestro3.c
994
struct sc_rchinfo *ch = chdata;
sys/dev/sound/pci/maestro3.c
995
struct sc_info *sc = ch->parent;
sys/dev/sound/pci/neomagic.c
323
nm_setch(struct sc_chinfo *ch)
sys/dev/sound/pci/neomagic.c
325
struct sc_info *sc = ch->parent;
sys/dev/sound/pci/neomagic.c
330
if (ch->spd < (samplerates[x] + samplerates[x + 1]) / 2)
sys/dev/sound/pci/neomagic.c
335
ch->spd = samplerates[x];
sys/dev/sound/pci/neomagic.c
336
nm_loadcoeff(sc, ch->dir, x);
sys/dev/sound/pci/neomagic.c
340
if (ch->fmt & AFMT_16BIT) x |= NM_RATE_BITS_16;
sys/dev/sound/pci/neomagic.c
341
if (AFMT_CHANNEL(ch->fmt) > 1) x |= NM_RATE_STEREO;
sys/dev/sound/pci/neomagic.c
343
base = (ch->dir == PCMDIR_PLAY)? NM_PLAYBACK_REG_OFFSET : NM_RECORD_REG_OFFSET;
sys/dev/sound/pci/neomagic.c
353
struct sc_chinfo *ch;
sys/dev/sound/pci/neomagic.c
357
ch = (dir == PCMDIR_PLAY)? &sc->pch : &sc->rch;
sys/dev/sound/pci/neomagic.c
358
ch->active = 0;
sys/dev/sound/pci/neomagic.c
359
ch->blksize = 0;
sys/dev/sound/pci/neomagic.c
360
ch->wmark = 0;
sys/dev/sound/pci/neomagic.c
361
ch->buffer = b;
sys/dev/sound/pci/neomagic.c
362
sndbuf_setup(ch->buffer, (u_int8_t *)rman_get_virtual(sc->buf) + chnbuf, NM_BUFFSIZE);
sys/dev/sound/pci/neomagic.c
365
"play" : "rec", ch->buffer->buf);
sys/dev/sound/pci/neomagic.c
366
ch->parent = sc;
sys/dev/sound/pci/neomagic.c
367
ch->channel = c;
sys/dev/sound/pci/neomagic.c
368
ch->dir = dir;
sys/dev/sound/pci/neomagic.c
369
return ch;
sys/dev/sound/pci/neomagic.c
381
struct sc_chinfo *ch = data;
sys/dev/sound/pci/neomagic.c
383
ch->fmt = format;
sys/dev/sound/pci/neomagic.c
384
return nm_setch(ch);
sys/dev/sound/pci/neomagic.c
390
struct sc_chinfo *ch = data;
sys/dev/sound/pci/neomagic.c
392
ch->spd = speed;
sys/dev/sound/pci/neomagic.c
393
return nm_setch(ch)? 0 : ch->spd;
sys/dev/sound/pci/neomagic.c
399
struct sc_chinfo *ch = data;
sys/dev/sound/pci/neomagic.c
401
ch->blksize = blocksize;
sys/dev/sound/pci/neomagic.c
409
struct sc_chinfo *ch = data;
sys/dev/sound/pci/neomagic.c
410
struct sc_info *sc = ch->parent;
sys/dev/sound/pci/neomagic.c
416
ssz = (ch->fmt & AFMT_16BIT)? 2 : 1;
sys/dev/sound/pci/neomagic.c
417
if (AFMT_CHANNEL(ch->fmt) > 1)
sys/dev/sound/pci/neomagic.c
420
if (ch->dir == PCMDIR_PLAY) {
sys/dev/sound/pci/neomagic.c
422
ch->active = 1;
sys/dev/sound/pci/neomagic.c
423
ch->wmark = ch->blksize;
sys/dev/sound/pci/neomagic.c
427
nm_wr(sc, NM_PBUFFER_WMARK, sc->pbuf + ch->wmark, 4);
sys/dev/sound/pci/neomagic.c
432
ch->active = 0;
sys/dev/sound/pci/neomagic.c
438
ch->active = 1;
sys/dev/sound/pci/neomagic.c
439
ch->wmark = ch->blksize;
sys/dev/sound/pci/neomagic.c
445
nm_wr(sc, NM_RBUFFER_WMARK, sc->rbuf + ch->wmark, 4);
sys/dev/sound/pci/neomagic.c
447
ch->active = 0;
sys/dev/sound/pci/neomagic.c
457
struct sc_chinfo *ch = data;
sys/dev/sound/pci/neomagic.c
458
struct sc_info *sc = ch->parent;
sys/dev/sound/pci/neomagic.c
460
if (ch->dir == PCMDIR_PLAY)
sys/dev/sound/pci/neomagic.c
86
static int nm_setch(struct sc_chinfo *ch);
sys/dev/sound/pci/solo.c
121
static int ess_setupch(struct ess_info *sc, int ch, int dir, int spd, u_int32_t fmt, int len);
sys/dev/sound/pci/solo.c
122
static int ess_start(struct ess_chinfo *ch);
sys/dev/sound/pci/solo.c
123
static int ess_stop(struct ess_chinfo *ch);
sys/dev/sound/pci/solo.c
125
static int ess_dmasetup(struct ess_info *sc, int ch, u_int32_t base, u_int16_t cnt, int dir);
sys/dev/sound/pci/solo.c
126
static int ess_dmapos(struct ess_info *sc, int ch);
sys/dev/sound/pci/solo.c
127
static int ess_dmatrigger(struct ess_info *sc, int ch, int go);
sys/dev/sound/pci/solo.c
415
ess_setupch(struct ess_info *sc, int ch, int dir, int spd, u_int32_t fmt, int len)
sys/dev/sound/pci/solo.c
428
if (ch == 1) {
sys/dev/sound/pci/solo.c
462
} else if (ch == 2) {
sys/dev/sound/pci/solo.c
485
ess_start(struct ess_chinfo *ch)
sys/dev/sound/pci/solo.c
487
struct ess_info *sc = ch->parent;
sys/dev/sound/pci/solo.c
490
ess_setupch(sc, ch->hwch, ch->dir, ch->spd, ch->fmt, ch->blksz);
sys/dev/sound/pci/solo.c
491
ch->stopping = 0;
sys/dev/sound/pci/solo.c
492
if (ch->hwch == 1) {
sys/dev/sound/pci/solo.c
494
if (ch->dir == PCMDIR_PLAY) {
sys/dev/sound/pci/solo.c
506
ess_stop(struct ess_chinfo *ch)
sys/dev/sound/pci/solo.c
508
struct ess_info *sc = ch->parent;
sys/dev/sound/pci/solo.c
511
ch->stopping = 1;
sys/dev/sound/pci/solo.c
512
if (ch->hwch == 1)
sys/dev/sound/pci/solo.c
526
struct ess_chinfo *ch = (dir == PCMDIR_PLAY)? &sc->pch : &sc->rch;
sys/dev/sound/pci/solo.c
529
ch->parent = sc;
sys/dev/sound/pci/solo.c
530
ch->channel = c;
sys/dev/sound/pci/solo.c
531
ch->buffer = b;
sys/dev/sound/pci/solo.c
532
ch->dir = dir;
sys/dev/sound/pci/solo.c
533
if (sndbuf_alloc(ch->buffer, sc->parent_dmat, 0, sc->bufsz) != 0)
sys/dev/sound/pci/solo.c
535
ch->hwch = 1;
sys/dev/sound/pci/solo.c
537
ch->hwch = 2;
sys/dev/sound/pci/solo.c
538
return ch;
sys/dev/sound/pci/solo.c
544
struct ess_chinfo *ch = data;
sys/dev/sound/pci/solo.c
546
ch->fmt = format;
sys/dev/sound/pci/solo.c
553
struct ess_chinfo *ch = data;
sys/dev/sound/pci/solo.c
554
struct ess_info *sc = ch->parent;
sys/dev/sound/pci/solo.c
556
ch->spd = speed;
sys/dev/sound/pci/solo.c
558
ess_calcspeed9(&ch->spd);
sys/dev/sound/pci/solo.c
560
ess_calcspeed8(&ch->spd);
sys/dev/sound/pci/solo.c
561
return ch->spd;
sys/dev/sound/pci/solo.c
567
struct ess_chinfo *ch = data;
sys/dev/sound/pci/solo.c
569
ch->blksz = blocksize;
sys/dev/sound/pci/solo.c
570
return ch->blksz;
sys/dev/sound/pci/solo.c
576
struct ess_chinfo *ch = data;
sys/dev/sound/pci/solo.c
577
struct ess_info *sc = ch->parent;
sys/dev/sound/pci/solo.c
587
ess_dmasetup(sc, ch->hwch, ch->buffer->buf_addr,
sys/dev/sound/pci/solo.c
588
ch->buffer->bufsize, ch->dir);
sys/dev/sound/pci/solo.c
589
ess_dmatrigger(sc, ch->hwch, 1);
sys/dev/sound/pci/solo.c
590
ess_start(ch);
sys/dev/sound/pci/solo.c
596
ess_stop(ch);
sys/dev/sound/pci/solo.c
606
struct ess_chinfo *ch = data;
sys/dev/sound/pci/solo.c
607
struct ess_info *sc = ch->parent;
sys/dev/sound/pci/solo.c
611
ret = ess_dmapos(sc, ch->hwch);
sys/dev/sound/pci/solo.c
619
struct ess_chinfo *ch = data;
sys/dev/sound/pci/solo.c
621
return (ch->dir == PCMDIR_PLAY)? &ess_playcaps : &ess_reccaps;
sys/dev/sound/pci/solo.c
757
ess_dmasetup(struct ess_info *sc, int ch, u_int32_t base, u_int16_t cnt, int dir)
sys/dev/sound/pci/solo.c
759
KASSERT(ch == 1 || ch == 2, ("bad ch"));
sys/dev/sound/pci/solo.c
760
sc->dmasz[ch - 1] = cnt;
sys/dev/sound/pci/solo.c
761
if (ch == 1) {
sys/dev/sound/pci/solo.c
769
} else if (ch == 2) {
sys/dev/sound/pci/solo.c
778
ess_dmapos(struct ess_info *sc, int ch)
sys/dev/sound/pci/solo.c
782
KASSERT(ch == 1 || ch == 2, ("bad ch"));
sys/dev/sound/pci/solo.c
783
if (ch == 1) {
sys/dev/sound/pci/solo.c
791
ess_dmatrigger(sc, ch, 0);
sys/dev/sound/pci/solo.c
800
} while ((p > sc->dmasz[ch - 1] || i < p || (p - i) > 0x8) && j++ < 1000);
sys/dev/sound/pci/solo.c
801
ess_dmatrigger(sc, ch, 1);
sys/dev/sound/pci/solo.c
803
else if (ch == 2)
sys/dev/sound/pci/solo.c
805
return sc->dmasz[ch - 1] - p;
sys/dev/sound/pci/solo.c
809
ess_dmatrigger(struct ess_info *sc, int ch, int go)
sys/dev/sound/pci/solo.c
811
KASSERT(ch == 1 || ch == 2, ("bad ch"));
sys/dev/sound/pci/solo.c
812
if (ch == 1)
sys/dev/sound/pci/solo.c
814
else if (ch == 2)
sys/dev/sound/pci/t4dwave.c
310
tr_testint(struct tr_chinfo *ch)
sys/dev/sound/pci/t4dwave.c
312
struct tr_info *tr = ch->parent;
sys/dev/sound/pci/t4dwave.c
315
bank = (ch->index & 0x20) ? 1 : 0;
sys/dev/sound/pci/t4dwave.c
316
chan = ch->index & 0x1f;
sys/dev/sound/pci/t4dwave.c
322
tr_clrint(struct tr_chinfo *ch)
sys/dev/sound/pci/t4dwave.c
324
struct tr_info *tr = ch->parent;
sys/dev/sound/pci/t4dwave.c
327
bank = (ch->index & 0x20) ? 1 : 0;
sys/dev/sound/pci/t4dwave.c
328
chan = ch->index & 0x1f;
sys/dev/sound/pci/t4dwave.c
333
tr_enaint(struct tr_chinfo *ch, int enable)
sys/dev/sound/pci/t4dwave.c
335
struct tr_info *tr = ch->parent;
sys/dev/sound/pci/t4dwave.c
340
bank = (ch->index & 0x20) ? 1 : 0;
sys/dev/sound/pci/t4dwave.c
341
chan = ch->index & 0x1f;
sys/dev/sound/pci/t4dwave.c
348
tr_clrint(ch);
sys/dev/sound/pci/t4dwave.c
356
tr_selch(struct tr_chinfo *ch)
sys/dev/sound/pci/t4dwave.c
358
struct tr_info *tr = ch->parent;
sys/dev/sound/pci/t4dwave.c
363
i |= ch->index & 0x3f;
sys/dev/sound/pci/t4dwave.c
368
tr_startch(struct tr_chinfo *ch)
sys/dev/sound/pci/t4dwave.c
370
struct tr_info *tr = ch->parent;
sys/dev/sound/pci/t4dwave.c
373
bank = (ch->index & 0x20) ? 1 : 0;
sys/dev/sound/pci/t4dwave.c
374
chan = ch->index & 0x1f;
sys/dev/sound/pci/t4dwave.c
379
tr_stopch(struct tr_chinfo *ch)
sys/dev/sound/pci/t4dwave.c
381
struct tr_info *tr = ch->parent;
sys/dev/sound/pci/t4dwave.c
384
bank = (ch->index & 0x20) ? 1 : 0;
sys/dev/sound/pci/t4dwave.c
385
chan = ch->index & 0x1f;
sys/dev/sound/pci/t4dwave.c
390
tr_wrch(struct tr_chinfo *ch)
sys/dev/sound/pci/t4dwave.c
392
struct tr_info *tr = ch->parent;
sys/dev/sound/pci/t4dwave.c
395
ch->gvsel &= 0x00000001;
sys/dev/sound/pci/t4dwave.c
396
ch->fmc &= 0x00000003;
sys/dev/sound/pci/t4dwave.c
397
ch->fms &= 0x0000000f;
sys/dev/sound/pci/t4dwave.c
398
ch->ctrl &= 0x0000000f;
sys/dev/sound/pci/t4dwave.c
399
ch->pan &= 0x0000007f;
sys/dev/sound/pci/t4dwave.c
400
ch->rvol &= 0x0000007f;
sys/dev/sound/pci/t4dwave.c
401
ch->cvol &= 0x0000007f;
sys/dev/sound/pci/t4dwave.c
402
ch->vol &= 0x000000ff;
sys/dev/sound/pci/t4dwave.c
403
ch->ec &= 0x00000fff;
sys/dev/sound/pci/t4dwave.c
404
ch->alpha &= 0x00000fff;
sys/dev/sound/pci/t4dwave.c
405
ch->delta &= 0x0000ffff;
sys/dev/sound/pci/t4dwave.c
407
ch->lba &= ALI_MAXADDR;
sys/dev/sound/pci/t4dwave.c
409
ch->lba &= TR_MAXADDR;
sys/dev/sound/pci/t4dwave.c
411
cr[1]=ch->lba;
sys/dev/sound/pci/t4dwave.c
412
cr[3]=(ch->fmc<<14) | (ch->rvol<<7) | (ch->cvol);
sys/dev/sound/pci/t4dwave.c
413
cr[4]=(ch->gvsel<<31) | (ch->pan<<24) | (ch->vol<<16) | (ch->ctrl<<12) | (ch->ec);
sys/dev/sound/pci/t4dwave.c
419
ch->cso &= 0x0000ffff;
sys/dev/sound/pci/t4dwave.c
420
ch->eso &= 0x0000ffff;
sys/dev/sound/pci/t4dwave.c
421
cr[0]=(ch->cso<<16) | (ch->alpha<<4) | (ch->fms);
sys/dev/sound/pci/t4dwave.c
422
cr[2]=(ch->eso<<16) | (ch->delta);
sys/dev/sound/pci/t4dwave.c
425
ch->cso &= 0x00ffffff;
sys/dev/sound/pci/t4dwave.c
426
ch->eso &= 0x00ffffff;
sys/dev/sound/pci/t4dwave.c
427
cr[0]=((ch->delta & 0xff)<<24) | (ch->cso);
sys/dev/sound/pci/t4dwave.c
428
cr[2]=((ch->delta>>8)<<24) | (ch->eso);
sys/dev/sound/pci/t4dwave.c
429
cr[3]|=(ch->alpha<<20) | (ch->fms<<16) | (ch->fmc<<14);
sys/dev/sound/pci/t4dwave.c
433
tr_selch(ch);
sys/dev/sound/pci/t4dwave.c
440
tr_rdch(struct tr_chinfo *ch)
sys/dev/sound/pci/t4dwave.c
442
struct tr_info *tr = ch->parent;
sys/dev/sound/pci/t4dwave.c
446
tr_selch(ch);
sys/dev/sound/pci/t4dwave.c
452
ch->lba=(cr[1] & ALI_MAXADDR);
sys/dev/sound/pci/t4dwave.c
454
ch->lba=(cr[1] & TR_MAXADDR);
sys/dev/sound/pci/t4dwave.c
455
ch->fmc= (cr[3] & 0x0000c000) >> 14;
sys/dev/sound/pci/t4dwave.c
456
ch->rvol= (cr[3] & 0x00003f80) >> 7;
sys/dev/sound/pci/t4dwave.c
457
ch->cvol= (cr[3] & 0x0000007f);
sys/dev/sound/pci/t4dwave.c
458
ch->gvsel= (cr[4] & 0x80000000) >> 31;
sys/dev/sound/pci/t4dwave.c
459
ch->pan= (cr[4] & 0x7f000000) >> 24;
sys/dev/sound/pci/t4dwave.c
460
ch->vol= (cr[4] & 0x00ff0000) >> 16;
sys/dev/sound/pci/t4dwave.c
461
ch->ctrl= (cr[4] & 0x0000f000) >> 12;
sys/dev/sound/pci/t4dwave.c
462
ch->ec= (cr[4] & 0x00000fff);
sys/dev/sound/pci/t4dwave.c
467
ch->cso= (cr[0] & 0xffff0000) >> 16;
sys/dev/sound/pci/t4dwave.c
468
ch->alpha= (cr[0] & 0x0000fff0) >> 4;
sys/dev/sound/pci/t4dwave.c
469
ch->fms= (cr[0] & 0x0000000f);
sys/dev/sound/pci/t4dwave.c
470
ch->eso= (cr[2] & 0xffff0000) >> 16;
sys/dev/sound/pci/t4dwave.c
471
ch->delta= (cr[2] & 0x0000ffff);
sys/dev/sound/pci/t4dwave.c
474
ch->cso= (cr[0] & 0x00ffffff);
sys/dev/sound/pci/t4dwave.c
475
ch->eso= (cr[2] & 0x00ffffff);
sys/dev/sound/pci/t4dwave.c
476
ch->delta= ((cr[2] & 0xff000000) >> 16) | ((cr[0] & 0xff000000) >> 24);
sys/dev/sound/pci/t4dwave.c
477
ch->alpha= (cr[3] & 0xfff00000) >> 20;
sys/dev/sound/pci/t4dwave.c
478
ch->fms= (cr[3] & 0x000f0000) >> 16;
sys/dev/sound/pci/t4dwave.c
503
struct tr_chinfo *ch;
sys/dev/sound/pci/t4dwave.c
506
ch = &tr->chinfo[tr->playchns];
sys/dev/sound/pci/t4dwave.c
507
ch->index = tr->playchns++;
sys/dev/sound/pci/t4dwave.c
508
ch->buffer = b;
sys/dev/sound/pci/t4dwave.c
509
ch->parent = tr;
sys/dev/sound/pci/t4dwave.c
510
ch->channel = c;
sys/dev/sound/pci/t4dwave.c
511
if (sndbuf_alloc(ch->buffer, tr->parent_dmat, 0, tr->bufsz) != 0)
sys/dev/sound/pci/t4dwave.c
514
return ch;
sys/dev/sound/pci/t4dwave.c
520
struct tr_chinfo *ch = data;
sys/dev/sound/pci/t4dwave.c
522
ch->ctrl = tr_fmttobits(format) | 0x01;
sys/dev/sound/pci/t4dwave.c
530
struct tr_chinfo *ch = data;
sys/dev/sound/pci/t4dwave.c
532
ch->delta = (speed << 12) / 48000;
sys/dev/sound/pci/t4dwave.c
533
return (ch->delta * 48000) >> 12;
sys/dev/sound/pci/t4dwave.c
539
struct tr_chinfo *ch = data;
sys/dev/sound/pci/t4dwave.c
541
sndbuf_resize(ch->buffer, 2, blocksize);
sys/dev/sound/pci/t4dwave.c
548
struct tr_chinfo *ch = data;
sys/dev/sound/pci/t4dwave.c
554
ch->fmc = 3;
sys/dev/sound/pci/t4dwave.c
555
ch->fms = 0;
sys/dev/sound/pci/t4dwave.c
556
ch->ec = 0;
sys/dev/sound/pci/t4dwave.c
557
ch->alpha = 0;
sys/dev/sound/pci/t4dwave.c
558
ch->lba = ch->buffer->buf_addr;
sys/dev/sound/pci/t4dwave.c
559
ch->cso = 0;
sys/dev/sound/pci/t4dwave.c
560
ch->eso = (ch->buffer->bufsize / ch->buffer->align) - 1;
sys/dev/sound/pci/t4dwave.c
561
ch->rvol = ch->cvol = 0x7f;
sys/dev/sound/pci/t4dwave.c
562
ch->gvsel = 0;
sys/dev/sound/pci/t4dwave.c
563
ch->pan = 0;
sys/dev/sound/pci/t4dwave.c
564
ch->vol = 0;
sys/dev/sound/pci/t4dwave.c
565
ch->bufhalf = 0;
sys/dev/sound/pci/t4dwave.c
566
tr_wrch(ch);
sys/dev/sound/pci/t4dwave.c
567
tr_enaint(ch, 1);
sys/dev/sound/pci/t4dwave.c
568
tr_startch(ch);
sys/dev/sound/pci/t4dwave.c
569
ch->active = 1;
sys/dev/sound/pci/t4dwave.c
571
tr_stopch(ch);
sys/dev/sound/pci/t4dwave.c
572
ch->active = 0;
sys/dev/sound/pci/t4dwave.c
581
struct tr_chinfo *ch = data;
sys/dev/sound/pci/t4dwave.c
583
tr_rdch(ch);
sys/dev/sound/pci/t4dwave.c
584
return ch->cso * ch->buffer->align;
sys/dev/sound/pci/t4dwave.c
612
struct tr_rchinfo *ch;
sys/dev/sound/pci/t4dwave.c
615
ch = &tr->recchinfo;
sys/dev/sound/pci/t4dwave.c
616
ch->buffer = b;
sys/dev/sound/pci/t4dwave.c
617
ch->parent = tr;
sys/dev/sound/pci/t4dwave.c
618
ch->channel = c;
sys/dev/sound/pci/t4dwave.c
619
if (sndbuf_alloc(ch->buffer, tr->parent_dmat, 0, tr->bufsz) != 0)
sys/dev/sound/pci/t4dwave.c
622
return ch;
sys/dev/sound/pci/t4dwave.c
628
struct tr_rchinfo *ch = data;
sys/dev/sound/pci/t4dwave.c
629
struct tr_info *tr = ch->parent;
sys/dev/sound/pci/t4dwave.c
634
i = (sndbuf_runsz(ch->buffer) >> ((bits & 0x08)? 1 : 0)) - 1;
sys/dev/sound/pci/t4dwave.c
646
struct tr_rchinfo *ch = data;
sys/dev/sound/pci/t4dwave.c
647
struct tr_info *tr = ch->parent;
sys/dev/sound/pci/t4dwave.c
650
ch->delta = (48000 << 12) / speed;
sys/dev/sound/pci/t4dwave.c
651
tr_wr(tr, TR_REG_SBDELTA, ch->delta, 2);
sys/dev/sound/pci/t4dwave.c
654
return (48000 << 12) / ch->delta;
sys/dev/sound/pci/t4dwave.c
660
struct tr_rchinfo *ch = data;
sys/dev/sound/pci/t4dwave.c
662
sndbuf_resize(ch->buffer, 2, blocksize);
sys/dev/sound/pci/t4dwave.c
670
struct tr_rchinfo *ch = data;
sys/dev/sound/pci/t4dwave.c
671
struct tr_info *tr = ch->parent;
sys/dev/sound/pci/t4dwave.c
683
tr_wr(tr, TR_REG_DMAR0, ch->buffer->buf_addr, 4);
sys/dev/sound/pci/t4dwave.c
686
tr_wr(tr, TR_REG_DMAR4, i | (sndbuf_runsz(ch->buffer) - 1), 4);
sys/dev/sound/pci/t4dwave.c
689
ch->active = 1;
sys/dev/sound/pci/t4dwave.c
692
ch->active = 0;
sys/dev/sound/pci/t4dwave.c
702
struct tr_rchinfo *ch = data;
sys/dev/sound/pci/t4dwave.c
703
struct tr_info *tr = ch->parent;
sys/dev/sound/pci/t4dwave.c
706
return tr_rd(tr, TR_REG_DMAR0, 4) - ch->buffer->buf_addr;
sys/dev/sound/pci/t4dwave.c
734
struct tr_chinfo *ch;
sys/dev/sound/pci/t4dwave.c
750
ch = &tr->chinfo[chnum];
sys/dev/sound/pci/t4dwave.c
752
if (ch->bufhalf != tmp) {
sys/dev/sound/pci/t4dwave.c
753
chn_intr(ch->channel);
sys/dev/sound/pci/t4dwave.c
754
ch->bufhalf = tmp;
sys/dev/sound/pci/via8233.c
383
via_buildsgdt(struct via_chinfo *ch)
sys/dev/sound/pci/via8233.c
388
phys_addr = ch->buffer->buf_addr;
sys/dev/sound/pci/via8233.c
390
for (i = 0; i < ch->blkcnt; i++) {
sys/dev/sound/pci/via8233.c
391
flag = (i == ch->blkcnt - 1) ? VIA_DMAOP_EOL : VIA_DMAOP_FLAG;
sys/dev/sound/pci/via8233.c
392
ch->sgd_table[i].ptr = phys_addr + (i * ch->blksz);
sys/dev/sound/pci/via8233.c
393
ch->sgd_table[i].flags = flag | ch->blksz;
sys/dev/sound/pci/via8233.c
405
struct via_chinfo *ch = data;
sys/dev/sound/pci/via8233.c
406
struct via_info *via = ch->parent;
sys/dev/sound/pci/via8233.c
424
struct via_chinfo *ch = data;
sys/dev/sound/pci/via8233.c
425
struct via_info *via = ch->parent;
sys/dev/sound/pci/via8233.c
428
r = ch->rbase + VIA8233_RP_DXS_RATEFMT;
sys/dev/sound/pci/via8233.c
446
struct via_chinfo *ch = data;
sys/dev/sound/pci/via8233.c
447
struct via_info *via = ch->parent;
sys/dev/sound/pci/via8233.c
474
struct via_chinfo *ch = data;
sys/dev/sound/pci/via8233.c
475
struct via_info *via = ch->parent;
sys/dev/sound/pci/via8233.c
486
struct via_chinfo *ch = data;
sys/dev/sound/pci/via8233.c
487
struct via_info *via = ch->parent;
sys/dev/sound/pci/via8233.c
490
r = ch->rbase + VIA8233_RP_DXS_RATEFMT;
sys/dev/sound/pci/via8233.c
506
struct via_chinfo *ch = data;
sys/dev/sound/pci/via8233.c
507
struct via_info *via = ch->parent;
sys/dev/sound/pci/via8233.c
521
struct via_chinfo *ch = data;
sys/dev/sound/pci/via8233.c
522
struct via_info *via = ch->parent;
sys/dev/sound/pci/via8233.c
533
struct via_chinfo *ch = data;
sys/dev/sound/pci/via8233.c
534
struct via_info *via = ch->parent;
sys/dev/sound/pci/via8233.c
550
struct via_chinfo *ch = data;
sys/dev/sound/pci/via8233.c
551
struct via_info *via = ch->parent;
sys/dev/sound/pci/via8233.c
566
struct via_chinfo *ch = data;
sys/dev/sound/pci/via8233.c
567
struct via_info *via = ch->parent;
sys/dev/sound/pci/via8233.c
571
if (blksz > (ch->buffer->maxsize / VIA_SEGS_MIN))
sys/dev/sound/pci/via8233.c
572
blksz = ch->buffer->maxsize / VIA_SEGS_MIN;
sys/dev/sound/pci/via8233.c
580
while ((blksz * blkcnt) > ch->buffer->maxsize) {
sys/dev/sound/pci/via8233.c
589
if ((ch->buffer->blksz != blksz ||
sys/dev/sound/pci/via8233.c
590
ch->buffer->blkcnt != blkcnt) &&
sys/dev/sound/pci/via8233.c
591
sndbuf_resize(ch->buffer, blkcnt, blksz) != 0)
sys/dev/sound/pci/via8233.c
595
ch->blksz = ch->buffer->blksz;
sys/dev/sound/pci/via8233.c
596
ch->blkcnt = ch->buffer->blkcnt;
sys/dev/sound/pci/via8233.c
604
struct via_chinfo *ch = data;
sys/dev/sound/pci/via8233.c
605
struct via_info *via = ch->parent;
sys/dev/sound/pci/via8233.c
609
return (ch->blksz);
sys/dev/sound/pci/via8233.c
615
struct via_chinfo *ch = data;
sys/dev/sound/pci/via8233.c
616
struct via_info *via = ch->parent;
sys/dev/sound/pci/via8233.c
621
ptr = ch->ptr;
sys/dev/sound/pci/via8233.c
624
v = via_rd(via, ch->rbase + VIA_RP_CURRENT_COUNT, 4);
sys/dev/sound/pci/via8233.c
628
ptr = (index + 1) * ch->blksz - count;
sys/dev/sound/pci/via8233.c
629
ptr %= ch->blkcnt * ch->blksz; /* Wrap to available space */
sys/dev/sound/pci/via8233.c
636
via8233chan_reset(struct via_info *via, struct via_chinfo *ch)
sys/dev/sound/pci/via8233.c
638
via_wr(via, ch->rbase + VIA_RP_CONTROL, SGD_CONTROL_STOP, 1);
sys/dev/sound/pci/via8233.c
639
via_wr(via, ch->rbase + VIA_RP_CONTROL, 0x00, 1);
sys/dev/sound/pci/via8233.c
640
via_wr(via, ch->rbase + VIA_RP_STATUS,
sys/dev/sound/pci/via8233.c
648
via8233chan_sgdinit(struct via_info *via, struct via_chinfo *ch, int chnum)
sys/dev/sound/pci/via8233.c
650
ch->sgd_table = &via->sgd_table[chnum * VIA_SEGS_MAX];
sys/dev/sound/pci/via8233.c
651
ch->sgd_addr = via->sgd_addr + chnum * VIA_SEGS_MAX *
sys/dev/sound/pci/via8233.c
660
struct via_chinfo *ch;
sys/dev/sound/pci/via8233.c
665
ch = &via->rch[num];
sys/dev/sound/pci/via8233.c
666
ch->parent = via;
sys/dev/sound/pci/via8233.c
667
ch->channel = c;
sys/dev/sound/pci/via8233.c
668
ch->buffer = b;
sys/dev/sound/pci/via8233.c
669
ch->dir = dir;
sys/dev/sound/pci/via8233.c
670
ch->blkcnt = via->blkcnt;
sys/dev/sound/pci/via8233.c
671
ch->rbase = VIA_WR_BASE(num);
sys/dev/sound/pci/via8233.c
672
via_wr(via, ch->rbase + VIA_WR_RP_SGD_FORMAT, WR_FIFO_ENABLE, 1);
sys/dev/sound/pci/via8233.c
675
if (sndbuf_alloc(ch->buffer, via->parent_dmat, 0, via->bufsz) != 0)
sys/dev/sound/pci/via8233.c
679
via8233chan_sgdinit(via, ch, num);
sys/dev/sound/pci/via8233.c
680
via8233chan_reset(via, ch);
sys/dev/sound/pci/via8233.c
683
return (ch);
sys/dev/sound/pci/via8233.c
691
struct via_chinfo *ch;
sys/dev/sound/pci/via8233.c
696
ch = &via->pch[num];
sys/dev/sound/pci/via8233.c
697
ch->parent = via;
sys/dev/sound/pci/via8233.c
698
ch->channel = c;
sys/dev/sound/pci/via8233.c
699
ch->buffer = b;
sys/dev/sound/pci/via8233.c
700
ch->dir = dir;
sys/dev/sound/pci/via8233.c
701
ch->blkcnt = via->blkcnt;
sys/dev/sound/pci/via8233.c
708
ch->rbase = VIA_DXS_BASE(NDXSCHANS - 1 - via->n_dxs_registered);
sys/dev/sound/pci/via8233.c
712
if (sndbuf_alloc(ch->buffer, via->parent_dmat, 0, via->bufsz) != 0)
sys/dev/sound/pci/via8233.c
716
via8233chan_sgdinit(via, ch, NWRCHANS + num);
sys/dev/sound/pci/via8233.c
717
via8233chan_reset(via, ch);
sys/dev/sound/pci/via8233.c
720
return (ch);
sys/dev/sound/pci/via8233.c
728
struct via_chinfo *ch;
sys/dev/sound/pci/via8233.c
733
ch = &via->pch[num];
sys/dev/sound/pci/via8233.c
734
ch->parent = via;
sys/dev/sound/pci/via8233.c
735
ch->channel = c;
sys/dev/sound/pci/via8233.c
736
ch->buffer = b;
sys/dev/sound/pci/via8233.c
737
ch->dir = dir;
sys/dev/sound/pci/via8233.c
738
ch->rbase = VIA_MC_SGD_STATUS;
sys/dev/sound/pci/via8233.c
739
ch->blkcnt = via->blkcnt;
sys/dev/sound/pci/via8233.c
742
if (sndbuf_alloc(ch->buffer, via->parent_dmat, 0, via->bufsz) != 0)
sys/dev/sound/pci/via8233.c
746
via8233chan_sgdinit(via, ch, NWRCHANS + num);
sys/dev/sound/pci/via8233.c
747
via8233chan_reset(via, ch);
sys/dev/sound/pci/via8233.c
750
return (ch);
sys/dev/sound/pci/via8233.c
754
via8233chan_mute(struct via_info *via, struct via_chinfo *ch, int muted)
sys/dev/sound/pci/via8233.c
756
if (BASE_IS_VIA_DXS_REG(ch->rbase)) {
sys/dev/sound/pci/via8233.c
759
via_wr(via, ch->rbase + VIA8233_RP_DXS_LVOL, muted, 1);
sys/dev/sound/pci/via8233.c
760
via_wr(via, ch->rbase + VIA8233_RP_DXS_RVOL, muted, 1);
sys/dev/sound/pci/via8233.c
761
r = via_rd(via, ch->rbase + VIA8233_RP_DXS_LVOL, 1) &
sys/dev/sound/pci/via8233.c
766
"(dxs base 0x%02x).\n", __func__, ch->rbase);
sys/dev/sound/pci/via8233.c
771
via_poll_channel(struct via_chinfo *ch)
sys/dev/sound/pci/via8233.c
778
if (ch == NULL || ch->channel == NULL || ch->active == 0)
sys/dev/sound/pci/via8233.c
781
via = ch->parent;
sys/dev/sound/pci/via8233.c
782
sz = ch->blksz * ch->blkcnt;
sys/dev/sound/pci/via8233.c
783
v = via_rd(via, ch->rbase + VIA_RP_CURRENT_COUNT, 4);
sys/dev/sound/pci/via8233.c
786
ptr = ((index + 1) * ch->blksz) - count;
sys/dev/sound/pci/via8233.c
788
ptr &= ~(ch->blksz - 1);
sys/dev/sound/pci/via8233.c
789
ch->ptr = ptr;
sys/dev/sound/pci/via8233.c
790
delta = (sz + ptr - ch->prevptr) % sz;
sys/dev/sound/pci/via8233.c
792
if (delta < ch->blksz)
sys/dev/sound/pci/via8233.c
795
ch->prevptr = ptr;
sys/dev/sound/pci/via8233.c
843
struct via_chinfo *ch;
sys/dev/sound/pci/via8233.c
849
ch = &via->pch[i];
sys/dev/sound/pci/via8233.c
850
if (ch->channel == NULL || ch->active == 0)
sys/dev/sound/pci/via8233.c
852
pollticks = ((uint64_t)hz * ch->blksz) /
sys/dev/sound/pci/via8233.c
853
((uint64_t)ch->buffer->align * ch->buffer->spd);
sys/dev/sound/pci/via8233.c
864
ch = &via->rch[i];
sys/dev/sound/pci/via8233.c
865
if (ch->channel == NULL || ch->active == 0)
sys/dev/sound/pci/via8233.c
867
pollticks = ((uint64_t)hz * ch->blksz) /
sys/dev/sound/pci/via8233.c
868
((uint64_t)ch->buffer->align * ch->buffer->spd);
sys/dev/sound/pci/via8233.c
884
struct via_chinfo *ch = data;
sys/dev/sound/pci/via8233.c
885
struct via_info *via = ch->parent;
sys/dev/sound/pci/via8233.c
894
via_buildsgdt(ch);
sys/dev/sound/pci/via8233.c
895
via8233chan_mute(via, ch, 0);
sys/dev/sound/pci/via8233.c
896
via_wr(via, ch->rbase + VIA_RP_TABLE_PTR, ch->sgd_addr, 4);
sys/dev/sound/pci/via8233.c
898
ch->ptr = 0;
sys/dev/sound/pci/via8233.c
899
ch->prevptr = 0;
sys/dev/sound/pci/via8233.c
900
pollticks = ((uint64_t)hz * ch->blksz) /
sys/dev/sound/pci/via8233.c
901
((uint64_t)ch->buffer->align *
sys/dev/sound/pci/via8233.c
902
ch->buffer->spd);
sys/dev/sound/pci/via8233.c
925
via_wr(via, ch->rbase + VIA_RP_CONTROL,
sys/dev/sound/pci/via8233.c
929
ch->active = 1;
sys/dev/sound/pci/via8233.c
933
via_wr(via, ch->rbase + VIA_RP_CONTROL, SGD_CONTROL_STOP, 1);
sys/dev/sound/pci/via8233.c
934
via8233chan_mute(via, ch, 1);
sys/dev/sound/pci/via8233.c
935
via8233chan_reset(via, ch);
sys/dev/sound/pci/via8233.c
936
ch->active = 0;
sys/dev/sound/pci/via82c686.c
217
via_buildsgdt(struct via_chinfo *ch)
sys/dev/sound/pci/via82c686.c
228
seg_size = ch->blksz;
sys/dev/sound/pci/via82c686.c
229
segs = ch->buffer->bufsize / seg_size;
sys/dev/sound/pci/via82c686.c
230
phys_addr = ch->buffer->buf_addr;
sys/dev/sound/pci/via82c686.c
234
ch->sgd_table[i].ptr = phys_addr + (i * seg_size);
sys/dev/sound/pci/via82c686.c
235
ch->sgd_table[i].flags = flag | seg_size;
sys/dev/sound/pci/via82c686.c
246
struct via_chinfo *ch;
sys/dev/sound/pci/via82c686.c
250
ch = &via->pch;
sys/dev/sound/pci/via82c686.c
251
ch->base = VIA_PLAY_DMAOPS_BASE;
sys/dev/sound/pci/via82c686.c
252
ch->count = VIA_PLAY_DMAOPS_COUNT;
sys/dev/sound/pci/via82c686.c
253
ch->ctrl = VIA_PLAY_CONTROL;
sys/dev/sound/pci/via82c686.c
254
ch->mode = VIA_PLAY_MODE;
sys/dev/sound/pci/via82c686.c
255
ch->sgd_addr = via->sgd_addr;
sys/dev/sound/pci/via82c686.c
256
ch->sgd_table = &via->sgd_table[0];
sys/dev/sound/pci/via82c686.c
258
ch = &via->rch;
sys/dev/sound/pci/via82c686.c
259
ch->base = VIA_RECORD_DMAOPS_BASE;
sys/dev/sound/pci/via82c686.c
260
ch->count = VIA_RECORD_DMAOPS_COUNT;
sys/dev/sound/pci/via82c686.c
261
ch->ctrl = VIA_RECORD_CONTROL;
sys/dev/sound/pci/via82c686.c
262
ch->mode = VIA_RECORD_MODE;
sys/dev/sound/pci/via82c686.c
263
ch->sgd_addr = via->sgd_addr + sizeof(struct via_dma_op) * SEGS_PER_CHAN;
sys/dev/sound/pci/via82c686.c
264
ch->sgd_table = &via->sgd_table[SEGS_PER_CHAN];
sys/dev/sound/pci/via82c686.c
267
ch->parent = via;
sys/dev/sound/pci/via82c686.c
268
ch->channel = c;
sys/dev/sound/pci/via82c686.c
269
ch->buffer = b;
sys/dev/sound/pci/via82c686.c
270
ch->dir = dir;
sys/dev/sound/pci/via82c686.c
273
if (sndbuf_alloc(ch->buffer, via->parent_dmat, 0, via->bufsz) != 0)
sys/dev/sound/pci/via82c686.c
276
return ch;
sys/dev/sound/pci/via82c686.c
282
struct via_chinfo *ch = data;
sys/dev/sound/pci/via82c686.c
283
struct via_info *via = ch->parent;
sys/dev/sound/pci/via82c686.c
292
DEB(printf("set format: dir = %d, format=%x\n", ch->dir, format));
sys/dev/sound/pci/via82c686.c
294
mode = via_rd(via, ch->mode, 1);
sys/dev/sound/pci/via82c686.c
297
via_wr(via, ch->mode, mode, 1);
sys/dev/sound/pci/via82c686.c
306
struct via_chinfo *ch = data;
sys/dev/sound/pci/via82c686.c
307
struct via_info *via = ch->parent;
sys/dev/sound/pci/via82c686.c
320
reg = (ch->dir == PCMDIR_PLAY)? AC97_REGEXT_FDACRATE : AC97_REGEXT_LADCRATE;
sys/dev/sound/pci/via82c686.c
329
struct via_chinfo *ch = data;
sys/dev/sound/pci/via82c686.c
331
ch->blksz = blocksize;
sys/dev/sound/pci/via82c686.c
332
sndbuf_resize(ch->buffer, SEGS_PER_CHAN, ch->blksz);
sys/dev/sound/pci/via82c686.c
334
return ch->blksz;
sys/dev/sound/pci/via82c686.c
340
struct via_chinfo *ch = data;
sys/dev/sound/pci/via82c686.c
341
struct via_info *via = ch->parent;
sys/dev/sound/pci/via82c686.c
342
bus_addr_t sgd_addr = ch->sgd_addr;
sys/dev/sound/pci/via82c686.c
347
DEB(printf("ado located at va=%p pa=%x\n", ch->sgd_table, sgd_addr));
sys/dev/sound/pci/via82c686.c
351
via_buildsgdt(ch);
sys/dev/sound/pci/via82c686.c
352
via_wr(via, ch->base, sgd_addr, 4);
sys/dev/sound/pci/via82c686.c
353
via_wr(via, ch->ctrl, VIA_RPCTRL_START, 1);
sys/dev/sound/pci/via82c686.c
355
via_wr(via, ch->ctrl, VIA_RPCTRL_TERMINATE, 1);
sys/dev/sound/pci/via82c686.c
365
struct via_chinfo *ch = data;
sys/dev/sound/pci/via82c686.c
366
struct via_info *via = ch->parent;
sys/dev/sound/pci/via82c686.c
367
bus_addr_t sgd_addr = ch->sgd_addr;
sys/dev/sound/pci/via82c686.c
371
base1 = via_rd(via, ch->base, 4);
sys/dev/sound/pci/via82c686.c
372
len = via_rd(via, ch->count, 4);
sys/dev/sound/pci/via82c686.c
373
base = via_rd(via, ch->base, 4);
sys/dev/sound/pci/via82c686.c
375
len = via_rd(via, ch->count, 4);
sys/dev/sound/pci/via82c686.c
388
ptr = (seg * ch->buffer->bufsize / SEGS_PER_CHAN) - len;
sys/dev/sound/pci/via82c686.c
389
if (ch->dir == PCMDIR_REC) {
sys/dev/sound/pci/via82c686.c
402
struct via_chinfo *ch = data;
sys/dev/sound/pci/via82c686.c
403
struct via_info *via = ch->parent;
sys/dev/sound/pci/vibes.c
194
struct sc_chinfo *ch;
sys/dev/sound/pci/vibes.c
195
ch = (dir == PCMDIR_PLAY) ? &sc->pch : &sc->rch;
sys/dev/sound/pci/vibes.c
197
ch->parent = sc;
sys/dev/sound/pci/vibes.c
198
ch->channel = c;
sys/dev/sound/pci/vibes.c
199
ch->dir = dir;
sys/dev/sound/pci/vibes.c
205
ch->buffer = b;
sys/dev/sound/pci/vibes.c
206
ch->fmt = SND_FORMAT(AFMT_U8, 1, 0);
sys/dev/sound/pci/vibes.c
207
ch->spd = 8000;
sys/dev/sound/pci/vibes.c
208
ch->dma_active = ch->dma_was_active = 0;
sys/dev/sound/pci/vibes.c
210
return ch;
sys/dev/sound/pci/vibes.c
222
struct sc_chinfo *ch = data;
sys/dev/sound/pci/vibes.c
223
struct sc_info *sc = ch->parent;
sys/dev/sound/pci/vibes.c
227
sndbuf_resize(ch->buffer, SV_INTR_PER_BUFFER, blocksize);
sys/dev/sound/pci/vibes.c
235
struct sc_chinfo *ch = data;
sys/dev/sound/pci/vibes.c
238
ch->fmt = (AFMT_CHANNEL(format) > 1) ? SV_AFMT_STEREO : SV_AFMT_MONO;
sys/dev/sound/pci/vibes.c
239
ch->fmt |= (format & AFMT_16BIT) ? SV_AFMT_S16 : SV_AFMT_U8;
sys/dev/sound/pci/vibes.c
246
struct sc_chinfo *ch = data;
sys/dev/sound/pci/vibes.c
248
ch->spd = speed;
sys/dev/sound/pci/vibes.c
315
struct sc_chinfo *ch = data;
sys/dev/sound/pci/vibes.c
316
struct sc_info *sc = ch->parent;
sys/dev/sound/pci/vibes.c
323
sv_set_recspeed(sc, ch->spd);
sys/dev/sound/pci/vibes.c
327
v |= SV_AFMT_DMAC(ch->fmt);
sys/dev/sound/pci/vibes.c
331
count = ch->buffer->bufsize / 2; /* DMAC uses words */
sys/dev/sound/pci/vibes.c
333
ch->buffer->buf_addr,
sys/dev/sound/pci/vibes.c
343
ch->dma_active = 1;
sys/dev/sound/pci/vibes.c
349
ch->dma_active = 0;
sys/dev/sound/pci/vibes.c
359
struct sc_chinfo *ch = data;
sys/dev/sound/pci/vibes.c
360
struct sc_info *sc = ch->parent;
sys/dev/sound/pci/vibes.c
363
sz = ch->buffer->bufsize;
sys/dev/sound/pci/vibes.c
387
struct sc_chinfo *ch = data;
sys/dev/sound/pci/vibes.c
388
struct sc_info *sc = ch->parent;
sys/dev/sound/pci/vibes.c
395
speed = (ch->spd * 65536) / 48000;
sys/dev/sound/pci/vibes.c
403
v |= SV_AFMT_DMAA(ch->fmt);
sys/dev/sound/pci/vibes.c
407
count = ch->buffer->bufsize;
sys/dev/sound/pci/vibes.c
409
ch->buffer->buf_addr,
sys/dev/sound/pci/vibes.c
420
ch->dma_active = 1;
sys/dev/sound/pci/vibes.c
426
ch->dma_active = 0;
sys/dev/sound/pci/vibes.c
436
struct sc_chinfo *ch = data;
sys/dev/sound/pci/vibes.c
437
struct sc_info *sc = ch->parent;
sys/dev/sound/pci/vibes.c
440
sz = ch->buffer->bufsize;
sys/dev/sound/pcm/channel.c
1000
if (ch < 1 || ch > AFMT_CHANNEL_MAX)
sys/dev/sound/pcm/channel.c
1006
if (ch < 1 || (ch + ext) > AFMT_CHANNEL_MAX)
sys/dev/sound/pcm/channel.c
1023
return (SND_FORMAT(afmt_tab[i].afmt, ch + ext, ext));
sys/dev/sound/pcm/channel.c
1034
uint32_t ch;
sys/dev/sound/pcm/channel.c
1043
ch = AFMT_CHANNEL(afmt);
sys/dev/sound/pcm/channel.c
1046
if (ch <= ext)
sys/dev/sound/pcm/channel.c
1053
afmt_tab[i].name, ch - ext, ext);
sys/dev/sound/pcm/channel.c
1054
return (SND_FORMAT(enc, ch, ext));
sys/dev/sound/pcm/channel.c
2333
struct pcm_channel *ch;
sys/dev/sound/pcm/channel.c
2394
CHN_FOREACH(ch, c, children.busy) {
sys/dev/sound/pcm/channel.c
2396
CHN_LOCK(ch);
sys/dev/sound/pcm/channel.c
2397
if ((ch->format & AFMT_PASSTHROUGH) &&
sys/dev/sound/pcm/channel.c
2398
snd_fmtvalid(ch->format, caps->fmtlist)) {
sys/dev/sound/pcm/channel.c
2399
bestformat = ch->format;
sys/dev/sound/pcm/channel.c
2400
bestspeed = ch->speed;
sys/dev/sound/pcm/channel.c
2401
CHN_UNLOCK(ch);
sys/dev/sound/pcm/channel.c
2405
if ((ch->flags & CHN_F_EXCLUSIVE) && vpflags == 0) {
sys/dev/sound/pcm/channel.c
2407
bestspeed = ch->speed;
sys/dev/sound/pcm/channel.c
2410
besthwformat = snd_fmtbest(ch->format,
sys/dev/sound/pcm/channel.c
2415
CHN_UNLOCK(ch);
sys/dev/sound/pcm/channel.c
2421
CHN_UNLOCK(ch);
sys/dev/sound/pcm/channel.c
2424
if (ch->speed > bestspeed) {
sys/dev/sound/pcm/channel.c
2425
bestspeed = ch->speed;
sys/dev/sound/pcm/channel.c
2429
besthwformat = snd_fmtbest(ch->format, caps->fmtlist);
sys/dev/sound/pcm/channel.c
2431
CHN_UNLOCK(ch);
sys/dev/sound/pcm/channel.c
2441
CHN_UNLOCK(ch);
sys/dev/sound/pcm/channel.c
2463
CHN_FOREACH(ch, c, children.busy) {
sys/dev/sound/pcm/channel.c
2464
CHN_LOCK(ch);
sys/dev/sound/pcm/channel.c
2465
if (VCHAN_SYNC_REQUIRED(ch))
sys/dev/sound/pcm/channel.c
2466
vchan_sync(ch);
sys/dev/sound/pcm/channel.c
2467
CHN_UNLOCK(ch);
sys/dev/sound/pcm/channel.c
2481
CHN_FOREACH(ch, c, children.busy) {
sys/dev/sound/pcm/channel.c
2482
CHN_LOCK(ch);
sys/dev/sound/pcm/channel.c
2483
if (VCHAN_SYNC_REQUIRED(ch))
sys/dev/sound/pcm/channel.c
2484
vchan_sync(ch);
sys/dev/sound/pcm/channel.c
2485
CHN_UNLOCK(ch);
sys/dev/sound/pcm/channel.c
311
struct pcm_channel *ch;
sys/dev/sound/pcm/channel.c
323
CHN_FOREACH(ch, c, children.busy) {
sys/dev/sound/pcm/channel.c
324
CHN_LOCK(ch);
sys/dev/sound/pcm/channel.c
325
chn_wakeup(ch);
sys/dev/sound/pcm/channel.c
326
CHN_UNLOCK(ch);
sys/dev/sound/pcm/channel.c
965
int ch;
sys/dev/sound/pcm/channel.c
985
i = sscanf(b2, "%d.%d", &ch, &ext);
sys/dev/sound/pcm/channel.c
989
ch = 1;
sys/dev/sound/pcm/channel.c
992
ch = 2;
sys/dev/sound/pcm/channel.c
995
ch = 4;
sys/dev/sound/pcm/channel.h
80
struct pcm_channel *ch;
sys/dev/sound/pcm/dsp.c
168
dsp_chn_alloc(struct snddev_info *d, struct pcm_channel **ch, int direction,
sys/dev/sound/pcm/dsp.c
177
KASSERT(d != NULL && ch != NULL &&
sys/dev/sound/pcm/dsp.c
180
__func__, d, ch, direction));
sys/dev/sound/pcm/dsp.c
189
*ch = NULL;
sys/dev/sound/pcm/dsp.c
2090
struct pcm_channel *ch;
sys/dev/sound/pcm/dsp.c
212
err = vchan_create(c, ch);
sys/dev/sound/pcm/dsp.c
216
CHN_LOCK(*ch);
sys/dev/sound/pcm/dsp.c
2164
CHN_FOREACH(ch, d, channels.pcm) {
sys/dev/sound/pcm/dsp.c
2165
CHN_UNLOCKASSERT(ch);
sys/dev/sound/pcm/dsp.c
2166
CHN_LOCK(ch);
sys/dev/sound/pcm/dsp.c
2175
if ((ex && (ch->flags & CHN_F_VIRTUAL) != 0) ||
sys/dev/sound/pcm/dsp.c
2176
((!ex && (ch->flags & CHN_F_VIRTUAL) == 0) &&
sys/dev/sound/pcm/dsp.c
2178
CHN_UNLOCK(ch);
sys/dev/sound/pcm/dsp.c
218
*ch = c;
sys/dev/sound/pcm/dsp.c
2182
if ((ch->flags & CHN_F_BUSY) == 0) {
sys/dev/sound/pcm/dsp.c
2183
ai->busy |= (ch->direction == PCMDIR_PLAY) ?
sys/dev/sound/pcm/dsp.c
2188
((ch->flags & CHN_F_VIRTUAL) ? PCM_CAP_VIRTUAL : 0) |
sys/dev/sound/pcm/dsp.c
2189
((ch->direction == PCMDIR_PLAY) ? PCM_CAP_OUTPUT :
sys/dev/sound/pcm/dsp.c
2192
caps = chn_getcaps(ch);
sys/dev/sound/pcm/dsp.c
2203
if (ch->direction == PCMDIR_PLAY)
sys/dev/sound/pcm/dsp.c
2218
CHN_UNLOCK(ch);
sys/dev/sound/pcm/dsp.c
2234
struct pcm_channel *ch = arg;
sys/dev/sound/pcm/dsp.c
2236
if (DSP_REGISTERED(priv->sc) && (ch == priv->rdch || ch == priv->wrch))
sys/dev/sound/pcm/dsp.c
224
(*ch)->flags |= CHN_F_BUSY;
sys/dev/sound/pcm/dsp.c
226
(*ch)->flags |= CHN_F_NBIO;
sys/dev/sound/pcm/dsp.c
2267
struct pcm_channel *ch;
sys/dev/sound/pcm/dsp.c
228
(*ch)->flags |= CHN_F_EXCLUSIVE;
sys/dev/sound/pcm/dsp.c
2280
ch = NULL;
sys/dev/sound/pcm/dsp.c
229
(*ch)->pid = pid;
sys/dev/sound/pcm/dsp.c
230
strlcpy((*ch)->comm, (comm != NULL) ? comm : CHN_COMM_UNKNOWN,
sys/dev/sound/pcm/dsp.c
2300
CHN_FOREACH(ch, d, channels.pcm) {
sys/dev/sound/pcm/dsp.c
2301
CHN_UNLOCKASSERT(ch);
sys/dev/sound/pcm/dsp.c
2302
CHN_LOCK(ch);
sys/dev/sound/pcm/dsp.c
2304
i_dev, dsp_oss_engineinfo_cb, ch) != 0) ||
sys/dev/sound/pcm/dsp.c
2307
CHN_UNLOCK(ch);
sys/dev/sound/pcm/dsp.c
231
sizeof((*ch)->comm));
sys/dev/sound/pcm/dsp.c
2311
if (ch == NULL) {
sys/dev/sound/pcm/dsp.c
2324
caps = chn_getcaps(ch);
sys/dev/sound/pcm/dsp.c
233
if ((err = chn_reset(*ch, (*ch)->format, (*ch)->speed)) != 0)
sys/dev/sound/pcm/dsp.c
2333
strlcpy(ai->name, ch->name, sizeof(ai->name));
sys/dev/sound/pcm/dsp.c
2335
if ((ch->flags & CHN_F_BUSY) == 0)
sys/dev/sound/pcm/dsp.c
2338
ai->busy = (ch->direction == PCMDIR_PLAY) ? OPEN_WRITE : OPEN_READ;
sys/dev/sound/pcm/dsp.c
2340
ai->pid = ch->pid;
sys/dev/sound/pcm/dsp.c
2341
strlcpy(ai->cmd, ch->comm, sizeof(ai->cmd));
sys/dev/sound/pcm/dsp.c
235
chn_vpc_reset(*ch, SND_VOL_C_PCM, 0);
sys/dev/sound/pcm/dsp.c
2353
((ch->flags & CHN_F_VIRTUAL) ? PCM_CAP_VIRTUAL : 0) |
sys/dev/sound/pcm/dsp.c
2354
((ch->direction == PCMDIR_PLAY) ? PCM_CAP_OUTPUT : PCM_CAP_INPUT);
sys/dev/sound/pcm/dsp.c
2369
if (ch->direction == PCMDIR_PLAY)
sys/dev/sound/pcm/dsp.c
237
CHN_UNLOCK(*ch);
sys/dev/sound/pcm/dsp.c
2413
if ((ch->flags & CHN_F_EXCLUSIVE) ||
sys/dev/sound/pcm/dsp.c
2425
ai->nrates = chn_getrates(ch, &rates);
sys/dev/sound/pcm/dsp.c
2435
CHN_UNLOCK(ch);
sys/dev/sound/pcm/dsp.c
2561
smrd->ch = rdch;
sys/dev/sound/pcm/dsp.c
2577
smwr->ch = wrch;
sys/dev/sound/pcm/dsp.c
2665
if (CHN_TRYLOCK(sm->ch) == 0) {
sys/dev/sound/pcm/dsp.c
2675
CHN_UNLOCK(sm_tmp->ch);
sys/dev/sound/pcm/dsp.c
2696
c = sm->ch;
sys/dev/sound/pcm/dsp.c
2859
struct pcm_channel *ch;
sys/dev/sound/pcm/dsp.c
2862
ch = (wrch != NULL) ? wrch : rdch;
sys/dev/sound/pcm/dsp.c
2863
if (ch != NULL) {
sys/dev/sound/pcm/dsp.c
2864
CHN_LOCK(ch);
sys/dev/sound/pcm/dsp.c
2865
ret = chn_oss_getorder(ch, map);
sys/dev/sound/pcm/dsp.c
2866
CHN_UNLOCK(ch);
sys/dev/sound/pcm/dsp.c
2913
struct pcm_channel *ch;
sys/dev/sound/pcm/dsp.c
2918
ch = (wrch != NULL) ? wrch : rdch;
sys/dev/sound/pcm/dsp.c
2920
if (ch != NULL) {
sys/dev/sound/pcm/dsp.c
2921
CHN_LOCK(ch);
sys/dev/sound/pcm/dsp.c
2922
ret = chn_oss_getmask(ch, &chnmask);
sys/dev/sound/pcm/dsp.c
2923
CHN_UNLOCK(ch);
sys/dev/sound/pcm/dsp.c
2936
struct pcm_channel *ch = kn->kn_hook;
sys/dev/sound/pcm/dsp.c
2938
if (ch == NULL)
sys/dev/sound/pcm/dsp.c
2940
CHN_LOCK(ch);
sys/dev/sound/pcm/dsp.c
2941
knlist_remove(&ch->bufsoft->sel.si_note, kn, 1);
sys/dev/sound/pcm/dsp.c
2942
CHN_UNLOCK(ch);
sys/dev/sound/pcm/dsp.c
2948
struct pcm_channel *ch = kn->kn_hook;
sys/dev/sound/pcm/dsp.c
2950
CHN_LOCKASSERT(ch);
sys/dev/sound/pcm/dsp.c
2951
if (ch->flags & CHN_F_DEAD) {
sys/dev/sound/pcm/dsp.c
2956
if (chn_polltrigger(ch)) {
sys/dev/sound/pcm/dsp.c
2958
kn->kn_data = sndbuf_getready(ch->bufsoft);
sys/dev/sound/pcm/dsp.c
2960
kn->kn_data = sndbuf_getfree(ch->bufsoft);
sys/dev/sound/pcm/dsp.c
2977
struct pcm_channel *ch;
sys/dev/sound/pcm/dsp.c
2989
ch = priv->rdch;
sys/dev/sound/pcm/dsp.c
2992
ch = priv->wrch;
sys/dev/sound/pcm/dsp.c
2997
ch = NULL;
sys/dev/sound/pcm/dsp.c
3000
if (ch != NULL) {
sys/dev/sound/pcm/dsp.c
3002
CHN_LOCK(ch);
sys/dev/sound/pcm/dsp.c
3003
knlist_add(&ch->bufsoft->sel.si_note, kn, 1);
sys/dev/sound/pcm/dsp.c
3004
CHN_UNLOCK(ch);
sys/dev/sound/pcm/dsp.c
3005
kn->kn_hook = ch;
sys/dev/sound/pcm/dsp.c
353
struct pcm_channel *ch;
sys/dev/sound/pcm/dsp.c
401
ch = CHN_FIRST(d, channels.pcm.opened);
sys/dev/sound/pcm/dsp.c
402
if (ch->direction == PCMDIR_PLAY)
sys/dev/sound/pcm/dsp.c
404
else if (ch->direction == PCMDIR_REC)
sys/dev/sound/pcm/dsp.c
412
ch = CHN_FIRST(d, channels.pcm.opened);
sys/dev/sound/pcm/dsp.c
414
if (ch->direction != dir)
sys/dev/sound/pcm/dsp.c
465
struct pcm_channel *ch;
sys/dev/sound/pcm/dsp.c
477
ch = priv->rdch;
sys/dev/sound/pcm/dsp.c
481
ch = priv->wrch;
sys/dev/sound/pcm/dsp.c
485
if (ch == NULL) {
sys/dev/sound/pcm/dsp.c
489
CHN_LOCK(ch);
sys/dev/sound/pcm/dsp.c
491
if (!(ch->flags & CHN_F_BUSY) ||
sys/dev/sound/pcm/dsp.c
492
(ch->flags & (CHN_F_MMAP | CHN_F_DEAD))) {
sys/dev/sound/pcm/dsp.c
493
CHN_UNLOCK(ch);
sys/dev/sound/pcm/dsp.c
496
} else if (!(ch->flags & CHN_F_RUNNING))
sys/dev/sound/pcm/dsp.c
497
ch->flags |= CHN_F_RUNNING;
sys/dev/sound/pcm/dsp.c
504
ch->inprog++;
sys/dev/sound/pcm/dsp.c
505
ret = chn_io(ch, buf);
sys/dev/sound/pcm/dsp.c
506
ch->inprog--;
sys/dev/sound/pcm/dsp.c
508
CHN_BROADCAST(&ch->cv);
sys/dev/sound/pcm/dsp.c
509
CHN_UNLOCK(ch);
sys/dev/sound/pcm/dsp.c
539
dsp_ioctl_channel(struct dsp_cdevpriv *priv, struct pcm_channel *ch,
sys/dev/sound/pcm/dsp.c
557
if (ch == NULL) {
sys/dev/sound/pcm/dsp.c
559
ch = rdch;
sys/dev/sound/pcm/dsp.c
561
ch = wrch;
sys/dev/sound/pcm/dsp.c
564
if (ch == NULL)
sys/dev/sound/pcm/dsp.c
567
CHN_LOCK(ch);
sys/dev/sound/pcm/dsp.c
568
if (!(ch->feederflags & (1 << FEEDER_VOLUME))) {
sys/dev/sound/pcm/dsp.c
569
CHN_UNLOCK(ch);
sys/dev/sound/pcm/dsp.c
577
if (ch->direction == PCMDIR_REC) {
sys/dev/sound/pcm/dsp.c
578
chn_setmute_multi(ch, SND_VOL_C_PCM, (*(int *)arg & SOUND_MASK_RECLEV) != 0);
sys/dev/sound/pcm/dsp.c
580
chn_setmute_multi(ch, SND_VOL_C_PCM, (*(int *)arg & SOUND_MASK_PCM) != 0);
sys/dev/sound/pcm/dsp.c
584
if (ch->direction != PCMDIR_PLAY)
sys/dev/sound/pcm/dsp.c
589
chn_setvolume_multi(ch, SND_VOL_C_PCM,
sys/dev/sound/pcm/dsp.c
593
if (ch->direction != PCMDIR_REC)
sys/dev/sound/pcm/dsp.c
598
chn_setvolume_multi(ch, SND_VOL_C_PCM,
sys/dev/sound/pcm/dsp.c
610
mute = chn_getmute_matrix(ch,
sys/dev/sound/pcm/dsp.c
612
chn_getmute_matrix(ch, SND_VOL_C_PCM, SND_CHN_T_FR);
sys/dev/sound/pcm/dsp.c
613
if (ch->direction == PCMDIR_REC) {
sys/dev/sound/pcm/dsp.c
620
if (ch->direction != PCMDIR_PLAY)
sys/dev/sound/pcm/dsp.c
622
*(int *)arg = chn_getvolume_matrix(ch,
sys/dev/sound/pcm/dsp.c
624
*(int *)arg |= chn_getvolume_matrix(ch,
sys/dev/sound/pcm/dsp.c
628
if (ch->direction != PCMDIR_REC)
sys/dev/sound/pcm/dsp.c
630
*(int *)arg = chn_getvolume_matrix(ch,
sys/dev/sound/pcm/dsp.c
632
*(int *)arg |= chn_getvolume_matrix(ch,
sys/dev/sound/pcm/dsp.c
638
if (ch->direction == PCMDIR_REC)
sys/dev/sound/pcm/dsp.c
652
CHN_UNLOCK(ch);
sys/dev/sound/pcm/feeder.c
307
feed_root(struct pcm_feeder *feeder, struct pcm_channel *ch, u_int8_t *buffer, u_int32_t count, void *source)
sys/dev/sound/pcm/feeder.c
314
if (++ch->feedcount == 0)
sys/dev/sound/pcm/feeder.c
315
ch->feedcount = 2;
sys/dev/sound/pcm/feeder.c
320
if (ch->direction == PCMDIR_REC) {
sys/dev/sound/pcm/feeder.c
332
(ch->flags & CHN_F_VIRTUAL) ? "virtual" : "hardware",
sys/dev/sound/pcm/feeder.c
333
(ch->feedcount == 1) ? "pre" : "ap",
sys/dev/sound/pcm/feeder.c
334
offset, count, l, ch->feedcount);
sys/dev/sound/pcm/feeder.c
336
if (ch->feedcount == 1) {
sys/dev/sound/pcm/feeder.c
341
ch->feedcount--;
sys/dev/sound/pcm/feeder.c
346
if (!(ch->flags & CHN_F_CLOSING))
sys/dev/sound/pcm/feeder.c
347
ch->xruns++;
sys/dev/sound/pcm/feeder_matrix.c
180
uint32_t i, j, ch, in_mask, merge_mask;
sys/dev/sound/pcm/feeder_matrix.c
216
for (ch = SND_CHN_T_BEGIN; ch <= SND_CHN_T_END &&
sys/dev/sound/pcm/feeder_matrix.c
217
m_out->map[ch].type != SND_CHN_T_MAX; ch += SND_CHN_T_STEP) {
sys/dev/sound/pcm/feeder_matrix.c
218
merge_mask = m_out->map[ch].members & in_mask;
sys/dev/sound/pcm/feeder_matrix.c
220
info->matrix[ch].chn[0] = SND_CHN_T_NULL;
sys/dev/sound/pcm/feeder_matrix.c
230
info->matrix[ch].chn[j++] =
sys/dev/sound/pcm/feeder_matrix.c
233
info->matrix[ch].chn[j++] =
sys/dev/sound/pcm/feeder_matrix.c
254
info->matrix[ch].mul = mul;
sys/dev/sound/pcm/feeder_matrix.c
255
info->matrix[ch].shift = shift;
sys/dev/sound/pcm/feeder_matrix.c
260
fprintf(stderr, "Total: %d\n", ch);
sys/dev/sound/pcm/feeder_matrix.c
428
feeder_matrix_default_id(uint32_t ch)
sys/dev/sound/pcm/feeder_matrix.c
431
if (ch < feeder_matrix_maps[SND_CHN_MATRIX_BEGIN].channels ||
sys/dev/sound/pcm/feeder_matrix.c
432
ch > feeder_matrix_maps[SND_CHN_MATRIX_END].channels)
sys/dev/sound/pcm/feeder_matrix.c
435
return (feeder_matrix_maps[feeder_matrix_default_ids[ch]].id);
sys/dev/sound/pcm/feeder_matrix.c
443
feeder_matrix_default_channel_map(uint32_t ch)
sys/dev/sound/pcm/feeder_matrix.c
446
if (ch < feeder_matrix_maps[SND_CHN_MATRIX_BEGIN].channels ||
sys/dev/sound/pcm/feeder_matrix.c
447
ch > feeder_matrix_maps[SND_CHN_MATRIX_END].channels)
sys/dev/sound/pcm/feeder_matrix.c
450
return (&feeder_matrix_maps[feeder_matrix_default_ids[ch]]);
sys/dev/sound/pcm/feeder_matrix.c
462
uint32_t i, ch, ext;
sys/dev/sound/pcm/feeder_matrix.c
464
ch = AFMT_CHANNEL(format);
sys/dev/sound/pcm/feeder_matrix.c
469
if (feeder_matrix_maps[i].channels == ch &&
sys/dev/sound/pcm/feeder_matrix.c
471
return (SND_FORMAT(format, ch, ext));
sys/dev/sound/pcm/feeder_matrix.c
475
m = feeder_matrix_default_channel_map(ch);
sys/dev/sound/pcm/feeder_matrix.c
479
return (SND_FORMAT(format, ch, m->ext));
sys/dev/sound/pcm/feeder_matrix.c
489
uint32_t i, ch, ext;
sys/dev/sound/pcm/feeder_matrix.c
491
ch = AFMT_CHANNEL(format);
sys/dev/sound/pcm/feeder_matrix.c
495
if (feeder_matrix_maps[i].channels == ch &&
sys/dev/sound/pcm/feeder_matrix.c
510
uint32_t i, ch, ext;
sys/dev/sound/pcm/feeder_matrix.c
512
ch = AFMT_CHANNEL(format);
sys/dev/sound/pcm/feeder_matrix.c
516
if (feeder_matrix_maps[i].channels == ch &&
sys/dev/sound/pcm/feeder_matrix.c
645
int ch, cheof;
sys/dev/sound/pcm/feeder_matrix.c
659
ch = (*map >> (i * 4)) & 0xf;
sys/dev/sound/pcm/feeder_matrix.c
660
if (ch < SND_CHN_OSS_BEGIN) {
sys/dev/sound/pcm/feeder_matrix.c
666
} else if (ch > SND_CHN_OSS_END)
sys/dev/sound/pcm/feeder_matrix.c
670
ch = oss_to_snd_chn[ch];
sys/dev/sound/pcm/feeder_matrix.c
671
chmask = 1 << ch;
sys/dev/sound/pcm/feeder_matrix.c
678
tmp.map[i] = m->map[m->offset[ch]];
sys/dev/sound/pcm/feeder_matrix.c
679
if (tmp.map[i].type != ch)
sys/dev/sound/pcm/feeder_matrix.c
681
tmp.offset[ch] = i;
sys/dev/sound/pcm/feeder_mixer.c
130
struct pcm_channel *ch;
sys/dev/sound/pcm/feeder_mixer.c
168
CHN_FOREACH(ch, c, children.busy) {
sys/dev/sound/pcm/feeder_mixer.c
169
CHN_LOCK(ch);
sys/dev/sound/pcm/feeder_mixer.c
170
if (CHN_STOPPED(ch) || (ch->flags & CHN_F_DIRTY)) {
sys/dev/sound/pcm/feeder_mixer.c
171
CHN_UNLOCK(ch);
sys/dev/sound/pcm/feeder_mixer.c
174
bs = ch->bufsoft;
sys/dev/sound/pcm/feeder_mixer.c
175
if (ch->flags & CHN_F_MMAP)
sys/dev/sound/pcm/feeder_mixer.c
179
CHN_UNLOCK(ch);
sys/dev/sound/pcm/feeder_mixer.c
184
cnt = FEEDER_FEED(ch->feeder, ch, bs->tmpbuf,
sys/dev/sound/pcm/feeder_mixer.c
195
ch->xruns++;
sys/dev/sound/pcm/feeder_mixer.c
196
CHN_UNLOCK(ch);
sys/dev/sound/pcm/feeder_mixer.c
227
struct pcm_channel *ch;
sys/dev/sound/pcm/feeder_mixer.c
256
CHN_FOREACH(ch, c, children.busy) {
sys/dev/sound/pcm/feeder_mixer.c
257
CHN_LOCK(ch);
sys/dev/sound/pcm/feeder_mixer.c
258
if (CHN_STOPPED(ch) || (ch->flags & CHN_F_DIRTY)) {
sys/dev/sound/pcm/feeder_mixer.c
259
CHN_UNLOCK(ch);
sys/dev/sound/pcm/feeder_mixer.c
262
if ((ch->flags & CHN_F_MMAP) && !(ch->flags & CHN_F_CLOSING))
sys/dev/sound/pcm/feeder_mixer.c
263
sndbuf_acquire(ch->bufsoft, NULL,
sys/dev/sound/pcm/feeder_mixer.c
264
sndbuf_getfree(ch->bufsoft));
sys/dev/sound/pcm/feeder_mixer.c
272
(ch->format & AFMT_PASSTHROUGH)) {
sys/dev/sound/pcm/feeder_mixer.c
273
rcnt = SND_FXROUND(FEEDER_FEED(ch->feeder, ch,
sys/dev/sound/pcm/feeder_mixer.c
274
b, count, ch->bufsoft), sz);
sys/dev/sound/pcm/feeder_mixer.c
277
FEEDER_FEED(ch->feeder, ch, tmp, count,
sys/dev/sound/pcm/feeder_mixer.c
278
ch->bufsoft);
sys/dev/sound/pcm/feeder_mixer.c
285
if (passthrough == 0 && (ch->flags & CHN_F_EXCLUSIVE)) {
sys/dev/sound/pcm/feeder_mixer.c
286
rcnt = SND_FXROUND(FEEDER_FEED(ch->feeder, ch,
sys/dev/sound/pcm/feeder_mixer.c
287
b, count, ch->bufsoft), sz);
sys/dev/sound/pcm/feeder_mixer.c
290
FEEDER_FEED(ch->feeder, ch, tmp, count,
sys/dev/sound/pcm/feeder_mixer.c
291
ch->bufsoft);
sys/dev/sound/pcm/feeder_mixer.c
294
rcnt = SND_FXROUND(FEEDER_FEED(ch->feeder, ch,
sys/dev/sound/pcm/feeder_mixer.c
295
b, count, ch->bufsoft), sz);
sys/dev/sound/pcm/feeder_mixer.c
298
cnt = SND_FXROUND(FEEDER_FEED(ch->feeder, ch,
sys/dev/sound/pcm/feeder_mixer.c
299
tmp, count, ch->bufsoft), sz);
sys/dev/sound/pcm/feeder_mixer.c
330
CHN_UNLOCK(ch);
sys/dev/sound/pcm/feeder_rate.c
449
uint32_t ch; \
sys/dev/sound/pcm/feeder_rate.c
458
ch = info->channels; \
sys/dev/sound/pcm/feeder_rate.c
468
} while (--ch != 0); \
sys/dev/sound/pcm/feeder_rate.c
531
uint32_t c, center, ch, i; \
sys/dev/sound/pcm/feeder_rate.c
536
ch = info->channels * PCM_##BIT##_BPS; \
sys/dev/sound/pcm/feeder_rate.c
537
dst += ch; \
sys/dev/sound/pcm/feeder_rate.c
541
ch -= PCM_##BIT##_BPS; \
sys/dev/sound/pcm/feeder_rate.c
546
info->channels * PCM_##BIT##_BPS) + ch; \
sys/dev/sound/pcm/feeder_rate.c
552
PCM_##BIT##_BPS) + ch; \
sys/dev/sound/pcm/feeder_rate.c
562
} while (ch != 0); \
sys/dev/sound/pcm/feeder_rate.c
572
int32_t ch, i, start, *z_pcoeff; \
sys/dev/sound/pcm/feeder_rate.c
574
ch = info->channels * PCM_##BIT##_BPS; \
sys/dev/sound/pcm/feeder_rate.c
575
dst += ch; \
sys/dev/sound/pcm/feeder_rate.c
576
start = z_prev(info, info->z_start, (info->z_size << 1) - 1) * ch; \
sys/dev/sound/pcm/feeder_rate.c
580
ch -= PCM_##BIT##_BPS; \
sys/dev/sound/pcm/feeder_rate.c
582
p = info->z_delay + start + ch; \
sys/dev/sound/pcm/feeder_rate.c
602
} while (ch != 0); \
sys/dev/sound/pcm/sound.c
118
struct pcm_channel *ch;
sys/dev/sound/pcm/sound.c
124
ch = chn_init(d, NULL, cls, dir, devinfo);
sys/dev/sound/pcm/sound.c
125
if (!ch) {
sys/dev/sound/pcm/sound.c
139
struct pcm_channel *ch;
sys/dev/sound/pcm/sound.c
148
CHN_FOREACH(ch, d, channels.pcm) {
sys/dev/sound/pcm/sound.c
149
CHN_LOCK(ch);
sys/dev/sound/pcm/sound.c
150
if (ch->inprog == 0 && ch->sleeping == 0 &&
sys/dev/sound/pcm/sound.c
151
CHN_STOPPED(ch)) {
sys/dev/sound/pcm/sound.c
152
CHN_UNLOCK(ch);
sys/dev/sound/pcm/sound.c
155
chn_shutdown(ch);
sys/dev/sound/pcm/sound.c
156
if (ch->direction == PCMDIR_PLAY)
sys/dev/sound/pcm/sound.c
157
chn_flush(ch);
sys/dev/sound/pcm/sound.c
159
chn_abort(ch);
sys/dev/sound/pcm/sound.c
160
CHN_UNLOCK(ch);
sys/dev/sound/pcm/sound.c
175
ch = CHN_FIRST(d, channels.pcm);
sys/dev/sound/pcm/sound.c
176
chn_kill(ch);
sys/dev/sound/pcm/vchan.c
408
struct pcm_channel *c, *ch;
sys/dev/sound/pcm/vchan.c
477
CHN_FOREACH(ch, c, children.busy) {
sys/dev/sound/pcm/vchan.c
478
CHN_LOCK(ch);
sys/dev/sound/pcm/vchan.c
479
if (VCHAN_SYNC_REQUIRED(ch))
sys/dev/sound/pcm/vchan.c
480
vchan_sync(ch);
sys/dev/sound/pcm/vchan.c
481
CHN_UNLOCK(ch);
sys/dev/sound/pcm/vchan.c
502
struct pcm_channel *c, *ch;
sys/dev/sound/pcm/vchan.c
576
CHN_FOREACH(ch, c, children.busy) {
sys/dev/sound/pcm/vchan.c
577
CHN_LOCK(ch);
sys/dev/sound/pcm/vchan.c
578
if (VCHAN_SYNC_REQUIRED(ch))
sys/dev/sound/pcm/vchan.c
579
vchan_sync(ch);
sys/dev/sound/pcm/vchan.c
580
CHN_UNLOCK(ch);
sys/dev/sound/pcm/vchan.c
608
struct pcm_channel *ch;
sys/dev/sound/pcm/vchan.c
637
ch = chn_init(d, parent, &vchan_class, direction, parent);
sys/dev/sound/pcm/vchan.c
638
if (ch == NULL) {
sys/dev/sound/pcm/vchan.c
646
CHN_INSERT_SORT_ASCEND(parent, ch, children);
sys/dev/sound/pcm/vchan.c
648
*child = ch;
sys/dev/sound/pcm/vchan.c
676
CHN_LOCK(ch);
sys/dev/sound/pcm/vchan.c
677
vchan_destroy(ch);
sys/dev/sound/usb/uaudio.c
1328
uaudio_get_buffer_size(struct uaudio_chan *ch, uint8_t alt)
sys/dev/sound/usb/uaudio.c
1330
struct uaudio_chan_alt *chan_alt = &ch->usb_alt[alt];
sys/dev/sound/usb/uaudio.c
1335
ms = uaudio_get_buffer_ms(ch->priv_sc, int_frames);
sys/dev/sound/usb/uaudio.c
1342
uaudio_max_buffer_size(struct uaudio_chan *ch, uint8_t alt)
sys/dev/sound/usb/uaudio.c
1344
struct uaudio_chan_alt *chan_alt = &ch->usb_alt[alt];
sys/dev/sound/usb/uaudio.c
2242
struct uaudio_chan *ch = usbd_xfer_softc(xfer);
sys/dev/sound/usb/uaudio.c
2254
i = uaudio_get_child_index_by_chan(ch->priv_sc, ch);
sys/dev/sound/usb/uaudio.c
2290
sample_rate = ch->usb_alt[ch->cur_alt].sample_rate;
sys/dev/sound/usb/uaudio.c
2306
if (ch->priv_sc->sc_rec_chan[i].num_alt == 0) {
sys/dev/sound/usb/uaudio.c
2317
ch->jitter_curr = temp - sample_rate;
sys/dev/sound/usb/uaudio.c
2318
if (ch->jitter_curr > jitter_max)
sys/dev/sound/usb/uaudio.c
2319
ch->jitter_curr = jitter_max;
sys/dev/sound/usb/uaudio.c
2320
else if (ch->jitter_curr < -jitter_max)
sys/dev/sound/usb/uaudio.c
2321
ch->jitter_curr = -jitter_max;
sys/dev/sound/usb/uaudio.c
2323
ch->feedback_rate = temp;
sys/dev/sound/usb/uaudio.c
2332
if (ch->priv_sc->sc_rec_chan[i].num_alt != 0 &&
sys/dev/sound/usb/uaudio.c
2346
uaudio_chan_is_async(struct uaudio_chan *ch, uint8_t alt)
sys/dev/sound/usb/uaudio.c
2348
uint8_t attr = ch->usb_alt[alt].p_ed1->bmAttributes;
sys/dev/sound/usb/uaudio.c
2355
struct uaudio_chan *ch = usbd_xfer_softc(xfer);
sys/dev/sound/usb/uaudio.c
2368
if (ch->running == 0 || ch->start == ch->end) {
sys/dev/sound/usb/uaudio.c
2373
i = uaudio_get_child_index_by_chan(ch->priv_sc, ch);
sys/dev/sound/usb/uaudio.c
2376
ch_rec = ch->priv_sc->sc_rec_chan + i;
sys/dev/sound/usb/uaudio.c
2400
ch->jitter_curr = 0;
sys/dev/sound/usb/uaudio.c
2401
ch->jitter_rem = 0;
sys/dev/sound/usb/uaudio.c
2409
chn_intr(ch->pcm_ch);
sys/dev/sound/usb/uaudio.c
2416
uaudio_chan_is_async(ch, ch->cur_alt) != 0) {
sys/dev/sound/usb/uaudio.c
2430
tx_jitter = ch->usb_alt[ch->cur_alt].sample_rate;
sys/dev/sound/usb/uaudio.c
2432
ch->jitter_rem;
sys/dev/sound/usb/uaudio.c
2440
ch->jitter_curr += tx_jitter / rx_rate;
sys/dev/sound/usb/uaudio.c
2441
ch->jitter_rem = tx_jitter % rx_rate;
sys/dev/sound/usb/uaudio.c
2446
ch->intr_counter += ch->intr_frames;
sys/dev/sound/usb/uaudio.c
2447
if (ch->intr_counter >= ch->frames_per_second) {
sys/dev/sound/usb/uaudio.c
2448
ch->intr_counter -= ch->frames_per_second;
sys/dev/sound/usb/uaudio.c
2449
usbd_transfer_start(ch->xfer[UAUDIO_NCHANBUFS]);
sys/dev/sound/usb/uaudio.c
2454
if (ch->bytes_per_frame[1] > mfl) {
sys/dev/sound/usb/uaudio.c
2457
ch->bytes_per_frame[1],
sys/dev/sound/usb/uaudio.c
2462
blockcount = ch->intr_frames;
sys/dev/sound/usb/uaudio.c
2468
sample_size = ch->usb_alt[ch->cur_alt].sample_size;
sys/dev/sound/usb/uaudio.c
2477
ch->sample_curr += ch->sample_rem;
sys/dev/sound/usb/uaudio.c
2478
if (ch->sample_curr >= ch->frames_per_second) {
sys/dev/sound/usb/uaudio.c
2479
ch->sample_curr -= ch->frames_per_second;
sys/dev/sound/usb/uaudio.c
2480
frame_len = ch->bytes_per_frame[1];
sys/dev/sound/usb/uaudio.c
2482
frame_len = ch->bytes_per_frame[0];
sys/dev/sound/usb/uaudio.c
2486
if (ch->jitter_curr > 0 &&
sys/dev/sound/usb/uaudio.c
2489
ch->jitter_curr--;
sys/dev/sound/usb/uaudio.c
2491
} else if (ch->jitter_curr < 0 &&
sys/dev/sound/usb/uaudio.c
2494
ch->jitter_curr++;
sys/dev/sound/usb/uaudio.c
2507
n = (ch->end - ch->cur);
sys/dev/sound/usb/uaudio.c
2511
usbd_copy_in(pc, offset, ch->cur, n);
sys/dev/sound/usb/uaudio.c
2514
ch->cur += n;
sys/dev/sound/usb/uaudio.c
2517
if (ch->cur >= ch->end)
sys/dev/sound/usb/uaudio.c
2518
ch->cur = ch->start;
sys/dev/sound/usb/uaudio.c
2539
struct uaudio_chan *ch = usbd_xfer_softc(xfer);
sys/dev/sound/usb/uaudio.c
2551
if (ch->start == ch->end) {
sys/dev/sound/usb/uaudio.c
2566
ch->sample_curr += (ch->sample_rem * ch->intr_frames);
sys/dev/sound/usb/uaudio.c
2569
expected_bytes = (ch->intr_frames * ch->bytes_per_frame[0]) +
sys/dev/sound/usb/uaudio.c
2570
((ch->sample_curr / ch->frames_per_second) *
sys/dev/sound/usb/uaudio.c
2571
(ch->bytes_per_frame[1] - ch->bytes_per_frame[0]));
sys/dev/sound/usb/uaudio.c
2574
ch->sample_curr %= ch->frames_per_second;
sys/dev/sound/usb/uaudio.c
2577
sample_size = ch->usb_alt[ch->cur_alt].sample_size;
sys/dev/sound/usb/uaudio.c
2591
if (ch->running == 0 || ch->cur_alt != ch->set_alt)
sys/dev/sound/usb/uaudio.c
2596
m = (ch->end - ch->cur);
sys/dev/sound/usb/uaudio.c
2601
usbd_copy_out(pc, offset1, ch->cur, m);
sys/dev/sound/usb/uaudio.c
2605
ch->cur += m;
sys/dev/sound/usb/uaudio.c
2607
if (ch->cur >= ch->end)
sys/dev/sound/usb/uaudio.c
2608
ch->cur = ch->start;
sys/dev/sound/usb/uaudio.c
2615
ch->jitter_curr -= (expected_bytes / sample_size);
sys/dev/sound/usb/uaudio.c
2618
nframes = 2 * ch->intr_frames;
sys/dev/sound/usb/uaudio.c
2621
if (ch->jitter_curr < -nframes)
sys/dev/sound/usb/uaudio.c
2622
ch->jitter_curr = -nframes;
sys/dev/sound/usb/uaudio.c
2623
else if (ch->jitter_curr > nframes)
sys/dev/sound/usb/uaudio.c
2624
ch->jitter_curr = nframes;
sys/dev/sound/usb/uaudio.c
2627
actlen, ch->jitter_curr);
sys/dev/sound/usb/uaudio.c
2629
if (ch->running != 0)
sys/dev/sound/usb/uaudio.c
2630
chn_intr(ch->pcm_ch);
sys/dev/sound/usb/uaudio.c
2634
nframes = ch->intr_frames;
sys/dev/sound/usb/uaudio.c
2651
uaudio_chan_init(struct uaudio_chan *ch, struct snd_dbuf *b,
sys/dev/sound/usb/uaudio.c
2659
ch->pcm_ch = c;
sys/dev/sound/usb/uaudio.c
2660
mtx_init(&ch->lock, "uaudio_chan lock", NULL, MTX_DEF);
sys/dev/sound/usb/uaudio.c
2665
for (x = 0; x != ch->num_alt; x++) {
sys/dev/sound/usb/uaudio.c
2666
uint32_t temp = uaudio_max_buffer_size(ch, x);
sys/dev/sound/usb/uaudio.c
2676
ch->buf = malloc(buf_size, M_DEVBUF, M_WAITOK | M_ZERO);
sys/dev/sound/usb/uaudio.c
2677
if (sndbuf_setup(b, ch->buf, buf_size) != 0)
sys/dev/sound/usb/uaudio.c
2680
ch->start = ch->buf;
sys/dev/sound/usb/uaudio.c
2681
ch->end = ch->buf + buf_size;
sys/dev/sound/usb/uaudio.c
2682
ch->cur = ch->buf;
sys/dev/sound/usb/uaudio.c
2683
ch->pcm_buf = b;
sys/dev/sound/usb/uaudio.c
2684
ch->max_buf = buf_size;
sys/dev/sound/usb/uaudio.c
2686
return (ch);
sys/dev/sound/usb/uaudio.c
2689
uaudio_chan_free(ch);
sys/dev/sound/usb/uaudio.c
2694
uaudio_chan_free(struct uaudio_chan *ch)
sys/dev/sound/usb/uaudio.c
2696
free(ch->buf, M_DEVBUF);
sys/dev/sound/usb/uaudio.c
2697
ch->buf = NULL;
sys/dev/sound/usb/uaudio.c
2698
usbd_transfer_unsetup(ch->xfer, UAUDIO_NCHANBUFS + 1);
sys/dev/sound/usb/uaudio.c
2699
mtx_destroy(&ch->lock);
sys/dev/sound/usb/uaudio.c
2701
ch->num_alt = 0;
sys/dev/sound/usb/uaudio.c
2707
uaudio_chan_set_param_blocksize(struct uaudio_chan *ch, uint32_t blocksize)
sys/dev/sound/usb/uaudio.c
2709
uint32_t temp = 2 * uaudio_get_buffer_size(ch, ch->set_alt);
sys/dev/sound/usb/uaudio.c
2710
sndbuf_setup(ch->pcm_buf, ch->buf, temp);
sys/dev/sound/usb/uaudio.c
2715
uaudio_chan_set_param_fragments(struct uaudio_chan *ch, uint32_t blocksize,
sys/dev/sound/usb/uaudio.c
2722
uaudio_chan_set_param_speed(struct uaudio_chan *ch, uint32_t speed)
sys/dev/sound/usb/uaudio.c
2727
sc = ch->priv_sc;
sys/dev/sound/usb/uaudio.c
2729
for (x = 0, y = 1; y < ch->num_alt; y++) {
sys/dev/sound/usb/uaudio.c
2731
if ((ch->usb_alt[x].sample_rate < speed &&
sys/dev/sound/usb/uaudio.c
2732
ch->usb_alt[x].sample_rate < ch->usb_alt[y].sample_rate) ||
sys/dev/sound/usb/uaudio.c
2733
(speed <= ch->usb_alt[y].sample_rate &&
sys/dev/sound/usb/uaudio.c
2734
ch->usb_alt[y].sample_rate < ch->usb_alt[x].sample_rate))
sys/dev/sound/usb/uaudio.c
2739
ch->set_alt = x;
sys/dev/sound/usb/uaudio.c
2744
return (ch->usb_alt[x].sample_rate);
sys/dev/sound/usb/uaudio.c
2748
uaudio_chan_getptr(struct uaudio_chan *ch)
sys/dev/sound/usb/uaudio.c
2750
return (ch->cur - ch->start);
sys/dev/sound/usb/uaudio.c
2754
uaudio_chan_getcaps(struct uaudio_chan *ch)
sys/dev/sound/usb/uaudio.c
2756
return (&ch->pcm_cap);
sys/dev/sound/usb/uaudio.c
2791
uaudio_chan_getmatrix(struct uaudio_chan *ch, uint32_t format)
sys/dev/sound/usb/uaudio.c
2795
sc = ch->priv_sc;
sys/dev/sound/usb/uaudio.c
2805
uaudio_chan_set_param_format(struct uaudio_chan *ch, uint32_t format)
sys/dev/sound/usb/uaudio.c
2812
uaudio_chan_reconfigure(struct uaudio_chan *ch, uint8_t operation)
sys/dev/sound/usb/uaudio.c
2814
struct uaudio_softc *sc = ch->priv_sc;
sys/dev/sound/usb/uaudio.c
2817
if (ch->operation == CHAN_OP_DRAIN)
sys/dev/sound/usb/uaudio.c
2821
ch->operation = operation;
sys/dev/sound/usb/uaudio.c
2852
uaudio_chan_start(struct uaudio_chan *ch)
sys/dev/sound/usb/uaudio.c
2854
struct uaudio_softc *sc = ch->priv_sc;
sys/dev/sound/usb/uaudio.c
2855
unsigned i = uaudio_get_child_index_by_chan(sc, ch);
sys/dev/sound/usb/uaudio.c
2861
if (ch->running == 0) {
sys/dev/sound/usb/uaudio.c
2865
temp = 2 * uaudio_get_buffer_size(ch, ch->set_alt);
sys/dev/sound/usb/uaudio.c
2868
ch->running = 1;
sys/dev/sound/usb/uaudio.c
2871
ch->start = ch->buf;
sys/dev/sound/usb/uaudio.c
2872
ch->end = ch->buf + temp;
sys/dev/sound/usb/uaudio.c
2873
ch->cur = ch->buf;
sys/dev/sound/usb/uaudio.c
2885
uaudio_chan_reconfigure(ch, CHAN_OP_START);
sys/dev/sound/usb/uaudio.c
2894
uaudio_chan_stop(struct uaudio_chan *ch)
sys/dev/sound/usb/uaudio.c
2896
struct uaudio_softc *sc = ch->priv_sc;
sys/dev/sound/usb/uaudio.c
2897
unsigned i = uaudio_get_child_index_by_chan(sc, ch);
sys/dev/sound/usb/uaudio.c
2903
if (ch->running != 0) {
sys/dev/sound/usb/uaudio.c
2905
ch->running = 0;
sys/dev/sound/usb/uaudio.c
2924
uaudio_chan_reconfigure(ch, CHAN_OP_STOP);
sys/dev/sound/usb/uaudio.c
3237
int ch;
sys/dev/sound/usb/uaudio.c
3245
for (ch = 0; ch < p_mc_new->nchan; ch++) {
sys/dev/sound/usb/uaudio.c
3249
p_mc_new->wData[ch] = (p_mc_new->maxval + p_mc_new->minval) / 2;
sys/dev/sound/usb/uaudio.c
3253
p_mc_new->wData[ch] = p_mc_new->maxval;
sys/dev/sound/usb/uaudio.c
3257
p_mc_new->wData[ch] = p_mc_new->minval;
sys/dev/sound/usb/uaudio.c
848
uaudio_get_child_index_by_chan(struct uaudio_softc *sc, struct uaudio_chan *ch)
sys/dev/sound/usb/uaudio.c
853
if ((sc->sc_play_chan + i) == ch ||
sys/dev/sound/usb/uaudio.c
854
(sc->sc_rec_chan + i) == ch)
sys/dev/sound/usb/uaudio.c
857
panic("uaudio_get_child_index_by_chan: Invalid chan: %p\n", ch);
sys/dev/sound/usb/uaudio.h
43
extern void *uaudio_chan_init(struct uaudio_chan *ch, struct snd_dbuf *b,
sys/dev/sound/usb/uaudio.h
45
extern int uaudio_chan_free(struct uaudio_chan *ch);
sys/dev/sound/usb/uaudio.h
46
extern int uaudio_chan_set_param_blocksize(struct uaudio_chan *ch,
sys/dev/sound/usb/uaudio.h
48
extern int uaudio_chan_set_param_fragments(struct uaudio_chan *ch,
sys/dev/sound/usb/uaudio.h
50
extern int uaudio_chan_set_param_speed(struct uaudio_chan *ch,
sys/dev/sound/usb/uaudio.h
52
extern int uaudio_chan_getptr(struct uaudio_chan *ch);
sys/dev/sound/usb/uaudio.h
53
extern struct pcmchan_caps *uaudio_chan_getcaps(struct uaudio_chan *ch);
sys/dev/sound/usb/uaudio.h
54
extern struct pcmchan_matrix *uaudio_chan_getmatrix(struct uaudio_chan *ch,
sys/dev/sound/usb/uaudio.h
56
extern int uaudio_chan_set_param_format(struct uaudio_chan *ch,
sys/dev/sound/usb/uaudio.h
58
extern void uaudio_chan_start(struct uaudio_chan *ch);
sys/dev/sound/usb/uaudio.h
59
extern void uaudio_chan_stop(struct uaudio_chan *ch);
sys/dev/sume/if_sume.c
1198
int ch;
sys/dev/sume/if_sume.c
1206
for (ch = 0; ch < SUME_RIFFA_CHANNELS; ch++) {
sys/dev/sume/if_sume.c
1208
rp[ch] = malloc(sizeof(struct riffa_chnl_dir), M_SUME,
sys/dev/sume/if_sume.c
1222
&rp[ch]->ch_tag);
sys/dev/sume/if_sume.c
1226
"failed.\n", dir, ch);
sys/dev/sume/if_sume.c
1230
err = bus_dmamem_alloc(rp[ch]->ch_tag, (void **)
sys/dev/sume/if_sume.c
1231
&rp[ch]->buf_addr, BUS_DMA_WAITOK | BUS_DMA_COHERENT |
sys/dev/sume/if_sume.c
1232
BUS_DMA_ZERO, &rp[ch]->ch_map);
sys/dev/sume/if_sume.c
1235
dir, ch);
sys/dev/sume/if_sume.c
1239
bzero(rp[ch]->buf_addr, adapter->sg_buf_size);
sys/dev/sume/if_sume.c
1241
err = bus_dmamap_load(rp[ch]->ch_tag, rp[ch]->ch_map,
sys/dev/sume/if_sume.c
1242
rp[ch]->buf_addr, adapter->sg_buf_size, callback_dma,
sys/dev/sume/if_sume.c
1246
dir, ch);
sys/dev/sume/if_sume.c
1249
rp[ch]->buf_hw_addr = hw_addr;
sys/dev/sume/if_sume.c
1250
rp[ch]->num_sg = 1;
sys/dev/sume/if_sume.c
1251
rp[ch]->state = SUME_RIFFA_CHAN_STATE_IDLE;
sys/dev/sume/if_sume.c
1253
rp[ch]->rtag = SUME_INIT_RTAG;
sys/dev/sume/if_sume.c
1472
int ch;
sys/dev/sume/if_sume.c
1474
for (ch = 0; ch < SUME_RIFFA_CHANNELS; ch++) {
sys/dev/sume/if_sume.c
1475
if (pp[ch] == NULL)
sys/dev/sume/if_sume.c
1478
if (pp[ch]->buf_hw_addr != 0) {
sys/dev/sume/if_sume.c
1479
bus_dmamem_free(pp[ch]->ch_tag, pp[ch]->buf_addr,
sys/dev/sume/if_sume.c
1480
pp[ch]->ch_map);
sys/dev/sume/if_sume.c
1481
pp[ch]->buf_hw_addr = 0;
sys/dev/sume/if_sume.c
1484
free(pp[ch], M_SUME);
sys/dev/sume/if_sume.c
321
int ch, loops;
sys/dev/sume/if_sume.c
339
for (ch = 0; ch < SUME_RIFFA_CHANNELS; ch++) {
sys/dev/sume/if_sume.c
340
vect = vect0 >> (5 * ch);
sys/dev/sume/if_sume.c
341
send = adapter->send[ch];
sys/dev/sume/if_sume.c
342
recv = adapter->recv[ch];
sys/dev/sume/if_sume.c
349
"0x%08x\n", ch, send->state, vect);
sys/dev/sume/if_sume.c
357
"vect = 0x%08x\n", ch, send->state,
sys/dev/sume/if_sume.c
369
"vect = 0x%08x\n", ch, send->state,
sys/dev/sume/if_sume.c
376
len = read_reg(adapter, RIFFA_CHNL_REG(ch,
sys/dev/sume/if_sume.c
378
if (ch == SUME_RIFFA_CHANNEL_DATA) {
sys/dev/sume/if_sume.c
382
} else if (ch == SUME_RIFFA_CHANNEL_REG)
sys/dev/sume/if_sume.c
387
"vect = 0x%08x\n", ch, send->state,
sys/dev/sume/if_sume.c
405
"%d\n", ch, vect, send->state, loops);
sys/dev/sume/if_sume.c
412
"0x%08x\n", ch, recv->state, vect);
sys/dev/sume/if_sume.c
418
"vect = 0x%08x\n", ch, recv->state,
sys/dev/sume/if_sume.c
430
RIFFA_CHNL_REG(ch,
sys/dev/sume/if_sume.c
432
recv->len = read_reg(adapter, RIFFA_CHNL_REG(ch,
sys/dev/sume/if_sume.c
456
write_reg(adapter, RIFFA_CHNL_REG(ch,
sys/dev/sume/if_sume.c
459
write_reg(adapter, RIFFA_CHNL_REG(ch,
sys/dev/sume/if_sume.c
462
write_reg(adapter, RIFFA_CHNL_REG(ch,
sys/dev/sume/if_sume.c
476
"vect = 0x%08x\n", ch, recv->state,
sys/dev/sume/if_sume.c
488
"vect = 0x%08x\n", ch, recv->state,
sys/dev/sume/if_sume.c
493
len = read_reg(adapter, RIFFA_CHNL_REG(ch,
sys/dev/sume/if_sume.c
497
if (ch == SUME_RIFFA_CHANNEL_DATA) {
sys/dev/sume/if_sume.c
502
} else if (ch == SUME_RIFFA_CHANNEL_REG)
sys/dev/sume/if_sume.c
507
"vect = 0x%08x\n", ch, recv->state,
sys/dev/sume/if_sume.c
525
"%d\n", ch, vect, recv->state, loops);
sys/dev/sume/if_sume.c
528
if (ch == SUME_RIFFA_CHANNEL_REG &&
sys/dev/sume/if_sume.c
530
read_reg(adapter, RIFFA_CHNL_REG(ch,
sys/dev/sym/sym_hipd.c
1377
struct callout ch; /* callout handle */
sys/dev/sym/sym_hipd.c
2322
callout_reset_sbt(&cp->ch, SBT_1MS * ccb->ccb_h.timeout, 0, sym_callout,
sys/dev/sym/sym_hipd.c
2340
callout_stop(&cp->ch);
sys/dev/sym/sym_hipd.c
6497
callout_init(&cp->ch, 1);
sys/dev/sym/sym_hipd.c
7357
callout_reset(&cp->ch, 10 * hz, sym_callout, (caddr_t) ccb);
sys/dev/syscons/scterm-teken.c
529
u_char ch;
sys/dev/syscons/scterm-teken.c
544
ch = c;
sys/dev/syscons/scterm-teken.c
550
sc_vtb_putchar(&scp->vtb, p, map[ch], attr);
sys/dev/syscons/scterm-teken.c
566
u_char ch;
sys/dev/syscons/scterm-teken.c
574
ch = c;
sys/dev/syscons/scterm-teken.c
582
map[ch], attr);
sys/dev/syscons/scterm-teken.c
590
width, map[ch], attr);
sys/dev/syscons/sctermvar.h
100
sc_vtb_erase(&scp->vtb, scp->cursor_pos, n, ch, attr);
sys/dev/syscons/sctermvar.h
106
sc_term_del_char(scr_stat *scp, int n, int ch, int attr)
sys/dev/syscons/sctermvar.h
116
sc_vtb_erase(&scp->vtb, scp->cursor_pos + count, n, ch, attr);
sys/dev/syscons/sctermvar.h
178
sc_term_up_scroll(scr_stat *scp, int n, int ch, int attr, int head, int tail)
sys/dev/syscons/sctermvar.h
188
ch, attr, tail);
sys/dev/syscons/sctermvar.h
194
sc_term_down_scroll(scr_stat *scp, int n, int ch, int attr, int head, int tail)
sys/dev/syscons/sctermvar.h
204
ch, attr, tail);
sys/dev/syscons/sctermvar.h
210
sc_term_clr_eos(scr_stat *scp, int n, int ch, int attr)
sys/dev/syscons/sctermvar.h
216
ch, attr);
sys/dev/syscons/sctermvar.h
222
sc_vtb_erase(&scp->vtb, 0, scp->cursor_pos + 1, ch, attr);
sys/dev/syscons/sctermvar.h
228
sc_vtb_erase(&scp->vtb, 0, scp->xsize*scp->ysize, ch, attr);
sys/dev/syscons/sctermvar.h
237
sc_term_clr_eol(scr_stat *scp, int n, int ch, int attr)
sys/dev/syscons/sctermvar.h
242
scp->xsize - scp->xpos, ch, attr);
sys/dev/syscons/sctermvar.h
249
scp->xpos + 1, ch, attr);
sys/dev/syscons/sctermvar.h
255
scp->xsize, ch, attr);
sys/dev/syscons/sctermvar.h
34
static __inline void sc_term_ins_line(scr_stat *scp, int y, int n, int ch,
sys/dev/syscons/sctermvar.h
36
static __inline void sc_term_del_line(scr_stat *scp, int y, int n, int ch,
sys/dev/syscons/sctermvar.h
38
static __inline void sc_term_ins_char(scr_stat *scp, int n, int ch,
sys/dev/syscons/sctermvar.h
40
static __inline void sc_term_del_char(scr_stat *scp, int n, int ch,
sys/dev/syscons/sctermvar.h
414
sc_term_gen_scroll(scr_stat *scp, int ch, int attr)
sys/dev/syscons/sctermvar.h
423
sc_vtb_delete(&scp->vtb, 0, scp->xsize, ch, attr);
sys/dev/syscons/sctermvar.h
48
static __inline void sc_term_up_scroll(scr_stat *scp, int n, int ch,
sys/dev/syscons/sctermvar.h
50
static __inline void sc_term_down_scroll(scr_stat *scp, int n, int ch,
sys/dev/syscons/sctermvar.h
52
static __inline void sc_term_clr_eos(scr_stat *scp, int n, int ch, int attr);
sys/dev/syscons/sctermvar.h
53
static __inline void sc_term_clr_eol(scr_stat *scp, int n, int ch, int attr);
sys/dev/syscons/sctermvar.h
59
static __inline void sc_term_gen_scroll(scr_stat *scp, int ch, int attr);
sys/dev/syscons/sctermvar.h
62
sc_term_ins_line(scr_stat *scp, int y, int n, int ch, int attr, int tail)
sys/dev/syscons/sctermvar.h
70
sc_vtb_ins(&scp->vtb, y*scp->xsize, n*scp->xsize, ch, attr);
sys/dev/syscons/sctermvar.h
76
sc_term_del_line(scr_stat *scp, int y, int n, int ch, int attr, int tail)
sys/dev/syscons/sctermvar.h
84
sc_vtb_delete(&scp->vtb, y*scp->xsize, n*scp->xsize, ch, attr);
sys/dev/syscons/sctermvar.h
90
sc_term_ins_char(scr_stat *scp, int n, int ch, int attr)
sys/dev/syscons/syscons.h
96
#define PRINTABLE(ch) ((ch) > 0x1b || ((ch) > 0x0d && (ch) < 0x1b) \
sys/dev/syscons/syscons.h
97
|| (ch) < 0x07)
sys/dev/uart/uart_bus_scc.c
106
if (BUS_READ_IVAR(parent, dev, SCC_IVAR_CHANNEL, &ch) ||
sys/dev/uart/uart_bus_scc.c
111
return (uart_bus_probe(dev, rs, 0, cl, 0, ch, 0));
sys/dev/uart/uart_bus_scc.c
86
uintptr_t ch, cl, md, rs;
sys/dev/uart/uart_dev_z8530.c
513
char ch;
sys/dev/uart/uart_dev_z8530.c
522
ch = sc->sc_bas.chan - 1 + 'A';
sys/dev/uart/uart_dev_z8530.c
524
device_set_descf(sc->sc_dev, "z8530, channel %c", ch);
sys/dev/usb/controller/dwc_otgreg.h
102
#define DOTG_DIEPEACHINTMSK(ch) (0x0840 + (4*(ch)))
sys/dev/usb/controller/dwc_otgreg.h
103
#define DOTG_DOEPEACHINTMSK(ch) (0x0880 + (4*(ch)))
sys/dev/usb/controller/dwc_otgreg.h
75
#define DOTG_HCCHAR(ch) (0x0500 + (32*(ch)))
sys/dev/usb/controller/dwc_otgreg.h
76
#define DOTG_HCSPLT(ch) (0x0504 + (32*(ch)))
sys/dev/usb/controller/dwc_otgreg.h
77
#define DOTG_HCINT(ch) (0x0508 + (32*(ch)))
sys/dev/usb/controller/dwc_otgreg.h
78
#define DOTG_HCINTMSK(ch) (0x050C + (32*(ch)))
sys/dev/usb/controller/dwc_otgreg.h
79
#define DOTG_HCTSIZ(ch) (0x0510 + (32*(ch)))
sys/dev/usb/controller/dwc_otgreg.h
80
#define DOTG_HCDMA(ch) (0x0514 + (32*(ch)))
sys/dev/usb/controller/dwc_otgreg.h
81
#define DOTG_HCDMAI(ch) (0x0514 + (32*(ch)))
sys/dev/usb/controller/dwc_otgreg.h
82
#define DOTG_HCDMAO(ch) (0x0514 + (32*(ch)))
sys/dev/usb/controller/dwc_otgreg.h
83
#define DOTG_HCDMAB(ch) (0x051C + (32*(ch)))
sys/dev/usb/controller/musb_otg.c
174
int ch;
sys/dev/usb/controller/musb_otg.c
196
for (ch = sc->sc_ep_max; ch != 0; ch--) {
sys/dev/usb/controller/musb_otg.c
197
if (sc->sc_channel_mask & (1 << ch))
sys/dev/usb/controller/musb_otg.c
203
sc->sc_hw_ep_profile[ch].max_in_frame_size)
sys/dev/usb/controller/musb_otg.c
207
sc->sc_hw_ep_profile[ch].max_out_frame_size)
sys/dev/usb/controller/musb_otg.c
210
sc->sc_channel_mask |= (1 << ch);
sys/dev/usb/controller/musb_otg.c
211
musbotg_ep_int_set(sc, ch, 1);
sys/dev/usb/controller/musb_otg.c
212
return (ch);
sys/dev/usb/net/if_udav.c
357
uint8_t ch)
sys/dev/usb/net/if_udav.c
363
USETW(req.wValue, ch);
sys/dev/usb/net/if_udav.c
415
uint8_t ch)
sys/dev/usb/net/if_udav.c
423
USETW(req.wValue, ch);
sys/dev/vt/hw/vga/vt_vga.c
872
uint8_t ch, attr;
sys/dev/vt/hw/vga/vt_vga.c
904
ch = vga_get_cp437(TCHAR_CHARACTER(c));
sys/dev/vt/hw/vga/vt_vga.c
912
ch + ((uint16_t)(attr) << 8));
sys/dev/vt/vt_buf.c
420
term_char_t ch;
sys/dev/vt/vt_buf.c
423
ch = TCOLOR_FG(a->ta_fgcolor) | TCOLOR_BG(a->ta_bgcolor);
sys/dev/vt/vt_buf.c
429
vtbuf_do_fill(vb, &rect, VTBUF_SPACE_CHAR(ch));
sys/dev/vt/vt_buf.c
505
term_char_t ch;
sys/dev/vt/vt_buf.c
508
ch = TCOLOR_FG(a->ta_fgcolor) | TCOLOR_BG(a->ta_bgcolor);
sys/dev/vt/vt_buf.c
575
row[c] = VTBUF_SPACE_CHAR(ch);
sys/dev/vt/vt_buf.c
583
row[c] = VTBUF_SPACE_CHAR(ch);
sys/dev/vt/vt_buf.c
632
row[c] = VTBUF_SPACE_CHAR(ch);
sys/dev/vt/vt_buf.c
748
tchar_is_word_separator(term_char_t ch)
sys/dev/vt/vt_buf.c
751
switch (TCHAR_CHARACTER(ch)) {
sys/fs/tarfs/tarfs_subr.c
260
#define is09(ch) ((ch) >= '0' && (ch) <= '9')
sys/fs/udf/osta.c
294
int IsIllegal(unicode_t ch);
sys/fs/udf/osta.c
457
unicode_t ch) /* (Input) Unicode char to search for. */
sys/fs/udf/osta.c
463
if (*string == ch) {
sys/fs/udf/osta.c
479
int IsIllegal(unicode_t ch)
sys/fs/udf/osta.c
483
if (ch == 0x003A) {
sys/fs/udf/osta.c
491
if (ch == 0x0000 || ch == 0x002F) {
sys/fs/udf/osta.c
499
if (ch < 0x0020 || UnicodeInString("\\/:*?\"<>|", ch)) {
sys/geom/label/g_label_gpt.c
55
uint32_t ch;
sys/geom/label/g_label_gpt.c
60
ch = (bo == BIG_ENDIAN) ? be16toh(*str) : le16toh(*str);
sys/geom/label/g_label_gpt.c
62
if ((ch & 0xf800) == 0xd800) {
sys/geom/label/g_label_gpt.c
69
if ((ch & 0x400) == 0 && (c & 0xfc00) == 0xdc00) {
sys/geom/label/g_label_gpt.c
70
ch = ((ch & 0x3ff) << 10) + (c & 0x3ff);
sys/geom/label/g_label_gpt.c
71
ch += 0x10000;
sys/geom/label/g_label_gpt.c
73
ch = 0xfffd;
sys/geom/label/g_label_gpt.c
74
} else if (ch == 0xfffe) { /* BOM (U+FEFF) swapped. */
sys/geom/label/g_label_gpt.c
77
} else if (ch == 0xfeff) /* BOM (U+FEFF) unswapped. */
sys/geom/label/g_label_gpt.c
81
if (ch < 0x80)
sys/geom/label/g_label_gpt.c
82
sbuf_printf(sb, "%c", ch);
sys/geom/label/g_label_gpt.c
83
else if (ch < 0x800)
sys/geom/label/g_label_gpt.c
84
sbuf_printf(sb, "%c%c", 0xc0 | (ch >> 6),
sys/geom/label/g_label_gpt.c
85
0x80 | (ch & 0x3f));
sys/geom/label/g_label_gpt.c
86
else if (ch < 0x10000)
sys/geom/label/g_label_gpt.c
87
sbuf_printf(sb, "%c%c%c", 0xe0 | (ch >> 12),
sys/geom/label/g_label_gpt.c
88
0x80 | ((ch >> 6) & 0x3f), 0x80 | (ch & 0x3f));
sys/geom/label/g_label_gpt.c
89
else if (ch < 0x200000)
sys/geom/label/g_label_gpt.c
90
sbuf_printf(sb, "%c%c%c%c", 0xf0 | (ch >> 18),
sys/geom/label/g_label_gpt.c
91
0x80 | ((ch >> 12) & 0x3f),
sys/geom/label/g_label_gpt.c
92
0x80 | ((ch >> 6) & 0x3f), 0x80 | (ch & 0x3f));
sys/geom/part/g_part_apm.c
114
char ch;
sys/geom/part/g_part_apm.c
117
ch = buf[i];
sys/geom/part/g_part_apm.c
119
buf[i + 1] = ch;
sys/geom/part/g_part_gpt.c
1390
uint32_t ch;
sys/geom/part/g_part_gpt.c
1395
ch = (bo == BIG_ENDIAN) ? be16toh(*str) : le16toh(*str);
sys/geom/part/g_part_gpt.c
1397
if ((ch & 0xf800) == 0xd800) {
sys/geom/part/g_part_gpt.c
1404
if ((ch & 0x400) == 0 && (c & 0xfc00) == 0xdc00) {
sys/geom/part/g_part_gpt.c
1405
ch = ((ch & 0x3ff) << 10) + (c & 0x3ff);
sys/geom/part/g_part_gpt.c
1406
ch += 0x10000;
sys/geom/part/g_part_gpt.c
1408
ch = 0xfffd;
sys/geom/part/g_part_gpt.c
1409
} else if (ch == 0xfffe) { /* BOM (U+FEFF) swapped. */
sys/geom/part/g_part_gpt.c
1412
} else if (ch == 0xfeff) /* BOM (U+FEFF) unswapped. */
sys/geom/part/g_part_gpt.c
1416
if (ch < 0x80)
sys/geom/part/g_part_gpt.c
1417
g_conf_printf_escaped(sb, "%c", ch);
sys/geom/part/g_part_gpt.c
1418
else if (ch < 0x800)
sys/geom/part/g_part_gpt.c
1419
g_conf_printf_escaped(sb, "%c%c", 0xc0 | (ch >> 6),
sys/geom/part/g_part_gpt.c
1420
0x80 | (ch & 0x3f));
sys/geom/part/g_part_gpt.c
1421
else if (ch < 0x10000)
sys/geom/part/g_part_gpt.c
1422
g_conf_printf_escaped(sb, "%c%c%c", 0xe0 | (ch >> 12),
sys/geom/part/g_part_gpt.c
1423
0x80 | ((ch >> 6) & 0x3f), 0x80 | (ch & 0x3f));
sys/geom/part/g_part_gpt.c
1424
else if (ch < 0x200000)
sys/geom/part/g_part_gpt.c
1426
(ch >> 18), 0x80 | ((ch >> 12) & 0x3f),
sys/geom/part/g_part_gpt.c
1427
0x80 | ((ch >> 6) & 0x3f), 0x80 | (ch & 0x3f));
sys/kern/coredump_vnode.c
214
char ch;
sys/kern/coredump_vnode.c
225
ch = name[indexpos + indexlen];
sys/kern/coredump_vnode.c
228
name[indexpos + indexlen] = ch;
sys/kern/kern_sysctl.c
115
#define SYSCTL_SLEEP(ch, wmesg, timo) \
sys/kern/kern_sysctl.c
116
rm_sleep(ch, &sysctllock, 0, wmesg, timo)
sys/kern/subr_prf.c
116
static void putchar(int ch, void *arg);
sys/kern/subr_prf.c
118
static void snprintf_func(int ch, void *arg);
sys/kern/subr_prf.c
599
snprintf_func(int ch, void *arg)
sys/kern/subr_prf.c
604
*info->str++ = ch;
sys/kern/subr_prf.c
684
int ch, n, sign;
sys/kern/subr_prf.c
708
while ((ch = (u_char)*fmt++) != '%' || stop) {
sys/kern/subr_prf.c
709
if (ch == '\0')
sys/kern/subr_prf.c
711
PCHAR(ch);
sys/kern/subr_prf.c
717
reswitch: switch (ch = (u_char)*fmt++) {
sys/kern/subr_prf.c
731
PCHAR(ch);
sys/kern/subr_prf.c
753
n = n * 10 + ch - '0';
sys/kern/subr_prf.c
754
ch = *fmt;
sys/kern/subr_prf.c
755
if (ch < '0' || ch > '9')
sys/kern/subr_unit.c
1277
int ch;
sys/kern/subr_unit.c
1284
while ((ch = getopt(argc, argv, "hir:v")) != -1) {
sys/kern/subr_unit.c
1285
switch (ch) {
sys/kgssapi/gssd_prot.c
191
gss_channel_bindings_t ch;
sys/kgssapi/gssd_prot.c
196
ch = *chp;
sys/kgssapi/gssd_prot.c
197
if (ch) {
sys/kgssapi/gssd_prot.c
200
|| !xdr_uint32_t(xdrs, &ch->initiator_addrtype)
sys/kgssapi/gssd_prot.c
202
&ch->initiator_address)
sys/kgssapi/gssd_prot.c
203
|| !xdr_uint32_t(xdrs, &ch->acceptor_addrtype)
sys/kgssapi/gssd_prot.c
205
&ch->acceptor_address)
sys/kgssapi/gssd_prot.c
207
&ch->application_data))
sys/kgssapi/gssd_prot.c
222
ch = mem_alloc(sizeof(*ch));
sys/kgssapi/gssd_prot.c
223
memset(ch, 0, sizeof(*ch));
sys/kgssapi/gssd_prot.c
224
if (!xdr_uint32_t(xdrs, &ch->initiator_addrtype)
sys/kgssapi/gssd_prot.c
226
&ch->initiator_address)
sys/kgssapi/gssd_prot.c
227
|| !xdr_uint32_t(xdrs, &ch->acceptor_addrtype)
sys/kgssapi/gssd_prot.c
229
&ch->acceptor_address)
sys/kgssapi/gssd_prot.c
231
&ch->application_data)) {
sys/kgssapi/gssd_prot.c
232
mem_free(ch, sizeof(*ch));
sys/kgssapi/gssd_prot.c
235
*chp = ch;
sys/kgssapi/gssd_prot.c
240
ch = *chp;
sys/kgssapi/gssd_prot.c
241
if (ch) {
sys/kgssapi/gssd_prot.c
242
xdr_gss_buffer_desc(xdrs, &ch->initiator_address);
sys/kgssapi/gssd_prot.c
243
xdr_gss_buffer_desc(xdrs, &ch->acceptor_address);
sys/kgssapi/gssd_prot.c
244
xdr_gss_buffer_desc(xdrs, &ch->application_data);
sys/kgssapi/gssd_prot.c
245
mem_free(ch, sizeof(*ch));
sys/libkern/inet_pton.c
130
int ch, seen_xdigits;
sys/libkern/inet_pton.c
143
while ((ch = *src++) != '\0') {
sys/libkern/inet_pton.c
146
if ((pch = strchr((xdigits = xdigits_l), ch)) == NULL)
sys/libkern/inet_pton.c
147
pch = strchr((xdigits = xdigits_u), ch);
sys/libkern/inet_pton.c
155
if (ch == ':') {
sys/libkern/inet_pton.c
173
if (ch == '.' && ((tp + NS_INADDRSZ) <= endp) &&
sys/libkern/inet_pton.c
71
int saw_digit, octets, ch;
sys/libkern/inet_pton.c
78
while ((ch = *src++) != '\0') {
sys/libkern/inet_pton.c
81
if ((pch = strchr(digits, ch)) != NULL) {
sys/libkern/inet_pton.c
94
} else if (ch == '.' && saw_digit) {
sys/libkern/strchr.c
36
strchr(const char *cp, int ch)
sys/libkern/strchr.c
42
if (*p == ch)
sys/libkern/strchrnul.c
32
strchrnul(const char *p, int ch)
sys/libkern/strchrnul.c
35
for (; *p != 0 && *p != ch; p++)
sys/libkern/strrchr.c
36
strrchr(const char *cp, int ch)
sys/libkern/strrchr.c
42
if (*p == ch)
sys/net/debugnet.c
1034
switch ((ch = db_tok_string[0])) {
sys/net/debugnet.c
1036
DNETDEBUG("Unexpected: '%c'\n", ch);
sys/net/debugnet.c
1057
"flag %c, got %d\n", cmd, ch, t);
sys/net/debugnet.c
1098
"flag %c option; got %d\n", cmd, ch, t);
sys/net/debugnet.c
984
char ch;
sys/net80211/_ieee80211.h
464
struct ieee80211_mimo_chan_info ch[IEEE80211_MAX_CHAINS];
sys/net80211/ieee80211_node.c
1377
info->ch[i].rssi[0] = 0;
sys/net80211/ieee80211_node.c
1380
info->ch[i].rssi[0] = rssi < 0 ? 0 : rssi > 127 ? 127 : rssi;
sys/net80211/ieee80211_node.c
1382
info->ch[i].noise[0] = ni->ni_mimo_noise_ctl[i];
sys/netgraph/bluetooth/l2cap/ng_l2cap_cmds.c
120
ng_l2cap_l2ca_con_rsp(cmd->ch, cmd->token,
sys/netgraph/bluetooth/l2cap/ng_l2cap_cmds.c
122
ng_l2cap_free_chan(cmd->ch); /* will free commands */
sys/netgraph/bluetooth/l2cap/ng_l2cap_cmds.c
130
if (cmd->ch != NULL) {
sys/netgraph/bluetooth/l2cap/ng_l2cap_cmds.c
131
ng_l2cap_l2ca_con_rsp_rsp(cmd->ch, cmd->token,
sys/netgraph/bluetooth/l2cap/ng_l2cap_cmds.c
135
ng_l2cap_free_chan(cmd->ch);
sys/netgraph/bluetooth/l2cap/ng_l2cap_cmds.c
143
ng_l2cap_l2ca_cfg_rsp(cmd->ch, cmd->token,
sys/netgraph/bluetooth/l2cap/ng_l2cap_cmds.c
155
if (cmd->ch != NULL)
sys/netgraph/bluetooth/l2cap/ng_l2cap_cmds.c
156
ng_l2cap_l2ca_cfg_rsp_rsp(cmd->ch, cmd->token,
sys/netgraph/bluetooth/l2cap/ng_l2cap_cmds.c
164
ng_l2cap_l2ca_discon_rsp(cmd->ch, cmd->token,
sys/netgraph/bluetooth/l2cap/ng_l2cap_cmds.c
167
ng_l2cap_free_chan(cmd->ch); /* XXX free channel */
sys/netgraph/bluetooth/l2cap/ng_l2cap_cmds.c
200
if (cmd->ch->dcid == NG_L2CAP_CLT_CID) {
sys/netgraph/bluetooth/l2cap/ng_l2cap_cmds.c
206
htole16(cmd->ch->psm);
sys/netgraph/bluetooth/l2cap/ng_l2cap_cmds.c
210
error = ng_l2cap_lp_send(con, cmd->ch->dcid, m);
sys/netgraph/bluetooth/l2cap/ng_l2cap_cmds.c
212
ng_l2cap_l2ca_write_rsp(cmd->ch, cmd->token,
sys/netgraph/bluetooth/l2cap/ng_l2cap_cmds.c
246
ng_l2cap_chan_p ch = NULL;
sys/netgraph/bluetooth/l2cap/ng_l2cap_cmds.c
276
ng_l2cap_l2ca_con_rsp(cmd->ch, cmd->token, result, 0);
sys/netgraph/bluetooth/l2cap/ng_l2cap_cmds.c
280
if (cmd->ch != NULL)
sys/netgraph/bluetooth/l2cap/ng_l2cap_cmds.c
281
ng_l2cap_l2ca_con_rsp_rsp(cmd->ch, cmd->token,
sys/netgraph/bluetooth/l2cap/ng_l2cap_cmds.c
288
ng_l2cap_l2ca_discon_ind(cmd->ch);
sys/netgraph/bluetooth/l2cap/ng_l2cap_cmds.c
292
ng_l2cap_l2ca_discon_rsp(cmd->ch, cmd->token,
sys/netgraph/bluetooth/l2cap/ng_l2cap_cmds.c
315
if (cmd->ch != NULL)
sys/netgraph/bluetooth/l2cap/ng_l2cap_cmds.c
316
ng_l2cap_free_chan(cmd->ch);
sys/netgraph/bluetooth/l2cap/ng_l2cap_cmds.c
326
LIST_FOREACH(ch, &l2cap->chan_list, next)
sys/netgraph/bluetooth/l2cap/ng_l2cap_cmds.c
327
if (ch->con == con)
sys/netgraph/bluetooth/l2cap/ng_l2cap_cmds.c
328
ng_l2cap_l2ca_discon_ind(ch);
sys/netgraph/bluetooth/l2cap/ng_l2cap_cmds.c
376
ng_l2cap_l2ca_con_rsp(cmd->ch, cmd->token, NG_L2CAP_TIMEOUT, 0);
sys/netgraph/bluetooth/l2cap/ng_l2cap_cmds.c
377
ng_l2cap_free_chan(cmd->ch);
sys/netgraph/bluetooth/l2cap/ng_l2cap_cmds.c
381
ng_l2cap_l2ca_cfg_rsp(cmd->ch, cmd->token, NG_L2CAP_TIMEOUT);
sys/netgraph/bluetooth/l2cap/ng_l2cap_cmds.c
385
ng_l2cap_l2ca_discon_rsp(cmd->ch, cmd->token, NG_L2CAP_TIMEOUT);
sys/netgraph/bluetooth/l2cap/ng_l2cap_cmds.c
386
ng_l2cap_free_chan(cmd->ch); /* XXX free channel */
sys/netgraph/bluetooth/l2cap/ng_l2cap_evnt.c
1051
if (cmd->ch->state != NG_L2CAP_W4_L2CAP_DISCON_RSP) {
sys/netgraph/bluetooth/l2cap/ng_l2cap_evnt.c
1056
cmd->ch->state);
sys/netgraph/bluetooth/l2cap/ng_l2cap_evnt.c
1061
if (cmd->ch->scid != scid || cmd->ch->dcid != dcid) {
sys/netgraph/bluetooth/l2cap/ng_l2cap_evnt.c
1065
__func__, NG_NODE_NAME(l2cap->node), cmd->ch->scid,
sys/netgraph/bluetooth/l2cap/ng_l2cap_evnt.c
1066
scid, cmd->ch->dcid, dcid);
sys/netgraph/bluetooth/l2cap/ng_l2cap_evnt.c
1079
error = ng_l2cap_l2ca_discon_rsp(cmd->ch, cmd->token, NG_L2CAP_SUCCESS);
sys/netgraph/bluetooth/l2cap/ng_l2cap_evnt.c
1080
ng_l2cap_free_chan(cmd->ch); /* this will free commands too */
sys/netgraph/bluetooth/l2cap/ng_l2cap_evnt.c
409
ng_l2cap_l2ca_con_rsp(cmd->ch,cmd->token,cp->reason,0);
sys/netgraph/bluetooth/l2cap/ng_l2cap_evnt.c
410
ng_l2cap_free_chan(cmd->ch);
sys/netgraph/bluetooth/l2cap/ng_l2cap_evnt.c
414
ng_l2cap_l2ca_cfg_rsp(cmd->ch, cmd->token, cp->reason);
sys/netgraph/bluetooth/l2cap/ng_l2cap_evnt.c
418
ng_l2cap_l2ca_discon_rsp(cmd->ch,cmd->token,cp->reason);
sys/netgraph/bluetooth/l2cap/ng_l2cap_evnt.c
419
ng_l2cap_free_chan(cmd->ch); /* XXX free channel */
sys/netgraph/bluetooth/l2cap/ng_l2cap_evnt.c
461
ng_l2cap_chan_p ch = NULL;
sys/netgraph/bluetooth/l2cap/ng_l2cap_evnt.c
491
ch = ng_l2cap_new_chan(l2cap, con, psm, idtype);
sys/netgraph/bluetooth/l2cap/ng_l2cap_evnt.c
493
if (ch == NULL)
sys/netgraph/bluetooth/l2cap/ng_l2cap_evnt.c
498
ch->dcid = dcid;
sys/netgraph/bluetooth/l2cap/ng_l2cap_evnt.c
501
ch->ident = ident;
sys/netgraph/bluetooth/l2cap/ng_l2cap_evnt.c
502
ch->state = NG_L2CAP_W4_L2CA_CON_RSP;
sys/netgraph/bluetooth/l2cap/ng_l2cap_evnt.c
504
error = ng_l2cap_l2ca_con_ind(ch);
sys/netgraph/bluetooth/l2cap/ng_l2cap_evnt.c
506
send_l2cap_con_rej(con, ident, ch->scid, dcid,
sys/netgraph/bluetooth/l2cap/ng_l2cap_evnt.c
509
ng_l2cap_free_chan(ch);
sys/netgraph/bluetooth/l2cap/ng_l2cap_evnt.c
555
if (cmd->ch->state != NG_L2CAP_W4_L2CAP_CON_RSP) {
sys/netgraph/bluetooth/l2cap/ng_l2cap_evnt.c
560
cmd->ch->state);
sys/netgraph/bluetooth/l2cap/ng_l2cap_evnt.c
565
if (cmd->ch->scid != scid) {
sys/netgraph/bluetooth/l2cap/ng_l2cap_evnt.c
568
__func__, NG_NODE_NAME(l2cap->node), cmd->ch->scid,
sys/netgraph/bluetooth/l2cap/ng_l2cap_evnt.c
589
cmd->ch->dcid = dcid;
sys/netgraph/bluetooth/l2cap/ng_l2cap_evnt.c
592
error = ng_l2cap_l2ca_con_rsp(cmd->ch, cmd->token,
sys/netgraph/bluetooth/l2cap/ng_l2cap_evnt.c
595
ng_l2cap_free_chan(cmd->ch);
sys/netgraph/bluetooth/l2cap/ng_l2cap_evnt.c
607
cmd->ch->dcid = dcid;
sys/netgraph/bluetooth/l2cap/ng_l2cap_evnt.c
608
cmd->ch->state = ((cmd->ch->scid == NG_L2CAP_ATT_CID)||
sys/netgraph/bluetooth/l2cap/ng_l2cap_evnt.c
609
(cmd->ch->scid == NG_L2CAP_SMP_CID))
sys/netgraph/bluetooth/l2cap/ng_l2cap_evnt.c
619
error = ng_l2cap_l2ca_con_rsp(cmd->ch, cmd->token,
sys/netgraph/bluetooth/l2cap/ng_l2cap_evnt.c
624
ng_l2cap_free_chan(cmd->ch);
sys/netgraph/bluetooth/l2cap/ng_l2cap_evnt.c
648
ng_l2cap_chan_p ch = NULL;
sys/netgraph/bluetooth/l2cap/ng_l2cap_evnt.c
666
ch = ng_l2cap_chan_by_scid(l2cap, dcid, NG_L2CAP_L2CA_IDTYPE_BREDR);
sys/netgraph/bluetooth/l2cap/ng_l2cap_evnt.c
667
if (ch == NULL) {
sys/netgraph/bluetooth/l2cap/ng_l2cap_evnt.c
676
if (ch->state != NG_L2CAP_CONFIG && ch->state != NG_L2CAP_OPEN) {
sys/netgraph/bluetooth/l2cap/ng_l2cap_evnt.c
680
__func__, NG_NODE_NAME(l2cap->node), dcid, ch->state);
sys/netgraph/bluetooth/l2cap/ng_l2cap_evnt.c
684
if (ch->state == NG_L2CAP_OPEN) { /* Re-configuration */
sys/netgraph/bluetooth/l2cap/ng_l2cap_evnt.c
685
ch->cfg_state = 0;
sys/netgraph/bluetooth/l2cap/ng_l2cap_evnt.c
686
ch->state = NG_L2CAP_CONFIG;
sys/netgraph/bluetooth/l2cap/ng_l2cap_evnt.c
697
ch->omtu = val.mtu;
sys/netgraph/bluetooth/l2cap/ng_l2cap_evnt.c
701
ch->flush_timo = val.flush_timo;
sys/netgraph/bluetooth/l2cap/ng_l2cap_evnt.c
705
bcopy(&val.flow, &ch->iflow, sizeof(ch->iflow));
sys/netgraph/bluetooth/l2cap/ng_l2cap_evnt.c
747
error = send_l2cap_cfg_rsp(con, ident, ch->dcid, result, m);
sys/netgraph/bluetooth/l2cap/ng_l2cap_evnt.c
749
ng_l2cap_l2ca_discon_ind(ch);
sys/netgraph/bluetooth/l2cap/ng_l2cap_evnt.c
750
ng_l2cap_free_chan(ch);
sys/netgraph/bluetooth/l2cap/ng_l2cap_evnt.c
754
ch->ident = ident;
sys/netgraph/bluetooth/l2cap/ng_l2cap_evnt.c
755
error = ng_l2cap_l2ca_cfg_ind(ch);
sys/netgraph/bluetooth/l2cap/ng_l2cap_evnt.c
757
ng_l2cap_free_chan(ch);
sys/netgraph/bluetooth/l2cap/ng_l2cap_evnt.c
812
if (cmd->ch->scid != scid) {
sys/netgraph/bluetooth/l2cap/ng_l2cap_evnt.c
816
__func__, NG_NODE_NAME(l2cap->node), cmd->ch->scid,
sys/netgraph/bluetooth/l2cap/ng_l2cap_evnt.c
822
if (cmd->ch->state != NG_L2CAP_CONFIG) {
sys/netgraph/bluetooth/l2cap/ng_l2cap_evnt.c
826
__func__, NG_NODE_NAME(l2cap->node), cmd->ch->scid,
sys/netgraph/bluetooth/l2cap/ng_l2cap_evnt.c
827
cmd->ch->state);
sys/netgraph/bluetooth/l2cap/ng_l2cap_evnt.c
852
cmd->ch->imtu = val.mtu;
sys/netgraph/bluetooth/l2cap/ng_l2cap_evnt.c
856
cmd->ch->flush_timo = val.flush_timo;
sys/netgraph/bluetooth/l2cap/ng_l2cap_evnt.c
860
bcopy(&val.flow, &cmd->ch->oflow,
sys/netgraph/bluetooth/l2cap/ng_l2cap_evnt.c
861
sizeof(cmd->ch->oflow));
sys/netgraph/bluetooth/l2cap/ng_l2cap_evnt.c
895
error = ng_l2cap_l2ca_cfg_rsp(cmd->ch, cmd->token, result);
sys/netgraph/bluetooth/l2cap/ng_l2cap_evnt.c
908
ng_l2cap_free_chan(cmd->ch);
sys/netgraph/bluetooth/l2cap/ng_l2cap_evnt.c
934
ng_l2cap_chan_p ch = NULL;
sys/netgraph/bluetooth/l2cap/ng_l2cap_evnt.c
950
ch = ng_l2cap_chan_by_scid(l2cap, dcid, NG_L2CAP_L2CA_IDTYPE_BREDR);
sys/netgraph/bluetooth/l2cap/ng_l2cap_evnt.c
951
if (ch == NULL) {
sys/netgraph/bluetooth/l2cap/ng_l2cap_evnt.c
960
if (ch->state != NG_L2CAP_OPEN && ch->state != NG_L2CAP_CONFIG &&
sys/netgraph/bluetooth/l2cap/ng_l2cap_evnt.c
961
ch->state != NG_L2CAP_W4_L2CAP_DISCON_RSP) {
sys/netgraph/bluetooth/l2cap/ng_l2cap_evnt.c
965
__func__, NG_NODE_NAME(l2cap->node), dcid, ch->state);
sys/netgraph/bluetooth/l2cap/ng_l2cap_evnt.c
970
if (ch->dcid != scid || ch->scid != dcid) {
sys/netgraph/bluetooth/l2cap/ng_l2cap_evnt.c
975
__func__, NG_NODE_NAME(l2cap->node), ch->scid, ch->dcid,
sys/netgraph/bluetooth/l2cap/ng_l2cap_evnt.c
986
if (ch->state != NG_L2CAP_W4_L2CAP_DISCON_RSP) {
sys/netgraph/bluetooth/l2cap/ng_l2cap_evnt.c
987
ng_l2cap_l2ca_discon_ind(ch); /* do not care about result */
sys/netgraph/bluetooth/l2cap/ng_l2cap_evnt.c
988
ng_l2cap_free_chan(ch);
sys/netgraph/bluetooth/l2cap/ng_l2cap_llpi.c
491
ng_l2cap_chan_p ch = NULL;
sys/netgraph/bluetooth/l2cap/ng_l2cap_llpi.c
527
LIST_FOREACH(ch, &l2cap->chan_list, next){
sys/netgraph/bluetooth/l2cap/ng_l2cap_llpi.c
528
if((ch->con->con_handle == ep->con_handle) &&
sys/netgraph/bluetooth/l2cap/ng_l2cap_llpi.c
529
(ch->con->linktype == ep->link_type))
sys/netgraph/bluetooth/l2cap/ng_l2cap_llpi.c
530
ng_l2cap_l2ca_encryption_change(ch, ep->status);
sys/netgraph/bluetooth/l2cap/ng_l2cap_main.c
598
ng_l2cap_chan_p ch = NULL;
sys/netgraph/bluetooth/l2cap/ng_l2cap_main.c
604
LIST_FOREACH(ch, &l2cap->chan_list, next)
sys/netgraph/bluetooth/l2cap/ng_l2cap_main.c
623
LIST_FOREACH(ch, &l2cap->chan_list, next) {
sys/netgraph/bluetooth/l2cap/ng_l2cap_main.c
624
e2->state = ch->state;
sys/netgraph/bluetooth/l2cap/ng_l2cap_main.c
626
e2->scid = ch->scid;
sys/netgraph/bluetooth/l2cap/ng_l2cap_main.c
627
e2->dcid = ch->dcid;
sys/netgraph/bluetooth/l2cap/ng_l2cap_main.c
629
e2->imtu = ch->imtu;
sys/netgraph/bluetooth/l2cap/ng_l2cap_main.c
630
e2->omtu = ch->omtu;
sys/netgraph/bluetooth/l2cap/ng_l2cap_main.c
632
e2->psm = ch->psm;
sys/netgraph/bluetooth/l2cap/ng_l2cap_main.c
633
bcopy(&ch->con->remote, &e2->remote,
sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.c
336
ng_l2cap_chan_p ch = NULL;
sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.c
338
ch = malloc(sizeof(*ch), M_NETGRAPH_L2CAP,
sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.c
340
if (ch == NULL)
sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.c
343
ch->scid = ch->dcid = NG_L2CAP_ATT_CID;
sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.c
345
ch->scid = ch->dcid = NG_L2CAP_SMP_CID;
sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.c
347
ch->scid = ng_l2cap_get_cid(l2cap,
sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.c
351
ch->idtype = idtype;
sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.c
352
if (ch->scid != NG_L2CAP_NULL_CID) {
sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.c
354
ch->psm = psm;
sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.c
355
ch->con = con;
sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.c
356
ch->state = NG_L2CAP_CLOSED;
sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.c
359
ch->imtu = NG_L2CAP_MTU_DEFAULT;
sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.c
360
bcopy(ng_l2cap_default_flow(), &ch->iflow, sizeof(ch->iflow));
sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.c
362
ch->omtu = NG_L2CAP_MTU_DEFAULT;
sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.c
363
bcopy(ng_l2cap_default_flow(), &ch->oflow, sizeof(ch->oflow));
sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.c
365
ch->flush_timo = NG_L2CAP_FLUSH_TIMO_DEFAULT;
sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.c
366
ch->link_timo = NG_L2CAP_LINK_TIMO_DEFAULT;
sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.c
368
LIST_INSERT_HEAD(&l2cap->chan_list, ch, next);
sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.c
372
bzero(ch, sizeof(*ch));
sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.c
373
free(ch, M_NETGRAPH_L2CAP);
sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.c
374
ch = NULL;
sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.c
377
return (ch);
sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.c
383
ng_l2cap_chan_p ch = NULL;
sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.c
390
LIST_FOREACH(ch, &l2cap->chan_list, next){
sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.c
392
(ch->con->linktype == NG_HCI_LINK_ACL ))
sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.c
395
(ch->con->linktype != NG_HCI_LINK_ACL ))
sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.c
397
if (ch->scid == scid)
sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.c
400
return (ch);
sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.c
407
ng_l2cap_chan_p ch = NULL;
sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.c
409
LIST_FOREACH(ch, &l2cap->chan_list, next){
sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.c
410
if ((ch->scid == scid) &&
sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.c
411
(ch->con->con_handle == con_handle))
sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.c
414
return (ch);
sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.c
422
ng_l2cap_free_chan(ng_l2cap_chan_p ch)
sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.c
426
f = TAILQ_FIRST(&ch->con->cmd_list);
sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.c
431
if (f->ch == ch) {
sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.c
441
LIST_REMOVE(ch, next);
sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.c
443
ng_l2cap_con_unref(ch->con);
sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.c
445
bzero(ch, sizeof(*ch));
sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.c
446
free(ch, M_NETGRAPH_L2CAP);
sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.c
454
ng_l2cap_new_cmd(ng_l2cap_con_p con, ng_l2cap_chan_p ch, u_int8_t ident,
sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.c
459
KASSERT((ch == NULL || ch->con == con),
sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.c
469
cmd->ch = ch;
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
1008
ch = ng_l2cap_chan_by_conhandle(l2cap, NG_L2CAP_ATT_CID,
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
1018
ch = ng_l2cap_chan_by_conhandle(l2cap, NG_L2CAP_SMP_CID,
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
1030
ch = ng_l2cap_chan_by_scid(l2cap, hdr->dcid, idtype);
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
1032
if (ch == NULL) {
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
1042
if (ch->state != NG_L2CAP_OPEN) {
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
1046
__func__, NG_NODE_NAME(l2cap->node), ch->scid,
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
1047
ch->state);
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
1053
if (hdr->length > ch->imtu) {
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
1058
ch->imtu, ch->scid);
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
107
ch = ng_l2cap_new_chan(l2cap, con, ip->psm, ip->idtype);
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
1073
__func__, NG_NODE_NAME(l2cap->node), ch->psm);
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
108
if (ch == NULL) {
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
114
cmd = ng_l2cap_new_cmd(ch->con, ch, ng_l2cap_get_ident(con),
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
117
ng_l2cap_free_chan(ch);
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
1180
ng_l2cap_l2ca_qos_ind(ng_l2cap_chan_p ch)
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
1182
ng_l2cap_p l2cap = ch->con->l2cap;
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
1192
__func__, NG_NODE_NAME(l2cap->node), ch->psm);
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
1204
bcopy(&ch->con->remote, &ip->bdaddr, sizeof(ip->bdaddr));
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
1219
ng_l2cap_chan_p ch = NULL;
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
1237
ch = ng_l2cap_chan_by_conhandle(l2cap, NG_L2CAP_ATT_CID,
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
124
ng_l2cap_free_chan(ch);
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
1240
if(ch != NULL){
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
1241
ng_l2cap_free_chan(ch);
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
1252
ch = ng_l2cap_chan_by_conhandle(l2cap, NG_L2CAP_SMP_CID,
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
1255
if(ch != NULL){
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
1256
ng_l2cap_free_chan(ch);
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
1267
ch = ng_l2cap_chan_by_scid(l2cap, ip->lcid, ip->idtype);
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
1269
if (ch == NULL) {
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
1279
if (ch->state != NG_L2CAP_CONFIG && ch->state != NG_L2CAP_OPEN &&
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
1280
ch->state != NG_L2CAP_W4_L2CAP_DISCON_RSP) {
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
1284
__func__, NG_NODE_NAME(l2cap->node), ch->state,
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
1285
ch->scid);
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
1291
cmd = ng_l2cap_new_cmd(ch->con, ch, ng_l2cap_get_ident(ch->con),
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
1294
ng_l2cap_free_chan(ch);
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
1300
ng_l2cap_free_chan(ch);
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
1306
_ng_l2cap_discon_req(cmd->aux, cmd->ident, ch->dcid, ch->scid);
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
1308
ng_l2cap_free_chan(ch);
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
1314
ch->state = NG_L2CAP_W4_L2CAP_DISCON_RSP;
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
1317
ng_l2cap_link_cmd(ch->con, cmd);
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
1318
ng_l2cap_lp_deliver(ch->con);
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
1328
ng_l2cap_l2ca_discon_rsp(ng_l2cap_chan_p ch, u_int32_t token, u_int16_t result)
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
1330
ng_l2cap_p l2cap = ch->con->l2cap;
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
1340
__func__, NG_NODE_NAME(l2cap->node), ch->psm);
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
1368
ng_l2cap_l2ca_discon_ind(ng_l2cap_chan_p ch)
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
1370
ng_l2cap_p l2cap = ch->con->l2cap;
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
1380
__func__, NG_NODE_NAME(l2cap->node), ch->psm);
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
139
_ng_l2cap_con_req(cmd->aux, cmd->ident, ch->psm, ch->scid);
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
1392
ip->idtype = ch->idtype;
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
1393
if(ch->idtype == NG_L2CAP_L2CA_IDTYPE_ATT||
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
1394
ch->idtype == NG_L2CAP_L2CA_IDTYPE_SMP)
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
1395
ip->lcid = ch->con->con_handle;
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
1397
ip->lcid = ch->scid;
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
143
ng_l2cap_free_chan(ch);
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
1444
ng_l2cap_l2ca_grp_add_member_rsp(ng_l2cap_chan_p ch, u_int32_t token,
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
148
ch->state = NG_L2CAP_W4_L2CAP_CON_RSP;
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
151
ng_l2cap_link_cmd(ch->con, cmd);
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
152
ng_l2cap_lp_deliver(ch->con);
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
162
ng_l2cap_l2ca_con_rsp(ng_l2cap_chan_p ch, u_int32_t token, u_int16_t result,
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
165
ng_l2cap_p l2cap = ch->con->l2cap;
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
175
__func__, NG_NODE_NAME(l2cap->node), ch->psm);
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
196
if(ch->scid == NG_L2CAP_ATT_CID){
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
198
op->lcid = ch->con->con_handle;
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
199
}else if(ch->scid == NG_L2CAP_SMP_CID){
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
201
op->lcid = ch->con->con_handle;
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
203
op->idtype = (ch->con->linktype == NG_HCI_LINK_ACL)?
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
206
op->lcid = ch->scid;
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
208
op->encryption = ch->con->encryption;
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
227
ng_l2cap_chan_p ch = NULL;
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
247
ch = ng_l2cap_chan_by_scid(l2cap, ip->lcid
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
253
ch = NULL;
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
255
if (ch == NULL) {
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
265
if (ch->state != NG_L2CAP_W4_L2CA_CON_RSP) {
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
269
__func__, NG_NODE_NAME(l2cap->node), ch->state,
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
275
dcid = ch->dcid;
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
276
con = ch->con;
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
283
if (ch->ident != ip->ident)
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
287
__func__, NG_NODE_NAME(l2cap->node), ch->scid,
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
288
ch->ident, ip->ident);
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
293
ch->state = ((ch->scid == NG_L2CAP_ATT_CID)||
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
294
(ch->scid == NG_L2CAP_SMP_CID))?
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
296
ch->cfg_state = 0;
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
303
ng_l2cap_free_chan(ch);
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
304
ch = NULL;
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
309
cmd = ng_l2cap_new_cmd(con, ch, ip->ident, NG_L2CAP_CON_RSP,
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
312
if (ch != NULL)
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
313
ng_l2cap_free_chan(ch);
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
322
if (ch != NULL)
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
323
ng_l2cap_free_chan(ch);
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
337
int ng_l2cap_l2ca_encryption_change(ng_l2cap_chan_p ch, uint16_t result)
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
339
ng_l2cap_p l2cap = ch->con->l2cap;
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
349
__func__, NG_NODE_NAME(l2cap->node), ch->psm);
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
365
if(ch->scid ==NG_L2CAP_ATT_CID||
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
366
ch->scid ==NG_L2CAP_SMP_CID){
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
367
op->lcid = ch->con->con_handle;
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
368
op->idtype = (ch->scid==NG_L2CAP_ATT_CID)?
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
372
op->idtype =(ch->con->linktype ==NG_HCI_LINK_ACL)?
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
389
ng_l2cap_l2ca_con_rsp_rsp(ng_l2cap_chan_p ch, u_int32_t token, u_int16_t result)
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
391
ng_l2cap_p l2cap = ch->con->l2cap;
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
401
__func__, NG_NODE_NAME(l2cap->node), ch->psm);
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
429
ng_l2cap_l2ca_con_ind(ng_l2cap_chan_p ch)
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
431
ng_l2cap_p l2cap = ch->con->l2cap;
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
441
__func__, NG_NODE_NAME(l2cap->node), ch->psm);
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
454
bcopy(&ch->con->remote, &ip->bdaddr, sizeof(ip->bdaddr));
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
455
ip->lcid = ch->scid;
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
456
ip->psm = ch->psm;
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
457
ip->ident = ch->ident;
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
458
ip->linktype = ch->con->linktype;
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
474
ng_l2cap_chan_p ch = NULL;
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
494
ch = ng_l2cap_chan_by_scid(l2cap, ip->lcid, NG_L2CAP_L2CA_IDTYPE_BREDR);
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
495
if (ch == NULL) {
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
505
if (ch->state != NG_L2CAP_OPEN && ch->state != NG_L2CAP_CONFIG) {
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
509
__func__, NG_NODE_NAME(l2cap->node), ch->state,
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
510
ch->scid);
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
516
ch->imtu = ip->imtu;
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
517
bcopy(&ip->oflow, &ch->oflow, sizeof(ch->oflow));
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
518
ch->flush_timo = ip->flush_timo;
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
519
ch->link_timo = ip->link_timo;
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
522
if (ch->imtu != NG_L2CAP_MTU_DEFAULT)
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
523
mtu = &ch->imtu;
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
524
if (ch->flush_timo != NG_L2CAP_FLUSH_TIMO_DEFAULT)
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
525
flush_timo = &ch->flush_timo;
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
526
if (bcmp(ng_l2cap_default_flow(), &ch->oflow, sizeof(ch->oflow)) != 0)
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
527
flow = &ch->oflow;
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
537
cmd = ng_l2cap_new_cmd(ch->con, ch, ng_l2cap_get_ident(ch->con),
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
553
_ng_l2cap_cfg_req(cmd->aux, cmd->ident, ch->dcid, 0, opt);
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
561
if (ch->state == NG_L2CAP_OPEN) {
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
562
ch->state = ((ch->scid == NG_L2CAP_ATT_CID)||
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
563
(ch->scid == NG_L2CAP_SMP_CID))?
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
565
ch->cfg_state = 0;
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
569
ng_l2cap_link_cmd(ch->con, cmd);
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
570
ng_l2cap_lp_deliver(ch->con);
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
580
ng_l2cap_l2ca_cfg_rsp(ng_l2cap_chan_p ch, u_int32_t token, u_int16_t result)
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
582
ng_l2cap_p l2cap = ch->con->l2cap;
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
592
__func__, NG_NODE_NAME(l2cap->node), ch->psm);
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
608
op->imtu = ch->imtu;
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
609
bcopy(&ch->oflow, &op->oflow, sizeof(op->oflow));
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
610
op->flush_timo = ch->flush_timo;
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
615
ch->cfg_state |= NG_L2CAP_CFG_IN;
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
617
if (ch->cfg_state == NG_L2CAP_CFG_BOTH)
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
618
ch->state = NG_L2CAP_OPEN;
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
646
ng_l2cap_chan_p ch = NULL;
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
666
ch = ng_l2cap_chan_by_scid(l2cap, ip->lcid,
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
668
if (ch == NULL) {
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
678
if (ch->state != NG_L2CAP_CONFIG) {
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
68
ng_l2cap_chan_p ch = NULL;
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
682
__func__, NG_NODE_NAME(l2cap->node), ch->state,
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
683
ch->scid);
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
689
if (ip->omtu != ch->omtu) {
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
690
ch->omtu = ip->omtu;
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
691
mtu = &ch->omtu;
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
694
if (bcmp(&ip->iflow, &ch->iflow, sizeof(ch->iflow)) != 0) {
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
695
bcopy(&ip->iflow, &ch->iflow, sizeof(ch->iflow));
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
696
flow = &ch->iflow;
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
708
cmd = ng_l2cap_new_cmd(ch->con, ch, ch->ident, NG_L2CAP_CFG_RSP,
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
716
_ng_l2cap_cfg_rsp(cmd->aux,cmd->ident,ch->dcid,0,NG_L2CAP_SUCCESS,opt);
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
724
ch->cfg_state |= NG_L2CAP_CFG_OUT;
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
725
if (ch->cfg_state == NG_L2CAP_CFG_BOTH)
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
726
ch->state = NG_L2CAP_OPEN;
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
729
ng_l2cap_link_cmd(ch->con, cmd);
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
730
ng_l2cap_lp_deliver(ch->con);
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
740
ng_l2cap_l2ca_cfg_rsp_rsp(ng_l2cap_chan_p ch, u_int32_t token, u_int16_t result)
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
742
ng_l2cap_p l2cap = ch->con->l2cap;
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
752
__func__, NG_NODE_NAME(l2cap->node), ch->psm);
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
793
ng_l2cap_l2ca_cfg_ind(ng_l2cap_chan_p ch)
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
795
ng_l2cap_p l2cap = ch->con->l2cap;
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
805
__func__, NG_NODE_NAME(l2cap->node), ch->psm);
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
817
ip->lcid = ch->scid;
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
818
ip->omtu = ch->omtu;
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
819
bcopy(&ch->iflow, &ip->iflow, sizeof(ip->iflow));
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
820
ip->flush_timo = ch->flush_timo;
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
836
ng_l2cap_chan_p ch = NULL;
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
872
ch = ng_l2cap_chan_by_conhandle(l2cap, NG_L2CAP_ATT_CID,
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
875
ch = ng_l2cap_chan_by_conhandle(l2cap, NG_L2CAP_SMP_CID,
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
888
ch = ng_l2cap_chan_by_scid(l2cap, l2ca_hdr->lcid,
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
892
if (ch == NULL) {
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
900
if (ch->state != NG_L2CAP_OPEN) {
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
903
__func__, NG_NODE_NAME(l2cap->node), ch->scid,
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
904
ch->state);
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
910
cmd = ng_l2cap_new_cmd(ch->con, ch, 0, NGM_L2CAP_L2CA_WRITE, token);
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
918
ng_l2cap_link_cmd(ch->con, cmd);
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
919
ng_l2cap_lp_deliver(ch->con);
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
933
ng_l2cap_l2ca_write_rsp(ng_l2cap_chan_p ch, u_int32_t token, u_int16_t result,
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
936
ng_l2cap_p l2cap = ch->con->l2cap;
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
946
__func__, NG_NODE_NAME(l2cap->node), ch->psm);
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
963
if(ch->scid == NG_L2CAP_ATT_CID){
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
965
op->lcid = ch->con->con_handle;
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
966
}else if(ch->scid == NG_L2CAP_SMP_CID){
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
968
op->lcid = ch->con->con_handle;
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
970
op->idtype = (ch->con->linktype == NG_HCI_LINK_ACL)?
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
973
op->lcid = ch->scid;
sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
992
ng_l2cap_chan_p ch = NULL;
sys/netgraph/bluetooth/l2cap/ng_l2cap_var.h
177
ng_l2cap_chan_p ch; /* L2CAP channel */
sys/netgraph/ng_async.c
505
u_char ch = *mtod(m, u_char *);
sys/netgraph/ng_async.c
508
if (ch == PPP_FLAG) { /* Flag overrides everything */
sys/netgraph/ng_async.c
557
if (ch == PPP_ESCAPE) {
sys/netgraph/ng_async.c
563
ch ^= PPP_TRANS;
sys/netgraph/ng_async.c
577
sc->sbuf[sc->slen++] = ch;
sys/netgraph/ng_async.c
578
sc->fcs = PPP_FCS(sc->fcs, ch);
sys/netgraph/ng_cisco.c
595
struct cisco_packet *ch;
sys/netgraph/ng_cisco.c
616
ch = (struct cisco_packet *) (h + 1);
sys/netgraph/ng_cisco.c
617
ch->type = htonl(type);
sys/netgraph/ng_cisco.c
618
ch->par1 = htonl(par1);
sys/netgraph/ng_cisco.c
619
ch->par2 = htonl(par2);
sys/netgraph/ng_cisco.c
620
ch->rel = -1;
sys/netgraph/ng_cisco.c
621
ch->time0 = htons((uint16_t) (t >> 16));
sys/netgraph/ng_cisco.c
622
ch->time1 = htons((uint16_t) t);
sys/netinet/ip_carp.c
1058
carp_prepare_ad(struct mbuf *m, struct carp_softc *sc, struct carp_header *ch)
sys/netinet/ip_carp.c
1071
ch->carp_counter[0] = htonl((sc->sc_counter>>32)&0xffffffff);
sys/netinet/ip_carp.c
1072
ch->carp_counter[1] = htonl(sc->sc_counter&0xffffffff);
sys/netinet/ip_carp.c
1074
carp_hmac_generate(sc, ch->carp_counter, ch->carp_md);
sys/netinet/ip_carp.c
1199
struct carp_header ch;
sys/netinet/ip_carp.c
1214
ch.carp_version = CARP_VERSION_CARP;
sys/netinet/ip_carp.c
1215
ch.carp_type = CARP_ADVERTISEMENT;
sys/netinet/ip_carp.c
1216
ch.carp_vhid = sc->sc_vhid;
sys/netinet/ip_carp.c
1217
ch.carp_advbase = sc->sc_advbase;
sys/netinet/ip_carp.c
1218
ch.carp_advskew = advskew;
sys/netinet/ip_carp.c
1219
ch.carp_authlen = 7; /* XXX DEFINE */
sys/netinet/ip_carp.c
1220
ch.carp_pad1 = 0; /* must be zero */
sys/netinet/ip_carp.c
1221
ch.carp_cksum = 0;
sys/netinet/ip_carp.c
1234
len = sizeof(*ip) + sizeof(ch);
sys/netinet/ip_carp.c
1262
bcopy(&ch, ch_ptr, sizeof(ch));
sys/netinet/ip_carp.c
1287
len = sizeof(*ip6) + sizeof(ch);
sys/netinet/ip_carp.c
1324
bcopy(&ch, ch_ptr, sizeof(ch));
sys/netinet/ip_carp.c
585
struct carp_header *ch;
sys/netinet/ip_carp.c
595
ch = (struct carp_header *)((char *)ip + iplen);
sys/netinet/ip_carp.c
596
carp_input_c(m, ch, AF_INET, ip->ip_ttl);
sys/netinet/ip_carp.c
691
struct carp_header *ch;
sys/netinet/ip_carp.c
702
ch = (struct carp_header *)((char *)ip6 + sizeof(*ip6));
sys/netinet/ip_carp.c
703
carp_input_c(m, ch, AF_INET6, ip6->ip6_hlim);
sys/netinet/ip_carp.c
815
carp_input_c(struct mbuf *m, struct carp_header *ch, sa_family_t af, int ttl)
sys/netinet/ip_carp.c
825
MPASS(ch->carp_version == CARP_VERSION_CARP);
sys/netinet/ip_carp.c
827
ifa = carp_find_ifa(m, af, ch->carp_vhid);
sys/netinet/ip_carp.c
842
ch->carp_version);
sys/netinet/ip_carp.c
863
if (carp_hmac_verify(sc, ch->carp_counter, ch->carp_md)) {
sys/netinet/ip_carp.c
870
tmp_counter = ntohl(ch->carp_counter[0]);
sys/netinet/ip_carp.c
872
tmp_counter += ntohl(ch->carp_counter[1]);
sys/netinet/ip_carp.c
881
ch_tv.tv_sec = ch->carp_advbase;
sys/netinet/ip_carp.c
882
ch_tv.tv_usec = ch->carp_advskew * 1000000 / 256;
sys/netinet/ip_icmp.c
286
struct sctp_chunkhdr *ch;
sys/netinet/ip_icmp.c
311
ch = (struct sctp_chunkhdr *)(sh + 1);
sys/netinet/ip_icmp.c
312
if (ch->chunk_type == SCTP_INITIATION) {
sys/netinet/libalias/alias_ftp.c
331
char ch;
sys/netinet/libalias/alias_ftp.c
349
ch = sptr[i];
sys/netinet/libalias/alias_ftp.c
352
if (isspace(ch))
sys/netinet/libalias/alias_ftp.c
362
if (isdigit(ch)) {
sys/netinet/libalias/alias_ftp.c
363
octet = ch - '0';
sys/netinet/libalias/alias_ftp.c
372
if (isdigit(ch))
sys/netinet/libalias/alias_ftp.c
373
octet = 10 * octet + ch - '0';
sys/netinet/libalias/alias_ftp.c
374
else if (ch == ',') {
sys/netinet/libalias/alias_ftp.c
382
if (isdigit(ch))
sys/netinet/libalias/alias_ftp.c
383
octet = 10 * octet + ch - '0';
sys/netinet/libalias/alias_ftp.c
384
else if (ch == ',' || state == 12) {
sys/netinet/libalias/alias_ftp.c
404
char ch, delim;
sys/netinet/libalias/alias_ftp.c
423
ch = sptr[i];
sys/netinet/libalias/alias_ftp.c
426
if (!isspace(ch)) {
sys/netinet/libalias/alias_ftp.c
427
delim = ch;
sys/netinet/libalias/alias_ftp.c
432
if (ch == '1') /* IPv4 address */
sys/netinet/libalias/alias_ftp.c
438
if (ch == delim)
sys/netinet/libalias/alias_ftp.c
447
if (isdigit(ch)) {
sys/netinet/libalias/alias_ftp.c
448
octet = ch - '0';
sys/netinet/libalias/alias_ftp.c
457
if (isdigit(ch))
sys/netinet/libalias/alias_ftp.c
458
octet = 10 * octet + ch - '0';
sys/netinet/libalias/alias_ftp.c
459
else if (ch == '.' || state == 10) {
sys/netinet/libalias/alias_ftp.c
466
if (isdigit(ch)) {
sys/netinet/libalias/alias_ftp.c
467
port = ch - '0';
sys/netinet/libalias/alias_ftp.c
473
if (isdigit(ch))
sys/netinet/libalias/alias_ftp.c
474
port = 10 * port + ch - '0';
sys/netinet/libalias/alias_ftp.c
475
else if (ch == delim)
sys/netinet/libalias/alias_ftp.c
494
char ch;
sys/netinet/libalias/alias_ftp.c
513
ch = sptr[i];
sys/netinet/libalias/alias_ftp.c
516
if (ch == '(')
sys/netinet/libalias/alias_ftp.c
525
if (isdigit(ch)) {
sys/netinet/libalias/alias_ftp.c
526
octet = ch - '0';
sys/netinet/libalias/alias_ftp.c
535
if (isdigit(ch))
sys/netinet/libalias/alias_ftp.c
536
octet = 10 * octet + ch - '0';
sys/netinet/libalias/alias_ftp.c
537
else if (ch == ',') {
sys/netinet/libalias/alias_ftp.c
545
if (isdigit(ch))
sys/netinet/libalias/alias_ftp.c
546
octet = 10 * octet + ch - '0';
sys/netinet/libalias/alias_ftp.c
547
else if (ch == ',' || (state == 12 && ch == ')')) {
sys/netinet/libalias/alias_ftp.c
567
char ch, delim;
sys/netinet/libalias/alias_ftp.c
585
ch = sptr[i];
sys/netinet/libalias/alias_ftp.c
588
if (ch == '(')
sys/netinet/libalias/alias_ftp.c
592
delim = ch;
sys/netinet/libalias/alias_ftp.c
597
if (ch == delim)
sys/netinet/libalias/alias_ftp.c
603
if (isdigit(ch)) {
sys/netinet/libalias/alias_ftp.c
604
port = ch - '0';
sys/netinet/libalias/alias_ftp.c
610
if (isdigit(ch))
sys/netinet/libalias/alias_ftp.c
611
port = 10 * port + ch - '0';
sys/netinet/libalias/alias_ftp.c
612
else if (ch == delim)
sys/netinet/libalias/alias_ftp.c
618
if (ch == ')')
sys/netinet/sctp.h
424
struct sctp_chunkhdr ch; /* header from chunk in error */
sys/netinet/sctp_asconf.c
1676
if (ntohs(cp->ch.chunk_length) < sizeof(struct sctp_asconf_ack_chunk)) {
sys/netinet/sctp_asconf.c
1679
ntohs(cp->ch.chunk_length));
sys/netinet/sctp_asconf.c
1722
ack_length = ntohs(cp->ch.chunk_length) -
sys/netinet/sctp_asconf.c
2346
asconf_limit = ntohs(acp->ch.chunk_length);
sys/netinet/sctp_asconf.c
2617
acp->ch.chunk_type = SCTP_ASCONF;
sys/netinet/sctp_asconf.c
2618
acp->ch.chunk_flags = 0;
sys/netinet/sctp_asconf.c
2751
acp->ch.chunk_length = htons(*retlen);
sys/netinet/sctp_asconf.c
622
if (ntohs(cp->ch.chunk_length) < sizeof(struct sctp_asconf_chunk)) {
sys/netinet/sctp_asconf.c
625
ntohs(cp->ch.chunk_length));
sys/netinet/sctp_asconf.c
646
asconf_limit = offset + ntohs(cp->ch.chunk_length);
sys/netinet/sctp_asconf.c
679
ack_cp->ch.chunk_type = SCTP_ASCONF_ACK;
sys/netinet/sctp_asconf.c
680
ack_cp->ch.chunk_flags = 0;
sys/netinet/sctp_asconf.c
684
ack_cp->ch.chunk_length = sizeof(struct sctp_asconf_ack_chunk);
sys/netinet/sctp_asconf.c
782
ack_cp->ch.chunk_length += SCTP_BUF_LEN(m_result);
sys/netinet/sctp_asconf.c
804
ack_cp->ch.chunk_length = htons(ack_cp->ch.chunk_length);
sys/netinet/sctp_auth.c
1599
chunklen = ntohs(auth->ch.chunk_length);
sys/netinet/sctp_auth.h
211
sctp_handle_auth(struct sctp_tcb *stcb, struct sctp_auth_chunk *ch,
sys/netinet/sctp_header.h
144
struct sctp_chunkhdr ch;
sys/netinet/sctp_header.h
161
struct sctp_chunkhdr ch;
sys/netinet/sctp_header.h
222
struct sctp_chunkhdr ch;
sys/netinet/sctp_header.h
252
struct sctp_chunkhdr ch;
sys/netinet/sctp_header.h
268
struct sctp_chunkhdr ch;
sys/netinet/sctp_header.h
278
struct sctp_chunkhdr ch;
sys/netinet/sctp_header.h
288
struct sctp_chunkhdr ch;
sys/netinet/sctp_header.h
299
struct sctp_chunkhdr ch;
sys/netinet/sctp_header.h
305
struct sctp_chunkhdr ch;
sys/netinet/sctp_header.h
310
struct sctp_chunkhdr ch;
sys/netinet/sctp_header.h
316
struct sctp_chunkhdr ch;
sys/netinet/sctp_header.h
322
struct sctp_chunkhdr ch;
sys/netinet/sctp_header.h
327
struct sctp_chunkhdr ch;
sys/netinet/sctp_header.h
332
struct sctp_chunkhdr ch;
sys/netinet/sctp_header.h
339
struct sctp_chunkhdr ch;
sys/netinet/sctp_header.h
345
struct sctp_chunkhdr ch;
sys/netinet/sctp_header.h
358
struct sctp_chunkhdr ch;
sys/netinet/sctp_header.h
366
struct sctp_chunkhdr ch;
sys/netinet/sctp_header.h
374
struct sctp_chunkhdr ch;
sys/netinet/sctp_header.h
406
struct sctp_chunkhdr ch;
sys/netinet/sctp_header.h
475
struct sctp_chunkhdr ch;
sys/netinet/sctp_header.h
480
struct sctp_chunkhdr ch;
sys/netinet/sctp_header.h
486
struct sctp_chunkhdr ch;
sys/netinet/sctp_header.h
514
struct sctp_chunkhdr ch;
sys/netinet/sctp_indata.c
1704
chk_flags = chunk->ch.chunk_flags;
sys/netinet/sctp_indata.c
1721
chk_flags = chunk->ch.chunk_flags;
sys/netinet/sctp_indata.c
2641
struct sctp_chunkhdr *ch, chunk_buf;
sys/netinet/sctp_indata.c
2699
ch = (struct sctp_chunkhdr *)sctp_m_getptr(m, *offset,
sys/netinet/sctp_indata.c
2702
if (ch == NULL) {
sys/netinet/sctp_indata.c
2713
chk_length = ntohs(ch->chunk_length);
sys/netinet/sctp_indata.c
2720
(ch->chunk_type == SCTP_DATA)) {
sys/netinet/sctp_indata.c
2731
(ch->chunk_type == SCTP_IDATA)) {
sys/netinet/sctp_indata.c
2741
if ((ch->chunk_type == SCTP_DATA) ||
sys/netinet/sctp_indata.c
2742
(ch->chunk_type == SCTP_IDATA)) {
sys/netinet/sctp_indata.c
2745
if (ch->chunk_type == SCTP_DATA) {
sys/netinet/sctp_indata.c
2759
ch->chunk_type == SCTP_DATA ? "DATA" : "I-DATA",
sys/netinet/sctp_indata.c
2776
last_chunk, ch->chunk_type)) {
sys/netinet/sctp_indata.c
2792
switch (ch->chunk_type) {
sys/netinet/sctp_indata.c
2830
ch->chunk_type);
sys/netinet/sctp_indata.c
2854
if (ch->chunk_type & 0x40) {
sys/netinet/sctp_indata.c
2874
if ((ch->chunk_type & 0x80) == 0) {
sys/netinet/sctp_indata.c
2888
ch = (struct sctp_chunkhdr *)sctp_m_getptr(m, *offset,
sys/netinet/sctp_indata.c
2891
if (ch == NULL) {
sys/netinet/sctp_indata.c
5504
if ((fwd_sz = ntohs(fwd->ch.chunk_length)) < sizeof(struct sctp_forward_tsn_chunk)) {
sys/netinet/sctp_input.c
1060
sctp_handle_error(struct sctp_chunkhdr *ch,
sys/netinet/sctp_input.c
1070
cause = (struct sctp_error_cause *)((caddr_t)ch +
sys/netinet/sctp_input.c
1072
remaining_length = ntohs(ch->chunk_length);
sys/netinet/sctp_input.c
1106
ch->chunk_flags);
sys/netinet/sctp_input.c
1113
ch->chunk_flags);
sys/netinet/sctp_input.c
114
offset + ntohs(cp->ch.chunk_length))) {
sys/netinet/sctp_input.c
1187
sctp_process_unrecog_chunk(stcb, unrec_chunk->ch.chunk_type);
sys/netinet/sctp_input.c
1239
sctp_ulp_notify(SCTP_NOTIFY_REMOTE_ERROR, stcb, code, ch, SCTP_SO_NOT_LOCKED);
sys/netinet/sctp_input.c
1411
if (init_cp->ch.chunk_type != SCTP_INITIATION) {
sys/netinet/sctp_input.c
1419
initack_offset = init_offset + SCTP_SIZE32(ntohs(init_cp->ch.chunk_length));
sys/netinet/sctp_input.c
1428
if (initack_cp->ch.chunk_type != SCTP_INITIATION_ACK) {
sys/netinet/sctp_input.c
1988
if (init_cp->ch.chunk_type != SCTP_INITIATION) {
sys/netinet/sctp_input.c
1992
initack_offset = init_offset + SCTP_SIZE32(ntohs(init_cp->ch.chunk_length));
sys/netinet/sctp_input.c
2005
if (initack_cp->ch.chunk_type != SCTP_INITIATION_ACK) {
sys/netinet/sctp_input.c
2276
cookie_len = ntohs(cp->ch.chunk_length);
sys/netinet/sctp_input.c
2863
len = ntohs(cp->ch.chunk_length);
sys/netinet/sctp_input.c
2984
override = cp->ch.chunk_flags & SCTP_CWR_REDUCE_OVERRIDE;
sys/netinet/sctp_input.c
3368
struct sctp_chunkhdr *ch;
sys/netinet/sctp_input.c
3388
ch = mtod(chk->data, struct sctp_chunkhdr *);
sys/netinet/sctp_input.c
3389
r = (struct sctp_stream_reset_request *)(ch + 1);
sys/netinet/sctp_input.c
3547
fwdtsn.ch.chunk_length = htons(sizeof(struct sctp_forward_tsn_chunk));
sys/netinet/sctp_input.c
3548
fwdtsn.ch.chunk_type = SCTP_FORWARD_CUM_TSN;
sys/netinet/sctp_input.c
3678
fwdtsn.ch.chunk_length = htons(sizeof(struct sctp_forward_tsn_chunk));
sys/netinet/sctp_input.c
3679
fwdtsn.ch.chunk_type = SCTP_FORWARD_CUM_TSN;
sys/netinet/sctp_input.c
3680
fwdtsn.ch.chunk_flags = 0;
sys/netinet/sctp_input.c
3961
struct sctp_chunkhdr *ch;
sys/netinet/sctp_input.c
3999
ch = mtod(chk->data, struct sctp_chunkhdr *);
sys/netinet/sctp_input.c
4000
ch->chunk_type = SCTP_STREAM_RESET;
sys/netinet/sctp_input.c
4001
ch->chunk_flags = 0;
sys/netinet/sctp_input.c
4002
ch->chunk_length = htons(chk->send_size);
sys/netinet/sctp_input.c
4142
pktdrp_flags = cp->ch.chunk_flags;
sys/netinet/sctp_input.c
4143
pktdrp_len = ntohs(cp->ch.chunk_length);
sys/netinet/sctp_input.c
4312
struct sctphdr *sh, struct sctp_chunkhdr *ch, struct sctp_inpcb *inp,
sys/netinet/sctp_input.c
4346
if (ntohs(ch->chunk_length) < sizeof(*ch)) {
sys/netinet/sctp_input.c
4348
ntohs(ch->chunk_length));
sys/netinet/sctp_input.c
4357
if (ch->chunk_type == SCTP_INITIATION) {
sys/netinet/sctp_input.c
4359
ntohs(ch->chunk_length), vtag_in);
sys/netinet/sctp_input.c
4368
} else if (ch->chunk_type != SCTP_COOKIE_ECHO) {
sys/netinet/sctp_input.c
4374
if ((ch->chunk_type == SCTP_AUTHENTICATION) &&
sys/netinet/sctp_input.c
4380
auth_len = ntohs(ch->chunk_length);
sys/netinet/sctp_input.c
4389
ch = (struct sctp_chunkhdr *)sctp_m_getptr(m, *offset,
sys/netinet/sctp_input.c
4392
if (ch == NULL) {
sys/netinet/sctp_input.c
4397
if (ch->chunk_type == SCTP_COOKIE_ECHO) {
sys/netinet/sctp_input.c
4404
if (ch->chunk_type == SCTP_ASCONF && stcb == NULL) {
sys/netinet/sctp_input.c
4405
struct sctp_chunkhdr *asconf_ch = ch;
sys/netinet/sctp_input.c
4469
if ((ch->chunk_type == SCTP_ABORT_ASSOCIATION) ||
sys/netinet/sctp_input.c
4470
(ch->chunk_type == SCTP_SHUTDOWN_COMPLETE) ||
sys/netinet/sctp_input.c
4471
(ch->chunk_type == SCTP_PACKET_DROPPED)) {
sys/netinet/sctp_input.c
4473
if ((((ch->chunk_flags & SCTP_HAD_NO_TCB) == 0) &&
sys/netinet/sctp_input.c
4475
(((ch->chunk_flags & SCTP_HAD_NO_TCB) == SCTP_HAD_NO_TCB) &&
sys/netinet/sctp_input.c
4506
if (((ch->chunk_type == SCTP_SELECTIVE_ACK) ||
sys/netinet/sctp_input.c
4507
(ch->chunk_type == SCTP_NR_SELECTIVE_ACK) ||
sys/netinet/sctp_input.c
4508
(ch->chunk_type == SCTP_HEARTBEAT_REQUEST)) &&
sys/netinet/sctp_input.c
4511
sctp_handle_cookie_ack((struct sctp_cookie_ack_chunk *)ch, stcb,
sys/netinet/sctp_input.c
4516
while (IS_SCTP_CONTROL(ch)) {
sys/netinet/sctp_input.c
4518
chk_length = ntohs(ch->chunk_length);
sys/netinet/sctp_input.c
4520
ch->chunk_type, chk_length);
sys/netinet/sctp_input.c
4521
SCTP_LTRACE_CHK(inp, stcb, ch->chunk_type, chk_length);
sys/netinet/sctp_input.c
4522
if (chk_length < sizeof(*ch) ||
sys/netinet/sctp_input.c
4533
switch (ch->chunk_type) {
sys/netinet/sctp_input.c
4544
ch = (struct sctp_chunkhdr *)sctp_m_getptr(m, *offset,
sys/netinet/sctp_input.c
4547
if (ch == NULL) {
sys/netinet/sctp_input.c
4555
if (((netp != NULL) && (*netp != NULL)) || (ch->chunk_type == SCTP_ASCONF)) {
sys/netinet/sctp_input.c
4566
sctp_audit_log(0xB0, ch->chunk_type);
sys/netinet/sctp_input.c
4571
sctp_auth_is_required_chunk(ch->chunk_type, stcb->asoc.local_auth_chunks) &&
sys/netinet/sctp_input.c
4577
switch (ch->chunk_type) {
sys/netinet/sctp_input.c
4603
(struct sctp_init_chunk *)ch, inp,
sys/netinet/sctp_input.c
463
initack_limit = offset + ntohs(cp->ch.chunk_length);
sys/netinet/sctp_input.c
4639
(struct sctp_init_ack_chunk *)ch,
sys/netinet/sctp_input.c
4670
ch->chunk_type == SCTP_SELECTIVE_ACK ? "SCTP_SACK" : "SCTP_NR_SACK");
sys/netinet/sctp_input.c
4674
(ch->chunk_type == SCTP_SELECTIVE_ACK) ? "SCTP_SACK" : "SCTP_NR_SACK");
sys/netinet/sctp_input.c
4677
if (ch->chunk_type == SCTP_SELECTIVE_ACK) {
sys/netinet/sctp_input.c
4699
flags = ch->chunk_flags;
sys/netinet/sctp_input.c
4700
if (ch->chunk_type == SCTP_SELECTIVE_ACK) {
sys/netinet/sctp_input.c
4703
sack = (struct sctp_sack_chunk *)ch;
sys/netinet/sctp_input.c
4720
nr_sack = (struct sctp_nr_sack_chunk *)ch;
sys/netinet/sctp_input.c
4736
(ch->chunk_type == SCTP_SELECTIVE_ACK) ? "SCTP_SACK" : "SCTP_NR_SACK",
sys/netinet/sctp_input.c
4791
sctp_handle_heartbeat_ack((struct sctp_heartbeat_chunk *)ch,
sys/netinet/sctp_input.c
4800
if (sctp_handle_abort((struct sctp_abort_chunk *)ch, stcb, *netp)) {
sys/netinet/sctp_input.c
4817
sctp_handle_shutdown((struct sctp_shutdown_chunk *)ch,
sys/netinet/sctp_input.c
4829
sctp_handle_shutdown_ack((struct sctp_shutdown_ack_chunk *)ch, stcb, *netp);
sys/netinet/sctp_input.c
4837
sctp_handle_error(ch, stcb, *netp, contiguous) < 0) {
sys/netinet/sctp_input.c
4918
(struct sctp_cookie_echo_chunk *)ch,
sys/netinet/sctp_input.c
4982
sctp_handle_cookie_ack((struct sctp_cookie_ack_chunk *)ch, stcb, *netp);
sys/netinet/sctp_input.c
4997
sctp_handle_ecn_echo((struct sctp_ecne_chunk *)ch, stcb);
sys/netinet/sctp_input.c
5011
sctp_handle_ecn_cwr((struct sctp_cwr_chunk *)ch, stcb, *netp);
sys/netinet/sctp_input.c
5023
sctp_handle_shutdown_complete((struct sctp_shutdown_complete_chunk *)ch,
sys/netinet/sctp_input.c
5036
(struct sctp_asconf_chunk *)ch, stcb, asconf_cnt == 0);
sys/netinet/sctp_input.c
5062
(struct sctp_asconf_ack_chunk *)ch, stcb, *netp, &abort_no_unlock);
sys/netinet/sctp_input.c
5070
ch->chunk_type == SCTP_FORWARD_CUM_TSN ? "FORWARD_TSN" : "I_FORWARD_TSN");
sys/netinet/sctp_input.c
5080
if (((stcb->asoc.idata_supported == 1) && (ch->chunk_type == SCTP_FORWARD_CUM_TSN)) ||
sys/netinet/sctp_input.c
5081
((stcb->asoc.idata_supported == 0) && (ch->chunk_type == SCTP_IFORWARD_CUM_TSN))) {
sys/netinet/sctp_input.c
5082
if (ch->chunk_type == SCTP_FORWARD_CUM_TSN) {
sys/netinet/sctp_input.c
5106
(struct sctp_forward_tsn_chunk *)ch, &abort_flag, m, *offset);
sys/netinet/sctp_input.c
5123
if (sctp_handle_stream_reset(stcb, m, *offset, ch)) {
sys/netinet/sctp_input.c
5141
sctp_handle_packet_dropped((struct sctp_pktdrop_chunk *)ch,
sys/netinet/sctp_input.c
5173
if (sctp_handle_auth(stcb, (struct sctp_auth_chunk *)ch, m, *offset)) {
sys/netinet/sctp_input.c
5186
if ((ch->chunk_type & 0x40) &&
sys/netinet/sctp_input.c
5215
if ((ch->chunk_type & 0x80) == 0) {
sys/netinet/sctp_input.c
5230
ch = (struct sctp_chunkhdr *)sctp_m_getptr(m, *offset,
sys/netinet/sctp_input.c
5232
if (ch == NULL) {
sys/netinet/sctp_input.c
5250
struct sctphdr *sh, struct sctp_chunkhdr *ch,
sys/netinet/sctp_input.c
5316
sh, ch, &inp, &net, vrf_id);
sys/netinet/sctp_input.c
5321
if ((ch->chunk_type != SCTP_INITIATION) &&
sys/netinet/sctp_input.c
5367
sh, ch, &inp, &net, vrf_id);
sys/netinet/sctp_input.c
539
if (ntohs(cp->ch.chunk_length) != sizeof(struct sctp_heartbeat_chunk)) {
sys/netinet/sctp_input.c
5391
sh, ch, &inp, &net, vrf_id);
sys/netinet/sctp_input.c
5394
if ((ch->chunk_type != SCTP_INITIATION) &&
sys/netinet/sctp_input.c
5420
if (ch->chunk_type == SCTP_SHUTDOWN_ACK) {
sys/netinet/sctp_input.c
5427
if (ch->chunk_type == SCTP_SHUTDOWN_COMPLETE) {
sys/netinet/sctp_input.c
5431
if (ch->chunk_type != SCTP_ABORT_ASSOCIATION) {
sys/netinet/sctp_input.c
5434
(ch->chunk_type != SCTP_INIT))) {
sys/netinet/sctp_input.c
5476
if (IS_SCTP_CONTROL(ch)) {
sys/netinet/sctp_input.c
5480
src, dst, sh, ch,
sys/netinet/sctp_input.c
5491
if ((ch->chunk_type != SCTP_INITIATION) &&
sys/netinet/sctp_input.c
5589
sctp_handle_cookie_ack((struct sctp_cookie_ack_chunk *)ch, stcb, net);
sys/netinet/sctp_input.c
5711
struct sctp_chunkhdr *ch;
sys/netinet/sctp_input.c
5755
ch = (struct sctp_chunkhdr *)((caddr_t)sh + sizeof(struct sctphdr));
sys/netinet/sctp_input.c
5797
sh, ch,
sys/netinet/sctp_input.c
758
len = ntohs(abort->ch.chunk_length);
sys/netinet/sctp_input.c
770
abort->ch.chunk_flags);
sys/netinet/sctp_input.c
776
abort->ch.chunk_flags);
sys/netinet/sctp_input.c
878
if (ntohs(cp->ch.chunk_length) != sizeof(struct sctp_shutdown_chunk)) {
sys/netinet/sctp_output.c
10477
fwdtsn->ch.chunk_length = htons(chk->send_size);
sys/netinet/sctp_output.c
10478
fwdtsn->ch.chunk_flags = 0;
sys/netinet/sctp_output.c
10480
fwdtsn->ch.chunk_type = SCTP_IFORWARD_CUM_TSN;
sys/netinet/sctp_output.c
10482
fwdtsn->ch.chunk_type = SCTP_FORWARD_CUM_TSN;
sys/netinet/sctp_output.c
10908
sack->ch.chunk_type = type;
sys/netinet/sctp_output.c
10909
sack->ch.chunk_flags = flags;
sys/netinet/sctp_output.c
10910
sack->ch.chunk_length = htons(a_chk->send_size);
sys/netinet/sctp_output.c
10922
nr_sack->ch.chunk_type = type;
sys/netinet/sctp_output.c
10923
nr_sack->ch.chunk_flags = flags;
sys/netinet/sctp_output.c
10924
nr_sack->ch.chunk_length = htons(a_chk->send_size);
sys/netinet/sctp_output.c
11007
abort->ch.chunk_type = SCTP_ABORT_ASSOCIATION;
sys/netinet/sctp_output.c
11011
abort->ch.chunk_flags = SCTP_HAD_NO_TCB;
sys/netinet/sctp_output.c
11014
abort->ch.chunk_flags = 0;
sys/netinet/sctp_output.c
11016
abort->ch.chunk_length = htons(chunk_len);
sys/netinet/sctp_output.c
11078
shutdown_complete->ch.chunk_type = SCTP_SHUTDOWN_COMPLETE;
sys/netinet/sctp_output.c
11079
shutdown_complete->ch.chunk_flags = flags;
sys/netinet/sctp_output.c
11080
shutdown_complete->ch.chunk_length = htons(sizeof(struct sctp_shutdown_complete_chunk));
sys/netinet/sctp_output.c
11113
struct sctp_chunkhdr *ch;
sys/netinet/sctp_output.c
11269
ch = (struct sctp_chunkhdr *)((caddr_t)shout + sizeof(struct sctphdr));
sys/netinet/sctp_output.c
11270
ch->chunk_type = type;
sys/netinet/sctp_output.c
11272
ch->chunk_flags = 0;
sys/netinet/sctp_output.c
11274
ch->chunk_flags = SCTP_HAD_NO_TCB;
sys/netinet/sctp_output.c
11276
ch->chunk_length = htons((uint16_t)(sizeof(struct sctp_chunkhdr) + cause_len));
sys/netinet/sctp_output.c
11422
hb->ch.chunk_type = SCTP_HEARTBEAT_REQUEST;
sys/netinet/sctp_output.c
11423
hb->ch.chunk_flags = 0;
sys/netinet/sctp_output.c
11424
hb->ch.chunk_length = htons(chk->send_size);
sys/netinet/sctp_output.c
11531
ecne->ch.chunk_type = SCTP_ECN_ECHO;
sys/netinet/sctp_output.c
11532
ecne->ch.chunk_flags = 0;
sys/netinet/sctp_output.c
11533
ecne->ch.chunk_length = htons(sizeof(struct sctp_ecne_chunk));
sys/netinet/sctp_output.c
11552
struct sctp_chunkhdr *ch, chunk_buf;
sys/netinet/sctp_output.c
11581
ch = (struct sctp_chunkhdr *)sctp_m_getptr(m, offset,
sys/netinet/sctp_output.c
11582
sizeof(*ch), (uint8_t *)&chunk_buf);
sys/netinet/sctp_output.c
11583
while (ch != NULL) {
sys/netinet/sctp_output.c
11584
chk_length = ntohs(ch->chunk_length);
sys/netinet/sctp_output.c
11585
if (chk_length < sizeof(*ch)) {
sys/netinet/sctp_output.c
11589
switch (ch->chunk_type) {
sys/netinet/sctp_output.c
11605
ch = (struct sctp_chunkhdr *)sctp_m_getptr(m, offset,
sys/netinet/sctp_output.c
11606
sizeof(*ch), (uint8_t *)&chunk_buf);
sys/netinet/sctp_output.c
11636
drp->ch.chunk_flags = SCTP_PACKET_TRUNCATED;
sys/netinet/sctp_output.c
11646
drp->ch.chunk_flags = 0;
sys/netinet/sctp_output.c
11650
drp->ch.chunk_flags |= SCTP_BADCRC;
sys/netinet/sctp_output.c
11663
drp->ch.chunk_type = SCTP_PACKET_DROPPED;
sys/netinet/sctp_output.c
11664
drp->ch.chunk_length = htons(chk->send_size);
sys/netinet/sctp_output.c
11716
cwr->ch.chunk_flags |= SCTP_CWR_REDUCE_OVERRIDE;
sys/netinet/sctp_output.c
11743
cwr->ch.chunk_type = SCTP_ECN_CWR;
sys/netinet/sctp_output.c
11744
cwr->ch.chunk_flags = override;
sys/netinet/sctp_output.c
11745
cwr->ch.chunk_length = htons(sizeof(struct sctp_cwr_chunk));
sys/netinet/sctp_output.c
11757
struct sctp_chunkhdr *ch;
sys/netinet/sctp_output.c
11761
ch = mtod(chk->data, struct sctp_chunkhdr *);
sys/netinet/sctp_output.c
11762
old_len = len = SCTP_SIZE32(ntohs(ch->chunk_length));
sys/netinet/sctp_output.c
11764
req_out = (struct sctp_stream_reset_out_request *)((caddr_t)ch + len);
sys/netinet/sctp_output.c
11816
ch->chunk_length = htons(len + old_len);
sys/netinet/sctp_output.c
11831
struct sctp_chunkhdr *ch;
sys/netinet/sctp_output.c
11833
ch = mtod(chk->data, struct sctp_chunkhdr *);
sys/netinet/sctp_output.c
11834
old_len = len = SCTP_SIZE32(ntohs(ch->chunk_length));
sys/netinet/sctp_output.c
11837
req_in = (struct sctp_stream_reset_in_request *)((caddr_t)ch + len);
sys/netinet/sctp_output.c
11857
ch->chunk_length = htons(len + old_len);
sys/netinet/sctp_output.c
11871
struct sctp_chunkhdr *ch;
sys/netinet/sctp_output.c
11873
ch = mtod(chk->data, struct sctp_chunkhdr *);
sys/netinet/sctp_output.c
11874
old_len = len = SCTP_SIZE32(ntohs(ch->chunk_length));
sys/netinet/sctp_output.c
11877
req_tsn = (struct sctp_stream_reset_tsn_request *)((caddr_t)ch + len);
sys/netinet/sctp_output.c
11885
ch->chunk_length = htons(len + old_len);
sys/netinet/sctp_output.c
11899
struct sctp_chunkhdr *ch;
sys/netinet/sctp_output.c
11901
ch = mtod(chk->data, struct sctp_chunkhdr *);
sys/netinet/sctp_output.c
11902
old_len = len = SCTP_SIZE32(ntohs(ch->chunk_length));
sys/netinet/sctp_output.c
11905
resp = (struct sctp_stream_reset_response *)((caddr_t)ch + len);
sys/netinet/sctp_output.c
11914
ch->chunk_length = htons(len + old_len);
sys/netinet/sctp_output.c
11929
struct sctp_chunkhdr *ch;
sys/netinet/sctp_output.c
11970
ch = mtod(chk->data, struct sctp_chunkhdr *);
sys/netinet/sctp_output.c
11971
ch->chunk_type = SCTP_STREAM_RESET;
sys/netinet/sctp_output.c
11972
ch->chunk_flags = 0;
sys/netinet/sctp_output.c
11973
ch->chunk_length = htons(chk->book_size);
sys/netinet/sctp_output.c
11991
struct sctp_chunkhdr *ch;
sys/netinet/sctp_output.c
11993
ch = mtod(chk->data, struct sctp_chunkhdr *);
sys/netinet/sctp_output.c
11994
old_len = len = SCTP_SIZE32(ntohs(ch->chunk_length));
sys/netinet/sctp_output.c
11997
resp = (struct sctp_stream_reset_response_tsn *)((caddr_t)ch + len);
sys/netinet/sctp_output.c
12008
ch->chunk_length = htons(len + old_len);
sys/netinet/sctp_output.c
12022
struct sctp_chunkhdr *ch;
sys/netinet/sctp_output.c
12025
ch = mtod(chk->data, struct sctp_chunkhdr *);
sys/netinet/sctp_output.c
12026
old_len = len = SCTP_SIZE32(ntohs(ch->chunk_length));
sys/netinet/sctp_output.c
12029
addstr = (struct sctp_stream_reset_add_strm *)((caddr_t)ch + len);
sys/netinet/sctp_output.c
12041
ch->chunk_length = htons(len + old_len);
sys/netinet/sctp_output.c
12055
struct sctp_chunkhdr *ch;
sys/netinet/sctp_output.c
12058
ch = mtod(chk->data, struct sctp_chunkhdr *);
sys/netinet/sctp_output.c
12059
old_len = len = SCTP_SIZE32(ntohs(ch->chunk_length));
sys/netinet/sctp_output.c
12062
addstr = (struct sctp_stream_reset_add_strm *)((caddr_t)ch + len);
sys/netinet/sctp_output.c
12073
ch->chunk_length = htons(len + old_len);
sys/netinet/sctp_output.c
12086
struct sctp_chunkhdr *ch;
sys/netinet/sctp_output.c
12123
ch = mtod(chk->data, struct sctp_chunkhdr *);
sys/netinet/sctp_output.c
12124
ch->chunk_type = SCTP_STREAM_RESET;
sys/netinet/sctp_output.c
12125
ch->chunk_flags = 0;
sys/netinet/sctp_output.c
12126
ch->chunk_length = htons(chk->book_size);
sys/netinet/sctp_output.c
12164
struct sctp_chunkhdr *ch;
sys/netinet/sctp_output.c
12229
ch = mtod(chk->data, struct sctp_chunkhdr *);
sys/netinet/sctp_output.c
12230
ch->chunk_type = SCTP_STREAM_RESET;
sys/netinet/sctp_output.c
12231
ch->chunk_flags = 0;
sys/netinet/sctp_output.c
12232
ch->chunk_length = htons(chk->book_size);
sys/netinet/sctp_output.c
13821
auth->ch.chunk_type = SCTP_AUTHENTICATION;
sys/netinet/sctp_output.c
13822
auth->ch.chunk_flags = 0;
sys/netinet/sctp_output.c
13825
auth->ch.chunk_length = htons(chunk_len);
sys/netinet/sctp_output.c
4677
init->ch.chunk_type = SCTP_INITIATION;
sys/netinet/sctp_output.c
4678
init->ch.chunk_flags = 0;
sys/netinet/sctp_output.c
4680
init->ch.chunk_length = 0;
sys/netinet/sctp_output.c
4887
init->ch.chunk_length = htons(chunk_len);
sys/netinet/sctp_output.c
5545
if (sctp_are_there_new_addresses(asoc, init_pkt, offset, offset + ntohs(init_chk->ch.chunk_length), src, &op_err)) {
sys/netinet/sctp_output.c
5846
initack->ch.chunk_type = SCTP_INITIATION_ACK;
sys/netinet/sctp_output.c
5847
initack->ch.chunk_flags = 0;
sys/netinet/sctp_output.c
5849
initack->ch.chunk_length = 0;
sys/netinet/sctp_output.c
6152
initack->ch.chunk_length = htons(chunk_len);
sys/netinet/sctp_output.c
7622
dchkh->ch.chunk_type = SCTP_DATA;
sys/netinet/sctp_output.c
7623
dchkh->ch.chunk_flags = chk->rec.data.rcv_flags;
sys/netinet/sctp_output.c
7628
dchkh->ch.chunk_length = htons(chk->send_size);
sys/netinet/sctp_output.c
7630
ndchkh->ch.chunk_type = SCTP_IDATA;
sys/netinet/sctp_output.c
7631
ndchkh->ch.chunk_flags = chk->rec.data.rcv_flags;
sys/netinet/sctp_output.c
7641
ndchkh->ch.chunk_length = htons(chk->send_size);
sys/netinet/sctp_output.c
8691
dchkh->ch.chunk_flags |= SCTP_DATA_SACK_IMMEDIATELY;
sys/netinet/sctp_output.c
9239
ack_cp->ch.chunk_type = SCTP_SHUTDOWN_ACK;
sys/netinet/sctp_output.c
9240
ack_cp->ch.chunk_flags = 0;
sys/netinet/sctp_output.c
9241
ack_cp->ch.chunk_length = htons(chk->send_size);
sys/netinet/sctp_output.c
9293
shutdown_cp->ch.chunk_type = SCTP_SHUTDOWN;
sys/netinet/sctp_output.c
9294
shutdown_cp->ch.chunk_flags = 0;
sys/netinet/sctp_output.c
9295
shutdown_cp->ch.chunk_length = htons(chk->send_size);
sys/netinet/sctp_pcb.c
2100
struct sctphdr *sh, struct sctp_chunkhdr *ch,
sys/netinet/sctp_pcb.c
2126
if ((ch->chunk_type == SCTP_INITIATION) ||
sys/netinet/sctp_pcb.c
2127
(ch->chunk_type == SCTP_INITIATION_ACK)) {
sys/netinet/sctp_usrreq.c
267
struct sctp_init_chunk *ch;
sys/netinet/sctp_usrreq.c
320
ch = (struct sctp_init_chunk *)(sh + 1);
sys/netinet/sctp_usrreq.c
321
if ((ch->ch.chunk_type != SCTP_INITIATION) ||
sys/netinet/sctp_usrreq.c
322
(ntohl(ch->init.initiate_tag) != stcb->asoc.my_vtag)) {
sys/netinet/sctputil.c
3160
abort_len = ntohs(abort->ch.chunk_length);
sys/netinet/sctputil.c
4025
chunk_len = ntohs(chunk->ch.chunk_length);
sys/netinet/sctputil.c
4549
struct sctp_chunkhdr *ch, chunk_buf;
sys/netinet/sctputil.c
4562
ch = (struct sctp_chunkhdr *)sctp_m_getptr(m, offset,
sys/netinet/sctputil.c
4563
sizeof(*ch), (uint8_t *)&chunk_buf);
sys/netinet/sctputil.c
4564
while (ch != NULL) {
sys/netinet/sctputil.c
4565
chk_length = ntohs(ch->chunk_length);
sys/netinet/sctputil.c
4566
if (chk_length < sizeof(*ch)) {
sys/netinet/sctputil.c
4570
switch (ch->chunk_type) {
sys/netinet/sctputil.c
4595
ch = (struct sctp_chunkhdr *)sctp_m_getptr(m, offset,
sys/netinet/sctputil.c
4596
sizeof(*ch), (uint8_t *)&chunk_buf);
sys/netinet/sctputil.c
4614
struct sctp_chunkhdr *ch;
sys/netinet/sctputil.c
4620
ch = (struct sctp_chunkhdr *)sctp_m_getptr(m, offset, sizeof(*ch),
sys/netinet/sctputil.c
4622
while (ch != NULL) {
sys/netinet/sctputil.c
4623
chk_length = ntohs(ch->chunk_length);
sys/netinet/sctputil.c
4624
if (chk_length < sizeof(*ch)) {
sys/netinet/sctputil.c
4629
if (ch->chunk_type == SCTP_ABORT_ASSOCIATION) {
sys/netinet/sctputil.c
4633
if ((ch->chunk_type == SCTP_INITIATION) ||
sys/netinet/sctputil.c
4634
(ch->chunk_type == SCTP_INITIATION_ACK)) {
sys/netinet/sctputil.c
4644
ch = (struct sctp_chunkhdr *)sctp_m_getptr(m, offset,
sys/netinet/sctputil.c
4645
sizeof(*ch), (uint8_t *)&chunk_buf);
sys/netinet/sctputil.c
7226
struct sctp_init_chunk *ch;
sys/netinet/sctputil.c
7288
ch = (struct sctp_init_chunk *)(sh + 1);
sys/netinet/sctputil.c
7289
if ((ch->ch.chunk_type != SCTP_INITIATION) ||
sys/netinet/sctputil.c
7290
(ntohl(ch->init.initiate_tag) != stcb->asoc.my_vtag)) {
sys/netinet6/sctp6_usrreq.c
112
ch = (struct sctp_chunkhdr *)((caddr_t)sh + sizeof(struct sctphdr));
sys/netinet6/sctp6_usrreq.c
156
sh, ch,
sys/netinet6/sctp6_usrreq.c
67
struct sctp_chunkhdr *ch;
sys/netpfil/ipfilter/netinet/ip_proxy.c
1119
int sel, ch = 0, out, nlen;
sys/netpfil/ipfilter/netinet/ip_proxy.c
1155
ch = 1;
sys/netpfil/ipfilter/netinet/ip_proxy.c
1186
ch = 1;
sys/netpfil/ipfilter/netinet/ip_proxy.c
1207
ch = 1;
sys/netpfil/ipfilter/netinet/ip_proxy.c
1243
ch = 1;
sys/netpfil/ipfilter/netinet/ip_proxy.c
1251
return (ch ? 2 : 0);
sys/netpfil/ipfw/ip_fw2.c
1312
tvalue_match(struct ip_fw_chain *ch, const ipfw_insn_lookup *cmd,
sys/netpfil/ipfw/ip_fw2.c
1319
tvalue = TARG_VAL(ch, tablearg, pipe);
sys/netpfil/ipfw/ip_fw2.c
1322
tvalue = TARG_VAL(ch, tablearg, divert);
sys/netpfil/ipfw/ip_fw2.c
1325
tvalue = TARG_VAL(ch, tablearg, skipto);
sys/netpfil/ipfw/ip_fw2.c
1328
tvalue = TARG_VAL(ch, tablearg, netgraph);
sys/netpfil/ipfw/ip_fw2.c
1331
tvalue = TARG_VAL(ch, tablearg, fib);
sys/netpfil/ipfw/ip_fw2.c
1334
tvalue = TARG_VAL(ch, tablearg, nat);
sys/netpfil/ipfw/ip_fw2.c
1337
tvalue = TARG_VAL(ch, tablearg, nh4);
sys/netpfil/ipfw/ip_fw2.c
1342
return (0 == memcmp(&TARG_VAL(ch, tablearg, nh6),
sys/netpfil/ipfw/ip_fw2.c
1345
tvalue = TARG_VAL(ch, tablearg, dscp);
sys/netpfil/ipfw/ip_fw2.c
1348
tvalue = TARG_VAL(ch, tablearg, limit);
sys/netpfil/ipfw/ip_fw2.c
1351
tvalue = TARG_VAL(ch, tablearg, mark);
sys/netpfil/ipfw/ip_fw2.c
1355
tvalue = TARG_VAL(ch, tablearg, tag);
sys/netpfil/ipfw/ip_fw_bpf.c
102
ipfw_tap_free(struct ip_fw_chain *ch, uint32_t rule)
sys/netpfil/ipfw/ip_fw_bpf.c
107
IPFW_UH_WLOCK_ASSERT(ch);
sys/netpfil/ipfw/ip_fw_bpf.c
109
tap = RB_FIND(tap_tree, &ch->taps, &key);
sys/netpfil/ipfw/ip_fw_bpf.c
113
RB_REMOVE(tap_tree, &ch->taps, tap);
sys/netpfil/ipfw/ip_fw_bpf.c
119
ipfw_bpf_tap(struct ip_fw_chain *ch, struct ip_fw_args *args,
sys/netpfil/ipfw/ip_fw_bpf.c
129
tap = RB_FIND(tap_tree, &ch->taps, &key);
sys/netpfil/ipfw/ip_fw_bpf.c
76
ipfw_tap_alloc(struct ip_fw_chain *ch, uint32_t rule)
sys/netpfil/ipfw/ip_fw_bpf.c
82
IPFW_UH_WLOCK_ASSERT(ch);
sys/netpfil/ipfw/ip_fw_bpf.c
84
tap = RB_FIND(tap_tree, &ch->taps, &key);
sys/netpfil/ipfw/ip_fw_bpf.c
97
tap = RB_INSERT(tap_tree, &ch->taps, tap);
sys/netpfil/ipfw/ip_fw_dynamic.c
2185
dyn_acquire_rule(struct ip_fw_chain *ch, struct dyn_data *data,
sys/netpfil/ipfw/ip_fw_dynamic.c
2198
IPFW_UH_WLOCK_ASSERT(ch);
sys/netpfil/ipfw/ip_fw_dynamic.c
2203
obj = SRV_OBJECT(ch, kidx);
sys/netpfil/ipfw/ip_fw_dynamic.c
2212
dyn_release_rule(struct ip_fw_chain *ch, struct dyn_data *data,
sys/netpfil/ipfw/ip_fw_dynamic.c
2217
IPFW_UH_WLOCK_ASSERT(ch);
sys/netpfil/ipfw/ip_fw_dynamic.c
2220
obj = SRV_OBJECT(ch, kidx);
sys/netpfil/ipfw/ip_fw_dynamic.c
2222
dyn_destroy(ch, &obj->no);
sys/netpfil/ipfw/ip_fw_dynamic.c
2239
dyn_match_ipv4_state(struct ip_fw_chain *ch, struct dyn_ipv4_state *s,
sys/netpfil/ipfw/ip_fw_dynamic.c
2258
dyn_acquire_rule(ch, s->data, rule, s->kidx);
sys/netpfil/ipfw/ip_fw_dynamic.c
2264
dyn_match_ipv6_state(struct ip_fw_chain *ch, struct dyn_ipv6_state *s,
sys/netpfil/ipfw/ip_fw_dynamic.c
2283
dyn_acquire_rule(ch, s->data, rule, s->kidx);
sys/netpfil/ipfw/ip_fw_dynamic.c
2293
dyn_expire_states(struct ip_fw_chain *ch, ipfw_range_tlv *rt)
sys/netpfil/ipfw/ip_fw_dynamic.c
2329
dyn_match_ ## af ## _state(ch, s, rt))) { \
sys/netpfil/ipfw/ip_fw_dynamic.c
2346
dyn_release_rule(ch, s->data, \
sys/netpfil/ipfw/ip_fw_dynamic.c
2861
ipfw_dyn_reset_eaction(struct ip_fw_chain *ch, uint32_t eaction_id,
sys/netpfil/ipfw/ip_fw_dynamic.c
2878
ipfw_reset_eaction(ch, rule, eaction_id, \
sys/netpfil/ipfw/ip_fw_dynamic.c
2882
IPFW_UH_WLOCK_ASSERT(ch);
sys/netpfil/ipfw/ip_fw_dynamic.c
615
dyn_findbyname(struct ip_fw_chain *ch, struct tid_info *ti,
sys/netpfil/ipfw/ip_fw_dynamic.c
638
*pno = ipfw_objhash_lookup_name_type(CHAIN_TO_SRV(ch), 0,
sys/netpfil/ipfw/ip_fw_dynamic.c
649
dyn_findbykidx(struct ip_fw_chain *ch, uint32_t idx)
sys/netpfil/ipfw/ip_fw_dynamic.c
653
return (ipfw_objhash_lookup_kidx(CHAIN_TO_SRV(ch), idx));
sys/netpfil/ipfw/ip_fw_dynamic.c
657
dyn_create(struct ip_fw_chain *ch, struct tid_info *ti,
sys/netpfil/ipfw/ip_fw_dynamic.c
666
IPFW_UH_WLOCK_ASSERT(ch);
sys/netpfil/ipfw/ip_fw_dynamic.c
680
ni = CHAIN_TO_SRV(ch);
sys/netpfil/ipfw/ip_fw_dynamic.c
705
SRV_OBJECT(ch, obj->no.kidx) = obj;
sys/netpfil/ipfw/ip_fw_dynamic.c
713
dyn_destroy(struct ip_fw_chain *ch, struct named_object *no)
sys/netpfil/ipfw/ip_fw_dynamic.c
717
IPFW_UH_WLOCK_ASSERT(ch);
sys/netpfil/ipfw/ip_fw_dynamic.c
725
obj = SRV_OBJECT(ch, no->kidx);
sys/netpfil/ipfw/ip_fw_dynamic.c
726
SRV_OBJECT(ch, no->kidx) = NULL;
sys/netpfil/ipfw/ip_fw_dynamic.c
727
ipfw_objhash_del(CHAIN_TO_SRV(ch), no);
sys/netpfil/ipfw/ip_fw_dynamic.c
728
ipfw_objhash_free_idx(CHAIN_TO_SRV(ch), no->kidx);
sys/netpfil/ipfw/ip_fw_eaction.c
109
default_eaction(struct ip_fw_chain *ch, struct ip_fw_args *args,
sys/netpfil/ipfw/ip_fw_eaction.c
146
eaction_findbyname(struct ip_fw_chain *ch, struct tid_info *ti,
sys/netpfil/ipfw/ip_fw_eaction.c
166
*pno = ipfw_objhash_lookup_name_type(CHAIN_TO_SRV(ch),
sys/netpfil/ipfw/ip_fw_eaction.c
174
eaction_findbykidx(struct ip_fw_chain *ch, uint32_t idx)
sys/netpfil/ipfw/ip_fw_eaction.c
178
return (ipfw_objhash_lookup_kidx(CHAIN_TO_SRV(ch), idx));
sys/netpfil/ipfw/ip_fw_eaction.c
193
create_eaction_obj(struct ip_fw_chain *ch, ipfw_eaction_t handler,
sys/netpfil/ipfw/ip_fw_eaction.c
199
IPFW_UH_UNLOCK_ASSERT(ch);
sys/netpfil/ipfw/ip_fw_eaction.c
201
ni = CHAIN_TO_SRV(ch);
sys/netpfil/ipfw/ip_fw_eaction.c
208
IPFW_UH_WLOCK(ch);
sys/netpfil/ipfw/ip_fw_eaction.c
215
IPFW_UH_WUNLOCK(ch);
sys/netpfil/ipfw/ip_fw_eaction.c
222
IPFW_UH_WUNLOCK(ch);
sys/netpfil/ipfw/ip_fw_eaction.c
228
IPFW_WLOCK(ch);
sys/netpfil/ipfw/ip_fw_eaction.c
229
SRV_OBJECT(ch, obj->no.kidx) = obj;
sys/netpfil/ipfw/ip_fw_eaction.c
230
IPFW_WUNLOCK(ch);
sys/netpfil/ipfw/ip_fw_eaction.c
232
IPFW_UH_WUNLOCK(ch);
sys/netpfil/ipfw/ip_fw_eaction.c
240
destroy_eaction_obj(struct ip_fw_chain *ch, struct named_object *no)
sys/netpfil/ipfw/ip_fw_eaction.c
245
IPFW_UH_WLOCK_ASSERT(ch);
sys/netpfil/ipfw/ip_fw_eaction.c
247
ni = CHAIN_TO_SRV(ch);
sys/netpfil/ipfw/ip_fw_eaction.c
248
IPFW_WLOCK(ch);
sys/netpfil/ipfw/ip_fw_eaction.c
249
obj = SRV_OBJECT(ch, no->kidx);
sys/netpfil/ipfw/ip_fw_eaction.c
250
SRV_OBJECT(ch, no->kidx) = NULL;
sys/netpfil/ipfw/ip_fw_eaction.c
251
IPFW_WUNLOCK(ch);
sys/netpfil/ipfw/ip_fw_eaction.c
261
reset_eaction_rules(struct ip_fw_chain *ch, uint32_t eaction_id,
sys/netpfil/ipfw/ip_fw_eaction.c
267
IPFW_UH_WLOCK_ASSERT(ch);
sys/netpfil/ipfw/ip_fw_eaction.c
269
no = ipfw_objhash_lookup_name_type(CHAIN_TO_SRV(ch), 0,
sys/netpfil/ipfw/ip_fw_eaction.c
277
IPFW_WLOCK(ch);
sys/netpfil/ipfw/ip_fw_eaction.c
283
for (i = 0; i < ch->n_rules; i++) {
sys/netpfil/ipfw/ip_fw_eaction.c
290
if (ipfw_reset_eaction(ch, ch->map[i], eaction_id,
sys/netpfil/ipfw/ip_fw_eaction.c
300
ipfw_dyn_reset_eaction(ch, eaction_id, no->kidx, instance_id);
sys/netpfil/ipfw/ip_fw_eaction.c
301
IPFW_WUNLOCK(ch);
sys/netpfil/ipfw/ip_fw_eaction.c
309
ipfw_eaction_init(struct ip_fw_chain *ch, int first)
sys/netpfil/ipfw/ip_fw_eaction.c
313
error = create_eaction_obj(ch, default_eaction,
sys/netpfil/ipfw/ip_fw_eaction.c
323
ipfw_eaction_uninit(struct ip_fw_chain *ch, int last)
sys/netpfil/ipfw/ip_fw_eaction.c
328
ni = CHAIN_TO_SRV(ch);
sys/netpfil/ipfw/ip_fw_eaction.c
330
IPFW_UH_WLOCK(ch);
sys/netpfil/ipfw/ip_fw_eaction.c
334
destroy_eaction_obj(ch, no);
sys/netpfil/ipfw/ip_fw_eaction.c
335
IPFW_UH_WUNLOCK(ch);
sys/netpfil/ipfw/ip_fw_eaction.c
345
ipfw_add_eaction(struct ip_fw_chain *ch, ipfw_eaction_t handler,
sys/netpfil/ipfw/ip_fw_eaction.c
352
create_eaction_obj(ch, handler, name, &eaction_id);
sys/netpfil/ipfw/ip_fw_eaction.c
363
ipfw_del_eaction(struct ip_fw_chain *ch, uint32_t eaction_id)
sys/netpfil/ipfw/ip_fw_eaction.c
367
IPFW_UH_WLOCK(ch);
sys/netpfil/ipfw/ip_fw_eaction.c
368
no = ipfw_objhash_lookup_kidx(CHAIN_TO_SRV(ch), eaction_id);
sys/netpfil/ipfw/ip_fw_eaction.c
370
IPFW_UH_WUNLOCK(ch);
sys/netpfil/ipfw/ip_fw_eaction.c
373
reset_eaction_rules(ch, eaction_id, 0, (no->refcnt > 1));
sys/netpfil/ipfw/ip_fw_eaction.c
376
destroy_eaction_obj(ch, no);
sys/netpfil/ipfw/ip_fw_eaction.c
377
IPFW_UH_WUNLOCK(ch);
sys/netpfil/ipfw/ip_fw_eaction.c
382
ipfw_reset_eaction(struct ip_fw_chain *ch, struct ip_fw *rule,
sys/netpfil/ipfw/ip_fw_eaction.c
388
IPFW_UH_WLOCK_ASSERT(ch);
sys/netpfil/ipfw/ip_fw_eaction.c
389
IPFW_WLOCK_ASSERT(ch);
sys/netpfil/ipfw/ip_fw_eaction.c
442
ipfw_reset_eaction_instance(struct ip_fw_chain *ch, uint32_t eaction_id,
sys/netpfil/ipfw/ip_fw_eaction.c
447
IPFW_UH_WLOCK_ASSERT(ch);
sys/netpfil/ipfw/ip_fw_eaction.c
448
no = ipfw_objhash_lookup_kidx(CHAIN_TO_SRV(ch), eaction_id);
sys/netpfil/ipfw/ip_fw_eaction.c
452
reset_eaction_rules(ch, eaction_id, kidx, 0);
sys/netpfil/ipfw/ip_fw_eaction.c
457
ipfw_run_eaction(struct ip_fw_chain *ch, struct ip_fw_args *args,
sys/netpfil/ipfw/ip_fw_eaction.c
462
return (EACTION_OBJ(ch, cmd)->handler(ch, args, cmd, done));
sys/netpfil/ipfw/ip_fw_eaction.c
96
#define EACTION_OBJ(ch, cmd) \
sys/netpfil/ipfw/ip_fw_eaction.c
97
((struct eaction_obj *)SRV_OBJECT((ch), insntod((cmd), kidx)->kidx))
sys/netpfil/ipfw/ip_fw_iface.c
108
ch = &V_layer3_chain;
sys/netpfil/ipfw/ip_fw_iface.c
110
IPFW_UH_WLOCK(ch);
sys/netpfil/ipfw/ip_fw_iface.c
111
ii = CHAIN_TO_II(ch);
sys/netpfil/ipfw/ip_fw_iface.c
113
IPFW_UH_WUNLOCK(ch);
sys/netpfil/ipfw/ip_fw_iface.c
121
handle_ifattach(ch, iif, ifp->if_index);
sys/netpfil/ipfw/ip_fw_iface.c
124
handle_ifdetach(ch, iif, ifp->if_index);
sys/netpfil/ipfw/ip_fw_iface.c
130
handle_ifdetach(ch, iif, ifp->if_index);
sys/netpfil/ipfw/ip_fw_iface.c
131
handle_ifattach(ch, iif, ifp->if_index);
sys/netpfil/ipfw/ip_fw_iface.c
135
IPFW_UH_WUNLOCK(ch);
sys/netpfil/ipfw/ip_fw_iface.c
245
vnet_ipfw_iface_init(struct ip_fw_chain *ch)
sys/netpfil/ipfw/ip_fw_iface.c
249
IPFW_UH_WLOCK_ASSERT(ch);
sys/netpfil/ipfw/ip_fw_iface.c
252
if (ch->ifcfg == NULL) {
sys/netpfil/ipfw/ip_fw_iface.c
253
ch->ifcfg = ii;
sys/netpfil/ipfw/ip_fw_iface.c
281
vnet_ipfw_iface_destroy(struct ip_fw_chain *ch)
sys/netpfil/ipfw/ip_fw_iface.c
285
IPFW_UH_WLOCK(ch);
sys/netpfil/ipfw/ip_fw_iface.c
286
ii = CHAIN_TO_II(ch);
sys/netpfil/ipfw/ip_fw_iface.c
287
ch->ifcfg = NULL;
sys/netpfil/ipfw/ip_fw_iface.c
288
IPFW_UH_WUNLOCK(ch);
sys/netpfil/ipfw/ip_fw_iface.c
291
ipfw_objhash_foreach(ii, destroy_iface, ch);
sys/netpfil/ipfw/ip_fw_iface.c
304
ipfw_iface_ref(struct ip_fw_chain *ch, char *name,
sys/netpfil/ipfw/ip_fw_iface.c
310
IPFW_UH_WLOCK_ASSERT(ch);
sys/netpfil/ipfw/ip_fw_iface.c
315
ii = CHAIN_TO_II(ch);
sys/netpfil/ipfw/ip_fw_iface.c
321
vnet_ipfw_iface_init(ch);
sys/netpfil/ipfw/ip_fw_iface.c
322
ii = CHAIN_TO_II(ch);
sys/netpfil/ipfw/ip_fw_iface.c
372
ipfw_iface_add_notify(struct ip_fw_chain *ch, struct ipfw_ifc *ic)
sys/netpfil/ipfw/ip_fw_iface.c
376
IPFW_UH_WLOCK_ASSERT(ch);
sys/netpfil/ipfw/ip_fw_iface.c
377
IPFW_WLOCK_ASSERT(ch);
sys/netpfil/ipfw/ip_fw_iface.c
383
ic->cb(ch, ic->cbdata, iif->ifindex);
sys/netpfil/ipfw/ip_fw_iface.c
391
ipfw_iface_del_notify(struct ip_fw_chain *ch, struct ipfw_ifc *ic)
sys/netpfil/ipfw/ip_fw_iface.c
395
IPFW_UH_WLOCK_ASSERT(ch);
sys/netpfil/ipfw/ip_fw_iface.c
406
ipfw_iface_unref(struct ip_fw_chain *ch, struct ipfw_ifc *ic)
sys/netpfil/ipfw/ip_fw_iface.c
410
IPFW_UH_WLOCK_ASSERT(ch);
sys/netpfil/ipfw/ip_fw_iface.c
423
handle_ifattach(struct ip_fw_chain *ch, struct ipfw_iface *iif,
sys/netpfil/ipfw/ip_fw_iface.c
428
IPFW_UH_WLOCK_ASSERT(ch);
sys/netpfil/ipfw/ip_fw_iface.c
434
IPFW_WLOCK(ch);
sys/netpfil/ipfw/ip_fw_iface.c
436
ic->cb(ch, ic->cbdata, iif->ifindex);
sys/netpfil/ipfw/ip_fw_iface.c
437
IPFW_WUNLOCK(ch);
sys/netpfil/ipfw/ip_fw_iface.c
444
handle_ifdetach(struct ip_fw_chain *ch, struct ipfw_iface *iif,
sys/netpfil/ipfw/ip_fw_iface.c
449
IPFW_UH_WLOCK_ASSERT(ch);
sys/netpfil/ipfw/ip_fw_iface.c
451
IPFW_WLOCK(ch);
sys/netpfil/ipfw/ip_fw_iface.c
453
ic->cb(ch, ic->cbdata, 0);
sys/netpfil/ipfw/ip_fw_iface.c
454
IPFW_WUNLOCK(ch);
sys/netpfil/ipfw/ip_fw_iface.c
462
struct ip_fw_chain *ch;
sys/netpfil/ipfw/ip_fw_iface.c
499
list_ifaces(struct ip_fw_chain *ch, ip_fw3_opheader *op3,
sys/netpfil/ipfw/ip_fw_iface.c
513
IPFW_UH_RLOCK(ch);
sys/netpfil/ipfw/ip_fw_iface.c
514
ii = CHAIN_TO_II(ch);
sys/netpfil/ipfw/ip_fw_iface.c
527
IPFW_UH_RUNLOCK(ch);
sys/netpfil/ipfw/ip_fw_iface.c
532
da.ch = ch;
sys/netpfil/ipfw/ip_fw_iface.c
537
IPFW_UH_RUNLOCK(ch);
sys/netpfil/ipfw/ip_fw_iface.c
62
#define CHAIN_TO_II(ch) ((struct namedobj_instance *)ch->ifcfg)
sys/netpfil/ipfw/ip_fw_iface.c
66
static void handle_ifdetach(struct ip_fw_chain *ch, struct ipfw_iface *iif,
sys/netpfil/ipfw/ip_fw_iface.c
68
static void handle_ifattach(struct ip_fw_chain *ch, struct ipfw_iface *iif,
sys/netpfil/ipfw/ip_fw_iface.c
70
static int list_ifaces(struct ip_fw_chain *ch, ip_fw3_opheader *op3,
sys/netpfil/ipfw/ip_fw_iface.c
99
struct ip_fw_chain *ch;
sys/netpfil/ipfw/ip_fw_private.h
229
void ipfw_dyn_reset_eaction(struct ip_fw_chain *ch, uint32_t eaction_id,
sys/netpfil/ipfw/ip_fw_private.h
383
typedef void (ipfw_ifc_cb)(struct ip_fw_chain *ch, void *cbdata,
sys/netpfil/ipfw/ip_fw_private.h
427
#define TARG_VAL(ch, k, f) ((struct table_value *)((ch)->valuestate))[k].f
sys/netpfil/ipfw/ip_fw_private.h
428
#define IP_FW_ARG_TABLEARG(ch, a, f) \
sys/netpfil/ipfw/ip_fw_private.h
429
(((a) == IP_FW_TARG) ? TARG_VAL(ch, tablearg, f) : (a))
sys/netpfil/ipfw/ip_fw_private.h
533
#define CHAIN_TO_SRV(ch) ((ch)->srvmap)
sys/netpfil/ipfw/ip_fw_private.h
534
#define SRV_OBJECT(ch, idx) ((ch)->srvstate[(idx)])
sys/netpfil/ipfw/ip_fw_private.h
563
typedef int (ipfw_obj_fname_cb)(struct ip_fw_chain *ch,
sys/netpfil/ipfw/ip_fw_private.h
578
typedef int (ipfw_obj_create_cb)(struct ip_fw_chain *ch, struct tid_info *ti,
sys/netpfil/ipfw/ip_fw_private.h
584
typedef void (ipfw_obj_destroy_cb)(struct ip_fw_chain *ch,
sys/netpfil/ipfw/ip_fw_private.h
598
typedef int (ipfw_obj_sets_cb)(struct ip_fw_chain *ch,
sys/netpfil/ipfw/ip_fw_private.h
627
void vnet_ipfw_iface_destroy(struct ip_fw_chain *ch);
sys/netpfil/ipfw/ip_fw_private.h
628
int ipfw_iface_ref(struct ip_fw_chain *ch, char *name,
sys/netpfil/ipfw/ip_fw_private.h
630
void ipfw_iface_unref(struct ip_fw_chain *ch, struct ipfw_ifc *ic);
sys/netpfil/ipfw/ip_fw_private.h
631
void ipfw_iface_add_notify(struct ip_fw_chain *ch, struct ipfw_ifc *ic);
sys/netpfil/ipfw/ip_fw_private.h
632
void ipfw_iface_del_notify(struct ip_fw_chain *ch, struct ipfw_ifc *ic);
sys/netpfil/ipfw/ip_fw_sockopt.c
150
static int ref_rule_objects(struct ip_fw_chain *ch, struct ip_fw *rule,
sys/netpfil/ipfw/ip_fw_sockopt.c
152
static int ref_opcode_object(struct ip_fw_chain *ch, ipfw_insn *cmd,
sys/netpfil/ipfw/ip_fw_sockopt.c
155
static void unref_oib_objects(struct ip_fw_chain *ch, ipfw_insn *cmd,
sys/netpfil/ipfw/ip_fw_sockopt.c
1762
dump_named_objects(struct ip_fw_chain *ch, struct dump_args *da,
sys/netpfil/ipfw/ip_fw_sockopt.c
1780
error = export_named_objects(ipfw_get_table_objhash(ch), da, sd);
sys/netpfil/ipfw/ip_fw_sockopt.c
1785
return (export_named_objects(CHAIN_TO_SRV(ch), da, sd));
sys/netpfil/ipfw/ip_fw_sockopt.c
1849
mark_rule_objects(struct ip_fw_chain *ch, struct ip_fw *rule,
sys/netpfil/ipfw/ip_fw_sockopt.c
2020
create_objects_compat(struct ip_fw_chain *ch, ipfw_insn *cmd,
sys/netpfil/ipfw/ip_fw_sockopt.c
2047
error = rw->create_object(ch, ti, &kidx);
sys/netpfil/ipfw/ip_fw_sockopt.c
2057
IPFW_UH_WLOCK(ch);
sys/netpfil/ipfw/ip_fw_sockopt.c
2058
unref_oib_objects(ch, cmd, oib, pidx);
sys/netpfil/ipfw/ip_fw_sockopt.c
2059
IPFW_UH_WUNLOCK(ch);
sys/netpfil/ipfw/ip_fw_sockopt.c
2074
unref_oib_objects(struct ip_fw_chain *ch, ipfw_insn *cmd, struct obj_idx *oib,
sys/netpfil/ipfw/ip_fw_sockopt.c
2081
IPFW_UH_WLOCK_ASSERT(ch);
sys/netpfil/ipfw/ip_fw_sockopt.c
2092
no = rw->find_bykidx(ch, p->kidx);
sys/netpfil/ipfw/ip_fw_sockopt.c
2103
unref_rule_objects(struct ip_fw_chain *ch, struct ip_fw *rule)
sys/netpfil/ipfw/ip_fw_sockopt.c
2112
IPFW_UH_WLOCK_ASSERT(ch);
sys/netpfil/ipfw/ip_fw_sockopt.c
2123
no = rw->find_bykidx(ch, kidx);
sys/netpfil/ipfw/ip_fw_sockopt.c
2133
rw->destroy_object(ch, no);
sys/netpfil/ipfw/ip_fw_sockopt.c
2138
ipfw_tap_free(ch, rule->rulenum);
sys/netpfil/ipfw/ip_fw_sockopt.c
2150
ref_opcode_object(struct ip_fw_chain *ch, ipfw_insn *cmd, struct tid_info *ti,
sys/netpfil/ipfw/ip_fw_sockopt.c
2167
error = rw->find_byname(ch, ti, &no);
sys/netpfil/ipfw/ip_fw_sockopt.c
2200
ref_rule_objects(struct ip_fw_chain *ch, struct ip_fw *rule,
sys/netpfil/ipfw/ip_fw_sockopt.c
2213
IPFW_UH_WLOCK_ASSERT(ch);
sys/netpfil/ipfw/ip_fw_sockopt.c
2220
error = ref_opcode_object(ch, cmd, ti, pidx, &unresolved);
sys/netpfil/ipfw/ip_fw_sockopt.c
2235
unref_oib_objects(ch, rule->cmd, oib, pidx);
sys/netpfil/ipfw/ip_fw_sockopt.c
2241
error = create_objects_compat(ch, rule->cmd, oib, pidx, ti);
sys/netpfil/ipfw/ip_fw_sockopt.c
3290
ipfw_init_srv(struct ip_fw_chain *ch)
sys/netpfil/ipfw/ip_fw_sockopt.c
3292
ch->srvmap = ipfw_objhash_create(IPFW_OBJECTS_DEFAULT,
sys/netpfil/ipfw/ip_fw_sockopt.c
3294
ch->srvstate = malloc(sizeof(void *) * IPFW_OBJECTS_DEFAULT,
sys/netpfil/ipfw/ip_fw_sockopt.c
3299
ipfw_destroy_srv(struct ip_fw_chain *ch)
sys/netpfil/ipfw/ip_fw_sockopt.c
3301
free(ch->srvstate, M_IPFW);
sys/netpfil/ipfw/ip_fw_sockopt.c
3302
ipfw_objhash_destroy(ch->srvmap);
sys/netpfil/ipfw/ip_fw_sockopt.c
815
move_objects(struct ip_fw_chain *ch, ipfw_range_tlv *rt)
sys/netpfil/ipfw/ip_fw_sockopt.c
823
IPFW_UH_WLOCK_ASSERT(ch);
sys/netpfil/ipfw/ip_fw_sockopt.c
826
for (c = 0, i = 0; i < ch->n_rules - 1; i++) {
sys/netpfil/ipfw/ip_fw_sockopt.c
827
rule = ch->map[i];
sys/netpfil/ipfw/ip_fw_sockopt.c
845
if (rw->manage_sets(ch, kidx, 1, COUNT_ONE) != 0)
sys/netpfil/ipfw/ip_fw_sockopt.c
853
for (c = 0, i = 0; (i < ch->n_rules - 1) && c == 0; i++) {
sys/netpfil/ipfw/ip_fw_sockopt.c
854
rule = ch->map[i];
sys/netpfil/ipfw/ip_fw_sockopt.c
867
c = rw->manage_sets(ch, kidx,
sys/netpfil/ipfw/ip_fw_sockopt.c
872
for (i = 0; i < ch->n_rules - 1; i++) {
sys/netpfil/ipfw/ip_fw_sockopt.c
873
rule = ch->map[i];
sys/netpfil/ipfw/ip_fw_sockopt.c
886
rw->manage_sets(ch, kidx,
sys/netpfil/ipfw/ip_fw_sockopt.c
891
rw->manage_sets(ch, kidx,
sys/netpfil/ipfw/ip_fw_table.c
1009
ipfw_unref_table_values(ch, tc, ta, astate_old, &ti_old);
sys/netpfil/ipfw/ip_fw_table.c
101
#define KIDX_TO_TI(ch, k) (&(((struct table_info *)(ch)->tablestate)[k]))
sys/netpfil/ipfw/ip_fw_table.c
1010
IPFW_UH_WUNLOCK(ch);
sys/netpfil/ipfw/ip_fw_table.c
1028
swap_table(struct ip_fw_chain *ch, ip_fw3_opheader *op3,
sys/netpfil/ipfw/ip_fw_table.c
1042
error = swap_tables(ch, &ti_a, &ti_b);
sys/netpfil/ipfw/ip_fw_table.c
106
get_table_value(struct ip_fw_chain *ch, struct table_config *tc, uint32_t kidx)
sys/netpfil/ipfw/ip_fw_table.c
1077
swap_tables(struct ip_fw_chain *ch, struct tid_info *a,
sys/netpfil/ipfw/ip_fw_table.c
1091
IPFW_UH_WLOCK(ch);
sys/netpfil/ipfw/ip_fw_table.c
1092
ni = CHAIN_TO_NI(ch);
sys/netpfil/ipfw/ip_fw_table.c
1094
IPFW_UH_WUNLOCK(ch);
sys/netpfil/ipfw/ip_fw_table.c
1098
IPFW_UH_WUNLOCK(ch);
sys/netpfil/ipfw/ip_fw_table.c
110
pval = (struct table_value *)ch->valuestate;
sys/netpfil/ipfw/ip_fw_table.c
1104
IPFW_UH_WUNLOCK(ch);
sys/netpfil/ipfw/ip_fw_table.c
1110
IPFW_UH_WUNLOCK(ch);
sys/netpfil/ipfw/ip_fw_table.c
1117
IPFW_UH_WUNLOCK(ch);
sys/netpfil/ipfw/ip_fw_table.c
1123
IPFW_UH_WUNLOCK(ch);
sys/netpfil/ipfw/ip_fw_table.c
1128
tablestate = (struct table_info *)ch->tablestate;
sys/netpfil/ipfw/ip_fw_table.c
1134
IPFW_WLOCK(ch);
sys/netpfil/ipfw/ip_fw_table.c
1145
IPFW_WUNLOCK(ch);
sys/netpfil/ipfw/ip_fw_table.c
1157
IPFW_UH_WUNLOCK(ch);
sys/netpfil/ipfw/ip_fw_table.c
1170
destroy_table(struct ip_fw_chain *ch, struct tid_info *ti)
sys/netpfil/ipfw/ip_fw_table.c
1175
IPFW_UH_WLOCK(ch);
sys/netpfil/ipfw/ip_fw_table.c
1177
ni = CHAIN_TO_NI(ch);
sys/netpfil/ipfw/ip_fw_table.c
1179
IPFW_UH_WUNLOCK(ch);
sys/netpfil/ipfw/ip_fw_table.c
1185
IPFW_UH_WUNLOCK(ch);
sys/netpfil/ipfw/ip_fw_table.c
1189
IPFW_WLOCK(ch);
sys/netpfil/ipfw/ip_fw_table.c
1190
unlink_table(ch, tc);
sys/netpfil/ipfw/ip_fw_table.c
1191
IPFW_WUNLOCK(ch);
sys/netpfil/ipfw/ip_fw_table.c
1199
ipfw_unref_table_values(ch, tc, tc->ta, tc->astate, &tc->ti_copy);
sys/netpfil/ipfw/ip_fw_table.c
1200
IPFW_UH_WUNLOCK(ch);
sys/netpfil/ipfw/ip_fw_table.c
1213
ipfw_resize_tables(struct ip_fw_chain *ch, unsigned int ntables)
sys/netpfil/ipfw/ip_fw_table.c
1236
IPFW_UH_WLOCK(ch);
sys/netpfil/ipfw/ip_fw_table.c
1239
ni = CHAIN_TO_NI(ch);
sys/netpfil/ipfw/ip_fw_table.c
1246
IPFW_UH_WUNLOCK(ch);
sys/netpfil/ipfw/ip_fw_table.c
1251
memcpy(tablestate, ch->tablestate, sizeof(struct table_info) * tbl);
sys/netpfil/ipfw/ip_fw_table.c
1254
IPFW_WLOCK(ch);
sys/netpfil/ipfw/ip_fw_table.c
1257
old_tablestate = ch->tablestate;
sys/netpfil/ipfw/ip_fw_table.c
1258
ch->tablestate = tablestate;
sys/netpfil/ipfw/ip_fw_table.c
1263
IPFW_WUNLOCK(ch);
sys/netpfil/ipfw/ip_fw_table.c
1266
ti = (struct table_info *)ch->tablestate;
sys/netpfil/ipfw/ip_fw_table.c
1277
IPFW_UH_WUNLOCK(ch);
sys/netpfil/ipfw/ip_fw_table.c
1290
ipfw_objhash_lookup_table_kidx(struct ip_fw_chain *ch, uint32_t kidx)
sys/netpfil/ipfw/ip_fw_table.c
1293
return (ipfw_objhash_lookup_kidx(CHAIN_TO_NI(ch), kidx));
sys/netpfil/ipfw/ip_fw_table.c
1301
ipfw_ref_table(struct ip_fw_chain *ch, ipfw_obj_ntlv *ntlv, uint32_t *kidx)
sys/netpfil/ipfw/ip_fw_table.c
1307
IPFW_UH_WLOCK_ASSERT(ch);
sys/netpfil/ipfw/ip_fw_table.c
1310
error = find_table_err(CHAIN_TO_NI(ch), &ti, &tc);
sys/netpfil/ipfw/ip_fw_table.c
1324
ipfw_unref_table(struct ip_fw_chain *ch, uint32_t kidx)
sys/netpfil/ipfw/ip_fw_table.c
1330
IPFW_UH_WLOCK_ASSERT(ch);
sys/netpfil/ipfw/ip_fw_table.c
1331
ni = CHAIN_TO_NI(ch);
sys/netpfil/ipfw/ip_fw_table.c
1344
ipfw_lookup_table(struct ip_fw_chain *ch, uint32_t tbl, uint16_t plen,
sys/netpfil/ipfw/ip_fw_table.c
1349
ti = KIDX_TO_TI(ch, tbl);
sys/netpfil/ipfw/ip_fw_table.c
1372
list_tables(struct ip_fw_chain *ch, ip_fw3_opheader *op3,
sys/netpfil/ipfw/ip_fw_table.c
1384
IPFW_UH_RLOCK(ch);
sys/netpfil/ipfw/ip_fw_table.c
1385
error = export_tables(ch, olh, sd);
sys/netpfil/ipfw/ip_fw_table.c
1386
IPFW_UH_RUNLOCK(ch);
sys/netpfil/ipfw/ip_fw_table.c
1400
describe_table(struct ip_fw_chain *ch, ip_fw3_opheader *op3,
sys/netpfil/ipfw/ip_fw_table.c
1415
IPFW_UH_RLOCK(ch);
sys/netpfil/ipfw/ip_fw_table.c
1416
if ((tc = find_table(CHAIN_TO_NI(ch), &ti)) == NULL) {
sys/netpfil/ipfw/ip_fw_table.c
1417
IPFW_UH_RUNLOCK(ch);
sys/netpfil/ipfw/ip_fw_table.c
1421
export_table_info(ch, tc, (ipfw_xtable_info *)(oh + 1));
sys/netpfil/ipfw/ip_fw_table.c
1422
IPFW_UH_RUNLOCK(ch);
sys/netpfil/ipfw/ip_fw_table.c
1435
modify_table(struct ip_fw_chain *ch, ip_fw3_opheader *op3,
sys/netpfil/ipfw/ip_fw_table.c
1462
IPFW_UH_WLOCK(ch);
sys/netpfil/ipfw/ip_fw_table.c
1463
ni = CHAIN_TO_NI(ch);
sys/netpfil/ipfw/ip_fw_table.c
1465
IPFW_UH_WUNLOCK(ch);
sys/netpfil/ipfw/ip_fw_table.c
1471
IPFW_UH_WUNLOCK(ch);
sys/netpfil/ipfw/ip_fw_table.c
1479
IPFW_UH_WUNLOCK(ch);
sys/netpfil/ipfw/ip_fw_table.c
1492
create_table(struct ip_fw_chain *ch, ip_fw3_opheader *op3,
sys/netpfil/ipfw/ip_fw_table.c
1526
ni = CHAIN_TO_NI(ch);
sys/netpfil/ipfw/ip_fw_table.c
1528
IPFW_UH_WLOCK(ch);
sys/netpfil/ipfw/ip_fw_table.c
1530
IPFW_UH_WUNLOCK(ch);
sys/netpfil/ipfw/ip_fw_table.c
1533
rv = create_table_internal(ch, &ti, aname, i, NULL, 0);
sys/netpfil/ipfw/ip_fw_table.c
1534
IPFW_UH_WUNLOCK(ch);
sys/netpfil/ipfw/ip_fw_table.c
1549
create_table_internal(struct ip_fw_chain *ch, struct tid_info *ti,
sys/netpfil/ipfw/ip_fw_table.c
1557
IPFW_UH_WLOCK_ASSERT(ch);
sys/netpfil/ipfw/ip_fw_table.c
1559
ni = CHAIN_TO_NI(ch);
sys/netpfil/ipfw/ip_fw_table.c
1561
ta = find_table_algo(CHAIN_TO_TCFG(ch), ti, aname);
sys/netpfil/ipfw/ip_fw_table.c
1565
tc = alloc_table_config(ch, ti, ta, aname, i->tflags);
sys/netpfil/ipfw/ip_fw_table.c
1604
link_table(ch, tc);
sys/netpfil/ipfw/ip_fw_table.c
1637
ipfw_get_table_objhash(struct ip_fw_chain *ch)
sys/netpfil/ipfw/ip_fw_table.c
1640
return (CHAIN_TO_NI(ch));
sys/netpfil/ipfw/ip_fw_table.c
1651
ipfw_export_table_ntlv(struct ip_fw_chain *ch, uint32_t kidx,
sys/netpfil/ipfw/ip_fw_table.c
1658
ni = CHAIN_TO_NI(ch);
sys/netpfil/ipfw/ip_fw_table.c
1676
struct ip_fw_chain *ch;
sys/netpfil/ipfw/ip_fw_table.c
1708
table_get_count(struct ip_fw_chain *ch, struct table_config *tc)
sys/netpfil/ipfw/ip_fw_table.c
1714
ti = KIDX_TO_TI(ch, tc->no.kidx);
sys/netpfil/ipfw/ip_fw_table.c
1736
export_table_info(struct ip_fw_chain *ch, struct table_config *tc,
sys/netpfil/ipfw/ip_fw_table.c
1748
i->count = table_get_count(ch, tc);
sys/netpfil/ipfw/ip_fw_table.c
1754
ti = KIDX_TO_TI(ch, tc->no.kidx);
sys/netpfil/ipfw/ip_fw_table.c
1770
struct ip_fw_chain *ch;
sys/netpfil/ipfw/ip_fw_table.c
1786
export_table_info(dta->ch, (struct table_config *)no, i);
sys/netpfil/ipfw/ip_fw_table.c
1799
export_tables(struct ip_fw_chain *ch, ipfw_obj_lheader *olh,
sys/netpfil/ipfw/ip_fw_table.c
1806
count = ipfw_objhash_count(CHAIN_TO_NI(ch));
sys/netpfil/ipfw/ip_fw_table.c
1820
dta.ch = ch;
sys/netpfil/ipfw/ip_fw_table.c
1823
ipfw_objhash_foreach(CHAIN_TO_NI(ch), export_table_internal, &dta);
sys/netpfil/ipfw/ip_fw_table.c
1837
dump_table_v1(struct ip_fw_chain *ch, ip_fw3_opheader *op3,
sys/netpfil/ipfw/ip_fw_table.c
1856
IPFW_UH_RLOCK(ch);
sys/netpfil/ipfw/ip_fw_table.c
1857
if ((tc = find_table(CHAIN_TO_NI(ch), &ti)) == NULL) {
sys/netpfil/ipfw/ip_fw_table.c
1858
IPFW_UH_RUNLOCK(ch);
sys/netpfil/ipfw/ip_fw_table.c
1861
export_table_info(ch, tc, i);
sys/netpfil/ipfw/ip_fw_table.c
187
create_table_compat(struct ip_fw_chain *ch, struct tid_info *ti,
sys/netpfil/ipfw/ip_fw_table.c
1870
IPFW_UH_RUNLOCK(ch);
sys/netpfil/ipfw/ip_fw_table.c
1878
da.ch = ch;
sys/netpfil/ipfw/ip_fw_table.c
1879
da.ti = KIDX_TO_TI(ch, tc->no.kidx);
sys/netpfil/ipfw/ip_fw_table.c
1886
IPFW_UH_RUNLOCK(ch);
sys/netpfil/ipfw/ip_fw_table.c
1922
pval = get_table_value(da->ch, da->tc, tent->v.kidx);
sys/netpfil/ipfw/ip_fw_table.c
1960
ipfw_foreach_table_tentry(struct ip_fw_chain *ch, uint32_t kidx,
sys/netpfil/ipfw/ip_fw_table.c
1968
ni = CHAIN_TO_NI(ch);
sys/netpfil/ipfw/ip_fw_table.c
197
error = create_table_internal(ch, ti, NULL, &xi, pkidx, 1);
sys/netpfil/ipfw/ip_fw_table.c
1977
da.ch = ch;
sys/netpfil/ipfw/ip_fw_table.c
1978
da.ti = KIDX_TO_TI(ch, tc->no.kidx);
sys/netpfil/ipfw/ip_fw_table.c
2052
ipfw_add_table_algo(struct ip_fw_chain *ch, struct table_algo *ta, size_t size,
sys/netpfil/ipfw/ip_fw_table.c
2073
tcfg = CHAIN_TO_TCFG(ch);
sys/netpfil/ipfw/ip_fw_table.c
2096
ipfw_del_table_algo(struct ip_fw_chain *ch, int idx)
sys/netpfil/ipfw/ip_fw_table.c
2101
tcfg = CHAIN_TO_TCFG(ch);
sys/netpfil/ipfw/ip_fw_table.c
2124
list_table_algo(struct ip_fw_chain *ch, ip_fw3_opheader *op3,
sys/netpfil/ipfw/ip_fw_table.c
213
find_ref_table(struct ip_fw_chain *ch, struct tid_info *ti,
sys/netpfil/ipfw/ip_fw_table.c
2139
IPFW_UH_RLOCK(ch);
sys/netpfil/ipfw/ip_fw_table.c
2140
tcfg = CHAIN_TO_TCFG(ch);
sys/netpfil/ipfw/ip_fw_table.c
2150
IPFW_UH_RUNLOCK(ch);
sys/netpfil/ipfw/ip_fw_table.c
2164
IPFW_UH_RUNLOCK(ch);
sys/netpfil/ipfw/ip_fw_table.c
222
IPFW_UH_WLOCK_ASSERT(ch);
sys/netpfil/ipfw/ip_fw_table.c
224
ni = CHAIN_TO_NI(ch);
sys/netpfil/ipfw/ip_fw_table.c
2249
table_findbyname(struct ip_fw_chain *ch, struct tid_info *ti,
sys/netpfil/ipfw/ip_fw_table.c
2255
IPFW_UH_WLOCK_ASSERT(ch);
sys/netpfil/ipfw/ip_fw_table.c
2257
error = find_table_err(CHAIN_TO_NI(ch), ti, &tc);
sys/netpfil/ipfw/ip_fw_table.c
2267
table_findbykidx(struct ip_fw_chain *ch, uint32_t idx)
sys/netpfil/ipfw/ip_fw_table.c
2272
IPFW_UH_WLOCK_ASSERT(ch);
sys/netpfil/ipfw/ip_fw_table.c
2273
ni = CHAIN_TO_NI(ch);
sys/netpfil/ipfw/ip_fw_table.c
2281
table_manage_sets(struct ip_fw_chain *ch, uint32_t set, uint8_t new_set,
sys/netpfil/ipfw/ip_fw_table.c
2314
return (ipfw_obj_manage_sets(CHAIN_TO_NI(ch), IPFW_TLV_TBL_NAME,
sys/netpfil/ipfw/ip_fw_table.c
2326
table_manage_sets_all(struct ip_fw_chain *ch, uint32_t set, uint8_t new_set,
sys/netpfil/ipfw/ip_fw_table.c
2344
return (table_manage_sets(ch, set, new_set, cmd));
sys/netpfil/ipfw/ip_fw_table.c
2347
return (ipfw_obj_manage_sets(CHAIN_TO_NI(ch), IPFW_TLV_TBL_NAME,
sys/netpfil/ipfw/ip_fw_table.c
2463
ipfw_switch_tables_namespace(struct ip_fw_chain *ch, unsigned int sets)
sys/netpfil/ipfw/ip_fw_table.c
2474
IPFW_UH_WLOCK(ch);
sys/netpfil/ipfw/ip_fw_table.c
2477
IPFW_UH_WUNLOCK(ch);
sys/netpfil/ipfw/ip_fw_table.c
2480
ni = CHAIN_TO_NI(ch);
sys/netpfil/ipfw/ip_fw_table.c
2488
IPFW_UH_WUNLOCK(ch);
sys/netpfil/ipfw/ip_fw_table.c
2495
for (i = 0; i < ch->n_rules; i++) {
sys/netpfil/ipfw/ip_fw_table.c
2496
rule = ch->map[i];
sys/netpfil/ipfw/ip_fw_table.c
2516
IPFW_UH_WUNLOCK(ch);
sys/netpfil/ipfw/ip_fw_table.c
252
error = create_table_compat(ch, ti, &kidx);
sys/netpfil/ipfw/ip_fw_table.c
2522
IPFW_UH_WUNLOCK(ch);
sys/netpfil/ipfw/ip_fw_table.c
2609
alloc_table_config(struct ip_fw_chain *ch, struct tid_info *ti,
sys/netpfil/ipfw/ip_fw_table.c
2643
error = ta->init(ch, &tc->astate, &tc->ti_copy, aname, tflags);
sys/netpfil/ipfw/ip_fw_table.c
2675
link_table(struct ip_fw_chain *ch, struct table_config *tc)
sys/netpfil/ipfw/ip_fw_table.c
2681
IPFW_UH_WLOCK_ASSERT(ch);
sys/netpfil/ipfw/ip_fw_table.c
2683
ni = CHAIN_TO_NI(ch);
sys/netpfil/ipfw/ip_fw_table.c
2688
ti = KIDX_TO_TI(ch, kidx);
sys/netpfil/ipfw/ip_fw_table.c
2704
unlink_table(struct ip_fw_chain *ch, struct table_config *tc)
sys/netpfil/ipfw/ip_fw_table.c
2710
IPFW_UH_WLOCK_ASSERT(ch);
sys/netpfil/ipfw/ip_fw_table.c
2711
IPFW_WLOCK_ASSERT(ch);
sys/netpfil/ipfw/ip_fw_table.c
2713
ni = CHAIN_TO_NI(ch);
sys/netpfil/ipfw/ip_fw_table.c
2718
ti = KIDX_TO_TI(ch, kidx);
sys/netpfil/ipfw/ip_fw_table.c
273
rollback_added_entries(struct ip_fw_chain *ch, struct table_config *tc,
sys/netpfil/ipfw/ip_fw_table.c
2760
ipfw_destroy_tables(struct ip_fw_chain *ch, int last)
sys/netpfil/ipfw/ip_fw_table.c
2767
IPFW_UH_WLOCK(ch);
sys/netpfil/ipfw/ip_fw_table.c
2768
IPFW_WLOCK(ch);
sys/netpfil/ipfw/ip_fw_table.c
2769
ipfw_objhash_foreach(CHAIN_TO_NI(ch), destroy_table_locked, ch);
sys/netpfil/ipfw/ip_fw_table.c
2770
IPFW_WUNLOCK(ch);
sys/netpfil/ipfw/ip_fw_table.c
2771
IPFW_UH_WUNLOCK(ch);
sys/netpfil/ipfw/ip_fw_table.c
2774
free(ch->tablestate, M_IPFW);
sys/netpfil/ipfw/ip_fw_table.c
2776
ipfw_table_value_destroy(ch, last);
sys/netpfil/ipfw/ip_fw_table.c
2777
ipfw_table_algo_destroy(ch);
sys/netpfil/ipfw/ip_fw_table.c
2779
ipfw_objhash_destroy(CHAIN_TO_NI(ch));
sys/netpfil/ipfw/ip_fw_table.c
2780
free(CHAIN_TO_TCFG(ch), M_IPFW);
sys/netpfil/ipfw/ip_fw_table.c
2787
ipfw_init_tables(struct ip_fw_chain *ch, int first)
sys/netpfil/ipfw/ip_fw_table.c
2792
ch->tablestate = malloc(V_fw_tables_max * sizeof(struct table_info),
sys/netpfil/ipfw/ip_fw_table.c
2798
ch->tblcfg = tcfg;
sys/netpfil/ipfw/ip_fw_table.c
2800
ipfw_table_value_init(ch, first);
sys/netpfil/ipfw/ip_fw_table.c
2801
ipfw_table_algo_init(ch);
sys/netpfil/ipfw/ip_fw_table.c
284
IPFW_UH_WLOCK_ASSERT(ch);
sys/netpfil/ipfw/ip_fw_table.c
304
error = ta->prepare_del(ch, ptei, vv);
sys/netpfil/ipfw/ip_fw_table.c
320
prepare_batch_buffer(struct ip_fw_chain *ch, struct table_algo *ta,
sys/netpfil/ipfw/ip_fw_table.c
352
ta->prepare_add(ch, ptei, v) : ta->prepare_del(ch, ptei, v);
sys/netpfil/ipfw/ip_fw_table.c
372
flush_batch_buffer(struct ip_fw_chain *ch, struct table_algo *ta,
sys/netpfil/ipfw/ip_fw_table.c
387
ta->flush_entry(ch, ptei, v);
sys/netpfil/ipfw/ip_fw_table.c
398
ta->flush_entry(ch, &tei[i], v);
sys/netpfil/ipfw/ip_fw_table.c
420
add_table_entry(struct ip_fw_chain *ch, struct tid_info *ti,
sys/netpfil/ipfw/ip_fw_table.c
431
IPFW_UH_WLOCK(ch);
sys/netpfil/ipfw/ip_fw_table.c
436
error = find_ref_table(ch, ti, tei, count, OP_ADD, &tc);
sys/netpfil/ipfw/ip_fw_table.c
438
IPFW_UH_WUNLOCK(ch);
sys/netpfil/ipfw/ip_fw_table.c
448
error = prepare_batch_buffer(ch, ta, tei, count, OP_ADD, &ta_buf_m);
sys/netpfil/ipfw/ip_fw_table.c
455
error = ipfw_link_table_values(ch, tc, tei, count, flags);
sys/netpfil/ipfw/ip_fw_table.c
464
error = check_table_space(ch, tc, KIDX_TO_TI(ch, kidx), count);
sys/netpfil/ipfw/ip_fw_table.c
474
IPFW_WLOCK(ch);
sys/netpfil/ipfw/ip_fw_table.c
490
error = ta->add(tc->astate, KIDX_TO_TI(ch, kidx),
sys/netpfil/ipfw/ip_fw_table.c
513
rollback_added_entries(ch, tc, KIDX_TO_TI(ch, kidx),
sys/netpfil/ipfw/ip_fw_table.c
520
IPFW_WUNLOCK(ch);
sys/netpfil/ipfw/ip_fw_table.c
522
ipfw_garbage_table_values(ch, tc, tei, count, rollback);
sys/netpfil/ipfw/ip_fw_table.c
526
check_table_space(ch, tc, KIDX_TO_TI(ch, kidx), 0);
sys/netpfil/ipfw/ip_fw_table.c
532
IPFW_UH_WUNLOCK(ch);
sys/netpfil/ipfw/ip_fw_table.c
534
flush_batch_buffer(ch, ta, tei, count, rollback, ta_buf_m, ta_buf);
sys/netpfil/ipfw/ip_fw_table.c
545
del_table_entry(struct ip_fw_chain *ch, struct tid_info *ti,
sys/netpfil/ipfw/ip_fw_table.c
559
IPFW_UH_WLOCK(ch);
sys/netpfil/ipfw/ip_fw_table.c
560
error = find_ref_table(ch, ti, tei, count, OP_DEL, &tc);
sys/netpfil/ipfw/ip_fw_table.c
562
IPFW_UH_WUNLOCK(ch);
sys/netpfil/ipfw/ip_fw_table.c
570
error = prepare_batch_buffer(ch, ta, tei, count, OP_DEL, &ta_buf_m);
sys/netpfil/ipfw/ip_fw_table.c
582
IPFW_UH_WUNLOCK(ch);
sys/netpfil/ipfw/ip_fw_table.c
591
IPFW_WLOCK(ch);
sys/netpfil/ipfw/ip_fw_table.c
596
error = ta->del(tc->astate, KIDX_TO_TI(ch, kidx), ptei, v,
sys/netpfil/ipfw/ip_fw_table.c
605
IPFW_WUNLOCK(ch);
sys/netpfil/ipfw/ip_fw_table.c
608
ipfw_garbage_table_values(ch, tc, tei, count, 0);
sys/netpfil/ipfw/ip_fw_table.c
612
check_table_space(ch, tc, KIDX_TO_TI(ch, kidx), 0);
sys/netpfil/ipfw/ip_fw_table.c
615
IPFW_UH_WUNLOCK(ch);
sys/netpfil/ipfw/ip_fw_table.c
621
flush_batch_buffer(ch, ta, tei, count, 0, ta_buf_m, ta_buf);
sys/netpfil/ipfw/ip_fw_table.c
641
check_table_space(struct ip_fw_chain *ch, struct table_config *tc,
sys/netpfil/ipfw/ip_fw_table.c
649
IPFW_UH_WLOCK_ASSERT(ch);
sys/netpfil/ipfw/ip_fw_table.c
677
ti = KIDX_TO_TI(ch, tc->no.kidx);
sys/netpfil/ipfw/ip_fw_table.c
68
static struct table_config *alloc_table_config(struct ip_fw_chain *ch,
sys/netpfil/ipfw/ip_fw_table.c
690
IPFW_WLOCK(ch);
sys/netpfil/ipfw/ip_fw_table.c
692
IPFW_WUNLOCK(ch);
sys/netpfil/ipfw/ip_fw_table.c
713
manage_table_ent_v1(struct ip_fw_chain *ch, ip_fw3_opheader *op3,
sys/netpfil/ipfw/ip_fw_table.c
72
static int create_table_internal(struct ip_fw_chain *ch, struct tid_info *ti,
sys/netpfil/ipfw/ip_fw_table.c
74
static void link_table(struct ip_fw_chain *ch, struct table_config *tc);
sys/netpfil/ipfw/ip_fw_table.c
75
static void unlink_table(struct ip_fw_chain *ch, struct table_config *tc);
sys/netpfil/ipfw/ip_fw_table.c
76
static int find_ref_table(struct ip_fw_chain *ch, struct tid_info *ti,
sys/netpfil/ipfw/ip_fw_table.c
796
add_table_entry(ch, &ti, tei_buf, ctlv->flags, ctlv->count) :
sys/netpfil/ipfw/ip_fw_table.c
797
del_table_entry(ch, &ti, tei_buf, ctlv->flags, ctlv->count);
sys/netpfil/ipfw/ip_fw_table.c
80
static int export_tables(struct ip_fw_chain *ch, ipfw_obj_lheader *olh,
sys/netpfil/ipfw/ip_fw_table.c
82
static void export_table_info(struct ip_fw_chain *ch, struct table_config *tc,
sys/netpfil/ipfw/ip_fw_table.c
835
find_table_entry(struct ip_fw_chain *ch, ip_fw3_opheader *op3,
sys/netpfil/ipfw/ip_fw_table.c
86
static int swap_tables(struct ip_fw_chain *ch, struct tid_info *a,
sys/netpfil/ipfw/ip_fw_table.c
864
IPFW_UH_RLOCK(ch);
sys/netpfil/ipfw/ip_fw_table.c
865
ni = CHAIN_TO_NI(ch);
sys/netpfil/ipfw/ip_fw_table.c
871
IPFW_UH_RUNLOCK(ch);
sys/netpfil/ipfw/ip_fw_table.c
877
IPFW_UH_RUNLOCK(ch);
sys/netpfil/ipfw/ip_fw_table.c
881
kti = KIDX_TO_TI(ch, tc->no.kidx);
sys/netpfil/ipfw/ip_fw_table.c
885
pval = get_table_value(ch, tc, tent->v.kidx);
sys/netpfil/ipfw/ip_fw_table.c
888
IPFW_UH_RUNLOCK(ch);
sys/netpfil/ipfw/ip_fw_table.c
90
static int check_table_space(struct ip_fw_chain *ch, struct table_config *tc,
sys/netpfil/ipfw/ip_fw_table.c
901
flush_table_v0(struct ip_fw_chain *ch, ip_fw3_opheader *op3,
sys/netpfil/ipfw/ip_fw_table.c
915
error = destroy_table(ch, &ti);
sys/netpfil/ipfw/ip_fw_table.c
917
error = flush_table(ch, &ti);
sys/netpfil/ipfw/ip_fw_table.c
92
static int destroy_table(struct ip_fw_chain *ch, struct tid_info *ti);
sys/netpfil/ipfw/ip_fw_table.c
934
flush_table(struct ip_fw_chain *ch, struct tid_info *ti)
sys/netpfil/ipfw/ip_fw_table.c
950
IPFW_UH_WLOCK(ch);
sys/netpfil/ipfw/ip_fw_table.c
951
ni = CHAIN_TO_NI(ch);
sys/netpfil/ipfw/ip_fw_table.c
953
IPFW_UH_WUNLOCK(ch);
sys/netpfil/ipfw/ip_fw_table.c
961
IPFW_UH_WUNLOCK(ch);
sys/netpfil/ipfw/ip_fw_table.c
966
ta->print_config(tc->astate, KIDX_TO_TI(ch, tc->no.kidx),
sys/netpfil/ipfw/ip_fw_table.c
977
error = ta->init(ch, &astate_new, &ti_new, pstate, tflags);
sys/netpfil/ipfw/ip_fw_table.c
984
IPFW_UH_WUNLOCK(ch);
sys/netpfil/ipfw/ip_fw_table.c
988
ni = CHAIN_TO_NI(ch);
sys/netpfil/ipfw/ip_fw_table.c
990
tablestate = (struct table_info *)ch->tablestate;
sys/netpfil/ipfw/ip_fw_table.c
992
IPFW_WLOCK(ch);
sys/netpfil/ipfw/ip_fw_table.c
995
IPFW_WUNLOCK(ch);
sys/netpfil/ipfw/ip_fw_table.h
101
typedef int (ta_prepare_add)(struct ip_fw_chain *ch, struct tentry_info *tei,
sys/netpfil/ipfw/ip_fw_table.h
103
typedef int (ta_prepare_del)(struct ip_fw_chain *ch, struct tentry_info *tei,
sys/netpfil/ipfw/ip_fw_table.h
109
typedef void (ta_flush_entry)(struct ip_fw_chain *ch, struct tentry_info *tei,
sys/netpfil/ipfw/ip_fw_table.h
168
int ipfw_add_table_algo(struct ip_fw_chain *ch, struct table_algo *ta,
sys/netpfil/ipfw/ip_fw_table.h
170
void ipfw_del_table_algo(struct ip_fw_chain *ch, int idx);
sys/netpfil/ipfw/ip_fw_table.h
177
int add_table_entry(struct ip_fw_chain *ch, struct tid_info *ti,
sys/netpfil/ipfw/ip_fw_table.h
179
int del_table_entry(struct ip_fw_chain *ch, struct tid_info *ti,
sys/netpfil/ipfw/ip_fw_table.h
181
int flush_table(struct ip_fw_chain *ch, struct tid_info *ti);
sys/netpfil/ipfw/ip_fw_table.h
185
void ipfw_table_value_init(struct ip_fw_chain *ch, int first);
sys/netpfil/ipfw/ip_fw_table.h
186
void ipfw_table_value_destroy(struct ip_fw_chain *ch, int last);
sys/netpfil/ipfw/ip_fw_table.h
187
int ipfw_link_table_values(struct ip_fw_chain *ch, struct table_config *tc,
sys/netpfil/ipfw/ip_fw_table.h
189
void ipfw_garbage_table_values(struct ip_fw_chain *ch, struct table_config *tc,
sys/netpfil/ipfw/ip_fw_table.h
193
void ipfw_unref_table_values(struct ip_fw_chain *ch, struct table_config *tc,
sys/netpfil/ipfw/ip_fw_table.h
200
int ipfw_export_table_ntlv(struct ip_fw_chain *ch, uint32_t kidx,
sys/netpfil/ipfw/ip_fw_table.h
203
struct namedobj_instance *ipfw_get_table_objhash(struct ip_fw_chain *ch);
sys/netpfil/ipfw/ip_fw_table.h
206
int ipfw_move_tables_sets(struct ip_fw_chain *ch, ipfw_range_tlv *rt,
sys/netpfil/ipfw/ip_fw_table.h
208
void ipfw_swap_tables_sets(struct ip_fw_chain *ch, uint32_t old_set,
sys/netpfil/ipfw/ip_fw_table.h
210
int ipfw_foreach_table_tentry(struct ip_fw_chain *ch, uint32_t kidx,
sys/netpfil/ipfw/ip_fw_table.h
98
typedef int (ta_init)(struct ip_fw_chain *ch, void **ta_state,
sys/netpfil/ipfw/ip_fw_table_algo.c
1279
ta_init_chash(struct ip_fw_chain *ch, void **ta_state, struct table_info *ti,
sys/netpfil/ipfw/ip_fw_table_algo.c
1537
ta_prepare_add_chash(struct ip_fw_chain *ch, struct tentry_info *tei,
sys/netpfil/ipfw/ip_fw_table_algo.c
1634
ta_prepare_del_chash(struct ip_fw_chain *ch, struct tentry_info *tei,
sys/netpfil/ipfw/ip_fw_table_algo.c
1697
ta_flush_chash_entry(struct ip_fw_chain *ch, struct tentry_info *tei,
sys/netpfil/ipfw/ip_fw_table_algo.c
1928
struct ip_fw_chain *ch;
sys/netpfil/ipfw/ip_fw_table_algo.c
1946
static int ta_init_ifidx(struct ip_fw_chain *ch, void **ta_state,
sys/netpfil/ipfw/ip_fw_table_algo.c
1954
static int ta_prepare_add_ifidx(struct ip_fw_chain *ch, struct tentry_info *tei,
sys/netpfil/ipfw/ip_fw_table_algo.c
1958
static int ta_prepare_del_ifidx(struct ip_fw_chain *ch, struct tentry_info *tei,
sys/netpfil/ipfw/ip_fw_table_algo.c
1962
static void ta_flush_ifidx_entry(struct ip_fw_chain *ch,
sys/netpfil/ipfw/ip_fw_table_algo.c
1964
static void if_notifier(struct ip_fw_chain *ch, void *cbdata, uint16_t ifindex);
sys/netpfil/ipfw/ip_fw_table_algo.c
2102
ta_init_ifidx(struct ip_fw_chain *ch, void **ta_state, struct table_info *ti,
sys/netpfil/ipfw/ip_fw_table_algo.c
2113
icfg->ch = ch;
sys/netpfil/ipfw/ip_fw_table_algo.c
2139
struct ip_fw_chain *ch;
sys/netpfil/ipfw/ip_fw_table_algo.c
2141
ch = (struct ip_fw_chain *)arg;
sys/netpfil/ipfw/ip_fw_table_algo.c
2144
ipfw_iface_del_notify(ch, &ife->ic);
sys/netpfil/ipfw/ip_fw_table_algo.c
2145
ipfw_iface_unref(ch, &ife->ic);
sys/netpfil/ipfw/ip_fw_table_algo.c
2157
struct ip_fw_chain *ch;
sys/netpfil/ipfw/ip_fw_table_algo.c
2160
ch = icfg->ch;
sys/netpfil/ipfw/ip_fw_table_algo.c
2165
IPFW_UH_WLOCK(ch);
sys/netpfil/ipfw/ip_fw_table_algo.c
2166
ipfw_objhash_foreach(icfg->ii, destroy_ifidx_locked, ch);
sys/netpfil/ipfw/ip_fw_table_algo.c
2167
IPFW_UH_WUNLOCK(ch);
sys/netpfil/ipfw/ip_fw_table_algo.c
2195
ta_prepare_add_ifidx(struct ip_fw_chain *ch, struct tentry_info *tei,
sys/netpfil/ipfw/ip_fw_table_algo.c
2213
if (ipfw_iface_ref(ch, ifname, &ife->ic) != 0) {
sys/netpfil/ipfw/ip_fw_table_algo.c
2277
ipfw_iface_add_notify(icfg->ch, &ife->ic);
sys/netpfil/ipfw/ip_fw_table_algo.c
2291
ta_prepare_del_ifidx(struct ip_fw_chain *ch, struct tentry_info *tei,
sys/netpfil/ipfw/ip_fw_table_algo.c
2344
ipfw_iface_del_notify(icfg->ch, &ife->ic);
sys/netpfil/ipfw/ip_fw_table_algo.c
2345
ipfw_iface_unref(icfg->ch, &ife->ic);
sys/netpfil/ipfw/ip_fw_table_algo.c
2361
ta_flush_ifidx_entry(struct ip_fw_chain *ch, struct tentry_info *tei,
sys/netpfil/ipfw/ip_fw_table_algo.c
2377
if_notifier(struct ip_fw_chain *ch, void *cbdata, uint16_t ifindex)
sys/netpfil/ipfw/ip_fw_table_algo.c
2647
static int ta_init_numarray(struct ip_fw_chain *ch, void **ta_state,
sys/netpfil/ipfw/ip_fw_table_algo.c
2652
static int ta_prepare_add_numarray(struct ip_fw_chain *ch,
sys/netpfil/ipfw/ip_fw_table_algo.c
2658
static void ta_flush_numarray_entry(struct ip_fw_chain *ch,
sys/netpfil/ipfw/ip_fw_table_algo.c
2720
ta_init_numarray(struct ip_fw_chain *ch, void **ta_state, struct table_info *ti,
sys/netpfil/ipfw/ip_fw_table_algo.c
2774
ta_prepare_add_numarray(struct ip_fw_chain *ch, struct tentry_info *tei,
sys/netpfil/ipfw/ip_fw_table_algo.c
2866
ta_flush_numarray_entry(struct ip_fw_chain *ch, struct tentry_info *tei,
sys/netpfil/ipfw/ip_fw_table_algo.c
3109
static int ta_init_fhash(struct ip_fw_chain *ch, void **ta_state,
sys/netpfil/ipfw/ip_fw_table_algo.c
3121
static int ta_prepare_add_fhash(struct ip_fw_chain *ch,
sys/netpfil/ipfw/ip_fw_table_algo.c
3125
static int ta_prepare_del_fhash(struct ip_fw_chain *ch, struct tentry_info *tei,
sys/netpfil/ipfw/ip_fw_table_algo.c
3129
static void ta_flush_fhash_entry(struct ip_fw_chain *ch, struct tentry_info *tei,
sys/netpfil/ipfw/ip_fw_table_algo.c
3259
ta_init_fhash(struct ip_fw_chain *ch, void **ta_state, struct table_info *ti,
sys/netpfil/ipfw/ip_fw_table_algo.c
3484
ta_prepare_add_fhash(struct ip_fw_chain *ch, struct tentry_info *tei,
sys/netpfil/ipfw/ip_fw_table_algo.c
3576
ta_prepare_del_fhash(struct ip_fw_chain *ch, struct tentry_info *tei,
sys/netpfil/ipfw/ip_fw_table_algo.c
3626
ta_flush_fhash_entry(struct ip_fw_chain *ch, struct tentry_info *tei,
sys/netpfil/ipfw/ip_fw_table_algo.c
3782
static int ta_init_kfib(struct ip_fw_chain *ch, void **ta_state,
sys/netpfil/ipfw/ip_fw_table_algo.c
385
static int ta_init_addr_radix(struct ip_fw_chain *ch, void **ta_state,
sys/netpfil/ipfw/ip_fw_table_algo.c
3868
ta_init_kfib(struct ip_fw_chain *ch, void **ta_state, struct table_info *ti,
sys/netpfil/ipfw/ip_fw_table_algo.c
399
static int ta_prepare_add_addr_radix(struct ip_fw_chain *ch, struct tentry_info *tei,
sys/netpfil/ipfw/ip_fw_table_algo.c
403
static int ta_prepare_del_addr_radix(struct ip_fw_chain *ch, struct tentry_info *tei,
sys/netpfil/ipfw/ip_fw_table_algo.c
4054
ta_init_mac_radix(struct ip_fw_chain *ch, void **ta_state, struct table_info *ti,
sys/netpfil/ipfw/ip_fw_table_algo.c
407
static void ta_flush_radix_entry(struct ip_fw_chain *ch, struct tentry_info *tei,
sys/netpfil/ipfw/ip_fw_table_algo.c
4116
ta_prepare_add_mac_radix(struct ip_fw_chain *ch, struct tentry_info *tei,
sys/netpfil/ipfw/ip_fw_table_algo.c
4205
ta_prepare_del_mac_radix(struct ip_fw_chain *ch, struct tentry_info *tei,
sys/netpfil/ipfw/ip_fw_table_algo.c
4343
ipfw_table_algo_init(struct ip_fw_chain *ch)
sys/netpfil/ipfw/ip_fw_table_algo.c
4351
ipfw_add_table_algo(ch, &addr_radix, sz, &addr_radix.idx);
sys/netpfil/ipfw/ip_fw_table_algo.c
4352
ipfw_add_table_algo(ch, &addr_hash, sz, &addr_hash.idx);
sys/netpfil/ipfw/ip_fw_table_algo.c
4353
ipfw_add_table_algo(ch, &iface_idx, sz, &iface_idx.idx);
sys/netpfil/ipfw/ip_fw_table_algo.c
4354
ipfw_add_table_algo(ch, &number_array, sz, &number_array.idx);
sys/netpfil/ipfw/ip_fw_table_algo.c
4355
ipfw_add_table_algo(ch, &flow_hash, sz, &flow_hash.idx);
sys/netpfil/ipfw/ip_fw_table_algo.c
4356
ipfw_add_table_algo(ch, &addr_kfib, sz, &addr_kfib.idx);
sys/netpfil/ipfw/ip_fw_table_algo.c
4357
ipfw_add_table_algo(ch, &mac_radix, sz, &mac_radix.idx);
sys/netpfil/ipfw/ip_fw_table_algo.c
4361
ipfw_table_algo_destroy(struct ip_fw_chain *ch)
sys/netpfil/ipfw/ip_fw_table_algo.c
4364
ipfw_del_table_algo(ch, addr_radix.idx);
sys/netpfil/ipfw/ip_fw_table_algo.c
4365
ipfw_del_table_algo(ch, addr_hash.idx);
sys/netpfil/ipfw/ip_fw_table_algo.c
4366
ipfw_del_table_algo(ch, iface_idx.idx);
sys/netpfil/ipfw/ip_fw_table_algo.c
4367
ipfw_del_table_algo(ch, number_array.idx);
sys/netpfil/ipfw/ip_fw_table_algo.c
4368
ipfw_del_table_algo(ch, flow_hash.idx);
sys/netpfil/ipfw/ip_fw_table_algo.c
4369
ipfw_del_table_algo(ch, addr_kfib.idx);
sys/netpfil/ipfw/ip_fw_table_algo.c
4370
ipfw_del_table_algo(ch, mac_radix.idx);
sys/netpfil/ipfw/ip_fw_table_algo.c
449
ta_init_addr_radix(struct ip_fw_chain *ch, void **ta_state, struct table_info *ti,
sys/netpfil/ipfw/ip_fw_table_algo.c
662
ta_prepare_add_addr_radix(struct ip_fw_chain *ch, struct tentry_info *tei,
sys/netpfil/ipfw/ip_fw_table_algo.c
779
ta_prepare_del_addr_radix(struct ip_fw_chain *ch, struct tentry_info *tei,
sys/netpfil/ipfw/ip_fw_table_algo.c
856
ta_flush_radix_entry(struct ip_fw_chain *ch, struct tentry_info *tei,
sys/netpfil/ipfw/ip_fw_table_algo.c
972
static int ta_init_chash(struct ip_fw_chain *ch, void **ta_state,
sys/netpfil/ipfw/ip_fw_table_algo.c
986
static int ta_prepare_add_chash(struct ip_fw_chain *ch, struct tentry_info *tei,
sys/netpfil/ipfw/ip_fw_table_algo.c
990
static int ta_prepare_del_chash(struct ip_fw_chain *ch, struct tentry_info *tei,
sys/netpfil/ipfw/ip_fw_table_algo.c
994
static void ta_flush_chash_entry(struct ip_fw_chain *ch, struct tentry_info *tei,
sys/netpfil/ipfw/ip_fw_table_value.c
128
get_value_ptrs(struct ip_fw_chain *ch, struct table_config *tc,
sys/netpfil/ipfw/ip_fw_table_value.c
135
pval = (struct table_value *)ch->valuestate;
sys/netpfil/ipfw/ip_fw_table_value.c
136
vi = CHAIN_TO_VI(ch);
sys/netpfil/ipfw/ip_fw_table_value.c
178
resize_shared_value_storage(struct ip_fw_chain *ch)
sys/netpfil/ipfw/ip_fw_table_value.c
188
IPFW_UH_WLOCK_ASSERT(ch);
sys/netpfil/ipfw/ip_fw_table_value.c
193
pval = (struct table_value *)ch->valuestate;
sys/netpfil/ipfw/ip_fw_table_value.c
194
vi = CHAIN_TO_VI(ch);
sys/netpfil/ipfw/ip_fw_table_value.c
195
tcfg = CHAIN_TO_TCFG(ch);
sys/netpfil/ipfw/ip_fw_table_value.c
214
pval = (struct table_value *)ch->valuestate;
sys/netpfil/ipfw/ip_fw_table_value.c
218
ipfw_objhash_bitmap_merge(CHAIN_TO_VI(ch), &new_idx, &new_blocks);
sys/netpfil/ipfw/ip_fw_table_value.c
220
IPFW_WLOCK(ch);
sys/netpfil/ipfw/ip_fw_table_value.c
222
old_valuestate = ch->valuestate;
sys/netpfil/ipfw/ip_fw_table_value.c
223
ch->valuestate = valuestate;
sys/netpfil/ipfw/ip_fw_table_value.c
225
ipfw_objhash_bitmap_swap(CHAIN_TO_VI(ch), &new_idx, &new_blocks);
sys/netpfil/ipfw/ip_fw_table_value.c
230
IPFW_WUNLOCK(ch);
sys/netpfil/ipfw/ip_fw_table_value.c
233
da.pval = (struct table_value *)ch->valuestate;
sys/netpfil/ipfw/ip_fw_table_value.c
266
struct ip_fw_chain *ch;
sys/netpfil/ipfw/ip_fw_table_value.c
277
struct ip_fw_chain *ch;
sys/netpfil/ipfw/ip_fw_table_value.c
291
ch = fa->ch;
sys/netpfil/ipfw/ip_fw_table_value.c
293
unref_table_value(CHAIN_TO_VI(ch),
sys/netpfil/ipfw/ip_fw_table_value.c
294
(struct table_value *)ch->valuestate, tent->v.kidx);
sys/netpfil/ipfw/ip_fw_table_value.c
303
ipfw_unref_table_values(struct ip_fw_chain *ch, struct table_config *tc,
sys/netpfil/ipfw/ip_fw_table_value.c
308
IPFW_UH_WLOCK_ASSERT(ch);
sys/netpfil/ipfw/ip_fw_table_value.c
311
fa.ch = ch;
sys/netpfil/ipfw/ip_fw_table_value.c
325
alloc_table_vidx(struct ip_fw_chain *ch, struct table_config *tc,
sys/netpfil/ipfw/ip_fw_table_value.c
331
IPFW_UH_WLOCK_ASSERT(ch);
sys/netpfil/ipfw/ip_fw_table_value.c
334
(error = resize_shared_value_storage(ch)) != 0)
sys/netpfil/ipfw/ip_fw_table_value.c
363
ipfw_garbage_table_values(struct ip_fw_chain *ch, struct table_config *tc,
sys/netpfil/ipfw/ip_fw_table_value.c
391
get_value_ptrs(ch, tc, &pval, &vi);
sys/netpfil/ipfw/ip_fw_table_value.c
422
ipfw_link_table_values(struct ip_fw_chain *ch, struct table_config *tc,
sys/netpfil/ipfw/ip_fw_table_value.c
436
IPFW_UH_WLOCK_ASSERT(ch);
sys/netpfil/ipfw/ip_fw_table_value.c
437
get_value_ptrs(ch, tc, &pval, &vi);
sys/netpfil/ipfw/ip_fw_table_value.c
483
KASSERT(pval == ch->valuestate, ("resize_storage() notify failure"));
sys/netpfil/ipfw/ip_fw_table_value.c
499
if ((error = alloc_table_vidx(ch, tc, vi, &vidx, flags)) != 0)
sys/netpfil/ipfw/ip_fw_table_value.c
607
list_table_values(struct ip_fw_chain *ch, ip_fw3_opheader *op3,
sys/netpfil/ipfw/ip_fw_table_value.c
621
IPFW_UH_RLOCK(ch);
sys/netpfil/ipfw/ip_fw_table_value.c
622
vi = CHAIN_TO_VI(ch);
sys/netpfil/ipfw/ip_fw_table_value.c
633
IPFW_UH_RUNLOCK(ch);
sys/netpfil/ipfw/ip_fw_table_value.c
642
da.ch = ch;
sys/netpfil/ipfw/ip_fw_table_value.c
646
IPFW_UH_RUNLOCK(ch);
sys/netpfil/ipfw/ip_fw_table_value.c
652
ipfw_table_value_init(struct ip_fw_chain *ch, int first)
sys/netpfil/ipfw/ip_fw_table_value.c
656
ch->valuestate = malloc(VALDATA_START_SIZE * sizeof(struct table_value),
sys/netpfil/ipfw/ip_fw_table_value.c
659
tcfg = ch->tblcfg;
sys/netpfil/ipfw/ip_fw_table_value.c
66
static int list_table_values(struct ip_fw_chain *ch, ip_fw3_opheader *op3,
sys/netpfil/ipfw/ip_fw_table_value.c
679
ipfw_table_value_destroy(struct ip_fw_chain *ch, int last)
sys/netpfil/ipfw/ip_fw_table_value.c
684
free(ch->valuestate, M_IPFW);
sys/netpfil/ipfw/ip_fw_table_value.c
685
ipfw_objhash_foreach(CHAIN_TO_VI(ch), destroy_value, ch);
sys/netpfil/ipfw/ip_fw_table_value.c
686
ipfw_objhash_destroy(CHAIN_TO_VI(ch));
sys/netpfil/ipfw/ip_fw_table_value.c
84
struct ip_fw_chain *ch;
sys/netpfil/ipfw/nat64/ip_fw_nat64.c
106
struct ip_fw_chain *ch;
sys/netpfil/ipfw/nat64/ip_fw_nat64.c
109
ch = &V_layer3_chain;
sys/netpfil/ipfw/nat64/ip_fw_nat64.c
111
nat64stl_uninit(ch, last);
sys/netpfil/ipfw/nat64/ip_fw_nat64.c
112
nat64clat_uninit(ch, last);
sys/netpfil/ipfw/nat64/ip_fw_nat64.c
113
nat64lsn_uninit(ch, last);
sys/netpfil/ipfw/nat64/ip_fw_nat64.c
79
struct ip_fw_chain *ch;
sys/netpfil/ipfw/nat64/ip_fw_nat64.c
82
ch = &V_layer3_chain;
sys/netpfil/ipfw/nat64/ip_fw_nat64.c
86
error = nat64stl_init(ch, first);
sys/netpfil/ipfw/nat64/ip_fw_nat64.c
89
error = nat64clat_init(ch, first);
sys/netpfil/ipfw/nat64/ip_fw_nat64.c
91
nat64stl_uninit(ch, first);
sys/netpfil/ipfw/nat64/ip_fw_nat64.c
94
error = nat64lsn_init(ch, first);
sys/netpfil/ipfw/nat64/ip_fw_nat64.c
96
nat64stl_uninit(ch, first);
sys/netpfil/ipfw/nat64/ip_fw_nat64.c
97
nat64clat_uninit(ch, first);
sys/netpfil/ipfw/nat64/ip_fw_nat64.h
51
int nat64stl_init(struct ip_fw_chain *ch, int first);
sys/netpfil/ipfw/nat64/ip_fw_nat64.h
52
void nat64stl_uninit(struct ip_fw_chain *ch, int last);
sys/netpfil/ipfw/nat64/ip_fw_nat64.h
53
int nat64lsn_init(struct ip_fw_chain *ch, int first);
sys/netpfil/ipfw/nat64/ip_fw_nat64.h
54
void nat64lsn_uninit(struct ip_fw_chain *ch, int last);
sys/netpfil/ipfw/nat64/ip_fw_nat64.h
55
int nat64clat_init(struct ip_fw_chain *ch, int first);
sys/netpfil/ipfw/nat64/ip_fw_nat64.h
56
void nat64clat_uninit(struct ip_fw_chain *ch, int last);
sys/netpfil/ipfw/nat64/ip_fw_nat64.h
77
mod ## _findbyname(struct ip_fw_chain *ch, struct tid_info *ti, \
sys/netpfil/ipfw/nat64/ip_fw_nat64.h
80
return (ipfw_objhash_find_type(CHAIN_TO_SRV(ch), ti, \
sys/netpfil/ipfw/nat64/ip_fw_nat64.h
84
mod ## _findbykidx(struct ip_fw_chain *ch, uint32_t idx) \
sys/netpfil/ipfw/nat64/ip_fw_nat64.h
88
IPFW_UH_WLOCK_ASSERT(ch); \
sys/netpfil/ipfw/nat64/ip_fw_nat64.h
89
ni = CHAIN_TO_SRV(ch); \
sys/netpfil/ipfw/nat64/nat64clat_control.c
106
struct ip_fw_chain *ch;
sys/netpfil/ipfw/nat64/nat64clat_control.c
118
nat64clat_export_config(da->ch, (struct nat64clat_cfg *)no, uc);
sys/netpfil/ipfw/nat64/nat64clat_control.c
141
nat64clat_create(struct ip_fw_chain *ch, ip_fw3_opheader *op3,
sys/netpfil/ipfw/nat64/nat64clat_control.c
163
ni = CHAIN_TO_SRV(ch);
sys/netpfil/ipfw/nat64/nat64clat_control.c
165
IPFW_UH_RLOCK(ch);
sys/netpfil/ipfw/nat64/nat64clat_control.c
167
IPFW_UH_RUNLOCK(ch);
sys/netpfil/ipfw/nat64/nat64clat_control.c
170
IPFW_UH_RUNLOCK(ch);
sys/netpfil/ipfw/nat64/nat64clat_control.c
182
IPFW_UH_WLOCK(ch);
sys/netpfil/ipfw/nat64/nat64clat_control.c
185
IPFW_UH_WUNLOCK(ch);
sys/netpfil/ipfw/nat64/nat64clat_control.c
191
IPFW_UH_WUNLOCK(ch);
sys/netpfil/ipfw/nat64/nat64clat_control.c
195
ipfw_objhash_add(CHAIN_TO_SRV(ch), &cfg->no);
sys/netpfil/ipfw/nat64/nat64clat_control.c
197
SRV_OBJECT(ch, cfg->no.kidx) = cfg;
sys/netpfil/ipfw/nat64/nat64clat_control.c
198
IPFW_UH_WUNLOCK(ch);
sys/netpfil/ipfw/nat64/nat64clat_control.c
212
nat64clat_config(struct ip_fw_chain *ch, ip_fw3_opheader *op,
sys/netpfil/ipfw/nat64/nat64clat_control.c
232
ni = CHAIN_TO_SRV(ch);
sys/netpfil/ipfw/nat64/nat64clat_control.c
234
IPFW_UH_RLOCK(ch);
sys/netpfil/ipfw/nat64/nat64clat_control.c
237
IPFW_UH_RUNLOCK(ch);
sys/netpfil/ipfw/nat64/nat64clat_control.c
240
nat64clat_export_config(ch, cfg, uc);
sys/netpfil/ipfw/nat64/nat64clat_control.c
241
IPFW_UH_RUNLOCK(ch);
sys/netpfil/ipfw/nat64/nat64clat_control.c
245
IPFW_UH_WLOCK(ch);
sys/netpfil/ipfw/nat64/nat64clat_control.c
248
IPFW_UH_WUNLOCK(ch);
sys/netpfil/ipfw/nat64/nat64clat_control.c
260
IPFW_UH_WUNLOCK(ch);
sys/netpfil/ipfw/nat64/nat64clat_control.c
269
IPFW_UH_WUNLOCK(ch);
sys/netpfil/ipfw/nat64/nat64clat_control.c
276
IPFW_WLOCK(ch);
sys/netpfil/ipfw/nat64/nat64clat_control.c
285
IPFW_WUNLOCK(ch);
sys/netpfil/ipfw/nat64/nat64clat_control.c
291
IPFW_UH_WUNLOCK(ch);
sys/netpfil/ipfw/nat64/nat64clat_control.c
296
nat64clat_detach_config(struct ip_fw_chain *ch, struct nat64clat_cfg *cfg)
sys/netpfil/ipfw/nat64/nat64clat_control.c
299
IPFW_UH_WLOCK_ASSERT(ch);
sys/netpfil/ipfw/nat64/nat64clat_control.c
301
ipfw_objhash_del(CHAIN_TO_SRV(ch), &cfg->no);
sys/netpfil/ipfw/nat64/nat64clat_control.c
302
ipfw_objhash_free_idx(CHAIN_TO_SRV(ch), cfg->no.kidx);
sys/netpfil/ipfw/nat64/nat64clat_control.c
313
nat64clat_destroy(struct ip_fw_chain *ch, ip_fw3_opheader *op3,
sys/netpfil/ipfw/nat64/nat64clat_control.c
326
IPFW_UH_WLOCK(ch);
sys/netpfil/ipfw/nat64/nat64clat_control.c
327
cfg = nat64clat_find(CHAIN_TO_SRV(ch), oh->ntlv.name, oh->ntlv.set);
sys/netpfil/ipfw/nat64/nat64clat_control.c
329
IPFW_UH_WUNLOCK(ch);
sys/netpfil/ipfw/nat64/nat64clat_control.c
333
IPFW_UH_WUNLOCK(ch);
sys/netpfil/ipfw/nat64/nat64clat_control.c
337
ipfw_reset_eaction_instance(ch, V_nat64clat_eid, cfg->no.kidx);
sys/netpfil/ipfw/nat64/nat64clat_control.c
338
SRV_OBJECT(ch, cfg->no.kidx) = NULL;
sys/netpfil/ipfw/nat64/nat64clat_control.c
339
nat64clat_detach_config(ch, cfg);
sys/netpfil/ipfw/nat64/nat64clat_control.c
340
IPFW_UH_WUNLOCK(ch);
sys/netpfil/ipfw/nat64/nat64clat_control.c
355
nat64clat_list(struct ip_fw_chain *ch, ip_fw3_opheader *op3,
sys/netpfil/ipfw/nat64/nat64clat_control.c
367
IPFW_UH_RLOCK(ch);
sys/netpfil/ipfw/nat64/nat64clat_control.c
368
olh->count = ipfw_objhash_count_type(CHAIN_TO_SRV(ch),
sys/netpfil/ipfw/nat64/nat64clat_control.c
374
IPFW_UH_RUNLOCK(ch);
sys/netpfil/ipfw/nat64/nat64clat_control.c
378
da.ch = ch;
sys/netpfil/ipfw/nat64/nat64clat_control.c
380
ipfw_objhash_foreach_type(CHAIN_TO_SRV(ch), export_config_cb,
sys/netpfil/ipfw/nat64/nat64clat_control.c
382
IPFW_UH_RUNLOCK(ch);
sys/netpfil/ipfw/nat64/nat64clat_control.c
390
export_stats(struct ip_fw_chain *ch, struct nat64clat_cfg *cfg,
sys/netpfil/ipfw/nat64/nat64clat_control.c
415
nat64clat_stats(struct ip_fw_chain *ch, ip_fw3_opheader *op,
sys/netpfil/ipfw/nat64/nat64clat_control.c
434
IPFW_UH_RLOCK(ch);
sys/netpfil/ipfw/nat64/nat64clat_control.c
435
cfg = nat64clat_find(CHAIN_TO_SRV(ch), oh->ntlv.name, oh->ntlv.set);
sys/netpfil/ipfw/nat64/nat64clat_control.c
437
IPFW_UH_RUNLOCK(ch);
sys/netpfil/ipfw/nat64/nat64clat_control.c
440
export_stats(ch, cfg, &stats);
sys/netpfil/ipfw/nat64/nat64clat_control.c
441
IPFW_UH_RUNLOCK(ch);
sys/netpfil/ipfw/nat64/nat64clat_control.c
462
nat64clat_reset_stats(struct ip_fw_chain *ch, ip_fw3_opheader *op,
sys/netpfil/ipfw/nat64/nat64clat_control.c
475
IPFW_UH_WLOCK(ch);
sys/netpfil/ipfw/nat64/nat64clat_control.c
476
cfg = nat64clat_find(CHAIN_TO_SRV(ch), oh->ntlv.name, oh->ntlv.set);
sys/netpfil/ipfw/nat64/nat64clat_control.c
478
IPFW_UH_WUNLOCK(ch);
sys/netpfil/ipfw/nat64/nat64clat_control.c
482
IPFW_UH_WUNLOCK(ch);
sys/netpfil/ipfw/nat64/nat64clat_control.c
496
nat64clat_manage_sets(struct ip_fw_chain *ch, uint32_t set, uint8_t new_set,
sys/netpfil/ipfw/nat64/nat64clat_control.c
500
return (ipfw_obj_manage_sets(CHAIN_TO_SRV(ch),
sys/netpfil/ipfw/nat64/nat64clat_control.c
510
struct ip_fw_chain *ch;
sys/netpfil/ipfw/nat64/nat64clat_control.c
512
ch = (struct ip_fw_chain *)arg;
sys/netpfil/ipfw/nat64/nat64clat_control.c
513
cfg = (struct nat64clat_cfg *)SRV_OBJECT(ch, no->kidx);
sys/netpfil/ipfw/nat64/nat64clat_control.c
514
SRV_OBJECT(ch, no->kidx) = NULL;
sys/netpfil/ipfw/nat64/nat64clat_control.c
515
nat64clat_detach_config(ch, cfg);
sys/netpfil/ipfw/nat64/nat64clat_control.c
521
nat64clat_init(struct ip_fw_chain *ch, int first)
sys/netpfil/ipfw/nat64/nat64clat_control.c
524
V_nat64clat_eid = ipfw_add_eaction(ch, ipfw_nat64clat, "nat64clat");
sys/netpfil/ipfw/nat64/nat64clat_control.c
533
nat64clat_uninit(struct ip_fw_chain *ch, int last)
sys/netpfil/ipfw/nat64/nat64clat_control.c
538
ipfw_del_eaction(ch, V_nat64clat_eid);
sys/netpfil/ipfw/nat64/nat64clat_control.c
546
IPFW_UH_WLOCK(ch);
sys/netpfil/ipfw/nat64/nat64clat_control.c
547
ipfw_objhash_foreach_type(CHAIN_TO_SRV(ch), destroy_config_cb, ch,
sys/netpfil/ipfw/nat64/nat64clat_control.c
550
IPFW_UH_WUNLOCK(ch);
sys/netpfil/ipfw/nat64/nat64clat_control.c
93
nat64clat_export_config(struct ip_fw_chain *ch, struct nat64clat_cfg *cfg,
sys/netpfil/ipfw/nat64/nat64lsn.c
1720
ipfw_nat64lsn(struct ip_fw_chain *ch, struct ip_fw_args *args,
sys/netpfil/ipfw/nat64/nat64lsn.c
1727
IPFW_RLOCK_ASSERT(ch);
sys/netpfil/ipfw/nat64/nat64lsn.c
1734
(i = NAT64_LOOKUP(ch, icmd)) == NULL)
sys/netpfil/ipfw/nat64/nat64lsn.c
1828
nat64lsn_init_config(struct ip_fw_chain *ch, in_addr_t prefix, int plen)
sys/netpfil/ipfw/nat64/nat64lsn.h
266
struct nat64lsn_cfg *nat64lsn_init_config(struct ip_fw_chain *ch,
sys/netpfil/ipfw/nat64/nat64lsn.h
272
int ipfw_nat64lsn(struct ip_fw_chain *ch, struct ip_fw_args *args,
sys/netpfil/ipfw/nat64/nat64lsn_control.c
111
nat64lsn_create(struct ip_fw_chain *ch, ip_fw3_opheader *op3,
sys/netpfil/ipfw/nat64/nat64lsn_control.c
154
ni = CHAIN_TO_SRV(ch);
sys/netpfil/ipfw/nat64/nat64lsn_control.c
155
IPFW_UH_RLOCK(ch);
sys/netpfil/ipfw/nat64/nat64lsn_control.c
157
IPFW_UH_RUNLOCK(ch);
sys/netpfil/ipfw/nat64/nat64lsn_control.c
160
IPFW_UH_RUNLOCK(ch);
sys/netpfil/ipfw/nat64/nat64lsn_control.c
169
cfg = nat64lsn_init_config(ch, addr4, uc->plen4);
sys/netpfil/ipfw/nat64/nat64lsn_control.c
189
IPFW_UH_WLOCK(ch);
sys/netpfil/ipfw/nat64/nat64lsn_control.c
192
IPFW_UH_WUNLOCK(ch);
sys/netpfil/ipfw/nat64/nat64lsn_control.c
199
IPFW_UH_WUNLOCK(ch);
sys/netpfil/ipfw/nat64/nat64lsn_control.c
208
SRV_OBJECT(ch, i->no.kidx) = i;
sys/netpfil/ipfw/nat64/nat64lsn_control.c
211
IPFW_UH_WUNLOCK(ch);
sys/netpfil/ipfw/nat64/nat64lsn_control.c
216
nat64lsn_detach_instance(struct ip_fw_chain *ch,
sys/netpfil/ipfw/nat64/nat64lsn_control.c
220
IPFW_UH_WLOCK_ASSERT(ch);
sys/netpfil/ipfw/nat64/nat64lsn_control.c
221
SRV_OBJECT(ch, i->no.kidx) = NULL;
sys/netpfil/ipfw/nat64/nat64lsn_control.c
222
ipfw_objhash_del(CHAIN_TO_SRV(ch), &i->no);
sys/netpfil/ipfw/nat64/nat64lsn_control.c
223
ipfw_objhash_free_idx(CHAIN_TO_SRV(ch), i->no.kidx);
sys/netpfil/ipfw/nat64/nat64lsn_control.c
234
nat64lsn_destroy(struct ip_fw_chain *ch, ip_fw3_opheader *op3,
sys/netpfil/ipfw/nat64/nat64lsn_control.c
245
IPFW_UH_WLOCK(ch);
sys/netpfil/ipfw/nat64/nat64lsn_control.c
246
i = nat64lsn_find(CHAIN_TO_SRV(ch), oh->ntlv.name, oh->ntlv.set);
sys/netpfil/ipfw/nat64/nat64lsn_control.c
248
IPFW_UH_WUNLOCK(ch);
sys/netpfil/ipfw/nat64/nat64lsn_control.c
253
IPFW_UH_WUNLOCK(ch);
sys/netpfil/ipfw/nat64/nat64lsn_control.c
257
ipfw_reset_eaction_instance(ch, V_nat64lsn_eid, i->no.kidx);
sys/netpfil/ipfw/nat64/nat64lsn_control.c
258
nat64lsn_detach_instance(ch, i);
sys/netpfil/ipfw/nat64/nat64lsn_control.c
259
IPFW_UH_WUNLOCK(ch);
sys/netpfil/ipfw/nat64/nat64lsn_control.c
269
export_stats(struct ip_fw_chain *ch, struct nat64lsn_cfg *cfg,
sys/netpfil/ipfw/nat64/nat64lsn_control.c
312
nat64lsn_export_config(struct ip_fw_chain *ch, struct nat64lsn_instance *i,
sys/netpfil/ipfw/nat64/nat64lsn_control.c
338
struct ip_fw_chain *ch;
sys/netpfil/ipfw/nat64/nat64lsn_control.c
352
nat64lsn_export_config(da->ch,
sys/netpfil/ipfw/nat64/nat64lsn_control.c
366
nat64lsn_list(struct ip_fw_chain *ch, ip_fw3_opheader *op3,
sys/netpfil/ipfw/nat64/nat64lsn_control.c
378
IPFW_UH_RLOCK(ch);
sys/netpfil/ipfw/nat64/nat64lsn_control.c
379
olh->count = ipfw_objhash_count_type(CHAIN_TO_SRV(ch),
sys/netpfil/ipfw/nat64/nat64lsn_control.c
385
IPFW_UH_RUNLOCK(ch);
sys/netpfil/ipfw/nat64/nat64lsn_control.c
389
da.ch = ch;
sys/netpfil/ipfw/nat64/nat64lsn_control.c
391
ipfw_objhash_foreach_type(CHAIN_TO_SRV(ch), export_config_cb, &da,
sys/netpfil/ipfw/nat64/nat64lsn_control.c
393
IPFW_UH_RUNLOCK(ch);
sys/netpfil/ipfw/nat64/nat64lsn_control.c
407
nat64lsn_config(struct ip_fw_chain *ch, ip_fw3_opheader *op,
sys/netpfil/ipfw/nat64/nat64lsn_control.c
427
ni = CHAIN_TO_SRV(ch);
sys/netpfil/ipfw/nat64/nat64lsn_control.c
429
IPFW_UH_RLOCK(ch);
sys/netpfil/ipfw/nat64/nat64lsn_control.c
432
IPFW_UH_RUNLOCK(ch);
sys/netpfil/ipfw/nat64/nat64lsn_control.c
435
nat64lsn_export_config(ch, i, uc);
sys/netpfil/ipfw/nat64/nat64lsn_control.c
436
IPFW_UH_RUNLOCK(ch);
sys/netpfil/ipfw/nat64/nat64lsn_control.c
442
IPFW_UH_WLOCK(ch);
sys/netpfil/ipfw/nat64/nat64lsn_control.c
445
IPFW_UH_WUNLOCK(ch);
sys/netpfil/ipfw/nat64/nat64lsn_control.c
467
IPFW_UH_WUNLOCK(ch);
sys/netpfil/ipfw/nat64/nat64lsn_control.c
481
nat64lsn_stats(struct ip_fw_chain *ch, ip_fw3_opheader *op,
sys/netpfil/ipfw/nat64/nat64lsn_control.c
500
IPFW_UH_RLOCK(ch);
sys/netpfil/ipfw/nat64/nat64lsn_control.c
501
i = nat64lsn_find(CHAIN_TO_SRV(ch), oh->ntlv.name, oh->ntlv.set);
sys/netpfil/ipfw/nat64/nat64lsn_control.c
503
IPFW_UH_RUNLOCK(ch);
sys/netpfil/ipfw/nat64/nat64lsn_control.c
507
export_stats(ch, i->cfg, &stats);
sys/netpfil/ipfw/nat64/nat64lsn_control.c
508
IPFW_UH_RUNLOCK(ch);
sys/netpfil/ipfw/nat64/nat64lsn_control.c
529
nat64lsn_reset_stats(struct ip_fw_chain *ch, ip_fw3_opheader *op,
sys/netpfil/ipfw/nat64/nat64lsn_control.c
542
IPFW_UH_WLOCK(ch);
sys/netpfil/ipfw/nat64/nat64lsn_control.c
543
i = nat64lsn_find(CHAIN_TO_SRV(ch), oh->ntlv.name, oh->ntlv.set);
sys/netpfil/ipfw/nat64/nat64lsn_control.c
545
IPFW_UH_WUNLOCK(ch);
sys/netpfil/ipfw/nat64/nat64lsn_control.c
549
IPFW_UH_WUNLOCK(ch);
sys/netpfil/ipfw/nat64/nat64lsn_control.c
686
nat64lsn_states(struct ip_fw_chain *ch, ip_fw3_opheader *op3,
sys/netpfil/ipfw/nat64/nat64lsn_control.c
719
IPFW_UH_RLOCK(ch);
sys/netpfil/ipfw/nat64/nat64lsn_control.c
720
i = nat64lsn_find(CHAIN_TO_SRV(ch), oh->ntlv.name, oh->ntlv.set);
sys/netpfil/ipfw/nat64/nat64lsn_control.c
722
IPFW_UH_RUNLOCK(ch);
sys/netpfil/ipfw/nat64/nat64lsn_control.c
733
IPFW_UH_RUNLOCK(ch);
sys/netpfil/ipfw/nat64/nat64lsn_control.c
739
IPFW_UH_RUNLOCK(ch);
sys/netpfil/ipfw/nat64/nat64lsn_control.c
801
IPFW_UH_RUNLOCK(ch);
sys/netpfil/ipfw/nat64/nat64lsn_control.c
885
nat64lsn_manage_sets(struct ip_fw_chain *ch, uint32_t set, uint8_t new_set,
sys/netpfil/ipfw/nat64/nat64lsn_control.c
893
ipfw_objhash_foreach_type(CHAIN_TO_SRV(ch),
sys/netpfil/ipfw/nat64/nat64lsn_control.c
896
return (ipfw_obj_manage_sets(CHAIN_TO_SRV(ch), IPFW_TLV_NAT64LSN_NAME,
sys/netpfil/ipfw/nat64/nat64lsn_control.c
906
struct ip_fw_chain *ch;
sys/netpfil/ipfw/nat64/nat64lsn_control.c
908
ch = (struct ip_fw_chain *)arg;
sys/netpfil/ipfw/nat64/nat64lsn_control.c
909
i = (struct nat64lsn_instance *)SRV_OBJECT(ch, no->kidx);
sys/netpfil/ipfw/nat64/nat64lsn_control.c
910
nat64lsn_detach_instance(ch, i);
sys/netpfil/ipfw/nat64/nat64lsn_control.c
917
nat64lsn_init(struct ip_fw_chain *ch, int first)
sys/netpfil/ipfw/nat64/nat64lsn_control.c
922
V_nat64lsn_eid = ipfw_add_eaction(ch, ipfw_nat64lsn, "nat64lsn");
sys/netpfil/ipfw/nat64/nat64lsn_control.c
931
nat64lsn_uninit(struct ip_fw_chain *ch, int last)
sys/netpfil/ipfw/nat64/nat64lsn_control.c
936
ipfw_del_eaction(ch, V_nat64lsn_eid);
sys/netpfil/ipfw/nat64/nat64lsn_control.c
944
IPFW_UH_WLOCK(ch);
sys/netpfil/ipfw/nat64/nat64lsn_control.c
945
ipfw_objhash_foreach_type(CHAIN_TO_SRV(ch), destroy_config_cb, ch,
sys/netpfil/ipfw/nat64/nat64lsn_control.c
948
IPFW_UH_WUNLOCK(ch);
sys/netpfil/ipfw/nat64/nat64stl_control.c
106
no = ipfw_objhash_lookup_table_kidx(ch, cfg->map64);
sys/netpfil/ipfw/nat64/nat64stl_control.c
108
no = ipfw_objhash_lookup_table_kidx(ch, cfg->map46);
sys/netpfil/ipfw/nat64/nat64stl_control.c
113
struct ip_fw_chain *ch;
sys/netpfil/ipfw/nat64/nat64stl_control.c
125
nat64stl_export_config(da->ch, (struct nat64stl_cfg *)no, uc);
sys/netpfil/ipfw/nat64/nat64stl_control.c
141
nat64stl_create_internal(struct ip_fw_chain *ch, struct nat64stl_cfg *cfg,
sys/netpfil/ipfw/nat64/nat64stl_control.c
145
IPFW_UH_WLOCK_ASSERT(ch);
sys/netpfil/ipfw/nat64/nat64stl_control.c
147
if (ipfw_objhash_alloc_idx(CHAIN_TO_SRV(ch), &cfg->no.kidx) != 0)
sys/netpfil/ipfw/nat64/nat64stl_control.c
151
if (ipfw_ref_table(ch, &i->ntlv4, &cfg->map46) != 0)
sys/netpfil/ipfw/nat64/nat64stl_control.c
155
if (ipfw_ref_table(ch, &i->ntlv6, &cfg->map64) != 0)
sys/netpfil/ipfw/nat64/nat64stl_control.c
159
ipfw_objhash_add(CHAIN_TO_SRV(ch), &cfg->no);
sys/netpfil/ipfw/nat64/nat64stl_control.c
172
nat64stl_create(struct ip_fw_chain *ch, ip_fw3_opheader *op3,
sys/netpfil/ipfw/nat64/nat64stl_control.c
195
ni = CHAIN_TO_SRV(ch);
sys/netpfil/ipfw/nat64/nat64stl_control.c
198
IPFW_UH_RLOCK(ch);
sys/netpfil/ipfw/nat64/nat64stl_control.c
200
IPFW_UH_RUNLOCK(ch);
sys/netpfil/ipfw/nat64/nat64stl_control.c
203
IPFW_UH_RUNLOCK(ch);
sys/netpfil/ipfw/nat64/nat64stl_control.c
212
IPFW_UH_WLOCK(ch);
sys/netpfil/ipfw/nat64/nat64stl_control.c
215
IPFW_UH_WUNLOCK(ch);
sys/netpfil/ipfw/nat64/nat64stl_control.c
219
error = nat64stl_create_internal(ch, cfg, uc);
sys/netpfil/ipfw/nat64/nat64stl_control.c
222
SRV_OBJECT(ch, cfg->no.kidx) = cfg;
sys/netpfil/ipfw/nat64/nat64stl_control.c
223
IPFW_UH_WUNLOCK(ch);
sys/netpfil/ipfw/nat64/nat64stl_control.c
230
ipfw_unref_table(ch, cfg->map46);
sys/netpfil/ipfw/nat64/nat64stl_control.c
232
ipfw_unref_table(ch, cfg->map64);
sys/netpfil/ipfw/nat64/nat64stl_control.c
234
IPFW_UH_WUNLOCK(ch);
sys/netpfil/ipfw/nat64/nat64stl_control.c
248
nat64stl_config(struct ip_fw_chain *ch, ip_fw3_opheader *op,
sys/netpfil/ipfw/nat64/nat64stl_control.c
267
ni = CHAIN_TO_SRV(ch);
sys/netpfil/ipfw/nat64/nat64stl_control.c
269
IPFW_UH_RLOCK(ch);
sys/netpfil/ipfw/nat64/nat64stl_control.c
272
IPFW_UH_RUNLOCK(ch);
sys/netpfil/ipfw/nat64/nat64stl_control.c
275
nat64stl_export_config(ch, cfg, uc);
sys/netpfil/ipfw/nat64/nat64stl_control.c
276
IPFW_UH_RUNLOCK(ch);
sys/netpfil/ipfw/nat64/nat64stl_control.c
280
IPFW_UH_WLOCK(ch);
sys/netpfil/ipfw/nat64/nat64stl_control.c
283
IPFW_UH_WUNLOCK(ch);
sys/netpfil/ipfw/nat64/nat64stl_control.c
294
IPFW_UH_WUNLOCK(ch);
sys/netpfil/ipfw/nat64/nat64stl_control.c
299
nat64stl_detach_config(struct ip_fw_chain *ch, struct nat64stl_cfg *cfg)
sys/netpfil/ipfw/nat64/nat64stl_control.c
302
IPFW_UH_WLOCK_ASSERT(ch);
sys/netpfil/ipfw/nat64/nat64stl_control.c
304
ipfw_objhash_del(CHAIN_TO_SRV(ch), &cfg->no);
sys/netpfil/ipfw/nat64/nat64stl_control.c
305
ipfw_objhash_free_idx(CHAIN_TO_SRV(ch), cfg->no.kidx);
sys/netpfil/ipfw/nat64/nat64stl_control.c
306
ipfw_unref_table(ch, cfg->map46);
sys/netpfil/ipfw/nat64/nat64stl_control.c
307
ipfw_unref_table(ch, cfg->map64);
sys/netpfil/ipfw/nat64/nat64stl_control.c
318
nat64stl_destroy(struct ip_fw_chain *ch, ip_fw3_opheader *op3,
sys/netpfil/ipfw/nat64/nat64stl_control.c
331
IPFW_UH_WLOCK(ch);
sys/netpfil/ipfw/nat64/nat64stl_control.c
332
cfg = nat64stl_find(CHAIN_TO_SRV(ch), oh->ntlv.name, oh->ntlv.set);
sys/netpfil/ipfw/nat64/nat64stl_control.c
334
IPFW_UH_WUNLOCK(ch);
sys/netpfil/ipfw/nat64/nat64stl_control.c
338
IPFW_UH_WUNLOCK(ch);
sys/netpfil/ipfw/nat64/nat64stl_control.c
342
ipfw_reset_eaction_instance(ch, V_nat64stl_eid, cfg->no.kidx);
sys/netpfil/ipfw/nat64/nat64stl_control.c
343
SRV_OBJECT(ch, cfg->no.kidx) = NULL;
sys/netpfil/ipfw/nat64/nat64stl_control.c
344
nat64stl_detach_config(ch, cfg);
sys/netpfil/ipfw/nat64/nat64stl_control.c
345
IPFW_UH_WUNLOCK(ch);
sys/netpfil/ipfw/nat64/nat64stl_control.c
360
nat64stl_list(struct ip_fw_chain *ch, ip_fw3_opheader *op3,
sys/netpfil/ipfw/nat64/nat64stl_control.c
372
IPFW_UH_RLOCK(ch);
sys/netpfil/ipfw/nat64/nat64stl_control.c
373
olh->count = ipfw_objhash_count_type(CHAIN_TO_SRV(ch),
sys/netpfil/ipfw/nat64/nat64stl_control.c
379
IPFW_UH_RUNLOCK(ch);
sys/netpfil/ipfw/nat64/nat64stl_control.c
383
da.ch = ch;
sys/netpfil/ipfw/nat64/nat64stl_control.c
385
ipfw_objhash_foreach_type(CHAIN_TO_SRV(ch), export_config_cb,
sys/netpfil/ipfw/nat64/nat64stl_control.c
387
IPFW_UH_RUNLOCK(ch);
sys/netpfil/ipfw/nat64/nat64stl_control.c
395
export_stats(struct ip_fw_chain *ch, struct nat64stl_cfg *cfg,
sys/netpfil/ipfw/nat64/nat64stl_control.c
420
nat64stl_stats(struct ip_fw_chain *ch, ip_fw3_opheader *op,
sys/netpfil/ipfw/nat64/nat64stl_control.c
439
IPFW_UH_RLOCK(ch);
sys/netpfil/ipfw/nat64/nat64stl_control.c
440
cfg = nat64stl_find(CHAIN_TO_SRV(ch), oh->ntlv.name, oh->ntlv.set);
sys/netpfil/ipfw/nat64/nat64stl_control.c
442
IPFW_UH_RUNLOCK(ch);
sys/netpfil/ipfw/nat64/nat64stl_control.c
445
export_stats(ch, cfg, &stats);
sys/netpfil/ipfw/nat64/nat64stl_control.c
446
IPFW_UH_RUNLOCK(ch);
sys/netpfil/ipfw/nat64/nat64stl_control.c
467
nat64stl_reset_stats(struct ip_fw_chain *ch, ip_fw3_opheader *op,
sys/netpfil/ipfw/nat64/nat64stl_control.c
480
IPFW_UH_WLOCK(ch);
sys/netpfil/ipfw/nat64/nat64stl_control.c
481
cfg = nat64stl_find(CHAIN_TO_SRV(ch), oh->ntlv.name, oh->ntlv.set);
sys/netpfil/ipfw/nat64/nat64stl_control.c
483
IPFW_UH_WUNLOCK(ch);
sys/netpfil/ipfw/nat64/nat64stl_control.c
487
IPFW_UH_WUNLOCK(ch);
sys/netpfil/ipfw/nat64/nat64stl_control.c
501
nat64stl_manage_sets(struct ip_fw_chain *ch, uint32_t set, uint8_t new_set,
sys/netpfil/ipfw/nat64/nat64stl_control.c
505
return (ipfw_obj_manage_sets(CHAIN_TO_SRV(ch), IPFW_TLV_NAT64STL_NAME,
sys/netpfil/ipfw/nat64/nat64stl_control.c
515
struct ip_fw_chain *ch;
sys/netpfil/ipfw/nat64/nat64stl_control.c
517
ch = (struct ip_fw_chain *)arg;
sys/netpfil/ipfw/nat64/nat64stl_control.c
518
cfg = (struct nat64stl_cfg *)SRV_OBJECT(ch, no->kidx);
sys/netpfil/ipfw/nat64/nat64stl_control.c
519
SRV_OBJECT(ch, no->kidx) = NULL;
sys/netpfil/ipfw/nat64/nat64stl_control.c
520
nat64stl_detach_config(ch, cfg);
sys/netpfil/ipfw/nat64/nat64stl_control.c
526
nat64stl_init(struct ip_fw_chain *ch, int first)
sys/netpfil/ipfw/nat64/nat64stl_control.c
529
V_nat64stl_eid = ipfw_add_eaction(ch, ipfw_nat64stl, "nat64stl");
sys/netpfil/ipfw/nat64/nat64stl_control.c
538
nat64stl_uninit(struct ip_fw_chain *ch, int last)
sys/netpfil/ipfw/nat64/nat64stl_control.c
543
ipfw_del_eaction(ch, V_nat64stl_eid);
sys/netpfil/ipfw/nat64/nat64stl_control.c
551
IPFW_UH_WLOCK(ch);
sys/netpfil/ipfw/nat64/nat64stl_control.c
552
ipfw_objhash_foreach_type(CHAIN_TO_SRV(ch), destroy_config_cb, ch,
sys/netpfil/ipfw/nat64/nat64stl_control.c
555
IPFW_UH_WUNLOCK(ch);
sys/netpfil/ipfw/nat64/nat64stl_control.c
95
nat64stl_export_config(struct ip_fw_chain *ch, struct nat64stl_cfg *cfg,
sys/netpfil/ipfw/nptv6/nptv6.c
1000
SRV_OBJECT(ch, no->kidx) = NULL;
sys/netpfil/ipfw/nptv6/nptv6.c
1008
nptv6_init(struct ip_fw_chain *ch, int first)
sys/netpfil/ipfw/nptv6/nptv6.c
1011
V_nptv6_eid = ipfw_add_eaction(ch, ipfw_nptv6, "nptv6");
sys/netpfil/ipfw/nptv6/nptv6.c
1020
nptv6_uninit(struct ip_fw_chain *ch, int last)
sys/netpfil/ipfw/nptv6/nptv6.c
1027
ipfw_del_eaction(ch, V_nptv6_eid);
sys/netpfil/ipfw/nptv6/nptv6.c
1035
IPFW_UH_WLOCK(ch);
sys/netpfil/ipfw/nptv6/nptv6.c
1036
ipfw_objhash_foreach_type(CHAIN_TO_SRV(ch), destroy_config_cb, ch,
sys/netpfil/ipfw/nptv6/nptv6.c
1039
IPFW_UH_WUNLOCK(ch);
sys/netpfil/ipfw/nptv6/nptv6.c
442
nptv6_export_config(struct ip_fw_chain *ch, struct nptv6_cfg *cfg,
sys/netpfil/ipfw/nptv6/nptv6.c
458
struct ip_fw_chain *ch;
sys/netpfil/ipfw/nptv6/nptv6.c
470
nptv6_export_config(da->ch, (struct nptv6_cfg *)no, uc);
sys/netpfil/ipfw/nptv6/nptv6.c
532
nptv6_find_prefix(struct ip_fw_chain *ch, struct nptv6_cfg *cfg,
sys/netpfil/ipfw/nptv6/nptv6.c
540
IPFW_UH_WLOCK_ASSERT(ch);
sys/netpfil/ipfw/nptv6/nptv6.c
575
struct ip_fw_chain *ch;
sys/netpfil/ipfw/nptv6/nptv6.c
578
ch = &V_layer3_chain;
sys/netpfil/ipfw/nptv6/nptv6.c
579
cfg = (struct nptv6_cfg *)SRV_OBJECT(ch, no->kidx);
sys/netpfil/ipfw/nptv6/nptv6.c
615
nptv6_find_prefix(ch, cfg, args->ifp);
sys/netpfil/ipfw/nptv6/nptv6.c
624
struct ip_fw_chain *ch;
sys/netpfil/ipfw/nptv6/nptv6.c
633
ch = &V_layer3_chain;
sys/netpfil/ipfw/nptv6/nptv6.c
634
IPFW_UH_WLOCK(ch);
sys/netpfil/ipfw/nptv6/nptv6.c
635
ipfw_objhash_foreach_type(CHAIN_TO_SRV(ch), ifaddr_cb, &args,
sys/netpfil/ipfw/nptv6/nptv6.c
637
IPFW_UH_WUNLOCK(ch);
sys/netpfil/ipfw/nptv6/nptv6.c
648
nptv6_create(struct ip_fw_chain *ch, ip_fw3_opheader *op3,
sys/netpfil/ipfw/nptv6/nptv6.c
674
ni = CHAIN_TO_SRV(ch);
sys/netpfil/ipfw/nptv6/nptv6.c
675
IPFW_UH_RLOCK(ch);
sys/netpfil/ipfw/nptv6/nptv6.c
677
IPFW_UH_RUNLOCK(ch);
sys/netpfil/ipfw/nptv6/nptv6.c
680
IPFW_UH_RUNLOCK(ch);
sys/netpfil/ipfw/nptv6/nptv6.c
701
IPFW_UH_WLOCK(ch);
sys/netpfil/ipfw/nptv6/nptv6.c
703
IPFW_UH_WUNLOCK(ch);
sys/netpfil/ipfw/nptv6/nptv6.c
708
SRV_OBJECT(ch, cfg->no.kidx) = cfg;
sys/netpfil/ipfw/nptv6/nptv6.c
710
nptv6_find_prefix(ch, cfg, NULL);
sys/netpfil/ipfw/nptv6/nptv6.c
711
IPFW_UH_WUNLOCK(ch);
sys/netpfil/ipfw/nptv6/nptv6.c
724
nptv6_destroy(struct ip_fw_chain *ch, ip_fw3_opheader *op3,
sys/netpfil/ipfw/nptv6/nptv6.c
737
IPFW_UH_WLOCK(ch);
sys/netpfil/ipfw/nptv6/nptv6.c
738
cfg = nptv6_find(CHAIN_TO_SRV(ch), oh->ntlv.name, oh->ntlv.set);
sys/netpfil/ipfw/nptv6/nptv6.c
740
IPFW_UH_WUNLOCK(ch);
sys/netpfil/ipfw/nptv6/nptv6.c
744
IPFW_UH_WUNLOCK(ch);
sys/netpfil/ipfw/nptv6/nptv6.c
748
ipfw_reset_eaction_instance(ch, V_nptv6_eid, cfg->no.kidx);
sys/netpfil/ipfw/nptv6/nptv6.c
749
SRV_OBJECT(ch, cfg->no.kidx) = NULL;
sys/netpfil/ipfw/nptv6/nptv6.c
750
ipfw_objhash_del(CHAIN_TO_SRV(ch), &cfg->no);
sys/netpfil/ipfw/nptv6/nptv6.c
751
ipfw_objhash_free_idx(CHAIN_TO_SRV(ch), cfg->no.kidx);
sys/netpfil/ipfw/nptv6/nptv6.c
752
IPFW_UH_WUNLOCK(ch);
sys/netpfil/ipfw/nptv6/nptv6.c
779
nptv6_list(struct ip_fw_chain *ch, ip_fw3_opheader *op3,
sys/netpfil/ipfw/nptv6/nptv6.c
791
IPFW_UH_RLOCK(ch);
sys/netpfil/ipfw/nptv6/nptv6.c
792
olh->count = ipfw_objhash_count_type(CHAIN_TO_SRV(ch),
sys/netpfil/ipfw/nptv6/nptv6.c
798
IPFW_UH_RUNLOCK(ch);
sys/netpfil/ipfw/nptv6/nptv6.c
802
da.ch = ch;
sys/netpfil/ipfw/nptv6/nptv6.c
804
ipfw_objhash_foreach_type(CHAIN_TO_SRV(ch), export_config_cb,
sys/netpfil/ipfw/nptv6/nptv6.c
806
IPFW_UH_RUNLOCK(ch);
sys/netpfil/ipfw/nptv6/nptv6.c
814
export_stats(struct ip_fw_chain *ch, struct nptv6_cfg *cfg,
sys/netpfil/ipfw/nptv6/nptv6.c
832
nptv6_stats(struct ip_fw_chain *ch, ip_fw3_opheader *op,
sys/netpfil/ipfw/nptv6/nptv6.c
854
IPFW_UH_RLOCK(ch);
sys/netpfil/ipfw/nptv6/nptv6.c
855
cfg = nptv6_find(CHAIN_TO_SRV(ch), oh->ntlv.name, oh->ntlv.set);
sys/netpfil/ipfw/nptv6/nptv6.c
857
IPFW_UH_RUNLOCK(ch);
sys/netpfil/ipfw/nptv6/nptv6.c
860
export_stats(ch, cfg, &stats);
sys/netpfil/ipfw/nptv6/nptv6.c
861
IPFW_UH_RUNLOCK(ch);
sys/netpfil/ipfw/nptv6/nptv6.c
882
nptv6_reset_stats(struct ip_fw_chain *ch, ip_fw3_opheader *op,
sys/netpfil/ipfw/nptv6/nptv6.c
895
IPFW_UH_WLOCK(ch);
sys/netpfil/ipfw/nptv6/nptv6.c
896
cfg = nptv6_find(CHAIN_TO_SRV(ch), oh->ntlv.name, oh->ntlv.set);
sys/netpfil/ipfw/nptv6/nptv6.c
898
IPFW_UH_WUNLOCK(ch);
sys/netpfil/ipfw/nptv6/nptv6.c
902
IPFW_UH_WUNLOCK(ch);
sys/netpfil/ipfw/nptv6/nptv6.c
942
nptv6_findbyname(struct ip_fw_chain *ch, struct tid_info *ti,
sys/netpfil/ipfw/nptv6/nptv6.c
947
err = ipfw_objhash_find_type(CHAIN_TO_SRV(ch), ti,
sys/netpfil/ipfw/nptv6/nptv6.c
954
nptv6_findbykidx(struct ip_fw_chain *ch, uint32_t idx)
sys/netpfil/ipfw/nptv6/nptv6.c
959
IPFW_UH_WLOCK_ASSERT(ch);
sys/netpfil/ipfw/nptv6/nptv6.c
960
ni = CHAIN_TO_SRV(ch);
sys/netpfil/ipfw/nptv6/nptv6.c
969
nptv6_manage_sets(struct ip_fw_chain *ch, uint32_t set, uint8_t new_set,
sys/netpfil/ipfw/nptv6/nptv6.c
973
return (ipfw_obj_manage_sets(CHAIN_TO_SRV(ch), IPFW_TLV_NPTV6_NAME,
sys/netpfil/ipfw/nptv6/nptv6.c
994
struct ip_fw_chain *ch;
sys/netpfil/ipfw/nptv6/nptv6.c
996
ch = (struct ip_fw_chain *)arg;
sys/netpfil/ipfw/nptv6/nptv6.c
997
IPFW_UH_WLOCK_ASSERT(ch);
sys/netpfil/ipfw/nptv6/nptv6.c
999
cfg = (struct nptv6_cfg *)SRV_OBJECT(ch, no->kidx);
sys/netpfil/ipfw/nptv6/nptv6.h
61
int nptv6_init(struct ip_fw_chain *ch, int first);
sys/netpfil/ipfw/nptv6/nptv6.h
62
void nptv6_uninit(struct ip_fw_chain *ch, int last);
sys/netpfil/ipfw/pmod/pmod.h
31
int tcpmod_init(struct ip_fw_chain *ch, int first);
sys/netpfil/ipfw/pmod/pmod.h
32
void tcpmod_uninit(struct ip_fw_chain *ch, int last);
sys/netpfil/ipfw/pmod/tcpmod.c
234
tcpmod_init(struct ip_fw_chain *ch, int first)
sys/netpfil/ipfw/pmod/tcpmod.c
237
V_tcpmod_setmss_eid = ipfw_add_eaction(ch, ipfw_tcpmod, "tcp-setmss");
sys/netpfil/ipfw/pmod/tcpmod.c
244
tcpmod_uninit(struct ip_fw_chain *ch, int last)
sys/netpfil/ipfw/pmod/tcpmod.c
247
ipfw_del_eaction(ch, V_tcpmod_setmss_eid);
sys/netpfil/pf/pf_norm.c
2018
struct sctp_chunkhdr ch = { };
sys/netpfil/pf/pf_norm.c
2024
if (!pf_pull_hdr(pd->m, pd->off + chunk_off, &ch, sizeof(ch),
sys/netpfil/pf/pf_norm.c
2029
if (ntohs(ch.chunk_length) < 4)
sys/netpfil/pf/pf_norm.c
2033
chunk_off += roundup(ntohs(ch.chunk_length), 4);
sys/netpfil/pf/pf_norm.c
2035
switch (ch.chunk_type) {
sys/netpfil/pf/pf_norm.c
2061
if (ch.chunk_type == SCTP_INITIATION &&
sys/netpfil/pf/pf_norm.c
2067
if (ch.chunk_type == SCTP_INITIATION)
sys/netpfil/pf/pf_norm.c
2073
ntohs(init.ch.chunk_length), pd);
sys/netpfil/pf/pf_norm.c
2108
ntohs(ch.chunk_length), pd);
sys/powerpc/mambo/mambo_console.c
163
int ch;
sys/powerpc/mambo/mambo_console.c
165
ch = mambocall(MAMBO_CONSOLE_READ);
sys/powerpc/mambo/mambo_console.c
167
if (ch > 0 && ch < 0xff) {
sys/powerpc/mambo/mambo_console.c
169
kdb_alt_break(ch, &alt_break_state);
sys/powerpc/mambo/mambo_console.c
171
return (ch);
sys/powerpc/mpc85xx/fsl_sata.c
1002
ctp = FSL_SATA_CTP(ch, slot);
sys/powerpc/mpc85xx/fsl_sata.c
1004
if (!(fis_size = fsl_sata_setup_fis(ch, ctp, ccb, slot->slot))) {
sys/powerpc/mpc85xx/fsl_sata.c
1005
device_printf(ch->dev, "Setting up SATA FIS failed\n");
sys/powerpc/mpc85xx/fsl_sata.c
1010
clp = FSL_SATA_CLP(ch, slot);
sys/powerpc/mpc85xx/fsl_sata.c
1032
clp->cda = htole32(FSL_SATA_CTP_BUS(ch, slot));
sys/powerpc/mpc85xx/fsl_sata.c
1033
bus_dmamap_sync(ch->dma.work_tag, ch->dma.work_map,
sys/powerpc/mpc85xx/fsl_sata.c
1037
ch->rslots |= (1 << slot->slot);
sys/powerpc/mpc85xx/fsl_sata.c
1038
ATA_OUTL(ch->r_mem, FSL_SATA_P_CQPMP, port);
sys/powerpc/mpc85xx/fsl_sata.c
1039
ATA_OUTL(ch->r_mem, FSL_SATA_P_CQR, (1 << slot->slot));
sys/powerpc/mpc85xx/fsl_sata.c
1050
tmp = ATA_INL(ch->r_mem, FSL_SATA_P_SIG);
sys/powerpc/mpc85xx/fsl_sata.c
1055
if ((ATA_INL(ch->r_mem, FSL_SATA_P_CCR) & (1 << slot->slot)) != 0)
sys/powerpc/mpc85xx/fsl_sata.c
1060
device_printf(ch->dev, "Poll timeout on slot %d port %d (round %d)\n",
sys/powerpc/mpc85xx/fsl_sata.c
1062
device_printf(ch->dev, "hsts %08x cqr %08x ccr %08x ss %08x "
sys/powerpc/mpc85xx/fsl_sata.c
1064
ATA_INL(ch->r_mem, FSL_SATA_P_HSTS),
sys/powerpc/mpc85xx/fsl_sata.c
1065
ATA_INL(ch->r_mem, FSL_SATA_P_CQR),
sys/powerpc/mpc85xx/fsl_sata.c
1066
ATA_INL(ch->r_mem, FSL_SATA_P_CCR),
sys/powerpc/mpc85xx/fsl_sata.c
1067
ATA_INL(ch->r_mem, FSL_SATA_P_SSTS), ch->rslots,
sys/powerpc/mpc85xx/fsl_sata.c
1068
ATA_INL(ch->r_mem, FSL_SATA_P_CER),
sys/powerpc/mpc85xx/fsl_sata.c
1069
ATA_INL(ch->r_mem, FSL_SATA_P_DER),
sys/powerpc/mpc85xx/fsl_sata.c
1070
ATA_INL(ch->r_mem, FSL_SATA_P_SERR),
sys/powerpc/mpc85xx/fsl_sata.c
1071
ATA_INL(ch->r_mem, FSL_SATA_P_CAR),
sys/powerpc/mpc85xx/fsl_sata.c
1072
ATA_INL(ch->r_mem, FSL_SATA_P_SIG));
sys/powerpc/mpc85xx/fsl_sata.c
1087
fsl_sata_process_timeout(struct fsl_sata_channel *ch)
sys/powerpc/mpc85xx/fsl_sata.c
1091
mtx_assert(&ch->mtx, MA_OWNED);
sys/powerpc/mpc85xx/fsl_sata.c
1095
if (ch->slot[i].state < FSL_SATA_SLOT_RUNNING)
sys/powerpc/mpc85xx/fsl_sata.c
1097
fsl_sata_end_transaction(&ch->slot[i], FSL_SATA_ERR_TIMEOUT);
sys/powerpc/mpc85xx/fsl_sata.c
1103
fsl_sata_rearm_timeout(struct fsl_sata_channel *ch)
sys/powerpc/mpc85xx/fsl_sata.c
1107
mtx_assert(&ch->mtx, MA_OWNED);
sys/powerpc/mpc85xx/fsl_sata.c
1109
struct fsl_sata_slot *slot = &ch->slot[i];
sys/powerpc/mpc85xx/fsl_sata.c
1114
if ((ch->toslots & (1 << i)) == 0)
sys/powerpc/mpc85xx/fsl_sata.c
1127
struct fsl_sata_channel *ch = slot->ch;
sys/powerpc/mpc85xx/fsl_sata.c
1128
device_t dev = ch->dev;
sys/powerpc/mpc85xx/fsl_sata.c
1138
sstatus = ATA_INL(ch->r_mem, FSL_SATA_P_CAR);
sys/powerpc/mpc85xx/fsl_sata.c
1152
if (ch->frozen) {
sys/powerpc/mpc85xx/fsl_sata.c
1153
union ccb *fccb = ch->frozen;
sys/powerpc/mpc85xx/fsl_sata.c
1154
ch->frozen = NULL;
sys/powerpc/mpc85xx/fsl_sata.c
1160
fsl_sata_done(ch, fccb);
sys/powerpc/mpc85xx/fsl_sata.c
1162
if (ch->toslots == 0)
sys/powerpc/mpc85xx/fsl_sata.c
1163
xpt_freeze_simq(ch->sim, 1);
sys/powerpc/mpc85xx/fsl_sata.c
1164
ch->toslots |= (1 << slot->slot);
sys/powerpc/mpc85xx/fsl_sata.c
1165
if ((ch->rslots & ~ch->toslots) == 0)
sys/powerpc/mpc85xx/fsl_sata.c
1166
fsl_sata_process_timeout(ch);
sys/powerpc/mpc85xx/fsl_sata.c
1169
ch->rslots & ~ch->toslots);
sys/powerpc/mpc85xx/fsl_sata.c
1176
struct fsl_sata_channel *ch = slot->ch;
sys/powerpc/mpc85xx/fsl_sata.c
1182
bus_dmamap_sync(ch->dma.work_tag, ch->dma.work_map,
sys/powerpc/mpc85xx/fsl_sata.c
1184
clp = FSL_SATA_CLP(ch, slot);
sys/powerpc/mpc85xx/fsl_sata.c
1191
struct fsl_sata_cmd_tab *ctp = FSL_SATA_CTP(ch, slot);
sys/powerpc/mpc85xx/fsl_sata.c
1208
sig = ATA_INL(ch->r_mem, FSL_SATA_P_SIG);
sys/powerpc/mpc85xx/fsl_sata.c
1228
bus_dmamap_sync(ch->dma.data_tag, slot->dma.data_map,
sys/powerpc/mpc85xx/fsl_sata.c
1231
bus_dmamap_unload(ch->dma.data_tag, slot->dma.data_map);
sys/powerpc/mpc85xx/fsl_sata.c
1234
ch->eslots |= (1 << slot->slot);
sys/powerpc/mpc85xx/fsl_sata.c
1236
if ((et != FSL_SATA_ERR_NONE) && (!ch->recoverycmd) &&
sys/powerpc/mpc85xx/fsl_sata.c
1250
ch->fatalerr = 1;
sys/powerpc/mpc85xx/fsl_sata.c
1266
ch->fatalerr = 1;
sys/powerpc/mpc85xx/fsl_sata.c
1267
if (!ch->recoverycmd) {
sys/powerpc/mpc85xx/fsl_sata.c
1268
xpt_freeze_simq(ch->sim, 1);
sys/powerpc/mpc85xx/fsl_sata.c
1275
if (!ch->recoverycmd) {
sys/powerpc/mpc85xx/fsl_sata.c
1276
xpt_freeze_simq(ch->sim, 1);
sys/powerpc/mpc85xx/fsl_sata.c
1283
ch->fatalerr = 1;
sys/powerpc/mpc85xx/fsl_sata.c
1287
ch->oslots &= ~(1 << slot->slot);
sys/powerpc/mpc85xx/fsl_sata.c
1288
ch->rslots &= ~(1 << slot->slot);
sys/powerpc/mpc85xx/fsl_sata.c
1289
ch->aslots &= ~(1 << slot->slot);
sys/powerpc/mpc85xx/fsl_sata.c
1293
ch->numrslots--;
sys/powerpc/mpc85xx/fsl_sata.c
1294
ch->numrslotspd[ccb->ccb_h.target_id]--;
sys/powerpc/mpc85xx/fsl_sata.c
1295
ATA_OUTL(ch->r_mem, FSL_SATA_P_CCR, 1 << slot->slot);
sys/powerpc/mpc85xx/fsl_sata.c
1298
ch->numtslots--;
sys/powerpc/mpc85xx/fsl_sata.c
1299
ch->numtslotspd[ccb->ccb_h.target_id]--;
sys/powerpc/mpc85xx/fsl_sata.c
1303
lastto = (ch->toslots == (1 << slot->slot));
sys/powerpc/mpc85xx/fsl_sata.c
1304
ch->toslots &= ~(1 << slot->slot);
sys/powerpc/mpc85xx/fsl_sata.c
1306
xpt_release_simq(ch->sim, TRUE);
sys/powerpc/mpc85xx/fsl_sata.c
1315
fsl_sata_begin_transaction(ch, ccb);
sys/powerpc/mpc85xx/fsl_sata.c
1320
fsl_sata_process_read_log(ch, ccb);
sys/powerpc/mpc85xx/fsl_sata.c
1323
fsl_sata_process_request_sense(ch, ccb);
sys/powerpc/mpc85xx/fsl_sata.c
1328
ch->hold[slot->slot] = ccb;
sys/powerpc/mpc85xx/fsl_sata.c
1329
ch->numhslots++;
sys/powerpc/mpc85xx/fsl_sata.c
1331
fsl_sata_done(ch, ccb);
sys/powerpc/mpc85xx/fsl_sata.c
1333
if (ch->rslots == 0) {
sys/powerpc/mpc85xx/fsl_sata.c
1335
if (ch->toslots != 0 || ch->fatalerr) {
sys/powerpc/mpc85xx/fsl_sata.c
1336
fsl_sata_reset(ch);
sys/powerpc/mpc85xx/fsl_sata.c
1339
if (ch->eslots != 0) {
sys/powerpc/mpc85xx/fsl_sata.c
1340
fsl_sata_stop(ch);
sys/powerpc/mpc85xx/fsl_sata.c
1341
fsl_sata_start(ch);
sys/powerpc/mpc85xx/fsl_sata.c
1344
if (!ch->recoverycmd && ch->numhslots)
sys/powerpc/mpc85xx/fsl_sata.c
1345
fsl_sata_issue_recovery(ch);
sys/powerpc/mpc85xx/fsl_sata.c
1348
} else if ((ch->rslots & ~ch->toslots) == 0 &&
sys/powerpc/mpc85xx/fsl_sata.c
1350
fsl_sata_rearm_timeout(ch);
sys/powerpc/mpc85xx/fsl_sata.c
1352
if (ch->frozen && !fsl_sata_check_collision(ch, ch->frozen)) {
sys/powerpc/mpc85xx/fsl_sata.c
1353
union ccb *fccb = ch->frozen;
sys/powerpc/mpc85xx/fsl_sata.c
1354
ch->frozen = NULL;
sys/powerpc/mpc85xx/fsl_sata.c
1355
fsl_sata_begin_transaction(ch, fccb);
sys/powerpc/mpc85xx/fsl_sata.c
1356
xpt_release_simq(ch->sim, TRUE);
sys/powerpc/mpc85xx/fsl_sata.c
1359
if (ch->numrslots == 0 && ch->pm_level > 3 &&
sys/powerpc/mpc85xx/fsl_sata.c
1360
(ch->curr[ch->pm_present ? 15 : 0].caps & CTS_SATA_CAPS_D_PMREQ)) {
sys/powerpc/mpc85xx/fsl_sata.c
1361
callout_schedule(&ch->pm_timer,
sys/powerpc/mpc85xx/fsl_sata.c
1362
(ch->pm_level == 4) ? hz / 1000 : hz / 8);
sys/powerpc/mpc85xx/fsl_sata.c
1367
fsl_sata_issue_recovery(struct fsl_sata_channel *ch)
sys/powerpc/mpc85xx/fsl_sata.c
1376
if (ch->hold[i])
sys/powerpc/mpc85xx/fsl_sata.c
1381
device_printf(ch->dev, "Unable to allocate recovery command\n");
sys/powerpc/mpc85xx/fsl_sata.c
1385
if (ch->hold[i] == NULL)
sys/powerpc/mpc85xx/fsl_sata.c
1387
ch->hold[i]->ccb_h.status &= ~CAM_STATUS_MASK;
sys/powerpc/mpc85xx/fsl_sata.c
1388
ch->hold[i]->ccb_h.status |= CAM_RESRC_UNAVAIL;
sys/powerpc/mpc85xx/fsl_sata.c
1389
fsl_sata_done(ch, ch->hold[i]);
sys/powerpc/mpc85xx/fsl_sata.c
1390
ch->hold[i] = NULL;
sys/powerpc/mpc85xx/fsl_sata.c
1391
ch->numhslots--;
sys/powerpc/mpc85xx/fsl_sata.c
1393
fsl_sata_reset(ch);
sys/powerpc/mpc85xx/fsl_sata.c
1396
ccb->ccb_h = ch->hold[i]->ccb_h; /* Reuse old header. */
sys/powerpc/mpc85xx/fsl_sata.c
1407
device_printf(ch->dev,
sys/powerpc/mpc85xx/fsl_sata.c
1429
csio->data_ptr = (void *)&ch->hold[i]->csio.sense_data;
sys/powerpc/mpc85xx/fsl_sata.c
1430
csio->dxfer_len = ch->hold[i]->csio.sense_len;
sys/powerpc/mpc85xx/fsl_sata.c
1437
ch->recoverycmd = 1;
sys/powerpc/mpc85xx/fsl_sata.c
1438
xpt_freeze_simq(ch->sim, 1);
sys/powerpc/mpc85xx/fsl_sata.c
1439
fsl_sata_begin_transaction(ch, ccb);
sys/powerpc/mpc85xx/fsl_sata.c
1443
fsl_sata_process_read_log(struct fsl_sata_channel *ch, union ccb *ccb)
sys/powerpc/mpc85xx/fsl_sata.c
1449
ch->recoverycmd = 0;
sys/powerpc/mpc85xx/fsl_sata.c
1455
if (!ch->hold[i])
sys/powerpc/mpc85xx/fsl_sata.c
1457
if (ch->hold[i]->ccb_h.func_code != XPT_ATA_IO)
sys/powerpc/mpc85xx/fsl_sata.c
1460
res = &ch->hold[i]->ataio.res;
sys/powerpc/mpc85xx/fsl_sata.c
1473
ch->hold[i]->ccb_h.status &= ~CAM_STATUS_MASK;
sys/powerpc/mpc85xx/fsl_sata.c
1474
ch->hold[i]->ccb_h.status |= CAM_REQUEUE_REQ;
sys/powerpc/mpc85xx/fsl_sata.c
1476
fsl_sata_done(ch, ch->hold[i]);
sys/powerpc/mpc85xx/fsl_sata.c
1477
ch->hold[i] = NULL;
sys/powerpc/mpc85xx/fsl_sata.c
1478
ch->numhslots--;
sys/powerpc/mpc85xx/fsl_sata.c
1482
device_printf(ch->dev, "Error while READ LOG EXT\n");
sys/powerpc/mpc85xx/fsl_sata.c
1484
device_printf(ch->dev, "Non-queued command error in READ LOG EXT\n");
sys/powerpc/mpc85xx/fsl_sata.c
1487
if (!ch->hold[i])
sys/powerpc/mpc85xx/fsl_sata.c
1489
if (ch->hold[i]->ccb_h.func_code != XPT_ATA_IO)
sys/powerpc/mpc85xx/fsl_sata.c
1491
fsl_sata_done(ch, ch->hold[i]);
sys/powerpc/mpc85xx/fsl_sata.c
1492
ch->hold[i] = NULL;
sys/powerpc/mpc85xx/fsl_sata.c
1493
ch->numhslots--;
sys/powerpc/mpc85xx/fsl_sata.c
1498
xpt_release_simq(ch->sim, TRUE);
sys/powerpc/mpc85xx/fsl_sata.c
1502
fsl_sata_process_request_sense(struct fsl_sata_channel *ch, union ccb *ccb)
sys/powerpc/mpc85xx/fsl_sata.c
1506
ch->recoverycmd = 0;
sys/powerpc/mpc85xx/fsl_sata.c
1510
ch->hold[i]->ccb_h.status |= CAM_AUTOSNS_VALID;
sys/powerpc/mpc85xx/fsl_sata.c
1512
ch->hold[i]->ccb_h.status &= ~CAM_STATUS_MASK;
sys/powerpc/mpc85xx/fsl_sata.c
1513
ch->hold[i]->ccb_h.status |= CAM_AUTOSENSE_FAIL;
sys/powerpc/mpc85xx/fsl_sata.c
1515
fsl_sata_done(ch, ch->hold[i]);
sys/powerpc/mpc85xx/fsl_sata.c
1516
ch->hold[i] = NULL;
sys/powerpc/mpc85xx/fsl_sata.c
1517
ch->numhslots--;
sys/powerpc/mpc85xx/fsl_sata.c
1519
xpt_release_simq(ch->sim, TRUE);
sys/powerpc/mpc85xx/fsl_sata.c
1523
fsl_sata_start(struct fsl_sata_channel *ch)
sys/powerpc/mpc85xx/fsl_sata.c
1528
ATA_OUTL(ch->r_mem, FSL_SATA_P_SERR, 0xFFFFFFFF);
sys/powerpc/mpc85xx/fsl_sata.c
1530
ATA_OUTL(ch->r_mem, FSL_SATA_P_HSTS, 0x3F);
sys/powerpc/mpc85xx/fsl_sata.c
1531
ATA_OUTL(ch->r_mem, FSL_SATA_P_CER, 0xFFFF);
sys/powerpc/mpc85xx/fsl_sata.c
1532
ATA_OUTL(ch->r_mem, FSL_SATA_P_DER, 0xFFFF);
sys/powerpc/mpc85xx/fsl_sata.c
1534
cmd = ATA_INL(ch->r_mem, FSL_SATA_P_HCTRL);
sys/powerpc/mpc85xx/fsl_sata.c
1537
ATA_OUTL(ch->r_mem, FSL_SATA_P_HCTRL, cmd |
sys/powerpc/mpc85xx/fsl_sata.c
1538
(ch->pm_present ? FSL_SATA_P_HCTRL_PM : 0));
sys/powerpc/mpc85xx/fsl_sata.c
1539
fsl_sata_wait_register(ch, FSL_SATA_P_HSTS,
sys/powerpc/mpc85xx/fsl_sata.c
1541
ATA_OUTL(ch->r_mem, FSL_SATA_P_HSTS,
sys/powerpc/mpc85xx/fsl_sata.c
1542
ATA_INL(ch->r_mem, FSL_SATA_P_HSTS) & FSL_SATA_P_HSTS_PR);
sys/powerpc/mpc85xx/fsl_sata.c
1546
fsl_sata_stop(struct fsl_sata_channel *ch)
sys/powerpc/mpc85xx/fsl_sata.c
1552
cmd = ATA_INL(ch->r_mem, FSL_SATA_P_HCTRL);
sys/powerpc/mpc85xx/fsl_sata.c
1556
ATA_OUTL(ch->r_mem, FSL_SATA_P_HCTRL, cmd);
sys/powerpc/mpc85xx/fsl_sata.c
1557
if (fsl_sata_wait_register(ch, FSL_SATA_P_HSTS,
sys/powerpc/mpc85xx/fsl_sata.c
1560
device_printf(ch->dev,
sys/powerpc/mpc85xx/fsl_sata.c
1566
ch->eslots = 0;
sys/powerpc/mpc85xx/fsl_sata.c
157
#define FSL_SATA_CTP_BUS(ch, slot) \
sys/powerpc/mpc85xx/fsl_sata.c
1570
fsl_sata_reset(struct fsl_sata_channel *ch)
sys/powerpc/mpc85xx/fsl_sata.c
1575
xpt_freeze_simq(ch->sim, 1);
sys/powerpc/mpc85xx/fsl_sata.c
1577
device_printf(ch->dev, "FSL SATA reset...\n");
sys/powerpc/mpc85xx/fsl_sata.c
158
((ch->dma.work_bus + FSL_SATA_CT_OFFSET + (FSL_SATA_CT_SIZE * slot->slot)))
sys/powerpc/mpc85xx/fsl_sata.c
1580
if (ch->frozen) {
sys/powerpc/mpc85xx/fsl_sata.c
1581
union ccb *fccb = ch->frozen;
sys/powerpc/mpc85xx/fsl_sata.c
1582
ch->frozen = NULL;
sys/powerpc/mpc85xx/fsl_sata.c
1588
fsl_sata_done(ch, fccb);
sys/powerpc/mpc85xx/fsl_sata.c
1591
fsl_sata_stop(ch);
sys/powerpc/mpc85xx/fsl_sata.c
1595
if (ch->slot[i].state < FSL_SATA_SLOT_RUNNING)
sys/powerpc/mpc85xx/fsl_sata.c
1598
fsl_sata_end_transaction(&ch->slot[i], FSL_SATA_ERR_INNOCENT);
sys/powerpc/mpc85xx/fsl_sata.c
160
#define FSL_SATA_CTP(ch, slot) \
sys/powerpc/mpc85xx/fsl_sata.c
1601
if (!ch->hold[i])
sys/powerpc/mpc85xx/fsl_sata.c
1603
fsl_sata_done(ch, ch->hold[i]);
sys/powerpc/mpc85xx/fsl_sata.c
1604
ch->hold[i] = NULL;
sys/powerpc/mpc85xx/fsl_sata.c
1605
ch->numhslots--;
sys/powerpc/mpc85xx/fsl_sata.c
1607
if (ch->toslots != 0)
sys/powerpc/mpc85xx/fsl_sata.c
1608
xpt_release_simq(ch->sim, TRUE);
sys/powerpc/mpc85xx/fsl_sata.c
1609
ch->eslots = 0;
sys/powerpc/mpc85xx/fsl_sata.c
161
((struct fsl_sata_cmd_tab *)(ch->dma.work + FSL_SATA_CT_OFFSET + \
sys/powerpc/mpc85xx/fsl_sata.c
1610
ch->toslots = 0;
sys/powerpc/mpc85xx/fsl_sata.c
1611
ch->fatalerr = 0;
sys/powerpc/mpc85xx/fsl_sata.c
1613
xpt_async(AC_BUS_RESET, ch->path, NULL);
sys/powerpc/mpc85xx/fsl_sata.c
1615
ATA_OUTL(ch->r_mem, FSL_SATA_P_HCTRL,
sys/powerpc/mpc85xx/fsl_sata.c
1616
ATA_INL(ch->r_mem, FSL_SATA_P_HCTRL) & ~0x3f);
sys/powerpc/mpc85xx/fsl_sata.c
1618
fsl_sata_start(ch);
sys/powerpc/mpc85xx/fsl_sata.c
1619
if (fsl_sata_wait_register(ch, FSL_SATA_P_HSTS, 0x08, 0x08, 500)) {
sys/powerpc/mpc85xx/fsl_sata.c
1621
device_printf(ch->dev,
sys/powerpc/mpc85xx/fsl_sata.c
1623
ch->devices = 0;
sys/powerpc/mpc85xx/fsl_sata.c
1625
ATA_OUTL(ch->r_mem, FSL_SATA_P_HCTRL,
sys/powerpc/mpc85xx/fsl_sata.c
1626
ATA_INL(ch->r_mem, FSL_SATA_P_HCTRL) | FSL_SATA_P_HCTRL_PHYRDY);
sys/powerpc/mpc85xx/fsl_sata.c
1627
xpt_release_simq(ch->sim, TRUE);
sys/powerpc/mpc85xx/fsl_sata.c
163
#define FSL_SATA_CLP(ch, slot) \
sys/powerpc/mpc85xx/fsl_sata.c
1631
device_printf(ch->dev, "FSL SATA reset: device found\n");
sys/powerpc/mpc85xx/fsl_sata.c
1632
ch->devices = 1;
sys/powerpc/mpc85xx/fsl_sata.c
1634
ctrl = ATA_INL(ch->r_mem, FSL_SATA_P_HCTRL) & ~0x3f;
sys/powerpc/mpc85xx/fsl_sata.c
1635
ATA_OUTL(ch->r_mem, FSL_SATA_P_HCTRL,
sys/powerpc/mpc85xx/fsl_sata.c
1639
xpt_release_simq(ch->sim, TRUE);
sys/powerpc/mpc85xx/fsl_sata.c
164
((struct fsl_sata_cmd_list *) (ch->dma.work + FSL_SATA_CL_OFFSET + \
sys/powerpc/mpc85xx/fsl_sata.c
1643
fsl_sata_setup_fis(struct fsl_sata_channel *ch, struct fsl_sata_cmd_tab *ctp, union ccb *ccb, int tag)
sys/powerpc/mpc85xx/fsl_sata.c
1654
ch->curr[ccb->ccb_h.target_id].mode >= ATA_DMA)
sys/powerpc/mpc85xx/fsl_sata.c
1693
fsl_sata_check_ids(struct fsl_sata_channel *ch, union ccb *ccb)
sys/powerpc/mpc85xx/fsl_sata.c
1698
fsl_sata_done(ch, ccb);
sys/powerpc/mpc85xx/fsl_sata.c
1703
fsl_sata_done(ch, ccb);
sys/powerpc/mpc85xx/fsl_sata.c
1712
struct fsl_sata_channel *ch;
sys/powerpc/mpc85xx/fsl_sata.c
1717
ch = (struct fsl_sata_channel *)cam_sim_softc(sim);
sys/powerpc/mpc85xx/fsl_sata.c
1722
if (fsl_sata_check_ids(ch, ccb))
sys/powerpc/mpc85xx/fsl_sata.c
1724
if (ch->devices == 0 ||
sys/powerpc/mpc85xx/fsl_sata.c
1725
(ch->pm_present == 0 &&
sys/powerpc/mpc85xx/fsl_sata.c
1732
if (fsl_sata_check_collision(ch, ccb)) {
sys/powerpc/mpc85xx/fsl_sata.c
1734
ch->frozen = ccb;
sys/powerpc/mpc85xx/fsl_sata.c
1736
xpt_freeze_simq(ch->sim, 1);
sys/powerpc/mpc85xx/fsl_sata.c
1739
fsl_sata_begin_transaction(ch, ccb);
sys/powerpc/mpc85xx/fsl_sata.c
1750
if (fsl_sata_check_ids(ch, ccb))
sys/powerpc/mpc85xx/fsl_sata.c
1753
d = &ch->curr[ccb->ccb_h.target_id];
sys/powerpc/mpc85xx/fsl_sata.c
1755
d = &ch->user[ccb->ccb_h.target_id];
sys/powerpc/mpc85xx/fsl_sata.c
1765
ch->pm_present = cts->xport_specific.sata.pm_present;
sys/powerpc/mpc85xx/fsl_sata.c
1778
if (fsl_sata_check_ids(ch, ccb))
sys/powerpc/mpc85xx/fsl_sata.c
1781
d = &ch->curr[ccb->ccb_h.target_id];
sys/powerpc/mpc85xx/fsl_sata.c
1783
d = &ch->user[ccb->ccb_h.target_id];
sys/powerpc/mpc85xx/fsl_sata.c
1792
(ccb->ccb_h.target_id == 0 && !ch->pm_present))) {
sys/powerpc/mpc85xx/fsl_sata.c
1793
status = ATA_INL(ch->r_mem, FSL_SATA_P_SSTS) & ATA_SS_SPD_MASK;
sys/powerpc/mpc85xx/fsl_sata.c
1801
if (ch->pm_level) {
sys/powerpc/mpc85xx/fsl_sata.c
1806
ch->user[ccb->ccb_h.target_id].caps;
sys/powerpc/mpc85xx/fsl_sata.c
1818
cts->xport_specific.sata.pm_present = ch->pm_present;
sys/powerpc/mpc85xx/fsl_sata.c
1829
fsl_sata_reset(ch);
sys/powerpc/mpc85xx/fsl_sata.c
1878
fsl_sata_done(ch, ccb);
sys/powerpc/mpc85xx/fsl_sata.c
1884
struct fsl_sata_channel *ch = (struct fsl_sata_channel *)cam_sim_softc(sim);
sys/powerpc/mpc85xx/fsl_sata.c
1888
istatus = ATA_INL(ch->r_mem, FSL_SATA_P_HSTS);
sys/powerpc/mpc85xx/fsl_sata.c
1890
fsl_sata_intr_main(ch, istatus);
sys/powerpc/mpc85xx/fsl_sata.c
231
struct fsl_sata_channel *ch; /* Channel */
sys/powerpc/mpc85xx/fsl_sata.c
326
struct fsl_sata_channel *ch = device_get_softc(dev);
sys/powerpc/mpc85xx/fsl_sata.c
330
ch->dev = dev;
sys/powerpc/mpc85xx/fsl_sata.c
331
mtx_init(&ch->mtx, "FSL SATA channel lock", NULL, MTX_DEF);
sys/powerpc/mpc85xx/fsl_sata.c
332
ch->pm_level = 0;
sys/powerpc/mpc85xx/fsl_sata.c
334
device_get_unit(dev), "pm_level", &ch->pm_level);
sys/powerpc/mpc85xx/fsl_sata.c
335
STAILQ_INIT(&ch->doneq);
sys/powerpc/mpc85xx/fsl_sata.c
336
if (ch->pm_level > 3)
sys/powerpc/mpc85xx/fsl_sata.c
337
callout_init_mtx(&ch->pm_timer, &ch->mtx, 0);
sys/powerpc/mpc85xx/fsl_sata.c
341
ch->user[i].revision = sata_rev;
sys/powerpc/mpc85xx/fsl_sata.c
342
ch->user[i].mode = 0;
sys/powerpc/mpc85xx/fsl_sata.c
343
ch->user[i].bytecount = 8192;
sys/powerpc/mpc85xx/fsl_sata.c
344
ch->user[i].tags = FSL_SATA_MAX_SLOTS;
sys/powerpc/mpc85xx/fsl_sata.c
345
ch->user[i].caps = 0;
sys/powerpc/mpc85xx/fsl_sata.c
346
ch->curr[i] = ch->user[i];
sys/powerpc/mpc85xx/fsl_sata.c
347
if (ch->pm_level) {
sys/powerpc/mpc85xx/fsl_sata.c
348
ch->user[i].caps = CTS_SATA_CAPS_H_PMREQ |
sys/powerpc/mpc85xx/fsl_sata.c
351
ch->user[i].caps |= CTS_SATA_CAPS_H_AN;
sys/powerpc/mpc85xx/fsl_sata.c
353
ch->r_mid = 0;
sys/powerpc/mpc85xx/fsl_sata.c
354
if (!(ch->r_mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY,
sys/powerpc/mpc85xx/fsl_sata.c
355
&ch->r_mid, RF_ACTIVE | RF_LITTLEENDIAN)))
sys/powerpc/mpc85xx/fsl_sata.c
361
if (!(ch->r_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ,
sys/powerpc/mpc85xx/fsl_sata.c
367
if ((bus_setup_intr(dev, ch->r_irq, ATA_INTR_FLAGS, NULL,
sys/powerpc/mpc85xx/fsl_sata.c
368
fsl_sata_intr, ch, &ch->ih))) {
sys/powerpc/mpc85xx/fsl_sata.c
373
mtx_lock(&ch->mtx);
sys/powerpc/mpc85xx/fsl_sata.c
382
ch->sim = cam_sim_alloc(fsl_sataaction, fsl_satapoll, "fslsata", ch,
sys/powerpc/mpc85xx/fsl_sata.c
383
device_get_unit(dev), (struct mtx *)&ch->mtx, 2, FSL_SATA_MAX_SLOTS,
sys/powerpc/mpc85xx/fsl_sata.c
385
if (ch->sim == NULL) {
sys/powerpc/mpc85xx/fsl_sata.c
391
if (xpt_bus_register(ch->sim, dev, 0) != CAM_SUCCESS) {
sys/powerpc/mpc85xx/fsl_sata.c
396
if (xpt_create_path(&ch->path, /*periph*/NULL, cam_sim_path(ch->sim),
sys/powerpc/mpc85xx/fsl_sata.c
402
if (ch->pm_level > 3) {
sys/powerpc/mpc85xx/fsl_sata.c
403
callout_reset(&ch->pm_timer,
sys/powerpc/mpc85xx/fsl_sata.c
404
(ch->pm_level == 4) ? hz / 1000 : hz / 8,
sys/powerpc/mpc85xx/fsl_sata.c
405
fsl_sata_pm, ch);
sys/powerpc/mpc85xx/fsl_sata.c
407
mtx_unlock(&ch->mtx);
sys/powerpc/mpc85xx/fsl_sata.c
411
xpt_bus_deregister(cam_sim_path(ch->sim));
sys/powerpc/mpc85xx/fsl_sata.c
413
cam_sim_free(ch->sim, /*free_devq*/TRUE);
sys/powerpc/mpc85xx/fsl_sata.c
415
mtx_unlock(&ch->mtx);
sys/powerpc/mpc85xx/fsl_sata.c
416
bus_release_resource(dev, SYS_RES_IRQ, ATA_IRQ_RID, ch->r_irq);
sys/powerpc/mpc85xx/fsl_sata.c
418
bus_release_resource(dev, SYS_RES_MEMORY, ch->r_mid, ch->r_mem);
sys/powerpc/mpc85xx/fsl_sata.c
419
mtx_destroy(&ch->mtx);
sys/powerpc/mpc85xx/fsl_sata.c
426
struct fsl_sata_channel *ch = device_get_softc(dev);
sys/powerpc/mpc85xx/fsl_sata.c
428
mtx_lock(&ch->mtx);
sys/powerpc/mpc85xx/fsl_sata.c
429
xpt_async(AC_LOST_DEVICE, ch->path, NULL);
sys/powerpc/mpc85xx/fsl_sata.c
431
xpt_free_path(ch->path);
sys/powerpc/mpc85xx/fsl_sata.c
432
xpt_bus_deregister(cam_sim_path(ch->sim));
sys/powerpc/mpc85xx/fsl_sata.c
433
cam_sim_free(ch->sim, /*free_devq*/TRUE);
sys/powerpc/mpc85xx/fsl_sata.c
434
mtx_unlock(&ch->mtx);
sys/powerpc/mpc85xx/fsl_sata.c
436
if (ch->pm_level > 3)
sys/powerpc/mpc85xx/fsl_sata.c
437
callout_drain(&ch->pm_timer);
sys/powerpc/mpc85xx/fsl_sata.c
438
bus_teardown_intr(dev, ch->r_irq, ch->ih);
sys/powerpc/mpc85xx/fsl_sata.c
439
bus_release_resource(dev, SYS_RES_IRQ, ATA_IRQ_RID, ch->r_irq);
sys/powerpc/mpc85xx/fsl_sata.c
445
bus_release_resource(dev, SYS_RES_MEMORY, ch->r_mid, ch->r_mem);
sys/powerpc/mpc85xx/fsl_sata.c
446
mtx_destroy(&ch->mtx);
sys/powerpc/mpc85xx/fsl_sata.c
451
fsl_sata_wait_register(struct fsl_sata_channel *ch, bus_size_t off,
sys/powerpc/mpc85xx/fsl_sata.c
457
while (((rval = ATA_INL(ch->r_mem, off)) & mask) != val) {
sys/powerpc/mpc85xx/fsl_sata.c
470
struct fsl_sata_channel *ch = device_get_softc(dev);
sys/powerpc/mpc85xx/fsl_sata.c
475
r = ATA_INL(ch->r_mem, FSL_SATA_P_HCTRL);
sys/powerpc/mpc85xx/fsl_sata.c
478
ATA_OUTL(ch->r_mem, FSL_SATA_P_HCTRL, r & ~FSL_SATA_P_HCTRL_INT_MASK);
sys/powerpc/mpc85xx/fsl_sata.c
479
fsl_sata_wait_register(ch, FSL_SATA_P_HSTS,
sys/powerpc/mpc85xx/fsl_sata.c
482
work = ch->dma.work_bus + FSL_SATA_CL_OFFSET;
sys/powerpc/mpc85xx/fsl_sata.c
483
ATA_OUTL(ch->r_mem, FSL_SATA_P_CHBA, work);
sys/powerpc/mpc85xx/fsl_sata.c
486
ATA_OUTL(ch->r_mem, FSL_SATA_P_HCTRL, r);
sys/powerpc/mpc85xx/fsl_sata.c
487
r = ATA_INL(ch->r_mem, FSL_SATA_P_PCC);
sys/powerpc/mpc85xx/fsl_sata.c
488
ATA_OUTL(ch->r_mem, FSL_SATA_P_PCC, r & ~FSL_SATA_PCC_LPB_EN);
sys/powerpc/mpc85xx/fsl_sata.c
489
ATA_OUTL(ch->r_mem, FSL_SATA_P_ICC, (1 << FSL_SATA_P_ICC_ITC_S));
sys/powerpc/mpc85xx/fsl_sata.c
490
fsl_sata_start(ch);
sys/powerpc/mpc85xx/fsl_sata.c
497
struct fsl_sata_channel *ch = device_get_softc(dev);
sys/powerpc/mpc85xx/fsl_sata.c
501
r = ATA_INL(ch->r_mem, FSL_SATA_P_HCTRL);
sys/powerpc/mpc85xx/fsl_sata.c
502
ATA_OUTL(ch->r_mem, FSL_SATA_P_HCTRL, r & ~FSL_SATA_P_HCTRL_INT_MASK);
sys/powerpc/mpc85xx/fsl_sata.c
504
fsl_sata_stop(ch);
sys/powerpc/mpc85xx/fsl_sata.c
506
ATA_OUTL(ch->r_mem, FSL_SATA_P_SCTL, 0);
sys/powerpc/mpc85xx/fsl_sata.c
509
ATA_OUTL(ch->r_mem, FSL_SATA_P_SCTL, ATA_SC_DET_DISABLE);
sys/powerpc/mpc85xx/fsl_sata.c
510
r = ATA_INL(ch->r_mem, FSL_SATA_P_HCTRL);
sys/powerpc/mpc85xx/fsl_sata.c
512
ATA_OUTL(ch->r_mem, FSL_SATA_P_HCTRL, r & ~FSL_SATA_P_HCTRL_HC_ON);
sys/powerpc/mpc85xx/fsl_sata.c
519
struct fsl_sata_channel *ch = device_get_softc(dev);
sys/powerpc/mpc85xx/fsl_sata.c
521
mtx_lock(&ch->mtx);
sys/powerpc/mpc85xx/fsl_sata.c
522
xpt_freeze_simq(ch->sim, 1);
sys/powerpc/mpc85xx/fsl_sata.c
523
while (ch->oslots)
sys/powerpc/mpc85xx/fsl_sata.c
524
msleep(ch, &ch->mtx, PRIBIO, "fsl_satasusp", hz/100);
sys/powerpc/mpc85xx/fsl_sata.c
526
mtx_unlock(&ch->mtx);
sys/powerpc/mpc85xx/fsl_sata.c
533
struct fsl_sata_channel *ch = device_get_softc(dev);
sys/powerpc/mpc85xx/fsl_sata.c
535
mtx_lock(&ch->mtx);
sys/powerpc/mpc85xx/fsl_sata.c
537
fsl_sata_reset(ch);
sys/powerpc/mpc85xx/fsl_sata.c
538
xpt_release_simq(ch->sim, TRUE);
sys/powerpc/mpc85xx/fsl_sata.c
539
mtx_unlock(&ch->mtx);
sys/powerpc/mpc85xx/fsl_sata.c
568
struct fsl_sata_channel *ch = device_get_softc(dev);
sys/powerpc/mpc85xx/fsl_sata.c
575
0, NULL, NULL, &ch->dma.work_tag))
sys/powerpc/mpc85xx/fsl_sata.c
577
if (bus_dmamem_alloc(ch->dma.work_tag, (void **)&ch->dma.work,
sys/powerpc/mpc85xx/fsl_sata.c
578
BUS_DMA_ZERO, &ch->dma.work_map))
sys/powerpc/mpc85xx/fsl_sata.c
580
if (bus_dmamap_load(ch->dma.work_tag, ch->dma.work_map, ch->dma.work,
sys/powerpc/mpc85xx/fsl_sata.c
582
bus_dmamem_free(ch->dma.work_tag, ch->dma.work, ch->dma.work_map);
sys/powerpc/mpc85xx/fsl_sata.c
585
ch->dma.work_bus = dcba.maddr;
sys/powerpc/mpc85xx/fsl_sata.c
591
0, busdma_lock_mutex, &ch->mtx, &ch->dma.data_tag)) {
sys/powerpc/mpc85xx/fsl_sata.c
595
device_printf(dev, "work area: %p\n", ch->dma.work);
sys/powerpc/mpc85xx/fsl_sata.c
615
struct fsl_sata_channel *ch = device_get_softc(dev);
sys/powerpc/mpc85xx/fsl_sata.c
617
if (ch->dma.data_tag) {
sys/powerpc/mpc85xx/fsl_sata.c
618
bus_dma_tag_destroy(ch->dma.data_tag);
sys/powerpc/mpc85xx/fsl_sata.c
619
ch->dma.data_tag = NULL;
sys/powerpc/mpc85xx/fsl_sata.c
621
if (ch->dma.work_bus) {
sys/powerpc/mpc85xx/fsl_sata.c
622
bus_dmamap_unload(ch->dma.work_tag, ch->dma.work_map);
sys/powerpc/mpc85xx/fsl_sata.c
623
bus_dmamem_free(ch->dma.work_tag, ch->dma.work, ch->dma.work_map);
sys/powerpc/mpc85xx/fsl_sata.c
624
ch->dma.work_bus = 0;
sys/powerpc/mpc85xx/fsl_sata.c
625
ch->dma.work = NULL;
sys/powerpc/mpc85xx/fsl_sata.c
627
if (ch->dma.work_tag) {
sys/powerpc/mpc85xx/fsl_sata.c
628
bus_dma_tag_destroy(ch->dma.work_tag);
sys/powerpc/mpc85xx/fsl_sata.c
629
ch->dma.work_tag = NULL;
sys/powerpc/mpc85xx/fsl_sata.c
636
struct fsl_sata_channel *ch = device_get_softc(dev);
sys/powerpc/mpc85xx/fsl_sata.c
640
bzero(ch->slot, sizeof(ch->slot));
sys/powerpc/mpc85xx/fsl_sata.c
642
struct fsl_sata_slot *slot = &ch->slot[i];
sys/powerpc/mpc85xx/fsl_sata.c
644
slot->ch = ch;
sys/powerpc/mpc85xx/fsl_sata.c
648
callout_init_mtx(&slot->timeout, &ch->mtx, 0);
sys/powerpc/mpc85xx/fsl_sata.c
65
static void fsl_sata_intr_main(struct fsl_sata_channel *ch, uint32_t istatus);
sys/powerpc/mpc85xx/fsl_sata.c
650
if (bus_dmamap_create(ch->dma.data_tag, 0, &slot->dma.data_map))
sys/powerpc/mpc85xx/fsl_sata.c
651
device_printf(ch->dev, "FAILURE - create data_map\n");
sys/powerpc/mpc85xx/fsl_sata.c
658
struct fsl_sata_channel *ch = device_get_softc(dev);
sys/powerpc/mpc85xx/fsl_sata.c
66
static void fsl_sata_begin_transaction(struct fsl_sata_channel *ch, union ccb *ccb);
sys/powerpc/mpc85xx/fsl_sata.c
663
struct fsl_sata_slot *slot = &ch->slot[i];
sys/powerpc/mpc85xx/fsl_sata.c
667
bus_dmamap_destroy(ch->dma.data_tag, slot->dma.data_map);
sys/powerpc/mpc85xx/fsl_sata.c
674
fsl_sata_phy_check_events(struct fsl_sata_channel *ch, u_int32_t serr)
sys/powerpc/mpc85xx/fsl_sata.c
677
if (((ch->pm_level == 0) && (serr & ATA_SE_PHY_CHANGED)) ||
sys/powerpc/mpc85xx/fsl_sata.c
678
((ch->pm_level != 0) && (serr & ATA_SE_EXCHANGED))) {
sys/powerpc/mpc85xx/fsl_sata.c
679
u_int32_t status = ATA_INL(ch->r_mem, FSL_SATA_P_SSTS);
sys/powerpc/mpc85xx/fsl_sata.c
684
device_printf(ch->dev, "CONNECT requested\n");
sys/powerpc/mpc85xx/fsl_sata.c
686
device_printf(ch->dev, "DISCONNECT requested\n");
sys/powerpc/mpc85xx/fsl_sata.c
689
xpt_async(AC_BUS_RESET, ch->path, NULL);
sys/powerpc/mpc85xx/fsl_sata.c
693
cam_sim_path(ch->sim),
sys/powerpc/mpc85xx/fsl_sata.c
705
fsl_sata_notify_events(struct fsl_sata_channel *ch, u_int32_t status)
sys/powerpc/mpc85xx/fsl_sata.c
71
static int fsl_sata_setup_fis(struct fsl_sata_channel *ch, struct fsl_sata_cmd_tab *ctp, union ccb *ccb, int tag);
sys/powerpc/mpc85xx/fsl_sata.c
710
ATA_OUTL(ch->r_mem, FSL_SATA_P_SNTF, status);
sys/powerpc/mpc85xx/fsl_sata.c
712
device_printf(ch->dev, "SNTF 0x%04x\n", status);
sys/powerpc/mpc85xx/fsl_sata.c
717
xpt_path_path_id(ch->path), i, 0) == CAM_REQ_CMP) {
sys/powerpc/mpc85xx/fsl_sata.c
725
fsl_sata_done(struct fsl_sata_channel *ch, union ccb *ccb)
sys/powerpc/mpc85xx/fsl_sata.c
728
mtx_assert(&ch->mtx, MA_OWNED);
sys/powerpc/mpc85xx/fsl_sata.c
730
ch->batch == 0) {
sys/powerpc/mpc85xx/fsl_sata.c
735
STAILQ_INSERT_TAIL(&ch->doneq, &ccb->ccb_h, sim_links.stqe);
sys/powerpc/mpc85xx/fsl_sata.c
741
struct fsl_sata_channel *ch = (struct fsl_sata_channel *)arg;
sys/powerpc/mpc85xx/fsl_sata.c
747
istatus = ATA_INL(ch->r_mem, FSL_SATA_P_HSTS) & 0x7ffff;
sys/powerpc/mpc85xx/fsl_sata.c
751
mtx_lock(&ch->mtx);
sys/powerpc/mpc85xx/fsl_sata.c
752
ch->batch = 1;
sys/powerpc/mpc85xx/fsl_sata.c
753
fsl_sata_intr_main(ch, istatus);
sys/powerpc/mpc85xx/fsl_sata.c
754
ch->batch = 0;
sys/powerpc/mpc85xx/fsl_sata.c
759
STAILQ_CONCAT(&tmp_doneq, &ch->doneq);
sys/powerpc/mpc85xx/fsl_sata.c
760
mtx_unlock(&ch->mtx);
sys/powerpc/mpc85xx/fsl_sata.c
766
ATA_OUTL(ch->r_mem, FSL_SATA_P_HSTS, istatus & 0x3f);
sys/powerpc/mpc85xx/fsl_sata.c
77
static void fsl_sata_reset(struct fsl_sata_channel *ch);
sys/powerpc/mpc85xx/fsl_sata.c
773
struct fsl_sata_channel *ch = (struct fsl_sata_channel *)arg;
sys/powerpc/mpc85xx/fsl_sata.c
776
if (ch->numrslots != 0)
sys/powerpc/mpc85xx/fsl_sata.c
778
work = ATA_INL(ch->r_mem, FSL_SATA_P_PCC) & ~FSL_SATA_PCC_LPB_EN;
sys/powerpc/mpc85xx/fsl_sata.c
779
if (ch->pm_level == 4)
sys/powerpc/mpc85xx/fsl_sata.c
78
static void fsl_sata_start(struct fsl_sata_channel *ch);
sys/powerpc/mpc85xx/fsl_sata.c
783
ATA_OUTL(ch->r_mem, FSL_SATA_P_PCC, work);
sys/powerpc/mpc85xx/fsl_sata.c
788
fsl_sata_intr_main(struct fsl_sata_channel *ch, uint32_t istatus)
sys/powerpc/mpc85xx/fsl_sata.c
79
static void fsl_sata_stop(struct fsl_sata_channel *ch);
sys/powerpc/mpc85xx/fsl_sata.c
795
ok = ATA_INL(ch->r_mem, FSL_SATA_P_CCR);
sys/powerpc/mpc85xx/fsl_sata.c
797
ATA_OUTL(ch->r_mem, FSL_SATA_P_CCR, ok);
sys/powerpc/mpc85xx/fsl_sata.c
798
if (ch->aslots == 0 && ok != 0) {
sys/powerpc/mpc85xx/fsl_sata.c
800
if (((ok >> i) & 1) && ch->slot[i].ccb != NULL)
sys/powerpc/mpc85xx/fsl_sata.c
801
fsl_sata_end_transaction(&ch->slot[i],
sys/powerpc/mpc85xx/fsl_sata.c
807
sntf = ATA_INL(ch->r_mem, FSL_SATA_P_SNTF);
sys/powerpc/mpc85xx/fsl_sata.c
809
serr = ATA_INL(ch->r_mem, FSL_SATA_P_SERR);
sys/powerpc/mpc85xx/fsl_sata.c
81
static void fsl_sata_issue_recovery(struct fsl_sata_channel *ch);
sys/powerpc/mpc85xx/fsl_sata.c
810
ATA_OUTL(ch->r_mem, FSL_SATA_P_SERR, serr);
sys/powerpc/mpc85xx/fsl_sata.c
813
fsl_sata_phy_check_events(ch, serr);
sys/powerpc/mpc85xx/fsl_sata.c
818
cer = ATA_INL(ch->r_mem, FSL_SATA_P_CER);
sys/powerpc/mpc85xx/fsl_sata.c
819
ATA_OUTL(ch->r_mem, FSL_SATA_P_CER, cer);
sys/powerpc/mpc85xx/fsl_sata.c
82
static void fsl_sata_process_read_log(struct fsl_sata_channel *ch, union ccb *ccb);
sys/powerpc/mpc85xx/fsl_sata.c
820
der = ATA_INL(ch->r_mem, FSL_SATA_P_DER);
sys/powerpc/mpc85xx/fsl_sata.c
821
ATA_OUTL(ch->r_mem, FSL_SATA_P_DER, der);
sys/powerpc/mpc85xx/fsl_sata.c
824
if (ch->frozen) {
sys/powerpc/mpc85xx/fsl_sata.c
825
union ccb *fccb = ch->frozen;
sys/powerpc/mpc85xx/fsl_sata.c
826
ch->frozen = NULL;
sys/powerpc/mpc85xx/fsl_sata.c
83
static void fsl_sata_process_request_sense(struct fsl_sata_channel *ch, union ccb *ccb);
sys/powerpc/mpc85xx/fsl_sata.c
832
fsl_sata_done(ch, fccb);
sys/powerpc/mpc85xx/fsl_sata.c
835
if (ch->slot[i].ccb == NULL)
sys/powerpc/mpc85xx/fsl_sata.c
839
else if ((der & (1 << ch->slot[i].ccb->ccb_h.target_id)) != 0)
sys/powerpc/mpc85xx/fsl_sata.c
843
fsl_sata_end_transaction(&ch->slot[i], et);
sys/powerpc/mpc85xx/fsl_sata.c
848
fsl_sata_notify_events(ch, sntf);
sys/powerpc/mpc85xx/fsl_sata.c
853
fsl_sata_check_collision(struct fsl_sata_channel *ch, union ccb *ccb)
sys/powerpc/mpc85xx/fsl_sata.c
860
if (((~ch->oslots) & (0xffff >> (16 - ch->curr[t].tags))) == 0)
sys/powerpc/mpc85xx/fsl_sata.c
863
if (ch->numrslotspd[t] != 0 && ch->numtslotspd[t] == 0)
sys/powerpc/mpc85xx/fsl_sata.c
867
if (ch->numrslotspd[t] != 0 && ch->numtslotspd[t] != 0)
sys/powerpc/mpc85xx/fsl_sata.c
873
if (ch->numrslots != 0)
sys/powerpc/mpc85xx/fsl_sata.c
877
if (ch->aslots != 0)
sys/powerpc/mpc85xx/fsl_sata.c
884
fsl_sata_begin_transaction(struct fsl_sata_channel *ch, union ccb *ccb)
sys/powerpc/mpc85xx/fsl_sata.c
895
tags = ch->curr[ccb->ccb_h.target_id].tags;
sys/powerpc/mpc85xx/fsl_sata.c
896
if (ch->lastslot + 1 < tags)
sys/powerpc/mpc85xx/fsl_sata.c
897
tag = ffs(~(ch->oslots >> (ch->lastslot + 1)));
sys/powerpc/mpc85xx/fsl_sata.c
900
if (tag == 0 || tag + ch->lastslot >= tags)
sys/powerpc/mpc85xx/fsl_sata.c
901
tag = ffs(~ch->oslots) - 1;
sys/powerpc/mpc85xx/fsl_sata.c
903
tag += ch->lastslot;
sys/powerpc/mpc85xx/fsl_sata.c
904
ch->lastslot = tag;
sys/powerpc/mpc85xx/fsl_sata.c
906
slot = &ch->slot[tag];
sys/powerpc/mpc85xx/fsl_sata.c
910
if (ch->numrslots == 0 && ch->pm_level > 3)
sys/powerpc/mpc85xx/fsl_sata.c
911
callout_stop(&ch->pm_timer);
sys/powerpc/mpc85xx/fsl_sata.c
913
ch->oslots |= (1 << tag);
sys/powerpc/mpc85xx/fsl_sata.c
914
ch->numrslots++;
sys/powerpc/mpc85xx/fsl_sata.c
915
ch->numrslotspd[ccb->ccb_h.target_id]++;
sys/powerpc/mpc85xx/fsl_sata.c
918
ch->numtslots++;
sys/powerpc/mpc85xx/fsl_sata.c
919
ch->numtslotspd[ccb->ccb_h.target_id]++;
sys/powerpc/mpc85xx/fsl_sata.c
920
ch->taggedtarget = ccb->ccb_h.target_id;
sys/powerpc/mpc85xx/fsl_sata.c
924
ch->aslots |= (1 << tag);
sys/powerpc/mpc85xx/fsl_sata.c
927
bus_dmamap_load_ccb(ch->dma.data_tag, slot->dma.data_map, ccb,
sys/powerpc/mpc85xx/fsl_sata.c
943
struct fsl_sata_channel *ch = slot->ch;
sys/powerpc/mpc85xx/fsl_sata.c
949
device_printf(ch->dev, "DMA load error %d\n", error);
sys/powerpc/mpc85xx/fsl_sata.c
956
ctp = FSL_SATA_CTP(ch, slot);
sys/powerpc/mpc85xx/fsl_sata.c
962
prd[j].dba = htole32(FSL_SATA_CTP_BUS(ch, slot) +
sys/powerpc/mpc85xx/fsl_sata.c
979
bus_dmamap_sync(ch->dma.data_tag, slot->dma.data_map,
sys/powerpc/mpc85xx/fsl_sata.c
989
struct fsl_sata_channel *ch = slot->ch;
sys/powerpc/powermac/ata_dbdma.c
127
struct ata_channel *ch = device_get_softc(dev);
sys/powerpc/powermac/ata_dbdma.c
134
if (ATA_IDX_INB(ch, ATA_ALTSTAT) & ATA_S_BUSY) {
sys/powerpc/powermac/ata_dbdma.c
136
if (ATA_IDX_INB(ch, ATA_ALTSTAT) & ATA_S_BUSY)
sys/powerpc/powermac/ata_dbdma.c
205
struct ata_channel *ch = device_get_softc(request->parent);
sys/powerpc/powermac/ata_dbdma.c
218
if (((uintptr_t)(request->data) & (ch->dma.alignment - 1)) ||
sys/powerpc/powermac/ata_dbdma.c
219
(request->bytecount & (ch->dma.alignment - 1))) {
sys/powerpc/powermac/ata_dbdma.c
224
if (request->bytecount > ch->dma.max_iosize) {
sys/powerpc/powermac/ata_dbdma.c
227
request->bytecount, ch->dma.max_iosize);
sys/powerpc/powermac/ata_dbdma.c
231
request->dma = &ch->dma.slot[0];
sys/powerpc/powermac/ata_dbdma.c
252
ch->dma.unload(request);
sys/powerpc/powermac/ata_kauai.c
231
struct ata_channel *ch;
sys/powerpc/powermac/ata_kauai.c
249
ch = &sc->sc_ch.sc_ch;
sys/powerpc/powermac/ata_kauai.c
263
ch->r_io[i].res = sc->sc_memr;
sys/powerpc/powermac/ata_kauai.c
264
ch->r_io[i].offset = i*ATA_KAUAI_REGGAP + ATA_KAUAI_REGOFFSET;
sys/powerpc/powermac/ata_kauai.c
266
ch->r_io[ATA_CONTROL].res = sc->sc_memr;
sys/powerpc/powermac/ata_kauai.c
267
ch->r_io[ATA_CONTROL].offset = ATA_KAUAI_ALTOFFSET;
sys/powerpc/powermac/ata_kauai.c
270
ch->unit = 0;
sys/powerpc/powermac/ata_kauai.c
271
ch->flags |= ATA_USE_16BIT;
sys/powerpc/powermac/ata_kauai.c
274
ch->flags |= ATA_NO_ATAPI_DMA;
sys/powerpc/powermac/ata_macio.c
185
struct ata_channel *ch;
sys/powerpc/powermac/ata_macio.c
193
ch = &sc->sc_ch.sc_ch;
sys/powerpc/powermac/ata_macio.c
205
ch->r_io[i].res = sc->sc_mem;
sys/powerpc/powermac/ata_macio.c
206
ch->r_io[i].offset = i * ATA_MACIO_REGGAP;
sys/powerpc/powermac/ata_macio.c
208
ch->r_io[ATA_CONTROL].res = sc->sc_mem;
sys/powerpc/powermac/ata_macio.c
209
ch->r_io[ATA_CONTROL].offset = ATA_MACIO_ALTOFFSET;
sys/powerpc/powermac/ata_macio.c
212
ch->unit = 0;
sys/powerpc/powermac/ata_macio.c
213
ch->flags |= ATA_USE_16BIT | ATA_NO_ATAPI_DMA;
sys/powerpc/powermac/ata_macio.c
347
struct ata_dbdma_channel *ch = device_get_softc(dev);
sys/powerpc/powermac/ata_macio.c
350
if (!ch->sc_ch.attached)
sys/powerpc/powermac/ata_macio.c
354
dbdma_save_state(ch->dbdma);
sys/powerpc/powermac/ata_macio.c
362
struct ata_dbdma_channel *ch = device_get_softc(dev);
sys/powerpc/powermac/ata_macio.c
365
if (!ch->sc_ch.attached)
sys/powerpc/powermac/ata_macio.c
368
dbdma_restore_state(ch->dbdma);
sys/powerpc/powernv/opal_console.c
472
unsigned char ch = c;
sys/powerpc/powernv/opal_console.c
481
uart_opal_put(cp->cn_arg, &ch, 1);
sys/powerpc/powernv/opal_dbg.c
124
char ch;
sys/powerpc/powernv/opal_dbg.c
129
ch = (unsigned char)c;
sys/powerpc/powernv/opal_dbg.c
133
bufp = vtophys(&ch);
sys/powerpc/powernv/opal_dbg.c
136
bufp = (uint64_t)&ch;
sys/powerpc/pseries/phyp_console.c
415
unsigned char ch = c;
sys/powerpc/pseries/phyp_console.c
416
uart_phyp_put(console_sc, &ch, 1);
sys/powerpc/psim/ata_iobus.c
232
struct ata_channel *ch = device_get_softc(dev);
sys/powerpc/psim/ata_iobus.c
235
ch->unit = 0;
sys/powerpc/psim/ata_iobus.c
236
ch->flags = (ATA_USE_16BIT|ATA_NO_SLAVE);
sys/riscv/include/sbi.h
227
sbi_console_putchar(int ch)
sys/riscv/include/sbi.h
230
(void)SBI_CALL1(SBI_CONSOLE_PUTCHAR, 0, ch);
sys/riscv/riscv/riscv_console.c
204
int ch;
sys/riscv/riscv/riscv_console.c
206
ch = sbi_console_getchar();
sys/riscv/riscv/riscv_console.c
207
if (ch > 0 && ch < 0xff) {
sys/riscv/riscv/riscv_console.c
209
kdb_alt_break(ch, &alt_break_state);
sys/riscv/riscv/riscv_console.c
211
return (ch);
sys/sys/libkern.h
296
index(const char *p, int ch)
sys/sys/libkern.h
299
return (strchr(p, ch));
sys/sys/libkern.h
303
rindex(const char *p, int ch)
sys/sys/libkern.h
306
return (strrchr(p, ch));
sys/sys/systm.h
207
typedef void early_putc_t(int ch);
sys/tests/runtest/runtest.c
61
int ch;
sys/tests/runtest/runtest.c
63
while ((ch = getopt(argc, argv, options)) != -1) {
sys/tests/runtest/runtest.c
64
switch (ch) {
tests/sys/aio/aio_test.c
102
char ch;
tests/sys/aio/aio_test.c
107
ch = random() & 0xff;
tests/sys/aio/aio_test.c
108
buffer[i] = ch;
tests/sys/aio/aio_test.c
119
char ch;
tests/sys/aio/aio_test.c
124
ch = random() & 0xff;
tests/sys/aio/aio_test.c
125
if (buffer[i] != ch)
tests/sys/capsicum/capability-fd.cc
484
char ch;
tests/sys/capsicum/capability-fd.cc
485
CHECK_RIGHT_RESULT(read(cap_fd, &ch, sizeof(ch)), rights, CAP_READ, 0);
tests/sys/capsicum/capability-fd.cc
487
ssize_t len1 = pread(cap_fd, &ch, sizeof(ch), 0);
tests/sys/capsicum/capability-fd.cc
489
ssize_t len2 = pread(cap_fd, &ch, sizeof(ch), 0);
tests/sys/capsicum/capability-fd.cc
493
CHECK_RIGHT_RESULT(write(cap_fd, &ch, sizeof(ch)), rights, CAP_WRITE, 0);
tests/sys/capsicum/capability-fd.cc
494
CHECK_RIGHT_RESULT(pwrite(cap_fd, &ch, sizeof(ch), 0), rights, CAP_PWRITE);
tests/sys/capsicum/capmode.cc
123
char ch;
tests/sys/capsicum/capmode.cc
124
EXPECT_OK(read(fd_file_, &ch, sizeof(ch)));
tests/sys/capsicum/capmode.cc
125
EXPECT_OK(write(fd_file_, &ch, sizeof(ch)));
tests/sys/capsicum/capmode.cc
161
char ch;
tests/sys/capsicum/capmode.cc
162
EXPECT_OK(write(fd_file_, &ch, sizeof(ch)));
tests/sys/cddl/zfs/bin/mkfile.c
168
int ch;
tests/sys/cddl/zfs/bin/mkfile.c
177
while ((ch = getopt(argc, argv, "nv")) != -1) {
tests/sys/cddl/zfs/bin/mkfile.c
178
switch (ch) {
tests/sys/cddl/zfs/bin/randfree_file.c
52
int fd, ch;
tests/sys/cddl/zfs/bin/randfree_file.c
55
while ((ch = getopt(argc, argv, "l:s:n:")) != EOF) {
tests/sys/cddl/zfs/bin/randfree_file.c
56
switch (ch) {
tests/sys/fifo/fifo_io.c
1125
u_char ch;
tests/sys/fifo/fifo_io.c
1155
ch = 0x00;
tests/sys/fifo/fifo_io.c
1156
len = write(writer_fd, &ch, sizeof(ch));
tests/sys/fifo/fifo_io.c
1182
len = read(reader_fd, &ch, sizeof(ch));
tests/sys/fifo/fifo_io.c
1302
char ch;
tests/sys/fifo/fifo_io.c
1337
ch = 0x00;
tests/sys/fifo/fifo_io.c
1338
len = write(fd, &ch, sizeof(ch));
tests/sys/fifo/fifo_io.c
1355
len = read(fd, &ch, sizeof(ch));
tests/sys/fifo/fifo_io.c
217
u_char ch;
tests/sys/fifo/fifo_io.c
222
while ((len = read(fd, &ch, sizeof(ch))) > 0);
tests/sys/fifo/fifo_io.c
405
u_char ch;
tests/sys/fifo/fifo_io.c
424
ret = timed_read(reader_fd, &ch, sizeof(ch), &len, 5, &timedout,
tests/sys/fifo/fifo_io.c
447
ret = timed_read(reader_fd, &ch, sizeof(ch), &len, 5, &timedout,
tests/sys/fifo/fifo_io.c
474
u_char ch;
tests/sys/fifo/fifo_io.c
492
ch = 0xfe;
tests/sys/fifo/fifo_io.c
493
ret = timed_write(writer_fd, &ch, sizeof(ch), &len, 5, &timedout,
tests/sys/fifo/fifo_io.c
500
if (len != sizeof(ch)) {
tests/sys/fifo/fifo_io.c
502
"%zu, wrote %zd", sizeof(ch), len);
tests/sys/fifo/fifo_io.c
507
ch = 0xab;
tests/sys/fifo/fifo_io.c
508
ret = timed_read(reader_fd, &ch, sizeof(ch), &len, 5, &timedout,
tests/sys/fifo/fifo_io.c
515
if (len != sizeof(ch)) {
tests/sys/fifo/fifo_io.c
517
"read %zd", sizeof(ch), len);
tests/sys/fifo/fifo_io.c
521
if (ch != 0xfe) {
tests/sys/fifo/fifo_io.c
523
"0x%02x, read 0x%02x", 0xfe, ch);
tests/sys/fifo/fifo_io.c
540
u_char ch;
tests/sys/fifo/fifo_io.c
554
ch = 0xfe;
tests/sys/fifo/fifo_io.c
555
ret = timed_write(writer_fd, &ch, sizeof(ch), &len, 5, &timedout,
tests/sys/fifo/fifo_io.c
562
if (len != sizeof(ch)) {
tests/sys/fifo/fifo_io.c
564
"%zu, wrote %zd", sizeof(ch), len);
tests/sys/fifo/fifo_io.c
569
ch = 0xab;
tests/sys/fifo/fifo_io.c
570
ret = timed_read(reader_fd, &ch, sizeof(ch), &len, 5, &timedout,
tests/sys/fifo/fifo_io.c
577
if (len != sizeof(ch)) {
tests/sys/fifo/fifo_io.c
579
"%zd", sizeof(ch), len);
tests/sys/fifo/fifo_io.c
583
if (ch != 0xfe) {
tests/sys/fifo/fifo_io.c
585
"0x%02x, read 0x%02x", 0xfe, ch);
tests/sys/file/flock_helper.c
1011
if (read(pfd[0], &ch, 1) != 1)
tests/sys/file/flock_helper.c
1055
char ch;
tests/sys/file/flock_helper.c
1094
while (read(pfd[0], &ch, 1) != 1) {
tests/sys/file/flock_helper.c
1342
char ch;
tests/sys/file/flock_helper.c
1374
if (read(pfd[0], &ch, 1) != 1)
tests/sys/file/flock_helper.c
1447
char ch;
tests/sys/file/flock_helper.c
1482
if (read(pfd[0], &ch, 1) != 1)
tests/sys/file/flock_helper.c
188
char ch;
tests/sys/file/flock_helper.c
221
if (read(pfd[0], &ch, 1) != 1)
tests/sys/file/flock_helper.c
259
char ch;
tests/sys/file/flock_helper.c
292
if (read(pfd[0], &ch, 1) != 1)
tests/sys/file/flock_helper.c
329
char ch;
tests/sys/file/flock_helper.c
361
if (read(pfd[0], &ch, 1) != 1)
tests/sys/file/flock_helper.c
603
char ch;
tests/sys/file/flock_helper.c
636
if (read(pfd[0], &ch, 1) != 1)
tests/sys/file/flock_helper.c
675
char ch;
tests/sys/file/flock_helper.c
708
if (read(pfd[0], &ch, 1) != 1)
tests/sys/file/flock_helper.c
752
char ch;
tests/sys/file/flock_helper.c
785
if (read(pfd[0], &ch, 1) != 1)
tests/sys/file/flock_helper.c
824
char ch;
tests/sys/file/flock_helper.c
860
if (read(pfd[0], &ch, 1) != 1)
tests/sys/file/flock_helper.c
977
char ch;
tests/sys/file/ftruncate_test.c
103
size = pread(fd, &ch, sizeof(ch), len - 1);
tests/sys/file/ftruncate_test.c
106
if (size != sizeof(ch))
tests/sys/file/ftruncate_test.c
109
if (ch != 0)
tests/sys/file/ftruncate_test.c
112
(intmax_t)len, (intmax_t)size, ch);
tests/sys/file/ftruncate_test.c
65
char ch;
tests/sys/fs/fusefs/utils.cc
661
int ch;
tests/sys/fs/fusefs/utils.cc
667
while ((ch = getopt(argc, argv, "v")) != -1) {
tests/sys/fs/fusefs/utils.cc
668
switch (ch) {
tests/sys/kern/sendfile_helper.c
135
int ch, fd, ss[2], flags, error;
tests/sys/kern/sendfile_helper.c
138
while ((ch = getopt(argc, argv, "u")) != -1)
tests/sys/kern/sendfile_helper.c
139
switch (ch) {
tests/sys/kern/tty/readsz.c
35
int ch;
tests/sys/kern/tty/readsz.c
46
while ((ch = getopt(argc, argv, "b:c:es:")) != -1) {
tests/sys/kern/tty/readsz.c
47
switch (ch) {
tests/sys/kern/unix_passfd_test.c
1103
char ch;
tests/sys/kern/unix_passfd_test.c
1113
ch = 0;
tests/sys/kern/unix_passfd_test.c
1114
len = sendfd_payload(sock[0], dfd, &ch, sizeof(ch));
tests/sys/kern/unix_passfd_test.c
1126
char ch;
tests/sys/kern/unix_passfd_test.c
1133
len = recvfd_payload(sock[1], &dfd, &ch, sizeof(ch),
tests/sys/kern/unix_passfd_test.c
189
char ch;
tests/sys/kern/unix_passfd_test.c
191
ch = 0;
tests/sys/kern/unix_passfd_test.c
192
len = sendfd_payload(sockfd, send_fd, &ch, sizeof(ch));
tests/sys/kern/unix_passfd_test.c
193
ATF_REQUIRE_MSG(len == sizeof(ch),
tests/sys/kern/unix_passfd_test.c
194
"sendmsg: %zd bytes sent; expected %zu; %s", len, sizeof(ch),
tests/sys/kern/unix_passfd_test.c
267
char ch = 0;
tests/sys/kern/unix_passfd_test.c
269
len = recvfd_payload(sockfd, recv_fd, &ch, sizeof(ch),
tests/sys/kern/unix_passfd_test.c
271
ATF_REQUIRE_MSG((size_t)len == sizeof(ch),
tests/sys/kern/unix_passfd_test.c
272
"recvmsg: %zd bytes received; expected %zd", len, sizeof(ch));
tests/sys/kern/unix_passfd_test.c
481
char *cmsg, ch;
tests/sys/kern/unix_passfd_test.c
486
iov.iov_base = &ch;
tests/sys/kern/unix_passfd_test.c
487
iov.iov_len = sizeof(ch);
tests/sys/kern/unix_passfd_test.c
764
char ch;
tests/sys/kern/unix_passfd_test.c
766
ch = 0;
tests/sys/kern/unix_passfd_test.c
769
iov.iov_base = &ch;
tests/sys/kern/unix_passfd_test.c
770
iov.iov_len = sizeof(ch);
tests/sys/kern/unix_passfd_test.c
779
ATF_REQUIRE_MSG(len == sizeof(ch),
tests/sys/kern/unix_passfd_test.c
780
"sendmsg: %zd bytes sent; expected %zu", len, sizeof(ch));
tests/sys/kern/unix_passfd_test.c
789
char ch;
tests/sys/kern/unix_passfd_test.c
791
ch = 0;
tests/sys/kern/unix_passfd_test.c
794
iov.iov_base = &ch;
tests/sys/kern/unix_passfd_test.c
795
iov.iov_len = sizeof(ch);
tests/sys/kern/unix_passfd_test.c
804
ATF_REQUIRE_MSG(len == sizeof(ch),
tests/sys/kern/unix_passfd_test.c
805
"recvmsg: %zd bytes received; expected %zu", len, sizeof(ch));
tests/sys/netinet/ip6_mrouted.c
141
int ch, error, mifi, sd, v;
tests/sys/netinet/ip6_mrouted.c
144
while ((ch = getopt(argc, argv, "i:m:")) != -1) {
tests/sys/netinet/ip6_mrouted.c
145
switch (ch) {
tests/sys/netinet/ip6_v4mapped_test.c
336
char ch;
tests/sys/netinet/ip6_v4mapped_test.c
370
ch = 0x42;
tests/sys/netinet/ip6_v4mapped_test.c
371
n = sendto(s, &ch, 1, 0, (struct sockaddr *)&sin6, sizeof(sin6));
tests/sys/netinet/ip6_v4mapped_test.c
379
ch = 0x42;
tests/sys/netinet/ip6_v4mapped_test.c
380
n = sendto(s, &ch, 1, 0, (struct sockaddr *)&sin6, sizeof(sin6));
tests/sys/netinet/ip6_v4mapped_test.c
383
ch = 0;
tests/sys/netinet/ip6_v4mapped_test.c
384
n = recv(ls, &ch, 1, 0);
tests/sys/netinet/ip6_v4mapped_test.c
386
ATF_REQUIRE(ch == 0x42);
tests/sys/netinet/so_reuseport_lb_test.c
576
char ch;
tests/sys/netinet/so_reuseport_lb_test.c
610
ch = 42;
tests/sys/netinet/so_reuseport_lb_test.c
611
n = sendto(s2, &ch, sizeof(ch), 0, (struct sockaddr *)&sin,
tests/sys/netinet/so_reuseport_lb_test.c
624
n = sendto(s3, &ch, sizeof(ch), 0, (struct sockaddr *)&sin,
tests/sys/netinet/so_reuseport_lb_test.c
648
char ch;
tests/sys/netinet/so_reuseport_lb_test.c
682
ch = 42;
tests/sys/netinet/so_reuseport_lb_test.c
683
n = sendto(s2, &ch, sizeof(ch), 0, (struct sockaddr *)&sin6,
tests/sys/netinet/so_reuseport_lb_test.c
696
n = sendto(s3, &ch, sizeof(ch), 0, (struct sockaddr *)&sin6,
tools/build/cross-build/include/mac/string.h
47
#define strchrnul(p, ch) __freebsd_strchrnul(p, ch)
tools/build/cross-build/include/mac/string.h
50
strchrnul(const char *p, int ch)
tools/build/cross-build/include/mac/string.h
54
c = ch;
tools/regression/ethernet/ethermulti/ethermulti.c
221
int ch;
tools/regression/ethernet/ethermulti/ethermulti.c
223
while ((ch = getopt(argc, argv, "i:rv")) != -1) {
tools/regression/ethernet/ethermulti/ethermulti.c
224
switch (ch) {
tools/regression/fsx/fsx.c
983
int i, ch;
tools/regression/fsx/fsx.c
997
while ((ch = getopt(argc, argv,
tools/regression/fsx/fsx.c
999
switch (ch) {
tools/regression/gaithrstress/gaithrstress.c
190
int ch;
tools/regression/gaithrstress/gaithrstress.c
197
while ((ch = getopt(argc, argv, "4s:t:w:")) != -1) {
tools/regression/gaithrstress/gaithrstress.c
198
switch (ch) {
tools/regression/netinet/ipbroadcast/ipbroadcast.c
114
int ch;
tools/regression/netinet/ipbroadcast/ipbroadcast.c
146
while ((ch = getopt(argc, argv, "1A:bBdi:l:p:Rs:t:")) != -1) {
tools/regression/netinet/ipbroadcast/ipbroadcast.c
147
switch (ch) {
tools/regression/netinet/ipmulticast/ipmulticast.c
362
int ch;
tools/regression/netinet/ipmulticast/ipmulticast.c
378
while ((ch = getopt(argc, argv, "4bg:i:I:mM:p:rsS:tT:v")) != -1) {
tools/regression/netinet/ipmulticast/ipmulticast.c
379
switch (ch) {
tools/regression/netinet/ipsockopt/ipsockopt.c
896
int ch;
tools/regression/netinet/ipsockopt/ipsockopt.c
898
while ((ch = getopt(argc, argv, "M:rv")) != -1) {
tools/regression/netinet/ipsockopt/ipsockopt.c
899
switch (ch) {
tools/regression/netinet/tcpdrop/tcpdrop.c
103
ch = 'A';
tools/regression/netinet/tcpdrop/tcpdrop.c
104
len = send(accept_fd, &ch, sizeof(ch), MSG_NOSIGNAL);
tools/regression/netinet/tcpdrop/tcpdrop.c
126
char ch;
tools/regression/netinet/tcpdrop/tcpdrop.c
164
ch = 'A';
tools/regression/netinet/tcpdrop/tcpdrop.c
165
len = send(sock, &ch, sizeof(ch), MSG_NOSIGNAL);
tools/regression/netinet/tcpdrop/tcpdrop.c
172
if (len != sizeof(ch)) {
tools/regression/netinet/tcpdrop/tcpdrop.c
186
ch = 'A';
tools/regression/netinet/tcpdrop/tcpdrop.c
187
len = send(sock, &ch, sizeof(ch), MSG_NOSIGNAL);
tools/regression/netinet/tcpdrop/tcpdrop.c
73
char ch;
tools/regression/netinet/tcpdrop/tcpdrop.c
88
ch = 'A';
tools/regression/netinet/tcpdrop/tcpdrop.c
89
len = send(accept_fd, &ch, sizeof(ch), MSG_NOSIGNAL);
tools/regression/netinet/tcpdrop/tcpdrop.c
96
if (len != sizeof(ch)) {
tools/regression/security/cap_test/cap_test_capabilities.c
120
char ch;
tools/regression/security/cap_test/cap_test_capabilities.c
139
ssize = read(fd_cap, &ch, sizeof(ch));
tools/regression/security/cap_test/cap_test_capabilities.c
142
ssize = write(fd_cap, &ch, sizeof(ch));
tools/regression/security/cap_test/cap_test_capabilities.c
148
ssize = pread(fd_cap, &ch, sizeof(ch), 0);
tools/regression/security/cap_test/cap_test_capabilities.c
149
ssize2 = pread(fd_cap, &ch, sizeof(ch), 0);
tools/regression/security/cap_test/cap_test_capabilities.c
153
ssize = pwrite(fd_cap, &ch, sizeof(ch), 0);
tools/regression/security/cap_test/cap_test_capmode.c
118
CHECK_SYSCALL_SUCCEEDS(read, fd_file, &ch, sizeof(ch));
tools/regression/security/cap_test/cap_test_capmode.c
121
CHECK_SYSCALL_SUCCEEDS(write, fd_file, &ch, sizeof(ch));
tools/regression/security/cap_test/cap_test_capmode.c
69
char ch;
tools/regression/security/open_to_operation/open_to_operation.c
773
char ch;
tools/regression/security/open_to_operation/open_to_operation.c
788
if (fn(fd, &ch, sizeof(ch)) < 0) {
tools/regression/security/open_to_operation/open_to_operation.c
859
char ch;
tools/regression/security/open_to_operation/open_to_operation.c
872
if (fn(fd, &ch, sizeof(ch)) < 0) {
tools/regression/sockets/kqueue/kqueue.c
107
char ch;
tools/regression/sockets/kqueue/kqueue.c
132
ch = 'a';
tools/regression/sockets/kqueue/kqueue.c
133
len = write(fd[1], &ch, sizeof(ch));
tools/regression/sockets/kqueue/kqueue.c
137
if (len != sizeof(ch))
tools/regression/sockets/kqueue/kqueue.c
158
len = read(fd[0], &ch, sizeof(ch));
tools/regression/sockets/kqueue/kqueue.c
162
if (len != sizeof(ch))
tools/regression/sockets/kqueue/kqueue.c
192
char ch;
tools/regression/sockets/kqueue/kqueue.c
217
ch = 'a';
tools/regression/sockets/kqueue/kqueue.c
218
while ((len = write(fd[0], &ch, sizeof(ch))) == sizeof(ch)) {};
tools/regression/sockets/kqueue/kqueue.c
222
if (len != -1 && len != sizeof(ch))
tools/regression/sockets/sblock/sblock.c
115
char ch;
tools/regression/sockets/sblock/sblock.c
129
len = send(fd, &ch, sizeof(ch), 0);
tools/regression/sockets/sblock/sblock.c
134
if (len != sizeof(ch)) {
tools/regression/sockets/sblock/sblock.c
69
char ch;
tools/regression/sockets/sblock/sblock.c
71
len = recv(fd, &ch, sizeof(ch), 0);
tools/regression/sockets/sblock/sblock.c
94
char ch;
tools/regression/sockets/sblock/sblock.c
98
len = recv(fd, &ch, sizeof(ch), 0);
tools/regression/sockets/sigpipe/sigpipe.c
105
char ch;
tools/regression/sockets/sigpipe/sigpipe.c
107
ch = 0;
tools/regression/sockets/sigpipe/sigpipe.c
108
len = write(sock, &ch, sizeof(ch));
tools/regression/sockets/sigpipe/sigpipe.c
89
char ch;
tools/regression/sockets/sigpipe/sigpipe.c
91
ch = 0;
tools/regression/sockets/sigpipe/sigpipe.c
92
len = send(sock, &ch, sizeof(ch), 0);
tools/regression/sockets/unix_sorflush/unix_sorflush.c
51
char ch;
tools/regression/sockets/unix_sorflush/unix_sorflush.c
53
ssize = recv(s, &ch, sizeof(ch), 0);
tools/regression/sockets/zerosend/zerosend.c
50
char ch;
tools/regression/sockets/zerosend/zerosend.c
52
ch = 0;
tools/regression/sockets/zerosend/zerosend.c
53
len = send(fd, &ch, 0, 0);
tools/regression/sockets/zerosend/zerosend.c
64
char ch;
tools/regression/sockets/zerosend/zerosend.c
66
ch = 0;
tools/regression/sockets/zerosend/zerosend.c
67
len = write(fd, &ch, 0);
tools/test/arc4random/biastest.c
49
int ch;
tools/test/arc4random/biastest.c
52
while (ch = getopt(argc, argv, "n:t:"), ch != EOF)
tools/test/arc4random/biastest.c
53
switch (ch) {
tools/test/buf_ring/buf_ring_test.c
225
int ch, ret;
tools/test/buf_ring/buf_ring_test.c
228
while ((ch = getopt_long(argc, argv, "bf:", longopts, NULL)) != -1) {
tools/test/buf_ring/buf_ring_test.c
229
switch(ch) {
tools/test/gpioevents/gpioevents.c
470
int ch;
tools/test/gpioevents/gpioevents.c
482
while ((ch = getopt(argc, argv, "d:f:m:sSnt:uv")) != -1) {
tools/test/gpioevents/gpioevents.c
483
switch (ch) {
tools/test/net/connect.c
52
int ch, cli_sock, count = 0;
tools/test/net/connect.c
56
while ((ch = getopt(argc, argv, "p:")) != -1) {
tools/test/net/connect.c
57
switch (ch) {
tools/test/net/listen.c
52
int ch, srv_sock, cli_sock, recvd = 0;
tools/test/net/listen.c
57
while ((ch = getopt(argc, argv, "p:l:")) != -1) {
tools/test/net/listen.c
58
switch (ch) {
tools/test/netfibs/reflect.c
303
int ch, rc;
tools/test/netfibs/reflect.c
306
while ((ch = getopt(argc, argv, "A:dF:f:Np:t:T:")) != -1) {
tools/test/netfibs/reflect.c
307
switch (ch) {
tools/test/stress2/lib/options.c
143
int ch;
tools/test/stress2/lib/options.c
161
while ((ch = getopt(argc, argv, "t:l:i:d:hknv")) != -1)
tools/test/stress2/lib/options.c
162
switch(ch) {
tools/test/stress2/tools/bench.c
309
int ch, i, status, timing;
tools/test/stress2/tools/bench.c
312
while ((ch = getopt(argc, argv, "t")) != -1)
tools/test/stress2/tools/bench.c
313
switch(ch) {
tools/test/stress2/tools/flip.c
128
char ch;
tools/test/stress2/tools/flip.c
133
if (read(fd, &ch, 1) != 1)
tools/test/stress2/tools/flip.c
136
flip(&ch, 1);
tools/test/stress2/tools/flip.c
138
trash(&ch);
tools/test/stress2/tools/flip.c
141
if (write(fd, &ch, 1) != 1)
tools/test/stress2/tools/fstool.c
163
char ch = 0;
tools/test/stress2/tools/fstool.c
194
sscanf(optarg, "%d%c", &fs, &ch);
tools/test/stress2/tools/fstool.c
195
if (ch == 'k' || ch == 'K')
tools/test/stress2/tools/fstool.c
197
if (ch == 'm' || ch == 'M')
tools/test/stress2/tools/swap.c
174
int ch, i, pct, verbose;
tools/test/stress2/tools/swap.c
186
while ((ch = getopt(argc, argv, "d:p:t:v")) != -1) {
tools/test/stress2/tools/swap.c
187
switch(ch) {
tools/tools/crypto/cryptocheck.c
1884
int ch;
tools/tools/crypto/cryptocheck.c
1891
while ((ch = getopt(ac, av, "A:a:d:I:vz")) != -1)
tools/tools/crypto/cryptocheck.c
1892
switch (ch) {
tools/tools/ether_reflect/ether_reflect.c
59
int ch;
tools/tools/ether_reflect/ether_reflect.c
75
while ((ch = getopt(argc, argv, "a:e:i:t:pd")) != -1) {
tools/tools/ether_reflect/ether_reflect.c
76
switch (ch) {
tools/tools/fib_multibind/sink.c
104
while ((ch = getopt(argc, argv, "af:u")) != -1) {
tools/tools/fib_multibind/sink.c
105
switch (ch) {
tools/tools/fib_multibind/sink.c
98
int ch, error, fib, lport;
tools/tools/find-sb/find-sb.c
35
char *ch;
tools/tools/find-sb/find-sb.c
45
offset = strtoimax(optarg, &ch, 10);
tools/tools/find-sb/find-sb.c
46
if (*ch != '\0' || offset < 0)
tools/tools/indent_wrapper/indent_wrapper.c
109
set_block(block_head_t *pbh, uint64_t off, uint16_t ch)
tools/tools/indent_wrapper/indent_wrapper.c
120
ptr->data[off] = ch & 0xFF;
tools/tools/indent_wrapper/indent_wrapper.c
121
ptr->mask[off] = (ch >> 8) & 0xFF;
tools/tools/indent_wrapper/indent_wrapper.c
214
char ch = peek_block(pa, n) & 0xFF;
tools/tools/indent_wrapper/indent_wrapper.c
216
if (nonspace && ch == '\n')
tools/tools/indent_wrapper/indent_wrapper.c
218
printf("%c", ch);
tools/tools/indent_wrapper/indent_wrapper.c
219
if (!isspace(ch))
tools/tools/indent_wrapper/indent_wrapper.c
226
char ch = peek_block(pb, n) & 0xFF;
tools/tools/indent_wrapper/indent_wrapper.c
228
if (nonspace && ch == '\n')
tools/tools/indent_wrapper/indent_wrapper.c
230
printf("%c", ch);
tools/tools/indent_wrapper/indent_wrapper.c
231
if (!isspace(ch))
tools/tools/indent_wrapper/indent_wrapper.c
386
uint16_t ch;
tools/tools/indent_wrapper/indent_wrapper.c
437
ch = peek_block(&diff_head, x);
tools/tools/indent_wrapper/indent_wrapper.c
438
switch (ch & 0xFF) {
tools/tools/indent_wrapper/indent_wrapper.c
440
if (ch == peek_block(&diff_head, x + 1) &&
tools/tools/indent_wrapper/indent_wrapper.c
441
ch == peek_block(&diff_head, x + 2) &&
tools/tools/indent_wrapper/indent_wrapper.c
447
ch = peek_block(&diff_head, x);
tools/tools/indent_wrapper/indent_wrapper.c
449
p1->data[y1++] = ch;
tools/tools/indent_wrapper/indent_wrapper.c
455
if ((ch & 0xFF) == '\n')
tools/tools/indent_wrapper/indent_wrapper.c
460
if (ch == peek_block(&diff_head, x + 1) &&
tools/tools/indent_wrapper/indent_wrapper.c
461
ch == peek_block(&diff_head, x + 2) &&
tools/tools/indent_wrapper/indent_wrapper.c
467
ch = peek_block(&diff_head, x);
tools/tools/indent_wrapper/indent_wrapper.c
468
p2->data[y2++] = ch;
tools/tools/indent_wrapper/indent_wrapper.c
474
if ((ch & 0xFF) == '\n')
tools/tools/indent_wrapper/indent_wrapper.c
482
ch = peek_block(&diff_head, x);
tools/tools/indent_wrapper/indent_wrapper.c
483
p1->data[y1++] = ch;
tools/tools/indent_wrapper/indent_wrapper.c
489
p2->data[y2++] = ch;
tools/tools/indent_wrapper/indent_wrapper.c
495
if ((ch & 0xFF) == '\n')
tools/tools/indent_wrapper/indent_wrapper.c
501
ch = peek_block(&diff_head, x);
tools/tools/indent_wrapper/indent_wrapper.c
503
if ((ch & 0xFF) == '.') {
tools/tools/indent_wrapper/indent_wrapper.c
507
if ((ch & 0xFF) == '\n')
tools/tools/indent_wrapper/indent_wrapper.c
515
ch = peek_block(&diff_head, x);
tools/tools/indent_wrapper/indent_wrapper.c
516
if ((ch & 0xFF) == '\n') {
tools/tools/indent_wrapper/indent_wrapper.c
530
ch = peek_block(&diff_a_head, x) & 0xFF;
tools/tools/indent_wrapper/indent_wrapper.c
531
if (!(ch & 0x80) && ch != '\t' && ch != '\r' && ch != '\n' &&
tools/tools/indent_wrapper/indent_wrapper.c
532
ch != ' ' && !isprint(ch))
tools/tools/indent_wrapper/indent_wrapper.c
533
errx(EX_SOFTWARE, "Non printable characters are not allowed: '%c'", ch);
tools/tools/indent_wrapper/indent_wrapper.c
534
else if (ch & 0x80) {
tools/tools/indent_wrapper/indent_wrapper.c
535
set_block(&diff_a_head, x, ch | BLOCK_MASK);
tools/tools/indent_wrapper/indent_wrapper.c
541
ch = peek_block(&diff_a_head, x);
tools/tools/indent_wrapper/indent_wrapper.c
543
if ((ch & 0xFF) == '/' && (chn & 0xFF) == '/') {
tools/tools/indent_wrapper/indent_wrapper.c
544
set_block(&diff_a_head, x, ch | BLOCK_MASK);
tools/tools/indent_wrapper/indent_wrapper.c
547
ch = peek_block(&diff_a_head, x);
tools/tools/indent_wrapper/indent_wrapper.c
548
if ((ch & 0xFF) == '\n')
tools/tools/indent_wrapper/indent_wrapper.c
550
set_block(&diff_a_head, x, ch | BLOCK_MASK);
tools/tools/indent_wrapper/indent_wrapper.c
552
} else if ((ch & 0xFF) == '/' && (chn & 0xFF) == '*') {
tools/tools/indent_wrapper/indent_wrapper.c
553
set_block(&diff_a_head, x, ch | BLOCK_MASK);
tools/tools/indent_wrapper/indent_wrapper.c
556
ch = peek_block(&diff_a_head, x);
tools/tools/indent_wrapper/indent_wrapper.c
558
if ((ch & 0xFF) == '*' && (chn & 0xFF) == '/') {
tools/tools/indent_wrapper/indent_wrapper.c
559
set_block(&diff_a_head, x, ch | BLOCK_MASK);
tools/tools/indent_wrapper/indent_wrapper.c
564
set_block(&diff_a_head, x, ch | BLOCK_MASK);
tools/tools/indent_wrapper/indent_wrapper.c
571
ch = peek_block(&diff_a_head, x);
tools/tools/indent_wrapper/indent_wrapper.c
572
if (ch & BLOCK_MASK)
tools/tools/indent_wrapper/indent_wrapper.c
574
if (inside_string == 0 && (ch & 0xFF) == '#') {
tools/tools/indent_wrapper/indent_wrapper.c
577
set_block(&diff_a_head, x, ch | BLOCK_MASK);
tools/tools/indent_wrapper/indent_wrapper.c
579
ch = peek_block(&diff_a_head, x);
tools/tools/indent_wrapper/indent_wrapper.c
580
if ((ch & 0xFF) == '\n') {
tools/tools/indent_wrapper/indent_wrapper.c
585
if (ch & BLOCK_MASK)
tools/tools/indent_wrapper/indent_wrapper.c
587
if ((ch & 0xFF) == '\\')
tools/tools/indent_wrapper/indent_wrapper.c
589
set_block(&diff_a_head, x, ch | BLOCK_MASK);
tools/tools/indent_wrapper/indent_wrapper.c
592
if ((ch & 0xFF) == '"' || (ch & 0xFF) == '\'') {
tools/tools/indent_wrapper/indent_wrapper.c
594
inside_string = (ch & 0xFF);
tools/tools/indent_wrapper/indent_wrapper.c
596
if (escape_char == 0 && inside_string == (ch & 0xFF))
tools/tools/indent_wrapper/indent_wrapper.c
600
set_block(&diff_a_head, x, ch | BLOCK_MASK);
tools/tools/indent_wrapper/indent_wrapper.c
602
if ((ch & 0xFF) == '\\')
tools/tools/indent_wrapper/indent_wrapper.c
606
set_block(&diff_a_head, x, ch | BLOCK_MASK);
tools/tools/indent_wrapper/indent_wrapper.c
617
ch = peek_block(&diff_a_head, x);
tools/tools/indent_wrapper/indent_wrapper.c
619
printf("%c", ch & 0xFF);
tools/tools/indent_wrapper/indent_wrapper.c
620
if ((ch & 0xFF) == '\n') {
tools/tools/indent_wrapper/indent_wrapper.c
626
if (ch & BLOCK_MASK)
tools/tools/indent_wrapper/indent_wrapper.c
628
switch (ch & 0xFF) {
tools/tools/indent_wrapper/indent_wrapper.c
637
set_block(&diff_a_head, x, ch | BLOCK_MASK);
tools/tools/indent_wrapper/indent_wrapper.c
638
switch (ch & 0xFF) {
tools/tools/indent_wrapper/indent_wrapper.c
656
ch = peek_block(&diff_a_head, x);
tools/tools/indent_wrapper/indent_wrapper.c
657
if (ch & BLOCK_MASK)
tools/tools/indent_wrapper/indent_wrapper.c
659
switch (ch & 0xFF) {
tools/tools/indent_wrapper/indent_wrapper.c
663
set_block(&diff_a_head, x, ch | BLOCK_MASK);
tools/tools/indent_wrapper/indent_wrapper.c
670
ch = peek_block(&diff_a_head, x);
tools/tools/indent_wrapper/indent_wrapper.c
671
if (ch & BLOCK_ADD) {
tools/tools/indent_wrapper/indent_wrapper.c
677
ch = peek_block(&diff_a_head, y1);
tools/tools/indent_wrapper/indent_wrapper.c
678
if (y1 > x && !(ch & (BLOCK_MASK | BLOCK_ADD)))
tools/tools/indent_wrapper/indent_wrapper.c
680
p2->data[y2++] = ch & 0xFF;
tools/tools/indent_wrapper/indent_wrapper.c
739
} else if (!(ch & BLOCK_MASK)) {
tools/tools/ioat/ioatcontrol.c
110
int fd, ch;
tools/tools/ioat/ioatcontrol.c
119
while ((ch = getopt(argc, argv, "c:EefmrvVwxXz")) != -1) {
tools/tools/ioat/ioatcontrol.c
120
switch (ch) {
tools/tools/iwn/iwnstats/main.c
275
int ch;
tools/tools/iwn/iwnstats/main.c
282
while ((ch = getopt(argc, argv,
tools/tools/iwn/iwnstats/main.c
284
switch (ch) {
tools/tools/mcgrab/mcgrab.cc
157
char ch; ///< character from getopt()
tools/tools/mcgrab/mcgrab.cc
168
while ((ch = getopt(argc, argv, "g:i:n:bh")) != -1) {
tools/tools/mcgrab/mcgrab.cc
169
switch (ch) {
tools/tools/mctest/mctest.cc
448
char ch; ///< character from getopt()
tools/tools/mctest/mctest.cc
464
while ((ch = getopt(argc, argv, "M:m:g:i:n:s:t:b:rh")) != -1) {
tools/tools/mctest/mctest.cc
465
switch (ch) {
tools/tools/net80211/stumbler/stumbler.c
375
int ch = atoi(chan);
tools/tools/net80211/stumbler/stumbler.c
376
if (ch <= 11 && ch >= 1) {
tools/tools/net80211/w00t/ap/ap.c
850
int ch;
tools/tools/net80211/w00t/ap/ap.c
862
while ((ch = getopt(argc, argv, "hi:s:m:w:c:t:")) != -1) {
tools/tools/net80211/w00t/ap/ap.c
863
switch (ch) {
tools/tools/net80211/w00t/assoc/assoc.c
709
int ch;
tools/tools/net80211/w00t/assoc/assoc.c
721
while ((ch = getopt(argc, argv, "hm:s:i:w:t:b:")) != -1) {
tools/tools/net80211/w00t/assoc/assoc.c
722
switch (ch) {
tools/tools/net80211/w00t/expand/expand.c
424
int ch;
tools/tools/net80211/w00t/expand/expand.c
431
while ((ch = getopt(argc, argv, "hb:t:")) != -1) {
tools/tools/net80211/w00t/expand/expand.c
432
switch (ch) {
tools/tools/net80211/w00t/prga/prga.c
605
int ch;
tools/tools/net80211/w00t/prga/prga.c
614
while ((ch = getopt(argc, argv, "hb:t:")) != -1) {
tools/tools/net80211/w00t/prga/prga.c
615
switch (ch) {
tools/tools/net80211/w00t/redir/redir.c
634
int ch;
tools/tools/net80211/w00t/redir/redir.c
641
while ((ch = getopt(argc, argv, "hd:p:b:t:r:s:")) != -1) {
tools/tools/net80211/w00t/redir/redir.c
642
switch (ch) {
tools/tools/net80211/wesside/wesside/wesside.c
2729
int ch;
tools/tools/net80211/wesside/wesside/wesside.c
2747
while ((ch = getopt(argc, argv, "hi:s:m:r:a:n:cp:4v:t:f:")) != -1) {
tools/tools/net80211/wesside/wesside/wesside.c
2748
switch (ch) {
tools/tools/net80211/wlaninject/wlaninject.c
535
int ch;
tools/tools/net80211/wlaninject/wlaninject.c
549
while ((ch = getopt(argc, argv,
tools/tools/net80211/wlaninject/wlaninject.c
551
switch (ch) {
tools/tools/net80211/wlantxtime/wlantxtime.c
515
int ch, allrates, isShortPreamble, isShort;
tools/tools/net80211/wlantxtime/wlantxtime.c
529
while ((ch = getopt(argc, argv, "al:m:r:s")) != -1) {
tools/tools/net80211/wlantxtime/wlantxtime.c
530
switch (ch) {
tools/tools/netmap/bridge.c
205
int ch;
tools/tools/netmap/bridge.c
207
while ((ch = getopt(argc, argv, "hb:ci:vw:L")) != -1) {
tools/tools/netmap/bridge.c
208
switch (ch) {
tools/tools/netmap/bridge.c
210
D("bad option %c %s", ch, optarg);
tools/tools/netmap/lb.c
617
int ch;
tools/tools/netmap/lb.c
630
while ( (ch = getopt(argc, argv, "hi:p:b:B:s:o:w:W")) != -1) {
tools/tools/netmap/lb.c
631
switch (ch) {
tools/tools/netmap/lb.c
685
D("bad option %c %s", ch, optarg);
tools/tools/netmap/nmreplay.c
1103
int ch, i, err=0;
tools/tools/netmap/nmreplay.c
1145
while ( (ch = getopt(argc, argv, "B:C:D:L:b:f:i:vw:")) != -1) {
tools/tools/netmap/nmreplay.c
1146
switch (ch) {
tools/tools/netmap/nmreplay.c
1148
D("bad option %c %s", ch, optarg);
tools/tools/netmap/pkt-gen.c
2935
int ch;
tools/tools/netmap/pkt-gen.c
2968
while ((ch = getopt(arc, argv, "46a:f:F:Nn:i:Il:d:s:D:S:b:c:o:p:"
tools/tools/netmap/pkt-gen.c
2971
switch(ch) {
tools/tools/netmap/pkt-gen.c
2973
D("bad option %c %s", ch, optarg);
tools/tools/netrate/http/http.c
242
int ch, error, i;
tools/tools/netrate/http/http.c
250
while ((ch = getopt(argc, argv, "n:s:t")) != -1) {
tools/tools/netrate/http/http.c
251
switch (ch) {
tools/tools/netrate/httpd/httpd.c
200
int ch, error, i;
tools/tools/netrate/httpd/httpd.c
206
while ((ch = getopt(argc, argv, "t")) != -1) {
tools/tools/netrate/httpd/httpd.c
207
switch (ch) {
tools/tools/netrate/tcpp/tcpp.c
114
while ((ch = getopt(argc, argv, "b:c:hl:m:p:r:st:CM:PT")) != -1) {
tools/tools/netrate/tcpp/tcpp.c
115
switch (ch) {
tools/tools/netrate/tcpp/tcpp.c
94
int ch;
tools/tools/nvmf/nvmfd/nvmfd.c
156
int ch, error, kqfd;
tools/tools/nvmf/nvmfd/nvmfd.c
168
while ((ch = getopt(ac, av, "dFgGH:Kn:P:p:t:")) != -1) {
tools/tools/nvmf/nvmfd/nvmfd.c
169
switch (ch) {
tools/tools/nvmf/nvmfdd/nvmfdd.c
364
int ch, error;
tools/tools/nvmf/nvmfdd/nvmfdd.c
373
while ((ch = getopt(ac, av, "FGc:gl:n:o:p:t:")) != -1) {
tools/tools/nvmf/nvmfdd/nvmfdd.c
374
switch (ch) {
tools/tools/pciroms/pciroms.c
104
while ((ch = getopt(argc, argv, "sb:h")) != -1)
tools/tools/pciroms/pciroms.c
105
switch (ch) {
tools/tools/pciroms/pciroms.c
92
int ch;
tools/tools/pirtool/pirtool.c
66
int ch, r;
tools/tools/pirtool/pirtool.c
74
while ((ch = getopt(argc, argv, "h")) != -1)
tools/tools/pirtool/pirtool.c
75
switch (ch) {
tools/tools/so_splice/pingpong.c
74
int ch, count, s;
tools/tools/so_splice/pingpong.c
80
while ((ch = getopt(argc, argv, "c:l:n:s:")) != -1) {
tools/tools/so_splice/pingpong.c
81
switch (ch) {
tools/tools/so_splice/proxy.c
405
int ch;
tools/tools/so_splice/proxy.c
414
while ((ch = getopt(argc, argv, "Ll:m:s:")) != -1) {
tools/tools/so_splice/proxy.c
415
switch (ch) {
tools/tools/switch_tls/switch_tls.c
72
int ch, mode;
tools/tools/switch_tls/switch_tls.c
79
while ((ch = getopt(argc, argv, "ailS:s")) != -1) {
tools/tools/switch_tls/switch_tls.c
80
switch (ch) {
tools/tools/syscall_timing/syscall_timing.c
1025
int ch, fd, error, i, j, rv;
tools/tools/syscall_timing/syscall_timing.c
1033
while ((ch = getopt(argc, argv, "i:l:p:s:")) != -1) {
tools/tools/syscall_timing/syscall_timing.c
1034
switch (ch) {
tools/tools/umastat/umastat.c
288
int ch;
tools/tools/umastat/umastat.c
292
while ((ch = getopt(argc, argv, "M:N:")) != -1) {
tools/tools/umastat/umastat.c
293
switch (ch) {
tools/tools/vimage/vimage.c
101
char ch;
tools/tools/vimage/vimage.c
106
while ((ch = getopt(argc, argv, "cdijlmrv")) != -1) {
tools/tools/vimage/vimage.c
107
switch (ch) {
usr.bin/apply/apply.c
60
int ch, debug, i, magic, n, nargs, rval;
usr.bin/apply/apply.c
68
while ((ch = getopt(argc, argv, "a:d0123456789")) != -1)
usr.bin/apply/apply.c
69
switch (ch) {
usr.bin/asa/asa.c
49
int ch, exval;
usr.bin/asa/asa.c
51
while ((ch = getopt(argc, argv, "")) != -1) {
usr.bin/asa/asa.c
52
switch (ch) {
usr.bin/at/at.c
218
int ch;
usr.bin/at/at.c
420
while((ch = getchar()) != EOF)
usr.bin/at/at.c
421
fputc(ch, fp);
usr.bin/at/at.c
600
int ch;
usr.bin/at/at.c
611
while((ch = getc(fp)) != EOF) {
usr.bin/at/at.c
612
putchar(ch);
usr.bin/backlight/backlight.c
107
while ((ch = getopt(argc, argv, "f:qhi")) != -1) {
usr.bin/backlight/backlight.c
108
switch (ch) {
usr.bin/backlight/backlight.c
93
int action, ch;
usr.bin/banner/banner.c
1019
int ch;
usr.bin/banner/banner.c
1021
while ((ch = getopt(argc, argv, "w:td")) != -1)
usr.bin/banner/banner.c
1022
switch (ch) {
usr.bin/basename/basename.c
51
int aflag, ch;
usr.bin/basename/basename.c
62
while ((ch = getopt(argc, argv, "as:")) != -1)
usr.bin/basename/basename.c
63
switch(ch) {
usr.bin/biff/biff.c
45
int ch;
usr.bin/biff/biff.c
49
while ((ch = getopt(argc, argv, "")) != -1)
usr.bin/biff/biff.c
50
switch(ch) {
usr.bin/bintrans/bintrans.c
128
int ch;
usr.bin/bintrans/bintrans.c
142
while ((ch = getopt_long(argc, argv, "+diw:", opts, NULL)) != -1)
usr.bin/bintrans/bintrans.c
143
switch (ch) {
usr.bin/bintrans/bintrans.c
158
usage_base64(ch == '?');
usr.bin/bintrans/qp.c
170
int ch;
usr.bin/bintrans/qp.c
184
while ((ch = getopt_long(argc, argv, "+do:ru", opts, NULL)) != -1) {
usr.bin/bintrans/qp.c
185
switch(ch) {
usr.bin/bintrans/uudecode.c
355
int i, ch;
usr.bin/bintrans/uudecode.c
390
ch = DEC(p[0]) << 2 | DEC(p[1]) >> 4;
usr.bin/bintrans/uudecode.c
391
putc(ch, outfp);
usr.bin/bintrans/uudecode.c
392
ch = DEC(p[1]) << 4 | DEC(p[2]) >> 2;
usr.bin/bintrans/uudecode.c
393
putc(ch, outfp);
usr.bin/bintrans/uudecode.c
394
ch = DEC(p[2]) << 6 | DEC(p[3]);
usr.bin/bintrans/uudecode.c
395
putc(ch, outfp);
usr.bin/bintrans/uudecode.c
400
ch = DEC(p[0]) << 2 | DEC(p[1]) >> 4;
usr.bin/bintrans/uudecode.c
401
putc(ch, outfp);
usr.bin/bintrans/uudecode.c
408
ch = DEC(p[1]) << 4 | DEC(p[2]) >> 2;
usr.bin/bintrans/uudecode.c
409
putc(ch, outfp);
usr.bin/bintrans/uudecode.c
415
ch = DEC(p[2]) << 6 | DEC(p[3]);
usr.bin/bintrans/uudecode.c
416
putc(ch, outfp);
usr.bin/bintrans/uudecode.c
90
int rval, ch;
usr.bin/bintrans/uudecode.c
95
while ((ch = getopt(argc, argv, "cimo:prs")) != -1) {
usr.bin/bintrans/uudecode.c
96
switch (ch) {
usr.bin/bintrans/uuencode.c
203
int ch, n;
usr.bin/bintrans/uuencode.c
210
ch = ENC(n);
usr.bin/bintrans/uuencode.c
211
if (fputc(ch, output) == EOF)
usr.bin/bintrans/uuencode.c
220
ch = *p >> 2;
usr.bin/bintrans/uuencode.c
221
ch = ENC(ch);
usr.bin/bintrans/uuencode.c
222
if (fputc(ch, output) == EOF)
usr.bin/bintrans/uuencode.c
224
ch = ((*p << 4) & 060) | ((p[1] >> 4) & 017);
usr.bin/bintrans/uuencode.c
225
ch = ENC(ch);
usr.bin/bintrans/uuencode.c
226
if (fputc(ch, output) == EOF)
usr.bin/bintrans/uuencode.c
228
ch = ((p[1] << 2) & 074) | ((p[2] >> 6) & 03);
usr.bin/bintrans/uuencode.c
229
ch = ENC(ch);
usr.bin/bintrans/uuencode.c
230
if (fputc(ch, output) == EOF)
usr.bin/bintrans/uuencode.c
232
ch = p[2] & 077;
usr.bin/bintrans/uuencode.c
233
ch = ENC(ch);
usr.bin/bintrans/uuencode.c
234
if (fputc(ch, output) == EOF)
usr.bin/bintrans/uuencode.c
87
int ch;
usr.bin/bintrans/uuencode.c
96
while ((ch = getopt(argc, argv, "mo:rw:")) != -1) {
usr.bin/bintrans/uuencode.c
97
switch (ch) {
usr.bin/brandelf/brandelf.c
71
int ch, flags, retval, type;
usr.bin/brandelf/brandelf.c
82
while ((ch = getopt(argc, argv, "f:lt:v")) != -1)
usr.bin/brandelf/brandelf.c
83
switch (ch) {
usr.bin/c99/c99.c
55
int ch, i;
usr.bin/c99/c99.c
60
while ((ch = getopt(argc, argv, "cD:EgI:L:o:O:sU:l:")) != -1) {
usr.bin/c99/c99.c
61
if (ch == 'l') {
usr.bin/c99/c99.c
68
} else if (ch == '?')
usr.bin/caesar/caesar.c
120
ch = (unsigned char) inbuf[i];
usr.bin/caesar/caesar.c
121
putchar(ROTATE(ch, winner));
usr.bin/caesar/caesar.c
136
int ch, rot;
usr.bin/caesar/caesar.c
142
while ((ch = getchar()) != EOF)
usr.bin/caesar/caesar.c
143
putchar(ROTATE(ch, rot));
usr.bin/caesar/caesar.c
47
#define ROTATE(ch, perm) \
usr.bin/caesar/caesar.c
48
isascii(ch) ? ( \
usr.bin/caesar/caesar.c
49
isupper(ch) ? ('A' + (ch - 'A' + perm) % 26) : \
usr.bin/caesar/caesar.c
50
islower(ch) ? ('a' + (ch - 'a' + perm) % 26) : ch) : ch
usr.bin/caesar/caesar.c
67
int ch, dot, i, nread, winnerdot = 0;
usr.bin/caesar/caesar.c
91
ch = (unsigned char) inbuf[i];
usr.bin/caesar/caesar.c
92
if (isascii(ch)) {
usr.bin/caesar/caesar.c
93
if (islower(ch))
usr.bin/caesar/caesar.c
94
++obs[ch - 'a'];
usr.bin/caesar/caesar.c
95
else if (isupper(ch))
usr.bin/caesar/caesar.c
96
++obs[ch - 'A'];
usr.bin/calendar/calendar.c
70
int ch;
usr.bin/calendar/calendar.c
75
while ((ch = getopt(argc, argv, "-A:aB:D:dF:f:l:t:U:W:?")) != -1)
usr.bin/calendar/calendar.c
76
switch (ch) {
usr.bin/chat/chat.c
1048
char ch = c;
usr.bin/chat/chat.c
1052
status = write(STDOUT_FILENO, &ch, 1);
usr.bin/chpass/chpass.c
71
int ch, pfd, tfd;
usr.bin/chpass/chpass.c
83
while ((ch = getopt(argc, argv, "a:p:s:e:d:h:loy")) != -1)
usr.bin/chpass/chpass.c
85
while ((ch = getopt(argc, argv, "a:p:s:e:")) != -1)
usr.bin/chpass/chpass.c
87
switch (ch) {
usr.bin/cksum/cksum.c
52
int ch, fd, rval;
usr.bin/cksum/cksum.c
70
while ((ch = getopt(argc, argv, "o:")) != -1)
usr.bin/cksum/cksum.c
71
switch (ch) {
usr.bin/cksum/crc.c
114
#define COMPUTE(var, ch) (var) = (var) << 8 ^ crctab[(var) >> 24 ^ (ch)]
usr.bin/cksum/crc32.c
22
#define CRC(crc, ch) (crc = (crc >> 8) ^ crctab[(crc ^ (ch)) & 0xff])
usr.bin/cmp/cmp.c
100
int ch, fd1, fd2, oflag;
usr.bin/cmp/cmp.c
107
while ((ch = getopt_long(argc, argv, "+bhi:ln:sxz", long_opts, NULL)) != -1)
usr.bin/cmp/cmp.c
108
switch (ch) {
usr.bin/cmp/link.c
49
u_char ch;
usr.bin/cmp/link.c
77
if ((ch = *p1) != *p2) {
usr.bin/cmp/link.c
81
(long long)byte - 1, ch, *p2);
usr.bin/cmp/link.c
86
(long long)byte, ch, ch, *p2, *p2);
usr.bin/cmp/link.c
89
(long long)byte, ch, *p2);
usr.bin/cmp/link.c
91
diffmsg(file1, file2, byte, 1, ch, *p2);
usr.bin/cmp/regular.c
124
if ((ch = *p1) != *p2) {
usr.bin/cmp/regular.c
128
(long long)byte - 1, ch, *p2);
usr.bin/cmp/regular.c
132
(long long)byte, ch, ch, *p2, *p2);
usr.bin/cmp/regular.c
135
(long long)byte, ch, *p2);
usr.bin/cmp/regular.c
137
diffmsg(file1, file2, byte, line, ch, *p2);
usr.bin/cmp/regular.c
141
if (ch == '\n')
usr.bin/cmp/regular.c
59
u_char ch, *p1, *p2, *m1, *m2, *e1, *e2;
usr.bin/col/col.c
105
#define PUTC(ch) \
usr.bin/col/col.c
107
if (putwchar(ch) == WEOF) \
usr.bin/col/col.c
114
wint_t ch;
usr.bin/col/col.c
174
while ((ch = getwchar()) != WEOF) {
usr.bin/col/col.c
175
if (!iswgraph(ch)) {
usr.bin/col/col.c
176
switch (ch) {
usr.bin/col/col.c
233
if (iswspace(ch)) {
usr.bin/col/col.c
234
if ((width = wcwidth(ch)) > 0)
usr.bin/col/col.c
311
c->c_char = ch;
usr.bin/col/col.c
314
c->c_width = wcwidth(ch);
usr.bin/colrm/colrm.c
109
if ((width = wcwidth(ch)) > 0)
usr.bin/colrm/colrm.c
115
putwchar(ch) == WEOF)
usr.bin/colrm/colrm.c
54
int ch, width;
usr.bin/colrm/colrm.c
63
while ((ch = getopt(argc, argv, "")) != -1)
usr.bin/colrm/colrm.c
64
switch(ch) {
usr.bin/colrm/colrm.c
94
switch (ch = getwchar()) {
usr.bin/column/column.c
70
int ch, tflag, xflag;
usr.bin/column/column.c
85
while ((ch = getopt(argc, argv, "c:l:s:tx")) != -1)
usr.bin/column/column.c
86
switch(ch) {
usr.bin/comm/comm.c
58
int ch, flag1, flag2, flag3;
usr.bin/comm/comm.c
71
while ((ch = getopt(argc, argv, "123i")) != -1)
usr.bin/comm/comm.c
72
switch(ch) {
usr.bin/compress/compress.c
383
int ch, first;
usr.bin/compress/compress.c
388
first = ch = getchar();
usr.bin/compress/compress.c
389
while (ch != '\n' && ch != EOF)
usr.bin/compress/compress.c
390
ch = getchar();
usr.bin/compress/compress.c
62
int bits, cat, ch;
usr.bin/compress/compress.c
81
while ((ch = getopt(argc, argv, "b:cdfv")) != -1)
usr.bin/compress/compress.c
82
switch(ch) {
usr.bin/csplit/csplit.c
108
while ((ch = getopt(argc, argv, "ksf:n:")) > 0) {
usr.bin/csplit/csplit.c
109
switch (ch) {
usr.bin/csplit/csplit.c
98
int ch;
usr.bin/ctags/ctags.c
85
int ch; /* getopts char */
usr.bin/ctags/ctags.c
91
while ((ch = getopt(argc, argv, "BFTadf:tuwvx")) != -1)
usr.bin/ctags/ctags.c
92
switch(ch) {
usr.bin/cut/cut.c
237
int ch, col;
usr.bin/cut/cut.c
240
ch = 0;
usr.bin/cut/cut.c
244
if ((ch = getc(fp)) == EOF)
usr.bin/cut/cut.c
246
if (ch == '\n')
usr.bin/cut/cut.c
249
(void)putchar(ch);
usr.bin/cut/cut.c
251
if (ch != '\n') {
usr.bin/cut/cut.c
253
while ((ch = getc(fp)) != EOF && ch != '\n')
usr.bin/cut/cut.c
254
(void)putchar(ch);
usr.bin/cut/cut.c
256
while ((ch = getc(fp)) != EOF && ch != '\n');
usr.bin/cut/cut.c
335
wint_t ch;
usr.bin/cut/cut.c
339
ch = 0;
usr.bin/cut/cut.c
343
if ((ch = getwc(fp)) == WEOF)
usr.bin/cut/cut.c
345
if (ch == '\n')
usr.bin/cut/cut.c
348
(void)putwchar(ch);
usr.bin/cut/cut.c
350
if (ch != '\n') {
usr.bin/cut/cut.c
352
while ((ch = getwc(fp)) != WEOF && ch != '\n')
usr.bin/cut/cut.c
353
(void)putwchar(ch);
usr.bin/cut/cut.c
355
while ((ch = getwc(fp)) != WEOF && ch != '\n');
usr.bin/cut/cut.c
368
is_delim(wchar_t ch)
usr.bin/cut/cut.c
371
if (ch == ' ' || ch == '\t')
usr.bin/cut/cut.c
374
if (ch == dchar)
usr.bin/cut/cut.c
383
wchar_t ch;
usr.bin/cut/cut.c
407
clen = mbrtowc(&ch, p, lbuf + reallen - p, NULL);
usr.bin/cut/cut.c
416
if (is_delim(ch))
usr.bin/cut/cut.c
418
if (ch == '\n') {
usr.bin/cut/cut.c
433
clen = mbrtowc(&ch, p, lbuf + reallen - p,
usr.bin/cut/cut.c
443
if (ch == '\n' || is_delim(ch)) {
usr.bin/cut/cut.c
445
if (wflag && ch != '\n')
usr.bin/cut/cut.c
454
if (ch == '\n')
usr.bin/cut/cut.c
457
if (ch != '\n') {
usr.bin/cut/cut.c
462
for (; (ch = *p) != '\n'; ++p)
usr.bin/cut/cut.c
463
(void)putchar(ch);
usr.bin/cut/cut.c
465
for (; (ch = *p) != '\n'; ++p);
usr.bin/cut/cut.c
73
int ch, rval;
usr.bin/cut/cut.c
82
while ((ch = getopt(argc, argv, "b:c:d:f:snw")) != -1)
usr.bin/cut/cut.c
83
switch(ch) {
usr.bin/diff/diff.c
142
int ch, dflags, lastch, gotstdin, prevoptind, newarg;
usr.bin/diff/diff.c
156
while ((ch = getopt_long(argc, argv, OPTIONS, longopts, NULL)) != -1) {
usr.bin/diff/diff.c
157
switch (ch) {
usr.bin/diff/diff.c
166
diff_context = (diff_context * 10) + (ch - '0');
usr.bin/diff/diff.c
389
lastch = ch;
usr.bin/diff/diffreg.c
1262
fetch(long *f, int a, int b, FILE *lb, int ch, int oldfile, int flags)
usr.bin/diff/diffreg.c
1300
ch != '\0') {
usr.bin/diff/diffreg.c
1301
if (color && (ch == '>' || ch == '+'))
usr.bin/diff/diffreg.c
1303
else if (color && (ch == '<' || ch == '-'))
usr.bin/diff/diffreg.c
1305
printf("%c", ch);
usr.bin/diff/diffreg.c
1517
char ch, *f;
usr.bin/diff/diffreg.c
1562
ch = 'c';
usr.bin/diff/diffreg.c
1564
ch = (a <= b) ? 'd' : 'a';
usr.bin/diff/diffreg.c
1566
if (ch == 'a')
usr.bin/diff/diffreg.c
1571
ch == 'c' ? '!' : '-', 0, flags);
usr.bin/diff/diffreg.c
1598
ch = 'c';
usr.bin/diff/diffreg.c
1600
ch = (a <= b) ? 'd' : 'a';
usr.bin/diff/diffreg.c
1602
if (ch == 'd')
usr.bin/diff/diffreg.c
1607
ch == 'c' ? '!' : '+', 0, flags);
usr.bin/diff/diffreg.c
1624
char ch, *f;
usr.bin/diff/diffreg.c
1667
ch = 'c';
usr.bin/diff/diffreg.c
1669
ch = (a <= b) ? 'd' : 'a';
usr.bin/diff/diffreg.c
1671
switch (ch) {
usr.bin/diff3/diff3.c
958
int ch, nblabels, m, n;
usr.bin/diff3/diff3.c
972
while ((ch = getopt_long(argc, argv, OPTIONS, longopts, NULL)) != -1) {
usr.bin/diff3/diff3.c
973
switch (ch) {
usr.bin/dirname/dirname.c
45
int ch;
usr.bin/dirname/dirname.c
50
while ((ch = getopt(argc, argv, "")) != -1)
usr.bin/dirname/dirname.c
51
switch(ch) {
usr.bin/dpv/dpv.c
253
int ch;
usr.bin/dpv/dpv.c
271
while ((ch = getopt(argc, argv,
usr.bin/dpv/dpv.c
273
switch(ch) {
usr.bin/dtc/dtc.cc
101
int ch;
usr.bin/dtc/dtc.cc
119
while ((ch = getopt(argc, argv, options)) != -1)
usr.bin/dtc/dtc.cc
121
switch (ch)
usr.bin/du/du.c
120
while ((ch = getopt_long(argc, argv, "+AB:HI:LPasd:cghklmnrt:x",
usr.bin/du/du.c
122
switch (ch) {
usr.bin/du/du.c
98
int lflag, ch, notused, rval;
usr.bin/elfctl/elfctl.c
109
while ((ch = getopt_long(argc, argv, "hile:", long_opts, NULL)) != -1) {
usr.bin/elfctl/elfctl.c
110
switch (ch) {
usr.bin/elfctl/elfctl.c
97
int ch, fd, retval;
usr.bin/elfdump/elfdump.c
523
int ch;
usr.bin/elfdump/elfdump.c
528
while ((ch = getopt(ac, av, "acdEeiGhnprsw:")) != -1)
usr.bin/elfdump/elfdump.c
529
switch (ch) {
usr.bin/env/env.c
69
int ch, want_clear;
usr.bin/env/env.c
81
while ((ch = getopt(argc, argv, "-0C:iL:P:S:U:u:v")) != -1)
usr.bin/env/env.c
82
switch(ch) {
usr.bin/etdump/etdump.c
226
int ch, i;
usr.bin/etdump/etdump.c
239
while ((ch = getopt_long(argc, argv, "f:o:", longopts, NULL)) != -1) {
usr.bin/etdump/etdump.c
240
switch (ch) {
usr.bin/factor/factor.c
113
int ch;
usr.bin/factor/factor.c
121
while ((ch = getopt(argc, argv, "h")) != -1)
usr.bin/factor/factor.c
122
switch (ch) {
usr.bin/find/main.c
71
int Hflag, Lflag, ch;
usr.bin/find/main.c
82
while ((ch = getopt(argc, argv, "EHLPXdf:sx")) != -1)
usr.bin/find/main.c
83
switch (ch) {
usr.bin/finger/finger.c
92
int ch;
usr.bin/finger/finger.c
96
while ((ch = getopt(argc, argv, "46gklmpsho")) != -1)
usr.bin/finger/finger.c
97
switch(ch) {
usr.bin/finger/lprint.c
290
int ch, cnt;
usr.bin/finger/lprint.c
329
while ((ch = getc(fp)) != EOF)
usr.bin/finger/lprint.c
330
if (ch != '\r')
usr.bin/finger/lprint.c
331
vputc(lastc = ch);
usr.bin/finger/lprint.c
339
vputc(unsigned char ch)
usr.bin/finger/lprint.c
343
if (!isprint(ch) && !isascii(ch)) {
usr.bin/finger/lprint.c
346
ch = toascii(ch);
usr.bin/finger/lprint.c
350
if (isprint(ch) || (!meta && (ch == ' ' || ch == '\t' || ch == '\n')))
usr.bin/finger/lprint.c
351
(void)putchar(ch);
usr.bin/finger/lprint.c
354
(void)putchar(ch == '\177' ? '?' : ch | 0100);
usr.bin/fmt/fmt.c
276
int ch; /* used for |getopt| processing */
usr.bin/fmt/fmt.c
285
while ((ch = getopt(argc, argv, "0123456789cd:hl:mnpst:w:")) != -1)
usr.bin/fmt/fmt.c
286
switch (ch) {
usr.bin/fmt/fmt.c
333
if (p[0] == '-' && p[1] == ch && !p[2])
usr.bin/fmt/fmt.c
356
exit(ch == 'h' ? 0 : EX_USAGE);
usr.bin/fmt/fmt.c
733
wint_t ch;
usr.bin/fmt/fmt.c
743
while ((ch = getwc(stream)) != '\n' && ch != WEOF) {
usr.bin/fmt/fmt.c
744
if (len + spaces_pending == 0 && ch == '.' && !format_troff)
usr.bin/fmt/fmt.c
746
if (ch == ' ')
usr.bin/fmt/fmt.c
748
else if (troff || iswprint(ch)) {
usr.bin/fmt/fmt.c
758
buf[len++] = ch;
usr.bin/fmt/fmt.c
759
col += (cwidth = wcwidth(ch)) > 0 ? cwidth : 1;
usr.bin/fmt/fmt.c
760
} else if (ch == '\t')
usr.bin/fmt/fmt.c
763
else if (ch == '\b') {
usr.bin/fmt/fmt.c
771
return (len > 0 || ch != WEOF) ? buf : 0;
usr.bin/fold/fold.c
104
previous_ch = ch;
usr.bin/fold/fold.c
147
wint_t ch;
usr.bin/fold/fold.c
150
while ((ch = getwchar()) != WEOF) {
usr.bin/fold/fold.c
151
if (ch == '\n') {
usr.bin/fold/fold.c
156
if ((col = newpos(col, ch)) > width) {
usr.bin/fold/fold.c
175
col = newpos(col, ch);
usr.bin/fold/fold.c
183
buf[indx++] = ch;
usr.bin/fold/fold.c
194
newpos(int col, wint_t ch)
usr.bin/fold/fold.c
201
len = wcrtomb(buf, ch, NULL);
usr.bin/fold/fold.c
204
switch (ch) {
usr.bin/fold/fold.c
216
if ((w = wcwidth(ch)) > 0)
usr.bin/fold/fold.c
57
int ch, previous_ch;
usr.bin/fold/fold.c
64
while ((ch = getopt(argc, argv, "0123456789bsw:")) != -1) {
usr.bin/fold/fold.c
65
switch (ch) {
usr.bin/fold/fold.c
87
width = width * 10 + (ch - '0');
usr.bin/fold/fold.c
97
width = ch - '0';
usr.bin/fortune/fortune/fortune.c
1310
unsigned char ch;
usr.bin/fortune/fortune/fortune.c
1331
for (p = Fortbuf; (ch = *p) != '\0'; ++p) {
usr.bin/fortune/fortune/fortune.c
1332
if (isascii(ch)) {
usr.bin/fortune/fortune/fortune.c
1333
if (isupper(ch))
usr.bin/fortune/fortune/fortune.c
1334
*p = 'A' + (ch - 'A' + 13) % 26;
usr.bin/fortune/fortune/fortune.c
1335
else if (islower(ch))
usr.bin/fortune/fortune/fortune.c
1336
*p = 'a' + (ch - 'a' + 13) % 26;
usr.bin/fortune/fortune/fortune.c
208
unsigned char ch;
usr.bin/fortune/fortune/fortune.c
216
for (p = line; (ch = *p) != '\0'; ++p) {
usr.bin/fortune/fortune/fortune.c
217
if (isascii(ch)) {
usr.bin/fortune/fortune/fortune.c
218
if (isupper(ch))
usr.bin/fortune/fortune/fortune.c
219
*p = 'A' + (ch - 'A' + 13) % 26;
usr.bin/fortune/fortune/fortune.c
220
else if (islower(ch))
usr.bin/fortune/fortune/fortune.c
221
*p = 'a' + (ch - 'a' + 13) % 26;
usr.bin/fortune/fortune/fortune.c
266
int ch;
usr.bin/fortune/fortune/fortune.c
272
while ((ch = getopt(argc, argv, "aDefilm:osw")) != -1)
usr.bin/fortune/fortune/fortune.c
274
while ((ch = getopt(argc, argv, "aefilm:osw")) != -1)
usr.bin/fortune/fortune/fortune.c
276
switch(ch) {
usr.bin/fortune/strfile/strfile.c
247
int ch;
usr.bin/fortune/strfile/strfile.c
249
while ((ch = getopt(argc, argv, "Cc:iorsx")) != -1)
usr.bin/fortune/strfile/strfile.c
250
switch(ch) {
usr.bin/fortune/strfile/strfile.c
381
#define SET_N(nf,ch) (nf = (ch == '\n'))
usr.bin/fortune/strfile/strfile.c
382
#define IS_END(ch,nf) (ch == EOF || (ch == (unsigned char)Delimch && nf))
usr.bin/from/from.c
140
char ch, pch, first;
usr.bin/from/from.c
144
if (isspace(ch = *line))
usr.bin/from/from.c
147
ch = tolower(ch);
usr.bin/from/from.c
148
if (ch != first)
usr.bin/from/from.c
153
ch = tolower(*t);
usr.bin/from/from.c
155
if (ch != pch)
usr.bin/from/from.c
52
int ch, count, newline;
usr.bin/from/from.c
63
while ((ch = getopt(argc, argv, "cf:s:")) != -1)
usr.bin/from/from.c
64
switch (ch) {
usr.bin/fstat/fstat.c
106
int arg, ch, what;
usr.bin/fstat/fstat.c
112
while ((ch = getopt(argc, argv, "fmnp:su:vN:M:")) != -1)
usr.bin/fstat/fstat.c
113
switch((char)ch) {
usr.bin/fstat/fuser.c
132
fputc(uflags[i].ch, stderr);
usr.bin/fstat/fuser.c
135
fputc(fflags[i].ch, stderr);
usr.bin/fstat/fuser.c
166
int ch, sig;
usr.bin/fstat/fuser.c
172
while ((ch = getopt(argc, argv, "M:N:cfhkms:u")) != -1)
usr.bin/fstat/fuser.c
173
switch(ch) {
usr.bin/fstat/fuser.c
56
char ch;
usr.bin/fstat/fuser.c
71
char ch;
usr.bin/gcore/gcore.c
129
int ch, efd, fd, name[4];
usr.bin/gcore/gcore.c
137
while ((ch = getopt(argc, argv, "c:fk")) != -1) {
usr.bin/gcore/gcore.c
138
switch (ch) {
usr.bin/getaddrinfo/getaddrinfo.c
65
int ch;
usr.bin/getaddrinfo/getaddrinfo.c
75
while ((ch = getopt(argc, argv, "cf:nNp:Ps:t:")) != -1) {
usr.bin/getaddrinfo/getaddrinfo.c
76
switch (ch) {
usr.bin/grdc/grdc.c
65
int ch;
usr.bin/grdc/grdc.c
69
while ((ch = getopt(argc, argv, "cst")) != -1)
usr.bin/grdc/grdc.c
70
switch (ch) {
usr.bin/gzip/gzip.c
326
int ch;
usr.bin/gzip/gzip.c
345
while ((ch = getopt_long(argc, argv, OPT_LIST, longopts, NULL)) != -1) {
usr.bin/gzip/gzip.c
346
switch (ch) {
usr.bin/gzip/gzip.c
350
numflag = ch - '0';
usr.bin/head/head.c
78
int ch, first, eval;
usr.bin/head/head.c
89
while ((ch = getopt_long(argc, argv, "+n:c:qv", long_opts, NULL)) != -1) {
usr.bin/head/head.c
90
switch(ch) {
usr.bin/hexdump/hexsyntax.c
47
int ch;
usr.bin/hexdump/hexsyntax.c
58
while ((ch = getopt(argc, argv, "bcCde:f:n:os:vx")) != -1)
usr.bin/hexdump/hexsyntax.c
59
switch (ch) {
usr.bin/hexdump/odsyntax.c
60
int ch;
usr.bin/hexdump/odsyntax.c
70
while ((ch = getopt(argc, argv, "A:aBbcDdeFfHhIij:LlN:Oost:vXx")) != -1)
usr.bin/hexdump/odsyntax.c
71
switch (ch) {
usr.bin/hexdump/parse.c
49
int ch;
usr.bin/hexdump/parse.c
515
badconv(const char *ch)
usr.bin/hexdump/parse.c
517
errx(1, "%%%s: bad conversion character", ch);
usr.bin/hexdump/parse.c
57
while ((ch = getchar()) != '\n' && ch != EOF);
usr.bin/iconv/iconv.c
162
int ch, i, res;
usr.bin/iconv/iconv.c
170
while ((ch = getopt_long(argc, argv, "csLlf:t:",
usr.bin/iconv/iconv.c
172
switch (ch) {
usr.bin/id/id.c
72
int ch, combo, error, id;
usr.bin/id/id.c
92
while ((ch = getopt(argc, argv, optstr)) != -1) {
usr.bin/id/id.c
93
switch(ch) {
usr.bin/ident/ident.c
215
int ch, i, *fds, fd;
usr.bin/ident/ident.c
220
while ((ch = getopt(argc, argv, "qV")) != -1) {
usr.bin/ident/ident.c
221
switch (ch) {
usr.bin/iscsictl/iscsictl.c
641
int ch, error, iscsi_fd, retval, saved_errno;
usr.bin/iscsictl/iscsictl.c
653
while ((ch = getopt(argc, argv, "AMRLac:d:e:i:n:p:rt:u:s:vw:")) != -1) {
usr.bin/iscsictl/iscsictl.c
654
switch (ch) {
usr.bin/join/join.c
109
int aflag, ch, cval, vflag;
usr.bin/join/join.c
119
while ((ch = getopt(argc, argv, "\01a:e:j:1:2:o:t:v:")) != -1) {
usr.bin/join/join.c
120
switch (ch) {
usr.bin/jot/jot.c
115
while ((ch = getopt(argc, argv, "b:cnp:rs:w:")) != -1)
usr.bin/jot/jot.c
116
switch (ch) {
usr.bin/jot/jot.c
123
errx(1, "-%c word too long", ch);
usr.bin/jot/jot.c
89
int ch;
usr.bin/kdump/kdump.c
336
int ch, ktrlen, size;
usr.bin/kdump/kdump.c
347
while ((ch = getopt(argc,argv,"f:cdElm:np:AHRrSsTt:")) != -1)
usr.bin/kdump/kdump.c
348
switch (ch) {
usr.bin/killall/killall.c
405
first = ch = getchar();
usr.bin/killall/killall.c
406
while (ch != '\n' && ch != EOF)
usr.bin/killall/killall.c
407
ch = getchar();
usr.bin/killall/killall.c
99
int i, j, ch;
usr.bin/ktrace/ktrace.c
60
int append, ch, fd, inherit, ops, trpoints;
usr.bin/ktrace/ktrace.c
68
while ((ch = getopt(argc,argv,"aCcdf:g:ip:t:")) != -1)
usr.bin/ktrace/ktrace.c
69
switch((char)ch) {
usr.bin/last/last.c
114
int ch;
usr.bin/last/last.c
126
while ((ch = getopt(argc, argv, "0123456789d:f:h:n:st:wy")) != -1)
usr.bin/last/last.c
127
switch (ch) {
usr.bin/last/last.c
135
p = strchr(argv[optind - 1], ch);
usr.bin/last/last.c
137
p = strchr(argv[optind], ch);
usr.bin/lastcomm/lastcomm.c
212
#define BIT(flag, ch) if (f & flag) *p++ = ch
usr.bin/lastcomm/lastcomm.c
73
int ch, rv;
usr.bin/lastcomm/lastcomm.c
80
while ((ch = getopt(argc, argv, "f:usecSE")) != -1)
usr.bin/lastcomm/lastcomm.c
81
switch((char)ch) {
usr.bin/limits/limits.c
265
static rlim_t resource_num(int which, int ch, const char *str);
usr.bin/limits/limits.c
282
int ch, doeval = 0, doall = 0;
usr.bin/limits/limits.c
300
while ((ch = getopt(argc, argv,
usr.bin/limits/limits.c
302
switch(ch) {
usr.bin/limits/limits.c
578
resource_num(int which, int ch, const char *str)
usr.bin/limits/limits.c
676
warnx("invalid value -%c `%s'", ch, str);
usr.bin/locale/locale.c
356
int ch;
usr.bin/locale/locale.c
359
while ((ch = getopt(argc, argv, "ackms:")) != -1) {
usr.bin/locale/locale.c
360
switch (ch) {
usr.bin/localedef/charmap.c
368
add_charmap_char(portable_chars[i].name, portable_chars[i].ch);
usr.bin/localedef/charmap.c
70
int ch;
usr.bin/locate/code/locate.code.c
105
int ch, code, count, diffcount, oldcount;
usr.bin/locate/code/locate.code.c
109
while ((ch = getopt(argc, argv, "")) != -1)
usr.bin/locate/code/locate.code.c
110
switch(ch) {
usr.bin/locate/locate/locate.c
118
int ch;
usr.bin/locate/locate/locate.c
126
while ((ch = getopt(argc, argv, "0Scd:il:ms")) != -1)
usr.bin/locate/locate/locate.c
127
switch(ch) {
usr.bin/locate/locate/locate.c
180
for (ch = 0; ch < UCHAR_MAX + 1; ch++)
usr.bin/locate/locate/locate.c
181
myctype[ch] = tolower(ch);
usr.bin/locate/locate/locate.h
58
define TOLOWER(ch) tolower(ch)
usr.bin/locate/locate/locate.h
62
#define TOLOWER(ch) (myctype[ch])
usr.bin/locate/locate/util.c
102
for (ch = c = path; ; ch++) {
usr.bin/locate/locate/util.c
103
if (*ch == ':' ||
usr.bin/locate/locate/util.c
104
(!*ch && !(*(ch - 1) == ':' && ch == 1+ path))) {
usr.bin/locate/locate/util.c
106
if (ch == c)
usr.bin/locate/locate/util.c
110
slen = ch - c;
usr.bin/locate/locate/util.c
123
c = ch + 1;
usr.bin/locate/locate/util.c
125
if (*ch == '\0')
usr.bin/locate/locate/util.c
59
check_bigram_char(int ch)
usr.bin/locate/locate/util.c
62
if (ch == 0 ||
usr.bin/locate/locate/util.c
63
(ch >= ASCII_MIN && ch <= ASCII_MAX))
usr.bin/locate/locate/util.c
64
return (ch);
usr.bin/locate/locate/util.c
68
ASCII_MIN, ASCII_MAX, ch);
usr.bin/locate/locate/util.c
84
char *c, *ch, *p;
usr.bin/lock/lock.c
103
while ((ch = getopt(argc, argv, "npt:v")) != -1)
usr.bin/lock/lock.c
104
switch((char)ch) {
usr.bin/lock/lock.c
89
int ch, failures, pam_err, sectimeout, usemine, vtylock;
usr.bin/lockf/lockf.c
110
int ch, flags;
usr.bin/lockf/lockf.c
116
while ((ch = getopt(argc, argv, "knpsTt:w")) != -1) {
usr.bin/lockf/lockf.c
117
switch (ch) {
usr.bin/logger/logger.c
105
while ((ch = getopt(argc, argv, "46Af:H:h:iP:p:S:st:")) != -1)
usr.bin/logger/logger.c
106
switch((char)ch) {
usr.bin/logger/logger.c
90
int ch, logflags, pri;
usr.bin/login/login.c
160
int ask, ch, cnt, quietlog, rootlogin, rval;
usr.bin/login/login.c
202
while ((ch = getopt(argc, argv, "fh:p")) != -1)
usr.bin/login/login.c
203
switch (ch) {
usr.bin/login/login.c
222
syslog(LOG_ERR, "invalid flag %c", ch);
usr.bin/login/login.c
826
int ch;
usr.bin/login/login.c
833
for (p = nbuf; (ch = getchar()) != '\n'; ) {
usr.bin/login/login.c
834
if (ch == EOF) {
usr.bin/login/login.c
839
*p++ = ch;
usr.bin/login/login.c
871
int ch;
usr.bin/login/login.c
880
while ((ch = fgetc(f)) != EOF && !motdinterrupt)
usr.bin/login/login.c
881
putchar(ch);
usr.bin/login/login.c
883
if (ch != EOF || ferror(f)) {
usr.bin/look/look.c
102
while ((ch = getopt_long(argc, argv, "+adft:", longopts, NULL)) != -1)
usr.bin/look/look.c
103
switch(ch) {
usr.bin/look/look.c
159
wchar_t ch;
usr.bin/look/look.c
170
while ((clen = mbrtowc(&ch, readp, MB_LEN_MAX, NULL)) != 0) {
usr.bin/look/look.c
174
ch = towlower(ch);
usr.bin/look/look.c
175
if (!dflag || iswalnum(ch))
usr.bin/look/look.c
176
*writep++ = ch;
usr.bin/look/look.c
92
int ch, fd, match;
usr.bin/mail/tty.c
171
char ch;
usr.bin/mail/tty.c
194
ch = '\\';
usr.bin/mail/tty.c
195
ioctl(0, TIOCSTI, &ch);
usr.bin/mail/tty.c
197
ch = c;
usr.bin/mail/tty.c
198
ioctl(0, TIOCSTI, &ch);
usr.bin/mdo/mdo.c
499
int ch;
usr.bin/mdo/mdo.c
513
while (ch = getopt_long(argc, argv, "+G:g:hiks:u:", longopts, NULL),
usr.bin/mdo/mdo.c
514
ch != -1) {
usr.bin/mdo/mdo.c
515
switch (ch) {
usr.bin/mesg/mesg.c
53
int ch;
usr.bin/mesg/mesg.c
55
while ((ch = getopt(argc, argv, "")) != -1)
usr.bin/mesg/mesg.c
56
switch (ch) {
usr.bin/mididump/mididump.c
159
int fd, ch, tflag = 0;
usr.bin/mididump/mididump.c
162
while ((ch = getopt(argc, argv, "t")) != -1) {
usr.bin/mididump/mididump.c
163
switch (ch) {
usr.bin/mkcsmapper/yacc.y
682
int ch, mkdb = 0, mkpv = 0;
usr.bin/mkcsmapper/yacc.y
684
while ((ch = getopt(argc, argv, "do:mp")) != EOF) {
usr.bin/mkcsmapper/yacc.y
685
switch (ch) {
usr.bin/mkesdb/yacc.y
290
int ch, mkdb = 0;
usr.bin/mkesdb/yacc.y
292
while ((ch = getopt(argc, argv, "do:m")) != EOF) {
usr.bin/mkesdb/yacc.y
293
switch (ch) {
usr.bin/mkfifo/mkfifo.c
55
int ch, exitval;
usr.bin/mkfifo/mkfifo.c
57
while ((ch = getopt(argc, argv, "m:")) != -1)
usr.bin/mkfifo/mkfifo.c
58
switch(ch) {
usr.bin/mkimg/image.c
137
struct chunk *ch;
usr.bin/mkimg/image.c
139
ch = (last != NULL && last->ch_block <= blk)
usr.bin/mkimg/image.c
141
while (ch != NULL) {
usr.bin/mkimg/image.c
142
if (ch->ch_block <= blk &&
usr.bin/mkimg/image.c
143
(lba_t)(ch->ch_block + (ch->ch_size / secsz)) > blk) {
usr.bin/mkimg/image.c
144
last = ch;
usr.bin/mkimg/image.c
147
ch = TAILQ_NEXT(ch, ch_list);
usr.bin/mkimg/image.c
149
return (ch);
usr.bin/mkimg/image.c
153
image_chunk_grow(struct chunk *ch, size_t sz)
usr.bin/mkimg/image.c
157
newsz = ch->ch_size + sz;
usr.bin/mkimg/image.c
158
if (newsz > ch->ch_size) {
usr.bin/mkimg/image.c
159
ch->ch_size = newsz;
usr.bin/mkimg/image.c
163
dsz = SIZE_MAX - ch->ch_size;
usr.bin/mkimg/image.c
165
ch->ch_size = SIZE_MAX;
usr.bin/mkimg/image.c
170
image_chunk_memory(struct chunk *ch, lba_t blk)
usr.bin/mkimg/image.c
179
if (ch->ch_block < blk) {
usr.bin/mkimg/image.c
185
memcpy(new, ch, sizeof(*new));
usr.bin/mkimg/image.c
186
ch->ch_size = (blk - ch->ch_block) * secsz;
usr.bin/mkimg/image.c
188
new->ch_size -= ch->ch_size;
usr.bin/mkimg/image.c
189
TAILQ_INSERT_AFTER(&image_chunks, ch, new, ch_list);
usr.bin/mkimg/image.c
191
ch = new;
usr.bin/mkimg/image.c
194
if (ch->ch_size > secsz) {
usr.bin/mkimg/image.c
200
memcpy(new, ch, sizeof(*new));
usr.bin/mkimg/image.c
201
ch->ch_size = secsz;
usr.bin/mkimg/image.c
204
TAILQ_INSERT_AFTER(&image_chunks, ch, new, ch_list);
usr.bin/mkimg/image.c
208
ch->ch_type = CH_TYPE_MEMORY;
usr.bin/mkimg/image.c
209
ch->ch_u.mem.ptr = ptr;
usr.bin/mkimg/image.c
210
return (ch);
usr.bin/mkimg/image.c
216
struct chunk *ch;
usr.bin/mkimg/image.c
220
ch = TAILQ_LAST(&image_chunks, chunk_head);
usr.bin/mkimg/image.c
221
from = (ch != NULL) ? ch->ch_block + (ch->ch_size / secsz) : 0LL;
usr.bin/mkimg/image.c
232
if (ch != NULL && ch->ch_type == CH_TYPE_ZEROES) {
usr.bin/mkimg/image.c
233
sz = image_chunk_grow(ch, sz);
usr.bin/mkimg/image.c
236
from = ch->ch_block + (ch->ch_size / secsz);
usr.bin/mkimg/image.c
238
ch = malloc(sizeof(*ch));
usr.bin/mkimg/image.c
239
if (ch == NULL)
usr.bin/mkimg/image.c
241
memset(ch, 0, sizeof(*ch));
usr.bin/mkimg/image.c
242
ch->ch_block = from;
usr.bin/mkimg/image.c
243
ch->ch_size = sz;
usr.bin/mkimg/image.c
244
ch->ch_type = CH_TYPE_ZEROES;
usr.bin/mkimg/image.c
245
TAILQ_INSERT_TAIL(&image_chunks, ch, ch_list);
usr.bin/mkimg/image.c
253
struct chunk *ch;
usr.bin/mkimg/image.c
255
ch = TAILQ_LAST(&image_chunks, chunk_head);
usr.bin/mkimg/image.c
256
if (ch != NULL && ch->ch_type == CH_TYPE_FILE) {
usr.bin/mkimg/image.c
257
if (fd == ch->ch_u.file.fd &&
usr.bin/mkimg/image.c
258
blk == (lba_t)(ch->ch_block + (ch->ch_size / secsz)) &&
usr.bin/mkimg/image.c
259
ofs == (off_t)(ch->ch_u.file.ofs + ch->ch_size)) {
usr.bin/mkimg/image.c
260
sz = image_chunk_grow(ch, sz);
usr.bin/mkimg/image.c
263
blk = ch->ch_block + (ch->ch_size / secsz);
usr.bin/mkimg/image.c
264
ofs = ch->ch_u.file.ofs + ch->ch_size;
usr.bin/mkimg/image.c
267
ch = malloc(sizeof(*ch));
usr.bin/mkimg/image.c
268
if (ch == NULL)
usr.bin/mkimg/image.c
270
memset(ch, 0, sizeof(*ch));
usr.bin/mkimg/image.c
271
ch->ch_block = blk;
usr.bin/mkimg/image.c
272
ch->ch_size = sz;
usr.bin/mkimg/image.c
273
ch->ch_type = CH_TYPE_FILE;
usr.bin/mkimg/image.c
274
ch->ch_u.file.ofs = ofs;
usr.bin/mkimg/image.c
275
ch->ch_u.file.fd = fd;
usr.bin/mkimg/image.c
276
TAILQ_INSERT_TAIL(&image_chunks, ch, ch_list);
usr.bin/mkimg/image.c
605
struct chunk *ch;
usr.bin/mkimg/image.c
613
ch = image_chunk_find(blk);
usr.bin/mkimg/image.c
614
if (ch == NULL) {
usr.bin/mkimg/image.c
618
ofs = (blk - ch->ch_block) * secsz;
usr.bin/mkimg/image.c
619
sz = ch->ch_size - ofs;
usr.bin/mkimg/image.c
621
switch (ch->ch_type) {
usr.bin/mkimg/image.c
626
error = image_copyout_file(fd, sz, ch->ch_u.file.fd,
usr.bin/mkimg/image.c
627
ch->ch_u.file.ofs + ofs);
usr.bin/mkimg/image.c
630
error = image_copyout_memory(fd, sz, ch->ch_u.mem.ptr);
usr.bin/mkimg/image.c
644
struct chunk *ch;
usr.bin/mkimg/image.c
648
ch = image_chunk_find(blk);
usr.bin/mkimg/image.c
649
if (ch == NULL)
usr.bin/mkimg/image.c
651
if (ch->ch_type != CH_TYPE_ZEROES)
usr.bin/mkimg/image.c
653
lim = ch->ch_block + (ch->ch_size / secsz);
usr.bin/mkimg/image.c
683
struct chunk *ch;
usr.bin/mkimg/image.c
687
ch = image_chunk_find(blk);
usr.bin/mkimg/image.c
688
if (ch == NULL)
usr.bin/mkimg/image.c
691
if (ch->ch_type == CH_TYPE_FILE)
usr.bin/mkimg/image.c
693
if (ch->ch_type == CH_TYPE_ZEROES) {
usr.bin/mkimg/image.c
694
ch = image_chunk_memory(ch, blk);
usr.bin/mkimg/image.c
695
if (ch == NULL)
usr.bin/mkimg/image.c
698
assert(ch->ch_type == CH_TYPE_MEMORY);
usr.bin/mkimg/image.c
699
memcpy(ch->ch_u.mem.ptr, buf, secsz);
usr.bin/mkimg/image.c
711
struct chunk *ch;
usr.bin/mkimg/image.c
713
while ((ch = TAILQ_FIRST(&image_chunks)) != NULL) {
usr.bin/mkimg/image.c
714
switch (ch->ch_type) {
usr.bin/mkimg/image.c
717
if (ch->ch_u.file.fd != -1)
usr.bin/mkimg/image.c
718
close(ch->ch_u.file.fd);
usr.bin/mkimg/image.c
721
free(ch->ch_u.mem.ptr);
usr.bin/mkimg/image.c
726
TAILQ_REMOVE(&image_chunks, ch, ch_list);
usr.bin/mkimg/image.c
727
free(ch);
usr.bin/mkstr/mkstr.c
172
int c, ch;
usr.bin/mkstr/mkstr.c
217
ch = getchar();
usr.bin/mkstr/mkstr.c
218
if (!octdigit(ch))
usr.bin/mkstr/mkstr.c
220
c <<= 7, c += ch - '0';
usr.bin/mkstr/mkstr.c
221
ch = getchar();
usr.bin/mkstr/mkstr.c
222
if (!octdigit(ch))
usr.bin/mkstr/mkstr.c
224
c <<= 3, c+= ch - '0', ch = -1;
usr.bin/morse/morse.c
304
int ch, lflags;
usr.bin/morse/morse.c
307
while ((ch = getopt(argc, argv, GETOPTOPTS)) != -1)
usr.bin/morse/morse.c
308
switch ((char) ch) {
usr.bin/morse/morse.c
449
while ((ch = getchar()) != EOF) {
usr.bin/morse/morse.c
451
putchar(ch);
usr.bin/morse/morse.c
452
morse(ch);
usr.bin/mt/mt.c
198
int ch, len, mtfd;
usr.bin/mt/mt.c
206
while ((ch = getopt(argc, argv, "f:t:")) != -1)
usr.bin/mt/mt.c
207
switch(ch) {
usr.bin/ncal/ncal.c
197
int ch; /* holds the option character */
usr.bin/ncal/ncal.c
262
while ((ch = getopt(argc, argv, "3A:B:Cd:eH:hjJm:Nops:wyM")) != -1)
usr.bin/ncal/ncal.c
263
switch (ch) {
usr.bin/netstat/main.c
244
int ch;
usr.bin/netstat/main.c
258
while ((ch = getopt(argc, argv, "46AaBbCcdF:f:ghI:ij:LlM:mN:nOoPp:Qq:RrSTsuWw:xz"))
usr.bin/netstat/main.c
260
switch(ch) {
usr.bin/newgrp/newgrp.c
72
int ch, login;
usr.bin/newgrp/newgrp.c
83
while ((ch = getopt(argc, argv, "-l")) != -1) {
usr.bin/newgrp/newgrp.c
84
switch (ch) {
usr.bin/nfsstat/nfsstat.c
136
int ch;
usr.bin/nfsstat/nfsstat.c
150
while ((ch = getopt(argc, argv, "cdEesWM:mN:w:zq")) != -1)
usr.bin/nfsstat/nfsstat.c
151
switch(ch) {
usr.bin/nice/nice.c
53
int ch;
usr.bin/nice/nice.c
62
while ((ch = getopt(argc, argv, "n:")) != -1) {
usr.bin/nice/nice.c
63
switch (ch) {
usr.bin/number/number.c
74
int ch, first;
usr.bin/number/number.c
78
while ((ch = getopt(argc, argv, "l")) != -1)
usr.bin/number/number.c
79
switch (ch) {
usr.bin/paste/paste.c
140
wchar_t ch;
usr.bin/paste/paste.c
164
(ch = delim[(lp->cnt - 1) % delimcnt]))
usr.bin/paste/paste.c
165
putwchar(ch);
usr.bin/paste/paste.c
173
(ch = delim[(lp->cnt - 1) % delimcnt]))
usr.bin/paste/paste.c
174
putwchar(ch);
usr.bin/paste/paste.c
184
if ((ch = delim[cnt % delimcnt]))
usr.bin/paste/paste.c
185
putwchar(ch);
usr.bin/paste/paste.c
186
} else if ((ch = delim[(lp->cnt - 1) % delimcnt]))
usr.bin/paste/paste.c
187
putwchar(ch);
usr.bin/paste/paste.c
206
wint_t ch;
usr.bin/paste/paste.c
219
while ((ch = getwc(fp)) != WEOF) {
usr.bin/paste/paste.c
227
if (ch != '\n')
usr.bin/paste/paste.c
228
putwchar(ch);
usr.bin/paste/paste.c
245
wchar_t ch, *p;
usr.bin/paste/paste.c
247
for (p = arg, cnt = 0; (ch = *p++); ++arg, ++cnt)
usr.bin/paste/paste.c
248
if (ch == '\\')
usr.bin/paste/paste.c
249
switch(ch = *p++) {
usr.bin/paste/paste.c
260
*arg = ch;
usr.bin/paste/paste.c
264
*arg = ch;
usr.bin/paste/paste.c
67
int ch, rval, seq;
usr.bin/paste/paste.c
77
while ((ch = getopt(argc, argv, "d:s")) != -1)
usr.bin/paste/paste.c
78
switch(ch) {
usr.bin/patch/patch.c
557
int ch;
usr.bin/patch/patch.c
565
while ((ch = getopt_long(Argc, Argv, options, longopts, NULL)) != -1) {
usr.bin/patch/patch.c
566
switch (ch) {
usr.bin/patch/patch.c
667
if (ch != '\0')
usr.bin/patch/patch.c
808
rej_line(int ch, LINENUM i)
usr.bin/patch/patch.c
815
fprintf(rejfp, "%c%s", ch, line);
usr.bin/patch/pch.c
1007
ch = ' ';
usr.bin/patch/pch.c
1018
p_char[fillold] = ch;
usr.bin/patch/pch.c
1043
p_char[fillnew] = ch;
usr.bin/patch/pch.c
1057
if (ch != ' ' && context > 0) {
usr.bin/patch/pch.c
903
char ch;
usr.bin/patch/pch.c
977
ch = ' '; /* assume the space got eaten */
usr.bin/patch/pch.c
980
ch = *buf;
usr.bin/patch/pch.c
989
switch (ch) {
usr.bin/patch/pch.c
996
p_char[fillold] = ch;
usr.bin/pathchk/pathchk.c
58
int ch, rval;
usr.bin/pathchk/pathchk.c
61
while ((ch = getopt(argc, argv, "pP")) > 0) {
usr.bin/pathchk/pathchk.c
62
switch (ch) {
usr.bin/pom/pom.c
78
int ch, cnt, pflag = 0;
usr.bin/pom/pom.c
90
while ((ch = getopt(argc, argv, "d:pt:")) != -1)
usr.bin/pom/pom.c
91
switch (ch) {
usr.bin/pr/pr.c
1017
int ch = EOF;
usr.bin/pr/pr.c
1027
while ((--lim >= 0) && ((ch = getc(inf)) != EOF)) {
usr.bin/pr/pr.c
1031
if (ch == chk) {
usr.bin/pr/pr.c
1041
if ((col > lim) && (ungetc(ch, inf) == EOF))
usr.bin/pr/pr.c
1051
if (ch == '\n')
usr.bin/pr/pr.c
1053
*ptbuf++ = ch;
usr.bin/pr/pr.c
1059
while ((--lim >= 0) && ((ch = getc(inf)) != EOF)) {
usr.bin/pr/pr.c
1060
if (ch == '\n')
usr.bin/pr/pr.c
1062
*ptbuf++ = ch;
usr.bin/pr/pr.c
1066
if (ch == EOF) {
usr.bin/pr/pr.c
1073
if (ch == '\n') {
usr.bin/pr/pr.c
1089
while ((ch = getc(inf)) != EOF) {
usr.bin/pr/pr.c
1090
if (ch == '\n')
usr.bin/primes/primes.c
87
int ch;
usr.bin/primes/primes.c
94
while ((ch = getopt(argc, argv, "h")) != -1)
usr.bin/primes/primes.c
95
switch (ch) {
usr.bin/printenv/printenv.c
55
int ch;
usr.bin/printenv/printenv.c
60
while ((ch = getopt(argc, argv, "")) != -1)
usr.bin/printenv/printenv.c
61
switch(ch) {
usr.bin/printf/printf.c
109
while ((ch = getopt(argc, argv, "")) != -1)
usr.bin/printf/printf.c
110
switch (ch) {
usr.bin/printf/printf.c
434
mknum(char *str, char ch)
usr.bin/printf/printf.c
454
copy[len - 2] = ch;
usr.bin/printf/printf.c
646
int ch;
usr.bin/printf/printf.c
650
ch = (unsigned char)**gargv;
usr.bin/printf/printf.c
651
if (ch == '\'' || ch == '"') {
usr.bin/printf/printf.c
662
ch = wch;
usr.bin/printf/printf.c
665
return (ch);
usr.bin/printf/printf.c
99
int ch;
usr.bin/proccontrol/proccontrol.c
109
int arg, ch, error, mode;
usr.bin/proccontrol/proccontrol.c
117
while ((ch = getopt(argc, argv, "m:qs:p:")) != -1) {
usr.bin/proccontrol/proccontrol.c
118
switch (ch) {
usr.bin/procstat/procstat.c
299
int aflag, ch, cnt, i, interval;
usr.bin/procstat/procstat.c
310
while ((ch = getopt(argc, argv, "abCcefHhijkLlM:N:nrSstvw:x")) != -1) {
usr.bin/procstat/procstat.c
311
switch (ch) {
usr.bin/procstat/procstat.c
549
int ch;
usr.bin/procstat/procstat.c
551
while ((ch = getopt(argc, argv, "")) != -1) {
usr.bin/procstat/procstat.c
552
switch (ch) {
usr.bin/procstat/procstat.c
563
int ch;
usr.bin/procstat/procstat.c
565
while ((ch = getopt(argc, argv, "v")) != -1) {
usr.bin/procstat/procstat.c
566
switch (ch) {
usr.bin/procstat/procstat.c
580
int ch;
usr.bin/procstat/procstat.c
582
while ((ch = getopt(argc, argv, "n")) != -1) {
usr.bin/procstat/procstat.c
583
switch (ch) {
usr.bin/procstat/procstat.c
597
int ch;
usr.bin/procstat/procstat.c
599
while ((ch = getopt(argc, argv, "Ht")) != -1) {
usr.bin/procstat/procstat.c
600
switch (ch) {
usr.bin/procstat/procstat.c
616
int ch;
usr.bin/procstat/procstat.c
618
while ((ch = getopt(argc, argv, "C")) != -1) {
usr.bin/procstat/procstat.c
619
switch (ch) {
usr.bin/procstat/procstat.c
641
int ch;
usr.bin/procstat/procstat.c
643
while ((ch = getopt(argc, argv, "v")) != -1) {
usr.bin/procstat/procstat.c
644
switch (ch) {
usr.bin/protect/protect.c
55
char *ch;
usr.bin/protect/protect.c
61
value = strtol(id, &ch, 0);
usr.bin/protect/protect.c
62
if (*ch != '\0') {
usr.bin/protect/protect.c
74
int ch, flags;
usr.bin/protect/protect.c
81
while ((ch = getopt(argc, argv, "cdig:p:")) != -1)
usr.bin/protect/protect.c
82
switch (ch) {
usr.bin/quota/quota.c
104
int i, ch, gflag = 0, uflag = 0, errflag = 0;
usr.bin/quota/quota.c
106
while ((ch = getopt(argc, argv, "f:ghlrquv")) != -1) {
usr.bin/quota/quota.c
107
switch(ch) {
usr.bin/random/random.c
157
while ((ch = getchar()) != EOF) {
usr.bin/random/random.c
158
putchar(ch);
usr.bin/random/random.c
159
if (ch == '\n')
usr.bin/random/random.c
163
while ((ch = getchar()) != EOF)
usr.bin/random/random.c
164
if (ch == '\n')
usr.bin/random/random.c
169
} while (ch != EOF);
usr.bin/random/random.c
56
int ch, fd, random_exit, randomize_lines, random_type, ret,
usr.bin/random/random.c
70
while ((ch = getopt(argc, argv, "ef:hlruUw")) != -1)
usr.bin/random/random.c
71
switch (ch) {
usr.bin/rctl/rctl.c
588
int ch, aflag = 0, hflag = 0, nflag = 0, lflag = 0, rflag = 0,
usr.bin/rctl/rctl.c
593
while ((ch = getopt(argc, argv, "ahlnru")) != -1) {
usr.bin/rctl/rctl.c
594
switch (ch) {
usr.bin/resizewin/resizewin.c
67
int ch, cnt, error, fd, ret, zflag;
usr.bin/resizewin/resizewin.c
71
while ((ch = getopt(argc, argv, "z")) != -1) {
usr.bin/resizewin/resizewin.c
72
switch (ch) {
usr.bin/rev/rev.c
52
int ch, rval;
usr.bin/rev/rev.c
56
while ((ch = getopt(argc, argv, "")) != -1)
usr.bin/rev/rev.c
57
switch(ch) {
usr.bin/rpcgen/rpc_main.c
1086
char c, ch;
usr.bin/rpcgen/rpc_main.c
1138
ch = argv[i][++j]; /* get next char */
usr.bin/rpcgen/rpc_main.c
1139
if (ch == 's')
usr.bin/rpcgen/rpc_main.c
1140
ch = 'S';
usr.bin/rpcgen/rpc_main.c
1141
else if (ch == 'c')
usr.bin/rpcgen/rpc_main.c
1142
ch = 'C';
usr.bin/rpcgen/rpc_main.c
1143
else if (ch == 'm')
usr.bin/rpcgen/rpc_main.c
1144
ch = 'M';
usr.bin/rpcgen/rpc_main.c
1148
if (flag[(int)ch]) {
usr.bin/rpcgen/rpc_main.c
1151
flag[(int)ch] = 1;
usr.bin/rpcgen/rpc_main.c
1154
ch = argv[i][j+1]; /* get next char */
usr.bin/rpcgen/rpc_main.c
1156
if (ch != 'C')
usr.bin/rs/rs.cc
338
int ch;
usr.bin/rs/rs.cc
344
while ((ch = getopt(ac, av, "C::EG:HK:S::Tc::eg:hjk:mns::tw:yz")) != -1)
usr.bin/rs/rs.cc
345
switch (ch) {
usr.bin/runat/runat.c
37
int ch, file_fd, flags, i, longindex, nameddir_fd, outsiz;
usr.bin/runat/runat.c
45
while (!done_args && (ch = getopt_long(argc, argv, "h-", longopts,
usr.bin/runat/runat.c
47
switch (ch) {
usr.bin/rup/rup.c
224
int ch;
usr.bin/rup/rup.c
226
while ((ch = getopt(argc, argv, "?")) != -1)
usr.bin/rup/rup.c
227
switch (ch) {
usr.bin/ruptime/ruptime.c
72
int aflg, ch;
usr.bin/ruptime/ruptime.c
76
while ((ch = getopt(argc, argv, "alrut")) != -1)
usr.bin/ruptime/ruptime.c
77
switch (ch) {
usr.bin/rusers/rusers.c
227
int ch;
usr.bin/rusers/rusers.c
229
while ((ch = getopt(argc, argv, "al")) != -1)
usr.bin/rusers/rusers.c
230
switch (ch) {
usr.bin/rwho/rwho.c
77
int ch;
usr.bin/rwho/rwho.c
94
while ((ch = getopt(argc, argv, "a")) != -1) {
usr.bin/rwho/rwho.c
95
switch ((char)ch) {
usr.bin/script/script.c
113
int aflg, Fflg, kflg, pflg, wflg, ch, k, n, fcm;
usr.bin/script/script.c
134
while ((ch = getopt(argc, argv, "adeFfkpqrT:t:w")) != -1)
usr.bin/script/script.c
135
switch (ch) {
usr.bin/sdiff/sdiff.c
212
int ch, fd[2], i, ret, status;
usr.bin/sdiff/sdiff.c
244
while ((ch = getopt_long(argc, argv, "aBbdEHI:ilo:stWw:",
usr.bin/sdiff/sdiff.c
246
switch (ch) {
usr.bin/sdiff/sdiff.c
266
flagv[flagc] = ch == 'W' ? 'w' : ch;
usr.bin/sdiff/sdiff.c
493
int ch, i;
usr.bin/sdiff/sdiff.c
499
ch = fgetc(f);
usr.bin/sdiff/sdiff.c
500
if (ch == '\0') {
usr.bin/sdiff/sdiff.c
504
if (ch == EOF)
usr.bin/sdiotool/cam_sdio.c
331
int start, i, ch, count, ret;
usr.bin/sdiotool/cam_sdio.c
356
ch = sdio_read_1(dev, 0, addr + i, &ret);
usr.bin/sdiotool/cam_sdio.c
357
printf("count=%d, start=%d, i=%d, Got %c (0x%02x)\n", count, start, i, ch, ch);
usr.bin/sdiotool/cam_sdio.c
358
if (ch == 0xff)
usr.bin/sdiotool/cam_sdio.c
360
cis1_info_buf[i] = ch;
usr.bin/sdiotool/cam_sdio.c
361
if (ch == 0) {
usr.bin/sdiotool/sdiotool.c
491
int ch;
usr.bin/sdiotool/sdiotool.c
498
while ((ch = getopt(argc, argv, "fu:")) != -1) {
usr.bin/sdiotool/sdiotool.c
499
switch (ch) {
usr.bin/sed/main.c
504
int ch;
usr.bin/sed/main.c
511
if ((ch = getc(file_fd)) != EOF) {
usr.bin/sed/main.c
516
ungetc(ch, file_fd);
usr.bin/sed/main.c
530
int ch;
usr.bin/sed/main.c
537
if ((ch = getc(infile)) == EOF) {
usr.bin/sed/main.c
542
ungetc(ch, infile);
usr.bin/showmount/showmount.c
115
int ch, estat, nbytes;
usr.bin/showmount/showmount.c
117
while ((ch = getopt_long(argc, argv, "+adEe13", long_opts, NULL)) != -1)
usr.bin/showmount/showmount.c
118
switch (ch) {
usr.bin/soelim/soelim.c
135
int ch, i;
usr.bin/soelim/soelim.c
143
while ((ch = getopt(argc, argv, "CrtvI:")) != -1) {
usr.bin/soelim/soelim.c
144
switch (ch) {
usr.bin/split/split.c
78
int ch, error;
usr.bin/split/split.c
83
while ((ch = getopt(argc, argv, "0::1::2::3::4::5::6::7::8::9::a:b:cdl:n:p:")) != -1)
usr.bin/split/split.c
84
switch (ch) {
usr.bin/split/split.c
93
numlines = ch - '0';
usr.bin/split/split.c
99
ch, optarg ? optarg : "");
usr.bin/stat/stat.c
217
int ch, rc, errs, am_readlink, fn, fmtchar;
usr.bin/stat/stat.c
246
while ((ch = getopt(argc, argv, options)) != -1)
usr.bin/stat/stat.c
247
switch (ch) {
usr.bin/stat/stat.c
283
fmtchar, ch);
usr.bin/stat/stat.c
284
fmtchar = ch;
usr.bin/su/su.c
149
int asme, ch, asthem, fastlogin, prio, i, retcode,
usr.bin/su/su.c
168
while ((ch = getopt(argc, argv, "-flmsc:")) != -1)
usr.bin/su/su.c
169
switch ((char)ch) {
usr.bin/systat/ifstat.c
382
char *p = matchline, *ch, t;
usr.bin/systat/ifstat.c
392
ch = p;
usr.bin/systat/ifstat.c
393
while ((mlen = strcspn(ch, " ;,")) != 0) {
usr.bin/systat/ifstat.c
394
p = ch + mlen;
usr.bin/systat/ifstat.c
396
if (p - ch > 0) {
usr.bin/systat/ifstat.c
398
if (fnmatch(ch, ifname, FNM_CASEFOLD) == 0) {
usr.bin/systat/ifstat.c
403
ch = p + strspn(p, " ;,");
usr.bin/systat/ifstat.c
406
ch = p + strspn(p, " ;,");
usr.bin/systat/keyboard.c
117
keyboard_dispatch(int ch)
usr.bin/systat/keyboard.c
120
if (ch == ERR) {
usr.bin/systat/keyboard.c
125
if (ch >= 'A' && ch <= 'Z')
usr.bin/systat/keyboard.c
126
ch += 'a' - 'A';
usr.bin/systat/keyboard.c
128
if (ch == CTRL('l')) {
usr.bin/systat/keyboard.c
132
if (ch == CTRL('g')) {
usr.bin/systat/keyboard.c
136
if (ch != ':')
usr.bin/systat/keyboard.c
141
if (ch == erasechar() && col > 0) {
usr.bin/systat/keyboard.c
147
if (ch == CTRL('w') && col > 0) {
usr.bin/systat/keyboard.c
157
if (ch == killchar() && col > 0) {
usr.bin/systat/keyboard.c
166
if (isprint(ch) || ch == ' ') {
usr.bin/systat/keyboard.c
167
line[col] = ch;
usr.bin/systat/keyboard.c
168
mvaddch(CMDLINE, col, ch);
usr.bin/systat/keyboard.c
172
if (col == 0 || (ch != '\r' && ch != '\n'))
usr.bin/systat/keyboard.c
47
static int keyboard_dispatch(int ch);
usr.bin/systat/keyboard.c
52
int ch, n;
usr.bin/systat/keyboard.c
90
ch = getch();
usr.bin/systat/keyboard.c
92
if (keyboard_dispatch(ch) == 0) {
usr.bin/tail/forward.c
113
if ((ch = getc(fp)) == EOF) {
usr.bin/tail/forward.c
125
if ((ch = getc(fp)) == EOF) {
usr.bin/tail/forward.c
132
if (ch == '\n' && !--off)
usr.bin/tail/forward.c
176
while ((ch = getc(fp)) != EOF)
usr.bin/tail/forward.c
177
if (putchar(ch) == EOF)
usr.bin/tail/forward.c
240
int ch;
usr.bin/tail/forward.c
242
while ((ch = getc(file->fp)) != EOF) {
usr.bin/tail/forward.c
248
if (putchar(ch) == EOF)
usr.bin/tail/forward.c
99
int ch;
usr.bin/tail/read.c
141
int ch, rc;
usr.bin/tail/read.c
151
while ((ch = getc(fp)) != EOF) {
usr.bin/tail/read.c
157
*p++ = ch;
usr.bin/tail/read.c
158
if (ch == '\n') {
usr.bin/tail/read.c
66
int ch, len, tlen;
usr.bin/tail/read.c
74
for (wrap = 0, ep = p + off; (ch = getc(fp)) != EOF;) {
usr.bin/tail/read.c
75
*p = ch;
usr.bin/tail/tail.c
124
while ((ch = getopt_long(argc, argv, "+Fb:c:fn:qrv", long_opts, NULL)) !=
usr.bin/tail/tail.c
126
switch (ch) {
usr.bin/tail/tail.c
81
int ch, first;
usr.bin/tcopy/tcopy.cc
712
int ch;
usr.bin/tcopy/tcopy.cc
724
while ((ch = getopt(argc, argv, "cl:rs:vx")) != -1)
usr.bin/tcopy/tcopy.cc
725
switch((char)ch) {
usr.bin/tee/tee.c
65
int append, ch, exitval, fd, n, oflags, rval, wval;
usr.bin/tee/tee.c
69
while ((ch = getopt(argc, argv, "ai")) != -1)
usr.bin/tee/tee.c
70
switch((char)ch) {
usr.bin/time/time.c
67
int aflag, ch, lflag, status;
usr.bin/time/time.c
80
while ((ch = getopt(argc, argv, "ahlo:p")) != -1)
usr.bin/time/time.c
81
switch((char)ch) {
usr.bin/tip/tip/cu.c
45
int ch, i, parity;
usr.bin/tip/tip/cu.c
74
while ((ch = getopt(argc, argv, "a:l:s:htoe")) != -1) {
usr.bin/tip/tip/cu.c
75
switch (ch) {
usr.bin/tip/tip/tip.c
374
char ch;
usr.bin/tip/tip/tip.c
406
ch = gch;
usr.bin/tip/tip/tip.c
407
parwrite(FD, &ch, 1);
usr.bin/tip/tip/tip.c
420
ch = gch;
usr.bin/tip/tip/tip.c
421
parwrite(FD, &ch, 1);
usr.bin/tip/tip/tip.c
423
printf("%c", ch);
usr.bin/top/commands.c
149
char ch;
usr.bin/top/commands.c
158
while ((ch = *str++) != '\0')
usr.bin/top/commands.c
160
if (isdigit(ch))
usr.bin/top/commands.c
162
val = val * 10 + (ch - '0');
usr.bin/top/commands.c
164
else if (isspace(ch))
usr.bin/top/display.c
1041
char ch;
usr.bin/top/display.c
1052
if ((ch = *ptr) == '\n' || ch == '\r')
usr.bin/top/display.c
1058
if (ch == ch_kill)
usr.bin/top/display.c
1071
else if (ch == ch_erase)
usr.bin/top/display.c
1087
else if (cnt == size || (numeric && !isdigit(ch)) ||
usr.bin/top/display.c
1088
!isprint(ch))
usr.bin/top/display.c
1096
putchar(ch);
usr.bin/top/display.c
1180
int ch;
usr.bin/top/display.c
1199
if ((ch = *new++) != *old)
usr.bin/top/display.c
1210
putchar(ch);
usr.bin/top/display.c
1211
*old = ch;
usr.bin/top/display.c
1229
if ((ch = *new++) != *old)
usr.bin/top/display.c
1258
if (ch == '\0')
usr.bin/top/display.c
1266
putchar(ch);
usr.bin/top/display.c
1269
*old = ch;
usr.bin/top/display.c
1276
} while (ch != '\0');
usr.bin/top/top.c
251
char ch;
usr.bin/top/top.c
782
if (read(0, &ch, 1) != 1)
usr.bin/top/top.c
789
if (ch == '\r' || ch == '\n') {
usr.bin/top/top.c
794
if (cptr->c == ch) {
usr.bin/top/top.c
831
read(0, &ch, 1);
usr.bin/top/top.c
849
read(0, &ch, 1);
usr.bin/touch/touch.c
60
int Aflag, aflag, cflag, mflag, ch, fd, len, rval, timeset;
usr.bin/touch/touch.c
70
while ((ch = getopt(argc, argv, "A:acd:fhmr:t:")) != -1)
usr.bin/touch/touch.c
71
switch(ch) {
usr.bin/tr/cmap.c
121
cmap_lookup_hard(struct cmap *cm, wint_t ch)
usr.bin/tr/cmap.c
125
cm->cm_root = cmap_splay(cm->cm_root, ch);
usr.bin/tr/cmap.c
126
if (cm->cm_root->cmn_from == ch)
usr.bin/tr/cmap.c
129
return (cm->cm_def == CM_DEF_SELF ? ch : cm->cm_def);
usr.bin/tr/cmap.c
139
wint_t ch;
usr.bin/tr/cmap.c
141
for (ch = 0; ch < CM_CACHE_SIZE; ch++)
usr.bin/tr/cmap.c
142
cm->cm_cache[ch] = cmap_lookup_hard(cm, ch);
usr.bin/tr/cmap.c
165
cmap_splay(struct cmapnode *t, wint_t ch)
usr.bin/tr/cmap.c
178
if (ch < t->cmn_from) {
usr.bin/tr/cmap.c
180
ch < t->cmn_left->cmn_from) {
usr.bin/tr/cmap.c
191
} else if (ch > t->cmn_from) {
usr.bin/tr/cmap.c
193
ch > t->cmn_right->cmn_from) {
usr.bin/tr/cset.c
107
ncsn->csn_min = ncsn->csn_max = ch;
usr.bin/tr/cset.c
108
if (cset_rangecmp(csn, ch) < 0) {
usr.bin/tr/cset.c
151
cset_in_hard(struct cset *cs, wchar_t ch)
usr.bin/tr/cset.c
156
if (csc->csc_invert ^ (iswctype(ch, csc->csc_type) != 0))
usr.bin/tr/cset.c
159
cs->cs_root = cset_splay(cs->cs_root, ch);
usr.bin/tr/cset.c
160
return (cs->cs_invert ^ (cset_rangecmp(cs->cs_root, ch) == 0));
usr.bin/tr/cset.c
214
cset_rangecmp(struct csnode *t, wchar_t ch)
usr.bin/tr/cset.c
217
if (ch < t->csn_min)
usr.bin/tr/cset.c
219
if (ch > t->csn_max)
usr.bin/tr/cset.c
225
cset_splay(struct csnode *t, wchar_t ch)
usr.bin/tr/cset.c
238
if (cset_rangecmp(t, ch) < 0) {
usr.bin/tr/cset.c
240
cset_rangecmp(t->csn_left, ch) < 0) {
usr.bin/tr/cset.c
251
} else if (cset_rangecmp(t, ch) > 0) {
usr.bin/tr/cset.c
253
cset_rangecmp(t->csn_right, ch) > 0) {
usr.bin/tr/cset.c
275
cset_delete(struct csnode *t, wchar_t ch)
usr.bin/tr/cset.c
280
t = cset_splay(t, ch);
usr.bin/tr/cset.c
281
assert(cset_rangecmp(t, ch) == 0);
usr.bin/tr/cset.c
285
x = cset_splay(t->csn_left, ch);
usr.bin/tr/cset.c
69
cset_add(struct cset *cs, wchar_t ch)
usr.bin/tr/cset.c
84
csn->csn_min = csn->csn_max = ch;
usr.bin/tr/cset.c
93
csn = cs->cs_root = cset_splay(cs->cs_root, ch);
usr.bin/tr/cset.c
98
if (cset_rangecmp(csn, ch) == 0)
usr.bin/tr/cset.h
66
cset_in(struct cset *cs, wchar_t ch)
usr.bin/tr/cset.h
69
if (ch < CS_CACHE_SIZE && cs->cs_havecache)
usr.bin/tr/cset.h
70
return (cs->cs_cache[ch]);
usr.bin/tr/cset.h
71
return (cset_in_hard(cs, ch));
usr.bin/tr/str.c
112
ch = nextwctype(s->lastch, s->cclass);
usr.bin/tr/str.c
113
if (ch == -1) {
usr.bin/tr/str.c
117
s->lastch = ch;
usr.bin/tr/str.c
120
if ((ch = s->set[s->cnt++]) == OOBCH) {
usr.bin/tr/str.c
124
s->lastch = ch;
usr.bin/tr/str.c
341
int ch, cnt, val;
usr.bin/tr/str.c
346
ch = (u_char)*++s->str;
usr.bin/tr/str.c
347
if (!isdigit(ch) || ch > '7')
usr.bin/tr/str.c
349
val = val * 8 + ch - '0';
usr.bin/tr/str.c
360
if (ch != '\0')
usr.bin/tr/str.c
362
switch (ch) {
usr.bin/tr/str.c
381
return (ch);
usr.bin/tr/str.c
59
wint_t ch;
usr.bin/tr/tr.c
128
for (lastch = OOBCH; (ch = getwchar()) != WEOF;)
usr.bin/tr/tr.c
129
if (!cset_in(delete, ch) &&
usr.bin/tr/tr.c
130
(lastch != ch || !cset_in(squeeze, ch))) {
usr.bin/tr/tr.c
131
lastch = ch;
usr.bin/tr/tr.c
132
(void)putwchar(ch);
usr.bin/tr/tr.c
149
while ((ch = getwchar()) != WEOF)
usr.bin/tr/tr.c
150
if (!cset_in(delete, ch))
usr.bin/tr/tr.c
151
(void)putwchar(ch);
usr.bin/tr/tr.c
164
for (lastch = OOBCH; (ch = getwchar()) != WEOF;)
usr.bin/tr/tr.c
165
if (lastch != ch || !cset_in(squeeze, ch)) {
usr.bin/tr/tr.c
166
lastch = ch;
usr.bin/tr/tr.c
167
(void)putwchar(ch);
usr.bin/tr/tr.c
215
ch = towupper(s1.lastch);
usr.bin/tr/tr.c
216
cmap_add(map, s1.lastch, ch);
usr.bin/tr/tr.c
217
if (sflag && iswupper(ch))
usr.bin/tr/tr.c
218
cset_add(squeeze, ch);
usr.bin/tr/tr.c
232
ch = towlower(s1.lastch);
usr.bin/tr/tr.c
233
cmap_add(map, s1.lastch, ch);
usr.bin/tr/tr.c
234
if (sflag && iswlower(ch))
usr.bin/tr/tr.c
235
cset_add(squeeze, ch);
usr.bin/tr/tr.c
249
ch = towupper(s1.lastch);
usr.bin/tr/tr.c
250
cmap_add(map, s1.lastch, ch);
usr.bin/tr/tr.c
251
if (sflag && iswupper(ch))
usr.bin/tr/tr.c
252
cset_add(squeeze, ch);
usr.bin/tr/tr.c
266
ch = towlower(s1.lastch);
usr.bin/tr/tr.c
267
cmap_add(map, s1.lastch, ch);
usr.bin/tr/tr.c
268
if (sflag && iswlower(ch))
usr.bin/tr/tr.c
269
cset_add(squeeze, ch);
usr.bin/tr/tr.c
347
for (lastch = OOBCH; (ch = getwchar()) != WEOF;) {
usr.bin/tr/tr.c
348
if (!Cflag || iswrune(ch))
usr.bin/tr/tr.c
349
ch = cmap_lookup(map, ch);
usr.bin/tr/tr.c
350
if (lastch != ch || !cset_in(squeeze, ch)) {
usr.bin/tr/tr.c
351
lastch = ch;
usr.bin/tr/tr.c
352
(void)putwchar(ch);
usr.bin/tr/tr.c
356
while ((ch = getwchar()) != WEOF) {
usr.bin/tr/tr.c
357
if (!Cflag || iswrune(ch))
usr.bin/tr/tr.c
358
ch = cmap_lookup(map, ch);
usr.bin/tr/tr.c
359
(void)putwchar(ch);
usr.bin/tr/tr.c
66
wint_t ch, cnt, lastch;
usr.bin/tr/tr.c
77
while ((ch = getopt(argc, argv, "Ccdsu")) != -1)
usr.bin/tr/tr.c
78
switch((char)ch) {
usr.bin/truncate/truncate.c
56
int ch, error, fd, oflags, r;
usr.bin/truncate/truncate.c
74
while ((ch = getopt(argc, argv, "cdr:s:o:l:")) != -1)
usr.bin/truncate/truncate.c
75
switch (ch) {
usr.bin/tsort/tsort.c
107
int bsize, ch, nused;
usr.bin/tsort/tsort.c
111
while ((ch = getopt(argc, argv, "dlq")) != -1)
usr.bin/tsort/tsort.c
112
switch (ch) {
usr.bin/tty/tty.c
41
int ch, sflag;
usr.bin/tty/tty.c
45
while ((ch = getopt(argc, argv, "s")) != -1)
usr.bin/tty/tty.c
46
switch (ch) {
usr.bin/uname/uname.c
84
int ch;
usr.bin/uname/uname.c
89
while ((ch = getopt(argc, argv, "abiKmnoprsUv")) != -1)
usr.bin/uname/uname.c
90
switch(ch) {
usr.bin/unexpand/unexpand.c
107
wint_t ch;
usr.bin/unexpand/unexpand.c
112
while ((ch = getwchar()) != WEOF) {
usr.bin/unexpand/unexpand.c
113
if (ch == ' ' && !doneline) {
usr.bin/unexpand/unexpand.c
117
} else if (ch == '\t') {
usr.bin/unexpand/unexpand.c
159
if (ch == '\b') {
usr.bin/unexpand/unexpand.c
163
} else if (ch == '\n') {
usr.bin/unexpand/unexpand.c
167
} else if (ch != ' ' || dcol > limit) {
usr.bin/unexpand/unexpand.c
168
putwchar(ch);
usr.bin/unexpand/unexpand.c
169
if ((width = wcwidth(ch)) > 0)
usr.bin/unexpand/unexpand.c
178
while ((ch = getwchar()) != '\n' && ch != WEOF)
usr.bin/unexpand/unexpand.c
179
putwchar(ch);
usr.bin/unexpand/unexpand.c
180
if (ch == '\n')
usr.bin/unexpand/unexpand.c
57
int ch, failed;
usr.bin/unexpand/unexpand.c
64
while ((ch = getopt(argc, argv, "at:")) != -1) {
usr.bin/unexpand/unexpand.c
65
switch (ch) {
usr.bin/uniq/uniq.c
84
int ch, comp;
usr.bin/uniq/uniq.c
93
while ((ch = getopt_long(argc, argv, "+D::cdif:s:u", long_opts,
usr.bin/uniq/uniq.c
95
switch (ch) {
usr.bin/usbhidaction/usbhidaction.c
101
while ((ch = getopt(argc, argv, "c:def:ip:r:t:v")) != -1) {
usr.bin/usbhidaction/usbhidaction.c
102
switch(ch) {
usr.bin/usbhidaction/usbhidaction.c
89
int fd, fp, ch, n, val, i;
usr.bin/usbhidctl/usbhid.c
451
int ch;
usr.bin/usbhidctl/usbhid.c
455
while ((ch = getopt(argc, argv, "af:lnrt:vwxz")) != -1) {
usr.bin/usbhidctl/usbhid.c
456
switch(ch) {
usr.bin/vtfontcvt/vtfontcvt.c
1036
int ch, verbose = 0, rv = 0;
usr.bin/vtfontcvt/vtfontcvt.c
1042
while ((ch = getopt(argc, argv, "nf:h:vw:o:")) != -1) {
usr.bin/vtfontcvt/vtfontcvt.c
1043
switch (ch) {
usr.bin/w/w.c
131
int ch, i, nentries, nusers, wcmd, longidle, longattime;
usr.bin/w/w.c
159
while ((ch = getopt(argc, argv, p)) != -1)
usr.bin/w/w.c
160
switch (ch) {
usr.bin/w/w.c
181
xo_warnx("-%c no longer supported", ch);
usr.bin/wall/wall.c
178
wchar_t ch;
usr.bin/wall/wall.c
236
for (p = lbuf; (ch = *p) != L'\0'; ++p, ++cnt) {
usr.bin/wall/wall.c
237
if (ch == L'\r') {
usr.bin/wall/wall.c
241
} else if (ch == L'\n') {
usr.bin/wall/wall.c
253
if (iswprint(ch) || iswspace(ch) || ch == L'\a' || ch == L'\b') {
usr.bin/wall/wall.c
254
putwc(ch, fp);
usr.bin/wall/wall.c
256
(void)swprintf(codebuf, sizeof(codebuf)/sizeof(wchar_t), L"<0x%X>", ch);
usr.bin/wall/wall.c
88
int ch;
usr.bin/wall/wall.c
98
while ((ch = getopt(argc, argv, "g:n")) != -1)
usr.bin/wall/wall.c
99
switch (ch) {
usr.bin/wc/wc.c
87
int ch, errors, total;
usr.bin/wc/wc.c
96
while ((ch = getopt(argc, argv, "clmwL")) != -1)
usr.bin/wc/wc.c
97
switch((char)ch) {
usr.bin/who/who.c
69
int ch;
usr.bin/who/who.c
73
while ((ch = getopt(argc, argv, "HTabmqsu")) != -1) {
usr.bin/who/who.c
74
switch (ch) {
usr.bin/whois/whois.c
154
int ch, flags;
usr.bin/whois/whois.c
162
while ((ch = getopt(argc, argv, "aAbc:fgh:iIklmp:PQrRS")) != -1) {
usr.bin/whois/whois.c
163
switch (ch) {
usr.bin/xargs/xargs.c
110
int ch, Jflag, nargs, nflag, nline;
usr.bin/xargs/xargs.c
145
while ((ch = getopt_long(argc, argv, optstr, long_options, NULL)) != -1)
usr.bin/xargs/xargs.c
146
switch (ch) {
usr.bin/xargs/xargs.c
165
errx(1, "-%c %s: %s", ch, optarg, errstr);
usr.bin/xargs/xargs.c
171
errx(1, "-%c %s: %s", ch, optarg, errstr);
usr.bin/xargs/xargs.c
179
errx(1, "-%c %s: %s", ch, optarg, errstr);
usr.bin/xargs/xargs.c
191
errx(1, "-%c %s: %s", ch, optarg, errstr);
usr.bin/xargs/xargs.c
193
errx(1, "-%c %s: %s", ch, optarg, "must be non-zero");
usr.bin/xargs/xargs.c
201
errx(1, "-%c %s: %s", ch, optarg, errstr);
usr.bin/xargs/xargs.c
206
errx(1, "-%c %s: %s", ch, optarg, errstr);
usr.bin/xargs/xargs.c
300
int ch, foundeof;
usr.bin/xargs/xargs.c
305
switch (ch = getchar()) {
usr.bin/xargs/xargs.c
390
if (xp == endxp || p > ebp || ch == EOF ||
usr.bin/xargs/xargs.c
401
if (ch == EOF || foundeof) {
usr.bin/xargs/xargs.c
428
if (!insingle && !indouble && (ch = getchar()) == EOF) {
usr.bin/xargs/xargs.c
435
*p++ = ch;
usr.bin/xargs/xargs.c
459
*p++ = ch;
usr.bin/xinstall/xinstall.c
1345
int ch, tried_mkdir;
usr.bin/xinstall/xinstall.c
1350
ch = *p;
usr.bin/xinstall/xinstall.c
1367
if (!(*p = ch))
usr.bin/xinstall/xinstall.c
167
int ch, no_target;
usr.bin/xinstall/xinstall.c
176
while ((ch = getopt(argc, argv, "B:bCcD:df:g:h:l:M:m:N:o:pSsT:Uv")) !=
usr.bin/xinstall/xinstall.c
178
switch((char)ch) {
usr.bin/xstr/xstr.c
221
int c, ch;
usr.bin/xstr/xstr.c
250
for (tp = tmp; (ch = *tp++); tp++)
usr.bin/xstr/xstr.c
251
if (c == ch) {
usr.sbin/accton/accton.c
44
int ch;
usr.sbin/accton/accton.c
46
while ((ch = getopt(argc, argv, "")) != -1)
usr.sbin/accton/accton.c
47
switch(ch) {
usr.sbin/apmd/apmd.c
636
int ch;
usr.sbin/apmd/apmd.c
641
while ((ch = getopt(ac, av, "df:sv")) != -1) {
usr.sbin/apmd/apmd.c
642
switch (ch) {
usr.sbin/apmd/apmd.c
657
err(1, "unknown option `%c'", ch);
usr.sbin/arp/arp.c
105
int ch, func = 0;
usr.sbin/arp/arp.c
112
while ((ch = getopt(argc, argv, "andfsSi:")) != -1)
usr.sbin/arp/arp.c
113
switch(ch) {
usr.sbin/autofs/automount.c
340
int ch, debug = 0, show_maps = 0;
usr.sbin/autofs/automount.c
350
while ((ch = getopt(argc, argv, "D:Lfco:uv")) != -1) {
usr.sbin/autofs/automount.c
351
switch (ch) {
usr.sbin/autofs/automountd.c
439
int ch, debug = 0, error, maxproc = 30, retval, saved_errno;
usr.sbin/autofs/automountd.c
444
while ((ch = getopt(argc, argv, "D:Tdim:o:v")) != -1) {
usr.sbin/autofs/automountd.c
445
switch (ch) {
usr.sbin/autofs/autounmountd.c
267
int ch, debug = 0, error, kq;
usr.sbin/autofs/autounmountd.c
271
while ((ch = getopt(argc, argv, "dr:t:v")) != -1) {
usr.sbin/autofs/autounmountd.c
272
switch (ch) {
usr.sbin/bhyve/ahci.h
320
#define AHCI_WORK_SIZE (AHCI_CT_OFFSET + AHCI_CT_SIZE * ch->numslots)
usr.sbin/bhyve/amd64/vga.c
259
uint8_t ch, attr, font;
usr.sbin/bhyve/amd64/vga.c
269
ch = sc->vga_ram[offset + 0 * 64*KB];
usr.sbin/bhyve/amd64/vga.c
284
(ch << 5) + y % 16;
usr.sbin/bhyve/amd64/vga.c
287
(ch << 5) + y % 16;
usr.sbin/bhyve/amd64/vga.c
290
font_offset = (ch << 5) + y % 16;
usr.sbin/bhyve/slirp/slirp-helper.c
463
int ch, fd, sd;
usr.sbin/bhyve/slirp/slirp-helper.c
468
while ((ch = getopt(argc, argv, "S:")) != -1) {
usr.sbin/bhyve/slirp/slirp-helper.c
469
switch (ch) {
usr.sbin/bhyve/uart_backend.c
170
rxfifo_putchar(struct uart_softc *sc, uint8_t ch)
usr.sbin/bhyve/uart_backend.c
178
fifo->buf[fifo->windex] = ch;
usr.sbin/bhyve/uart_backend.c
198
uint8_t ch;
usr.sbin/bhyve/uart_backend.c
202
if (ttyread(&sc->tty, &ch) == 0 && sc->tty.is_socket)
usr.sbin/bhyve/uart_backend.c
206
len = ttyread(&sc->tty, &ch);
usr.sbin/bhyve/uart_backend.c
214
rxfifo_putchar(sc, ch);
usr.sbin/bhyve/uart_backend.c
220
uart_rxfifo_putchar(struct uart_softc *sc, uint8_t ch, bool loopback)
usr.sbin/bhyve/uart_backend.c
223
return (rxfifo_putchar(sc, ch));
usr.sbin/bhyve/uart_backend.c
226
if (ttywrite(&sc->tty, ch) == -1 && sc->tty.is_socket)
usr.sbin/bhyve/uart_backend.h
43
int uart_rxfifo_putchar(struct uart_softc *sc, uint8_t ch, bool loopback);
usr.sbin/bhyvectl/bhyvectl.c
329
int action_opts, error, ch, vcpuid;
usr.sbin/bhyvectl/bhyvectl.c
346
while ((ch = getopt_long(argc, argv, "", opts, NULL)) != -1) {
usr.sbin/bhyvectl/bhyvectl.c
347
if (ch >= OPT_START_MD) {
usr.sbin/bhyvectl/bhyvectl.c
348
bhyvectl_handle_opt(opts, ch);
usr.sbin/bhyvectl/bhyvectl.c
352
switch (ch) {
usr.sbin/bhyvectl/bhyvectl.c
379
vm_suspend_opt = (ch == SET_SUSPEND_FILE);
usr.sbin/bhyveload/bhyveload.c
126
cb_putc(void *arg __unused, int ch)
usr.sbin/bhyveload/bhyveload.c
128
char c = ch;
usr.sbin/binmiscctl/binmiscctl.c
283
int ch;
usr.sbin/binmiscctl/binmiscctl.c
294
while ((ch = getopt_long(argc, argv, "epi:m:M:o:s:", add_opts, NULL))
usr.sbin/binmiscctl/binmiscctl.c
297
switch(ch) {
usr.sbin/binmiscctl/binmiscctl.c
336
usage("Unknown argument: '%c'", ch);
usr.sbin/bluetooth/btpand/btpand.c
154
if (ch == 's')
usr.sbin/bluetooth/btpand/btpand.c
79
int ch, status;
usr.sbin/bluetooth/btpand/btpand.c
81
while ((ch = getopt(argc, argv, "a:c:d:i:l:m:p:S:s:")) != -1) {
usr.sbin/bluetooth/btpand/btpand.c
82
switch (ch) {
usr.sbin/bluetooth/hccontrol/le.c
1002
while ((ch = getopt(argc, argv , "a:t:v")) != -1) {
usr.sbin/bluetooth/hccontrol/le.c
1003
switch(ch) {
usr.sbin/bluetooth/hccontrol/le.c
180
int ch;
usr.sbin/bluetooth/hccontrol/le.c
185
while ((ch = getopt(argc, argv , "n:f:u:b:")) != -1) {
usr.sbin/bluetooth/hccontrol/le.c
186
switch(ch){
usr.sbin/bluetooth/hccontrol/le.c
459
int n, ch;
usr.sbin/bluetooth/hccontrol/le.c
472
while ((ch = getopt(argc, argv , "m:M:t:o:p:a:c:f:")) != -1) {
usr.sbin/bluetooth/hccontrol/le.c
473
switch(ch) {
usr.sbin/bluetooth/hccontrol/le.c
593
int n, ch;
usr.sbin/bluetooth/hccontrol/le.c
604
while ((ch = getopt(argc, argv , "v:")) != -1) {
usr.sbin/bluetooth/hccontrol/le.c
605
switch(ch) {
usr.sbin/bluetooth/hccontrol/le.c
650
char ch;
usr.sbin/bluetooth/hccontrol/le.c
666
while ((ch = getopt(argc, argv , "an:v")) != -1) {
usr.sbin/bluetooth/hccontrol/le.c
667
switch(ch) {
usr.sbin/bluetooth/hccontrol/le.c
845
char ch;
usr.sbin/bluetooth/hccontrol/le.c
854
while ((ch = getopt(argc, argv , "t:a:")) != -1) {
usr.sbin/bluetooth/hccontrol/le.c
855
switch(ch) {
usr.sbin/bluetooth/hccontrol/le.c
904
char ch;
usr.sbin/bluetooth/hccontrol/le.c
913
while ((ch = getopt(argc, argv , "t:a:")) != -1) {
usr.sbin/bluetooth/hccontrol/le.c
914
switch(ch) {
usr.sbin/bluetooth/hccontrol/le.c
966
char ch;
usr.sbin/bootparamd/bootparamd/bootparamd.c
190
int ch, pch, fid_len, res = 0;
usr.sbin/bootparamd/bootparamd/bootparamd.c
239
pch = ch = getc(bpf);
usr.sbin/bootparamd/bootparamd/bootparamd.c
240
while ( ! ( ch == '\n' && pch != '\\') && ch != EOF) {
usr.sbin/bootparamd/bootparamd/bootparamd.c
241
pch = ch; ch = getc(bpf);
usr.sbin/bootparamd/bootparamd/bootparamd.c
253
ch = getc(bpf); /* and a character */
usr.sbin/bootparamd/bootparamd/bootparamd.c
262
while (isspace(ch) && ch != '\n') ch = getc(bpf);
usr.sbin/bootparamd/bootparamd/bootparamd.c
264
if ( ch == '\n' ) { /* didn't find it */
usr.sbin/bootparamd/bootparamd/bootparamd.c
267
if ( ch == '\\' ) { /* more info */
usr.sbin/bootparamd/bootparamd/bootparamd.c
268
ch = getc(bpf); /* maybe on next line */
usr.sbin/bootparamd/bootparamd/bootparamd.c
269
if (ch == '\n') continue; /* read it in next loop */
usr.sbin/bootparamd/bootparamd/bootparamd.c
270
ungetc(ch, bpf); ungetc('\\',bpf); /* push the character(s) back */
usr.sbin/bootparamd/bootparamd/bootparamd.c
271
} else ungetc(ch, bpf); /* but who know what a `\` is */
usr.sbin/bootparamd/bootparamd/bootparamd.c
288
int ch, pch;
usr.sbin/bootparamd/bootparamd/bootparamd.c
345
pch = ch = getc(bpf);
usr.sbin/bootparamd/bootparamd/bootparamd.c
346
while ( ! ( ch == '\n' && pch != '\\') && ch != EOF) {
usr.sbin/bootparamd/bootparamd/bootparamd.c
347
pch = ch; ch = getc(bpf);
usr.sbin/bsdinstall/runconsoles/runconsoles.c
597
int ch, status;
usr.sbin/bsdinstall/runconsoles/runconsoles.c
599
while ((ch = getopt_long(argc, argv, "+h", longopts, NULL)) != -1) {
usr.sbin/bsdinstall/runconsoles/runconsoles.c
600
switch (ch) {
usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.c
147
int ch;
usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.c
164
while ((ch = getopt(argc, argv, opts)) != EOF) {
usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.c
165
switch (ch) {
usr.sbin/chown/chown.c
76
int ch, fts_options, rval;
usr.sbin/chown/chown.c
82
while ((ch = getopt(argc, argv, "HLPRfhvx")) != -1)
usr.sbin/chown/chown.c
83
switch (ch) {
usr.sbin/chroot/chroot.c
101
int arg, ch, error, gids;
usr.sbin/chroot/chroot.c
110
while ((ch = getopt(argc, argv, "G:g:u:n")) != -1) {
usr.sbin/chroot/chroot.c
111
switch(ch) {
usr.sbin/ckdist/ckdist.c
226
char ch;
usr.sbin/ckdist/ckdist.c
233
&ch)) != 3 && (!feof(fp) || c != 2)) ||
usr.sbin/ckdist/ckdist.c
234
(c == 3 && ch != '\n') ||
usr.sbin/ckdist/ckdist.c
274
char ch;
usr.sbin/ckdist/ckdist.c
282
if ((c = sscanf(buf, "Pieces = %d%c", &pieces, &ch)) != 2 ||
usr.sbin/ckdist/ckdist.c
283
ch != '\n' || pieces < 1)
usr.sbin/ckdist/ckdist.c
286
&sumlen, &ch)) != 4 &&
usr.sbin/ckdist/ckdist.c
287
(!feof(fp) || c != 3)) || (c == 4 && ch != '\n') ||
usr.sbin/config/main.cc
114
int ch, len;
usr.sbin/config/main.cc
135
while ((ch = getopt(argc, argv, "Cd:gI:mps:Vvx:")) != -1)
usr.sbin/config/main.cc
136
switch (ch) {
usr.sbin/config/main.cc
335
int ch;
usr.sbin/config/main.cc
340
while ((ch = getc(fp)) != EOF)
usr.sbin/config/main.cc
341
if (ch != ' ' && ch != '\t')
usr.sbin/config/main.cc
343
if (ch == EOF)
usr.sbin/config/main.cc
345
if (ch == '\\'){
usr.sbin/config/main.cc
349
if (ch == '\n') {
usr.sbin/config/main.cc
357
line_buf << (char)ch;
usr.sbin/config/main.cc
359
if (ch == '!') {
usr.sbin/config/main.cc
362
while ((ch = getc(fp)) != EOF) {
usr.sbin/config/main.cc
363
if (isspace(ch))
usr.sbin/config/main.cc
365
line_buf << (char)ch;
usr.sbin/config/main.cc
367
if (ch == EOF)
usr.sbin/config/main.cc
369
(void) ungetc(ch, fp);
usr.sbin/config/main.cc
381
int ch;
usr.sbin/config/main.cc
386
while ((ch = getc(fp)) != EOF)
usr.sbin/config/main.cc
387
if (ch != ' ' && ch != '\t')
usr.sbin/config/main.cc
389
if (ch == EOF)
usr.sbin/config/main.cc
391
if (ch == '\\'){
usr.sbin/config/main.cc
395
if (ch == '\n') {
usr.sbin/config/main.cc
403
if (ch == '"' || ch == '\'') {
usr.sbin/config/main.cc
404
int quote = ch;
usr.sbin/config/main.cc
407
while ((ch = getc(fp)) != EOF) {
usr.sbin/config/main.cc
408
if (ch == quote && !escaped_nl)
usr.sbin/config/main.cc
410
if (ch == '\n' && !escaped_nl) {
usr.sbin/config/main.cc
415
if (ch == '\\' && !escaped_nl) {
usr.sbin/config/main.cc
419
if (ch != quote && escaped_nl)
usr.sbin/config/main.cc
421
line_buf << (char)ch;
usr.sbin/config/main.cc
425
line_buf << (char)ch;
usr.sbin/config/main.cc
426
while ((ch = getc(fp)) != EOF) {
usr.sbin/config/main.cc
427
if (isspace(ch))
usr.sbin/config/main.cc
429
line_buf << (char)ch;
usr.sbin/config/main.cc
431
if (ch != EOF)
usr.sbin/config/main.cc
432
(void) ungetc(ch, fp);
usr.sbin/config/main.cc
434
if (ch == EOF)
usr.sbin/cron/cron/do_command.c
263
int ch;
usr.sbin/cron/cron/do_command.c
267
(ch = *input_data) != '\0';
usr.sbin/cron/cron/do_command.c
270
*p = ch;
usr.sbin/cron/cron/do_command.c
272
if (ch == '%' || ch == '\\')
usr.sbin/cron/cron/do_command.c
273
*--p = ch;
usr.sbin/cron/cron/do_command.c
277
if (ch == '\\') {
usr.sbin/cron/cron/do_command.c
281
if (ch == '%') {
usr.sbin/cron/cron/do_command.c
556
int ch;
usr.sbin/cron/cron/do_command.c
575
while ((ch = *input_data++) != '\0') {
usr.sbin/cron/cron/do_command.c
577
if (ch != '%')
usr.sbin/cron/cron/do_command.c
580
if (ch == '%')
usr.sbin/cron/cron/do_command.c
581
ch = '\n';
usr.sbin/cron/cron/do_command.c
584
if (!(escaped = (ch == '\\'))) {
usr.sbin/cron/cron/do_command.c
585
putc(ch, out);
usr.sbin/cron/cron/do_command.c
586
need_newline = (ch != '\n');
usr.sbin/cron/cron/do_command.c
619
int ch;
usr.sbin/cron/cron/do_command.c
628
ch = getc(in);
usr.sbin/cron/cron/do_command.c
629
if (ch != EOF) {
usr.sbin/cron/cron/do_command.c
632
getpid(), ch, ch))
usr.sbin/cron/cron/do_command.c
694
putc(ch, mail);
usr.sbin/cron/cron/do_command.c
702
while (EOF != (ch = getc(in))) {
usr.sbin/cron/cron/do_command.c
705
putc(ch, mail);
usr.sbin/cron/cron/macros.h
93
#define MkLower(ch) (isupper(ch) ? tolower(ch) : ch)
usr.sbin/cron/cron/macros.h
94
#define MkUpper(ch) (islower(ch) ? toupper(ch) : ch)
usr.sbin/cron/crontab/crontab.c
221
int x, ch;
usr.sbin/cron/crontab/crontab.c
227
ch = get_char(in);
usr.sbin/cron/crontab/crontab.c
228
if (EOF == ch)
usr.sbin/cron/crontab/crontab.c
230
if ('#' != ch) {
usr.sbin/cron/crontab/crontab.c
231
putc(ch, out);
usr.sbin/cron/crontab/crontab.c
234
while (EOF != (ch = get_char(in)))
usr.sbin/cron/crontab/crontab.c
235
if (ch == '\n')
usr.sbin/cron/crontab/crontab.c
237
if (EOF == ch)
usr.sbin/cron/crontab/crontab.c
243
if (EOF != ch)
usr.sbin/cron/crontab/crontab.c
244
while (EOF != (ch = get_char(in)))
usr.sbin/cron/crontab/crontab.c
245
putc(ch, out);
usr.sbin/cron/crontab/crontab.c
273
int ch, first;
usr.sbin/cron/crontab/crontab.c
277
first = ch = getchar();
usr.sbin/cron/crontab/crontab.c
278
while (ch != '\n' && ch != EOF)
usr.sbin/cron/crontab/crontab.c
279
ch = getchar();
usr.sbin/cron/crontab/crontab.c
495
int ch, eof;
usr.sbin/cron/crontab/crontab.c
528
while (EOF != (ch = get_char(NewCrontab)))
usr.sbin/cron/crontab/crontab.c
529
putc(ch, tmp);
usr.sbin/cron/lib/entry.c
111
int ch;
usr.sbin/cron/lib/entry.c
121
ch = get_char(file);
usr.sbin/cron/lib/entry.c
122
if (ch == EOF)
usr.sbin/cron/lib/entry.c
137
if (ch == '@') {
usr.sbin/cron/lib/entry.c
154
ch = get_string(cmd, MAX_COMMAND, file, " \t\n");
usr.sbin/cron/lib/entry.c
232
Skip_Blanks(ch, file);
usr.sbin/cron/lib/entry.c
233
if (ch == EOF) {
usr.sbin/cron/lib/entry.c
241
ch = get_list(e->minute, FIRST_MINUTE, LAST_MINUTE,
usr.sbin/cron/lib/entry.c
242
PPC_NULL, ch, file);
usr.sbin/cron/lib/entry.c
243
if (ch == EOF) {
usr.sbin/cron/lib/entry.c
251
ch = get_list(e->hour, FIRST_HOUR, LAST_HOUR,
usr.sbin/cron/lib/entry.c
252
PPC_NULL, ch, file);
usr.sbin/cron/lib/entry.c
253
if (ch == EOF) {
usr.sbin/cron/lib/entry.c
261
if (ch == '*')
usr.sbin/cron/lib/entry.c
263
ch = get_list(e->dom, FIRST_DOM, LAST_DOM,
usr.sbin/cron/lib/entry.c
264
PPC_NULL, ch, file);
usr.sbin/cron/lib/entry.c
265
if (ch == EOF) {
usr.sbin/cron/lib/entry.c
273
ch = get_list(e->month, FIRST_MONTH, LAST_MONTH,
usr.sbin/cron/lib/entry.c
274
MonthNames, ch, file);
usr.sbin/cron/lib/entry.c
275
if (ch == EOF) {
usr.sbin/cron/lib/entry.c
283
if (ch == '*')
usr.sbin/cron/lib/entry.c
285
ch = get_list(e->dow, FIRST_DOW, LAST_DOW,
usr.sbin/cron/lib/entry.c
286
DowNames, ch, file);
usr.sbin/cron/lib/entry.c
287
if (ch == EOF) {
usr.sbin/cron/lib/entry.c
300
unget_char(ch, file);
usr.sbin/cron/lib/entry.c
311
ch = get_string(username, MAX_COMMAND, file, " \t");
usr.sbin/cron/lib/entry.c
314
if (ch == EOF) {
usr.sbin/cron/lib/entry.c
320
Skip_Blanks(ch, file)
usr.sbin/cron/lib/entry.c
321
unget_char(ch, file);
usr.sbin/cron/lib/entry.c
437
ch = get_char(file);
usr.sbin/cron/lib/entry.c
439
while (ch == '-') {
usr.sbin/cron/lib/entry.c
441
switch (ch = get_char(file)) {
usr.sbin/cron/lib/entry.c
463
Debug(DPARS|DEXT, ("load_entry()...invalid option '%c'\n", ch))
usr.sbin/cron/lib/entry.c
467
ch = get_char(file);
usr.sbin/cron/lib/entry.c
468
if (ch!='\t' && ch!=' ') {
usr.sbin/cron/lib/entry.c
473
Skip_Blanks(ch, file)
usr.sbin/cron/lib/entry.c
474
if (ch == EOF || ch == '\n') {
usr.sbin/cron/lib/entry.c
480
unget_char(ch, file);
usr.sbin/cron/lib/entry.c
488
ch = get_string(cmd, MAX_COMMAND, file, "\n");
usr.sbin/cron/lib/entry.c
492
if (ch == EOF) {
usr.sbin/cron/lib/entry.c
515
while (ch != EOF && ch != '\n')
usr.sbin/cron/lib/entry.c
516
ch = get_char(file);
usr.sbin/cron/lib/entry.c
529
get_list(bitstr_t *bits, int low, int high, const char *names[], int ch,
usr.sbin/cron/lib/entry.c
553
ch = get_range(bits, low, high, names, ch, file);
usr.sbin/cron/lib/entry.c
554
if (ch == ',')
usr.sbin/cron/lib/entry.c
555
ch = get_char(file);
usr.sbin/cron/lib/entry.c
562
Skip_Nonblanks(ch, file)
usr.sbin/cron/lib/entry.c
563
Skip_Blanks(ch, file)
usr.sbin/cron/lib/entry.c
565
Debug(DPARS|DEXT, ("get_list()...exiting w/ %02x\n", ch))
usr.sbin/cron/lib/entry.c
567
return ch;
usr.sbin/cron/lib/entry.c
579
get_range(bitstr_t *bits, int low, int high, const char *names[], int ch,
usr.sbin/cron/lib/entry.c
589
if (ch == '*') {
usr.sbin/cron/lib/entry.c
594
ch = get_char(file);
usr.sbin/cron/lib/entry.c
595
if (ch == EOF)
usr.sbin/cron/lib/entry.c
598
if (EOF == (ch = get_number(&num1, low, names, ch, file)))
usr.sbin/cron/lib/entry.c
601
if (ch == '/')
usr.sbin/cron/lib/entry.c
603
else if (ch != '-') {
usr.sbin/cron/lib/entry.c
608
return ch;
usr.sbin/cron/lib/entry.c
612
ch = get_char(file);
usr.sbin/cron/lib/entry.c
613
if (ch == EOF)
usr.sbin/cron/lib/entry.c
618
ch = get_number(&num2, low, names, ch, file);
usr.sbin/cron/lib/entry.c
619
if (ch == EOF)
usr.sbin/cron/lib/entry.c
626
if (ch == '/') {
usr.sbin/cron/lib/entry.c
629
ch = get_char(file);
usr.sbin/cron/lib/entry.c
630
if (ch == EOF)
usr.sbin/cron/lib/entry.c
638
ch = get_number(&num3, 0, PPC_NULL, ch, file);
usr.sbin/cron/lib/entry.c
639
if (ch == EOF || num3 == 0)
usr.sbin/cron/lib/entry.c
656
return ch;
usr.sbin/cron/lib/entry.c
668
get_number(int *numptr, int low, const char *names[], int ch, FILE *file)
usr.sbin/cron/lib/entry.c
678
while (isalnum(ch)) {
usr.sbin/cron/lib/entry.c
682
*pc++ = ch;
usr.sbin/cron/lib/entry.c
684
if (!isdigit(ch))
usr.sbin/cron/lib/entry.c
687
ch = get_char(file);
usr.sbin/cron/lib/entry.c
701
return ch;
usr.sbin/cron/lib/entry.c
712
return ch;
usr.sbin/cron/lib/misc.c
223
int ch;
usr.sbin/cron/lib/misc.c
225
ch = getc(file);
usr.sbin/cron/lib/misc.c
226
if (ch == '\n')
usr.sbin/cron/lib/misc.c
228
return ch;
usr.sbin/cron/lib/misc.c
235
unget_char(int ch, FILE *file)
usr.sbin/cron/lib/misc.c
237
ungetc(ch, file);
usr.sbin/cron/lib/misc.c
238
if (ch == '\n')
usr.sbin/cron/lib/misc.c
252
int ch;
usr.sbin/cron/lib/misc.c
254
while (EOF != (ch = get_char(file)) && !strchr(terms, ch)) {
usr.sbin/cron/lib/misc.c
256
*string++ = (char) ch;
usr.sbin/cron/lib/misc.c
264
return ch;
usr.sbin/cron/lib/misc.c
273
int ch;
usr.sbin/cron/lib/misc.c
275
while (EOF != (ch = get_char(file))) {
usr.sbin/cron/lib/misc.c
279
while (ch == ' ' || ch == '\t')
usr.sbin/cron/lib/misc.c
280
ch = get_char(file);
usr.sbin/cron/lib/misc.c
282
if (ch == EOF)
usr.sbin/cron/lib/misc.c
288
if (ch != '\n' && ch != '#')
usr.sbin/cron/lib/misc.c
295
while (ch != '\n' && ch != EOF)
usr.sbin/cron/lib/misc.c
296
ch = get_char(file);
usr.sbin/cron/lib/misc.c
302
if (ch != EOF)
usr.sbin/cron/lib/misc.c
303
unget_char(ch, file);
usr.sbin/cron/lib/misc.c
515
unsigned char ch = *src++;
usr.sbin/cron/lib/misc.c
517
if (ch < ' ') { /* control character */
usr.sbin/cron/lib/misc.c
519
*dst++ = ch + '@';
usr.sbin/cron/lib/misc.c
520
} else if (ch < 0177) { /* printable */
usr.sbin/cron/lib/misc.c
521
*dst++ = ch;
usr.sbin/cron/lib/misc.c
522
} else if (ch == 0177) { /* delete/rubout */
usr.sbin/cron/lib/misc.c
526
sprintf(dst, "\\%03o", ch);
usr.sbin/crunch/crunchide/crunchide.c
91
int ch, errors;
usr.sbin/crunch/crunchide/crunchide.c
95
while ((ch = getopt(argc, argv, "k:f:v")) != -1)
usr.sbin/crunch/crunchide/crunchide.c
96
switch(ch) {
usr.sbin/ctld/ctld.cc
2662
int debug = 0, ch, error;
usr.sbin/ctld/ctld.cc
2667
while ((ch = getopt(argc, argv, "dtuf:R")) != -1) {
usr.sbin/ctld/ctld.cc
2668
switch (ch) {
usr.sbin/daemon/daemon.c
185
int ch = 0;
usr.sbin/daemon/daemon.c
212
while ((ch = getopt_long(argc, argv, shortopts, longopts, NULL)) != -1) {
usr.sbin/daemon/daemon.c
213
switch (ch) {
usr.sbin/dconschat/dconschat.c
1010
while ((ch = getopt(argc, argv, "a:be:h:rt:u:vwC:G:M:N:RT1")) != -1) {
usr.sbin/dconschat/dconschat.c
1011
switch(ch) {
usr.sbin/dconschat/dconschat.c
472
struct dcons_ch *ch;
usr.sbin/dconschat/dconschat.c
477
ch = &dc->port[port].o;
usr.sbin/dconschat/dconschat.c
481
if (gen == ch->gen && pos == ch->pos)
usr.sbin/dconschat/dconschat.c
484
next_gen = DCONS_NEXT_GEN(ch->gen);
usr.sbin/dconschat/dconschat.c
486
if (gen == ch->gen) {
usr.sbin/dconschat/dconschat.c
487
if (pos > ch->pos)
usr.sbin/dconschat/dconschat.c
489
lost = ch->size * DCONS_GEN_MASK - ch->pos;
usr.sbin/dconschat/dconschat.c
490
ch->pos = 0;
usr.sbin/dconschat/dconschat.c
492
if (pos <= ch->pos)
usr.sbin/dconschat/dconschat.c
494
lost = pos - ch->pos;
usr.sbin/dconschat/dconschat.c
495
ch->pos = pos;
usr.sbin/dconschat/dconschat.c
497
lost = gen - ch->gen;
usr.sbin/dconschat/dconschat.c
502
lost = lost * ch->size - ch->pos;
usr.sbin/dconschat/dconschat.c
503
ch->pos = 0;
usr.sbin/dconschat/dconschat.c
504
ch->gen = gen;
usr.sbin/dconschat/dconschat.c
511
if (gen == ch->gen)
usr.sbin/dconschat/dconschat.c
512
rlen = pos - ch->pos;
usr.sbin/dconschat/dconschat.c
514
rlen = ch->size - ch->pos;
usr.sbin/dconschat/dconschat.c
529
dlen = dread(dc, buf, rlen, ch->buf + ch->pos);
usr.sbin/dconschat/dconschat.c
539
ch->pos += dlen;
usr.sbin/dconschat/dconschat.c
540
if (ch->pos >= ch->size) {
usr.sbin/dconschat/dconschat.c
541
ch->gen = next_gen;
usr.sbin/dconschat/dconschat.c
542
ch->pos = 0;
usr.sbin/dconschat/dconschat.c
544
printf("read_dcons: gen=%d", ch->gen);
usr.sbin/dconschat/dconschat.c
552
struct dcons_ch *ch;
usr.sbin/dconschat/dconschat.c
557
ch = &dc->port[port].i;
usr.sbin/dconschat/dconschat.c
561
ch->gen = ptr >> DCONS_GEN_SHIFT;
usr.sbin/dconschat/dconschat.c
562
ch->pos = ptr & DCONS_POS_MASK;
usr.sbin/dconschat/dconschat.c
565
wlen = MIN(blen, ch->size - ch->pos);
usr.sbin/dconschat/dconschat.c
567
len = dwrite(dc, buf, wlen, ch->buf + ch->pos);
usr.sbin/dconschat/dconschat.c
575
ch->pos += len;
usr.sbin/dconschat/dconschat.c
578
if (ch->pos >= ch->size) {
usr.sbin/dconschat/dconschat.c
579
ch->gen = DCONS_NEXT_GEN(ch->gen);
usr.sbin/dconschat/dconschat.c
580
ch->pos = 0;
usr.sbin/dconschat/dconschat.c
582
printf("write_dcons: gen=%d", ch->gen);
usr.sbin/dconschat/dconschat.c
587
ptr = DCONS_MAKE_PTR(ch);
usr.sbin/dconschat/dconschat.c
995
int i, ch, error;
usr.sbin/devctl/devctl.c
142
int ch;
usr.sbin/devctl/devctl.c
145
while ((ch = getopt(ac, av, "f")) != -1)
usr.sbin/devctl/devctl.c
146
switch (ch) {
usr.sbin/devctl/devctl.c
176
int ch;
usr.sbin/devctl/devctl.c
179
while ((ch = getopt(ac, av, "f")) != -1)
usr.sbin/devctl/devctl.c
180
switch (ch) {
usr.sbin/devctl/devctl.c
246
int ch;
usr.sbin/devctl/devctl.c
249
while ((ch = getopt(ac, av, "f")) != -1)
usr.sbin/devctl/devctl.c
250
switch (ch) {
usr.sbin/devctl/devctl.c
280
int ch;
usr.sbin/devctl/devctl.c
283
while ((ch = getopt(ac, av, "f")) != -1)
usr.sbin/devctl/devctl.c
284
switch (ch) {
usr.sbin/devctl/devctl.c
326
int ch;
usr.sbin/devctl/devctl.c
329
while ((ch = getopt(ac, av, "f")) != -1)
usr.sbin/devctl/devctl.c
330
switch (ch) {
usr.sbin/devctl/devctl.c
400
int ch;
usr.sbin/devctl/devctl.c
403
while ((ch = getopt(ac, av, "d")) != -1)
usr.sbin/devctl/devctl.c
404
switch (ch) {
usr.sbin/diskinfo/diskinfo.c
85
int i, ch, fd, error, exitval = 0;
usr.sbin/diskinfo/diskinfo.c
94
while ((ch = getopt(argc, argv, "cilpsStvw")) != -1) {
usr.sbin/diskinfo/diskinfo.c
95
switch (ch) {
usr.sbin/edquota/edquota.c
111
int eflag = 0, tflag = 0, pflag = 0, ch;
usr.sbin/edquota/edquota.c
123
while ((ch = getopt(argc, argv, "ughtf:p:e:")) != -1) {
usr.sbin/edquota/edquota.c
124
switch(ch) {
usr.sbin/efibootmgr/efibootmgr.c
204
int ch;
usr.sbin/efibootmgr/efibootmgr.c
207
while ((ch = getopt_long(argc, argv,
usr.sbin/efibootmgr/efibootmgr.c
209
switch (ch) {
usr.sbin/efidp/efidp.c
87
int ch;
usr.sbin/efidp/efidp.c
89
while ((ch = getopt_long(argc, argv, "efpu",
usr.sbin/efidp/efidp.c
91
switch (ch) {
usr.sbin/efitable/efitable.c
73
int efi_fd, ch, rc = 1, efi_idx = -1;
usr.sbin/efitable/efitable.c
87
while ((ch = getopt_long(argc, argv, "g:t:u:", longopts, NULL)) != -1) {
usr.sbin/efitable/efitable.c
88
switch (ch) {
usr.sbin/efivar/efivar.c
312
int ch, i;
usr.sbin/efivar/efivar.c
314
while ((ch = getopt_long(argc, argv, "aAbdDf:gHlLNn:OpqRt:uw",
usr.sbin/efivar/efivar.c
316
switch (ch) {
usr.sbin/efiwake/efiwake.c
56
int ch, error, efi_fd;
usr.sbin/efiwake/efiwake.c
61
while ((ch = getopt(argc, argv, "de:")) != -1) {
usr.sbin/efiwake/efiwake.c
62
switch (ch) {
usr.sbin/extattr/rmextattr.c
111
int ch, error, i, arg_counter, attrnamespace, minargc;
usr.sbin/extattr/rmextattr.c
149
while ((ch = getopt(argc, argv, options)) != -1) {
usr.sbin/extattr/rmextattr.c
150
switch (ch) {
usr.sbin/extattr/rmextattr.c
260
for (i = 0; i < ret; i += ch + 1) {
usr.sbin/extattr/rmextattr.c
262
ch = (unsigned char)buf[i];
usr.sbin/extattr/rmextattr.c
264
ch, ch, buf + i + 1);
usr.sbin/extattrctl/extattrctl.c
100
switch (ch) {
usr.sbin/extattrctl/extattrctl.c
93
int ch, i, error, flags;
usr.sbin/extattrctl/extattrctl.c
99
while ((ch = getopt(argc, argv, "fp:r:w:")) != -1)
usr.sbin/fifolog/fifolog_create/fifolog_create.c
52
int ch;
usr.sbin/fifolog/fifolog_create/fifolog_create.c
61
while((ch = getopt(argc, argv, "l:r:s:")) != -1) {
usr.sbin/fifolog/fifolog_create/fifolog_create.c
62
switch (ch) {
usr.sbin/fifolog/fifolog_reader/fifolog_reader.c
103
while ((ch = getopt(argc, argv, "b:B:e:E:o:R:tT:")) != -1) {
usr.sbin/fifolog/fifolog_reader/fifolog_reader.c
104
switch (ch) {
usr.sbin/fifolog/fifolog_reader/fifolog_reader.c
97
int ch, i;
usr.sbin/fstyp/fstyp.c
201
int ch, error, i, nbytes;
usr.sbin/fstyp/fstyp.c
208
while ((ch = getopt(argc, argv, "lsu")) != -1) {
usr.sbin/fstyp/fstyp.c
209
switch (ch) {
usr.sbin/fwcontrol/fwcontrol.c
626
p.astat, p.bstat, p.ch, p.con, p.rxok, p.dis,
usr.sbin/fwcontrol/fwcontrol.c
688
isoreq.ch = ich & 0x3f;
usr.sbin/fwcontrol/fwcontrol.c
736
int fd = -1, ch, len=1024;
usr.sbin/fwcontrol/fwcontrol.c
791
while ((ch = getopt(argc, argv, "M:f:g:m:o:s:b:prtc:d:l:u:R:S:")) != -1) {
usr.sbin/fwcontrol/fwcontrol.c
792
switch(ch) {
usr.sbin/fwcontrol/fwdv.c
125
isoreq.ch = ich & 0x3f;
usr.sbin/fwcontrol/fwdv.c
283
isoreq.ch = ich & 0x3f;
usr.sbin/fwcontrol/fwmpegts.c
180
isoreq.ch = ich & 0x3f;
usr.sbin/getfmac/getfmac.c
63
int ch, hflag;
usr.sbin/getfmac/getfmac.c
68
while ((ch = getopt(argc, argv, "hl:")) != -1) {
usr.sbin/getfmac/getfmac.c
69
switch (ch) {
usr.sbin/getpmac/getpmac.c
63
int ch, error, pid_set;
usr.sbin/getpmac/getpmac.c
68
while ((ch = getopt(argc, argv, "l:p:")) != -1) {
usr.sbin/getpmac/getpmac.c
69
switch (ch) {
usr.sbin/gpioctl/gpioctl.c
219
int pinn, pinv, pin_type, ch;
usr.sbin/gpioctl/gpioctl.c
225
while ((ch = getopt(argc, argv, "cf:lntvNp")) != -1) {
usr.sbin/gpioctl/gpioctl.c
226
switch (ch) {
usr.sbin/gssd/gssd.c
109
int oldmask, ch, debug, jailed;
usr.sbin/gssd/gssd.c
122
while ((ch = getopt(argc, argv, "dhvs:c:r:")) != -1) {
usr.sbin/gssd/gssd.c
123
switch (ch) {
usr.sbin/i2c/i2c.c
744
int fd, error = 0, ch;
usr.sbin/i2c/i2c.c
749
for (ch = 0; ch < N_FDCACHE; ch++)
usr.sbin/i2c/i2c.c
750
fd_cache[ch] = -1;
usr.sbin/i2c/i2c.c
765
while ((ch = getopt(argc, argv, optflags)) != -1) {
usr.sbin/i2c/i2c.c
766
switch(ch) {
usr.sbin/i2c/i2c.c
773
do_what = ch;
usr.sbin/i2c/i2c.c
797
while ((ch = getopt(argc, argv, optflags)) != -1) {
usr.sbin/i2c/i2c.c
798
switch(ch) {
usr.sbin/i2c/i2c.c
853
fprintf(stderr, "Illegal -%c option", ch);
usr.sbin/i2c/i2c.c
905
ch = close(fd);
usr.sbin/i2c/i2c.c
906
assert(ch == 0);
usr.sbin/inetd/inetd.c
2247
CHash *ch = &CHashAry[(hv + i) & CPMHMASK];
usr.sbin/inetd/inetd.c
2250
ch->ch_Family == AF_INET &&
usr.sbin/inetd/inetd.c
2251
sin4->sin_addr.s_addr == ch->ch_Addr4.s_addr &&
usr.sbin/inetd/inetd.c
2252
ch->ch_Service && strcmp(sep->se_service,
usr.sbin/inetd/inetd.c
2253
ch->ch_Service) == 0) {
usr.sbin/inetd/inetd.c
2254
chBest = ch;
usr.sbin/inetd/inetd.c
2259
ch->ch_Family == AF_INET6 &&
usr.sbin/inetd/inetd.c
2261
&ch->ch_Addr6) != 0 &&
usr.sbin/inetd/inetd.c
2262
ch->ch_Service && strcmp(sep->se_service,
usr.sbin/inetd/inetd.c
2263
ch->ch_Service) == 0) {
usr.sbin/inetd/inetd.c
2264
chBest = ch;
usr.sbin/inetd/inetd.c
2268
if (chBest == NULL || ch->ch_LTime == 0 ||
usr.sbin/inetd/inetd.c
2269
ch->ch_LTime < chBest->ch_LTime) {
usr.sbin/inetd/inetd.c
2270
chBest = ch;
usr.sbin/inetd/inetd.c
323
int ch, dofork;
usr.sbin/inetd/inetd.c
343
while ((ch = getopt(argc, argv, "dlwWR:a:c:C:p:s:")) != -1)
usr.sbin/inetd/inetd.c
344
switch(ch) {
usr.sbin/iovctl/iovctl.c
175
int ch, dryrun;
usr.sbin/iovctl/iovctl.c
183
while ((ch = getopt(argc, argv, "Cd:Df:nS")) != -1) {
usr.sbin/iovctl/iovctl.c
184
switch (ch) {
usr.sbin/ip6addrctl/ip6addrctl.c
88
int ch;
usr.sbin/ip6addrctl/ip6addrctl.c
90
while ((ch = getopt(argc, argv, "j:")) != -1) {
usr.sbin/ip6addrctl/ip6addrctl.c
91
switch (ch) {
usr.sbin/iscsid/iscsid.c
152
char *arg, *addr, *ch, *tofree;
usr.sbin/iscsid/iscsid.c
185
for (ch = arg; *ch != '\0'; ch++) {
usr.sbin/iscsid/iscsid.c
186
if (*ch == ':')
usr.sbin/iscsid/iscsid.c
692
int ch, debug = 0, error, iscsi_fd, maxproc = 30, retval, saved_errno,
usr.sbin/iscsid/iscsid.c
700
while ((ch = getopt(argc, argv, "P:dl:m:t:")) != -1) {
usr.sbin/iscsid/iscsid.c
701
switch (ch) {
usr.sbin/jail/jail.c
173
int ch, docf, dying_warned, error, i, oldcl, sysval;
usr.sbin/jail/jail.c
188
while ((ch = getopt(argc, argv, "cCde:f:hiJ:lmn:p:qrRs:u:U:v")) != -1) {
usr.sbin/jail/jail.c
189
switch (ch) {
usr.sbin/jexec/jexec.c
155
while ((ch = getopt(env_argc, env_argv, jexec_args)) != -1) {
usr.sbin/jexec/jexec.c
156
switch (ch) {
usr.sbin/jexec/jexec.c
61
int ch, clean, dflag, uflag, Uflag;
usr.sbin/jexec/jexec.c
70
ch = clean = dflag = uflag = Uflag = 0;
usr.sbin/jexec/jexec.c
74
while ((ch = getopt(argc, argv, jexec_args)) != -1) {
usr.sbin/jexec/jexec.c
75
switch (ch) {
usr.sbin/kbdmap/kbdmap.c
261
char ch;
usr.sbin/kbdmap/kbdmap.c
289
if (sscanf(p, "%dx%d%c", &i, &i, &ch) != 2)
usr.sbin/kbdmap/kbdmap.c
630
char ch = *delim++;
usr.sbin/kbdmap/kbdmap.c
631
if (ch == ',' || ch == '\0') {
usr.sbin/kbdmap/kbdmap.c
635
if (ch == '\0')
usr.sbin/lastlogin/lastlogin.c
82
int ch, i, ulistsize;
usr.sbin/lastlogin/lastlogin.c
89
while ((ch = getopt(argc, argv, "f:rt")) != -1) {
usr.sbin/lastlogin/lastlogin.c
90
switch (ch) {
usr.sbin/lpr/chkprintcap/skimprintcap.c
151
ch = curline;
usr.sbin/lpr/chkprintcap/skimprintcap.c
152
while ((ch <= lastchar) && (*ch != ':') && (*ch != '|'))
usr.sbin/lpr/chkprintcap/skimprintcap.c
153
ch++;
usr.sbin/lpr/chkprintcap/skimprintcap.c
154
ch--; /* last char of queue name */
usr.sbin/lpr/chkprintcap/skimprintcap.c
156
if ((ch - curline) > QENTRY_MAXLEN) {
usr.sbin/lpr/chkprintcap/skimprintcap.c
161
strncat(skim_entryname, curline, (ch - curline
usr.sbin/lpr/chkprintcap/skimprintcap.c
78
char *ch, *curline, *endfield, *lastchar;
usr.sbin/lpr/common_source/ctlinfo.c
899
char *ch;
usr.sbin/lpr/common_source/ctlinfo.c
902
ch = strp;
usr.sbin/lpr/common_source/ctlinfo.c
903
for (ch = strp; *ch != '\0'; ch++) {
usr.sbin/lpr/common_source/ctlinfo.c
904
if (*ch == '\t')
usr.sbin/lpr/filters/lpf.c
115
switch (ch = getc(p)) {
usr.sbin/lpr/filters/lpf.c
118
ch = '\n';
usr.sbin/lpr/filters/lpf.c
148
if ((ch = getchar()) == '\1') {
usr.sbin/lpr/filters/lpf.c
153
ungetc(ch, stdin);
usr.sbin/lpr/filters/lpf.c
154
ch = '\031';
usr.sbin/lpr/filters/lpf.c
158
if (col >= width || (!literal && ch < ' ')) {
usr.sbin/lpr/filters/lpf.c
167
*cp = ch;
usr.sbin/lpr/filters/lpf.c
188
putc(ch, o);
usr.sbin/lpr/filters/lpf.c
71
int ch;
usr.sbin/lpr/lpc/cmds.c
490
int cat_a, cat_b, ch, res, seq_a, seq_b;
usr.sbin/lpr/lpc/cmds.c
507
ch = *(fname_X + 2); \
usr.sbin/lpr/lpc/cmds.c
510
if ((*(fname_X + 1) == 'f') && (isalpha(ch))) { \
usr.sbin/lpr/lpc/cmds.c
511
seq_X = ch; \
usr.sbin/lpr/lpc/cmds.c
521
ch = *jnum_X; \
usr.sbin/lpr/lpc/cmds.c
522
if (!isdigit(ch)) { \
usr.sbin/lpr/lpc/cmds.c
523
if (isalpha(ch)) { \
usr.sbin/lpr/lpc/cmds.c
525
ch = *jnum_X; \
usr.sbin/lpr/lpc/cmds.c
526
seq_X = (seq_X << 8) + ch; \
usr.sbin/lpr/lpc/cmds.c
528
if (!isdigit(ch)) \
usr.sbin/lpr/lpd/recvjob.c
60
#define digit(ch) ((ch) >= '0' && (ch) <= '9')
usr.sbin/lpr/lpq/lpq.c
72
int ch, aflag, lflag;
usr.sbin/lpr/lpq/lpq.c
86
while ((ch = getopt(argc, argv, "alP:")) != -1)
usr.sbin/lpr/lpq/lpq.c
87
switch((char)ch) {
usr.sbin/lpr/pac/pac.c
375
any(int ch, const char str[])
usr.sbin/lpr/pac/pac.c
377
register int c = ch;
usr.sbin/makefs/makefs.c
101
int ch, i, len;
usr.sbin/makefs/makefs.c
128
ch = clock_gettime(CLOCK_REALTIME, &start_time);
usr.sbin/makefs/makefs.c
130
ch = gettimeofday(&start, NULL);
usr.sbin/makefs/makefs.c
134
if (ch == -1)
usr.sbin/makefs/makefs.c
138
while ((ch = getopt(argc, argv, "B:b:Dd:f:F:M:m:N:O:o:pR:s:S:t:T:xZ")) != -1) {
usr.sbin/makefs/makefs.c
139
switch (ch) {
usr.sbin/memcontrol/memcontrol.c
154
int ch;
usr.sbin/memcontrol/memcontrol.c
159
while ((ch = getopt(argc, argv, "ao:")) != -1)
usr.sbin/memcontrol/memcontrol.c
160
switch(ch) {
usr.sbin/memcontrol/memcontrol.c
197
int ch;
usr.sbin/memcontrol/memcontrol.c
204
while ((ch = getopt(argc, argv, "b:l:o:")) != -1)
usr.sbin/memcontrol/memcontrol.c
205
switch(ch) {
usr.sbin/memcontrol/memcontrol.c
259
int ch;
usr.sbin/memcontrol/memcontrol.c
265
while ((ch = getopt(argc, argv, "b:l:o:")) != -1)
usr.sbin/memcontrol/memcontrol.c
266
switch(ch) {
usr.sbin/mfiutil/mfi_config.c
161
int ch, error, fd;
usr.sbin/mfiutil/mfi_config.c
197
ch = getchar();
usr.sbin/mfiutil/mfi_config.c
198
if (ch != 'y' && ch != 'Y') {
usr.sbin/mfiutil/mfi_config.c
561
int ch, verbose;
usr.sbin/mfiutil/mfi_config.c
625
while ((ch = getopt(ac, av, "ds:v")) != -1) {
usr.sbin/mfiutil/mfi_config.c
626
switch (ch) {
usr.sbin/mfiutil/mfi_evt.c
545
int ch, error, fd, num_events, verbose;
usr.sbin/mfiutil/mfi_evt.c
573
while ((ch = getopt(ac, av, "c:l:n:v")) != -1) {
usr.sbin/mfiutil/mfi_evt.c
574
switch (ch) {
usr.sbin/mfiutil/mfi_foreign.c
286
int ch, error, fd;
usr.sbin/mfiutil/mfi_foreign.c
338
ch = getchar();
usr.sbin/mfiutil/mfi_foreign.c
339
if (ch != 'y' && ch != 'Y') {
usr.sbin/mfiutil/mfi_foreign.c
47
int ch, error, fd;
usr.sbin/mfiutil/mfi_foreign.c
60
ch = getchar();
usr.sbin/mfiutil/mfi_foreign.c
61
if (ch != 'y' && ch != 'Y') {
usr.sbin/mfiutil/mfiutil.c
125
int ch, mfi_unit;
usr.sbin/mfiutil/mfiutil.c
138
while ((ch = getopt(ac, av, "D:det:u:")) != -1) {
usr.sbin/mfiutil/mfiutil.c
139
switch (ch) {
usr.sbin/mixer/mixer.c
61
int ch;
usr.sbin/mixer/mixer.c
63
while ((ch = getopt(argc, argv, "ad:f:hos")) != -1) {
usr.sbin/mixer/mixer.c
64
switch (ch) {
usr.sbin/mld6query/mld6.c
103
while ((ch = getopt(argc, argv, "dgr")) != -1) {
usr.sbin/mld6query/mld6.c
104
switch (ch) {
usr.sbin/mld6query/mld6.c
99
int ch;
usr.sbin/mlxcontrol/command.c
121
int ch, i, oargc;
usr.sbin/mlxcontrol/command.c
126
while ((ch = getopt(argc, argv, "")) != -1)
usr.sbin/mlxcontrol/command.c
127
switch(ch) {
usr.sbin/mlxcontrol/command.c
384
int ch, verbosity = 1, i, unit;
usr.sbin/mlxcontrol/command.c
388
while ((ch = getopt(argc, argv, "qv")) != -1)
usr.sbin/mlxcontrol/command.c
389
switch(ch) {
usr.sbin/mlxcontrol/command.c
442
int all = 0, i, ch, unit;
usr.sbin/mlxcontrol/command.c
446
while ((ch = getopt(argc, argv, "a")) != -1)
usr.sbin/mlxcontrol/command.c
447
switch(ch) {
usr.sbin/mlxcontrol/command.c
501
int all = 0, i, ch, unit;
usr.sbin/mlxcontrol/command.c
505
while ((ch = getopt(argc, argv, "a")) != -1)
usr.sbin/mlxcontrol/command.c
506
switch(ch) {
usr.sbin/mlxcontrol/command.c
651
int unit, i, ch, fd, cancel = 0;
usr.sbin/mlxcontrol/command.c
661
while ((ch = getopt(argc, argv, "cd:t:")) != -1)
usr.sbin/mlxcontrol/command.c
662
switch(ch) {
usr.sbin/mlxcontrol/command.c
697
ch = strtol(argv[i], &cp, 0);
usr.sbin/mlxcontrol/command.c
702
mp.mp_which |= (1 << ch);
usr.sbin/mpsutil/mpsutil.c
100
switch (ch) {
usr.sbin/mpsutil/mpsutil.c
95
int ch;
usr.sbin/mpsutil/mpsutil.c
99
while ((ch = getopt(ac, av, "u:h?")) != -1) {
usr.sbin/mptable/mptable.c
173
int ch;
usr.sbin/mptable/mptable.c
180
while ((ch = getopt(argc, argv, "d:g:h:v:")) != -1) {
usr.sbin/mptable/mptable.c
181
switch(ch) {
usr.sbin/mptutil/mpt_config.c
235
int ch, error, fd, i;
usr.sbin/mptutil/mpt_config.c
267
ch = getchar();
usr.sbin/mptutil/mpt_config.c
268
if (ch != 'y' && ch != 'Y') {
usr.sbin/mptutil/mpt_config.c
627
int ch, error, fd, i, quick, raid_type, verbose;
usr.sbin/mptutil/mpt_config.c
667
while ((ch = getopt(ac, av, "dqs:v")) != -1) {
usr.sbin/mptutil/mpt_config.c
668
switch (ch) {
usr.sbin/mptutil/mpt_evt.c
117
while ((ch = getopt(ac, av, "v")) != -1) {
usr.sbin/mptutil/mpt_evt.c
118
switch (ch) {
usr.sbin/mptutil/mpt_evt.c
96
int ch, error, fd, i, num_events, verbose;
usr.sbin/mptutil/mptutil.c
95
int ch;
usr.sbin/mptutil/mptutil.c
97
while ((ch = getopt(ac, av, "u:")) != -1) {
usr.sbin/mptutil/mptutil.c
98
switch (ch) {
usr.sbin/ndp/ndp.c
197
int ch, mode = 0;
usr.sbin/ndp/ndp.c
210
while ((ch = getopt(argc, argv, "acd:f:Ii:nprstA:HPR")) != -1)
usr.sbin/ndp/ndp.c
211
switch (ch) {
usr.sbin/ndp/ndp.c
225
mode = ch;
usr.sbin/ndp/ndp.c
236
mode = ch;
usr.sbin/newsyslog/newsyslog.c
691
int ch;
usr.sbin/newsyslog/newsyslog.c
704
while ((ch = getopt(argc, argv, "a:d:f:nrst:vCD:FI:NPR:S:")) != -1)
usr.sbin/newsyslog/newsyslog.c
705
switch (ch) {
usr.sbin/nfscbd/nfscbd.c
101
int ch, connect_type_cnt, maxsock, msgsock, error;
usr.sbin/nfscbd/nfscbd.c
150
while ((ch = getopt(argc, argv, GETOPT)) != -1)
usr.sbin/nfscbd/nfscbd.c
151
switch (ch) {
usr.sbin/nfsd/nfsd.c
156
int ch, connect_type_cnt, i, maxsock, msgsock;
usr.sbin/nfsd/nfsd.c
186
while ((ch = getopt_long(argc, argv, getopt_shortopts, longopts,
usr.sbin/nfsd/nfsd.c
188
switch (ch) {
usr.sbin/nfsdumpstate/nfsdumpstate.c
69
int ch, openstate;
usr.sbin/nfsdumpstate/nfsdumpstate.c
76
while ((ch = getopt(argc, argv, "ol:")) != -1)
usr.sbin/nfsdumpstate/nfsdumpstate.c
77
switch (ch) {
usr.sbin/ngctl/dot.c
68
int ch;
usr.sbin/ngctl/dot.c
75
while ((ch = getopt(ac, av, "c")) != -1) {
usr.sbin/ngctl/dot.c
76
switch (ch) {
usr.sbin/ngctl/list.c
69
int ch, rtn = CMDRTN_OK;
usr.sbin/ngctl/list.c
74
while ((ch = getopt(ac, av, "ln")) != -1) {
usr.sbin/ngctl/list.c
75
switch (ch) {
usr.sbin/ngctl/main.c
151
int ch, rtn = 0;
usr.sbin/ngctl/main.c
157
while ((ch = getopt(ac, av, "df:j:n:")) != -1) {
usr.sbin/ngctl/main.c
158
switch (ch) {
usr.sbin/ngctl/show.c
66
int ch, no_hooks = 0;
usr.sbin/ngctl/show.c
71
while ((ch = getopt(ac, av, "n")) != -1) {
usr.sbin/ngctl/show.c
72
switch (ch) {
usr.sbin/nghook/main.c
253
char ch, sbuf[100];
usr.sbin/nghook/main.c
269
ch = isprint(buf[count + k]) ?
usr.sbin/nghook/main.c
272
sizeof(sbuf) - strlen(sbuf), "%c", ch);
usr.sbin/nghook/main.c
280
ch = '\n';
usr.sbin/nghook/main.c
281
write(outfd, &ch, 1);
usr.sbin/nghook/main.c
84
int ch;
usr.sbin/nghook/main.c
90
while ((ch = getopt(ac, av, "aedlm:nsS")) != -1) {
usr.sbin/nghook/main.c
91
switch (ch) {
usr.sbin/pciconf/pciconf.c
1082
char *ch;
usr.sbin/pciconf/pciconf.c
1107
if ((ch = strchr(buf, '#')) != NULL)
usr.sbin/pciconf/pciconf.c
1108
*ch = '\0';
usr.sbin/pciconf/pciconf.c
1109
ch = strchr(buf, '\0') - 1;
usr.sbin/pciconf/pciconf.c
1110
while (ch > buf && isspace(*ch))
usr.sbin/pciconf/pciconf.c
1111
*ch-- = '\0';
usr.sbin/pciconf/pciconf.c
1112
if (ch <= buf)
usr.sbin/pkg/pkg.c
1080
signed char ch;
usr.sbin/pkg/pkg.c
1103
while ((ch = getopt_long(argc, argv, "+:dN46", longopts, NULL)) != -1) {
usr.sbin/pkg/pkg.c
1104
switch (ch) {
usr.sbin/pkg/pkg.c
1142
while ((ch = getopt_long(argc, argv, "+:fr:y",
usr.sbin/pkg/pkg.c
1144
switch (ch) {
usr.sbin/pkg/pkg.c
1173
while ((ch = getopt_long(argc, argv, "+:y",
usr.sbin/pkg/pkg.c
1175
switch (ch) {
usr.sbin/pnfsdscopymr/pnfsdscopymr.c
79
int ch, fnd, fndzero, i, migrateit, mirrorcnt, mirrorit, ret;
usr.sbin/pnfsdscopymr/pnfsdscopymr.c
88
while ((ch = getopt_long(argc, argv, "m:r:", longopts, NULL)) != -1) {
usr.sbin/pnfsdscopymr/pnfsdscopymr.c
89
switch (ch) {
usr.sbin/pnfsdsfile/pnfsdsfile.c
73
int ch, dosetxattr, i, mirrorcnt, mirrorit, quiet, zerods, zerofh;
usr.sbin/pnfsdsfile/pnfsdsfile.c
85
while ((ch = getopt_long(argc, argv, "c:m:qr:s:z", longopts, NULL)) !=
usr.sbin/pnfsdsfile/pnfsdsfile.c
87
switch (ch) {
usr.sbin/pnfsdskill/pnfsdskill.c
61
int ch, force;
usr.sbin/pnfsdskill/pnfsdskill.c
66
while ((ch = getopt_long(argc, argv, "f", longopts, NULL)) != -1) {
usr.sbin/pnfsdskill/pnfsdskill.c
67
switch (ch) {
usr.sbin/powerd/powerd.c
105
static void parse_mode(char *arg, int *mode, int ch);
usr.sbin/powerd/powerd.c
523
parse_mode(char *arg, int *mode, int ch)
usr.sbin/powerd/powerd.c
535
errx(1, "bad option: -%c %s", (char)ch, optarg);
usr.sbin/powerd/powerd.c
539
parse_acline_mode(char *arg, int ch)
usr.sbin/powerd/powerd.c
552
errx(1, "bad option: -%c %s", (char)ch, optarg);
usr.sbin/powerd/powerd.c
581
int ch, mode, mode_ac, mode_battery, mode_none, idle, to;
usr.sbin/powerd/powerd.c
600
while ((ch = getopt(argc, argv, "a:b:i:m:M:Nn:p:P:r:s:v")) != -1)
usr.sbin/powerd/powerd.c
601
switch (ch) {
usr.sbin/powerd/powerd.c
603
parse_mode(optarg, &mode_ac, ch);
usr.sbin/powerd/powerd.c
606
parse_mode(optarg, &mode_battery, ch);
usr.sbin/powerd/powerd.c
609
parse_acline_mode(optarg, ch);
usr.sbin/powerd/powerd.c
639
parse_mode(optarg, &mode_none, ch);
usr.sbin/ppp/async.c
194
u_char *ch;
usr.sbin/ppp/async.c
206
ch = MBUF_CTOP(bp);
usr.sbin/ppp/async.c
208
*last = async_Decode(&p->async, *ch++);
usr.sbin/ppp/chat.c
127
chat_NextChar(char *ptr, char ch)
usr.sbin/ppp/chat.c
130
if (*ptr == ch)
usr.sbin/ppp/chat.c
345
char *ptr, *end, *stop, ch;
usr.sbin/ppp/chat.c
367
ch = *stop;
usr.sbin/ppp/chat.c
371
*stop = ch;
usr.sbin/ppp/command.c
414
#define isinword(ch) (isalnum(ch) || (ch) == '_')
usr.sbin/ppp/ipcp.c
101
#define issep(ch) ((ch) == ' ' || (ch) == '\t')
usr.sbin/ppp/ipcp.c
102
#define isip(ch) (((ch) >= '0' && (ch) <= '9') || (ch) == '.')
usr.sbin/ppp/ipcp.c
222
char *cp, *cp_nons, *ncp, ch;
usr.sbin/ppp/ipcp.c
250
ch = *ncp;
usr.sbin/ppp/ipcp.c
254
*ncp = ch;
usr.sbin/ppp/mppe.c
386
char ch;
usr.sbin/ppp/mppe.c
397
ch = '(';
usr.sbin/ppp/mppe.c
399
if ((n = snprintf(buf + len, sizeof buf - len, "%c128", ch)) > 0)
usr.sbin/ppp/mppe.c
401
ch = '/';
usr.sbin/ppp/mppe.c
404
if ((n = snprintf(buf + len, sizeof buf - len, "%c56", ch)) > 0)
usr.sbin/ppp/mppe.c
406
ch = '/';
usr.sbin/ppp/mppe.c
409
if ((n = snprintf(buf + len, sizeof buf - len, "%c40", ch)) > 0)
usr.sbin/ppp/mppe.c
411
ch = '/';
usr.sbin/ppp/prompt.c
189
char ch;
usr.sbin/ppp/prompt.c
243
n = read(p->fd_in, &ch, 1);
usr.sbin/ppp/prompt.c
249
if (ch == '~')
usr.sbin/ppp/prompt.c
252
if (physical_Write(p->TermMode->physical, &ch, n) < 0) {
usr.sbin/ppp/prompt.c
258
switch (ch) {
usr.sbin/ppp/prompt.c
292
if (physical_Write(p->TermMode->physical, &ch, n) < 0) {
usr.sbin/ppp/systems.c
46
#define issep(ch) ((ch) == ' ' || (ch) == '\t')
usr.sbin/prometheus_sysctl_exporter/prometheus_sysctl_exporter.c
576
int ch, error;
usr.sbin/prometheus_sysctl_exporter/prometheus_sysctl_exporter.c
582
while ((ch = getopt(argc, argv, "de:ghi:")) != -1) {
usr.sbin/prometheus_sysctl_exporter/prometheus_sysctl_exporter.c
583
switch (ch) {
usr.sbin/pstat/pstat.c
106
int ch, quit, ret;
usr.sbin/pstat/pstat.c
129
while ((ch = getopt(argc, argv, opts)) != -1)
usr.sbin/pstat/pstat.c
130
switch (ch) {
usr.sbin/pw/pw_group.c
264
int ch;
usr.sbin/pw/pw_group.c
267
while ((ch = getopt(argc, argv, "C:q")) != -1) {
usr.sbin/pw/pw_group.c
268
switch (ch) {
usr.sbin/pw/pw_group.c
296
int ch;
usr.sbin/pw/pw_group.c
315
while ((ch = getopt(argc, argv, "C:qn:g:FPa")) != -1) {
usr.sbin/pw/pw_group.c
316
switch (ch) {
usr.sbin/pw/pw_group.c
373
int ch, rc;
usr.sbin/pw/pw_group.c
384
while ((ch = getopt(argc, argv, "C:qn:g:Y")) != -1) {
usr.sbin/pw/pw_group.c
385
switch (ch) {
usr.sbin/pw/pw_group.c
509
int ch, rc, fd = -1;
usr.sbin/pw/pw_group.c
521
while ((ch = getopt(argc, argv, "C:qn:g:h:H:M:oNPY")) != -1) {
usr.sbin/pw/pw_group.c
522
switch (ch) {
usr.sbin/pw/pw_group.c
601
int ch, rc, fd = -1;
usr.sbin/pw/pw_group.c
613
while ((ch = getopt(argc, argv, "C:qn:d:g:l:h:H:M:m:NPY")) != -1) {
usr.sbin/pw/pw_group.c
614
switch (ch) {
usr.sbin/pw/pw_user.c
1032
int ch;
usr.sbin/pw/pw_user.c
1034
while ((ch = getopt(argc, argv, "Cq")) != -1) {
usr.sbin/pw/pw_user.c
1035
switch (ch) {
usr.sbin/pw/pw_user.c
1055
int ch;
usr.sbin/pw/pw_user.c
1057
while ((ch = getopt(argc, argv, "Cq")) != -1) {
usr.sbin/pw/pw_user.c
1058
switch (ch) {
usr.sbin/pw/pw_user.c
1209
int rc, ch, fd = -1;
usr.sbin/pw/pw_user.c
1231
while ((ch = getopt(argc, argv, args)) != -1) {
usr.sbin/pw/pw_user.c
1232
switch (ch) {
usr.sbin/pw/pw_user.c
1253
cmdcnf->expire_days = validate_expire(optarg, ch);
usr.sbin/pw/pw_user.c
1259
cmdcnf->password_days = validate_expire(optarg, ch);
usr.sbin/pw/pw_user.c
1542
int ch, fd = -1;
usr.sbin/pw/pw_user.c
1564
while ((ch = getopt(argc, argv, args)) != -1) {
usr.sbin/pw/pw_user.c
1565
switch (ch) {
usr.sbin/pw/pw_user.c
624
const char *badchars, *ch, *showtype;
usr.sbin/pw/pw_user.c
627
ch = name;
usr.sbin/pw/pw_user.c
638
if (*ch == '-')
usr.sbin/pw/pw_user.c
642
while (*ch) {
usr.sbin/pw/pw_user.c
643
if (strchr(badchars, *ch) != NULL ||
usr.sbin/pw/pw_user.c
644
(!gecos && *ch < ' ') ||
usr.sbin/pw/pw_user.c
645
*ch == 127) {
usr.sbin/pw/pw_user.c
650
if (!gecos && (*ch & 0x80)) {
usr.sbin/pw/pw_user.c
654
ch++;
usr.sbin/pw/pw_user.c
662
if (*ch == '$' && *(ch + 1) == '\0') {
usr.sbin/pw/pw_user.c
664
ch++;
usr.sbin/pw/pw_user.c
668
snprintf(showch, sizeof(showch), (*ch >= ' ' && *ch < 127)
usr.sbin/pw/pw_user.c
669
? "`%c'" : "0x%02x", *ch);
usr.sbin/pw/pw_user.c
671
showch, (ch - name), showtype);
usr.sbin/pw/pw_user.c
673
if (!gecos && (ch - name) > LOGNAMESIZE)
usr.sbin/pw/pw_user.c
718
int ch;
usr.sbin/pw/pw_user.c
722
while ((ch = getopt(argc, argv, "C:q")) != -1) {
usr.sbin/pw/pw_user.c
723
switch (ch) {
usr.sbin/pw/pw_user.c
758
int ch;
usr.sbin/pw/pw_user.c
772
while ((ch = getopt(argc, argv, "C:qn:u:FPa7")) != -1) {
usr.sbin/pw/pw_user.c
773
switch (ch) {
usr.sbin/pw/pw_user.c
850
int ch, rc;
usr.sbin/pw/pw_user.c
862
while ((ch = getopt(argc, argv, "C:qn:u:rYy:")) != -1) {
usr.sbin/pw/pw_user.c
863
switch (ch) {
usr.sbin/pwd_mkdb/pwd_mkdb.c
112
while ((ch = getopt(argc, argv, "Cd:iNps:u:v")) != -1)
usr.sbin/pwd_mkdb/pwd_mkdb.c
113
switch(ch) {
usr.sbin/pwd_mkdb/pwd_mkdb.c
92
int ch, cnt, ypcnt, makeold, tfd, yp_enabled = 0;
usr.sbin/pwm/pwm.c
78
int action, ch;
usr.sbin/pwm/pwm.c
89
while ((ch = getopt(argc, argv, "f:EDCIp:d:")) != -1) {
usr.sbin/pwm/pwm.c
90
switch (ch) {
usr.sbin/quot/quot.c
479
int ch, cnt;
usr.sbin/quot/quot.c
483
while ((ch = getopt(argc, argv, "acfhkNnv")) != -1) {
usr.sbin/quot/quot.c
484
switch (ch) {
usr.sbin/quotaon/quotaon.c
67
int ch, i, offmode = 0, errs = 0;
usr.sbin/quotaon/quotaon.c
74
while ((ch = getopt(argc, argv, "avug")) != -1) {
usr.sbin/quotaon/quotaon.c
75
switch(ch) {
usr.sbin/repquota/repquota.c
101
int ch, gflag = 0, uflag = 0, errs = 0;
usr.sbin/repquota/repquota.c
104
while ((ch = getopt(argc, argv, "aghnuv")) != -1) {
usr.sbin/repquota/repquota.c
105
switch(ch) {
usr.sbin/route6d/route6d.c
275
int ch;
usr.sbin/route6d/route6d.c
292
while ((ch = getopt(argc, argv, "A:N:O:R:T:L:t:adDhlnp:P:Q:qsS")) != -1) {
usr.sbin/route6d/route6d.c
293
switch (ch) {
usr.sbin/route6d/route6d.c
303
filtertype[nfilter] = ch;
usr.sbin/rpc.lockd/lockd.c
117
int ch, i, s;
usr.sbin/rpc.lockd/lockd.c
130
while ((ch = getopt(argc, argv, "d:Fg:h:p:")) != (-1)) {
usr.sbin/rpc.lockd/lockd.c
131
switch (ch) {
usr.sbin/rpc.statd/statd.c
86
int ch, i, s;
usr.sbin/rpc.statd/statd.c
95
while ((ch = getopt(argc, argv, "dFh:p:")) != -1)
usr.sbin/rpc.statd/statd.c
96
switch (ch) {
usr.sbin/rpc.tlsclntd/rpc.tlsclntd.c
116
int ch;
usr.sbin/rpc.tlsclntd/rpc.tlsclntd.c
137
while ((ch = getopt_long(argc, argv, "2C:D:dl:mp:r:v", longopts,
usr.sbin/rpc.tlsclntd/rpc.tlsclntd.c
139
switch (ch) {
usr.sbin/rpc.tlsservd/rpc.tlsservd.c
140
int ch;
usr.sbin/rpc.tlsservd/rpc.tlsservd.c
178
while ((ch = getopt_long(argc, argv, "2C:D:dhl:N:n:mp:r:uvWw", longopts,
usr.sbin/rpc.tlsservd/rpc.tlsservd.c
180
switch (ch) {
usr.sbin/rpc.umntall/rpc.umntall.c
56
int ch, keep, success, pathlen;
usr.sbin/rpc.umntall/rpc.umntall.c
64
while ((ch = getopt(argc, argv, "h:kp:ve:")) != -1)
usr.sbin/rpc.umntall/rpc.umntall.c
65
switch (ch) {
usr.sbin/rpc.yppasswdd/yppasswdd_main.c
169
int ch;
usr.sbin/rpc.yppasswdd/yppasswdd_main.c
176
while ((ch = getopt(argc, argv, "t:d:p:sfamuivh")) != -1) {
usr.sbin/rpc.yppasswdd/yppasswdd_main.c
177
switch (ch) {
usr.sbin/rpc.ypupdated/ypupdated_main.c
196
int ch;
usr.sbin/rpc.ypupdated/ypupdated_main.c
198
while ((ch = getopt(argc, argv, "p:h")) != -1) {
usr.sbin/rpc.ypupdated/ypupdated_main.c
199
switch (ch) {
usr.sbin/rpc.ypxfrd/ypxfrd_main.c
202
int ch;
usr.sbin/rpc.ypxfrd/ypxfrd_main.c
204
while ((ch = getopt(argc, argv, "p:h")) != -1) {
usr.sbin/rpc.ypxfrd/ypxfrd_main.c
205
switch (ch) {
usr.sbin/rrenumd/rrenumd.c
530
int ch, i, maxfd = 0, send_counter = 0;
usr.sbin/rrenumd/rrenumd.c
541
while ((ch = getopt(argc, argv, "c:sdf"
usr.sbin/rrenumd/rrenumd.c
550
switch (ch) {
usr.sbin/rtadvctl/rtadvctl.c
154
int ch;
usr.sbin/rtadvctl/rtadvctl.c
158
while ((ch = getopt(argc, argv, "Dv")) != -1) {
usr.sbin/rtadvctl/rtadvctl.c
159
switch (ch) {
usr.sbin/rtadvd/rtadvd.c
184
int i, ch;
usr.sbin/rtadvd/rtadvd.c
190
while ((ch = getopt(argc, argv, "c:C:dDfhM:p:Rs")) != -1) {
usr.sbin/rtadvd/rtadvd.c
191
switch (ch) {
usr.sbin/rtsold/rtsol.c
792
int pch = PERIOD, ch = *dn++;
usr.sbin/rtsold/rtsol.c
794
while (ch != '\0') {
usr.sbin/rtsold/rtsol.c
797
if (periodchar(ch)) {
usr.sbin/rtsold/rtsol.c
800
if (!borderchar(ch))
usr.sbin/rtsold/rtsol.c
803
if (!borderchar(ch))
usr.sbin/rtsold/rtsol.c
806
if (!middlechar(ch))
usr.sbin/rtsold/rtsol.c
809
pch = ch, ch = nch;
usr.sbin/rtsold/rtsold.c
124
int ch, error, kq, once, rcvsock, rtsock;
usr.sbin/rtsold/rtsold.c
137
while ((ch = getopt(argc, argv, opts)) != -1) {
usr.sbin/rtsold/rtsold.c
138
switch (ch) {
usr.sbin/sa/main.c
80
int ch, error = 0;
usr.sbin/sa/main.c
84
while ((ch = getopt(argc, argv, "abcdDfijkKlmnP:qrstuU:v:")) != -1)
usr.sbin/sa/main.c
85
switch (ch) {
usr.sbin/services_mkdb/services_mkdb.c
104
byteorder = ch == 'b' ? 4321 : 1234;
usr.sbin/services_mkdb/services_mkdb.c
83
int ch;
usr.sbin/services_mkdb/services_mkdb.c
98
while ((ch = getopt(argc, argv, "blo:qu")) != -1)
usr.sbin/services_mkdb/services_mkdb.c
99
switch (ch) {
usr.sbin/sesutil/sesutil.c
980
int i, ch;
usr.sbin/sesutil/sesutil.c
988
while ((ch = getopt_long(argc, argv, "u:", NULL, NULL)) != -1) {
usr.sbin/sesutil/sesutil.c
989
switch (ch) {
usr.sbin/setaudit/setaudit.c
63
int ch, error;
usr.sbin/setaudit/setaudit.c
74
while ((ch = getopt(argc, argv, "46a:m:p:s:U")) != -1)
usr.sbin/setaudit/setaudit.c
75
switch (ch) {
usr.sbin/setfib/setfib.c
52
int ch;
usr.sbin/setfib/setfib.c
71
while ((ch = getopt(argc, argv, "F:")) != -1) {
usr.sbin/setfib/setfib.c
72
switch (ch) {
usr.sbin/setfmac/setfmac.c
87
int ch, is_setfmac;
usr.sbin/setfmac/setfmac.c
96
while ((ch = getopt(argc, argv, is_setfmac ? "Rhq" : "ef:qs:vx")) !=
usr.sbin/setfmac/setfmac.c
98
switch (ch) {
usr.sbin/snapinfo/snapinfo.c
59
int all = 0, ch, done = 0, fscount, n;
usr.sbin/snapinfo/snapinfo.c
61
while ((ch = getopt(argc, argv, "adv")) != -1) {
usr.sbin/snapinfo/snapinfo.c
62
switch (ch) {
usr.sbin/sndctl/sndctl.c
1018
TAILQ_FOREACH(ch, &dp->chans, next) {
usr.sbin/sndctl/sndctl.c
1022
print_chan_ctl(ch, ctl, true, true);
usr.sbin/sndctl/sndctl.c
291
int enc, ch, ext;
usr.sbin/sndctl/sndctl.c
294
ch = (fmt & 0x07f00000) >> 20;
usr.sbin/sndctl/sndctl.c
301
if (ch) {
usr.sbin/sndctl/sndctl.c
303
":%d.%d", ch - ext, ext);
usr.sbin/sndctl/sndctl.c
316
int enc, ch, samplesz;
usr.sbin/sndctl/sndctl.c
319
ch = (fmt & 0x07f00000) >> 20;
usr.sbin/sndctl/sndctl.c
321
ch += (fmt & 0x08000000) >> 27;
usr.sbin/sndctl/sndctl.c
334
if (!samplesz || !ch)
usr.sbin/sndctl/sndctl.c
337
return (bytes / (samplesz * ch));
usr.sbin/sndctl/sndctl.c
438
struct snd_chan *ch;
usr.sbin/sndctl/sndctl.c
573
if ((ch = calloc(1, sizeof(struct snd_chan))) == NULL)
usr.sbin/sndctl/sndctl.c
576
strlcpy(ch->name, NV(string, NAME), sizeof(ch->name));
usr.sbin/sndctl/sndctl.c
577
strlcpy(ch->parentchan, NV(string, PARENTCHAN),
usr.sbin/sndctl/sndctl.c
578
sizeof(ch->parentchan));
usr.sbin/sndctl/sndctl.c
579
ch->unit = NV(number, UNIT);
usr.sbin/sndctl/sndctl.c
580
ch->direction = (NV(number, CAPS) & PCM_CAP_INPUT) ?
usr.sbin/sndctl/sndctl.c
582
cap2str(ch->caps, sizeof(ch->caps), NV(number, CAPS));
usr.sbin/sndctl/sndctl.c
583
ch->latency = NV(number, LATENCY);
usr.sbin/sndctl/sndctl.c
584
ch->rate = NV(number, RATE);
usr.sbin/sndctl/sndctl.c
585
fmt2str(ch->format, sizeof(ch->format), NV(number, FORMAT));
usr.sbin/sndctl/sndctl.c
586
ch->pid = NV(number, PID);
usr.sbin/sndctl/sndctl.c
587
strlcpy(ch->proc, NV(string, COMM), sizeof(ch->proc));
usr.sbin/sndctl/sndctl.c
588
ch->interrupts = NV(number, INTR);
usr.sbin/sndctl/sndctl.c
589
ch->xruns = NV(number, XRUNS);
usr.sbin/sndctl/sndctl.c
590
ch->feedcount = NV(number, FEEDCNT);
usr.sbin/sndctl/sndctl.c
591
ch->volume = NV(number, LEFTVOL) |
usr.sbin/sndctl/sndctl.c
593
fmt2str(ch->hwbuf.format, sizeof(ch->hwbuf.format),
usr.sbin/sndctl/sndctl.c
595
ch->hwbuf.rate = NV(number, HWBUF_RATE);
usr.sbin/sndctl/sndctl.c
596
ch->hwbuf.size_bytes = NV(number, HWBUF_SIZE);
usr.sbin/sndctl/sndctl.c
597
ch->hwbuf.size_frames =
usr.sbin/sndctl/sndctl.c
598
bytes2frames(ch->hwbuf.size_bytes, NV(number, HWBUF_FORMAT));
usr.sbin/sndctl/sndctl.c
599
ch->hwbuf.blksz = NV(number, HWBUF_BLKSZ);
usr.sbin/sndctl/sndctl.c
600
ch->hwbuf.blkcnt = NV(number, HWBUF_BLKCNT);
usr.sbin/sndctl/sndctl.c
601
ch->hwbuf.free = NV(number, HWBUF_FREE);
usr.sbin/sndctl/sndctl.c
602
ch->hwbuf.ready = NV(number, HWBUF_READY);
usr.sbin/sndctl/sndctl.c
603
fmt2str(ch->swbuf.format, sizeof(ch->swbuf.format),
usr.sbin/sndctl/sndctl.c
605
ch->swbuf.rate = NV(number, SWBUF_RATE);
usr.sbin/sndctl/sndctl.c
606
ch->swbuf.size_bytes = NV(number, SWBUF_SIZE);
usr.sbin/sndctl/sndctl.c
607
ch->swbuf.size_frames =
usr.sbin/sndctl/sndctl.c
608
bytes2frames(ch->swbuf.size_bytes, NV(number, SWBUF_FORMAT));
usr.sbin/sndctl/sndctl.c
609
ch->swbuf.blksz = NV(number, SWBUF_BLKSZ);
usr.sbin/sndctl/sndctl.c
610
ch->swbuf.blkcnt = NV(number, SWBUF_BLKCNT);
usr.sbin/sndctl/sndctl.c
611
ch->swbuf.free = NV(number, SWBUF_FREE);
usr.sbin/sndctl/sndctl.c
612
ch->swbuf.ready = NV(number, SWBUF_READY);
usr.sbin/sndctl/sndctl.c
613
strlcpy(ch->feederchain, NV(string, FEEDERCHAIN),
usr.sbin/sndctl/sndctl.c
614
sizeof(ch->feederchain));
usr.sbin/sndctl/sndctl.c
615
ch->dev = dp;
usr.sbin/sndctl/sndctl.c
618
TAILQ_INSERT_TAIL(&dp->chans, ch, next);
usr.sbin/sndctl/sndctl.c
620
if (!dp->rec.vchans && ch->direction == INPUT) {
usr.sbin/sndctl/sndctl.c
621
strlcpy(dp->rec.format, ch->hwbuf.format,
usr.sbin/sndctl/sndctl.c
623
dp->rec.rate = ch->hwbuf.rate;
usr.sbin/sndctl/sndctl.c
624
} else if (!dp->play.vchans && ch->direction == OUTPUT) {
usr.sbin/sndctl/sndctl.c
625
strlcpy(dp->play.format, ch->hwbuf.format,
usr.sbin/sndctl/sndctl.c
627
dp->play.rate = ch->hwbuf.rate;
usr.sbin/sndctl/sndctl.c
644
struct snd_chan *ch;
usr.sbin/sndctl/sndctl.c
647
ch = TAILQ_FIRST(&dp->chans);
usr.sbin/sndctl/sndctl.c
648
TAILQ_REMOVE(&dp->chans, ch, next);
usr.sbin/sndctl/sndctl.c
649
free(ch);
usr.sbin/sndctl/sndctl.c
691
print_chan_ctl(struct snd_chan *ch, struct snd_ctl *ctl, bool simple,
usr.sbin/sndctl/sndctl.c
700
printf("%s.%s=", ch->name, ctl->name);
usr.sbin/sndctl/sndctl.c
707
xo_emit("{a:%s/%s}\n", ctl->name, (char *)ch + ctl->off);
usr.sbin/sndctl/sndctl.c
710
xo_emit("{a:%s/%d}\n", ctl->name, *(int *)((intptr_t)ch + ctl->off));
usr.sbin/sndctl/sndctl.c
713
v = *(int *)((intptr_t)ch + ctl->off);
usr.sbin/sndctl/sndctl.c
724
print_chan_ctl(ch, cp, simple, showgrp);
usr.sbin/sndctl/sndctl.c
733
struct snd_chan *ch;
usr.sbin/sndctl/sndctl.c
763
TAILQ_FOREACH(ch, &dp->chans, next) {
usr.sbin/sndctl/sndctl.c
766
printf(" %s\n", ch->name);
usr.sbin/sndctl/sndctl.c
768
print_chan_ctl(ch, ctl, oflag, false);
usr.sbin/sndctl/sndctl.c
948
struct snd_chan *ch;
usr.sbin/spi/spi.c
162
int err, ch, hdev, finfo, stream, fdir;
usr.sbin/spi/spi.c
185
while (!err && (ch = getopt(argc, argv, "f:d:m:s:c:C:AbLviSh")) != -1) {
usr.sbin/spi/spi.c
186
switch (ch) {
usr.sbin/spi/spi.c
405
int ch, ch2, ctr, cbcmd, err;
usr.sbin/spi/spi.c
430
ch = hexval(*(ppos++));
usr.sbin/spi/spi.c
431
if (ch < 0 || !*ppos) { /* must be valid pair of hex characters */
usr.sbin/spi/spi.c
442
ch = (ch * 16 + ch2) & 0xff; /* convert to byte */
usr.sbin/spi/spi.c
461
*pcur = reversebits[ch];
usr.sbin/spi/spi.c
463
*pcur = (uint8_t)ch;
usr.sbin/spi/spi.c
545
int ch, ch2, ch3, ncmd, lsb, err;
usr.sbin/spi/spi.c
588
while (!err && cbread < cbdata && (ch = fgetc(stdin)) != EOF) {
usr.sbin/spi/spi.c
592
while (ch <= ' ') {
usr.sbin/spi/spi.c
593
if ((ch = fgetc(stdin)) == EOF)
usr.sbin/spi/spi.c
597
if (ch != EOF) {
usr.sbin/spi/spi.c
598
ch2 = hexval(ch);
usr.sbin/spi/spi.c
603
"Invalid input character '%c'\n", ch);
usr.sbin/spi/spi.c
608
ch = fgetc(stdin);
usr.sbin/spi/spi.c
610
if (ch != EOF) {
usr.sbin/spi/spi.c
611
ch3 = hexval(ch);
usr.sbin/spi/spi.c
616
ch = ch2 * 16 + ch3;
usr.sbin/spi/spi.c
620
if (err || ch == EOF)
usr.sbin/spi/spi.c
626
pdat2[cbread] = reversebits[ch];
usr.sbin/spi/spi.c
628
pdat2[cbread] = (uint8_t) ch;
usr.sbin/spi/spi.c
922
uint8_t ch;
usr.sbin/spi/spi.c
935
ch = ((uint8_t *) pbuf)[idx];
usr.sbin/spi/spi.c
938
ch = reversebits[ch];
usr.sbin/spi/spi.c
940
fprintf(stderr, "%02hhx ", ch);
usr.sbin/spi/spi.c
953
ch = ((uint8_t *) pbuf)[idx];
usr.sbin/spi/spi.c
956
ch = reversebits[ch];
usr.sbin/spi/spi.c
958
if (ch < ' ' || ch > 127)
usr.sbin/spi/spi.c
961
fprintf(stderr, "%c", ch);
usr.sbin/syslogd/syslogd.c
493
int ch, ppipe_w = -1, s;
usr.sbin/syslogd/syslogd.c
500
while ((ch = getopt(argc, argv, "468Aa:b:cCdf:FHkl:M:m:nNoO:p:P:sS:Tuv"))
usr.sbin/syslogd/syslogd.c
502
switch (ch) {
usr.sbin/syslogd/syslogd.c
572
if (ch == 'l')
usr.sbin/syslogd/syslogd.c
574
else if (ch == 'p') {
usr.sbin/tcpdrop/tcpdrop.c
70
int ch, state;
usr.sbin/tcpdrop/tcpdrop.c
78
while ((ch = getopt(argc, argv, "aC:lS:s:")) != -1) {
usr.sbin/tcpdrop/tcpdrop.c
79
switch (ch) {
usr.sbin/tcpsso/tcpsso.c
401
int ch, state;
usr.sbin/tcpsso/tcpsso.c
414
while ((ch = getopt(argc, argv, "aC:i:S:s:")) != -1) {
usr.sbin/tcpsso/tcpsso.c
415
switch (ch) {
usr.sbin/traceroute/traceroute.c
1544
init->ch.chunk_type = SCTP_INITIATION;
usr.sbin/traceroute/traceroute.c
1545
init->ch.chunk_flags = 0;
usr.sbin/traceroute/traceroute.c
1546
init->ch.chunk_length = htons((u_int16_t)(protlen -
usr.sbin/traceroute6/traceroute6.c
1170
init->ch.chunk_type = SCTP_INITIATION;
usr.sbin/traceroute6/traceroute6.c
1171
init->ch.chunk_flags = 0;
usr.sbin/traceroute6/traceroute6.c
1172
init->ch.chunk_length = htons((u_int16_t)(datalen -
usr.sbin/traceroute6/traceroute6.c
352
int ch, i, on = 1, seq, rcvcmsglen, error;
usr.sbin/traceroute6/traceroute6.c
405
while ((ch = getopt(argc, argv, "aA:dEf:g:Ilm:nNp:q:rs:St:TUvw:")) != -1)
usr.sbin/traceroute6/traceroute6.c
406
switch (ch) {
usr.sbin/trim/trim.c
119
for (ch = optind; ch < argc; ch++)
usr.sbin/trim/trim.c
120
if (argv[ch][0] == '-')
usr.sbin/trim/trim.c
59
int ch, error;
usr.sbin/trim/trim.c
68
while ((ch = getopt(argc, argv, "Nfl:o:qr:v")) != -1)
usr.sbin/trim/trim.c
69
switch (ch) {
usr.sbin/trim/trim.c
80
(off_t)usz < 0 || (usz == 0 && ch == 'l'))
usr.sbin/trim/trim.c
83
ch == 'o' ? "offset" : "length",
usr.sbin/trim/trim.c
85
if (ch == 'o')
usr.sbin/uefisign/uefisign.c
122
unsigned char *hex, *tmp, ch;
usr.sbin/uefisign/uefisign.c
133
ch = bin[i];
usr.sbin/uefisign/uefisign.c
134
tmp += sprintf(tmp, "%02x", ch);
usr.sbin/uefisign/uefisign.c
336
int ch, error;
usr.sbin/uefisign/uefisign.c
345
while ((ch = getopt(argc, argv, "Vc:k:o:v")) != -1) {
usr.sbin/uefisign/uefisign.c
346
switch (ch) {
usr.sbin/uhsoctl/uhsoctl.c
1358
int ch, error, mode;
usr.sbin/uhsoctl/uhsoctl.c
1387
while ((ch = getopt(argc, argv, "?ha:p:c:u:k:r:f:dbn")) != -1) {
usr.sbin/uhsoctl/uhsoctl.c
1388
switch (ch) {
usr.sbin/usbconfig/dump.c
364
char *ch;
usr.sbin/usbconfig/dump.c
388
if ((ch = strchr(buf, '#')) != NULL)
usr.sbin/usbconfig/dump.c
389
*ch = '\0';
usr.sbin/usbconfig/dump.c
390
if (ch == buf)
usr.sbin/usbconfig/dump.c
392
ch = strchr(buf, '\0') - 1;
usr.sbin/usbconfig/dump.c
393
while (ch > buf && isspace(*ch))
usr.sbin/usbconfig/dump.c
394
*ch-- = '\0';
usr.sbin/usbconfig/dump.c
395
if (ch <= buf)
usr.sbin/usbconfig/usbconfig.c
557
int ch;
usr.sbin/usbconfig/usbconfig.c
566
while ((ch = getopt(argc, argv, "a:d:hi:lu:v")) != -1) {
usr.sbin/usbconfig/usbconfig.c
567
switch (ch) {
usr.sbin/valectl/valectl.c
365
int ch;
usr.sbin/valectl/valectl.c
374
while ((ch = getopt(argc, argv, "d:a:h:g:l:n:r:C:p:P:m:v")) != -1) {
usr.sbin/valectl/valectl.c
375
switch (ch) {
usr.sbin/valectl/valectl.c
377
fprintf(stderr, "bad option %c %s", ch, optarg);
usr.sbin/vidcontrol/vidcontrol.c
1302
u_int16_t ch;
usr.sbin/vidcontrol/vidcontrol.c
1313
ch = shot.buf[x + (y * shot.xsize)];
usr.sbin/vidcontrol/vidcontrol.c
1314
ch &= 0xff;
usr.sbin/vidcontrol/vidcontrol.c
1316
if (isprint(ch) == 0)
usr.sbin/vidcontrol/vidcontrol.c
1317
ch = ' ';
usr.sbin/vidcontrol/vidcontrol.c
1319
line[x] = (char)ch;
usr.sbin/vipw/vipw.c
57
int ch, pfd, tfd;
usr.sbin/vipw/vipw.c
61
while ((ch = getopt(argc, argv, "d:")) != -1)
usr.sbin/vipw/vipw.c
62
switch (ch) {
usr.sbin/virtual_oss/virtual_bt_speaker/bt_speaker.c
454
int ch;
usr.sbin/virtual_oss/virtual_bt_speaker/bt_speaker.c
460
while ((ch = getopt_long(argc, argv, "p:i:d:Bh", bt_speaker_opts, NULL)) != -1) {
usr.sbin/virtual_oss/virtual_bt_speaker/bt_speaker.c
461
switch (ch) {
usr.sbin/virtual_oss/virtual_oss/compressor.c
50
unsigned ch;
usr.sbin/virtual_oss/virtual_oss/compressor.c
60
for (ch = i = 0; i != samples; i++) {
usr.sbin/virtual_oss/virtual_oss/compressor.c
65
amp = p_ch_gain[ch];
usr.sbin/virtual_oss/virtual_oss/compressor.c
73
p_ch_gain[ch] = amp;
usr.sbin/virtual_oss/virtual_oss/compressor.c
75
if (++ch == maxchan)
usr.sbin/virtual_oss/virtual_oss/compressor.c
76
ch = 0;
usr.sbin/virtual_oss/virtual_oss/format.c
284
format_maximum(const int64_t *src, int64_t *dst, uint32_t ch,
usr.sbin/virtual_oss/virtual_oss/format.c
287
const int64_t *end = src + (samples * ch);
usr.sbin/virtual_oss/virtual_oss/format.c
288
int64_t max[ch];
usr.sbin/virtual_oss/virtual_oss/format.c
295
for (x = 0; x != ch; x++) {
usr.sbin/virtual_oss/virtual_oss/format.c
304
for (x = 0; x != ch; x++) {
usr.sbin/watch/watch.c
283
int ch, res, rv, nread;
usr.sbin/watch/watch.c
295
while ((ch = getopt(ac, av, "Wciotnf:")) != -1)
usr.sbin/watch/watch.c
296
switch (ch) {
usr.sbin/yp_mkdb/yp_mkdb.c
117
while ((ch = getopt(argc, argv, "uhcbsfd:i:o:m:")) != -1) {
usr.sbin/yp_mkdb/yp_mkdb.c
118
switch (ch) {
usr.sbin/yp_mkdb/yp_mkdb.c
98
int ch;
usr.sbin/yppush/yppush_main.c
494
int ch;
usr.sbin/yppush/yppush_main.c
504
while ((ch = getopt(argc, argv, "d:j:p:h:t:v")) != -1) {
usr.sbin/yppush/yppush_main.c
505
switch (ch) {
usr.sbin/ypserv/yp_main.c
449
int ch;
usr.sbin/ypserv/yp_main.c
461
while ((ch = getopt(argc, argv, "dh:np:P:")) != -1) {
usr.sbin/ypserv/yp_main.c
462
switch (ch) {