Print this page
8527 tty buffer/queue sizes should be larger

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/io/ptem.c
          +++ new/usr/src/uts/common/io/ptem.c
↓ open down ↓ 20 lines elided ↑ open up ↑
  21   21   */
  22   22  /*      Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
  23   23  /*        All Rights Reserved   */
  24   24  
  25   25  
  26   26  /*
  27   27   * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
  28   28   * Use is subject to license terms.
  29   29   */
  30   30  
  31      -#pragma ident   "%Z%%M% %I%     %E% SMI" /* from S5R4 1.13 */
  32      -
  33   31  /*
  34   32   * Description:
  35   33   *
  36   34   * The PTEM streams module is used as a pseudo driver emulator.  Its purpose
  37   35   * is to emulate the ioctl() functions of a terminal device driver.
  38   36   */
  39   37  
  40   38  #include <sys/types.h>
  41   39  #include <sys/param.h>
  42   40  #include <sys/stream.h>
↓ open down ↓ 56 lines elided ↑ open up ↑
  99   97  static int ptemopen(queue_t *, dev_t  *, int, int, cred_t *);
 100   98  static int ptemclose(queue_t *, int, cred_t *);
 101   99  static void ptemrput(queue_t *, mblk_t *);
 102  100  static void ptemwput(queue_t *, mblk_t *);
 103  101  static void ptemwsrv(queue_t *);
 104  102  
 105  103  static struct module_info ptem_info = {
 106  104          0xabcd,
 107  105          "ptem",
 108  106          0,
 109      -        512,
 110      -        512,
      107 +        _TTY_BUFSIZ,
      108 +        _TTY_BUFSIZ,
 111  109          128
 112  110  };
 113  111  
 114  112  static struct qinit ptemrinit = {
 115  113          (int (*)()) ptemrput,
 116  114          NULL,
 117  115          ptemopen,
 118  116          ptemclose,
 119  117          NULL,
 120  118          &ptem_info,
↓ open down ↓ 73 lines elided ↑ open up ↑
 194  192          mop = allocb(sizeof (struct stroptions), BPRI_MED);
 195  193          if (mop == NULL) {
 196  194                  freemsg(ntp->dack_ptr);
 197  195                  kmem_free(ntp, sizeof (*ntp));
 198  196                  return (EAGAIN);
 199  197          }
 200  198          mop->b_datap->db_type = M_SETOPTS;
 201  199          mop->b_wptr += sizeof (struct stroptions);
 202  200          sop = (struct stroptions *)mop->b_rptr;
 203  201          sop->so_flags = SO_HIWAT | SO_LOWAT | SO_ISTTY;
 204      -        sop->so_hiwat = 512;
      202 +        sop->so_hiwat = _TTY_BUFSIZ;
 205  203          sop->so_lowat = 256;
 206  204  
 207  205          /*
 208  206           * Cross-link.
 209  207           */
 210  208          ntp->q_ptr = q;
 211  209          q->q_ptr = ntp;
 212  210          WR(q)->q_ptr = ntp;
 213  211  
 214  212          /*
↓ open down ↓ 258 lines elided ↑ open up ↑
 473  471                                          qreply(q, mp);
 474  472                                          break;
 475  473  
 476  474                                  default:
 477  475                                          freemsg(mp);
 478  476                          }
 479  477                          break;
 480  478  
 481  479                  case M_FLUSH:
 482  480                          if (*mp->b_rptr & FLUSHW) {
 483      -                            if ((ntp->state & IS_PTSTTY) &&
 484      -                                        (*mp->b_rptr & FLUSHBAND))
 485      -                                flushband(q, *(mp->b_rptr + 1), FLUSHDATA);
 486      -                            else
 487      -                                flushq(q, FLUSHDATA);
      481 +                                if ((ntp->state & IS_PTSTTY) &&
      482 +                                    (*mp->b_rptr & FLUSHBAND))
      483 +                                        flushband(q, *(mp->b_rptr + 1),
      484 +                                            FLUSHDATA);
      485 +                                else
      486 +                                        flushq(q, FLUSHDATA);
 488  487                          }
 489  488                          putnext(q, mp);
 490  489                          break;
 491  490  
 492  491                  case M_READ:
 493  492                          freemsg(mp);
 494  493                          break;
 495  494  
 496  495                  case M_STOP:
 497  496                          /*
↓ open down ↓ 536 lines elided ↑ open up ↑
1034 1033                   * appropriate.
1035 1034                   */
1036 1035                  if (putnextctl1(q, M_PCSIG, sig) == 0) {
1037 1036                          miocnak(q, mp, 0, EAGAIN);
1038 1037                          return;
1039 1038                  }
1040 1039  
1041 1040                  mioc2ack(mp, NULL, 0, 0);
1042 1041                  qreply(q, mp);
1043 1042                  return;
1044      -            }
     1043 +        }
1045 1044  
1046 1045          case TIOCREMOTE: {
1047 1046                  int     onoff;
1048 1047                  mblk_t  *mctlp;
1049 1048  
1050 1049                  if (DB_TYPE(mp) == M_IOCTL) {
1051 1050                          error = miocpullup(mp, sizeof (int));
1052 1051                          if (error != 0) {
1053 1052                                  miocnak(q, mp, 0, error);
1054 1053                                  return;
↓ open down ↓ 20 lines elided ↑ open up ↑
1075 1074                  qreply(q, mp);
1076 1075  
1077 1076                  /*
1078 1077                   * Record state change.
1079 1078                   */
1080 1079                  if (onoff)
1081 1080                          tp->state |= REMOTEMODE;
1082 1081                  else
1083 1082                          tp->state &= ~REMOTEMODE;
1084 1083                  return;
1085      -            }
     1084 +        }
1086 1085  
1087 1086          default:
1088 1087                  putnext(q, mp);
1089 1088                  return;
1090 1089          }
1091 1090  }
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX