Browse Source

qcacmn: Add qdf_napi_disable() abstraction

Linux API napi_enable() is abstracted, but napi_disable() is not.  Add
an abstraction so that all of the native NAPI API calls in HIF can be
changed to use QDF abstractions.

Change-Id: I26e4c1d301dc6744be19b3f4142542aefe0e6fec
CRs-Fixed: 3364272
Jeff Johnson 2 years ago
parent
commit
161c891e60
3 changed files with 37 additions and 0 deletions
  1. 16 0
      qdf/inc/qdf_net_if.h
  2. 14 0
      qdf/linux/src/i_qdf_net_if.h
  3. 7 0
      qdf/linux/src/qdf_net_if.c

+ 16 - 0
qdf/inc/qdf_net_if.h

@@ -75,6 +75,16 @@ qdf_net_if_release_dev(struct qdf_net_if *nif);
  */
 void qdf_napi_enable(struct napi_struct *napi);
 
+/**
+ * qdf_napi_disable() - Disable the napi schedule
+ * @napi: NAPI context
+ *
+ * This function suspends NAPI from being scheduled on this context
+ *
+ * Return: NONE
+ */
+void qdf_napi_disable(struct napi_struct *napi);
+
 /**
  * qdf_netif_napi_add - initialize a NAPI context
  * @netdev:  network device
@@ -152,6 +162,12 @@ qdf_napi_enable(struct napi_struct *napi)
 	__qdf_napi_enable(napi);
 }
 
+static inline void
+qdf_napi_disable(struct napi_struct *napi)
+{
+	__qdf_napi_disable(napi);
+}
+
 static inline void
 qdf_netif_napi_add(struct net_device *netdev, struct napi_struct *napi,
 		   int (*poll)(struct napi_struct *, int), int weight)

+ 14 - 0
qdf/linux/src/i_qdf_net_if.h

@@ -139,6 +139,20 @@ __qdf_napi_enable(struct napi_struct *napi)
 	napi_enable(napi);
 }
 
+/**
+ * __qdf_napi_disable() - Disable the napi schedule
+ * @napi: NAPI context
+ *
+ * This function suspends NAPI from being scheduled on this context
+ *
+ * Return: NONE
+ */
+static inline void
+__qdf_napi_disable(struct napi_struct *napi)
+{
+	napi_disable(napi);
+}
+
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 0))
 /**
  * __qdf_netif_napi_add - initialize a NAPI context

+ 7 - 0
qdf/linux/src/qdf_net_if.c

@@ -117,6 +117,13 @@ void qdf_napi_enable(struct napi_struct *napi)
 
 qdf_export_symbol(qdf_napi_enable);
 
+void qdf_napi_disable(struct napi_struct *napi)
+{
+	__qdf_napi_disable(napi);
+}
+
+qdf_export_symbol(qdf_napi_disable);
+
 void qdf_netif_napi_add(struct net_device *netdev, struct napi_struct *napi,
 			int (*poll)(struct napi_struct *, int), int weight)
 {