Lines Matching refs:com
148 #define CE_RECORD(com, errnum) (++(com)->delta_error_counts[errnum]) argument
234 static void cd1400_channel_cmd(struct com_s *com, int cmd);
235 static void cd1400_channel_cmd_wait(struct com_s *com);
236 static void cd_etc(struct com_s *com, int etc);
237 static int cd_getreg(struct com_s *com, int reg);
238 static void cd_setreg(struct com_s *com, int reg, int val);
239 static void cyinput(struct com_s *com);
243 static int cysetwater(struct com_s *com, speed_t speed);
249 struct com_s *com);
386 struct com_s *com; in cyattach_common() local
389 com = malloc(sizeof *com, M_DEVBUF, M_NOWAIT | M_ZERO); in cyattach_common()
390 if (com == NULL) in cyattach_common()
392 com->unit = unit; in cyattach_common()
393 com->gfrcr_image = firmware_version; in cyattach_common()
395 com->mcr_dtr = CD1400_MSVR1_RTS; in cyattach_common()
396 com->mcr_rts = CD1400_MSVR2_DTR; in cyattach_common()
397 com->mcr_rts_reg = CD1400_MSVR2; in cyattach_common()
399 com->mcr_dtr = CD1400_MSVR2_DTR; in cyattach_common()
400 com->mcr_rts = CD1400_MSVR1_RTS; in cyattach_common()
401 com->mcr_rts_reg = CD1400_MSVR1; in cyattach_common()
403 com->obufs[0].l_head = com->obuf1; in cyattach_common()
404 com->obufs[1].l_head = com->obuf2; in cyattach_common()
406 com->cy_align = cy_align; in cyattach_common()
407 com->cy_iobase = cy_iobase; in cyattach_common()
408 com->iobase = iobase; in cyattach_common()
409 com->car = ~CD1400_CAR_CHAN; in cyattach_common()
411 tp = com->tp = ttyalloc(); in cyattach_common()
419 tp->t_sc = com; in cyattach_common()
421 if (cysetwater(com, tp->t_init_in.c_ispeed) != 0) { in cyattach_common()
422 free(com, M_DEVBUF); in cyattach_common()
427 cy_addr(unit) = com; in cyattach_common()
450 struct com_s *com; in cyopen() local
453 com = tp->t_sc; in cyopen()
461 cd_setreg(com, CD1400_LIVR, in cyopen()
462 (com->unit & CD1400_xIVR_CHAN) << CD1400_xIVR_CHAN_SHIFT); in cyopen()
469 cd1400_channel_cmd(com, in cyopen()
471 cd1400_channel_cmd(com, com->channel_control); in cyopen()
475 com->prev_modem_status = com->last_modem_status in cyopen()
476 = cd_getreg(com, CD1400_MSVR2); in cyopen()
477 cd_setreg(com, CD1400_SRER, in cyopen()
478 com->intr_enable in cyopen()
491 struct com_s *com; in cyclose() local
495 com = tp->t_sc; in cyclose()
496 unit = com->unit; in cyclose()
497 iobase = com->iobase; in cyclose()
502 com->etc = ETC_NONE; in cyclose()
503 cd_setreg(com, CD1400_COR2, com->cor[1] &= ~CD1400_COR2_ETC); in cyclose()
506 cd_etc(com, CD1400_ETC_STOPBREAK); in cyclose()
507 cd1400_channel_cmd(com, CD1400_CCR_CMDRESET | CD1400_CCR_FTF); in cyclose()
512 cd_setreg(com, CD1400_SRER, com->intr_enable = 0); in cyclose()
515 tp = com->tp; in cyclose()
525 && !(com->prev_modem_status & CD1400_MSVR2_CD) in cyclose()
531 com->channel_control = CD1400_CCR_CMDCHANCTL in cyclose()
534 cd1400_channel_cmd(com, com->channel_control); in cyclose()
551 cyinput(struct com_s *com) in cyinput() argument
559 buf = com->ibuf; in cyinput()
560 tp = com->tp; in cyinput()
562 cy_events -= (com->iptr - com->ibuf); in cyinput()
563 com->iptr = com->ibuf; in cyinput()
583 incc = com->iptr - buf; in cyinput()
585 && (com->state & CS_RTS_IFLOW in cyinput()
589 com->delta_error_counts[CE_TTY_BUF_OVERFLOW] in cyinput()
605 } while (buf < com->iptr); in cyinput()
615 line_status = buf[com->ierroff]; in cyinput()
631 } while (buf < com->iptr); in cyinput()
633 cy_events -= (com->iptr - com->ibuf); in cyinput()
634 com->iptr = com->ibuf; in cyinput()
641 if ((com->state & CS_RTS_IFLOW) && !(com->mcr_image & com->mcr_rts) && in cyinput()
643 cd_setreg(com, com->mcr_rts_reg, in cyinput()
644 com->mcr_image |= com->mcr_rts); in cyinput()
680 struct com_s *com; in cyintr() local
699 com = cy_addr(baseu in cyintr()
706 com = cy_addr(baseu + in cyintr()
712 ++com->recv_exception; in cyintr()
718 && com->tp->t_hotchar != 0) in cyintr()
729 if ( com->tp == NULL in cyintr()
730 || !(com->tp->t_state & TS_ISOPEN) in cyintr()
732 && (com->tp->t_iflag & IGNPAR)) in cyintr()
734 && (com->tp->t_iflag & IGNBRK))) in cyintr()
737 && (com->tp->t_state & TS_CAN_BYPASS_L_RINT) in cyintr()
740 && (com->tp->t_iflag & INPCK)))) in cyintr()
744 ++com->bytes_in; in cyintr()
746 if (com->tp->t_hotchar != 0 && recv_data == com->tp->t_hotchar) in cyintr()
749 ioptr = com->iptr; in cyintr()
750 if (ioptr >= com->ibufend) in cyintr()
751 CE_RECORD(com, CE_INTERRUPT_BUF_OVERFLOW); in cyintr()
753 if (com->tp != NULL && com->tp->t_do_timestamp) in cyintr()
754 microtime(&com->tp->t_timestamp); in cyintr()
757 ioptr[com->ierroff] = line_status; in cyintr()
758 com->iptr = ++ioptr; in cyintr()
759 if (ioptr == com->ihighwater in cyintr()
760 && com->state & CS_RTS_IFLOW) in cyintr()
761 cd_outb(iobase, com->mcr_rts_reg, in cyintr()
763 com->mcr_image &= in cyintr()
764 ~com->mcr_rts); in cyintr()
766 CE_RECORD(com, CE_OVERRUN); in cyintr()
775 com->bytes_in += count; in cyintr()
776 ioptr = com->iptr; in cyintr()
777 ifree = com->ibufend - ioptr; in cyintr()
782 if (com->tp != NULL && com->tp->t_do_timestamp) in cyintr()
783 microtime(&com->tp->t_timestamp); in cyintr()
789 if (com->tp->t_hotchar != 0 in cyintr()
791 == com->tp->t_hotchar) in cyintr()
796 ioptr[com->ierroff] = 0; in cyintr()
800 com->delta_error_counts in cyintr()
806 if (com->tp->t_hotchar != 0 in cyintr()
807 && recv_data == com->tp->t_hotchar) in cyintr()
812 if (com->tp != NULL && com->tp->t_do_timestamp) in cyintr()
813 microtime(&com->tp->t_timestamp); in cyintr()
814 if (ioptr <= com->ihighwater in cyintr()
815 && ioptr + count > com->ihighwater in cyintr()
816 && com->state & CS_RTS_IFLOW) in cyintr()
817 cd_outb(iobase, com->mcr_rts_reg, in cyintr()
819 com->mcr_image in cyintr()
820 &= ~com->mcr_rts); in cyintr()
826 if (com->tp->t_hotchar != 0 in cyintr()
827 && recv_data == com->tp->t_hotchar) in cyintr()
831 ioptr[com->ierroff] = 0; in cyintr()
835 com->iptr = ioptr; in cyintr()
849 struct com_s *com; in cyintr() local
865 com = cy_addr(baseu + cyu * CD1400_NO_OF_CHANNELS in cyintr()
871 com = cy_addr(baseu in cyintr()
875 ++com->mdm; in cyintr()
877 if (modem_status != com->last_modem_status) { in cyintr()
884 com->last_modem_status = modem_status; in cyintr()
885 if (!(com->state & CS_CHECKMSR)) { in cyintr()
887 com->state |= CS_CHECKMSR; in cyintr()
893 if (com->state & CS_CTS_OFLOW) { in cyintr()
895 com->state |= CS_ODEVREADY; in cyintr()
896 if (com->state >= (CS_BUSY | CS_TTGO in cyintr()
898 && !(com->intr_enable in cyintr()
902 com->intr_enable in cyintr()
903 = com->intr_enable in cyintr()
907 com->state &= ~CS_ODEVREADY; in cyintr()
908 if (com->intr_enable in cyintr()
912 com->intr_enable in cyintr()
913 = com->intr_enable in cyintr()
931 struct com_s *com; in cyintr() local
946 com = cy_addr(baseu in cyintr()
953 com = cy_addr(baseu in cyintr()
958 if (com->etc != ETC_NONE) { in cyintr()
959 if (com->intr_enable & CD1400_SRER_TXRDY) { in cyintr()
966 com->intr_enable in cyintr()
967 = (com->intr_enable in cyintr()
972 switch (com->etc) { in cyintr()
981 com->cor[1] |= CD1400_COR2_ETC); in cyintr()
985 com->etc); in cyintr()
986 if (com->etc == CD1400_ETC_SENDBREAK) in cyintr()
987 com->etc = ETC_BREAK_STARTING; in cyintr()
989 com->etc = ETC_BREAK_ENDING; in cyintr()
997 com->etc = ETC_BREAK_STARTED; in cyintr()
1013 com->cor[1] in cyintr()
1015 com->etc = ETC_BREAK_ENDED; in cyintr()
1016 if (!(com->state & CS_ODONE)) { in cyintr()
1018 com->state |= CS_ODONE; in cyintr()
1029 if (com->intr_enable & CD1400_SRER_TXMPTY) { in cyintr()
1030 if (!(com->extra_state & CSE_ODONE)) { in cyintr()
1032 com->extra_state |= CSE_ODONE; in cyintr()
1036 com->intr_enable in cyintr()
1040 if (com->state >= (CS_BUSY | CS_TTGO | CS_ODEVREADY)) { in cyintr()
1044 ioptr = com->obufq.l_head; in cyintr()
1045 ocount = com->obufq.l_tail - ioptr; in cyintr()
1048 com->bytes_out += ocount; in cyintr()
1053 com->obufq.l_head = ioptr; in cyintr()
1054 if (ioptr >= com->obufq.l_tail) { in cyintr()
1057 qp = com->obufq.l_next; in cyintr()
1061 com->obufq.l_head = qp->l_head; in cyintr()
1062 com->obufq.l_tail = qp->l_tail; in cyintr()
1063 com->obufq.l_next = qp; in cyintr()
1066 com->state &= ~CS_BUSY; in cyintr()
1075 if (com->extra_state & CSE_ODONE) { in cyintr()
1077 com->extra_state &= ~CSE_ODONE; in cyintr()
1081 com->intr_enable in cyintr()
1082 = (com->intr_enable in cyintr()
1086 if (!(com->state & CS_ODONE)) { in cyintr()
1088 com->state |= CS_ODONE; in cyintr()
1120 struct com_s *com; in cybreak() local
1122 com = tp->t_sc; in cybreak()
1124 cd_etc(com, CD1400_ETC_SENDBREAK); in cybreak()
1126 cd_etc(com, CD1400_ETC_STOPBREAK); in cybreak()
1141 struct com_s *com; in cypoll() local
1145 com = cy_addr(unit); in cypoll()
1146 if (com == NULL) in cypoll()
1148 tp = com->tp; in cypoll()
1157 incc = com->iptr - com->ibuf; in cypoll()
1158 com->iptr = com->ibuf; in cypoll()
1159 if (com->state & CS_CHECKMSR) { in cypoll()
1161 com->state &= ~CS_CHECKMSR; in cypoll()
1172 if (com->iptr != com->ibuf) { in cypoll()
1175 cyinput(com); in cypoll()
1179 if (com->state & CS_CHECKMSR) { in cypoll()
1184 cyinput(com); in cypoll()
1185 delta_modem_status = com->last_modem_status in cypoll()
1186 ^ com->prev_modem_status; in cypoll()
1187 com->prev_modem_status = com->last_modem_status; in cypoll()
1189 com->state &= ~CS_CHECKMSR; in cypoll()
1194 com->prev_modem_status & CD1400_MSVR2_CD); in cypoll()
1196 if (com->extra_state & CSE_ODONE) { in cypoll()
1200 com->extra_state &= ~CSE_ODONE; in cypoll()
1203 if (!(com->state & CS_BUSY)) { in cypoll()
1205 ttwwakeup(com->tp); in cypoll()
1207 if (com->etc != ETC_NONE) { in cypoll()
1208 if (com->etc == ETC_BREAK_ENDED) in cypoll()
1209 com->etc = ETC_NONE; in cypoll()
1210 wakeup(&com->etc); in cypoll()
1213 if (com->state & CS_ODONE) { in cypoll()
1217 com->state &= ~CS_ODONE; in cypoll()
1234 struct com_s *com; in cyparam() local
1246 com = tp->t_sc; in cyparam()
1249 cy_clock = CY_CLOCK(com->gfrcr_image); in cyparam()
1265 (void) cysetwater(com, t->c_ispeed); in cyparam()
1269 cd_setreg(com, CD1400_RBPR, idivisor); in cyparam()
1270 cd_setreg(com, CD1400_RCOR, iprescaler); in cyparam()
1271 cd_setreg(com, CD1400_TBPR, odivisor); in cyparam()
1272 cd_setreg(com, CD1400_TCOR, oprescaler); in cyparam()
1282 if (opt != com->channel_control) { in cyparam()
1283 com->channel_control = opt; in cyparam()
1284 cd1400_channel_cmd(com, opt); in cyparam()
1291 cd_setreg(com, CD1400_SCHR1, t->c_cc[VSTOP]); in cyparam()
1293 cd_setreg(com, CD1400_SCHR2, t->c_cc[VSTART]); in cyparam()
1295 cd_setreg(com, CD1400_SCHR3, t->c_cc[VINTR]); in cyparam()
1297 cd_setreg(com, CD1400_SCHR4, t->c_cc[VSUSP]); in cyparam()
1342 if (opt != com->cor[0]) { in cyparam()
1344 cd_setreg(com, CD1400_COR1, com->cor[0] = opt); in cyparam()
1363 cd_setreg(com, CD1400_RTPR, itimeout); in cyparam()
1382 if (opt != com->cor[1]) { in cyparam()
1384 cd_setreg(com, CD1400_COR2, com->cor[1] = opt); in cyparam()
1402 if (opt != com->cor[2]) { in cyparam()
1404 cd_setreg(com, CD1400_COR3, com->cor[2] = opt); in cyparam()
1409 cd1400_channel_cmd(com, CD1400_CCR_CMDCORCHG | cor_change); in cyparam()
1452 cd_setreg(com, CD1400_COR4, opt); in cyparam()
1469 cd_setreg(com, CD1400_COR5, opt); in cyparam()
1491 cd_setreg(com, CD1400_MCOR1, opt); in cyparam()
1502 cd_setreg(com, CD1400_MCOR2, opt); in cyparam()
1511 com->state &= ~CS_TTGO; in cyparam()
1513 com->state |= CS_TTGO; in cyparam()
1515 com->state |= CS_RTS_IFLOW; in cyparam()
1522 } else if (com->state & CS_RTS_IFLOW) { in cyparam()
1523 com->state &= ~CS_RTS_IFLOW; in cyparam()
1528 cd_setreg(com, com->mcr_rts_reg, in cyparam()
1529 com->mcr_image |= com->mcr_rts); in cyparam()
1537 com->state |= CS_ODEVREADY; in cyparam()
1539 com->state &= ~CS_CTS_OFLOW; in cyparam()
1541 com->state |= CS_CTS_OFLOW; in cyparam()
1542 if (!(com->last_modem_status & CD1400_MSVR2_CTS)) in cyparam()
1543 com->state &= ~CS_ODEVREADY; in cyparam()
1547 disc_optim(tp, t, com); in cyparam()
1554 if (com->state >= (CS_BUSY | CS_TTGO)) in cyparam()
1555 cyintr1(com); in cyparam()
1557 if (com->state >= (CS_BUSY | CS_TTGO | CS_ODEVREADY)) { in cyparam()
1558 if (!(com->intr_enable & CD1400_SRER_TXRDY)) in cyparam()
1559 cd_setreg(com, CD1400_SRER, in cyparam()
1560 com->intr_enable in cyparam()
1561 = (com->intr_enable & ~CD1400_SRER_TXMPTY) in cyparam()
1564 if (com->intr_enable & CD1400_SRER_TXRDY) in cyparam()
1565 cd_setreg(com, CD1400_SRER, in cyparam()
1566 com->intr_enable in cyparam()
1567 = (com->intr_enable & ~CD1400_SRER_TXRDY) in cyparam()
1575 if (com->ibufold != NULL) { in cyparam()
1576 free(com->ibufold, M_DEVBUF); in cyparam()
1577 com->ibufold = NULL; in cyparam()
1583 cysetwater(struct com_s *com, speed_t speed) in cysetwater() argument
1599 if (ibufsize == com->ibufsize) { in cysetwater()
1613 com->ibufold = com->ibuf; in cysetwater()
1614 com->ibufsize = ibufsize; in cysetwater()
1615 tp = com->tp; in cysetwater()
1628 if (com->iptr != com->ibuf) in cysetwater()
1629 cyinput(com); in cysetwater()
1642 com->iptr = com->ibuf = ibuf; in cysetwater()
1643 com->ibufend = ibuf + ibufsize; in cysetwater()
1644 com->ierroff = ibufsize; in cysetwater()
1645 com->ihighwater = ibuf + 3 * ibufsize / 4; in cysetwater()
1655 struct com_s *com; in cystart() local
1661 com = tp->t_sc; in cystart()
1665 ++com->start_count; in cystart()
1672 com->state &= ~CS_TTGO; in cystart()
1673 if (com->intr_enable & CD1400_SRER_TXRDY) in cystart()
1674 cd_setreg(com, CD1400_SRER, in cystart()
1675 com->intr_enable in cystart()
1676 = (com->intr_enable & ~CD1400_SRER_TXRDY) in cystart()
1679 com->state |= CS_TTGO; in cystart()
1680 if (com->state >= (CS_BUSY | CS_TTGO | CS_ODEVREADY) in cystart()
1681 && !(com->intr_enable & CD1400_SRER_TXRDY)) in cystart()
1682 cd_setreg(com, CD1400_SRER, in cystart()
1683 com->intr_enable in cystart()
1684 = (com->intr_enable & ~CD1400_SRER_TXMPTY) in cystart()
1688 if (com->mcr_image & com->mcr_rts && com->state & CS_RTS_IFLOW) in cystart()
1690 outb(com->modem_ctl_port, com->mcr_image &= ~CD1400_MSVR1_RTS); in cystart()
1692 cd_setreg(com, com->mcr_rts_reg, in cystart()
1693 com->mcr_image &= ~com->mcr_rts); in cystart()
1696 if (!(com->mcr_image & com->mcr_rts) in cystart()
1697 && com->iptr < com->ihighwater in cystart()
1698 && com->state & CS_RTS_IFLOW) in cystart()
1700 outb(com->modem_ctl_port, com->mcr_image |= CD1400_MSVR1_RTS); in cystart()
1702 cd_setreg(com, com->mcr_rts_reg, in cystart()
1703 com->mcr_image |= com->mcr_rts); in cystart()
1717 if (!com->obufs[0].l_queued) { in cystart()
1721 com->obufs[0].l_tail in cystart()
1722 = com->obuf1 + q_to_b(&tp->t_outq, com->obuf1, in cystart()
1723 sizeof com->obuf1); in cystart()
1724 com->obufs[0].l_next = NULL; in cystart()
1725 com->obufs[0].l_queued = TRUE; in cystart()
1728 if (com->state & CS_BUSY) { in cystart()
1729 qp = com->obufq.l_next; in cystart()
1732 qp->l_next = &com->obufs[0]; in cystart()
1734 com->obufq.l_head = com->obufs[0].l_head; in cystart()
1735 com->obufq.l_tail = com->obufs[0].l_tail; in cystart()
1736 com->obufq.l_next = &com->obufs[0]; in cystart()
1737 com->state |= CS_BUSY; in cystart()
1738 if (com->state >= (CS_BUSY | CS_TTGO in cystart()
1740 cd_setreg(com, CD1400_SRER, in cystart()
1741 com->intr_enable in cystart()
1742 = (com->intr_enable in cystart()
1749 if (tp->t_outq.c_cc != 0 && !com->obufs[1].l_queued) { in cystart()
1753 com->obufs[1].l_tail in cystart()
1754 = com->obuf2 + q_to_b(&tp->t_outq, com->obuf2, in cystart()
1755 sizeof com->obuf2); in cystart()
1756 com->obufs[1].l_next = NULL; in cystart()
1757 com->obufs[1].l_queued = TRUE; in cystart()
1760 if (com->state & CS_BUSY) { in cystart()
1761 qp = com->obufq.l_next; in cystart()
1764 qp->l_next = &com->obufs[1]; in cystart()
1766 com->obufq.l_head = com->obufs[1].l_head; in cystart()
1767 com->obufq.l_tail = com->obufs[1].l_tail; in cystart()
1768 com->obufq.l_next = &com->obufs[1]; in cystart()
1769 com->state |= CS_BUSY; in cystart()
1770 if (com->state >= (CS_BUSY | CS_TTGO in cystart()
1772 cd_setreg(com, CD1400_SRER, in cystart()
1773 com->intr_enable in cystart()
1774 = (com->intr_enable in cystart()
1785 ++com->start_real; in cystart()
1790 if (com->state >= (CS_BUSY | CS_TTGO)) in cystart()
1791 cyintr1(com); /* fake interrupt to start output */ in cystart()
1802 struct com_s *com; in comstop() local
1805 com = tp->t_sc; in comstop()
1810 com->obufs[0].l_queued = FALSE; in comstop()
1811 com->obufs[1].l_queued = FALSE; in comstop()
1812 if (com->extra_state & CSE_ODONE) { in comstop()
1814 com->extra_state &= ~CSE_ODONE; in comstop()
1815 if (com->etc != ETC_NONE) { in comstop()
1816 if (com->etc == ETC_BREAK_ENDED) in comstop()
1817 com->etc = ETC_NONE; in comstop()
1821 com->tp->t_state &= ~TS_BUSY; in comstop()
1822 if (com->state & CS_ODONE) in comstop()
1824 com->state &= ~(CS_ODONE | CS_BUSY); in comstop()
1828 cy_events -= (com->iptr - com->ibuf); in comstop()
1829 com->iptr = com->ibuf; in comstop()
1834 wakeup(&com->etc); in comstop()
1835 if (rw & FWRITE && com->etc == ETC_NONE) in comstop()
1836 cd1400_channel_cmd(com, CD1400_CCR_CMDRESET | CD1400_CCR_FTF); in comstop()
1843 struct com_s *com; in cymodem() local
1847 com = tp->t_sc; in cymodem()
1850 mcr = com->mcr_image; in cymodem()
1851 if (mcr & com->mcr_dtr) in cymodem()
1853 if (mcr & com->mcr_rts) in cymodem()
1865 msr = cd_getreg(com, CD1400_MSVR2); in cymodem()
1878 mcr = com->mcr_image; in cymodem()
1880 mcr |= com->mcr_dtr; in cymodem()
1882 mcr &= ~com->mcr_dtr; in cymodem()
1884 mcr |= com->mcr_rts; in cymodem()
1886 mcr &= ~com->mcr_rts; in cymodem()
1889 com->mcr_image = mcr; in cymodem()
1890 cd_setreg(com, CD1400_MSVR1, mcr); in cymodem()
1891 cd_setreg(com, CD1400_MSVR2, mcr); in cymodem()
1900 struct com_s *com; in cysettimeout() local
1913 com = cy_addr(unit); in cysettimeout()
1914 if (com != NULL && com->tp != NULL in cysettimeout()
1915 && com->tp->t_state & TS_ISOPEN) { in cysettimeout()
1934 struct com_s *com; in cywakeup() local
1948 com = cy_addr(unit); in cywakeup()
1949 if (com == NULL) in cywakeup()
1957 delta = com->delta_error_counts[errnum]; in cywakeup()
1958 com->delta_error_counts[errnum] = 0; in cywakeup()
1963 total = com->error_counts[errnum] += delta; in cywakeup()
1972 disc_optim(struct tty *tp, struct termios *t, struct com_s *com) in disc_optim() argument
1980 opt = com->cor[2] & ~CD1400_COR3_SCD34; in disc_optim()
1981 if (com->tp->t_hotchar != 0) { in disc_optim()
1982 cd_setreg(com, CD1400_SCHR3, com->tp->t_hotchar); in disc_optim()
1983 cd_setreg(com, CD1400_SCHR4, com->tp->t_hotchar); in disc_optim()
1986 if (opt != com->cor[2]) { in disc_optim()
1987 cd_setreg(com, CD1400_COR3, com->cor[2] = opt); in disc_optim()
1988 cd1400_channel_cmd(com, CD1400_CCR_CMDCORCHG | CD1400_CCR_COR3); in disc_optim()
2043 cd1400_channel_cmd(struct com_s *com, int cmd) in cd1400_channel_cmd() argument
2045 cd1400_channel_cmd_wait(com); in cd1400_channel_cmd()
2046 cd_setreg(com, CD1400_CCR, cmd); in cd1400_channel_cmd()
2047 cd1400_channel_cmd_wait(com); in cd1400_channel_cmd()
2051 cd1400_channel_cmd_wait(struct com_s *com) in cd1400_channel_cmd_wait() argument
2057 if (cd_getreg(com, CD1400_CCR) == 0) in cd1400_channel_cmd_wait()
2061 if (cd_getreg(com, CD1400_CCR) == 0) in cd1400_channel_cmd_wait()
2069 com->unit, usec); in cd1400_channel_cmd_wait()
2076 cd_etc(struct com_s *com, int etc) in cd_etc() argument
2092 if (com->etc == etc) in cd_etc()
2095 && (com->etc == ETC_BREAK_STARTING in cd_etc()
2096 || com->etc == ETC_BREAK_STARTED)) in cd_etc()
2098 && (com->etc == ETC_BREAK_ENDING || com->etc == ETC_BREAK_ENDED in cd_etc()
2099 || com->etc == ETC_NONE))) { in cd_etc()
2104 com->etc = etc; in cd_etc()
2105 cd_setreg(com, CD1400_SRER, in cd_etc()
2106 com->intr_enable in cd_etc()
2107 = (com->intr_enable & ~CD1400_SRER_TXRDY) | CD1400_SRER_TXMPTY); in cd_etc()
2111 while (com->etc == etc in cd_etc()
2112 && tsleep(&com->etc, TTIPRI | PCATCH, "cyetc", 0) == 0) in cd_etc()
2117 cd_getreg(struct com_s *com, int reg) in cd_getreg() argument
2128 basecom = cy_addr(com->unit & ~(CD1400_NO_OF_CHANNELS - 1)); in cd_getreg()
2129 car = com->unit & CD1400_CAR_CHAN; in cd_getreg()
2130 cy_align = com->cy_align; in cd_getreg()
2131 iobase = com->iobase; in cd_getreg()
2152 cd_setreg(struct com_s *com, int reg, int val) in cd_setreg() argument
2162 basecom = cy_addr(com->unit & ~(CD1400_NO_OF_CHANNELS - 1)); in cd_setreg()
2163 car = com->unit & CD1400_CAR_CHAN; in cd_setreg()
2164 cy_align = com->cy_align; in cd_setreg()
2165 iobase = com->iobase; in cd_setreg()
2189 struct com_s *com; in cystatus() local
2194 com = cy_addr(unit); in cystatus()
2199 if (com == NULL) in cystatus()
2201 iobase = com->iobase; in cystatus()
2204 printf("saved channel_control:\t\t0x%02x\n", com->channel_control); in cystatus()
2206 com->cor[0], com->cor[1], com->cor[2]); in cystatus()
2208 cd_getreg(com, CD1400_SRER), com->intr_enable); in cystatus()
2210 cd_inb(iobase, CD1400_SVRR, com->cy_align)); in cystatus()
2212 cd_getreg(com, CD1400_MSVR2), com->prev_modem_status); in cystatus()
2214 cd_inb(iobase, CD1400_RIR, com->cy_align), in cystatus()
2215 cd_inb(iobase, CD1400_TIR, com->cy_align), in cystatus()
2216 cd_inb(iobase, CD1400_MIR, com->cy_align)); in cystatus()
2218 printf("com state:\t\t\t0x%02x\n", com->state); in cystatus()
2220 com->start_count, com->start_real); in cystatus()
2221 printf("rx buffer chars free:\t\t%d\n", com->iptr - com->ibuf); in cystatus()
2223 if (com->obufs[0].l_queued) in cystatus()
2224 ocount += com->obufs[0].l_tail - com->obufs[0].l_head; in cystatus()
2225 if (com->obufs[1].l_queued) in cystatus()
2226 ocount += com->obufs[1].l_tail - com->obufs[1].l_head; in cystatus()
2228 printf("received chars:\t\t\t%d\n", com->bytes_in); in cystatus()
2229 printf("received exceptions:\t\t%d\n", com->recv_exception); in cystatus()
2230 printf("modem signal deltas:\t\t%d\n", com->mdm); in cystatus()
2231 printf("transmitted chars:\t\t%d\n", com->bytes_out); in cystatus()
2233 tp = com->tp; in cystatus()