annotate src/g23m-aci/aci/cmh_ras.c @ 303:f76436d19a7a default tip

!GPRS config: fix long-standing AT+COPS chance hanging bug There has been a long-standing bug in FreeCalypso going back years: sometimes in the AT command bring-up sequence of an ACI-only MS, the AT+COPS command would produce only a power scan followed by cessation of protocol stack activity (only L1 ADC traces), instead of the expected network search sequence. This behaviour was seen in different FC firmware versions going back to Citrine, and seemed to follow some law of chance, not reliably repeatable. This bug has been tracked down and found to be specific to !GPRS configuration, stemming from our TCS2/TCS3 hybrid and reconstruction of !GPRS support that was bitrotten in TCS3.2/LoCosto version. ACI module psa_mms.c, needed only for !GPRS, was missing in the TCS3 version and had to be pulled from TCS2 - but as it turns out, there is a new field in the MMR_REG_REQ primitive that needs to be set correctly, and that psa_mms.c module is the place where this initialization needed to be added.
author Mychaela Falconia <falcon@freecalypso.org>
date Thu, 08 Jun 2023 08:23:37 +0000
parents fa8dc04885d8
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1 /*
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2 +-----------------------------------------------------------------------------
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
3 | Project : GSM-PS (6147)
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
4 | Modul : CMH_RAS
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
5 +-----------------------------------------------------------------------------
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
6 | Copyright 2002 Texas Instruments Berlin, AG
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
7 | All rights reserved.
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
8 |
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
9 | This file is confidential and a trade secret of Texas
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
10 | Instruments Berlin, AG
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
11 | The receipt of or possession of this file does not convey
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
12 | any rights to reproduce or disclose its contents or to
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
13 | manufacture, use, or sell anything it may describe, in
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
14 | whole, or in part, without the specific written consent of
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
15 | Texas Instruments Berlin, AG.
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
16 +-----------------------------------------------------------------------------
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
17 | Purpose : This module provides the set functions related to the
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
18 | protocol stack adapter for RA.
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
19 +-----------------------------------------------------------------------------
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
20 */
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
21
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
22 #ifndef CMH_RAS_C
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
23 #define CMH_RAS_C
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
24 #endif
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
25
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
26 #include "aci_all.h"
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
27 /*==== INCLUDES ===================================================*/
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
28 #include "aci_cmh.h"
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
29 #include "ati_cmd.h"
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
30 #include "aci_cmd.h"
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
31
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
32 #ifdef FAX_AND_DATA
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
33 #include "aci_fd.h"
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
34 #endif
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
35
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
36 #include "aci_io.h"
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
37
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
38 #include "psa.h"
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
39 #include "psa_ra.h"
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
40 #include "psa_cc.h"
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
41 #include "cmh.h"
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
42 #include "cmh_ra.h"
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
43
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
44 /*==== CONSTANTS ==================================================*/
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
45
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
46 /*==== EXPORT =====================================================*/
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
47
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
48 /*==== VARIABLES ==================================================*/
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
49
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
50 /*==== FUNCTIONS ==================================================*/
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
51
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
52 /*
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
53 +-------------------------------------------------------------------+
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
54 | PROJECT : GSM-PS (6147) MODULE : CMH_RAS |
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
55 | ROUTINE : cmhRA_Activate |
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
56 +-------------------------------------------------------------------+
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
57
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
58 PURPOSE : set all nescessary parameters and activate RA
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
59
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
60 */
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
61
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
62 GLOBAL T_ACI_RETURN cmhRA_Activate ( T_ACI_CMD_SRC srcId,
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
63 T_ACI_AT_CMD cmdId,
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
64 SHORT cId )
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
65 {
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
66 T_RA_SET_PRM * pRASetPrm; /* points to RA parameter set */
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
67 UBYTE prmTst; /* for parameter testing */
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
68
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
69 TRACE_FUNCTION ("cmhRA_Activate()");
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
70
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
71 /*
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
72 *-------------------------------------------------------------------
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
73 * check command source
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
74 *-------------------------------------------------------------------
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
75 */
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
76 if(!cmh_IsVldCmdSrc (srcId))
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
77
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
78 return( AT_FAIL );
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
79
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
80 pRASetPrm = &raShrdPrm.set_prm[srcId];
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
81
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
82 /*
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
83 *-------------------------------------------------------------------
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
84 * check entity status
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
85 *-------------------------------------------------------------------
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
86 */
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
87 if( raEntStat.curCmd NEQ AT_CMD_NONE )
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
88
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
89 return( AT_BUSY );
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
90
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
91 /*
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
92 *-------------------------------------------------------------------
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
93 * fill in activate parameters
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
94 *-------------------------------------------------------------------
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
95 */
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
96 pRASetPrm -> model = prmTst = cmhRA_SelTrfProt( cId );
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
97 if( prmTst EQ NOT_PRESENT_8BIT ) return( AT_FAIL );
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
98
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
99 pRASetPrm -> tra_rate = prmTst = (UBYTE)cmhRA_SelChnRate();
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
100 if( prmTst EQ NOT_PRESENT_8BIT ) return( AT_FAIL );
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
101
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
102 pRASetPrm -> user_rate = prmTst = cmhRA_SelUsrRate( cId );
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
103 if( prmTst EQ NOT_PRESENT_8BIT ) return( AT_FAIL );
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
104
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
105 pRASetPrm -> ndb = prmTst = cmhRA_SelDataBits( cId );
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
106 if( prmTst EQ NOT_PRESENT_8BIT ) return( AT_FAIL );
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
107
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
108 pRASetPrm -> nsb = prmTst = cmhRA_SelStopBits( cId );
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
109 if( prmTst EQ NOT_PRESENT_8BIT ) return( AT_FAIL );
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
110
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
111 #ifdef FF_FAX
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
112 pRASetPrm -> bitord = prmTst = cmhRA_SelBitOrder( srcId );
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
113 if( prmTst EQ NOT_PRESENT_8BIT ) return( AT_FAIL );
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
114 #endif
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
115
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
116 raShrdPrm.cId = cId;
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
117 raEntStat.curCmd = cmdId;
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
118 raShrdPrm.owner = (UBYTE)srcId;
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
119 raEntStat.entOwn = srcId;
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
120
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
121 psaRA_Activate();
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
122
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
123 return( AT_EXCT );
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
124
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
125 }
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
126
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
127 /*
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
128 +-------------------------------------------------------------------+
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
129 | PROJECT : GSM-PS (6147) MODULE : CMH_RA |
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
130 | ROUTINE : cmhRA_Deactivate |
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
131 +-------------------------------------------------------------------+
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
132
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
133 PURPOSE : set all nescessary parameters and deactivate RA
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
134
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
135 */
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
136
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
137 GLOBAL T_ACI_RETURN cmhRA_Deactivate ( void )
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
138 {
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
139 TRACE_FUNCTION ("cmhRA_Deactivate()");
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
140
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
141
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
142 /* deactivate */
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
143 psaRA_Deactivate();
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
144 return( AT_EXCT );
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
145 }
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
146
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
147 /*
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
148 +-------------------------------------------------------------------+
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
149 | PROJECT : GSM-PS (6147) MODULE : CMH_RA |
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
150 | ROUTINE : cmhRA_Modify |
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
151 +-------------------------------------------------------------------+
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
152
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
153 PURPOSE : set all nescessary parameters and modify RA
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
154
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
155 */
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
156
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
157 GLOBAL T_ACI_RETURN cmhRA_Modify ( T_ACI_CMD_SRC srcId,
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
158 SHORT cId )
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
159 {
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
160 T_RA_SET_PRM * pRASetPrm; /* points to RA parameter set */
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
161 UBYTE prmTst; /* for parameter testing */
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
162
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
163 TRACE_FUNCTION ("cmhRA_Modify()");
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
164
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
165 /* check command source */
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
166 if(!cmh_IsVldCmdSrc (srcId))
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
167 {
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
168 return( AT_FAIL );
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
169 }
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
170
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
171 pRASetPrm = &raShrdPrm.set_prm[srcId];
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
172
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
173
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
174 pRASetPrm -> tra_rate = prmTst = (UBYTE)cmhRA_SelChnRate();
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
175 if( prmTst EQ NOT_PRESENT_8BIT ) return( AT_FAIL );
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
176
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
177 pRASetPrm -> user_rate = prmTst = cmhRA_SelUsrRate( cId );
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
178 if( prmTst EQ NOT_PRESENT_8BIT ) return( AT_FAIL );
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
179
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
180 /* modify */
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
181 raShrdPrm.owner = srcId;
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
182 psaRA_Modify();
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
183 return( AT_EXCT );
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
184 }
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
185
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
186 /*
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
187 +-------------------------------------------------------------------+
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
188 | PROJECT : GSM-PS (6147) MODULE : CMH_RAR |
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
189 | ROUTINE : cmhRA_Escape |
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
190 +-------------------------------------------------------------------+
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
191
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
192 PURPOSE : Escape from data mode
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
193
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
194 */
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
195
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
196 GLOBAL T_ACI_RETURN cmhRA_Escape ( void )
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
197 {
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
198 T_OWN calOwn;
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
199
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
200 TRACE_FUNCTION ("cmhRA_Escape()");
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
201
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
202 /*
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
203 *-------------------------------------------------------------------
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
204 * return to command mode
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
205 *-------------------------------------------------------------------
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
206 */
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
207 /* io_setIoMode( IO_MODE_CMD, rCI_IoMode ); */
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
208
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
209 if (ccShrdPrm.ctb[raShrdPrm.cId] NEQ NULL)
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
210 calOwn = psaCC_ctb(raShrdPrm.cId)->calOwn;
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
211 else
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
212 calOwn = (T_OWN)CMD_SRC_NONE;
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
213
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
214 R_AT( RAT_OK, (T_ACI_CMD_SRC)calOwn )
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
215 ( AT_CMD_NONE );
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
216
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
217 return(AT_CMPL);
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
218 }
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
219
fa8dc04885d8 src/g23m-*: import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
220 /*==== EOF ========================================================*/