diff options
| author | Tushnim Bhattacharyya <tushnimb@codeaurora.org> | 2016-07-31 09:59:40 -0700 |
|---|---|---|
| committer | qcabuildsw <qcabuildsw@localhost> | 2016-08-19 18:33:08 -0700 |
| commit | c7d6202f2a44be26ea884a4377a6c542bb72ca4d (patch) | |
| tree | a6aa1291fe8b258b690d59d8da7fe2b68c5284df | |
| parent | 47384bcd39f485c28ab48b798653274f2dcad8a8 (diff) | |
qcacld-3.0: Disallow chain mask request for 2x2 if hardware is not capable
Disallow host requesting for 2x2 chain if hardware is not capable of or
ini setting disabled it. Downgrade the request to 1x1 instead. No need for
waiting for NSS update to complete as all requests are serialized through
SME cmd queue.
Change-Id: Ifee4ce15771b57ac3cc1e85650c56f426c34c833
CRs-Fixed: 1037816
| -rw-r--r-- | core/cds/src/cds_concurrency.c | 111 |
1 files changed, 30 insertions, 81 deletions
diff --git a/core/cds/src/cds_concurrency.c b/core/cds/src/cds_concurrency.c index c8781fc0a37a..c4a61b468ca3 100644 --- a/core/cds/src/cds_concurrency.c +++ b/core/cds/src/cds_concurrency.c @@ -2604,6 +2604,19 @@ QDF_STATUS cds_pdev_set_hw_mode(uint32_t session_id, return QDF_STATUS_E_FAILURE; } + /* + * if HW is not capable of doing 2x2 or ini config disabled 2x2, don't + * allow to request FW for 2x2 + */ + if ((HW_MODE_SS_2x2 == mac0_ss) && (!hdd_ctx->config->enable2x2)) { + cds_info("2x2 is not allowed downgrading to 1x1 for mac0"); + mac0_ss = HW_MODE_SS_1x1; + } + if ((HW_MODE_SS_2x2 == mac1_ss) && (!hdd_ctx->config->enable2x2)) { + cds_info("2x2 is not allowed downgrading to 1x1 for mac1"); + mac1_ss = HW_MODE_SS_1x1; + } + hw_mode_index = wma_get_hw_mode_idx_from_dbs_hw_list(mac0_ss, mac0_bw, mac1_ss, mac1_bw, dbs, dfs); if (hw_mode_index < 0) { @@ -3663,7 +3676,7 @@ enum cds_conc_next_action cds_need_opportunistic_upgrade(void) /* Is there any connection had an initial connection with 2x2 */ for (conn_index = 0; conn_index < MAX_NUMBER_OF_CONC_CONNECTIONS; conn_index++) { - if ((conc_connection_list[conn_index].original_nss == 1) && + if ((conc_connection_list[conn_index].original_nss == 2) && conc_connection_list[conn_index].in_use) { upgrade = CDS_SINGLE_MAC_UPGRADE; goto done; @@ -6056,62 +6069,6 @@ done: } /** - * cds_wait_for_nss_update() - finds out if we need to wait - * for all nss update to finish before requesting for HW mode - * update - * @action: next action to happen at policy mgr after - * beacon update - * - * This function finds out if we need to wait - * for all nss update to finish before requesting for HW mode - * update - * - * Return: boolean. True = wait for nss update, False = go ahead - * with HW mode update - */ -bool cds_wait_for_nss_update(uint8_t action) -{ - uint32_t conn_index = 0; - bool wait = false; - if (CDS_DBS == action) { - for (conn_index = 0; - conn_index < MAX_NUMBER_OF_CONC_CONNECTIONS; - conn_index++) { - if ((conc_connection_list - [conn_index].original_nss == 2) && - (conc_connection_list - [conn_index].chain_mask == CDS_TWO_TWO) && - conc_connection_list[conn_index].in_use && - ((conc_connection_list[conn_index].mode == - CDS_P2P_GO_MODE) || - (conc_connection_list[conn_index].mode == - CDS_SAP_MODE))) { - wait = true; - break; - } - } - } else if (CDS_SINGLE_MAC == action) { - for (conn_index = 0; - conn_index < MAX_NUMBER_OF_CONC_CONNECTIONS; - conn_index++) { - if ((conc_connection_list - [conn_index].original_nss == 2) && - (conc_connection_list - [conn_index].chain_mask == CDS_TWO_TWO) && - conc_connection_list[conn_index].in_use && - ((conc_connection_list[conn_index].mode == - CDS_P2P_GO_MODE) || - (conc_connection_list[conn_index].mode == - CDS_SAP_MODE))) { - wait = true; - break; - } - } - } - return wait; -} - -/** * cds_nss_update_cb() - callback from SME confirming nss * update * @hdd_ctx: HDD Context @@ -6133,12 +6090,9 @@ void cds_nss_update_cb(void *context, uint8_t tx_status, uint8_t vdev_id, { cds_context_type *cds_ctx; uint32_t conn_index = 0; - bool wait = true; - if (QDF_STATUS_E_FAILURE == tx_status) { - cds_err("nss update failed for vdev %d", vdev_id); - return; - } + if (QDF_STATUS_SUCCESS != tx_status) + cds_err("nss update failed(%d) for vdev %d", tx_status, vdev_id); cds_ctx = cds_get_context(QDF_MODULE_ID_QDF); if (!cds_ctx) { @@ -6156,24 +6110,9 @@ void cds_nss_update_cb(void *context, uint8_t tx_status, uint8_t vdev_id, cds_err("connection not found for vdev %d", vdev_id); return; } - switch (next_action) { - case CDS_DBS: - wait = cds_wait_for_nss_update(next_action); - break; - case CDS_SINGLE_MAC: - wait = cds_wait_for_nss_update(next_action); - break; - default: - cds_err("unexpected action %d", next_action); - break; - } - - cds_debug("vdev:%d wait:%d", vdev_id, wait); - if (!wait) - cds_next_actions(vdev_id, - next_action, - reason); + cds_debug("nss update successful for vdev:%d", vdev_id); + cds_next_actions(vdev_id, next_action, reason); qdf_mutex_release(&cds_ctx->qdf_conc_list_lock); return; } @@ -6231,7 +6170,7 @@ QDF_STATUS cds_complete_action(uint8_t new_nss, uint8_t next_action, continue; } - if (1 == conc_connection_list[list[index]].original_nss) { + if (2 == conc_connection_list[list[index]].original_nss) { status = sme_nss_update_request(hdd_ctx->hHal, conc_connection_list [list[index]].vdev_id, new_nss, @@ -6254,7 +6193,7 @@ QDF_STATUS cds_complete_action(uint8_t new_nss, uint8_t next_action, conc_connection_list[list[index]].vdev_id); continue; } - if (1 == conc_connection_list[list[index]].original_nss) { + if (2 == conc_connection_list[list[index]].original_nss) { status = sme_nss_update_request(hdd_ctx->hHal, conc_connection_list [list[index]].vdev_id, new_nss, @@ -6340,6 +6279,16 @@ QDF_STATUS cds_next_actions(uint32_t session_id, break; case CDS_SINGLE_MAC_UPGRADE: /* + * change the HW mode first before the NSS upgrade + */ + status = cds_pdev_set_hw_mode(session_id, + HW_MODE_SS_2x2, + HW_MODE_80_MHZ, + HW_MODE_SS_0x0, HW_MODE_BW_NONE, + HW_MODE_DBS_NONE, + HW_MODE_AGILE_DFS_NONE, + reason); + /* * check if we have a beaconing entity that advertised 2x2 * intially. If yes, update the beacon template & notify FW. * Once FW confirms beacon updated, send the HW mode change req |
