comstats.h
上传用户:szlgq88
上传日期:2009-04-28
资源大小:48287k
文件大小:3k
源码类别:

嵌入式Linux

开发平台:

Unix_Linux

  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