qcacmn: Update Wifi netdevs for IPA exception path NAPI

Starting Kernel 4.19 IPA LAN RX supports NAPI polling
mechanism. Netdevs that hook into IPA need to call
netif_receive_skb() or similar to deliver the packet
to network stack instead of using netif_rx_ni().

IPA driver exports ipa_get_lan_rx_napi(void) API for
this purpose. If this API call returns true use
netif_receive_skb() or fallback on legacy api.

Add the changes under a feature flag IPA_LAN_RX_NAPI_SUPPORT
which is enabled under a linux kernel version check for 4.19
and above.

Change-Id: I449404e86e934fd6113cb71e494575e67602f678
CRs-Fixed: 2588500
diff --git a/qdf/inc/qdf_ipa.h b/qdf/inc/qdf_ipa.h
index 83e6f31..6d13de7 100644
--- a/qdf/inc/qdf_ipa.h
+++ b/qdf/inc/qdf_ipa.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for any
  * purpose with or without fee is hereby granted, provided that the above
@@ -665,5 +665,22 @@
 }
 #endif
 
+#ifdef IPA_LAN_RX_NAPI_SUPPORT
+/**
+ * qdf_ipa_get_lan_rx_napi() - Check if NAPI is enabled in LAN
+ * RX DP
+ *
+ * Returns: true if enabled, false otherwise
+ */
+static inline bool qdf_ipa_get_lan_rx_napi(void)
+{
+	return __qdf_ipa_get_lan_rx_napi();
+}
+#else
+static inline bool qdf_ipa_get_lan_rx_napi(void)
+{
+	return false;
+}
+#endif /* IPA_LAN_RX_NAPI_SUPPORT */
 #endif /* IPA_OFFLOAD */
 #endif /* _QDF_IPA_H */
diff --git a/qdf/linux/src/i_qdf_ipa.h b/qdf/linux/src/i_qdf_ipa.h
index edd99fd..273f5a3 100644
--- a/qdf/linux/src/i_qdf_ipa.h
+++ b/qdf/linux/src/i_qdf_ipa.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for any
  * purpose with or without fee is hereby granted, provided that the above
@@ -20,6 +20,7 @@
 #ifdef IPA_OFFLOAD
 
 #include <linux/ipa.h>
+#include <linux/version.h>
 
 /**
  * __qdf_ipa_wdi_meter_evt_type_t - type of event client callback is
@@ -554,6 +555,10 @@
 #define __QDF_IPA_CLIENT_WLAN3_CONS IPA_CLIENT_WLAN3_CONS
 #define __QDF_IPA_CLIENT_WLAN4_CONS IPA_CLIENT_WLAN4_CONS
 
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 0))
+#define IPA_LAN_RX_NAPI_SUPPORT
+#endif
+
 /*
  * Resume / Suspend
  */
@@ -967,5 +972,16 @@
 }
 #endif
 
+#ifdef IPA_LAN_RX_NAPI_SUPPORT
+/**
+ * ipa_get_lan_rx_napi() - Check if NAPI is enabled in LAN RX DP
+ *
+ * Returns: true if enabled, false otherwise
+ */
+static inline bool __qdf_ipa_get_lan_rx_napi(void)
+{
+	return ipa_get_lan_rx_napi();
+}
+#endif /* IPA_LAN_RX_NAPI_SUPPORT */
 #endif /* IPA_OFFLOAD */
 #endif /* _I_QDF_IPA_H */