Lines Matching refs:ss
117 struct snp_softc *ss = data; in snp_dtor() local
120 tp = ss->snp_tty; in snp_dtor()
123 ttyoutq_free(&ss->snp_outq); in snp_dtor()
125 ss->snp_tty = NULL; in snp_dtor()
128 cv_destroy(&ss->snp_outwait); in snp_dtor()
129 free(ss, M_SNP); in snp_dtor()
139 struct snp_softc *ss; in snp_open() local
142 ss = malloc(sizeof(struct snp_softc), M_SNP, M_WAITOK|M_ZERO); in snp_open()
143 cv_init(&ss->snp_outwait, "snp out"); in snp_open()
145 devfs_set_cdevpriv(ss, snp_dtor); in snp_open()
154 struct snp_softc *ss; in snp_read() local
160 error = devfs_get_cdevpriv((void **)&ss); in snp_read()
164 tp = ss->snp_tty; in snp_read()
170 error = ttyoutq_read_uio(&ss->snp_outq, tp, uio); in snp_read()
179 error = cv_wait_sig(&ss->snp_outwait, tty_getlock(tp)); in snp_read()
195 struct snp_softc *ss; in snp_write() local
200 error = devfs_get_cdevpriv((void **)&ss); in snp_write()
204 tp = ss->snp_tty; in snp_write()
241 struct snp_softc *ss; in snp_ioctl() local
245 error = devfs_get_cdevpriv((void **)&ss); in snp_ioctl()
253 tp = ss->snp_tty; in snp_ioctl()
257 ss->snp_tty = NULL; in snp_ioctl()
258 ttyoutq_free(&ss->snp_outq); in snp_ioctl()
270 error = ttyhook_register(&ss->snp_tty, td->td_proc, in snp_ioctl()
271 *(int *)data, &snp_hook, ss); in snp_ioctl()
277 tp = ss->snp_tty; in snp_ioctl()
279 ttyoutq_setsize(&ss->snp_outq, tp, SNP_OUTPUT_BUFSIZE); in snp_ioctl()
285 if (ss->snp_tty == NULL) in snp_ioctl()
288 *(dev_t *)data = tty_udev(ss->snp_tty); in snp_ioctl()
291 if (ss->snp_tty == NULL) in snp_ioctl()
294 *(uint32_t *)data = tty_udev(ss->snp_tty); /* trunc */ in snp_ioctl()
297 tp = ss->snp_tty; in snp_ioctl()
303 *(int *)data = ttyoutq_bytesused(&ss->snp_outq); in snp_ioctl()
317 struct snp_softc *ss; in snp_poll() local
321 if (devfs_get_cdevpriv((void **)&ss) != 0) in snp_poll()
328 tp = ss->snp_tty; in snp_poll()
331 if (ttyoutq_bytesused(&ss->snp_outq) > 0) in snp_poll()
338 selrecord(td, &ss->snp_outpoll); in snp_poll()
368 struct snp_softc *ss = ttyhook_softc(tp); in snp_getc_capture() local
370 ttyoutq_write(&ss->snp_outq, buf, len); in snp_getc_capture()
372 cv_broadcast(&ss->snp_outwait); in snp_getc_capture()
373 selwakeup(&ss->snp_outpoll); in snp_getc_capture()