kernel: Sync ACPICA with Intel's version 20140424.
[dragonfly.git] / sys / netproto / atm / uni / sscop_misc.h
1 /*
2  *
3  * ===================================
4  * HARP  |  Host ATM Research Platform
5  * ===================================
6  *
7  *
8  * This Host ATM Research Platform ("HARP") file (the "Software") is
9  * made available by Network Computing Services, Inc. ("NetworkCS")
10  * "AS IS".  NetworkCS does not provide maintenance, improvements or
11  * support of any kind.
12  *
13  * NETWORKCS MAKES NO WARRANTIES OR REPRESENTATIONS, EXPRESS OR IMPLIED,
14  * INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY
15  * AND FITNESS FOR A PARTICULAR PURPOSE, AS TO ANY ELEMENT OF THE
16  * SOFTWARE OR ANY SUPPORT PROVIDED IN CONNECTION WITH THIS SOFTWARE.
17  * In no event shall NetworkCS be responsible for any damages, including
18  * but not limited to consequential damages, arising from or relating to
19  * any use of the Software or related support.
20  *
21  * Copyright 1994-1998 Network Computing Services, Inc.
22  *
23  * Copies of this Software may be made, however, the above copyright
24  * notice must be reproduced on all copies.
25  *
26  *      @(#) $FreeBSD: src/sys/netatm/uni/sscop_misc.h,v 1.2 1999/08/28 00:48:59 peter Exp $
27  *      @(#) $DragonFly: src/sys/netproto/atm/uni/sscop_misc.h,v 1.2 2003/06/17 04:28:49 dillon Exp $
28  *
29  */
30
31 /*
32  * ATM Forum UNI Support
33  * ---------------------
34  *
35  * SSCOP miscellaneous definitions
36  *
37  */
38
39 #ifndef _UNI_SSCOP_MISC_H
40 #define _UNI_SSCOP_MISC_H
41
42 /*
43  * SSCOP command definitions
44  */
45 #define SSCOP_CMD_MIN   SSCOP_INIT      /* Minimum SSCOP CMD value */
46 #define SSCOP_CMD_MAX   SSCOP_RETRIEVECMP_IND   /* Maximum SSCOP CMD value */
47 #define SSCOP_CMD_SIZE  36              /* Size of command lookup table */
48
49
50 /*
51  * Management Errors
52  */
53 #define MAA_ERROR_MIN   'A'
54 #define MAA_ERROR_MAX   'X'
55 #define MAA_ERROR_INVAL (MAA_ERROR_MAX + 1)
56 #define MAA_ERROR_COUNT (MAA_ERROR_MAX - MAA_ERROR_MIN + 2)
57
58
59 /*
60  * SSCOP Sequence Numbers
61  *
62  * SSCOP sequence numbers are 24 bit integers using modulo arithmetic.
63  * The macros below must be used to modify and compare such numbers.
64  * Comparison of sequence numbers is always relative to some base number (b).
65  */
66 typedef u_int     sscop_seq;
67
68 #define SEQ_MOD         0xffffff
69 #define SEQ_VAL(v)      ((v) & SEQ_MOD)
70 #define SEQ_SET(s,v)    ((s) = SEQ_VAL(v))
71 #define SEQ_ADD(s,v)    (SEQ_VAL((s) + (v)))
72 #define SEQ_SUB(s,v)    (SEQ_VAL((s) - (v)))
73 #define SEQ_INCR(s,v)   ((s) = SEQ_VAL((s) + (v)))
74 #define SEQ_DECR(s,v)   ((s) = SEQ_VAL((s) - (v)))
75 #define SEQ_EQ(x,y)     (SEQ_VAL(x) == SEQ_VAL(y))
76 #define SEQ_NEQ(x,y)    (SEQ_VAL(x) != SEQ_VAL(y))
77 #define SEQ_LT(x,y,b)   (SEQ_VAL((x) - (b)) < SEQ_VAL((y) - (b)))
78 #define SEQ_LEQ(x,y,b)  (SEQ_VAL((x) - (b)) <= SEQ_VAL((y) - (b)))
79 #define SEQ_GT(x,y,b)   (SEQ_VAL((x) - (b)) > SEQ_VAL((y) - (b)))
80 #define SEQ_GEQ(x,y,b)  (SEQ_VAL((x) - (b)) >= SEQ_VAL((y) - (b)))
81
82
83 /*
84  * SSCOP Timers
85  *
86  * All of the SSCOP timer fields are maintained in terms of clock ticks.
87  * The timers tick 2 times per second.
88  */
89 #define SSCOP_HZ        2               /* SSCOP ticks per second */
90
91 #define SSCOP_T_NUM     4               /* Number of timers per connection */
92
93 #define SSCOP_T_POLL    0               /* Timer_POLL / Timer_KEEP-ALIVE */
94 #define SSCOP_T_NORESP  1               /* Timer_NO-RESPONSE */
95 #define SSCOP_T_CC      2               /* Timer_CC */
96 #define SSCOP_T_IDLE    3               /* Timer_IDLE */
97
98 #endif  /* _UNI_SSCOP_MISC_H */