Add support up to 2.6.31
[bcu1driver.git] / eib.h
blobb49cfa0c9f168d3a4a60688b808260c4b264362b
1 /*
2 eib.h - Low Level EIB driver for BCU 1
4 Copyright (C) 2000 Bernd Thallner <bernd@kangaroo.at>
6 This program is free software; you can redistribute it and/or
7 modify it under the terms of the GNU General Public License
8 as published by the Free Software Foundation; either version 2
9 of the License, or (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 struct eib_device_information {
23 char string[255];
24 unsigned long warning_flag;
25 int rb_length;
26 int wb_length;
27 int rb_max_length;
28 int wb_max_length;
29 unsigned long stat_rx_bytes;
30 unsigned long stat_tx_bytes;
31 unsigned long stat_rx_data_blocks;
32 unsigned long stat_tx_data_blocks;
33 unsigned long stat_max_rx_time_data_block;
34 unsigned long stat_max_tx_time_data_block;
35 int io;
36 int irq;
37 int major;
41 #define EIB_IOCTL_MAGIC ('E'+'I'+'B') // 0xd0
43 #define EIB_GET_BCU_VERSION _IO (EIB_IOCTL_MAGIC, 0)
44 #define EIB_CLEAR_WRITE_BUFFER _IO (EIB_IOCTL_MAGIC, 3)
45 #define EIB_CLEAR_READ_BUFFER _IO (EIB_IOCTL_MAGIC, 5)
47 /* the following are nops: not working */
48 #define EIB_GET_DEVICE_INFORMATION _IOR(EIB_IOCTL_MAGIC, 1, struct eib_device_information)
49 #define EIB_RESET_DEVICE_STATISTIC _IO (EIB_IOCTL_MAGIC, 2)
50 #define EIB_SINGLE_OPEN _IO (EIB_IOCTL_MAGIC, 4)
53 warning_flag:
54 0x00000001 interrupt_handler no interrupt pending ignore
55 0x00000002 0 interrupt_handler unexpected receive data interrupt reset reason, protocol error
56 0x00000004 3 6 interrupt_handler unexpected receive data interrupt reset reason, protocol error
57 0x00000008 3 6 interrupt_handler unexpected cts change to high reset reason, protocol error
58 0x00000010 0 interrupt_handler read buffer overflow reset, warning
59 0x00000020 2 interrupt_handler unexpected cts change to high reset reason, protocol error
60 0x00000040 interrupt_handler
61 do_temt_bh unknown state reset reason, coding error
62 0x00000080 2 5 interrupt_handler overrun reset reason, protocol error
63 0x00000100 5 interrupt_handler read forced info, normal operation
64 0x00000200 1 interrupt_handler unexpected receive data interrupt reset reason, protocol error
65 0x00000400 2 5 interrupt_handler parity error reset reason, physical layer error
66 0x00000800 4 interrupt_handler unexpected receive data interrupt reset reason, protocol error
67 0x00001000 3 do_temt_bh exceed MAX_TEMT_WAIT reset reason, protocol error
68 5 interrupt_handler
69 0x00002000 5 interrupt_handler unexpected byte received reset reason, protocol error
70 0x00004000 5 interrupt_handler read forced && read buffer full reset reason
71 0x00008000 5 interrupt_handler unexpected cts change reset reason, protocol error
72 0x00010000 initate_send_timer initate send with empty write buffer ignore, coding error
73 0x00020000 do_temt_bh bcu reset (info) info
74 0x00040000 3 6 check_int_pending unexpected receive data interrupt reset reason, protocol error
75 0x00040000 3 6 check_interrupt_pending unexpected cts change to high reset reason, protocol error
76 0x00100000 interrupt_handler
77 detect_reset_timer READ_WRITE_TIMEOUT reset reason, system load to high
78 0x00200000 detect_reset_timer exceed MAX_TIME_BETWEEN_INT reset reason, could be bcu reset
79 0x00400000 eib_ioctl clear write buffer user initated reset