|
@@ -504,8 +504,8 @@ QDF_STATUS wlan_objmgr_iterate_peerobj_list(
|
|
|
|
|
|
if (vdev->obj_state != WLAN_OBJ_STATE_CREATED) {
|
|
|
wlan_vdev_obj_unlock(vdev);
|
|
|
- obj_mgr_err("VDEV is not in create state(:%d): vdev-id:%d",
|
|
|
- vdev_id, vdev->obj_state);
|
|
|
+ obj_mgr_err("VDEV is not in create state:%d: vdev-id:%d",
|
|
|
+ vdev->obj_state, vdev_id);
|
|
|
return QDF_STATUS_E_FAILURE;
|
|
|
}
|
|
|
wlan_objmgr_vdev_get_ref(vdev, dbg_id);
|
|
@@ -530,6 +530,59 @@ QDF_STATUS wlan_objmgr_iterate_peerobj_list(
|
|
|
return QDF_STATUS_SUCCESS;
|
|
|
}
|
|
|
|
|
|
+/**
|
|
|
+ ** APIs to get a peer with given mac in a vdev
|
|
|
+ */
|
|
|
+struct wlan_objmgr_peer *
|
|
|
+wlan_objmgr_vdev_find_peer_by_mac(struct wlan_objmgr_vdev *vdev,
|
|
|
+ uint8_t *peer_mac,
|
|
|
+ wlan_objmgr_ref_dbgid dbg_id)
|
|
|
+{
|
|
|
+ qdf_list_t *peer_list;
|
|
|
+ struct wlan_objmgr_peer *peer = NULL;
|
|
|
+ struct wlan_objmgr_peer *peer_next = NULL;
|
|
|
+ uint8_t vdev_id;
|
|
|
+
|
|
|
+ if (!vdev) {
|
|
|
+ obj_mgr_err("VDEV is NULL");
|
|
|
+ return NULL;
|
|
|
+ }
|
|
|
+ wlan_vdev_obj_lock(vdev);
|
|
|
+ vdev_id = wlan_vdev_get_id(vdev);
|
|
|
+
|
|
|
+ if (vdev->obj_state != WLAN_OBJ_STATE_CREATED) {
|
|
|
+ wlan_vdev_obj_unlock(vdev);
|
|
|
+ obj_mgr_err("VDEV is not in create state:%d: vdev-id:%d",
|
|
|
+ vdev->obj_state, vdev_id);
|
|
|
+ return NULL;
|
|
|
+ }
|
|
|
+ wlan_objmgr_vdev_get_ref(vdev, dbg_id);
|
|
|
+ peer_list = &vdev->vdev_objmgr.wlan_peer_list;
|
|
|
+ /* Iterate through VDEV's peer list */
|
|
|
+ peer = wlan_vdev_peer_list_peek_head(peer_list);
|
|
|
+ while (peer) {
|
|
|
+ peer_next = wlan_peer_get_next_peer_of_vdev(peer_list,
|
|
|
+ peer);
|
|
|
+ if (wlan_objmgr_peer_try_get_ref(peer, dbg_id) ==
|
|
|
+ QDF_STATUS_SUCCESS) {
|
|
|
+ if (!WLAN_ADDR_EQ(peer_mac,
|
|
|
+ wlan_peer_get_macaddr(peer))) {
|
|
|
+ wlan_objmgr_vdev_release_ref(vdev,
|
|
|
+ dbg_id);
|
|
|
+ wlan_vdev_obj_unlock(vdev);
|
|
|
+ return peer;
|
|
|
+ }
|
|
|
+ wlan_objmgr_peer_release_ref(peer, dbg_id);
|
|
|
+ }
|
|
|
+ peer = peer_next;
|
|
|
+ }
|
|
|
+ wlan_objmgr_vdev_release_ref(vdev, dbg_id);
|
|
|
+ wlan_vdev_obj_unlock(vdev);
|
|
|
+ return NULL;
|
|
|
+}
|
|
|
+
|
|
|
+qdf_export_symbol(wlan_objmgr_vdev_find_peer_by_mac);
|
|
|
+
|
|
|
/**
|
|
|
* wlan_obj_vdev_populate_logically_del_peerlist() - get peer
|
|
|
* from vdev peer list
|