at v3.13 65 lines 2.0 kB view raw
1#ifndef _SPEAKUP_SERIAL_H 2#define _SPEAKUP_SERIAL_H 3 4#include <linux/serial.h> /* for rs_table, serial constants */ 5#include <linux/serial_reg.h> /* for more serial constants */ 6#ifndef __sparc__ 7#include <asm/serial.h> 8#endif 9 10/* 11 * this is cut&paste from 8250.h. Get rid of the structure, the definitions 12 * and this whole broken driver. 13 */ 14struct old_serial_port { 15 unsigned int uart; /* unused */ 16 unsigned int baud_base; 17 unsigned int port; 18 unsigned int irq; 19 unsigned int flags; /* unused */ 20}; 21 22/* countdown values for serial timeouts in us */ 23#define SPK_SERIAL_TIMEOUT 100000 24/* countdown values transmitter/dsr timeouts in us */ 25#define SPK_XMITR_TIMEOUT 100000 26/* countdown values cts timeouts in us */ 27#define SPK_CTS_TIMEOUT 100000 28/* check ttyS0 ... ttyS3 */ 29#define SPK_LO_TTY 0 30#define SPK_HI_TTY 3 31/* # of timeouts permitted before disable */ 32#define NUM_DISABLE_TIMEOUTS 3 33/* buffer timeout in ms */ 34#define SPK_TIMEOUT 100 35#define BOTH_EMPTY (UART_LSR_TEMT | UART_LSR_THRE) 36 37#define spk_serial_tx_busy() ((inb(speakup_info.port_tts + UART_LSR) & BOTH_EMPTY) != BOTH_EMPTY) 38 39/* 2.6.22 doesn't have them any more, hardcode it for now (these values should 40 * be fine for 99% cases) */ 41#ifndef BASE_BAUD 42#define BASE_BAUD (1843200 / 16) 43#endif 44#ifndef STD_COM_FLAGS 45#ifdef CONFIG_SERIAL_DETECT_IRQ 46#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST | ASYNC_AUTO_IRQ) 47#define STD_COM4_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_AUTO_IRQ) 48#else 49#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST) 50#define STD_COM4_FLAGS ASYNC_BOOT_AUTOCONF 51#endif 52#endif 53#ifndef SERIAL_PORT_DFNS 54#define SERIAL_PORT_DFNS \ 55 /* UART CLK PORT IRQ FLAGS */ \ 56 { 0, BASE_BAUD, 0x3F8, 4, STD_COM_FLAGS }, /* ttyS0 */ \ 57 { 0, BASE_BAUD, 0x2F8, 3, STD_COM_FLAGS }, /* ttyS1 */ \ 58 { 0, BASE_BAUD, 0x3E8, 4, STD_COM_FLAGS }, /* ttyS2 */ \ 59 { 0, BASE_BAUD, 0x2E8, 3, STD_COM4_FLAGS }, /* ttyS3 */ 60#endif 61#ifndef IRQF_SHARED 62#define IRQF_SHARED SA_SHIRQ 63#endif 64 65#endif