Lines Matching full:peer
142 struct ath10k_peer *peer; in ath10k_peer_find() local
146 list_for_each_entry(peer, &ar->peers, list) { in ath10k_peer_find()
147 if (peer->vdev_id != vdev_id) in ath10k_peer_find()
149 if (!ether_addr_equal(peer->addr, addr)) in ath10k_peer_find()
152 return peer; in ath10k_peer_find()
160 struct ath10k_peer *peer; in ath10k_peer_find_by_id() local
162 if (peer_id >= BITS_PER_TYPE(peer->peer_ids)) in ath10k_peer_find_by_id()
167 list_for_each_entry(peer, &ar->peers, list) in ath10k_peer_find_by_id()
168 if (test_bit(peer_id, peer->peer_ids)) in ath10k_peer_find_by_id()
169 return peer; in ath10k_peer_find_by_id()
210 struct ath10k_peer *peer; in ath10k_peer_map_event() local
214 "received htt peer map event with idx out of bounds: %hu\n", in ath10k_peer_map_event()
220 peer = ath10k_peer_find(ar, ev->vdev_id, ev->addr); in ath10k_peer_map_event()
221 if (!peer) { in ath10k_peer_map_event()
222 peer = kzalloc(sizeof(*peer), GFP_ATOMIC); in ath10k_peer_map_event()
223 if (!peer) in ath10k_peer_map_event()
226 peer->vdev_id = ev->vdev_id; in ath10k_peer_map_event()
227 ether_addr_copy(peer->addr, ev->addr); in ath10k_peer_map_event()
228 list_add(&peer->list, &ar->peers); in ath10k_peer_map_event()
232 ath10k_dbg(ar, ATH10K_DBG_HTT, "htt peer map vdev %d peer %pM id %d\n", in ath10k_peer_map_event()
235 WARN_ON(ar->peer_map[ev->peer_id] && (ar->peer_map[ev->peer_id] != peer)); in ath10k_peer_map_event()
236 ar->peer_map[ev->peer_id] = peer; in ath10k_peer_map_event()
237 set_bit(ev->peer_id, peer->peer_ids); in ath10k_peer_map_event()
246 struct ath10k_peer *peer; in ath10k_peer_unmap_event() local
250 "received htt peer unmap event with idx out of bounds: %hu\n", in ath10k_peer_unmap_event()
256 peer = ath10k_peer_find_by_id(ar, ev->peer_id); in ath10k_peer_unmap_event()
257 if (!peer) { in ath10k_peer_unmap_event()
258 ath10k_warn(ar, "peer-unmap-event: unknown peer id %d\n", in ath10k_peer_unmap_event()
263 ath10k_dbg(ar, ATH10K_DBG_HTT, "htt peer unmap vdev %d peer %pM id %d\n", in ath10k_peer_unmap_event()
264 peer->vdev_id, peer->addr, ev->peer_id); in ath10k_peer_unmap_event()
267 clear_bit(ev->peer_id, peer->peer_ids); in ath10k_peer_unmap_event()
269 if (bitmap_empty(peer->peer_ids, ATH10K_MAX_NUM_PEER_IDS)) { in ath10k_peer_unmap_event()
270 list_del(&peer->list); in ath10k_peer_unmap_event()
271 kfree(peer); in ath10k_peer_unmap_event()