qcacld-3.0: Cleanup P2P GO support on indoor channel

Rename policy_mgr_is_sap_allowed_on_indoor() to
policy_mgr_is_sap_go_interface_allowed_on_indoor() since
it is common between SAP and GO. Cleanup the API as well.

Change-Id: I8380bd81c5050e9f12c00fff830455f14135c2b4
CRs-Fixed: 3423703
This commit is contained in:
Surya Prakash Sivaraj
2023-03-24 20:53:22 +05:30
committed by Madan Koyyalamudi
parent fbe284ddd4
commit 34ec96337f
7 changed files with 62 additions and 41 deletions

View File

@@ -5010,8 +5010,8 @@ policy_mgr_is_conc_sap_present_on_sta_freq(struct wlan_objmgr_psoc *psoc,
uint32_t policy_mgr_get_connection_count_with_ch_freq(uint32_t ch_freq); uint32_t policy_mgr_get_connection_count_with_ch_freq(uint32_t ch_freq);
/** /**
* policy_mgr_is_sap_allowed_on_indoor() - Check if the SAP operation * policy_mgr_is_sap_go_interface_allowed_on_indoor() - Check if SAP or GO
* is allowed in the indoor channel * interface is allowed on the indoor channel
* *
* @pdev: pointer to pdev * @pdev: pointer to pdev
* @vdev_id: vdev id * @vdev_id: vdev id
@@ -5019,8 +5019,10 @@ uint32_t policy_mgr_get_connection_count_with_ch_freq(uint32_t ch_freq);
* *
* Return: is SAP allowed * Return: is SAP allowed
*/ */
bool policy_mgr_is_sap_allowed_on_indoor(struct wlan_objmgr_pdev *pdev, bool
uint8_t vdev_id, qdf_freq_t ch_freq); policy_mgr_is_sap_go_interface_allowed_on_indoor(struct wlan_objmgr_pdev *pdev,
uint8_t vdev_id,
qdf_freq_t ch_freq);
#ifdef WLAN_FEATURE_TDLS_CONCURRENCIES #ifdef WLAN_FEATURE_TDLS_CONCURRENCIES
/** /**

View File

@@ -1723,9 +1723,10 @@ bool policy_mgr_is_sap_restart_required_after_sta_disconnect(
* channel. * channel.
*/ */
if (pm_ctx->last_disconn_sta_freq == op_ch_freq_list[i] && if (pm_ctx->last_disconn_sta_freq == op_ch_freq_list[i] &&
!policy_mgr_is_sap_allowed_on_indoor(pm_ctx->pdev, !policy_mgr_is_sap_go_interface_allowed_on_indoor(
sap_vdev_id, pm_ctx->pdev,
op_ch_freq_list[i])) { sap_vdev_id,
op_ch_freq_list[i])) {
curr_sap_freq = op_ch_freq_list[i]; curr_sap_freq = op_ch_freq_list[i];
policy_mgr_debug("indoor sap_ch_freq %u", policy_mgr_debug("indoor sap_ch_freq %u",
curr_sap_freq); curr_sap_freq);
@@ -1781,9 +1782,10 @@ bool policy_mgr_is_sap_restart_required_after_sta_disconnect(
* on indoor which is not removed in policy_mgr_get_pcl * on indoor which is not removed in policy_mgr_get_pcl
*/ */
if (!sta_gc_present && if (!sta_gc_present &&
!policy_mgr_is_sap_allowed_on_indoor(pm_ctx->pdev, !policy_mgr_is_sap_go_interface_allowed_on_indoor(
sap_vdev_id, pm_ctx->pdev,
pcl_channels[i])) { sap_vdev_id,
pcl_channels[i])) {
policy_mgr_debug("Do not allow SAP on indoor frequency, STA is absent"); policy_mgr_debug("Do not allow SAP on indoor frequency, STA is absent");
continue; continue;
} }
@@ -2628,9 +2630,9 @@ policy_mgr_valid_sap_conc_channel_check(struct wlan_objmgr_psoc *psoc,
find_alternate = true; find_alternate = true;
policymgr_nofl_debug("sap not capable on SRD con ch_freq %d", policymgr_nofl_debug("sap not capable on SRD con ch_freq %d",
ch_freq); ch_freq);
} else if (!policy_mgr_is_sap_allowed_on_indoor(pm_ctx->pdev, } else if (!policy_mgr_is_sap_go_interface_allowed_on_indoor(
sap_vdev_id, pm_ctx->pdev,
ch_freq)) { sap_vdev_id, ch_freq)) {
policymgr_nofl_debug("sap not capable on indoor con ch_freq %d is_sta_sap_scc:%d", policymgr_nofl_debug("sap not capable on indoor con ch_freq %d is_sta_sap_scc:%d",
ch_freq, is_sta_sap_scc); ch_freq, is_sta_sap_scc);
find_alternate = true; find_alternate = true;

View File

@@ -9085,8 +9085,10 @@ bool policy_mgr_is_sap_allowed_on_dfs_freq(struct wlan_objmgr_pdev *pdev,
return true; return true;
} }
bool policy_mgr_is_sap_allowed_on_indoor(struct wlan_objmgr_pdev *pdev, bool
uint8_t vdev_id, qdf_freq_t ch_freq) policy_mgr_is_sap_go_interface_allowed_on_indoor(struct wlan_objmgr_pdev *pdev,
uint8_t vdev_id,
qdf_freq_t ch_freq)
{ {
struct wlan_objmgr_psoc *psoc; struct wlan_objmgr_psoc *psoc;
bool is_scc = false, indoor_support = false; bool is_scc = false, indoor_support = false;
@@ -9110,7 +9112,7 @@ bool policy_mgr_is_sap_allowed_on_indoor(struct wlan_objmgr_pdev *pdev,
* a) Restrict 6 GHz SAP * a) Restrict 6 GHz SAP
* b) Restrict standalone 5 GHz SAP * b) Restrict standalone 5 GHz SAP
* *
* If p2p_go_on_indoor_chan is enabled - Allow GO * If p2p_go_on_5ghz_indoor_chan is enabled - Allow GO
* with or without concurrency * with or without concurrency
* *
* If sta_sap_scc_on_indoor_chan is enabled - Allow * If sta_sap_scc_on_indoor_chan is enabled - Allow
@@ -9118,18 +9120,30 @@ bool policy_mgr_is_sap_allowed_on_indoor(struct wlan_objmgr_pdev *pdev,
* *
* Restrict all other operations on indoor * Restrict all other operations on indoor
*/ */
if (indoor_support) {
if (indoor_support)
return true; return true;
} else if (WLAN_REG_IS_6GHZ_CHAN_FREQ(ch_freq) ||
(!is_scc && mode == QDF_SAP_MODE)) { if (WLAN_REG_IS_6GHZ_CHAN_FREQ(ch_freq)) {
policy_mgr_rl_debug("SAP operation is not allowed on 6 GHz indoor channel");
return false;
}
if (mode == QDF_SAP_MODE) {
if (is_scc &&
policy_mgr_get_sta_sap_scc_allowed_on_indoor_chnl(psoc))
return true;
policy_mgr_rl_debug("SAP operation is not allowed on indoor channel"); policy_mgr_rl_debug("SAP operation is not allowed on indoor channel");
return false; return false;
} else if (mode == QDF_P2P_GO_MODE && }
ucfg_p2p_get_indoor_ch_support(psoc)) {
return true; if (mode == QDF_P2P_GO_MODE) {
} else if (is_scc && if (ucfg_p2p_get_indoor_ch_support(psoc) ||
policy_mgr_get_sta_sap_scc_allowed_on_indoor_chnl(psoc)) { (is_scc &&
return true; policy_mgr_get_sta_sap_scc_allowed_on_indoor_chnl(psoc)))
return true;
policy_mgr_rl_debug("GO operation is not allowed on indoor channel");
return false;
} }
policy_mgr_rl_debug("SAP operation is not allowed on indoor channel"); policy_mgr_rl_debug("SAP operation is not allowed on indoor channel");
@@ -9898,9 +9912,9 @@ bool policy_mgr_is_restart_sap_required(struct wlan_objmgr_psoc *psoc,
if (connection[i].freq != freq && if (connection[i].freq != freq &&
WLAN_REG_IS_24GHZ_CH_FREQ(connection[i].freq) && WLAN_REG_IS_24GHZ_CH_FREQ(connection[i].freq) &&
WLAN_REG_IS_5GHZ_CH_FREQ(freq) && WLAN_REG_IS_5GHZ_CH_FREQ(freq) &&
!policy_mgr_is_sap_allowed_on_indoor(pm_ctx->pdev, !policy_mgr_is_sap_go_interface_allowed_on_indoor(
vdev_id, pm_ctx->pdev,
freq)) { vdev_id, freq)) {
policy_mgr_debug("SAP in indoor freq: sta:%d sap:%d", policy_mgr_debug("SAP in indoor freq: sta:%d sap:%d",
connection[i].freq, freq); connection[i].freq, freq);
restart_required = true; restart_required = true;

View File

@@ -554,7 +554,7 @@ static QDF_STATUS p2p_object_init_params(
p2p_soc_obj->param.is_random_seq_num_enabled = p2p_soc_obj->param.is_random_seq_num_enabled =
cfg_get(psoc, CFG_ACTION_FRAME_RANDOM_SEQ_NUM_ENABLED); cfg_get(psoc, CFG_ACTION_FRAME_RANDOM_SEQ_NUM_ENABLED);
p2p_soc_obj->param.indoor_channel_support = p2p_soc_obj->param.indoor_channel_support =
cfg_get(psoc, CFG_P2P_GO_ON_INDOOR_CHANNEL); cfg_get(psoc, CFG_P2P_GO_ON_5GHZ_INDOOR_CHANNEL);
return QDF_STATUS_SUCCESS; return QDF_STATUS_SUCCESS;
} }

View File

@@ -125,7 +125,7 @@
/* /*
* <ini> * <ini>
* p2p_go_on_indoor_chan - Allow P2P GO to operate on 5 GHz indoor channels * p2p_go_on_5ghz_indoor_chan - Allow P2P GO to operate on 5 GHz indoor channels
* *
* @Min: 0 * @Min: 0
* @Max: 1 * @Max: 1
@@ -142,15 +142,16 @@
* *
* </ini> * </ini>
*/ */
#define CFG_P2P_GO_ON_INDOOR_CHANNEL CFG_INI_BOOL("p2p_go_on_indoor_chan", \ #define CFG_P2P_GO_ON_5GHZ_INDOOR_CHANNEL CFG_INI_BOOL(\
"0", \ "p2p_go_on_5ghz_indoor_chan", \
"Allow P2P GO on 5 GHz indoor channels") "0", \
"Allow P2P GO on 5 GHz indoor channels")
#define CFG_P2P_ALL \ #define CFG_P2P_ALL \
CFG(CFG_ACTION_FRAME_RANDOM_SEQ_NUM_ENABLED) \ CFG(CFG_ACTION_FRAME_RANDOM_SEQ_NUM_ENABLED) \
CFG(CFG_GO_KEEP_ALIVE_PERIOD) \ CFG(CFG_GO_KEEP_ALIVE_PERIOD) \
CFG(CFG_GO_LINK_MONITOR_PERIOD) \ CFG(CFG_GO_LINK_MONITOR_PERIOD) \
CFG(CFG_P2P_DEVICE_ADDRESS_ADMINISTRATED) \ CFG(CFG_P2P_DEVICE_ADDRESS_ADMINISTRATED) \
CFG(CFG_P2P_GO_ON_INDOOR_CHANNEL) CFG(CFG_P2P_GO_ON_5GHZ_INDOOR_CHANNEL)
#endif #endif

View File

@@ -3311,9 +3311,10 @@ int hdd_softap_set_channel_change(struct net_device *dev, int target_chan_freq,
return status; return status;
} }
if (!policy_mgr_is_sap_allowed_on_indoor(hdd_ctx->pdev, if (!policy_mgr_is_sap_go_interface_allowed_on_indoor(
adapter->deflink->vdev_id, hdd_ctx->pdev,
target_chan_freq)) { adapter->deflink->vdev_id,
target_chan_freq)) {
hdd_debug("Channel switch is not allowed to indoor frequency %d", hdd_debug("Channel switch is not allowed to indoor frequency %d",
target_chan_freq); target_chan_freq);
return -EINVAL; return -EINVAL;
@@ -7616,7 +7617,7 @@ static int __wlan_hdd_cfg80211_start_ap(struct wiphy *wiphy,
if (!status) if (!status)
return -EINVAL; return -EINVAL;
status = policy_mgr_is_sap_allowed_on_indoor( status = policy_mgr_is_sap_go_interface_allowed_on_indoor(
hdd_ctx->pdev, hdd_ctx->pdev,
adapter->deflink->vdev_id, adapter->deflink->vdev_id,
chandef->chan->center_freq); chandef->chan->center_freq);

View File

@@ -509,9 +509,10 @@ static bool sap_chan_sel_init(mac_handle_t mac_handle,
continue; continue;
/* Skip indoor channels for non-scc indoor scenario*/ /* Skip indoor channels for non-scc indoor scenario*/
if (!policy_mgr_is_sap_allowed_on_indoor(mac->pdev, if (!policy_mgr_is_sap_go_interface_allowed_on_indoor(
sap_ctx->sessionId, mac->pdev,
*pChans)) { sap_ctx->sessionId,
*pChans)) {
sap_debug("Do not allow SAP on indoor frequency %u", sap_debug("Do not allow SAP on indoor frequency %u",
*pChans); *pChans);
continue; continue;