|
本帖最后由 手指恋上烟 于 2012-9-21 15:35 编辑
- static void s3c24xx_serial_set_termios(struct uart_port *port,
- struct ktermios *termios,
- struct ktermios *old)
- {
- struct s3c2410_uartcfg *cfg = s3c24xx_port_to_cfg(port);
- struct s3c24xx_uart_port *ourport = to_ourport(port);
- struct s3c24xx_uart_clksrc *clksrc = NULL;
- struct clk *clk = NULL;
- unsigned long flags;
- unsigned int baud, quot;
- unsigned int ulcon;
- unsigned int umcon;
- unsigned int udivslot = 0;
- /*
- * We don't support modem control lines.
- */
- termios->c_cflag &= ~(HUPCL | CMSPAR);
- termios->c_cflag |= CLOCAL;
复制代码 s3c24xx_serial_set_termios(。。。)这个函数应该对应应用程序中tcsetattr();
但是在内核函数中下边这段话
/*
* We don't support modem control lines.这句话的意思是我们不支持调制解调器控制线,是不是就是不支持硬件流控?
*/
termios->c_cflag &= ~(HUPCL | CMSPAR);
termios->c_cflag |= CLOCAL;
应该是将调制解调器的线路状态给忽略了,不管我们在应用程序中是否设置cflag |= CRTSCTS,内核中都将其设置为忽略调制解调器的线路状态了。所以我们用ioctl函数控制RTS升高或拉低,在硬件上都没有实现相应电平的变化。
|
|