FreeCalypso > hg > freecalypso-sw
comparison gsm-fw/g23m-gsm/dl/dl_signal.c @ 673:2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
| author | Michael Spacefalcon <msokolov@ivan.Harhan.ORG> | 
|---|---|
| date | Sun, 28 Sep 2014 23:20:04 +0000 | 
| parents | |
| children | 857ded4ed2a1 | 
   comparison
  equal
  deleted
  inserted
  replaced
| 672:0dc6f9e8e980 | 673:2f7df7a314f8 | 
|---|---|
| 1 /* | |
| 2 +----------------------------------------------------------------------------- | |
| 3 | Project : GSM-PS | |
| 4 | Modul : dl_signal | |
| 5 +----------------------------------------------------------------------------- | |
| 6 | Copyright 2002 Texas Instruments Berlin, AG | |
| 7 | All rights reserved. | |
| 8 | | |
| 9 | This file is confidential and a trade secret of Texas | |
| 10 | Instruments Berlin, AG | |
| 11 | The receipt of or possession of this file does not convey | |
| 12 | any rights to reproduce or disclose its contents or to | |
| 13 | manufacture, use, or sell anything it may describe, in | |
| 14 | whole, or in part, without the specific written consent of | |
| 15 | Texas Instruments Berlin, AG. | |
| 16 +----------------------------------------------------------------------------- | |
| 17 | Purpose : This Modul defines all functions which invoke signals or are | |
| 18 | called by signal. | |
| 19 +----------------------------------------------------------------------------- | |
| 20 */ | |
| 21 | |
| 22 #ifndef DL_SIGNAL_C | |
| 23 #define DL_SIGNAL_C | |
| 24 | |
| 25 #define ENTITY_DL | |
| 26 | |
| 27 /*==== INCLUDES ===================================================*/ | |
| 28 | |
| 29 #include "typedefs.h" | |
| 30 #include <string.h> | |
| 31 #include "pconst.cdg" | |
| 32 #include "vsi.h" | |
| 33 #include "custom.h" | |
| 34 #include "gsm.h" | |
| 35 #include "mon_dl.h" | |
| 36 #include "prim.h" | |
| 37 #include "pei.h" | |
| 38 #include "tok.h" | |
| 39 #include "ccdapi.h" | |
| 40 #include "dl.h" | |
| 41 #include "dl_trc.h" | |
| 42 | |
| 43 #if defined(INVOKE_SIGNAL) | |
| 44 /*==== EXPORT =====================================================*/ | |
| 45 | |
| 46 /*==== PRIVAT =====================================================*/ | |
| 47 | |
| 48 /*==== VARIABLES ==================================================*/ | |
| 49 | |
| 50 /*==== FUNCTIONS ==================================================*/ | |
| 51 /* | |
| 52 +------------------------------------------------------------------------------ | |
| 53 | Function : sig_get_signal_data | |
| 54 +------------------------------------------------------------------------------ | |
| 55 | Description : Get the signal data back depend on parameter write | |
| 56 +------------------------------------------------------------------------------ | |
| 57 */ | |
| 58 GLOBAL void sig_init_signal_data (void) | |
| 59 { | |
| 60 GET_INSTANCE_DATA; | |
| 61 memset (&dl_data->signal_struct, 0, sizeof (T_DL_SIGNAL)); | |
| 62 } | |
| 63 | |
| 64 /* | |
| 65 +------------------------------------------------------------------------------ | |
| 66 | Function : sig_get_signal_data | |
| 67 +------------------------------------------------------------------------------ | |
| 68 | Description : Get the signal data back depend on parameter write | |
| 69 +------------------------------------------------------------------------------ | |
| 70 */ | |
| 71 LOCAL T_DL_SIGNAL_DATA * sig_get_signal_data (void) | |
| 72 { | |
| 73 GET_INSTANCE_DATA; | |
| 74 T_DL_SIGNAL *sig = &dl_data->signal_struct; | |
| 75 T_DL_SIGNAL_DATA *sd = &sig->sig_data[sig->sig_idx]; | |
| 76 | |
| 77 /*TRACE_EVENT_WIN_P2 ("sig_get_signal_data(): idx=%u %s", sig->sig_idx, sd->busy ? "BUSY": "use it");*/ | |
| 78 | |
| 79 /* first approach without semaphore */ | |
| 80 if (sd->busy EQ FALSE) | |
| 81 { | |
| 82 sd->busy = TRUE; | |
| 83 #if defined(_SIMULATION_) | |
| 84 sd->idx = sig->sig_idx; | |
| 85 #endif /* _SIMULATION_ */ | |
| 86 if (++sig->sig_idx EQ DL_SIGNAL_DATA_ELEMENTS) | |
| 87 sig->sig_idx = 0;/* index of ring buffer */ | |
| 88 } | |
| 89 else | |
| 90 { | |
| 91 TRACE_ERROR ("dl_signal_data BUSY !!!"); | |
| 92 TRACE_ASSERT (!sd->busy); | |
| 93 } | |
| 94 return sd; | |
| 95 } | |
| 96 | |
| 97 #if 0 /* only for debug purposes */ | |
| 98 GLOBAL int sig_get_busy_signals_counter (T_DL_DATA_STORE * dl_data) | |
| 99 { | |
| 100 T_DL_SIGNAL *sig = &dl_data->signal_struct; | |
| 101 T_DL_SIGNAL_DATA *sd = &sig->sig_data[0]; | |
| 102 int n, busy; | |
| 103 | |
| 104 for (n=busy=0; n < DL_SIGNAL_DATA_ELEMENTS; n++, sd++) | |
| 105 { | |
| 106 if (sd->busy EQ TRUE) | |
| 107 busy++; | |
| 108 } | |
| 109 return busy; | |
| 110 } | |
| 111 #endif /* 0|1 */ | |
| 112 | |
| 113 /* | |
| 114 +------------------------------------------------------------------------------ | |
| 115 | Function : sig_invoke_drr_dl_establish_ind | |
| 116 +------------------------------------------------------------------------------ | |
| 117 | Description : Invokes the signal DL_SIGNAL_ESTABLISH_IND | |
| 118 +------------------------------------------------------------------------------ | |
| 119 */ | |
| 120 GLOBAL void sig_invoke_drr_dl_establish_ind (UBYTE ch_type, | |
| 121 UBYTE sapi, UBYTE indication) | |
| 122 { | |
| 123 T_DL_SIGNAL_DATA * signal = sig_get_signal_data (); | |
| 124 TRACE_EVENT_WIN ("sig_invoke_drr_dl_establish_ind()"); | |
| 125 signal->u.establish_ind.ch_type = ch_type; | |
| 126 signal->u.establish_ind.sapi = sapi; | |
| 127 signal->u.establish_ind.indication = indication; | |
| 128 #ifdef TI_PS_HCOMM_CHANGE | |
| 129 PSIGNAL(_hCommDL, DL_SIGNAL_ESTABLISH_IND, signal); | |
| 130 #else | |
| 131 PSIGNAL(hCommDL, DL_SIGNAL_ESTABLISH_IND, signal); | |
| 132 #endif | |
| 133 } | |
| 134 | |
| 135 /* | |
| 136 +------------------------------------------------------------------------------ | |
| 137 | Function : sig_handle_drr_dl_establish_ind | |
| 138 +------------------------------------------------------------------------------ | |
| 139 | Description : Handles the signal DL_SIGNAL_ESTABLISH_IND | |
| 140 +------------------------------------------------------------------------------ | |
| 141 */ | |
| 142 GLOBAL void sig_handle_drr_dl_establish_ind (T_DL_SIGNAL_DATA * signal) | |
| 143 { | |
| 144 TRACE_EVENT_WIN ("sig_handle_drr_dl_establish_ind()"); | |
| 145 drr_dl_establish_ind (signal->u.establish_ind.ch_type, | |
| 146 signal->u.establish_ind.sapi, signal->u.establish_ind.indication); | |
| 147 } | |
| 148 | |
| 149 /* | |
| 150 +------------------------------------------------------------------------------ | |
| 151 | Function : sig_invoke_drr_dl_establish_cnf | |
| 152 +------------------------------------------------------------------------------ | |
| 153 | Description : Invokes the signal DL_SIGNAL_ESTABLISH_CNF | |
| 154 +------------------------------------------------------------------------------ | |
| 155 */ | |
| 156 GLOBAL void sig_invoke_drr_dl_establish_cnf (UBYTE ch_type, UBYTE sapi) | |
| 157 { | |
| 158 T_DL_SIGNAL_DATA * signal = sig_get_signal_data (); | |
| 159 TRACE_EVENT_WIN ("sig_invoke_drr_dl_establish_cnf()"); | |
| 160 signal->u.establish_cnf.ch_type = ch_type; | |
| 161 signal->u.establish_cnf.sapi = sapi; | |
| 162 #ifdef TI_PS_HCOMM_CHANGE | |
| 163 PSIGNAL(_hCommDL, DL_SIGNAL_ESTABLISH_CNF, signal); | |
| 164 #else | |
| 165 PSIGNAL(hCommDL, DL_SIGNAL_ESTABLISH_CNF, signal); | |
| 166 #endif | |
| 167 } | |
| 168 | |
| 169 /* | |
| 170 +------------------------------------------------------------------------------ | |
| 171 | Function : sig_handle_drr_dl_establish_cnf | |
| 172 +------------------------------------------------------------------------------ | |
| 173 | Description : Handles the signal DL_SIGNAL_ESTABLISH_CNF | |
| 174 +------------------------------------------------------------------------------ | |
| 175 */ | |
| 176 GLOBAL void sig_handle_drr_dl_establish_cnf (T_DL_SIGNAL_DATA * signal) | |
| 177 { | |
| 178 TRACE_EVENT_WIN ("sig_handle_drr_dl_establish_cnf()"); | |
| 179 drr_dl_establish_cnf (signal->u.establish_cnf.ch_type, | |
| 180 signal->u.establish_cnf.sapi); | |
| 181 } | |
| 182 | |
| 183 /* | |
| 184 +------------------------------------------------------------------------------ | |
| 185 | Function : sig_invoke_drr_dl_data_cnf | |
| 186 +------------------------------------------------------------------------------ | |
| 187 | Description : Invokes the signal DL_SIGNAL_DATA_CNF | |
| 188 +------------------------------------------------------------------------------ | |
| 189 */ | |
| 190 GLOBAL void sig_invoke_drr_dl_data_cnf (UBYTE sapi) | |
| 191 { | |
| 192 T_DL_SIGNAL_DATA * signal = sig_get_signal_data (); | |
| 193 TRACE_EVENT_WIN ("sig_invoke_drr_dl_data_cnf()"); | |
| 194 signal->u.data_cnf.sapi = sapi; | |
| 195 #ifdef TI_PS_HCOMM_CHANGE | |
| 196 PSIGNAL(_hCommDL, DL_SIGNAL_DATA_CNF, signal); | |
| 197 #else | |
| 198 PSIGNAL(hCommDL, DL_SIGNAL_DATA_CNF, signal); | |
| 199 #endif | |
| 200 } | |
| 201 | |
| 202 /* | |
| 203 +------------------------------------------------------------------------------ | |
| 204 | Function : sig_handle_drr_dl_data_cnf | |
| 205 +------------------------------------------------------------------------------ | |
| 206 | Description : Handles the signal DL_SIGNAL_DATA_CNF | |
| 207 +------------------------------------------------------------------------------ | |
| 208 */ | |
| 209 GLOBAL void sig_handle_drr_dl_data_cnf (T_DL_SIGNAL_DATA * signal) | |
| 210 { | |
| 211 TRACE_EVENT_WIN ("sig_handle_drr_dl_data_cnf()"); | |
| 212 drr_dl_data_cnf (signal->u.data_cnf.sapi); | |
| 213 } | |
| 214 | |
| 215 #if 0 /* happens in primitive context only */ | |
| 216 /* | |
| 217 +------------------------------------------------------------------------------ | |
| 218 | Function : sig_invoke_drr_dl_unitdata_ind | |
| 219 +------------------------------------------------------------------------------ | |
| 220 | Description : Invokes the signal DL_SIGNAL_UNITDATA_IND | |
| 221 +------------------------------------------------------------------------------ | |
| 222 */ | |
| 223 GLOBAL void sig_invoke_drr_dl_unitdata_ind (UBYTE error_flag, UBYTE * layer1head, | |
| 224 UBYTE * layer3msg,UBYTE length, | |
| 225 ULONG fn) | |
| 226 { | |
| 227 GET_INSTANCE_DATA; | |
| 228 T_DL_SIGNAL_DATA * signal = sig_get_signal_data (); | |
| 229 TRACE_EVENT_WIN ("sig_invoke_drr_dl_unitdata_ind()"); | |
| 230 signal->u.unitdata_ind.error_flag = error_flag; | |
| 231 #ifdef TI_PS_16BIT_CPY | |
| 232 api_memcpy(signal->u.unitdata_ind.layer1head, layer1head, | |
| 233 sizeof(signal->u.unitdata_ind.layer1head)); | |
| 234 api_memcpy(signal->u.unitdata_ind.layer3msg, layer3msg, length); | |
| 235 #else | |
| 236 memcpy(signal->u.unitdata_ind.layer1head, layer1head, | |
| 237 sizeof(signal->u.unitdata_ind.layer1head)); | |
| 238 memcpy(signal->u.unitdata_ind.layer3msg, layer3msg, length); | |
| 239 #endif | |
| 240 signal->u.unitdata_ind.length = length; | |
| 241 signal->u.unitdata_ind.fn = fn; | |
| 242 PSIGNAL(hCommDL, DL_SIGNAL_UNITDATA_IND, signal); | |
| 243 } | |
| 244 | |
| 245 /* | |
| 246 +------------------------------------------------------------------------------ | |
| 247 | Function : sig_handle_drr_dl_unitdata_ind | |
| 248 +------------------------------------------------------------------------------ | |
| 249 | Description : Handles the signal DL_SIGNAL_UNITDATA_IND | |
| 250 +------------------------------------------------------------------------------ | |
| 251 */ | |
| 252 GLOBAL void sig_handle_drr_dl_unitdata_ind (T_DL_DATA_STORE *dl_data, | |
| 253 T_DL_SIGNAL_DATA * signal) | |
| 254 { | |
| 255 TRACE_EVENT_WIN ("sig_handle_drr_dl_unitdata_ind()"); | |
| 256 drr_dl_unitdata_ind (dl_data, | |
| 257 signal->u.unitdata_ind.error_flag, | |
| 258 signal->u.unitdata_ind.layer1head, | |
| 259 signal->u.unitdata_ind.layer3msg, | |
| 260 signal->u.unitdata_ind.length, | |
| 261 signal->u.unitdata_ind.fn); | |
| 262 } | |
| 263 #endif /* 0 */ | |
| 264 | |
| 265 /* | |
| 266 +------------------------------------------------------------------------------ | |
| 267 | Function : sig_invoke_drr_dl_short_unitdata_ind | |
| 268 +------------------------------------------------------------------------------ | |
| 269 | Description : Invokes the signal DL_SIGNAL_SHORT_UNITDATA_IND | |
| 270 +------------------------------------------------------------------------------ | |
| 271 */ | |
| 272 GLOBAL void sig_invoke_drr_dl_short_unitdata_ind (UBYTE ch_type, | |
| 273 UBYTE error_flag, UBYTE * layer1head, | |
| 274 UBYTE * layer3msg, UBYTE length, ULONG fn) | |
| 275 { | |
| 276 T_DL_SIGNAL_DATA * signal = sig_get_signal_data (); | |
| 277 TRACE_EVENT_WIN ("sig_invoke_drr_dl_short_unitdata_ind()"); | |
| 278 signal->u.short_unitdata_ind.ch_type = ch_type; | |
| 279 signal->u.short_unitdata_ind.error_flag = error_flag; | |
| 280 #ifdef TI_PS_16BIT_CPY | |
| 281 api_memcpy(signal->u.short_unitdata_ind.layer1head, layer1head, | |
| 282 sizeof(signal->u.short_unitdata_ind.layer1head)); | |
| 283 api_memcpy(signal->u.short_unitdata_ind.layer3msg, layer3msg, length); | |
| 284 #else | |
| 285 memcpy(signal->u.short_unitdata_ind.layer1head, layer1head, | |
| 286 sizeof(signal->u.short_unitdata_ind.layer1head)); | |
| 287 memcpy(signal->u.short_unitdata_ind.layer3msg, layer3msg, length); | |
| 288 #endif | |
| 289 signal->u.short_unitdata_ind.length = length; | |
| 290 signal->u.short_unitdata_ind.fn = fn; | |
| 291 #ifdef TI_PS_HCOMM_CHANGE | |
| 292 PSIGNAL(_hCommDL, DL_SIGNAL_SHORT_UNITDATA_IND, signal); | |
| 293 #else | |
| 294 PSIGNAL(hCommDL, DL_SIGNAL_SHORT_UNITDATA_IND, signal); | |
| 295 #endif | |
| 296 } | |
| 297 | |
| 298 /* | |
| 299 +------------------------------------------------------------------------------ | |
| 300 | Function : sig_handle_drr_dl_short_unitdata_ind | |
| 301 +------------------------------------------------------------------------------ | |
| 302 | Description : Handles the signal DL_SIGNAL_SHORT_UNITDATA_IND | |
| 303 +------------------------------------------------------------------------------ | |
| 304 */ | |
| 305 GLOBAL void sig_handle_drr_dl_short_unitdata_ind ( | |
| 306 T_DL_SIGNAL_DATA * signal) | |
| 307 { | |
| 308 TRACE_EVENT_WIN ("sig_handle_drr_dl_short_unitdata_ind()"); | |
| 309 drr_dl_short_unitdata_ind ( | |
| 310 signal->u.short_unitdata_ind.ch_type, | |
| 311 signal->u.short_unitdata_ind.error_flag, | |
| 312 signal->u.short_unitdata_ind.layer1head, | |
| 313 signal->u.short_unitdata_ind.layer3msg, | |
| 314 signal->u.short_unitdata_ind.length, | |
| 315 signal->u.short_unitdata_ind.fn); | |
| 316 } | |
| 317 | |
| 318 /* | |
| 319 +------------------------------------------------------------------------------ | |
| 320 | Function : sig_invoke_drr_dl_release_ind | |
| 321 +------------------------------------------------------------------------------ | |
| 322 | Description : Invokes the signal DL_SIGNAL_RELEASE_IND | |
| 323 +------------------------------------------------------------------------------ | |
| 324 */ | |
| 325 GLOBAL void sig_invoke_drr_dl_release_ind (UBYTE ch_type, UBYTE sapi, | |
| 326 UBYTE cs, BOOL init) | |
| 327 { | |
| 328 T_DL_SIGNAL_DATA * signal = sig_get_signal_data (); | |
| 329 TRACE_EVENT_WIN ("sig_invoke_drr_dl_release_ind()"); | |
| 330 signal->u.release_ind.ch_type = ch_type; | |
| 331 signal->u.release_ind.sapi = sapi; | |
| 332 signal->u.release_ind.cs = cs; | |
| 333 signal->u.release_ind.init = init; | |
| 334 #ifdef TI_PS_HCOMM_CHANGE | |
| 335 PSIGNAL(_hCommDL, DL_SIGNAL_RELEASE_IND, signal); | |
| 336 #else | |
| 337 PSIGNAL(hCommDL, DL_SIGNAL_RELEASE_IND, signal); | |
| 338 #endif | |
| 339 } | |
| 340 | |
| 341 /* | |
| 342 +------------------------------------------------------------------------------ | |
| 343 | Function : sig_handle_drr_dl_release_ind | |
| 344 +------------------------------------------------------------------------------ | |
| 345 | Description : Handles the signal DL_SIGNAL_RELEASE_IND | |
| 346 +------------------------------------------------------------------------------ | |
| 347 */ | |
| 348 GLOBAL void sig_handle_drr_dl_release_ind (T_DL_SIGNAL_DATA * signal) | |
| 349 { | |
| 350 TRACE_EVENT_WIN ("sig_handle_drr_dl_release_ind()"); | |
| 351 drr_dl_release_ind (signal->u.release_ind.ch_type, | |
| 352 signal->u.release_ind.sapi, signal->u.release_ind.cs, | |
| 353 signal->u.release_ind.init); | |
| 354 | |
| 355 } | |
| 356 | |
| 357 /* | |
| 358 +------------------------------------------------------------------------------ | |
| 359 | Function : sig_invoke_drr_dl_release_cnf | |
| 360 +------------------------------------------------------------------------------ | |
| 361 | Description : Invokes the signal DL_SIGNAL_RELEASE_CNF | |
| 362 +------------------------------------------------------------------------------ | |
| 363 */ | |
| 364 GLOBAL void sig_invoke_drr_dl_release_cnf (UBYTE ch_type, | |
| 365 UBYTE sapi, BOOL init) | |
| 366 { | |
| 367 T_DL_SIGNAL_DATA * signal = sig_get_signal_data (); | |
| 368 TRACE_EVENT_WIN ("sig_invoke_drr_dl_release_cnf()"); | |
| 369 signal->u.release_cnf.ch_type = ch_type; | |
| 370 signal->u.release_cnf.sapi = sapi; | |
| 371 signal->u.release_cnf.init = init; | |
| 372 #ifdef TI_PS_HCOMM_CHANGE | |
| 373 PSIGNAL(_hCommDL, DL_SIGNAL_RELEASE_CNF, signal); | |
| 374 #else | |
| 375 PSIGNAL(hCommDL, DL_SIGNAL_RELEASE_CNF, signal); | |
| 376 #endif | |
| 377 } | |
| 378 | |
| 379 /* | |
| 380 +------------------------------------------------------------------------------ | |
| 381 | Function : sig_handle_drr_dl_release_cnf | |
| 382 +------------------------------------------------------------------------------ | |
| 383 | Description : Handles the signal DL_SIGNAL_RELEASE_CNF | |
| 384 +------------------------------------------------------------------------------ | |
| 385 */ | |
| 386 GLOBAL void sig_handle_drr_dl_release_cnf ( T_DL_SIGNAL_DATA * signal) | |
| 387 { | |
| 388 TRACE_EVENT_WIN ("sig_handle_drr_dl_release_cnf()"); | |
| 389 drr_dl_release_cnf (signal->u.release_cnf.ch_type, | |
| 390 signal->u.release_cnf.sapi, signal->u.release_cnf.init); | |
| 391 } | |
| 392 | |
| 393 /* | |
| 394 +------------------------------------------------------------------------------ | |
| 395 | Function : sig_invoke_drr_error_ind | |
| 396 +------------------------------------------------------------------------------ | |
| 397 | Description : Invokes the signal DL_SIGNAL_ERROR_IND | |
| 398 +------------------------------------------------------------------------------ | |
| 399 */ | |
| 400 GLOBAL void sig_invoke_drr_error_ind (UBYTE ch_type, UBYTE sapi) | |
| 401 { | |
| 402 T_DL_SIGNAL_DATA * signal = sig_get_signal_data (); | |
| 403 TRACE_EVENT_WIN ("sig_invoke_drr_error_ind()"); | |
| 404 signal->u.error_ind.ch_type = ch_type; | |
| 405 signal->u.error_ind.sapi = sapi; | |
| 406 #ifdef TI_PS_HCOMM_CHANGE | |
| 407 PSIGNAL(_hCommDL, DL_SIGNAL_ERROR_IND, signal); | |
| 408 #else | |
| 409 PSIGNAL(hCommDL, DL_SIGNAL_ERROR_IND, signal); | |
| 410 #endif | |
| 411 } | |
| 412 | |
| 413 /* | |
| 414 +------------------------------------------------------------------------------ | |
| 415 | Function : sig_handle_drr_error_ind | |
| 416 +------------------------------------------------------------------------------ | |
| 417 | Description : Handles the signal DL_SIGNAL_ERROR_IND | |
| 418 +------------------------------------------------------------------------------ | |
| 419 */ | |
| 420 GLOBAL void sig_handle_drr_error_ind (T_DL_SIGNAL_DATA * signal) | |
| 421 { | |
| 422 TRACE_EVENT_WIN ("sig_handle_drr_error_ind()"); | |
| 423 drr_error_ind (signal->u.error_ind.ch_type, | |
| 424 signal->u.error_ind.sapi); | |
| 425 } | |
| 426 | |
| 427 #if defined(FF_EM_MODE) | |
| 428 /* | |
| 429 +------------------------------------------------------------------------------ | |
| 430 | Function : sig_invoke_dl_em_write | |
| 431 +------------------------------------------------------------------------------ | |
| 432 | Description : Invokes the signal DL_SIGNAL_EM_WRITE | |
| 433 +------------------------------------------------------------------------------ | |
| 434 */ | |
| 435 GLOBAL void sig_invoke_dl_em_write (UBYTE length, UBYTE * data) | |
| 436 { | |
| 437 T_DL_SIGNAL_DATA * signal = sig_get_signal_data (); | |
| 438 TRACE_EVENT_WIN ("sig_invoke_dl_em_write()"); | |
| 439 signal->u.em_write.length = length; | |
| 440 #ifdef TI_PS_16BIT_CPY | |
| 441 api_memcpy(signal->u.em_write.data, data, length); | |
| 442 #else | |
| 443 memcpy(signal->u.em_write.data, data, length); | |
| 444 #endif | |
| 445 PSIGNAL(hCommDL, DL_SIGNAL_EM_WRITE, signal); | |
| 446 } | |
| 447 | |
| 448 /* | |
| 449 +------------------------------------------------------------------------------ | |
| 450 | Function : sig_handle_dl_em_write | |
| 451 +------------------------------------------------------------------------------ | |
| 452 | Description : Handles the signal DL_SIGNAL_EM_WRITE | |
| 453 +------------------------------------------------------------------------------ | |
| 454 */ | |
| 455 GLOBAL void sig_handle_dl_em_write (T_DL_DATA_STORE *dl_data, | |
| 456 T_DL_SIGNAL_DATA * signal) | |
| 457 { | |
| 458 TRACE_EVENT_WIN ("sig_handle_dl_em_write()"); | |
| 459 em_dl_write (signal->u.em_write.length, signal->u.em_write.data); | |
| 460 } | |
| 461 | |
| 462 /* | |
| 463 +------------------------------------------------------------------------------ | |
| 464 | Function : sig_invoke_dl_em_first_event_check | |
| 465 +------------------------------------------------------------------------------ | |
| 466 | Description : Invokes the signal DL_SIGNAL_EM_IND | |
| 467 +------------------------------------------------------------------------------ | |
| 468 */ | |
| 469 GLOBAL void sig_invoke_dl_em_first_event_check (void) | |
| 470 { | |
| 471 TRACE_EVENT_WIN ("sig_invoke_dl_em_first_event_check()"); | |
| 472 PSIGNAL(hCommDL, DL_SIGNAL_EM_IND, NULL); | |
| 473 } | |
| 474 | |
| 475 /* | |
| 476 +------------------------------------------------------------------------------ | |
| 477 | Function : sig_handle_dl_em_first_event_check | |
| 478 +------------------------------------------------------------------------------ | |
| 479 | Description : Handles the signal DL_SIGNAL_EM_IND | |
| 480 +------------------------------------------------------------------------------ | |
| 481 */ | |
| 482 GLOBAL void sig_handle_dl_em_first_event_check () | |
| 483 { | |
| 484 TRACE_EVENT_WIN ("sig_handle_dl_em_first_event_check()"); | |
| 485 dl_em_first_event_check(); | |
| 486 } | |
| 487 #endif /* FF_EM_MODE */ | |
| 488 | |
| 489 /* | |
| 490 +------------------------------------------------------------------------------ | |
| 491 | Function : sig_invoke_com_concatenate | |
| 492 +------------------------------------------------------------------------------ | |
| 493 | Description : Invokes the signal DL_SIGNAL_DATA_IND | |
| 494 +------------------------------------------------------------------------------ | |
| 495 */ | |
| 496 GLOBAL void sig_invoke_com_concatenate ( T_DL_DATA_IND ** in_msg, | |
| 497 UBYTE * new_data_in) | |
| 498 { | |
| 499 T_DL_SIGNAL_DATA * signal = sig_get_signal_data (); | |
| 500 TRACE_EVENT_WIN ("sig_invoke_com_concatenate()"); | |
| 501 signal->u.concatenate.in_msg = in_msg; | |
| 502 #ifdef TI_PS_16BIT_CPY | |
| 503 api_memcpy (signal->u.concatenate.new_data_in, new_data_in, MAX_L2_FRAME_SIZE); | |
| 504 #else | |
| 505 memcpy (signal->u.concatenate.new_data_in, new_data_in, MAX_L2_FRAME_SIZE); | |
| 506 #endif | |
| 507 #ifdef TI_PS_HCOMM_CHANGE | |
| 508 PSIGNAL(_hCommDL, DL_SIGNAL_CONCATENATE, signal); | |
| 509 #else | |
| 510 PSIGNAL(hCommDL, DL_SIGNAL_CONCATENATE, signal); | |
| 511 #endif | |
| 512 } | |
| 513 | |
| 514 /* | |
| 515 +------------------------------------------------------------------------------ | |
| 516 | Function : sig_handle_com_concatenate | |
| 517 +------------------------------------------------------------------------------ | |
| 518 | Description : Handles the signal DL_SIGNAL_CONCATENATE | |
| 519 +------------------------------------------------------------------------------ | |
| 520 */ | |
| 521 GLOBAL void sig_handle_com_concatenate (T_DL_SIGNAL_DATA * signal) | |
| 522 { | |
| 523 TRACE_EVENT_WIN ("sig_handle_com_concatenate()"); | |
| 524 com_concatenate (signal->u.concatenate.in_msg, | |
| 525 signal->u.concatenate.new_data_in); | |
| 526 } | |
| 527 | |
| 528 /* | |
| 529 +------------------------------------------------------------------------------ | |
| 530 | Function : sig_invoke_com_free_pointer | |
| 531 +------------------------------------------------------------------------------ | |
| 532 | Description : Invokes the signal DL_SIGNAL_FREE_POINTER | |
| 533 +------------------------------------------------------------------------------ | |
| 534 */ | |
| 535 GLOBAL void sig_invoke_com_free_pointer (void *pointer) | |
| 536 { | |
| 537 T_DL_SIGNAL_DATA * signal = sig_get_signal_data (); | |
| 538 TRACE_EVENT_WIN ("sig_invoke_com_free_pointer()"); | |
| 539 signal->u.free_pointer.pointer = pointer; | |
| 540 #ifdef TI_PS_HCOMM_CHANGE | |
| 541 PSIGNAL(_hCommDL, DL_SIGNAL_FREE_POINTER, signal); | |
| 542 #else | |
| 543 PSIGNAL(hCommDL, DL_SIGNAL_FREE_POINTER, signal); | |
| 544 #endif | |
| 545 } | |
| 546 | |
| 547 /* | |
| 548 +------------------------------------------------------------------------------ | |
| 549 | Function : sig_handle_drr_error_ind | |
| 550 +------------------------------------------------------------------------------ | |
| 551 | Description : Handles the signal DL_SIGNAL_ERROR_IND | |
| 552 +------------------------------------------------------------------------------ | |
| 553 */ | |
| 554 GLOBAL void sig_handle_com_free_pointer(T_DL_SIGNAL_DATA * signal) | |
| 555 { | |
| 556 TRACE_EVENT_WIN ("sig_handle_com_free_pointer()"); | |
| 557 COM_FREE_POINTER (signal->u.free_pointer.pointer); | |
| 558 signal->u.free_pointer.pointer = NULL; | |
| 559 } | |
| 560 | |
| 561 /* | |
| 562 +------------------------------------------------------------------------------ | |
| 563 | Function : sig_invoke_com_data_ind | |
| 564 +------------------------------------------------------------------------------ | |
| 565 | Description : Invokes the signal DL_SIGNAL_CONCATENATE | |
| 566 +------------------------------------------------------------------------------ | |
| 567 */ | |
| 568 GLOBAL void sig_invoke_com_data_ind (UBYTE ch_type, | |
| 569 UBYTE sapi, ULONG fn) | |
| 570 { | |
| 571 T_DL_SIGNAL_DATA * signal = sig_get_signal_data (); | |
| 572 TRACE_EVENT_WIN ("sig_invoke_com_data_ind()"); | |
| 573 signal->u.data_ind.ch_type = ch_type; | |
| 574 signal->u.data_ind.sapi = sapi; | |
| 575 signal->u.data_ind.fn = fn; | |
| 576 #ifdef TI_PS_HCOMM_CHANGE | |
| 577 PSIGNAL(_hCommDL, DL_SIGNAL_DATA_IND, signal); | |
| 578 #else | |
| 579 PSIGNAL(hCommDL, DL_SIGNAL_DATA_IND, signal); | |
| 580 #endif | |
| 581 } | |
| 582 | |
| 583 /* | |
| 584 +------------------------------------------------------------------------------ | |
| 585 | Function : sig_handle_com_data_ind | |
| 586 +------------------------------------------------------------------------------ | |
| 587 | Description : Handles the signal DL_SIGNAL_DATA_IND | |
| 588 +------------------------------------------------------------------------------ | |
| 589 */ | |
| 590 GLOBAL void sig_handle_com_data_ind (T_DL_SIGNAL_DATA * signal) | |
| 591 { | |
| 592 TRACE_EVENT_WIN ("sig_handle_com_data_ind()"); | |
| 593 com_data_ind(signal->u.data_ind.ch_type, signal->u.data_ind.sapi, | |
| 594 signal->u.data_ind.fn); | |
| 595 } | |
| 596 | |
| 597 /* | |
| 598 +------------------------------------------------------------------------------ | |
| 599 | Function : sig_invoke_com_l3trace | |
| 600 +------------------------------------------------------------------------------ | |
| 601 | Description : Invokes the signal DL_SIGNAL_L3TRACE | |
| 602 +------------------------------------------------------------------------------ | |
| 603 */ | |
| 604 GLOBAL void sig_invoke_com_l3trace (UBYTE type, UBYTE ch_type, UBYTE *frame) | |
| 605 { | |
| 606 T_DL_SIGNAL_DATA * signal = sig_get_signal_data (); | |
| 607 TRACE_EVENT_WIN ("sig_invoke_com_l3_trace()"); | |
| 608 signal->u.l3trace.type = type; | |
| 609 signal->u.l3trace.ch_type = ch_type; | |
| 610 /* | |
| 611 * Attention: The down- or uplinked message will not copy. The pointer | |
| 612 * of the frame is stored only. Please be aware that the frame have to trace | |
| 613 * before it will free. | |
| 614 */ | |
| 615 signal->u.l3trace.frame = frame; | |
| 616 #ifdef TI_PS_HCOMM_CHANGE | |
| 617 PSIGNAL(_hCommDL, DL_SIGNAL_L3TRACE, signal); | |
| 618 #else | |
| 619 PSIGNAL(hCommDL, DL_SIGNAL_L3TRACE, signal); | |
| 620 #endif | |
| 621 } | |
| 622 | |
| 623 /* | |
| 624 +------------------------------------------------------------------------------ | |
| 625 | Function : sig_handle_com_l3trace | |
| 626 +------------------------------------------------------------------------------ | |
| 627 | Description : Handles the signal DL_SIGNAL_L3TRACE | |
| 628 +------------------------------------------------------------------------------ | |
| 629 */ | |
| 630 GLOBAL void sig_handle_com_l3trace( T_DL_SIGNAL_DATA * signal) | |
| 631 { | |
| 632 TRACE_EVENT_WIN ("sig_handle_com_l3trace()"); | |
| 633 com_l3trace (signal->u.l3trace.type, signal->u.l3trace.ch_type, signal->u.l3trace.frame); | |
| 634 } | |
| 635 | |
| 636 #if defined(DL_TRACE_ENABLED) && defined(DL_IMMEDIATE_TRACE) | |
| 637 /* | |
| 638 +------------------------------------------------------------------------------ | |
| 639 | Function : sig_invoke_com_l2trace | |
| 640 +------------------------------------------------------------------------------ | |
| 641 | Description : Invokes the signal DL_SIGNAL_L2TRACE | |
| 642 +------------------------------------------------------------------------------ | |
| 643 */ | |
| 644 GLOBAL void sig_invoke_com_l2trace (UBYTE trace_type, | |
| 645 UBYTE channel, UBYTE ch_type, T_TIME trace_time, | |
| 646 UBYTE* data) | |
| 647 { | |
| 648 T_DL_SIGNAL_DATA * signal = sig_get_signal_data (); | |
| 649 TRACE_EVENT_WIN ("sig_invoke_com_l2trace()"); | |
| 650 signal->u.l2trace.trace_type = trace_type; | |
| 651 signal->u.l2trace.channel = channel; | |
| 652 signal->u.l2trace.ch_type = ch_type; | |
| 653 signal->u.l2trace.trace_time = trace_time; | |
| 654 if (data) | |
| 655 { | |
| 656 signal->u.l2trace.data_len = MAX_L2_FRAME_SIZE; | |
| 657 /* | |
| 658 * lint Warning 420: Apparent access beyond array ... | |
| 659 * The argument 2 (data) may be smaller than MAX_L2_FRAME_SIZE, | |
| 660 * but it makes no sense to detect the kind and length of the data first | |
| 661 * (frame of SACCH or DCCH, string -> strlen) to avoid a read beyond array. | |
| 662 */ | |
| 663 memcpy (signal->u.l2trace.data, data, MAX_L2_FRAME_SIZE); | |
| 664 } | |
| 665 else | |
| 666 signal->u.l2trace.data_len = 0; | |
| 667 #ifdef TI_PS_HCOMM_CHANGE | |
| 668 PSIGNAL(_hCommDL, DL_SIGNAL_L2TRACE, signal); | |
| 669 #else | |
| 670 PSIGNAL(hCommDL, DL_SIGNAL_L2TRACE, signal); | |
| 671 #endif | |
| 672 } | |
| 673 | |
| 674 /* | |
| 675 +------------------------------------------------------------------------------ | |
| 676 | Function : sig_handle_com_l2trace | |
| 677 +------------------------------------------------------------------------------ | |
| 678 | Description : Handles the signal DL_SIGNAL_L2TRACE | |
| 679 +------------------------------------------------------------------------------ | |
| 680 */ | |
| 681 GLOBAL void sig_handle_com_l2trace(T_DL_SIGNAL_DATA * signal) | |
| 682 { | |
| 683 TRACE_EVENT_WIN ("sig_handle_com_l2trace()"); | |
| 684 com_l2trace (signal->u.l2trace.trace_type, signal->u.l2trace.channel, | |
| 685 signal->u.l2trace.ch_type, | |
| 686 signal->u.l2trace.trace_time, | |
| 687 signal->u.l2trace.data_len ? signal->u.l2trace.data : NULL); | |
| 688 } | |
| 689 #endif /* DL_TRACE_ENABLED && DL_IMMEDIATE_TRACE */ | |
| 690 | |
| 691 #endif /* INVOKE_SIGNAL */ | |
| 692 #endif /* DL_SIGNAL_C */ | |
| 693 | 
