summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlok Kumar <alokkuma@codeaurora.org>2018-08-17 11:54:54 +0530
committernshrivas <nshrivas@codeaurora.org>2018-08-17 14:10:29 -0700
commitccbdad69fca5795c53bc587d944215c0f086754a (patch)
tree3569cbddb0306a945b2189cb5c8b73d88a20baa0
parent23fc40ab428fe6f441509285d706e44dc5dd8e7e (diff)
qcacld-3.0: Add support to check if LRO is enabled or not
Add an API to validate if LRO is enabled or not based on FEATURE_LRO flag. Change-Id: I85bce60d3f7b47a57fba1122d058d17c474c456c CRs-Fixed: 2298731
-rw-r--r--core/hdd/inc/wlan_hdd_lro.h9
-rw-r--r--core/hdd/src/wlan_hdd_lro.c16
-rw-r--r--core/hdd/src/wlan_hdd_tx_rx.c2
3 files changed, 25 insertions, 2 deletions
diff --git a/core/hdd/inc/wlan_hdd_lro.h b/core/hdd/inc/wlan_hdd_lro.h
index c744c3b100d0..cc9fc91d1584 100644
--- a/core/hdd/inc/wlan_hdd_lro.h
+++ b/core/hdd/inc/wlan_hdd_lro.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015-2017 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2015-2018 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
@@ -132,6 +132,8 @@ struct hdd_lro_s {
struct hdd_lro_desc_info lro_desc_info;
};
+int hdd_is_lro_enabled(hdd_context_t *hdd_ctx);
+
int hdd_lro_enable(hdd_context_t *hdd_ctx,
hdd_adapter_t *adapter);
@@ -153,6 +155,11 @@ QDF_STATUS hdd_lro_set_reset(hdd_context_t *hdd_ctx,
#else
struct hdd_lro_s {};
+static inline int hdd_is_lro_enabled(hdd_context_t *hdd_ctx)
+{
+ return -EOPNOTSUPP;
+}
+
static inline int hdd_lro_enable(hdd_context_t *hdd_ctx,
hdd_adapter_t *adapter)
{
diff --git a/core/hdd/src/wlan_hdd_lro.c b/core/hdd/src/wlan_hdd_lro.c
index fca8b5f86697..1483ddf84762 100644
--- a/core/hdd/src/wlan_hdd_lro.c
+++ b/core/hdd/src/wlan_hdd_lro.c
@@ -462,6 +462,22 @@ static void *hdd_init_lro_mgr(void)
}
/**
+ * hdd_is_lro_enabled() - Is LRO enabled
+ * @hdd_ctx: HDD context
+ *
+ * This function checks if LRO is enabled in HDD context.
+ *
+ * Return: 0 - success, < 0 - failure
+ */
+int hdd_is_lro_enabled(hdd_context_t *hdd_ctx)
+{
+ if (hdd_ctx->ol_enable != CFG_LRO_ENABLED)
+ return -EOPNOTSUPP;
+
+ return 0;
+}
+
+/**
* hdd_lro_enable() - enable LRO
* @hdd_ctx: HDD context
* @adapter: HDD adapter
diff --git a/core/hdd/src/wlan_hdd_tx_rx.c b/core/hdd/src/wlan_hdd_tx_rx.c
index e8640faab7b4..1367eca44ffb 100644
--- a/core/hdd/src/wlan_hdd_tx_rx.c
+++ b/core/hdd/src/wlan_hdd_tx_rx.c
@@ -1682,7 +1682,7 @@ static inline void hdd_register_rx_ol(void)
hdd_ctx->tcp_delack_on = 0;
- if (hdd_ctx->ol_enable == CFG_LRO_ENABLED) {
+ if (!hdd_is_lro_enabled(hdd_ctx)) {
hdd_ctx->receive_offload_cb = hdd_lro_rx;
/* Register the flush callback */
hdd_lro_create();