From 07b28f68784f22d23cf07c2a6563047d04f393cf Mon Sep 17 00:00:00 2001 From: Leo Chang Date: Wed, 11 May 2016 12:29:22 -0700 Subject: [PATCH] qcacld-3.0: enable hsoffload feature Enable HS offload feature against latest kernel and ipa release. Compile against latest ipa header is required. Change-Id: I704bdfde098de6e33fb6b30455a75cb6a6cddb21 CRs-fixed: 1019762 --- core/hdd/src/wlan_hdd_ipa.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/core/hdd/src/wlan_hdd_ipa.c b/core/hdd/src/wlan_hdd_ipa.c index 69cbf006e891..1c0b99ba3602 100644 --- a/core/hdd/src/wlan_hdd_ipa.c +++ b/core/hdd/src/wlan_hdd_ipa.c @@ -510,8 +510,7 @@ uint32_t wlan_hdd_stub_addr_to_priv(void *ptr) } while (0) #define HDD_BW_GET_DIFF(_x, _y) (unsigned long)((ULONG_MAX - (_y)) + (_x) + 1) -/* Temporary macro to make a build without IPA V2 */ -#ifdef IPA_V2 +#if defined (QCA_WIFI_3_0) && defined (CONFIG_IPA3) #define HDD_IPA_WDI2_SET(pipe_in, ipa_ctxt) \ do { \ pipe_in.u.ul.rdy_ring_rp_va = \ @@ -528,7 +527,7 @@ do { \ #else /* Do nothing */ #define HDD_IPA_WDI2_SET(pipe_in, ipa_ctxt) -#endif /* IPA_V2 */ +#endif /* IPA3 */ static struct hdd_ipa_adapter_2_client { enum ipa_client_type cons_client; @@ -1977,10 +1976,20 @@ struct sk_buff *hdd_ipa_tx_packet_ipa(hdd_context_t *hdd_ctx, { struct ipa_header *ipa_header; struct frag_header *frag_header; + struct hdd_ipa_priv *hdd_ipa = hdd_ctx->hdd_ipa; if (!hdd_ipa_uc_is_enabled(hdd_ctx)) return skb; + if (!hdd_ipa) + return skb; + + if (HDD_IPA_UC_NUM_WDI_PIPE != hdd_ipa->activated_fw_pipe) + return skb; + + if (skb_headroom(skb) < sizeof(struct ipa_header)) + return skb; + ipa_header = (struct ipa_header *) skb_push(skb, sizeof(struct ipa_header)); if (!ipa_header) {