1
2
3
4
5
6
7
8
9 #ifndef _COSM_COSM_H_
10 #define _COSM_COSM_H_
11
12 #include <linux/scif.h>
13 #include "../bus/cosm_bus.h"
14
15 #define COSM_HEARTBEAT_SEND_SEC 30
16 #define SCIF_COSM_LISTEN_PORT 201
17
18
19
20
21
22
23
24
25 enum cosm_msg_id {
26 COSM_MSG_SHUTDOWN,
27 COSM_MSG_SYNC_TIME,
28 COSM_MSG_HEARTBEAT,
29 COSM_MSG_SHUTDOWN_STATUS,
30 };
31
32 struct cosm_msg {
33 u64 id;
34 union {
35 u64 shutdown_status;
36 struct {
37 u64 tv_sec;
38 u64 tv_nsec;
39 } timespec;
40 };
41 };
42
43 extern const char * const cosm_state_string[];
44 extern const char * const cosm_shutdown_status_string[];
45
46 void cosm_sysfs_init(struct cosm_device *cdev);
47 int cosm_start(struct cosm_device *cdev);
48 void cosm_stop(struct cosm_device *cdev, bool force);
49 int cosm_reset(struct cosm_device *cdev);
50 int cosm_shutdown(struct cosm_device *cdev);
51 void cosm_set_state(struct cosm_device *cdev, u8 state);
52 void cosm_set_shutdown_status(struct cosm_device *cdev, u8 status);
53 void cosm_init_debugfs(void);
54 void cosm_exit_debugfs(void);
55 void cosm_create_debug_dir(struct cosm_device *cdev);
56 void cosm_delete_debug_dir(struct cosm_device *cdev);
57 int cosm_scif_init(void);
58 void cosm_scif_exit(void);
59 void cosm_scif_work(struct work_struct *work);
60
61 #endif