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

Commit c6cac6d5 authored by Skylar Chang's avatar Skylar Chang Committed by Kyle Yan
Browse files

msm: rmnet_ipa3: add RMNET_IOCTL_GET_SG_SUPPORT support



While the transport always supports scatter-gather, the
capability advertised through this IOCTL is configured
from the device tree. Add support on ipav3.

Change-Id: Idf626cb5a22d2ed5152ab76dcc5fe56696a631a6
Signed-off-by: default avatarSkylar Chang <chiaweic@codeaurora.org>
parent b265655e
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -8,6 +8,8 @@ Required properties:
Optional:
- qcom,rmnet-ipa-ssr: determine if modem SSR is supported
- qcom,ipa-loaduC: indicate that ipa uC should be loaded
- qcom,ipa-advertise-sg-support: determine how to respond to a query
regarding scatter-gather capability

Example:
	qcom,rmnet-ipa3 {
+22 −2
Original line number Diff line number Diff line
@@ -82,6 +82,7 @@ enum ipa3_wwan_device_status {
struct ipa3_rmnet_plat_drv_res {
	bool ipa_rmnet_ssr;
	bool ipa_loaduC;
	bool ipa_advertise_sg_support;
};

/**
@@ -1219,6 +1220,8 @@ static void apps_ipa_packet_receive_notify(void *priv,
	dev->stats.rx_bytes += packet_len;
}

static struct ipa3_rmnet_plat_drv_res ipa3_rmnet_res = {0, };

/**
 * ipa3_wwan_ioctl() - I/O control for wwan network driver.
 *
@@ -1349,6 +1352,15 @@ static int ipa3_wwan_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
				sizeof(struct rmnet_ioctl_extended_s)))
				rc = -EFAULT;
			break;
		/* GET SG support */
		case RMNET_IOCTL_GET_SG_SUPPORT:
			extend_ioctl_data.u.data =
				ipa3_rmnet_res.ipa_advertise_sg_support;
			if (copy_to_user((u8 *)ifr->ifr_ifru.ifru_data,
				&extend_ioctl_data,
				sizeof(struct rmnet_ioctl_extended_s)))
				rc = -EFAULT;
			break;
		/*  Get endpoint ID  */
		case RMNET_IOCTL_GET_EPID:
			IPAWANDBG("get ioctl: RMNET_IOCTL_GET_EPID\n");
@@ -1915,8 +1927,6 @@ static struct notifier_block ipa3_ssr_notifier = {
	.notifier_call = ipa3_ssr_notifier_cb,
};

static struct ipa3_rmnet_plat_drv_res ipa3_rmnet_res = {0, };

static int get_ipa_rmnet_dts_configuration(struct platform_device *pdev,
		struct ipa3_rmnet_plat_drv_res *ipa_rmnet_drv_res)
{
@@ -1930,6 +1940,12 @@ static int get_ipa_rmnet_dts_configuration(struct platform_device *pdev,
			"qcom,ipa-loaduC");
	pr_info("IPA ipa-loaduC = %s\n",
		ipa_rmnet_drv_res->ipa_loaduC ? "True" : "False");

	ipa_rmnet_drv_res->ipa_advertise_sg_support =
		of_property_read_bool(pdev->dev.of_node,
		"qcom,ipa-advertise-sg-support");
	pr_info("IPA SG support = %s\n",
		ipa_rmnet_drv_res->ipa_advertise_sg_support ? "True" : "False");
	return 0;
}

@@ -2106,6 +2122,10 @@ static int ipa3_wwan_probe(struct platform_device *pdev)
		goto set_perf_err;
	/* IPA_RM configuration ends */

	/* Enable SG support in netdevice. */
	if (ipa3_rmnet_res.ipa_advertise_sg_support)
		dev->hw_features |= NETIF_F_SG;

	ret = register_netdev(dev);
	if (ret) {
		IPAWANERR("unable to register ipa_netdev %d rc=%d\n",