Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1 | /* |
Satyanarayana Dash | e5482b5 | 2015-04-06 16:36:08 +0530 | [diff] [blame] | 2 | * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. |
Kiet Lam | 842dad0 | 2014-02-18 18:44:02 -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 | 842dad0 | 2014-02-18 18:44:02 -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_DXE_H |
| 29 | #define WLAN_QCT_DXE_H |
| 30 | |
| 31 | /**========================================================================= |
| 32 | |
| 33 | @file wlan_qct_dxe.h |
| 34 | |
| 35 | @brief |
| 36 | |
| 37 | This file contains the external API exposed by the wlan data transfer abstraction layer module. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 38 | ========================================================================*/ |
| 39 | |
| 40 | /*=========================================================================== |
| 41 | |
| 42 | EDIT HISTORY FOR FILE |
| 43 | |
| 44 | |
| 45 | This section contains comments describing changes made to the module. |
| 46 | Notice that changes are listed in reverse chronological order. |
| 47 | |
| 48 | |
| 49 | $Header:$ $DateTime: $ $Author: $ |
| 50 | |
| 51 | |
| 52 | when who what, where, why |
| 53 | -------- --- ---------------------------------------------------------- |
| 54 | 08/03/10 schang Created module. |
| 55 | |
| 56 | ===========================================================================*/ |
| 57 | |
| 58 | /*=========================================================================== |
| 59 | |
| 60 | INCLUDE FILES FOR MODULE |
| 61 | |
| 62 | ===========================================================================*/ |
| 63 | |
| 64 | /*---------------------------------------------------------------------------- |
| 65 | * Include Files |
| 66 | * -------------------------------------------------------------------------*/ |
| 67 | #include "wlan_qct_pal_api.h" |
| 68 | #include "wlan_qct_pal_packet.h" |
| 69 | #include "wlan_qct_pal_status.h" |
| 70 | #include "wlan_qct_pal_type.h" |
| 71 | #include "wlan_qct_pal_msg.h" |
| 72 | #include "wlan_qct_pal_sync.h" |
| 73 | #include "wlan_qct_wdi_dts.h" |
| 74 | |
| 75 | /*---------------------------------------------------------------------------- |
| 76 | * Type Declarations |
| 77 | * -------------------------------------------------------------------------*/ |
| 78 | /* DXE Descriptor contents SWAP option flag */ |
| 79 | |
| 80 | //#define WLANDXE_ENDIAN_SWAP_ENABLE |
| 81 | |
| 82 | /* Default RX OS frame buffer size |
| 83 | * Size must be same with Vos Packet Size */ |
| 84 | #define WLANDXE_DEFAULT_RX_OS_BUFFER_SIZE (VPKT_SIZE_BUFFER) |
| 85 | |
Hanumantha Reddy Pothula | bd3303c | 2015-07-15 17:22:00 +0530 | [diff] [blame] | 86 | /*reserve 30B of skb buff, to add NL header*/ |
| 87 | #define WLANDXE_NL_HEADER_SZ (30) |
| 88 | |
| 89 | /*MAX data transferred in one skb*/ |
| 90 | #define WLANDXE_FW_LOGGING_XFSIZE (WLANDXE_DEFAULT_RX_OS_BUFFER_SIZE - \ |
| 91 | WLANDXE_NL_HEADER_SZ) |
Mihir Shete | 5affadc | 2015-05-29 20:54:57 +0530 | [diff] [blame] | 92 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 93 | /*The maximum number of packets that can be chained in dxe for the Low |
| 94 | priority channel |
| 95 | Note: Increased it to 240 from 128 for Windows(EA) becase Windows is |
| 96 | able to push 2~6 packet chain in one NET_BUFFER. It causes TX low |
| 97 | resource condition more easily than LA. It ends up to cause low |
| 98 | throughut number and spend more CPU time*/ |
| 99 | #ifdef WINDOWS_DT |
| 100 | #define WLANDXE_LO_PRI_RES_NUM 240 |
| 101 | #else |
| 102 | #define WLANDXE_LO_PRI_RES_NUM 128 |
| 103 | #endif |
| 104 | |
| 105 | |
| 106 | /*The maximum number of packets that can be chained in dxe for the HI |
| 107 | priority channel */ |
| 108 | #define WLANDXE_HI_PRI_RES_NUM 10 |
| 109 | |
| 110 | typedef enum |
| 111 | { |
| 112 | WLANDXE_POWER_STATE_FULL, |
| 113 | WLANDXE_POWER_STATE_IMPS, |
| 114 | WLANDXE_POWER_STATE_BMPS, |
| 115 | WLANDXE_POWER_STATE_BMPS_PENDING, |
| 116 | WLANDXE_POWER_STATE_DOWN, |
| 117 | WLANDXE_POWER_STATE_MAX |
| 118 | } WLANDXE_PowerStateType; |
| 119 | |
| 120 | typedef enum |
| 121 | { |
| 122 | WLANDXE_RIVA_POWER_STATE_ACTIVE, |
| 123 | WLANDXE_RIVA_POWER_STATE_IMPS_UNKNOWN, |
| 124 | WLANDXE_RIVA_POWER_STATE_BMPS_UNKNOWN, |
| 125 | WLANDXE_RIVA_POWER_STATE_DOWN_UNKNOWN, |
| 126 | WLANDXE_RIVA_POWER_STATE_MAX |
| 127 | } WLANDXE_RivaPowerStateType; |
| 128 | |
| 129 | /*========================================================================== |
| 130 | @ Type Name |
| 131 | WLANDXE_RxFrameReadyCbType |
| 132 | |
| 133 | @ Description |
| 134 | RX Frame Ready indication CB |
| 135 | |
| 136 | @ Parameters |
Jeff Johnson | a8a1a48 | 2012-12-12 16:49:33 -0800 | [diff] [blame] | 137 | pVoid pAdapter : Driver global control block pointer |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 138 | palPacket pRXFramePtr : Received Frame Pointer |
| 139 | pVoid userCtxt : DTS user contect pointer |
| 140 | |
| 141 | @ Return |
| 142 | wpt_status |
| 143 | ===========================================================================*/ |
| 144 | typedef WDTS_RxFrameReadyCbType WLANDXE_RxFrameReadyCbType; |
| 145 | |
| 146 | /*========================================================================== |
| 147 | @ Type Name |
| 148 | WLANDXE_TxCompleteCbType |
| 149 | |
| 150 | @ Description |
| 151 | TX complete indication CB |
| 152 | |
| 153 | @ Parameters |
Jeff Johnson | a8a1a48 | 2012-12-12 16:49:33 -0800 | [diff] [blame] | 154 | pVoid pAdapter : Driver global control block pointer |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 155 | void pTXFramePtr : Completed TX Frame Pointer |
| 156 | pVoid userCtxt : DTS user contect pointer |
| 157 | |
| 158 | @ Return |
| 159 | wpt_status |
| 160 | ===========================================================================*/ |
| 161 | typedef WDTS_TxCompleteCbType WLANDXE_TxCompleteCbType; |
| 162 | |
| 163 | /*========================================================================== |
| 164 | @ Type Name |
| 165 | WLANDXE_LowResourceCbType |
| 166 | |
| 167 | @ Description |
| 168 | DXE Low resource indication CB |
| 169 | |
| 170 | @ Parameters |
Jeff Johnson | a8a1a48 | 2012-12-12 16:49:33 -0800 | [diff] [blame] | 171 | pVoid pAdapter : Driver global control block pointer |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 172 | BOOL lowResourceCondition : DXE low resource or not |
| 173 | pVoid userCtxt : DTS user contect pointer |
| 174 | |
| 175 | @ Return |
| 176 | wpt_status |
| 177 | ===========================================================================*/ |
| 178 | typedef WDTS_LowResourceCbType WLANDXE_LowResourceCbType; |
| 179 | |
| 180 | /*========================================================================== |
| 181 | @ Type Name |
Mihir Shete | c4093f9 | 2015-05-28 15:21:11 +0530 | [diff] [blame] | 182 | WLANDXE_MbReceiveMsgCbType |
| 183 | |
| 184 | @ Description |
| 185 | DXE Mailbox mes receive indiacation |
| 186 | |
| 187 | @ Parameters |
| 188 | void |
| 189 | |
| 190 | @ Return |
| 191 | void |
| 192 | ===========================================================================*/ |
| 193 | typedef WDTS_MbReceiveMsgType WLANDXE_MbReceiveMsgCbType; |
| 194 | |
Mihir Shete | 5affadc | 2015-05-29 20:54:57 +0530 | [diff] [blame] | 195 | typedef WDTS_RxLogDoneType WLANDXE_RxLogDoneType; |
| 196 | |
Mihir Shete | c4093f9 | 2015-05-28 15:21:11 +0530 | [diff] [blame] | 197 | /*========================================================================== |
| 198 | @ Type Name |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 199 | WLANDXE_SetPowerStateCbType |
| 200 | |
| 201 | @ Description |
| 202 | DXE Set power state ACK callback. This callback function should be |
| 203 | invoked by the DXE to notify WDI that set power state request is complete |
| 204 | |
| 205 | @ Parameters |
| 206 | status status of the set operation |
| 207 | pUserData Cookie that should be passed back to the caller along with the |
| 208 | callback. |
| 209 | |
| 210 | @ Return |
| 211 | None |
| 212 | ===========================================================================*/ |
| 213 | typedef WDTS_SetPSCbType WLANDXE_SetPowerStateCbType; |
| 214 | |
| 215 | /*------------------------------------------------------------------------- |
| 216 | *Function declarations and documenation |
| 217 | *-------------------------------------------------------------------------*/ |
| 218 | /*========================================================================== |
| 219 | @ Function Name |
| 220 | WLANDXE_Open |
| 221 | |
| 222 | @ Description |
| 223 | Open host DXE driver, allocate DXE resources |
| 224 | Allocate, DXE local control block, DXE descriptor pool, DXE descriptor control block pool |
| 225 | |
| 226 | @ Parameters |
Jeff Johnson | a8a1a48 | 2012-12-12 16:49:33 -0800 | [diff] [blame] | 227 | pVoid pAdapter : Driver global control block pointer |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 228 | |
| 229 | @ Return |
| 230 | pVoid DXE local module control block pointer |
| 231 | ===========================================================================*/ |
| 232 | void *WLANDXE_Open |
| 233 | ( |
| 234 | void |
| 235 | ); |
| 236 | |
| 237 | /*========================================================================== |
| 238 | @ Function Name |
| 239 | WLANDXE_ClientRegistration |
| 240 | |
| 241 | @ Description |
| 242 | Make callback functions registration into DXE driver from DXE driver client |
| 243 | |
| 244 | @ Parameters |
| 245 | pVoid pDXEContext : DXE module control block |
Mihir Shete | c4093f9 | 2015-05-28 15:21:11 +0530 | [diff] [blame] | 246 | WDTS_ClientCallbacks WDTSCb : Callbacks to WDTS to indicate various events |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 247 | void *userContext : DXE Cliennt control block |
| 248 | |
| 249 | @ Return |
| 250 | wpt_status |
| 251 | ===========================================================================*/ |
| 252 | wpt_status WLANDXE_ClientRegistration |
| 253 | ( |
| 254 | void *pDXEContext, |
Mihir Shete | c4093f9 | 2015-05-28 15:21:11 +0530 | [diff] [blame] | 255 | WDTS_ClientCallbacks WDTSCb, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 256 | void *userContext |
| 257 | ); |
| 258 | |
| 259 | /*========================================================================== |
| 260 | @ Function Name |
| 261 | WLANDXE_Start |
| 262 | |
| 263 | @ Description |
| 264 | Start Host DXE driver |
| 265 | Initialize DXE channels and start channel |
| 266 | |
| 267 | @ Parameters |
| 268 | pVoid pDXEContext : DXE module control block |
| 269 | |
| 270 | @ Return |
| 271 | wpt_status |
| 272 | ===========================================================================*/ |
| 273 | wpt_status WLANDXE_Start |
| 274 | ( |
| 275 | void *pDXEContext |
| 276 | ); |
| 277 | |
| 278 | /*========================================================================== |
| 279 | @ Function Name |
| 280 | WLANDXE_TXFrame |
| 281 | |
| 282 | @ Description |
| 283 | Trigger frame transmit from host to RIVA |
| 284 | |
| 285 | @ Parameters |
| 286 | pVoid pDXEContext : DXE Control Block |
| 287 | wpt_packet pPacket : transmit packet structure |
| 288 | WDTS_ChannelType channel : TX channel |
| 289 | |
| 290 | @ Return |
| 291 | wpt_status |
| 292 | ===========================================================================*/ |
| 293 | wpt_status WLANDXE_TxFrame |
| 294 | ( |
| 295 | void *pDXEContext, |
| 296 | wpt_packet *pPacket, |
| 297 | WDTS_ChannelType channel |
| 298 | ); |
| 299 | |
| 300 | |
| 301 | /*========================================================================== |
| 302 | @ Function Name |
| 303 | WLANDXE_CompleteTX |
| 304 | |
| 305 | @ Description |
| 306 | Informs DXE that the current series of Tx packets is complete |
| 307 | |
| 308 | @ Parameters |
| 309 | pDXEContext : DXE Control Block |
| 310 | ucTxResReq TX resource number required by TL/WDI |
| 311 | |
| 312 | @ Return |
| 313 | wpt_status |
| 314 | ===========================================================================*/ |
| 315 | wpt_status |
| 316 | WLANDXE_CompleteTX |
| 317 | ( |
| 318 | void* pDXEContext, |
| 319 | wpt_uint32 ucTxResReq |
| 320 | ); |
| 321 | |
| 322 | /*========================================================================== |
| 323 | @ Function Name |
| 324 | WLANDXE_Stop |
| 325 | |
| 326 | @ Description |
| 327 | Stop DXE channels and DXE engine operations |
| 328 | |
| 329 | @ Parameters |
| 330 | pVoid pDXEContext : DXE Control Block |
| 331 | |
| 332 | @ Return |
| 333 | wpt_status |
| 334 | ===========================================================================*/ |
| 335 | wpt_status WLANDXE_Stop |
| 336 | ( |
| 337 | void *pDXEContext |
| 338 | ); |
| 339 | |
| 340 | /*========================================================================== |
| 341 | @ Function Name |
| 342 | WLANDXE_Close |
| 343 | |
| 344 | @ Description |
| 345 | Close DXE channels |
| 346 | Free DXE related resources |
| 347 | DXE descriptor free |
| 348 | Descriptor control block free |
| 349 | Pre allocated RX buffer free |
| 350 | |
| 351 | @ Parameters |
| 352 | pVoid pDXEContext : DXE Control Block |
| 353 | |
| 354 | @ Return |
| 355 | wpt_status |
| 356 | ===========================================================================*/ |
| 357 | wpt_status WLANDXE_Close |
| 358 | ( |
| 359 | void *pDXEContext |
| 360 | ); |
| 361 | |
| 362 | /*========================================================================== |
| 363 | @ Function Name |
| 364 | WLANDXE_TriggerTX |
| 365 | |
| 366 | @ Description |
| 367 | TBD |
| 368 | |
| 369 | @ Parameters |
| 370 | pVoid pDXEContext : DXE Control Block |
| 371 | |
| 372 | @ Return |
| 373 | wpt_status |
| 374 | ===========================================================================*/ |
| 375 | wpt_status WLANDXE_TriggerTX |
| 376 | ( |
| 377 | void *pDXEContext |
| 378 | ); |
| 379 | |
| 380 | /*========================================================================== |
| 381 | @ Function Name |
| 382 | WLANDXE_SetPowerState |
| 383 | |
| 384 | @ Description |
| 385 | From Client let DXE knows what is the WLAN HW(RIVA) power state |
| 386 | |
| 387 | @ Parameters |
| 388 | pVoid pDXEContext : DXE Control Block |
| 389 | WLANDXE_PowerStateType powerState |
| 390 | |
| 391 | @ Return |
| 392 | wpt_status |
| 393 | ===========================================================================*/ |
| 394 | wpt_status WLANDXE_SetPowerState |
| 395 | ( |
| 396 | void *pDXEContext, |
| 397 | WDTS_PowerStateType powerState, |
| 398 | WDTS_SetPSCbType cBack |
| 399 | ); |
| 400 | |
| 401 | /*========================================================================== |
| 402 | @ Function Name |
| 403 | WLANDXE_GetFreeTxDataResNumber |
| 404 | |
| 405 | @ Description |
| 406 | Returns free descriptor numbers for TX data channel (TX high priority) |
| 407 | |
| 408 | @ Parameters |
| 409 | pVoid pDXEContext : DXE Control Block |
| 410 | |
| 411 | @ Return |
| 412 | wpt_uint32 Free descriptor number of TX high pri ch |
| 413 | ===========================================================================*/ |
| 414 | wpt_uint32 WLANDXE_GetFreeTxDataResNumber |
| 415 | ( |
| 416 | void *pDXEContext |
| 417 | ); |
| 418 | |
Madan Mohan Koyyalamudi | 8cb5398 | 2012-09-28 14:34:47 -0700 | [diff] [blame] | 419 | /*========================================================================== |
| 420 | @ Function Name |
| 421 | WLANDXE_ChannelDebug |
| 422 | |
| 423 | @ Description |
| 424 | Display DXE Channel debugging information |
| 425 | User may request to display DXE channel snapshot |
| 426 | Or if host driver detects any abnormal stcuk may display |
| 427 | |
| 428 | @ Parameters |
Jeff Johnson | b88db98 | 2012-12-10 13:34:59 -0800 | [diff] [blame] | 429 | displaySnapshot : Display DXE snapshot option |
Mihir Shete | 40a5565 | 2014-03-02 14:14:47 +0530 | [diff] [blame] | 430 | debugFlags : Enable stall detect features |
| 431 | defined by WPAL_DeviceDebugFlags |
| 432 | These features may effect |
| 433 | data performance. |
Madan Mohan Koyyalamudi | 8cb5398 | 2012-09-28 14:34:47 -0700 | [diff] [blame] | 434 | |
| 435 | @ Return |
| 436 | NONE |
| 437 | |
| 438 | ===========================================================================*/ |
| 439 | void WLANDXE_ChannelDebug |
| 440 | ( |
| 441 | wpt_boolean displaySnapshot, |
Mihir Shete | 40a5565 | 2014-03-02 14:14:47 +0530 | [diff] [blame] | 442 | wpt_uint8 debugFlags |
Madan Mohan Koyyalamudi | 8cb5398 | 2012-09-28 14:34:47 -0700 | [diff] [blame] | 443 | ); |
| 444 | |
Sravan Kumar Kairam | e9d186c | 2015-11-27 23:37:02 +0530 | [diff] [blame] | 445 | /*========================================================================== |
| 446 | @ Function Name |
| 447 | WLANDXE_KickDxe |
| 448 | |
| 449 | @ Description |
| 450 | Kick Dxe when HDD TX timeout happen |
| 451 | |
| 452 | @ Parameters |
| 453 | NONE |
| 454 | |
| 455 | @ Return |
| 456 | NONE |
| 457 | |
| 458 | ===========================================================================*/ |
| 459 | void WLANDXE_KickDxe |
| 460 | ( |
| 461 | void |
| 462 | ); |
| 463 | |
Mihir Shete | 5affadc | 2015-05-29 20:54:57 +0530 | [diff] [blame] | 464 | wpt_uint32 WLANDXE_SetupLogTransfer |
| 465 | ( |
| 466 | wpt_uint64 bufferAddr, |
| 467 | wpt_uint32 bufferLen |
| 468 | ); |
| 469 | |
| 470 | wpt_status WLANDXE_StartLogTransfer |
| 471 | ( |
| 472 | void |
| 473 | ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 474 | #endif /* WLAN_QCT_DXE_H */ |