home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / unix / internal / 1604 < prev    next >
Encoding:
Internet Message Format  |  1992-07-29  |  3.0 KB

  1. Xref: sparky comp.unix.internals:1604 comp.unix.questions:9379
  2. Newsgroups: comp.unix.internals,comp.unix.questions
  3. Path: sparky!uunet!psgrain!hippo!ucthpx!aim1!aim1!gram
  4. From: gram@aim1.aztec.co.za (Graham Wheeler)
  5. Subject: Termio ioctls panicking system! Help!
  6. Message-ID: <gram.711971201@aim1>
  7. Organization: Aztec Information Management
  8. Date: Fri, 24 Jul 1992 09:46:41 GMT
  9. Lines: 87
  10.  
  11. Hi all
  12.  
  13. I have a STREAMS module problem that I hope someone can help me with. I
  14. have written some X.25 STREAMS device/modules which are working fine for
  15. outgoing connections (via a Triple-X PAD pseudo-device). However, I am 
  16. struggling with incoming connections. If I don't include any line discipline,
  17. I get loads of messages warning about problems with job control, etc. I am
  18. thus trying to get the ldterm line discipline module working as well, via
  19. the autopush facility.
  20.  
  21. What happens now is that my pseudo-device gets the M_CTL message from 
  22. ldterm, to which it replies with a M_DO_CANON (that is, it requests ldterm
  23. to do all the termio processing as it doesn't do any itself). Shortly thereafter
  24. I get a TCGETA ioctl (from uugetty) to which my device responds with a
  25. ACK. Then the system panics.
  26.  
  27. My upper write put procedure looks like:
  28.  
  29. static int PADuwput(queue_t *q, mblk_t *mp) {
  30.     struct PAD *PAD = (struct PAD *) q->q_ptr;
  31.     switch (mp->b_datap->db_type) {
  32.  
  33.     case M_CTL: { /* Termio query from ldterm; see 12-7 */
  34.         struct iocblk *iocp = (struct  iocblk *)mp->b_rptr;
  35.         iocp->ioc_cmd = MC_DO_CANON;
  36.         qreply(q,mp);
  37.         break;
  38.         }
  39.     case M_IOCTL: {
  40.         struct iocblk *iocp = (struct  iocblk *)mp->b_rptr;
  41.         struct linkblk *linkp;
  42.         int error = ENXIO;
  43.         switch (iocp->ioc_cmd) {
  44.  
  45.         case I_PLINK:    ...
  46.         case I_PUNLINK: ...
  47.  
  48.         case TCSETA:
  49.         case TCSETAW: /* Needs special processing; see 12-14 */
  50.         case TCSETS:
  51.         case TCSETSW:
  52.         case TCSETSF:
  53.         case TCSETAF:
  54.         case TCGETA:
  55.         case TCGETS:
  56.         case TCSBRK: /* Needs special processing; see 12-14 */
  57.         iocack:
  58.             mp->b_datap->db_type = M_IOCACK;
  59.             /*iocp->ioc_count = 0;*/
  60.             break;
  61.         default:
  62.         iocnak:
  63.             mp->b_datap->db_type = M_IOCNAK;
  64.             iocp->ioc_error = error;
  65.             break;
  66.         }
  67.         qreply(q,mp);
  68.         break;
  69.         }
  70.     case M_FLUSH:    ...
  71.     case M_DATA:    ...
  72.     case M_BREAK:    ...
  73.     case M_PROTO:    ...
  74.     default:    ...
  75.     }
  76.     return 0;
  77. }
  78.  
  79. Does anyone know what I am doing wrong? Do I have to send the data in the
  80. ioctl back with a COPY message? 
  81.  
  82. I usually have lots of cmn_err calls embedded in this code, and the last thing
  83. I can see happening is the acknowledgement of the ioctl. I suspect that
  84. ldterm wants some data back and is assuming it exists and causing some kind
  85. of violation as a result, but I can't figure out from the STREAMS manual
  86. what more I should be doing.
  87.  
  88. Any help will be much appreciated!
  89.  
  90. Thanks in advance
  91. Graham
  92.  
  93. -- 
  94. Graham Wheeler                     | "That which is weak conquers the strong,
  95. Software Systems Engineer/Student  | that which is soft conquers the hard."
  96. Aztec Information Management/UCT   |         Lao Tzu - Tao Te Ching Ch. 78
  97. gram@aim1.aztec.co.za / gram@cs.uct.ac.za 
  98.