Add the DragonFly cvs id and perform general cleanups on cvs/rcs/sccs ids. Most
[dragonfly.git] / sys / net / i4b / include / i4b_l2l3.h
1 /*
2  * Copyright (c) 1997, 1999 Hellmuth Michaelis. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  * 1. Redistributions of source code must retain the above copyright
8  *    notice, this list of conditions and the following disclaimer.
9  * 2. Redistributions in binary form must reproduce the above copyright
10  *    notice, this list of conditions and the following disclaimer in the
11  *    documentation and/or other materials provided with the distribution.
12  *
13  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23  * SUCH DAMAGE.
24  *
25  *---------------------------------------------------------------------------
26  *
27  *      i4b_l2l3.h - i4b layer 2 / layer 3 interactions
28  *      -----------------------------------------------
29  *
30  *      $Id: i4b_l2l3.h,v 1.8 2000/06/02 16:14:35 hm Exp $
31  *
32  * $FreeBSD: src/sys/i4b/include/i4b_l2l3.h,v 1.6.2.1 2001/08/10 14:08:36 obrien Exp $
33  * $DragonFly: src/sys/net/i4b/include/i4b_l2l3.h,v 1.2 2003/06/17 04:28:39 dillon Exp $
34  *
35  *      last edit-date: [Fri Jun  2 14:33:34 2000]
36  *
37  *---------------------------------------------------------------------------*/
38
39 #ifndef _I4B_L2L3_H_
40 #define _I4B_L2L3_H_
41
42 extern struct i4b_l2l3_func i4b_l2l3_func;
43
44 struct i4b_l2l3_func
45 {
46         /* Layer 2 --> Layer 3 */
47         /* =================== */
48
49         int     (*DL_ESTABLISH_IND) (int);
50         int     (*DL_ESTABLISH_CNF) (int);
51         
52         int     (*DL_RELEASE_IND) (int);
53         int     (*DL_RELEASE_CNF) (int);
54
55         int     (*DL_DATA_IND) (int, struct mbuf *);
56
57         int     (*DL_UNIT_DATA_IND) (int, struct mbuf *);       
58         
59 #define DL_Est_Ind(unit)                \
60         ((*i4b_l2l3_func.DL_ESTABLISH_IND)(unit))
61 #define DL_Est_Cnf(unit)                \
62         ((*i4b_l2l3_func.DL_ESTABLISH_CNF)(unit))
63 #define DL_Rel_Ind(unit)                \
64         ((*i4b_l2l3_func.DL_RELEASE_IND)(unit))
65 #define DL_Rel_Cnf(unit)                \
66         ((*i4b_l2l3_func.DL_RELEASE_CNF)(unit))
67 #define DL_Data_Ind(unit, data)         \
68         ((*i4b_l2l3_func.DL_DATA_IND)(unit, data))
69 #define DL_Unit_Data_Ind(unit, data)    \
70         ((*i4b_l2l3_func.DL_UNIT_DATA_IND)(unit, data))
71         
72 #define DL_Est_Ind_A                    \
73         (i4b_l2l3_func.DL_ESTABLISH_IND)
74 #define DL_Est_Cnf_A                    \
75         (i4b_l2l3_func.DL_ESTABLISH_CNF)
76 #define DL_Rel_Ind_A                    \
77         (i4b_l2l3_func.DL_RELEASE_IND)
78 #define DL_Rel_Cnf_A                    \
79         (i4b_l2l3_func.DL_RELEASE_CNF)
80         
81         /* Layer 3 --> Layer 2 */       
82         /* =================== */
83
84         int     (*DL_ESTABLISH_REQ) (int);
85         
86         int     (*DL_RELEASE_REQ) (int);
87
88         int     (*DL_DATA_REQ) (int, struct mbuf *);
89
90         int     (*DL_UNIT_DATA_REQ) (int, struct mbuf *);       
91         
92 #define DL_Est_Req(unit)                \
93         ((*i4b_l2l3_func.DL_ESTABLISH_REQ)(unit))
94 #define DL_Rel_Req(unit)                \
95         ((*i4b_l2l3_func.DL_RELEASE_REQ)(unit))
96 #define DL_Data_Req(unit, data)         \
97         ((*i4b_l2l3_func.DL_DATA_REQ)(unit, data))
98 #define DL_Unit_Data_Req(unit, data)    \
99         ((*i4b_l2l3_func.DL_UNIT_DATA_REQ)(unit, data))
100
101         /* Layer 2 --> Layer 3 management */
102         /* ============================== */
103
104         int     (*MDL_STATUS_IND) (int, int, int);      /* L2 --> L3 status */
105         
106 #define MDL_Status_Ind(unit, status, parm)              \
107         ((*i4b_l2l3_func.MDL_STATUS_IND)(unit, status, parm))
108
109         /* Layer 3 --> Layer 2 management */
110         /* ============================== */
111
112         int     (*MDL_COMMAND_REQ) (int, int, void *);  /* L3 --> L2 command */
113
114 #define MDL_Command_Req(unit, command, parm)            \
115         ((*i4b_l2l3_func.MDL_COMMAND_REQ)(unit, command, parm))
116 };
117
118 #endif /* _I4B_L2L3_H_ */
119