Lines Matching full:ab

27 struct ath12k_peer *ath12k_peer_find(struct ath12k_base *ab, int vdev_id,  in ath12k_peer_find()  argument
32 lockdep_assert_held(&ab->base_lock); in ath12k_peer_find()
34 list_for_each_entry(peer, &ab->peers, list) { in ath12k_peer_find()
46 static struct ath12k_peer *ath12k_peer_find_by_pdev_idx(struct ath12k_base *ab, in ath12k_peer_find_by_pdev_idx() argument
51 lockdep_assert_held(&ab->base_lock); in ath12k_peer_find_by_pdev_idx()
53 list_for_each_entry(peer, &ab->peers, list) { in ath12k_peer_find_by_pdev_idx()
65 struct ath12k_peer *ath12k_peer_find_by_addr(struct ath12k_base *ab, in ath12k_peer_find_by_addr() argument
70 lockdep_assert_held(&ab->base_lock); in ath12k_peer_find_by_addr()
72 list_for_each_entry(peer, &ab->peers, list) { in ath12k_peer_find_by_addr()
82 static struct ath12k_peer *ath12k_peer_find_by_ml_id(struct ath12k_base *ab, in ath12k_peer_find_by_ml_id() argument
87 lockdep_assert_held(&ab->base_lock); in ath12k_peer_find_by_ml_id()
89 list_for_each_entry(peer, &ab->peers, list) in ath12k_peer_find_by_ml_id()
96 struct ath12k_peer *ath12k_peer_find_by_id(struct ath12k_base *ab, in ath12k_peer_find_by_id() argument
101 lockdep_assert_held(&ab->base_lock); in ath12k_peer_find_by_id()
107 return ath12k_peer_find_by_ml_id(ab, peer_id); in ath12k_peer_find_by_id()
109 list_for_each_entry(peer, &ab->peers, list) in ath12k_peer_find_by_id()
116 bool ath12k_peer_exist_by_vdev_id(struct ath12k_base *ab, int vdev_id) in ath12k_peer_exist_by_vdev_id() argument
120 spin_lock_bh(&ab->base_lock); in ath12k_peer_exist_by_vdev_id()
122 list_for_each_entry(peer, &ab->peers, list) { in ath12k_peer_exist_by_vdev_id()
124 spin_unlock_bh(&ab->base_lock); in ath12k_peer_exist_by_vdev_id()
128 spin_unlock_bh(&ab->base_lock); in ath12k_peer_exist_by_vdev_id()
132 struct ath12k_peer *ath12k_peer_find_by_ast(struct ath12k_base *ab, in ath12k_peer_find_by_ast() argument
137 lockdep_assert_held(&ab->base_lock); in ath12k_peer_find_by_ast()
139 list_for_each_entry(peer, &ab->peers, list) in ath12k_peer_find_by_ast()
146 void ath12k_peer_unmap_event(struct ath12k_base *ab, u16 peer_id) in ath12k_peer_unmap_event() argument
150 spin_lock_bh(&ab->base_lock); in ath12k_peer_unmap_event()
152 peer = ath12k_peer_find_by_id(ab, peer_id); in ath12k_peer_unmap_event()
154 ath12k_warn(ab, "peer-unmap-event: unknown peer id %d\n", in ath12k_peer_unmap_event()
159 ath12k_dbg(ab, ATH12K_DBG_DP_HTT, "htt peer unmap vdev %d peer %pM id %d\n", in ath12k_peer_unmap_event()
164 wake_up(&ab->peer_mapping_wq); in ath12k_peer_unmap_event()
167 spin_unlock_bh(&ab->base_lock); in ath12k_peer_unmap_event()
170 void ath12k_peer_map_event(struct ath12k_base *ab, u8 vdev_id, u16 peer_id, in ath12k_peer_map_event() argument
175 spin_lock_bh(&ab->base_lock); in ath12k_peer_map_event()
176 peer = ath12k_peer_find(ab, vdev_id, mac_addr); in ath12k_peer_map_event()
187 list_add(&peer->list, &ab->peers); in ath12k_peer_map_event()
188 wake_up(&ab->peer_mapping_wq); in ath12k_peer_map_event()
191 ath12k_dbg(ab, ATH12K_DBG_DP_HTT, "htt peer map vdev %d peer %pM id %d\n", in ath12k_peer_map_event()
195 spin_unlock_bh(&ab->base_lock); in ath12k_peer_map_event()
198 static int ath12k_wait_for_peer_common(struct ath12k_base *ab, int vdev_id, in ath12k_wait_for_peer_common() argument
203 ret = wait_event_timeout(ab->peer_mapping_wq, ({ in ath12k_wait_for_peer_common()
206 spin_lock_bh(&ab->base_lock); in ath12k_wait_for_peer_common()
207 mapped = !!ath12k_peer_find(ab, vdev_id, addr); in ath12k_wait_for_peer_common()
208 spin_unlock_bh(&ab->base_lock); in ath12k_wait_for_peer_common()
211 test_bit(ATH12K_FLAG_CRASH_FLUSH, &ab->dev_flags)); in ath12k_wait_for_peer_common()
223 struct ath12k_base *ab = ar->ab; in ath12k_peer_cleanup() local
227 spin_lock_bh(&ab->base_lock); in ath12k_peer_cleanup()
228 list_for_each_entry_safe(peer, tmp, &ab->peers, list) { in ath12k_peer_cleanup()
232 ath12k_warn(ab, "removing stale peer %pM from vdev_id %d\n", in ath12k_peer_cleanup()
240 spin_unlock_bh(&ab->base_lock); in ath12k_peer_cleanup()
245 return ath12k_wait_for_peer_common(ar->ab, vdev_id, addr, false); in ath12k_wait_for_peer_deleted()
256 ath12k_warn(ar->ab, "failed wait for peer deleted"); in ath12k_wait_for_peer_delete_done()
263 ath12k_warn(ar->ab, "Timeout in receiving peer delete response\n"); in ath12k_wait_for_peer_delete_done()
272 struct ath12k_base *ab = ar->ab; in ath12k_peer_delete_send() local
281 ath12k_warn(ab, in ath12k_peer_delete_send()
311 return ath12k_wait_for_peer_common(ar->ab, vdev_id, addr, true); in ath12k_wait_for_peer_created()
329 ath12k_warn(ar->ab, in ath12k_peer_create()
334 spin_lock_bh(&ar->ab->base_lock); in ath12k_peer_create()
335 peer = ath12k_peer_find_by_pdev_idx(ar->ab, ar->pdev_idx, arg->peer_addr); in ath12k_peer_create()
337 spin_unlock_bh(&ar->ab->base_lock); in ath12k_peer_create()
340 spin_unlock_bh(&ar->ab->base_lock); in ath12k_peer_create()
344 ath12k_warn(ar->ab, in ath12k_peer_create()
355 spin_lock_bh(&ar->ab->base_lock); in ath12k_peer_create()
357 peer = ath12k_peer_find(ar->ab, arg->vdev_id, arg->peer_addr); in ath12k_peer_create()
359 spin_unlock_bh(&ar->ab->base_lock); in ath12k_peer_create()
360 ath12k_warn(ar->ab, "failed to find peer %pM on vdev %i after creation\n", in ath12k_peer_create()
368 ath12k_warn(ar->ab, "failed to delete peer vdev_id %d addr %pM\n", in ath12k_peer_create()
420 spin_unlock_bh(&ar->ab->base_lock); in ath12k_peer_create()
541 ath12k_warn(ar->ab, in ath12k_peer_mlo_link_peers_delete()