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