annotate gsm-fw/gpf/frame/vsi_drv.c @ 316:79080922d8e4

GPF: FRAME C sources and include files imported from LoCosto source
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Thu, 10 Apr 2014 04:06:05 +0000
parents
children 2c760f6b1fe0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
316
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1 /*
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
2 +------------------------------------------------------------------------------
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
3 | File: vsi_drv.c
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
4 +------------------------------------------------------------------------------
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
5 | Copyright 2002 Texas Instruments Berlin, AG
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
6 | All rights reserved.
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
7 |
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
8 | This file is confidential and a trade secret of Texas
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
9 | Instruments Berlin, AG
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
10 | The receipt of or possession of this file does not convey
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
11 | any rights to reproduce or disclose its contents or to
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
12 | manufacture, use, or sell anything it may describe, in
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
13 | whole, or in part, without the specific written consent of
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
14 | Texas Instruments Berlin, AG.
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
15 +-----------------------------------------------------------------------------
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
16 | Purpose : This Module defines the virtual system interface part
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
17 | for driver access.
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
18 +-----------------------------------------------------------------------------
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
19 */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
20
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
21 #ifndef __VSI_DRV_C__
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
22 #define __VSI_DRV_C__
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
23 #endif
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
24
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
25 /*==== INCLUDES ===================================================*/
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
26
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
27 #include "string.h"
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
28 #include "stdio.h"
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
29 #include "typedefs.h"
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
30
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
31 #include "vsi.h"
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
32 #include "gdi.h"
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
33 #include "os.h"
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
34 #ifdef _TOOLS_
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
35 #include "drvconf.h"
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
36 #endif
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
37 #include "frm_defs.h"
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
38 #include "frm_types.h"
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
39 #include "frm_glob.h"
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
40 #include "frame.h"
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
41
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
42 /*==== TYPES ======================================================*/
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
43
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
44
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
45 #ifdef _TOOLS_
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
46 typedef struct
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
47 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
48 char Name[RESOURCE_NAMELEN];
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
49 char Process[RESOURCE_NAMELEN];
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
50 char DrvConfig[80];
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
51 } _T_DRV_LIST_ENTRY;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
52
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
53 typedef struct
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
54 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
55 _T_DRV_LIST_ENTRY DrvEntry [ 5 ];
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
56 } _T_DRV_LIST;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
57
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
58 #endif
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
59
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
60 /*==== CONSTANTS ==================================================*/
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
61
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
62
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
63 /*==== EXTERNALS ==================================================*/
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
64
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
65 /* -------------- S H A R E D - BEGIN ---------------- */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
66 #ifdef _TOOLS_
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
67 #pragma data_seg("FRAME_SHARED")
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
68 #endif
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
69
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
70 extern T_DRV_TABLE_ENTRY DrvTable [];
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
71
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
72 /*==== VARIABLES ==================================================*/
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
73
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
74 #undef EXTR_SEND_CONTROL
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
75 #ifndef RUN_INT_RAM
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
76 T_DRV_LIST *DriverConfigList; /* pointer to start of driver cinfiguration list */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
77 static T_DRV_LIST *DriverList; /* pointer to selected driver list */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
78 #ifdef EXTR_SEND_CONTROL
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
79 FILE *fp;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
80 #endif
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
81 #endif
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
82
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
83 #ifdef _TOOLS_
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
84 _T_DRV_LIST _DrvList={0};
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
85 T_DRV_LIST DrvList={0};
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
86 #endif
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
87
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
88 #ifdef _TOOLS_
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
89 #pragma data_seg()
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
90 #endif /* _TOOLS_ */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
91 /* -------------- S H A R E D - END ---------------- */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
92
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
93
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
94 /*==== FUNCTIONS ==================================================*/
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
95
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
96 void ClearDriverTable ( void );
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
97
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
98 #ifndef RUN_INT_RAM
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
99 /*
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
100 +--------------------------------------------------------------------+
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
101 | PROJECT : GSM-Frame (8415) MODULE : VSI_DRV |
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
102 | STATE : code ROUTINE : vsi_d_create |
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
103 +--------------------------------------------------------------------+
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
104
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
105 PURPOSE : enter a new driver in the driver list
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
106
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
107 */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
108 int vsi_d_create ( T_HANDLE caller, T_TST_DRV_ENTRY *drv_info )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
109 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
110 T_HANDLE drv_handle;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
111
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
112 drv_handle = drv_info->drv_pos;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
113 vsi_d_exit ( caller, 0 );
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
114 DriverList->DrvEntry[drv_handle].drv_Init = drv_info->entry.drv_Init;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
115 DriverList->DrvEntry[drv_handle].Name = drv_info->entry.Name;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
116 DriverList->DrvEntry[drv_handle].Process = drv_info->entry.Process;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
117 DriverList->DrvEntry[drv_handle].DrvConfig = drv_info->entry.DrvConfig;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
118
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
119 ClearDriverTable();
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
120 vsi_d_init ( caller );
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
121 vsi_d_setsignal ( caller, 0, DRV_SIGTYPE_READ|DRV_SIGTYPE_CONNECT|DRV_SIGTYPE_DISCONNECT);
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
122 vsi_d_setconfig ( caller, 0, NULL );
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
123 return VSI_OK;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
124 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
125 #endif
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
126
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
127 #ifndef RUN_INT_RAM
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
128 /*
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
129 +--------------------------------------------------------------------+
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
130 | PROJECT : GSM-Frame (8415) MODULE : VSI_DRV |
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
131 | STATE : code ROUTINE : vsi_d_callback |
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
132 +--------------------------------------------------------------------+
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
133
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
134 PURPOSE : callback from a driver
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
135
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
136 */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
137 void vsi_d_callback ( T_DRV_SIGNAL *Signal )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
138 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
139 T_HANDLE Caller;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
140 T_HANDLE DrvHandle;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
141 int sts;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
142 #ifdef EXTR_SEND_CONTROL
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
143 OS_TIME time;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
144 T_PRIM_HEADER *p;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
145 static int cnt = 0;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
146 int bytes;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
147 #endif
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
148
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
149 Caller = Signal->DrvHandle;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
150 DrvHandle = DrvTable[Caller].UpperDrv;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
151 if ( DrvHandle )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
152 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
153 if ( DrvTable[DrvHandle].DrvInfo->DrvFunc.drv_Callback != NULL )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
154 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
155 #if defined _TARGET_ && defined _NUCLEUS_
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
156 if ( DrvTable[Caller].DrvInfo->Flags & CALLED_FROM_ISR )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
157 os_ExecuteCallback ( Caller, DrvTable[DrvHandle].DrvInfo->DrvFunc.drv_Callback, Signal );
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
158 else
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
159 #endif
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
160 (DrvTable[DrvHandle].DrvInfo->DrvFunc.drv_Callback)( Signal );
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
161 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
162 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
163 else
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
164 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
165 if ( DrvTable[Caller].ProcessHandle )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
166 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
167 OS_QDATA Msg;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
168 OS_TIME time;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
169 Msg.data16 = MSG_SIGNAL;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
170 Msg.data32 = Signal->SignalType;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
171 Msg.ptr = Signal->UserData;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
172 os_GetTime ( 0, &time );
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
173 Msg.time = (ULONG)time;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
174 Msg.e_id = DrvTable[Caller].ProcessHandle;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
175 #ifdef EXTR_SEND_CONTROL
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
176 if ( Msg.ptr )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
177 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
178 os_GetTime(0,&time);
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
179 fp = fopen("test.txt", "a");
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
180 p = (T_PRIM_HEADER*)((T_PRIM_X*)Msg.ptr)->prim_ptr;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
181 if ( p->opc == 0x8000 )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
182 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
183 printf("EXTR: Start sending %s, time %d, %d\n", (char*)P2D(p),time, cnt & 1023 );
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
184 bytes = fprintf(fp, "EXTR: Start sending %s, time %d, %d\n", (char*)P2D(p),time, cnt & 1023 );
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
185 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
186 else
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
187 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
188 printf("EXTR: Start sending primitive, time %d, %d\n", time, cnt & 1023);
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
189 bytes = fprintf(fp, "EXTR: Start sending primitive, time %d, %d\n", time, cnt & 1023);
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
190 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
191 fclose(fp);
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
192 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
193 #endif
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
194 #ifdef _TOOLS_
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
195 sts = os_SendToQueue (NO_TASK, DrvTable[Caller].ProcessHandle, OS_NORMAL, OS_SUSPEND, &Msg );
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
196 #else
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
197 sts = os_SendToQueue (NO_TASK, pf_TaskTable[DrvTable[Caller].ProcessHandle].QueueHandle, OS_NORMAL, OS_SUSPEND, &Msg );
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
198 #endif
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
199 #ifdef EXTR_SEND_CONTROL
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
200 os_GetTime(0,&time);
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
201 fp = fopen("test.txt", "a");
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
202 printf("EXTR: Complete sending, time %d %d\n", time, cnt & 1023);
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
203 bytes = fprintf(fp,"EXTR: Complete sending, time %d %d\n", time, cnt++ & 1023);
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
204 fclose(fp);
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
205 #endif
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
206 /*
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
207 * This is a dirty patch, but due to the missing return value there is no other choice
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
208 */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
209 if ( sts == OS_TIMEOUT || sts == OS_ERROR )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
210 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
211 T_PRIM_X *sys_prim;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
212
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
213 sys_prim = (T_PRIM_X*)Signal->UserData;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
214 PFREE(P2D(sys_prim->prim_ptr));
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
215 PFREE(P2D(sys_prim));
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
216 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
217 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
218 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
219 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
220 #endif
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
221
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
222 #ifndef RUN_INT_RAM
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
223 /*
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
224 +--------------------------------------------------------------------+
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
225 | PROJECT : GSM-Frame (8415) MODULE : VSI_DRV |
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
226 | STATE : code ROUTINE : vsi_d_init |
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
227 +--------------------------------------------------------------------+
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
228
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
229 PURPOSE : initialize drivers
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
230
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
231 */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
232 /*lint -esym(644,DrvInfo) */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
233 int vsi_d_init ( T_HANDLE Caller )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
234 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
235 T_DRV_EXPORT const *DrvInfo;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
236 USHORT i;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
237 SHORT sts;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
238
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
239 #ifdef EXTR_SEND_CONTROL
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
240 fp = fopen("test.txt", "a");
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
241 fprintf(fp,"=========================================================\n");
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
242 fclose (fp);
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
243 #endif
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
244 for ( i = 1; i < MAX_TST_DRV; i++ )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
245 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
246 sts = DRV_NOTCONFIGURED;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
247 #ifdef _TOOLS_
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
248 if ( DrvTable[i].DrvInfo )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
249 sts = (SHORT)(DrvTable[i].DrvInfo->DrvFunc.drv_Init)(i,vsi_d_callback,&DrvInfo);
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
250 else
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
251 #endif
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
252 if ( DriverList->DrvEntry[i].drv_Init )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
253 sts = (SHORT)(DriverList->DrvEntry[i].drv_Init)(i,vsi_d_callback,&DrvInfo);
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
254 if ( sts == DRV_OK )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
255 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
256 if ( DriverList->DrvEntry[i].Process )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
257 DrvTable[i].ProcessHandle = vsi_c_open ( Caller, (char*)DriverList->DrvEntry[i].Process );
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
258 DrvTable[i].UpperDrv = i-1;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
259 DrvTable[i-1].LowerDrv = i;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
260 DrvTable[i].DrvInfo = DrvInfo;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
261 #if defined _TARGET_ && defined _NUCLEUS_
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
262 if ( DrvTable[i].DrvInfo->Flags & CALLED_FROM_ISR )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
263 if ( os_CreateCallback() == OS_ERROR )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
264 return VSI_ERROR;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
265 #endif
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
266 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
267 else
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
268 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
269 if ( sts != DRV_NOTCONFIGURED )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
270 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
271 return VSI_ERROR;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
272 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
273 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
274 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
275 return VSI_OK;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
276 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
277 #endif
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
278
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
279 #ifndef RUN_INT_RAM
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
280 /*
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
281 +--------------------------------------------------------------------+
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
282 | PROJECT : GSM-Frame (8415) MODULE : VSI_DRV |
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
283 | STATE : code ROUTINE : vsi_d_exit |
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
284 +--------------------------------------------------------------------+
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
285
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
286 PURPOSE : exit drivers
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
287
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
288 */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
289 int vsi_d_exit ( T_HANDLE Caller, T_HANDLE DrvHandle )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
290 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
291 T_HANDLE Handle;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
292 T_HANDLE min, max;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
293
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
294 if ( DrvHandle )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
295 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
296 min = DrvHandle;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
297 max = DrvHandle+1;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
298 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
299 else
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
300 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
301 min = 1;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
302 max = MAX_TST_DRV;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
303 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
304
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
305 for ( Handle = min; Handle < max; Handle++ )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
306 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
307 if ( DrvTable[Handle].DrvInfo )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
308 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
309 if ( DrvTable[Handle].DrvInfo->DrvFunc.drv_Exit != NULL )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
310 (DrvTable[Handle].DrvInfo->DrvFunc.drv_Exit)();
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
311 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
312 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
313 return VSI_OK;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
314 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
315 #endif
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
316
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
317 #ifndef RUN_INT_RAM
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
318 /*
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
319 +--------------------------------------------------------------------+
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
320 | PROJECT : GSM-Frame (8415) MODULE : VSI_DRV |
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
321 | STATE : code ROUTINE : vsi_d_open |
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
322 +--------------------------------------------------------------------+
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
323
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
324 PURPOSE : open a drivers
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
325
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
326 */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
327 int vsi_d_open ( T_HANDLE Caller, char *Name )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
328 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
329 int i;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
330
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
331 for ( i = 1; i <= MAX_TST_DRV; i++ )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
332 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
333 if ( DrvTable[i].DrvInfo && DrvTable[i].DrvInfo->Name )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
334 if ( !strcmp ( DrvTable[i].DrvInfo->Name, Name ) )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
335 return (i);
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
336 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
337 return VSI_ERROR;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
338 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
339 #endif
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
340
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
341 #ifndef RUN_INT_RAM
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
342 /*
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
343 +--------------------------------------------------------------------+
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
344 | PROJECT : GSM-Frame (8415) MODULE : VSI_DRV |
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
345 | STATE : code ROUTINE : vsi_d_close |
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
346 +--------------------------------------------------------------------+
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
347
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
348 PURPOSE : close a driver
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
349
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
350 */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
351 /*lint -esym(715,DrvHandle) suppress Info -- Symbol 'DrvHandle' not referenced */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
352 int vsi_d_close ( T_HANDLE Caller, T_HANDLE DrvHandle )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
353 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
354
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
355 return VSI_OK;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
356 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
357 #endif
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
358
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
359 #ifndef RUN_INT_RAM
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
360 /*
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
361 +--------------------------------------------------------------------+
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
362 | PROJECT : GSM-Frame (8415) MODULE : VSI_DRV |
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
363 | STATE : code ROUTINE : vsi_d_read |
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
364 +--------------------------------------------------------------------+
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
365
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
366 PURPOSE : read data from a driver
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
367
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
368 */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
369 int vsi_d_read ( T_HANDLE Caller, T_HANDLE DrvHandle, void *Buffer, ULONG *Size )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
370 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
371 T_HANDLE Handle;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
372
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
373 if ( DrvHandle )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
374 Handle = DrvHandle; /* Caller TST: opened driver with vsi_d_open() */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
375 else
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
376 Handle = DrvTable[Caller].LowerDrv; /* Caller drv: handle defined by ConfigSring */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
377
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
378 if ( DrvTable[Handle].DrvInfo->DrvFunc.drv_Read != NULL )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
379 if ( (DrvTable[Handle].DrvInfo->DrvFunc.drv_Read)( (void*)Buffer, Size ) == DRV_OK )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
380 return VSI_OK;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
381
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
382 return VSI_ERROR;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
383 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
384 #endif
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
385
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
386 #ifndef RUN_FLASH
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
387 /*
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
388 +--------------------------------------------------------------------+
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
389 | PROJECT : GSM-Frame (8415) MODULE : VSI_DRV |
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
390 | STATE : code ROUTINE : vsi_d_write |
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
391 +--------------------------------------------------------------------+
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
392
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
393 PURPOSE : write data to a driver
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
394
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
395 */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
396 int vsi_d_write ( T_HANDLE Caller, T_HANDLE DrvHandle, void *Buffer, ULONG Size )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
397 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
398 T_HANDLE Handle;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
399 ULONG TotalBytesToWrite = Size;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
400 ULONG BytesToWrite = Size;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
401 ULONG TotalBytesWritten = 0;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
402 ULONG BytesWritten = 0;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
403 char *ptr = (char*)Buffer;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
404
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
405 if ( DrvHandle )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
406 Handle = DrvHandle; /* Caller TST: opened driver with vsi_d_open() */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
407 else
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
408 Handle = DrvTable[Caller].LowerDrv; /* Caller drv: handle defined by ConfigSring */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
409
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
410 if ( DrvTable[Handle].DrvInfo->DrvFunc.drv_Write != NULL )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
411 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
412 while ( TotalBytesWritten < TotalBytesToWrite )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
413 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
414 BytesWritten = BytesToWrite;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
415 if ( (DrvTable[Handle].DrvInfo->DrvFunc.drv_Write)( (void*)ptr, &BytesWritten ) != DRV_OK )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
416 return VSI_ERROR;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
417 ptr += BytesWritten;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
418 TotalBytesWritten += BytesWritten;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
419 BytesToWrite = TotalBytesToWrite - TotalBytesWritten;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
420 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
421 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
422 return VSI_OK;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
423 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
424 #endif
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
425
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
426 #ifndef RUN_INT_RAM
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
427 /*
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
428 +--------------------------------------------------------------------+
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
429 | PROJECT : GSM-Frame (8415) MODULE : VSI_DRV |
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
430 | STATE : code ROUTINE : vsi_d_flush |
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
431 +--------------------------------------------------------------------+
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
432
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
433 PURPOSE : flush the internal buffers of a driver
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
434
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
435 */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
436 int vsi_d_flush ( T_HANDLE Caller, T_HANDLE DrvHandle )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
437 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
438 T_HANDLE Handle;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
439 T_HANDLE min, max;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
440
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
441 if ( DrvHandle )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
442 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
443 min = DrvHandle;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
444 max = DrvHandle+1;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
445 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
446 else
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
447 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
448 min = 1;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
449 max = MAX_TST_DRV;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
450 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
451
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
452 for ( Handle = min; Handle < max; Handle++ )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
453 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
454 if ( DrvTable[Handle].DrvInfo )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
455 if ( DrvTable[Handle].DrvInfo->DrvFunc.drv_Flush != NULL )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
456 if ( (DrvTable[Handle].DrvInfo->DrvFunc.drv_Flush)() != DRV_OK )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
457 return VSI_ERROR;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
458 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
459 return VSI_OK;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
460 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
461 #endif
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
462
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
463 #ifndef RUN_INT_RAM
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
464 /*
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
465 +--------------------------------------------------------------------+
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
466 | PROJECT : GSM-Frame (8415) MODULE : VSI_DRV |
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
467 | STATE : code ROUTINE : vsi_d_setsignal |
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
468 +--------------------------------------------------------------------+
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
469
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
470 PURPOSE : enable a signal in a driver
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
471
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
472 */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
473 int vsi_d_setsignal ( T_HANDLE Caller, T_HANDLE DrvHandle, USHORT SignalType )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
474 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
475 T_HANDLE Handle;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
476 T_HANDLE min, max;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
477
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
478 if ( DrvHandle )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
479 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
480 min = DrvHandle;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
481 max = DrvHandle+1;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
482 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
483 else
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
484 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
485 min = 1;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
486 max = MAX_TST_DRV;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
487 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
488
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
489 for ( Handle = min; Handle < max; Handle++ )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
490 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
491 if ( DrvTable[Handle].DrvInfo )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
492 if ( DrvTable[Handle].DrvInfo->DrvFunc.drv_SetSignal != NULL )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
493 if ( (DrvTable[Handle].DrvInfo->DrvFunc.drv_SetSignal)( SignalType ) != DRV_OK )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
494 return VSI_ERROR;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
495 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
496 return VSI_OK;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
497 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
498 #endif
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
499
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
500 #ifndef RUN_INT_RAM
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
501 /*
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
502 +--------------------------------------------------------------------+
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
503 | PROJECT : GSM-Frame (8415) MODULE : VSI_DRV |
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
504 | STATE : code ROUTINE : vsi_d_resetsignal |
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
505 +--------------------------------------------------------------------+
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
506
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
507 PURPOSE : disable a signal in a driver
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
508
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
509 */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
510 int vsi_d_resetsignal ( T_HANDLE Caller, T_HANDLE DrvHandle, USHORT SignalType )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
511 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
512 T_HANDLE Handle;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
513 T_HANDLE min, max;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
514
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
515 if ( DrvHandle )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
516 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
517 min = DrvHandle;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
518 max = DrvHandle+1;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
519 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
520 else
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
521 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
522 min = 1;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
523 max = MAX_TST_DRV;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
524 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
525
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
526 for ( Handle = min; Handle < max; Handle++ )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
527 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
528 if ( DrvTable[Handle].DrvInfo )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
529 if ( DrvTable[Handle].DrvInfo->DrvFunc.drv_ResetSignal != NULL )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
530 if ( (DrvTable[Handle].DrvInfo->DrvFunc.drv_ResetSignal)( SignalType ) != DRV_OK )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
531 return VSI_ERROR;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
532 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
533 return VSI_OK;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
534 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
535 #endif
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
536
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
537 #ifndef RUN_INT_RAM
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
538 /*
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
539 +--------------------------------------------------------------------+
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
540 | PROJECT : GSM-Frame (8415) MODULE : VSI_DRV |
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
541 | STATE : code ROUTINE : vsi_d_setconfig |
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
542 +--------------------------------------------------------------------+
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
543
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
544 PURPOSE : configure a driver
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
545
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
546 */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
547 int vsi_d_setconfig ( T_HANDLE Caller, T_HANDLE DrvHandle, char *Config )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
548 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
549 T_HANDLE Handle;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
550
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
551 if ( Config && DrvHandle != 0)
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
552 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
553 if ( DrvTable[DrvHandle].DrvInfo->DrvFunc.drv_SetConfig != NULL )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
554 if ( (DrvTable[DrvHandle].DrvInfo->DrvFunc.drv_SetConfig)( Config ) != DRV_OK )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
555 return VSI_ERROR;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
556 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
557 else
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
558 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
559 T_HANDLE min, max;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
560
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
561 if ( DrvHandle )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
562 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
563 min = DrvHandle;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
564 max = DrvHandle+1;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
565 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
566 else
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
567 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
568 min = 1;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
569 max = MAX_TST_DRV;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
570 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
571
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
572 for ( Handle = min; Handle < max; Handle++ )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
573 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
574 if ( DriverList->DrvEntry[Handle].DrvConfig )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
575 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
576 if ( DrvTable[Handle].DrvInfo->DrvFunc.drv_SetConfig != NULL )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
577 if ( (DrvTable[Handle].DrvInfo->DrvFunc.drv_SetConfig)( (char*)DriverList->DrvEntry[Handle].DrvConfig ) != DRV_OK )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
578 return VSI_ERROR;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
579 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
580 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
581 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
582 return VSI_OK;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
583 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
584 #endif
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
585
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
586 #ifndef RUN_INT_RAM
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
587 /*
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
588 +--------------------------------------------------------------------+
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
589 | PROJECT : GSM-Frame (8415) MODULE : VSI_DRV |
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
590 | STATE : code ROUTINE : vsi_d_getconfig |
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
591 +--------------------------------------------------------------------+
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
592
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
593 PURPOSE : read configuration data from a driver
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
594
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
595 */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
596
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
597 int vsi_d_getconfig ( T_HANDLE Caller, T_HANDLE DrvHandle, char *Config )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
598 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
599 T_HANDLE Handle;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
600 char Buffer[40];
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
601 char *ptr = Config;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
602
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
603 Handle = DrvHandle;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
604 while ( Handle )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
605 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
606 if ( DrvTable[Handle].DrvInfo )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
607 if ( DrvTable[Handle].DrvInfo->DrvFunc.drv_GetConfig != NULL )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
608 if ( (DrvTable[Handle].DrvInfo->DrvFunc.drv_GetConfig)( Buffer ) != DRV_OK )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
609 return VSI_ERROR;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
610
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
611 sprintf ( ptr, "%s:%s;",DrvTable[Handle].DrvInfo->Name,Buffer );
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
612 ptr = ptr + strlen(DrvTable[Handle].DrvInfo->Name) + strlen(Buffer) + 2;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
613 Handle = DrvTable[Handle].LowerDrv;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
614 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
615 return VSI_OK;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
616 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
617 #endif
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
618
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
619 #ifndef RUN_INT_RAM
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
620 /*
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
621 +--------------------------------------------------------------------+
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
622 | PROJECT : GSM-Frame (8415) MODULE : VSI_DRV |
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
623 | STATE : code ROUTINE : InitializeDriverTable |
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
624 +--------------------------------------------------------------------+
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
625
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
626 PURPOSE : Initialize the driver table
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
627
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
628 */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
629 void InitializeDriverConfig ( void )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
630 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
631 #ifdef _TOOLS_
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
632 USHORT j;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
633
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
634 for ( j = 1; j < MAX_TST_DRV ; j++ )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
635 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
636 if ( DriverConfigList->DrvEntry[j].Name )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
637 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
638 strcpy ( _DrvList.DrvEntry[j].Name, DriverConfigList->DrvEntry[j].Name );
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
639 DrvList.DrvEntry[j].Name = _DrvList.DrvEntry[j].Name;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
640 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
641
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
642 if ( DriverConfigList->DrvEntry[j].drv_Init )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
643 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
644 DrvList.DrvEntry[j].drv_Init = DriverConfigList->DrvEntry[j].drv_Init;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
645 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
646
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
647 if ( DriverConfigList->DrvEntry[j].Process )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
648 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
649 strcpy ( _DrvList.DrvEntry[j].Process, DriverConfigList->DrvEntry[j].Process );
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
650 DrvList.DrvEntry[j].Process = _DrvList.DrvEntry[j].Process;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
651 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
652
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
653 if ( DriverConfigList->DrvEntry[j].DrvConfig )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
654 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
655 strcpy ( _DrvList.DrvEntry[j].DrvConfig, DriverConfigList->DrvEntry[j].DrvConfig );
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
656 DrvList.DrvEntry[j].DrvConfig = _DrvList.DrvEntry[j].DrvConfig;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
657 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
658 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
659
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
660 DriverList = &DrvList;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
661 #else
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
662 DriverList = DriverConfigList;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
663 #endif /* _TOOLS_ */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
664 ClearDriverTable();
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
665 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
666 #endif
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
667
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
668 #ifndef RUN_INT_RAM
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
669 /*
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
670 +--------------------------------------------------------------------+
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
671 | PROJECT : GSM-Frame (8415) MODULE : VSI_DRV |
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
672 | STATE : code ROUTINE : ClearDriverTable |
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
673 +--------------------------------------------------------------------+
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
674
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
675 PURPOSE : Clear the driver table
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
676
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
677 */
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
678 void ClearDriverTable ( void )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
679 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
680 char i;
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
681
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
682 for ( i = 1; i <= MAX_TST_DRV; i++ )
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
683 {
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
684 memset ( &DrvTable[i], 0, sizeof(T_DRV_TABLE_ENTRY) );
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
685 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
686
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
687 }
79080922d8e4 GPF: FRAME C sources and include files imported from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
688 #endif