mcfserial.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /*
  2. * mcfserial.c -- serial driver for ColdFire internal UARTS.
  3. *
  4. * Copyright (c) 1999 Greg Ungerer <gerg@snapgear.com>
  5. * Copyright (c) 2000-2001 Lineo, Inc. <www.lineo.com>
  6. * Copyright (c) 2002 SnapGear Inc., <www.snapgear.com>
  7. *
  8. * Based on code from 68332serial.c which was:
  9. *
  10. * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
  11. * Copyright (C) 1998 TSHG
  12. * Copyright (c) 1999 Rt-Control Inc. <jeff@uclinux.org>
  13. */
  14. #ifndef _MCF_SERIAL_H
  15. #define _MCF_SERIAL_H
  16. #include <linux/config.h>
  17. #include <linux/serial.h>
  18. #ifdef __KERNEL__
  19. /*
  20. * Define a local serial stats structure.
  21. */
  22. struct mcf_stats {
  23. unsigned int rx;
  24. unsigned int tx;
  25. unsigned int rxbreak;
  26. unsigned int rxframing;
  27. unsigned int rxparity;
  28. unsigned int rxoverrun;
  29. };
  30. /*
  31. * This is our internal structure for each serial port's state.
  32. * Each serial port has one of these structures associated with it.
  33. */
  34. struct mcf_serial {
  35. int magic;
  36. volatile unsigned char *addr; /* UART memory address */
  37. int irq;
  38. int flags; /* defined in tty.h */
  39. int type; /* UART type */
  40. struct tty_struct *tty;
  41. unsigned char imr; /* Software imr register */
  42. unsigned int baud;
  43. int sigs;
  44. int custom_divisor;
  45. int x_char; /* xon/xoff character */
  46. int baud_base;
  47. int close_delay;
  48. unsigned short closing_wait;
  49. unsigned short closing_wait2;
  50. unsigned long event;
  51. int line;
  52. int count; /* # of fd on device */
  53. int blocked_open; /* # of blocked opens */
  54. unsigned char *xmit_buf;
  55. int xmit_head;
  56. int xmit_tail;
  57. int xmit_cnt;
  58. struct mcf_stats stats;
  59. struct work_struct tqueue;
  60. struct work_struct tqueue_hangup;
  61. wait_queue_head_t open_wait;
  62. wait_queue_head_t close_wait;
  63. };
  64. #endif /* __KERNEL__ */
  65. #endif /* _MCF_SERIAL_H */