2002-03-24 23:35:43 +03:00
|
|
|
/* $NetBSD: i4b_l1l2.h,v 1.4 2002/03/24 20:35:58 martin Exp $ */
|
2001-03-24 15:40:29 +03:00
|
|
|
|
2001-01-05 15:49:52 +03:00
|
|
|
/*
|
2002-03-24 23:35:43 +03:00
|
|
|
* Copyright (c) 2001-2002 Martin Husemann. All rights reserved.
|
2001-01-05 15:49:52 +03:00
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
|
|
|
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
* SUCH DAMAGE.
|
|
|
|
*
|
2001-03-24 15:40:29 +03:00
|
|
|
*/
|
2001-01-05 15:49:52 +03:00
|
|
|
|
|
|
|
#ifndef _I4B_L1L2_H_
|
|
|
|
#define _I4B_L1L2_H_
|
|
|
|
|
2001-03-24 15:40:29 +03:00
|
|
|
/*
|
2002-03-24 23:35:43 +03:00
|
|
|
* This file defines the D-channel interface between layer 1 (physical
|
|
|
|
* card hardware) and layer 2 of a passive ISDN card (i.e. a card that
|
|
|
|
* does not run it's own ISDN stack in firmware).
|
2001-03-24 15:40:29 +03:00
|
|
|
*
|
2002-03-24 23:35:43 +03:00
|
|
|
* Since each layer 1 driver knows in advance it will need to attach
|
|
|
|
* to this layer 2, the whole layer 2 softc struct is typically included
|
|
|
|
* in the layer 1 softc.
|
|
|
|
*
|
|
|
|
* A back-pointer to the layer 1 softc is included (as void*) in this
|
|
|
|
* structure.
|
2001-03-24 15:40:29 +03:00
|
|
|
*/
|
2001-01-05 15:49:52 +03:00
|
|
|
|
2001-03-24 15:40:29 +03:00
|
|
|
typedef void * isdn_layer1token;
|
2001-01-05 15:49:52 +03:00
|
|
|
|
2001-03-24 15:40:29 +03:00
|
|
|
/*
|
|
|
|
* Each driver attaching to layer 2 via this interface provides a pointer
|
|
|
|
* to a struct of function pointers used to communicate with layer 1, while
|
|
|
|
* layer 1 calls layer 2 functions directly (see below).
|
|
|
|
*
|
|
|
|
* Layer 1 functions called from layer 2:
|
|
|
|
*/
|
|
|
|
struct isdn_layer1_bri_driver {
|
|
|
|
/* Activate card and enable interrupts or disable it. */
|
|
|
|
int (*enable)(isdn_layer1token, int);
|
2001-01-05 15:49:52 +03:00
|
|
|
|
2001-03-24 15:40:29 +03:00
|
|
|
/* Request to transmit data. */
|
|
|
|
int (*ph_data_req)(isdn_layer1token, struct mbuf *, int);
|
2001-01-05 15:49:52 +03:00
|
|
|
|
2001-03-24 15:40:29 +03:00
|
|
|
/* Request to activate layer 1. */
|
|
|
|
int (*ph_activate_req)(isdn_layer1token);
|
2001-01-05 15:49:52 +03:00
|
|
|
|
2001-03-24 15:40:29 +03:00
|
|
|
/* Request to execute an internal command. */
|
|
|
|
int (*mph_command_req)(isdn_layer1token, int, void *);
|
2001-01-05 15:49:52 +03:00
|
|
|
};
|
2001-03-24 15:40:29 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Layer 2 functions called by layer 1:
|
|
|
|
*/
|
|
|
|
|
2002-03-24 23:35:43 +03:00
|
|
|
/* Process a rx'd frame */
|
|
|
|
int isdn_layer2_data_ind(struct l2_softc * t, struct mbuf *m);
|
2001-03-24 15:40:29 +03:00
|
|
|
|
|
|
|
/* Pass a layer 1 activation/deactivation to layer 2. */
|
2002-03-24 23:35:43 +03:00
|
|
|
int isdn_layer2_activate_ind(struct l2_softc *, int);
|
2001-03-24 15:40:29 +03:00
|
|
|
|
|
|
|
/* Pass trace data to layer 2. */
|
|
|
|
struct i4b_trace_hdr; /* from i4b_trace.h */
|
2002-03-24 23:35:43 +03:00
|
|
|
int isdn_layer2_trace_ind(struct l2_softc *, struct i4b_trace_hdr *, size_t, unsigned char *);
|
2001-03-24 15:40:29 +03:00
|
|
|
|
|
|
|
/* Pass status informations to layer 2. */
|
2002-03-24 23:35:43 +03:00
|
|
|
int isdn_layer2_status_ind(struct l2_softc *, int, int);
|
2001-01-05 15:49:52 +03:00
|
|
|
|
2001-03-24 15:40:29 +03:00
|
|
|
#endif /* !_I4B_L1L2_H_ */
|
2001-01-05 15:49:52 +03:00
|
|
|
|