comparison src/g23m-fad/tcpip/rnet/rnet_env.c @ 1:fa8dc04885d8

src/g23m-*: import from Magnetite
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 16 Oct 2020 06:25:50 +0000
parents
children
comparison
equal deleted inserted replaced
0:4e78acac3d88 1:fa8dc04885d8
1 /**
2 * @file rnet_env.c
3 *
4 * Riviera NET.
5 *
6 * Coding of the Riviera Generic Functions,
7 *
8 * @author Vincent Oberle (v-oberle@ti.com)
9 * @version 0.1
10 */
11
12 /*
13 * History:
14 *
15 * Date Author Modification
16 * -------------------------------------------------------------------
17 * 01/29/2002 Vincent Oberle Create
18 * 03/15/2002 Vincent Oberle Passed in type 1
19 *
20 * (C) Copyright 2002 by Texas Instruments Incorporated, All Rights Reserved
21 */
22
23 #include "rnet_env.h"
24
25 #include "rvm_use_id_list.h"
26
27 #include <string.h>
28
29 #include "rnet_cfg.h"
30 #include "rnet_trace_i.h"
31
32 /**
33 * Called by RVM to learn RNET requirements in terms of memory, SWEs...
34 *
35 * @param swe_info Pointer to the structure to fill
36 * containing infos related to the rnet SWE.
37 * @return RVM_OK
38 */
39 T_RVM_RETURN rnet_get_info(T_RVM_INFO_SWE * swe_info)
40 {
41 swe_info->swe_type = RVM_SWE_TYPE_1;
42
43 memcpy(swe_info->type_info.type1.swe_name, "RNET", sizeof("RNET"));
44 swe_info->type_info.type1.swe_use_id = RNET_USE_ID;
45
46 swe_info->type_info.type1.version = BUILD_VERSION_NUMBER(0,1,0);
47
48 /* Memory bank info */
49 swe_info->type_info.type1.nb_mem_bank = 1;
50 memcpy(swe_info->type_info.type1.mem_bank[0].bank_name, "RNET_PRIM", sizeof("RNET_PRIM"));
51 swe_info->type_info.type1.mem_bank[0].initial_params.size = RNET_MB_PRIM_SIZE;
52 swe_info->type_info.type1.mem_bank[0].initial_params.watermark = RNET_MB_PRIM_WATERMARK;
53
54 /* No linked SWE. */
55 swe_info->type_info.type1.nb_linked_swe = 0;
56
57 #ifdef _WINDOWS
58 #ifdef RNET_CFG_WINSOCK
59 swe_info->type_info.type1.linked_swe_id[0] = RNET_WS_USE_ID;
60 swe_info->type_info.type1.nb_linked_swe = 1;
61 #elif defined RNET_CFG_REAL_TRANSPORT
62 swe_info->type_info.type1.linked_swe_id[0] = RNET_RT_USE_ID;
63 swe_info->type_info.type1.linked_swe_id[1] = DCM_USE_ID;
64 swe_info->type_info.type1.nb_linked_swe = 2;
65 #endif
66 #else
67 #if defined RNET_CFG_BRIDGE
68 swe_info->type_info.type1.linked_swe_id[0] = RNET_BR_USE_ID;
69 swe_info->type_info.type1.nb_linked_swe = 1;
70 #elif defined RNET_CFG_REAL_TRANSPORT
71 swe_info->type_info.type1.linked_swe_id[0] = RNET_RT_USE_ID;
72 swe_info->type_info.type1.linked_swe_id[1] = DCM_USE_ID;
73 swe_info->type_info.type1.nb_linked_swe = 2;
74 #endif
75 #endif
76
77 /* Set the return path: NOT USED. */
78 swe_info->type_info.type1.return_path.callback_func = NULL;
79 swe_info->type_info.type1.return_path.addr_id = 0;
80
81 /* Generic functions */
82 swe_info->type_info.type1.set_info = rnet_set_info;
83 swe_info->type_info.type1.init = rnet_init;
84 swe_info->type_info.type1.start = rnet_start;
85 swe_info->type_info.type1.stop = rnet_stop;
86 swe_info->type_info.type1.kill = rnet_kill;
87
88 return RVM_OK;
89 }
90
91 /**
92 * Called by the RV manager to inform the RNET SWE about
93 * addr_id, return path, mb_id and error function.
94 *
95 * It is called only once.
96 *
97 * @param addr_id Address ID of the RNET SWE.
98 * Used to send messages to the SWE.
99 * @param return_path Return path array of the linked SWEs.
100 * @param bk_id_table Array of memory bank ids allocated to the SWE.
101 * @param call_back_error_ft Callback function to call in case of unrecoverable error.
102 * @return RVM_MEMORY_ERR ou RVM_OK.
103 */
104 T_RVM_RETURN rnet_set_info (T_RVF_ADDR_ID addr_id,
105 T_RV_RETURN_PATH return_path[],
106 T_RVF_MB_ID bk_id_table[],
107 T_RVM_CB_FUNC call_back_error_ft)
108 {
109 return RVM_OK;
110 }
111
112 /**
113 * Called by the RV manager to initialize the
114 * RNET SWE before creating the task and calling rnet_start.
115 *
116 * @return RVM_OK
117 */
118 T_RVM_RETURN rnet_init (void)
119 {
120 return RVM_OK;
121 }
122
123 /**
124 * Called by the RV manager to start the RNET SWE,
125 *
126 * @return RVM_OK.
127 */
128 T_RVM_RETURN rnet_start(void)
129 {
130 return RVM_OK;
131 }
132
133 /**
134 * Called by the RV manager to stop the RNET SWE.
135 *
136 * @return RVM_OK
137 */
138 T_RVM_RETURN rnet_stop (void)
139 {
140 return RVM_OK;
141 }
142
143 /**
144 * Called by the RV manager to kill the rnet SWE,
145 * after the rnet_stop function has been called.
146 *
147 * @return RVM_OK
148 */
149 T_RVM_RETURN rnet_kill (void)
150 {
151 return RVM_OK;
152 }
153