Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright (c) 2014-2015 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 | /* |
| 23 | * This file was originally distributed by Qualcomm Atheros, Inc. |
| 24 | * under proprietary terms before Copyright ownership was assigned |
| 25 | * to the Linux Foundation. |
| 26 | */ |
| 27 | |
| 28 | #if !defined(__CDF_THREADS_H) |
| 29 | #define __CDF_THREADS_H |
| 30 | |
| 31 | /** |
| 32 | * DOC: cdf_threads |
| 33 | * |
| 34 | * Connectivity driver framework (CDF) thread related APIs |
| 35 | * |
| 36 | */ |
| 37 | |
| 38 | /* Include Files */ |
| 39 | #include <cdf_types.h> |
| 40 | |
| 41 | /* Preprocessor definitions and constants */ |
| 42 | |
| 43 | /* Type declarations */ |
| 44 | |
| 45 | /* Function declarations and documenation */ |
| 46 | |
| 47 | /** |
| 48 | * cdf_sleep() - sleep |
| 49 | * @msInterval : Number of milliseconds to suspend the current thread. |
| 50 | * A value of 0 may or may not cause the current thread to yield. |
| 51 | * |
| 52 | * This function suspends the execution of the current thread |
| 53 | * until the specified time out interval elapses. |
| 54 | * |
| 55 | * Return: nothing |
| 56 | */ |
| 57 | void cdf_sleep(uint32_t msInterval); |
| 58 | |
| 59 | /** |
| 60 | * cdf_sleep_us() - sleep |
| 61 | * @usInterval : Number of microseconds to suspend the current thread. |
| 62 | * A value of 0 may or may not cause the current thread to yield. |
| 63 | * |
| 64 | * This function suspends the execution of the current thread |
| 65 | * until the specified time out interval elapses. |
| 66 | * |
| 67 | * Return : nothing |
| 68 | */ |
| 69 | void cdf_sleep_us(uint32_t usInterval); |
| 70 | |
| 71 | /** |
| 72 | * cdf_busy_wait() - busy wait |
| 73 | * @usInterval : Number of microseconds to busy wait. |
| 74 | * |
| 75 | * This function places the current thread in busy wait until the specified |
| 76 | * time out interval elapses. If the interval is greater than 50us on WM, the |
| 77 | * behaviour is undefined. |
| 78 | * |
| 79 | * Return : nothing |
| 80 | */ |
| 81 | void cdf_busy_wait(uint32_t usInterval); |
| 82 | |
| 83 | #endif /* __CDF_THREADS_H */ |