Greg Kroah-Hartman | 6496922 | 2018-01-11 11:08:40 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
William Hubbs | c6e3fd2 | 2010-10-07 13:20:02 -0500 | [diff] [blame] | 2 | /* spk_priv.h |
Cristina Moraru | 7ea8778 | 2015-10-14 23:28:29 +0300 | [diff] [blame] | 3 | * review functions for the speakup screen review package. |
| 4 | * originally written by: Kirk Reiser and Andy Berdan. |
| 5 | * |
| 6 | * extensively modified by David Borowski. |
| 7 | * |
| 8 | * Copyright (C) 1998 Kirk Reiser. |
| 9 | * Copyright (C) 2003 David Borowski. |
Cristina Moraru | 7ea8778 | 2015-10-14 23:28:29 +0300 | [diff] [blame] | 10 | */ |
William Hubbs | c6e3fd2 | 2010-10-07 13:20:02 -0500 | [diff] [blame] | 11 | #ifndef _SPEAKUP_PRIVATE_H |
| 12 | #define _SPEAKUP_PRIVATE_H |
| 13 | |
Sam Muhammed | 1c31a13 | 2020-03-22 10:33:22 -0400 | [diff] [blame] | 14 | #include <linux/printk.h> |
| 15 | |
William Hubbs | c6e3fd2 | 2010-10-07 13:20:02 -0500 | [diff] [blame] | 16 | #include "spk_types.h" |
| 17 | #include "spk_priv_keyinfo.h" |
| 18 | |
William Hubbs | c6e3fd2 | 2010-10-07 13:20:02 -0500 | [diff] [blame] | 19 | #define V_LAST_VAR { MAXVARS } |
| 20 | #define SPACE 0x20 |
| 21 | #define SYNTH_CHECK 20030716 /* today's date ought to do for check value */ |
| 22 | /* synth flags, for odd synths */ |
| 23 | #define SF_DEC 1 /* to fiddle puncs in alpha strings so it doesn't spell */ |
| 24 | #ifdef MODULE |
| 25 | #define SYNTH_START 1 |
| 26 | #else |
| 27 | #define SYNTH_START 0 |
| 28 | #endif |
| 29 | |
| 30 | #define KT_SPKUP 15 |
Okash Khawaja | 6b9ad1c | 2017-05-15 18:45:35 +0100 | [diff] [blame] | 31 | #define SPK_SYNTH_TIMEOUT 100000 /* in micro-seconds */ |
Okash Khawaja | a5525dc | 2017-06-25 19:40:01 +0100 | [diff] [blame] | 32 | #define SYNTH_DEFAULT_DEV "ttyS0" |
| 33 | #define SYNTH_DEFAULT_SER 0 |
William Hubbs | c6e3fd2 | 2010-10-07 13:20:02 -0500 | [diff] [blame] | 34 | |
Katie Dunne | 13d932f | 2015-02-26 18:42:36 -0800 | [diff] [blame] | 35 | const struct old_serial_port *spk_serial_init(int index); |
| 36 | void spk_stop_serial_interrupt(void); |
Samuel Thibault | 1941ab1 | 2021-01-26 23:21:44 +0100 | [diff] [blame] | 37 | void spk_serial_release(struct spk_synth *synth); |
| 38 | void spk_ttyio_release(struct spk_synth *synth); |
Okash Khawaja | 9f8dced | 2017-07-16 17:18:25 +0100 | [diff] [blame] | 39 | void spk_ttyio_register_ldisc(void); |
| 40 | void spk_ttyio_unregister_ldisc(void); |
William Hubbs | c6e3fd2 | 2010-10-07 13:20:02 -0500 | [diff] [blame] | 41 | |
Samuel Thibault | 89fc2ae | 2017-03-04 15:01:55 +0100 | [diff] [blame] | 42 | void synth_buffer_skip_nonlatin1(void); |
| 43 | u16 synth_buffer_getc(void); |
| 44 | u16 synth_buffer_peek(void); |
Katie Dunne | 13d932f | 2015-02-26 18:42:36 -0800 | [diff] [blame] | 45 | int synth_buffer_empty(void); |
| 46 | struct var_t *spk_get_var(enum var_id_t var_id); |
| 47 | ssize_t spk_var_show(struct kobject *kobj, struct kobj_attribute *attr, |
| 48 | char *buf); |
| 49 | ssize_t spk_var_store(struct kobject *kobj, struct kobj_attribute *attr, |
| 50 | const char *buf, size_t count); |
William Hubbs | c6e3fd2 | 2010-10-07 13:20:02 -0500 | [diff] [blame] | 51 | |
Katie Dunne | 13d932f | 2015-02-26 18:42:36 -0800 | [diff] [blame] | 52 | int spk_serial_synth_probe(struct spk_synth *synth); |
Okash Khawaja | 1ab92da | 2017-05-15 18:45:33 +0100 | [diff] [blame] | 53 | int spk_ttyio_synth_probe(struct spk_synth *synth); |
Ioannis Valasakis | 2843719 | 2018-11-06 02:29:10 +0000 | [diff] [blame] | 54 | const char *spk_serial_synth_immediate(struct spk_synth *synth, |
| 55 | const char *buff); |
| 56 | const char *spk_ttyio_synth_immediate(struct spk_synth *synth, |
| 57 | const char *buff); |
Katie Dunne | 13d932f | 2015-02-26 18:42:36 -0800 | [diff] [blame] | 58 | void spk_do_catch_up(struct spk_synth *synth); |
Samuel Thibault | 65fa72d | 2018-03-10 11:56:27 +0100 | [diff] [blame] | 59 | void spk_do_catch_up_unicode(struct spk_synth *synth); |
Katie Dunne | 13d932f | 2015-02-26 18:42:36 -0800 | [diff] [blame] | 60 | void spk_synth_flush(struct spk_synth *synth); |
Okash Khawaja | ca693dc | 2017-04-29 20:52:58 +0100 | [diff] [blame] | 61 | unsigned char spk_synth_get_index(struct spk_synth *synth); |
Katie Dunne | 13d932f | 2015-02-26 18:42:36 -0800 | [diff] [blame] | 62 | int spk_synth_is_alive_nop(struct spk_synth *synth); |
| 63 | int spk_synth_is_alive_restart(struct spk_synth *synth); |
Joe Perches | ae8784f | 2017-03-04 08:13:11 -0800 | [diff] [blame] | 64 | __printf(1, 2) |
Katie Dunne | 13d932f | 2015-02-26 18:42:36 -0800 | [diff] [blame] | 65 | void synth_printf(const char *buf, ...); |
Samuel Thibault | 89fc2ae | 2017-03-04 15:01:55 +0100 | [diff] [blame] | 66 | void synth_putwc(u16 wc); |
| 67 | void synth_putwc_s(u16 wc); |
| 68 | void synth_putws(const u16 *buf); |
| 69 | void synth_putws_s(const u16 *buf); |
Derek Robson | cb23ebd | 2017-02-04 17:49:00 +1300 | [diff] [blame] | 70 | int synth_request_region(unsigned long start, unsigned long n); |
| 71 | int synth_release_region(unsigned long start, unsigned long n); |
Katie Dunne | 13d932f | 2015-02-26 18:42:36 -0800 | [diff] [blame] | 72 | int synth_add(struct spk_synth *in_synth); |
| 73 | void synth_remove(struct spk_synth *in_synth); |
Samuel Thibault | 45ac7b3 | 2019-03-07 23:06:57 +0100 | [diff] [blame] | 74 | struct spk_synth *synth_current(void); |
William Hubbs | c6e3fd2 | 2010-10-07 13:20:02 -0500 | [diff] [blame] | 75 | |
| 76 | extern struct speakup_info_t speakup_info; |
| 77 | |
| 78 | extern struct var_t synth_time_vars[]; |
| 79 | |
Okash Khawaja | 1e44159 | 2017-03-14 13:41:53 +0000 | [diff] [blame] | 80 | extern struct spk_io_ops spk_serial_io_ops; |
Okash Khawaja | 1ab92da | 2017-05-15 18:45:33 +0100 | [diff] [blame] | 81 | extern struct spk_io_ops spk_ttyio_ops; |
Okash Khawaja | 1e44159 | 2017-03-14 13:41:53 +0000 | [diff] [blame] | 82 | |
William Hubbs | c6e3fd2 | 2010-10-07 13:20:02 -0500 | [diff] [blame] | 83 | #endif |