FreeCalypso > hg > freecalypso-sw
annotate gsm-fw/gpf/tst_drv/tif2.c @ 473:658b141a1600
os_com_fl.c: small buglet in the reconstruction
| author | Michael Spacefalcon <msokolov@ivan.Harhan.ORG> | 
|---|---|
| date | Fri, 27 Jun 2014 00:05:23 +0000 | 
| parents | 7e878e6b9cf7 | 
| children | 
| rev | line source | 
|---|---|
| 322 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1 /* | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 2 +------------------------------------------------------------------------------ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 3 | File: tif.c | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 4 +------------------------------------------------------------------------------ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 5 | Copyright 2002 Texas Instruments Berlin, AG | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 6 | All rights reserved. | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 7 | | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 8 | This file is confidential and a trade secret of Texas | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 9 | Instruments Berlin, AG | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 10 | The receipt of or possession of this file does not convey | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 11 | any rights to reproduce or disclose its contents or to | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 12 | manufacture, use, or sell anything it may describe, in | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 13 | whole, or in part, without the specific written consent of | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 14 | Texas Instruments Berlin, AG. | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 15 +----------------------------------------------------------------------------- | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 16 | Purpose : This Modul contains the TIF driver | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 17 +----------------------------------------------------------------------------- | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 18 */ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 19 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 20 #ifndef __TIF_C__ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 21 #define __TIF_C__ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 22 #endif | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 23 | 
| 326 
7e878e6b9cf7
gsm-fw/gpf/tst_drv: tif2.c compiles
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: 
322diff
changeset | 24 #include <string.h> | 
| 
7e878e6b9cf7
gsm-fw/gpf/tst_drv: tif2.c compiles
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: 
322diff
changeset | 25 #include "gpfconf.h" | 
| 322 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 26 #include "typedefs.h" | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 27 #include "gdi.h" | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 28 #include "vsi.h" | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 29 #include "tools.h" | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 30 #include "glob_defs.h" | 
| 326 
7e878e6b9cf7
gsm-fw/gpf/tst_drv: tif2.c compiles
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: 
322diff
changeset | 31 #if 0 // FreeCalypso | 
| 322 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 32 #include "ccdtable.h" | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 33 #include "ccddata.h" | 
| 326 
7e878e6b9cf7
gsm-fw/gpf/tst_drv: tif2.c compiles
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: 
322diff
changeset | 34 #endif | 
| 322 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 35 #include "pcon.h" | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 36 #include "p_mem.h" | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 37 #include "drvconf.h" | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 38 #include "tstheader.h" | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 39 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 40 #ifdef _TOOLS_ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 41 #include "frame_const.h" | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 42 #include <stdio.h> | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 43 #endif /* _TOOLS_ */ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 44 #include "printtofile.h" | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 45 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 46 #ifndef _TOOLS_ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 47 #if !defined (_SOLARIS_) && !defined (_LINUX_) | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 48 #pragma pack(4) | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 49 #endif | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 50 #endif | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 51 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 52 /*lint -e545 */ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 53 /*==== TYPES ======================================================*/ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 54 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 55 typedef struct | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 56 { | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 57 USHORT Handle; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 58 USHORT EnabledSignalType; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 59 T_DRV_CB_FUNC Callback; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 60 USHORT Config; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 61 } T_TIF_DATA; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 62 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 63 #ifdef _TOOLS_ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 64 typedef struct | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 65 { | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 66 unsigned int use_id; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 67 char *name; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 68 } T_RIV_USEID_TO_NAME; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 69 #endif | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 70 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 71 /*==== CONSTANTS ==================================================*/ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 72 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 73 #define ALLOWED_TIF_SIGNALS (DRV_SIGTYPE_READ|DRV_SIGTYPE_CONNECT|DRV_SIGTYPE_DISCONNECT) | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 74 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 75 #define NAME_LENGTH 4 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 76 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 77 #define TIF_RCV_CMD_SIZE 32 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 78 #define TIF_MAX_CMD (TIF_RCV_CMD_SIZE-1) | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 79 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 80 #define STX 0x02 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 81 #define LF 0x0a | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 82 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 83 #define PCON_ENABLED 0x0001 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 84 #define SYNC_MODE 0x0002 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 85 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 86 #undef VSI_CALLER | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 87 #define VSI_CALLER TST_Handle, | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 88 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 89 #ifdef _TOOLS_ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 90 const T_RIV_USEID_TO_NAME riv_use_id_to_name[] = | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 91 { | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 92 { 0x00010001, "RVM" }, | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 93 { 0x00010002, "RVT" }, | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 94 { 0x000A0001, "R2D" }, | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 95 { 0x000A0002, "RTC" }, | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 96 { 0x000A0004, "FFS" }, | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 97 { 0x000A0008, "KPD" }, | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 98 { 0x000A0010, "SPI" }, | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 99 { 0x000A0020, "PWR" }, | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 100 { 0x000A0040, "RGUI" }, | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 101 { 0x00140001, "HCI" }, | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 102 { 0x00140002, "L2CA" }, | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 103 { 0x00140004, "BTCT" }, | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 104 { 0x00140008, "RFC" }, | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 105 { 0x00140010, "SPP" }, | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 106 { 0x00140020, "HS" }, | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 107 { 0x00140040, "HSG" }, | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 108 { 0x00140080, "SDP" }, | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 109 { 0x00140100, "DUN" }, | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 110 { 0x00140200, "FAX" }, | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 111 { 0x00140400, "OBX" }, | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 112 { 0x00140800, "OPP" }, | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 113 { 0x00141000, "FTP" }, | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 114 { 0x00142000, "SYN" }, | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 115 { 0x001E0001, "EXPL" }, | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 116 { 0x001E0010, "AUDIO" }, | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 117 { 0x001E0020, "ETM" }, | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 118 { 0x001E0040, "DAR" }, | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 119 { 0x001E0080, "MKS" }, | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 120 { 0x001E0100, "MPM" }, | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 121 { 0x001E0200, "LLS" }, | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 122 { 0x001E0400, "ATP" }, | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 123 { 0x001E0800, "ATPUART" }, | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 124 { 0x001E2000, "MDC" }, | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 125 { 0x001E4000, "TTY" }, | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 126 { 0x001E8000, "DCM" }, | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 127 { 0x00280001, "TEST" }, | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 128 { 0x00280002, "TUT" }, | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 129 { 0x00320001, "KIL" }, | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 130 { 0x00320002, "KGC" }, | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 131 { 0x00320004, "KCL" }, | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 132 { 0x00320008, "KMM" }, | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 133 { 0x00320010, "KNM" }, | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 134 { 0x00320020, "UVM" }, | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 135 { 0x00320040, "KZP" }, | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 136 { 0x00320080, "KPG" }, | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 137 { 0x00320100, "JTM" }, | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 138 { 0x003C0001, "DEV1" }, | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 139 { 0x003C0002, "DEV2" }, | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 140 { 0x003C0003, "DEV3" }, | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 141 { 0x00460001, "RNET" }, | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 142 { 0x00460002, "RNET_WS" }, | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 143 { 0x00460004, "RNET_RT" }, | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 144 { 0x00460008, "RNET_BR" }, | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 145 { 0x00640001, "MSME" }, | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 146 { 0x00640002, "MSFE" }, | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 147 { 0x00640004, "STKE" }, | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 148 { 0x00640008, "BRSE" }, | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 149 { 0x00640010, "BRAE" }, | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 150 { 0x00640020, "PHSE" }, | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 151 { 0x00640040, "IBSE" }, | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 152 { 0x00640080, "MMSE" }, | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 153 { 0x00640100, "SLSE" }, | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 154 { 0x00640200, "SMAE" }, | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 155 { 0x00640400, "MEAE" }, | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 156 { 0x00640800, "SECE" }, | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 157 { 0x00641000, "SELE" }, | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 158 { 0x00642000, "PRSE" }, | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 159 { 0x00644000, "JAAE" }, | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 160 { 0x00648000, "JASE" }, | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 161 { 0x006E0001, "IT1E" }, | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 162 { 0x006E0002, "IT2E" }, | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 163 { 0x006E0004, "IT0E" }, | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 164 { 0x0, NULL} | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 165 }; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 166 #endif | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 167 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 168 /*==== EXTERNALS ==================================================*/ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 169 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 170 extern T_HANDLE TST_Handle; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 171 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 172 #ifndef _TOOLS_ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 173 extern const T_PCON_PROPERTIES *pcon; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 174 extern ULONG MaxPrimPartSize; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 175 extern const T_MEM_PROPERTIES *mem; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 176 #endif | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 177 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 178 #ifdef CTB | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 179 extern BOOL ctb_sent_to_tap; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 180 extern BOOL ctb_tick_enabled; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 181 #endif | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 182 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 183 /*==== VARIABLES ==================================================*/ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 184 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 185 #ifndef RUN_INT_RAM | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 186 char corruptWarning[] = "corrupt prim received: "; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 187 char wrongTSTWarning[] = "wrong (old) TST header used on toolside! "; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 188 T_TIF_DATA TIF_Data; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 189 static ULONG TIF_WrInd = 0; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 190 BOOL socket_flush = TRUE; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 191 #else | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 192 extern T_TIF_DATA TIF_Data; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 193 extern BOOL socket_flush; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 194 #endif /* RUN_INT_RAM */ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 195 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 196 #ifdef _TOOLS_ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 197 char buffer[80]; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 198 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 199 const T_PCON_PROPERTIES pcon_export = | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 200 { | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 201 pcon_init_prim_coding, | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 202 pcon_decodePrim, | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 203 pcon_codePrim, | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 204 pcon_make_filter, | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 205 PCON_STACK_OFFSET | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 206 }; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 207 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 208 T_PCON_PROPERTIES const *pcon = &pcon_export; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 209 #endif | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 210 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 211 /*==== FUNCTIONS ==================================================*/ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 212 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 213 #ifndef RUN_INT_RAM | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 214 USHORT TIF_Write ( void *Buffer, ULONG *BytesToWrite ); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 215 #endif | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 216 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 217 #ifndef RUN_INT_RAM | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 218 /* | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 219 +--------------------------------------------------------------------+ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 220 | PROJECT : GSM-Frame (8415) MODULE : TIF | | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 221 | STATE : code ROUTINE : TIF_Exit | | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 222 +--------------------------------------------------------------------+ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 223 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 224 PURPOSE : exit a driver | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 225 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 226 */ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 227 LOCAL void TIF_Exit ( void ) | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 228 { | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 229 #ifdef _TOOLS_ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 230 ccddata_exit(); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 231 #endif /* _TOOLS_ */ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 232 } | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 233 #endif | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 234 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 235 #ifndef RUN_FLASH | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 236 /* | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 237 +--------------------------------------------------------------------+ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 238 | PROJECT : GSM-Frame (8415) MODULE : TIF | | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 239 | STATE : code ROUTINE : TIF_Write | | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 240 +--------------------------------------------------------------------+ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 241 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 242 PURPOSE : write data to driver | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 243 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 244 */ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 245 /* Lint is not able to analyze the program flow through if...else constructions | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 246 and therefor bring a bunch of warnings.*/ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 247 /*lint -e645 suppress warning -- Symbol '...' may not have been initialized */ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 248 /*lint -e644 suppress warning -- Symbol '...' may not have been initialized */ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 249 /*lint -e613 suppress warning -- possibly use of NULL pointer '...' */ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 250 USHORT TIF_Write ( void *Buffer, ULONG *BytesToWrite ) | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 251 { | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 252 T_PRIM_HEADER *prim = (T_PRIM_HEADER*)Buffer; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 253 T_PRIM_HEADER *prim_ptr = NULL; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 254 TST_SMALL_HEADER *tst_header_ptr; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 255 T_S_HEADER *s_hdr; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 256 unsigned int bytes_to_write; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 257 unsigned int size; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 258 unsigned int name_len; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 259 unsigned int length; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 260 unsigned int org_rcv_len = 0; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 261 unsigned int opc_len = 0; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 262 unsigned int bytes_written = 0; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 263 unsigned int write_flag = 0; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 264 char *write_ptr; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 265 char *tst_data_ptr; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 266 char trace_opc=0; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 267 char Sender[RESOURCE_NAMELEN] = {0}; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 268 void *coded_prim; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 269 void *decoded_prim; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 270 int pcon_called = 0; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 271 int is_primitive = TRUE; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 272 int ret = DRV_OK; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 273 int sts; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 274 #ifdef _TOOLS_ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 275 int is_generated_primitive = FALSE; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 276 #endif /* _TOOLS_ */ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 277 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 278 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 279 s_hdr = (T_S_HEADER*)((ULONG*)prim + prim->sh_offset); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 280 if ( prim->opc & SYS_MASK ) | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 281 { | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 282 size = prim->len - sizeof(T_PRIM_HEADER); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 283 tst_data_ptr = (char*)P2D(prim); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 284 tst_header_ptr = (TST_SMALL_HEADER*) tst_data_ptr - 1; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 285 tst_header_ptr->combined[INFO_BYTE] = (~HDR_IDENT_MASK | IDENT_SYS_PRIM); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 286 InsertString(s_hdr->rcv, (char*)&tst_header_ptr->receiver, 4); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 287 is_primitive = FALSE; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 288 #ifdef _TOOLS_ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 289 if ( (length = GetNextToken (tst_data_ptr, buffer, " #")) > 0) | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 290 { | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 291 if ( !strcmp (buffer, FILTER) ) | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 292 { | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 293 void *filter_prim; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 294 if ( (pcon != NULL) && pcon->make_filter(tst_data_ptr+length+1, &filter_prim) == PCON_OK ) | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 295 { | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 296 prim = D2P(filter_prim); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 297 s_hdr = (T_S_HEADER*)((ULONG*)prim + prim->sh_offset); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 298 is_primitive = TRUE; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 299 is_generated_primitive = TRUE; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 300 } | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 301 } | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 302 } | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 303 #endif | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 304 } | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 305 else if ( (SAP_NR(prim->opc)==TRACE_SAP) || (prim->opc==TRACE_OPC) ) | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 306 { | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 307 is_primitive = FALSE; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 308 size = prim->len - sizeof(T_PRIM_HEADER); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 309 tst_data_ptr = (char*)P2D(prim); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 310 if (prim->opc!=TRACE_OPC) | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 311 { | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 312 /* we have a traceclass id */ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 313 trace_opc=(char)PRIM_NR(prim->opc); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 314 } | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 315 tst_header_ptr = (TST_SMALL_HEADER*) tst_data_ptr - 1; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 316 tst_header_ptr->combined[INFO_BYTE] = (~HDR_IDENT_MASK | IDENT_TRACE); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 317 InsertString(FRM_PCO_NAME, (char*)&tst_header_ptr->receiver, 4); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 318 } | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 319 if ( is_primitive == TRUE ) | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 320 { | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 321 TST_BIG_HEADER tst_big_header; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 322 TST_BIG_HEADER *tst_big_header_ptr; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 323 #ifdef _TOOLS_ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 324 /* on the tool side the primitive to be duplicated is copied when sent to TST */ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 325 prim_ptr = prim; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 326 #else | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 327 /* in the target a pointer to the primitive to be duplicated is transported in a carrier of type T_PRIM_X */ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 328 prim_ptr = (T_PRIM_HEADER*)((T_PRIM_X*)(prim))->prim_ptr; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 329 #endif | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 330 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 331 size = prim_ptr->len - sizeof(T_PRIM_HEADER); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 332 tst_data_ptr = (char*)P2D(prim_ptr); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 333 tst_big_header_ptr = &tst_big_header; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 334 opc_len = 4; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 335 org_rcv_len = 4; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 336 if ( (pcon != NULL) && (TIF_Data.Config & PCON_ENABLED) && !(prim_ptr->opc & VIRTUAL_OPC) ) | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 337 { | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 338 decoded_prim = P2D(prim_ptr); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 339 if ( (sts = (int)(pcon->code_prim( prim_ptr->opc, decoded_prim, &coded_prim, (ULONG*)&size, 0, s_hdr->rcv ))) != PCON_OK ) | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 340 { | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 341 vsi_o_ttrace (NO_TASK, TC_SYSTEM,"PCON Code Error %d, TIF_Write() aborted", sts ); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 342 return DRV_INTERNAL_ERROR; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 343 } | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 344 else | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 345 { | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 346 prim_ptr = D2P(coded_prim); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 347 tst_data_ptr = coded_prim; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 348 pcon_called = 1; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 349 } | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 350 } | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 351 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 352 EXCHANGE_4BYTES_ENDIANESS(&prim_ptr->opc); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 353 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 354 tst_big_header_ptr->opc = prim_ptr->opc; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 355 tst_big_header_ptr->combined[INFO_BYTE] = (~HDR_IDENT_MASK | IDENT_PS_PRIM); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 356 InsertString(s_hdr->rcv, (char*) &tst_big_header_ptr->receiver, 4); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 357 InsertString(s_hdr->org_rcv, (char*) &tst_big_header_ptr->orgreceiver, 4); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 358 socket_flush = TRUE; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 359 tst_header_ptr = (TST_SMALL_HEADER*) tst_big_header_ptr; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 360 } | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 361 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 362 tst_header_ptr->combined[INFO_BYTE] = ((tst_header_ptr->combined[INFO_BYTE] & (~HDR_VERSION_MASK)) | HDR_VALID_VERSION_1); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 363 tst_header_ptr->combined[INFO_BYTE] = ((tst_header_ptr->combined[INFO_BYTE] & (~HDR_TIME_MASK)) | HDR_TIME_MS); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 364 tst_header_ptr->time = s_hdr->time; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 365 EXCHANGE_4BYTES_ENDIANESS(&tst_header_ptr->time); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 366 tst_header_ptr->sender[0] = 0; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 367 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 368 if ( s_hdr->snd[0] == 0 ) | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 369 { | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 370 if ( *tst_data_ptr == '~') | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 371 { | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 372 name_len = GetNextToken ((char*)(tst_data_ptr), Sender, "~"); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 373 InsertString(Sender, (char*) &tst_header_ptr->sender, 4); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 374 size -= 2+name_len; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 375 /* rub out a leading ~NAM~ in data field: */ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 376 memcpy ( tst_data_ptr, tst_data_ptr + 2 + name_len, size ); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 377 } | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 378 else | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 379 { | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 380 InsertString(FRM_SYST_NAME, (char*)&tst_header_ptr->sender, 4); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 381 } | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 382 } | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 383 else | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 384 { | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 385 T_HANDLE TaskHandle; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 386 if ( s_hdr->snd[0] & ~HANDLE_MASK ) | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 387 { | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 388 TaskHandle = (T_HANDLE)(s_hdr->snd[0]&HANDLE_MASK); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 389 vsi_e_name ( TST_Handle, TaskHandle, Sender ); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 390 InsertString(Sender, (char*)&tst_header_ptr->sender, 4); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 391 } | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 392 else | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 393 { | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 394 InsertString(s_hdr->snd, (char*)&tst_header_ptr->sender, 4); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 395 } | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 396 } | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 397 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 398 length = size + TST_HEADER_TRAILING_FIELDS + org_rcv_len + opc_len + (trace_opc ? 1 : 0); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 399 tst_header_ptr->combined[FIRST_BYTE] = (UBYTE) (LOW_MASK & length); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 400 tst_header_ptr->combined[SECOND_BYTE] = (UBYTE) (LOW_MASK & (length >> 8)); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 401 bytes_to_write = length + TST_HEADER_LEADING_FIELDS; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 402 write_ptr = (char*)&tst_header_ptr->combined[INFO_BYTE]; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 403 if (trace_opc) | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 404 { | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 405 /* move small header 1 byte to the left and insert trace class id */ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 406 char *trace_opc_ptr=tst_data_ptr-1; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 407 write_ptr = (char*)tst_header_ptr; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 408 memcpy(write_ptr,(char*)tst_header_ptr+1,sizeof(TST_SMALL_HEADER)-1); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 409 *trace_opc_ptr=trace_opc; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 410 length++; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 411 } | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 412 else if ( prim_ptr != NULL ) | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 413 { | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 414 bytes_written = TST_BIG_HEADER_SIZE; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 415 if ( vsi_d_write ( TIF_Data.Handle, 0, write_ptr, bytes_written | PRIM_HEADER_FLAG ) != VSI_OK ) | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 416 { | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 417 ret = DRV_INTERNAL_ERROR; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 418 *BytesToWrite = 0; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 419 } | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 420 write_ptr = tst_data_ptr; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 421 write_flag = PRIM_DATA_FLAG; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 422 } | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 423 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 424 if (ret==DRV_OK) | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 425 { | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 426 #if defined (_TOOLS_) || defined (_LINUX_) || defined (_SOLARIS_) | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 427 socket_flush = TRUE; /* flush socket always on tool side */ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 428 #endif | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 429 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 430 if ( vsi_d_write ( TIF_Data.Handle, 0, write_ptr, (bytes_to_write - bytes_written) | write_flag ) != VSI_OK ) | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 431 { | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 432 ret = DRV_INTERNAL_ERROR; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 433 *BytesToWrite = 0; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 434 } | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 435 } | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 436 if ( pcon_called ) | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 437 { | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 438 PFREE(P2D((T_VOID_STRUCT*)prim_ptr)); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 439 } | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 440 #ifdef _TOOLS_ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 441 if ( is_generated_primitive == TRUE ) | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 442 { | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 443 vsi_c_free ( TST_Handle, (T_VOID_STRUCT**)&prim ); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 444 } | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 445 #else /* _TOOLS_ */ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 446 if (prim->opc & MEMHANDLE_OPC) | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 447 { | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 448 M_FREE(P_MEMHANDLE_SDU(((T_PRIM_X*)(prim))->prim_ptr)); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 449 } | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 450 #endif /* _TOOLS_ */ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 451 #if defined _NUCLEUS_ && !defined _TARGET_ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 452 #ifdef CTB | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 453 if(ctb_tick_enabled && !ctb_sent_to_tap && !strncmp(tst_header_ptr->receiver,"TAP",3)) | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 454 { | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 455 ctb_sent_to_tap = TRUE; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 456 } | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 457 #endif | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 458 #endif | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 459 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 460 return ( (USHORT)ret ); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 461 } | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 462 /*lint +e645 */ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 463 /*lint +e613 */ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 464 #endif | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 465 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 466 #ifndef RUN_INT_RAM | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 467 /* | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 468 +--------------------------------------------------------------------+ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 469 | PROJECT : GSM-Frame (8415) MODULE : TIF | | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 470 | STATE : code ROUTINE : TIF_SetSignal | | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 471 +--------------------------------------------------------------------+ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 472 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 473 PURPOSE : enable signal for the driver | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 474 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 475 */ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 476 LOCAL USHORT TIF_SetSignal ( USHORT SignalType ) | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 477 { | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 478 if ( !(SignalType & ALLOWED_TIF_SIGNALS) ) | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 479 return DRV_INVALID_PARAMS; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 480 else | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 481 TIF_Data.EnabledSignalType |= SignalType; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 482 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 483 return DRV_OK; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 484 } | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 485 #endif | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 486 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 487 #ifndef RUN_INT_RAM | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 488 /* | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 489 +--------------------------------------------------------------------+ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 490 | PROJECT : GSM-Frame (8415) MODULE : TIF | | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 491 | STATE : code ROUTINE : TIF_ResetSignal | | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 492 +--------------------------------------------------------------------+ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 493 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 494 PURPOSE : disable signal for the driver | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 495 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 496 */ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 497 LOCAL USHORT TIF_ResetSignal ( USHORT SignalType ) | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 498 { | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 499 if ( !(SignalType & ALLOWED_TIF_SIGNALS) ) | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 500 return DRV_INVALID_PARAMS; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 501 else | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 502 TIF_Data.EnabledSignalType &= ~SignalType; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 503 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 504 return DRV_OK; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 505 } | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 506 #endif | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 507 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 508 #ifndef RUN_INT_RAM | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 509 /* | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 510 +--------------------------------------------------------------------+ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 511 | PROJECT : GSM-Frame (8415) MODULE : TIF | | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 512 | STATE : code ROUTINE : TIF_SetConfig | | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 513 +--------------------------------------------------------------------+ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 514 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 515 PURPOSE : set configuration for the driver | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 516 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 517 */ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 518 /*lint -esym(715,Buffer), suppress Info -- Symbol 'Buffer' not referenced) */ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 519 LOCAL USHORT TIF_SetConfig ( char *Buffer ) | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 520 { | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 521 if ( !strcmp ( TIF_PCON_ENABLE, Buffer ) ) | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 522 { | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 523 if ( TIF_Data.Config & PCON_ENABLED) | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 524 { | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 525 /* already in PCON mode */ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 526 return DRV_OK; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 527 } | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 528 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 529 #ifdef _TOOLS_ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 530 switch (ccddata_init(NULL,0,NULL,NULL)) | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 531 { | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 532 case CCDDATA_DLL_OK: | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 533 case CCDDATA_DLL_ALREADY: | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 534 break; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 535 default: | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 536 return DRV_INTERNAL_ERROR; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 537 } | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 538 #endif | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 539 TIF_Data.Config |= PCON_ENABLED; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 540 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 541 #ifdef _TOOLS_ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 542 printf("TIF: PCON mode selected\n"); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 543 #endif | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 544 return DRV_OK; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 545 } | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 546 else if ( !strcmp ( DRV_DEFAULT, Buffer ) ) | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 547 { | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 548 if ( !(TIF_Data.Config & PCON_ENABLED)) | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 549 { | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 550 /* already in default mode */ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 551 return DRV_OK; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 552 } | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 553 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 554 #ifdef _TOOLS_ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 555 ccddata_exit(); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 556 #endif | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 557 TIF_Data.Config &= ~PCON_ENABLED; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 558 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 559 #ifdef _TOOLS_ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 560 printf("TIF: default mode selected\n"); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 561 #endif | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 562 return DRV_OK; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 563 } | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 564 #ifdef _TOOLS_ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 565 else if ( !strcmp ( ENABLE_SYNC_MODE, Buffer ) ) | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 566 { | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 567 TIF_Data.Config |= SYNC_MODE; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 568 PrintToFile("TIF: sync mode enabled\n"); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 569 return DRV_OK; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 570 } | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 571 else if ( !strcmp ( DISABLE_SYNC_MODE, Buffer ) ) | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 572 { | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 573 TIF_Data.Config &= ~SYNC_MODE; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 574 PrintToFile("TIF: sync mode disabled\n"); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 575 return DRV_OK; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 576 } | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 577 return DRV_INVALID_PARAMS; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 578 #else | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 579 return DRV_OK; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 580 #endif | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 581 } | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 582 #endif | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 583 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 584 #ifndef RUN_INT_RAM | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 585 /* | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 586 +--------------------------------------------------------------------+ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 587 | PROJECT : GSM-Frame (8415) MODULE : TIF | | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 588 | STATE : code ROUTINE : Callback | | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 589 +--------------------------------------------------------------------+ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 590 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 591 PURPOSE : callback function of the driver | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 592 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 593 */ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 594 /* Lint is not able to analyze the program flow through if...else constructions | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 595 and therefor bring a bunch of warnings.*/ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 596 /*lint -esym(645,opc_str) suppress warning -- Symbol 'opc_str' may not have been initialized */ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 597 LOCAL void TIF_Callback ( T_DRV_SIGNAL *Signal ) | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 598 { | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 599 T_PRIM_HEADER *prim; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 600 T_S_HEADER *s_hdr; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 601 T_PRIM_X *sys_prim; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 602 T_DRV_SIGNAL TIF_Signal; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 603 TST_BIG_HEADER tst_header; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 604 unsigned int CorruptByteOffset = 0; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 605 unsigned int length; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 606 unsigned int BytesToRead = 0; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 607 unsigned int BytesRead; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 608 unsigned int Bytes = 0; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 609 unsigned int i; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 610 unsigned int opc_len = 0; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 611 unsigned int org_rcv_len = 0; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 612 unsigned int alloc_size; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 613 int sts; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 614 int WrongTSTHeader = FALSE; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 615 char *target; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 616 void *decoded_prim; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 617 char opc_str[4]; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 618 #ifdef _TOOLS_ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 619 int l1_sigtype = 0; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 620 #endif | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 621 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 622 switch ( Signal->SignalType ) | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 623 { | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 624 #ifdef _TOOLS_ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 625 case DRV_SIGTYPE_READ_L1: | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 626 l1_sigtype = 1; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 627 /*lint -fallthrough*/ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 628 case DRV_SIGTYPE_READ_RIV: | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 629 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 630 if ( vsi_d_read ( TIF_Data.Handle, 0, NULL, &BytesToRead ) != DRV_OK ) | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 631 return; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 632 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 633 alloc_size = S_ALLOC_SIZE(BytesToRead + 1); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 634 if ( ( prim = (T_PRIM_HEADER*)vsi_c_new ( TST_Handle, alloc_size, 0 FILE_LINE_MACRO )) != NULL ) | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 635 { | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 636 TIF_WrInd = 0; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 637 Bytes = 0; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 638 BytesRead = BytesToRead; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 639 do | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 640 { | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 641 vsi_d_read ( TIF_Data.Handle, 0, (void*)((char*)P2D(prim)+TIF_WrInd), &BytesRead ); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 642 Bytes += BytesRead; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 643 if ( Bytes < BytesToRead ) | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 644 { | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 645 TIF_WrInd += BytesRead; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 646 BytesRead = BytesToRead - BytesRead; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 647 } | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 648 } while ( Bytes < BytesToRead ); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 649 prim->sh_offset = S_HDR_OFFSET(alloc_size - sizeof(T_S_HEADER)); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 650 s_hdr = (T_S_HEADER*)((ULONG*)prim + prim->sh_offset); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 651 s_hdr->time = 0; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 652 s_hdr->org_rcv[0] = 0; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 653 if ( l1_sigtype == 1 ) | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 654 { | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 655 strcpy ( s_hdr->snd, "L1" ); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 656 } | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 657 else | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 658 { | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 659 int i = 0; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 660 unsigned int use_id = 0; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 661 unsigned char *p = (unsigned char*)P2D(prim); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 662 use_id = use_id | *p++ << 24; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 663 use_id = use_id | *p++ << 16; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 664 use_id = use_id | *p++ << 8; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 665 use_id = use_id | *p; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 666 do | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 667 { | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 668 if ( riv_use_id_to_name[i].use_id == use_id ) | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 669 { | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 670 strcpy ( s_hdr->snd, riv_use_id_to_name[i].name ); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 671 break; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 672 } | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 673 if ( riv_use_id_to_name[i+1].use_id == 0 ) | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 674 strcpy ( s_hdr->snd, "RIV" ); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 675 } while ( riv_use_id_to_name[++i].use_id != 0 ); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 676 memcpy ( (char*)P2D(prim), (char*)P2D(prim)+5, BytesToRead); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 677 } | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 678 strcpy ( s_hdr->rcv, FRM_PCO_NAME ); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 679 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 680 sys_prim = (T_PRIM_X*) vsi_c_new ( TST_Handle, alloc_size, 0 FILE_LINE_MACRO ); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 681 sys_prim->prim_ptr = prim; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 682 prim->opc = 0; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 683 prim->len = BytesToRead + sizeof(T_PRIM_HEADER); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 684 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 685 if ( TIF_Data.EnabledSignalType & DRV_SIGTYPE_READ ) | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 686 { | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 687 VSI_PPM_SEND ( (T_PRIM_HEADER*)sys_prim, TST_Handle ); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 688 VSI_PPM_SEND ( (T_PRIM_HEADER*)sys_prim->prim_ptr, TST_Handle ); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 689 TIF_Signal.SignalType = DRV_SIGTYPE_READ; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 690 TIF_Signal.DrvHandle = TIF_Data.Handle; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 691 TIF_Signal.UserData = (T_VOID_STRUCT*)sys_prim; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 692 (TIF_Data.Callback)( &TIF_Signal ); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 693 } | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 694 } | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 695 break; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 696 #endif | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 697 case DRV_SIGTYPE_READ: | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 698 /* | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 699 * Get the size of the needed buffer to store the data | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 700 */ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 701 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 702 if ( vsi_d_read ( TIF_Data.Handle, 0, NULL, (ULONG*)&BytesToRead ) != DRV_OK ) | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 703 return; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 704 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 705 if ( BytesToRead ) | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 706 { | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 707 if ( BytesToRead >= TST_SMALL_HEADER_SIZE ) | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 708 BytesToRead -= TST_SMALL_HEADER_SIZE; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 709 Bytes = 0; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 710 TIF_WrInd = 0; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 711 BytesRead = TST_SMALL_HEADER_SIZE; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 712 do | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 713 { | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 714 vsi_d_read ( TIF_Data.Handle, 0, (void*)((char*)&tst_header.combined[INFO_BYTE]+TIF_WrInd), (ULONG*)&BytesRead ); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 715 Bytes += BytesRead; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 716 if ( Bytes < TST_SMALL_HEADER_SIZE ) | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 717 { | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 718 TIF_WrInd += BytesRead; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 719 BytesRead = TST_SMALL_HEADER_SIZE - BytesRead; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 720 } | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 721 } while ( Bytes < TST_SMALL_HEADER_SIZE ); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 722 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 723 alloc_size = ALIGN(sizeof(T_PRIM_X)); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 724 sys_prim = (T_PRIM_X*) vsi_c_new ( TST_Handle, alloc_size, 0 FILE_LINE_MACRO ); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 725 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 726 switch (tst_header.combined[INFO_BYTE] & HDR_IDENT_MASK) | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 727 { | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 728 case IDENT_ABORT: | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 729 tst_header.combined[INFO_BYTE] = ((tst_header.combined[INFO_BYTE] & ~HDR_IDENT_MASK) | IDENT_TRACE); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 730 #ifdef _TOOLS_ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 731 /* TR did loose byte(s)! Primitive is corrupt, no header val can be | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 732 guaranteed to be valid. | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 733 Create a HUGE trace prim with zero time, sender tst, receiver pco, | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 734 org_receiver tst | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 735 TRACE DATA will contain: a "corrupt prim received: " string, | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 736 the already received part of the prim and all the rest */ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 737 CorruptByteOffset = TST_SMALL_HEADER_SIZE + strlen(corruptWarning) + 1; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 738 #else | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 739 /* TR did receive a prim from tool side old TST header format and swiched to new. | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 740 Now we have to TRACE the wrong tool side format, because the prim is lost. */ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 741 WrongTSTHeader = TRUE; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 742 BytesToRead = 0; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 743 CorruptByteOffset = strlen(wrongTSTWarning) + 1; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 744 #endif | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 745 break; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 746 case IDENT_PS_PRIM: | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 747 opc_len = 4; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 748 org_rcv_len = 4; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 749 break; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 750 default: | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 751 break; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 752 } | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 753 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 754 if ( (BytesRead = org_rcv_len) > 0 ) | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 755 { | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 756 if ( BytesToRead >= org_rcv_len ) | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 757 BytesToRead -= org_rcv_len; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 758 Bytes = 0; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 759 TIF_WrInd = 0; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 760 do | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 761 { | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 762 vsi_d_read ( TIF_Data.Handle, 0, (void*)((char*)&tst_header.orgreceiver+TIF_WrInd), (ULONG*)&BytesRead ); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 763 Bytes += BytesRead; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 764 if ( Bytes < org_rcv_len ) | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 765 { | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 766 TIF_WrInd += BytesRead; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 767 BytesRead = org_rcv_len - BytesRead; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 768 } | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 769 } while ( Bytes < org_rcv_len ); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 770 } | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 771 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 772 if ( (BytesRead = opc_len) > 0 ) | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 773 { | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 774 if ( BytesToRead >= opc_len ) | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 775 BytesToRead -= opc_len; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 776 Bytes = 0; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 777 TIF_WrInd = 0; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 778 do | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 779 { | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 780 vsi_d_read ( TIF_Data.Handle, 0, (void*)(opc_str+TIF_WrInd), (ULONG*)&BytesRead ); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 781 Bytes += BytesRead; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 782 if ( Bytes < opc_len ) | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 783 { | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 784 TIF_WrInd += BytesRead; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 785 BytesRead = opc_len - BytesRead; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 786 } | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 787 } while ( Bytes < opc_len ); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 788 } | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 789 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 790 alloc_size = S_ALLOC_SIZE(CorruptByteOffset + BytesToRead + 1); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 791 #ifdef _TOOLS_ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 792 if ( alloc_size > MAX_PRIM_PARTITION_SIZE - sizeof(T_PRIM_HEADER) - sizeof(T_S_HEADER)) | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 793 alloc_size = MAX_PRIM_PARTITION_SIZE - sizeof(T_PRIM_HEADER) - sizeof(T_S_HEADER); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 794 #else | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 795 if ( alloc_size > MaxPrimPartSize - sizeof(T_PRIM_HEADER) - sizeof(T_S_HEADER) ) | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 796 alloc_size = MaxPrimPartSize - sizeof(T_PRIM_HEADER) - sizeof(T_S_HEADER); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 797 #endif | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 798 if ( ( prim = (T_PRIM_HEADER*)vsi_c_new ( TST_Handle, alloc_size, 0 FILE_LINE_MACRO )) != NULL ) | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 799 { | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 800 TIF_WrInd = 0; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 801 Bytes = 0; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 802 if ((BytesToRead + CorruptByteOffset) > alloc_size) | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 803 { | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 804 #ifdef _TOOLS_ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 805 PrintToFile("TIF: Reduced a new Prim's size\n"); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 806 #endif | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 807 BytesToRead = alloc_size - CorruptByteOffset; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 808 } | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 809 BytesRead = BytesToRead; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 810 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 811 target = (char*) P2D(prim); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 812 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 813 if (WrongTSTHeader) | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 814 { | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 815 memcpy(target, wrongTSTWarning, strlen(wrongTSTWarning)); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 816 target += strlen(wrongTSTWarning); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 817 } | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 818 else if (CorruptByteOffset) | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 819 { | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 820 #ifdef _TOOLS_ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 821 PrintToFile("TIF: Byte(s) lost\n"); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 822 #endif | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 823 memcpy(target, corruptWarning, strlen(corruptWarning)); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 824 target += strlen(corruptWarning); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 825 /*lint -e420, suppress Warning -- Apparent access beyond array for function 'memcpy(...*/ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 826 memcpy(target,&tst_header.combined[INFO_BYTE], TST_SMALL_HEADER_SIZE-1); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 827 /*lint +e420 */ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 828 target += TST_SMALL_HEADER_SIZE - 1; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 829 } | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 830 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 831 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 832 if (WrongTSTHeader == FALSE && BytesToRead) | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 833 { | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 834 if ( (tst_header.combined[INFO_BYTE] & HDR_IDENT_MASK)==IDENT_TRACE ) | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 835 { | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 836 /* we read the first bytes in advance in case the trace class is carried */ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 837 ULONG bread=1; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 838 vsi_d_read ( TIF_Data.Handle, 0, (void*)((char*)target+TIF_WrInd), &bread ); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 839 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 840 if (bread==1 && *((char*)target)<0x20) /* no character -> assume traceclass id */ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 841 { | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 842 opc_str[0]=*((char*)target); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 843 opc_len=1; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 844 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 845 BytesToRead -= bread; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 846 } | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 847 else | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 848 { | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 849 /* ok, we have no traceclass info :-( */ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 850 TIF_WrInd += bread; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 851 Bytes += bread; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 852 } | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 853 BytesRead = BytesToRead - Bytes; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 854 } | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 855 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 856 do | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 857 { | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 858 vsi_d_read ( TIF_Data.Handle, 0, (void*)((char*)target+TIF_WrInd), (ULONG*)&BytesRead ); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 859 Bytes += BytesRead; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 860 if ( Bytes < BytesToRead ) | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 861 { | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 862 TIF_WrInd += BytesRead; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 863 BytesRead = BytesToRead - Bytes; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 864 } | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 865 } while ( Bytes < BytesToRead ); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 866 } | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 867 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 868 *((char*)target + Bytes) = 0; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 869 prim->sh_offset = S_HDR_OFFSET(alloc_size - sizeof(T_S_HEADER)); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 870 s_hdr = (T_S_HEADER*)((ULONG*)prim + prim->sh_offset); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 871 switch (tst_header.combined[INFO_BYTE] & HDR_IDENT_MASK) | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 872 { | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 873 case IDENT_PS_PRIM: | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 874 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 875 EXCHANGE_4BYTES_ENDIANESS(opc_str); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 876 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 877 memcpy((char*)&prim->opc, opc_str, 4); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 878 if ( (pcon != NULL) && (TIF_Data.Config & PCON_ENABLED) ) | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 879 { | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 880 if ( (sts = (int)pcon->decode_prim ( prim->opc, &decoded_prim, (void*)((char*)prim+sizeof(T_PRIM_HEADER)), (ULONG*)&length, 0 )) != PCON_OK ) | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 881 { | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 882 if ( sts != PCON_CONFIG_PRIM ) | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 883 { | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 884 vsi_o_ttrace (NO_TASK, TC_SYSTEM,"PCON Deode Error %d, TIF_Callback() aborted", sts ); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 885 } | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 886 PFREE(P2D(sys_prim)); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 887 PFREE(P2D(prim)); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 888 return; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 889 } | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 890 PFREE(P2D((T_VOID_STRUCT*)prim)); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 891 sys_prim->prim_ptr = D2P(decoded_prim); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 892 } | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 893 else | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 894 { | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 895 sys_prim->prim_ptr = prim; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 896 length = BytesToRead; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 897 } | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 898 sys_prim->prim_ptr->sh_offset = S_HDR_OFFSET(length+sizeof(T_PRIM_HEADER)); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 899 sys_prim->prim_ptr->len = length + sizeof(T_PRIM_HEADER); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 900 s_hdr = (T_S_HEADER*)((ULONG*)sys_prim->prim_ptr + sys_prim->prim_ptr->sh_offset); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 901 #ifndef _TOOLS_ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 902 /* evtl. convert aux sdu to mem handle */ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 903 if (sys_prim->prim_ptr->opc & MEMHANDLE_OPC && mem!=NULL) | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 904 { | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 905 if (P_MEMHANDLE_SDU(sys_prim->prim_ptr)) | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 906 { | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 907 U32 mem_handle; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 908 U8 buffer_handle; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 909 U8 user_handle; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 910 U8 *user_data; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 911 T_sdu *sdu; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 912 U16 len; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 913 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 914 sdu=(T_sdu *)P_MEMHANDLE_SDU(sys_prim->prim_ptr); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 915 len=(sdu->l_buf + 7)/8; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 916 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 917 buffer_handle=mem->create_buffer(MEM_UNORDERED_BUFFER, len); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 918 user_handle = mem->create_user(buffer_handle, 23, "TST"); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 919 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 920 user_data=mem->alloc(user_handle,len,&mem_handle); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 921 memcpy(user_data,sdu->buf+(sdu->o_buf+7)/8,len); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 922 P_MEMHANDLE(sys_prim->prim_ptr)=mem_handle; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 923 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 924 mem->delete_user(user_handle); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 925 mem->delete_buffer(buffer_handle); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 926 } | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 927 } | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 928 #endif | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 929 break; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 930 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 931 case IDENT_SYS_PRIM: | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 932 sys_prim->prim_ptr = prim; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 933 prim->opc = SYS_MASK; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 934 prim->len = BytesToRead + sizeof(T_PRIM_HEADER); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 935 break; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 936 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 937 case IDENT_TRACE: | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 938 sys_prim->prim_ptr = prim; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 939 if (opc_len) | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 940 { | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 941 /* nice, we found a traceclass info */ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 942 prim->opc = opc_str[0]; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 943 prim->opc = prim->opc << 16; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 944 prim->opc |= EXTENDED_OPC | VIRTUAL_OPC | TRACE_SAP; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 945 } | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 946 else | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 947 { | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 948 prim->opc = TRACE_OPC; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 949 } | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 950 prim->len = CorruptByteOffset + BytesToRead + sizeof(T_PRIM_HEADER); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 951 break; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 952 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 953 default: | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 954 break; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 955 } | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 956 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 957 /* | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 958 * Extract Sender and Receiverfrom header | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 959 */ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 960 if (CorruptByteOffset) | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 961 { | 
| 326 
7e878e6b9cf7
gsm-fw/gpf/tst_drv: tif2.c compiles
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: 
322diff
changeset | 962 s_hdr->time = 0; /* FreeCalypso: changed from NULL */ | 
| 322 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 963 #ifndef _TOOLS_ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 964 memcpy ( s_hdr->snd, "~TST", 4 ); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 965 memcpy ( s_hdr->rcv, FRM_TST_NAME, 4 ); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 966 #else | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 967 memcpy ( s_hdr->snd, FRM_TST_NAME, 4 ); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 968 memcpy ( s_hdr->rcv, FRM_PCO_NAME, 4 ); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 969 #endif | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 970 memcpy ( s_hdr->org_rcv, "TST", 4 ); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 971 } | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 972 else | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 973 { | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 974 s_hdr->time = tst_header.time; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 975 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 976 i = 0; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 977 do | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 978 { | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 979 s_hdr->snd[i] = tst_header.sender[i]; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 980 i++; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 981 } while ( tst_header.sender[i] != 0x20 && i < 4 ); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 982 s_hdr->snd[i] = 0; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 983 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 984 i = 0; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 985 do | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 986 { | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 987 s_hdr->rcv[i] = tst_header.receiver[i]; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 988 i++; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 989 } while ( tst_header.receiver[i] != 0x20 && i < 4 ); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 990 s_hdr->rcv[i] = 0; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 991 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 992 if (org_rcv_len) | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 993 { | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 994 i = 0; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 995 do | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 996 { | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 997 s_hdr->org_rcv[i] = tst_header.orgreceiver[i]; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 998 i++; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 999 } while ( tst_header.orgreceiver[i] != 0x20 && i < 4 ); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1000 s_hdr->org_rcv[i] = 0; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1001 } | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1002 } | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1003 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1004 if ( TIF_Data.EnabledSignalType & DRV_SIGTYPE_READ ) | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1005 { | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1006 VSI_PPM_SEND ( (T_PRIM_HEADER*)sys_prim, TST_Handle ); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1007 VSI_PPM_SEND ( (T_PRIM_HEADER*)sys_prim->prim_ptr, TST_Handle ); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1008 TIF_Signal.SignalType = DRV_SIGTYPE_READ; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1009 TIF_Signal.DrvHandle = TIF_Data.Handle; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1010 TIF_Signal.UserData = (T_VOID_STRUCT*)sys_prim; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1011 (TIF_Data.Callback)( &TIF_Signal ); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1012 } | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1013 } | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1014 } /* if ( BytesToRead ) */ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1015 break; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1016 case DRV_SIGTYPE_CONNECT: | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1017 case DRV_SIGTYPE_DISCONNECT: | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1018 if ( TIF_Data.EnabledSignalType & Signal->SignalType ) | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1019 { | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1020 TIF_Signal.SignalType = Signal->SignalType; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1021 TIF_Signal.DrvHandle = TIF_Data.Handle; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1022 TIF_Signal.UserData = NULL; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1023 (TIF_Data.Callback)( &TIF_Signal ); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1024 } | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1025 break; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1026 default: | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1027 break; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1028 } | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1029 } | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1030 #endif | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1031 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1032 #ifndef RUN_INT_RAM | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1033 /* | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1034 +--------------------------------------------------------------------+ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1035 | PROJECT : GSM-Frame (8415) MODULE : TIF | | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1036 | STATE : code ROUTINE : TIF_Init | | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1037 +--------------------------------------------------------------------+ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1038 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1039 PURPOSE : initialize driver | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1040 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1041 */ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1042 GLOBAL USHORT TIF_Init ( USHORT DrvHandle, T_DRV_CB_FUNC CallbackFunc, T_DRV_EXPORT const **DrvInfo ) | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1043 { | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1044 static const T_DRV_EXPORT TIF_Info = | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1045 { | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1046 TIF_NAME, | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1047 0, | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1048 { | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1049 #ifdef _TOOLS_ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1050 TIF_Init, | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1051 #endif | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1052 TIF_Exit, | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1053 NULL, | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1054 TIF_Write, | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1055 NULL, | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1056 NULL, | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1057 NULL, | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1058 TIF_SetSignal, | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1059 TIF_ResetSignal, | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1060 TIF_SetConfig, | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1061 NULL, | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1062 TIF_Callback, | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1063 } | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1064 }; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1065 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1066 #ifndef _TOOLS_ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1067 union | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1068 { | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1069 USHORT s; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1070 UBYTE b[2]; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1071 } test; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1072 #endif /* !_TOOLS_ */ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1073 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1074 TIF_Data.Handle = DrvHandle; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1075 TIF_Data.EnabledSignalType = 0; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1076 TIF_Data.Config = 0; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1077 TIF_Data.Callback = CallbackFunc; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1078 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1079 #ifdef _TOOLS_ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1080 switch (ccddata_init(NULL,0,NULL,NULL)) | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1081 { | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1082 case CCDDATA_DLL_OK: | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1083 case CCDDATA_DLL_ALREADY: | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1084 break; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1085 default: | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1086 return DRV_INITFAILURE; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1087 } | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1088 #else /* _TOOLS_ */ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1089 test.s = 1; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1090 if ( pcon != NULL ) | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1091 { | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1092 ULONG sts = pcon->init_prim_coding ( TST_Handle,(UBYTE)((test.b[0]==1) ? PCON_LITTLE : PCON_BIG)); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1093 #ifndef _TARGET_ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1094 vsi_pcheck_register (pcon->pcheck, PCON_OK); | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1095 #endif /* !_TARGET_ */ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1096 } | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1097 #endif /* !_TOOLS_ */ | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1098 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1099 *DrvInfo = &TIF_Info; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1100 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1101 return DRV_OK; | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1102 } | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1103 #endif | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1104 | 
| 
5d1e22505446
GPF: tif library sources imported from Leonardo version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1105 | 
