wlan_scan_api.c 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. /*
  2. * Copyright (c) 2017-2018 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: This file contains all SCAN component's APIs
  20. */
  21. #include "cfg_ucfg_api.h"
  22. #include "wlan_scan_api.h"
  23. void wlan_scan_cfg_get_passive_dwelltime(struct wlan_objmgr_psoc *psoc,
  24. uint32_t *dwell_time)
  25. {
  26. struct wlan_scan_obj *scan_obj;
  27. scan_obj = wlan_psoc_get_scan_obj(psoc);
  28. if (!scan_obj)
  29. return;
  30. *dwell_time = scan_obj->scan_def.passive_dwell;
  31. }
  32. void wlan_scan_cfg_set_passive_dwelltime(struct wlan_objmgr_psoc *psoc,
  33. uint32_t dwell_time)
  34. {
  35. struct wlan_scan_obj *scan_obj;
  36. scan_obj = wlan_psoc_get_scan_obj(psoc);
  37. if (!scan_obj)
  38. return;
  39. scan_obj->scan_def.passive_dwell = dwell_time;
  40. }
  41. void wlan_scan_cfg_get_active_dwelltime(struct wlan_objmgr_psoc *psoc,
  42. uint32_t *dwell_time)
  43. {
  44. struct wlan_scan_obj *scan_obj;
  45. scan_obj = wlan_psoc_get_scan_obj(psoc);
  46. if (!scan_obj)
  47. return;
  48. *dwell_time = scan_obj->scan_def.active_dwell;
  49. }
  50. void wlan_scan_cfg_set_active_dwelltime(struct wlan_objmgr_psoc *psoc,
  51. uint32_t dwell_time)
  52. {
  53. struct wlan_scan_obj *scan_obj;
  54. scan_obj = wlan_psoc_get_scan_obj(psoc);
  55. if (!scan_obj)
  56. return;
  57. scan_obj->scan_def.active_dwell = dwell_time;
  58. }
  59. void wlan_scan_cfg_get_conc_active_dwelltime(struct wlan_objmgr_psoc *psoc,
  60. uint32_t *dwell_time)
  61. {
  62. struct wlan_scan_obj *scan_obj;
  63. scan_obj = wlan_psoc_get_scan_obj(psoc);
  64. if (!scan_obj)
  65. return;
  66. *dwell_time = scan_obj->scan_def.conc_active_dwell;
  67. }
  68. void wlan_scan_cfg_set_conc_active_dwelltime(struct wlan_objmgr_psoc *psoc,
  69. uint32_t dwell_time)
  70. {
  71. struct wlan_scan_obj *scan_obj;
  72. scan_obj = wlan_psoc_get_scan_obj(psoc);
  73. if (!scan_obj)
  74. return;
  75. scan_obj->scan_def.conc_active_dwell = dwell_time;
  76. }
  77. void wlan_scan_cfg_get_conc_passive_dwelltime(struct wlan_objmgr_psoc *psoc,
  78. uint32_t *dwell_time)
  79. {
  80. struct wlan_scan_obj *scan_obj;
  81. scan_obj = wlan_psoc_get_scan_obj(psoc);
  82. if (!scan_obj)
  83. return;
  84. *dwell_time = scan_obj->scan_def.conc_passive_dwell;
  85. }
  86. void wlan_scan_cfg_set_conc_passive_dwelltime(struct wlan_objmgr_psoc *psoc,
  87. uint32_t dwell_time)
  88. {
  89. struct wlan_scan_obj *scan_obj;
  90. scan_obj = wlan_psoc_get_scan_obj(psoc);
  91. if (!scan_obj)
  92. return;
  93. scan_obj->scan_def.conc_passive_dwell = dwell_time;
  94. }
  95. void wlan_scan_cfg_get_conc_max_resttime(struct wlan_objmgr_psoc *psoc,
  96. uint32_t *rest_time)
  97. {
  98. struct wlan_scan_obj *scan_obj;
  99. scan_obj = wlan_psoc_get_scan_obj(psoc);
  100. if (!scan_obj)
  101. return;
  102. *rest_time = scan_obj->scan_def.conc_max_rest_time;
  103. }
  104. void wlan_scan_cfg_get_conc_min_resttime(struct wlan_objmgr_psoc *psoc,
  105. uint32_t *rest_time)
  106. {
  107. struct wlan_scan_obj *scan_obj;
  108. scan_obj = wlan_psoc_get_scan_obj(psoc);
  109. if (!scan_obj)
  110. return;
  111. *rest_time = scan_obj->scan_def.conc_min_rest_time;
  112. }