]> git.ozlabs.org Git - ppp.git/commitdiff
Merge branch 'master' of git://github.com/cmcqueen/ppp
authorPaul Mackerras <paulus@samba.org>
Fri, 1 Aug 2014 11:41:27 +0000 (21:41 +1000)
committerPaul Mackerras <paulus@samba.org>
Fri, 1 Aug 2014 11:41:27 +0000 (21:41 +1000)
This merges in one commit, which adds the new "stop-bits" option.

Signed-off-by: Paul Mackerras <paulus@samba.org>
pppd/pppd.h
pppd/sys-linux.c
pppd/sys-solaris.c
pppd/tty.c

index 7c341006bc18ce28b9707253db42089b803d4902..247fa153739b387d217719e6ac1beb8bf407d708 100644 (file)
@@ -279,6 +279,7 @@ extern int  kdebugflag;     /* Tell kernel to print debug messages */
 extern int     default_device; /* Using /dev/tty or equivalent */
 extern char    devnam[MAXPATHLEN];     /* Device name */
 extern int     crtscts;        /* Use hardware flow control */
+extern int     stop_bits;      /* Number of serial port stop bits */
 extern bool    modem;          /* Use modem control lines */
 extern int     inspeed;        /* Input/Output speed requested */
 extern u_int32_t netmask;      /* IP netmask to set on interface */
index a40d00c1926908575f1e12a23d35bec32d6596e6..e5e9baf8821ff775305a7681441634a0f1bb97c3 100644 (file)
@@ -971,6 +971,9 @@ void set_up_tty(int tty_fd, int local)
        break;
     }
 
+    if (stop_bits >= 2)
+       tios.c_cflag |= CSTOPB;
+
     speed = translate_speed(inspeed);
     if (speed) {
        cfsetospeed (&tios, speed);
index 50ce3dfac2d39a28e1ba26a3e5175f6bc0a73388..93d90332e0d4f2116b17800970e082cf193640dd 100644 (file)
@@ -1225,6 +1225,9 @@ set_up_tty(fd, local)
     }
 #endif
 
+    if (stop_bits >= 2)
+       tios.c_cflag |= CSTOPB;
+
     tios.c_cflag |= CS8 | CREAD | HUPCL;
     if (local || !modem)
        tios.c_cflag |= CLOCAL;
index d571b111d7e34755d9304104c075dcbcc16f4e44..c9a0b33715bc829a7dae446f5f5e1b29d1d78e26 100644 (file)
@@ -136,6 +136,7 @@ struct stat devstat;                /* result of stat() on devnam */
 
 /* option variables */
 int    crtscts = 0;            /* Use hardware flow control */
+int    stop_bits = 1;          /* Number of serial port stop bits */
 bool   modem = 1;              /* Use modem control lines */
 int    inspeed = 0;            /* Input/Output speed requested */
 bool   lockflag = 0;           /* Create lock file to lock the serial dev */
@@ -221,6 +222,9 @@ option_t tty_options[] = {
       OPT_PRIOSUB | OPT_ALIAS | OPT_NOARG | OPT_VAL(-1) },
     { "xonxoff", o_special_noarg, (void *)setxonxoff,
       "Set software (XON/XOFF) flow control", OPT_PRIOSUB },
+    { "stop-bits", o_int, &stop_bits,
+      "Number of stop bits in serial port",
+      OPT_PRIO | OPT_PRIVFIX | OPT_LIMITS, NULL, 2, 1 },
 
     { "modem", o_bool, &modem,
       "Use modem control lines", OPT_PRIO | 1 },