1 #ifndef __QMI_RMTFS_H__
2 #define __QMI_RMTFS_H__
3 
4 #include <stdint.h>
5 #include <stdbool.h>
6 
7 #include "libqrtr.h"
8 
9 #define QMI_RMTFS_RESULT_SUCCESS 0
10 #define QMI_RMTFS_RESULT_FAILURE 1
11 #define QMI_RMTFS_ERR_NONE 0
12 #define QMI_RMTFS_ERR_INTERNAL 1
13 #define QMI_RMTFS_ERR_MALFORMED_MSG 2
14 #define QMI_RMTFS_OPEN 1
15 #define QMI_RMTFS_CLOSE 2
16 #define QMI_RMTFS_RW_IOVEC 3
17 #define QMI_RMTFS_ALLOC_BUFF 4
18 #define QMI_RMTFS_GET_DEV_ERROR 5
19 #define QMI_RMTFS_FORCE_SYNC_IND 6
20 
21 struct rmtfs_qmi_result {
22 	uint16_t result;
23 	uint16_t error;
24 };
25 
26 struct rmtfs_iovec_entry {
27 	uint32_t sector_addr;
28 	uint32_t phys_offset;
29 	uint32_t num_sector;
30 };
31 
32 struct rmtfs_open_req {
33 	uint32_t path_len;
34 	char path[256];
35 };
36 
37 struct rmtfs_open_resp {
38 	struct rmtfs_qmi_result result;
39 	bool caller_id_valid;
40 	uint32_t caller_id;
41 };
42 
43 struct rmtfs_close_req {
44 	uint32_t caller_id;
45 };
46 
47 struct rmtfs_close_resp {
48 	struct rmtfs_qmi_result result;
49 };
50 
51 struct rmtfs_iovec_req {
52 	uint32_t caller_id;
53 	uint8_t direction;
54 	size_t iovec_len;
55 	struct rmtfs_iovec_entry iovec[255];
56 	uint8_t is_force_sync;
57 };
58 
59 struct rmtfs_iovec_resp {
60 	struct rmtfs_qmi_result result;
61 };
62 
63 struct rmtfs_alloc_buf_req {
64 	uint32_t caller_id;
65 	uint32_t buff_size;
66 };
67 
68 struct rmtfs_alloc_buf_resp {
69 	struct rmtfs_qmi_result result;
70 	bool buff_address_valid;
71 	uint64_t buff_address;
72 };
73 
74 struct rmtfs_dev_error_req {
75 	uint32_t caller_id;
76 };
77 
78 struct rmtfs_dev_error_resp {
79 	struct rmtfs_qmi_result result;
80 	bool status_valid;
81 	uint8_t status;
82 };
83 
84 struct rmtfs_force_sync {
85 	size_t caller_id_len;
86 	uint32_t caller_id[10];
87 };
88 
89 extern struct qmi_elem_info rmtfs_open_req_ei[];
90 extern struct qmi_elem_info rmtfs_open_resp_ei[];
91 extern struct qmi_elem_info rmtfs_close_req_ei[];
92 extern struct qmi_elem_info rmtfs_close_resp_ei[];
93 extern struct qmi_elem_info rmtfs_iovec_req_ei[];
94 extern struct qmi_elem_info rmtfs_iovec_resp_ei[];
95 extern struct qmi_elem_info rmtfs_alloc_buf_req_ei[];
96 extern struct qmi_elem_info rmtfs_alloc_buf_resp_ei[];
97 extern struct qmi_elem_info rmtfs_dev_error_req_ei[];
98 extern struct qmi_elem_info rmtfs_dev_error_resp_ei[];
99 extern struct qmi_elem_info rmtfs_force_sync_ei[];
100 
101 #endif
102