xref: /linux/drivers/net/wireless/ath/ath11k/peer.h (revision 06d07429858317ded2db7986113a9e0129cd599b)
1d5c65159SKalle Valo /* SPDX-License-Identifier: BSD-3-Clause-Clear */
2d5c65159SKalle Valo /*
3d5c65159SKalle Valo  * Copyright (c) 2018-2019 The Linux Foundation. All rights reserved.
4*ea77e939SJeff Johnson  * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved.
5d5c65159SKalle Valo  */
6d5c65159SKalle Valo 
7d5c65159SKalle Valo #ifndef ATH11K_PEER_H
8d5c65159SKalle Valo #define ATH11K_PEER_H
9d5c65159SKalle Valo 
10d5c65159SKalle Valo struct ath11k_peer {
11d5c65159SKalle Valo 	struct list_head list;
12d5c65159SKalle Valo 	struct ieee80211_sta *sta;
13d5c65159SKalle Valo 	int vdev_id;
14d5c65159SKalle Valo 	u8 addr[ETH_ALEN];
15d5c65159SKalle Valo 	int peer_id;
16d5c65159SKalle Valo 	u16 ast_hash;
171e744bf2SKarthikeyan Periyasamy 	u8 pdev_idx;
184b965be5SKarthikeyan Periyasamy 	u16 hw_peer_id;
19d5c65159SKalle Valo 
20d5c65159SKalle Valo 	/* protected by ab->data_lock */
21d5c65159SKalle Valo 	struct ieee80211_key_conf *keys[WMI_MAX_KEY_INDEX + 1];
22d5c65159SKalle Valo 	struct dp_rx_tid rx_tid[IEEE80211_NUM_TIDS + 1];
23243874c6SManikanta Pubbisetty 
247b0c70d9SKarthikeyan Periyasamy 	/* peer id based rhashtable list pointer */
257b0c70d9SKarthikeyan Periyasamy 	struct rhash_head rhash_id;
267b0c70d9SKarthikeyan Periyasamy 	/* peer addr based rhashtable list pointer */
277b0c70d9SKarthikeyan Periyasamy 	struct rhash_head rhash_addr;
287b0c70d9SKarthikeyan Periyasamy 
29243874c6SManikanta Pubbisetty 	/* Info used in MMIC verification of
30243874c6SManikanta Pubbisetty 	 * RX fragments
31243874c6SManikanta Pubbisetty 	 */
32243874c6SManikanta Pubbisetty 	struct crypto_shash *tfm_mmic;
33243874c6SManikanta Pubbisetty 	u8 mcast_keyidx;
34243874c6SManikanta Pubbisetty 	u8 ucast_keyidx;
35acc79d98SSriram R 	u16 sec_type;
36acc79d98SSriram R 	u16 sec_type_grp;
3785f36923SKarthikeyan Periyasamy 	bool is_authorized;
38a06bfb3cSHarshitha Prem 	bool dp_setup_done;
39d5c65159SKalle Valo };
40d5c65159SKalle Valo 
41d5c65159SKalle Valo void ath11k_peer_unmap_event(struct ath11k_base *ab, u16 peer_id);
42d5c65159SKalle Valo void ath11k_peer_map_event(struct ath11k_base *ab, u8 vdev_id, u16 peer_id,
434b965be5SKarthikeyan Periyasamy 			   u8 *mac_addr, u16 ast_hash, u16 hw_peer_id);
44d5c65159SKalle Valo struct ath11k_peer *ath11k_peer_find(struct ath11k_base *ab, int vdev_id,
45d5c65159SKalle Valo 				     const u8 *addr);
46d5c65159SKalle Valo struct ath11k_peer *ath11k_peer_find_by_addr(struct ath11k_base *ab,
47d5c65159SKalle Valo 					     const u8 *addr);
48d5c65159SKalle Valo struct ath11k_peer *ath11k_peer_find_by_id(struct ath11k_base *ab, int peer_id);
49d5c65159SKalle Valo void ath11k_peer_cleanup(struct ath11k *ar, u32 vdev_id);
50d5c65159SKalle Valo int ath11k_peer_delete(struct ath11k *ar, u32 vdev_id, u8 *addr);
51d5c65159SKalle Valo int ath11k_peer_create(struct ath11k *ar, struct ath11k_vif *arvif,
52d5c65159SKalle Valo 		       struct ieee80211_sta *sta, struct peer_create_params *param);
53690ace20SRitesh Singh int ath11k_wait_for_peer_delete_done(struct ath11k *ar, u32 vdev_id,
54690ace20SRitesh Singh 				     const u8 *addr);
55aa44b2f3SCarl Huang struct ath11k_peer *ath11k_peer_find_by_vdev_id(struct ath11k_base *ab,
56aa44b2f3SCarl Huang 						int vdev_id);
577b0c70d9SKarthikeyan Periyasamy int ath11k_peer_rhash_tbl_init(struct ath11k_base *ab);
587b0c70d9SKarthikeyan Periyasamy void ath11k_peer_rhash_tbl_destroy(struct ath11k_base *ab);
597b0c70d9SKarthikeyan Periyasamy int ath11k_peer_rhash_delete(struct ath11k_base *ab, struct ath11k_peer *peer);
60d5c65159SKalle Valo #endif /* _PEER_H_ */
61