Deleted Added
full compact
rc.c (14873) rc.c (16322)
1/*
2 * Copyright (C) 1995 by Pavel Antonov, Moscow, Russia.
3 * Copyright (C) 1995 by Andrey A. Chernov, Moscow, Russia.
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 138 unchanged lines hidden (view full) ---

147 void *devfs_token;
148#endif
149} rc_chans[NRC * CD180_NCHAN];
150
151static int rc_scheduled_event = 0;
152
153/* for pstat -t */
154static struct tty rc_tty[NRC * CD180_NCHAN];
1/*
2 * Copyright (C) 1995 by Pavel Antonov, Moscow, Russia.
3 * Copyright (C) 1995 by Andrey A. Chernov, Moscow, Russia.
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 138 unchanged lines hidden (view full) ---

147 void *devfs_token;
148#endif
149} rc_chans[NRC * CD180_NCHAN];
150
151static int rc_scheduled_event = 0;
152
153/* for pstat -t */
154static struct tty rc_tty[NRC * CD180_NCHAN];
155static int nrc_tty = NRC * CD180_NCHAN;
155static const int nrc_tty = NRC * CD180_NCHAN;
156
157/* Flags */
158#define RC_DTR_OFF 0x0001 /* DTR wait, for close/open */
159#define RC_ACTOUT 0x0002 /* Dial-out port active */
160#define RC_RTSFLOW 0x0004 /* RTS flow ctl enabled */
161#define RC_CTSFLOW 0x0008 /* CTS flow ctl enabled */
162#define RC_DORXFER 0x0010 /* RXFER event planned */
163#define RC_DOXXFER 0x0020 /* XXFER event planned */

--- 89 unchanged lines hidden (view full) ---

