peer.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /* SPDX-License-Identifier: BSD-3-Clause-Clear */
  2. /*
  3. * Copyright (c) 2018-2019 The Linux Foundation. All rights reserved.
  4. * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
  5. */
  6. #ifndef ATH11K_PEER_H
  7. #define ATH11K_PEER_H
  8. struct ath11k_peer {
  9. struct list_head list;
  10. struct ieee80211_sta *sta;
  11. int vdev_id;
  12. u8 addr[ETH_ALEN];
  13. int peer_id;
  14. u16 ast_hash;
  15. u8 pdev_idx;
  16. u16 hw_peer_id;
  17. /* protected by ab->data_lock */
  18. struct ieee80211_key_conf *keys[WMI_MAX_KEY_INDEX + 1];
  19. struct dp_rx_tid rx_tid[IEEE80211_NUM_TIDS + 1];
  20. /* peer id based rhashtable list pointer */
  21. struct rhash_head rhash_id;
  22. /* peer addr based rhashtable list pointer */
  23. struct rhash_head rhash_addr;
  24. /* Info used in MMIC verification of
  25. * RX fragments
  26. */
  27. struct crypto_shash *tfm_mmic;
  28. u8 mcast_keyidx;
  29. u8 ucast_keyidx;
  30. u16 sec_type;
  31. u16 sec_type_grp;
  32. bool is_authorized;
  33. bool dp_setup_done;
  34. };
  35. void ath11k_peer_unmap_event(struct ath11k_base *ab, u16 peer_id);
  36. void ath11k_peer_map_event(struct ath11k_base *ab, u8 vdev_id, u16 peer_id,
  37. u8 *mac_addr, u16 ast_hash, u16 hw_peer_id);
  38. struct ath11k_peer *ath11k_peer_find(struct ath11k_base *ab, int vdev_id,
  39. const u8 *addr);
  40. struct ath11k_peer *ath11k_peer_find_by_addr(struct ath11k_base *ab,
  41. const u8 *addr);
  42. struct ath11k_peer *ath11k_peer_find_by_id(struct ath11k_base *ab, int peer_id);
  43. void ath11k_peer_cleanup(struct ath11k *ar, u32 vdev_id);
  44. int ath11k_peer_delete(struct ath11k *ar, u32 vdev_id, u8 *addr);
  45. int ath11k_peer_create(struct ath11k *ar, struct ath11k_vif *arvif,
  46. struct ieee80211_sta *sta, struct peer_create_params *param);
  47. int ath11k_wait_for_peer_delete_done(struct ath11k *ar, u32 vdev_id,
  48. const u8 *addr);
  49. struct ath11k_peer *ath11k_peer_find_by_vdev_id(struct ath11k_base *ab,
  50. int vdev_id);
  51. int ath11k_peer_rhash_tbl_init(struct ath11k_base *ab);
  52. void ath11k_peer_rhash_tbl_destroy(struct ath11k_base *ab);
  53. int ath11k_peer_rhash_delete(struct ath11k_base *ab, struct ath11k_peer *peer);
  54. #endif /* _PEER_H_ */