versadac  1
versadac - Scalable Recorder Firmware
rmpm.h
1 /*---------------------------------------------------------------------------*/
2 /* Copyright (C) 2006 Woodhead Software & Electonics. All rights reserved. */
3 /*---------------------------------------------------------------------------*/
4 /* This program is protected by international copyright. */
5 /* */
6 /* The use of this software including but not limited to its Source Code */
7 /* is subject to restrictions as agreed in the license agreement between */
8 /* you and Woodhead. */
9 /* Copying or distribution is not allowed unless expressly permitted */
10 /* according to your license agreement with Woodhead. */
11 /*---------------------------------------------------------------------------*/
12 /* */
13 /* Project : STACK PROFINET Controller */
14 /* Component : Acyclique Services */
15 /* $Workfile:: rmpm.h $*/
16 /* $Revision:: 7 $*/
17 /* $Date:: 13/07/11 13:57 $*/
18 /* */
19 /*---------------------------------------------------------------------------*/
20 /* */
21 /* D e s c r i p t i o n : */
22 /* main thread for managment of all acyclique state machine */
23 /* */
24 /*---------------------------------------------------------------------------*/
25 
26 #ifndef _RMPM_H
27 #define _RMPM_H
28 
29 /* fonction */
30 APP_DWORD APP_FAR rm_init_req (LPST_MSG* ppMsg);
31 APP_DWORD APP_FAR dcpmcr_activate_cnf_pos(LPST_MSG* ppMsg);
32 APP_DWORD APP_FAR dcpmcr_activate_cnf_neg(LPST_MSG* ppMsg);
33 APP_DWORD APP_FAR dcpucr_activate_cnf_pos(LPST_MSG* ppMsg);
34 APP_DWORD APP_FAR dcpucr_activate_cnf_neg(LPST_MSG* ppMsg);
35 APP_DWORD APP_FAR rm_setup_ind (LPST_MSG* ppMsg);
36 APP_DWORD APP_FAR dcpmcr_identify_ind (LPST_MSG* ppMsg);
37 APP_DWORD APP_FAR dcpucr_get_ind (LPST_MSG* ppMsg);
38 APP_DWORD APP_FAR dcpucr_set_ind (LPST_MSG* ppMsg);
39 
40 
41 APP_DWORD APP_FAR rpc_dcontrol_ind(LPST_MSG* ppMsg);
42 APP_DWORD APP_FAR rpc_connect_ind(LPST_MSG* ppMsg);
43 APP_DWORD APP_FAR rpc_write_ind(LPST_MSG* ppMsg);
44 APP_DWORD APP_FAR rpc_read_ind(LPST_MSG* ppMsg);
45 APP_DWORD APP_FAR rpc_release_ind(LPST_MSG* ppMsg);
46 APP_DWORD APP_FAR rm_abort_req(LPST_MSG* ppMsg);
47 APP_DWORD APP_FAR rpc_cancel_req(LPST_AREP lpArep, LPST_RPC_CALL pArgs, LPST_MSG* ppMsg);
48 
49 
50 APP_DWORD APP_FAR dcpucr_close_cnf_neg(LPST_MSG* ppMsg);
51 APP_DWORD APP_FAR dcpucr_close_cnf_pos(LPST_MSG* ppMsg);
52 APP_DWORD APP_FAR dcpmcr_close_cnf_neg(LPST_MSG* ppMsg);
53 APP_DWORD APP_FAR dcpmcr_close_cnf_pos(LPST_MSG* ppMsg);
54 APP_DWORD APP_FAR rm_release_rsp_neg(LPST_MSG* ppMsg);
55 APP_DWORD APP_FAR rm_release_rsp_pos(LPST_MSG* ppMsg);
56 APP_DWORD APP_FAR rm_connect_rsp_neg(LPST_MSG* ppMsg);
57 APP_DWORD APP_FAR rm_connect_rsp_pos(LPST_MSG* ppMsg);
58 APP_DWORD APP_FAR rm_read_rsp_neg(LPST_MSG* ppMsg);
59 APP_DWORD APP_FAR rm_read_rsp_pos(LPST_MSG* ppMsg);
60 APP_DWORD APP_FAR rm_write_rsp_neg(LPST_MSG* ppMsg);
61 APP_DWORD APP_FAR rm_write_rsp_pos(LPST_MSG* ppMsg);
62 APP_DWORD APP_FAR rm_dcontrol_rsp_neg(LPST_MSG* ppMsg);
63 APP_DWORD APP_FAR rm_dcontrol_rsp_pos(LPST_MSG* ppMsg);
64 APP_DWORD APP_FAR rpc_ccontrol_cnf_neg(LPST_MSG* ppMsg);
65 APP_DWORD APP_FAR rpc_ccontrol_cnf_pos(LPST_MSG* ppMsg);
66 APP_DWORD APP_FAR rm_ccontrol_req(LPST_MSG* ppMsg);
67 
68 APP_DWORD APP_FAR rpc_cancel_cnf(LPST_MSG APP_FAR * ppMsg);
69 APP_DWORD APP_FAR rpc_lookup_req(LPST_MSG APP_FAR * ppMsg);
70 APP_DWORD APP_FAR rpc_lookup_free_req(LPST_MSG APP_FAR * ppMsg);
71 
72 APP_DWORD APP_FAR rm_dcp_set_name_rsp_pos(LPST_MSG* ppMsg);
73 APP_DWORD APP_FAR rm_dcp_set_name_rsp_neg(LPST_MSG* ppMsg);
74 APP_DWORD APP_FAR rm_dcp_set_ip_rsp_pos(LPST_MSG* ppMsg);
75 APP_DWORD APP_FAR rm_dcp_set_ip_rsp_neg(LPST_MSG* ppMsg);
76 APP_DWORD APP_FAR rm_dcp_set_blink_rsp_pos(LPST_MSG* ppMsg);
77 APP_DWORD APP_FAR rm_dcp_set_reset_factory_rsp_pos(LPST_MSG* ppMsg);
78 APP_DWORD APP_FAR rm_dcp_set_reset_factory_rsp_neg(LPST_MSG* ppMsg);
79 APP_DWORD APP_FAR rm_hello_timer_expired(LPST_MSG* ppMsg);
80 APP_DWORD APP_FAR ase_dcp_hello_req(LPST_MSG* ppMsg);
81 
82 #ifdef DHCP_ACTIVATE
83 APP_DWORD APP_FAR rm_dcp_set_dhcp_rsp_pos(LPST_MSG* ppMsg);
84 APP_DWORD APP_FAR rm_dcp_set_dhcp_rsp_neg(LPST_MSG* ppMsg);
85 #endif /* DHCP_ACTIVATE */
86 
87 APP_DWORD APP_FAR rpc_read_impl_ind(LPST_MSG* ppMsg);
88 
89 APP_VOID rmpm_register_rpc_itf(LPST_DREP lpstdrep, APP_DWORD dwIpAddr, APP_DWORD dwOldIP);
90 APP_VOID rmpm_register_rpc_lookup(LPST_DREP lpstdrep, APP_DWORD dwIpAddr, APP_DWORD dwOldIP);
91 
92 APP_DWORD dcp_sending_frame (LPST_DREP lpstDrep, LPST_MSG* ppMsg);
93 APP_VOID rpc_response_neg (LPST_AREP lpArep,LPST_RPC_REQ lpstRPCReq,LPST_MSG* ppMsg);
94 APP_VOID rpc_read_write_response_neg(LPST_AREP lpArep,LPST_RPC_REQ lpstRPCReq,LPST_MSG* ppMsg, APP_WORD wIsReadRsp);
95 
96 
97 APP_DWORD APP_FAR rpc_marshall_pnioc_response_lookup(LPST_AREP lpArep,LPST_RPC_REQ lpRPCReq,LPST_MSG* ppMsg);
98 APP_DWORD APP_FAR rpc_marshall_pnioc_response(LPST_AREP lpArep,LPST_RPC_REQ lpRPCReq,LPST_MSG* ppMsg);
99 APP_DWORD APP_FAR rpc_marshall_pnioc_and_invoke(APP_WORD wOperation,
100  APP_WORD wIdPos,
101  APP_WORD wIdNeg,
102  APP_WORD wIdCancel,
103  LPST_AREP lpArep,
104  APP_LPVOID lpContext,
105  LPST_RPC_CALL pArgs,
106  APP_DWORD dwIPSrc,
107  LPST_MSG* ppMsg);
108 
109 
110 APP_WORD SetLLDPMgtAddr(LPST_DREP lpPhyDev, APP_LPWORD lpwStatus);
111 APP_WORD SetLLDPChassisID(LPST_DREP lpPhyDev, APP_LPWORD lpwStatus);
112 APP_WORD SetLLDPPNChassis(LPST_DREP lpPhyDev, APP_LPWORD lpwStatus);
113 
114 
115 #define RPC_CONNECT_RSP_OK(pArep,ppMsg) rpc_marshall_pnioc_response (pArep, pArep->lpstRPCReq, ppMsg)
116 #define RPC_WRITE_RSP_OK(pArep,ppMsg) rpc_marshall_pnioc_response (pArep, pArep->lpstRPCReq, ppMsg)
117 #define RPC_READ_RSP_OK(pArep,ppMsg) rpc_marshall_pnioc_response (pArep, pArep->lpstRPCReq, ppMsg)
118 #define RPC_CONTROL_RSP_OK(pArep,ppMsg) rpc_marshall_pnioc_response (pArep, pArep->lpstRPCReq, ppMsg)
119 #define RPC_RELEASE_RSP_OK(pArep,ppMsg) rpc_marshall_pnioc_response (pArep, pArep->lpstRPCReq, ppMsg)
120 #define RPC_LOOKUP_RSP_OK(pArep,ppMsg) rpc_marshall_pnioc_response_lookup(pArep, pArep->lpstRPCReq, ppMsg)
121 
122 #define RPC_CCONTROL_REQ(pArep,lpContext,ppMsg) rpc_marshall_pnioc_and_invoke(RPCOPERATIONNMB_CONTROL, ID_RMPM_CCONTROL_CNF_POS, ID_RMPM_CCONTROL_CNF_NEG ,ID_RPC_CANCEL_CNF, pArep ,lpContext,pArep->lpstCurrRPCCall, GET_DREP_IP(AREP_GET_DREP(pArep)), ppMsg)
123 
124 #include "os_pck.h"
125 
126 /*---------------------------------------------------------------------------*/
127 /* Stucture for marchalling */
128 /*---------------------------------------------------------------------------*/
129 typedef struct _ST_NDR_DATA_REQUEST{ /*5.2.11*/
130  ALIGNED_DWORD_DECL(NDRDR_ArgsMaximum);
131  ALIGNED_DWORD_DECL(NDRDR_ArgsLength);
132  ALIGNED_DWORD_DECL(NDRDR_MaximumCount);
133  ALIGNED_DWORD_DECL(NDRDR_Offset);
134  ALIGNED_DWORD_DECL(NDRDR_ActualCount);
135 }PACK_ALIGNEMENT(ST_NDR_DATA_REQUEST), APP_FAR * LPST_NDR_DATA_REQUEST;
136 #define ST_NDR_DATA_REQUEST_SIZEOF 20
137 STRUCT_SIZE_CHECK(ST_NDR_DATA_REQUEST, ST_NDR_DATA_REQUEST_SIZEOF)
138 
139 
140 typedef struct _ST_NDR_DATA_RESPONSE{
141  ALIGNED_DWORD_DECL(NDRDR_RPCStatus);
142  ALIGNED_DWORD_DECL(NDRDR_ArgsLength);
143  ALIGNED_DWORD_DECL(NDRDR_MaximumCount);
144  ALIGNED_DWORD_DECL(NDRDR_Offset);
145  ALIGNED_DWORD_DECL(NDRDR_ActualCount);
146 }PACK_ALIGNEMENT(ST_NDR_DATA_RESPONSE), APP_FAR * LPST_NDR_DATA_RESPONSE;
147 #define ST_NDR_DATA_RESPONSE_SIZEOF 20
148 STRUCT_SIZE_CHECK(ST_NDR_DATA_RESPONSE, ST_NDR_DATA_RESPONSE_SIZEOF)
149 
150 #include "os_unpck.h"
151 
152 /* Macro using message */
153 #define RMPM_INIT_REQ OS_SEND_MESSAGE_RMPM(ID_RMPM_INIT_REQ)
154 
155 #define RETURN_DCPUCR_GET_RSP_POS (*ppMsg)->dwQueue = ID_QUEUE_DCP; (*ppMsg)->wCodeFnct = ID_DV_DCPUCR_RMPM_GET_RSP_POS; return SEND_MESSAGE
156 #define RETURN_DCPUCR_GET_RSP_NEG (*ppMsg)->dwQueue = ID_QUEUE_DCP; (*ppMsg)->wCodeFnct = ID_DV_DCPUCR_RMPM_GET_RSP_NEG; return SEND_MESSAGE
157 
158 #define RETURN_DCPUCR_SET_RSP_POS (*ppMsg)->dwQueue = ID_QUEUE_DCP; (*ppMsg)->wCodeFnct = ID_DV_DCPUCR_RMPM_SET_RSP_POS; return SEND_MESSAGE
159 #define RETURN_DCPUCR_SET_RSP_NEG (*ppMsg)->dwQueue = ID_QUEUE_DCP; (*ppMsg)->wCodeFnct = ID_DV_DCPUCR_RMPM_SET_RSP_NEG; return SEND_MESSAGE
160 
161 #define RETURN_DCPMCR_IDENTIFY_RSP (*ppMsg)->dwQueue = ID_QUEUE_DCP; (*ppMsg)->wCodeFnct = ID_DV_DCPMCR_IDENTIFY_RSP; return SEND_MESSAGE
162 
163 
164 #define RETURN_FSPMDEV_RMPM_INIT_CNF_POS (*ppMsg)->dwQueue = ID_QUEUE_FSPMDEV; (*ppMsg)->wCodeFnct = ID_FSPMDEV_RMPM_INIT_CNF_POS; return SEND_MESSAGE
165 #define RETURN_FSPMDEV_RMPM_INIT_CNF_NEG (*ppMsg)->dwQueue = ID_QUEUE_FSPMDEV; (*ppMsg)->wCodeFnct = ID_FSPMDEV_RMPM_INIT_CNF_NEG; return SEND_MESSAGE
166 #define RETURN_FSPMDEV_RMPM_STOP_IND (*ppMsg)->dwQueue = ID_QUEUE_FSPMDEV; (*ppMsg)->wCodeFnct = ID_FSPMDEV_RMPM_STOP_IND; return SEND_MESSAGE
167 #define RETURN_RMPM_SETUP_IND (*ppMsg)->dwQueue = ID_QUEUE_RMPM; (*ppMsg)->wCodeFnct = ID_RMPM_SETUP_IND; return SEND_MESSAGE
168 
169 #define RETURN_DCPMCR_ACTIVATE (*ppMsg)->dwQueue = ID_QUEUE_DCP; (*ppMsg)->wCodeFnct = ID_DV_DCPMCR_ACTIVATE_REQ; return SEND_MESSAGE
170 
171 #define RETURN_CMDEV_RMPM_CONNECT_IND (*ppMsg)->dwQueue = ID_QUEUE_CMDEV; (*ppMsg)->wCodeFnct = ID_RM_CONNECT_IND; return SEND_MESSAGE
172 #define RETURN_CMDEV_RMPM_WRITE_IND (*ppMsg)->dwQueue = ID_QUEUE_CMDEV; (*ppMsg)->wCodeFnct = ID_RM_WRITE_IND; return SEND_MESSAGE
173 #define RETURN_CMDEV_RMPM_READ_IND (*ppMsg)->dwQueue = ID_QUEUE_CMDEV; (*ppMsg)->wCodeFnct = ID_RM_READ_IND; return SEND_MESSAGE
174 #define RETURN_CMDEV_RMPM_RELEASE_IND (*ppMsg)->dwQueue = ID_QUEUE_CMDEV; (*ppMsg)->wCodeFnct = ID_RM_RELEASE_IND; return SEND_MESSAGE
175 #define RETURN_CMDEV_RMPM_DCONTROL_IND (*ppMsg)->dwQueue = ID_QUEUE_CMDEV; (*ppMsg)->wCodeFnct = ID_RM_DCONTROL_IND; return SEND_MESSAGE
176 #define RETURN_CMDEV_RMPM_CCONTROL_RSP_POS (*ppMsg)->dwQueue = ID_QUEUE_CMDEV; (*ppMsg)->wCodeFnct = ID_RM_CCONTROL_CNF_POS; return SEND_MESSAGE
177 #define RETURN_CMDEV_RMPM_CCONTROL_RSP_NEG (*ppMsg)->dwQueue = ID_QUEUE_CMDEV; (*ppMsg)->wCodeFnct = ID_RM_CCONTROL_CNF_NEG; return SEND_MESSAGE
178 #define RETURN_CMDEV_RMPM_ABORT_CNF (*ppMsg)->dwQueue = ID_QUEUE_CMDEV; (*ppMsg)->wCodeFnct = ID_RM_ABORT_CNF; return SEND_MESSAGE
179 
180 #define RETURN_SEND_HELLO_REQ (*ppMsg)->dwQueue = ID_QUEUE_DCP; (*ppMsg)->wCodeFnct = ID_DV_DCPHMCS_HELLO_REQ;return SEND_MESSAGE
181 
182 #define RMPM_POWER_ON 0
183 #define RMPM_ACT1 1
184 #define RMPM_ACT2 2
185 #define RMPM_SETUP 3
186 #define RMPM_SET_NAME 4
187 #define RMPM_SET_IP 5
188 #define RMPM_W_CONNECT 6
189 
190 
191 
192 #endif
Definition: message.h:1163
Definition: rmpm.h:140
Definition: rmpm.h:129