diff options
author | Skylar Chang <chiaweic@codeaurora.org> | 2016-04-13 17:27:13 -0700 |
---|---|---|
committer | Kyle Yan <kyan@codeaurora.org> | 2016-06-02 16:12:00 -0700 |
commit | c6cac6d5397c14ff713cb783ad8395862ec0929b (patch) | |
tree | bd077b5e59e364bbcb0feb1a6e8639d5335ebc15 /drivers/platform/msm | |
parent | b265655edbfb3c2bd07ca8c2ee54d3985dc38e9e (diff) |
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: Skylar Chang <chiaweic@codeaurora.org>
Diffstat (limited to 'drivers/platform/msm')
-rw-r--r-- | drivers/platform/msm/ipa/ipa_v3/rmnet_ipa.c | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/drivers/platform/msm/ipa/ipa_v3/rmnet_ipa.c b/drivers/platform/msm/ipa/ipa_v3/rmnet_ipa.c index 9c33d8052e71..5dcb25876fd4 100644 --- a/drivers/platform/msm/ipa/ipa_v3/rmnet_ipa.c +++ b/drivers/platform/msm/ipa/ipa_v3/rmnet_ipa.c @@ -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", |