serialP.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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 xmit_fifo_size;
  42. struct serial_state *state;
  43. struct tty_struct *tty;
  44. int read_status_mask;
  45. int ignore_status_mask;
  46. int timeout;
  47. int quot;
  48. int x_char; /* xon/xoff character */
  49. int close_delay;
  50. unsigned short closing_wait;
  51. int IER; /* Interrupt Enable Register */
  52. int MCR; /* Modem control register */
  53. int line;
  54. int blocked_open; /* # of blocked opens */
  55. struct circ_buf xmit;
  56. wait_queue_head_t open_wait;
  57. wait_queue_head_t close_wait;
  58. wait_queue_head_t delta_msr_wait;
  59. struct async_struct *next_port; /* For the linked list */
  60. struct async_struct *prev_port;
  61. };
  62. #endif /* _LINUX_SERIAL_H */