source: svn/trunk/newcon3bcm2_21bu/toolchain/mips-linux-uclibc/include/linux/cycx_x25.h

Last change on this file was 2, checked in by jglee, 11 years ago

first commit

  • Property svn:executable set to *
File size: 3.9 KB
Line 
1#ifndef _CYCX_X25_H
2#define _CYCX_X25_H
3/*
4* cycx_x25.h    Cyclom X.25 firmware API definitions.
5*
6* Author:       Arnaldo Carvalho de Melo <acme@conectiva.com.br>
7*
8* Copyright:    (c) 1998-2003 Arnaldo Carvalho de Melo
9*
10* Based on sdla_x25.h by Gene Kozin <74604.152@compuserve.com>
11*
12*               This program is free software; you can redistribute it and/or
13*               modify it under the terms of the GNU General Public License
14*               as published by the Free Software Foundation; either version
15*               2 of the License, or (at your option) any later version.
16* ============================================================================
17* 2000/04/02    acme            dprintk and cycx_debug
18* 1999/01/03    acme            judicious use of data types
19* 1999/01/02    acme            #define X25_ACK_N3      0x4411
20* 1998/12/28    acme            cleanup: lot'o'things removed
21*                                        commands listed,
22*                                        TX25Cmd & TX25Config structs
23*                                        typedef'ed
24*/
25#ifndef PACKED
26#define PACKED __attribute__((packed))
27#endif
28
29#include <asm/types.h>
30
31/* X.25 shared memory layout. */
32#define X25_MBOX_OFFS   0x300   /* general mailbox block */
33#define X25_RXMBOX_OFFS 0x340   /* receive mailbox */
34
35/* Debug */
36#define dprintk(level, format, a...) if (cycx_debug >= level) printk(format, ##a)
37
38extern unsigned int cycx_debug;
39
40/* Data Structures */
41/* X.25 Command Block. */
42struct cycx_x25_cmd {
43        __u16 command PACKED;
44        __u16 link    PACKED; /* values: 0 or 1 */
45        __u16 len     PACKED; /* values: 0 thru 0x205 (517) */
46        __u32 buf     PACKED;
47};
48
49/* Defines for the 'command' field. */
50#define X25_CONNECT_REQUEST             0x4401
51#define X25_CONNECT_RESPONSE            0x4402
52#define X25_DISCONNECT_REQUEST          0x4403
53#define X25_DISCONNECT_RESPONSE         0x4404
54#define X25_DATA_REQUEST                0x4405
55#define X25_ACK_TO_VC                   0x4406
56#define X25_INTERRUPT_RESPONSE          0x4407
57#define X25_CONFIG                      0x4408
58#define X25_CONNECT_INDICATION          0x4409
59#define X25_CONNECT_CONFIRM             0x440A
60#define X25_DISCONNECT_INDICATION       0x440B
61#define X25_DISCONNECT_CONFIRM          0x440C
62#define X25_DATA_INDICATION             0x440E
63#define X25_INTERRUPT_INDICATION        0x440F
64#define X25_ACK_FROM_VC                 0x4410
65#define X25_ACK_N3                      0x4411
66#define X25_CONNECT_COLLISION           0x4413
67#define X25_N3WIN                       0x4414
68#define X25_LINE_ON                     0x4415
69#define X25_LINE_OFF                    0x4416
70#define X25_RESET_REQUEST               0x4417
71#define X25_LOG                         0x4500
72#define X25_STATISTIC                   0x4600
73#define X25_TRACE                       0x4700
74#define X25_N2TRACEXC                   0x4702
75#define X25_N3TRACEXC                   0x4703
76
77/**
78 *      struct cycx_x25_config - cyclom2x x25 firmware configuration
79 *      @link - link number
80 *      @speed - line speed
81 *      @clock - internal/external
82 *      @n2 - # of level 2 retransm.(values: 1 thru FF)
83 *      @n2win - level 2 window (values: 1 thru 7)
84 *      @n3win - level 3 window (values: 1 thru 7)
85 *      @nvc - # of logical channels (values: 1 thru 64)
86 *      @pktlen - level 3 packet lenght - log base 2 of size
87 *      @locaddr - my address
88 *      @remaddr - remote address
89 *      @t1 - time, in seconds
90 *      @t2 - time, in seconds
91 *      @t21 - time, in seconds
92 *      @npvc - # of permanent virt. circuits (1 thru nvc)
93 *      @t23 - time, in seconds
94 *      @flags - see dosx25.doc, in portuguese, for details
95 */
96struct cycx_x25_config {
97        __u8  link      PACKED;
98        __u8  speed     PACKED;
99        __u8  clock     PACKED;
100        __u8  n2                PACKED;
101        __u8  n2win     PACKED;
102        __u8  n3win     PACKED;
103        __u8  nvc               PACKED;
104        __u8  pktlen    PACKED;
105        __u8  locaddr   PACKED;
106        __u8  remaddr   PACKED;
107        __u16 t1                PACKED;
108        __u16 t2                PACKED;
109        __u8  t21               PACKED;
110        __u8  npvc      PACKED;
111        __u8  t23               PACKED;
112        __u8  flags     PACKED;
113};
114
115struct cycx_x25_stats {
116        __u16 rx_crc_errors     PACKED;
117        __u16 rx_over_errors    PACKED;
118        __u16 n2_tx_frames      PACKED;
119        __u16 n2_rx_frames      PACKED;
120        __u16 tx_timeouts       PACKED;
121        __u16 rx_timeouts       PACKED;
122        __u16 n3_tx_packets     PACKED;
123        __u16 n3_rx_packets     PACKED;
124        __u16 tx_aborts         PACKED;
125        __u16 rx_aborts         PACKED;
126};
127#endif  /* _CYCX_X25_H */
Note: See TracBrowser for help on using the repository browser.