staging: speakup: add send_xchar, tiocmset and input functionality for tty
Samuel Thibault
samuel.thibault at ens-lyon.org
Sat Apr 29 09:06:04 EDT 2017
Okash Khawaja, on sam. 29 avril 2017 13:48:09 +0100, wrote:
> +static unsigned char ttyio_in(int timeout)
> +{
> + struct spk_ldisc_data *ldisc_data = speakup_tty->disc_data;
> + char rv;
> +
> + if (down_timeout(&ldisc_data->sem, usecs_to_jiffies(timeout)) != 0) {
> + pr_warn("spk_ttyio: timeout (%d) while waiting for input\n",
> + timeout);
> + return 0xff;
> + }
> +static unsigned char spk_ttyio_in_nowait(void)
> +{
> + return ttyio_in(0);
> +}
Thinking of it: for spk_ttyio_in_nowait(), we shouldn't print a warning
when down_timeout returns ETIMEDOUT. So pr_warn should be guarded by
"if (timeout)".
Also, spk_ttyio_in_nowait() should return 0 instead of 0xff on timeout,
since that's used for synth_insert_next_index() which takes 0 as "no new
value", not 0xff.
I know, it's converging slowly, but we need to make sure we don't change
things, otherwise it'll bring regressions.
Samuel
More information about the Speakup
mailing list