/* $Id: capi.c,v 1.9.6.2 2001/09/23 22:24:32 kai Exp $
*
* ISDN lowlevel-module for the IBM ISDN-S0 Active 2000.
* CAPI encoder/decoder
*
* Author Fritz Elfert
* Copyright by Fritz Elfert <fritz@isdn4linux.de>
*
* This software may be used and distributed according to the terms
* of the GNU General Public License, incorporated herein by reference.
*
* Thanks to Friedemann Baitinger and IBM Germany
*
*/
#include "act2000.h"
#include "capi.h"
static actcapi_msgdsc valid_msg[] = {
{{ 0x86, 0x02}, "DATA_B3_IND"}, /* DATA_B3_IND/CONF must be first because of speed!!! */
{{ 0x86, 0x01}, "DATA_B3_CONF"},
{{ 0x02, 0x01}, "CONNECT_CONF"},
{{ 0x02, 0x02}, "CONNECT_IND"},
{{ 0x09, 0x01}, "CONNECT_INFO_CONF"},
{{ 0x03, 0x02}, "CONNECT_ACTIVE_IND"},
{{ 0x04, 0x01}, "DISCONNECT_CONF"},
{{ 0x04, 0x02}, "DISCONNECT_IND"},
{{ 0x05, 0x01}, "LISTEN_CONF"},
{{ 0x06, 0x01}, "GET_PARAMS_CONF"},
{{ 0x07, 0x01}, "INFO_CONF"},
{{ 0x07, 0x02}, "INFO_IND"},
{{ 0x08, 0x01}, "DATA_CONF"},
{{ 0x08, 0x02}, "DATA_IND"},
{{ 0x40, 0x01}, "SELECT_B2_PROTOCOL_CONF"},
{{ 0x80, 0x01}, "SELECT_B3_PROTOCOL_CONF"},
{{ 0x81, 0x01}, "LISTEN_B3_CONF"},
{{ 0x82, 0x01}, "CONNECT_B3_CONF"},
{{ 0x82, 0x02}, "CONNECT_B3_IND"},
{{ 0x83, 0x02}, "CONNECT_B3_ACTIVE_IND"},
{{ 0x84, 0x01}, "DISCONNECT_B3_CONF"},
{{ 0x84, 0x02}, "DISCONNECT_B3_IND"},
{{ 0x85, 0x01}, "GET_B3_PARAMS_CONF"},
{{ 0x01, 0x01}, "RESET_B3_CONF"},
{{ 0x01, 0x02}, "RESET_B3_IND"},
/* {{ 0x87, 0x02, "HANDSET_IND"}, not implemented */
{{ 0xff, 0x01}, "MANUFACTURER_CONF"},
{{ 0xff, 0x02}, "MANUFACTURER_IND"},
#ifdef DEBUG_MSG
/* Requests */
{{ 0x01, 0x00}, "RESET_B3_REQ"},
{{ 0x02, 0x00}, "CONNECT_REQ"},
{{ 0x04, 0x00}, "DISCONNECT_REQ"},
{{ 0x05, 0x00}, "LISTEN_REQ"},
{{ 0x06, 0x00}, "GET_PARAMS_REQ"},
{{ 0x07, 0x00}, "INFO_REQ"},
{{ 0x08, 0x00}, "DATA_REQ"},
{{ 0x09, 0x00}, "CONNECT_INFO_REQ"},
{{ 0x40, 0x00}, "SELECT_B2_PROTOCOL_REQ"},
{{ 0x80, 0x00}, "SELECT_B3_PROTOCOL_REQ"},
{{ 0x81, 0x00}, "LISTEN_B3_REQ"},
{{ 0x82, 0x00}, "CONNECT_B3_REQ"},
{{ 0x84, 0x00}, "DISCONNECT_B3_REQ"},
{{ 0x85, 0x00}, "GET_B3_PARAMS_REQ"},
{{ 0x86, 0x00}, "DATA_B3_REQ"},
{{ 0xff, 0x00}, "MANUFACTURER_REQ"},
/* Responses */
{{ 0x01, 0x03}, "RESET_B3_RESP"},
{{ 0x02, 0x03}, "CONNECT_RESP"},
{{ 0x03, 0x03}, "CONNECT_ACTIVE_RESP"},
{{ 0x04, 0x03}, "DISCONNECT_RESP"},
{{ 0x07, 0x03}, "INFO_RESP"},
{{ 0x08, 0x03<