253 kdc_rc[unit].kdc_state = DC_UNKNOWN;
254 dev_attach(&kdc_rc[unit]);
255}
256
257static int
258rcattach(dvp)
259 struct isa_device *dvp;
260{
156
157/* Flags */
158#define RC_DTR_OFF 0x0001 /* DTR wait, for close/open */
159#define RC_ACTOUT 0x0002 /* Dial-out port active */
160#define RC_RTSFLOW 0x0004 /* RTS flow ctl enabled */
161#define RC_CTSFLOW 0x0008 /* CTS flow ctl enabled */
162#define RC_DORXFER 0x0010 /* RXFER event planned */
163#define RC_DOXXFER 0x0020 /* XXFER event planned */

--- 89 unchanged lines hidden (view full) ---

253 kdc_rc[unit].kdc_state = DC_UNKNOWN;
254 dev_attach(&kdc_rc[unit]);
255}
256
257static int
258rcattach(dvp)
259 struct isa_device *dvp;
260{
261 register int i, chan, nec = dvp->id_iobase;
261 register int chan, nec = dvp->id_iobase;
262 struct rc_softc *rcb = &rc_softc[dvp->id_unit];
263 struct rc_chans *rc = &rc_chans[dvp->id_unit * CD180_NCHAN];
264 static int rc_wakeup_started = 0;
265 struct tty *tp;
266
267 /* Thorooughly test the device */
268 if (rcb->rcb_probed != RC_PROBED)
269 return 0;

--- 320 unchanged lines hidden (view full) ---

590}
591
592/* Handle delayed events. */
593void rcpoll()
594{
595 register struct rc_chans *rc;
596 register struct rc_softc *rcb;
597 register u_char *tptr, *eptr;
262 struct rc_softc *rcb = &rc_softc[dvp->id_unit];
263 struct rc_chans *rc = &rc_chans[dvp->id_unit * CD180_NCHAN];
264 static int rc_wakeup_started = 0;
265 struct tty *tp;
266
267 /* Thorooughly test the device */
268 if (rcb->rcb_probed != RC_PROBED)
269 return 0;

--- 320 unchanged lines hidden (view full) ---

590}
591
592/* Handle delayed events. */
593void rcpoll()
594{
595 register struct rc_chans *rc;
596 register struct rc_softc *rcb;
597 register u_char *tptr, *eptr;
598 register int s;
599 register struct tty *tp;
598 register struct tty *tp;
600 register int chan, icnt, c, nec, unit;
599 register int chan, icnt, nec, unit;
601
602 if (rc_scheduled_event == 0)
603 return;
604repeat:
605 for (unit = 0; unit < NRC; unit++) {
606 rcb = &rc_softc[unit];
607 rc = rcb->rcb_baserc;
608 nec = rc->rc_rcb->rcb_addr;

--- 496 unchanged lines hidden (view full) ---

1105 return 0;
1106}
1107
1108/* Re-initialize board after bogus interrupts */
1109static void rc_reinit(rcb)
1110struct rc_softc *rcb;
1111{
1112 register struct rc_chans *rc, *rce;
600
601 if (rc_scheduled_event == 0)
602 return;
603repeat:
604 for (unit = 0; unit < NRC; unit++) {
605 rcb = &rc_softc[unit];
606 rc = rcb->rcb_baserc;
607 nec = rc->rc_rcb->rcb_addr;

--- 496 unchanged lines hidden (view full) ---

1104 return 0;
1105}
1106
1107/* Re-initialize board after bogus interrupts */
1108static void rc_reinit(rcb)
1109struct rc_softc *rcb;
1110{
1111 register struct rc_chans *rc, *rce;
1113 register int i, nec;
1112 register int nec;
1114
1115 nec = rcb->rcb_addr;
1116 rc_hwreset(rcb->rcb_unit, nec, RC_FAKEID);
1117 rc = &rc_chans[rcb->rcb_unit * CD180_NCHAN];
1118 rce = rc + CD180_NCHAN;
1119 for (; rc < rce; rc++)
1120 (void) rc_param(rc->rc_tp, &rc->rc_tp->t_termios);
1121}

--- 145 unchanged lines hidden (view full) ---

1267 return 0;
1268}
1269
1270/* Test the board. */
1271int rc_test(nec, unit)
1272 register int nec;
1273 int unit;
1274{
1113
1114 nec = rcb->rcb_addr;
1115 rc_hwreset(rcb->rcb_unit, nec, RC_FAKEID);
1116 rc = &rc_chans[rcb->rcb_unit * CD180_NCHAN];
1117 rce = rc + CD180_NCHAN;
1118 for (; rc < rce; rc++)
1119 (void) rc_param(rc->rc_tp, &rc->rc_tp->t_termios);
1120}

--- 145 unchanged lines hidden (view full) ---

1266 return 0;
1267}
1268
1269/* Test the board. */
1270int rc_test(nec, unit)
1271 register int nec;
1272 int unit;
1273{
1275 int chan = 0, nopt = 0;
1274 int chan = 0;
1276 int i = 0, rcnt, old_level;
1277 unsigned int iack, chipid;
1278 unsigned short divs;
1279 static u_char ctest[] = "\377\125\252\045\244\0\377";
1280#define CTLEN 8
1281#define ERR(s) { \
1282 printf("rc%d: ", unit); printf s ; printf("\n"); \
1283 (void) splx(old_level); return 1; }

--- 193 unchanged lines hidden (view full) ---

1477 enable_intr();
1478 ttwwakeup(rc->rc_tp);
1479}
1480
1481static void
1482rc_wakeup(chan)
1483 void *chan;
1484{
1275 int i = 0, rcnt, old_level;
1276 unsigned int iack, chipid;
1277 unsigned short divs;
1278 static u_char ctest[] = "\377\125\252\045\244\0\377";
1279#define CTLEN 8
1280#define ERR(s) { \
1281 printf("rc%d: ", unit); printf s ; printf("\n"); \
1282 (void) splx(old_level); return 1; }

--- 193 unchanged lines hidden (view full) ---

1476 enable_intr();
1477 ttwwakeup(rc->rc_tp);
1478}
1479
1480static void
1481rc_wakeup(chan)
1482 void *chan;
1483{
1485 int unit;
1486
1487 timeout(rc_wakeup, (caddr_t)NULL, 1);
1488
1489 if (rc_scheduled_event != 0) {
1490 int s;
1491
1492 s = splsofttty();
1493 rcpoll();
1494 splx(s);

--- 57 unchanged lines hidden ---
1484 timeout(rc_wakeup, (caddr_t)NULL, 1);
1485
1486 if (rc_scheduled_event != 0) {
1487 int s;
1488
1489 s = splsofttty();
1490 rcpoll();
1491 splx(s);

--- 57 unchanged lines hidden ---