wlan-ap-Telecominfraproject/feeds/qca-wifi-7/ipq53xx/patches-6.1/0252-net-ppp-API-to-check-compression-enabled-on-PPP-devi.patch
John Crispin 68cf54d9f7 qca-wifi-7: update to ath12.5.5
Signed-off-by: John Crispin <john@phrozen.org>
2025-02-27 12:45:52 +01:00

63 lines
1.8 KiB
Diff

From 5357cc04939baaea0f24687860624b472f763bec Mon Sep 17 00:00:00 2001
From: Ratheesh Kannoth <rkannoth@codeaurora.org>
Date: Fri, 6 Nov 2020 12:56:12 +0530
Subject: [PATCH 252/281] net: ppp: API to check compression enabled on PPP
device
Change-Id: I574c688a9299531263061534a51cc88fef5e069f
Signed-off-by: Ratheesh Kannoth <rkannoth@codeaurora.org>
---
drivers/net/ppp/ppp_generic.c | 22 ++++++++++++++++++++++
include/linux/ppp_channel.h | 2 ++
2 files changed, 24 insertions(+)
diff --git a/drivers/net/ppp/ppp_generic.c b/drivers/net/ppp/ppp_generic.c
index 3230c5cb7483..be55c30b4a6e 100644
--- a/drivers/net/ppp/ppp_generic.c
+++ b/drivers/net/ppp/ppp_generic.c
@@ -3660,6 +3660,28 @@ void ppp_update_stats(struct net_device *dev, unsigned long rx_packets,
ppp_recv_unlock(ppp);
}
+/* Returns true if Compression is enabled on PPP device
+ */
+bool ppp_is_cp_enabled(struct net_device *dev)
+{
+ struct ppp *ppp;
+ bool flag = false;
+
+ if (!dev)
+ return false;
+
+ if (dev->type != ARPHRD_PPP)
+ return false;
+
+ ppp = netdev_priv(dev);
+ ppp_lock(ppp);
+ flag = !!ppp->xcomp || !!ppp->rcomp;
+ ppp_unlock(ppp);
+
+ return flag;
+}
+EXPORT_SYMBOL(ppp_is_cp_enabled);
+
/* Returns >0 if the device is a multilink PPP netdevice, 0 if not or < 0 if
* the device is not PPP.
*/
diff --git a/include/linux/ppp_channel.h b/include/linux/ppp_channel.h
index 4f32f6f19e6e..1347b8fcd1c7 100644
--- a/include/linux/ppp_channel.h
+++ b/include/linux/ppp_channel.h
@@ -81,6 +81,8 @@ extern int ppp_hold_channels(struct net_device *dev,
struct ppp_channel *channels[],
unsigned int chan_sz);
+bool ppp_is_cp_enabled(struct net_device *dev);
+
/* Test if the ppp device is a multi-link ppp device */
extern int ppp_is_multilink(struct net_device *dev);
--
2.17.1