Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
W
White Rabbit Switch - Software
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
86
Issues
86
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
CI / CD
CI / CD
Pipelines
Schedules
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
White Rabbit Switch - Software
Commits
52905205
Commit
52905205
authored
Sep 11, 2019
by
Jean-Claude BAU
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Share memory dump: Display LPDC data
parent
c41e1cd5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
72 additions
and
3 deletions
+72
-3
wrs_dump_shmem.c
userspace/tools/wrs_dump_shmem.c
+72
-3
No files found.
userspace/tools/wrs_dump_shmem.c
View file @
52905205
...
@@ -403,9 +403,6 @@ struct dump_info hal_port_info [] = {
...
@@ -403,9 +403,6 @@ struct dump_info hal_port_info [] = {
DUMP_FIELD
(
int
,
hw_addr_auto
),
DUMP_FIELD
(
int
,
hw_addr_auto
),
DUMP_FIELD
(
int
,
portStates
.
state
),
DUMP_FIELD
(
int
,
portStates
.
state
),
DUMP_FIELD
(
int
,
pllStates
.
state
),
DUMP_FIELD
(
int
,
pllStates
.
state
),
DUMP_FIELD
(
int
,
lpdc
.
isSupported
),
DUMP_FIELD
(
int
,
lpdc
.
txSetupStates
.
state
),
DUMP_FIELD
(
int
,
lpdc
.
rxSetupStates
.
state
),
DUMP_FIELD
(
int
,
fiber_index
),
DUMP_FIELD
(
int
,
fiber_index
),
DUMP_FIELD
(
int
,
locked
),
DUMP_FIELD
(
int
,
locked
),
/* these fields are defined as uint32_t but we prefer %i to %x */
/* these fields are defined as uint32_t but we prefer %i to %x */
...
@@ -446,8 +443,51 @@ struct dump_info hal_port_info [] = {
...
@@ -446,8 +443,51 @@ struct dump_info hal_port_info [] = {
DUMP_FIELD
(
uint32_t
,
t2_phase_transition
),
DUMP_FIELD
(
uint32_t
,
t2_phase_transition
),
DUMP_FIELD
(
uint32_t
,
t4_phase_transition
),
DUMP_FIELD
(
uint32_t
,
t4_phase_transition
),
DUMP_FIELD
(
uint32_t
,
ep_base
),
DUMP_FIELD
(
uint32_t
,
ep_base
),
DUMP_FIELD
(
int
,
sfpPresent
),
DUMP_FIELD
(
int
,
has_sfp_diag
),
DUMP_FIELD
(
int
,
has_sfp_diag
),
DUMP_FIELD
(
int
,
monitor
),
DUMP_FIELD
(
int
,
monitor
),
/* PPSi instance information */
DUMP_FIELD
(
int
,
portMode
),
DUMP_FIELD
(
int
,
synchronized
),
DUMP_FIELD
(
int
,
portInfoUpdated
),
/* Events to process */
DUMP_FIELD
(
int
,
evt_reset
),
DUMP_FIELD
(
int
,
evt_lock
),
DUMP_FIELD
(
int
,
evt_linkUp
),
DUMP_FIELD
(
int
,
pllStates
.
state
),
};
/* map for fields of hal_port_state.lpdc (hal_shmem.h) */
#undef DUMP_STRUCT
#define DUMP_STRUCT halPortLPDC_t
struct
dump_info
hal_port_info_lpdc
[]
=
{
DUMP_FIELD
(
int
,
isSupported
),
DUMP_FIELD
(
int
,
txSetupStates
.
state
),
DUMP_FIELD
(
int
,
rxSetupStates
.
state
),
};
/* map for fields of hal_port_state.lpdc.txsetup (hal_shmem.h) */
#undef DUMP_STRUCT
#define DUMP_STRUCT halPortLpdcTx_t
struct
dump_info
hal_port_info_lpdc_txsetup
[]
=
{
DUMP_FIELD
(
int
,
attempts
),
DUMP_FIELD
(
int
,
cal_saved_phase
),
DUMP_FIELD
(
int
,
cal_saved_phase_valid
),
DUMP_FIELD
(
int
,
measured_phase
),
DUMP_FIELD
(
int
,
expected_phase
),
DUMP_FIELD
(
int
,
tolerance
),
DUMP_FIELD
(
int
,
update_cnt
),
DUMP_FIELD
(
int
,
expected_phase_valid
),
};
/* map for fields of hal_port_state.lpdc.rxsetup (hal_shmem.h) */
#undef DUMP_STRUCT
#define DUMP_STRUCT halPortLpdcRx_t
struct
dump_info
hal_port_info_lpdc_rxsetup
[]
=
{
DUMP_FIELD
(
int
,
attempts
),
};
};
int
dump_hal_mem
(
struct
wrs_shm_head
*
head
)
int
dump_hal_mem
(
struct
wrs_shm_head
*
head
)
...
@@ -476,9 +516,38 @@ int dump_hal_mem(struct wrs_shm_head *head)
...
@@ -476,9 +516,38 @@ int dump_hal_mem(struct wrs_shm_head *head)
for
(
i
=
0
;
i
<
n
;
i
++
,
p
++
)
{
for
(
i
=
0
;
i
<
n
;
i
++
,
p
++
)
{
char
prefix
[
64
];
char
prefix
[
64
];
char
prefix2
[
64
];
sprintf
(
prefix
,
"HAL.port.%d"
,
i
+
1
);
sprintf
(
prefix
,
"HAL.port.%d"
,
i
+
1
);
dump_many_fields
(
p
,
hal_port_info
,
ARRAY_SIZE
(
hal_port_info
),
prefix
);
dump_many_fields
(
p
,
hal_port_info
,
ARRAY_SIZE
(
hal_port_info
),
prefix
);
if
(
p
->
lpdc
)
{
halPortLPDC_t
*
lpdc
;
if
(
(
lpdc
=
wrs_shm_follow
(
head
,
p
->
lpdc
))
!=
NULL
)
{
strcat
(
prefix
,
".lpdc"
);
dump_many_fields
(
lpdc
,
hal_port_info_lpdc
,
ARRAY_SIZE
(
hal_port_info_lpdc
),
prefix
);
if
(
lpdc
->
txSetup
)
{
halPortLpdcTx_t
*
txsetup
;
if
(
(
txsetup
=
wrs_shm_follow
(
head
,
lpdc
->
txSetup
))
!=
NULL
)
{
strcpy
(
prefix2
,
prefix
);
strcat
(
prefix2
,
".txsetup"
);
dump_many_fields
(
txsetup
,
hal_port_info_lpdc_txsetup
,
ARRAY_SIZE
(
hal_port_info_lpdc_txsetup
),
prefix2
);
}
}
if
(
lpdc
->
rxSetup
)
{
halPortLpdcTx_t
*
rxsetup
;
if
(
(
rxsetup
=
wrs_shm_follow
(
head
,
lpdc
->
rxSetup
))
!=
NULL
)
{
strcpy
(
prefix2
,
prefix
);
strcat
(
prefix2
,
".rxsetup"
);
dump_many_fields
(
rxsetup
,
hal_port_info_lpdc_rxsetup
,
ARRAY_SIZE
(
hal_port_info_lpdc_rxsetup
),
prefix2
);
}
}
}
}
}
}
return
0
;
return
0
;
}
}
...
...
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