Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1 | /* |
Kiet Lam | aa8e15a | 2014-02-11 23:30:06 -0800 | [diff] [blame^] | 2 | * Copyright (c) 2012-2013 Qualcomm Atheros, Inc. |
| 3 | * All Rights Reserved. |
| 4 | * Qualcomm Atheros Confidential and Proprietary. |
Gopichand Nakkala | 92f07d8 | 2013-01-08 21:16:34 -0800 | [diff] [blame] | 5 | */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6 | #if !defined( __VOS_MQ_H ) |
| 7 | #define __VOS_MQ_H |
| 8 | |
| 9 | /**========================================================================= |
Jeff Johnson | 2f5cfec | 2013-02-22 21:25:10 -0800 | [diff] [blame] | 10 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11 | \file vos_mq.h |
Jeff Johnson | 2f5cfec | 2013-02-22 21:25:10 -0800 | [diff] [blame] | 12 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13 | \brief virtual Operating System Services (vOSS) message queue APIs |
Jeff Johnson | 2f5cfec | 2013-02-22 21:25:10 -0800 | [diff] [blame] | 14 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15 | Message Queue Definitions and API |
Jeff Johnson | 2f5cfec | 2013-02-22 21:25:10 -0800 | [diff] [blame] | 16 | <<<<<<< HEAD:CORE/VOSS/inc/vos_mq.h |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17 | |
| 18 | Copyright 2008 (c) Qualcomm, Incorporated. All Rights Reserved. |
| 19 | |
| 20 | Qualcomm Confidential and Proprietary. |
| 21 | |
Jeff Johnson | 2f5cfec | 2013-02-22 21:25:10 -0800 | [diff] [blame] | 22 | ======= |
| 23 | |
| 24 | Copyright 2008 (c) Qualcomm Technologies, Inc. All Rights Reserved. |
| 25 | |
| 26 | Qualcomm Technologies Confidential and Proprietary. |
| 27 | |
| 28 | >>>>>>> f7413b6... wlan: voss: remove obsolete "INTEGRATED_SOC" featurization:prima/CORE/VOSS/inc/vos_mq.h |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 29 | ========================================================================*/ |
| 30 | |
| 31 | /* $Header$ */ |
| 32 | |
| 33 | /*-------------------------------------------------------------------------- |
| 34 | Include Files |
| 35 | ------------------------------------------------------------------------*/ |
| 36 | #include <vos_types.h> |
| 37 | #include <vos_status.h> |
| 38 | |
| 39 | /*-------------------------------------------------------------------------- |
| 40 | Preprocessor definitions and constants |
| 41 | ------------------------------------------------------------------------*/ |
| 42 | |
| 43 | /*-------------------------------------------------------------------------- |
| 44 | Type declarations |
| 45 | ------------------------------------------------------------------------*/ |
| 46 | |
| 47 | /// vos Message Type. |
| 48 | /// This represnets a message that can be posted to another module through |
| 49 | /// the voss Message Queues. |
| 50 | /// |
| 51 | /// \note This is mapped directly to the tSirMsgQ for backward |
| 52 | /// compatibility with the legacy MAC code. |
| 53 | |
| 54 | typedef struct vos_msg_s |
| 55 | { |
| 56 | v_U16_t type; |
| 57 | /* |
| 58 | * This field can be used as sequence number/dialog token for matching |
| 59 | * requests and responses. |
| 60 | */ |
| 61 | v_U16_t reserved; |
| 62 | /** |
| 63 | * Based on the type either a bodyptr pointer into |
| 64 | * memory or bodyval as a 32 bit data is used. |
| 65 | * bodyptr: is always a freeable pointer, one should always |
| 66 | * make sure that bodyptr is always freeable. |
| 67 | * |
| 68 | * Messages should use either bodyptr or bodyval; not both !!!. |
| 69 | */ |
| 70 | void *bodyptr; |
Jeff Johnson | 0212798 | 2013-12-09 09:19:48 -0800 | [diff] [blame] | 71 | |
| 72 | v_U32_t bodyval; |
| 73 | |
| 74 | /* |
| 75 | * Some messages provide a callback function. The function signature |
| 76 | * must be agreed upon between the two entities exchanging the message |
| 77 | */ |
| 78 | void *callback; |
| 79 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 80 | } vos_msg_t; |
| 81 | |
| 82 | |
Jeff Johnson | 2f5cfec | 2013-02-22 21:25:10 -0800 | [diff] [blame] | 83 | /*------------------------------------------------------------------------- |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 84 | Function declarations and documenation |
| 85 | ------------------------------------------------------------------------*/ |
Jeff Johnson | 2f5cfec | 2013-02-22 21:25:10 -0800 | [diff] [blame] | 86 | |
| 87 | /// Message Queue IDs |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 88 | typedef enum |
| 89 | { |
| 90 | /// Message Queue ID for messages bound for SME |
| 91 | VOS_MQ_ID_SME = VOS_MODULE_ID_SME, |
Jeff Johnson | 2f5cfec | 2013-02-22 21:25:10 -0800 | [diff] [blame] | 92 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 93 | /// Message Queue ID for messages bound for PE |
Jeff Johnson | 2f5cfec | 2013-02-22 21:25:10 -0800 | [diff] [blame] | 94 | VOS_MQ_ID_PE = VOS_MODULE_ID_PE, |
| 95 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 96 | /// Message Queue ID for messages bound for WDA |
| 97 | VOS_MQ_ID_WDA = VOS_MODULE_ID_WDA, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 98 | |
| 99 | /// Message Queue ID for messages bound for TL |
| 100 | VOS_MQ_ID_TL = VOS_MODULE_ID_TL, |
| 101 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 102 | /// Message Queue ID for messages bound for the SYS module |
| 103 | VOS_MQ_ID_SYS = VOS_MODULE_ID_SYS, |
| 104 | |
Jeff Johnson | 2f5cfec | 2013-02-22 21:25:10 -0800 | [diff] [blame] | 105 | /// Message Queue ID for messages bound for WDI |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 106 | VOS_MQ_ID_WDI = VOS_MODULE_ID_WDI, |
Jeff Johnson | 2f5cfec | 2013-02-22 21:25:10 -0800 | [diff] [blame] | 107 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 108 | } VOS_MQ_ID; |
| 109 | |
| 110 | |
| 111 | /**--------------------------------------------------------------------------- |
| 112 | |
| 113 | \brief vos_mq_post_message() - post a message to a message queue |
| 114 | |
| 115 | This API allows messages to be posted to a specific message queue. Messages |
| 116 | can be posted to the following message queues: |
| 117 | |
| 118 | <ul> |
| 119 | <li> SME |
| 120 | <li> PE |
| 121 | <li> HAL |
| 122 | <li> TL |
| 123 | </ul> |
| 124 | |
| 125 | \param msgQueueId - identifies the message queue upon which the message |
| 126 | will be posted. |
| 127 | |
| 128 | \param message - a pointer to a message buffer. Memory for this message |
| 129 | buffer is allocated by the caller and free'd by the vOSS after the |
| 130 | message is posted to the message queue. If the consumer of the |
| 131 | message needs anything in this message, it needs to copy the contents |
| 132 | before returning from the message queue handler. |
| 133 | |
| 134 | \return VOS_STATUS_SUCCESS - the message has been successfully posted |
| 135 | to the message queue. |
| 136 | |
| 137 | VOS_STATUS_E_INVAL - The value specified by msgQueueId does not |
| 138 | refer to a valid Message Queue Id. |
| 139 | |
| 140 | VOS_STATUS_E_FAULT - message is an invalid pointer. |
| 141 | |
| 142 | VOS_STATUS_E_FAILURE - the message queue handler has reported |
| 143 | an unknown failure. |
| 144 | |
| 145 | \sa |
| 146 | |
| 147 | --------------------------------------------------------------------------*/ |
| 148 | VOS_STATUS vos_mq_post_message( VOS_MQ_ID msgQueueId, vos_msg_t *message ); |
| 149 | |
| 150 | |
| 151 | /**--------------------------------------------------------------------------- |
| 152 | |
| 153 | \brief vos_tx_mq_serialize() - serialize a message to the Tx execution flow |
| 154 | |
| 155 | This API allows messages to be posted to a specific message queue in the |
| 156 | Tx excution flow. Messages for the Tx execution flow can be posted only |
| 157 | to the following queue. |
| 158 | |
| 159 | <ul> |
| 160 | <li> TL |
| 161 | <li> WDI/SSC |
| 162 | </ul> |
| 163 | |
| 164 | \param msgQueueId - identifies the message queue upon which the message |
| 165 | will be posted. |
| 166 | |
| 167 | \param message - a pointer to a message buffer. Body memory for this message |
| 168 | buffer is allocated by the caller and free'd by the vOSS after the |
| 169 | message is dispacthed to the appropriate component. If the consumer |
| 170 | of the message needs to keep anything in the body, it needs to copy |
| 171 | the contents before returning from the message handler. |
| 172 | |
| 173 | \return VOS_STATUS_SUCCESS - the message has been successfully posted |
| 174 | to the message queue. |
| 175 | |
| 176 | VOS_STATUS_E_INVAL - The value specified by msgQueueId does not |
| 177 | refer to a valid Message Queue Id. |
| 178 | |
| 179 | VOS_STATUS_E_FAULT - message is an invalid pointer. |
| 180 | |
| 181 | VOS_STATUS_E_FAILURE - the message queue handler has reported |
| 182 | an unknown failure. |
| 183 | |
| 184 | \sa |
| 185 | |
| 186 | --------------------------------------------------------------------------*/ |
| 187 | VOS_STATUS vos_tx_mq_serialize( VOS_MQ_ID msgQueueId, vos_msg_t *message ); |
| 188 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 189 | /**--------------------------------------------------------------------------- |
| 190 | |
| 191 | \brief vos_rx_mq_serialize() - serialize a message to the Rx execution flow |
| 192 | |
| 193 | This API allows messages to be posted to a specific message queue in the |
| 194 | Tx excution flow. Messages for the Rx execution flow can be posted only |
| 195 | to the following queue. |
| 196 | |
| 197 | <ul> |
| 198 | <li> WDI |
| 199 | </ul> |
| 200 | |
| 201 | \param msgQueueId - identifies the message queue upon which the message |
| 202 | will be posted. |
| 203 | |
| 204 | \param message - a pointer to a message buffer. Body memory for this message |
| 205 | buffer is allocated by the caller and free'd by the vOSS after the |
| 206 | message is dispacthed to the appropriate component. If the consumer |
| 207 | of the message needs to keep anything in the body, it needs to copy |
| 208 | the contents before returning from the message handler. |
| 209 | |
| 210 | \return VOS_STATUS_SUCCESS - the message has been successfully posted |
| 211 | to the message queue. |
| 212 | |
| 213 | VOS_STATUS_E_INVAL - The value specified by msgQueueId does not |
| 214 | refer to a valid Message Queue Id. |
| 215 | |
| 216 | VOS_STATUS_E_FAULT - message is an invalid pointer. |
| 217 | |
| 218 | VOS_STATUS_E_FAILURE - the message queue handler has reported |
| 219 | an unknown failure. |
| 220 | |
| 221 | \sa |
| 222 | |
| 223 | --------------------------------------------------------------------------*/ |
| 224 | VOS_STATUS vos_rx_mq_serialize( VOS_MQ_ID msgQueueId, vos_msg_t *message ); |
| 225 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 226 | |
| 227 | #endif // if !defined __VOS_MQ_H |