1 /* $NetBSD: i4b_l1l2.h,v 1.9 2003/12/04 13:57:31 keihan Exp $ */
2
3 /*-
4 * Copyright (c) 2002 The NetBSD Foundation, Inc.
5 * All rights reserved.
6 *
7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Martin Husemann <martin@NetBSD.org>.
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
18 * 3. All advertising materials mentioning features or use of this software
19 * must display the following acknowledgement:
20 * This product includes software developed by the NetBSD
21 * Foundation, Inc. and its contributors.
22 * 4. Neither the name of The NetBSD Foundation nor the names of its
23 * contributors may be used to endorse or promote products derived
24 * from this software without specific prior written permission.
25 *
26 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
27 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
28 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
30 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36 * POSSIBILITY OF SUCH DAMAGE.
37 */
38
39 #ifndef _I4B_L1L2_H_
40 #define _I4B_L1L2_H_
41
42 /*
43 * This file defines the D-channel interface between layer 1 (physical
44 * card hardware) and layer 2 of a passive ISDN card (i.e. a card that
45 * does not run it's own ISDN stack in firmware).
46 *
47 * Since each layer 1 driver knows in advance it will need to attach
48 * to this layer 2, the whole layer 2 softc struct is typically included
49 * in the layer 1 softc.
50 *
51 * A back-pointer to the layer 1 softc is included (as void*) in this
52 * structure.
53 */
54
55 typedef void * isdn_layer1token;
56
57 /*
58 * Each driver attaching to layer 2 via this interface provides a pointer
59 * to a struct of function pointers used to communicate with layer 1, while
60 * layer 1 calls layer 2 functions directly (see below).
61 *
62 * Layer 1 functions called from layer 2:
63 */
64 struct isdn_layer1_isdnif_driver {
65 /* Request to transmit data. */
66 int (*ph_data_req)(isdn_layer1token, struct mbuf *, int);
67
68 /* Request to activate layer 1. */
69 int (*ph_activate_req)(isdn_layer1token);
70
71 /* Request to execute an internal command. */
72 int (*mph_command_req)(isdn_layer1token, int, void *);
73 };
74
75 /*
76 * Layer 2 functions called by layer 1:
77 */
78
79 /* Process a rx'd frame */
80 int isdn_layer2_data_ind(struct l2_softc * t, struct isdn_l3_driver *, struct mbuf *m);
81
82 /* Pass a layer 1 activation/deactivation to layer 2. */
83 int isdn_layer2_activate_ind(struct l2_softc *, struct isdn_l3_driver *, int);
84
85 /* Pass trace data to layer 2. */
86 struct i4b_trace_hdr; /* from i4b_trace.h */
87 int isdn_layer2_trace_ind(struct l2_softc *, struct isdn_l3_driver *, struct i4b_trace_hdr *, size_t, unsigned char *);
88
89 /* Pass status informations to layer 2. */
90 int isdn_layer2_status_ind(struct l2_softc *, struct isdn_l3_driver *, int, int);
91
92 #endif /* !_I4B_L1L2_H_ */
93
Cache object: 103ee2839d35270d00f3d2d79ac38586
|