home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.unix.internals:1604 comp.unix.questions:9379
- Newsgroups: comp.unix.internals,comp.unix.questions
- Path: sparky!uunet!psgrain!hippo!ucthpx!aim1!aim1!gram
- From: gram@aim1.aztec.co.za (Graham Wheeler)
- Subject: Termio ioctls panicking system! Help!
- Message-ID: <gram.711971201@aim1>
- Organization: Aztec Information Management
- Date: Fri, 24 Jul 1992 09:46:41 GMT
- Lines: 87
-
- Hi all
-
- I have a STREAMS module problem that I hope someone can help me with. I
- have written some X.25 STREAMS device/modules which are working fine for
- outgoing connections (via a Triple-X PAD pseudo-device). However, I am
- struggling with incoming connections. If I don't include any line discipline,
- I get loads of messages warning about problems with job control, etc. I am
- thus trying to get the ldterm line discipline module working as well, via
- the autopush facility.
-
- What happens now is that my pseudo-device gets the M_CTL message from
- ldterm, to which it replies with a M_DO_CANON (that is, it requests ldterm
- to do all the termio processing as it doesn't do any itself). Shortly thereafter
- I get a TCGETA ioctl (from uugetty) to which my device responds with a
- ACK. Then the system panics.
-
- My upper write put procedure looks like:
-
- static int PADuwput(queue_t *q, mblk_t *mp) {
- struct PAD *PAD = (struct PAD *) q->q_ptr;
- switch (mp->b_datap->db_type) {
-
- case M_CTL: { /* Termio query from ldterm; see 12-7 */
- struct iocblk *iocp = (struct iocblk *)mp->b_rptr;
- iocp->ioc_cmd = MC_DO_CANON;
- qreply(q,mp);
- break;
- }
- case M_IOCTL: {
- struct iocblk *iocp = (struct iocblk *)mp->b_rptr;
- struct linkblk *linkp;
- int error = ENXIO;
- switch (iocp->ioc_cmd) {
-
- case I_PLINK: ...
- case I_PUNLINK: ...
-
- case TCSETA:
- case TCSETAW: /* Needs special processing; see 12-14 */
- case TCSETS:
- case TCSETSW:
- case TCSETSF:
- case TCSETAF:
- case TCGETA:
- case TCGETS:
- case TCSBRK: /* Needs special processing; see 12-14 */
- iocack:
- mp->b_datap->db_type = M_IOCACK;
- /*iocp->ioc_count = 0;*/
- break;
- default:
- iocnak:
- mp->b_datap->db_type = M_IOCNAK;
- iocp->ioc_error = error;
- break;
- }
- qreply(q,mp);
- break;
- }
- case M_FLUSH: ...
- case M_DATA: ...
- case M_BREAK: ...
- case M_PROTO: ...
- default: ...
- }
- return 0;
- }
-
- Does anyone know what I am doing wrong? Do I have to send the data in the
- ioctl back with a COPY message?
-
- I usually have lots of cmn_err calls embedded in this code, and the last thing
- I can see happening is the acknowledgement of the ioctl. I suspect that
- ldterm wants some data back and is assuming it exists and causing some kind
- of violation as a result, but I can't figure out from the STREAMS manual
- what more I should be doing.
-
- Any help will be much appreciated!
-
- Thanks in advance
- Graham
-
- --
- Graham Wheeler | "That which is weak conquers the strong,
- Software Systems Engineer/Student | that which is soft conquers the hard."
- Aztec Information Management/UCT | Lao Tzu - Tao Te Ching Ch. 78
- gram@aim1.aztec.co.za / gram@cs.uct.ac.za
-