qcacmn: Enable target_if in object manager

1) Remove service ready members
2) Replace few macros with variables

Change-Id: I1dbfa824cbbb504ce24ef0e05869197a06760162
CRs-Fixed: 2177109
diff --git a/umac/cmn_services/inc/wlan_cmn.h b/umac/cmn_services/inc/wlan_cmn.h
index f9eda3e..d54e01e 100644
--- a/umac/cmn_services/inc/wlan_cmn.h
+++ b/umac/cmn_services/inc/wlan_cmn.h
@@ -53,7 +53,6 @@
 #define WLAN_INVALID_MGMT_DESC_COUNT 0xFFFFFFFF
 
 /* 802.11 cap info */
-/* 802.11 cap info */
 #define WLAN_CAPINFO_ESS               0x0001
 #define WLAN_CAPINFO_IBSS              0x0002
 #define WLAN_CAPINFO_CF_POLLABLE       0x0004
@@ -71,11 +70,11 @@
 
 /* Allowed time to wait for Object creation  */
 #define WLAN_VDEV_CREATE_TIMEOUT_CNT 300
- /* 25 msec */
+/* 25 msec */
 #define WLAN_VDEV_CREATE_TIMEOUT 25
 
 #define WLAN_PDEV_CREATE_TIMEOUT_CNT 300
- /* 25 msec */
+/* 25 msec */
 #define WLAN_PDEV_CREATE_TIMEOUT 25
 
 #define WLAN_PSOC_CREATE_TIMEOUT_CNT 300
@@ -97,6 +96,122 @@
 #define WLAN_MAC_EID_VENDOR     221
 #define WLAN_MAC_EID_EXT        255
 
