Browse Source

qcacld-3.0: Fix no puncture in chan change event when SAP start

When SAP start, channel change event is sent to upper layer before
vdev start, puncture bitmap isn't filled at that time.

To fix it, send channel change event to upper layer after SAP vdev
started.

Change-Id: If7a993c354ab456762cc7be068b12eece0d2893d
CRs-Fixed: 3495030
Jianmin Zhu 1 year ago
parent
commit
5d55617fb1
2 changed files with 13 additions and 7 deletions
  1. 7 2
      core/hdd/src/wlan_hdd_hostapd.c
  2. 6 5
      core/sap/src/sap_fsm.c

+ 7 - 2
core/hdd/src/wlan_hdd_hostapd.c

@@ -1053,9 +1053,10 @@ QDF_STATUS hdd_chan_change_notify(struct hdd_adapter *adapter,
 	puncture_bitmap = wlan_hdd_get_puncture_bitmap(chan_change);
 
 	hdd_objmgr_put_vdev_by_user(vdev, WLAN_OSIF_ID);
-	hdd_debug("notify: chan:%d width:%d freq1:%d freq2:%d",
+	hdd_debug("notify: chan:%d width:%d freq1:%d freq2:%d punct 0x%x",
 		  chandef.chan->center_freq, chandef.width,
-		  chandef.center_freq1, chandef.center_freq2);
+		  chandef.center_freq1, chandef.center_freq2,
+		  puncture_bitmap);
 
 	if (hdd_adapter_is_link_adapter(adapter)) {
 		hdd_debug("replace link adapter dev with ml adapter dev");
@@ -1762,6 +1763,8 @@ static QDF_STATUS hdd_hostapd_chan_change(struct hdd_adapter *adapter,
 	struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
 	struct sap_ch_selected_s *sap_chan_selected =
 			&sap_event->sapevt.sap_ch_selected;
+	struct sap_config *sap_config =
+				&adapter->deflink->session.ap.sap_config;
 
 	sap_ch_param.ch_width = sap_chan_selected->ch_width;
 	sap_ch_param.mhz_freq_seg0 =
@@ -1769,6 +1772,8 @@ static QDF_STATUS hdd_hostapd_chan_change(struct hdd_adapter *adapter,
 	sap_ch_param.mhz_freq_seg1 =
 		sap_chan_selected->vht_seg1_center_ch_freq;
 
+	if (sap_phymode_is_eht(sap_config->SapHw_mode))
+		wlan_reg_set_create_punc_bitmap(&sap_ch_param, true);
 	wlan_reg_set_channel_params_for_pwrmode(
 		hdd_ctx->pdev,
 		sap_chan_selected->pri_ch_freq,

+ 6 - 5
core/sap/src/sap_fsm.c

@@ -3383,11 +3383,6 @@ static QDF_STATUS sap_goto_starting(struct sap_context *sap_ctx,
 			sap_err("rates full, can not add H2E bss membership");
 		}
 	}
-	sap_debug("notify hostapd about chan freq selection: %d",
-		  sap_ctx->chan_freq);
-	sap_signal_hdd_event(sap_ctx, NULL,
-			     eSAP_CHANNEL_CHANGE_EVENT,
-			     (void *)eSAP_STATUS_SUCCESS);
 	sap_dfs_set_current_channel(sap_ctx);
 	/* Reset radar found flag before start sap, the flag will
 	 * be set when radar found in CAC wait.
@@ -3798,6 +3793,12 @@ static QDF_STATUS sap_fsm_state_starting(struct sap_context *sap_ctx,
 						(void *)eSAP_STATUS_SUCCESS);
 			sap_ctx->is_chan_change_inprogress = false;
 		} else {
+			sap_debug("notify hostapd about chan freq selection: %d",
+				  sap_ctx->chan_freq);
+			qdf_status =
+				sap_signal_hdd_event(sap_ctx, roam_info,
+						     eSAP_CHANNEL_CHANGE_EVENT,
+						     (void *)eSAP_STATUS_SUCCESS);
 			/* Action code for transition */
 			qdf_status = sap_signal_hdd_event(sap_ctx, roam_info,
 					eSAP_START_BSS_EVENT,