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

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/io/zcons.c
          +++ new/usr/src/uts/common/io/zcons.c
↓ open down ↓ 207 lines elided ↑ open up ↑
 208  208  
 209  209  
 210  210  /*
 211  211   * Zone Console Pseudo Terminal Module: stream data structure definitions
 212  212   */
 213  213  static struct module_info zc_info = {
 214  214          31337,  /* c0z we r hAx0rs */
 215  215          "zcons",
 216  216          0,
 217  217          INFPSZ,
 218      -        2048,
      218 +        _TTY_BUFSIZ,
 219  219          128
 220  220  };
 221  221  
 222  222  static struct qinit zc_rinit = {
 223  223          NULL,
 224  224          (int (*)()) zc_rsrv,
 225  225          zc_open,
 226  226          zc_close,
 227  227          NULL,
 228  228          &zc_info,
↓ open down ↓ 16 lines elided ↑ open up ↑
 245  245          NULL,
 246  246          NULL
 247  247  };
 248  248  
 249  249  #define ZC_CONF_FLAG    (D_MP | D_MTQPAIR | D_MTOUTPERIM | D_MTOCEXCL)
 250  250  
 251  251  /*
 252  252   * this will define (struct cb_ops cb_zc_ops) and (struct dev_ops zc_ops)
 253  253   */
 254  254  DDI_DEFINE_STREAM_OPS(zc_ops, nulldev, nulldev, zc_attach, zc_detach, nodev, \
 255      -        zc_getinfo, ZC_CONF_FLAG, &zc_tab_info, ddi_quiesce_not_needed);
      255 +    zc_getinfo, ZC_CONF_FLAG, &zc_tab_info, ddi_quiesce_not_needed);
 256  256  
 257  257  /*
 258  258   * Module linkage information for the kernel.
 259  259   */
 260  260  
 261  261  static struct modldrv modldrv = {
 262  262          &mod_driverops,         /* Type of module (this is a pseudo driver) */
 263  263          "Zone console driver",  /* description of module */
 264  264          &zc_ops                 /* driver ops */
 265  265  };
↓ open down ↓ 228 lines elided ↑ open up ↑
 494  494           * set up hi/lo water marks on stream head read queue and add
 495  495           * controlling tty as needed.
 496  496           */
 497  497          mop->b_datap->db_type = M_SETOPTS;
 498  498          mop->b_wptr += sizeof (struct stroptions);
 499  499          sop = (struct stroptions *)(void *)mop->b_rptr;
 500  500          if (oflag & FNOCTTY)
 501  501                  sop->so_flags = SO_HIWAT | SO_LOWAT;
 502  502          else
 503  503                  sop->so_flags = SO_HIWAT | SO_LOWAT | SO_ISTTY;
 504      -        sop->so_hiwat = 512;
      504 +        sop->so_hiwat = _TTY_BUFSIZ;
 505  505          sop->so_lowat = 256;
 506  506          putnext(rqp, mop);
 507  507  
 508  508          return (0);
 509  509  }
 510  510  
 511  511  /*ARGSUSED*/
 512  512  static int
 513  513  zc_slave_open(zc_state_t *zcs,
 514  514      queue_t     *rqp,   /* pointer to the read side queue */
↓ open down ↓ 54 lines elided ↑ open up ↑
 569  569          zcs->zc_slave_rdq = rqp;
 570  570  
 571  571          /*
 572  572           * set up hi/lo water marks on stream head read queue and add
 573  573           * controlling tty as needed.
 574  574           */
 575  575          mop->b_datap->db_type = M_SETOPTS;
 576  576          mop->b_wptr += sizeof (struct stroptions);
 577  577          sop = (struct stroptions *)(void *)mop->b_rptr;
 578  578          sop->so_flags = SO_HIWAT | SO_LOWAT | SO_ISTTY;
 579      -        sop->so_hiwat = 512;
      579 +        sop->so_hiwat = _TTY_BUFSIZ;
 580  580          sop->so_lowat = 256;
 581  581          putnext(rqp, mop);
 582  582  
 583  583          return (0);
 584  584  }
 585  585  
 586  586  /*
 587  587   * open(9e) entrypoint; checks sflag, and rejects anything unordinary.
 588  588   */
 589  589  static int
 590      -zc_open(queue_t *rqp,           /* pointer to the read side queue */
 591      -        dev_t   *devp,          /* pointer to stream tail's dev */
 592      -        int     oflag,          /* the user open(2) supplied flags */
 593      -        int     sflag,          /* open state flag */
 594      -        cred_t  *credp)         /* credentials */
      590 +zc_open(queue_t *rqp,   /* pointer to the read side queue */
      591 +    dev_t   *devp,      /* pointer to stream tail's dev */
      592 +    int oflag,          /* the user open(2) supplied flags */
      593 +    int sflag,          /* open state flag */
      594 +    cred_t  *credp)     /* credentials */
 595  595  {
 596  596          int instance = ZC_INSTANCE(*devp);
 597  597          int ret;
 598  598          zc_state_t *zcs;
 599  599  
 600  600          if (sflag != 0)
 601  601                  return (EINVAL);
 602  602  
 603  603          if ((zcs = ddi_get_soft_state(zc_soft_state, instance)) == NULL)
 604  604                  return (ENXIO);
↓ open down ↓ 410 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX