peer.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /* SPDX-License-Identifier: BSD-3-Clause-Clear */
  2. /*
  3. * Copyright (c) 2018-2021 The Linux Foundation. All rights reserved.
  4. * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved.
  5. */
  6. #ifndef ATH12K_PEER_H
  7. #define ATH12K_PEER_H
  8. #include "dp_rx.h"
  9. struct ppdu_user_delayba {
  10. u16 sw_peer_id;
  11. u32 info0;
  12. u16 ru_end;
  13. u16 ru_start;
  14. u32 info1;
  15. u32 rate_flags;
  16. u32 resp_rate_flags;
  17. };
  18. struct ath12k_peer {
  19. struct list_head list;
  20. struct ieee80211_sta *sta;
  21. int vdev_id;
  22. u8 addr[ETH_ALEN];
  23. int peer_id;
  24. u16 ast_hash;
  25. u8 pdev_idx;
  26. u16 hw_peer_id;
  27. /* protected by ab->data_lock */
  28. struct ieee80211_key_conf *keys[WMI_MAX_KEY_INDEX + 1];
  29. struct ath12k_dp_rx_tid rx_tid[IEEE80211_NUM_TIDS + 1];
  30. /* Info used in MMIC verification of
  31. * RX fragments
  32. */
  33. struct crypto_shash *tfm_mmic;
  34. u8 mcast_keyidx;
  35. u8 ucast_keyidx;
  36. u16 sec_type;
  37. u16 sec_type_grp;
  38. struct ppdu_user_delayba ppdu_stats_delayba;
  39. bool delayba_flag;
  40. bool is_authorized;
  41. /* protected by ab->data_lock */
  42. bool dp_setup_done;
  43. };
  44. void ath12k_peer_unmap_event(struct ath12k_base *ab, u16 peer_id);
  45. void ath12k_peer_map_event(struct ath12k_base *ab, u8 vdev_id, u16 peer_id,
  46. u8 *mac_addr, u16 ast_hash, u16 hw_peer_id);
  47. struct ath12k_peer *ath12k_peer_find(struct ath12k_base *ab, int vdev_id,
  48. const u8 *addr);
  49. struct ath12k_peer *ath12k_peer_find_by_addr(struct ath12k_base *ab,
  50. const u8 *addr);
  51. struct ath12k_peer *ath12k_peer_find_by_id(struct ath12k_base *ab, int peer_id);
  52. void ath12k_peer_cleanup(struct ath12k *ar, u32 vdev_id);
  53. int ath12k_peer_delete(struct ath12k *ar, u32 vdev_id, u8 *addr);
  54. int ath12k_peer_create(struct ath12k *ar, struct ath12k_vif *arvif,
  55. struct ieee80211_sta *sta,
  56. struct ath12k_wmi_peer_create_arg *arg);
  57. int ath12k_wait_for_peer_delete_done(struct ath12k *ar, u32 vdev_id,
  58. const u8 *addr);
  59. bool ath12k_peer_exist_by_vdev_id(struct ath12k_base *ab, int vdev_id);
  60. struct ath12k_peer *ath12k_peer_find_by_ast(struct ath12k_base *ab, int ast_hash);
  61. #endif /* _PEER_H_ */