Lines Matching defs:msc
1 /* $NetBSD: msc.c,v 1.48 2022/10/26 23:55:40 riastradh Exp $ */
96 __KERNEL_RCSID(0, "$NetBSD: msc.c,v 1.48 2022/10/26 23:55:40 riastradh Exp $");
98 #include "msc.h"
129 * of msc devices and the specification of the number of serial
213 #define SWFLAGS(dev) (msc->openflags | (MSCDIALIN(dev) ? 0 : TIOCFLAG_SOFTCAR))
216 CFATTACH_DECL_NEW(msc, 0,
259 struct mscdevice *msc;
273 printf("msc%d: Board initialize failed, bad download code.\n", unit);
277 printf("msc%d: Board successfully initialized.\n", unit);
282 printf("msc%d: Unable to detect crystal frequency.\n", unit);
287 printf("msc%d: Turbo version detected (%02x%02x:%d)\n", unit,
292 printf("msc%d: Normal version detected (%02x%02x:%d)\n", unit,
302 msc = &mscdev[MSCSLOTUL(unit, Count)];
303 msc->board = mscmem;
304 msc->port = Count;
305 msc->flags = 0;
306 msc->openflags = 0;
307 msc->active = 1;
308 msc->unit = unit;
309 msc->closing = false;
331 struct mscdevice *msc;
346 msc = &mscdev[slot];
347 ms = &msc->board->Status[msc->port];
349 if (!msc->active)
384 if (msc->closing) {
386 msc->closing = false;
406 if (msc->openflags & TIOCFLAG_CLOCAL)
408 if (msc->openflags & TIOCFLAG_CRTSCTS)
410 if (msc->openflags & TIOCFLAG_MDMBUF)
431 printf("msc%d: %d open nonblock\n", msc->unit, MSCLINE(dev));
448 printf("msc%d: %d waiting for CD\n", msc->unit, MSCLINE(dev));
460 printf("msc%d: %d got CD\n", msc->unit, MSCLINE(dev));
487 struct mscdevice *msc;
495 msc = &mscdev[slot];
497 if (!msc->active)
500 ms = &msc->board->Status[msc->port];
509 if (msc->flags & TIOCM_DTR)
510 msc->closing = true; /* flush remaining characters before dropping DTR */
575 struct mscdevice *msc;
591 msc = &mscdev[MSCSLOTUL(unit, 0)];
593 newhead = msc->board->Common.CDHead;
594 bufpos = msc->board->Common.CDTail;
598 ocd = msc->board->Common.CDStatus; /* get old status bits */
600 ncd = msc->board->CDBuf[bufpos++]; /* get one event */
608 msc = &mscdev[MSCSLOTUL(unit, i)];
611 printf("msc%d: CD OFF %d\n", unit, msc->port);
613 msc->flags &= ~TIOCM_CD;
623 ms = &msc->board->Status[msc->port];
627 msc->flags &= ~(TIOCM_DTR | TIOCM_RTS);
634 printf("msc%d: CD ON %d\n", unit, msc->port);
636 msc->flags |= TIOCM_CD;
647 msc->board->Common.CDStatus = ocd; /* save new status */
648 msc->board->Common.CDTail = bufpos; /* remove events */
653 msc = &mscdev[slot];
655 if (!msc->active)
659 ms = &msc->board->Status[msc->port];
673 ibuf = &msc->board->InBuf[msc->port][0];
676 cbuf = &msc->board->InCtl[msc->port][0];
690 printf("msc%d: unknown event type %d\n",
691 msc->unit, ibuf[(bufpos-1)&0xff]);
703 printf("msc%d: unknown data type %d\n",
704 msc->unit, cbuf[bufpos]);
744 ibuf = &msc->board->InBuf[msc->port][0];
747 cbuf = &msc->board->InCtl[msc->port][0];
757 printf("msc: unknown event type %d\n",
772 if (msc->closing) {
774 if ( (msc->flags & TIOCM_DTR) == 0) {
776 msc->closing = false;
781 msc->closing = false;
794 struct mscdevice *msc;
804 msc = &mscdev[slot];
806 if (!msc->active)
809 ms = &msc->board->Status[msc->port];
876 msc->openflags = *(int *)data;
878 msc->openflags &=
894 struct mscdevice *msc;
905 msc = &mscdev[slot];
907 if (!msc->active)
910 ms = &msc->board->Status[msc->port];
962 struct mscdevice *msc;
969 msc = &mscdev[slot];
970 if (!msc->active)
972 ms = &msc->board->Status[msc->port];
990 struct mscdevice *msc;
1002 printf("starting msc%d\n", slot);
1019 msc = &mscdev[slot];
1020 ms = &msc->board->Status[msc->port];
1034 cc = q_to_b (&tp->t_outq, msc->tmpbuf, cc);
1039 mob = &msc->board->OutBuf[msc->port][0];
1040 cp = &msc->tmpbuf[0];
1046 msc->tmpbuf[cc] = 0;
1085 struct mscdevice *msc;
1094 msc = &mscdev[MSCSLOT(tp->t_dev)];
1095 ms = &msc->board->Status[msc->port];
1096 printf("stopped output on msc%d\n", MSCSLOT(tp->t_dev));
1111 struct mscdevice *msc;
1124 msc = &mscdev[slot];
1126 if (!msc->active)
1132 OldFlags = msc->flags;
1137 msc->flags = (bits | (msc->flags & ~(TIOCM_DTR | TIOCM_RTS)));
1141 msc->flags &= ~bits;
1145 msc->flags |= bits;
1150 ms = &msc->board->Status[msc->port];
1152 if (msc->flags & TIOCM_RTS) /* was bits & */
1157 if (msc->flags & TIOCM_DTR) /* was bits & */
1168 bits = msc->flags;