blob: 03cbc8fda6320a28e39aaa48f3ac02b791fd0fc6 [file] [log] [blame]
Amit Pundir33109f72020-02-07 22:26:08 +05301#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
21struct rmtfs_qmi_result {
22 uint16_t result;
23 uint16_t error;
24};
25
26struct rmtfs_iovec_entry {
27 uint32_t sector_addr;
28 uint32_t phys_offset;
29 uint32_t num_sector;
30};
31
32struct rmtfs_open_req {
33 uint32_t path_len;
34 char path[256];
35};
36
37struct rmtfs_open_resp {
38 struct rmtfs_qmi_result result;
39 bool caller_id_valid;
40 uint32_t caller_id;
41};
42
43struct rmtfs_close_req {
44 uint32_t caller_id;
45};
46
47struct rmtfs_close_resp {
48 struct rmtfs_qmi_result result;
49};
50
51struct 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
59struct rmtfs_iovec_resp {
60 struct rmtfs_qmi_result result;
61};
62
63struct rmtfs_alloc_buf_req {
64 uint32_t caller_id;
65 uint32_t buff_size;
66};
67
68struct rmtfs_alloc_buf_resp {
69 struct rmtfs_qmi_result result;
70 bool buff_address_valid;
71 uint64_t buff_address;
72};
73
74struct rmtfs_dev_error_req {
75 uint32_t caller_id;
76};
77
78struct rmtfs_dev_error_resp {
79 struct rmtfs_qmi_result result;
80 bool status_valid;
81 uint8_t status;
82};
83
84struct rmtfs_force_sync {
85 size_t caller_id_len;
86 uint32_t caller_id[10];
87};
88
89extern struct qmi_elem_info rmtfs_open_req_ei[];
90extern struct qmi_elem_info rmtfs_open_resp_ei[];
91extern struct qmi_elem_info rmtfs_close_req_ei[];
92extern struct qmi_elem_info rmtfs_close_resp_ei[];
93extern struct qmi_elem_info rmtfs_iovec_req_ei[];
94extern struct qmi_elem_info rmtfs_iovec_resp_ei[];
95extern struct qmi_elem_info rmtfs_alloc_buf_req_ei[];
96extern struct qmi_elem_info rmtfs_alloc_buf_resp_ei[];
97extern struct qmi_elem_info rmtfs_dev_error_req_ei[];
98extern struct qmi_elem_info rmtfs_dev_error_resp_ei[];
99extern struct qmi_elem_info rmtfs_force_sync_ei[];
100
101#endif