FreeCalypso > hg > fc-magnetite
comparison src/g23m-fad/fad/fad_rcvs.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 : FAD_RCVS | |
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 processing | |
18 | of incomming signals for the component | |
19 | Fax Adaptation 3.45 of the mobile station | |
20 +----------------------------------------------------------------------------- | |
21 */ | |
22 | |
23 #ifndef FAD_RCVS_C | |
24 #define FAD_RCVS_C | |
25 #endif | |
26 | |
27 #define ENTITY_FAD | |
28 | |
29 /*==== INCLUDES ===================================================*/ | |
30 | |
31 #include <string.h> | |
32 #include "typedefs.h" | |
33 #include "vsi.h" | |
34 #include "macdef.h" | |
35 #include "pconst.cdg" | |
36 #include "custom.h" | |
37 #include "gsm.h" | |
38 #include "cnf_fad.h" | |
39 #include "mon_fad.h" | |
40 #include "prim.h" | |
41 #include "pei.h" | |
42 #include "tok.h" | |
43 #include "ccdapi.h" | |
44 #include "fad.h" | |
45 | |
46 /*==== CONST =======================================================*/ | |
47 | |
48 /*==== TYPES =======================================================*/ | |
49 | |
50 /*==== VAR EXPORT ==================================================*/ | |
51 | |
52 /*==== VAR LOCAL ===================================================*/ | |
53 | |
54 /*==== FUNCTIONS ===================================================*/ | |
55 | |
56 /* | |
57 +-------------------------------------------------------------------------+ | |
58 | PROJECT : GSM-F&D (8411) MODULE : FAD_RCVS | | |
59 | STATE : code ROUTINE : sig_ker_rcv_await_tcf_req| | |
60 +-------------------------------------------------------------------------+ | |
61 | |
62 PURPOSE : Process signal AWAIT_TCF_REQ received from KERNEL process | |
63 | |
64 */ | |
65 | |
66 GLOBAL void sig_ker_rcv_await_tcf_req (void) | |
67 { | |
68 TRACE_FUNCTION ("sig_ker_rcv_await_tcf_req()"); | |
69 | |
70 if (GET_STATE (RCV) EQ SYNC_RCV) | |
71 { | |
72 fad_data->rcv.bytes_expect = snd_DurationToBytes(fad_data->snd.trans_rate, TIME_AWAIT_TCF); | |
73 SET_STATE (RCVSUB, SUB_IDLE); | |
74 SET_STATE (RCV, TCF_RCV); | |
75 } | |
76 } | |
77 | |
78 /* | |
79 +-------------------------------------------------------------------------+ | |
80 | PROJECT : GSM-F&D (8411) MODULE : FAD_RCVS | | |
81 | STATE : code ROUTINE : sig_ker_rcv_ready_req | | |
82 +-------------------------------------------------------------------------+ | |
83 | |
84 PURPOSE : Process signal READY_REQ received from KERNEL process | |
85 | |
86 */ | |
87 | |
88 GLOBAL void sig_ker_rcv_ready_req (void) | |
89 { | |
90 T_RCV *rcv = &fad_data->rcv; | |
91 T_FAD_DATA_IND *fad_data_ind; | |
92 | |
93 TRACE_FUNCTION ("sig_ker_rcv_ready_req()"); | |
94 | |
95 rcv->t30_req_frames = TRUE; | |
96 if (rcv->prim_ready OR !rcv->data_incoming) | |
97 { | |
98 if (rcv_GetMsgData (&fad_data_ind, rcv->data_incoming)) | |
99 { | |
100 if (fad_data_ind->final) | |
101 { | |
102 if (rcv->data_incoming) /* data incoming - buffer empty */ | |
103 { | |
104 sig_rcv_ker_error_ind (ERR_EMPTY_BUFFER); | |
105 rcv->t30_req_frames = FALSE; | |
106 rcv_ResetFormatter (); | |
107 SET_STATE (RCV, SYNC_RCV); | |
108 return; | |
109 } | |
110 else | |
111 { | |
112 rcv_ResetFormatter (); | |
113 SET_STATE (RCV, SYNC_RCV); | |
114 } | |
115 } | |
116 sig_rcv_ker_msg_ind (fad_data_ind); | |
117 rcv->t30_req_frames = FALSE; | |
118 | |
119 if (rcv->preamble_pending AND !rcv->data_in_rbm) | |
120 { | |
121 /* TRACE_EVENT ("pend FAD_MUX_IND to T30"); */ | |
122 sig_rcv_ker_preamble_ind (); /**/ | |
123 } | |
124 if (rcv->bcs_pending AND !rcv->data_in_rbm) | |
125 { | |
126 /* TRACE_EVENT ("pend FAD_DATA_IND (BCS) to T30"); */ | |
127 sig_rcv_ker_bcs_ind (rcv->hdlc, rcv->hdlc_len); | |
128 } | |
129 } | |
130 } | |
131 } | |
132 | |
133 /* | |
134 +-------------------------------------------------------------------------+ | |
135 | PROJECT : GSM-F&D (8411) MODULE : FAD_RCVS | | |
136 | STATE : code ROUTINE : sig_ker_rcv_reset_req | | |
137 +-------------------------------------------------------------------------+ | |
138 | |
139 PURPOSE : Process signal AWAIT_REQ received from KERNEL process | |
140 | |
141 */ | |
142 | |
143 GLOBAL void sig_ker_rcv_reset_req (void) | |
144 { | |
145 | |
146 TRACE_FUNCTION ("sig_ker_rcv_reset_req()"); | |
147 | |
148 rcv_ResetFormatter (); | |
149 SET_STATE (RCV, SYNC_RCV); | |
150 | |
151 } | |
152 |