USB-serial: pl2303: add space/mark parity
The device supports it, so why not use it ? Works fine ! Signed-off-by: Frank Schaefer <schaefer.frank@gmx.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
Родитель
25b8286805
Коммит
6dd81b45fd
|
@ -636,11 +636,21 @@ static void pl2303_set_termios(struct tty_struct *tty,
|
|||
/* For reference buf[5]=3 is mark parity */
|
||||
/* For reference buf[5]=4 is space parity */
|
||||
if (cflag & PARODD) {
|
||||
buf[5] = 1;
|
||||
dbg("%s - parity = odd", __func__);
|
||||
if (cflag & CMSPAR) {
|
||||
buf[5] = 3;
|
||||
dbg("%s - parity = mark", __func__);
|
||||
} else {
|
||||
buf[5] = 1;
|
||||
dbg("%s - parity = odd", __func__);
|
||||
}
|
||||
} else {
|
||||
buf[5] = 2;
|
||||
dbg("%s - parity = even", __func__);
|
||||
if (cflag & CMSPAR) {
|
||||
buf[5] = 4;
|
||||
dbg("%s - parity = space", __func__);
|
||||
} else {
|
||||
buf[5] = 2;
|
||||
dbg("%s - parity = even", __func__);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
buf[5] = 0;
|
||||
|
|
Загрузка…
Ссылка в новой задаче