|
@@ -139,6 +139,31 @@ void policy_mgr_update_with_safe_channel_list(uint8_t *pcl_channels,
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
+static QDF_STATUS policy_mgr_modify_pcl_based_on_enabled_channels(
|
|
|
+ uint8_t *pcl_list_org,
|
|
|
+ uint8_t *weight_list_org,
|
|
|
+ uint32_t *pcl_len_org)
|
|
|
+{
|
|
|
+ uint32_t i, pcl_len = 0;
|
|
|
+ uint8_t pcl_list[QDF_MAX_NUM_CHAN];
|
|
|
+ uint8_t weight_list[QDF_MAX_NUM_CHAN];
|
|
|
+
|
|
|
+ for (i = 0; i < *pcl_len_org; i++) {
|
|
|
+ if (!wlan_reg_is_passive_or_disable_ch(pcl_list_org[i])) {
|
|
|
+ pcl_list[pcl_len] = pcl_list_org[i];
|
|
|
+ weight_list[pcl_len++] = weight_list_org[i];
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ qdf_mem_zero(pcl_list_org, QDF_ARRAY_SIZE(pcl_list_org));
|
|
|
+ qdf_mem_zero(weight_list_org, QDF_ARRAY_SIZE(weight_list_org));
|
|
|
+ qdf_mem_copy(pcl_list_org, pcl_list, pcl_len);
|
|
|
+ qdf_mem_copy(weight_list_org, weight_list, pcl_len);
|
|
|
+ *pcl_len_org = pcl_len;
|
|
|
+
|
|
|
+ return QDF_STATUS_SUCCESS;
|
|
|
+}
|
|
|
+
|
|
|
uint8_t policy_mgr_get_channel(struct wlan_objmgr_psoc *psoc,
|
|
|
enum policy_mgr_con_mode mode, uint32_t *vdev_id)
|
|
|
{
|
|
@@ -293,6 +318,19 @@ QDF_STATUS policy_mgr_get_pcl(struct wlan_objmgr_psoc *psoc,
|
|
|
|
|
|
}
|
|
|
|
|
|
+ if (mode == PM_P2P_GO_MODE) {
|
|
|
+ status = policy_mgr_modify_pcl_based_on_enabled_channels(
|
|
|
+ pcl_channels, pcl_weight, len);
|
|
|
+ if (QDF_IS_STATUS_ERROR(status)) {
|
|
|
+ policy_mgr_err("failed to get modified pcl for GO");
|
|
|
+ return status;
|
|
|
+ }
|
|
|
+ policy_mgr_debug("modified pcl len:%d", *len);
|
|
|
+ for (i = 0; i < *len; i++)
|
|
|
+ policy_mgr_debug("chan:%d weight:%d",
|
|
|
+ pcl_channels[i], pcl_weight[i]);
|
|
|
+ }
|
|
|
+
|
|
|
return QDF_STATUS_SUCCESS;
|
|
|
}
|
|
|
|