Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Esteban Blanc
proview
Commits
2ad18f40
Commit
2ad18f40
authored
Jan 29, 2018
by
Claes Sjofors
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
qcom embryo to open/close link
parent
bbac8458
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
194 additions
and
4 deletions
+194
-4
src/exe/rt_qmon/src/rt_qmon.c
src/exe/rt_qmon/src/rt_qmon.c
+28
-0
src/exe/rt_qmon/src/rt_qmon.h
src/exe/rt_qmon/src/rt_qmon.h
+4
-2
src/lib/rt/src/rt_qcom.c
src/lib/rt/src/rt_qcom.c
+46
-0
src/lib/rt/src/rt_qcom.h
src/lib/rt/src/rt_qcom.h
+10
-1
src/lib/rt/src/rt_rtt_command.c
src/lib/rt/src/rt_rtt_command.c
+106
-1
No files found.
src/exe/rt_qmon/src/rt_qmon.c
View file @
2ad18f40
...
...
@@ -2091,6 +2091,32 @@ action_thread ()
send_action
(
lp
,
get
.
type
.
s
);
break
;
case
qmon_eMsgTypeAction_Connect
:
{
sLink
*
lp
;
sEseg
*
sp
;
pwr_tNodeId
nid
;
nid
=
*
(
pwr_tNodeId
*
)
msg
;
lp
=
get_link
(
nid
,
NULL
);
if
(
!
lp
)
break
;
lp
->
np
->
link
[
lp
->
lix
].
birth
=
time_Clock
(
NULL
,
NULL
);
sp
=
create_connect
(
lp
);
que_Put
(
NULL
,
&
lp
->
q_in
,
&
sp
->
c
.
le
,
sp
);
break
;
}
case
qmon_eMsgTypeAction_Disconnect
:
{
sLink
*
lp
;
pwr_tNodeId
nid
;
nid
=
*
(
pwr_tNodeId
*
)
msg
;
lp
=
get_link
(
nid
,
NULL
);
if
(
!
lp
)
break
;
link_disconnect
(
lp
);
break
;
}
default:
;
}
break
;
...
...
@@ -2122,6 +2148,8 @@ send_action (
timelog
(
1
,
"qmon send NodePassive"
);
sp
->
head
.
flags
.
b
.
event
=
eEvent_redcomPassive
;
break
;
default:
return
0
;
}
sp
->
lp
=
lp
;
sp
->
c
.
action
=
eAction_export
;
...
...
src/exe/rt_qmon/src/rt_qmon.h
View file @
2ad18f40
...
...
@@ -43,7 +43,9 @@
typedef
enum
{
qmon_eMsgTypeAction_NodeActive
,
qmon_eMsgTypeAction_NodePassive
qmon_eMsgTypeAction_NodePassive
,
qmon_eMsgTypeAction_Connect
,
qmon_eMsgTypeAction_Disconnect
}
qmon_eMsgTypeAction
;
#endif
\ No newline at end of file
#endif
src/lib/rt/src/rt_qcom.c
View file @
2ad18f40
...
...
@@ -42,6 +42,7 @@
#include "rt_errh.h"
#include "rt_qcom.h"
#include "rt_qdb.h"
#include "rt_qmon.h"
#include "rt_qcom_msg.h"
#include "rt_qdb_msg.h"
...
...
@@ -1329,6 +1330,51 @@ qcom_SetRedundancyState (
qdb
->
my_node
->
redundancy_state
=
state
;
}
/**
* Send a connect action message to rt_qmon
*/
void
qcom_LinkConnect
(
pwr_tNodeId
nid
)
{
pwr_tStatus
sts
;
qcom_sPut
put
;
qcom_sQid
qmon_qid
=
{
qcom_cImonAction
,
0
};
memset
(
&
put
,
0
,
sizeof
(
put
));
put
.
type
.
b
=
(
qcom_eBtype
)
qmon_cMsgClassAction
;
put
.
type
.
s
=
(
qcom_eStype
)
qmon_eMsgTypeAction_Connect
;
put
.
size
=
sizeof
(
pwr_tNodeId
);
put
.
data
=
qcom_Alloc
(
&
sts
,
put
.
size
);
*
(
pwr_tNodeId
*
)
put
.
data
=
nid
;
put
.
allocate
=
0
;
qcom_Put
(
&
sts
,
&
qmon_qid
,
&
put
);
}
/**
* Send a disconnect action message to rt_qmon
*/
void
qcom_LinkDisconnect
(
pwr_tNodeId
nid
)
{
pwr_tStatus
sts
;
qcom_sPut
put
;
qcom_sQid
qmon_qid
=
{
qcom_cImonAction
,
0
};
memset
(
&
put
,
0
,
sizeof
(
put
));
put
.
type
.
b
=
(
qcom_eBtype
)
qmon_cMsgClassAction
;
put
.
type
.
s
=
(
qcom_eStype
)
qmon_eMsgTypeAction_Disconnect
;
put
.
size
=
sizeof
(
pwr_tNodeId
);
put
.
data
=
qcom_Alloc
(
&
sts
,
put
.
size
);
*
(
pwr_tNodeId
*
)
put
.
data
=
nid
;
put
.
allocate
=
0
;
qcom_Put
(
&
sts
,
&
qmon_qid
,
&
put
);
}
/*
...
...
src/lib/rt/src/rt_qcom.h
View file @
2ad18f40
...
...
@@ -450,6 +450,15 @@ qcom_SetRedundancyState (
pwr_eRedundancyState
state
);
void
qcom_LinkConnect
(
pwr_tNodeId
nid
);
void
qcom_LinkDisconnect
(
pwr_tNodeId
nid
);
bool_t
...
...
@@ -468,4 +477,4 @@ xdr_qcom_sQid(XDR *xdrs, qcom_sQid *objp);
#endif
/** @} */
/** @} */
\ No newline at end of file
/** @} */
src/lib/rt/src/rt_rtt_command.c
View file @
2ad18f40
...
...
@@ -138,6 +138,8 @@ static int exit_func( menu_ctx ctx,
int
*
flag
);
static
int
classhier_func
(
menu_ctx
ctx
,
int
*
flag
);
static
int
qcom_func
(
menu_ctx
ctx
,
int
*
flag
);
static
int
rtt_login_func
(
menu_ctx
ctx
,
int
*
flag
);
static
int
rtt_show_object_add
(
...
...
@@ -4463,6 +4465,104 @@ static int classhier_func( menu_ctx ctx,
return
sts
;
}
/*************************************************************************
*
* Name: qcom_func()
*
* Type int
*
* Type Parameter IOGF Description
* menu_ctx ctx I rtt context.
*
* Description:
* Connect and disconnect qcom.
*
**************************************************************************/
static
int
qcom_func
(
menu_ctx
ctx
,
int
*
flag
)
{
int
sts
;
char
arg1_str
[
80
];
int
arg1_sts
;
arg1_sts
=
rtt_get_qualifier
(
"rtt_arg1"
,
arg1_str
);
if
(
cdh_NoCaseStrncmp
(
arg1_str
,
"CONNECT"
,
strlen
(
arg1_str
))
==
0
)
{
/* Command is "QCOM CONNECT" */
char
node_str
[
80
];
qcom_sNode
node
;
pwr_tNid
nid
;
int
found
;
/* Check authorization */
if
(
!
(
rtt_priv
&
RTT_PRIV_SYS
)
)
{
rtt_message
(
'E'
,
"Not authorized for this operation"
);
return
RTT__NOPICTURE
;
}
if
(
EVEN
(
rtt_get_qualifier
(
"/NODE"
,
node_str
)))
{
rtt_message
(
'E'
,
"Enter node"
);
return
RTT__HOLDCOMMAND
;
}
found
=
0
;
for
(
nid
=
qcom_cNNid
;
qcom_NextNode
(
&
sts
,
&
node
,
nid
);
nid
=
node
.
nid
)
{
if
(
cdh_NoCaseStrcmp
(
node_str
,
node
.
name
)
==
0
)
{
found
=
1
;
break
;
}
}
if
(
!
found
)
{
rtt_message
(
'E'
,
"Unknown node"
);
return
RTT__NOPICTURE
;
}
qcom_LinkConnect
(
node
.
nid
);
}
else
if
(
cdh_NoCaseStrncmp
(
arg1_str
,
"DISCONNECT"
,
strlen
(
arg1_str
))
==
0
)
{
/* Command is "QCOM CONNECT" */
char
node_str
[
80
];
qcom_sNode
node
;
pwr_tNid
nid
;
int
found
;
/* Check authorization */
if
(
!
(
rtt_priv
&
RTT_PRIV_SYS
)
)
{
rtt_message
(
'E'
,
"Not authorized for this operation"
);
return
RTT__NOPICTURE
;
}
if
(
EVEN
(
rtt_get_qualifier
(
"/NODE"
,
node_str
)))
{
rtt_message
(
'E'
,
"Enter node"
);
return
RTT__HOLDCOMMAND
;
}
found
=
0
;
for
(
nid
=
qcom_cNNid
;
qcom_NextNode
(
&
sts
,
&
node
,
nid
);
nid
=
node
.
nid
)
{
if
(
cdh_NoCaseStrcmp
(
node_str
,
node
.
name
)
==
0
)
{
found
=
1
;
break
;
}
}
if
(
!
found
)
{
rtt_message
(
'E'
,
"Unknown node"
);
return
RTT__NOPICTURE
;
}
qcom_LinkDisconnect
(
node
.
nid
);
}
else
{
rtt_message
(
'E'
,
"Syntax error"
);
return
RTT__HOLDCOMMAND
;
}
return
RTT__SUCCESS
;
}
/*************************************************************************
*
* Name: rtt_login_func()
...
...
@@ -4689,6 +4789,11 @@ rtt_t_comtbl rtt_command_table[] = {
&
classhier_func
,
{
""
}
},
{
"QCOM"
,
&
qcom_func
,
{
"rtt_arg1"
,
"/NODE"
,
""
}
},
{
"CREATE"
,
&
rtt_create_func
,
...
...
@@ -11188,4 +11293,4 @@ static int rtt_qual_to_time( char *in_str,
if
(
EVEN
(
sts
))
return
sts
;
}
return
RTT__SUCCESS
;
}
\ No newline at end of file
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment