lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <506A6E8E.2000005@synopsys.com>
Date:	Tue, 2 Oct 2012 10:03:18 +0530
From:	Vineet Gupta <Vineet.Gupta1@...opsys.com>
To:	Alan Cox <alan@...ux.intel.com>
CC:	<gregkh@...uxfoundation.org>, <linux-serial@...r.kernel.org>,
	<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] serial/arc-uart: Add new driver

On Friday 28 September 2012 06:32 PM, Alan Cox wrote:

>> +static void
>> +arc_serial_set_termios(struct uart_port *port, struct ktermios
>> *termios,
>> +		       struct ktermios *old)
>> +{
>> +	struct arc_uart_port *uart = (struct arc_uart_port *)port;
>> +	unsigned int baud, uartl, uarth, hw_val;
>> +	unsigned long flags;
>> +
> Two things here. Firstly you want to write the actual baud back to the
> termios (tty_termios_encode_baud_rate) unless B0 is set.
>
> Secondly if you don't support hardware flow control, character size
> setting etc then you need to set those bits back so the caller knows.
> Two ways to do that. Either initialise the default termios for the tty
> type to the correct values and use tty_termios_copy_hw() or set them in
> the termios handler.

Just to give you an idea, is something on the lines of following OK for
both the above points above !

-       uart_update_timeout(port, termios->c_cflag, baud);
+       new->c_cflag &= ~(CMSPAR|CRTSCTS);  /* Don't care for
parity/flow ctrl */
+
+       if (old)
+               tty_termios_copy_hw(new, old);
+
+       /* Don't rewrite B0 */
+       if (tty_termios_baud_rate(new))
+               tty_termios_encode_baud_rate(new, baud, baud);
+
+       uart_update_timeout(port, new->c_cflag, baud);
 

Respun patch to follow shortly.

Thx,
Vineet
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