FreeCalypso > hg > fc-magnetite
comparison src/g23m-fad/ra/ra_l1int.c @ 174:90eb61ecd093
src/g23m-fad: initial import from TCS3.2/LoCosto
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Wed, 12 Oct 2016 05:40:46 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
173:bf64d785238a | 174:90eb61ecd093 |
---|---|
1 /* | |
2 +----------------------------------------------------------------------------- | |
3 | Project : GSM-F&D (8411) | |
4 | Modul : RA_TRA | |
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 the functions for the transparent | |
18 | data model for the component RA of the mobile station | |
19 +----------------------------------------------------------------------------- | |
20 */ | |
21 | |
22 #ifndef RA_L1INT_C | |
23 #define RA_L1INT_C | |
24 #endif | |
25 | |
26 #define ENTITY_RA | |
27 | |
28 /*==== INCLUDES ===================================================*/ | |
29 | |
30 #include <string.h> | |
31 #include "typedefs.h" | |
32 #include "pconst.cdg" | |
33 #include "vsi.h" | |
34 #include "macdef.h" | |
35 #include "pconst.cdg" | |
36 #include "custom.h" | |
37 #include "gsm.h" | |
38 #include "cnf_ra.h" | |
39 #include "prim.h" | |
40 #include "pei.h" | |
41 #include "tok.h" | |
42 #include "ccdapi.h" | |
43 #include "ra.h" | |
44 #include "ra_l1int.h" | |
45 | |
46 /*==== CONST ======================================================*/ | |
47 /*==== TYPES ======================================================*/ | |
48 /*==== VAR EXPORT ==================================================*/ | |
49 /*==== VAR LOCAL ===================================================*/ | |
50 /*==== FUNCTIONS ==================================================*/ | |
51 | |
52 /* | |
53 +--------------------------------------------------------------------+ | |
54 | PROJECT : GSM-F&D (8411) MODULE : RA_L1INT | | |
55 | STATE : code ROUTINE : l1i_ra_activate_req | | |
56 +--------------------------------------------------------------------+ | |
57 | |
58 PURPOSE : Process the primitive RA_ACTIVATE_REQ. | |
59 This function performs the TCH synchronisation | |
60 if transparent data services are set up. | |
61 */ | |
62 | |
63 GLOBAL void l1i_ra_activate_req (T_RA_ACTIVATE_REQ *ra_activate_req) | |
64 { | |
65 TRACE_EVENT ("l1i_ra_activate_req()"); | |
66 | |
67 #ifdef _SIMULATION_ | |
68 PACCESS (ra_activate_req); | |
69 #else | |
70 /* | |
71 * Set ra_handle only for target | |
72 * because RA is not a single task here like on PC simulation. | |
73 * Handle is needed for stack check in frame. | |
74 */ | |
75 ra_handle = vsi_gettaskhandle(VSI_CALLER L1_NAME); | |
76 #endif | |
77 | |
78 switch (ra_activate_req->model) | |
79 { | |
80 case RA_MODEL_TRANS: | |
81 dll_init (); | |
82 MALLOC(ra_data->tra, sizeof(T_TRA)); | |
83 | |
84 #ifdef _SIMULATION_ | |
85 /* | |
86 Provide frame descriptors of L2R's downlink FIFO | |
87 for the simulation | |
88 */ | |
89 cl_ribu_create(&ra_data->dl_ribu, MAX_TRANS_BUFFER, RA_FIFO_DEPTH); | |
90 #endif | |
91 | |
92 tra_init (ra_activate_req->tra_rate); | |
93 TRACE_EVENT ("RA MODE: Transparent"); | |
94 ra_data->model = MODEL_TRANS; | |
95 break; | |
96 | |
97 case RA_MODEL_RLP: | |
98 dll_init (); | |
99 MALLOC(ra_data->rlp, sizeof(T_RLP)); | |
100 rlp_init (); | |
101 TRACE_EVENT ("RA MODE: Non-Transparent"); | |
102 ra_data->model = MODEL_RLP; | |
103 break; | |
104 | |
105 #ifdef FF_FAX | |
106 case RA_MODEL_FAX: | |
107 dll_init (); | |
108 MALLOC(ra_data->fax, sizeof(T_FAX)); | |
109 | |
110 #ifdef _SIMULATION_ | |
111 /* | |
112 Provide frame descriptors of FAD's downlink FIFO | |
113 for the simulation | |
114 */ | |
115 cl_ribu_create(&ra_data->dl_ribu, FAD_DESCBUF_LEN, RA_FIFO_DEPTH); | |
116 #endif | |
117 | |
118 cl_ribu_create(&ra_data->fax->ul_ribu, FAD_DESCBUF_LEN, RA_FIFO_DEPTH); | |
119 | |
120 fax_init (); | |
121 TRACE_EVENT ("RA MODE: FAX"); | |
122 ra_data->model = MODEL_FAX; | |
123 break; | |
124 #endif /* FF_FAX */ | |
125 | |
126 default: | |
127 TRACE_EVENT ("RA MODE: INVALID (SPEECH?)"); | |
128 #ifdef _SIMULATION_ | |
129 PFREE(ra_activate_req); | |
130 #endif | |
131 return; | |
132 } | |
133 | |
134 ra_data->tra_rate = ra_activate_req->tra_rate; | |
135 ra_data->user_rate = ra_activate_req->user_rate; | |
136 ra_data->ndb = ra_activate_req->ndb; | |
137 ra_data->nsb = ra_activate_req->nsb; | |
138 ra_data->activated = TRUE; | |
139 | |
140 #ifdef _SIMULATION_ | |
141 PFREE(ra_activate_req); | |
142 #endif | |
143 } | |
144 | |
145 /* | |
146 +--------------------------------------------------------------------+ | |
147 | PROJECT : GSM-F&D (8411) MODULE : RA_L1INT | | |
148 | STATE : code ROUTINE : l1i_ra_datatrans_req | | |
149 +--------------------------------------------------------------------+ | |
150 | |
151 PURPOSE : Process the primitive RA_DATATRANS_REQ. | |
152 This function is signalling | |
153 the upper layer is ready to provide frame descriptors | |
154 for downlink data transfer. | |
155 */ | |
156 GLOBAL void l1i_ra_datatrans_req (T_RA_DATATRANS_REQ *ra_datatrans_req) | |
157 { | |
158 TRACE_EVENT ("l1i_ra_datatrans_req()"); | |
159 | |
160 #ifdef _SIMULATION_ | |
161 PACCESS (ra_datatrans_req); | |
162 #endif | |
163 | |
164 switch (ra_data->model) | |
165 { | |
166 case MODEL_TRANS: | |
167 if (GET_STATE(KER) EQ TRA_DATA_TRANS_PRE2) | |
168 { | |
169 SET_STATE (KER, TRA_DATA_TRANS_PRE3); | |
170 } | |
171 break; | |
172 | |
173 #ifdef FF_FAX | |
174 case MODEL_FAX: | |
175 if (GET_STATE(KER) EQ FAX_DATA_TRANS_PRE) | |
176 { | |
177 SET_STATE (KER, FAX_DATA_TRANS); | |
178 } | |
179 break; | |
180 #endif /* FF_FAX */ | |
181 | |
182 case MODEL_RLP: | |
183 break; | |
184 } | |
185 | |
186 #ifdef _SIMULATION_ | |
187 PFREE(ra_datatrans_req); | |
188 #endif | |
189 } | |
190 | |
191 /* | |
192 +--------------------------------------------------------------------+ | |
193 | PROJECT : GSM-F&D (8411) MODULE : RA_L1INT | | |
194 | STATE : code ROUTINE : l1i_ra_activate_cnf | | |
195 +--------------------------------------------------------------------+ | |
196 | |
197 PURPOSE : Send the primitive RA_ACTIVATE_CNF. | |
198 */ | |
199 | |
200 GLOBAL void l1i_ra_activate_cnf(void) | |
201 { | |
202 TRACE_EVENT ("l1i_ra_activate_cnf()"); | |
203 | |
204 #ifndef _SIMULATION_ | |
205 | |
206 PSIGNAL(hCommMMI, RA_ACTIVATE_CNF, NULL); | |
207 | |
208 #else | |
209 { | |
210 PALLOC(ra_activate_cnf, RA_ACTIVATE_CNF); | |
211 PSENDX(MMI, ra_activate_cnf); | |
212 } | |
213 #endif | |
214 } | |
215 | |
216 /* | |
217 +--------------------------------------------------------------------+ | |
218 | PROJECT : GSM-F&D (8411) MODULE : RA_L1INT | | |
219 | STATE : code ROUTINE : l1i_ra_modify_req | | |
220 +--------------------------------------------------------------------+ | |
221 | |
222 PURPOSE : Process the primitive RA_MODIFY_REQ. | |
223 This function performs no TCH synchronisation. | |
224 Only the communication parameters are changed in the shared memory | |
225 and in case of fax the sequencer is synchronized. | |
226 This function is only used in fax mode. | |
227 */ | |
228 | |
229 GLOBAL void l1i_ra_modify_req (T_RA_MODIFY_REQ *ra_modify_req) | |
230 { | |
231 #ifdef FF_FAX | |
232 TRACE_EVENT ("l1i_ra_modify_req()"); | |
233 | |
234 #ifdef _SIMULATION_ | |
235 PACCESS (ra_modify_req); | |
236 #endif | |
237 | |
238 if (ra_data->activated AND ra_data->model EQ MODEL_FAX) | |
239 { | |
240 | |
241 ra_data->tra_rate = ra_modify_req->tra_rate; | |
242 ra_data->user_rate = ra_modify_req->user_rate; | |
243 | |
244 #ifdef TRACE_RA_FAX_STATUS | |
245 TRACE_EVENT_P2("trans_rate=0x%02X & user_rate=0x%02X", ra_data->tra_rate, ra_data->user_rate); | |
246 #endif | |
247 | |
248 SET_STATE (KER, FAX_MODIFY); | |
249 | |
250 #ifdef TRACE_RA_FAX_STATUS | |
251 if (ra_data->fax->state_last NEQ ra_data->ker.state) | |
252 { | |
253 TRACE_EVENT_P2("KER:FAX_%d -> FAX_%d", ra_data->fax->state_last, ra_data->ker.state); | |
254 ra_data->fax->state_last = ra_data->ker.state; | |
255 } | |
256 #endif | |
257 } | |
258 | |
259 #ifdef _SIMULATION_ | |
260 PFREE(ra_modify_req); | |
261 #endif | |
262 | |
263 #endif /* FF_FAX */ | |
264 } | |
265 | |
266 /* | |
267 +--------------------------------------------------------------------+ | |
268 | PROJECT : GSM-F&D (8411) MODULE : RA_L1INT | | |
269 | STATE : code ROUTINE : l1i_ra_modify_cnf | | |
270 +--------------------------------------------------------------------+ | |
271 | |
272 PURPOSE : Send the primitive RA_MODIFY_CNF. | |
273 */ | |
274 | |
275 GLOBAL void l1i_ra_modify_cnf(void) | |
276 { | |
277 #ifdef FF_FAX | |
278 TRACE_EVENT ("l1i_ra_modify_cnf()"); | |
279 | |
280 #ifndef _SIMULATION_ | |
281 | |
282 PSIGNAL ( hCommMMI, RA_MODIFY_CNF, NULL ); | |
283 | |
284 #else | |
285 { | |
286 PALLOC (ra_modify_cnf, RA_MODIFY_CNF); | |
287 PSENDX (MMI, ra_modify_cnf); | |
288 } | |
289 #endif | |
290 | |
291 #endif /* FF_FAX */ | |
292 } | |
293 | |
294 /* | |
295 +--------------------------------------------------------------------+ | |
296 | PROJECT : GSM-F&D (8411) MODULE : RA_L1INT | | |
297 | STATE : code ROUTINE : l1i_ra_deactivate_req | | |
298 +--------------------------------------------------------------------+ | |
299 | |
300 PURPOSE : Process the primitive RA_DEACTIVATE_REQ. | |
301 This function stops the processing activities | |
302 of the processes TRA, RLP or FAX. | |
303 | |
304 */ | |
305 | |
306 GLOBAL void l1i_ra_deactivate_req (T_RA_DEACTIVATE_REQ *ra_deactivate_req) | |
307 { | |
308 TRACE_EVENT ("l1i_ra_deactivate_req()"); | |
309 | |
310 #ifdef _SIMULATION_ | |
311 PACCESS (ra_deactivate_req); | |
312 #endif | |
313 | |
314 if (ra_data->activated) | |
315 { | |
316 switch (ra_data->model) | |
317 { | |
318 case MODEL_TRANS: | |
319 SET_STATE (KER, TRA_NULL); | |
320 MFREE(ra_data->tra); | |
321 break; | |
322 | |
323 case MODEL_RLP: | |
324 SET_STATE (KER, RLP_NULL); | |
325 MFREE(ra_data->rlp); | |
326 break; | |
327 | |
328 #ifdef FF_FAX | |
329 case MODEL_FAX: | |
330 SET_STATE (KER, FAX_NULL); | |
331 #ifdef TRACE_RA_FAX_STATUS | |
332 if (ra_data->fax->state_last NEQ ra_data->ker.state) | |
333 { | |
334 TRACE_EVENT_P2("KER:FAX_%d -> FAX_%d", ra_data->fax->state_last, ra_data->ker.state); | |
335 ra_data->fax->state_last = ra_data->ker.state; | |
336 } | |
337 #endif | |
338 if (ra_data->fax->ul_ribu) | |
339 cl_ribu_release(&ra_data->fax->ul_ribu); | |
340 | |
341 MFREE(ra_data->fax); | |
342 break; | |
343 #endif /* FF_FAX */ | |
344 | |
345 } | |
346 | |
347 #ifdef _SIMULATION_ | |
348 if (ra_data->dl_ribu) | |
349 cl_ribu_release(&ra_data->dl_ribu); | |
350 #endif | |
351 | |
352 dll_init(); | |
353 | |
354 #ifdef _SIMULATION_ | |
355 { | |
356 PALLOC (ra_deactivate_cnf, RA_DEACTIVATE_CNF); | |
357 PSENDX (MMI, ra_deactivate_cnf); | |
358 } | |
359 #else | |
360 PSIGNAL (hCommMMI, RA_DEACTIVATE_CNF, &ra_data->ra_deactivate_cnf); | |
361 #endif | |
362 | |
363 } | |
364 ra_data->activated=FALSE; | |
365 #ifdef _SIMULATION_ | |
366 PFREE(ra_deactivate_req); | |
367 #endif | |
368 } | |
369 | |
370 /* | |
371 +--------------------------------------------------------------------+ | |
372 | PROJECT : GSM-F&D (8411) MODULE : RA_L1INT | | |
373 | STATE : code ROUTINE : l1i_ra_data_req | | |
374 +--------------------------------------------------------------------+ | |
375 | |
376 PURPOSE : Process the primitive RA_DATA_REQ. | |
377 */ | |
378 | |
379 GLOBAL void l1i_ra_data_req(T_RA_DATA_REQ *ra_data_req, T_FRAME_DESC *frame_desc) | |
380 { | |
381 TRACE_FUNCTION ("l1i_ra_data_req()"); | |
382 | |
383 if (ra_data->activated) | |
384 { | |
385 switch (ra_data->model) | |
386 { | |
387 case MODEL_RLP: | |
388 | |
389 if (frame_desc->Len[0] > 0) | |
390 { | |
391 U8 ribu_wi = cl_ribu_write_index(&ra_data->rlp->ulq); | |
392 cl_set_frame_desc(&ra_data->rlp->ul_frame_desc[ribu_wi], | |
393 frame_desc->Adr[0], frame_desc->Len[0], frame_desc->Adr[1], frame_desc->Len[1]); | |
394 | |
395 #ifdef TRACE_RA_RLP | |
396 TRACE_EVENT_P3("RLP_UL_L1:0x%02X%02X - %d", | |
397 *(ra_data->rlp->ul_frame_desc[ribu_wi].Adr[0]+1), | |
398 *(ra_data->rlp->ul_frame_desc[ribu_wi].Adr[0]+0), | |
399 ra_data->rlp->ul_frame_desc[ribu_wi].Len[0]); | |
400 #endif | |
401 ra_data->rlp->ul_data_pending = TRUE; | |
402 ra_data->rlp->m1 = 0; | |
403 ra_data->rlp->ul_48_first_half_sent = FALSE; | |
404 } | |
405 break; /* MODEL_RLP */ | |
406 | |
407 default: | |
408 break; | |
409 } | |
410 } | |
411 } | |
412 | |
413 GLOBAL void l1i_ra_data_req_new(T_FD *pFD) | |
414 { | |
415 TRACE_FUNCTION ("l1i_ra_data_req_new()"); | |
416 | |
417 if (ra_data->activated) | |
418 { | |
419 switch (ra_data->model) | |
420 { | |
421 case MODEL_TRANS: | |
422 if (ra_data->tra->ul_status NEQ pFD->status) | |
423 { | |
424 ra_data->tra->ul_sa = ((pFD->status & ST_SA) ? 1 : 0); | |
425 ra_data->tra->ul_sb = ((pFD->status & ST_SB) ? 1 : 0); | |
426 ra_data->tra->ul_x = ((pFD->status & ST_X) ? 1 : 0); | |
427 ra_data->tra->overspeed = ((pFD->status & ST_OVER) ? 1 : 0); | |
428 | |
429 ra_data->tra->ul_status = pFD->status; | |
430 ra_data->tra->ul_signals_pending = TRUE; | |
431 } | |
432 cl_set_frame_desc_0(&ra_data->tra->ul_frame_desc, pFD->buf, pFD->len); | |
433 | |
434 ra_data->tra->data_req_rec = TRUE; /* ra_data_req received */ | |
435 | |
436 if (ra_data->tra->ul_frame_desc.Len[0] > 0) | |
437 { | |
438 ra_data->tra->ul_data_pending = TRUE; | |
439 } | |
440 else | |
441 { | |
442 ra_data->tra->ul_signals_pending = TRUE; | |
443 } | |
444 break; /* MODEL_TRANS */ | |
445 | |
446 #ifdef FF_FAX | |
447 case MODEL_FAX: | |
448 cl_ribu_put(*pFD, ra_data->fax->ul_ribu); | |
449 break; /* MODEL_FAX */ | |
450 #endif | |
451 | |
452 default: | |
453 break; | |
454 } | |
455 } | |
456 } | |
457 | |
458 #ifdef _SIMULATION_ | |
459 | |
460 /* | |
461 +--------------------------------------------------------------------+ | |
462 | PROJECT : GSM-F&D (8411) MODULE : RA_L1INT | | |
463 | STATE : code ROUTINE : l1i_ra_data_req_sim | | |
464 +--------------------------------------------------------------------+ | |
465 | |
466 PURPOSE : Process the primitive RA_DATA_REQ (SIMULATION wrapper) | |
467 */ | |
468 | |
469 GLOBAL void l1i_ra_data_req_sim(T_RA_DATA_REQ *ra_data_req) | |
470 { | |
471 static T_FRAME_DESC frame_desc; | |
472 static U8 buf[MAX_FAX_BUFFER_UL]; | |
473 | |
474 T_FD *pFD = &ra_data->ul_FD; | |
475 | |
476 TRACE_FUNCTION ("l1i_ra_data_req_sim()"); | |
477 | |
478 PACCESS (ra_data_req); | |
479 | |
480 if (ra_data->activated) | |
481 { | |
482 switch (ra_data->model) | |
483 { | |
484 case MODEL_TRANS: | |
485 pFD->status = ra_data_req->status; | |
486 pFD->len = ra_data_req->sdu.l_buf>>3; | |
487 pFD->buf = &ra_data->ul_buf[0]; | |
488 memcpy(pFD->buf, ra_data_req->sdu.buf, pFD->len); | |
489 l1i_ra_data_req_new(pFD); | |
490 break; | |
491 | |
492 #ifdef FF_FAX | |
493 case MODEL_FAX: | |
494 pFD->type = ra_data_req->fr_type; | |
495 pFD->len = ra_data_req->sdu.l_buf>>3; | |
496 pFD->buf = ra_data_req->sdu.buf; | |
497 l1i_ra_data_req_new(pFD); | |
498 break; | |
499 #endif /* FF_FAX */ | |
500 | |
501 default: /* serves old version */ | |
502 cl_set_frame_desc_0(&frame_desc, buf, (USHORT)(ra_data_req->sdu.l_buf >> 3)); | |
503 memcpy(frame_desc.Adr[0], ra_data_req->sdu.buf, frame_desc.Len[0]); | |
504 l1i_ra_data_req(ra_data_req, &frame_desc); | |
505 break; | |
506 } | |
507 } | |
508 | |
509 PFREE(ra_data_req); | |
510 } | |
511 | |
512 #endif | |
513 | |
514 /* | |
515 +--------------------------------------------------------------------+ | |
516 | PROJECT : GSM-F&D (8411) MODULE : RA_L1INT | | |
517 | STATE : code ROUTINE : l1i_ra_ready_ind | | |
518 +--------------------------------------------------------------------+ | |
519 | |
520 PURPOSE : Send the primitive RA_READY_IND. | |
521 */ | |
522 | |
523 GLOBAL void l1i_ra_ready_ind(T_HANDLE handle, UBYTE idx) | |
524 { | |
525 TRACE_FUNCTION ("l1i_ra_ready_ind()"); | |
526 | |
527 #ifdef _SIMULATION_ | |
528 { | |
529 PALLOC (ra_ready_ind, RA_READY_IND); | |
530 memcpy (ra_ready_ind, &ra_data->ra_ready_ind[idx], sizeof (T_RA_READY_IND)); | |
531 PSEND (handle, ra_ready_ind); | |
532 } | |
533 #else | |
534 | |
535 PSIGNAL(handle, RA_READY_IND, &ra_data->ra_ready_ind[idx]); | |
536 | |
537 #endif | |
538 } | |
539 | |
540 /* | |
541 +--------------------------------------------------------------------+ | |
542 | PROJECT : GSM-F&D (8411) MODULE : RA_L1INT | | |
543 | STATE : code ROUTINE : l1i_ra_data_ind | | |
544 +--------------------------------------------------------------------+ | |
545 | |
546 PURPOSE : Send the primitive RA_DATA_IND | |
547 */ | |
548 | |
549 GLOBAL void l1i_ra_data_ind(T_HANDLE handle) | |
550 { | |
551 TRACE_FUNCTION ("l1i_ra_data_ind()"); | |
552 | |
553 #ifdef _TARGET_ | |
554 | |
555 PSIGNAL(handle, RA_DATA_IND, &ra_data->ra_data_ind); | |
556 | |
557 #else /* _SIMULATION_ */ | |
558 | |
559 { | |
560 PALLOC_SDU (ra_data_ind, RA_DATA_IND, (MAX_FAX_BUFFER_DL << 3)); | |
561 memcpy(ra_data_ind, &ra_data->ra_data_ind, sizeof (T_RA_DATA_IND)); | |
562 | |
563 switch (ra_data->model) | |
564 { | |
565 case MODEL_TRANS: | |
566 { | |
567 T_TRA *dtra = ra_data->tra; | |
568 | |
569 dtra->dl_pFD = cl_ribu_get(ra_data->dl_ribu); | |
570 | |
571 if (dtra->dl_pFD AND dtra->dl_pFD->len) | |
572 { | |
573 ra_data_ind->sdu.l_buf = dtra->dl_pFD->len<<3; | |
574 memcpy(&ra_data_ind->sdu.buf[0], dtra->dl_pFD->buf, dtra->dl_pFD->len); | |
575 dtra->dl_pFD = NULL; | |
576 } | |
577 } | |
578 break; | |
579 | |
580 #ifdef FF_FAX | |
581 case MODEL_FAX: | |
582 { | |
583 T_FAX *dfax = ra_data->fax; | |
584 | |
585 dfax->dl_pFD = cl_ribu_get(ra_data->dl_ribu); | |
586 | |
587 if (dfax->dl_pFD) | |
588 { | |
589 ra_data_ind->fr_type = dfax->dl_pFD->type; | |
590 | |
591 if (dfax->dl_pFD->len) | |
592 { | |
593 if (ra_data_ind->fr_type EQ FR_SYNC) | |
594 ra_data_ind->sdu.l_buf = 0; | |
595 else | |
596 { | |
597 ra_data_ind->sdu.l_buf = dfax->dl_pFD->len<<3; | |
598 memcpy(&ra_data_ind->sdu.buf[0], dfax->dl_pFD->buf, ra_data_ind->sdu.l_buf>>3); | |
599 } | |
600 } | |
601 } | |
602 } | |
603 break; | |
604 #endif /* FF_FAX */ | |
605 | |
606 default: | |
607 if (ra_data->ra_data_ind.sdu.l_buf) | |
608 { | |
609 memcpy(&ra_data_ind->sdu.buf[0], ra_data->rlp->dl_buf, ra_data->ra_data_ind.sdu.l_buf>>3); | |
610 } | |
611 break; | |
612 } | |
613 PSEND (handle, ra_data_ind); | |
614 } | |
615 | |
616 #endif /* _SIMULATION_ */ | |
617 } | |
618 | |
619 /* | |
620 +--------------------------------------------------------------------+ | |
621 | PROJECT : GSM-F&D (8411) MODULE : RA_L1INT | | |
622 | STATE : code ROUTINE : l1i_ra_break_req | | |
623 +--------------------------------------------------------------------+ | |
624 | |
625 PURPOSE : Process the primitive RA_BREAK_REQ. | |
626 */ | |
627 | |
628 GLOBAL void l1i_ra_break_req(T_RA_BREAK_REQ *ra_break_req) | |
629 { | |
630 TRACE_EVENT ("l1i_ra_break_req()"); | |
631 | |
632 #ifdef _SIMULATION_ | |
633 PACCESS (ra_break_req); | |
634 #endif | |
635 | |
636 if (ra_data->activated) | |
637 { | |
638 /* | |
639 * a break can only be requested if it is the | |
640 * first request or the last is sent completeley | |
641 * via the TCH. | |
642 */ | |
643 if (ra_data->tra->break_len EQ 0) | |
644 { | |
645 ra_data->tra->break_len = ra_break_req->break_len; | |
646 } | |
647 else | |
648 TRACE_EVENT ("break request too early"); | |
649 } | |
650 | |
651 #ifdef _SIMULATION_ | |
652 PFREE(ra_break_req); | |
653 #endif | |
654 } | |
655 | |
656 #ifndef HO_WORKAROUND | |
657 /* | |
658 +--------------------------------------------------------------------+ | |
659 | PROJECT : GSM-F&D (8411) MODULE : RA_L1INT | | |
660 | STATE : code ROUTINE : l1i_ra_break_ind | | |
661 +--------------------------------------------------------------------+ | |
662 | |
663 PURPOSE : Send the primitive RA_BREAK_IND. | |
664 */ | |
665 | |
666 GLOBAL void l1i_ra_break_ind(void) | |
667 { | |
668 TRACE_EVENT ("l1i_ra_break_ind()"); | |
669 | |
670 #ifndef _SIMULATION_ | |
671 | |
672 PSIGNAL (hCommTRA, RA_BREAK_IND, &ra_data->ra_break_ind); | |
673 | |
674 #else | |
675 { | |
676 PALLOC (ra_break_ind, RA_BREAK_IND); | |
677 memcpy (ra_break_ind, &ra_data->tra->ra_break_ind, sizeof(T_RA_BREAK_IND)); | |
678 PSENDX (TRA, ra_break_ind); | |
679 } | |
680 #endif | |
681 } | |
682 #endif | |
683 | |
684 /* | |
685 +--------------------------------------------------------------------+ | |
686 | PROJECT : GSM-F&D (8411) MODULE : RA_L1INT | | |
687 | STATE : code ROUTINE : l1i_ra_detect_req | | |
688 +--------------------------------------------------------------------+ | |
689 | |
690 PURPOSE : Process the primitive RA_DETECT_REQ. | |
691 | |
692 */ | |
693 | |
694 GLOBAL void l1i_ra_detect_req(T_RA_DETECT_REQ *ra_detect_req) | |
695 { | |
696 TRACE_FUNCTION ("l1i_ra_detect_req()"); | |
697 | |
698 #ifdef _SIMULATION_ | |
699 PACCESS (ra_detect_req); | |
700 #endif | |
701 | |
702 if (ra_data->activated) | |
703 { | |
704 if (ra_detect_req->detect EQ DET_NO_STATUS) | |
705 { | |
706 shm_set_dsp_value (fax_b_status_detect, 0); | |
707 } | |
708 else if (ra_detect_req->detect EQ DET_STATUS) | |
709 { | |
710 shm_set_dsp_value (fax_b_status_detect, 1); | |
711 } | |
712 } | |
713 | |
714 #ifdef _SIMULATION_ | |
715 PFREE(ra_detect_req); | |
716 #endif | |
717 } | |
718 |