mcfserial.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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/serial.h>
  17. #ifdef __KERNEL__
  18. /*
  19. * Define a local serial stats structure.
  20. */
  21. struct mcf_stats {
  22. unsigned int rx;
  23. unsigned int tx;
  24. unsigned int rxbreak;
  25. unsigned int rxframing;
  26. unsigned int rxparity;
  27. unsigned int rxoverrun;
  28. };
  29. /*
  30. * This is our internal structure for each serial port's state.
  31. * Each serial port has one of these structures associated with it.
  32. */
  33. struct mcf_serial {
  34. int magic;
  35. volatile unsigned char *addr; /* UART memory address */
  36. int irq;
  37. int flags; /* defined in tty.h */
  38. int type; /* UART type */
  39. struct tty_struct *tty;
  40. unsigned char imr; /* Software imr register */
  41. unsigned int baud;
  42. int sigs;
  43. int custom_divisor;
  44. int x_char; /* xon/xoff character */
  45. int baud_base;
  46. int close_delay;
  47. unsigned short closing_wait;
  48. unsigned short closing_wait2;
  49. unsigned long event;
  50. int line;
  51. int count; /* # of fd on device */
  52. int blocked_open; /* # of blocked opens */
  53. unsigned char *xmit_buf;
  54. int xmit_head;
  55. int xmit_tail;
  56. int xmit_cnt;
  57. struct mcf_stats stats;
  58. struct work_struct tqueue;
  59. struct work_struct tqueue_hangup;
  60. wait_queue_head_t open_wait;
  61. wait_queue_head_t close_wait;
  62. };
  63. #endif /* __KERNEL__ */
  64. #endif /* _MCF_SERIAL_H */