1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /* Copyright (c) 2020, The Linux Foundation. All rights reserved.
3  * Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved.
4  */
5 
6 #ifndef IP_MULTIMEDIA_SUBSYSTEM_PRIVATE_SERVICE_V01_H
7 #define IP_MULTIMEDIA_SUBSYSTEM_PRIVATE_SERVICE_V01_H
8 
9 #include <linux/soc/qcom/qmi.h>
10 
11 #define IMSPRIVATE_SERVICE_ID_V01 0x4D
12 #define IMSPRIVATE_SERVICE_VERS_V01 0x01
13 
14 #define QMI_IMS_PRIVATE_SERVICE_SUBSCRIBE_FOR_INDICATIONS_RSP_V01 0x003E
15 #define QMI_IMS_PRIVATE_SERVICE_WFC_CALL_STATUS_IND_V01 0x0040
16 #define QMI_IMS_PRIVATE_SERVICE_SUBSCRIBE_FOR_INDICATIONS_REQ_V01 0x003E
17 #define QMI_IMS_PRIVATE_SERVICE_MT_INVITE_IND_V01 0x003F
18 #define QMI_IMS_PRIVATE_SERVICE_WFC_CALL_TWT_CONFIG_RSP_V01 0x0041
19 #define QMI_IMS_PRIVATE_SERVICE_WFC_CALL_TWT_CONFIG_REQ_V01 0x0041
20 
21 #define IMS_PRIVATE_SERVICE_MAX_MT_INVITE_HEADERS_V01 15
22 #define IMS_PRIVATE_SERVICE_HEADER_STR_LEN_V01 1024
23 #define IMS_PRIVATE_SERVICE_MAX_ICCID_LEN_V01 21
24 
25 enum ims_common_resp_enum_v01 {
26 	IMS_COMMON_RESP_ENUM_MIN_VAL_V01 = INT_MIN,
27 	IMS_COMMON_MSG_NO_ERR_V01 = 0,
28 	IMS_COMMON_MSG_IMS_NOT_READY_V01 = 1,
29 	IMS_COMMON_MSG_FILE_NOT_AVAILABLE_V01 = 2,
30 	IMS_COMMON_MSG_READ_FAILED_V01 = 3,
31 	IMS_COMMON_MSG_WRITE_FAILED_V01 = 4,
32 	IMS_COMMON_MSG_OTHER_INTERNAL_ERR_V01 = 5,
33 	IMS_COMMON_RESP_ENUM_MAX_VAL_V01 = INT_MAX,
34 };
35 
36 enum ims_subscription_type_enum_v01 {
37 	IMS_SUBSCRIPTION_TYPE_ENUM_MIN_VAL_V01 = INT_MIN,
38 	IMS_SUBSCRIPTION_TYPE_NONE_V01 = -1,
39 	IMS_SUBSCRIPTION_TYPE_PRIMARY_V01 = 0,
40 	IMS_SUBSCRIPTION_TYPE_SECONDARY_V01 = 1,
41 	IMS_SUBSCRIPTION_TYPE_TERTIARY_V01 = 2,
42 	IMS_SUBSCRIPTION_TYPE_ENUM_MAX_VAL_V01 = INT_MAX,
43 };
44 
45 enum wfc_media_quality_v01 {
46 	WFC_MEDIA_QUALITY_MIN_VAL_V01 = INT_MIN,
47 	WFC_MEDIA_QUAL_NOT_AVAILABLE_V01 = 0,
48 	WFC_MEDIA_QUAL_BAD_V01 = 1,
49 	WFC_MEDIA_QUAL_GOOD_V01 = 2,
50 	WFC_MEDIA_QUAL_EXCELLENT_V01 = 3,
51 	WFC_MEDIA_QUALITY_MAX_VAL_V01 = INT_MAX,
52 };
53 
54 struct ims_private_service_header_value_v01 {
55 	char header[IMS_PRIVATE_SERVICE_HEADER_STR_LEN_V01 + 1];
56 	char value[IMS_PRIVATE_SERVICE_HEADER_STR_LEN_V01 + 1];
57 };
58 
59 struct ims_private_service_subscribe_for_indications_req_msg_v01 {
60 	u8 mt_invite_valid;
61 	u8 mt_invite;
62 	u8 wfc_call_status_valid;
63 	u8 wfc_call_status;
64 };
65 
66 #define IMS_PRIVATE_SERVICE_SUBSCRIBE_FOR_INDICATIONS_REQ_MSG_V01_MAX_MSG_LEN 8
67 extern struct qmi_elem_info
68 ims_private_service_subscribe_ind_req_msg_v01_ei[];
69 
70 struct ims_private_service_subscribe_for_indications_rsp_msg_v01 {
71 	struct qmi_response_type_v01 resp;
72 };
73 
74 #define IMS_PRIVATE_SERVICE_SUBSCRIBE_FOR_INDICATIONS_RSP_MSG_V01_MAX_MSG_LEN 7
75 extern struct qmi_elem_info
76 ims_private_service_subscribe_ind_rsp_msg_v01_ei[];
77 
78 struct ims_private_service_mt_invite_ind_msg_v01 {
79 	enum ims_subscription_type_enum_v01 subscription_type;
80 	u8 iccid_valid;
81 	char iccid[IMS_PRIVATE_SERVICE_MAX_ICCID_LEN_V01 + 1];
82 	u8 header_value_list_valid;
83 	u32 header_value_list_len;
84 	struct ims_private_service_header_value_v01
85 	header_value_list[IMS_PRIVATE_SERVICE_MAX_MT_INVITE_HEADERS_V01];
86 };
87 
88 #define IMS_PRIVATE_SERVICE_MT_INVITE_IND_MSG_V01_MAX_MSG_LEN 30815
89 extern struct qmi_elem_info ims_private_service_mt_invite_ind_msg_v01_ei[];
90 
91 struct ims_private_service_wfc_call_status_ind_msg_v01 {
92 	u8 wfc_call_active;
93 	u8 all_wfc_calls_held_valid;
94 	u8 all_wfc_calls_held;
95 	u8 is_wfc_emergency_valid;
96 	u8 is_wfc_emergency;
97 	u8 twt_ims_start_valid;
98 	u64 twt_ims_start;
99 	u8 twt_ims_int_valid;
100 	u16 twt_ims_int;
101 	u8 media_quality_valid;
102 	enum wfc_media_quality_v01 media_quality;
103 };
104 
105 #define IMS_PRIVATE_SERVICE_WFC_CALL_STATUS_IND_MSG_V01_MAX_MSG_LEN 35
106 extern struct qmi_elem_info
107 ims_private_service_wfc_call_status_ind_msg_v01_ei[];
108 
109 struct ims_private_service_wfc_call_twt_config_req_msg_v01 {
110 	u8 twt_sta_start_valid;
111 	u64 twt_sta_start;
112 	u8 twt_sta_int_valid;
113 	u16 twt_sta_int;
114 	u8 twt_sta_upo_valid;
115 	u16 twt_sta_upo;
116 	u8 twt_sta_sp_valid;
117 	u16 twt_sta_sp;
118 	u8 twt_sta_dl_valid;
119 	u16 twt_sta_dl;
120 	u8 twt_sta_config_changed_valid;
121 	u8 twt_sta_config_changed;
122 };
123 
124 #define IMS_PRIVATE_SERVICE_WFC_CALL_TWT_CONFIG_REQ_MSG_V01_MAX_MSG_LEN 35
125 extern struct qmi_elem_info
126 ims_private_service_wfc_call_twt_config_req_msg_v01_ei[];
127 
128 struct ims_private_service_wfc_call_twt_config_rsp_msg_v01 {
129 	struct qmi_response_type_v01 resp;
130 };
131 
132 #define IMS_PRIVATE_SERVICE_WFC_CALL_TWT_CONFIG_RSP_MSG_V01_MAX_MSG_LEN 7
133 extern struct qmi_elem_info
134 ims_private_service_wfc_call_twt_config_rsp_msg_v01_ei[];
135 
136 #endif
137