Import 2.3.25pre1
[davej-history.git] / include / linux / cycx_x25.h
blobe242e579553d5f91cb3c5bf5a3f5ce4ea8b8450e
1 /*
2 * cycx_x25.h Cyclom X.25 firmware API definitions.
4 * Author: Arnaldo Carvalho de Melo <acme@conectiva.com.br>
6 * Copyright: (c) 1998, 1999 Arnaldo Carvalho de Melo
8 * Based on sdla_x25.h by Gene Kozin <74604.152@compuserve.com>
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version
13 * 2 of the License, or (at your option) any later version.
14 * ============================================================================
15 * 1999/01/03 acme judicious use of data types
17 * 1999/01/02 acme #define X25_ACK_N3 0x4411
18 * Dec 28, 1998 Arnaldo cleanup: lot'o'things removed
19 * commands listed,
20 * TX25Cmd & TX25Config structs
21 * typedef'ed
23 #ifndef _CYCX_X25_H
24 #define _CYCX_X25_H
26 #ifndef PACKED
27 #define PACKED __attribute__((packed))
28 #endif
30 /* X.25 shared memory layout. */
31 #define X25_MBOX_OFFS 0x300 /* general mailbox block */
32 #define X25_RXMBOX_OFFS 0x340 /* receive mailbox */
34 /* DATA STRUCTURES */
35 /* X.25 Command Block. */
36 typedef struct X25Cmd
38 u16 command PACKED;
39 u16 link PACKED; /* values: 0 or 1 */
40 u16 len PACKED; /* values: 0 thru 0x205 (517) */
41 u32 buf PACKED;
42 } TX25Cmd;
44 /* Defines for the 'command' field. */
45 #define X25_CONNECT_REQUEST 0x4401
46 #define X25_CONNECT_RESPONSE 0x4402
47 #define X25_DISCONNECT_REQUEST 0x4403
48 #define X25_DISCONNECT_RESPONSE 0x4404
49 #define X25_DATA_REQUEST 0x4405
50 #define X25_ACK_TO_VC 0x4406
51 #define X25_INTERRUPT_RESPONSE 0x4407
52 #define X25_CONFIG 0x4408
53 #define X25_CONNECT_INDICATION 0x4409
54 #define X25_CONNECT_CONFIRM 0x440A
55 #define X25_DISCONNECT_INDICATION 0x440B
56 #define X25_DISCONNECT_CONFIRM 0x440C
57 #define X25_DATA_INDICATION 0x440E
58 #define X25_INTERRUPT_INDICATION 0x440F
59 #define X25_ACK_FROM_VC 0x4410
60 #define X25_ACK_N3 0x4411
61 #define X25_CONNECT_COLLISION 0x4413
62 #define X25_N3WIN 0x4414
63 #define X25_LINE_ON 0x4415
64 #define X25_LINE_OFF 0x4416
65 #define X25_RESET_REQUEST 0x4417
66 #define X25_LOG 0x4500
67 #define X25_STATISTIC 0x4600
68 #define X25_TRACE 0x4700
69 #define X25_N2TRACEXC 0x4702
70 #define X25_N3TRACEXC 0x4703
72 typedef struct X25Config {
73 u8 link PACKED; /* link number */
74 u8 speed PACKED; /* line speed */
75 u8 clock PACKED; /* internal/external */
76 u8 n2 PACKED; /* # of level 2 retransm.(values: 1 thru FF) */
77 u8 n2win PACKED; /* level 2 window (values: 1 thru 7) */
78 u8 n3win PACKED; /* level 3 window (values: 1 thru 7) */
79 u8 nvc PACKED; /* # of logical channels (values: 1 thru 64) */
80 u8 pktlen PACKED; /* level 3 packet lenght - log base 2 of size */
81 u8 locaddr PACKED; /* my address */
82 u8 remaddr PACKED; /* remote address */
83 u16 t1 PACKED; /* time, in seconds */
84 u16 t2 PACKED; /* time, in seconds */
85 u8 t21 PACKED; /* time, in seconds */
86 u8 npvc PACKED; /* # of permanent virt. circuits (1 thru nvc) */
87 u8 t23 PACKED; /* time, in seconds */
88 u8 flags PACKED; /* see dosx25.doc, in portuguese, for details */
89 } TX25Config;
91 typedef struct X25Stats {
92 u16 rx_crc_errors PACKED;
93 u16 rx_over_errors PACKED;
94 u16 n2_tx_frames PACKED;
95 u16 n2_rx_frames PACKED;
96 u16 tx_timeouts PACKED;
97 u16 rx_timeouts PACKED;
98 u16 n3_tx_packets PACKED;
99 u16 n3_rx_packets PACKED;
100 u16 tx_aborts PACKED;
101 u16 rx_aborts PACKED;
102 } TX25Stats;
103 #endif /* _CYCX_X25_H */