qdf_threads.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. /*
  2. * Copyright (c) 2014-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: qdf_threads
  20. * QCA driver framework (QDF) thread related APIs
  21. */
  22. #if !defined(__QDF_THREADS_H)
  23. #define __QDF_THREADS_H
  24. #include <qdf_types.h>
  25. #include "i_qdf_threads.h"
  26. typedef __qdf_thread_t qdf_thread_t;
  27. /* Function declarations and documenation */
  28. void qdf_sleep(uint32_t ms_interval);
  29. void qdf_sleep_us(uint32_t us_interval);
  30. void qdf_busy_wait(uint32_t us_interval);
  31. /**
  32. * qdf_set_user_nice() - set thread's nice value
  33. * @thread: pointer to thread
  34. * @nice: nice value
  35. *
  36. * Return: none
  37. */
  38. void qdf_set_user_nice(qdf_thread_t *thread, long nice);
  39. /**
  40. * qdf_create_thread() - create a kernel thread
  41. * @thread: pointer to thread
  42. * @nice: nice value
  43. *
  44. * Return: pointer to created kernel thread
  45. */
  46. qdf_thread_t *qdf_create_thread(int (*thread_handler)(void *data), void *data,
  47. const char thread_name[]);
  48. /**
  49. * qdf_wake_up_process() - wake up given thread
  50. * @thread: pointer to thread which needs to be woken up
  51. *
  52. * Return: none
  53. */
  54. int qdf_wake_up_process(qdf_thread_t *thread);
  55. /**
  56. * qdf_print_stack_trace_thread() - prints the stack trace of the given thread
  57. * @thread: the thread for which the stack trace will be printed
  58. *
  59. * Return: None
  60. */
  61. void qdf_print_thread_trace(qdf_thread_t *thread);
  62. /**
  63. * qdf_get_current_task() - get current task struct
  64. *
  65. * Return: pointer to task struct
  66. */
  67. qdf_thread_t *qdf_get_current_task(void);
  68. #endif /* __QDF_THREADS_H */