Browse Source

qcacmn: Implement API to support GETBAND functionality

Add GETBAND support by implementing API, ucfg_reg_get_band

Change-Id: I91fabb367c53aed5ae13a0bb4272965f925d44bd
CRs-Fixed: 2412777
Harprit Chhabada 6 years ago
parent
commit
5d32743e83

+ 32 - 0
umac/regulatory/core/src/reg_utils.c

@@ -403,6 +403,38 @@ QDF_STATUS reg_set_band(struct wlan_objmgr_pdev *pdev,
 	return status;
 }
 
+QDF_STATUS reg_get_band(struct wlan_objmgr_pdev *pdev,
+			enum band_info *band)
+{
+	struct wlan_regulatory_psoc_priv_obj *psoc_priv_obj;
+	struct wlan_regulatory_pdev_priv_obj *pdev_priv_obj;
+	struct wlan_objmgr_psoc *psoc;
+
+	pdev_priv_obj = reg_get_pdev_obj(pdev);
+
+	if (!IS_VALID_PDEV_REG_OBJ(pdev_priv_obj)) {
+		reg_err("pdev reg component is NULL");
+		return QDF_STATUS_E_INVAL;
+	}
+
+	psoc = wlan_pdev_get_psoc(pdev);
+	if (!psoc) {
+		reg_err("psoc is NULL");
+		return QDF_STATUS_E_INVAL;
+	}
+
+	psoc_priv_obj = reg_get_psoc_obj(psoc);
+	if (!IS_VALID_PSOC_REG_OBJ(psoc_priv_obj)) {
+		reg_err("psoc reg component is NULL");
+		return QDF_STATUS_E_INVAL;
+	}
+
+	reg_debug("getting band_info: %d", pdev_priv_obj->band_capability);
+	*band = pdev_priv_obj->band_capability;
+
+	return QDF_STATUS_SUCCESS;
+}
+
 #ifdef DISABLE_CHANNEL_LIST
 QDF_STATUS reg_restore_cached_channels(struct wlan_objmgr_pdev *pdev)
 {

+ 12 - 3
umac/regulatory/core/src/reg_utils.h

@@ -56,21 +56,30 @@ bool reg_chan_has_dfs_attribute(struct wlan_objmgr_pdev *pdev, uint32_t ch);
 /**
  * reg_set_band() - Sets the band information for the PDEV
  * @pdev: The physical dev to set the band for
- * @band: The set band parameters to configure for the pysical device
+ * @band: The set band parameters to configure for the physical device
  *
  * Return: QDF_STATUS
  */
 QDF_STATUS reg_set_band(struct wlan_objmgr_pdev *pdev, enum band_info band);
 
+/**
+ * reg_get_band() - Get the band information for the PDEV
+ * @pdev: The physical dev to get the band for
+ * @band: The band parameters of the physical device
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS reg_get_band(struct wlan_objmgr_pdev *pdev, enum band_info *band);
+
 #ifdef DISABLE_CHANNEL_LIST
 /**
- * reg_restore_cached_channels() - Cache the current state of the channles
+ * reg_restore_cached_channels() - Cache the current state of the channels
  * @pdev: The physical dev to cache the channels for
  */
 QDF_STATUS reg_restore_cached_channels(struct wlan_objmgr_pdev *pdev);
 
 /**
- * reg_cache_channel_state() - Cache the current state of the channles
+ * reg_cache_channel_state() - Cache the current state of the channels
  * @pdev: The physical dev to cache the channels for
  * @channel_list: List of the channels for which states needs to be cached
  * @num_channels: Number of channels in the list

+ 12 - 2
umac/regulatory/dispatcher/inc/wlan_reg_ucfg_api.h

@@ -31,12 +31,22 @@ typedef QDF_STATUS (*reg_event_cb)(void *status_struct);
 /**
  * ucfg_reg_set_band() - Sets the band information for the PDEV
  * @pdev: The physical pdev to set the band for
- * @band: The set band parameter to configure for the pysical device
+ * @band: The set band parameter to configure for the physical device
  *
  * Return: QDF_STATUS
  */
 QDF_STATUS ucfg_reg_set_band(struct wlan_objmgr_pdev *pdev,
-		enum band_info band);
+			     enum band_info band);
+
+/**
+ * ucfg_reg_get_band() - Gets the band information for the PDEV
+ * @pdev: The physical pdev to get the band for
+ * @band: The band parameter of the physical device
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS ucfg_reg_get_band(struct wlan_objmgr_pdev *pdev,
+			     enum band_info *band);
 
 /**
  * ucfg_reg_notify_sap_event() - Notify regulatory domain for sap event

+ 7 - 7
umac/regulatory/dispatcher/src/wlan_reg_ucfg_api.c

@@ -117,19 +117,19 @@ QDF_STATUS ucfg_reg_get_current_cc(struct wlan_objmgr_pdev *pdev,
 }
 
 #ifdef CONFIG_REG_CLIENT
-/**
- * ucfg_reg_set_band() - Sets the band information for the PDEV
- * @pdev: The physical pdev to set the band for
- * @band: The set band parameter to configure for the pysical device
- *
- * Return: QDF_STATUS
- */
+
 QDF_STATUS ucfg_reg_set_band(struct wlan_objmgr_pdev *pdev,
 			     enum band_info band)
 {
 	return reg_set_band(pdev, band);
 }
 
+QDF_STATUS ucfg_reg_get_band(struct wlan_objmgr_pdev *pdev,
+			     enum band_info *band)
+{
+	return reg_get_band(pdev, band);
+}
+
 /**
  * ucfg_reg_notify_sap_event() - Notify regulatory domain for sap event
  * @pdev: The physical dev to set the band for