FreeCalypso > hg > freecalypso-sw
annotate nuc-fw/riviera/rvt/rvt_api.c @ 119:dd56546ad9e0
starting to compile RVF
| author | Michael Spacefalcon <msokolov@ivan.Harhan.ORG> | 
|---|---|
| date | Wed, 30 Oct 2013 23:19:21 +0000 | 
| parents | 21de8d8e6ea7 | 
| children | 28f967578233 | 
| rev | line source | 
|---|---|
| 118 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 1 /************************************************************************** | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 2 * | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 3 * rvt_api.c | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 4 * | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 5 * This module defines the interface of Trace Module | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 6 * | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 7 * (C) Texas Instruments, all rights reserved | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 8 * | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 9 * Version number : 0.1 | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 10 * | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 11 * History : 0.1 (7/5/2000) - Created | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 12 * | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 13 * Date : 7/5/2000 | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 14 * | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 15 * Author : Guido Pagana g-pagana@ti.com * | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 16 ***************************************************************************/ | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 17 | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 18 | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 19 | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 20 #include "rv/general.h" | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 21 #include "rv/rv_general.h" | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 22 #include "rvf/rvf_api.h" | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 23 #include "rvm/rvm_use_id_list.h" | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 24 | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 25 #include "rvt/rvt_gen.h" | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 26 #include "rvt/rvt_def_i.h" | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 27 #include "rvt/rvt_env.h" | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 28 #include "rvt/rvt_env_i.h" | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 29 | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 30 #include <string.h> | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 31 | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 32 | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 33 /* | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 34 ** Trace User data base global variable | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 35 */ | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 36 T_RVT_USER_DB rvt_user_db [] = RVT_USER_ID_MAPPING; | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 37 | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 38 /* | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 39 ** Number of messages lost | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 40 */ | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 41 T_RVT_LOST_MSG rvt_lost_msg_cpt = {0}; | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 42 | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 43 extern UINT8 rvf_trace_level; | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 44 | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 45 extern UINT32 rvf_layer_mask; | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 46 | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 47 | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 48 /********************************************************************************/ | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 49 /* */ | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 50 /* Function Name: rvt_set_trace_level */ | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 51 /* */ | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 52 /* Purpose: Updating the level of filtering, as well as the 32-bit */ | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 53 /* mask related to the software entities to be monitored, */ | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 54 /* according to the PC. */ | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 55 /* */ | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 56 /* Note: None. */ | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 57 /* */ | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 58 /********************************************************************************/ | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 59 void rvt_set_trace_level (T_RVT_BUFFER p_msg, UINT16 msg_length) | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 60 { | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 61 | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 62 /* Checking for an invalid PDU. */ | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 63 if ((p_msg == NULL) || \ | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 64 (msg_length != (sizeof (UINT8) + sizeof (UINT32)))) | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 65 { | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 66 return; | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 67 } | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 68 | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 69 /* Update the level of filtering. */ | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 70 if (*p_msg <= RV_TRACE_LEVEL_DEBUG_LOW) | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 71 { | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 72 rvf_trace_level = *p_msg; | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 73 } | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 74 | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 75 /* Update the 32-bit mask related to the software entities to be monitored. | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 76 Note that the 32-bit mask is transmitted LSB first. */ | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 77 rvf_layer_mask = *(++p_msg); | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 78 rvf_layer_mask |= *(++p_msg) << 8; | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 79 rvf_layer_mask |= *(++p_msg) << 16; | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 80 rvf_layer_mask |= *(++p_msg) << 24; | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 81 } | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 82 | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 83 | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 84 /********************************************************************************/ | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 85 /* */ | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 86 /* Function Name: rvt_send_trace_no_copy */ | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 87 /* */ | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 88 /* Purpose: This function is used send trace messages without */ | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 89 /* copying. */ | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 90 /* */ | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 91 /* Note: */ | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 92 /* WARNING!!!! The buffer containing the message has been allocated */ | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 93 /* by the trace module!!! */ | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 94 /* */ | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 95 /********************************************************************************/ | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 96 | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 97 T_RVT_RET | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 98 rvt_send_trace_no_cpy( T_RVT_BUFFER msg, | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 99 T_RVT_USER_ID user_id, | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 100 T_RVT_MSG_LG msg_length, | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 101 T_RVT_FORMAT msg_format) | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 102 { | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 103 /* Shift the pointer back to write control values */ | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 104 T_RVT_TRACE_RQST * req_msg = (T_RVT_TRACE_RQST * )((UINT8*)msg - RVT_HEADER_SIZE); | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 105 | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 106 /* Check is Trace Module is running */ | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 107 if (rvt_module_state != RVT_STARTED) | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 108 { | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 109 (rvt_lost_msg_cpt.bit_mask).count++; | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 110 (rvt_lost_msg_cpt.bit_mask).not_started = 1; | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 111 return RVT_NOT_READY; | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 112 } | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 113 | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 114 | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 115 /* Add the id, size and format of the msg at the beginning */ | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 116 | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 117 req_msg->header.msg_id = RVT_TRACE_RQST_ID; | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 118 req_msg->format = msg_format; | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 119 req_msg->user_id = user_id; | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 120 req_msg->msg_length = msg_length; | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 121 | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 122 if (rvf_send_msg(rvt_addr_id, (void *) req_msg) != RVF_OK) | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 123 { | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 124 (rvt_lost_msg_cpt.bit_mask).count++; | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 125 (rvt_lost_msg_cpt.bit_mask).message_not_sent = 1; | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 126 return RVT_INTERNAL_ERR; | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 127 } | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 128 return RVT_OK; | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 129 } | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 130 | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 131 | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 132 /********************************************************************************/ | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 133 /* */ | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 134 /* Function Name: send trace copy */ | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 135 /* */ | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 136 /* Purpose: this function sends traces with copy */ | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 137 /* */ | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 138 /* Note: */ | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 139 /* No check on id parameter !!!! Must be done in PC. */ | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 140 /* */ | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 141 /********************************************************************************/ | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 142 T_RVT_RET rvt_send_trace_cpy (T_RVT_BUFFER msg, | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 143 T_RVT_USER_ID user_id, | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 144 T_RVT_MSG_LG msg_length, | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 145 T_RVT_FORMAT msg_format) | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 146 | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 147 | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 148 | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 149 { | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 150 T_RVT_TRACE_RQST * req ; | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 151 | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 152 /* Check is Trace Module is running */ | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 153 if (rvt_module_state != RVT_STARTED) | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 154 { | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 155 (rvt_lost_msg_cpt.bit_mask).count++; | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 156 (rvt_lost_msg_cpt.bit_mask).not_started = 1; | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 157 return RVT_NOT_READY; | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 158 } | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 159 | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 160 /* Allocate memory (msg_length + necessary room for the header) */ | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 161 if ((rvf_get_buf (rvt_mb_id, (UINT32) msg_length + RVT_HEADER_SIZE, (T_RVF_BUFFER**) &req)) == RVF_RED) | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 162 { | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 163 (rvt_lost_msg_cpt.bit_mask).count++; | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 164 (rvt_lost_msg_cpt.bit_mask).insufficient_resources = 1; | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 165 return RVT_MEMORY_ERR; | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 166 } | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 167 | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 168 /* Add the id, size and format of the msg at the beginning */ | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 169 req->header.msg_id = RVT_TRACE_RQST_ID; | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 170 req->format = msg_format; | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 171 req->user_id = user_id; | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 172 req->msg_length = msg_length; | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 173 | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 174 /* Copy the message */ | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 175 memcpy( (UINT8*)req + RVT_HEADER_SIZE, msg, msg_length); | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 176 | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 177 /* | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 178 ** Send it as a message to Trace Task | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 179 */ | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 180 if (rvf_send_msg(rvt_addr_id, (void *) req) != RVF_OK) | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 181 { | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 182 (rvt_lost_msg_cpt.bit_mask).count++; | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 183 (rvt_lost_msg_cpt.bit_mask).message_not_sent = 1; | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 184 rvf_free_buf (req); | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 185 return RVT_INTERNAL_ERR; | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 186 } | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 187 return RVT_OK; | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 188 } | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 189 | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 190 | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 191 | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 192 /********************************************************************************/ | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 193 /* */ | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 194 /* Function Name: rvt_register_id */ | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 195 /* */ | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 196 /* Purpose: function rvt_register id */ | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 197 /* returns 0 if string not found, else the number */ | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 198 /* stocked in the array */ | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 199 /* */ | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 200 /* Note: */ | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 201 /* uses two arrays, one that stockes the messages,and another for the */ | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 202 /* correspondent values. */ | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 203 /* */ | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 204 /********************************************************************************/ | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 205 | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 206 T_RVT_RET rvt_register_id(T_RVT_NAME name[], T_RVT_USER_ID *rvt_id, RVT_CALLBACK_FUNC callback) | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 207 { | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 208 UINT8 i; | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 209 | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 210 /*looks in the array if the message is stocked */ | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 211 for (i=0;rvt_user_db[i].user_id!=RVT_INVALID_HEADER;i++) | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 212 { | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 213 if (rvt_name_cmp(rvt_user_db[i].user_name,name)) | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 214 { | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 215 *rvt_id = rvt_user_db[i].user_id; | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 216 rvt_user_db[i].rx_callback_func = callback; | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 217 return(RVT_OK); | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 218 } | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 219 } | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 220 | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 221 /*else returns zero */ | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 222 return (RVT_INVALID_PARAMETER); | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 223 | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 224 } | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 225 | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 226 | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 227 | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 228 | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 229 /********************************************************************************/ | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 230 /* */ | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 231 /* Function Name: rvt_mem_alloc */ | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 232 /* */ | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 233 /* Purpose: this function allocates a buffer for tracing. */ | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 234 /* */ | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 235 /* Note: */ | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 236 /* None. */ | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 237 /* */ | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 238 /********************************************************************************/ | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 239 T_RVT_RET rvt_mem_alloc(T_RVT_USER_ID user_id, T_RVT_MSG_LG buffer_length, T_RVT_BUFFER * buff) | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 240 { | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 241 if (rvt_module_state != RVT_STARTED) | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 242 { | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 243 *buff = NULL; | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 244 (rvt_lost_msg_cpt.bit_mask).count++; | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 245 (rvt_lost_msg_cpt.bit_mask).not_started = 1; | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 246 return RVT_NOT_READY; | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 247 } | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 248 | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 249 if (rvf_get_buf (rvt_mb_id, (UINT32) buffer_length + RVT_HEADER_SIZE, (T_RVF_BUFFER**) buff) == RVF_RED) | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 250 { | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 251 *buff = NULL; | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 252 (rvt_lost_msg_cpt.bit_mask).count++; | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 253 (rvt_lost_msg_cpt.bit_mask).insufficient_resources = 1; | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 254 return RVT_MEMORY_ERR; | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 255 } | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 256 *buff = *buff + RVT_HEADER_SIZE; | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 257 return RVT_OK; | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 258 } | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 259 | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 260 | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 261 /********************************************************************************/ | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 262 /* */ | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 263 /* Function Name: rvt_mem_free */ | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 264 /* */ | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 265 /* Purpose: this function frees an allocated buffer for the trace task */ | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 266 /* */ | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 267 /* Note: */ | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 268 /* None. */ | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 269 /* */ | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 270 /********************************************************************************/ | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 271 T_RVT_RET rvt_mem_free(T_RVT_BUFFER msg) | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 272 { | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 273 | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 274 /* | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 275 ** Shift the pointer back to write control values | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 276 */ | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 277 char *buff = (char*) msg - RVT_HEADER_SIZE; | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 278 | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 279 // Deallocates the buffer | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 280 if (rvf_free_buf((T_RVF_BUFFER*) buff) == RVF_MEMORY_ERR) | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 281 { | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 282 return RVT_MEMORY_ERR; | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 283 } | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 284 return RVT_OK; | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 285 } | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 286 | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 287 | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 288 /* | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 289 ** User function used to compare name | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 290 */ | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 291 BOOLEAN rvt_name_cmp( char * str1, char * str2) | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 292 { | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 293 UINT8 i; | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 294 | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 295 for ( i = 0; (str1[i] == str2[i]) && (str1[i] != 0) && (str2[i] != 0) && (i < RVT_NAME_MAX_LEN); i++ ); | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 296 if ( i == RVT_NAME_MAX_LEN) | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 297 { return TRUE; | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 298 } | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 299 if ( (str1[i] == 0) && (str2[i] == 0) ) | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 300 { return TRUE; | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 301 } | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 302 return FALSE; | 
| 
21de8d8e6ea7
checking in Riviera code from the Sotomodem version
 Michael Spacefalcon <msokolov@ivan.Harhan.ORG> parents: diff
changeset | 303 } | 
