Path: blob/master/drivers/isdn/hardware/eicon/dsp_defs.h
15115 views
1/*2*3Copyright (c) Eicon Networks, 2002.4*5This source file is supplied for the use with6Eicon Networks range of DIVA Server Adapters.7*8Eicon File Revision : 2.19*10This program is free software; you can redistribute it and/or modify11it under the terms of the GNU General Public License as published by12the Free Software Foundation; either version 2, or (at your option)13any later version.14*15This program is distributed in the hope that it will be useful,16but WITHOUT ANY WARRANTY OF ANY KIND WHATSOEVER INCLUDING ANY17implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.18See the GNU General Public License for more details.19*20You should have received a copy of the GNU General Public License21along with this program; if not, write to the Free Software22Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.23*24*/25#ifndef DSP_DEFS_H_26#define DSP_DEFS_H_27#include "dspdids.h"28/*---------------------------------------------------------------------------*/29#define dsp_download_reserve_space(fp,length)30/*****************************************************************************/31/*32* OS file access abstraction layer33*34* I/O functions returns -1 on error, 0 on EOF35*/36struct _OsFileHandle_;37typedef long ( * OsFileIo) (struct _OsFileHandle_ *handle,38void *buffer,39long size) ;40typedef long ( * OsFileSeek)(struct _OsFileHandle_ *handle,41long position,42int mode) ;43typedef long ( * OsCardLoad)(struct _OsFileHandle_ *handle,44long length,45void * *addr) ;46typedef struct _OsFileHandle_47{ void *sysFileDesc ;48unsigned long sysFileSize ;49OsFileIo sysFileRead ;50OsFileSeek sysFileSeek ;51void *sysLoadDesc ;52OsCardLoad sysCardLoad ;53} OsFileHandle ;54extern OsFileHandle *OsOpenFile (char *path_name) ;55extern void OsCloseFile (OsFileHandle *fp) ;56/*****************************************************************************/57#define DSP_TELINDUS_FILE "dspdload.bin"58/* special DSP file for BRI cards for Qsig and CornetN because of missing memory */59#define DSP_QSIG_TELINDUS_FILE "dspdqsig.bin"60#define DSP_MDM_TELINDUS_FILE "dspdvmdm.bin"61#define DSP_FAX_TELINDUS_FILE "dspdvfax.bin"62#define DSP_DIRECTORY_ENTRIES 6463#define DSP_MEMORY_TYPE_EXTERNAL_DM 064#define DSP_MEMORY_TYPE_EXTERNAL_PM 165#define DSP_MEMORY_TYPE_INTERNAL_DM 266#define DSP_MEMORY_TYPE_INTERNAL_PM 367#define DSP_DOWNLOAD_FLAG_BOOTABLE 0x000168#define DSP_DOWNLOAD_FLAG_2181 0x000269#define DSP_DOWNLOAD_FLAG_TIMECRITICAL 0x000470#define DSP_DOWNLOAD_FLAG_COMPAND 0x000871#define DSP_MEMORY_BLOCK_COUNT 1672#define DSP_SEGMENT_PM_FLAG 0x000173#define DSP_SEGMENT_SHARED_FLAG 0x000274#define DSP_SEGMENT_EXTERNAL_DM DSP_MEMORY_TYPE_EXTERNAL_DM75#define DSP_SEGMENT_EXTERNAL_PM DSP_MEMORY_TYPE_EXTERNAL_PM76#define DSP_SEGMENT_INTERNAL_DM DSP_MEMORY_TYPE_INTERNAL_DM77#define DSP_SEGMENT_INTERNAL_PM DSP_MEMORY_TYPE_INTERNAL_PM78#define DSP_SEGMENT_FIRST_RELOCATABLE 479#define DSP_DATA_BLOCK_PM_FLAG 0x000180#define DSP_DATA_BLOCK_DWORD_FLAG 0x000281#define DSP_DATA_BLOCK_RESOLVE_FLAG 0x000482#define DSP_RELOC_NONE 0x0083#define DSP_RELOC_SEGMENT_MASK 0x3f84#define DSP_RELOC_TYPE_MASK 0xc085#define DSP_RELOC_TYPE_0 0x00 /* relocation of address in DM word / high part of PM word */86#define DSP_RELOC_TYPE_1 0x40 /* relocation of address in low part of PM data word */87#define DSP_RELOC_TYPE_2 0x80 /* relocation of address in standard command */88#define DSP_RELOC_TYPE_3 0xc0 /* relocation of address in call/jump on flag in */89#define DSP_COMBIFILE_FORMAT_IDENTIFICATION_SIZE 4890#define DSP_COMBIFILE_FORMAT_VERSION_BCD 0x010091#define DSP_FILE_FORMAT_IDENTIFICATION_SIZE 4892#define DSP_FILE_FORMAT_VERSION_BCD 0x010093typedef struct tag_dsp_combifile_header94{95char format_identification[DSP_COMBIFILE_FORMAT_IDENTIFICATION_SIZE];96word format_version_bcd;97word header_size;98word combifile_description_size;99word directory_entries;100word directory_size;101word download_count;102word usage_mask_size;103} t_dsp_combifile_header;104typedef struct tag_dsp_combifile_directory_entry105{106word card_type_number;107word file_set_number;108} t_dsp_combifile_directory_entry;109typedef struct tag_dsp_file_header110{111char format_identification[DSP_FILE_FORMAT_IDENTIFICATION_SIZE];112word format_version_bcd;113word download_id;114word download_flags;115word required_processing_power;116word interface_channel_count;117word header_size;118word download_description_size;119word memory_block_table_size;120word memory_block_count;121word segment_table_size;122word segment_count;123word symbol_table_size;124word symbol_count;125word total_data_size_dm;126word data_block_count_dm;127word total_data_size_pm;128word data_block_count_pm;129} t_dsp_file_header;130typedef struct tag_dsp_memory_block_desc131{132word alias_memory_block;133word memory_type;134word address;135word size; /* DSP words */136} t_dsp_memory_block_desc;137typedef struct tag_dsp_segment_desc138{139word memory_block;140word attributes;141word base;142word size;143word alignment; /* ==0 -> no other legal start address than base */144} t_dsp_segment_desc;145typedef struct tag_dsp_symbol_desc146{147word symbol_id;148word segment;149word offset;150word size; /* DSP words */151} t_dsp_symbol_desc;152typedef struct tag_dsp_data_block_header153{154word attributes;155word segment;156word offset;157word size; /* DSP words */158} t_dsp_data_block_header;159typedef struct tag_dsp_download_desc160{161word download_id;162word download_flags;163word required_processing_power;164word interface_channel_count;165word excess_header_size;166word memory_block_count;167word segment_count;168word symbol_count;169word data_block_count_dm;170word data_block_count_pm;171byte * p_excess_header_data;172char * p_download_description;173t_dsp_memory_block_desc *p_memory_block_table;174t_dsp_segment_desc *p_segment_table;175t_dsp_symbol_desc *p_symbol_table;176word * p_data_blocks_dm;177word * p_data_blocks_pm;178} t_dsp_desc;179typedef struct tag_dsp_portable_download_desc /* be sure to keep native alignment for MAESTRA's */180{181word download_id;182word download_flags;183word required_processing_power;184word interface_channel_count;185word excess_header_size;186word memory_block_count;187word segment_count;188word symbol_count;189word data_block_count_dm;190word data_block_count_pm;191dword p_excess_header_data;192dword p_download_description;193dword p_memory_block_table;194dword p_segment_table;195dword p_symbol_table;196dword p_data_blocks_dm;197dword p_data_blocks_pm;198} t_dsp_portable_desc;199#define DSP_DOWNLOAD_INDEX_KERNEL 0200#define DSP30TX_DOWNLOAD_INDEX_KERNEL 1201#define DSP30RX_DOWNLOAD_INDEX_KERNEL 2202#define DSP_MAX_DOWNLOAD_COUNT 64203#define DSP_DOWNLOAD_MAX_SEGMENTS 16204#define DSP_UDATA_REQUEST_RECONFIGURE 0205/*206parameters:207<word> reconfigure delay (in 8kHz samples)208<word> reconfigure code209<byte> reconfigure hdlc preamble flags210*/211#define DSP_RECONFIGURE_TX_FLAG 0x8000212#define DSP_RECONFIGURE_SHORT_TRAIN_FLAG 0x4000213#define DSP_RECONFIGURE_ECHO_PROTECT_FLAG 0x2000214#define DSP_RECONFIGURE_HDLC_FLAG 0x1000215#define DSP_RECONFIGURE_SYNC_FLAG 0x0800216#define DSP_RECONFIGURE_PROTOCOL_MASK 0x00ff217#define DSP_RECONFIGURE_IDLE 0218#define DSP_RECONFIGURE_V25 1219#define DSP_RECONFIGURE_V21_CH2 2220#define DSP_RECONFIGURE_V27_2400 3221#define DSP_RECONFIGURE_V27_4800 4222#define DSP_RECONFIGURE_V29_7200 5223#define DSP_RECONFIGURE_V29_9600 6224#define DSP_RECONFIGURE_V33_12000 7225#define DSP_RECONFIGURE_V33_14400 8226#define DSP_RECONFIGURE_V17_7200 9227#define DSP_RECONFIGURE_V17_9600 10228#define DSP_RECONFIGURE_V17_12000 11229#define DSP_RECONFIGURE_V17_14400 12230/*231data indications if transparent framer232<byte> data 0233<byte> data 1234...235data indications if HDLC framer236<byte> data 0237<byte> data 1238...239<byte> CRC 0240<byte> CRC 1241<byte> preamble flags242*/243#define DSP_UDATA_INDICATION_SYNC 0244/*245returns:246<word> time of sync (sampled from counter at 8kHz)247*/248#define DSP_UDATA_INDICATION_DCD_OFF 1249/*250returns:251<word> time of DCD off (sampled from counter at 8kHz)252*/253#define DSP_UDATA_INDICATION_DCD_ON 2254/*255returns:256<word> time of DCD on (sampled from counter at 8kHz)257<byte> connected norm258<word> connected options259<dword> connected speed (bit/s)260*/261#define DSP_UDATA_INDICATION_CTS_OFF 3262/*263returns:264<word> time of CTS off (sampled from counter at 8kHz)265*/266#define DSP_UDATA_INDICATION_CTS_ON 4267/*268returns:269<word> time of CTS on (sampled from counter at 8kHz)270<byte> connected norm271<word> connected options272<dword> connected speed (bit/s)273*/274#define DSP_CONNECTED_NORM_UNSPECIFIED 0275#define DSP_CONNECTED_NORM_V21 1276#define DSP_CONNECTED_NORM_V23 2277#define DSP_CONNECTED_NORM_V22 3278#define DSP_CONNECTED_NORM_V22_BIS 4279#define DSP_CONNECTED_NORM_V32_BIS 5280#define DSP_CONNECTED_NORM_V34 6281#define DSP_CONNECTED_NORM_V8 7282#define DSP_CONNECTED_NORM_BELL_212A 8283#define DSP_CONNECTED_NORM_BELL_103 9284#define DSP_CONNECTED_NORM_V29_LEASED_LINE 10285#define DSP_CONNECTED_NORM_V33_LEASED_LINE 11286#define DSP_CONNECTED_NORM_TFAST 12287#define DSP_CONNECTED_NORM_V21_CH2 13288#define DSP_CONNECTED_NORM_V27_TER 14289#define DSP_CONNECTED_NORM_V29 15290#define DSP_CONNECTED_NORM_V33 16291#define DSP_CONNECTED_NORM_V17 17292#define DSP_CONNECTED_OPTION_TRELLIS 0x0001293/*---------------------------------------------------------------------------*/294extern char *dsp_read_file (OsFileHandle *fp,295word card_type_number,296word *p_dsp_download_count,297t_dsp_desc *p_dsp_download_table,298t_dsp_portable_desc *p_dsp_portable_download_table) ;299/*---------------------------------------------------------------------------*/300#endif /* DSP_DEFS_H_ */301302303