+/* VHT capability flags */
+/* B0-B1 Maximum MPDU Length */
+/* A-MSDU Length 3839 octets */
+#define WLAN_VHTCAP_MAX_MPDU_LEN_3839     0x00000000
+ /* A-MSDU Length 7991 octets */
+#define WLAN_VHTCAP_MAX_MPDU_LEN_7935     0x00000001
+/* A-MSDU Length 11454 octets */
+#define WLAN_VHTCAP_MAX_MPDU_LEN_11454    0x00000002
+
+/* B2-B3 Supported Channel Width */
+/* Does not support 160 or 80+80 */
+#define WLAN_VHTCAP_SUP_CHAN_WIDTH_80     0x00000000
+/* Supports 160 */
+#define WLAN_VHTCAP_SUP_CHAN_WIDTH_160    0x00000004
+/* Support both 160 or 80+80 */
+#define WLAN_VHTCAP_SUP_CHAN_WIDTH_80_160 0x00000008
+/* B2-B3 */
+#define WLAN_VHTCAP_SUP_CHAN_WIDTH_S      2
+#define WLAN_VHTCAP_SUP_CHAN_WIDTH_MASK   0x0000000C
+/* B4 RX LDPC */
+#define WLAN_VHTCAP_RX_LDPC             0x00000010
+/* B5 Short GI for 80MHz */
+#define WLAN_VHTCAP_SHORTGI_80          0x00000020
+/* B6 Short GI for 160 and 80+80 MHz */
+#define WLAN_VHTCAP_SHORTGI_160         0x00000040
+/* B7 Tx STBC */
+#define WLAN_VHTCAP_TX_STBC             0x00000080
+#define WLAN_VHTCAP_TX_STBC_S           7
+/* B8-B10 Rx STBC */
+#define WLAN_VHTCAP_RX_STBC             0x00000700
+#define WLAN_VHTCAP_RX_STBC_S           8
+/* B11 SU Beam former capable */
+#define WLAN_VHTCAP_SU_BFORMER          0x00000800
+#define WLAN_VHTCAP_SU_BFORMER_S        11
+/* B12 SU Beam formee capable */
+#define WLAN_VHTCAP_SU_BFORMEE          0x00001000
+#define WLAN_VHTCAP_SU_BFORMEE_S        12
+
+/* B13-B15 Compressed steering number of beacomformer Antennas supported */
+#define WLAN_VHTCAP_BF_MAX_ANT          0x0000E000
+#define WLAN_VHTCAP_BF_MAX_ANT_S        13
+/* B13-B15 Beamformee STS Capability */
+#define WLAN_VHTCAP_STS_CAP_S           13
+#define WLAN_VHTCAP_STS_CAP_M           0x7
+
+/* B16-B18 Sounding Dimensions */
+#define WLAN_VHTCAP_SOUND_DIM           0x00070000
+#define WLAN_VHTCAP_SOUND_DIM_S         16
+/* B19 MU Beam Former */
+#define WLAN_VHTCAP_MU_BFORMER          0x00080000
+#define WLAN_VHTCAP_MU_BFORMER_S        19
+/* B20 MU Beam Formee */
+#define WLAN_VHTCAP_MU_BFORMEE          0x00100000
+#define WLAN_VHTCAP_MU_BFORMEE_S        20
+/* B21 VHT TXOP PS */
+#define WLAN_VHTCAP_TXOP_PS             0x00200000
+/* B22 +HTC-VHT capable */
+#define WLAN_VHTCAP_PLUS_HTC_VHT        0x00400000
+
+#define WLAN_VHTCAP_MAX_AMPDU_LEN_FACTOR  13
+/* B23-B25 maximum AMPDU Length Exponent */
+#define WLAN_VHTCAP_MAX_AMPDU_LEN_EXP   0x03800000
+#define WLAN_VHTCAP_MAX_AMPDU_LEN_EXP_S 23
+/* B26-B27 VHT Link Adaptation capable */
+#define WLAN_VHTCAP_LINK_ADAPT          0x0C000000
+/* Rx Antenna Pattern Consistency Supported */
+#define WLAN_VHTCAP_RX_ANTENNA_PATTERN  0x10000000
+/* Tx Antenna Pattern Consistency Supported */
+#define WLAN_VHTCAP_TX_ANTENNA_PATTERN  0x20000000
+/* B30-B31 Extended NSS Bandwidth Support */
+#define WLAN_VHTCAP_NO_EXT_NSS_BW_SUPPORT  0x00000000
+/* B30-B31 Extended NSS Bandwidth Support */
+#define WLAN_VHTCAP_EXT_NSS_BW_SUPPORT_1   0x40000000
+/* B30-B31 Extended NSS Bandwidth Support */
+#define WLAN_VHTCAP_EXT_NSS_BW_SUPPORT_2   0x80000000
+/* B30-B31 Extended NSS Bandwidth Support */
+#define WLAN_VHTCAP_EXT_NSS_BW_SUPPORT_3   0xC0000000
+#define WLAN_VHTCAP_EXT_NSS_BW_SUPPORT_S   30
+#define WLAN_VHTCAP_EXT_NSS_BW_SUPPORT_MASK   0xC0000000
+
+#define WLAN_VHTCAP_EXT_NSS_MASK   (WLAN_VHTCAP_SUP_CHAN_WIDTH_MASK |\
+					 WLAN_VHTCAP_EXT_NSS_BW_SUPPORT_MASK)
+/* VHTCAP combinations of "supported channel width" and "ext nss support"
+ * which determine the NSS value supported by STA for <=80 MHz, 160 MHz
+ * and 80+80 MHz. The macros to be read as combination of
+ * "supported channel width" and "ext nss support" followed by NSS for 80MHz,
+ * 160MHz and 80+80MHz defined as a function of Max VHT NSS supported.
+ * Ex: WLAN_EXTNSS_MAP_01_80F1_160FDOT5_80P80NONE - To be reas as
+ * supported channel width = 0
+ * ext nss support = 1
+ * NSS value for <=80MHz = max_vht_nss * 1
+ * NSS value for 160MHz = max_vht_nss * (.5)
+ * NSS value for 80+80MHz = not supported
+ */
+#define WLAN_EXTNSS_MAP_00_80F1_160NONE_80P80NONE \
+	(WLAN_VHTCAP_SUP_CHAN_WIDTH_80 | WLAN_VHTCAP_NO_EXT_NSS_BW_SUPPORT)
+#define WLAN_EXTNSS_MAP_01_80F1_160FDOT5_80P80NONE \
+	(WLAN_VHTCAP_SUP_CHAN_WIDTH_80 | WLAN_VHTCAP_EXT_NSS_BW_SUPPORT_1)
+#define WLAN_EXTNSS_MAP_02_80F1_160FDOT5_80P80FDOT5 \
+	(WLAN_VHTCAP_SUP_CHAN_WIDTH_80 | WLAN_VHTCAP_EXT_NSS_BW_SUPPORT_2)
+#define WLAN_EXTNSS_MAP_03_80F1_160FDOT75_80P80FDOT75 \
+	(WLAN_VHTCAP_SUP_CHAN_WIDTH_80 | WLAN_VHTCAP_EXT_NSS_BW_SUPPORT_3)
+#define WLAN_EXTNSS_MAP_10_80F1_160F1_80P80NONE \
+	(WLAN_VHTCAP_SUP_CHAN_WIDTH_160 | WLAN_VHTCAP_NO_EXT_NSS_BW_SUPPORT)
+#define WLAN_EXTNSS_MAP_11_80F1_160F1_80P80FDOT5 \
+	(WLAN_VHTCAP_SUP_CHAN_WIDTH_160 | WLAN_VHTCAP_EXT_NSS_BW_SUPPORT_1)
+#define WLAN_EXTNSS_MAP_12_80F1_160F1_80P80FDOT75 \
+	(WLAN_VHTCAP_SUP_CHAN_WIDTH_160 | WLAN_VHTCAP_EXT_NSS_BW_SUPPORT_2)
+#define WLAN_EXTNSS_MAP_13_80F2_160F2_80P80F1 \
+	(WLAN_VHTCAP_SUP_CHAN_WIDTH_160 | WLAN_VHTCAP_EXT_NSS_BW_SUPPORT_3)
+#define WLAN_EXTNSS_MAP_20_80F1_160F1_80P80F1 \
+	(WLAN_VHTCAP_SUP_CHAN_WIDTH_80_160 | WLAN_VHTCAP_NO_EXT_NSS_BW_SUPPORT)
+#define WLAN_EXTNSS_MAP_23_80F2_160F1_80P80F1 \
+	(WLAN_VHTCAP_SUP_CHAN_WIDTH_80_160 | WLAN_VHTCAP_EXT_NSS_BW_SUPPORT_3)
+
+
 /**
  * enum wlan_umac_comp_id - UMAC component id
  * @WLAN_UMAC_COMP_MLME:          MLME
@@ -406,4 +521,13 @@
 /* Util API to compare the MAC address */
 #define WLAN_ADDR_EQ(a1, a2)   qdf_mem_cmp(a1, a2, WLAN_MACADDR_LEN)
 
