Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1 | /* |
Gopichand Nakkala | 92f07d8 | 2013-01-08 21:16:34 -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. |
| 20 | */ |
| 21 | /* |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 22 | * Copyright (c) 2012, The Linux Foundation. All rights reserved. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23 | * |
| 24 | * Previously licensed under the ISC license by Qualcomm Atheros, Inc. |
| 25 | * |
| 26 | * |
| 27 | * Permission to use, copy, modify, and/or distribute this software for |
| 28 | * any purpose with or without fee is hereby granted, provided that the |
| 29 | * above copyright notice and this permission notice appear in all |
| 30 | * copies. |
| 31 | * |
| 32 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL |
| 33 | * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED |
| 34 | * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE |
| 35 | * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL |
| 36 | * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR |
| 37 | * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER |
| 38 | * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR |
| 39 | * PERFORMANCE OF THIS SOFTWARE. |
| 40 | */ |
| 41 | |
| 42 | #ifndef WLAN_QCT_TLI_BA_H |
| 43 | #define WLAN_QCT_TLI_BA_H |
| 44 | |
| 45 | /*=========================================================================== |
| 46 | |
| 47 | W L A N T R A N S P O R T L A Y E R |
| 48 | B L O C K A C K I N T E R N A L A P I |
| 49 | |
| 50 | |
| 51 | DESCRIPTION |
| 52 | This file contains the internal declarations used within wlan transport |
| 53 | layer module for BA session support, AMSDU de-aggregation and |
| 54 | MSDU reordering. |
| 55 | |
| 56 | Copyright (c) 2008 QUALCOMM Incorporated. All Rights Reserved. |
| 57 | Qualcomm Confidential and Proprietary |
| 58 | ===========================================================================*/ |
| 59 | |
| 60 | |
| 61 | /*=========================================================================== |
| 62 | |
| 63 | EDIT HISTORY FOR FILE |
| 64 | |
| 65 | |
| 66 | This section contains comments describing changes made to the module. |
| 67 | Notice that changes are listed in reverse chronological order. |
| 68 | |
| 69 | |
| 70 | $Header:$ $DateTime: $ $Author: $ |
| 71 | |
| 72 | |
| 73 | when who what, where, why |
| 74 | -------- --- ---------------------------------------------------------- |
| 75 | 08/22/08 sch Update based on unit test |
| 76 | 07/31/08 lti Created module. |
| 77 | |
| 78 | ===========================================================================*/ |
| 79 | |
| 80 | |
| 81 | |
| 82 | /*=========================================================================== |
| 83 | |
| 84 | INCLUDE FILES FOR MODULE |
| 85 | |
| 86 | ===========================================================================*/ |
| 87 | |
| 88 | /*---------------------------------------------------------------------------- |
| 89 | * Include Files |
| 90 | * -------------------------------------------------------------------------*/ |
| 91 | #include "wlan_qct_tli.h" |
| 92 | |
| 93 | /*--------------------------------------------------------------------------- |
| 94 | Re-order opcode filled in by RPE |
| 95 | !!! fix me: (check with RPE doc if the codes are correct) |
| 96 | ---------------------------------------------------------------------------*/ |
| 97 | typedef enum |
| 98 | { |
| 99 | WLANTL_OPCODE_INVALID = 0, |
| 100 | WLANTL_OPCODE_QCUR_FWDBUF = 1, |
| 101 | WLANTL_OPCODE_FWDBUF_FWDCUR = 2, |
| 102 | WLANTL_OPCODE_QCUR = 3, |
| 103 | WLANTL_OPCODE_FWDBUF_QUEUECUR = 4, |
| 104 | WLANTL_OPCODE_FWDBUF_DROPCUR = 5, |
| 105 | WLANTL_OPCODE_FWDALL_DROPCUR = 6, |
| 106 | WLANTL_OPCODE_FWDALL_QCUR = 7, |
| 107 | WLANTL_OPCODE_TEARDOWN = 8, |
| 108 | WLANTL_OPCODE_DROPCUR = 9, |
| 109 | WLANTL_OPCODE_MAX |
| 110 | }WLANTL_OpCodeEnumType; |
| 111 | |
| 112 | void WLANTL_InitBAReorderBuffer |
| 113 | ( |
| 114 | v_PVOID_t pvosGCtx |
| 115 | ); |
| 116 | |
| 117 | /*========================================================================== |
| 118 | |
| 119 | FUNCTION WLANTL_BaSessionAdd |
| 120 | |
| 121 | DESCRIPTION |
| 122 | HAL notifies TL when a new Block Ack session is being added. |
| 123 | |
| 124 | DEPENDENCIES |
| 125 | A BA session on Rx needs to be added in TL before the response is |
| 126 | being sent out |
| 127 | |
| 128 | PARAMETERS |
| 129 | |
| 130 | IN |
| 131 | pvosGCtx: pointer to the global vos context; a handle to TL's |
| 132 | control block can be extracted from its context |
| 133 | ucSTAId: identifier of the station for which requested the BA |
| 134 | session |
| 135 | ucTid: Tspec ID for the new BA session |
| 136 | uSize: size of the reordering window |
| 137 | |
| 138 | |
| 139 | RETURN VALUE |
| 140 | The result code associated with performing the operation |
| 141 | |
| 142 | VOS_STATUS_E_INVAL: Input parameters are invalid |
| 143 | VOS_STATUS_E_FAULT: Station ID is outside array boundaries or pointer |
| 144 | to TL cb is NULL ; access would cause a page fault |
| 145 | VOS_STATUS_E_EXISTS: Station was not registered or BA session already |
| 146 | exists |
| 147 | VOS_STATUS_E_NOSUPPORT: Not yet supported |
| 148 | |
| 149 | SIDE EFFECTS |
| 150 | |
| 151 | ============================================================================*/ |
| 152 | VOS_STATUS |
| 153 | WLANTL_BaSessionAdd |
| 154 | ( |
| 155 | v_PVOID_t pvosGCtx, |
| 156 | v_U16_t sessionID, |
| 157 | v_U32_t ucSTAId, |
| 158 | v_U8_t ucTid, |
| 159 | v_U32_t uBufferSize, |
| 160 | v_U32_t winSize, |
| 161 | v_U32_t SSN |
| 162 | ); |
| 163 | |
| 164 | /*========================================================================== |
| 165 | |
| 166 | FUNCTION WLANTL_BaSessionDel |
| 167 | |
| 168 | DESCRIPTION |
| 169 | HAL notifies TL when a new Block Ack session is being deleted. |
| 170 | |
| 171 | DEPENDENCIES |
| 172 | |
| 173 | PARAMETERS |
| 174 | |
| 175 | IN |
| 176 | pvosGCtx: pointer to the global vos context; a handle to TL's |
| 177 | control block can be extracted from its context |
| 178 | ucSTAId: identifier of the station for which requested the BA |
| 179 | session |
| 180 | ucTid: Tspec ID for the new BA session |
| 181 | |
| 182 | RETURN VALUE |
| 183 | The result code associated with performing the operation |
| 184 | |
| 185 | VOS_STATUS_E_INVAL: Input parameters are invalid |
| 186 | VOS_STATUS_E_FAULT: Station ID is outside array boundaries or pointer |
| 187 | to TL cb is NULL ; access would cause a page fault |
| 188 | VOS_STATUS_E_EXISTS: Station was not registered or BA session already |
| 189 | exists |
| 190 | VOS_STATUS_E_NOSUPPORT: Not yet supported |
| 191 | |
| 192 | SIDE EFFECTS |
| 193 | |
| 194 | ============================================================================*/ |
| 195 | VOS_STATUS |
| 196 | WLANTL_BaSessionDel |
| 197 | ( |
| 198 | v_PVOID_t pvosGCtx, |
| 199 | v_U16_t ucSTAId, |
| 200 | v_U8_t ucTid |
| 201 | ); |
| 202 | |
| 203 | /*========================================================================== |
| 204 | FUNCTION WLANTL_AMSDUProcess |
| 205 | |
| 206 | DESCRIPTION |
| 207 | Process A-MSDU sub-frame. Start of chain if marked as first frame. |
| 208 | Linked at the end of the existing AMSDU chain. |
| 209 | |
| 210 | |
| 211 | DEPENDENCIES |
| 212 | |
| 213 | PARAMETERS |
| 214 | |
| 215 | IN/OUT: |
| 216 | vosDataBuff: vos packet for the received data |
| 217 | outgoing contains the root of the chain for the rx |
| 218 | aggregated MSDU if the frame is marked as last; otherwise |
| 219 | NULL |
| 220 | |
| 221 | IN |
| 222 | pAdapter: pointer to the global adapter context; a handle to TL's |
| 223 | control block can be extracted from its context |
| 224 | pvBDHeader: pointer to the BD header |
| 225 | ucSTAId: STAtion ID |
| 226 | |
| 227 | RETURN VALUE |
| 228 | The result code associated with performing the operation |
| 229 | |
| 230 | SIDE EFFECTS |
| 231 | |
| 232 | ============================================================================*/ |
| 233 | VOS_STATUS |
| 234 | WLANTL_AMSDUProcess |
| 235 | ( |
| 236 | v_PVOID_t pvosGCtx, |
| 237 | vos_pkt_t** ppVosDataBuff, |
| 238 | v_PVOID_t pvBDHeader, |
| 239 | v_U8_t ucSTAId, |
| 240 | v_U8_t ucMPDUHLen, |
| 241 | v_U16_t usMPDULen |
| 242 | ); |
| 243 | |
| 244 | /*========================================================================== |
| 245 | FUNCTION WLANTL_MSDUReorder |
| 246 | |
| 247 | DESCRIPTION |
| 248 | MSDU reordering |
| 249 | |
| 250 | DEPENDENCIES |
| 251 | |
| 252 | PARAMETERS |
| 253 | |
| 254 | IN |
| 255 | |
| 256 | vosDataBuff: vos packet for the received data |
| 257 | pvBDHeader: pointer to the BD header |
| 258 | ucSTAId: STAtion ID |
| 259 | |
| 260 | RETURN VALUE |
| 261 | The result code associated with performing the operation |
| 262 | |
| 263 | SIDE EFFECTS |
| 264 | |
| 265 | ============================================================================*/ |
| 266 | VOS_STATUS |
| 267 | WLANTL_MSDUReorder |
| 268 | ( |
| 269 | WLANTL_CbType *pTLCb, |
| 270 | vos_pkt_t **vosDataBuff, |
| 271 | v_PVOID_t pvBDHeader, |
| 272 | v_U8_t ucSTAId, |
| 273 | v_U8_t ucTid |
| 274 | ); |
| 275 | |
| 276 | |
| 277 | /*========================================================================== |
| 278 | Utility functions |
| 279 | ==========================================================================*/ |
| 280 | |
| 281 | /*========================================================================== |
| 282 | FUNCTION WLANTL_AMSDUCompleteFrame |
| 283 | |
| 284 | DESCRIPTION |
| 285 | Complete AMSDU de-aggregation |
| 286 | |
| 287 | DEPENDENCIES |
| 288 | |
| 289 | PARAMETERS |
| 290 | |
| 291 | IN/OUT: |
| 292 | vosDataBuff: vos packet for the received data |
| 293 | |
| 294 | IN |
| 295 | pvBDHeader: pointer to the BD header |
| 296 | ucSTAId: STAtion ID |
| 297 | |
| 298 | RETURN VALUE |
| 299 | The result code associated with performing the operation |
| 300 | |
| 301 | SIDE EFFECTS |
| 302 | |
| 303 | ============================================================================*/ |
| 304 | VOS_STATUS |
| 305 | WLANTL_AMSDUCompleteFrame |
| 306 | ( |
| 307 | vos_pkt_t* vosDataBuff, |
| 308 | v_U8_t ucMPDUHLen, |
| 309 | v_U16_t usMPDULen |
| 310 | ); |
| 311 | |
| 312 | /*========================================================================== |
| 313 | |
| 314 | FUNCTION WLANTL_QueueCurrent |
| 315 | |
| 316 | DESCRIPTION |
| 317 | It will queue a packet at a given slot index in the MSDU reordering list. |
| 318 | |
| 319 | DEPENDENCIES |
| 320 | |
| 321 | PARAMETERS |
| 322 | |
| 323 | IN |
| 324 | pwBaReorder: pointer to the BA reordering session info |
| 325 | vosDataBuff: data buffer to be queued |
| 326 | ucSlotIndex: slot index |
| 327 | |
| 328 | RETURN VALUE |
| 329 | The result code associated with performing the operation |
| 330 | |
| 331 | VOS_STATUS_E_SUCCESS: Everything is OK |
| 332 | |
| 333 | |
| 334 | SIDE EFFECTS |
| 335 | |
| 336 | ============================================================================*/ |
| 337 | VOS_STATUS |
| 338 | WLANTL_QueueCurrent |
| 339 | ( |
| 340 | WLANTL_BAReorderType* pwBaReorder, |
| 341 | vos_pkt_t** vosDataBuff, |
| 342 | v_U8_t ucSlotIndex |
| 343 | ); |
| 344 | |
| 345 | /*========================================================================== |
| 346 | |
| 347 | FUNCTION WLANTL_ChainFrontPkts |
| 348 | |
| 349 | DESCRIPTION |
| 350 | It will remove all the packets from the front of a vos list and chain |
| 351 | them to a vos pkt . |
| 352 | |
| 353 | DEPENDENCIES |
| 354 | |
| 355 | PARAMETERS |
| 356 | |
| 357 | IN |
| 358 | ucCount: number of packets to extract |
| 359 | pwBaReorder: pointer to the BA reordering session info |
| 360 | |
| 361 | OUT |
| 362 | vosDataBuff: data buffer containing the extracted chain of packets |
| 363 | |
| 364 | RETURN VALUE |
| 365 | The result code associated with performing the operation |
| 366 | |
| 367 | VOS_STATUS_E_SUCCESS: Everything is OK |
| 368 | |
| 369 | |
| 370 | SIDE EFFECTS |
| 371 | |
| 372 | ============================================================================*/ |
| 373 | VOS_STATUS WLANTL_ChainFrontPkts |
| 374 | ( |
| 375 | v_U32_t fwdIndex, |
| 376 | v_U8_t opCode, |
| 377 | vos_pkt_t **vosDataBuff, |
| 378 | WLANTL_BAReorderType *pwBaReorder, |
| 379 | WLANTL_CbType *pTLCb |
| 380 | ); |
| 381 | |
| 382 | #ifdef ANI_CHIPSET_VOLANS |
| 383 | /*========================================================================== |
| 384 | |
| 385 | FUNCTION WLANTL_FillReplayCounter |
| 386 | |
| 387 | DESCRIPTION |
| 388 | It will fill repaly counter at a given slot index in the MSDU reordering list. |
| 389 | |
| 390 | DEPENDENCIES |
| 391 | |
| 392 | PARAMETERS |
| 393 | |
| 394 | IN |
| 395 | pwBaReorder : pointer to the BA reordering session info |
| 396 | replayCounter: replay counter to be filled |
| 397 | ucSlotIndex : slot index |
| 398 | |
| 399 | RETURN VALUE |
| 400 | NONE |
| 401 | |
| 402 | |
| 403 | SIDE EFFECTS |
| 404 | NONE |
| 405 | |
| 406 | ============================================================================*/ |
| 407 | void WLANTL_FillReplayCounter |
| 408 | ( |
| 409 | WLANTL_BAReorderType* pwBaReorder, |
| 410 | v_U64_t replayCounter, |
| 411 | v_U8_t ucSlotIndex |
| 412 | ); |
| 413 | #endif /*ANI_CHIPSET_VOLANS*/ |
| 414 | |
| 415 | #endif /* #ifndef WLAN_QCT_TLI_H */ |