diff options
| author | bings <bings@codeaurora.org> | 2019-06-25 11:40:29 +0800 |
|---|---|---|
| committer | bings <bings@codeaurora.org> | 2019-06-25 16:38:26 +0800 |
| commit | 318cd86a7e132ba8e9648f69a136fc8ab29673d3 (patch) | |
| tree | b9766da9577bd77830617d1f6cce0acfb14f374e | |
| parent | eb7b0783fc30d5ffd963b78f8516361d104139a4 (diff) | |
qcacld-2.0: Provide iwpriv to configure candidate channel
Currently driver will switch to random channel when radar is detected.
Some vendors expect driver to switch to the non-dfs channel specified
by themself. Provide iwpriv to configure candidate channel, then driver
switches to the configured channel when radar is detected.
Change-Id: Ib7be2691efce2aac55ebc51ea8bf3cc4008abee6
CRs-Fixed: 2478265
| -rw-r--r-- | CORE/HDD/inc/qc_sap_ioctl.h | 1 | ||||
| -rw-r--r-- | CORE/HDD/src/wlan_hdd_hostapd.c | 13 | ||||
| -rw-r--r-- | CORE/SAP/src/sapFsm.c | 21 | ||||
| -rw-r--r-- | CORE/SAP/src/sapInternal.h | 5 |
4 files changed, 37 insertions, 3 deletions
diff --git a/CORE/HDD/inc/qc_sap_ioctl.h b/CORE/HDD/inc/qc_sap_ioctl.h index 18d7df8cb804..4c16bb0e7d5b 100644 --- a/CORE/HDD/inc/qc_sap_ioctl.h +++ b/CORE/HDD/inc/qc_sap_ioctl.h @@ -272,6 +272,7 @@ enum { QCSAP_ENABLE_RTS_BURSTING, QCSAP_ENABLE_DYNAMIC_BW, QCSAP_GET_DYNAMIC_BW, + QCSAP_SET_CANDIDATE_CH, }; int iw_get_channel_list(struct net_device *dev, diff --git a/CORE/HDD/src/wlan_hdd_hostapd.c b/CORE/HDD/src/wlan_hdd_hostapd.c index 0cdf00ad0811..d1735ff2e893 100644 --- a/CORE/HDD/src/wlan_hdd_hostapd.c +++ b/CORE/HDD/src/wlan_hdd_hostapd.c @@ -4633,6 +4633,15 @@ static __iw_softap_setparam(struct net_device *dev, set_value, PDEV_CMD); break; + case QCSAP_SET_CANDIDATE_CH: + { + ptSapContext sap_ctx = WLAN_HDD_GET_SAP_CTX_PTR(pHostapdAdapter); + + hddLog(LOG1, "QCSAP_SET_CANDIDATE_CH val %d", set_value); + sap_ctx->candidate_ch = set_value; + break; + } + default: hddLog(LOGE, FL("Invalid setparam command %d value %d"), sub_cmd, set_value); @@ -7414,6 +7423,10 @@ static const struct iw_priv_args hostapd_private_args[] = { 0, "cwmenable" }, + { QCSAP_SET_CANDIDATE_CH, + IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, + 0, + "candidate_ch" }, { QCSAP_IOCTL_GETPARAM, 0, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "getparam" }, diff --git a/CORE/SAP/src/sapFsm.c b/CORE/SAP/src/sapFsm.c index 08a49ef178f9..95c3d260fc69 100644 --- a/CORE/SAP/src/sapFsm.c +++ b/CORE/SAP/src/sapFsm.c @@ -4206,7 +4206,15 @@ sapFsm v_U8_t ch; /* find a new available channel */ - ch = sapRandomChannelSel(sapContext); + if (sapContext->candidate_ch && + !VOS_IS_DFS_CH(sapContext->candidate_ch) && + sapContext->candidate_ch != sapContext->channel) { + ch = sapContext->candidate_ch; + VOS_TRACE(VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_DEBUG, + FL("Candidate channel exist, ch= %d"), ch); + } else { + ch = sapRandomChannelSel(sapContext); + } if (ch == 0) { /* No available channel found */ VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, @@ -5409,7 +5417,16 @@ v_U8_t sapIndicateRadar(ptSapContext sapContext, tSirSmeDfsEventInd *dfs_event) * (5) Create the available channel list with the above rules */ - target_channel = sapRandomChannelSel(sapContext); + if (sapContext->candidate_ch && + !VOS_IS_DFS_CH(sapContext->candidate_ch) && + sapContext->candidate_ch != sapContext->channel) { + target_channel = sapContext->candidate_ch; + VOS_TRACE(VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_DEBUG, + FL("Candidate channel exist, ch= %d"), target_channel); + } else { + target_channel = sapRandomChannelSel(sapContext); + } + if (0 == target_channel) { sapSignalHDDevent(sapContext, NULL, eSAP_DFS_NO_AVAILABLE_CHANNEL, diff --git a/CORE/SAP/src/sapInternal.h b/CORE/SAP/src/sapInternal.h index 79da55f8b182..aa95f05e0c84 100644 --- a/CORE/SAP/src/sapInternal.h +++ b/CORE/SAP/src/sapInternal.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2017, 2019 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -181,6 +181,9 @@ typedef struct sSapContext { v_U32_t channel; v_U32_t secondary_ch; + // Include the candidate channel of AP + v_U32_t candidate_ch; + // Include the SME(CSR) sessionId here v_U8_t sessionId; |