+#define PSOC_SERVICE_BM_SIZE ((128 + sizeof(uint32_t) - 1) / sizeof(uint32_t))
+#define PSOC_HOST_MAX_NUM_SS (8)
+#define PSOC_HOST_MAX_PHY_SIZE (3)
+#define PSOC_MAX_HW_MODE (2)
+#define PSOC_MAX_MAC_PHY_CAP (5)
+#define PSOC_MAX_PHY_REG_CAP (3)
+#define PSOC_MAX_CHAINMASK_TABLES (5)
+
+
 #endif /* _WLAN_OBJMGR_CMN_H_*/
diff --git a/umac/cmn_services/obj_mgr/inc/wlan_objmgr_cmn.h b/umac/cmn_services/obj_mgr/inc/wlan_objmgr_cmn.h
index 992e95a..4c87d87 100644
--- a/umac/cmn_services/obj_mgr/inc/wlan_objmgr_cmn.h
+++ b/umac/cmn_services/obj_mgr/inc/wlan_objmgr_cmn.h
@@ -212,6 +212,7 @@
  * @WLAN_FD_ID:                 FILS Discovery
  * @WLAN_OCB_NB_ID:             OCB Northbound operations
  * @WLAN_OCB_SB_ID:             OCB Southbound operations
+ * @WLAN_INIT_DEINIT_ID:        Init deinit module
  * @WLAN_REF_ID_MAX:            Max id used to generate ref count tracking array
  */
  /* New value added to the enum must also be reflected in function
@@ -254,6 +255,7 @@
 	WLAN_FD_ID            = 33,
 	WLAN_OCB_NB_ID        = 34,
 	WLAN_OCB_SB_ID        = 35,
+	WLAN_INIT_DEINIT_ID   = 36,
 	WLAN_REF_ID_MAX,
 } wlan_objmgr_ref_dbgid;
 
@@ -301,6 +303,9 @@
 					"WLAN_DISA_ID",
 					"WLAN_FTM_ID",
 					"WLAN_FD_ID",
+					"WLAN_OCB_NB_ID",
+					"WLAN_OCB_SB_ID",
+					"WLAN_INIT_DEINIT_ID",
 					"WLAN_REF_ID_MAX" };
 
 	return (char *)strings[id];
diff --git a/umac/cmn_services/obj_mgr/inc/wlan_objmgr_pdev_obj.h b/umac/cmn_services/obj_mgr/inc/wlan_objmgr_pdev_obj.h
index 94f7f1b..ab9a011 100644
--- a/umac/cmn_services/obj_mgr/inc/wlan_objmgr_pdev_obj.h
+++ b/umac/cmn_services/obj_mgr/inc/wlan_objmgr_pdev_obj.h
@@ -120,12 +120,14 @@
  * @pdev_fw_caps:       radio specific FW capabilities
  * @pdev_feature_caps:  radio specific feature capabilities
  * @pdev_ospriv:        OS specific pointer
+ * @macaddr[]:          MAC address
  * @notified_ap_vdev:   ap vdev
  */
 struct wlan_objmgr_pdev_nif {
 	uint32_t pdev_fw_caps;
 	uint32_t pdev_feature_caps;
 	struct pdev_osif_priv *pdev_ospriv;
+	uint8_t macaddr[WLAN_MACADDR_LEN];
 	uint8_t notified_ap_vdev;
 };
 
