FreeCalypso > hg > fc-magnetite
comparison src/g23m-aci/aci/psa_tcpipp.c @ 162:53929b40109c
src/g23m-aci: initial import from TCS3.2/LoCosto
| author | Mychaela Falconia <falcon@freecalypso.org> | 
|---|---|
| date | Tue, 11 Oct 2016 02:02:43 +0000 | 
| parents | |
| children | 
   comparison
  equal
  deleted
  inserted
  replaced
| 161:4557e2a9c18e | 162:53929b40109c | 
|---|---|
| 1 /* | |
| 2 +----------------------------------------------------------------------------- | |
| 3 | Project : GSM-PS (6147) | |
| 4 | Modul : PSA_TCPP | |
| 5 +----------------------------------------------------------------------------- | |
| 6 | Copyright 2002 Texas Instruments Berlin, AG | |
| 7 | All rights reserved. | |
| 8 | | |
| 9 | This file is confidential and a trade secret of Texas | |
| 10 | Instruments Berlin, AG | |
| 11 | The receipt of or possession of this file does not convey | |
| 12 | any rights to reproduce or disclose its contents or to | |
| 13 | manufacture, use, or sell anything it may describe, in | |
| 14 | whole, or in part, without the specific written consent of | |
| 15 | Texas Instruments Berlin, AG. | |
| 16 +----------------------------------------------------------------------------- | |
| 17 | Purpose : This module defines the processing functions for the | |
| 18 | primitives sent to the protocol stack adapter by the TCPIP | |
| 19 | module. | |
| 20 +----------------------------------------------------------------------------- | |
| 21 */ | |
| 22 | |
| 23 #ifndef PSA_TCPP_C | |
| 24 #define PSA_TCPP_C | |
| 25 #endif /* of PSA_TCPP_C */ | |
| 26 | |
| 27 #include "aci_all.h" | |
| 28 /*==== INCLUDES ===================================================*/ | |
| 29 #include "aci_cmh.h" | |
| 30 #include "ati_cmd.h" | |
| 31 #include "aci_cmd.h" | |
| 32 #include "dti.h" /* functionality of the dti library */ | |
| 33 #include "dti_conn_mng.h" | |
| 34 #include "dti_cntrl_mng.h" | |
| 35 | |
| 36 #include "aci_fd.h" | |
| 37 #include "aci.h" | |
| 38 #include "psa.h" | |
| 39 #include "psa_l2r.h" | |
| 40 #include "cmh.h" | |
| 41 #include "cmh_ra.h" | |
| 42 #include "cmh_l2r.h" | |
| 43 #include "psa_tcpip.h" | |
| 44 #include "psa_cc.h" | |
| 45 | |
| 46 #include "wap_aci.h" | |
| 47 #include "psa_sat.h" | |
| 48 | |
| 49 | |
| 50 #include "dcm_utils.h" | |
| 51 #include "dcm_state.h" | |
| 52 #include "dcm_env.h" | |
| 53 #include "dcm_f.h" | |
| 54 | |
| 55 | |
| 56 /*==== CONSTANTS ==================================================*/ | |
| 57 | |
| 58 /*==== TYPES ======================================================*/ | |
| 59 | |
| 60 /*==== EXPORT =====================================================*/ | |
| 61 | |
| 62 /*==== VARIABLES ==================================================*/ | |
| 63 | |
| 64 /*==== FUNCTIONS ==================================================*/ | |
| 65 | |
| 66 /* | |
| 67 +-------------------------------------------------------------------+ | |
| 68 | PROJECT : GSM-PS (6147) MODULE : PSA_TCP | | |
| 69 | ROUTINE : psa_tcpip_dti_cnf | | |
| 70 +-------------------------------------------------------------------+ | |
| 71 | |
| 72 PURPOSE : processes the TCPIP_DTI_CNF primitive sent by TCPIP. | |
| 73 */ | |
| 74 GLOBAL void psa_tcpip_dti_cnf(T_TCPIP_DTI_CNF *tcpip_dti_cnf) | |
| 75 { | |
| 76 TRACE_FUNCTION ("psa_tcpip_dti_cnf()"); | |
| 77 | |
| 78 switch( tcpip_dti_cnf->dti_conn ) | |
| 79 { | |
| 80 case(TCPIP_CONNECT_DTI): | |
| 81 dti_cntrl_entity_connected( tcpip_dti_cnf->link_id, DTI_ENTITY_TCPIP, DTI_OK ); | |
| 82 break; | |
| 83 | |
| 84 case(TCPIP_DISCONNECT_DTI): | |
| 85 dti_cntrl_entity_disconnected( tcpip_dti_cnf->link_id, DTI_ENTITY_TCPIP ); | |
| 86 break; | |
| 87 } | |
| 88 PFREE(tcpip_dti_cnf); | |
| 89 } | |
| 90 | |
| 91 | |
| 92 /* | |
| 93 +-------------------------------------------------------------------+ | |
| 94 | PROJECT : GSM-PS (6147) MODULE : PSA_TCP | | |
| 95 | ROUTINE : psa_tcpip_ifconfig_cnf | | |
| 96 +-------------------------------------------------------------------+ | |
| 97 | |
| 98 PURPOSE : processes the TCPIP_CONFIG_CNF primitive sent by TCPIP. | |
| 99 | |
| 100 */ | |
| 101 GLOBAL void psa_tcpip_ifconfig_cnf(T_TCPIP_IFCONFIG_CNF *tcpip_ifconfig_cnf) | |
| 102 { | |
| 103 TRACE_FUNCTION ("psa_tcpip_ifconfig_cnf()"); | |
| 104 | |
| 105 if(tcpip_ifconfig_cnf->result == TCPIP_RESULT_OK) | |
| 106 { | |
| 107 if (wap_state EQ TCPIP_Configuration) | |
| 108 { | |
| 109 wap_state = TCPIP_Configurated; | |
| 110 cmhTCPIP_Configurated(); | |
| 111 } | |
| 112 else if (wap_state EQ TCPIP_Deconfiguration) | |
| 113 { | |
| 114 wap_state = TCPIP_Deconfigurated; | |
| 115 /* For TCPIP call also we need to shutdown the TCP before clearing the | |
| 116 DTI connection */ | |
| 117 if( (tcpipShrdPrm.connection_type EQ TCPIP_CONNECTION_TYPE_CSD_WAP) OR | |
| 118 ((is_gpf_tcpip_call()) AND | |
| 119 (tcpipShrdPrm.connection_type EQ TCPIP_CONNECTION_TYPE_GPRS_WAP))) | |
| 120 | |
| 121 { | |
| 122 wap_state = TCPIP_Deactivation; | |
| 123 psaTCPIP_config_dispatch(); | |
| 124 } | |
| 125 else | |
| 126 cmhTCPIP_Deconfigurated(); | |
| 127 } | |
| 128 } | |
| 129 else | |
| 130 { | |
| 131 TRACE_EVENT("unexpected TCPIP_IFCONFIG_CNF primitive received"); | |
| 132 } | |
| 133 | |
| 134 PFREE(tcpip_ifconfig_cnf); | |
| 135 } | |
| 136 | |
| 137 | |
| 138 | |
| 139 GLOBAL void psa_tcpip_shutdown_cnf(T_TCPIP_SHUTDOWN_CNF *tcpip_shutdown_cnf) | |
| 140 { | |
| 141 TRACE_FUNCTION ("psa_tcpip_shutdown_cnf()"); | |
| 142 | |
| 143 if(tcpip_shutdown_cnf->result != TCPIP_RESULT_OK) | |
| 144 { | |
| 145 T_DCM_STATUS_IND_MSG msg; | |
| 146 msg.hdr.msg_id = DCM_NEXT_CMD_STOP_MSG; | |
| 147 dcm_send_message(msg, DCM_SUB_WAIT_CGDEACT_CNF); | |
| 148 | |
| 149 msg.hdr.msg_id = DCM_NEXT_CMD_STOP_MSG; | |
| 150 dcm_send_message(msg, DCM_SUB_WAIT_SATH_CNF); | |
| 151 } | |
| 152 else | |
| 153 { | |
| 154 wap_state = TCPIP_Deactivated; | |
| 155 psaTCPIP_config_dispatch(); | |
| 156 } | |
| 157 reset_gpf_tcpip_call(); | |
| 158 PFREE(tcpip_shutdown_cnf); | |
| 159 } | |
| 160 | |
| 161 | |
| 162 | |
| 163 GLOBAL void psa_tcpip_initialize_cnf(T_TCPIP_INITIALIZE_CNF *tcpip_initialize_cnf) | |
| 164 { | |
| 165 TRACE_FUNCTION ("psa_tcpip_initialize_cnf()"); | |
| 166 | |
| 167 if(tcpip_initialize_cnf->result != TCPIP_RESULT_OK) | |
| 168 { | |
| 169 T_DCM_STATUS_IND_MSG msg; | |
| 170 msg.hdr.msg_id = DCM_NEXT_CMD_STOP_MSG; | |
| 171 dcm_send_message(msg, DCM_SUB_WAIT_CGACT_CNF); | |
| 172 | |
| 173 msg.hdr.msg_id = DCM_NEXT_CMD_STOP_MSG; | |
| 174 dcm_send_message(msg, DCM_SUB_WAIT_SATDN_CNF); | |
| 175 } | |
| 176 else | |
| 177 { | |
| 178 wap_state = TCPIP_Activation; | |
| 179 psaTCPIP_config_dispatch(); | |
| 180 } | |
| 181 PFREE(tcpip_initialize_cnf); | |
| 182 } | 
