serialP.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /*
  2. * Private header file for the (dumb) serial driver
  3. *
  4. * Copyright (C) 1997 by Theodore Ts'o.
  5. *
  6. * Redistribution of this file is permitted under the terms of the GNU
  7. * Public License (GPL)
  8. */
  9. #ifndef _LINUX_SERIALP_H
  10. #define _LINUX_SERIALP_H
  11. /*
  12. * This is our internal structure for each serial port's state.
  13. *
  14. * Many fields are paralleled by the structure used by the serial_struct
  15. * structure.
  16. *
  17. * For definitions of the flags field, see tty.h
  18. */
  19. #include <linux/termios.h>
  20. #include <linux/workqueue.h>
  21. #include <linux/interrupt.h>
  22. #include <linux/circ_buf.h>
  23. #include <linux/wait.h>
  24. struct serial_state {
  25. int baud_base;
  26. unsigned long port;
  27. int irq;
  28. int flags;
  29. int type;
  30. int line;
  31. int xmit_fifo_size;
  32. int custom_divisor;
  33. int count;
  34. unsigned short close_delay;
  35. unsigned short closing_wait; /* time to wait before closing */
  36. struct async_icount icount;
  37. struct async_struct *info;
  38. };
  39. struct async_struct {
  40. unsigned long port;
  41. int flags;
  42. int xmit_fifo_size;
  43. struct serial_state *state;
  44. struct tty_struct *tty;
  45. int read_status_mask;
  46. int ignore_status_mask;
  47. int timeout;
  48. int quot;
  49. int x_char; /* xon/xoff character */
  50. int close_delay;
  51. unsigned short closing_wait;
  52. int IER; /* Interrupt Enable Register */
  53. int MCR; /* Modem control register */
  54. unsigned long event;
  55. int line;
  56. int blocked_open; /* # of blocked opens */
  57. struct circ_buf xmit;
  58. struct tasklet_struct tlet;
  59. wait_queue_head_t open_wait;
  60. wait_queue_head_t close_wait;
  61. wait_queue_head_t delta_msr_wait;
  62. struct async_struct *next_port; /* For the linked list */
  63. struct async_struct *prev_port;
  64. };
  65. /*
  66. * Events are used to schedule things to happen at timer-interrupt
  67. * time, instead of at rs interrupt time.
  68. */
  69. #define RS_EVENT_WRITE_WAKEUP 0
  70. #endif /* _LINUX_SERIAL_H */