Jelajahi Sumber

qcacld-3.0: Set ru_punct_supp_bw of wiphy

Set ru_punct_supp_bw of wiphy to indicate puncturing support.

Change-Id: I8df09e36172fe064d2192423b51e8b73d1bad5c2
CRs-Fixed: 3155064
Bing Sun 3 tahun lalu
induk
melakukan
b7b003f34f
1 mengubah file dengan 24 tambahan dan 7 penghapusan
  1. 24 7
      core/hdd/src/wlan_hdd_eht.c

+ 24 - 7
core/hdd/src/wlan_hdd_eht.c

@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2021, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for any
  * purpose with or without fee is hereby granted, provided that the above
@@ -134,6 +135,23 @@ hdd_update_wiphy_eht_caps_6ghz(struct hdd_context *hdd_ctx,
 		phy_info[0] |= CHAN_WIDTH_SET_80PLUS80_MHZ_IN_5G;
 }
 
+#ifdef CFG80211_RU_PUNCT_SUPPORT
+static void hdd_update_wiphy_punct_support(struct hdd_context *hdd_ctx)
+{
+	/*
+	 * ru_punct_supp_bw is the minimum BW of puncture.
+	 * If it is set to 80, then 160 and 320 puncture bandwidth will also be
+	 * supported in this case.
+	 * If it is set to 320, then only 320 puncture bandwidth is supported.
+	 */
+	hdd_ctx->wiphy->ru_punct_supp_bw = NL80211_RU_PUNCT_SUPP_BW_80;
+}
+#else
+static void hdd_update_wiphy_punct_support(struct hdd_context *hdd_ctx)
+{
+}
+#endif
+
 void hdd_update_wiphy_eht_cap(struct hdd_context *hdd_ctx)
 {
 	tDot11fIEeht_cap eht_cap_cfg;
@@ -144,7 +162,7 @@ void hdd_update_wiphy_eht_cap(struct hdd_context *hdd_ctx)
 	QDF_STATUS status;
 	uint8_t *phy_info_5g =
 		    hdd_ctx->iftype_data_5g->eht_cap.eht_cap_elem.phy_cap_info;
-	uint8_t max_fw_bw = sme_get_vht_ch_width();
+	uint8_t max_fw_bw = sme_get_eht_ch_width();
 	uint32_t channel_bonding_mode_2g;
 	uint8_t *phy_info_2g =
 		    hdd_ctx->iftype_data_2g->eht_cap.eht_cap_elem.phy_cap_info;
@@ -155,6 +173,9 @@ void hdd_update_wiphy_eht_cap(struct hdd_context *hdd_ctx)
 	if (QDF_IS_STATUS_ERROR(status))
 		return;
 
+	if (eht_cap_cfg.present)
+		hdd_update_wiphy_punct_support(hdd_ctx);
+
 	if (band_2g) {
 		hdd_ctx->iftype_data_2g->types_mask =
 			(BIT(NL80211_IFTYPE_STATION) | BIT(NL80211_IFTYPE_AP));
@@ -182,16 +203,12 @@ void hdd_update_wiphy_eht_cap(struct hdd_context *hdd_ctx)
 		hdd_ctx->iftype_data_5g->eht_cap.has_eht = eht_cap_cfg.present;
 		if (hdd_ctx->iftype_data_5g->eht_cap.has_eht) {
 			hdd_ctx->iftype_data_5g->he_cap.has_he = true;
-			if (max_fw_bw >= WNI_CFG_VHT_CHANNEL_WIDTH_80MHZ)
+			if (max_fw_bw >= WNI_CFG_EHT_CHANNEL_WIDTH_80MHZ)
 				phy_info_5g[0] |=
 					CHAN_WIDTH_SET_40MHZ_80MHZ_IN_5G;
-			if (max_fw_bw >= WNI_CFG_VHT_CHANNEL_WIDTH_160MHZ)
+			if (max_fw_bw >= WNI_CFG_EHT_CHANNEL_WIDTH_160MHZ)
 				phy_info_5g[0] |=
 					CHAN_WIDTH_SET_160MHZ_IN_5G;
-			if (max_fw_bw >=
-				WNI_CFG_VHT_CHANNEL_WIDTH_80_PLUS_80MHZ)
-				phy_info_5g[0] |=
-					CHAN_WIDTH_SET_80PLUS80_MHZ_IN_5G;
 		}
 	}