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

Commit 36fa5133 authored by Pooja Kumari's avatar Pooja Kumari Committed by Gerrit - the friendly Code Review server
Browse files

msm: ipa3: Add max PDN num based on hardware version



Currently defined max PDN number is generic for all
hardware version which is incorrect. Define PDN based
on hardware version to support correct number of PDN.

Change-Id: I3e898a32104562584b4702132c57b7f1cb8deeca
Signed-off-by: default avatarPooja Kumari <kumarip@codeaurora.org>
parent 64750dee
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1917,7 +1917,7 @@ static void ipa3_read_pdn_table(void)
		}

		for (i = 0, pdn_entry = ipa3_ctx->nat_mem.pdn_mem.base;
			 i < IPA_MAX_PDN_NUM;
			 i < ipa3_get_max_pdn();
			 ++i, pdn_entry += pdn_entry_size) {

			result = ipahal_nat_is_entry_zeroed(
+1 −1
Original line number Diff line number Diff line
@@ -857,7 +857,7 @@ static int __ipa_validate_flt_rule(const struct ipa_flt_rule_i *rule,
					"PDN index should be 0 when action is not pass to NAT\n");
				goto error;
			} else {
				if (rule->pdn_idx >= IPA_MAX_PDN_NUM) {
				if (rule->pdn_idx >= ipa3_get_max_pdn()) {
					IPAERR_RL("PDN index %d is too large\n",
						rule->pdn_idx);
					goto error;
+1 −0
Original line number Diff line number Diff line
@@ -2874,6 +2874,7 @@ int ipa3_query_intf(struct ipa_ioc_query_intf *lookup);
int ipa3_query_intf_tx_props(struct ipa_ioc_query_intf_tx_props *tx);
int ipa3_query_intf_rx_props(struct ipa_ioc_query_intf_rx_props *rx);
int ipa3_query_intf_ext_props(struct ipa_ioc_query_intf_ext_props *ext);
int ipa3_get_max_pdn(void);

void wwan_cleanup(void);

+5 −3
Original line number Diff line number Diff line
@@ -763,7 +763,8 @@ int ipa3_allocate_nat_table(

		ipahal_nat_entry_size(IPAHAL_NAT_IPV4_PDN, &pdn_entry_size);

		pdn_mem_ptr->size = pdn_entry_size * IPA_MAX_PDN_NUM;
		pdn_mem_ptr->size = pdn_entry_size *
						ipa3_get_max_pdn();

		if (IPA_MEM_PART(pdn_config_size) < pdn_mem_ptr->size) {
			IPAERR(
@@ -1179,7 +1180,8 @@ static int ipa3_nat_create_modify_pdn_cmd(
	IPADBG("\n");

	ipahal_nat_entry_size(IPAHAL_NAT_IPV4_PDN, &pdn_entry_size);
	mem_size = pdn_entry_size * IPA_MAX_PDN_NUM;

	mem_size = pdn_entry_size * ipa3_get_max_pdn();

	/* Before providing physical base address check pointer exist or not*/
	if (!ipa3_ctx->nat_mem.pdn_mem.base)
@@ -1714,7 +1716,7 @@ int ipa3_nat_mdfy_pdn(
		goto bail;
	}

	if (mdfy_pdn->pdn_index > (IPA_MAX_PDN_NUM - 1)) {
	if (mdfy_pdn->pdn_index > (ipa3_get_max_pdn() - 1)) {
		IPAERR_RL("pdn index out of range %d\n", mdfy_pdn->pdn_index);
		result = -EPERM;
		goto bail;
+15 −0
Original line number Diff line number Diff line
@@ -9301,3 +9301,18 @@ int ipa3_del_socksv5_conn(uint32_t handle)
	mutex_unlock(&ipa3_ctx->act_tbl_lock);
	return res;
}

/**
 * ipa3_get_max_pdn() - get max PDN number based on hardware version
 *
 * Returns:     IPA_MAX_PDN_NUM of IPAv4_5 and IPA_MAX_PDN_NUM_v4_2 for others
 *
 */

int ipa3_get_max_pdn(void)
{
	if (ipa3_get_hw_type_index() == IPA_4_5_AUTO)
		return IPA_MAX_PDN_NUM;
	else
		return IPA_MAX_PDN_NUM_v4;
}
Loading