Commit 5d9c5024 authored by Alessandro Rubini's avatar Alessandro Rubini Committed by Adam Wujek

arch-wrpc: change how to get/set mechanism

Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent 64bcec12
...@@ -189,18 +189,22 @@ int wrc_ptp_get_mode() ...@@ -189,18 +189,22 @@ int wrc_ptp_get_mode()
return ptp_mode; return ptp_mode;
} }
void wrc_ptp_set_sync_mech(int mech) int wrc_ptp_sync_mech(int e2e_p2p_qry)
{ {
struct pp_instance *ppi = &ppi_static; struct pp_instance *ppi = &ppi_static;
int running;
wrc_ptp_stop();
ppi->mech = mech; switch(e2e_p2p_qry) {
} case PP_E2E_MECH:
case PP_P2P_MECH:
int wrc_ptp_get_sync_mech() running = wrc_ptp_run(-1);
{ wrc_ptp_run(0);
struct pp_instance *ppi = &ppi_static; ppi->mech = e2e_p2p_qry;
return ppi->mech; wrc_ptp_run(running);
return 0;
default:
return ppi->mech;
}
} }
int wrc_ptp_start() int wrc_ptp_start()
......
...@@ -24,8 +24,7 @@ extern int ptp_mode; ...@@ -24,8 +24,7 @@ extern int ptp_mode;
int wrc_ptp_init(void); int wrc_ptp_init(void);
int wrc_ptp_set_mode(int mode); int wrc_ptp_set_mode(int mode);
int wrc_ptp_get_mode(void); int wrc_ptp_get_mode(void);
void wrc_ptp_set_sync_mech(int mech); int wrc_ptp_sync_mech(int e2e_p2p_qry);
int wrc_ptp_get_sync_mech(void);
int wrc_ptp_start(void); int wrc_ptp_start(void);
int wrc_ptp_stop(void); int wrc_ptp_stop(void);
int wrc_ptp_run(int start_stop_qry); int wrc_ptp_run(int start_stop_qry);
......
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