Skip to contentSkip to conversation

change HW flow-control

DISCUSSION Michael Westermann 1 participant 1 message May 6, 2004 TTY layer and serial drivers

lore
Share & tools
lore
#0 lore raw

Hello,

I work on a change for the serial driver,
first for a i386 kernel 2.4.xx. Many POS printers and devices from different vendors use DTR/DSR flow control, not RTS/CTS.

I think it's a good idea to change the serial.c module for flexible flow control. My idea is to add one or two additional variables for the hw flow control.

info->modem_flow /* Modem lines */
info->status_flow /* Status lines */

example: setting for ctrscts in serial.c not complete.

@@ -1751,6 +1751,8 @@
info->IER |= UART_IER_MSI;
if (cflag & CRTSCTS) {
info->flags |= ASYNC_CTS_FLOW;
+ info->status_flow = UART_MSR_CTS;
+ info->modem_flow = UART_MCR_RTS;
info->IER |= UART_IER_MSI;
} else
info->flags &= ~ASYNC_CTS_FLOW;

With this change can we use few different flow-controls e.g. CTS/DTR, DTR/DSR RTS/DSR .. DTR/CD.

I think is a good idea to integrate the new settings in the termios flags.

/* c_lflag bits */
#define CHWFLOW 001000000000

and set the hw stop and start bits in the c_cc array.
either in the VSTART and VSTOP field or in the free field index 17 and 18.

Alternatively the new HW flow lines could be set with a new ioctl.

What is the best way to set status_flow and modem_flow?

Michael