dp_peer.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*
  2. * Copyright (c) 2016-2017 The Linux Foundation. All rights reserved.
  3. *
  4. * Permission to use, copy, modify, and/or distribute this software for
  5. * any purpose with or without fee is hereby granted, provided that the
  6. * above copyright notice and this permission notice appear in all
  7. * copies.
  8. *
  9. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  10. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  11. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  12. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  13. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  14. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  15. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  16. * PERFORMANCE OF THIS SOFTWARE.
  17. */
  18. #ifndef _DP_PEER_H_
  19. #define _DP_PEER_H_
  20. #include <qdf_types.h>
  21. #include <qdf_lock.h>
  22. #include "dp_types.h"
  23. #define DP_INVALID_PEER_ID 0xffff
  24. /**
  25. * dp_peer_find_by_id() - Returns peer object given the peer id
  26. *
  27. * @soc : core DP soc context
  28. * @peer_id : peer id from peer object can be retrieved
  29. *
  30. * Return: struct dp_peer*: Pointer to DP peer object
  31. */
  32. static inline struct dp_peer *
  33. dp_peer_find_by_id(struct dp_soc *soc,
  34. uint16_t peer_id)
  35. {
  36. struct dp_peer *peer;
  37. /* TODO: Hold lock */
  38. peer = (peer_id >= soc->max_peers) ? NULL :
  39. soc->peer_id_to_obj_map[peer_id];
  40. return peer;
  41. }
  42. void dp_rx_peer_map_handler(void *soc_handle, uint16_t peer_id,
  43. uint8_t vdev_id, uint8_t *peer_mac_addr);
  44. void dp_rx_peer_unmap_handler(void *soc_handle, uint16_t peer_id);
  45. void dp_rx_sec_ind_handler(void *soc_handle, uint16_t peer_id,
  46. enum htt_sec_type sec_type, int is_unicast,
  47. u_int32_t *michael_key, u_int32_t *rx_pn);
  48. #endif /* _DP_PEER_H_ */