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

Commit b917daed authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: ipa: Send actual DL flt rule length to Q6"

parents bb54209c e954e917
Loading
Loading
Loading
Loading
+36 −2
Original line number Diff line number Diff line
/* Copyright (c) 2013-2018, The Linux Foundation. All rights reserved.
/* Copyright (c) 2013-2018, 2021, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -506,6 +506,38 @@ static int qmi_init_modem_send_sync_msg(void)
		resp.resp.error, "ipa_init_modem_driver_resp_msg_v01");
}

static int ipa_qmi_filter_request_ex_calc_length(
	struct ipa_install_fltr_rule_req_msg_v01 *req)
{
	int len = 0;
	/* caller should validate and send the req */
	/* instead of sending max length,the approximate length is calculated */
	len += ((sizeof(struct ipa_install_fltr_rule_req_msg_v01)) -
		(QMI_IPA_MAX_FILTERS_V01 *
		sizeof(struct ipa_filter_spec_type_v01)) -
		(QMI_IPA_MAX_FILTERS_V01 * sizeof(uint32_t)) -
		(QMI_IPA_MAX_FILTERS_V01 *
		sizeof(struct ipa_filter_spec_ex_type_v01)));

	if (req->filter_spec_list_valid &&
		req->filter_spec_list_len > 0) {
		len += sizeof(struct ipa_filter_spec_type_v01)*
			req->filter_spec_list_len;
	}

	if (req->xlat_filter_indices_list_valid &&
		req->xlat_filter_indices_list_len > 0) {
		len += sizeof(uint32_t)*req->xlat_filter_indices_list_len;
	}

	if (req->filter_spec_ex_list_valid &&
		req->filter_spec_ex_list_len > 0) {
		len += sizeof(struct ipa_filter_spec_ex_type_v01)*
			req->filter_spec_ex_list_len;
	}
	return len;

}
/* sending filter-install-request to modem*/
int qmi_filter_request_send(struct ipa_install_fltr_rule_req_msg_v01 *req)
{
@@ -574,7 +606,9 @@ int qmi_filter_request_send(struct ipa_install_fltr_rule_req_msg_v01 *req)
	}
	mutex_unlock(&ipa_qmi_lock);

	req_desc.max_msg_len = QMI_IPA_INSTALL_FILTER_RULE_REQ_MAX_MSG_LEN_V01;
	req_desc.max_msg_len = ipa_qmi_filter_request_ex_calc_length(req);
	IPAWANDBG("QMI send request length = %d\n", req_desc.max_msg_len);

	req_desc.msg_id = QMI_IPA_INSTALL_FILTER_RULE_REQ_V01;
	req_desc.ei_array = ipa_install_fltr_rule_req_msg_data_v01_ei;