diff --git a/components/mlme/core/inc/wlan_mlme_main.h b/components/mlme/core/inc/wlan_mlme_main.h
index a21089abac..31602454cb 100644
--- a/components/mlme/core/inc/wlan_mlme_main.h
+++ b/components/mlme/core/inc/wlan_mlme_main.h
@@ -186,4 +186,14 @@ struct wlan_mlme_psoc_obj *mlme_get_psoc_obj_fl(struct wlan_objmgr_psoc *psoc,
const char *func,
uint32_t line);
+/**
+ * mlme_init_ibss_cfg() - Init IBSS config data structure with default CFG value
+ * @psoc: pointer to the psoc object
+ * @ibss_cfg: Pointer to IBSS cfg data structure to return values
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS mlme_init_ibss_cfg(struct wlan_objmgr_psoc *psoc,
+ struct wlan_mlme_ibss_cfg *ibss_cfg);
+
#endif
diff --git a/components/mlme/core/src/wlan_mlme_main.c b/components/mlme/core/src/wlan_mlme_main.c
index 9000b578d2..504b189772 100644
--- a/components/mlme/core/src/wlan_mlme_main.c
+++ b/components/mlme/core/src/wlan_mlme_main.c
@@ -1209,6 +1209,35 @@ static void mlme_init_acs_cfg(struct wlan_objmgr_psoc *psoc,
cfg_get(psoc, CFG_EXTERNAL_ACS_POLICY);
}
+QDF_STATUS mlme_init_ibss_cfg(struct wlan_objmgr_psoc *psoc,
+ struct wlan_mlme_ibss_cfg *ibss_cfg)
+{
+ if (!ibss_cfg)
+ return QDF_STATUS_E_FAILURE;
+
+ ibss_cfg->auto_bssid = cfg_default(CFG_IBSS_AUTO_BSSID);
+ ibss_cfg->atim_win_size = cfg_get(psoc, CFG_IBSS_ATIM_WIN_SIZE);
+ ibss_cfg->adhoc_ch_5g = cfg_get(psoc, CFG_IBSS_ADHOC_CHANNEL_5GHZ);
+ ibss_cfg->adhoc_ch_2g = cfg_get(psoc, CFG_IBSS_ADHOC_CHANNEL_24GHZ);
+ ibss_cfg->coalesing_enable = cfg_get(psoc, CFG_IBSS_COALESING);
+ ibss_cfg->power_save_allow = cfg_get(psoc,
+ CFG_IBSS_IS_POWER_SAVE_ALLOWED);
+ ibss_cfg->power_collapse_allow =
+ cfg_get(psoc, CFG_IBSS_IS_POWER_COLLAPSE_ALLOWED);
+ ibss_cfg->awake_on_tx_rx = cfg_get(psoc, CFG_IBSS_AWAKE_ON_TX_RX);
+ ibss_cfg->inactivity_bcon_count =
+ cfg_get(psoc, CFG_IBSS_INACTIVITY_TIME);
+ ibss_cfg->txsp_end_timeout =
+ cfg_get(psoc, CFG_IBSS_TXSP_END_INACTIVITY);
+ ibss_cfg->ps_warm_up_time = cfg_get(psoc, CFG_IBSS_PS_WARMUP_TIME);
+ ibss_cfg->ps_1rx_chain_atim_win =
+ cfg_get(psoc, CFG_IBSS_PS_1RX_CHAIN_IN_ATIM_WINDOW);
+ qdf_copy_macaddr(&ibss_cfg->bssid, (struct qdf_mac_addr *)
+ &cfg_get(psoc, CFG_IBSS_BSSID));
+
+ return QDF_STATUS_SUCCESS;
+}
+
static void
mlme_init_product_details_cfg(struct wlan_mlme_product_details_cfg
*product_details)
@@ -2031,6 +2060,7 @@ QDF_STATUS mlme_cfg_on_psoc_enable(struct wlan_objmgr_psoc *psoc)
mlme_init_stats_cfg(psoc, &mlme_cfg->stats);
mlme_init_twt_cfg(psoc, &mlme_cfg->twt_cfg);
mlme_init_lfr_cfg(psoc, &mlme_cfg->lfr);
+ mlme_init_ibss_cfg(psoc, &mlme_cfg->ibss);
mlme_init_feature_flag_in_cfg(psoc, &mlme_cfg->feature_flags);
mlme_init_scoring_cfg(psoc, &mlme_cfg->scoring);
mlme_init_threshold_cfg(psoc, &mlme_cfg->threshold);
diff --git a/components/mlme/dispatcher/inc/cfg_mlme.h b/components/mlme/dispatcher/inc/cfg_mlme.h
index db18e3a198..c0a45a40f0 100644
--- a/components/mlme/dispatcher/inc/cfg_mlme.h
+++ b/components/mlme/dispatcher/inc/cfg_mlme.h
@@ -26,6 +26,7 @@
#include "cfg_mlme_chainmask.h"
#include "cfg_mlme_edca_params.h"
#include "cfg_mlme_generic.h"
+#include "cfg_mlme_ibss.h"
#include "cfg_mlme_acs.h"
#include "cfg_mlme_power.h"
#include "cfg_mlme_ht_caps.h"
@@ -72,6 +73,7 @@
CFG_GENERIC_ALL \
CFG_HT_CAPS_ALL \
CFG_HE_CAPS_ALL \
+ CFG_IBSS_ALL \
CFG_LFR_ALL \
CFG_MBO_ALL \
CFG_MLME_POWER_ALL \
diff --git a/components/mlme/dispatcher/inc/cfg_mlme_ibss.h b/components/mlme/dispatcher/inc/cfg_mlme_ibss.h
new file mode 100644
index 0000000000..6295a0d54a
--- /dev/null
+++ b/components/mlme/dispatcher/inc/cfg_mlme_ibss.h
@@ -0,0 +1,379 @@
+/*
+ * Copyright (c) 2012-2018 The Linux Foundation. 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 copyright notice and this permission notice appear in all
+ * copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+ * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
+ * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
+ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/**
+ * DOC: This file contains centralized definitions of converged configuration.
+ */
+
+#ifndef __CFG_MLME_IBSS_H
+#define __CFG_MLME_IBSS_H
+
+/*
+ *
+ * g_IBSS_AUTO_BSSID - Control IBSS Auto BSSID setup
+ * @Min: 0
+ * @Max: 1
+ * @Default: 1
+ *
+ * Control IBSS Auto BSSID enable / disable
+ * Usage: External
+ *
+ *
+ */
+#define CFG_IBSS_AUTO_BSSID CFG_BOOL( \
+ "gIbssAutoBssid", \
+ 1, \
+ "Enable Auto BSSID for IBSS")
+
+/*
+ *
+ * gAdHocChannel5G - Default 5Ghz IBSS channel if channel is not
+ * provided by supplicant.
+ * @Min: 36
+ * @Max: 165
+ * @Default: 44
+ *
+ * This ini is used to set default 5Ghz IBSS channel
+ * if channel is not provided by supplicant and band is 5Ghz
+ *
+ * Related: None
+ *
+ * Supported Feature: IBSS
+ *
+ * Usage: Internal/External
+ *
+ *
+ */
+#define CFG_IBSS_ADHOC_CHANNEL_5GHZ CFG_INI_UINT( \
+ "gAdHocChannel5G", \
+ 36, \
+ 165, \
+ 44, \
+ CFG_VALUE_OR_DEFAULT, \
+ "Default 5Ghz IBSS channel if not provided by supplicant")
+
+/*
+ *
+ * gAdHocChannel24G - Default 2.4Ghz IBSS channel if channel is not
+ * provided by supplicant.
+ * @Min: 1
+ * @Max: 14
+ * @Default: 6
+ *
+ * This ini is used to set default 2.4Ghz IBSS channel
+ * if channel is not provided by supplicant and band is 2.4Ghz
+ *
+ * Related: None
+ *
+ * Supported Feature: IBSS
+ *
+ * Usage: Internal/External
+ *
+ *
+ */
+#define CFG_IBSS_ADHOC_CHANNEL_24GHZ CFG_INI_UINT( \
+ "gAdHocChannel24G", \
+ 1, \
+ 14, \
+ 6, \
+ CFG_VALUE_OR_DEFAULT, \
+ "Default 2.4Ghz IBSS channel if not provided by supplicant")
+
+/*
+ *
+ * gCoalesingInIBSS - If IBSS coalesing is enabled.
+ * @Min: 0
+ * @Max: 1
+ * @Default: 0
+ *
+ * This ini is used to set IBSS coalesing
+ *
+ * Related: None
+ *
+ * Supported Feature: IBSS
+ *
+ * Usage: Internal/External
+ *
+ *
+ */
+#define CFG_IBSS_COALESING CFG_INI_BOOL( \
+ "gCoalesingInIBSS", \
+ 0, \
+ "IBSS coalesing control param")
+
+/*
+ *
+ * gIbssATIMWinSize - Set IBSS ATIM window size
+ * @Min: 0
+ * @Max: 50
+ * @Default: 0
+ *
+ * This ini is used to set IBSS ATIM window size
+ *
+ * Related: None
+ *
+ * Supported Feature: IBSS
+ *
+ * Usage: Internal/External
+ *
+ *
+ */
+#define CFG_IBSS_ATIM_WIN_SIZE CFG_INI_UINT( \
+ "gIbssATIMWinSize", \
+ 0, \
+ 50, \
+ 0, \
+ CFG_VALUE_OR_DEFAULT, \
+ "Set IBSS ATIM window size")
+
+/*
+ *
+ * gIbssIsPowerSaveAllowed - Indicates if IBSS Power Save is
+ * supported or not
+ * @Min: 0
+ * @Max: 1
+ * @Default: 1
+ *
+ * This ini is used to Indicates if IBSS Power Save is
+ * supported or not. When not allowed,IBSS station has
+ * to stay awake all the time and should never set PM=1
+ * in its transmitted frames.
+ *
+ * Related: valid only when gIbssATIMWinSize is non-zero
+ *
+ * Supported Feature: IBSS
+ *
+ * Usage: Internal/External
+ *
+ *
+ */
+#define CFG_IBSS_IS_POWER_SAVE_ALLOWED CFG_INI_BOOL( \
+ "gIbssIsPowerSaveAllowed", \
+ 1, \
+ "IBSS Power Save control")
+
+/*
+ *
+ * gIbssIsPowerCollapseAllowed - Indicates if IBSS Power Collapse
+ * is allowed
+ * @Min: 0
+ * @Max: 1
+ * @Default: 1
+ *
+ * This ini is used to indicates if IBSS Power Collapse
+ * is allowed
+ *
+ * Related: None
+ *
+ * Supported Feature: IBSS
+ *
+ * Usage: Internal/External
+ *
+ *
+ */
+#define CFG_IBSS_IS_POWER_COLLAPSE_ALLOWED CFG_INI_BOOL( \
+ "gIbssIsPowerCollapseAllowed", \
+ 1, \
+ "Indicates if IBSS Power Collapse is allowed")
+
+/*
+ *
+ * gIbssAwakeOnTxRx - Indicates whether IBSS station
+ * can exit power save mode and enter power active
+ * state whenever there is a TX/RX activity.
+ *
+ * @Min: 0
+ * @Max: 1
+ * @Default: 0
+ *
+ * This ini is used to ndicates whether IBSS station
+ * can exit power save mode and enter power active
+ * state whenever there is a TX/RX activity.
+ *
+ * Related: None
+ *
+ * Supported Feature: IBSS
+ *
+ * Usage: Internal/External
+ *
+ *
+ */
+#define CFG_IBSS_AWAKE_ON_TX_RX CFG_INI_BOOL( \
+ "gIbssAwakeOnTxRx", \
+ 0, \
+ "IBSS sta power save mode on TX/RX activity")
+
+/*
+ *
+ * gIbssInactivityTime - Indicates the data
+ * inactivity time in number of beacon intervals
+ * after which IBSS station re-inters power save
+ *
+ * @Min: 1
+ * @Max: 10
+ * @Default: 1
+ *
+ * In IBSS mode if Awake on TX/RX activity is enabled
+ * Ibss Inactivity parameter indicates the data
+ * inactivity time in number of beacon intervals
+ * after which IBSS station re-inters power save
+ * by sending Null frame with PM=1
+ *
+ * Related: Aplicable if gIbssAwakeOnTxRx is enabled
+ *
+ * Supported Feature: IBSS
+ *
+ * Usage: Internal/External
+ *
+ *
+ */
+#define CFG_IBSS_INACTIVITY_TIME CFG_INI_UINT( \
+ "gIbssInactivityTime", \
+ 1, \
+ 10, \
+ 1, \
+ CFG_VALUE_OR_DEFAULT, \
+ "No of Beacons intervals of data inactivity for power save")
+
+/*
+ *
+ * gIbssTxSpEndInactivityTime - Indicates the time after
+ * which TX Service Period is terminated by
+ * sending a Qos Null frame with EOSP.
+ *
+ * @Min: 0
+ * @Max: 100
+ * @Default: 0
+ *
+ * In IBSS mode Tx Service Period Inactivity
+ * time in msecs indicates the time after
+ * which TX Service Period is terminated by
+ * sending a Qos Null frame with EOSP.
+ * If value is 0, TX SP is terminated with the
+ * last buffered packet itself instead of waiting
+ * for the inactivity.
+ *
+ * Related: None
+ *
+ * Supported Feature: IBSS
+ *
+ * Usage: Internal/External
+ *
+ *
+ */
+#define CFG_IBSS_TXSP_END_INACTIVITY CFG_INI_UINT( \
+ "gIbssTxSpEndInactivityTime", \
+ 0, \
+ 100, \
+ 0, \
+ CFG_VALUE_OR_DEFAULT, \
+ "TX service period inactivity timeout")
+
+/*
+ *
+ * gIbssPsWarmupTime - PS-supporting device
+ * does not enter protocol sleep state during first
+ * gIbssPsWarmupTime seconds.
+ *
+ * @Min: 0
+ * @Max: 65535
+ * @Default: 0
+ *
+ * When IBSS network is initialized, PS-supporting device
+ * does not enter protocol sleep state during first
+ * gIbssPsWarmupTime seconds.
+ *
+ * Related: valid if gIbssIsPowerSaveAllowed is set
+ *
+ * Supported Feature: IBSS
+ *
+ * Usage: Internal/External
+ *
+ *
+ */
+#define CFG_IBSS_PS_WARMUP_TIME CFG_INI_UINT( \
+ "gIbssPsWarmupTime", \
+ 0, \
+ 65535, \
+ 0, \
+ CFG_VALUE_OR_DEFAULT, \
+ "IBSS Power save skip time")
+
+/*
+ *
+ * gIbssPs1RxChainInAtim - IBSS Power Save Enable/Disable 1 RX
+ * chain usage during the ATIM window
+ *
+ * @Min: 0
+ * @Max: 1
+ * @Default: 0
+ *
+ * IBSS Power Save Enable/Disable 1 RX
+ * chain usage during the ATIM window
+ *
+ * Related: Depend on gIbssIsPowerSaveAllowed
+ *
+ * Supported Feature: IBSS
+ *
+ * Usage: Internal/External
+ *
+ *
+ */
+#define CFG_IBSS_PS_1RX_CHAIN_IN_ATIM_WINDOW CFG_INI_BOOL( \
+ "gIbssPs1RxChainInAtim", \
+ 0, \
+ "Control IBSS Power save in 1RX chain during ATIM")
+
+/*
+ *
+ * gIbssBssid - Default IBSS BSSID if BSSID is not provided by supplicant
+ * @Min: "000000000000"
+ * @Max: "ffffffffffff"
+ * @Default: "000AF5040506"
+ *
+ * This ini is used to set Default IBSS BSSID if BSSID
+ * is not provided by supplicant and Coalesing is disabled
+ *
+ * Related: Only applicable if gCoalesingInIBSS is 0
+ *
+ * Supported Feature: IBSS
+ *
+ * Usage: Internal/External
+ *
+ *
+ */
+#define IBSS_BSSID_DEFAULT { .bytes = { 0x00, 0x0a, 0xf5, 0x04, 0x05, 0x06 } }
+#define CFG_IBSS_BSSID CFG_INI_MAC("gIbssBssid", \
+ IBSS_BSSID_DEFAULT, \
+ "IBSS BSSID if not provided by supplicant")
+
+#define CFG_IBSS_ALL \
+ CFG(CFG_IBSS_ADHOC_CHANNEL_5GHZ) \
+ CFG(CFG_IBSS_ADHOC_CHANNEL_24GHZ) \
+ CFG(CFG_IBSS_ATIM_WIN_SIZE) \
+ CFG(CFG_IBSS_AUTO_BSSID) \
+ CFG(CFG_IBSS_AWAKE_ON_TX_RX) \
+ CFG(CFG_IBSS_BSSID) \
+ CFG(CFG_IBSS_COALESING) \
+ CFG(CFG_IBSS_INACTIVITY_TIME) \
+ CFG(CFG_IBSS_IS_POWER_COLLAPSE_ALLOWED) \
+ CFG(CFG_IBSS_IS_POWER_SAVE_ALLOWED) \
+ CFG(CFG_IBSS_PS_1RX_CHAIN_IN_ATIM_WINDOW) \
+ CFG(CFG_IBSS_PS_WARMUP_TIME) \
+ CFG(CFG_IBSS_TXSP_END_INACTIVITY)
+#endif
diff --git a/components/mlme/dispatcher/inc/wlan_mlme_api.h b/components/mlme/dispatcher/inc/wlan_mlme_api.h
index 6b76247b6f..aee276e3c7 100644
--- a/components/mlme/dispatcher/inc/wlan_mlme_api.h
+++ b/components/mlme/dispatcher/inc/wlan_mlme_api.h
@@ -1884,6 +1884,16 @@ wlan_mlme_set_11h_enabled(struct wlan_objmgr_psoc *psoc, bool value);
QDF_STATUS
wlan_mlme_is_11d_enabled(struct wlan_objmgr_psoc *psoc, bool *value);
+/**
+ * wlan_mlme_ibss_power_save_setup() - Set IBSS power save params
+ * @psoc: pointer to psoc object
+ * @vdev_id: IBSS Vdev ID
+ *
+ * Return: QDF Status
+ */
+QDF_STATUS wlan_mlme_ibss_power_save_setup(struct wlan_objmgr_psoc *psoc,
+ uint32_t vdev_id);
+
/**
* wlan_mlme_set_11d_enabled() - Set the 11h flag
* @psoc: psoc context
@@ -2071,5 +2081,4 @@ wlan_mlme_get_wps_uuid(struct wlan_mlme_wps_params *wps_params, uint8_t *data);
QDF_STATUS
wlan_mlme_get_self_gen_frm_pwr(struct wlan_objmgr_psoc *psoc,
uint32_t *value);
-
#endif /* _WLAN_MLME_API_H_ */
diff --git a/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h b/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h
index 63a9556da7..4cd7313fa1 100644
--- a/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h
+++ b/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h
@@ -1834,6 +1834,38 @@ struct wlan_mlme_reg {
uint32_t scan_11d_interval;
};
+/**
+ * struct wlan_mlme_ibss_cfg - IBSS config params
+ * @auto_bssid: Enable Auto BSSID for IBSS
+ * @atim_win_size: Set IBSS ATIM window size
+ * @adhoc_ch_5g: Default 5Ghz IBSS channel if not provided by supplicant
+ * @adhoc_ch_2g: Default 2.4Ghz IBSS channel if not provided by supplicant
+ * @coalesing_enable: IBSS coalesing control param
+ * @power_save_allow: IBSS Power Save control
+ * @power_collapse_allow: IBSS Power collapse control
+ * @awake_on_tx_rx: IBSS sta power save mode on TX/RX activity
+ * @inactivity_bcon_count: No of Beacons of data inactivity for power save
+ * @txsp_end_timeout: TX service period inactivity timeout
+ * @ps_warm_up_time: IBSS Power save skip time
+ * @ps_1rx_chain_atim_win: Control IBSS Power save in 1RX chain during ATIM
+ * @bssid: BSSID Mac address: IBSS BSSID if not provided by supplicant
+ */
+struct wlan_mlme_ibss_cfg {
+ bool auto_bssid;
+ uint32_t atim_win_size;
+ uint32_t adhoc_ch_5g;
+ uint32_t adhoc_ch_2g;
+ bool coalesing_enable;
+ bool power_save_allow;
+ bool power_collapse_allow;
+ bool awake_on_tx_rx;
+ uint32_t inactivity_bcon_count;
+ uint32_t txsp_end_timeout;
+ uint32_t ps_warm_up_time;
+ uint32_t ps_1rx_chain_atim_win;
+ struct qdf_mac_addr bssid;
+};
+
/**
* struct wlan_mlme_cfg - MLME config items
* @chainmask_cfg: VHT chainmask related cfg items
@@ -1842,6 +1874,7 @@ struct wlan_mlme_reg {
* @ht_caps: HT related CFG Items
* @he_caps: HE related cfg items
* @lfr: LFR related CFG Items
+ * @ibss: IBSS related CFG items
* @obss_ht40:obss ht40 CFG Items
* @mbo_cfg: Multiband Operation related CFG items
* @vht_caps: VHT related CFG Items
@@ -1882,6 +1915,7 @@ struct wlan_mlme_cfg {
struct wlan_mlme_he_caps he_caps;
#endif
struct wlan_mlme_lfr_cfg lfr;
+ struct wlan_mlme_ibss_cfg ibss;
struct wlan_mlme_obss_ht40 obss_ht40;
struct wlan_mlme_mbo mbo_cfg;
struct wlan_mlme_vht_caps vht_caps;
diff --git a/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h b/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h
index 5bececea74..c3a63b57c3 100644
--- a/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h
+++ b/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h
@@ -2542,6 +2542,40 @@ ucfg_mlme_stats_is_link_speed_report_max(struct wlan_objmgr_psoc *psoc);
bool
ucfg_mlme_stats_is_link_speed_report_max_scaled(struct wlan_objmgr_psoc *psoc);
+/**
+ * ucfg_mlme_get_ibss_cfg() - Get IBSS config params data structure
+ * @psoc: pointer to psoc object
+ * @auto_bssid: Pointer to return the IBSS config data structure
+ *
+ * Return: QDF Status
+ */
+QDF_STATUS ucfg_mlme_get_ibss_cfg(struct wlan_objmgr_psoc *psoc,
+ struct wlan_mlme_ibss_cfg *ibss_cfg);
+
+/**
+ * ucfg_mlme_set_ibss_auto_bssid() - Set IBSS Auto BSSID config
+ * @psoc: pointer to psoc object
+ * @auto_bssid: IBSS Auto BSSID config value
+ *
+ * Return: QDF Status
+ */
+QDF_STATUS ucfg_mlme_set_ibss_auto_bssid(struct wlan_objmgr_psoc *psoc,
+ uint32_t auto_bssid);
+
+/**
+ * ucfg_mlme_ibss_power_save_setup() - Set IBSS power save params
+ * @psoc: pointer to psoc object
+ * @vdev_id: IBSS Vdev ID
+ *
+ * Return: QDF Status
+ */
+static inline
+QDF_STATUS ucfg_mlme_ibss_power_save_setup(struct wlan_objmgr_psoc *psoc,
+ uint32_t vdev_id)
+{
+ return wlan_mlme_ibss_power_save_setup(psoc, vdev_id);
+}
+
/**
* ucfg_mlme_get_wmm_dir_ac_vi() - Get TSPEC direction
* for VI
diff --git a/components/mlme/dispatcher/src/wlan_mlme_api.c b/components/mlme/dispatcher/src/wlan_mlme_api.c
index a6c6ba5fdc..bd563c3121 100644
--- a/components/mlme/dispatcher/src/wlan_mlme_api.c
+++ b/components/mlme/dispatcher/src/wlan_mlme_api.c
@@ -3038,3 +3038,90 @@ wlan_mlme_get_self_gen_frm_pwr(struct wlan_objmgr_psoc *psoc,
return QDF_STATUS_SUCCESS;
}
+
+QDF_STATUS wlan_mlme_ibss_power_save_setup(struct wlan_objmgr_psoc *psoc,
+ uint32_t vdev_id)
+{
+ struct wlan_mlme_ibss_cfg *ibss_cfg;
+ int ret;
+ struct wlan_mlme_psoc_obj *mlme_obj = mlme_get_psoc_obj(psoc);
+
+ if (!mlme_obj)
+ return QDF_STATUS_E_FAILURE;
+
+ ibss_cfg = &mlme_obj->cfg.ibss;
+
+ ret = wma_cli_set_command(vdev_id,
+ WMA_VDEV_IBSS_SET_ATIM_WINDOW_SIZE,
+ ibss_cfg->atim_win_size,
+ VDEV_CMD);
+ if (ret) {
+ mlme_err("atim window set failed: %d", ret);
+ return QDF_STATUS_E_FAILURE;
+ }
+
+ ret = wma_cli_set_command(vdev_id,
+ WMA_VDEV_IBSS_SET_POWER_SAVE_ALLOWED,
+ ibss_cfg->power_save_allow,
+ VDEV_CMD);
+ if (ret) {
+ mlme_err("power save allow failed %d", ret);
+ return QDF_STATUS_E_FAILURE;
+ }
+
+ ret = wma_cli_set_command(vdev_id,
+ WMA_VDEV_IBSS_SET_POWER_COLLAPSE_ALLOWED,
+ ibss_cfg->power_collapse_allow,
+ VDEV_CMD);
+ if (ret) {
+ mlme_err("power collapse allow failed %d", ret);
+ return QDF_STATUS_E_FAILURE;
+ }
+
+ ret = wma_cli_set_command(vdev_id,
+ WMA_VDEV_IBSS_SET_AWAKE_ON_TX_RX,
+ ibss_cfg->awake_on_tx_rx,
+ VDEV_CMD);
+ if (ret) {
+ mlme_err("set awake on tx/rx failed %d", ret);
+ return QDF_STATUS_E_FAILURE;
+ }
+
+ ret = wma_cli_set_command(vdev_id,
+ WMA_VDEV_IBSS_SET_INACTIVITY_TIME,
+ ibss_cfg->inactivity_bcon_count,
+ VDEV_CMD);
+ if (ret) {
+ mlme_err("set inactivity time failed %d", ret);
+ return QDF_STATUS_E_FAILURE;
+ }
+
+ ret = wma_cli_set_command(vdev_id,
+ WMA_VDEV_IBSS_SET_TXSP_END_INACTIVITY_TIME,
+ ibss_cfg->txsp_end_timeout,
+ VDEV_CMD);
+ if (ret) {
+ mlme_err("set txsp end failed %d", ret);
+ return QDF_STATUS_E_FAILURE;
+ }
+
+ ret = wma_cli_set_command(vdev_id,
+ WMA_VDEV_IBSS_PS_SET_WARMUP_TIME_SECS,
+ ibss_cfg->ps_warm_up_time,
+ VDEV_CMD);
+ if (ret) {
+ mlme_err("set ps warmup failed %d", ret);
+ return QDF_STATUS_E_FAILURE;
+ }
+
+ ret = wma_cli_set_command(vdev_id,
+ WMA_VDEV_IBSS_PS_SET_1RX_CHAIN_IN_ATIM_WINDOW,
+ ibss_cfg->ps_1rx_chain_atim_win,
+ VDEV_CMD);
+ if (ret) {
+ mlme_err("set 1rx chain atim failed %d", ret);
+ return QDF_STATUS_E_FAILURE;
+ }
+
+ return QDF_STATUS_SUCCESS;
+}
diff --git a/components/mlme/dispatcher/src/wlan_mlme_ucfg_api.c b/components/mlme/dispatcher/src/wlan_mlme_ucfg_api.c
index be4090c505..99e6346a1c 100644
--- a/components/mlme/dispatcher/src/wlan_mlme_ucfg_api.c
+++ b/components/mlme/dispatcher/src/wlan_mlme_ucfg_api.c
@@ -1310,6 +1310,43 @@ ucfg_mlme_get_latency_enable(struct wlan_objmgr_psoc *psoc, bool *value)
return QDF_STATUS_SUCCESS;
}
+QDF_STATUS ucfg_mlme_get_ibss_cfg(struct wlan_objmgr_psoc *psoc,
+ struct wlan_mlme_ibss_cfg *ibss_cfg)
+{
+ struct wlan_mlme_psoc_obj *mlme_obj;
+
+ if (!ibss_cfg)
+ return QDF_STATUS_E_FAILURE;
+
+ mlme_obj = mlme_get_psoc_obj(psoc);
+ if (!mlme_obj) {
+ mlme_err("MLME Obj null on get IBSS config");
+ mlme_init_ibss_cfg(psoc, ibss_cfg);
+ return QDF_STATUS_E_INVAL;
+ }
+ *ibss_cfg = mlme_obj->cfg.ibss;
+ return QDF_STATUS_SUCCESS;
+}
+
+QDF_STATUS ucfg_mlme_set_ibss_auto_bssid(struct wlan_objmgr_psoc *psoc,
+ uint32_t auto_bssid)
+{
+ struct wlan_mlme_psoc_obj *mlme_obj;
+
+ mlme_obj = mlme_get_psoc_obj(psoc);
+ if (!mlme_obj) {
+ mlme_err("MLME Obj null on get IBSS config");
+ return QDF_STATUS_E_INVAL;
+ }
+ if (!cfg_in_range(CFG_IBSS_AUTO_BSSID, auto_bssid)) {
+ mlme_err("Invalid IBSS Auto BSSID control value: %d",
+ auto_bssid);
+ return QDF_STATUS_E_INVAL;
+ }
+ mlme_obj->cfg.ibss.auto_bssid = auto_bssid;
+ return QDF_STATUS_SUCCESS;
+}
+
#ifdef MWS_COEX
QDF_STATUS
ucfg_mlme_get_mws_coex_4g_quick_tdm(struct wlan_objmgr_psoc *psoc,
@@ -1416,6 +1453,5 @@ ucfg_mlme_get_scan_11d_interval(struct wlan_objmgr_psoc *psoc,
}
*value = mlme_obj->cfg.reg.scan_11d_interval;
-
return QDF_STATUS_SUCCESS;
}
diff --git a/core/hdd/inc/wlan_hdd_cfg.h b/core/hdd/inc/wlan_hdd_cfg.h
index 5c19100aa8..9b1dc3a7f4 100644
--- a/core/hdd/inc/wlan_hdd_cfg.h
+++ b/core/hdd/inc/wlan_hdd_cfg.h
@@ -655,312 +655,6 @@ enum hdd_dot11_mode {
#define CFG_ROAM_FORCE_RSSI_TRIGGER_MAX (1)
#define CFG_ROAM_FORCE_RSSI_TRIGGER_DEFAULT (1)
-/*
- *
- * gIbssBssid - Default IBSS BSSID if BSSID is not provided by supplicant
- * @Min: "000000000000"
- * @Max: "ffffffffffff"
- * @Default: "000AF5040506"
- *
- * This ini is used to set Default IBSS BSSID if BSSID
- * is not provided by supplicant and Coalesing is disabled
- *
- * Related: Only applicable if gCoalesingInIBSS is 0
- *
- * Supported Feature: IBSS
- *
- * Usage: Internal/External
- *
- *
- */
-#define CFG_IBSS_BSSID_NAME "gIbssBssid"
-#define CFG_IBSS_BSSID_MIN "000000000000"
-#define CFG_IBSS_BSSID_MAX "ffffffffffff"
-#define CFG_IBSS_BSSID_DEFAULT "000AF5040506"
-
-/*
- *
- * gAdHocChannel5G - Default 5Ghz IBSS channel if channel is not
- * provided by supplicant.
- * @Min: 36
- * @Max: 165
- * @Default: 44
- *
- * This ini is used to set default 5Ghz IBSS channel
- * if channel is not provided by supplicant and band is 5Ghz
- *
- * Related: None
- *
- * Supported Feature: IBSS
- *
- * Usage: Internal/External
- *
- *
- */
-#define CFG_IBSS_ADHOC_CHANNEL_5GHZ_NAME "gAdHocChannel5G"
-#define CFG_IBSS_ADHOC_CHANNEL_5GHZ_MIN (36)
-#define CFG_IBSS_ADHOC_CHANNEL_5GHZ_MAX (165)
-#define CFG_IBSS_ADHOC_CHANNEL_5GHZ_DEFAULT (44)
-
-/*
- *
- * gAdHocChannel24G - Default 2.4Ghz IBSS channel if channel is not
- * provided by supplicant.
- * @Min: 1
- * @Max: 14
- * @Default: 6
- *
- * This ini is used to set default 2.4Ghz IBSS channel
- * if channel is not provided by supplicant and band is 2.4Ghz
- *
- * Related: None
- *
- * Supported Feature: IBSS
- *
- * Usage: Internal/External
- *
- *
- */
-#define CFG_IBSS_ADHOC_CHANNEL_24GHZ_NAME "gAdHocChannel24G"
-#define CFG_IBSS_ADHOC_CHANNEL_24GHZ_MIN (1)
-#define CFG_IBSS_ADHOC_CHANNEL_24GHZ_MAX (14)
-#define CFG_IBSS_ADHOC_CHANNEL_24GHZ_DEFAULT (6)
-
-/*
- *
- * gCoalesingInIBSS - If IBSS coalesing is enabled.
- * @Min: 0
- * @Max: 1
- * @Default: 0
- *
- * This ini is used to set IBSS coalesing
- *
- * Related: None
- *
- * Supported Feature: IBSS
- *
- * Usage: Internal/External
- *
- *
- */
-#define CFG_COALESING_IN_IBSS_NAME "gCoalesingInIBSS"
-#define CFG_COALESING_IN_IBSS_MIN (0)
-#define CFG_COALESING_IN_IBSS_MAX (1)
-#define CFG_COALESING_IN_IBSS_DEFAULT (0) /* disabled */
-
-/*
- *
- * gIbssATIMWinSize - Set IBSS ATIM window size
- * @Min: 0
- * @Max: 50
- * @Default: 0
- *
- * This ini is used to set IBSS ATIM window size
- *
- * Related: None
- *
- * Supported Feature: IBSS
- *
- * Usage: Internal/External
- *
- *
- */
-#define CFG_IBSS_ATIM_WIN_SIZE_NAME "gIbssATIMWinSize"
-#define CFG_IBSS_ATIM_WIN_SIZE_MIN (0)
-#define CFG_IBSS_ATIM_WIN_SIZE_MAX (50)
-#define CFG_IBSS_ATIM_WIN_SIZE_DEFAULT (0)
-
-
-/*
- *
- * gIbssIsPowerSaveAllowed - Indicates if IBSS Power Save is
- * supported or not
- * @Min: 0
- * @Max: 1
- * @Default: 1
- *
- * This ini is used to Indicates if IBSS Power Save is
- * supported or not. When not allowed,IBSS station has
- * to stay awake all the time and should never set PM=1
- * in its transmitted frames.
- *
- * Related: valid only when gIbssATIMWinSize is non-zero
- *
- * Supported Feature: IBSS
- *
- * Usage: Internal/External
- *
- *
- */
-#define CFG_IBSS_IS_POWER_SAVE_ALLOWED_NAME "gIbssIsPowerSaveAllowed"
-#define CFG_IBSS_IS_POWER_SAVE_ALLOWED_MIN (0)
-#define CFG_IBSS_IS_POWER_SAVE_ALLOWED_MAX (1)
-#define CFG_IBSS_IS_POWER_SAVE_ALLOWED_DEFAULT (1)
-
-/*
- *
- * gIbssIsPowerCollapseAllowed - Indicates if IBSS Power Collapse
- * is allowed
- * @Min: 0
- * @Max: 1
- * @Default: 1
- *
- * This ini is used to indicates if IBSS Power Collapse
- * is allowed
- *
- * Related: None
- *
- * Supported Feature: IBSS
- *
- * Usage: Internal/External
- *
- *
- */
-#define CFG_IBSS_IS_POWER_COLLAPSE_ALLOWED_NAME "gIbssIsPowerCollapseAllowed"
-#define CFG_IBSS_IS_POWER_COLLAPSE_ALLOWED_MIN (0)
-#define CFG_IBSS_IS_POWER_COLLAPSE_ALLOWED_MAX (1)
-#define CFG_IBSS_IS_POWER_COLLAPSE_ALLOWED_DEFAULT (1)
-
-/*
- *
- * gIbssAwakeOnTxRx - Indicates whether IBSS station
- * can exit power save mode and enter power active
- * state whenever there is a TX/RX activity.
- *
- * @Min: 0
- * @Max: 1
- * @Default: 0
- *
- * This ini is used to ndicates whether IBSS station
- * can exit power save mode and enter power active
- * state whenever there is a TX/RX activity.
- *
- * Related: None
- *
- * Supported Feature: IBSS
- *
- * Usage: Internal/External
- *
- *
- */
-#define CFG_IBSS_AWAKE_ON_TX_RX_NAME "gIbssAwakeOnTxRx"
-#define CFG_IBSS_AWAKE_ON_TX_RX_MIN (0)
-#define CFG_IBSS_AWAKE_ON_TX_RX_MAX (1)
-#define CFG_IBSS_AWAKE_ON_TX_RX_DEFAULT (0)
-
-/*
- *
- * gIbssInactivityTime - Indicates the data
- * inactivity time in number of beacon intervals
- * after which IBSS station re-inters power save
- *
- * @Min: 1
- * @Max: 10
- * @Default: 1
- *
- * In IBSS mode if Awake on TX/RX activity is enabled
- * Ibss Inactivity parameter indicates the data
- * inactivity time in number of beacon intervals
- * after which IBSS station re-inters power save
- * by sending Null frame with PM=1
- *
- * Related: Aplicable if gIbssAwakeOnTxRx is enabled
- *
- * Supported Feature: IBSS
- *
- * Usage: Internal/External
- *
- *
- */
-#define CFG_IBSS_INACTIVITY_TIME_NAME "gIbssInactivityTime"
-#define CFG_IBSS_INACTIVITY_TIME_MIN (1)
-#define CFG_IBSS_INACTIVITY_TIME_MAX (10)
-#define CFG_IBSS_INACTIVITY_TIME_DEFAULT (1)
-
-/*
- *
- * gIbssTxSpEndInactivityTime - Indicates the time after
- * which TX Service Period is terminated by
- * sending a Qos Null frame with EOSP.
- *
- * @Min: 0
- * @Max: 100
- * @Default: 0
- *
- * In IBSS mode Tx Service Period Inactivity
- * time in msecs indicates the time after
- * which TX Service Period is terminated by
- * sending a Qos Null frame with EOSP.
- * If value is 0, TX SP is terminated with the
- * last buffered packet itself instead of waiting
- * for the inactivity.
- *
- * Related: None
- *
- * Supported Feature: IBSS
- *
- * Usage: Internal/External
- *
- *
- */
-#define CFG_IBSS_TXSP_END_INACTIVITY_NAME "gIbssTxSpEndInactivityTime"
-#define CFG_IBSS_TXSP_END_INACTIVITY_MIN (0)
-#define CFG_IBSS_TXSP_END_INACTIVITY_MAX (100)
-#define CFG_IBSS_TXSP_END_INACTIVITY_DEFAULT (0)
-
-/*
- *
- * gIbssPsWarmupTime - PS-supporting device
- * does not enter protocol sleep state during first
- * gIbssPsWarmupTime seconds.
- *
- * @Min: 0
- * @Max: 65535
- * @Default: 0
- *
- * When IBSS network is initialized, PS-supporting device
- * does not enter protocol sleep state during first
- * gIbssPsWarmupTime seconds.
- *
- * Related: valid if gIbssIsPowerSaveAllowed is set
- *
- * Supported Feature: IBSS
- *
- * Usage: Internal/External
- *
- *
- */
-#define CFG_IBSS_PS_WARMUP_TIME_NAME "gIbssPsWarmupTime"
-#define CFG_IBSS_PS_WARMUP_TIME_MIN (0)
-/* Allow unsigned Int Max for now */
-#define CFG_IBSS_PS_WARMUP_TIME_MAX (65535)
-#define CFG_IBSS_PS_WARMUP_TIME_DEFAULT (0)
-
-/*
- *
- * gIbssPs1RxChainInAtim - IBSS Power Save Enable/Disable 1 RX
- * chain usage during the ATIM window
- *
- * @Min: 0
- * @Max: 1
- * @Default: 0
- *
- * IBSS Power Save Enable/Disable 1 RX
- * chain usage during the ATIM window
- *
- * Related: Depend on gIbssIsPowerSaveAllowed
- *
- * Supported Feature: IBSS
- *
- * Usage: Internal/External
- *
- *
- */
-#define CFG_IBSS_PS_1RX_CHAIN_IN_ATIM_WINDOW_NAME "gIbssPs1RxChainInAtim"
-#define CFG_IBSS_PS_1RX_CHAIN_IN_ATIM_WINDOW_MIN (0)
-#define CFG_IBSS_PS_1RX_CHAIN_IN_ATIM_WINDOW_MAX (1)
-#define CFG_IBSS_PS_1RX_CHAIN_IN_ATIM_WINDOW_DEFAULT (0)
-
/*
*
* gDot11Mode - SAP phy mode
@@ -1645,10 +1339,6 @@ struct hdd_config {
enum hdd_dot11_mode dot11Mode;
uint32_t nChannelBondingMode24GHz;
uint32_t nChannelBondingMode5GHz;
- struct qdf_mac_addr IbssBssid;
- uint32_t AdHocChannel5G;
- uint32_t AdHocChannel24G;
-
bool apProtEnabled;
uint8_t nTxPowerCap; /* In dBm */
uint8_t disablePacketFilter;
@@ -1681,17 +1371,6 @@ struct hdd_config {
uint32_t configPNOScanTimerRepeatValue;
uint32_t pno_slow_scan_multiplier;
#endif
- uint8_t isCoalesingInIBSSAllowed;
-
- /* IBSS Power Save related parameters */
- uint32_t ibssATIMWinSize;
- uint8_t isIbssPowerSaveAllowed;
- uint8_t isIbssPowerCollapseAllowed;
- uint8_t isIbssAwakeOnTxRx;
- uint32_t ibssInactivityCount;
- uint32_t ibssTxSpEndInactivityTime;
- uint32_t ibssPsWarmupTime;
- uint32_t ibssPs1RxChainInAtimEnable;
bool advertiseConcurrentOperation;
#ifdef DHCP_SERVER_OFFLOAD
uint8_t dhcpServerIP[IPADDR_STRING_LENGTH];
diff --git a/core/hdd/src/wlan_hdd_cfg.c b/core/hdd/src/wlan_hdd_cfg.c
index 405bdf813c..8d92255725 100644
--- a/core/hdd/src/wlan_hdd_cfg.c
+++ b/core/hdd/src/wlan_hdd_cfg.c
@@ -77,11 +77,6 @@ struct reg_table_entry g_registry_table[] = {
CFG_CHANNEL_BONDING_MODE_MIN,
CFG_CHANNEL_BONDING_MODE_MAX),
- REG_VARIABLE_STRING(CFG_IBSS_BSSID_NAME, WLAN_PARAM_MacAddr,
- struct hdd_config, IbssBssid,
- VAR_FLAGS_OPTIONAL,
- (void *)CFG_IBSS_BSSID_DEFAULT),
-
REG_VARIABLE(CFG_AP_ENABLE_PROTECTION_MODE_NAME, WLAN_PARAM_Integer,
struct hdd_config, apProtEnabled,
VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
@@ -160,20 +155,6 @@ struct reg_table_entry g_registry_table[] = {
CFG_SCAN_AGING_PARAM_MIN,
CFG_SCAN_AGING_PARAM_MAX),
- REG_VARIABLE(CFG_IBSS_ADHOC_CHANNEL_5GHZ_NAME, WLAN_PARAM_Integer,
- struct hdd_config, AdHocChannel5G,
- VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
- CFG_IBSS_ADHOC_CHANNEL_5GHZ_DEFAULT,
- CFG_IBSS_ADHOC_CHANNEL_5GHZ_MIN,
- CFG_IBSS_ADHOC_CHANNEL_5GHZ_MAX),
-
- REG_VARIABLE(CFG_IBSS_ADHOC_CHANNEL_24GHZ_NAME, WLAN_PARAM_Integer,
- struct hdd_config, AdHocChannel24G,
- VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
- CFG_IBSS_ADHOC_CHANNEL_24GHZ_DEFAULT,
- CFG_IBSS_ADHOC_CHANNEL_24GHZ_MIN,
- CFG_IBSS_ADHOC_CHANNEL_24GHZ_MAX),
-
REG_VARIABLE(CFG_ENABLE_SNR_MONITORING_NAME, WLAN_PARAM_Integer,
struct hdd_config, fEnableSNRMonitoring,
VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK,
@@ -203,70 +184,6 @@ struct reg_table_entry g_registry_table[] = {
CFG_PNO_SLOW_SCAN_MULTIPLIER_MIN,
CFG_PNO_SLOW_SCAN_MULTIPLIER_MAX),
#endif
- REG_VARIABLE(CFG_COALESING_IN_IBSS_NAME, WLAN_PARAM_Integer,
- struct hdd_config, isCoalesingInIBSSAllowed,
- VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
- CFG_COALESING_IN_IBSS_DEFAULT,
- CFG_COALESING_IN_IBSS_MIN,
- CFG_COALESING_IN_IBSS_MAX),
-
- REG_VARIABLE(CFG_IBSS_ATIM_WIN_SIZE_NAME, WLAN_PARAM_Integer,
- struct hdd_config, ibssATIMWinSize,
- VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
- CFG_IBSS_ATIM_WIN_SIZE_DEFAULT,
- CFG_IBSS_ATIM_WIN_SIZE_MIN,
- CFG_IBSS_ATIM_WIN_SIZE_MAX),
-
- REG_VARIABLE(CFG_IBSS_IS_POWER_SAVE_ALLOWED_NAME, WLAN_PARAM_Integer,
- struct hdd_config, isIbssPowerSaveAllowed,
- VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
- CFG_IBSS_IS_POWER_SAVE_ALLOWED_DEFAULT,
- CFG_IBSS_IS_POWER_SAVE_ALLOWED_MIN,
- CFG_IBSS_IS_POWER_SAVE_ALLOWED_MAX),
-
- REG_VARIABLE(CFG_IBSS_IS_POWER_COLLAPSE_ALLOWED_NAME,
- WLAN_PARAM_Integer,
- struct hdd_config, isIbssPowerCollapseAllowed,
- VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
- CFG_IBSS_IS_POWER_COLLAPSE_ALLOWED_DEFAULT,
- CFG_IBSS_IS_POWER_COLLAPSE_ALLOWED_MIN,
- CFG_IBSS_IS_POWER_COLLAPSE_ALLOWED_MAX),
-
- REG_VARIABLE(CFG_IBSS_AWAKE_ON_TX_RX_NAME, WLAN_PARAM_Integer,
- struct hdd_config, isIbssAwakeOnTxRx,
- VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
- CFG_IBSS_AWAKE_ON_TX_RX_DEFAULT,
- CFG_IBSS_AWAKE_ON_TX_RX_MIN,
- CFG_IBSS_AWAKE_ON_TX_RX_MAX),
-
- REG_VARIABLE(CFG_IBSS_INACTIVITY_TIME_NAME, WLAN_PARAM_Integer,
- struct hdd_config, ibssInactivityCount,
- VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
- CFG_IBSS_INACTIVITY_TIME_DEFAULT,
- CFG_IBSS_INACTIVITY_TIME_MIN,
- CFG_IBSS_INACTIVITY_TIME_MAX),
-
- REG_VARIABLE(CFG_IBSS_TXSP_END_INACTIVITY_NAME, WLAN_PARAM_Integer,
- struct hdd_config, ibssTxSpEndInactivityTime,
- VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
- CFG_IBSS_TXSP_END_INACTIVITY_DEFAULT,
- CFG_IBSS_TXSP_END_INACTIVITY_MIN,
- CFG_IBSS_TXSP_END_INACTIVITY_MAX),
-
- REG_VARIABLE(CFG_IBSS_PS_WARMUP_TIME_NAME, WLAN_PARAM_Integer,
- struct hdd_config, ibssPsWarmupTime,
- VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
- CFG_IBSS_PS_WARMUP_TIME_DEFAULT,
- CFG_IBSS_PS_WARMUP_TIME_MIN,
- CFG_IBSS_PS_WARMUP_TIME_MAX),
-
- REG_VARIABLE(CFG_IBSS_PS_1RX_CHAIN_IN_ATIM_WINDOW_NAME,
- WLAN_PARAM_Integer,
- struct hdd_config, ibssPs1RxChainInAtimEnable,
- VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
- CFG_IBSS_PS_1RX_CHAIN_IN_ATIM_WINDOW_DEFAULT,
- CFG_IBSS_PS_1RX_CHAIN_IN_ATIM_WINDOW_MIN,
- CFG_IBSS_PS_1RX_CHAIN_IN_ATIM_WINDOW_MAX),
REG_VARIABLE(CFG_ADVERTISE_CONCURRENT_OPERATION_NAME,
WLAN_PARAM_Integer,
@@ -1815,13 +1732,6 @@ bool hdd_update_config_cfg(struct hdd_context *hdd_ctx)
hdd_err("Fail to pass WNI_CFG_PS_WOW_DATA_INACTIVITY_TO CFG");
}
- if (sme_cfg_set_int(mac_handle, WNI_CFG_IBSS_ATIM_WIN_SIZE,
- config->ibssATIMWinSize) ==
- QDF_STATUS_E_FAILURE) {
- status = false;
- hdd_err("Couldn't pass on WNI_CFG_IBSS_ATIM_WIN_SIZE to CFG");
- }
-
ucfg_policy_mgr_get_mcc_adaptive_sch(hdd_ctx->psoc,
&mcc_adaptive_sch);
if (sme_cfg_set_int(mac_handle, WNI_CFG_ENABLE_MCC_ADAPTIVE_SCHED,
@@ -2043,8 +1953,16 @@ QDF_STATUS hdd_set_sme_config(struct hdd_context *hdd_ctx)
#ifdef FEATURE_WLAN_ESE
bool ese_enabled;
#endif
+ struct wlan_mlme_ibss_cfg ibss_cfg = {0};
+
struct hdd_config *pConfig = hdd_ctx->config;
+ if (QDF_IS_STATUS_ERROR(ucfg_mlme_get_ibss_cfg(
+ hdd_ctx->psoc, &ibss_cfg))) {
+ hdd_err("Unable to get IBSS config params");
+ return QDF_STATUS_E_FAILURE;
+ }
+
smeConfig = qdf_mem_malloc(sizeof(*smeConfig));
if (NULL == smeConfig) {
hdd_err("unable to allocate smeConfig");
@@ -2075,8 +1993,8 @@ QDF_STATUS hdd_set_sme_config(struct hdd_context *hdd_ctx)
*/
/* This param cannot be configured from INI */
smeConfig->csrConfig.send_smps_action = true;
- smeConfig->csrConfig.AdHocChannel5G = pConfig->AdHocChannel5G;
- smeConfig->csrConfig.AdHocChannel24 = pConfig->AdHocChannel24G;
+ smeConfig->csrConfig.AdHocChannel5G = ibss_cfg.adhoc_ch_5g;
+ smeConfig->csrConfig.AdHocChannel24 = ibss_cfg.adhoc_ch_2g;
smeConfig->csrConfig.ProprietaryRatesEnabled = 0;
smeConfig->csrConfig.HeartbeatThresh50 = 40;
smeConfig->csrConfig.nTxPowerCap = pConfig->nTxPowerCap;
@@ -2104,7 +2022,7 @@ QDF_STATUS hdd_set_sme_config(struct hdd_context *hdd_ctx)
}
smeConfig->csrConfig.isCoalesingInIBSSAllowed =
- hdd_ctx->config->isCoalesingInIBSSAllowed;
+ ibss_cfg.coalesing_enable;
/* Update maximum interfaces information */
smeConfig->csrConfig.max_intf_count = hdd_ctx->max_intf_count;
diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c
index 23d7f0db7f..c922117207 100644
--- a/core/hdd/src/wlan_hdd_cfg80211.c
+++ b/core/hdd/src/wlan_hdd_cfg80211.c
@@ -18001,6 +18001,7 @@ static int __wlan_hdd_cfg80211_join_ibss(struct wiphy *wiphy,
struct qdf_mac_addr bssid;
u8 channelNum = 0;
mac_handle_t mac_handle;
+ struct wlan_mlme_ibss_cfg ibss_cfg = {0};
hdd_enter();
@@ -18023,6 +18024,11 @@ static int __wlan_hdd_cfg80211_join_ibss(struct wiphy *wiphy,
if (0 != status)
return status;
+ if (QDF_IS_STATUS_ERROR(ucfg_mlme_get_ibss_cfg(hdd_ctx->psoc,
+ &ibss_cfg))) {
+ return -EINVAL;
+ }
+
mac_handle = hdd_ctx->mac_handle;
if (NULL !=
params->chandef.chan) {
@@ -18100,28 +18106,21 @@ static int __wlan_hdd_cfg80211_join_ibss(struct wiphy *wiphy,
/* enable selected protection checks in IBSS mode */
roam_profile->cfg_protection = IBSS_CFG_PROTECTION_ENABLE_MASK;
- if (QDF_STATUS_E_FAILURE == sme_cfg_set_int(mac_handle,
- WNI_CFG_IBSS_ATIM_WIN_SIZE,
- hdd_ctx->config->
- ibssATIMWinSize)) {
- hdd_err("Could not pass on WNI_CFG_IBSS_ATIM_WIN_SIZE to CCM");
- }
-
/* BSSID is provided by upper layers hence no need to AUTO generate */
if (NULL != params->bssid) {
- if (sme_cfg_set_int(mac_handle, WNI_CFG_IBSS_AUTO_BSSID, 0)
+ if (ucfg_mlme_set_ibss_auto_bssid(hdd_ctx->psoc, 0)
== QDF_STATUS_E_FAILURE) {
- hdd_err("ccmCfgStInt failed for WNI_CFG_IBSS_AUTO_BSSID");
+ hdd_err("Unable to update MLME IBSS Auto BSSID config");
return -EIO;
}
qdf_mem_copy(bssid.bytes, params->bssid, QDF_MAC_ADDR_SIZE);
- } else if (hdd_ctx->config->isCoalesingInIBSSAllowed == 0) {
- if (sme_cfg_set_int(mac_handle, WNI_CFG_IBSS_AUTO_BSSID, 0)
+ } else if (ibss_cfg.coalesing_enable == 0) {
+ if (ucfg_mlme_set_ibss_auto_bssid(hdd_ctx->psoc, 0)
== QDF_STATUS_E_FAILURE) {
- hdd_err("ccmCfgStInt failed for WNI_CFG_IBSS_AUTO_BSSID");
+ hdd_err("Unable to update MLME IBSS Auto BSSID config");
return -EIO;
}
- qdf_copy_macaddr(&bssid, &hdd_ctx->config->IbssBssid);
+ qdf_copy_macaddr(&bssid, &ibss_cfg.bssid);
}
if (cfg_in_range(CFG_BEACON_INTERVAL, params->beacon_interval))
diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c
index 91e77ca654..7128684f48 100644
--- a/core/hdd/src/wlan_hdd_main.c
+++ b/core/hdd/src/wlan_hdd_main.c
@@ -1199,7 +1199,6 @@ bool wlan_hdd_validate_modules_state(struct hdd_context *hdd_ctx)
*/
QDF_STATUS hdd_set_ibss_power_save_params(struct hdd_adapter *adapter)
{
- int ret;
struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
if (hdd_ctx == NULL) {
@@ -1207,84 +1206,8 @@ QDF_STATUS hdd_set_ibss_power_save_params(struct hdd_adapter *adapter)
return QDF_STATUS_E_FAILURE;
}
- ret = sme_cli_set_command(adapter->session_id,
- WMA_VDEV_IBSS_SET_ATIM_WINDOW_SIZE,
- hdd_ctx->config->ibssATIMWinSize,
- VDEV_CMD);
- if (0 != ret) {
- hdd_err("atim window set failed %d", ret);
- return QDF_STATUS_E_FAILURE;
- }
-
- ret = sme_cli_set_command(adapter->session_id,
- WMA_VDEV_IBSS_SET_POWER_SAVE_ALLOWED,
- hdd_ctx->config->isIbssPowerSaveAllowed,
- VDEV_CMD);
- if (0 != ret) {
- hdd_err("power save allow failed %d",
- ret);
- return QDF_STATUS_E_FAILURE;
- }
-
- ret = sme_cli_set_command(adapter->session_id,
- WMA_VDEV_IBSS_SET_POWER_COLLAPSE_ALLOWED,
- hdd_ctx->config->
- isIbssPowerCollapseAllowed, VDEV_CMD);
- if (0 != ret) {
- hdd_err("power collapse allow failed %d",
- ret);
- return QDF_STATUS_E_FAILURE;
- }
-
- ret = sme_cli_set_command(adapter->session_id,
- WMA_VDEV_IBSS_SET_AWAKE_ON_TX_RX,
- hdd_ctx->config->isIbssAwakeOnTxRx,
- VDEV_CMD);
- if (0 != ret) {
- hdd_err("set awake on tx/rx failed %d", ret);
- return QDF_STATUS_E_FAILURE;
- }
-
- ret = sme_cli_set_command(adapter->session_id,
- WMA_VDEV_IBSS_SET_INACTIVITY_TIME,
- hdd_ctx->config->ibssInactivityCount,
- VDEV_CMD);
- if (0 != ret) {
- hdd_err("set inactivity time failed %d", ret);
- return QDF_STATUS_E_FAILURE;
- }
-
- ret = sme_cli_set_command(adapter->session_id,
- WMA_VDEV_IBSS_SET_TXSP_END_INACTIVITY_TIME,
- hdd_ctx->config->ibssTxSpEndInactivityTime,
- VDEV_CMD);
- if (0 != ret) {
- hdd_err("set txsp end failed %d",
- ret);
- return QDF_STATUS_E_FAILURE;
- }
-
- ret = sme_cli_set_command(adapter->session_id,
- WMA_VDEV_IBSS_PS_SET_WARMUP_TIME_SECS,
- hdd_ctx->config->ibssPsWarmupTime,
- VDEV_CMD);
- if (0 != ret) {
- hdd_err("set ps warmup failed %d",
- ret);
- return QDF_STATUS_E_FAILURE;
- }
-
- ret = sme_cli_set_command(adapter->session_id,
- WMA_VDEV_IBSS_PS_SET_1RX_CHAIN_IN_ATIM_WINDOW,
- hdd_ctx->config->ibssPs1RxChainInAtimEnable,
- VDEV_CMD);
- if (0 != ret) {
- hdd_err("set 1rx chain atim failed %d",
- ret);
- return QDF_STATUS_E_FAILURE;
- }
-
- return QDF_STATUS_SUCCESS;
+ return ucfg_mlme_ibss_power_save_setup(hdd_ctx->psoc,
+ adapter->session_id);
}
#ifdef FEATURE_RUNTIME_PM
diff --git a/core/mac/inc/wni_cfg.h b/core/mac/inc/wni_cfg.h
index d70fec3263..b263a896c7 100644
--- a/core/mac/inc/wni_cfg.h
+++ b/core/mac/inc/wni_cfg.h
@@ -33,9 +33,7 @@ enum {
WNI_CFG_LOCAL_POWER_CONSTRAINT,
WNI_CFG_SCAN_CONTROL_LIST,
WNI_CFG_SCAN_IN_POWERSAVE,
- WNI_CFG_IBSS_AUTO_BSSID,
WNI_CFG_ENABLE_MCC_ADAPTIVE_SCHED,
- WNI_CFG_IBSS_ATIM_WIN_SIZE,
WNI_CFG_PS_WOW_DATA_INACTIVITY_TIMEOUT,
WNI_CFG_OBSS_DETECTION_OFFLOAD,
WNI_CFG_OBSS_COLOR_COLLISION_OFFLOAD,
@@ -146,10 +144,6 @@ enum {
#define WNI_CFG_SCAN_IN_POWERSAVE_STAMAX 1
#define WNI_CFG_SCAN_IN_POWERSAVE_STADEF 1
-#define WNI_CFG_IBSS_AUTO_BSSID_STAMIN 0
-#define WNI_CFG_IBSS_AUTO_BSSID_STAMAX 1
-#define WNI_CFG_IBSS_AUTO_BSSID_STADEF 1
-
#define WNI_CFG_WPS_ENABLE_AP 1
#define WNI_CFG_ASSOC_STA_LIMIT_STAMIN 1
@@ -159,10 +153,6 @@ enum {
#define WNI_CFG_ENABLE_MCC_ADAPTIVE_SCHED_STAMAX 1
#define WNI_CFG_ENABLE_MCC_ADAPTIVE_SCHED_STADEF 0
-#define WNI_CFG_IBSS_ATIM_WIN_SIZE_STAMIN 0
-#define WNI_CFG_IBSS_ATIM_WIN_SIZE_STAMAX 100
-#define WNI_CFG_IBSS_ATIM_WIN_SIZE_STADEF 0
-
#define WNI_CFG_PS_WOW_DATA_INACTIVITY_TIMEOUT_STAMIN 1
#define WNI_CFG_PS_WOW_DATA_INACTIVITY_TIMEOUT_STAMAX 255
#define WNI_CFG_PS_WOW_DATA_INACTIVITY_TIMEOUT_STADEF 50
diff --git a/core/mac/src/cfg/cfg_param_name.c b/core/mac/src/cfg/cfg_param_name.c
index 3a88dd27c2..688754bd1a 100644
--- a/core/mac/src/cfg/cfg_param_name.c
+++ b/core/mac/src/cfg/cfg_param_name.c
@@ -47,9 +47,7 @@ const char *cfg_get_string(uint16_t cfg_id)
CASE_RETURN_STRING(WNI_CFG_COUNTRY_CODE);
CASE_RETURN_STRING(WNI_CFG_LOCAL_POWER_CONSTRAINT);
CASE_RETURN_STRING(WNI_CFG_SCAN_CONTROL_LIST);
- CASE_RETURN_STRING(WNI_CFG_IBSS_AUTO_BSSID);
CASE_RETURN_STRING(WNI_CFG_ENABLE_MCC_ADAPTIVE_SCHED);
- CASE_RETURN_STRING(WNI_CFG_IBSS_ATIM_WIN_SIZE);
CASE_RETURN_STRING(WNI_CFG_PS_WOW_DATA_INACTIVITY_TIMEOUT);
CASE_RETURN_STRING(WNI_CFG_OBSS_DETECTION_OFFLOAD);
CASE_RETURN_STRING(WNI_CFG_OBSS_COLOR_COLLISION_OFFLOAD);
diff --git a/core/mac/src/cfg/cfg_proc_msg.c b/core/mac/src/cfg/cfg_proc_msg.c
index 9f2369baeb..8cf1851941 100644
--- a/core/mac/src/cfg/cfg_proc_msg.c
+++ b/core/mac/src/cfg/cfg_proc_msg.c
@@ -68,21 +68,11 @@ cgstatic cfg_static[CFG_PARAM_MAX_NUM] = {
WNI_CFG_SCAN_IN_POWERSAVE_STAMIN,
WNI_CFG_SCAN_IN_POWERSAVE_STAMAX,
WNI_CFG_SCAN_IN_POWERSAVE_STADEF},
- {WNI_CFG_IBSS_AUTO_BSSID,
- CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT,
- WNI_CFG_IBSS_AUTO_BSSID_STAMIN,
- WNI_CFG_IBSS_AUTO_BSSID_STAMAX,
- WNI_CFG_IBSS_AUTO_BSSID_STADEF},
{WNI_CFG_ENABLE_MCC_ADAPTIVE_SCHED,
CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT,
WNI_CFG_ENABLE_MCC_ADAPTIVE_SCHED_STAMIN,
WNI_CFG_ENABLE_MCC_ADAPTIVE_SCHED_STAMAX,
WNI_CFG_ENABLE_MCC_ADAPTIVE_SCHED_STADEF},
- {WNI_CFG_IBSS_ATIM_WIN_SIZE,
- CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT,
- WNI_CFG_IBSS_ATIM_WIN_SIZE_STAMIN,
- WNI_CFG_IBSS_ATIM_WIN_SIZE_STAMAX,
- WNI_CFG_IBSS_ATIM_WIN_SIZE_STADEF},
{WNI_CFG_PS_WOW_DATA_INACTIVITY_TIMEOUT,
CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT,
WNI_CFG_PS_WOW_DATA_INACTIVITY_TIMEOUT_STAMIN,
diff --git a/core/mac/src/pe/lim/lim_process_sme_req_messages.c b/core/mac/src/pe/lim/lim_process_sme_req_messages.c
index ba7e29cfa2..62031d101f 100644
--- a/core/mac/src/pe/lim/lim_process_sme_req_messages.c
+++ b/core/mac/src/pe/lim/lim_process_sme_req_messages.c
@@ -54,7 +54,6 @@
#include "cds_regdomain.h"
#include "lim_process_fils.h"
#include "wlan_utility.h"
-
/*
* This overhead is time for sending NOA start to host in case of GO/sending
* NULL data & receiving ACK in case of P2P Client and starting actual scanning
@@ -569,7 +568,6 @@ __lim_handle_sme_start_bss_request(struct mac_context *mac_ctx, uint32_t *msg_bu
{
uint16_t size;
uint32_t val = 0;
- QDF_STATUS ret_status;
tSirMacChanNum channel_number;
tLimMlmStartReq *mlm_start_req = NULL;
tpSirSmeStartBssReq sme_start_bss_req = NULL;
@@ -915,16 +913,7 @@ __lim_handle_sme_start_bss_request(struct mac_context *mac_ctx, uint32_t *msg_bu
} else {
/* ibss mode */
mac_ctx->lim.gLimIbssCoalescingHappened = false;
-
- ret_status = wlan_cfg_get_int(mac_ctx,
- WNI_CFG_IBSS_AUTO_BSSID,
- &auto_gen_bssid);
- if (ret_status != QDF_STATUS_SUCCESS) {
- pe_err("Get Auto Gen BSSID fail,Status: %d",
- ret_status);
- ret_code = eSIR_LOGE_EXCEPTION;
- goto free;
- }
+ auto_gen_bssid = mac_ctx->mlme_cfg->ibss.auto_bssid;
if (!auto_gen_bssid) {
/*
diff --git a/core/mac/src/sys/legacy/src/utils/src/parser_api.c b/core/mac/src/sys/legacy/src/utils/src/parser_api.c
index 29efd34031..64a8b5ac52 100644
--- a/core/mac/src/sys/legacy/src/utils/src/parser_api.c
+++ b/core/mac/src/sys/legacy/src/utils/src/parser_api.c
@@ -1190,19 +1190,10 @@ populate_dot11f_ibss_params(struct mac_context *mac,
tDot11fIEIBSSParams *pDot11f,
struct pe_session *pe_session)
{
- uint32_t val = 0;
-
if (LIM_IS_IBSS_ROLE(pe_session)) {
- if (wlan_cfg_get_int(mac,
- WNI_CFG_IBSS_ATIM_WIN_SIZE,
- &val) != QDF_STATUS_SUCCESS) {
- pe_err("could not retrieve IBSS ATIM WIN size");
- }
+ pDot11f->atim = mac->mlme_cfg->ibss.atim_win_size;
pDot11f->present = 1;
- /* ATIM duration is always set to 0 */
- pDot11f->atim = val;
}
-
} /* End populate_dot11f_ibss_params. */
#ifdef ANI_SUPPORT_11H