Przeglądaj źródła

qcacmn: Include opclass 80p80 in AFC request only if device supports

AFC request is sent for all the opclass supported in the global opclass
including 80p80. Not all the devices support 80p80 and so, it is
unnecessarily included in the AFC request.

Create a callback function in regulatory to check if 80p80 is supported by
the device. If the support is present then the AFC request can include
80p80 opclass (opclass number 135 in global operating class). If not, then
the AFC request excludes 80p80 opclass.

Include 80p80 opclass in the AFC request based on the devices' support.

Change-Id: I9e72c960fefe6fbdc106bb83fb240d84d8522b80
CRs-Fixed: 3538926
Vignesh U 2 lat temu
rodzic
commit
416c570033

+ 2 - 0
target_if/regulatory/src/target_if_reg.c

@@ -1454,5 +1454,7 @@ QDF_STATUS target_if_register_regulatory_tx_ops(
 
 	reg_ops->end_r2p_table_update_wait = NULL;
 
+	reg_ops->is_80p80_supported = NULL;
+
 	return QDF_STATUS_SUCCESS;
 }

+ 3 - 0
umac/global_umac_dispatcher/lmac_if/inc/wlan_lmac_if_def.h

@@ -1129,6 +1129,8 @@ struct wlan_lmac_if_ftm_rx_ops {
  *			rate2power table update event handler.
  * @end_r2p_table_update_wait: Call-back function to end the wait on r2p update
  *			response from fw.
+ * @is_80p80_supported: Callback function to check if the device supports a
+ * 6GHz 80p80 channel.
  */
 struct wlan_lmac_if_reg_tx_ops {
 	QDF_STATUS (*register_master_handler)(struct wlan_objmgr_psoc *psoc,
@@ -1199,6 +1201,7 @@ struct wlan_lmac_if_reg_tx_ops {
 	QDF_STATUS (*end_r2p_table_update_wait)(
 			struct wlan_objmgr_psoc *psoc,
 			uint32_t pdev_id);
+	bool (*is_80p80_supported)(struct wlan_objmgr_pdev *pdev);
 };
 
 /**

+ 23 - 2
umac/regulatory/core/src/reg_opclass.c

@@ -779,6 +779,21 @@ static void reg_dmn_fill_6g_opcls_chan_lists(struct wlan_objmgr_pdev *pdev,
 	}
 }
 
+/**
+ * reg_is_unsupported_opclass() - Checks if the given opclass is unsupported or
+ * not.
+ * @pdev: Pointer to pdev.
+ * @op_class: Opclass number.
+ *
+ * Return: True if opclass is unsupported, else false.
+ */
+static bool
+reg_is_unsupported_opclass(struct wlan_objmgr_pdev *pdev, uint8_t op_class)
+{
+	return ((op_class == GLOBAL_6G_OPCLASS_80P80) &&
+		(!reg_is_dev_supports_80p80(pdev)));
+}
+
 QDF_STATUS reg_dmn_get_6g_opclasses_and_channels(struct wlan_objmgr_pdev *pdev,
 						 struct wlan_afc_frange_list *p_frange_lst,
 						 uint8_t *num_opclasses,
@@ -842,13 +857,19 @@ QDF_STATUS reg_dmn_get_6g_opclasses_and_channels(struct wlan_objmgr_pdev *pdev,
 	count = 0;
 	while (op_class_tbl && op_class_tbl->op_class) {
 		const struct c_freq_lst *p_lst;
+		uint8_t op_class = op_class_tbl->op_class;
 
 		p_lst = op_class_tbl->p_cfi_lst_obj;
 		if (p_lst &&
-		    reg_is_6ghz_op_class(pdev, op_class_tbl->op_class)) {
+		    reg_is_6ghz_op_class(pdev, op_class)) {
 			uint8_t n_supp_cfis = 0;
 			uint8_t j;
 
+			if (reg_is_unsupported_opclass(pdev, op_class)) {
+				op_class_tbl++;
+				continue;
+			}
+
 			for (j = 0; j < p_lst->num_cfis; j++) {
 				uint8_t cfi;
 				qdf_freq_t cfi_freq;
@@ -870,7 +891,7 @@ QDF_STATUS reg_dmn_get_6g_opclasses_and_channels(struct wlan_objmgr_pdev *pdev,
 			 */
 			if (n_supp_cfis) {
 				l_chansize_lst[count] = n_supp_cfis;
-				l_opcls_lst[count] = op_class_tbl->op_class;
+				l_opcls_lst[count] = op_class;
 				(*num_opclasses)++;
 				count++;
 			}

+ 25 - 0
umac/regulatory/core/src/reg_services_common.c

@@ -10162,3 +10162,28 @@ QDF_STATUS reg_process_r2p_table_update_response(struct wlan_objmgr_psoc *psoc,
 
 	return status;
 }
+
+#ifndef CONFIG_REG_CLIENT
+bool reg_is_dev_supports_80p80(struct wlan_objmgr_pdev *pdev)
+{
+	struct wlan_lmac_if_reg_tx_ops *reg_tx_ops;
+	struct wlan_objmgr_psoc *psoc;
+
+	psoc = wlan_pdev_get_psoc(pdev);
+	if (!psoc) {
+		reg_err("psoc is NULL");
+		return false;
+	}
+
+	reg_tx_ops = reg_get_psoc_tx_ops(psoc);
+	if (!reg_tx_ops) {
+		reg_err("reg_tx_ops is NULL");
+		return false;
+	}
+
+	if (reg_tx_ops->is_80p80_supported)
+		return reg_tx_ops->is_80p80_supported(pdev);
+
+	return false;
+}
+#endif

+ 20 - 2
umac/regulatory/core/src/reg_services_common.h

@@ -127,8 +127,9 @@
 
 /* EEPROM setting is a country code */
 #define    COUNTRY_ERD_FLAG     0x8000
-#define MIN_6GHZ_OPER_CLASS 131
-#define MAX_6GHZ_OPER_CLASS 137
+#define MIN_6GHZ_OPER_CLASS     131
+#define MAX_6GHZ_OPER_CLASS     137
+#define GLOBAL_6G_OPCLASS_80P80 135
 
 #ifdef CONFIG_AFC_SUPPORT
 #define DEFAULT_REQ_ID 11235813
@@ -3076,4 +3077,21 @@ QDF_STATUS reg_process_r2p_table_update_response(struct wlan_objmgr_psoc *psoc,
 qdf_freq_t
 reg_get_endchan_cen_from_bandstart(qdf_freq_t band_start,
 				   uint16_t bw);
+
+#ifndef CONFIG_REG_CLIENT
+/**
+ * reg_is_dev_supports_80p80() - Fetch if the device supports 80p80
+ * (discontinuous 160MHz) channel.
+ * @pdev: PDEV object
+ *
+ * Return: True, if the device supports 80p80, else, false.
+ */
+bool reg_is_dev_supports_80p80(struct wlan_objmgr_pdev *pdev);
+#else
+static inline
+bool reg_is_dev_supports_80p80(struct wlan_objmgr_pdev *pdev)
+{
+	return false;
+}
+#endif
 #endif