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