qdf_threads.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /*
  2. * Copyright (c) 2014-2017 The Linux Foundation. All rights reserved.
  3. *
  4. * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  5. *
  6. *
  7. * Permission to use, copy, modify, and/or distribute this software for
  8. * any purpose with or without fee is hereby granted, provided that the
  9. * above copyright notice and this permission notice appear in all
  10. * copies.
  11. *
  12. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  13. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  14. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  15. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  16. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  17. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  18. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  19. * PERFORMANCE OF THIS SOFTWARE.
  20. */
  21. /*
  22. * This file was originally distributed by Qualcomm Atheros, Inc.
  23. * under proprietary terms before Copyright ownership was assigned
  24. * to the Linux Foundation.
  25. */
  26. /**
  27. * DOC: qdf_threads
  28. * QCA driver framework (QDF) thread related APIs
  29. */
  30. #if !defined(__QDF_THREADS_H)
  31. #define __QDF_THREADS_H
  32. #include <qdf_types.h>
  33. #include "i_qdf_threads.h"
  34. typedef __qdf_thread_t qdf_thread_t;
  35. /* Function declarations and documenation */
  36. void qdf_sleep(uint32_t ms_interval);
  37. void qdf_sleep_us(uint32_t us_interval);
  38. void qdf_busy_wait(uint32_t us_interval);
  39. /**
  40. * qdf_set_user_nice() - set thread's nice value
  41. * @thread: pointer to thread
  42. * @nice: nice value
  43. *
  44. * Return: none
  45. */
  46. void qdf_set_user_nice(qdf_thread_t *thread, long nice);
  47. /**
  48. * qdf_create_thread() - create a kernel thread
  49. * @thread: pointer to thread
  50. * @nice: nice value
  51. *
  52. * Return: pointer to created kernel thread
  53. */
  54. qdf_thread_t *qdf_create_thread(int (*thread_handler)(void *data), void *data,
  55. const char thread_name[]);
  56. /**
  57. * qdf_wake_up_process() - wake up given thread
  58. * @thread: pointer to thread which needs to be woken up
  59. *
  60. * Return: none
  61. */
  62. int qdf_wake_up_process(qdf_thread_t *thread);
  63. /**
  64. * qdf_print_stack_trace_thread() - prints the stack trace of the given thread
  65. * @thread: the thread for which the stack trace will be printed
  66. *
  67. * Return: None
  68. */
  69. void qdf_print_thread_trace(qdf_thread_t *thread);
  70. /**
  71. * qdf_get_current_task() - get current task struct
  72. *
  73. * Return: pointer to task struct
  74. */
  75. qdf_thread_t *qdf_get_current_task(void);
  76. #endif /* __QDF_THREADS_H */