From e1f4c485cdb2b1d7aae172b731f6c2b403381ebb Mon Sep 17 00:00:00 2001 From: Danny Kukawka Date: Thu, 2 Feb 2012 03:20:28 +0000 Subject: eicon: fix -Warray-bounds warning Fix for a -Warray-bounds warning. mixer_notify_update() tries to write to ((CAPI_MSG *) msg)->info.facility_req.structs[3] while structs is defined as byte structs[1]. Set all 'structs' which are part of the typdefs in the info union to 'byte structs[0]'. v2: set all info.*.structs to byte structs[0] Signed-off-by: Danny Kukawka Signed-off-by: David S. Miller --- drivers/isdn/hardware/eicon/capi20.h | 60 ++++++++++++++++++------------------ 1 file changed, 30 insertions(+), 30 deletions(-) (limited to 'drivers/isdn/hardware/eicon') diff --git a/drivers/isdn/hardware/eicon/capi20.h b/drivers/isdn/hardware/eicon/capi20.h index 7ebcccda74d..27ecd61888d 100644 --- a/drivers/isdn/hardware/eicon/capi20.h +++ b/drivers/isdn/hardware/eicon/capi20.h @@ -117,7 +117,7 @@ typedef struct api_profile_s { /*------------------------------------------------------------------*/ /* ALERT-REQUEST */ typedef struct { - byte structs[1]; /* Additional Info */ + byte structs[0]; /* Additional Info */ } _ALT_REQP; /* ALERT-CONFIRM */ typedef struct { @@ -126,7 +126,7 @@ typedef struct { /* CONNECT-REQUEST */ typedef struct { word CIP_Value; - byte structs[1]; /* Called party number, + byte structs[0]; /* Called party number, Called party subaddress, Calling party number, Calling party subaddress, @@ -143,7 +143,7 @@ typedef struct { /* CONNECT-INDICATION */ typedef struct { word CIP_Value; - byte structs[1]; /* Called party number, + byte structs[0]; /* Called party number, Called party subaddress, Calling party number, Calling party subaddress, @@ -155,24 +155,24 @@ typedef struct { /* CONNECT-RESPONSE */ typedef struct { word Accept; - byte structs[1]; /* B_protocol, + byte structs[0]; /* B_protocol, Connected party number, Connected party subaddress, LLC */ } _CON_RESP; /* CONNECT-ACTIVE-INDICATION */ typedef struct { - byte structs[1]; /* Connected party number, + byte structs[0]; /* Connected party number, Connected party subaddress, LLC */ } _CON_A_INDP; /* CONNECT-ACTIVE-RESPONSE */ typedef struct { - byte structs[1]; /* empty */ + byte structs[0]; /* empty */ } _CON_A_RESP; /* DISCONNECT-REQUEST */ typedef struct { - byte structs[1]; /* Additional Info */ + byte structs[0]; /* Additional Info */ } _DIS_REQP; /* DISCONNECT-CONFIRM */ typedef struct { @@ -184,13 +184,13 @@ typedef struct { } _DIS_INDP; /* DISCONNECT-RESPONSE */ typedef struct { - byte structs[1]; /* empty */ + byte structs[0]; /* empty */ } _DIS_RESP; /* LISTEN-REQUEST */ typedef struct { dword Info_Mask; dword CIP_Mask; - byte structs[1]; /* Calling party number, + byte structs[0]; /* Calling party number, Calling party subaddress */ } _LIS_REQP; /* LISTEN-CONFIRM */ @@ -199,7 +199,7 @@ typedef struct { } _LIS_CONP; /* INFO-REQUEST */ typedef struct { - byte structs[1]; /* Called party number, + byte structs[0]; /* Called party number, Additional Info */ } _INF_REQP; /* INFO-CONFIRM */ @@ -209,15 +209,15 @@ typedef struct { /* INFO-INDICATION */ typedef struct { word Number; - byte structs[1]; /* Info element */ + byte structs[0]; /* Info element */ } _INF_INDP; /* INFO-RESPONSE */ typedef struct { - byte structs[1]; /* empty */ + byte structs[0]; /* empty */ } _INF_RESP; /* SELECT-B-REQUEST */ typedef struct { - byte structs[1]; /* B-protocol */ + byte structs[0]; /* B-protocol */ } _SEL_B_REQP; /* SELECT-B-CONFIRM */ typedef struct { @@ -226,7 +226,7 @@ typedef struct { /* FACILITY-REQUEST */ typedef struct { word Selector; - byte structs[1]; /* Facility parameters */ + byte structs[0]; /* Facility parameters */ } _FAC_REQP; /* FACILITY-CONFIRM STRUCT FOR SUPPLEMENT. SERVICES */ typedef struct { @@ -240,21 +240,21 @@ typedef struct { typedef struct { word Info; word Selector; - byte structs[1]; /* Facility parameters */ + byte structs[0]; /* Facility parameters */ } _FAC_CONP; /* FACILITY-INDICATION */ typedef struct { word Selector; - byte structs[1]; /* Facility parameters */ + byte structs[0]; /* Facility parameters */ } _FAC_INDP; /* FACILITY-RESPONSE */ typedef struct { word Selector; - byte structs[1]; /* Facility parameters */ + byte structs[0]; /* Facility parameters */ } _FAC_RESP; /* CONNECT-B3-REQUEST */ typedef struct { - byte structs[1]; /* NCPI */ + byte structs[0]; /* NCPI */ } _CON_B3_REQP; /* CONNECT-B3-CONFIRM */ typedef struct { @@ -262,24 +262,24 @@ typedef struct { } _CON_B3_CONP; /* CONNECT-B3-INDICATION */ typedef struct { - byte structs[1]; /* NCPI */ + byte structs[0]; /* NCPI */ } _CON_B3_INDP; /* CONNECT-B3-RESPONSE */ typedef struct { word Accept; - byte structs[1]; /* NCPI */ + byte structs[0]; /* NCPI */ } _CON_B3_RESP; /* CONNECT-B3-ACTIVE-INDICATION */ typedef struct { - byte structs[1]; /* NCPI */ + byte structs[0]; /* NCPI */ } _CON_B3_A_INDP; /* CONNECT-B3-ACTIVE-RESPONSE */ typedef struct { - byte structs[1]; /* empty */ + byte structs[0]; /* empty */ } _CON_B3_A_RESP; /* DISCONNECT-B3-REQUEST */ typedef struct { - byte structs[1]; /* NCPI */ + byte structs[0]; /* NCPI */ } _DIS_B3_REQP; /* DISCONNECT-B3-CONFIRM */ typedef struct { @@ -288,11 +288,11 @@ typedef struct { /* DISCONNECT-B3-INDICATION */ typedef struct { word Info; - byte structs[1]; /* NCPI */ + byte structs[0]; /* NCPI */ } _DIS_B3_INDP; /* DISCONNECT-B3-RESPONSE */ typedef struct { - byte structs[1]; /* empty */ + byte structs[0]; /* empty */ } _DIS_B3_RESP; /* DATA-B3-REQUEST */ typedef struct { @@ -335,7 +335,7 @@ typedef struct { } _DAT_B3_RESP; /* RESET-B3-REQUEST */ typedef struct { - byte structs[1]; /* NCPI */ + byte structs[0]; /* NCPI */ } _RES_B3_REQP; /* RESET-B3-CONFIRM */ typedef struct { @@ -343,20 +343,20 @@ typedef struct { } _RES_B3_CONP; /* RESET-B3-INDICATION */ typedef struct { - byte structs[1]; /* NCPI */ + byte structs[0]; /* NCPI */ } _RES_B3_INDP; /* RESET-B3-RESPONSE */ typedef struct { - byte structs[1]; /* empty */ + byte structs[0]; /* empty */ } _RES_B3_RESP; /* CONNECT-B3-T90-ACTIVE-INDICATION */ typedef struct { - byte structs[1]; /* NCPI */ + byte structs[0]; /* NCPI */ } _CON_B3_T90_A_INDP; /* CONNECT-B3-T90-ACTIVE-RESPONSE */ typedef struct { word Reject; - byte structs[1]; /* NCPI */ + byte structs[0]; /* NCPI */ } _CON_B3_T90_A_RESP; /*------------------------------------------------------------------*/ /* message structure */ -- cgit v1.2.3-18-g5258 From 475be4d85a274d0961593db41cf85689db1d583c Mon Sep 17 00:00:00 2001 From: Joe Perches Date: Sun, 19 Feb 2012 19:52:38 -0800 Subject: isdn: whitespace coding style cleanup isdn source code uses a not-current coding style. Update the coding style used on a per-line basis so that git diff -w shows only elided blank lines at EOF. Done with emacs and some scripts and some typing. Built x86 allyesconfig. No detected change in objdump -d or size. Signed-off-by: Joe Perches --- drivers/isdn/hardware/eicon/capi20.h | 514 +- drivers/isdn/hardware/eicon/capidtmf.c | 1094 +- drivers/isdn/hardware/eicon/capidtmf.h | 78 +- drivers/isdn/hardware/eicon/capifunc.c | 222 +- drivers/isdn/hardware/eicon/capifunc.h | 4 +- drivers/isdn/hardware/eicon/capimain.c | 10 +- drivers/isdn/hardware/eicon/cardtype.h | 1476 +- drivers/isdn/hardware/eicon/cp_vers.h | 32 +- drivers/isdn/hardware/eicon/dadapter.c | 576 +- drivers/isdn/hardware/eicon/dadapter.h | 36 +- drivers/isdn/hardware/eicon/debug.c | 3519 ++-- drivers/isdn/hardware/eicon/debug_if.h | 82 +- drivers/isdn/hardware/eicon/debuglib.c | 176 +- drivers/isdn/hardware/eicon/debuglib.h | 272 +- drivers/isdn/hardware/eicon/dfifo.h | 56 +- drivers/isdn/hardware/eicon/di.c | 1430 +- drivers/isdn/hardware/eicon/di.h | 156 +- drivers/isdn/hardware/eicon/di_dbg.h | 34 +- drivers/isdn/hardware/eicon/di_defs.h | 144 +- drivers/isdn/hardware/eicon/did_vers.h | 32 +- drivers/isdn/hardware/eicon/diddfunc.c | 22 +- drivers/isdn/hardware/eicon/diva.c | 160 +- drivers/isdn/hardware/eicon/diva_didd.c | 16 +- drivers/isdn/hardware/eicon/diva_dma.c | 116 +- drivers/isdn/hardware/eicon/diva_dma.h | 62 +- drivers/isdn/hardware/eicon/diva_pci.h | 6 +- drivers/isdn/hardware/eicon/divacapi.h | 630 +- drivers/isdn/hardware/eicon/divamnt.c | 15 +- drivers/isdn/hardware/eicon/divasfunc.c | 34 +- drivers/isdn/hardware/eicon/divasi.c | 56 +- drivers/isdn/hardware/eicon/divasmain.c | 118 +- drivers/isdn/hardware/eicon/divasproc.c | 58 +- drivers/isdn/hardware/eicon/divasync.h | 562 +- drivers/isdn/hardware/eicon/dqueue.c | 14 +- drivers/isdn/hardware/eicon/dqueue.h | 14 +- drivers/isdn/hardware/eicon/dsp_defs.h | 256 +- drivers/isdn/hardware/eicon/dsp_tst.h | 8 +- drivers/isdn/hardware/eicon/dspdids.h | 30 +- drivers/isdn/hardware/eicon/dsrv4bri.h | 34 +- drivers/isdn/hardware/eicon/dsrv_bri.h | 44 +- drivers/isdn/hardware/eicon/dsrv_pri.h | 46 +- drivers/isdn/hardware/eicon/entity.h | 14 +- drivers/isdn/hardware/eicon/helpers.h | 68 +- drivers/isdn/hardware/eicon/idifunc.c | 22 +- drivers/isdn/hardware/eicon/io.c | 1414 +- drivers/isdn/hardware/eicon/io.h | 514 +- drivers/isdn/hardware/eicon/istream.c | 352 +- drivers/isdn/hardware/eicon/kst_ifc.h | 227 +- drivers/isdn/hardware/eicon/maintidi.c | 2277 ++- drivers/isdn/hardware/eicon/maintidi.h | 105 +- drivers/isdn/hardware/eicon/man_defs.h | 36 +- drivers/isdn/hardware/eicon/mdm_msg.h | 72 +- drivers/isdn/hardware/eicon/message.c | 28300 ++++++++++++++-------------- drivers/isdn/hardware/eicon/mi_pc.h | 86 +- drivers/isdn/hardware/eicon/mntfunc.c | 186 +- drivers/isdn/hardware/eicon/os_4bri.c | 352 +- drivers/isdn/hardware/eicon/os_4bri.h | 2 +- drivers/isdn/hardware/eicon/os_bri.c | 262 +- drivers/isdn/hardware/eicon/os_bri.h | 2 +- drivers/isdn/hardware/eicon/os_capi.h | 10 +- drivers/isdn/hardware/eicon/os_pri.c | 390 +- drivers/isdn/hardware/eicon/os_pri.h | 2 +- drivers/isdn/hardware/eicon/pc.h | 268 +- drivers/isdn/hardware/eicon/pc_init.h | 48 +- drivers/isdn/hardware/eicon/pc_maint.h | 158 +- drivers/isdn/hardware/eicon/pkmaint.h | 43 +- drivers/isdn/hardware/eicon/platform.h | 156 +- drivers/isdn/hardware/eicon/pr_pc.h | 116 +- drivers/isdn/hardware/eicon/s_4bri.c | 488 +- drivers/isdn/hardware/eicon/s_bri.c | 288 +- drivers/isdn/hardware/eicon/s_pri.c | 314 +- drivers/isdn/hardware/eicon/sdp_hdr.h | 130 +- drivers/isdn/hardware/eicon/um_idi.c | 224 +- drivers/isdn/hardware/eicon/um_idi.h | 2 +- drivers/isdn/hardware/eicon/xdi_adapter.h | 12 +- drivers/isdn/hardware/eicon/xdi_msg.h | 2 +- drivers/isdn/hardware/eicon/xdi_vers.h | 32 +- 77 files changed, 24604 insertions(+), 24614 deletions(-) (limited to 'drivers/isdn/hardware/eicon') diff --git a/drivers/isdn/hardware/eicon/capi20.h b/drivers/isdn/hardware/eicon/capi20.h index 27ecd61888d..391e4175b0b 100644 --- a/drivers/isdn/hardware/eicon/capi20.h +++ b/drivers/isdn/hardware/eicon/capi20.h @@ -1,74 +1,74 @@ /* * - Copyright (c) Eicon Networks, 2002. + Copyright (c) Eicon Networks, 2002. * - This source file is supplied for the use with - Eicon Networks range of DIVA Server Adapters. + This source file is supplied for the use with + Eicon Networks range of DIVA Server Adapters. * - Eicon File Revision : 2.1 + Eicon File Revision : 2.1 * - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. * - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY OF ANY KIND WHATSOEVER INCLUDING ANY - implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY OF ANY KIND WHATSOEVER INCLUDING ANY + implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU General Public License for more details. * - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * */ -#ifndef _INC_CAPI20 +#ifndef _INC_CAPI20 #define _INC_CAPI20 - /* operations on message queues */ - /* the common device type for CAPI20 drivers */ +/* operations on message queues */ +/* the common device type for CAPI20 drivers */ #define FILE_DEVICE_CAPI20 0x8001 - /* DEVICE_CONTROL codes for user and kernel mode applications */ +/* DEVICE_CONTROL codes for user and kernel mode applications */ #define CAPI20_CTL_REGISTER 0x0801 #define CAPI20_CTL_RELEASE 0x0802 #define CAPI20_CTL_GET_MANUFACTURER 0x0805 #define CAPI20_CTL_GET_VERSION 0x0806 #define CAPI20_CTL_GET_SERIAL 0x0807 #define CAPI20_CTL_GET_PROFILE 0x0808 - /* INTERNAL_DEVICE_CONTROL codes for kernel mode applicatios only */ +/* INTERNAL_DEVICE_CONTROL codes for kernel mode applicatios only */ #define CAPI20_CTL_PUT_MESSAGE 0x0803 #define CAPI20_CTL_GET_MESSAGE 0x0804 - /* the wrapped codes as required by the system */ -#define CAPI_CTL_CODE(f,m) CTL_CODE(FILE_DEVICE_CAPI20,f,m,FILE_ANY_ACCESS) -#define IOCTL_CAPI_REGISTER CAPI_CTL_CODE(CAPI20_CTL_REGISTER,METHOD_BUFFERED) -#define IOCTL_CAPI_RELEASE CAPI_CTL_CODE(CAPI20_CTL_RELEASE,METHOD_BUFFERED) -#define IOCTL_CAPI_GET_MANUFACTURER CAPI_CTL_CODE(CAPI20_CTL_GET_MANUFACTURER,METHOD_BUFFERED) -#define IOCTL_CAPI_GET_VERSION CAPI_CTL_CODE(CAPI20_CTL_GET_VERSION,METHOD_BUFFERED) -#define IOCTL_CAPI_GET_SERIAL CAPI_CTL_CODE(CAPI20_CTL_GET_SERIAL,METHOD_BUFFERED) -#define IOCTL_CAPI_GET_PROFILE CAPI_CTL_CODE(CAPI20_CTL_GET_PROFILE,METHOD_BUFFERED) -#define IOCTL_CAPI_PUT_MESSAGE CAPI_CTL_CODE(CAPI20_CTL_PUT_MESSAGE,METHOD_BUFFERED) -#define IOCTL_CAPI_GET_MESSAGE CAPI_CTL_CODE(CAPI20_CTL_GET_MESSAGE,METHOD_BUFFERED) +/* the wrapped codes as required by the system */ +#define CAPI_CTL_CODE(f, m) CTL_CODE(FILE_DEVICE_CAPI20, f, m, FILE_ANY_ACCESS) +#define IOCTL_CAPI_REGISTER CAPI_CTL_CODE(CAPI20_CTL_REGISTER, METHOD_BUFFERED) +#define IOCTL_CAPI_RELEASE CAPI_CTL_CODE(CAPI20_CTL_RELEASE, METHOD_BUFFERED) +#define IOCTL_CAPI_GET_MANUFACTURER CAPI_CTL_CODE(CAPI20_CTL_GET_MANUFACTURER, METHOD_BUFFERED) +#define IOCTL_CAPI_GET_VERSION CAPI_CTL_CODE(CAPI20_CTL_GET_VERSION, METHOD_BUFFERED) +#define IOCTL_CAPI_GET_SERIAL CAPI_CTL_CODE(CAPI20_CTL_GET_SERIAL, METHOD_BUFFERED) +#define IOCTL_CAPI_GET_PROFILE CAPI_CTL_CODE(CAPI20_CTL_GET_PROFILE, METHOD_BUFFERED) +#define IOCTL_CAPI_PUT_MESSAGE CAPI_CTL_CODE(CAPI20_CTL_PUT_MESSAGE, METHOD_BUFFERED) +#define IOCTL_CAPI_GET_MESSAGE CAPI_CTL_CODE(CAPI20_CTL_GET_MESSAGE, METHOD_BUFFERED) struct divas_capi_register_params { - word MessageBufferSize; - word maxLogicalConnection; - word maxBDataBlocks; - word maxBDataLen; + word MessageBufferSize; + word maxLogicalConnection; + word maxBDataBlocks; + word maxBDataLen; }; struct divas_capi_version { - word CapiMajor; - word CapiMinor; - word ManuMajor; - word ManuMinor; + word CapiMajor; + word CapiMinor; + word ManuMajor; + word ManuMinor; }; typedef struct api_profile_s { - word Number; - word Channels; - dword Global_Options; - dword B1_Protocols; - dword B2_Protocols; - dword B3_Protocols; + word Number; + word Channels; + dword Global_Options; + dword B1_Protocols; + dword B2_Protocols; + dword B3_Protocols; } API_PROFILE; - /* ISDN Common API message types */ +/* ISDN Common API message types */ #define _ALERT_R 0x8001 #define _CONNECT_R 0x8002 #define _CONNECT_I 0x8202 @@ -93,9 +93,9 @@ typedef struct api_profile_s { #define _CONNECT_B3_T90_ACTIVE_I 0x8288 #define _MANUFACTURER_R 0x80ff #define _MANUFACTURER_I 0x82ff - /* OR this to convert a REQUEST to a CONFIRM */ +/* OR this to convert a REQUEST to a CONFIRM */ #define CONFIRM 0x0100 - /* OR this to convert a INDICATION to a RESPONSE */ +/* OR this to convert a INDICATION to a RESPONSE */ #define RESPONSE 0x0100 /*------------------------------------------------------------------*/ /* diehl isdn private MANUFACTURER codes */ @@ -115,248 +115,248 @@ typedef struct api_profile_s { /*------------------------------------------------------------------*/ /* parameter structures */ /*------------------------------------------------------------------*/ - /* ALERT-REQUEST */ +/* ALERT-REQUEST */ typedef struct { - byte structs[0]; /* Additional Info */ + byte structs[0]; /* Additional Info */ } _ALT_REQP; - /* ALERT-CONFIRM */ +/* ALERT-CONFIRM */ typedef struct { - word Info; + word Info; } _ALT_CONP; - /* CONNECT-REQUEST */ -typedef struct { - word CIP_Value; - byte structs[0]; /* Called party number, - Called party subaddress, - Calling party number, - Calling party subaddress, - B_protocol, - BC, - LLC, - HLC, - Additional Info */ +/* CONNECT-REQUEST */ +typedef struct { + word CIP_Value; + byte structs[0]; /* Called party number, + Called party subaddress, + Calling party number, + Calling party subaddress, + B_protocol, + BC, + LLC, + HLC, + Additional Info */ } _CON_REQP; - /* CONNECT-CONFIRM */ +/* CONNECT-CONFIRM */ typedef struct { - word Info; + word Info; } _CON_CONP; - /* CONNECT-INDICATION */ -typedef struct { - word CIP_Value; - byte structs[0]; /* Called party number, - Called party subaddress, - Calling party number, - Calling party subaddress, - BC, - LLC, - HLC, - Additional Info */ +/* CONNECT-INDICATION */ +typedef struct { + word CIP_Value; + byte structs[0]; /* Called party number, + Called party subaddress, + Calling party number, + Calling party subaddress, + BC, + LLC, + HLC, + Additional Info */ } _CON_INDP; - /* CONNECT-RESPONSE */ +/* CONNECT-RESPONSE */ typedef struct { - word Accept; - byte structs[0]; /* B_protocol, - Connected party number, - Connected party subaddress, - LLC */ + word Accept; + byte structs[0]; /* B_protocol, + Connected party number, + Connected party subaddress, + LLC */ } _CON_RESP; - /* CONNECT-ACTIVE-INDICATION */ +/* CONNECT-ACTIVE-INDICATION */ typedef struct { - byte structs[0]; /* Connected party number, - Connected party subaddress, - LLC */ + byte structs[0]; /* Connected party number, + Connected party subaddress, + LLC */ } _CON_A_INDP; - /* CONNECT-ACTIVE-RESPONSE */ +/* CONNECT-ACTIVE-RESPONSE */ typedef struct { - byte structs[0]; /* empty */ + byte structs[0]; /* empty */ } _CON_A_RESP; - /* DISCONNECT-REQUEST */ +/* DISCONNECT-REQUEST */ typedef struct { - byte structs[0]; /* Additional Info */ + byte structs[0]; /* Additional Info */ } _DIS_REQP; - /* DISCONNECT-CONFIRM */ +/* DISCONNECT-CONFIRM */ typedef struct { - word Info; + word Info; } _DIS_CONP; - /* DISCONNECT-INDICATION */ +/* DISCONNECT-INDICATION */ typedef struct { - word Info; + word Info; } _DIS_INDP; - /* DISCONNECT-RESPONSE */ +/* DISCONNECT-RESPONSE */ typedef struct { - byte structs[0]; /* empty */ + byte structs[0]; /* empty */ } _DIS_RESP; - /* LISTEN-REQUEST */ +/* LISTEN-REQUEST */ typedef struct { - dword Info_Mask; - dword CIP_Mask; - byte structs[0]; /* Calling party number, - Calling party subaddress */ + dword Info_Mask; + dword CIP_Mask; + byte structs[0]; /* Calling party number, + Calling party subaddress */ } _LIS_REQP; - /* LISTEN-CONFIRM */ +/* LISTEN-CONFIRM */ typedef struct { - word Info; + word Info; } _LIS_CONP; - /* INFO-REQUEST */ +/* INFO-REQUEST */ typedef struct { - byte structs[0]; /* Called party number, - Additional Info */ + byte structs[0]; /* Called party number, + Additional Info */ } _INF_REQP; - /* INFO-CONFIRM */ +/* INFO-CONFIRM */ typedef struct { - word Info; + word Info; } _INF_CONP; - /* INFO-INDICATION */ +/* INFO-INDICATION */ typedef struct { - word Number; - byte structs[0]; /* Info element */ + word Number; + byte structs[0]; /* Info element */ } _INF_INDP; - /* INFO-RESPONSE */ +/* INFO-RESPONSE */ typedef struct { - byte structs[0]; /* empty */ + byte structs[0]; /* empty */ } _INF_RESP; - /* SELECT-B-REQUEST */ +/* SELECT-B-REQUEST */ typedef struct { - byte structs[0]; /* B-protocol */ + byte structs[0]; /* B-protocol */ } _SEL_B_REQP; - /* SELECT-B-CONFIRM */ +/* SELECT-B-CONFIRM */ typedef struct { - word Info; + word Info; } _SEL_B_CONP; - /* FACILITY-REQUEST */ +/* FACILITY-REQUEST */ typedef struct { - word Selector; - byte structs[0]; /* Facility parameters */ + word Selector; + byte structs[0]; /* Facility parameters */ } _FAC_REQP; - /* FACILITY-CONFIRM STRUCT FOR SUPPLEMENT. SERVICES */ +/* FACILITY-CONFIRM STRUCT FOR SUPPLEMENT. SERVICES */ typedef struct { - byte struct_length; - word function; - byte length; - word SupplementaryServiceInfo; - dword SupportedServices; + byte struct_length; + word function; + byte length; + word SupplementaryServiceInfo; + dword SupportedServices; } _FAC_CON_STRUCTS; - /* FACILITY-CONFIRM */ +/* FACILITY-CONFIRM */ typedef struct { - word Info; - word Selector; - byte structs[0]; /* Facility parameters */ + word Info; + word Selector; + byte structs[0]; /* Facility parameters */ } _FAC_CONP; - /* FACILITY-INDICATION */ +/* FACILITY-INDICATION */ typedef struct { - word Selector; - byte structs[0]; /* Facility parameters */ + word Selector; + byte structs[0]; /* Facility parameters */ } _FAC_INDP; - /* FACILITY-RESPONSE */ +/* FACILITY-RESPONSE */ typedef struct { - word Selector; - byte structs[0]; /* Facility parameters */ + word Selector; + byte structs[0]; /* Facility parameters */ } _FAC_RESP; - /* CONNECT-B3-REQUEST */ +/* CONNECT-B3-REQUEST */ typedef struct { - byte structs[0]; /* NCPI */ + byte structs[0]; /* NCPI */ } _CON_B3_REQP; - /* CONNECT-B3-CONFIRM */ +/* CONNECT-B3-CONFIRM */ typedef struct { - word Info; + word Info; } _CON_B3_CONP; - /* CONNECT-B3-INDICATION */ +/* CONNECT-B3-INDICATION */ typedef struct { - byte structs[0]; /* NCPI */ + byte structs[0]; /* NCPI */ } _CON_B3_INDP; - /* CONNECT-B3-RESPONSE */ +/* CONNECT-B3-RESPONSE */ typedef struct { - word Accept; - byte structs[0]; /* NCPI */ + word Accept; + byte structs[0]; /* NCPI */ } _CON_B3_RESP; - /* CONNECT-B3-ACTIVE-INDICATION */ +/* CONNECT-B3-ACTIVE-INDICATION */ typedef struct { - byte structs[0]; /* NCPI */ + byte structs[0]; /* NCPI */ } _CON_B3_A_INDP; - /* CONNECT-B3-ACTIVE-RESPONSE */ +/* CONNECT-B3-ACTIVE-RESPONSE */ typedef struct { - byte structs[0]; /* empty */ + byte structs[0]; /* empty */ } _CON_B3_A_RESP; - /* DISCONNECT-B3-REQUEST */ +/* DISCONNECT-B3-REQUEST */ typedef struct { - byte structs[0]; /* NCPI */ + byte structs[0]; /* NCPI */ } _DIS_B3_REQP; - /* DISCONNECT-B3-CONFIRM */ +/* DISCONNECT-B3-CONFIRM */ typedef struct { - word Info; + word Info; } _DIS_B3_CONP; - /* DISCONNECT-B3-INDICATION */ +/* DISCONNECT-B3-INDICATION */ typedef struct { - word Info; - byte structs[0]; /* NCPI */ + word Info; + byte structs[0]; /* NCPI */ } _DIS_B3_INDP; - /* DISCONNECT-B3-RESPONSE */ +/* DISCONNECT-B3-RESPONSE */ typedef struct { - byte structs[0]; /* empty */ + byte structs[0]; /* empty */ } _DIS_B3_RESP; - /* DATA-B3-REQUEST */ +/* DATA-B3-REQUEST */ typedef struct { - dword Data; - word Data_Length; - word Number; - word Flags; + dword Data; + word Data_Length; + word Number; + word Flags; } _DAT_B3_REQP; - /* DATA-B3-REQUEST 64 BIT Systems */ +/* DATA-B3-REQUEST 64 BIT Systems */ typedef struct { - dword Data; - word Data_Length; - word Number; - word Flags; - void *pData; + dword Data; + word Data_Length; + word Number; + word Flags; + void *pData; } _DAT_B3_REQ64P; - /* DATA-B3-CONFIRM */ +/* DATA-B3-CONFIRM */ typedef struct { - word Number; - word Info; + word Number; + word Info; } _DAT_B3_CONP; - /* DATA-B3-INDICATION */ +/* DATA-B3-INDICATION */ typedef struct { - dword Data; - word Data_Length; - word Number; - word Flags; + dword Data; + word Data_Length; + word Number; + word Flags; } _DAT_B3_INDP; - /* DATA-B3-INDICATION 64 BIT Systems */ +/* DATA-B3-INDICATION 64 BIT Systems */ typedef struct { - dword Data; - word Data_Length; - word Number; - word Flags; - void *pData; + dword Data; + word Data_Length; + word Number; + word Flags; + void *pData; } _DAT_B3_IND64P; - /* DATA-B3-RESPONSE */ +/* DATA-B3-RESPONSE */ typedef struct { - word Number; + word Number; } _DAT_B3_RESP; - /* RESET-B3-REQUEST */ +/* RESET-B3-REQUEST */ typedef struct { - byte structs[0]; /* NCPI */ + byte structs[0]; /* NCPI */ } _RES_B3_REQP; - /* RESET-B3-CONFIRM */ +/* RESET-B3-CONFIRM */ typedef struct { - word Info; + word Info; } _RES_B3_CONP; - /* RESET-B3-INDICATION */ +/* RESET-B3-INDICATION */ typedef struct { - byte structs[0]; /* NCPI */ + byte structs[0]; /* NCPI */ } _RES_B3_INDP; - /* RESET-B3-RESPONSE */ +/* RESET-B3-RESPONSE */ typedef struct { - byte structs[0]; /* empty */ + byte structs[0]; /* empty */ } _RES_B3_RESP; - /* CONNECT-B3-T90-ACTIVE-INDICATION */ +/* CONNECT-B3-T90-ACTIVE-INDICATION */ typedef struct { - byte structs[0]; /* NCPI */ + byte structs[0]; /* NCPI */ } _CON_B3_T90_A_INDP; - /* CONNECT-B3-T90-ACTIVE-RESPONSE */ +/* CONNECT-B3-T90-ACTIVE-RESPONSE */ typedef struct { - word Reject; - byte structs[0]; /* NCPI */ + word Reject; + byte structs[0]; /* NCPI */ } _CON_B3_T90_A_RESP; /*------------------------------------------------------------------*/ /* message structure */ @@ -364,64 +364,64 @@ typedef struct { typedef struct _API_MSG CAPI_MSG; typedef struct _MSG_HEADER CAPI_MSG_HEADER; struct _API_MSG { - struct _MSG_HEADER { - word length; - word appl_id; - word command; - word number; - byte controller; - byte plci; - word ncci; - } header; - union { - _ALT_REQP alert_req; - _ALT_CONP alert_con; - _CON_REQP connect_req; - _CON_CONP connect_con; - _CON_INDP connect_ind; - _CON_RESP connect_res; - _CON_A_INDP connect_a_ind; - _CON_A_RESP connect_a_res; - _DIS_REQP disconnect_req; - _DIS_CONP disconnect_con; - _DIS_INDP disconnect_ind; - _DIS_RESP disconnect_res; - _LIS_REQP listen_req; - _LIS_CONP listen_con; - _INF_REQP info_req; - _INF_CONP info_con; - _INF_INDP info_ind; - _INF_RESP info_res; - _SEL_B_REQP select_b_req; - _SEL_B_CONP select_b_con; - _FAC_REQP facility_req; - _FAC_CONP facility_con; - _FAC_INDP facility_ind; - _FAC_RESP facility_res; - _CON_B3_REQP connect_b3_req; - _CON_B3_CONP connect_b3_con; - _CON_B3_INDP connect_b3_ind; - _CON_B3_RESP connect_b3_res; - _CON_B3_A_INDP connect_b3_a_ind; - _CON_B3_A_RESP connect_b3_a_res; - _DIS_B3_REQP disconnect_b3_req; - _DIS_B3_CONP disconnect_b3_con; - _DIS_B3_INDP disconnect_b3_ind; - _DIS_B3_RESP disconnect_b3_res; - _DAT_B3_REQP data_b3_req; - _DAT_B3_REQ64P data_b3_req64; - _DAT_B3_CONP data_b3_con; - _DAT_B3_INDP data_b3_ind; - _DAT_B3_IND64P data_b3_ind64; - _DAT_B3_RESP data_b3_res; - _RES_B3_REQP reset_b3_req; - _RES_B3_CONP reset_b3_con; - _RES_B3_INDP reset_b3_ind; - _RES_B3_RESP reset_b3_res; - _CON_B3_T90_A_INDP connect_b3_t90_a_ind; - _CON_B3_T90_A_RESP connect_b3_t90_a_res; - byte b[200]; - } info; + struct _MSG_HEADER { + word length; + word appl_id; + word command; + word number; + byte controller; + byte plci; + word ncci; + } header; + union { + _ALT_REQP alert_req; + _ALT_CONP alert_con; + _CON_REQP connect_req; + _CON_CONP connect_con; + _CON_INDP connect_ind; + _CON_RESP connect_res; + _CON_A_INDP connect_a_ind; + _CON_A_RESP connect_a_res; + _DIS_REQP disconnect_req; + _DIS_CONP disconnect_con; + _DIS_INDP disconnect_ind; + _DIS_RESP disconnect_res; + _LIS_REQP listen_req; + _LIS_CONP listen_con; + _INF_REQP info_req; + _INF_CONP info_con; + _INF_INDP info_ind; + _INF_RESP info_res; + _SEL_B_REQP select_b_req; + _SEL_B_CONP select_b_con; + _FAC_REQP facility_req; + _FAC_CONP facility_con; + _FAC_INDP facility_ind; + _FAC_RESP facility_res; + _CON_B3_REQP connect_b3_req; + _CON_B3_CONP connect_b3_con; + _CON_B3_INDP connect_b3_ind; + _CON_B3_RESP connect_b3_res; + _CON_B3_A_INDP connect_b3_a_ind; + _CON_B3_A_RESP connect_b3_a_res; + _DIS_B3_REQP disconnect_b3_req; + _DIS_B3_CONP disconnect_b3_con; + _DIS_B3_INDP disconnect_b3_ind; + _DIS_B3_RESP disconnect_b3_res; + _DAT_B3_REQP data_b3_req; + _DAT_B3_REQ64P data_b3_req64; + _DAT_B3_CONP data_b3_con; + _DAT_B3_INDP data_b3_ind; + _DAT_B3_IND64P data_b3_ind64; + _DAT_B3_RESP data_b3_res; + _RES_B3_REQP reset_b3_req; + _RES_B3_CONP reset_b3_con; + _RES_B3_INDP reset_b3_ind; + _RES_B3_RESP reset_b3_res; + _CON_B3_T90_A_INDP connect_b3_t90_a_ind; + _CON_B3_T90_A_RESP connect_b3_t90_a_res; + byte b[200]; + } info; }; /*------------------------------------------------------------------*/ /* non-fatal errors */ @@ -696,4 +696,4 @@ struct _API_MSG { /* function prototypes */ /*------------------------------------------------------------------*/ /*------------------------------------------------------------------*/ -#endif /* _INC_CAPI20 */ +#endif /* _INC_CAPI20 */ diff --git a/drivers/isdn/hardware/eicon/capidtmf.c b/drivers/isdn/hardware/eicon/capidtmf.c index f130724144f..e3f77841519 100644 --- a/drivers/isdn/hardware/eicon/capidtmf.c +++ b/drivers/isdn/hardware/eicon/capidtmf.c @@ -1,34 +1,34 @@ /* * - Copyright (c) Eicon Networks, 2002. + Copyright (c) Eicon Networks, 2002. * - This source file is supplied for the use with - Eicon Networks range of DIVA Server Adapters. + This source file is supplied for the use with + Eicon Networks range of DIVA Server Adapters. * - Eicon File Revision : 2.1 + Eicon File Revision : 2.1 * - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. * - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY OF ANY KIND WHATSOEVER INCLUDING ANY - implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY OF ANY KIND WHATSOEVER INCLUDING ANY + implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU General Public License for more details. * - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * */ #include "platform.h" - - + + @@ -51,74 +51,74 @@ static short capidtmf_expand_table_alaw[0x0100] = { - -5504, 5504, -344, 344, -22016, 22016, -1376, 1376, - -2752, 2752, -88, 88, -11008, 11008, -688, 688, - -7552, 7552, -472, 472, -30208, 30208, -1888, 1888, - -3776, 3776, -216, 216, -15104, 15104, -944, 944, - -4480, 4480, -280, 280, -17920, 17920, -1120, 1120, - -2240, 2240, -24, 24, -8960, 8960, -560, 560, - -6528, 6528, -408, 408, -26112, 26112, -1632, 1632, - -3264, 3264, -152, 152, -13056, 13056, -816, 816, - -6016, 6016, -376, 376, -24064, 24064, -1504, 1504, - -3008, 3008, -120, 120, -12032, 12032, -752, 752, - -8064, 8064, -504, 504, -32256, 32256, -2016, 2016, - -4032, 4032, -248, 248, -16128, 16128, -1008, 1008, - -4992, 4992, -312, 312, -19968, 19968, -1248, 1248, - -2496, 2496, -56, 56, -9984, 9984, -624, 624, - -7040, 7040, -440, 440, -28160, 28160, -1760, 1760, - -3520, 3520, -184, 184, -14080, 14080, -880, 880, - -5248, 5248, -328, 328, -20992, 20992, -1312, 1312, - -2624, 2624, -72, 72, -10496, 10496, -656, 656, - -7296, 7296, -456, 456, -29184, 29184, -1824, 1824, - -3648, 3648, -200, 200, -14592, 14592, -912, 912, - -4224, 4224, -264, 264, -16896, 16896, -1056, 1056, - -2112, 2112, -8, 8, -8448, 8448, -528, 528, - -6272, 6272, -392, 392, -25088, 25088, -1568, 1568, - -3136, 3136, -136, 136, -12544, 12544, -784, 784, - -5760, 5760, -360, 360, -23040, 23040, -1440, 1440, - -2880, 2880, -104, 104, -11520, 11520, -720, 720, - -7808, 7808, -488, 488, -31232, 31232, -1952, 1952, - -3904, 3904, -232, 232, -15616, 15616, -976, 976, - -4736, 4736, -296, 296, -18944, 18944, -1184, 1184, - -2368, 2368, -40, 40, -9472, 9472, -592, 592, - -6784, 6784, -424, 424, -27136, 27136, -1696, 1696, - -3392, 3392, -168, 168, -13568, 13568, -848, 848 + -5504, 5504, -344, 344, -22016, 22016, -1376, 1376, + -2752, 2752, -88, 88, -11008, 11008, -688, 688, + -7552, 7552, -472, 472, -30208, 30208, -1888, 1888, + -3776, 3776, -216, 216, -15104, 15104, -944, 944, + -4480, 4480, -280, 280, -17920, 17920, -1120, 1120, + -2240, 2240, -24, 24, -8960, 8960, -560, 560, + -6528, 6528, -408, 408, -26112, 26112, -1632, 1632, + -3264, 3264, -152, 152, -13056, 13056, -816, 816, + -6016, 6016, -376, 376, -24064, 24064, -1504, 1504, + -3008, 3008, -120, 120, -12032, 12032, -752, 752, + -8064, 8064, -504, 504, -32256, 32256, -2016, 2016, + -4032, 4032, -248, 248, -16128, 16128, -1008, 1008, + -4992, 4992, -312, 312, -19968, 19968, -1248, 1248, + -2496, 2496, -56, 56, -9984, 9984, -624, 624, + -7040, 7040, -440, 440, -28160, 28160, -1760, 1760, + -3520, 3520, -184, 184, -14080, 14080, -880, 880, + -5248, 5248, -328, 328, -20992, 20992, -1312, 1312, + -2624, 2624, -72, 72, -10496, 10496, -656, 656, + -7296, 7296, -456, 456, -29184, 29184, -1824, 1824, + -3648, 3648, -200, 200, -14592, 14592, -912, 912, + -4224, 4224, -264, 264, -16896, 16896, -1056, 1056, + -2112, 2112, -8, 8, -8448, 8448, -528, 528, + -6272, 6272, -392, 392, -25088, 25088, -1568, 1568, + -3136, 3136, -136, 136, -12544, 12544, -784, 784, + -5760, 5760, -360, 360, -23040, 23040, -1440, 1440, + -2880, 2880, -104, 104, -11520, 11520, -720, 720, + -7808, 7808, -488, 488, -31232, 31232, -1952, 1952, + -3904, 3904, -232, 232, -15616, 15616, -976, 976, + -4736, 4736, -296, 296, -18944, 18944, -1184, 1184, + -2368, 2368, -40, 40, -9472, 9472, -592, 592, + -6784, 6784, -424, 424, -27136, 27136, -1696, 1696, + -3392, 3392, -168, 168, -13568, 13568, -848, 848 }; static short capidtmf_expand_table_ulaw[0x0100] = { - -32124, 32124, -1884, 1884, -7932, 7932, -372, 372, - -15996, 15996, -876, 876, -3900, 3900, -120, 120, - -23932, 23932, -1372, 1372, -5884, 5884, -244, 244, - -11900, 11900, -620, 620, -2876, 2876, -56, 56, - -28028, 28028, -1628, 1628, -6908, 6908, -308, 308, - -13948, 13948, -748, 748, -3388, 3388, -88, 88, - -19836, 19836, -1116, 1116, -4860, 4860, -180, 180, - -9852, 9852, -492, 492, -2364, 2364, -24, 24, - -30076, 30076, -1756, 1756, -7420, 7420, -340, 340, - -14972, 14972, -812, 812, -3644, 3644, -104, 104, - -21884, 21884, -1244, 1244, -5372, 5372, -212, 212, - -10876, 10876, -556, 556, -2620, 2620, -40, 40, - -25980, 25980, -1500, 1500, -6396, 6396, -276, 276, - -12924, 12924, -684, 684, -3132, 3132, -72, 72, - -17788, 17788, -988, 988, -4348, 4348, -148, 148, - -8828, 8828, -428, 428, -2108, 2108, -8, 8, - -31100, 31100, -1820, 1820, -7676, 7676, -356, 356, - -15484, 15484, -844, 844, -3772, 3772, -112, 112, - -22908, 22908, -1308, 1308, -5628, 5628, -228, 228, - -11388, 11388, -588, 588, -2748, 2748, -48, 48, - -27004, 27004, -1564, 1564, -6652, 6652, -292, 292, - -13436, 13436, -716, 716, -3260, 3260, -80, 80, - -18812, 18812, -1052, 1052, -4604, 4604, -164, 164, - -9340, 9340, -460, 460, -2236, 2236, -16, 16, - -29052, 29052, -1692, 1692, -7164, 7164, -324, 324, - -14460, 14460, -780, 780, -3516, 3516, -96, 96, - -20860, 20860, -1180, 1180, -5116, 5116, -196, 196, - -10364, 10364, -524, 524, -2492, 2492, -32, 32, - -24956, 24956, -1436, 1436, -6140, 6140, -260, 260, - -12412, 12412, -652, 652, -3004, 3004, -64, 64, - -16764, 16764, -924, 924, -4092, 4092, -132, 132, - -8316, 8316, -396, 396, -1980, 1980, 0, 0 + -32124, 32124, -1884, 1884, -7932, 7932, -372, 372, + -15996, 15996, -876, 876, -3900, 3900, -120, 120, + -23932, 23932, -1372, 1372, -5884, 5884, -244, 244, + -11900, 11900, -620, 620, -2876, 2876, -56, 56, + -28028, 28028, -1628, 1628, -6908, 6908, -308, 308, + -13948, 13948, -748, 748, -3388, 3388, -88, 88, + -19836, 19836, -1116, 1116, -4860, 4860, -180, 180, + -9852, 9852, -492, 492, -2364, 2364, -24, 24, + -30076, 30076, -1756, 1756, -7420, 7420, -340, 340, + -14972, 14972, -812, 812, -3644, 3644, -104, 104, + -21884, 21884, -1244, 1244, -5372, 5372, -212, 212, + -10876, 10876, -556, 556, -2620, 2620, -40, 40, + -25980, 25980, -1500, 1500, -6396, 6396, -276, 276, + -12924, 12924, -684, 684, -3132, 3132, -72, 72, + -17788, 17788, -988, 988, -4348, 4348, -148, 148, + -8828, 8828, -428, 428, -2108, 2108, -8, 8, + -31100, 31100, -1820, 1820, -7676, 7676, -356, 356, + -15484, 15484, -844, 844, -3772, 3772, -112, 112, + -22908, 22908, -1308, 1308, -5628, 5628, -228, 228, + -11388, 11388, -588, 588, -2748, 2748, -48, 48, + -27004, 27004, -1564, 1564, -6652, 6652, -292, 292, + -13436, 13436, -716, 716, -3260, 3260, -80, 80, + -18812, 18812, -1052, 1052, -4604, 4604, -164, 164, + -9340, 9340, -460, 460, -2236, 2236, -16, 16, + -29052, 29052, -1692, 1692, -7164, 7164, -324, 324, + -14460, 14460, -780, 780, -3516, 3516, -96, 96, + -20860, 20860, -1180, 1180, -5116, 5116, -196, 196, + -10364, 10364, -524, 524, -2492, 2492, -32, 32, + -24956, 24956, -1436, 1436, -6140, 6140, -260, 260, + -12412, 12412, -652, 652, -3004, 3004, -64, 64, + -16764, 16764, -924, 924, -4092, 4092, -132, 132, + -8316, 8316, -396, 396, -1980, 1980, 0, 0 }; @@ -126,52 +126,52 @@ static short capidtmf_expand_table_ulaw[0x0100] = static short capidtmf_recv_window_function[CAPIDTMF_RECV_ACCUMULATE_CYCLES] = { - -500L, -999L, -1499L, -1998L, -2496L, -2994L, -3491L, -3988L, - -4483L, -4978L, -5471L, -5963L, -6454L, -6943L, -7431L, -7917L, - -8401L, -8883L, -9363L, -9840L, -10316L, -10789L, -11259L, -11727L, - -12193L, -12655L, -13115L, -13571L, -14024L, -14474L, -14921L, -15364L, - -15804L, -16240L, -16672L, -17100L, -17524L, -17944L, -18360L, -18772L, - -19180L, -19583L, -19981L, -20375L, -20764L, -21148L, -21527L, -21901L, - -22270L, -22634L, -22993L, -23346L, -23694L, -24037L, -24374L, -24705L, - -25030L, -25350L, -25664L, -25971L, -26273L, -26568L, -26858L, -27141L, - -27418L, -27688L, -27952L, -28210L, -28461L, -28705L, -28943L, -29174L, - -29398L, -29615L, -29826L, -30029L, -30226L, -30415L, -30598L, -30773L, - -30941L, -31102L, -31256L, -31402L, -31541L, -31673L, -31797L, -31914L, - -32024L, -32126L, -32221L, -32308L, -32388L, -32460L, -32524L, -32581L, - -32631L, -32673L, -32707L, -32734L, -32753L, -32764L, -32768L, -32764L, - -32753L, -32734L, -32707L, -32673L, -32631L, -32581L, -32524L, -32460L, - -32388L, -32308L, -32221L, -32126L, -32024L, -31914L, -31797L, -31673L, - -31541L, -31402L, -31256L, -31102L, -30941L, -30773L, -30598L, -30415L, - -30226L, -30029L, -29826L, -29615L, -29398L, -29174L, -28943L, -28705L, - -28461L, -28210L, -27952L, -27688L, -27418L, -27141L, -26858L, -26568L, - -26273L, -25971L, -25664L, -25350L, -25030L, -24705L, -24374L, -24037L, - -23694L, -23346L, -22993L, -22634L, -22270L, -21901L, -21527L, -21148L, - -20764L, -20375L, -19981L, -19583L, -19180L, -18772L, -18360L, -17944L, - -17524L, -17100L, -16672L, -16240L, -15804L, -15364L, -14921L, -14474L, - -14024L, -13571L, -13115L, -12655L, -12193L, -11727L, -11259L, -10789L, - -10316L, -9840L, -9363L, -8883L, -8401L, -7917L, -7431L, -6943L, - -6454L, -5963L, -5471L, -4978L, -4483L, -3988L, -3491L, -2994L, - -2496L, -1998L, -1499L, -999L, -500L, + -500L, -999L, -1499L, -1998L, -2496L, -2994L, -3491L, -3988L, + -4483L, -4978L, -5471L, -5963L, -6454L, -6943L, -7431L, -7917L, + -8401L, -8883L, -9363L, -9840L, -10316L, -10789L, -11259L, -11727L, + -12193L, -12655L, -13115L, -13571L, -14024L, -14474L, -14921L, -15364L, + -15804L, -16240L, -16672L, -17100L, -17524L, -17944L, -18360L, -18772L, + -19180L, -19583L, -19981L, -20375L, -20764L, -21148L, -21527L, -21901L, + -22270L, -22634L, -22993L, -23346L, -23694L, -24037L, -24374L, -24705L, + -25030L, -25350L, -25664L, -25971L, -26273L, -26568L, -26858L, -27141L, + -27418L, -27688L, -27952L, -28210L, -28461L, -28705L, -28943L, -29174L, + -29398L, -29615L, -29826L, -30029L, -30226L, -30415L, -30598L, -30773L, + -30941L, -31102L, -31256L, -31402L, -31541L, -31673L, -31797L, -31914L, + -32024L, -32126L, -32221L, -32308L, -32388L, -32460L, -32524L, -32581L, + -32631L, -32673L, -32707L, -32734L, -32753L, -32764L, -32768L, -32764L, + -32753L, -32734L, -32707L, -32673L, -32631L, -32581L, -32524L, -32460L, + -32388L, -32308L, -32221L, -32126L, -32024L, -31914L, -31797L, -31673L, + -31541L, -31402L, -31256L, -31102L, -30941L, -30773L, -30598L, -30415L, + -30226L, -30029L, -29826L, -29615L, -29398L, -29174L, -28943L, -28705L, + -28461L, -28210L, -27952L, -27688L, -27418L, -27141L, -26858L, -26568L, + -26273L, -25971L, -25664L, -25350L, -25030L, -24705L, -24374L, -24037L, + -23694L, -23346L, -22993L, -22634L, -22270L, -21901L, -21527L, -21148L, + -20764L, -20375L, -19981L, -19583L, -19180L, -18772L, -18360L, -17944L, + -17524L, -17100L, -16672L, -16240L, -15804L, -15364L, -14921L, -14474L, + -14024L, -13571L, -13115L, -12655L, -12193L, -11727L, -11259L, -10789L, + -10316L, -9840L, -9363L, -8883L, -8401L, -7917L, -7431L, -6943L, + -6454L, -5963L, -5471L, -4978L, -4483L, -3988L, -3491L, -2994L, + -2496L, -1998L, -1499L, -999L, -500L, }; static byte capidtmf_leading_zeroes_table[0x100] = { - 8, 7, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + 8, 7, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; #define capidtmf_byte_leading_zeroes(b) (capidtmf_leading_zeroes_table[(BYTE)(b)]) @@ -182,140 +182,140 @@ static byte capidtmf_leading_zeroes_table[0x100] = /*---------------------------------------------------------------------------*/ -static void capidtmf_goertzel_loop (long *buffer, long *coeffs, short *sample, long count) +static void capidtmf_goertzel_loop(long *buffer, long *coeffs, short *sample, long count) { - int i, j; - long c, d, q0, q1, q2; - - for (i = 0; i < CAPIDTMF_RECV_TOTAL_FREQUENCY_COUNT - 1; i++) - { - q1 = buffer[i]; - q2 = buffer[i + CAPIDTMF_RECV_TOTAL_FREQUENCY_COUNT]; - d = coeffs[i] >> 1; - c = d << 1; - if (c >= 0) - { - for (j = 0; j < count; j++) - { - q0 = sample[j] - q2 + (c * (q1 >> 16)) + (((dword)(((dword) d) * ((dword)(q1 & 0xffff)))) >> 15); - q2 = q1; - q1 = q0; - } - } - else - { - c = -c; - d = -d; - for (j = 0; j < count; j++) - { - q0 = sample[j] - q2 - ((c * (q1 >> 16)) + (((dword)(((dword) d) * ((dword)(q1 & 0xffff)))) >> 15)); - q2 = q1; - q1 = q0; - } - } - buffer[i] = q1; - buffer[i + CAPIDTMF_RECV_TOTAL_FREQUENCY_COUNT] = q2; - } - q1 = buffer[i]; - q2 = buffer[i + CAPIDTMF_RECV_TOTAL_FREQUENCY_COUNT]; - c = (coeffs[i] >> 1) << 1; - if (c >= 0) - { - for (j = 0; j < count; j++) - { - q0 = sample[j] - q2 + (c * (q1 >> 16)) + (((dword)(((dword)(c >> 1)) * ((dword)(q1 & 0xffff)))) >> 15); - q2 = q1; - q1 = q0; - c -= CAPIDTMF_RECV_FUNDAMENTAL_DECREMENT; - } - } - else - { - c = -c; - for (j = 0; j < count; j++) - { - q0 = sample[j] - q2 - ((c * (q1 >> 16)) + (((dword)(((dword)(c >> 1)) * ((dword)(q1 & 0xffff)))) >> 15)); - q2 = q1; - q1 = q0; - c += CAPIDTMF_RECV_FUNDAMENTAL_DECREMENT; - } - } - coeffs[i] = c; - buffer[i] = q1; - buffer[i + CAPIDTMF_RECV_TOTAL_FREQUENCY_COUNT] = q2; + int i, j; + long c, d, q0, q1, q2; + + for (i = 0; i < CAPIDTMF_RECV_TOTAL_FREQUENCY_COUNT - 1; i++) + { + q1 = buffer[i]; + q2 = buffer[i + CAPIDTMF_RECV_TOTAL_FREQUENCY_COUNT]; + d = coeffs[i] >> 1; + c = d << 1; + if (c >= 0) + { + for (j = 0; j < count; j++) + { + q0 = sample[j] - q2 + (c * (q1 >> 16)) + (((dword)(((dword) d) * ((dword)(q1 & 0xffff)))) >> 15); + q2 = q1; + q1 = q0; + } + } + else + { + c = -c; + d = -d; + for (j = 0; j < count; j++) + { + q0 = sample[j] - q2 - ((c * (q1 >> 16)) + (((dword)(((dword) d) * ((dword)(q1 & 0xffff)))) >> 15)); + q2 = q1; + q1 = q0; + } + } + buffer[i] = q1; + buffer[i + CAPIDTMF_RECV_TOTAL_FREQUENCY_COUNT] = q2; + } + q1 = buffer[i]; + q2 = buffer[i + CAPIDTMF_RECV_TOTAL_FREQUENCY_COUNT]; + c = (coeffs[i] >> 1) << 1; + if (c >= 0) + { + for (j = 0; j < count; j++) + { + q0 = sample[j] - q2 + (c * (q1 >> 16)) + (((dword)(((dword)(c >> 1)) * ((dword)(q1 & 0xffff)))) >> 15); + q2 = q1; + q1 = q0; + c -= CAPIDTMF_RECV_FUNDAMENTAL_DECREMENT; + } + } + else + { + c = -c; + for (j = 0; j < count; j++) + { + q0 = sample[j] - q2 - ((c * (q1 >> 16)) + (((dword)(((dword)(c >> 1)) * ((dword)(q1 & 0xffff)))) >> 15)); + q2 = q1; + q1 = q0; + c += CAPIDTMF_RECV_FUNDAMENTAL_DECREMENT; + } + } + coeffs[i] = c; + buffer[i] = q1; + buffer[i + CAPIDTMF_RECV_TOTAL_FREQUENCY_COUNT] = q2; } -static void capidtmf_goertzel_result (long *buffer, long *coeffs) +static void capidtmf_goertzel_result(long *buffer, long *coeffs) { - int i; - long d, e, q1, q2, lo, mid, hi; - dword k; - - for (i = 0; i < CAPIDTMF_RECV_TOTAL_FREQUENCY_COUNT; i++) - { - q1 = buffer[i]; - q2 = buffer[i + CAPIDTMF_RECV_TOTAL_FREQUENCY_COUNT]; - d = coeffs[i] >> 1; - if (d >= 0) - d = ((d << 1) * (-q1 >> 16)) + (((dword)(((dword) d) * ((dword)(-q1 & 0xffff)))) >> 15); - else - d = ((-d << 1) * (-q1 >> 16)) + (((dword)(((dword) -d) * ((dword)(-q1 & 0xffff)))) >> 15); - e = (q2 >= 0) ? q2 : -q2; - if (d >= 0) - { - k = ((dword)(d & 0xffff)) * ((dword)(e & 0xffff)); - lo = k & 0xffff; - mid = k >> 16; - k = ((dword)(d >> 16)) * ((dword)(e & 0xffff)); - mid += k & 0xffff; - hi = k >> 16; - k = ((dword)(d & 0xffff)) * ((dword)(e >> 16)); - mid += k & 0xffff; - hi += k >> 16; - hi += ((dword)(d >> 16)) * ((dword)(e >> 16)); - } - else - { - d = -d; - k = ((dword)(d & 0xffff)) * ((dword)(e & 0xffff)); - lo = -((long)(k & 0xffff)); - mid = -((long)(k >> 16)); - k = ((dword)(d >> 16)) * ((dword)(e & 0xffff)); - mid -= k & 0xffff; - hi = -((long)(k >> 16)); - k = ((dword)(d & 0xffff)) * ((dword)(e >> 16)); - mid -= k & 0xffff; - hi -= k >> 16; - hi -= ((dword)(d >> 16)) * ((dword)(e >> 16)); - } - if (q2 < 0) - { - lo = -lo; - mid = -mid; - hi = -hi; - } - d = (q1 >= 0) ? q1 : -q1; - k = ((dword)(d & 0xffff)) * ((dword)(d & 0xffff)); - lo += k & 0xffff; - mid += k >> 16; - k = ((dword)(d >> 16)) * ((dword)(d & 0xffff)); - mid += (k & 0xffff) << 1; - hi += (k >> 16) << 1; - hi += ((dword)(d >> 16)) * ((dword)(d >> 16)); - d = (q2 >= 0) ? q2 : -q2; - k = ((dword)(d & 0xffff)) * ((dword)(d & 0xffff)); - lo += k & 0xffff; - mid += k >> 16; - k = ((dword)(d >> 16)) * ((dword)(d & 0xffff)); - mid += (k & 0xffff) << 1; - hi += (k >> 16) << 1; - hi += ((dword)(d >> 16)) * ((dword)(d >> 16)); - mid += lo >> 16; - hi += mid >> 16; - buffer[i] = (lo & 0xffff) | (mid << 16); - buffer[i + CAPIDTMF_RECV_TOTAL_FREQUENCY_COUNT] = hi; - } + int i; + long d, e, q1, q2, lo, mid, hi; + dword k; + + for (i = 0; i < CAPIDTMF_RECV_TOTAL_FREQUENCY_COUNT; i++) + { + q1 = buffer[i]; + q2 = buffer[i + CAPIDTMF_RECV_TOTAL_FREQUENCY_COUNT]; + d = coeffs[i] >> 1; + if (d >= 0) + d = ((d << 1) * (-q1 >> 16)) + (((dword)(((dword) d) * ((dword)(-q1 & 0xffff)))) >> 15); + else + d = ((-d << 1) * (-q1 >> 16)) + (((dword)(((dword) -d) * ((dword)(-q1 & 0xffff)))) >> 15); + e = (q2 >= 0) ? q2 : -q2; + if (d >= 0) + { + k = ((dword)(d & 0xffff)) * ((dword)(e & 0xffff)); + lo = k & 0xffff; + mid = k >> 16; + k = ((dword)(d >> 16)) * ((dword)(e & 0xffff)); + mid += k & 0xffff; + hi = k >> 16; + k = ((dword)(d & 0xffff)) * ((dword)(e >> 16)); + mid += k & 0xffff; + hi += k >> 16; + hi += ((dword)(d >> 16)) * ((dword)(e >> 16)); + } + else + { + d = -d; + k = ((dword)(d & 0xffff)) * ((dword)(e & 0xffff)); + lo = -((long)(k & 0xffff)); + mid = -((long)(k >> 16)); + k = ((dword)(d >> 16)) * ((dword)(e & 0xffff)); + mid -= k & 0xffff; + hi = -((long)(k >> 16)); + k = ((dword)(d & 0xffff)) * ((dword)(e >> 16)); + mid -= k & 0xffff; + hi -= k >> 16; + hi -= ((dword)(d >> 16)) * ((dword)(e >> 16)); + } + if (q2 < 0) + { + lo = -lo; + mid = -mid; + hi = -hi; + } + d = (q1 >= 0) ? q1 : -q1; + k = ((dword)(d & 0xffff)) * ((dword)(d & 0xffff)); + lo += k & 0xffff; + mid += k >> 16; + k = ((dword)(d >> 16)) * ((dword)(d & 0xffff)); + mid += (k & 0xffff) << 1; + hi += (k >> 16) << 1; + hi += ((dword)(d >> 16)) * ((dword)(d >> 16)); + d = (q2 >= 0) ? q2 : -q2; + k = ((dword)(d & 0xffff)) * ((dword)(d & 0xffff)); + lo += k & 0xffff; + mid += k >> 16; + k = ((dword)(d >> 16)) * ((dword)(d & 0xffff)); + mid += (k & 0xffff) << 1; + hi += (k >> 16) << 1; + hi += ((dword)(d >> 16)) * ((dword)(d >> 16)); + mid += lo >> 16; + hi += mid >> 16; + buffer[i] = (lo & 0xffff) | (mid << 16); + buffer[i + CAPIDTMF_RECV_TOTAL_FREQUENCY_COUNT] = hi; + } } @@ -346,339 +346,339 @@ static void capidtmf_goertzel_result (long *buffer, long *coeffs) static long capidtmf_recv_goertzel_coef_table[CAPIDTMF_RECV_TOTAL_FREQUENCY_COUNT] = { - 0xda97L * 2, /* 697 Hz (Low group 697 Hz) */ - 0xd299L * 2, /* 770 Hz (Low group 770 Hz) */ - 0xc8cbL * 2, /* 852 Hz (Low group 852 Hz) */ - 0xbd36L * 2, /* 941 Hz (Low group 941 Hz) */ - 0x9501L * 2, /* 1209 Hz (High group 1209 Hz) */ - 0x7f89L * 2, /* 1336 Hz (High group 1336 Hz) */ - 0x6639L * 2, /* 1477 Hz (High group 1477 Hz) */ - 0x48c6L * 2, /* 1633 Hz (High group 1633 Hz) */ - 0xe14cL * 2, /* 630 Hz (Lower guard of low group 631 Hz) */ - 0xb2e0L * 2, /* 1015 Hz (Upper guard of low group 1039 Hz) */ - 0xa1a0L * 2, /* 1130 Hz (Lower guard of high group 1140 Hz) */ - 0x8a87L * 2, /* 1272 Hz (Guard between 1209 Hz and 1336 Hz: 1271 Hz) */ - 0x7353L * 2, /* 1405 Hz (2nd harmonics of 697 Hz and guard between 1336 Hz and 1477 Hz: 1405 Hz) */ - 0x583bL * 2, /* 1552 Hz (2nd harmonics of 770 Hz and guard between 1477 Hz and 1633 Hz: 1553 Hz) */ - 0x37d8L * 2, /* 1720 Hz (2nd harmonics of 852 Hz and upper guard of high group: 1715 Hz) */ - 0x0000L * 2 /* 100-630 Hz (fundamentals) */ + 0xda97L * 2, /* 697 Hz (Low group 697 Hz) */ + 0xd299L * 2, /* 770 Hz (Low group 770 Hz) */ + 0xc8cbL * 2, /* 852 Hz (Low group 852 Hz) */ + 0xbd36L * 2, /* 941 Hz (Low group 941 Hz) */ + 0x9501L * 2, /* 1209 Hz (High group 1209 Hz) */ + 0x7f89L * 2, /* 1336 Hz (High group 1336 Hz) */ + 0x6639L * 2, /* 1477 Hz (High group 1477 Hz) */ + 0x48c6L * 2, /* 1633 Hz (High group 1633 Hz) */ + 0xe14cL * 2, /* 630 Hz (Lower guard of low group 631 Hz) */ + 0xb2e0L * 2, /* 1015 Hz (Upper guard of low group 1039 Hz) */ + 0xa1a0L * 2, /* 1130 Hz (Lower guard of high group 1140 Hz) */ + 0x8a87L * 2, /* 1272 Hz (Guard between 1209 Hz and 1336 Hz: 1271 Hz) */ + 0x7353L * 2, /* 1405 Hz (2nd harmonics of 697 Hz and guard between 1336 Hz and 1477 Hz: 1405 Hz) */ + 0x583bL * 2, /* 1552 Hz (2nd harmo