@@ -576,10 +578,11 @@
  */
 static inline uint8_t *wlan_pdev_get_hw_macaddr(struct wlan_objmgr_pdev *pdev)
 {
-	struct wlan_objmgr_psoc *psoc = wlan_pdev_get_psoc(pdev);
+	if (!pdev)
+		return NULL;
 
 	/* This API is invoked with lock acquired, do not add log prints */
-	return wlan_psoc_get_hw_macaddr(psoc);
+	return pdev->pdev_nif.macaddr;
 }
 
 /**
@@ -596,11 +599,8 @@
 static inline void wlan_pdev_set_hw_macaddr(struct wlan_objmgr_pdev *pdev,
 			uint8_t *macaddr)
 {
-	struct wlan_objmgr_psoc *psoc = wlan_pdev_get_psoc(pdev);
-
 	/* This API is invoked with lock acquired, do not add log prints */
-	if (psoc != NULL)
-		wlan_psoc_set_hw_macaddr(psoc, macaddr);
+	WLAN_ADDR_COPY(pdev->pdev_nif.macaddr, macaddr);
 }
 
 /**
diff --git a/umac/cmn_services/obj_mgr/inc/wlan_objmgr_psoc_obj.h b/umac/cmn_services/obj_mgr/inc/wlan_objmgr_psoc_obj.h
index 09695cb..dcd16bd 100644
--- a/umac/cmn_services/obj_mgr/inc/wlan_objmgr_psoc_obj.h
+++ b/umac/cmn_services/obj_mgr/inc/wlan_objmgr_psoc_obj.h
@@ -22,7 +22,6 @@
 #ifndef _WLAN_OBJMGR_PSOC_OBJ_H_
 #define _WLAN_OBJMGR_PSOC_OBJ_H_
 
-#include "wlan_objmgr_psoc_service_ready_api.h"
 #include "wlan_objmgr_cmn.h"
 #include "wlan_lmac_if_def.h"
 
@@ -109,6 +108,18 @@
 #define WLAN_SOC_CEXT_ACS_CHAN_HOP     0x00000020
 	/* CAPABILITY: the device support STA DFS */
 #define WLAN_SOC_CEXT_STADFS           0x00000040
+	/* NSS offload capability */
+#define WLAN_SOC_CEXT_NSS_OFFLOAD      0x00000080
+	/* SW cal support capability */
+#define WLAN_SOC_CEXT_SW_CAL           0x00000100
+	/* Hybrid mode */
+#define WLAN_SOC_CEXT_HYBRID_MODE      0x00000200
+	/* TT support */
+#define WLAN_SOC_CEXT_TT_SUPPORT       0x00000400
+	/* WMI MGMT REF */
+#define WLAN_SOC_CEXT_WMI_MGMT_REF     0x00000800
+	/* Wideband scan */
+#define WLAN_SOC_CEXT_WIDEBAND_SCAN    0x00001000
 
 /* feature_flags */
 	/* CONF: ATH FF enabled */
@@ -151,7 +162,21 @@
 #define WLAN_SOC_F_PWRCNSTRIE          0x00010000
 	/* STATUS: 11D in used */
 #define WLAN_SOC_F_DOT11D              0x00020000
+	/* Beacon offload */
+#define WLAN_SOC_F_BCN_OFFLOAD         0x00040000
+	/* QWRAP enable */
+#define WLAN_SOC_F_QWRAP_ENABLE        0x00080000
+	/* LTEU support */
+#define WLAN_SOC_F_LTEU_SUPPORT        0x00100000
+	/* BT coext support */
+#define WLAN_SOC_F_BTCOEX_SUPPORT      0x00200000
+	/* HOST 80211 enable*/
+#define WLAN_SOC_F_HOST_80211_ENABLE   0x00400000
 
