diff options
| author | Service qcabuildsw <qcabuildsw@localhost> | 2016-12-19 09:57:32 -0800 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2016-12-19 09:57:32 -0800 |
| commit | 98a5375af5bd409b18f131a29e2b721631b24520 (patch) | |
| tree | 266f8aa6ad56ef0f4ac503e8a6e89b91db7675e0 | |
| parent | 5b4ccaf3b26ffe6f1d5e49c0659f4ffb019c5dde (diff) | |
| parent | 4bfff1af09af7632ca235fb8688d60b038ee670f (diff) | |
Merge "qcacld-3.0: Register/De-register DP callbacks with CDS" into wlan-cld3.driver.lnx.1.1-dev
| -rw-r--r-- | core/cds/inc/cds_api.h | 14 | ||||
| -rw-r--r-- | core/cds/inc/cds_sched.h | 6 | ||||
| -rw-r--r-- | core/cds/src/cds_api.c | 52 | ||||
| -rw-r--r-- | core/cds/src/cds_concurrency.c | 14 | ||||
| -rw-r--r-- | core/hdd/src/wlan_hdd_main.c | 19 |
5 files changed, 87 insertions, 18 deletions
diff --git a/core/cds/inc/cds_api.h b/core/cds/inc/cds_api.h index 1ecabb01b6c8..12b583d53dd0 100644 --- a/core/cds/inc/cds_api.h +++ b/core/cds/inc/cds_api.h @@ -86,6 +86,18 @@ struct cds_sme_cbacks { uint8_t *, uint8_t *); }; +/** + * struct cds_dp_cbacks - list of datapath functions registered with CDS + * @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 + */ +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 cds_set_driver_state(enum cds_driver_state); void cds_clear_driver_state(enum cds_driver_state); enum cds_driver_state cds_get_driver_state(void); @@ -295,4 +307,6 @@ bool cds_is_10_mhz_enabled(void); bool cds_is_sub_20_mhz_enabled(void); bool cds_is_self_recovery_enabled(void); void cds_pkt_stats_to_logger_thread(void *pl_hdr, void *pkt_dump, void *data); +QDF_STATUS cds_register_dp_cb(struct cds_dp_cbacks *dp_cbs); +QDF_STATUS cds_deregister_dp_cb(void); #endif /* if !defined __CDS_API_H */ diff --git a/core/cds/inc/cds_sched.h b/core/cds/inc/cds_sched.h index 85c56f32b933..54a9d42c0ae2 100644 --- a/core/cds/inc/cds_sched.h +++ b/core/cds/inc/cds_sched.h @@ -313,9 +313,9 @@ typedef struct _cds_context_type { uint8_t *, uint8_t *); /* Datapath callback functions */ - void (*ol_txrx_update_mac_id)(uint8_t , uint8_t); - void (*hdd_enable_lro_in_concurrency)(struct hdd_context_s *); - void (*hdd_disable_lro_in_concurrency)(struct hdd_context_s *); + 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 *); /* 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 542b05d3dbce..c2504f4f9a96 100644 --- a/core/cds/src/cds_api.c +++ b/core/cds/src/cds_api.c @@ -458,12 +458,6 @@ QDF_STATUS cds_open(void) goto err_sme_close; } - gp_cds_context->ol_txrx_update_mac_id = ol_txrx_update_mac_id; - gp_cds_context->hdd_enable_lro_in_concurrency = - hdd_enable_lro_in_concurrency; - gp_cds_context->hdd_disable_lro_in_concurrency = - hdd_disable_lro_in_concurrency; - QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_INFO_HIGH, "%s: CDS successfully Opened", __func__); @@ -2446,3 +2440,49 @@ inline void cds_pkt_stats_to_logger_thread(void *pl_hdr, void *pkt_dump, wlan_pkt_stats_to_logger_thread(pl_hdr, pkt_dump, data); } + +/** + * cds_register_dp_cb() - Register datapath callbacks with CDS + * @dp_cbs: pointer to cds_dp_cbacks structure + * + * Return: QDF_STATUS + */ +QDF_STATUS cds_register_dp_cb(struct cds_dp_cbacks *dp_cbs) +{ + p_cds_contextType cds_ctx; + + cds_ctx = cds_get_global_context(); + if (!cds_ctx) { + cds_err("Invalid CDS context"); + return QDF_STATUS_E_FAILURE; + } + + 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; + return QDF_STATUS_SUCCESS; +} + +/** + * cds_deregister_dp_cb() - Deregister datapath callbacks with CDS + * @dp_cbs: pointer to cds_dp_cbacks structure + * + * Return: QDF_STATUS + */ +QDF_STATUS cds_deregister_dp_cb(void) + +{ + p_cds_contextType cds_ctx; + + cds_ctx = cds_get_global_context(); + if (!cds_ctx) { + cds_err("Invalid CDS context"); + return QDF_STATUS_E_FAILURE; + } + + 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; + + return QDF_STATUS_SUCCESS; +} diff --git a/core/cds/src/cds_concurrency.c b/core/cds/src/cds_concurrency.c index 9f40b8fd2b7d..4c41547c3247 100644 --- a/core/cds/src/cds_concurrency.c +++ b/core/cds/src/cds_concurrency.c @@ -2162,8 +2162,8 @@ static void cds_update_conc_list(uint32_t conn_index, conc_connection_list[conn_index].in_use = in_use; cds_dump_connection_status_info(); - if (cds_ctx->ol_txrx_update_mac_id) - cds_ctx->ol_txrx_update_mac_id(vdev_id, mac); + if (cds_ctx->ol_txrx_update_mac_id_cb) + cds_ctx->ol_txrx_update_mac_id_cb(vdev_id, mac); } @@ -3800,10 +3800,10 @@ void cds_incr_active_session(enum tQDF_ADAPTER_MODE mode, 0) || (cds_mode_specific_connection_count(CDS_P2P_GO_MODE, NULL) > 0) || (cds_mode_specific_connection_count(CDS_IBSS_MODE, NULL) > 0)) { - if (cds_ctx->hdd_disable_lro_in_concurrency != NULL) - cds_ctx->hdd_disable_lro_in_concurrency(hdd_ctx); + if (cds_ctx->hdd_disable_lro_in_cc_cb != NULL) + cds_ctx->hdd_disable_lro_in_cc_cb(hdd_ctx); else - cds_warn("hdd_disable_lro_in_concurrency NULL!"); + cds_warn("hdd_disable_lro_in_cc_cb NULL!"); }; /* set tdls connection tracker state */ @@ -4044,8 +4044,8 @@ void cds_decr_active_session(enum tQDF_ADAPTER_MODE mode, 0) && (cds_mode_specific_connection_count(CDS_P2P_GO_MODE, NULL) == 0) && (cds_mode_specific_connection_count(CDS_IBSS_MODE, NULL) == 0)) { - if (cds_ctx->hdd_enable_lro_in_concurrency != NULL) - cds_ctx->hdd_enable_lro_in_concurrency(hdd_ctx); + if (cds_ctx->hdd_en_lro_in_cc_cb != NULL) + cds_ctx->hdd_en_lro_in_cc_cb(hdd_ctx); else cds_warn("hdd_enable_lro_in_concurrency NULL!"); }; diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 56c9454a23f1..00933befba88 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -105,7 +105,7 @@ #include "nan_api.h" #include <wlan_hdd_napi.h> #include "wlan_hdd_disa.h" - +#include "ol_txrx.h" #ifdef MODULE #define WLAN_MODULE_NAME module_name(THIS_MODULE) #else @@ -7802,9 +7802,12 @@ int hdd_configure_cds(hdd_context_t *hdd_ctx, hdd_adapter_t *adapter) { int ret; QDF_STATUS status; - /* structure of function pointers to be used by CDS */ + /* structure of SME function pointers to be used by CDS */ struct cds_sme_cbacks sme_cbacks; + /* structure of datapath function pointers to be used by CDS */ + struct cds_dp_cbacks dp_cbacks; + ret = hdd_pre_enable_configure(hdd_ctx); if (ret) { hdd_err("Failed to pre-configure cds"); @@ -7840,6 +7843,12 @@ int hdd_configure_cds(hdd_context_t *hdd_ctx, hdd_adapter_t *adapter) goto hdd_features_deinit; } + dp_cbacks.hdd_en_lro_in_cc_cb = hdd_enable_lro_in_concurrency; + dp_cbacks.hdd_disble_lro_in_cc_cb = hdd_disable_lro_in_concurrency; + 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"); + return 0; hdd_features_deinit: @@ -7877,6 +7886,12 @@ static int hdd_deconfigure_cds(hdd_context_t *hdd_ctx) ret = -EINVAL; } + qdf_status = cds_deregister_dp_cb(); + if (!QDF_IS_STATUS_SUCCESS(qdf_status)) { + hdd_err("Failed to deregister datapath callbacks from CDS :%d", + qdf_status); + } + qdf_status = cds_disable(hdd_ctx->pcds_context); if (!QDF_IS_STATUS_SUCCESS(qdf_status)) { hdd_err("Failed to Disable the CDS Modules! :%d", |
