Commit ca26578f authored by Alessandro Rubini's avatar Alessandro Rubini

trivial: fold pre-master.c into master.c

Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent 4f221227
......@@ -419,13 +419,6 @@ extern pp_action pp_initializing, pp_faulty, pp_disabled, pp_listening,
pp_pre_master, pp_master, pp_passive, pp_uncalibrated,
pp_slave, pp_pclock;;
/*
* MASTER and PRE_MASTER have many things in common. This function implements
* both states. It is invoked by pp_master and pp_pre_master with pre
* respectively equal to 0 and 1.
*/
extern int _pp_master(struct pp_instance *ppi, uint8_t *pkt, int plen, int pre);
/* The engine */
extern int pp_state_machine(struct pp_instance *ppi, uint8_t *packet, int plen);
......
......@@ -9,7 +9,6 @@ OBJ-y += $D/fsm-table.o \
$D/state-faulty.o \
$D/state-disabled.o \
$D/state-listening.o \
$D/state-pre-master.o \
$D/state-master.o \
$D/state-passive.o \
$D/state-uncalibrated.o \
......
......@@ -10,9 +10,11 @@
#include "common-fun.h"
/*
* pre indicates that we're in PRE_MASTER slave
* MASTER and PRE_MASTER have many things in common. This function implements
* both states. It is invoked by pp_master and pp_pre_master with pre
* respectively equal to 0 and 1.
*/
int _pp_master(struct pp_instance *ppi, uint8_t *pkt, int plen, int pre)
static int _pp_master(struct pp_instance *ppi, uint8_t *pkt, int plen, int pre)
{
int msgtype;
int e = 0; /* error var, to check errors in msg handling */
......@@ -120,3 +122,8 @@ int pp_master(struct pp_instance *ppi, uint8_t *pkt, int plen)
{
return _pp_master(ppi, pkt, plen, 0);
}
int pp_pre_master(struct pp_instance *ppi, unsigned char *pkt, int plen)
{
return _pp_master(ppi, pkt, plen, 1);
}
/*
* Copyright (C) 2011 CERN (www.cern.ch)
* Author: Aurelio Colosimo
* Based on PTPd project v. 2.1.0 (see AUTHORS for details)
*
* Released according to the GNU LGPL, version 2.1 or any later version.
*/
#include <ppsi/ppsi.h>
int pp_pre_master(struct pp_instance *ppi, unsigned char *pkt, int plen)
{
return _pp_master(ppi, pkt, plen, 1);
}
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