Commit d755255f authored by Adam Wujek's avatar Adam Wujek 💬 Committed by Alessandro Rubini

exclude some code when p2p is not compiled

Saves ~150 bytes
Signed-off-by: Adam Wujek's avatarAdam Wujek <adam.wujek@cern.ch>
parent 28fe78eb
......@@ -194,6 +194,9 @@ int wrc_ptp_sync_mech(int e2e_p2p_qry)
struct pp_instance *ppi = &ppi_static;
int running;
if (!CONFIG_HAS_P2P)
return ppi->mech;
switch(e2e_p2p_qry) {
case PP_E2E_MECH:
case PP_P2P_MECH:
......
......@@ -221,9 +221,11 @@ static struct pp_argname arg_mech[] = {
{"request-response", PP_E2E_MECH},
{"delay", PP_E2E_MECH},
{"e2e", PP_E2E_MECH},
#ifdef CONFIG_P2P
{"peer-delay", PP_P2P_MECH},
{"pdelay", PP_P2P_MECH},
{"p2p", PP_P2P_MECH},
#endif
{},
};
......
......@@ -29,7 +29,7 @@ static int wrpc_open_ch(struct pp_instance *ppi)
struct wr_sockaddr addr;
char *macaddr = PP_MCAST_MACADDRESS;
if (ppi->mech == PP_P2P_MECH)
if (CONFIG_HAS_P2P && ppi->mech == PP_P2P_MECH)
macaddr = PP_PDELAY_MACADDRESS;
addr.ethertype = htons(ETH_P_1588);
memcpy(addr.mac, macaddr, sizeof(mac_addr_t));
......
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