Commit 9a448f44 authored by Omar Gabella's avatar Omar Gabella

new monitoring ++

parent e50ae501
......@@ -15,6 +15,10 @@
*/
int wr_calibrated(struct pp_instance *ppi, unsigned char *pkt, int plen)
{
#if defined(BROADCAST_BASE) && defined(BC_EXTRA_MON)
/* ONLY FOR TESTS */
WR_DSPOR(ppi)->ctr_wr_calibrated_1++;
#endif // BROADCAST_BASE && BC_EXTRA_MON
struct wr_dsport *wrp = WR_DSPOR(ppi);
MsgSignaling wrsig_msg;
......@@ -49,6 +53,10 @@ int wr_calibrated(struct pp_instance *ppi, unsigned char *pkt, int plen)
DSPOR(ppi)->portIdentity.clockIdentity.id,
PP_CLOCK_IDENTITY_LENGTH)==0)
{
#if defined(BROADCAST_BASE) && defined(BC_EXTRA_MON)
/* ONLY FOR TESTS */
WR_DSPOR(ppi)->ctr_wr_calibrated_2++;
#endif // BROADCAST_BASE && BC_EXTRA_MON
ppi->next_state = WRS_WR_LINK_ON;
}
#else
......
......@@ -15,6 +15,10 @@
*/
int wr_calibration(struct pp_instance *ppi, unsigned char *pkt, int plen)
{
#if defined(BROADCAST_BASE) && defined(BC_EXTRA_MON)
/* ONLY FOR TESTS */
WR_DSPOR(ppi)->ctr_wr_calibration_00++;
#endif // BROADCAST_BASE && BC_EXTRA_MON
struct wr_dsport *wrp = WR_DSPOR(ppi);
int sendmsg = 0;
uint32_t delta;
......@@ -31,7 +35,7 @@ int wr_calibration(struct pp_instance *ppi, unsigned char *pkt, int plen)
if (sendmsg) {
__pp_timeout_set(ppi, PP_TO_EXT_0, wrp->calPeriod);
#ifndef BROADCAST
#ifndef BROADCAST
// Don't send CALIBRATE message, the master don't care about it if broadcast
msg_issue_wrsig(ppi, CALIBRATE);
#endif
......@@ -45,6 +49,10 @@ int wr_calibration(struct pp_instance *ppi, unsigned char *pkt, int plen)
switch (wrp->wrPortState) {
case WR_PORT_CALIBRATION_0:
#if defined(BROADCAST_BASE) && defined(BC_EXTRA_MON)
/* ONLY FOR TESTS */
WR_DSPOR(ppi)->ctr_wr_calibration_0++;
#endif // BROADCAST_BASE && BC_EXTRA_MON
/* enable pattern sending */
if (wrp->ops->calib_pattern_enable(ppi, 0, 0, 0) ==
WR_HW_CALIB_OK)
......@@ -53,6 +61,10 @@ int wr_calibration(struct pp_instance *ppi, unsigned char *pkt, int plen)
break;
case WR_PORT_CALIBRATION_1:
#if defined(BROADCAST_BASE) && defined(BC_EXTRA_MON)
/* ONLY FOR TESTS */
WR_DSPOR(ppi)->ctr_wr_calibration_1++;
#endif // BROADCAST_BASE && BC_EXTRA_MON
/* enable Tx calibration */
if (wrp->ops->calib_enable(ppi, WR_HW_CALIB_TX)
== WR_HW_CALIB_OK)
......@@ -61,6 +73,10 @@ int wr_calibration(struct pp_instance *ppi, unsigned char *pkt, int plen)
break;
case WR_PORT_CALIBRATION_2:
#if defined(BROADCAST_BASE) && defined(BC_EXTRA_MON)
/* ONLY FOR TESTS */
WR_DSPOR(ppi)->ctr_wr_calibration_2++;
#endif // BROADCAST_BASE && BC_EXTRA_MON
/* wait until Tx calibration is finished */
if (wrp->ops->calib_poll(ppi, WR_HW_CALIB_TX, &delta) ==
WR_HW_CALIB_READY) {
......@@ -79,6 +95,10 @@ int wr_calibration(struct pp_instance *ppi, unsigned char *pkt, int plen)
}
case WR_PORT_CALIBRATION_3:
#if defined(BROADCAST_BASE) && defined(BC_EXTRA_MON)
/* ONLY FOR TESTS */
WR_DSPOR(ppi)->ctr_wr_calibration_3++;
#endif // BROADCAST_BASE && BC_EXTRA_MON
/* disable Tx calibration */
if (wrp->ops->calib_disable(ppi, WR_HW_CALIB_TX)
== WR_HW_CALIB_OK)
......@@ -87,6 +107,10 @@ int wr_calibration(struct pp_instance *ppi, unsigned char *pkt, int plen)
break;
case WR_PORT_CALIBRATION_4:
#if defined(BROADCAST_BASE) && defined(BC_EXTRA_MON)
/* ONLY FOR TESTS */
WR_DSPOR(ppi)->ctr_wr_calibration_4++;
#endif // BROADCAST_BASE && BC_EXTRA_MON
/* disable pattern sending */
if (wrp->ops->calib_pattern_disable(ppi) == WR_HW_CALIB_OK)
wrp->wrPortState = WR_PORT_CALIBRATION_5;
......@@ -94,6 +118,10 @@ int wr_calibration(struct pp_instance *ppi, unsigned char *pkt, int plen)
break;
case WR_PORT_CALIBRATION_5:
#if defined(BROADCAST_BASE) && defined(BC_EXTRA_MON)
/* ONLY FOR TESTS */
WR_DSPOR(ppi)->ctr_wr_calibration_5++;
#endif // BROADCAST_BASE && BC_EXTRA_MON
/* enable Rx calibration using the pattern sent by other port */
if (wrp->ops->calib_enable(ppi, WR_HW_CALIB_RX) ==
WR_HW_CALIB_OK)
......@@ -102,6 +130,10 @@ int wr_calibration(struct pp_instance *ppi, unsigned char *pkt, int plen)
break;
case WR_PORT_CALIBRATION_6:
#if defined(BROADCAST_BASE) && defined(BC_EXTRA_MON)
/* ONLY FOR TESTS */
WR_DSPOR(ppi)->ctr_wr_calibration_6++;
#endif // BROADCAST_BASE && BC_EXTRA_MON
/* wait until Rx calibration is finished */
if (wrp->ops->calib_poll(ppi, WR_HW_CALIB_RX, &delta) ==
WR_HW_CALIB_READY) {
......@@ -121,6 +153,10 @@ int wr_calibration(struct pp_instance *ppi, unsigned char *pkt, int plen)
}
case WR_PORT_CALIBRATION_7:
#if defined(BROADCAST_BASE) && defined(BC_EXTRA_MON)
/* ONLY FOR TESTS */
WR_DSPOR(ppi)->ctr_wr_calibration_7++;
#endif // BROADCAST_BASE && BC_EXTRA_MON
/* disable Rx calibration */
if (wrp->ops->calib_disable(ppi, WR_HW_CALIB_RX)
== WR_HW_CALIB_OK)
......@@ -128,6 +164,10 @@ int wr_calibration(struct pp_instance *ppi, unsigned char *pkt, int plen)
else
break;
case WR_PORT_CALIBRATION_8:
#if defined(BROADCAST_BASE) && defined(BC_EXTRA_MON)
/* ONLY FOR TESTS */
WR_DSPOR(ppi)->ctr_wr_calibration_8++;
#endif // BROADCAST_BASE && BC_EXTRA_MON
/* send deltas to the other port and go to the next state */
#ifndef BROADCAST
......
......@@ -15,6 +15,10 @@
*/
int wr_link_on(struct pp_instance *ppi, unsigned char *pkt, int plen)
{
#if defined(BROADCAST_BASE) && defined(BC_EXTRA_MON)
/* ONLY FOR TESTS */
WR_DSPOR(ppi)->ctr_wr_link_on_1++;
#endif // BROADCAST_BASE && BC_EXTRA_MON
struct wr_dsport *wrp = WR_DSPOR(ppi);
int e = 0;
......@@ -35,7 +39,13 @@ int wr_link_on(struct pp_instance *ppi, unsigned char *pkt, int plen)
return -1;
if (wrp->wrMode == WR_SLAVE)
{
#if defined(BROADCAST_BASE) && defined(BC_EXTRA_MON)
/* ONLY FOR TESTS */
WR_DSPOR(ppi)->ctr_wr_link_on_2++;
#endif // BROADCAST_BASE && BC_EXTRA_MON
ppi->next_state = PPS_SLAVE;
}
else
ppi->next_state = PPS_MASTER;
......
......@@ -15,6 +15,10 @@
*/
int wr_locked(struct pp_instance *ppi, unsigned char *pkt, int plen)
{
#if defined(BROADCAST_BASE) && defined(BC_EXTRA_MON)
/* ONLY FOR TESTS */
WR_DSPOR(ppi)->ctr_wr_locked_1++;
#endif // BROADCAST_BASE && BC_EXTRA_MON
int e = 0, sendmsg = 0;
MsgSignaling wrsig_msg;
struct wr_dsport *wrp = WR_DSPOR(ppi);
......@@ -49,7 +53,11 @@ int wr_locked(struct pp_instance *ppi, unsigned char *pkt, int plen)
if (memcmp(ppi->received_ptp_header.targetIdentity.clockIdentity.id,
DSPOR(ppi)->portIdentity.clockIdentity.id,
PP_CLOCK_IDENTITY_LENGTH)==0)
{
{
#if defined(BROADCAST_BASE) && defined(BC_EXTRA_MON)
/* ONLY FOR TESTS */
WR_DSPOR(ppi)->ctr_wr_locked_2++;
#endif // BROADCAST_BASE && BC_EXTRA_MON
ppi->next_state = WRS_RESP_CALIB_REQ;
}
#else
......
......@@ -11,6 +11,10 @@
int wr_resp_calib_req(struct pp_instance *ppi, unsigned char *pkt, int plen)
{
#if defined(BROADCAST_BASE) && defined(BC_EXTRA_MON)
/* ONLY FOR TESTS */
WR_DSPOR(ppi)->ctr_wr_resp_calib_req_1++;
#endif // BROADCAST_BASE && BC_EXTRA_MON
struct wr_dsport *wrp = WR_DSPOR(ppi);
MsgSignaling wrsig_msg;
int e = 0, enable = 0;
......@@ -52,6 +56,10 @@ int wr_resp_calib_req(struct pp_instance *ppi, unsigned char *pkt, int plen)
{
if (send_pattern)
wrp->ops->calib_pattern_disable(ppi);
#if defined(BROADCAST_BASE) && defined(BC_EXTRA_MON)
/* ONLY FOR TESTS */
WR_DSPOR(ppi)->ctr_wr_resp_calib_req_2++;
#endif // BROADCAST_BASE && BC_EXTRA_MON
ppi->next_state = WRS_CALIBRATION;
}
#else
......
......@@ -80,6 +80,30 @@ struct wr_dsport {
UInteger32 ctr_wr_s_lock_5;
UInteger32 ctr_wr_s_lock_6;
UInteger32 ctr_wr_s_lock_7;
UInteger32 ctr_wr_locked_1;
UInteger32 ctr_wr_locked_2;
UInteger32 ctr_wr_resp_calib_req_1;
UInteger32 ctr_wr_resp_calib_req_2;
UInteger32 ctr_wr_calibration_00;
UInteger32 ctr_wr_calibration_0;
UInteger32 ctr_wr_calibration_1;
UInteger32 ctr_wr_calibration_2;
UInteger32 ctr_wr_calibration_3;
UInteger32 ctr_wr_calibration_4;
UInteger32 ctr_wr_calibration_5;
UInteger32 ctr_wr_calibration_6;
UInteger32 ctr_wr_calibration_7;
UInteger32 ctr_wr_calibration_8;
UInteger32 ctr_wr_calibrated_1;
UInteger32 ctr_wr_calibrated_2;
UInteger32 ctr_wr_link_on_1;
UInteger32 ctr_wr_link_on_2;
#endif // BROADCAST_BASE && BC_EXTRA_MON
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment