Browse Source

qcacmn: Add regulatory APIs to retrieve "unii_5g_bitmap" mask

Add regulatory APIs reg_get_unii_5g_bitmap and ucfg_reg_get_unii_5g_bitmap
to retrieve the value of "unii_5g_bitmap" stored in regulatory pdev
private object.

CRs-Fixed: 2574642
Change-Id: Iffb004b7fc9d9fbcf1972eb6f527529024e49c70
Priyadarshnee S 5 years ago
parent
commit
399ef175ce

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

@@ -992,6 +992,8 @@ struct wlan_lmac_if_reg_rx_ops {
 	QDF_STATUS (*reg_disable_chan_coex)(struct wlan_objmgr_pdev *pdev,
 					    uint8_t unii_5g_bitmap);
 	bool (*reg_ignore_fw_reg_offload_ind)(struct wlan_objmgr_psoc *psoc);
+	QDF_STATUS (*reg_get_unii_5g_bitmap)(struct wlan_objmgr_pdev *pdev,
+					     uint8_t *bitmap);
 };
 
 #ifdef CONVERGED_P2P_ENABLE

+ 3 - 0
umac/global_umac_dispatcher/lmac_if/src/wlan_lmac_if.c

@@ -326,6 +326,9 @@ static void wlan_lmac_if_umac_reg_rx_ops_register(
 
 	rx_ops->reg_rx_ops.reg_disable_chan_coex =
 		wlan_reg_disable_chan_coex;
+
+	rx_ops->reg_rx_ops.reg_get_unii_5g_bitmap =
+		ucfg_reg_get_unii_5g_bitmap;
 }
 
 #ifdef CONVERGED_P2P_ENABLE

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

@@ -3544,3 +3544,20 @@ bool reg_is_6ghz_supported(struct wlan_objmgr_pdev *pdev)
 
 	return psoc_priv_obj->six_ghz_supported;
 }
+
+#ifdef DISABLE_UNII_SHARED_BANDS
+QDF_STATUS
+reg_get_unii_5g_bitmap(struct wlan_objmgr_pdev *pdev, uint8_t *bitmap)
+{
+	struct wlan_regulatory_pdev_priv_obj *pdev_priv_obj;
+
+	pdev_priv_obj = reg_get_pdev_obj(pdev);
+	if (!IS_VALID_PDEV_REG_OBJ(pdev_priv_obj)) {
+		reg_err_rl("pdev reg component is NULL");
+		return QDF_STATUS_E_FAILURE;
+	}
+	*bitmap =  pdev_priv_obj->unii_5g_bitmap;
+
+	return QDF_STATUS_SUCCESS;
+}
+#endif

+ 12 - 0
umac/regulatory/core/src/reg_services_common.h

@@ -968,4 +968,16 @@ bool reg_is_6ghz_op_class(struct wlan_objmgr_pdev *pdev,
  */
 bool reg_is_6ghz_supported(struct wlan_objmgr_pdev *pdev);
 
+/**
+ * reg_get_unii_5g_bitmap() - get unii_5g_bitmap value
+ * @pdev: pdev pointer
+ * @bitmap: Pointer to retrieve the unii_5g_bitmap of enum reg_unii_band
+ *
+ * Return: QDF_STATUS
+ */
+#ifdef DISABLE_UNII_SHARED_BANDS
+QDF_STATUS
+reg_get_unii_5g_bitmap(struct wlan_objmgr_pdev *pdev, uint8_t *bitmap);
+#endif
+
 #endif

+ 19 - 0
umac/regulatory/dispatcher/inc/wlan_reg_ucfg_api.h

@@ -380,4 +380,23 @@ QDF_STATUS ucfg_reg_set_hal_reg_cap(struct wlan_objmgr_psoc *psoc,
  */
 QDF_STATUS ucfg_set_ignore_fw_reg_offload_ind(struct wlan_objmgr_psoc *psoc);
 
+/**
+ * ucfg_reg_get_unii_5g_bitmap() - get unii_5g_bitmap value
+ * @pdev: pdev pointer
+ * @bitmap: Pointer to retrieve unii_5g_bitmap of enum reg_unii_band.
+ *
+ * Return: QDF_STATUS
+ */
+#ifdef DISABLE_UNII_SHARED_BANDS
+QDF_STATUS
+ucfg_reg_get_unii_5g_bitmap(struct wlan_objmgr_pdev *pdev, uint8_t *bitmap);
+#else
+static inline QDF_STATUS
+ucfg_reg_get_unii_5g_bitmap(struct wlan_objmgr_pdev *pdev, uint8_t *bitmap)
+{
+	*bitmap = 0;
+	return QDF_STATUS_SUCCESS;
+}
+#endif
+
 #endif

+ 8 - 0
umac/regulatory/dispatcher/src/wlan_reg_ucfg_api.c

@@ -333,3 +333,11 @@ QDF_STATUS ucfg_set_ignore_fw_reg_offload_ind(struct wlan_objmgr_psoc *psoc)
 {
 	return reg_set_ignore_fw_reg_offload_ind(psoc);
 }
+
+#ifdef DISABLE_UNII_SHARED_BANDS
+QDF_STATUS
+ucfg_reg_get_unii_5g_bitmap(struct wlan_objmgr_pdev *pdev, uint8_t *bitmap)
+{
+	return reg_get_unii_5g_bitmap(pdev, bitmap);
+}
+#endif