diff options
| author | Komal Seelam <kseelam@codeaurora.org> | 2016-02-23 18:03:19 +0530 |
|---|---|---|
| committer | Prakash Dhavali <pdhavali@codeaurora.org> | 2016-03-23 13:45:07 -0700 |
| commit | 02d0934a4a83aee8bd0940f5869c032a194d3ca6 (patch) | |
| tree | ffcedd316b8a07ab2da71d3004310c7d5ebab611 | |
| parent | 48152e1a16d7241e65c4b31323df54e45147ead4 (diff) | |
qcacld-3.0: update WMA with ini config for max_peers
Max_peers configuration is needed only by WMA. Remove dependency of
ol layer for max_peers and move it WMA.
Change-Id: I336b02ae84c72c70ca459425b38b197e5fe551a0
CRs-Fixed: 967765
| -rw-r--r-- | core/bmi/inc/ol_fw.h | 8 | ||||
| -rw-r--r-- | core/bmi/src/ol_fw.c | 24 | ||||
| -rw-r--r-- | core/cds/src/cds_api.c | 1 | ||||
| -rw-r--r-- | core/hdd/src/wlan_hdd_main.c | 1 | ||||
| -rw-r--r-- | core/wma/inc/wma.h | 12 | ||||
| -rw-r--r-- | core/wma/src/wma_main.c | 94 |
6 files changed, 88 insertions, 52 deletions
diff --git a/core/bmi/inc/ol_fw.h b/core/bmi/inc/ol_fw.h index a9918d7cd82c..c26c26aaf279 100644 --- a/core/bmi/inc/ol_fw.h +++ b/core/bmi/inc/ol_fw.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014 The Linux Foundation. All rights reserved. + * Copyright (c) 2014, 2016 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -49,16 +49,10 @@ #ifdef HIF_PCI void ol_target_failure(void *instance, CDF_STATUS status); -uint8_t ol_get_number_of_peers_supported(struct ol_softc *scn); #else static inline void ol_target_failure(void *instance, CDF_STATUS status) { return; } - -static inline uint8_t ol_get_number_of_peers_supported(struct ol_softc *scn) -{ - return 1; -} #endif #endif /* _OL_FW_H_ */ diff --git a/core/bmi/src/ol_fw.c b/core/bmi/src/ol_fw.c index ab5edb355030..240f7c385ccd 100644 --- a/core/bmi/src/ol_fw.c +++ b/core/bmi/src/ol_fw.c @@ -1635,27 +1635,3 @@ static int ol_target_coredump(void *inst, void *memory_block, } return ret; } - -#define MAX_SUPPORTED_PEERS_REV1_1 14 -#define MAX_SUPPORTED_PEERS_REV1_3 32 - -uint8_t ol_get_number_of_peers_supported(struct ol_softc *scn) -{ - struct hif_config_info *ini_cfg = hif_get_ini_handle(scn); - struct hif_target_info *tgt_info = hif_get_target_info_handle(scn); - uint8_t max_no_of_peers = ini_cfg->max_no_of_peers; - - switch (tgt_info->target_version) { - case AR6320_REV1_1_VERSION: - if (max_no_of_peers > MAX_SUPPORTED_PEERS_REV1_1) - max_no_of_peers = MAX_SUPPORTED_PEERS_REV1_1; - break; - - default: - if (max_no_of_peers > MAX_SUPPORTED_PEERS_REV1_3) - max_no_of_peers = MAX_SUPPORTED_PEERS_REV1_3; - break; - - } - return max_no_of_peers; -} diff --git a/core/cds/src/cds_api.c b/core/cds/src/cds_api.c index dcb92c922e35..f205d2a73bf0 100644 --- a/core/cds/src/cds_api.c +++ b/core/cds/src/cds_api.c @@ -363,6 +363,7 @@ CDF_STATUS cds_open(void) mac_openParms.tx_chain_mask_cck = pHddCtx->config->tx_chain_mask_cck; mac_openParms.self_gen_frm_pwr = pHddCtx->config->self_gen_frm_pwr; + mac_openParms.maxStation = pHddCtx->config->maxNumberOfPeers; cdf_status = wma_open(gp_cds_context, hdd_update_tgt_cfg, diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 484112567469..af356ed1d54b 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -7003,7 +7003,6 @@ void hdd_update_hif_config(void *scn, hdd_context_t *hdd_ctx) cfg->enable_self_recovery = hdd_ctx->config->enableSelfRecovery; cfg->enable_uart_print = hdd_ctx->config->enablefwprint; cfg->enable_fw_log = hdd_ctx->config->enable_fw_log; - cfg->max_no_of_peers = hdd_ctx->config->maxNumberOfPeers; cfg->enable_ramdump_collection = hdd_ctx->config->is_ramdump_enabled; cfg->enable_lpass_support = hdd_is_lpass_supported(hdd_ctx); diff --git a/core/wma/inc/wma.h b/core/wma/inc/wma.h index 91e71471c956..456f08ed4c10 100644 --- a/core/wma/inc/wma.h +++ b/core/wma/inc/wma.h @@ -1035,6 +1035,16 @@ struct wmi_init_cmd { }; /** + * struct wma_ini_config - Structure to hold wma ini configuration + * @max_no_of_peers: Max Number of supported + * + * Placeholder for WMA ini parameters. + */ +struct wma_ini_config { + uint8_t max_no_of_peers; +}; + +/** * struct t_wma_handle - wma context * @wmi_handle: wmi handle * @htc_handle: htc handle @@ -1342,6 +1352,7 @@ typedef struct { cdf_wake_lock_t wmi_cmd_rsp_wake_lock; cdf_runtime_lock_t wmi_cmd_rsp_runtime_lock; uint32_t fine_time_measurement_cap; + struct wma_ini_config ini_config; } t_wma_handle, *tp_wma_handle; /** @@ -2012,3 +2023,4 @@ void wma_indicate_err(enum ol_rx_err_type err_type, struct ol_error_info *err_info); #endif +struct wma_ini_config *wma_get_ini_handle(tp_wma_handle wma_handle); diff --git a/core/wma/src/wma_main.c b/core/wma/src/wma_main.c index 84d66d890c52..aa07912ab1e2 100644 --- a/core/wma/src/wma_main.c +++ b/core/wma/src/wma_main.c @@ -126,6 +126,62 @@ end: } /** + * wma_get_ini_handle() - API to get WMA ini info handle + * @wma: WMA Handle + * + * Returns the pointer to WMA ini structure. + * Return: struct wma_ini_config + */ +struct wma_ini_config *wma_get_ini_handle(tp_wma_handle wma) +{ + if (!wma) { + WMA_LOGE("%s: Invalid WMA context\n", __func__); + return NULL; + } + + return &wma->ini_config; +} + +#define MAX_SUPPORTED_PEERS_REV1_1 14 +#define MAX_SUPPORTED_PEERS_REV1_3 32 +#define MIN_NO_OF_PEERS 1 + +/** + * wma_get_number_of_peers_supported - API to query for number of peers + * supported + * @wma: WMA Handle + * + * Return: Max Number of Peers Supported + */ +static uint8_t wma_get_number_of_peers_supported(tp_wma_handle wma) +{ + struct hif_target_info *tgt_info; + struct wma_ini_config *cfg = wma_get_ini_handle(wma); + uint8_t max_no_of_peers = cfg ? cfg->max_no_of_peers : MIN_NO_OF_PEERS; + struct ol_softc *scn = cds_get_context(CDF_MODULE_ID_HIF); + + if (!scn) { + WMA_LOGE("%s: Invalid wma handle", __func__); + return 0; + } + + tgt_info = hif_get_target_info_handle(scn); + + switch (tgt_info->target_version) { + case AR6320_REV1_1_VERSION: + if (max_no_of_peers > MAX_SUPPORTED_PEERS_REV1_1) + max_no_of_peers = MAX_SUPPORTED_PEERS_REV1_1; + break; + default: + if (max_no_of_peers > MAX_SUPPORTED_PEERS_REV1_3) + max_no_of_peers = MAX_SUPPORTED_PEERS_REV1_3; + break; + } + + return max_no_of_peers; +} + +/** * wma_set_default_tgt_config() - set default tgt config * @wma_handle: wma handle * @@ -133,7 +189,6 @@ end: */ static void wma_set_default_tgt_config(tp_wma_handle wma_handle) { - struct ol_softc *scn; uint8_t no_of_peers_supported; wmi_resource_config tgt_cfg = { 0, /* Filling zero for TLV Tag and Length fields */ @@ -180,13 +235,7 @@ static void wma_set_default_tgt_config(tp_wma_handle wma_handle) CFG_TGT_NUM_OCB_SCHEDULES, }; - /* Update the max number of peers */ - scn = cds_get_context(CDF_MODULE_ID_HIF); - if (!scn) { - WMA_LOGE("%s: cds_context is NULL", __func__); - return; - } - no_of_peers_supported = ol_get_number_of_peers_supported(scn); + no_of_peers_supported = wma_get_number_of_peers_supported(wma_handle); tgt_cfg.num_peers = no_of_peers_supported + CFG_TGT_NUM_VDEV + 2; tgt_cfg.num_tids = (2 * (no_of_peers_supported + CFG_TGT_NUM_VDEV + 2)); tgt_cfg.scan_max_pending_req = wma_handle->max_scan; @@ -1514,6 +1563,21 @@ static void wma_set_nan_enable(tp_wma_handle wma_handle, #endif /** + * wma_init_max_no_of_peers - API to initialize wma configuration params + * @wma_handle: WMA Handle + * @max_peers: Max Peers supported + * + * Return: void + */ +static void wma_init_max_no_of_peers(tp_wma_handle wma_handle, + uint16_t max_peers) +{ + struct wma_ini_config *cfg = wma_get_ini_handle(wma_handle); + + cfg->max_no_of_peers = max_peers; +} + +/** * wma_open() - Allocate wma context and initialize it. * @cds_context: cds context * @wma_tgt_cfg_cb: tgt config callback fun @@ -1532,7 +1596,6 @@ CDF_STATUS wma_open(void *cds_context, cdf_device_t cdf_dev; void *wmi_handle; CDF_STATUS cdf_status; - struct ol_softc *scn; struct txrx_pdev_cfg_param_t olCfg = { 0 }; WMA_LOGD("%s: Enter", __func__); @@ -1648,17 +1711,8 @@ CDF_STATUS wma_open(void *cds_context, if (cds_get_conparam() == CDF_GLOBAL_FTM_MODE) wma_utf_attach(wma_handle); #endif /* QCA_WIFI_FTM */ - - /*TODO: Recheck below parameters */ - scn = cds_get_context(CDF_MODULE_ID_HIF); - - if (NULL == scn) { - WMA_LOGE("%s: Failed to get scn", __func__); - cdf_status = CDF_STATUS_E_NOMEM; - goto err_scn_context; - } - - mac_params->maxStation = ol_get_number_of_peers_supported(scn); + wma_init_max_no_of_peers(wma_handle, mac_params->maxStation); + mac_params->maxStation = wma_get_number_of_peers_supported(wma_handle); mac_params->maxBssId = WMA_MAX_SUPPORTED_BSS; mac_params->frameTransRequired = 0; |
