Lines Matching refs:peer

14 	struct ath11k_peer *peer;  in ath11k_peer_find_list_by_id()  local
18 list_for_each_entry(peer, &ab->peers, list) { in ath11k_peer_find_list_by_id()
19 if (peer->peer_id != peer_id) in ath11k_peer_find_list_by_id()
22 return peer; in ath11k_peer_find_list_by_id()
31 struct ath11k_peer *peer; in ath11k_peer_find() local
35 list_for_each_entry(peer, &ab->peers, list) { in ath11k_peer_find()
36 if (peer->vdev_id != vdev_id) in ath11k_peer_find()
38 if (!ether_addr_equal(peer->addr, addr)) in ath11k_peer_find()
41 return peer; in ath11k_peer_find()
50 struct ath11k_peer *peer; in ath11k_peer_find_by_addr() local
57 peer = rhashtable_lookup_fast(ab->rhead_peer_addr, addr, in ath11k_peer_find_by_addr()
60 return peer; in ath11k_peer_find_by_addr()
66 struct ath11k_peer *peer; in ath11k_peer_find_by_id() local
73 peer = rhashtable_lookup_fast(ab->rhead_peer_id, &peer_id, in ath11k_peer_find_by_id()
76 return peer; in ath11k_peer_find_by_id()
82 struct ath11k_peer *peer; in ath11k_peer_find_by_vdev_id() local
86 list_for_each_entry(peer, &ab->peers, list) { in ath11k_peer_find_by_vdev_id()
87 if (vdev_id == peer->vdev_id) { in ath11k_peer_find_by_vdev_id()
89 return peer; in ath11k_peer_find_by_vdev_id()
98 struct ath11k_peer *peer; in ath11k_peer_unmap_event() local
102 peer = ath11k_peer_find_list_by_id(ab, peer_id); in ath11k_peer_unmap_event()
103 if (!peer) { in ath11k_peer_unmap_event()
110 peer->vdev_id, peer->addr, peer_id); in ath11k_peer_unmap_event()
112 list_del(&peer->list); in ath11k_peer_unmap_event()
113 kfree(peer); in ath11k_peer_unmap_event()
123 struct ath11k_peer *peer; in ath11k_peer_map_event() local
126 peer = ath11k_peer_find(ab, vdev_id, mac_addr); in ath11k_peer_map_event()
127 if (!peer) { in ath11k_peer_map_event()
128 peer = kzalloc(sizeof(*peer), GFP_ATOMIC); in ath11k_peer_map_event()
129 if (!peer) in ath11k_peer_map_event()
132 peer->vdev_id = vdev_id; in ath11k_peer_map_event()
133 peer->peer_id = peer_id; in ath11k_peer_map_event()
134 peer->ast_hash = ast_hash; in ath11k_peer_map_event()
135 peer->hw_peer_id = hw_peer_id; in ath11k_peer_map_event()
136 ether_addr_copy(peer->addr, mac_addr); in ath11k_peer_map_event()
137 list_add(&peer->list, &ab->peers); in ath11k_peer_map_event()
206 static int ath11k_peer_rhash_add(struct ath11k_base *ab, struct ath11k_peer *peer) in ath11k_peer_rhash_add() argument
216 ret = ath11k_peer_rhash_insert(ab, ab->rhead_peer_id, &peer->rhash_id, in ath11k_peer_rhash_add()
217 &ab->rhash_peer_id_param, &peer->peer_id); in ath11k_peer_rhash_add()
220 peer->addr, peer->peer_id, ret); in ath11k_peer_rhash_add()
224 ret = ath11k_peer_rhash_insert(ab, ab->rhead_peer_addr, &peer->rhash_addr, in ath11k_peer_rhash_add()
225 &ab->rhash_peer_addr_param, &peer->addr); in ath11k_peer_rhash_add()
228 peer->addr, peer->peer_id, ret); in ath11k_peer_rhash_add()
235 ath11k_peer_rhash_remove(ab, ab->rhead_peer_id, &peer->rhash_id, in ath11k_peer_rhash_add()
242 struct ath11k_peer *peer, *tmp; in ath11k_peer_cleanup() local
249 list_for_each_entry_safe(peer, tmp, &ab->peers, list) { in ath11k_peer_cleanup()
250 if (peer->vdev_id != vdev_id) in ath11k_peer_cleanup()
254 peer->addr, vdev_id); in ath11k_peer_cleanup()
256 ath11k_peer_rhash_delete(ab, peer); in ath11k_peer_cleanup()
257 list_del(&peer->list); in ath11k_peer_cleanup()
258 kfree(peer); in ath11k_peer_cleanup()
296 struct ath11k_peer *peer; in __ath11k_peer_delete() local
304 peer = ath11k_peer_find_by_addr(ab, addr); in __ath11k_peer_delete()
310 if (peer && peer->vdev_id == vdev_id) in __ath11k_peer_delete()
311 ath11k_peer_rhash_delete(ab, peer); in __ath11k_peer_delete()
317 if (!peer) in __ath11k_peer_delete()
318 peer = ath11k_peer_find(ab, vdev_id, addr); in __ath11k_peer_delete()
320 if (!peer) { in __ath11k_peer_delete()
373 struct ath11k_peer *peer; in ath11k_peer_create() local
387 peer = ath11k_peer_find_by_addr(ar->ab, param->peer_addr); in ath11k_peer_create()
388 if (peer) { in ath11k_peer_create()
389 if (peer->vdev_id == param->vdev_id) { in ath11k_peer_create()
398 ath11k_peer_rhash_delete(ar->ab, peer); in ath11k_peer_create()
419 peer = ath11k_peer_find(ar->ab, param->vdev_id, param->peer_addr); in ath11k_peer_create()
420 if (!peer) { in ath11k_peer_create()
430 ret = ath11k_peer_rhash_add(ar->ab, peer); in ath11k_peer_create()
437 peer->pdev_idx = ar->pdev_idx; in ath11k_peer_create()
438 peer->sta = sta; in ath11k_peer_create()
441 arvif->ast_hash = peer->ast_hash; in ath11k_peer_create()
442 arvif->ast_idx = peer->hw_peer_id; in ath11k_peer_create()
445 peer->sec_type = HAL_ENCRYPT_TYPE_OPEN; in ath11k_peer_create()
446 peer->sec_type_grp = HAL_ENCRYPT_TYPE_OPEN; in ath11k_peer_create()
452 peer->peer_id); in ath11k_peer_create()
474 int ath11k_peer_rhash_delete(struct ath11k_base *ab, struct ath11k_peer *peer) in ath11k_peer_rhash_delete() argument
484 ret = ath11k_peer_rhash_remove(ab, ab->rhead_peer_addr, &peer->rhash_addr, in ath11k_peer_rhash_delete()
488 peer->addr, peer->peer_id, ret); in ath11k_peer_rhash_delete()
492 ret = ath11k_peer_rhash_remove(ab, ab->rhead_peer_id, &peer->rhash_id, in ath11k_peer_rhash_delete()
496 peer->addr, peer->peer_id, ret); in ath11k_peer_rhash_delete()