Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cdb04072 authored by Yuanyuan Liu's avatar Yuanyuan Liu
Browse files

cnss2: Add support for communicate with IMS server



Add support for communicate with IMS server. CNSS2 platform
will register for WFC call status indication and pass data
to WLAN FW later.

Change-Id: I427ac09d9907106c63ba60953855d8b70709473b
Signed-off-by: default avatarYuanyuan Liu <yuanliu@codeaurora.org>
parent d1d3fafc
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -8,4 +8,4 @@ cnss2-y += debug.o
cnss2-y += pci.o
cnss2-y += power.o
cnss2-$(CONFIG_CNSS2_DEBUG) += genl.o
cnss2-$(CONFIG_CNSS2_QMI) += qmi.o wlan_firmware_service_v01.o coexistence_service_v01.o
cnss2-$(CONFIG_CNSS2_QMI) += qmi.o wlan_firmware_service_v01.o coexistence_service_v01.o ip_multimedia_subsystem_private_service_v01.o
+3 −0
Original line number Diff line number Diff line
@@ -100,6 +100,9 @@ static int cnss_stats_show_state(struct seq_file *s,
		case CNSS_COEX_CONNECTED:
			seq_puts(s, "COEX_CONNECTED");
			continue;
		case CNSS_IMS_CONNECTED:
			seq_puts(s, "IMS_CONNECTED");
			continue;
		}

		seq_printf(s, "UNKNOWN-%d", i);
+93 −0
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/* Copyright (c) 2019, The Linux Foundation. All rights reserved. */

#include <linux/soc/qcom/qmi.h>

#include "ip_multimedia_subsystem_private_service_v01.h"

struct qmi_elem_info
ims_private_service_subscribe_for_indications_req_msg_v01_ei[] = {
	{
		.data_type      = QMI_OPT_FLAG,
		.elem_len       = 1,
		.elem_size      = sizeof(u8),
		.array_type       = NO_ARRAY,
		.tlv_type       = 0x10,
		.offset         = offsetof(struct
		ims_private_service_subscribe_for_indications_req_msg_v01,
				mt_invite_valid),
	},
	{
		.data_type      = QMI_UNSIGNED_1_BYTE,
		.elem_len       = 1,
		.elem_size      = sizeof(u8),
		.array_type       = NO_ARRAY,
		.tlv_type       = 0x10,
		.offset         = offsetof(struct
		ims_private_service_subscribe_for_indications_req_msg_v01,
				mt_invite),
	},
	{
		.data_type      = QMI_OPT_FLAG,
		.elem_len       = 1,
		.elem_size      = sizeof(u8),
		.array_type       = NO_ARRAY,
		.tlv_type       = 0x11,
		.offset         = offsetof(struct
		ims_private_service_subscribe_for_indications_req_msg_v01,
				wfc_call_status_valid),
	},
	{
		.data_type      = QMI_UNSIGNED_1_BYTE,
		.elem_len       = 1,
		.elem_size      = sizeof(u8),
		.array_type       = NO_ARRAY,
		.tlv_type       = 0x11,
		.offset         = offsetof(struct
		ims_private_service_subscribe_for_indications_req_msg_v01,
				wfc_call_status),
	},
	{
		.data_type      = QMI_EOTI,
		.array_type       = NO_ARRAY,
		.tlv_type       = QMI_COMMON_TLV_TYPE,
	},
};

struct qmi_elem_info
ims_private_service_subscribe_for_indications_rsp_msg_v01_ei[] = {
	{
		.data_type      = QMI_STRUCT,
		.elem_len       = 1,
		.elem_size      = sizeof(struct qmi_response_type_v01),
		.array_type       = NO_ARRAY,
		.tlv_type       = 0x02,
		.offset         = offsetof(struct
		ims_private_service_subscribe_for_indications_rsp_msg_v01,
				resp),
		.ei_array      = qmi_response_type_v01_ei,
	},
	{
		.data_type      = QMI_EOTI,
		.array_type       = NO_ARRAY,
		.tlv_type       = QMI_COMMON_TLV_TYPE,
	},
};

struct qmi_elem_info ims_private_service_wfc_call_status_ind_msg_v01_ei[] = {
	{
		.data_type      = QMI_UNSIGNED_1_BYTE,
		.elem_len       = 1,
		.elem_size      = sizeof(u8),
		.array_type       = NO_ARRAY,
		.tlv_type       = 0x01,
		.offset         = offsetof(struct
				ims_private_service_wfc_call_status_ind_msg_v01,
				wfc_call_active),
	},
	{
		.data_type      = QMI_EOTI,
		.array_type       = NO_ARRAY,
		.tlv_type       = QMI_COMMON_TLV_TYPE,
	},
};
+43 −0
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0-only */
/* Copyright (c) 2019, The Linux Foundation. All rights reserved. */

#ifndef IP_MULTIMEDIA_SUBSYSTEM_PRIVATE_SERVICE_V01_H
#define IP_MULTIMEDIA_SUBSYSTEM_PRIVATE_SERVICE_V01_H

#define IMSPRIVATE_SERVICE_ID_V01 0x4D
#define IMSPRIVATE_SERVICE_VERS_V01 0x01

#define IMSPRIVATE_SERVICE_MAX_MSG_LEN 8

#define QMI_IMS_PRIVATE_SERVICE_SUBSCRIBE_FOR_INDICATIONS_RSP_V01 0x003E
#define QMI_IMS_PRIVATE_SERVICE_SUBSCRIBE_FOR_INDICATIONS_REQ_V01 0x003E
#define QMI_IMS_PRIVATE_SERVICE_WFC_CALL_STATUS_IND_V01 0x0040

struct ims_private_service_subscribe_for_indications_req_msg_v01 {
	u8 mt_invite_valid;
	u8 mt_invite;
	u8 wfc_call_status_valid;
	u8 wfc_call_status;
};

#define IMS_PRIVATE_SERVICE_SUBSCRIBE_FOR_INDICATIONS_REQ_MSG_V01_MAX_MSG_LEN 8
extern struct
qmi_elem_info ims_private_service_subscribe_for_indications_req_msg_v01_ei[];

struct ims_private_service_subscribe_for_indications_rsp_msg_v01 {
	struct qmi_response_type_v01 resp;
};

#define IMS_PRIVATE_SERVICE_SUBSCRIBE_FOR_INDICATIONS_RSP_MSG_V01_MAX_MSG_LEN 7
extern struct
qmi_elem_info ims_private_service_subscribe_for_indications_rsp_msg_v01_ei[];

struct ims_private_service_wfc_call_status_ind_msg_v01 {
	u8 wfc_call_active;
};

#define IMS_PRIVATE_SERVICE_WFC_CALL_STATUS_IND_MSG_V01_MAX_MSG_LEN 4
extern struct
qmi_elem_info ims_private_service_wfc_call_status_ind_msg_v01_ei[];

#endif
+2 −0
Original line number Diff line number Diff line
@@ -1992,6 +1992,7 @@ static int cnss_probe(struct platform_device *plat_dev)
		goto destroy_debugfs;

	cnss_register_coex_service(plat_priv);
	cnss_register_ims_service(plat_priv);

	ret = cnss_genl_init();
	if (ret < 0)
@@ -2033,6 +2034,7 @@ static int cnss_remove(struct platform_device *plat_dev)
	struct cnss_plat_data *plat_priv = platform_get_drvdata(plat_dev);

	cnss_genl_exit();
	cnss_unregister_ims_service(plat_priv);
	cnss_unregister_coex_service(plat_priv);
	cnss_misc_deinit(plat_priv);
	cnss_debugfs_destroy(plat_priv);
Loading