serialio.h 1.1 KB

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