^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: GPL-2.0 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) #ifndef _SPEAKUP_SERIAL_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) #define _SPEAKUP_SERIAL_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) #include <linux/serial.h> /* for rs_table, serial constants */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) #include <linux/serial_reg.h> /* for more serial constants */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) #include <linux/serial_core.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) #include "spk_priv.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) * this is cut&paste from 8250.h. Get rid of the structure, the definitions
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) * and this whole broken driver.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) struct old_serial_port {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) unsigned int uart; /* unused */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) unsigned int baud_base;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) unsigned int port;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) unsigned int irq;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) upf_t flags; /* unused */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) /* countdown values for serial timeouts in us */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) #define SPK_SERIAL_TIMEOUT SPK_SYNTH_TIMEOUT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) /* countdown values transmitter/dsr timeouts in us */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) #define SPK_XMITR_TIMEOUT 100000
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) /* countdown values cts timeouts in us */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) #define SPK_CTS_TIMEOUT 100000
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) /* check ttyS0 ... ttyS3 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) #define SPK_LO_TTY 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) #define SPK_HI_TTY 3
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) /* # of timeouts permitted before disable */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) #define NUM_DISABLE_TIMEOUTS 3
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) /* buffer timeout in ms */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) #define SPK_TIMEOUT 100
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) #define BOTH_EMPTY (UART_LSR_TEMT | UART_LSR_THRE)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) #define spk_serial_tx_busy() \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) ((inb(speakup_info.port_tts + UART_LSR) & BOTH_EMPTY) != BOTH_EMPTY)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) #endif