Browse Source

qcacmn: Fix the oplass cfi mismatch in AFC request

In this Change-ID I9e72c960fefe6fbdc106bb83fb240d84d8522b80, the
80P80 opclass is excluded if the device does not support 80P80
mode of operation. The exclusion of 80P80 opclass is done only
in the AFC request size calculation. In
reg_dmn_fill_6g_opcls_chan_lists(), 80P80 CFIs are added in the
opclass index of 320 MHz. Hence, 320 MHz opclass (137) contains
cfis 7, 23 (which is actually 80P80 CFIS) and this request is sent
to the AFC server. Since, the AFC server does not support 320 MHz
SP operation in CFIs 7, 23, it does not return opclass 137 in the
AFC response. Hence, AP is unable to come up on 320 MHz in SP
power mode.

To fix this issue, exclude 80P80 CFIs in
reg_dmn_fill_6g_opcls_chan_lists() API as well if the device does
not support 80P80 mode of operation.

Change-Id: I3114f52c45f575ba3693dadc0d2a3d42ed513f68
CRs-Fixed: 3593497
Priyadarshnee Srinivasan 1 year ago
parent
commit
d45510b2bf
1 changed files with 20 additions and 15 deletions
  1. 20 15
      umac/regulatory/core/src/reg_opclass.c

+ 20 - 15
umac/regulatory/core/src/reg_opclass.c

@@ -734,6 +734,21 @@ reg_dmn_fill_cfis(const struct reg_dmn_op_class_map_t *op_class_tbl,
 	return cfi_idx;
 }
 
+/**
+ * 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)));
+}
+
 /**
  * reg_dmn_fill_6g_opcls_chan_lists() - Copy the channel lists for 6g opclasses
  * to the output argument list ('channel_lists')
@@ -764,6 +779,11 @@ static void reg_dmn_fill_6g_opcls_chan_lists(struct wlan_objmgr_pdev *pdev,
 			uint8_t *dst;
 			uint8_t num_valid_cfi = 0;
 
+			if (reg_is_unsupported_opclass(pdev, op_class_tbl->op_class)) {
+				op_class_tbl++;
+				continue;
+			}
+
 			dst = channel_lists[i];
 			if (!dst) {
 				reg_debug("dest list empty\n");
@@ -779,21 +799,6 @@ 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,