Lines Matching defs:msc

1 /*	$NetBSD: msc.c,v 1.43 2011/04/24 16:26:52 rmind Exp $ */
96 __KERNEL_RCSID(0, "$NetBSD: msc.c,v 1.43 2011/04/24 16:26:52 rmind 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,
249 struct mscdevice *msc;
263 printf("msc%d: Board initialize failed, bad download code.\n", unit);
267 printf("msc%d: Board successfully initialized.\n", unit);
272 printf("msc%d: Unable to detect crystal frequency.\n", unit);
277 printf("msc%d: Turbo version detected (%02x%02x:%d)\n", unit,
282 printf("msc%d: Normal version detected (%02x%02x:%d)\n", unit,
292 msc = &mscdev[MSCSLOTUL(unit, Count)];
293 msc->board = mscmem;
294 msc->port = Count;
295 msc->flags = 0;
296 msc->openflags = 0;
297 msc->active = 1;
298 msc->unit = unit;
299 msc->closing = false;
321 struct mscdevice *msc;
336 msc = &mscdev[slot];
337 ms = &msc->board->Status[msc->port];
339 if (!msc->active)
374 if (msc->closing) {
376 msc->closing = false;
396 if (msc->openflags & TIOCFLAG_CLOCAL)
398 if (msc->openflags & TIOCFLAG_CRTSCTS)
400 if (msc->openflags & TIOCFLAG_MDMBUF)
421 printf("msc%d: %d open nonblock\n", msc->unit, MSCLINE(dev));
438 printf("msc%d: %d waiting for CD\n", msc->unit, MSCLINE(dev));
450 printf("msc%d: %d got CD\n", msc->unit, MSCLINE(dev));
477 struct mscdevice *msc;
485 msc = &mscdev[slot];
487 if (!msc->active)
490 ms = &msc->board->Status[msc->port];
499 if (msc->flags & TIOCM_DTR)
500 msc->closing = true; /* flush remaining characters before dropping DTR */
565 struct mscdevice *msc;
581 msc = &mscdev[MSCSLOTUL(unit, 0)];
583 newhead = msc->board->Common.CDHead;
584 bufpos = msc->board->Common.CDTail;
588 ocd = msc->board->Common.CDStatus; /* get old status bits */
590 ncd = msc->board->CDBuf[bufpos++]; /* get one event */
598 msc = &mscdev[MSCSLOTUL(unit, i)];
601 printf("msc%d: CD OFF %d\n", unit, msc->port);
603 msc->flags &= ~TIOCM_CD;
613 ms = &msc->board->Status[msc->port];
617 msc->flags &= ~(TIOCM_DTR | TIOCM_RTS);
624 printf("msc%d: CD ON %d\n", unit, msc->port);
626 msc->flags |= TIOCM_CD;
637 msc->board->Common.CDStatus = ocd; /* save new status */
638 msc->board->Common.CDTail = bufpos; /* remove events */
643 msc = &mscdev[slot];
645 if (!msc->active)
649 ms = &msc->board->Status[msc->port];
663 ibuf = &msc->board->InBuf[msc->port][0];
666 cbuf = &msc->board->InCtl[msc->port][0];
680 printf("msc%d: unknown event type %d\n",
681 msc->unit, ibuf[(bufpos-1)&0xff]);
693 printf("msc%d: unknown data type %d\n",
694 msc->unit, cbuf[bufpos]);
734 ibuf = &msc->board->InBuf[msc->port][0];
737 cbuf = &msc->board->InCtl[msc->port][0];
747 printf("msc: unknown event type %d\n",
762 if (msc->closing) {
764 if ( (msc->flags & TIOCM_DTR) == 0) {
766 msc->closing = false;
771 msc->closing = false;
784 struct mscdevice *msc;
794 msc = &mscdev[slot];
796 if (!msc->active)
799 ms = &msc->board->Status[msc->port];
866 msc->openflags = *(int *)data;
868 msc->openflags &=
884 struct mscdevice *msc;
895 msc = &mscdev[slot];
897 if (!msc->active)
900 ms = &msc->board->Status[msc->port];
952 struct mscdevice *msc;
959 msc = &mscdev[slot];
960 if (!msc->active)
962 ms = &msc->board->Status[msc->port];
980 struct mscdevice *msc;
992 printf("starting msc%d\n", slot);
1009 msc = &mscdev[slot];
1010 ms = &msc->board->Status[msc->port];
1024 cc = q_to_b (&tp->t_outq, msc->tmpbuf, cc);
1029 mob = &msc->board->OutBuf[msc->port][0];
1030 cp = &msc->tmpbuf[0];
1036 msc->tmpbuf[cc] = 0;
1075 struct mscdevice *msc;
1084 msc = &mscdev[MSCSLOT(tp->t_dev)];
1085 ms = &msc->board->Status[msc->port];
1086 printf("stopped output on msc%d\n", MSCSLOT(tp->t_dev));
1101 struct mscdevice *msc;
1114 msc = &mscdev[slot];
1116 if (!msc->active)
1122 OldFlags = msc->flags;
1127 msc->flags = (bits | (msc->flags & ~(TIOCM_DTR | TIOCM_RTS)));
1131 msc->flags &= ~bits;
1135 msc->flags |= bits;
1140 ms = &msc->board->Status[msc->port];
1142 if (msc->flags & TIOCM_RTS) /* was bits & */
1147 if (msc->flags & TIOCM_DTR) /* was bits & */
1158 bits = msc->flags;