comstats.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. /*****************************************************************************/
  2. /*
  3. * comstats.h -- Serial Port Stats.
  4. *
  5. * Copyright (C) 1996-1998 Stallion Technologies
  6. * Copyright (C) 1994-1996 Greg Ungerer.
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation; either version 2 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  21. */
  22. /*****************************************************************************/
  23. #ifndef _COMSTATS_H
  24. #define _COMSTATS_H
  25. /*****************************************************************************/
  26. /*
  27. * Serial port stats structure. The structure itself is UART
  28. * independent, but some fields may be UART/driver specific (for
  29. * example state).
  30. */
  31. typedef struct {
  32. unsigned long brd;
  33. unsigned long panel;
  34. unsigned long port;
  35. unsigned long hwid;
  36. unsigned long type;
  37. unsigned long txtotal;
  38. unsigned long rxtotal;
  39. unsigned long txbuffered;
  40. unsigned long rxbuffered;
  41. unsigned long rxoverrun;
  42. unsigned long rxparity;
  43. unsigned long rxframing;
  44. unsigned long rxlost;
  45. unsigned long txbreaks;
  46. unsigned long rxbreaks;
  47. unsigned long txxon;
  48. unsigned long txxoff;
  49. unsigned long rxxon;
  50. unsigned long rxxoff;
  51. unsigned long txctson;
  52. unsigned long txctsoff;
  53. unsigned long rxrtson;
  54. unsigned long rxrtsoff;
  55. unsigned long modem;
  56. unsigned long state;
  57. unsigned long flags;
  58. unsigned long ttystate;
  59. unsigned long cflags;
  60. unsigned long iflags;
  61. unsigned long oflags;
  62. unsigned long lflags;
  63. unsigned long signals;
  64. } comstats_t;
  65. /*
  66. * Board stats structure. Returns useful info about the board.
  67. */
  68. #define COM_MAXPANELS 8
  69. typedef struct {
  70. unsigned long panel;
  71. unsigned long type;
  72. unsigned long hwid;
  73. unsigned long nrports;
  74. } companel_t;
  75. typedef struct {
  76. unsigned long brd;
  77. unsigned long type;
  78. unsigned long hwid;
  79. unsigned long state;
  80. unsigned long ioaddr;
  81. unsigned long ioaddr2;
  82. unsigned long memaddr;
  83. unsigned long irq;
  84. unsigned long nrpanels;
  85. unsigned long nrports;
  86. companel_t panels[COM_MAXPANELS];
  87. } combrd_t;
  88. /*
  89. * Define the ioctl operations for stats stuff.
  90. */
  91. #include <linux/ioctl.h>
  92. #define COM_GETPORTSTATS _IO('c',30)
  93. #define COM_CLRPORTSTATS _IO('c',31)
  94. #define COM_GETBRDSTATS _IO('c',32)
  95. /*
  96. * Define the set of ioctls that give user level access to the
  97. * private port, panel and board structures. The argument required
  98. * will be driver dependent!
  99. */
  100. #define COM_READPORT _IO('c',40)
  101. #define COM_READBOARD _IO('c',41)
  102. #define COM_READPANEL _IO('c',42)
  103. /*****************************************************************************/
  104. #endif