annotate gsm-fw/g23m-gsm/sms/sms_for.c @ 915:7b805007dcfc

etmsync: slight "main" refactoring in preparation for multiple programs
author Space Falcon <falcon@ivan.Harhan.ORG>
date Tue, 08 Sep 2015 18:26:42 +0000
parents a7bbc4fdd447
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
673
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1 /*
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
2 +-----------------------------------------------------------------------------
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
3 | Project : GSM-F&D (8411)
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
4 | Modul : SMS_FOR
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
5 +-----------------------------------------------------------------------------
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
6 | Copyright 2002 Texas Instruments Berlin, AG
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
7 | All rights reserved.
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
8 |
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
9 | This file is confidential and a trade secret of Texas
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
10 | Instruments Berlin, AG
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
11 | The receipt of or possession of this file does not convey
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
12 | any rights to reproduce or disclose its contents or to
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
13 | manufacture, use, or sell anything it may describe, in
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
14 | whole, or in part, without the specific written consent of
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
15 | Texas Instruments Berlin, AG.
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
16 +-----------------------------------------------------------------------------
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
17 | Purpose : This Modul defines the functions for the formatter
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
18 | of the component SMS.
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
19 +-----------------------------------------------------------------------------
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
20 */
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
21
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
22 #ifndef SMS_FOR_C
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
23 #define SMS_FOR_C
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
24
760
2b438f89bb62 sms_for.c compiles
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 673
diff changeset
25 #include "config.h"
2b438f89bb62 sms_for.c compiles
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 673
diff changeset
26 #include "fixedconf.h"
2b438f89bb62 sms_for.c compiles
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 673
diff changeset
27 #include "condat-features.h"
2b438f89bb62 sms_for.c compiles
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 673
diff changeset
28
673
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
29 #define ENTITY_SMS
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
30
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
31 /*==== INCLUDES ===================================================*/
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
32
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
33 #include <string.h>
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
34 #include <stdlib.h>
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
35 #include <stddef.h>
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
36 #include "typedefs.h"
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
37 #include "pcm.h"
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
38 #include "vsi.h"
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
39 #include "custom.h"
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
40 #include "gsm.h"
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
41 #include "message.h"
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
42 #include "ccdapi.h"
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
43 #include "prim.h"
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
44 #include "cus_sms.h"
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
45 #include "cnf_sms.h"
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
46 #include "mon_sms.h"
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
47 #include "pei.h"
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
48 #include "tok.h"
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
49 #include "sms.h"
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
50 #include "sms_em.h"
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
51
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
52 /*==== EXPORT ======================================================*/
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
53
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
54 /*==== PRIVAT ======================================================*/
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
55
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
56 /*==== VARIABLES ===================================================*/
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
57
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
58 #if !defined (SHARED_CCD_BUF)
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
59 GLOBAL UBYTE _decodedMsg [MAX_MSTRUCT_LEN_SMS];
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
60 #else
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
61 GLOBAL UBYTE * _decodedMsg;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
62 GLOBAL UBYTE _CCDbuf = FALSE;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
63 #endif
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
64
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
65 /*==== FUNCTIONS ===================================================*/
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
66
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
67 /*
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
68 +--------------------------------------------------------------------+
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
69 | PROJECT : GSM-PS (8410) MODULE : SMS_FOR |
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
70 | STATE : code ROUTINE : for_init_sms |
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
71 +--------------------------------------------------------------------+
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
72
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
73 PURPOSE : Initialize the formatter (void)
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
74 */
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
75
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
76 GLOBAL void for_init_sms (void)
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
77 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
78 // TRACE_FUNCTION ("for_init_sms()");
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
79 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
80
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
81 /*
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
82 +--------------------------------------------------------------------+
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
83 | PROJECT : GSM-PS (8410) MODULE : SMS_FOR |
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
84 | STATE : code ROUTINE : for_get_pd_ti |
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
85 +--------------------------------------------------------------------+
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
86
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
87 PURPOSE : Get protocol discriminator and transaction identifier if
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
88 the incoming message is of sufficient length to contain
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
89 anythiny useful, this means at least PD, TI and message type.
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
90 */
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
91
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
92 LOCAL BOOL for_get_pd_ti (T_sdu *p_sdu, UBYTE *p_pd, UBYTE *p_ti)
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
93 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
94 if (p_sdu->l_buf >= 16)
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
95 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
96 *p_pd = p_sdu->buf[p_sdu->o_buf >> 3] & 0x0F;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
97 *p_ti = p_sdu->buf[p_sdu->o_buf >> 3] >> 4;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
98 *p_ti ^= 0x8;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
99
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
100 p_sdu->o_buf += BSIZE_TI_PD;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
101 p_sdu->l_buf -= BSIZE_TI_PD;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
102
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
103 return TRUE;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
104 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
105 TRACE_EVENT ("message too short");
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
106 return FALSE;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
107 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
108
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
109 /*
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
110 +--------------------------------------------------------------------+
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
111 | PROJECT : GSM-PS (8410) MODULE : SMS_FOR |
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
112 | STATE : code ROUTINE : for_get_new_mt_instance |
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
113 +--------------------------------------------------------------------+
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
114
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
115 PURPOSE : This function gets a new MT instance. Basically the same
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
116 is done here as in GET_NEW_SMS_INSTANCE(), but additionally
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
117 the special case that the CP-Layer of an old MT transaction
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
118 waits for the last CP-ACK before the MMSMS_RELEASE_REQ is
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
119 sent is handled.
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
120
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
121 */
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
122
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
123 LOCAL T_SMS_DATA * for_get_new_mt_instance (UBYTE ti)
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
124 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
125 GET_INSTANCE_DATA;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
126
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
127 TRACE_FUNCTION ("for_get_new_mt_instance()");
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
128
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
129 /*
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
130 * Check here whether we are awaiting the last CP-ACK for a MT transaction.
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
131 * If so, take the new MT message as implicit CP-ACK.
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
132 */
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
133 if (sms_data NEQ NULL) /*lint !e774 (sms_data NEQ NULL) always */
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
134 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
135 if (sms_data->data[INST_MT].ti NEQ 0)
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
136 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
137 /* Old MT instance still exists */
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
138 sms_data->inst = INST_MT;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
139 switch (SMS_INST_GET_STATE (STATE_CP))
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
140 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
141 case CP_WAIT_FOR_ACK:
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
142 #ifdef GPRS
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
143 case CP_GSMS_MT_WAIT_FOR_CP_ACK:
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
144 #endif
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
145 if (SMS_INST.r_flag)
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
146 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
147 /*
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
148 * No further message for the old MT instance expected. Take the
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
149 * MMSMS_ESTABLISH_IND as implicit CP-ACK for the old instance.
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
150 */
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
151 TRACE_EVENT ("Implicit CP-ACK");
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
152 cp_data_ind_cp_ack ();
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
153 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
154 break;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
155
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
156 default:
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
157 break; /* Do nothing */
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
158 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
159 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
160 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
161
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
162 sms_data = GET_NEW_SMS_INSTANCE(ti);
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
163
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
164 return sms_data;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
165 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
166
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
167 /*
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
168 +--------------------------------------------------------------------+
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
169 | PROJECT : GSM-PS (8410) MODULE : SMS_FOR |
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
170 | STATE : code ROUTINE : for_ccd_rp_error_send |
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
171 +--------------------------------------------------------------------+
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
172
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
173 PURPOSE : Perform CCD Error check and send rp errors
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
174
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
175 */
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
176
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
177 LOCAL BOOL for_ccd_rp_error_send (T_D_CP_DATA *cp_data,
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
178 T_SMS_DATA *sms_data, UBYTE rp_error)
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
179 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
180 BOOL rp_error_send = FALSE;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
181
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
182 MCAST (cp_data1, U_CP_DATA);
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
183
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
184 if((SMS_INST_GET_STATE (STATE_CP)) EQ CP_MM_CONNECTION_ESTABLISHED)
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
185 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
186 rp_error_send = TRUE;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
187 rl_build_rp_error (cp_data->cp_user_data_dl.reference,
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
188 rp_error,cp_data1, NULL);
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
189 SMS_EM_SEND_RP_ERROR;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
190 cp_data_req (cp_data1);
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
191 cp_send_release_req (SMS_INST.ti);
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
192
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
193 FREE_SMS_INSTANCE (SMS_INST.ti);
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
194 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
195 return rp_error_send;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
196 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
197
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
198 /*
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
199 +--------------------------------------------------------------------+
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
200 | PROJECT : GSM-PS (8410) MODULE : SMS_FOR |
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
201 | STATE : code ROUTINE : for_ccd_error_check |
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
202 +--------------------------------------------------------------------+
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
203
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
204 PURPOSE : Perform CCD Error check and returns errors
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
205
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
206 */
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
207
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
208 LOCAL BOOL for_ccd_error_check (UBYTE *_decodedMsg,T_sdu *buf_sdu,
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
209 T_SMS_DATA *sms_data,UBYTE ti)
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
210 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
211 ULONG ccd_err = ERR_NO_MORE_ERROR;
824
a7bbc4fdd447 g23m-gsm/sms/sms_for.c: bogus call to malloc removed
Space Falcon <falcon@ivan.Harhan.ORG>
parents: 760
diff changeset
212 T_CCD_ERR_ENTRY *ccd_err_entry = 0;
673
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
213 UBYTE p_sdu;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
214 UBYTE cp_error_cause = 0;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
215 UBYTE length = 0;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
216 BOOL cp_error_send = FALSE;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
217 BOOL rp_error_send = FALSE;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
218
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
219
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
220 /* Message offset value */
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
221 p_sdu = (buf_sdu->o_buf/8) - 1;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
222
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
223 ccd_err = ccd_getFirstFault(&ccd_err_entry);
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
224 do
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
225 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
226 /*
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
227 * Need to set these values everytime we go through fault list of ccd
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
228 */
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
229 cp_error_send = FALSE;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
230 rp_error_send = FALSE;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
231 /*lint -e415 Likely access of out-of-bounds pointer*/
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
232 switch(ccd_err)
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
233 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
234 case ERR_ELEM_LEN: /* ignore message & send STATUS #96 */
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
235 /*
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
236 * This ccd error will come when there is any error in IE length.
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
237 * If cp user data length is greater than 249 Octets then this error
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
238 * is because CP Message IE, so send CP-ERROR
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
239 * if cp user data length is less than 249, then this ccd error is
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
240 * because of rp IE length, so RP-ERROR
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
241 */
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
242 switch(_decodedMsg[0])
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
243 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
244 case D_CP_DATA:
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
245 length = buf_sdu->buf[p_sdu+2];
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
246
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
247 /*
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
248 * If CP User data length is more than 249 then CCD error is because
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
249 * of CP Message IE else it will be becasue of RP message IE
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
250 * Send error accordingly
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
251 */
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
252 if(length < MAX_LEN_CP_USER_DATA)
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
253 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
254 rp_error_send = for_ccd_rp_error_send((T_D_CP_DATA *)_decodedMsg,
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
255 sms_data,
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
256 SMS_RP_CS_INV_MAND_INFO);
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
257 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
258 if(rp_error_send EQ FALSE)
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
259 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
260 cp_error_send = TRUE;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
261 cp_error_cause = SMS_CP_CS_INV_MAND_INFO;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
262 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
263 break;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
264 /*
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
265 * If Message is CP-ACK or CP-ERROR then this ccd error is due to CP
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
266 * no need to differentiate between RP and CP, These two messages are
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
267 * intended for CP Layer, So send CP-ERROR
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
268 */
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
269 case B_CP_ACK:
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
270 case B_CP_ERROR:
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
271 /* This flag will become FALSE, in case there is CCD warning, so make it
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
272 * TRUE till we get CCD Error, especially this will happen in default case
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
273 */
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
274 cp_error_send = TRUE;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
275 cp_error_cause = SMS_CP_CS_INV_MAND_INFO;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
276 break;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
277 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
278 break;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
279
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
280 case ERR_COMPREH_REQUIRED: /* ignore message & send STATUS #96 */
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
281 /*
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
282 * This error will come when Comprehension bit required set is having error in
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
283 * IE.Comprehension bits can be set inside only CP-DATA message
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
284 * for RP-ERROR or RP-ACK
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
285 */
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
286 if(_decodedMsg[0] EQ D_CP_DATA)
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
287 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
288 /*
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
289 * Comprehension bit error is in RP_ERROR or RP_ACK after RP Cause element
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
290 */
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
291 rp_error_send = for_ccd_rp_error_send((T_D_CP_DATA *)_decodedMsg,
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
292 sms_data,
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
293 SMS_RP_CS_INV_MAND_INFO);
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
294 if(rp_error_send EQ FALSE)
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
295 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
296 cp_error_send = TRUE;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
297 cp_error_cause = SMS_CP_CS_INV_MAND_INFO;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
298 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
299 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
300 break;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
301
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
302 case ERR_MAND_ELEM_MISS: /* ignore message & send STATUS #96 */
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
303 /* See bit postions to check whether it is CP or RP Error */
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
304 /*
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
305 * Checking whether this error is in CP message element or RP
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
306 * message element. This is required to check because both CP and RP
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
307 * Layer decoding is done inside same CCD function
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
308 */
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
309 /* This is for CP Message decoding error - in Length*/
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
310 length = (buf_sdu->l_buf/8);
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
311 switch(buf_sdu->buf[1])
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
312 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
313 case D_CP_DATA:
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
314 /* Evaluate length of Mandatory CP-DATA/CP-ERROR message */
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
315 if(length < MIN_CP_LEN)
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
316 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
317 cp_error_send = TRUE;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
318 cp_error_cause = SMS_CP_CS_INV_MAND_INFO;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
319 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
320 else
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
321 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
322 cp_error_send = FALSE;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
323 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
324 break;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
325
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
326 case B_CP_ERROR:/* This will not have RP DATA, so no need to check for RP */
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
327 /* Evaluate length of Mandatory CP-DATA/CP-ERROR message */
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
328 if(length < MIN_CP_LEN)
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
329 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
330 cp_error_send = TRUE;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
331 cp_error_cause = SMS_CP_CS_INV_MAND_INFO;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
332 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
333 break;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
334
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
335 case B_CP_ACK:/* This will not have RP DATA, so no need to check for RP */
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
336 if(length < MIN_CP_ACK_LEN)
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
337 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
338 cp_error_send = TRUE;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
339 cp_error_cause = SMS_CP_CS_INV_MAND_INFO;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
340 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
341 break;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
342
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
343 default:
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
344 cp_error_send = TRUE;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
345 cp_error_cause = SMS_CP_CS_INV_MAND_INFO;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
346 break;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
347 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
348 break;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
349
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
350 case ERR_INVALID_MID: /* ignore message & send STATUS #97 */
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
351 /*
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
352 * Checking whether this error is in CP message element or RP
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
353 * message element. This is required to check because both CP and RP
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
354 * Layer decoding is done inside same CCD function
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
355 */
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
356 /* See bit postions to check whether it is CP or RP Error */
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
357 /* This is for CP Message decoding error - in Length*/
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
358 if ((buf_sdu->buf[1] NEQ D_CP_DATA)||(buf_sdu->buf[1] NEQ B_CP_ACK)
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
359 ||(buf_sdu->buf[1] NEQ B_CP_ERROR))
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
360 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
361 cp_error_send = TRUE;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
362 cp_error_cause = SMS_CP_CS_MSG_TYPE_NON_EXIST;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
363 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
364 else
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
365 /* Let RP Layer Handle This ccd error, eventually RP Layer will
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
366 * send RP-ERROR
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
367 */
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
368 /* This is for RP Message decoding error - in Length*/
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
369 cp_error_send = FALSE;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
370 break;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
371
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
372 case ERR_MSG_LEN: /* ignore message & send STATUS #96 */
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
373 /* Send CP-ERROR, some problem with Message Length, whole message is garbled */
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
374 cp_error_send = TRUE;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
375 cp_error_cause = SMS_CP_CS_INV_MAND_INFO;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
376 break;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
377
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
378 case ERR_LEN_MISMATCH: /* ignore message & send STATUS #96 */
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
379 /* Send CP-ERROR, some problem with Message Length, whole message is garbled */
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
380 cp_error_send = TRUE;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
381 cp_error_cause = SMS_CP_CS_INV_MAND_INFO;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
382 break;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
383 default:
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
384 TRACE_EVENT_P1 ("Unexpected warnings/errors = %u", ccd_err);
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
385 /*
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
386 *Default warnings pass it to RP Layer, decoding at TP will take care of it
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
387 */
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
388 cp_error_send = FALSE;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
389 break;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
390 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
391 /*lint +e415 Likely access of out-of-bounds pointer*/
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
392 ccd_err = ccd_getNextFault(&ccd_err_entry);
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
393 }while(ccd_err != ERR_NO_MORE_ERROR);
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
394
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
395 if(cp_error_send)
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
396 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
397 cp_build_cp_error (cp_error_cause);
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
398 /*
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
399 * Check if the cmms_mode is enabled or not
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
400 * If enabled dont release the MM connection
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
401 */
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
402
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
403 if(!CMMS_ACTIVE)
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
404 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
405 cp_send_release_req (ti);
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
406 SMS_INST_SET_STATE (STATE_CP, CP_IDLE);
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
407 SMS_INST.r_flag = FALSE;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
408 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
409 else
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
410 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
411 sms_data->cmms_release_pending = TRUE;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
412 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
413
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
414 rl_error_ind (CAUSE_MAKE(DEFBY_STD, ORIGSIDE_MS,
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
415 SMSCP_ORIGINATING_ENTITY, cp_error_cause));
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
416
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
417
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
418 FREE_SMS_INSTANCE (ti);
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
419 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
420 /* These flags return value will decide whether to pass to rp layer further */
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
421 return (!rp_error_send && !cp_error_send);
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
422 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
423
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
424
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
425 /*---- PRIMITIVES --------------------------------------------------*/
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
426
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
427 /*
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
428 +--------------------------------------------------------------------+
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
429 | PROJECT : GSM-PS (8410) MODULE : SMS_FOR |
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
430 | STATE : code ROUTINE : for_mmsms_establish_ind |
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
431 +--------------------------------------------------------------------+
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
432
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
433 PURPOSE : Processing the primitive MMSMS_ESTABLISH_IND
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
434
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
435 */
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
436
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
437 GLOBAL void for_mmsms_establish_ind (T_MMSMS_ESTABLISH_IND *mmsms_establish_ind)
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
438 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
439 UBYTE ti;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
440 UBYTE pd;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
441 CHAR *msg_type;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
442 BOOL pass_to_rp = TRUE;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
443
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
444
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
445 /* Enable the PCO to correctly decode the message */
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
446 PPASS (mmsms_establish_ind, establish_ind, MMSMS_ESTABLISH_IND);
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
447
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
448 TRACE_FUNCTION ("for_mmsms_establish_ind()");
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
449
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
450 if (for_get_pd_ti (&establish_ind->sdu, &pd, &ti))
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
451 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
452 if ((ti & 0x8) AND (pd EQ PD_SMS))
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
453 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
454 register T_SMS_DATA *sms_data = for_get_new_mt_instance (ti);
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
455
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
456 TRACE_EVENT_P1 ("TI %u", ti);
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
457
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
458 if (sms_data)
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
459 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
460 #if defined (GPRS)
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
461 SMS_INST.downlink = SMS_DOWNLINK_MMSMS;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
462 #endif
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
463
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
464 SMS_INST.cp_ack_pending = FALSE;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
465
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
466 CCD_START;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
467
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
468 if(ccd_decodeMsg (CCDENT_SMS,
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
469 DOWNLINK,
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
470 (T_MSGBUF *) &establish_ind->sdu,
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
471 (UBYTE *)_decodedMsg,
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
472 NOT_PRESENT_8BIT) EQ ccdError)
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
473 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
474 pass_to_rp = for_ccd_error_check(_decodedMsg,&establish_ind->sdu,sms_data,ti);
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
475 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
476
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
477 if(pass_to_rp)
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
478 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
479 switch (_decodedMsg[0])
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
480 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
481 case D_CP_DATA:
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
482 cp_est_ind_cp_data ((T_D_CP_DATA *)_decodedMsg);
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
483 msg_type = "D_CP_DATA";
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
484
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
485 SMS_EM_RECEIVE_CP_DATA;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
486
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
487 break;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
488
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
489 case B_CP_ERROR:
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
490 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
491 MCAST (error, B_CP_ERROR);
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
492
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
493 cp_est_ind_cp_error (error->cp_cause);
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
494 msg_type = "B_CP_ERROR";
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
495
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
496 SMS_EM_RECEIVE_CP_ERROR;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
497
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
498 break;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
499 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
500
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
501 case B_CP_ACK:
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
502 cp_est_ind_cp_ack ();
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
503 msg_type = "B_CP_ACK";
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
504 SMS_EM_RECEIVE_CP_ACKNOWLEDGE;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
505
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
506 break;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
507
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
508 default:
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
509 cp_est_ind_cp_unknown ();
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
510 msg_type = "UNKNOWN_MESSAGE";
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
511
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
512 SMS_EM_RECEIVE_UNKNOWN;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
513
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
514 break;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
515 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
516 TRACE_BINDUMP(sms_handle,
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
517 TC_USER4,
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
518 msg_type,
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
519 (&(establish_ind->sdu.buf[0]) + ((establish_ind->sdu.o_buf >> 3) -1)),
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
520 ((establish_ind->sdu.l_buf >> 3) + 1));
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
521 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
522 CCD_END;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
523 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
524 else
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
525 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
526 /*
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
527 * no further instance available
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
528 */
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
529 CCD_START;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
530
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
531 ccd_decodeMsg (CCDENT_SMS,
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
532 DOWNLINK,
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
533 (T_MSGBUF *) &establish_ind->sdu,
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
534 (UBYTE *) _decodedMsg,
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
535 NOT_PRESENT_8BIT);
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
536
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
537 switch (_decodedMsg[0])
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
538 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
539 case D_CP_DATA:
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
540 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
541 MCAST (d_cp_data, D_CP_DATA);
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
542 MCAST (cp_data, U_CP_DATA);
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
543 /*
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
544 * U_CP_DATA contains a maximum of 252 Bytes
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
545 */
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
546 PALLOC_SDU (data_req, MMSMS_DATA_REQ, LEN_U_CP_DATA);
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
547
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
548 data_req->sdu.o_buf = ENCODE_OFFSET;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
549
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
550 rl_build_rp_error (d_cp_data->cp_user_data_dl.reference,
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
551 SMS_RP_CS_PROTOCOL_ERROR,
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
552 cp_data, NULL);
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
553
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
554 cp_data->msg_type = U_CP_DATA;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
555
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
556 ccd_codeMsg (CCDENT_SMS,
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
557 UPLINK,
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
558 (T_MSGBUF *)&data_req->sdu,
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
559 (UBYTE *)cp_data,
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
560 NOT_PRESENT_8BIT);
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
561
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
562 cp_add_pd_ti (ti, &data_req->sdu);
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
563
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
564 TRACE_BINDUMP(sms_handle,
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
565 TC_USER4,
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
566 "U_CP_DATA",
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
567 (&(data_req->sdu.buf[0]) + ((data_req->sdu.o_buf >> 3) -1)),
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
568 ((data_req->sdu.l_buf >> 3) + 1));
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
569 PSENDX (MM, data_req);
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
570 break;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
571 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
572 default:
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
573 TRACE_EVENT_P1 ("Unexpected Message = %u", _decodedMsg[0]);
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
574 break;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
575 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
576 CCD_END;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
577 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
578 PALLOC (release_req, MMSMS_RELEASE_REQ);
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
579
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
580 release_req->ti = ti;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
581 PSENDX (MM, release_req);
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
582 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
583 SMS_EM_UNKNOWN_TRANSACTION;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
584 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
585 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
586 else
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
587 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
588 TRACE_EVENT_P2 ("TI or PD wrong, PD=%d, TI=%d", pd, ti);
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
589 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
590 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
591 PFREE (establish_ind);
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
592 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
593
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
594 /*
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
595 +--------------------------------------------------------------------+
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
596 | PROJECT : GSM-PS (8410) MODULE : SMS_FOR |
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
597 | STATE : code ROUTINE : for_mmsms_data_ind |
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
598 +--------------------------------------------------------------------+
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
599
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
600 PURPOSE : Processing the primitive MMSMS_DATA_IND
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
601
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
602 */
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
603
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
604 GLOBAL void for_mmsms_data_ind (T_MMSMS_DATA_IND *mmsms_data_ind)
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
605 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
606 UBYTE ti;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
607 UBYTE pd;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
608 CHAR *msg_type;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
609 BOOL pass_to_rp = TRUE;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
610
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
611
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
612 /* Enable the PCO to correctly decode the message */
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
613 PPASS (mmsms_data_ind, data_ind, MMSMS_DATA_IND);
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
614
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
615 if (for_get_pd_ti (&data_ind->sdu, &pd, &ti))
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
616 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
617 TRACE_FUNCTION_P1 ("for_mmsms_data_ind(TI=%u)", ti);
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
618
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
619 if (/*((! ti) OR (ti >= 8)) AND*/ (pd EQ PD_SMS))
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
620 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
621 register T_SMS_DATA *sms_data = GET_SMS_INSTANCE(ti);
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
622
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
623 if (sms_data)
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
624 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
625 CCD_START;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
626
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
627 if(ccd_decodeMsg (CCDENT_SMS,
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
628 DOWNLINK,
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
629 (T_MSGBUF *) &data_ind->sdu,
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
630 (UBYTE *)_decodedMsg,
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
631 NOT_PRESENT_8BIT) EQ ccdError)
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
632 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
633 pass_to_rp = for_ccd_error_check(_decodedMsg,&data_ind->sdu,sms_data,ti);
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
634 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
635
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
636 if(pass_to_rp)
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
637 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
638 switch (_decodedMsg[0])
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
639 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
640 case D_CP_DATA:
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
641 cp_data_ind_cp_data ((T_D_CP_DATA *)_decodedMsg);
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
642 msg_type = "D_CP_DATA";
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
643 break ;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
644
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
645 case B_CP_ERROR:
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
646 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
647 MCAST (error, B_CP_ERROR);
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
648
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
649 cp_data_ind_cp_error (error->cp_cause);
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
650 msg_type = "B_CP_ERROR";
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
651 break ;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
652 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
653
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
654 case B_CP_ACK:
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
655 cp_data_ind_cp_ack ();
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
656 msg_type = "B_CP_ACK";
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
657 break ;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
658 default:
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
659 cp_data_ind_cp_unknown ();
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
660 msg_type = "UNKNOWN MESSAGE";
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
661 break ;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
662 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
663 TRACE_BINDUMP(sms_handle,
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
664 TC_USER4,
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
665 msg_type,
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
666 (&(data_ind->sdu.buf[0]) + ((data_ind->sdu.o_buf >> 3) -1)),
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
667 ((data_ind->sdu.l_buf >> 3) + 1));
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
668 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
669 CCD_END;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
670 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
671 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
672 else
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
673 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
674 TRACE_EVENT_P1 ("PD wrong, PD=%d", pd);
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
675 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
676 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
677 else
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
678 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
679 TRACE_ERROR("for_mmsms_data_ind() error evaluating PD TI");
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
680 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
681 PFREE (data_ind) ;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
682 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
683
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
684 #if defined (GPRS)
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
685 /*
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
686 +--------------------------------------------------------------------+
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
687 | PROJECT : GSM-PS (8410) MODULE : SMS_CP |
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
688 | STATE : code ROUTINE : cp_ll_unitdata_ind |
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
689 +--------------------------------------------------------------------+
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
690
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
691 PURPOSE : Processing the signal LL_UNITDATA_IND (GSMS only).
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
692
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
693 */
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
694 GLOBAL void for_ll_unitdata_ind (T_LL_UNITDATA_IND *ll_unitdata_ind)
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
695 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
696
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
697 UBYTE ti;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
698 UBYTE pd;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
699 CHAR *msg_type;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
700
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
701 T_SMS_DATA *sms_global = GET_INSTANCE(0);
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
702
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
703 /* Enable the PCO to correctly decode the message */
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
704 PPASS (ll_unitdata_ind, unitdata_ind, LL_UNITDATA_IND);
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
705
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
706 TRACE_FUNCTION ("for_ll_unitdata_ind()");
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
707
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
708 if (!(unitdata_ind->sapi EQ LL_SAPI_7))
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
709 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
710 TRACE_EVENT ("SAPI not LL_SAPI_7");
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
711 PFREE (unitdata_ind);
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
712 return;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
713 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
714
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
715 if (sms_global) /*lint !e774 (sms_global) always */
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
716 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
717 if (SMS_SMS_FLOW(sms_global) NEQ SMS_FLOW_AVAILABLE)
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
718 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
719 TRACE_ERROR ("unexpected primitive");
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
720 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
721
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
722 /*
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
723 * data has been received, mark flow status as busy
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
724 */
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
725 SMS_SMS_FLOW(sms_global) = SMS_FLOW_BUSY;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
726 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
727
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
728 if (for_get_pd_ti (&unitdata_ind->sdu, &pd, &ti))
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
729 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
730 if (/*((! ti) OR (ti >= 8)) AND*/ (pd EQ PD_SMS))
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
731 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
732 register T_SMS_DATA *sms_data = GET_SMS_INSTANCE(ti);
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
733
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
734 if (sms_data)
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
735 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
736 CCD_START;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
737
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
738 ccd_decodeMsg (CCDENT_SMS,
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
739 DOWNLINK,
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
740 (T_MSGBUF *) &unitdata_ind->sdu,
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
741 (UBYTE *) _decodedMsg,
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
742 NOT_PRESENT_8BIT);
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
743
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
744 switch (_decodedMsg[0])
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
745 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
746 case D_CP_DATA:
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
747 cp_data_ind_cp_data ((T_D_CP_DATA *)_decodedMsg);
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
748 msg_type = "D_CP_DATA";
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
749 break ;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
750
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
751 case B_CP_ERROR:
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
752 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
753 MCAST (error, B_CP_ERROR);
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
754
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
755 cp_data_ind_cp_error (error->cp_cause);
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
756 msg_type = "B_CP_ERROR";
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
757 break ;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
758 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
759
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
760 case B_CP_ACK:
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
761 cp_data_ind_cp_ack ();
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
762 msg_type = "B_CP_ACK";
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
763 break ;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
764 default:
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
765 cp_data_ind_cp_unknown ();
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
766 msg_type = "UNKNOWN MESSAGE";
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
767 break ;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
768 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
769 CCD_END;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
770 TRACE_BINDUMP(sms_handle,
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
771 TC_USER4,
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
772 msg_type,
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
773 (&(unitdata_ind->sdu.buf[0]) + ((unitdata_ind->sdu.o_buf >> 3) -1)),
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
774 ((unitdata_ind->sdu.l_buf >> 3) + 1));
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
775 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
776 else
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
777 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
778 /*
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
779 * no SMS instance associated with pid, try to create new one
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
780 */
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
781 if (ti & 0x8)
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
782 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
783 register T_SMS_DATA *sms_data = for_get_new_mt_instance (ti);
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
784
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
785 if (sms_data)
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
786 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
787 CCD_START;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
788
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
789 ccd_decodeMsg (CCDENT_SMS,
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
790 DOWNLINK,
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
791 (T_MSGBUF *) &unitdata_ind->sdu,
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
792 (UBYTE *) _decodedMsg,
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
793 NOT_PRESENT_8BIT);
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
794
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
795 SMS_INST_SET_STATE (STATE_CP, CP_GSMS_IDLE);
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
796 SMS_INST.downlink = SMS_DOWNLINK_LL;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
797
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
798 switch (_decodedMsg[0])
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
799 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
800 case D_CP_DATA:
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
801 cp_data_ind_cp_data ((T_D_CP_DATA*) _decodedMsg);
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
802 msg_type = "D_CP_DATA";
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
803 break ;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
804
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
805 case B_CP_ERROR:
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
806 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
807 MCAST (error, B_CP_ERROR);
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
808
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
809 cp_data_ind_cp_error (error->cp_cause);
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
810 msg_type = "B_CP_ERROR";
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
811 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
812 break ;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
813
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
814 case B_CP_ACK:
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
815 cp_data_ind_cp_ack ();
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
816 msg_type = "B_CP_ACK";
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
817 break ;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
818
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
819 default:
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
820 cp_data_ind_cp_unknown ();
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
821 msg_type = "UNKNOWN MESSAGE";
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
822 break ;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
823 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
824 CCD_END;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
825 TRACE_BINDUMP(sms_handle,
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
826 TC_USER4,
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
827 msg_type,
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
828 (&(unitdata_ind->sdu.buf[0]) + ((unitdata_ind->sdu.o_buf >> 3) -1)),
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
829 ((unitdata_ind->sdu.l_buf >> 3) + 1));
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
830 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
831 else
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
832 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
833 /*
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
834 * no further instance available, send rp error message
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
835 */
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
836 register T_SMS_DATA* sms_data_main = GET_INSTANCE(0);
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
837 CCD_START;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
838
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
839 ccd_decodeMsg (CCDENT_SMS,
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
840 DOWNLINK,
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
841 (T_MSGBUF *) &unitdata_ind->sdu,
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
842 (UBYTE *) _decodedMsg,
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
843 NOT_PRESENT_8BIT);
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
844 if (sms_data_main) /*lint !e774 (sms_data_main) always */
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
845 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
846 if ((_decodedMsg[0] EQ D_CP_DATA) &&
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
847 (sms_data_main->llc_flow EQ SMS_LLC_AVAILABLE))
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
848 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
849 UBYTE msg_ref;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
850
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
851 MCAST (d_cp_data, D_CP_DATA);
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
852 MCAST (cp_data, U_CP_DATA);
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
853 /*
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
854 * U_CP_DATA contains a maximum of 252 Bytes
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
855 */
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
856 PALLOC_SDU (unitdata_req, LL_UNITDATA_REQ, LEN_U_CP_DATA);
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
857
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
858 cp_init_ll_unitdata_req (unitdata_req);
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
859 msg_ref = d_cp_data->cp_user_data_dl.reference;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
860
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
861 rl_build_rp_error_gprs (ti, unitdata_req, SMS_RP_CS_PROTOCOL_ERROR,
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
862 msg_ref, cp_data, NULL);
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
863 sms_data_main->llc_flow = SMS_LLC_BUSY;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
864 TRACE_BINDUMP(sms_handle,
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
865 TC_USER4,
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
866 "U_CP_DATA",
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
867 (&(unitdata_req->sdu.buf[0]) + ((unitdata_req->sdu.o_buf >> 3) -1)),
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
868 ((unitdata_req->sdu.l_buf >> 3) + 1));
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
869 PSENDX (LLC, unitdata_req);
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
870 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
871 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
872 CCD_END;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
873 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
874 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
875 else
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
876 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
877 TRACE_EVENT_P1 ("Unknown TI with response flag set, TI=%d", ti);
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
878 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
879 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
880 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
881 else
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
882 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
883 TRACE_EVENT_P1 ("PD wrong, PD=%d", pd);
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
884 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
885 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
886
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
887 PFREE (unitdata_ind);
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
888
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
889 /*
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
890 * Receive ready, if sending is not blocked
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
891 */
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
892 // if (SMS_LLC_FLOW(sms_global) NEQ SMS_LLC_BUSY_WAITING)
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
893 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
894 cp_send_getunitdata_req ();
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
895 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
896 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
897
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
898 /*
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
899 +--------------------------------------------------------------------+
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
900 | PROJECT : GSM-PS (8410) MODULE : SMS_CP |
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
901 | STATE : code ROUTINE : for_ll_unitready_ind |
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
902 +--------------------------------------------------------------------+
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
903
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
904 PURPOSE : Processing the signal LL_UNITREADY_IND (GSMS only).
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
905 */
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
906
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
907 GLOBAL void for_ll_unitready_ind (T_LL_UNITREADY_IND *unitready_ind)
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
908 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
909 GET_INSTANCE_DATA;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
910
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
911 TRACE_FUNCTION ("ll_unitready_ind()");
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
912
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
913 if ((unitready_ind->sapi NEQ LL_SAPI_7) || !sms_data) /*lint !e774 (!sms_data) never */
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
914 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
915 TRACE_EVENT ("ll_unitready_ind(): SAPI not LL_SAPI_7 or no SMS instance");
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
916 PFREE (unitready_ind);
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
917 return;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
918 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
919
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
920 if (SMS_LLC_FLOW(sms_data) EQ SMS_LLC_BUSY_WAITING)
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
921 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
922 /*
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
923 * find the message waiting for LLC
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
924 */
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
925 GET_MO_INSTANCE(sms_data);
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
926
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
927 if (SMS_INST_GET_STATE (STATE_CP) EQ CP_GSMS_IDLE)
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
928 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
929 switch (SMS_CP_ACK_TYPE(sms_data))
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
930 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
931 case SMS_CP_ACK:
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
932 cp_build_cp_ack ();
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
933 SMS_LLC_FLOW(sms_data) = SMS_LLC_BUSY;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
934
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
935 if (SMS_CP_UDL(sms_data) NEQ NULL)
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
936 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
937 rl_data_ind (SMS_CP_UDL(sms_data));
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
938 MFREE(SMS_CP_UDL(sms_data));
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
939 SMS_CP_UDL(sms_data) = NULL;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
940 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
941 if (SMS_INST.r_flag)
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
942 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
943 /*
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
944 * terminate SMS instance
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
945 */
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
946 SMS_INST_SET_STATE (STATE_CP, CP_IDLE);
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
947 SMS_INST.r_flag = FALSE;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
948 FREE_SMS_INSTANCE (SMS_INST.ti);
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
949 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
950 break;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
951
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
952 case SMS_CP_ERROR:
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
953 cp_build_cp_error (SMS_CP_CAUSE(sms_data));
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
954 SMS_LLC_FLOW(sms_data) = SMS_LLC_BUSY;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
955 /*
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
956 * terminate SMS instance
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
957 */
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
958 SMS_INST_SET_STATE (STATE_CP, CP_IDLE);
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
959 SMS_INST.r_flag = FALSE;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
960 FREE_SMS_INSTANCE (SMS_INST.ti);
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
961 break;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
962
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
963 default:
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
964 SMS_LLC_FLOW(sms_data) = SMS_LLC_AVAILABLE;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
965 break;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
966 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
967 SMS_CP_ACK_TYPE(sms_data) = SMS_CP_NONE;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
968 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
969 else
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
970 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
971 SMS_LLC_FLOW(sms_data) = SMS_LLC_AVAILABLE;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
972 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
973 if (SMS_LLC_FLOW(sms_data) EQ SMS_LLC_AVAILABLE)
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
974 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
975 GET_MT_INSTANCE(sms_data);
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
976
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
977 switch (SMS_INST_GET_STATE (STATE_CP))
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
978 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
979 case CP_GSMS_IDLE:
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
980 case CP_GSMS_MT_WAIT_FOR_RP_ACK:
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
981 case CP_GSMS_MT_WAIT_FOR_CP_ACK:
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
982 switch (SMS_CP_ACK_TYPE(sms_data))
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
983 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
984 case SMS_CP_ACK:
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
985 cp_build_cp_ack ();
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
986 if (SMS_INST_GET_STATE (STATE_CP) EQ CP_GSMS_MT_WAIT_FOR_CP_ACK)
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
987 { /* stored CP-DATA will follow */
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
988 SMS_LLC_FLOW(sms_data) = SMS_LLC_BUSY_WAITING;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
989 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
990 else
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
991 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
992 SMS_LLC_FLOW(sms_data) = SMS_LLC_BUSY;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
993 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
994 break;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
995
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
996 case SMS_CP_ERROR:
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
997 cp_build_cp_error (SMS_CP_CAUSE(sms_data));
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
998 SMS_LLC_FLOW(sms_data) = SMS_LLC_BUSY;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
999 /*
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1000 * terminate SMS instance
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1001 */
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1002 SMS_INST_SET_STATE (STATE_CP, CP_IDLE);
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1003 SMS_INST.r_flag = FALSE;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1004 FREE_SMS_INSTANCE (SMS_INST.ti);
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1005 break;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1006
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1007 default:
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1008 if (SMS_INST_GET_STATE (STATE_CP) EQ CP_GSMS_MT_WAIT_FOR_CP_ACK
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1009 AND SMS_DATA_REQ(sms_data) NEQ 0)
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1010 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1011 cp_send_data_gsms ();
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1012 SMS_LLC_FLOW(sms_data) = SMS_LLC_BUSY;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1013 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1014 break;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1015
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1016 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1017 SMS_CP_ACK_TYPE(sms_data) = SMS_CP_NONE;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1018 break;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1019
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1020 default:
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1021 break;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1022 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1023 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1024 if (SMS_LLC_FLOW(sms_data) EQ SMS_LLC_AVAILABLE)
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1025 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1026 GET_MO_INSTANCE(sms_data);
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1027
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1028 switch (SMS_INST_GET_STATE (STATE_CP))
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1029 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1030 case CP_GSMS_MO_WAIT_FOR_CP_ACK:
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1031 cp_send_data_gsms ();
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1032
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1033 SMS_LLC_FLOW(sms_data) = SMS_LLC_BUSY;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1034 break;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1035
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1036 case CP_GSMS_IDLE:
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1037 cp_send_data_gsms ();
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1038 rl_proceed ();
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1039
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1040 SMS_INST.r_flag = TRUE;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1041 SMS_INST_SET_STATE (STATE_CP, CP_GSMS_MO_WAIT_FOR_CP_ACK);
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1042 SMS_LLC_FLOW(sms_data) = SMS_LLC_BUSY;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1043 break;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1044
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1045 default:
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1046 break;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1047 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1048 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1049 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1050 else
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1051 {
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1052 SMS_LLC_FLOW(sms_data) = SMS_LLC_AVAILABLE;
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1053 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1054 PFREE (unitready_ind);
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1055
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1056 // cp_send_getunitdata_req (sms_data);
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1057 }
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1058
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1059 #endif /* GPRS */
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1060
2f7df7a314f8 gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1061 #endif /* #ifndef SMS_FOR_C */