Commit 05c06994 authored by Alessandro Rubini's avatar Alessandro Rubini

proto-ext-whiterabbit: remove unused files

Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent 7055a3cc
......@@ -8,11 +8,8 @@ LIBS += $(LIBWRO)
OBJ-libwr := $D/fsm-table.o \
$D/state-initializing.o \
$D/state-faulty.o \
$D/state-disabled.o \
$D/state-listening.o \
$D/state-master.o \
$D/state-uncalibrated.o \
$D/state-slave.o \
$D/common-fun.o \
$D/bmc.o \
......
/*
* Aurelio Colosimo for CERN, 2011 -- GNU LGPL v2.1 or later
* Based on PTPd project v. 2.1.0 (see AUTHORS for details)
*/
#include <ppsi/ppsi.h>
int pp_disabled(struct pp_instance *ppi, unsigned char *pkt, int plen)
{
/* nothing to do */
DSPOR(ppi)->portState = PPS_DISABLED;
ppi->next_delay = PP_DEFAULT_NEXT_DELAY_MS;
return 0;
}
/*
* Aurelio Colosimo for CERN, 2011 -- GNU LGPL v2.1 or later
* Based on PTPd project v. 2.1.0 (see AUTHORS for details)
*/
#include <ppsi/ppsi.h>
#include <ppsi/diag.h>
/*
* Fault troubleshooting. Now only prints an error messages and comes back to
* PTP_INITIALIZING state
*/
int pp_faulty(struct pp_instance *ppi, unsigned char *pkt, int plen)
{
DSPOR(ppi)->portState = PPS_FAULTY;
PP_PRINTF("Faulty state detected\n");
ppi->next_state = PPS_INITIALIZING;
ppi->next_delay = PP_DEFAULT_NEXT_DELAY_MS * 4;
return 0;
}
/*
* Aurelio Colosimo for CERN, 2011 -- GNU LGPL v2.1 or later
* Based on PTPd project v. 2.1.0 (see AUTHORS for details)
*/
#include <ppsi/ppsi.h>
#include "common-fun.h"
int pp_passive(struct pp_instance *ppi, unsigned char *pkt, int plen)
{
int e = 0; /* error var, to check errors in msg handling */
if (ppi->is_new_state) {
DSPOR(ppi)->portState = PPS_PASSIVE;
pp_timer_start(
(1 << DSPOR(ppi)->logMinPdelayReqInterval) * 1000,
ppi->timers[PP_TIMER_PDELAYREQ]);
st_com_restart_annrec_timer(ppi);
}
if (st_com_check_record_update(ppi))
goto state_updated;
if (plen == 0)
goto no_incoming_msg;
switch (ppi->msg_tmp_header.messageType) {
case PPM_ANNOUNCE:
e = st_com_master_handle_announce(ppi, pkt, plen);
break;
case PPM_PDELAY_REQ:
e = st_com_handle_pdelay_req(ppi, pkt, plen);
break;
case PPM_SYNC:
e = st_com_master_handle_sync(ppi, pkt, plen);
break;
default:
/* disreguard, nothing to do */
break;
}
no_incoming_msg:
if (e == 0)
e = st_com_execute_slave(ppi, 0);
if (e != 0)
ppi->next_state = PPS_FAULTY;
state_updated:
/* Leaving this state */
if (ppi->next_state != ppi->state) {
pp_timer_stop(ppi->timers[PP_TIMER_ANN_RECEIPT]);
pp_timer_stop(ppi->timers[PP_TIMER_PDELAYREQ]);
}
ppi->next_delay = PP_DEFAULT_NEXT_DELAY_MS;
return 0;
}
/*
* Aurelio Colosimo for CERN, 2011 -- GNU LGPL v2.1 or later
* Based on PTPd project v. 2.1.0 (see AUTHORS for details)
*/
#include <ppsi/ppsi.h>
int pp_pre_master(struct pp_instance *ppi, unsigned char *pkt, int plen)
{
/*
* No need of PRE_MASTER state because of only ordinary clock
* implementation.
*/
DSPOR(ppi)->portState = PPS_PRE_MASTER;
return 0;
}
/*
* Aurelio Colosimo for CERN, 2011 -- GNU LGPL v2.1 or later
* Based on PTPd project v. 2.1.0 (see AUTHORS for details)
*/
#include <ppsi/ppsi.h>
#include "common-fun.h"
int pp_uncalibrated(struct pp_instance *ppi, unsigned char *pkt, int plen)
{
int e = 0; /* error var, to check errors in msg handling */
if (plen == 0)
goto no_incoming_msg;
switch (ppi->msg_tmp_header.messageType) {
case PPM_ANNOUNCE:
e = st_com_slave_handle_announce(ppi, pkt, plen);
break;
case PPM_SYNC:
e = st_com_slave_handle_sync(ppi, pkt, plen);
break;
case PPM_FOLLOW_UP:
e = st_com_slave_handle_followup(ppi, pkt, plen);
break;
default:
/* disreguard, nothing to do */
break;
}
no_incoming_msg:
if (e == 0)
e = st_com_execute_slave(ppi, 0);
if (e != 0)
ppi->next_state = PPS_FAULTY;
ppi->next_delay = PP_DEFAULT_NEXT_DELAY_MS;
return 0;
}
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