The mode constants are taken from the GPL-2.0+ driver available
in the driver section of the Moxa homepage.
It is tested on a C320Turbo PCI card per logic analyzer and
per a device which requires 9 bit character communication.
The vendors driver supports CMSPAR unconditionally, so that all
other available firmware versions seems to support mark/space
parity modes as well.
Signed-off-by: Lars Kanis <kanis@comcard.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
        if (ts->c_iflag & IXANY)
                xany = 1;
 
-       /* Clear the features we don't support */
-       ts->c_cflag &= ~CMSPAR;
        MoxaPortFlowCtrl(ch, rts, cts, txflow, rxflow, xany);
        baud = MoxaPortSetTermio(ch, ts, tty_get_baud_rate(tty));
        if (baud == -1)
                mode |= MX_STOP1;
 
        if (termio->c_cflag & PARENB) {
-               if (termio->c_cflag & PARODD)
-                       mode |= MX_PARODD;
-               else
-                       mode |= MX_PAREVEN;
+               if (termio->c_cflag & PARODD) {
+                       if (termio->c_cflag & CMSPAR)
+                               mode |= MX_PARMARK;
+                       else
+                               mode |= MX_PARODD;
+               } else {
+                       if (termio->c_cflag & CMSPAR)
+                               mode |= MX_PARSPACE;
+                       else
+                               mode |= MX_PAREVEN;
+               }
        } else
                mode |= MX_PARNONE;
 
 
 #define        MX_PARNONE      0x00
 #define        MX_PAREVEN      0x40
 #define        MX_PARODD       0xC0
+#define        MX_PARMARK      0xA0
+#define        MX_PARSPACE     0x20
 
 #endif