Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1 | /* |
Kiet Lam | 1ed83fc | 2014-02-19 01:15:45 -0800 | [diff] [blame] | 2 | * Copyright (c) 2012-2013 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. |
Gopichand Nakkala | 92f07d8 | 2013-01-08 21:16:34 -0800 | [diff] [blame] | 20 | */ |
Kiet Lam | 1ed83fc | 2014-02-19 01:15:45 -0800 | [diff] [blame] | 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 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 28 | #if !defined( __WLAN_QCT_PAL_SYNC_H ) |
| 29 | #define __WLAN_QCT_PAL_SYNC_H |
| 30 | |
| 31 | /**========================================================================= |
| 32 | |
| 33 | \file wlan_pal_sync.h |
| 34 | |
| 35 | \brief define synchronization objects PAL exports. wpt = (Wlan Pal Type) wpal = (Wlan PAL) |
| 36 | |
| 37 | Definitions for platform independent. |
| 38 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 39 | |
| 40 | ========================================================================*/ |
| 41 | |
| 42 | #include "wlan_qct_pal_type.h" |
| 43 | #include "wlan_qct_pal_status.h" |
| 44 | #include "wlan_qct_os_sync.h" |
| 45 | |
| 46 | |
| 47 | #define WLAN_PAL_WAIT_INFINITE 0xFFFFFFFF |
| 48 | |
| 49 | /*--------------------------------------------------------------------------- |
| 50 | wpalMutexInit initialize a mutex object |
| 51 | Param: |
| 52 | pMutex a pointer to caller allocated object of wpt_mutex |
| 53 | Return: |
| 54 | eWLAN_PAL_STATUS_SUCCESS success. Fail otherwise. |
| 55 | ---------------------------------------------------------------------------*/ |
| 56 | wpt_status wpalMutexInit(wpt_mutex *pMutex); |
| 57 | |
| 58 | /*--------------------------------------------------------------------------- |
| 59 | wpalMutexDelete invalidate a mutex object |
| 60 | Param: |
| 61 | pMutex a pointer to caller allocated object of wpt_mutex |
| 62 | Return: |
| 63 | eWLAN_PAL_STATUS_SUCCESS success. Fail otherwise. |
| 64 | ---------------------------------------------------------------------------*/ |
| 65 | wpt_status wpalMutexDelete(wpt_mutex *pMutex); |
| 66 | |
| 67 | /*--------------------------------------------------------------------------- |
| 68 | wpalMutexAcquire acquire a mutex object. It is blocked until the object is acquired. |
| 69 | Param: |
| 70 | pMutex a pointer to caller allocated object of wpt_mutex |
| 71 | Return: |
| 72 | eWLAN_PAL_STATUS_SUCCESS success. Fail otherwise. |
| 73 | ---------------------------------------------------------------------------*/ |
| 74 | wpt_status wpalMutexAcquire(wpt_mutex *pMutex); |
| 75 | |
| 76 | /*--------------------------------------------------------------------------- |
| 77 | wpalMutexRelease Release a held mutex object |
| 78 | Param: |
| 79 | pMutex a pointer to caller allocated object of wpt_mutex |
| 80 | Return: |
| 81 | eWLAN_PAL_STATUS_SUCCESS success. Fail otherwise. |
| 82 | ---------------------------------------------------------------------------*/ |
| 83 | wpt_status wpalMutexRelease(wpt_mutex *pMutex); |
| 84 | |
| 85 | /*--------------------------------------------------------------------------- |
| 86 | wpalEventInit initialize an event object |
| 87 | Param: |
| 88 | pEvent a pointer to caller allocated object of wpt_event |
| 89 | Return: |
| 90 | eWLAN_PAL_STATUS_SUCCESS success. Fail otherwise. |
| 91 | ---------------------------------------------------------------------------*/ |
| 92 | wpt_status wpalEventInit(wpt_event *pEvent); |
| 93 | |
| 94 | /*--------------------------------------------------------------------------- |
| 95 | wpalEventDelete invalidate an event object |
| 96 | Param: |
| 97 | pEvent a pointer to caller allocated object of wpt_event |
| 98 | Return: |
| 99 | eWLAN_PAL_STATUS_SUCCESS success. Fail otherwise. |
| 100 | ---------------------------------------------------------------------------*/ |
| 101 | wpt_status wpalEventDelete(wpt_event *pEvent); |
| 102 | |
| 103 | /*--------------------------------------------------------------------------- |
| 104 | wpalEventWait Wait on an event object |
| 105 | Param: |
| 106 | pEvent a pointer to caller allocated object of wpt_event |
| 107 | timeout timerout value at unit of milli-seconds. 0xffffffff means infinite wait |
| 108 | Return: |
| 109 | eWLAN_PAL_STATUS_SUCCESS success. Fail otherwise. |
| 110 | ---------------------------------------------------------------------------*/ |
| 111 | wpt_status wpalEventWait(wpt_event *pEvent, wpt_uint32 timeout); |
| 112 | |
| 113 | /*--------------------------------------------------------------------------- |
| 114 | wpalEventSet Set an event object to signaled state |
| 115 | Param: |
| 116 | pEvent a pointer to caller allocated object of wpt_event |
| 117 | Return: |
| 118 | eWLAN_PAL_STATUS_SUCCESS success. Fail otherwise. |
| 119 | ---------------------------------------------------------------------------*/ |
| 120 | wpt_status wpalEventSet(wpt_event *pEvent); |
| 121 | |
| 122 | /*--------------------------------------------------------------------------- |
| 123 | wpalEventReset Set an event object to non-signaled state |
| 124 | Param: |
| 125 | pEvent a pointer to caller allocated object of wpt_event |
| 126 | Return: |
| 127 | eWLAN_PAL_STATUS_SUCCESS success. Fail otherwise. |
| 128 | ---------------------------------------------------------------------------*/ |
| 129 | wpt_status wpalEventReset(wpt_event *pEvent); |
| 130 | |
| 131 | |
| 132 | #endif // __WLAN_QCT_PAL_SYNC_H |