+/* PSOC op flags */
+
+	/* Invalid VHT cap */
+#define WLAN_SOC_OP_VHT_INVALID_CAP    0x00000001
 /**
  * struct wlan_objmgr_psoc_regulatory -  Regulatory sub structure of PSOC
  * @country_code:  Country code
@@ -196,6 +221,7 @@
  * @soc_fw_caps:     FW capabilities
  * @soc_fw_ext_caps: FW ext capabilities
  * @soc_feature_caps:Feature capabilities
+ * @soc_op_flags:    Flags to set/reset during operation
  * @soc_hw_macaddr[]:HW MAC address
  * @user_config:     user config from OS layer
  */
@@ -205,6 +231,7 @@
 	uint32_t soc_fw_caps;
 	uint32_t soc_fw_ext_caps;
 	uint32_t soc_feature_caps;
+	uint32_t soc_op_flags;
 	uint8_t soc_hw_macaddr[WLAN_MACADDR_LEN];
 	struct wlan_objmgr_psoc_user_config user_config;
 };
@@ -220,6 +247,7 @@
  * @wlan_vdev_list[]:     VDEV list
  * @wlan_vdev_id_map[]:   VDEV id map, to allocate free ids
  * @wlan_peer_count:      PEER count
+ * @max_peer_count:       Max no. of peers supported by this PSOC
  * @peer_list:            Peer list
  * @ref_cnt:              Ref count
  * @ref_id_dbg:           Array to track Ref count
@@ -236,6 +264,7 @@
 	struct wlan_objmgr_vdev *wlan_vdev_list[WLAN_UMAC_PSOC_MAX_VDEVS];
 	uint32_t wlan_vdev_id_map[2];
 	uint16_t wlan_peer_count;
+	uint16_t max_peer_count;
 	struct wlan_peer_list peer_list;
 	qdf_atomic_t ref_cnt;
 	qdf_atomic_t ref_id_dbg[WLAN_REF_ID_MAX];
@@ -280,10 +309,6 @@
  * @obj_status[]:          component object status
  * @obj_state:             object state
  * @tgt_if_handle:         target interface handle
- *    For OL based target it points to wmi handle
- * @total_mac_phy:         number of mac/phy supported by HW
- * @service_param:         FW service capability info
- * @ext_service_param:     extended FW service capability info
  * @dp_handle:             DP module handle
  * @psoc_lock:             psoc lock
  */
@@ -299,14 +324,38 @@
 	QDF_STATUS obj_status[WLAN_UMAC_MAX_COMPONENTS];
 	WLAN_OBJ_STATE obj_state;
 	void *tgt_if_handle;
