Lines Matching full:ab
11 struct ath12k_peer *ath12k_peer_find(struct ath12k_base *ab, int vdev_id, in ath12k_peer_find() argument
16 lockdep_assert_held(&ab->base_lock); in ath12k_peer_find()
18 list_for_each_entry(peer, &ab->peers, list) { in ath12k_peer_find()
30 static struct ath12k_peer *ath12k_peer_find_by_pdev_idx(struct ath12k_base *ab, in ath12k_peer_find_by_pdev_idx() argument
35 lockdep_assert_held(&ab->base_lock); in ath12k_peer_find_by_pdev_idx()
37 list_for_each_entry(peer, &ab->peers, list) { in ath12k_peer_find_by_pdev_idx()
49 struct ath12k_peer *ath12k_peer_find_by_addr(struct ath12k_base *ab, in ath12k_peer_find_by_addr() argument
54 lockdep_assert_held(&ab->base_lock); in ath12k_peer_find_by_addr()
56 list_for_each_entry(peer, &ab->peers, list) { in ath12k_peer_find_by_addr()
66 struct ath12k_peer *ath12k_peer_find_by_id(struct ath12k_base *ab, in ath12k_peer_find_by_id() argument
71 lockdep_assert_held(&ab->base_lock); in ath12k_peer_find_by_id()
73 list_for_each_entry(peer, &ab->peers, list) in ath12k_peer_find_by_id()
80 bool ath12k_peer_exist_by_vdev_id(struct ath12k_base *ab, int vdev_id) in ath12k_peer_exist_by_vdev_id() argument
84 spin_lock_bh(&ab->base_lock); in ath12k_peer_exist_by_vdev_id()
86 list_for_each_entry(peer, &ab->peers, list) { in ath12k_peer_exist_by_vdev_id()
88 spin_unlock_bh(&ab->base_lock); in ath12k_peer_exist_by_vdev_id()
92 spin_unlock_bh(&ab->base_lock); in ath12k_peer_exist_by_vdev_id()
96 struct ath12k_peer *ath12k_peer_find_by_ast(struct ath12k_base *ab, in ath12k_peer_find_by_ast() argument
101 lockdep_assert_held(&ab->base_lock); in ath12k_peer_find_by_ast()
103 list_for_each_entry(peer, &ab->peers, list) in ath12k_peer_find_by_ast()
110 void ath12k_peer_unmap_event(struct ath12k_base *ab, u16 peer_id) in ath12k_peer_unmap_event() argument
114 spin_lock_bh(&ab->base_lock); in ath12k_peer_unmap_event()
116 peer = ath12k_peer_find_by_id(ab, peer_id); in ath12k_peer_unmap_event()
118 ath12k_warn(ab, "peer-unmap-event: unknown peer id %d\n", in ath12k_peer_unmap_event()
123 ath12k_dbg(ab, ATH12K_DBG_DP_HTT, "htt peer unmap vdev %d peer %pM id %d\n", in ath12k_peer_unmap_event()
128 wake_up(&ab->peer_mapping_wq); in ath12k_peer_unmap_event()
131 spin_unlock_bh(&ab->base_lock); in ath12k_peer_unmap_event()
134 void ath12k_peer_map_event(struct ath12k_base *ab, u8 vdev_id, u16 peer_id, in ath12k_peer_map_event() argument
139 spin_lock_bh(&ab->base_lock); in ath12k_peer_map_event()
140 peer = ath12k_peer_find(ab, vdev_id, mac_addr); in ath12k_peer_map_event()
151 list_add(&peer->list, &ab->peers); in ath12k_peer_map_event()
152 wake_up(&ab->peer_mapping_wq); in ath12k_peer_map_event()
155 ath12k_dbg(ab, ATH12K_DBG_DP_HTT, "htt peer map vdev %d peer %pM id %d\n", in ath12k_peer_map_event()
159 spin_unlock_bh(&ab->base_lock); in ath12k_peer_map_event()
162 static int ath12k_wait_for_peer_common(struct ath12k_base *ab, int vdev_id, in ath12k_wait_for_peer_common() argument
167 ret = wait_event_timeout(ab->peer_mapping_wq, ({ in ath12k_wait_for_peer_common()
170 spin_lock_bh(&ab->base_lock); in ath12k_wait_for_peer_common()
171 mapped = !!ath12k_peer_find(ab, vdev_id, addr); in ath12k_wait_for_peer_common()
172 spin_unlock_bh(&ab->base_lock); in ath12k_wait_for_peer_common()
175 test_bit(ATH12K_FLAG_CRASH_FLUSH, &ab->dev_flags)); in ath12k_wait_for_peer_common()
187 struct ath12k_base *ab = ar->ab; in ath12k_peer_cleanup() local
191 spin_lock_bh(&ab->base_lock); in ath12k_peer_cleanup()
192 list_for_each_entry_safe(peer, tmp, &ab->peers, list) { in ath12k_peer_cleanup()
196 ath12k_warn(ab, "removing stale peer %pM from vdev_id %d\n", in ath12k_peer_cleanup()
204 spin_unlock_bh(&ab->base_lock); in ath12k_peer_cleanup()
209 return ath12k_wait_for_peer_common(ar->ab, vdev_id, addr, false); in ath12k_wait_for_peer_deleted()
220 ath12k_warn(ar->ab, "failed wait for peer deleted"); in ath12k_wait_for_peer_delete_done()
227 ath12k_warn(ar->ab, "Timeout in receiving peer delete response\n"); in ath12k_wait_for_peer_delete_done()
244 ath12k_warn(ar->ab, in ath12k_peer_delete()
261 return ath12k_wait_for_peer_common(ar->ab, vdev_id, addr, true); in ath12k_wait_for_peer_created()
274 ath12k_warn(ar->ab, in ath12k_peer_create()
279 spin_lock_bh(&ar->ab->base_lock); in ath12k_peer_create()
280 peer = ath12k_peer_find_by_pdev_idx(ar->ab, ar->pdev_idx, arg->peer_addr); in ath12k_peer_create()
282 spin_unlock_bh(&ar->ab->base_lock); in ath12k_peer_create()
285 spin_unlock_bh(&ar->ab->base_lock); in ath12k_peer_create()
289 ath12k_warn(ar->ab, in ath12k_peer_create()
300 spin_lock_bh(&ar->ab->base_lock); in ath12k_peer_create()
302 peer = ath12k_peer_find(ar->ab, arg->vdev_id, arg->peer_addr); in ath12k_peer_create()
304 spin_unlock_bh(&ar->ab->base_lock); in ath12k_peer_create()
305 ath12k_warn(ar->ab, "failed to find peer %pM on vdev %i after creation\n", in ath12k_peer_create()
313 ath12k_warn(ar->ab, "failed to delete peer vdev_id %d addr %pM\n", in ath12k_peer_create()
339 spin_unlock_bh(&ar->ab->base_lock); in ath12k_peer_create()