qcacmn: Account for temporary peers created in object manager
The wlan_max_peer count in the object manager currently
includes the count of temporary peers and actual peers
created on the target, and this could be used to limit the
actual numbers of peers created.
The result is that, for a given number of
peers configured the object manager limits
counting temporary peer also and not actual peers alone.
Indicate the count of actual peers and temporary peers
separately, to appropriately limit actual peers created.
Change-Id: Ia1593d702949853ad26756f167988ec70279eb87
CRs-Fixed: 2228250
diff --git a/umac/cmn_services/obj_mgr/src/wlan_objmgr_vdev_obj.c b/umac/cmn_services/obj_mgr/src/wlan_objmgr_vdev_obj.c
index 3109e76..359ac48 100644
--- a/umac/cmn_services/obj_mgr/src/wlan_objmgr_vdev_obj.c
+++ b/umac/cmn_services/obj_mgr/src/wlan_objmgr_vdev_obj.c
@@ -215,7 +215,8 @@
/* Initialize peer list */
qdf_list_create(&vdev->vdev_objmgr.wlan_peer_list,
- vdev->vdev_objmgr.max_peer_count);
+ vdev->vdev_objmgr.max_peer_count +
+ WLAN_MAX_PDEV_TEMP_PEERS);
/* TODO init other parameters */
/* Invoke registered create handlers */
@@ -646,21 +647,35 @@
wlan_vdev_obj_lock(vdev);
pdev = wlan_vdev_get_pdev(vdev);
- /* If Max peer count exceeds, return failure */
- if (objmgr->wlan_peer_count >= objmgr->max_peer_count) {
- wlan_vdev_obj_unlock(vdev);
- return QDF_STATUS_E_FAILURE;
+ /* If Max VDEV peer count exceeds, return failure */
+ if (peer->peer_mlme.peer_type != WLAN_PEER_STA_TEMP) {
+ if (objmgr->wlan_peer_count >= objmgr->max_peer_count) {
+ wlan_vdev_obj_unlock(vdev);
+ return QDF_STATUS_E_FAILURE;
+ }
}
wlan_vdev_obj_unlock(vdev);
+ /* If Max PDEV peer count exceeds, return failure */
wlan_pdev_obj_lock(pdev);
- if (wlan_pdev_get_peer_count(pdev) >=
+ if (peer->peer_mlme.peer_type == WLAN_PEER_STA_TEMP) {
+ if (wlan_pdev_get_temp_peer_count(pdev) >=
+ WLAN_MAX_PDEV_TEMP_PEERS) {
+ wlan_pdev_obj_unlock(pdev);
+ return QDF_STATUS_E_FAILURE;
+ }
+ } else {
+ if (wlan_pdev_get_peer_count(pdev) >=
wlan_pdev_get_max_peer_count(pdev)) {
- wlan_pdev_obj_unlock(pdev);
- return QDF_STATUS_E_FAILURE;
+ wlan_pdev_obj_unlock(pdev);
+ return QDF_STATUS_E_FAILURE;
+ }
}
- wlan_pdev_incr_peer_count(wlan_vdev_get_pdev(vdev));
+ if (peer->peer_mlme.peer_type == WLAN_PEER_STA_TEMP)
+ wlan_pdev_incr_temp_peer_count(wlan_vdev_get_pdev(vdev));
+ else
+ wlan_pdev_incr_peer_count(wlan_vdev_get_pdev(vdev));
wlan_pdev_obj_unlock(pdev);
wlan_vdev_obj_lock(vdev);
@@ -744,7 +759,10 @@
wlan_vdev_obj_unlock(vdev);
wlan_pdev_obj_lock(pdev);
- wlan_pdev_decr_peer_count(pdev);
+ if (peer->peer_mlme.peer_type == WLAN_PEER_STA_TEMP)
+ wlan_pdev_decr_temp_peer_count(pdev);
+ else
+ wlan_pdev_decr_peer_count(pdev);
wlan_pdev_obj_unlock(pdev);
/* decrement vdev ref count after peer released its reference */