wlan_utility.h 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. /*
  2. * Copyright (c) 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. /**
  19. * DOC: Contains mandatory API from legacy
  20. */
  21. #ifndef _WLAN_UTILITY_H_
  22. #define _WLAN_UTILITY_H_
  23. #include <qdf_types.h>
  24. #include <wlan_objmgr_psoc_obj.h>
  25. #include <wlan_objmgr_pdev_obj.h>
  26. #include <wlan_objmgr_vdev_obj.h>
  27. /**
  28. * wlan_chan_to_freq() - converts channel to frequency
  29. * @chan: channel number
  30. *
  31. * @return frequency of the channel
  32. */
  33. uint32_t wlan_chan_to_freq(uint8_t chan);
  34. /*
  35. * wlan_is_dsrc_channel() - is the channel DSRC
  36. * @center_freq: center freq of the channel
  37. *
  38. * Return: true if DSRC channel or false otherwise
  39. */
  40. bool wlan_is_dsrc_channel(uint16_t center_freq);
  41. /**
  42. * wlan_freq_to_chan() - converts frequency to channel
  43. * @freq: frequency
  44. *
  45. * Return: channel of frequency
  46. */
  47. uint8_t wlan_freq_to_chan(uint32_t freq);
  48. /**
  49. * wlan_get_vendor_ie_ptr_from_oui() - Find out vendor ie
  50. * @oui: oui buffer
  51. * @oui_size: oui size
  52. * @ie: source ie address
  53. * @ie_len: source ie length
  54. *
  55. * This function find out vendor ie by pass source ie and vendor oui.
  56. *
  57. * Return: vendor ie address - success
  58. * NULL - failure
  59. */
  60. uint8_t *wlan_get_vendor_ie_ptr_from_oui(uint8_t *oui,
  61. uint8_t oui_size, uint8_t *ie, uint16_t ie_len);
  62. /**
  63. * wlan_is_emulation_platform() - check if platform is emulation based
  64. * @phy_version - psoc nif phy_version
  65. *
  66. * Return: boolean value based on platform type
  67. */
  68. bool wlan_is_emulation_platform(uint32_t phy_version);
  69. /**
  70. * wlan_get_pdev_id_from_vdev_id() - Helper func to derive pdev id from vdev_id
  71. * @psoc : psoc object
  72. * @vdev_id : vdev identifier
  73. * @dbg_id : object manager debug id
  74. *
  75. * This function is used to derive the pdev id from vdev id for a psoc
  76. *
  77. * Return : pdev_id - +ve integer for success and WLAN_INVALID_PDEV_ID
  78. * for failure
  79. */
  80. uint32_t wlan_get_pdev_id_from_vdev_id(struct wlan_objmgr_psoc *psoc,
  81. uint8_t vdev_id,
  82. wlan_objmgr_ref_dbgid dbg_id);
  83. #endif /* _WLAN_UTILITY_H_ */