Browse Source

qcacld-3.0: Add puncture support

Make puncture information can be populated and parsed.
Pass the puncture bitmap to FW in peer assoc wmi command.

Change-Id: I9d6f7ead90cfe2e2b366ffb37f74bfac8404c2b7
CRs-Fixed: 3145854
Bing Sun 3 years ago
parent
commit
5078eb797e

+ 39 - 0
core/mac/src/pe/lim/lim_process_assoc_rsp_frame.c

@@ -771,6 +771,43 @@ lim_update_mcs_rate_set(struct wlan_objmgr_vdev *vdev, tDot11fIEHTCaps *ht_cap)
 	mlme_set_mcs_rate(vdev, dst_rate, len);
 }
 
+#ifdef WLAN_FEATURE_11BE
+/**
+ * lim_update_sta_vdev_punc() - Update puncture set according to assoc resp
+ * @psoc: Pointer to psoc object
+ * @vdev_id: vdev id
+ * @assoc_resp: pointer to parsed associate response
+ *
+ * Return: None.
+ */
+static void
+lim_update_sta_vdev_punc(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
+			 tpSirAssocRsp assoc_resp)
+{
+	struct wlan_objmgr_vdev *vdev;
+	struct wlan_channel *des_chan;
+
+	vdev = wlan_objmgr_get_vdev_by_id_from_psoc(psoc, vdev_id,
+						    WLAN_LEGACY_MAC_ID);
+	if (!vdev) {
+		pe_err("vdev not found for id: %d", vdev_id);
+		return;
+	}
+
+	des_chan = wlan_vdev_mlme_get_des_chan(vdev);
+	des_chan->puncture_bitmap =
+		*(uint16_t *)assoc_resp->eht_op.disable_sub_chan_bitmap;
+	pe_debug("sta vdev %d puncture %d", vdev_id, des_chan->puncture_bitmap);
+	wlan_objmgr_vdev_release_ref(vdev, WLAN_LEGACY_MAC_ID);
+}
+#else
+static void
+lim_update_sta_vdev_punc(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
+			 tpSirAssocRsp assoc_resp)
+{
+}
+#endif
+
 /**
  * hdd_cm_update_rate_set() - Update rate set according to assoc resp
  * @psoc: Pointer to psoc object
@@ -1276,6 +1313,8 @@ lim_process_assoc_rsp_frame(struct mac_context *mac_ctx, uint8_t *rx_pkt_info,
 				   session_entry->nss);
 	lim_update_vdev_rate_set(mac_ctx->psoc, session_entry->smeSessionId,
 				 assoc_rsp);
+	lim_update_sta_vdev_punc(mac_ctx->psoc, session_entry->smeSessionId,
+				 assoc_rsp);
 
 	/*
 	 * Extract the AP capabilities from the beacon that

+ 27 - 1
core/mac/src/pe/lim/lim_utils.c

@@ -9932,6 +9932,26 @@ QDF_STATUS lim_set_ch_phy_mode(struct wlan_objmgr_vdev *vdev, uint8_t dot11mode)
 	return QDF_STATUS_SUCCESS;
 }
 
+#ifdef WLAN_FEATURE_11BE
+/**
+ * lim_update_ap_puncture() - set puncture_bitmap for ap session
+ * @session: session
+ * @ch_params: pointer to ch_params
+ *
+ * Return: void
+ */
+static void lim_update_ap_puncture(struct pe_session *session,
+				   struct ch_params *ch_params)
+{
+	if (ch_params->reg_punc_bitmap) {
+		*(uint16_t *)session->eht_op.disable_sub_chan_bitmap =
+					ch_params->reg_punc_bitmap;
+		session->eht_op.disable_sub_chan_bitmap_present = true;
+		pe_debug("vdev %d, puncture %d", session->vdev_id,
+			 ch_params->reg_punc_bitmap);
+	}
+}
+
 /**
  * lim_update_des_chan_puncture() - set puncture_bitmap of des_chan
  * @des_chan: pointer to wlan_channel
@@ -9939,13 +9959,17 @@ QDF_STATUS lim_set_ch_phy_mode(struct wlan_objmgr_vdev *vdev, uint8_t dot11mode)
  *
  * Return: void
  */
-#ifdef WLAN_FEATURE_11BE
 static void lim_update_des_chan_puncture(struct wlan_channel *des_chan,
 					 struct ch_params *ch_params)
 {
 	des_chan->puncture_bitmap = ch_params->reg_punc_bitmap;
 }
 #else
+static void lim_update_ap_puncture(struct pe_session *session,
+				   struct ch_params *ch_params)
+{
+}
+
 static void lim_update_des_chan_puncture(struct wlan_channel *des_chan,
 					 struct ch_params *ch_params)
 {
@@ -10016,6 +10040,8 @@ QDF_STATUS lim_pre_vdev_start(struct mac_context *mac,
 	des_chan->ch_freq_seg2 = ch_params.center_freq_seg1;
 	des_chan->ch_ieee = wlan_reg_freq_to_chan(mac->pdev, des_chan->ch_freq);
 	lim_update_des_chan_puncture(des_chan, &ch_params);
+	if (LIM_IS_AP_ROLE(session))
+		lim_update_ap_puncture(session, &ch_params);
 	session->ch_width = ch_params.ch_width;
 	session->ch_center_freq_seg0 = ch_params.center_freq_seg0;
 	session->ch_center_freq_seg1 = ch_params.center_freq_seg1;

+ 13 - 0
core/wma/src/wma_mgmt.c

@@ -1174,12 +1174,24 @@ wma_host_to_fw_phymode_11be(enum wlan_phymode host_phymode)
 		return WMI_HOST_MODE_UNKNOWN;
 	}
 }
+
+static void wma_populate_peer_puncture(struct peer_assoc_params *peer,
+				       struct wlan_channel *des_chan)
+{
+	peer->puncture_bitmap = des_chan->puncture_bitmap;
+	wma_debug("Peer EHT puncture bitmap %d", peer->puncture_bitmap);
+}
 #else
 static WMI_HOST_WLAN_PHY_MODE
 wma_host_to_fw_phymode_11be(enum wlan_phymode host_phymode)
 {
 	return WMI_HOST_MODE_UNKNOWN;
 }
+
+static void wma_populate_peer_puncture(struct peer_assoc_params *peer,
+				       struct wlan_channel *des_chan)
+{
+}
 #endif
 
 WMI_HOST_WLAN_PHY_MODE wma_host_to_fw_phymode(enum wlan_phymode host_phymode)
@@ -1683,6 +1695,7 @@ QDF_STATUS wma_send_peer_assoc(tp_wma_handle wma,
 
 	wma_populate_peer_he_cap(cmd, params);
 	wma_populate_peer_eht_cap(cmd, params);
+	wma_populate_peer_puncture(cmd, des_chan);
 	if (!wma_is_vdev_in_ap_mode(wma, params->smesessionId))
 		intr->nss = cmd->peer_nss;