diff --git a/dp/inc/cdp_txrx_stats_struct.h b/dp/inc/cdp_txrx_stats_struct.h index 35e2deab8f17..83132d61651b 100644 --- a/dp/inc/cdp_txrx_stats_struct.h +++ b/dp/inc/cdp_txrx_stats_struct.h @@ -1986,6 +1986,16 @@ enum _ol_ath_param_t { OL_ATH_PARAM_HW_MODE_SWITCH_OMN_ENABLE = 430, /* set primary interface for hw-mode switch */ OL_ATH_PARAM_HW_MODE_SWITCH_PRIMARY_IF = 431, + /* Number of vdevs configured per PSOC */ + OL_ATH_PARAM_GET_PSOC_NUM_VDEVS = 432, + /* Number of peers configured per PSOC */ + OL_ATH_PARAM_GET_PSOC_NUM_PEERS = 433, + /* Number of vdevs configured per PDEV */ + OL_ATH_PARAM_GET_PDEV_NUM_VDEVS = 434, + /* Number of peers configured per PDEV */ + OL_ATH_PARAM_GET_PDEV_NUM_PEERS = 435, + /* Number of monitor vdevs configured per PDEV */ + OL_ATH_PARAM_GET_PDEV_NUM_MONITOR_VDEVS = 436, }; #endif /* Bitmasks for stats that can block */ diff --git a/target_if/init_deinit/src/init_event_handler.c b/target_if/init_deinit/src/init_event_handler.c index 76c30a44f1a5..4bd8444ba8c7 100644 --- a/target_if/init_deinit/src/init_event_handler.c +++ b/target_if/init_deinit/src/init_event_handler.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 The Linux Foundation. All rights reserved. + * Copyright (c) 2018-2020 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 @@ -353,11 +353,6 @@ static int init_deinit_service_ext_ready_event_handler(ol_scn_t scn_handle, target_if_set_twt_ap_pdev_count(info, tgt_hdl); - info->wlan_res_cfg.num_vdevs = (target_psoc_get_num_radios(tgt_hdl) * - info->wlan_res_cfg.num_vdevs); - info->wlan_res_cfg.beacon_tx_offload_max_vdev = - (target_psoc_get_num_radios(tgt_hdl) * - info->wlan_res_cfg.beacon_tx_offload_max_vdev); info->wlan_res_cfg.max_bssid_indicator = info->service_ext_param.max_bssid_indicator; @@ -471,8 +466,11 @@ static int init_deinit_ready_event_handler(ol_scn_t scn_handle, else info->wlan_res_cfg.agile_capability = ready_ev.agile_capability; + num_radios = target_psoc_get_num_radios(tgt_hdl); + if ((ready_ev.num_total_peer != 0) && (info->wlan_res_cfg.num_peers != ready_ev.num_total_peer)) { + uint16_t num_peers = 0; /* FW allocated number of peers is different than host * requested. Update host max with FW reported value. */ @@ -480,6 +478,22 @@ static int init_deinit_ready_event_handler(ol_scn_t scn_handle, info->wlan_res_cfg.num_peers, ready_ev.num_total_peer); info->wlan_res_cfg.num_peers = ready_ev.num_total_peer; + num_peers = info->wlan_res_cfg.num_peers / num_radios; + + for (i = 0; i < num_radios; i++) { + pdev = wlan_objmgr_get_pdev_by_id(psoc, i, + WLAN_INIT_DEINIT_ID); + if (!pdev) { + target_if_err(" PDEV %d is NULL", i); + return -EINVAL; + } + + wlan_pdev_set_max_peer_count(pdev, num_peers); + wlan_objmgr_pdev_release_ref(pdev, WLAN_INIT_DEINIT_ID); + } + + wlan_psoc_set_max_peer_count(psoc, + info->wlan_res_cfg.num_peers); } /* for non legacy num_total_peer will be non zero @@ -514,8 +528,6 @@ static int init_deinit_ready_event_handler(ol_scn_t scn_handle, goto exit; } - num_radios = target_psoc_get_num_radios(tgt_hdl); - if (ready_ev.pktlog_defs_checksum) { for (i = 0; i < num_radios; i++) { pdev = wlan_objmgr_get_pdev_by_id(psoc, i, 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 1d7902b9bdfe..a8c532a963f7 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 @@ -165,6 +165,7 @@ struct wlan_objmgr_pdev_mlme { * @wlan_peer_count: Peer count * @max_peer_count: Max Peer count * @temp_peer_count: Temporary peer count + * @max_monitor_vdev_count: Max monitor vdev count * @wlan_psoc: back pointer to PSOC, its attached to * @ref_cnt: Ref count * @ref_id_dbg: Array to track Ref count @@ -178,6 +179,7 @@ struct wlan_objmgr_pdev_objmgr { uint16_t wlan_peer_count; uint16_t max_peer_count; uint16_t temp_peer_count; + uint8_t max_monitor_vdev_count; struct wlan_objmgr_psoc *wlan_psoc; qdf_atomic_t ref_cnt; qdf_atomic_t ref_id_dbg[WLAN_REF_ID_MAX]; @@ -946,6 +948,36 @@ static inline uint16_t wlan_pdev_get_max_peer_count( return pdev->pdev_objmgr.max_peer_count; } +/** + * wlan_pdev_set_max_monitor_vdev_count() - set max monitor vdev count + * @pdev: PDEV object + * @count: Max monitor vdev count + * + * API to set max monitor vdev count of PDEV + * + * Return: void + */ +static inline void wlan_pdev_set_max_monitor_vdev_count( + struct wlan_objmgr_pdev *pdev, + uint16_t count) +{ + pdev->pdev_objmgr.max_monitor_vdev_count = count; +} + +/** + * wlan_pdev_get_max_monitor_vdev_count() - get max monitor vdev count + * @pdev: PDEV object + * + * API to get max monitor vdev count of PDEV + * + * Return: max monitor vdev count + */ +static inline uint16_t wlan_pdev_get_max_monitor_vdev_count( + struct wlan_objmgr_pdev *pdev) +{ + return pdev->pdev_objmgr.max_monitor_vdev_count; +} + /** * wlan_pdev_get_peer_count() - get pdev peer count * @pdev: PDEV object