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

Commit f9bb9f5f authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: ipa3: Cleanup MHIP Dl rules on IPACM restart"

parents dc106b79 edd49fca
Loading
Loading
Loading
Loading
+22 −1
Original line number Diff line number Diff line
@@ -259,6 +259,24 @@ static int ipa3_clean_modem_rule(void)
	return val;
}

static int ipa3_clean_mhip_dl_rule(void)
{
	struct ipa_remove_offload_connection_req_msg_v01 req;

	memset(&req, 0, sizeof(struct
		ipa_remove_offload_connection_req_msg_v01));

	req.clean_all_rules_valid = true;
	req.clean_all_rules = true;

	if (ipa3_qmi_rmv_offload_request_send(&req)) {
		IPAWANDBG("clean dl rule cache failed\n");
		return -EFAULT;
	}

	return 0;
}

static int ipa3_active_clients_panic_notifier(struct notifier_block *this,
		unsigned long event, void *ptr)
{
@@ -1862,6 +1880,9 @@ static long ipa3_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
		memset(&nat_del, 0, sizeof(nat_del));
		nat_del.table_index = 0;
		retval = ipa3_nat_del_cmd(&nat_del);
		if (ipa3_ctx->platform_type == IPA_PLAT_TYPE_APQ)
			retval = ipa3_clean_mhip_dl_rule();
		else
			retval = ipa3_clean_modem_rule();
		ipa3_counter_id_remove_all();
		break;
+9 −0
Original line number Diff line number Diff line
@@ -1088,6 +1088,15 @@ int ipa3_qmi_rmv_offload_request_send(
	req_desc.msg_id = QMI_IPA_REMOVE_OFFLOAD_CONNECTION_REQ_V01;
	req_desc.ei_array = ipa_remove_offload_connection_req_msg_v01_ei;

	/* clean the Dl rules  in the cache if flag is set */
	if (req->clean_all_rules) {
		for (i = 0; i < QMI_IPA_MAX_FILTERS_V01; i++)
			if (ipa3_qmi_ctx->ipa_offload_cache[i].valid)
				ipa3_qmi_ctx->ipa_offload_cache[i].valid =
				false;
	}


	memset(&resp, 0, sizeof(struct
		ipa_remove_offload_connection_resp_msg_v01));
	resp_desc.max_msg_len =
+40 −0
Original line number Diff line number Diff line
@@ -4948,6 +4948,26 @@ struct qmi_elem_info ipa_add_offload_connection_req_msg_v01_ei[] = {
			struct ipa_add_offload_connection_req_msg_v01,
			embedded_call_mux_id),
	},
	{
		.data_type      = QMI_OPT_FLAG,
		.elem_len       = 1,
		.elem_size      = sizeof(u8),
		.is_array       = NO_ARRAY,
		.tlv_type       = 0x15,
		.offset         = offsetof(
			struct ipa_add_offload_connection_req_msg_v01,
			default_mhi_path_valid),
	},
	{
		.data_type      = QMI_UNSIGNED_1_BYTE,
		.elem_len       = 1,
		.elem_size      = sizeof(u8),
		.is_array       = NO_ARRAY,
		.tlv_type       = 0x15,
		.offset         = offsetof(
			struct ipa_add_offload_connection_req_msg_v01,
			default_mhi_path),
	},
	{
		.data_type      = QMI_EOTI,
		.is_array       = NO_ARRAY,
@@ -5041,6 +5061,26 @@ struct qmi_elem_info ipa_remove_offload_connection_req_msg_v01_ei[] = {
		.ei_array      =
			ipa3_filter_rule_identifier_to_handle_map_data_v01_ei,
	},
	{
		.data_type      = QMI_OPT_FLAG,
		.elem_len       = 1,
		.elem_size      = sizeof(u8),
		.is_array       = NO_ARRAY,
		.tlv_type       = 0x11,
		.offset         = offsetof(
			struct ipa_remove_offload_connection_req_msg_v01,
			clean_all_rules_valid),
	},
	{
		.data_type      = QMI_UNSIGNED_1_BYTE,
		.elem_len       = 1,
		.elem_size      = sizeof(u8),
		.is_array       = NO_ARRAY,
		.tlv_type       = 0x11,
		.offset         = offsetof(
			struct ipa_remove_offload_connection_req_msg_v01,
			clean_all_rules),
	},
	{
		.data_type      = QMI_EOTI,
		.is_array       = NO_ARRAY,
+15 −2
Original line number Diff line number Diff line
@@ -64,6 +64,7 @@
 * Indicates presence of newly added member to support HW stats.
 */
#define IPA_QMI_SUPPORTS_STATS
#define IPA_QMI_SUPPORT_MHI_DEFAULT

#define IPA_INT_MAX	((int)(~0U>>1))
#define IPA_INT_MIN	(-IPA_INT_MAX - 1)
@@ -2606,8 +2607,14 @@ struct ipa_add_offload_connection_req_msg_v01 {
	/* Must be set to true if embedded_call_mux_id is being passed */
	uint32_t embedded_call_mux_id;
	/* Mux ID for the new embedded call */
	/* Optional */
	/*  Default MHI path */
	uint8_t default_mhi_path_valid;
	/* Must be set to true if default_mhi_path is being passed */
	uint8_t default_mhi_path;
	/* Default MHI path */
}; /* Message */
#define IPA_ADD_OFFLOAD_CONNECTION_REQ_MSG_V01_MAX_MSG_LEN 11357
#define IPA_ADD_OFFLOAD_CONNECTION_REQ_MSG_V01_MAX_MSG_LEN 11361

struct ipa_add_offload_connection_resp_msg_v01 {
	/*  Result Code */
@@ -2630,8 +2637,14 @@ struct ipa_remove_offload_connection_req_msg_v01 {
	uint32_t filter_handle_list_len;
	struct ipa_filter_rule_identifier_to_handle_map_v01
		filter_handle_list[QMI_IPA_MAX_FILTERS_V01];
	/* Optional */
	/*  Clean All rules */
	uint8_t clean_all_rules_valid;
	/* Must be set to true if clean_all_rules is being passed */
	uint8_t clean_all_rules;
	/* Clean All rules */
}; /* Message */
#define IPA_REMOVE_OFFLOAD_CONNECTION_REQ_MSG_V01_MAX_MSG_LEN 516
#define IPA_REMOVE_OFFLOAD_CONNECTION_REQ_MSG_V01_MAX_MSG_LEN 520

struct ipa_remove_offload_connection_resp_msg_v01 {
	/* optional */