can somebody maybe help me with this issue:
I need to change the parity within a frame. User-Space is sending a frame (incl. some "control chars") and i need to send the first byte with Space parity, where all remaining bytes must be send with Mark parity.
The parity will be updated successfully for the first byte (i checked it by toggling between S->M and M->S on each incoming frame), but it is not changing for the remaining bytes. So it seems, you can change the parity before the first char of a frame is sent, but you cannot change the parity "within" the frame (just plain explanation).
What i have done:
In "serial8250_start_tx()" i am catching all incoming bytes and then check them for my "control bytes". If it is a control-byte, then i am changing the parity. If its not a control-byte, then i am sending this one like the "normal" serial8250_start_tx() does.
This is the code, which is changing the parity, where c is the byte from xmit, which described the new parity, and "tUserTermios" is the termios, which has been set by user-space. I am saving the termios to store information about baud, databits, stopsbits, etc.:
printk("Update Parity <%c>!\n", c);
/* Wait for transmitter register to empty */
/* Check and update parity */
up->tUserTermios.c_cflag &= ~(PARENB | PARODD | CMSPAR);
up->tUserTermios.c_cflag |= (c=='O') ? (PARENB|PARODD) : 0;
up->tUserTermios.c_cflag |= (c=='E') ? PARENB : 0;
up->tUserTermios.c_cflag |= (c=='M') ? (PARENB|PARODD|CMSPAR): 0;
up->tUserTermios.c_cflag |= (c=='S') ? (PARENB|CMSPAR): 0;
/* Set new termios */
serial8250_set_termios(&up->port, &up->tUserTermios, &old);
Any hints, what is wrong? Or did i miss something?