-	uint8_t total_mac_phy;
-	struct wlan_objmgr_psoc_service_ready_param service_param;
-	struct wlan_objmgr_psoc_ext_service_ready_param ext_service_param;
 	void *dp_handle;
 	qdf_spinlock_t psoc_lock;
 };
 
 /**
+ * struct wlan_psoc_host_hal_reg_capabilities_ext: Below are Reg caps per PHY.
+ *                       Please note PHY ID starts with 0.
+ * @phy_id: phy id starts with 0.
+ * @eeprom_reg_domain: regdomain value specified in EEPROM
+ * @eeprom_reg_domain_ext: regdomain
+ * @regcap1: CAP1 capabilities bit map, see REGDMN_CAP1_ defines
+ * @regcap2: REGDMN EEPROM CAP, see REGDMN_EEPROM_EEREGCAP_ defines
+ * @wireless_modes: REGDMN MODE, see REGDMN_MODE_ enum
+ * @low_2ghz_chan: 2G channel low
+ * @high_2ghz_chan: 2G channel High
+ * @low_5ghz_chan: 5G channel low
+ * @high_5ghz_chan: 5G channel High
+ */
+struct wlan_psoc_host_hal_reg_capabilities_ext {
+	uint32_t phy_id;
+	uint32_t eeprom_reg_domain;
+	uint32_t eeprom_reg_domain_ext;
+	uint32_t regcap1;
+	uint32_t regcap2;
+	uint32_t wireless_modes;
+	uint32_t low_2ghz_chan;
+	uint32_t high_2ghz_chan;
+	uint32_t low_5ghz_chan;
+	uint32_t high_5ghz_chan;
+};
+
+/**
  ** APIs to Create/Delete Global object APIs
  */
 /**
@@ -1016,12 +1065,57 @@
  * Return: 1 (for set) or 0 (for not set)
  */
 static inline uint8_t wlan_psoc_nif_feat_cap_get(struct wlan_objmgr_psoc *psoc,
-				uint32_t feat_cap)
+							uint32_t feat_cap)
 {
 	return (psoc->soc_nif.soc_feature_caps & feat_cap) ? 1 : 0;
 }
 
 /**
+ * wlan_psoc_nif_op_flag_get() - get op flags
+ * @psoc: PSOC object
+ * @flag: op flag to be checked
+ *
+ * API to know, whether particular op flag is set in psoc
+ *
+ * Return: 1 (for set) or 0 (for not set)
+ */
+static inline uint8_t wlan_psoc_nif_op_flag_get(struct wlan_objmgr_psoc *psoc,
+						uint32_t flag)
+{
+	return (psoc->soc_nif.soc_op_flags & flag) ? 1 : 0;
+}
+
+/**
+ * wlan_psoc_nif_op_flag_set() - set op flag
+ * @psoc: PSOC object
+ * @flag: op flag to be set
+ *
+ * API to set op flag in psoc
+ *
+ * Return: void
+ */
+static inline void wlan_psoc_nif_op_flag_set(struct wlan_objmgr_psoc *psoc,
+						uint32_t flag)
+{
+	psoc->soc_nif.soc_op_flags |= flag;
+}
+
+/**
+ * wlan_psoc_nif_op_flag_clear() - clear op flag
+ * @psoc: PSOC object
+ * @flag: op flag to be cleared
+ *
+ * API to clear op flag in psoc
+ *
+ * Return: void
+ */
+static inline void wlan_psoc_nif_op_flag_clear(struct wlan_objmgr_psoc *psoc,
+						uint32_t flag)
+{
+	psoc->soc_nif.soc_op_flags &= ~flag;
+}
+
+/**
  * wlan_psoc_set_hw_macaddr() - set hw mac addr
  * @psoc: PSOC object
  * @macaddr: hw macaddr
@@ -1155,6 +1249,64 @@
 }
 
 /**
+ * wlan_psoc_set_max_vdev_count() - set psoc max vdev count
+ * @psoc: PSOC object
+ * @vdev count: Max vdev count
+ *
+ * API to set Max vdev count
+ *
+ * Return: void
+ */
+static inline void wlan_psoc_set_max_vdev_count(struct wlan_objmgr_psoc *psoc,
+						uint8_t max_vdev_count)
+{
+	psoc->soc_objmgr.max_vdev_count = max_vdev_count;
+}
+
+/**
+ * wlan_psoc_get_max_vdev_count() - get psoc max vdev count
+ * @psoc: PSOC object
+ *
+ * API to set Max vdev count
+ *
+ * Return: @vdev count: Max vdev count
+ */
+static inline uint8_t wlan_psoc_get_max_vdev_count(
+					struct wlan_objmgr_psoc *psoc)
+{
+	return psoc->soc_objmgr.max_vdev_count;
+}
+
+/**
+ * wlan_psoc_set_max_peer_count() - set psoc max peer count
+ * @psoc: PSOC object
+ * @peer count: Max peer count
+ *
+ * API to set Max peer count
+ *
+ * Return: void
+ */
+static inline void wlan_psoc_set_max_peer_count(struct wlan_objmgr_psoc *psoc,
+						uint16_t max_peer_count)
+{
+	psoc->soc_objmgr.max_peer_count = max_peer_count;
+}
+
+/**
+ * wlan_psoc_get_max_peer_count() - get psoc max peer count
+ * @psoc: PSOC object
+ *
+ * API to set Max peer count
+ *
+ * Return: @peer count: Max peer count
+ */
+static inline uint16_t wlan_psoc_get_max_peer_count(
+					struct wlan_objmgr_psoc *psoc)
+{
+	return psoc->soc_objmgr.max_peer_count;
+}
+
+/**
  * DOC: Examples to use PSOC ref count APIs
  *
  * In all the scenarios, the pair of API should be followed
diff --git a/umac/cmn_services/obj_mgr/src/wlan_objmgr_pdev_obj.c b/umac/cmn_services/obj_mgr/src/wlan_objmgr_pdev_obj.c
index 7fb6d64..3df88ca 100644
--- a/umac/cmn_services/obj_mgr/src/wlan_objmgr_pdev_obj.c
+++ b/umac/cmn_services/obj_mgr/src/wlan_objmgr_pdev_obj.c
@@ -128,7 +128,7 @@
 	pdev->pdev_objmgr.wlan_vdev_count = 0;
 	pdev->pdev_objmgr.max_vdev_count = WLAN_UMAC_PDEV_MAX_VDEVS;
 	pdev->pdev_objmgr.wlan_peer_count = 0;
-	pdev->pdev_objmgr.max_peer_count = WLAN_UMAC_PSOC_MAX_PEERS;
+	pdev->pdev_objmgr.max_peer_count = wlan_psoc_get_max_peer_count(psoc);
 	/* Save HDD/OSIF pointer */
 	pdev->pdev_nif.pdev_ospriv = osdev_priv;
 	qdf_atomic_init(&pdev->pdev_objmgr.ref_cnt);
