summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/cds/inc/cds_api.h2
-rw-r--r--core/cds/inc/cds_config.h2
-rw-r--r--core/cds/inc/cds_sched.h3
-rw-r--r--core/cds/src/cds_api.c2
-rw-r--r--core/cds/src/cds_concurrency.c31
-rw-r--r--core/hdd/inc/wlan_hdd_main.h1
-rw-r--r--core/hdd/inc/wlan_hdd_tx_rx.h3
-rw-r--r--core/hdd/src/wlan_hdd_main.c27
-rw-r--r--core/hdd/src/wlan_hdd_tx_rx.c60
9 files changed, 125 insertions, 6 deletions
diff --git a/core/cds/inc/cds_api.h b/core/cds/inc/cds_api.h
index 6141e4244d0d..ca87b452d8d4 100644
--- a/core/cds/inc/cds_api.h
+++ b/core/cds/inc/cds_api.h
@@ -92,11 +92,13 @@ struct cds_sme_cbacks {
* @ol_txrx_update_mac_id_cb: updates mac_id for vdev
* @hdd_en_lro_in_cc_cb: enables LRO if concurrency is not active
* @hdd_disble_lro_in_cc_cb: disables LRO due to concurrency
+ * @hdd_set_rx_mode_rps_cb: enable/disable RPS in SAP mode
*/
struct cds_dp_cbacks {
void (*ol_txrx_update_mac_id_cb)(uint8_t , uint8_t);
void (*hdd_en_lro_in_cc_cb)(struct hdd_context_s *);
void (*hdd_disble_lro_in_cc_cb)(struct hdd_context_s *);
+ void (*hdd_set_rx_mode_rps_cb)(struct hdd_context_s *, void *, bool);
};
void cds_set_driver_state(enum cds_driver_state);
diff --git a/core/cds/inc/cds_config.h b/core/cds/inc/cds_config.h
index 75d86dec200a..0286171c0808 100644
--- a/core/cds/inc/cds_config.h
+++ b/core/cds/inc/cds_config.h
@@ -115,6 +115,7 @@ enum active_bpf_mode {
* @is_fw_timeout: Indicate whether crash host when fw timesout or not
* @force_target_assert_enabled: Indicate whether target assert enabled or not
* @active_bpf_mode: Setting that determines how BPF is applied in active mode
+ * @rps_enabled: RPS enabled in SAP mode
* Structure for holding cds ini parameters.
*/
@@ -172,5 +173,6 @@ struct cds_config_info {
bool force_target_assert_enabled;
enum active_bpf_mode active_bpf_mode;
+ bool rps_enabled;
};
#endif /* !defined( __CDS_CONFIG_H ) */
diff --git a/core/cds/inc/cds_sched.h b/core/cds/inc/cds_sched.h
index 54a9d42c0ae2..7a52b40cccaa 100644
--- a/core/cds/inc/cds_sched.h
+++ b/core/cds/inc/cds_sched.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012-2016 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
@@ -316,6 +316,7 @@ typedef struct _cds_context_type {
void (*ol_txrx_update_mac_id_cb)(uint8_t , uint8_t);
void (*hdd_en_lro_in_cc_cb)(struct hdd_context_s *);
void (*hdd_disable_lro_in_cc_cb)(struct hdd_context_s *);
+ void (*hdd_set_rx_mode_rps_cb)(struct hdd_context_s *, void *, bool);
/* This list is not sessionized. This mandatory channel list would be
* as per OEMs preference as per the regulatory/other considerations.
diff --git a/core/cds/src/cds_api.c b/core/cds/src/cds_api.c
index 0c76db8f2f6d..efbe4926ddf9 100644
--- a/core/cds/src/cds_api.c
+++ b/core/cds/src/cds_api.c
@@ -2456,6 +2456,7 @@ QDF_STATUS cds_register_dp_cb(struct cds_dp_cbacks *dp_cbs)
cds_ctx->ol_txrx_update_mac_id_cb = dp_cbs->ol_txrx_update_mac_id_cb;
cds_ctx->hdd_en_lro_in_cc_cb = dp_cbs->hdd_en_lro_in_cc_cb;
cds_ctx->hdd_disable_lro_in_cc_cb = dp_cbs->hdd_disble_lro_in_cc_cb;
+ cds_ctx->hdd_set_rx_mode_rps_cb = dp_cbs->hdd_set_rx_mode_rps_cb;
return QDF_STATUS_SUCCESS;
}
@@ -2479,6 +2480,7 @@ QDF_STATUS cds_deregister_dp_cb(void)
cds_ctx->ol_txrx_update_mac_id_cb = NULL;
cds_ctx->hdd_en_lro_in_cc_cb = NULL;
cds_ctx->hdd_disable_lro_in_cc_cb = NULL;
+ cds_ctx->hdd_set_rx_mode_rps_cb = NULL;
return QDF_STATUS_SUCCESS;
}
diff --git a/core/cds/src/cds_concurrency.c b/core/cds/src/cds_concurrency.c
index efd6c7384c70..6bb5ff76f10b 100644
--- a/core/cds/src/cds_concurrency.c
+++ b/core/cds/src/cds_concurrency.c
@@ -3758,6 +3758,7 @@ void cds_incr_active_session(enum tQDF_ADAPTER_MODE mode,
{
hdd_context_t *hdd_ctx;
cds_context_type *cds_ctx;
+ hdd_adapter_t *sap_adapter;
hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
if (!hdd_ctx) {
@@ -3827,6 +3828,19 @@ void cds_incr_active_session(enum tQDF_ADAPTER_MODE mode,
cds_warn("hdd_disable_lro_in_cc_cb NULL!");
};
+ /* Enable RPS if SAP interface has come up */
+ if (cds_mode_specific_connection_count(CDS_SAP_MODE, NULL) == 1) {
+ if (cds_ctx->hdd_set_rx_mode_rps_cb != NULL) {
+ sap_adapter = hdd_get_adapter(hdd_ctx, QDF_SAP_MODE);
+ if (sap_adapter != NULL)
+ cds_ctx->hdd_set_rx_mode_rps_cb(hdd_ctx,
+ sap_adapter,
+ true);
+ } else {
+ cds_warn("hdd_set_rx_mode_rps_cb NULL!");
+ }
+ };
+
/* set tdls connection tracker state */
cds_set_tdls_ct_mode(hdd_ctx);
cds_dump_current_concurrency();
@@ -4027,6 +4041,7 @@ void cds_decr_active_session(enum tQDF_ADAPTER_MODE mode,
{
hdd_context_t *hdd_ctx;
cds_context_type *cds_ctx;
+ hdd_adapter_t *sap_adapter;
cds_ctx = cds_get_context(QDF_MODULE_ID_QDF);
if (!cds_ctx) {
@@ -4069,13 +4084,25 @@ void cds_decr_active_session(enum tQDF_ADAPTER_MODE mode,
cds_ctx->hdd_en_lro_in_cc_cb(hdd_ctx);
else
cds_warn("hdd_enable_lro_in_concurrency NULL!");
- };
+ }
+
+ /* Disable RPS if SAP interface has come up */
+ if (cds_mode_specific_connection_count(CDS_SAP_MODE, NULL) == 0) {
+ if (cds_ctx->hdd_set_rx_mode_rps_cb != NULL) {
+ sap_adapter = hdd_get_adapter(hdd_ctx, QDF_SAP_MODE);
+ if (sap_adapter != NULL)
+ cds_ctx->hdd_set_rx_mode_rps_cb(hdd_ctx,
+ sap_adapter,
+ false);
+ } else {
+ cds_warn("hdd_set_rx_mode_rps_cb NULL!");
+ }
+ }
/* set tdls connection tracker state */
cds_set_tdls_ct_mode(hdd_ctx);
cds_dump_current_concurrency();
-
}
/**
diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h
index 1d18d70d66ed..ebfa4f0bf0f6 100644
--- a/core/hdd/inc/wlan_hdd_main.h
+++ b/core/hdd/inc/wlan_hdd_main.h
@@ -2110,4 +2110,5 @@ void hdd_set_roaming_in_progress(bool value);
*/
bool hdd_check_for_opened_interfaces(hdd_context_t *hdd_ctx);
void wlan_hdd_start_sap(hdd_adapter_t *ap_adapter, bool reinit);
+void hdd_set_rx_mode_rps(hdd_context_t *hdd_ctx, void *padapter, bool enable);
#endif /* end #if !defined(WLAN_HDD_MAIN_H) */
diff --git a/core/hdd/inc/wlan_hdd_tx_rx.h b/core/hdd/inc/wlan_hdd_tx_rx.h
index 0352cdb8add1..9ce5214f250c 100644
--- a/core/hdd/inc/wlan_hdd_tx_rx.h
+++ b/core/hdd/inc/wlan_hdd_tx_rx.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013-2016 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2013-2017 The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
@@ -114,6 +114,7 @@ void wlan_hdd_netif_queue_control(hdd_adapter_t *adapter,
enum netif_action_type action, enum netif_reason_type reason);
int hdd_set_mon_rx_cb(struct net_device *dev);
void hdd_send_rps_ind(hdd_adapter_t *adapter);
+void hdd_send_rps_disable_ind(hdd_adapter_t *adapter);
void wlan_hdd_classify_pkt(struct sk_buff *skb);
#ifdef MSM_PLATFORM
diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c
index 4f046b3e7eb7..c70d5c7f9581 100644
--- a/core/hdd/src/wlan_hdd_main.c
+++ b/core/hdd/src/wlan_hdd_main.c
@@ -7896,6 +7896,30 @@ out:
/**
+ * hdd_set_rx_mode_rps() - Enable/disable RPS in SAP mode
+ * @hdd_context_t *hdd_ctx
+ * @hdd_adapter_t *padapter
+ * @bool enble
+ *
+ * Return: none
+ */
+void hdd_set_rx_mode_rps(hdd_context_t *hdd_ctx, void *padapter,
+ bool enable)
+{
+ struct cds_config_info *cds_cfg = cds_get_ini_config();
+ hdd_adapter_t *adapter = padapter;
+
+ if (adapter && hdd_ctx &&
+ !hdd_ctx->rps && cds_cfg->uc_offload_enabled) {
+ if (enable && !cds_cfg->rps_enabled)
+ hdd_send_rps_ind(adapter);
+ else if (!enable && cds_cfg->rps_enabled)
+ hdd_send_rps_disable_ind(adapter);
+ }
+}
+
+
+/**
* hdd_configure_cds() - Configure cds modules
* @hdd_ctx: HDD context
* @adapter: Primary adapter context
@@ -7954,6 +7978,9 @@ int hdd_configure_cds(hdd_context_t *hdd_ctx, hdd_adapter_t *adapter)
dp_cbacks.hdd_disble_lro_in_cc_cb =
hdd_disable_lro_in_concurrency;
}
+
+ dp_cbacks.hdd_set_rx_mode_rps_cb = hdd_set_rx_mode_rps;
+
dp_cbacks.ol_txrx_update_mac_id_cb = ol_txrx_update_mac_id;
if (cds_register_dp_cb(&dp_cbacks) != QDF_STATUS_SUCCESS)
hdd_err("Unable to register datapath callbacks in CDS");
diff --git a/core/hdd/src/wlan_hdd_tx_rx.c b/core/hdd/src/wlan_hdd_tx_rx.c
index 52efc3988dfc..1e81a09b774e 100644
--- a/core/hdd/src/wlan_hdd_tx_rx.c
+++ b/core/hdd/src/wlan_hdd_tx_rx.c
@@ -1456,12 +1456,20 @@ void hdd_send_rps_ind(hdd_adapter_t *adapter)
uint8_t cpu_map_list_len = 0;
hdd_context_t *hdd_ctxt = NULL;
struct wlan_rps_data rps_data;
+ struct cds_config_info *cds_cfg;
+
+ cds_cfg = cds_get_ini_config();
if (!adapter) {
hdd_err("adapter is NULL");
return;
}
+ if (!cds_cfg) {
+ hdd_err("cds_cfg is NULL");
+ return;
+ }
+
hdd_ctxt = WLAN_HDD_GET_CTX(adapter);
rps_data.num_queues = NUM_TX_QUEUES;
@@ -1497,10 +1505,58 @@ void hdd_send_rps_ind(hdd_adapter_t *adapter)
WLAN_SVC_RPS_ENABLE_IND,
&rps_data, sizeof(rps_data));
+ cds_cfg->rps_enabled = true;
+
+ return;
+
err:
hdd_err("Wrong RPS configuration. enabling rx_thread");
- hdd_ctxt->rps = false;
- hdd_ctxt->enableRxThread = true;
+ cds_cfg->rps_enabled = false;
+}
+
+/**
+ * hdd_send_rps_disable_ind() - send rps disable indication to daemon
+ * @adapter: adapter context
+ *
+ * Return: none
+ */
+void hdd_send_rps_disable_ind(hdd_adapter_t *adapter)
+{
+ uint8_t cpu_map_list_len = 0;
+ hdd_context_t *hdd_ctxt = NULL;
+ struct wlan_rps_data rps_data;
+ struct cds_config_info *cds_cfg;
+
+ cds_cfg = cds_get_ini_config();
+
+ if (!adapter) {
+ hdd_err("adapter is NULL");
+ return;
+ }
+
+ if (!cds_cfg) {
+ hdd_err("cds_cfg is NULL");
+ return;
+ }
+
+ hdd_ctxt = WLAN_HDD_GET_CTX(adapter);
+ rps_data.num_queues = NUM_TX_QUEUES;
+
+ hdd_info("Set cpu_map_list 0");
+
+ qdf_mem_zero(&rps_data.cpu_map_list, sizeof(rps_data.cpu_map_list));
+ cpu_map_list_len = 0;
+ rps_data.num_queues =
+ (cpu_map_list_len < rps_data.num_queues) ?
+ cpu_map_list_len : rps_data.num_queues;
+
+ strlcpy(rps_data.ifname, adapter->dev->name,
+ sizeof(rps_data.ifname));
+ wlan_hdd_send_svc_nlink_msg(hdd_ctxt->radio_index,
+ WLAN_SVC_RPS_ENABLE_IND,
+ &rps_data, sizeof(rps_data));
+
+ cds_cfg->rps_enabled = false;
}
#ifdef MSM_PLATFORM