فهرست منبع

qcacmn: Update super chan list with AFC_NOT_DONE flag for outdoor

Prior to receiving the power event, the super channel list is not getting
rightly updated with the REGULATORY_CHAN_AFC_NOT_DONE flag as it is filled
using afc_chan_list which is not filled until the power event is received.

To fix this issue, call reg_assign_afc_chan_entry_to_mas_chan in
reg_update_sup_ch_entry_for_mode only if AFC power event is received.

Now the super channel list is copied from mas_chan_list_6g_ap before the
power event and from afc_chan_list after the power event is received.
These lists have the REGULATORY_CHAN_AFC_NOT_DONE flag updated during
construction. So remove the  call to reg_update_6g_chan_for_outdoor as
it is redundant.

Remove the return statement after disabling the out of chip range channels
as it does not get reflected the super channel list. This disabling is
done on local data and it is copied to super chan list only towards the
end of the function.

Change-Id: I725cf41ec3dc68ba9a615752fd170fc7b574aa16
CRs-Fixed: 3216916
Amith A 3 سال پیش
والد
کامیت
98b8c53d08
1فایلهای تغییر یافته به همراه12 افزوده شده و 52 حذف شده
  1. 12 52
      umac/regulatory/core/src/reg_build_chan_list.c

+ 12 - 52
umac/regulatory/core/src/reg_build_chan_list.c

@@ -2004,49 +2004,11 @@ reg_set_flag_afc_not_done(uint32_t *chan_flags, bool is_set)
 		*chan_flags &= ~REGULATORY_CHAN_AFC_NOT_DONE;
 }
 
-/**
- * reg_update_6g_chan_for_outdoor() - Update channel state and flags for
- * outdoor
- * @pdev_priv: Regulatory pdev private object
- * @chan_info: Channel parameters
- * @chan_idx:  Channel index.
- *
- * Return: void
- */
-static void
-reg_update_6g_chan_for_outdoor(struct wlan_regulatory_pdev_priv_obj *pdev_priv,
-			       struct super_chan_info *chan_info)
-{
-	uint32_t *p_chan_flags;
-
-	if (pdev_priv->reg_afc_dev_deployment_type != AFC_DEPLOYMENT_OUTDOOR)
-		return;
-
-	if (chan_info->state_arr[REG_AP_SP] == CHANNEL_STATE_DISABLE)
-		return;
-
-	p_chan_flags = &chan_info->chan_flags_arr[REG_AP_SP];
-
-	if (pdev_priv->is_6g_afc_power_event_received) {
-		reg_set_flag_afc_not_done(p_chan_flags, false);
-		return;
-	}
-
-	reg_set_flag_afc_not_done(p_chan_flags, true);
-}
-
 #else
 static inline void
 reg_set_flag_afc_not_done(uint32_t *chan_flags, bool is_set)
 {
 }
-
-static inline void
-reg_update_6g_chan_for_outdoor(struct wlan_regulatory_pdev_priv_obj *pdev_priv,
-			       struct super_chan_info *chan_info)
-{
-}
-
 #endif
 
 /**
@@ -2397,14 +2359,15 @@ static void reg_update_sup_ch_entry_for_mode(
 	if (!mas_chan)
 		return;
 
+	/*
+	 * If AFC is invalid, copy from Regulatory SP channel list.
+	 * If AFC is valid, copy from AFC response channel list.
+	 */
 	if (reg_is_sp_supp_pwr_mode(supp_pwr_mode)) {
-		/* Add the entry to super channel list whether or not AFC
-		 * response is received. If AFC response is not received
-		 * mark the channel flag as REGULATORY_AFC_NOT_DONE
-		 */
-		reg_assign_afc_chan_entry_to_mas_chan(pdev_priv_obj,
-						      &mas_chan,
-						      chn_idx);
+		if (wlan_reg_is_afc_power_event_received(pdev))
+			reg_assign_afc_chan_entry_to_mas_chan(pdev_priv_obj,
+							      &mas_chan,
+							      chn_idx);
 	}
 
 	if (!mas_chan)
@@ -2415,25 +2378,22 @@ static void reg_update_sup_ch_entry_for_mode(
 	/*
 	 * Intersect the hardware frequency range with the
 	 * 6GHz channels.
+	 * If a channel is out of chip range, disable it.
 	 */
 	if (reg_is_chan_out_of_chip_range(&temp_reg_chan, pdev_priv_obj)) {
 		reg_dis_chan_state_and_flags(&temp_reg_chan.state,
 					     &temp_reg_chan.chan_flags);
-		return;
 	}
 
-	if (reg_is_chan_disabled_and_not_nol(&temp_reg_chan))
-		return;
-
 	super_chan_list = pdev_priv_obj->super_chan_list;
 	copy_enh_chan_info_from_reg_chan(&super_chan_list[chn_idx],
 					 supp_pwr_mode,
 					 &temp_reg_chan);
+	if (reg_is_chan_disabled_and_not_nol(&temp_reg_chan))
+		return;
+
 	reg_dis_6g_edge_chan_in_enh_chan(pdev, &super_chan_list[chn_idx],
 					 chn_idx, supp_pwr_mode);
-	reg_update_6g_chan_for_outdoor(pdev_priv_obj,
-				       &super_chan_list[chn_idx]);
-
 	reg_fill_best_pwr_mode(pdev_priv_obj, super_chan_list, chn_idx,
 			       supp_pwr_mode, temp_reg_chan.tx_power,
 			       max_eirp_pwr);