Lines Matching refs:ab

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