Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
W
White Rabbit Switch - Software
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
86
Issues
86
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
CI / CD
CI / CD
Pipelines
Schedules
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
White Rabbit Switch - Software
Commits
a435f9df
Commit
a435f9df
authored
Feb 25, 2019
by
baujc
Committed by
Adam Wujek
Apr 10, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
HAL exports : Add get_timing_mode_state
parent
fb853dc9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
30 deletions
+28
-30
hal_exports.h
userspace/include/hal_exports.h
+12
-28
hal_exports.c
userspace/wrsw_hal/hal_exports.c
+14
-2
wrsw_hal.h
userspace/wrsw_hal/wrsw_hal.h
+2
-0
No files found.
userspace/include/hal_exports.h
View file @
a435f9df
...
...
@@ -38,6 +38,9 @@
#define HEXP_PPSG_CMD_ADJUST_NSEC 3
#define HEXP_PPSG_CMD_POLL 4
#define HEXP_PPSG_CMD_SET_VALID 5
#define HEXP_PPSG_CMD_SET_TIMING_MODE 6
#define HEXP_PPSG_CMD_GET_TIMING_MODE 7
#define HEXP_PPSG_CMD_GET_TIMING_MODE_STATE 8
#define HEXP_ON 1
#define HEXP_OFF 0
...
...
@@ -56,6 +59,11 @@
#define HAL_TIMING_MODE_GRAND_MASTER 0
#define HAL_TIMING_MODE_FREE_MASTER 1
#define HAL_TIMING_MODE_BC 2
#define HAL_TIMING_MODE_DISABLED 3
#define HAL_TIMING_MODE_TMDT_UNLOCKED 0
#define HAL_TIMING_MODE_TMDT_LOCKED 1
#define HAL_TIMING_MODE_TMDT_HOLDHOVER 2
typedef
struct
{
...
...
@@ -72,6 +80,7 @@ typedef struct {
uint64_t
current_sec
;
uint32_t
current_nsec
;
uint32_t
timing_mode
;
}
hexp_pps_params_t
;
/* Port modes (hal_port_state.mode) */
...
...
@@ -87,36 +96,11 @@ typedef struct {
#define HEXP_PORT_TSC_FALLING 2
*/
extern
struct
minipc_pd
__rpcdef_lock_cmd
;
extern
struct
minipc_pd
__rpcdef_pps_cmd
;
/* Prototypes of functions that call on rpc */
extern
int
halexp_lock_cmd
(
const
char
*
port_name
,
int
command
,
int
priority
);
extern
int
halexp_pps_cmd
(
int
cmd
,
hexp_pps_params_t
*
params
);
/* Export structures, shared by server and client for argument matching */
#ifdef HAL_EXPORT_STRUCTURES
//int halexp_lock_cmd(const char *port_name, int command, int priority);
struct
minipc_pd
__rpcdef_lock_cmd
=
{
.
name
=
"lock_cmd"
,
.
retval
=
MINIPC_ARG_ENCODE
(
MINIPC_ATYPE_INT
,
int
),
.
args
=
{
MINIPC_ARG_ENCODE
(
MINIPC_ATYPE_STRING
,
char
*
),
MINIPC_ARG_ENCODE
(
MINIPC_ATYPE_INT
,
int
),
MINIPC_ARG_ENCODE
(
MINIPC_ATYPE_INT
,
int
),
MINIPC_ARG_END
,
},
};
//int halexp_pps_cmd(int cmd, hexp_pps_params_t *params);
struct
minipc_pd
__rpcdef_pps_cmd
=
{
.
name
=
"pps_cmd"
,
.
retval
=
MINIPC_ARG_ENCODE
(
MINIPC_ATYPE_INT
,
int
),
.
args
=
{
MINIPC_ARG_ENCODE
(
MINIPC_ATYPE_INT
,
int
),
MINIPC_ARG_ENCODE
(
MINIPC_ATYPE_STRUCT
,
hexp_pps_params_t
),
MINIPC_ARG_END
,
},
};
#endif
/* HAL_EXPORT_STRUCTURES */
#endif
userspace/wrsw_hal/hal_exports.c
View file @
a435f9df
...
...
@@ -15,7 +15,6 @@
#include <minipc.h>
#include <libwr/shmem.h>
#define HAL_EXPORT_STRUCTURES
#include <hal_exports.h>
/* for exported structs/function protos */
static
struct
minipc_ch
*
hal_ch
;
...
...
@@ -78,7 +77,7 @@ int halexp_lock_cmd(const char *port_name, int command, int priority)
* both the PLLs and the PPS Generator. */
int
halexp_pps_cmd
(
int
cmd
,
hexp_pps_params_t
*
params
)
{
int
busy
;
int
busy
,
ret
;
pr_debug
(
"halexp_pps_cmd: cmd=%d
\n
"
,
cmd
);
switch
(
cmd
)
{
...
...
@@ -143,6 +142,19 @@ int halexp_pps_cmd(int cmd, hexp_pps_params_t * params)
case
HEXP_PPSG_CMD_SET_VALID
:
return
shw_pps_gen_enable_output
(
params
->
pps_valid
);
case
HEXP_PPSG_CMD_SET_TIMING_MODE
:
ret
=
shw_pps_set_timing_mode
(
params
->
timing_mode
);
hal_update_timing_mode
();
return
ret
;
case
HEXP_PPSG_CMD_GET_TIMING_MODE
:{
ret
=
hal_get_timing_mode
();
printf
(
"JCB: shw_pps_get_timing_mode() returns %d
\n
"
,
ret
);
return
ret
;
}
case
HEXP_PPSG_CMD_GET_TIMING_MODE_STATE
:
return
shw_pps_get_timing_mode_state
();
}
return
-
1
;
/* fixme: real error code */
}
...
...
userspace/wrsw_hal/wrsw_hal.h
View file @
a435f9df
...
...
@@ -31,10 +31,12 @@ int hal_port_start_lock(const char *port_name, int priority);
int
hal_port_check_lock
(
const
char
*
port_name
);
int
hal_port_reset
(
const
char
*
port_name
);
int
hal_port_enable_tracking
(
const
char
*
port_name
);
int
hal_port_poll_rts_state
(
void
);
int
hal_init_timing_mode
(
void
);
int
hal_init_timing
(
char
*
filename
);
int
hal_get_timing_mode
(
void
);
int
hal_update_timing_mode
(
void
);
int
hal_port_pshifter_busy
(
void
);
#endif
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment