From: Okash Khawaja <okash.khawaja@gmail.com>
To: Samuel Thibault <samuel.thibault@ens-lyon.org>,
John Covici <covici@ccs.covici.com>
Cc: speakup@linux-speakup.org
Subject: Re: staging: speakup: flush tty buffers
Date: Mon, 1 May 2017 19:03:35 +0100 [thread overview]
Message-ID: <20170501180335.GA4211@sanghar> (raw)
In-Reply-To: <20170501180208.GA4197@sanghar>
Hi,
For testing, I have updated the github repo [1]. I will test this on apollo.
Thanks,
Okash
[1] https://github.com/bytefire/speakup-decext
On Mon, May 01, 2017 at 07:02:08PM +0100, Okash Khawaja wrote:
> This patch fixes the issue where TTY-migrated synths would take a while
> to shut up after hitting numpad enter key. When calling synth_flush, even
> though XOFF character is sent as high priority, data buffered in TTY layer
> is still sent to the synth. This patch flushes that buffered data when
> synth_flush is called.
>
> Reported-by: John Covici <covici@ccs.covici.com>
> Signed-off-by: Okash Khawaja <okash.khawaja@gmail.com>
>
> Index: linux-staging/drivers/staging/speakup/serialio.c
> ===================================================================
> --- linux-staging.orig/drivers/staging/speakup/serialio.c
> +++ linux-staging/drivers/staging/speakup/serialio.c
> @@ -30,6 +30,7 @@
> static void spk_serial_tiocmset(unsigned int set, unsigned int clear);
> static unsigned char spk_serial_in(void);
> static unsigned char spk_serial_in_nowait(void);
> +static void spk_serial_flush_buffer(void);
>
> struct spk_io_ops spk_serial_io_ops = {
> .synth_out = spk_serial_out,
> @@ -37,6 +38,7 @@
> .tiocmset = spk_serial_tiocmset,
> .synth_in = spk_serial_in,
> .synth_in_nowait = spk_serial_in_nowait,
> + .flush_buffer = spk_serial_flush_buffer,
> };
> EXPORT_SYMBOL_GPL(spk_serial_io_ops);
>
> @@ -268,6 +270,11 @@
> return inb_p(speakup_info.port_tts + UART_RX);
> }
>
> +static void spk_serial_flush_buffer(void)
> +{
> + /* TODO: flush the UART 16550 buffer */
> +}
> +
> static int spk_serial_out(struct spk_synth *in_synth, const char ch)
> {
> if (in_synth->alive && spk_wait_for_xmitr(in_synth)) {
> Index: linux-staging/drivers/staging/speakup/spk_ttyio.c
> ===================================================================
> --- linux-staging.orig/drivers/staging/speakup/spk_ttyio.c
> +++ linux-staging/drivers/staging/speakup/spk_ttyio.c
> @@ -85,6 +85,7 @@
> static void spk_ttyio_tiocmset(unsigned int set, unsigned int clear);
> static unsigned char spk_ttyio_in(void);
> static unsigned char spk_ttyio_in_nowait(void);
> +static void spk_ttyio_flush_buffer(void);
>
> struct spk_io_ops spk_ttyio_ops = {
> .synth_out = spk_ttyio_out,
> @@ -92,6 +93,7 @@
> .tiocmset = spk_ttyio_tiocmset,
> .synth_in = spk_ttyio_in,
> .synth_in_nowait = spk_ttyio_in_nowait,
> + .flush_buffer = spk_ttyio_flush_buffer,
> };
> EXPORT_SYMBOL_GPL(spk_ttyio_ops);
>
> @@ -201,6 +203,11 @@
> return (rv == 0xff) ? 0 : rv;
> }
>
> +static void spk_ttyio_flush_buffer(void)
> +{
> + speakup_tty->ops->flush_buffer(speakup_tty);
> +}
> +
> int spk_ttyio_synth_probe(struct spk_synth *synth)
> {
> int rv = spk_ttyio_initialise_ldisc(synth->ser);
> Index: linux-staging/drivers/staging/speakup/spk_types.h
> ===================================================================
> --- linux-staging.orig/drivers/staging/speakup/spk_types.h
> +++ linux-staging/drivers/staging/speakup/spk_types.h
> @@ -154,6 +154,7 @@
> void (*tiocmset)(unsigned int set, unsigned int clear);
> unsigned char (*synth_in)(void);
> unsigned char (*synth_in_nowait)(void);
> + void (*flush_buffer)(void);
> };
>
> struct spk_synth {
> Index: linux-staging/drivers/staging/speakup/speakup_audptr.c
> ===================================================================
> --- linux-staging.orig/drivers/staging/speakup/speakup_audptr.c
> +++ linux-staging/drivers/staging/speakup/speakup_audptr.c
> @@ -127,6 +127,7 @@
>
> static void synth_flush(struct spk_synth *synth)
> {
> + synth->io_ops->flush_buffer();
> synth->io_ops->send_xchar(SYNTH_CLEAR);
> synth->io_ops->synth_out(synth, PROCSPEECH);
> }
> Index: linux-staging/drivers/staging/speakup/speakup_decext.c
> ===================================================================
> --- linux-staging.orig/drivers/staging/speakup/speakup_decext.c
> +++ linux-staging/drivers/staging/speakup/speakup_decext.c
> @@ -221,6 +221,7 @@
> static void synth_flush(struct spk_synth *synth)
> {
> in_escape = 0;
> + synth->io_ops->flush_buffer();
> synth->synth_immediate(synth, "\033P;10z\033\\");
> }
>
> Index: linux-staging/drivers/staging/speakup/speakup_dectlk.c
> ===================================================================
> --- linux-staging.orig/drivers/staging/speakup/speakup_dectlk.c
> +++ linux-staging/drivers/staging/speakup/speakup_dectlk.c
> @@ -293,6 +293,7 @@
> synth->io_ops->synth_out(synth, ']');
> in_escape = 0;
> is_flushing = 1;
> + synth->io_ops->flush_buffer();
> synth->io_ops->synth_out(synth, SYNTH_CLEAR);
> }
>
> Index: linux-staging/drivers/staging/speakup/speakup_spkout.c
> ===================================================================
> --- linux-staging.orig/drivers/staging/speakup/speakup_spkout.c
> +++ linux-staging/drivers/staging/speakup/speakup_spkout.c
> @@ -125,6 +125,7 @@
>
> static void synth_flush(struct spk_synth *synth)
> {
> + synth->io_ops->flush_buffer();
> synth->io_ops->send_xchar(SYNTH_CLEAR);
> }
>
> Index: linux-staging/drivers/staging/speakup/synth.c
> ===================================================================
> --- linux-staging.orig/drivers/staging/speakup/synth.c
> +++ linux-staging/drivers/staging/speakup/synth.c
> @@ -120,6 +120,7 @@
>
> void spk_synth_flush(struct spk_synth *synth)
> {
> + synth->io_ops->flush_buffer();
> synth->io_ops->synth_out(synth, synth->clear);
> }
> EXPORT_SYMBOL_GPL(spk_synth_flush);
next prev parent reply other threads:[~ UTC|newest]
Thread overview: 76+ messages / expand[flat|nested] mbox.gz Atom feed top
DecTalk External (decext) testers wanted! Okash Khawaja
` Okash Khawaja
` Okash Khawaja
` John Covici
` Okash Khawaja
` Okash Khawaja
` Keith Barrett
` Okash Khawaja
` Karen Lewellen
` Okash Khawaja
` Tom Fowle
` Gregory Nowak
` Keith Barrett
` Tom Fowle
` Gregory Nowak
` Okash Khawaja
` Okash Khawaja
` Gregory Nowak
` Okash Khawaja
` Keith Barrett
` Gregory Nowak
` Keith Barrett
` Okash Khawaja
` Keith Barrett
` Gregory Nowak
` Keith Barrett
` Okash Khawaja
` Keith Barrett
` Keith Barrett
` Okash Khawaja
` Okash Khawaja
` Keith Barrett
` Okash Khawaja
` Keith Barrett
` Okash Khawaja
` Keith Barrett
` Okash Khawaja
` John Covici
` Okash Khawaja
` Okash Khawaja
` Gregory Nowak
` John Covici
` Gregory Nowak
` Samuel Thibault
` bns indexing, was: " Gregory Nowak
` Samuel Thibault
` Samuel Thibault
` Samuel Thibault
` John Covici
` Okash Khawaja
` Tony Baechler
` Okash Khawaja
` John Covici
` Okash Khawaja
` John Covici
` Frost
` Zachary Kline
` Okash Khawaja
` John Covici
` Okash Khawaja
` John Covici
` Samuel Thibault
` Samuel Thibault
` staging: speakup: flush tty buffers Okash Khawaja
` Okash Khawaja [this message]
` John Covici
` Okash Khawaja
` John Covici
` Okash Khawaja
` Samuel Thibault
` Okash Khawaja
` Samuel Thibault
` staging: speakup: flush tty buffers and ensure hardware flow control Okash Khawaja
` Samuel Thibault
` DecTalk External (decext) testers wanted! Okash Khawaja
` Samuel Thibault
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170501180335.GA4211@sanghar \
--to=okash.khawaja@gmail.com \
--cc=covici@ccs.covici.com \
--cc=samuel.thibault@ens-lyon.org \
--cc=speakup@linux-speakup.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).