diff --git a/umac/cmn_services/obj_mgr/src/wlan_objmgr_peer_obj.c b/umac/cmn_services/obj_mgr/src/wlan_objmgr_peer_obj.c
index d52d74c..11dc11a 100644
--- a/umac/cmn_services/obj_mgr/src/wlan_objmgr_peer_obj.c
+++ b/umac/cmn_services/obj_mgr/src/wlan_objmgr_peer_obj.c
@@ -57,6 +57,7 @@
 			failure, complete object need to be cleaned up */
 		} else if ((peer->obj_status[id] == QDF_STATUS_E_NOMEM) ||
 			(peer->obj_status[id] == QDF_STATUS_E_FAILURE)) {
+			obj_mgr_err("Peer comp object(id:%d) alloc fail", id);
 			status = QDF_STATUS_E_FAILURE;
 			break;
 		}
diff --git a/umac/cmn_services/obj_mgr/src/wlan_objmgr_psoc_obj.c b/umac/cmn_services/obj_mgr/src/wlan_objmgr_psoc_obj.c
index 363407f..fa654ba 100644
--- a/umac/cmn_services/obj_mgr/src/wlan_objmgr_psoc_obj.c
+++ b/umac/cmn_services/obj_mgr/src/wlan_objmgr_psoc_obj.c
@@ -90,16 +90,12 @@
 
 static QDF_STATUS wlan_objmgr_psoc_obj_free(struct wlan_objmgr_psoc *psoc)
 {
-	struct wlan_psoc_host_service_ext_param *ext_param =
-		&(psoc->ext_service_param.service_ext_param);
-
 	/* Detach PSOC from global object's psoc list  */
 	if (wlan_objmgr_psoc_object_detach(psoc) == QDF_STATUS_E_FAILURE) {
 		obj_mgr_err("PSOC object detach failed");
 		return QDF_STATUS_E_FAILURE;
 	}
 	wlan_objmgr_psoc_peer_list_deinit(&psoc->soc_objmgr.peer_list);
-	wlan_objmgr_ext_service_ready_chainmask_table_free(ext_param);
 
 	qdf_spinlock_destroy(&psoc->psoc_lock);
 	qdf_mem_free(psoc);
@@ -131,6 +127,7 @@
 	objmgr->wlan_vdev_count = 0;
 	objmgr->max_vdev_count = WLAN_UMAC_PSOC_MAX_VDEVS;
 	objmgr->wlan_peer_count = 0;
+	objmgr->max_peer_count = WLAN_UMAC_PSOC_MAX_PEERS;
 	qdf_atomic_init(&objmgr->ref_cnt);
 	objmgr->print_cnt = 0;
 	/* set phy version, dev_type in psoc */
@@ -417,6 +414,7 @@
 	struct wlan_objmgr_vdev *vdev;
 	struct wlan_objmgr_peer *peer;
 	struct wlan_objmgr_peer *peer_next;
+	uint16_t max_vdev_cnt;
 
 	/* If caller requests for lock free opeation, do not acquire,
 	 * handler will handle the synchronization
@@ -439,7 +437,8 @@
 		break;
 	case WLAN_VDEV_OP:
 		/* Iterate through VDEV list, invoke handler for each vdev */
-		for (obj_id = 0; obj_id < WLAN_UMAC_PSOC_MAX_VDEVS; obj_id++) {
+		max_vdev_cnt = wlan_psoc_get_max_vdev_count(psoc);
+		for (obj_id = 0; obj_id < max_vdev_cnt; obj_id++) {
 			vdev = objmgr->wlan_vdev_list[obj_id];
 			if ((vdev != NULL) &&
 			    (wlan_objmgr_vdev_try_get_ref(vdev, dbg_id) ==
@@ -501,6 +500,7 @@
 	struct wlan_objmgr_vdev *vdev;
 	struct wlan_objmgr_peer *peer;
 	struct wlan_objmgr_peer *peer_next;
+	uint16_t max_vdev_cnt;
 
 	/* If caller requests for lock free opeation, do not acquire,
 	 * handler will handle the synchronization
@@ -522,7 +522,8 @@
 		break;
 	case WLAN_VDEV_OP:
 		/* Iterate through VDEV list, invoke handler for each vdev */
-		for (obj_id = 0; obj_id < WLAN_UMAC_PSOC_MAX_VDEVS; obj_id++) {
+		max_vdev_cnt = wlan_psoc_get_max_vdev_count(psoc);
+		for (obj_id = 0; obj_id < max_vdev_cnt; obj_id++) {
 			vdev = objmgr->wlan_vdev_list[obj_id];
 			if (vdev != NULL) {
 				wlan_objmgr_vdev_get_ref(vdev, dbg_id);
@@ -850,7 +851,7 @@
 
 	id = vdev->vdev_objmgr.vdev_id;
 	/* Invalid vdev id */
-	if (id >= WLAN_UMAC_PSOC_MAX_VDEVS)
+	if (id >= wlan_psoc_get_max_vdev_count(psoc))
 		return QDF_STATUS_E_FAILURE;
 	/*
 	 * Derive map_index and adjust_ix to find actual DWORD
@@ -881,6 +882,7 @@
 {
 	struct wlan_objmgr_vdev *vdev = NULL;
 	int vdev_cnt = 0;
+	uint16_t max_vdev_cnt;
 
 	/* if PSOC is NULL, return */
 	if (psoc == NULL)
@@ -888,8 +890,9 @@
 
 	wlan_psoc_obj_lock(psoc);
 
+	max_vdev_cnt = wlan_psoc_get_max_vdev_count(psoc);
 	/* retrieve vdev pointer from vdev list */
-	while (vdev_cnt < WLAN_UMAC_PSOC_MAX_VDEVS) {
+	while (vdev_cnt < max_vdev_cnt) {
 		vdev = psoc->soc_objmgr.wlan_vdev_list[vdev_cnt];
 		vdev_cnt++;
 		if (vdev == NULL)
@@ -921,7 +924,7 @@
 	if (psoc == NULL)
 		return NULL;
 	/* vdev id is invalid */
-	if (vdev_id >= WLAN_UMAC_PSOC_MAX_VDEVS)
+	if (vdev_id >= wlan_psoc_get_max_vdev_count(psoc))
 		return NULL;
 
 	wlan_psoc_obj_lock(psoc);
@@ -948,7 +951,7 @@
 	if (psoc == NULL)
 		return NULL;
 	/* vdev id is invalid */
-	if (vdev_id >= WLAN_UMAC_PSOC_MAX_VDEVS)
+	if (vdev_id >= wlan_psoc_get_max_vdev_count(psoc))
 		return NULL;
 
 	wlan_psoc_obj_lock(psoc);
@@ -969,14 +972,16 @@
 {
 	struct wlan_objmgr_vdev *vdev;
 	uint8_t id;
+	uint16_t max_vdev_cnt;
 
 	/* if PSOC is NULL, return */
 	if (psoc == NULL)
 		return NULL;
 
 	wlan_psoc_obj_lock(psoc);
+	max_vdev_cnt = wlan_psoc_get_max_vdev_count(psoc);
 	/* Iterate through PSOC's vdev list */
-	for (id = 0; id < WLAN_UMAC_PSOC_MAX_VDEVS; id++) {
+	for (id = 0; id < max_vdev_cnt; id++) {
 		vdev = psoc->soc_objmgr.wlan_vdev_list[id];
 		if (vdev == NULL)
 			continue;
@@ -1004,14 +1009,16 @@
 {
 	struct wlan_objmgr_vdev *vdev;
 	uint8_t id;
+	uint16_t max_vdev_cnt;
 
 	/* if PSOC is NULL, return */
 	if (psoc == NULL)
 		return NULL;
 
 	wlan_psoc_obj_lock(psoc);
+	max_vdev_cnt = wlan_psoc_get_max_vdev_count(psoc);
 	/* Iterate through PSOC's vdev list */
-	for (id = 0; id < WLAN_UMAC_PSOC_MAX_VDEVS; id++) {
+	for (id = 0; id < max_vdev_cnt; id++) {
 		vdev = psoc->soc_objmgr.wlan_vdev_list[id];
 		if (vdev == NULL)
 			continue;
@@ -1367,7 +1374,7 @@
 	wlan_psoc_obj_lock(psoc);
 	objmgr = &psoc->soc_objmgr;
 	/* Max peer limit is reached, return failure */
-	if (objmgr->wlan_peer_count >= WLAN_UMAC_PSOC_MAX_PEERS) {
+	if (objmgr->wlan_peer_count >= wlan_psoc_get_max_peer_count(psoc)) {
 		wlan_psoc_obj_unlock(psoc);
 		return QDF_STATUS_E_FAILURE;
 	}