Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1 | /* |
Siddharth Bhal | 4f6694f | 2015-02-27 17:24:21 +0530 | [diff] [blame] | 2 | * Copyright (c) 2012,2014-2015 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 | /**========================================================================= |
| 29 | |
| 30 | \file wlan_qct_pal_api.c |
| 31 | |
| 32 | \brief Implementation general APIs PAL exports. |
| 33 | wpt = (Wlan Pal Type) wpal = (Wlan PAL) |
| 34 | |
| 35 | Definitions for platform Windows. |
| 36 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 37 | |
| 38 | ========================================================================*/ |
| 39 | |
| 40 | #include "wlan_qct_pal_api.h" |
| 41 | #include "wlan_qct_pal_trace.h" |
| 42 | #include "wlan_qct_pal_device.h" |
| 43 | #include "vos_trace.h" |
| 44 | #ifndef MEMORY_DEBUG |
| 45 | #include "vos_memory.h" |
| 46 | #endif /* MEMORY_DEBUG */ |
Katya Nigam | a0e98e4 | 2014-02-05 13:46:40 +0530 | [diff] [blame] | 47 | #include "vos_sched.h" |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 48 | #include "vos_api.h" |
| 49 | |
| 50 | #include "dma-mapping.h" |
Arun Kumar Khandavalli | 74fe303 | 2014-03-17 20:35:34 +0530 | [diff] [blame] | 51 | #include <linux/version.h> |
| 52 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0)) |
| 53 | #include <soc/qcom/subsystem_restart.h> |
| 54 | #else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 55 | #include <mach/subsystem_restart.h> |
Arun Kumar Khandavalli | 74fe303 | 2014-03-17 20:35:34 +0530 | [diff] [blame] | 56 | #endif |
Madan Mohan Koyyalamudi | 0bfd000 | 2012-10-24 14:39:37 -0700 | [diff] [blame] | 57 | #include <linux/wcnss_wlan.h> |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 58 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 59 | |
| 60 | #define WPAL_GET_NDIS_HANDLE(p) ( ((tPalContext *)(p))->devHandle ) |
| 61 | |
| 62 | tPalContext gContext; |
| 63 | |
| 64 | //This structure need to be 4-byte aligned. No packing. |
| 65 | typedef struct |
| 66 | { |
| 67 | wpt_uint32 length; |
| 68 | //The offset from beginning of the buffer where it is allocated |
| 69 | wpt_uint32 offset; |
| 70 | wpt_uint32 phyAddr; |
| 71 | } tPalDmaMemInfo; |
| 72 | |
| 73 | /*=========================================================================== |
| 74 | |
| 75 | FUNCTIONS |
| 76 | |
| 77 | ===========================================================================*/ |
| 78 | |
| 79 | /** |
| 80 | * @brief Initialize PAL |
| 81 | * In case of QNP, this does nothing. |
| 82 | * @param ppPalContext pointer to a caller allocated pointer. It |
| 83 | * is opaque to caller. |
| 84 | * Caller save the returned pointer for future use when |
| 85 | * calling PAL APIs. |
Arun Kumar Khandavalli | ebb1948 | 2014-03-25 13:56:53 +0530 | [diff] [blame] | 86 | * @param devHandle pointer to the OS specific device handle. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 87 | * |
| 88 | * @return wpt_status eWLAN_PAL_STATUS_SUCCESS - success. Otherwise fail. |
| 89 | */ |
Arun Kumar Khandavalli | ebb1948 | 2014-03-25 13:56:53 +0530 | [diff] [blame] | 90 | wpt_status wpalOpen(void **ppPalContext, void *devHandle) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 91 | { |
| 92 | wpt_status status; |
| 93 | |
Arun Kumar Khandavalli | ebb1948 | 2014-03-25 13:56:53 +0530 | [diff] [blame] | 94 | gContext.devHandle = devHandle; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 95 | |
Arun Kumar Khandavalli | ebb1948 | 2014-03-25 13:56:53 +0530 | [diff] [blame] | 96 | status = wpalDeviceInit(devHandle); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 97 | if (!WLAN_PAL_IS_STATUS_SUCCESS(status)) |
| 98 | { |
| 99 | WPAL_TRACE(eWLAN_MODULE_PAL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 100 | "%s: wpalDeviceInit failed with status %u", |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 101 | __func__, status); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 102 | } |
| 103 | |
| 104 | return status; |
| 105 | } |
| 106 | |
| 107 | /** |
| 108 | * @brief wpalClose - Release PAL |
| 109 | * In case of QNP, this does nothing. |
| 110 | * @param pPalContext pointer returned from wpalOpen. |
| 111 | * |
| 112 | * @return wpt_status eWLAN_PAL_STATUS_SUCCESS - success. Otherwise fail. |
| 113 | */ |
| 114 | wpt_status wpalClose(void *pPalContext) |
| 115 | { |
| 116 | wpalDeviceClose(gContext.devHandle); |
| 117 | gContext.devHandle = NULL; |
| 118 | |
| 119 | return eWLAN_PAL_STATUS_SUCCESS; |
| 120 | } |
| 121 | |
| 122 | #ifndef MEMORY_DEBUG |
| 123 | /** |
| 124 | * @brief wpalMemoryAllocate - Allocate memory |
| 125 | * @param size number of bytes to allocate |
| 126 | * |
| 127 | * @return void* A pointer to the allocated memory. |
| 128 | * NULL - fail to allocate memory |
| 129 | */ |
| 130 | void *wpalMemoryAllocate(wpt_uint32 size) |
| 131 | { |
| 132 | return vos_mem_malloc( size ); |
| 133 | } |
| 134 | |
| 135 | /** |
| 136 | * @brief wpalMemoryFree - Free allocated memory |
| 137 | * @param pv pointer to buffer to be freed |
| 138 | */ |
| 139 | void wpalMemoryFree(void *pv) |
| 140 | { |
| 141 | vos_mem_free( pv ); |
| 142 | } |
| 143 | #endif /* MEMORY_DEBUG */ |
| 144 | /** |
| 145 | * @brief wpalMemoryCopy - copy memory |
| 146 | * @param dest address which data is copied to |
| 147 | * @param src address which data is copied from |
| 148 | * @param size number of bytes to copy |
| 149 | * |
| 150 | * @return wpt_status |
| 151 | * eWLAN_PAL_STATUS_SUCCESS |
| 152 | * eWLAN_PAL_STATUS_INVALID_PARAM |
| 153 | */ |
| 154 | wpt_status wpalMemoryCopy(void * dest, void * src, wpt_uint32 size) |
| 155 | { |
| 156 | vos_mem_copy( dest, src, size ); |
| 157 | |
| 158 | return eWLAN_PAL_STATUS_SUCCESS; |
| 159 | } |
| 160 | |
| 161 | /** |
| 162 | * @brief wpalMemoryCompare - compare memory |
| 163 | * @param buf1 address of buffer1 |
| 164 | * @param buf2 address of buffer2 |
| 165 | * @param size number of bytes to compare |
| 166 | * |
| 167 | * @return wpt_boolean |
| 168 | * eWLAN_PAL_TRUE - if two buffers have same content |
| 169 | * eWLAN_PAL_FALSE - not match |
| 170 | */ |
| 171 | wpt_boolean wpalMemoryCompare(void * buf1, void * buf2, wpt_uint32 size) |
| 172 | { |
| 173 | return (wpt_boolean)vos_mem_compare( buf1, buf2, size ); |
| 174 | } |
| 175 | |
| 176 | |
| 177 | /*--------------------------------------------------------------------------- |
| 178 | wpalMemoryZero - Zero memory |
| 179 | Param: |
| 180 | buf - address of buffer to be zero |
| 181 | size - number of bytes to zero |
| 182 | Return: |
| 183 | None |
| 184 | ---------------------------------------------------------------------------*/ |
| 185 | void wpalMemoryZero(void *buf, wpt_uint32 size) |
| 186 | { |
| 187 | vos_mem_zero( buf, size ); |
| 188 | } |
| 189 | |
| 190 | /** |
| 191 | * @brief wpalMemoryFill - Fill memory with one pattern |
| 192 | * @param buf address of buffer to be filled |
| 193 | * @param size number of bytes to fill |
| 194 | * @param bFill one byte of data to fill in (size) bytes from the start of the |
| 195 | * buffer |
| 196 | */ |
| 197 | void wpalMemoryFill(void *buf, wpt_uint32 size, wpt_byte bFill) |
| 198 | { |
| 199 | vos_mem_set( buf, size, bFill ); |
| 200 | } |
| 201 | |
| 202 | /** |
| 203 | * @brief wpalDmaMemoryAllocate - Allocate memory ready for DMA. Aligned at 4-byte |
| 204 | * @param size number of bytes to allocate |
| 205 | * @param ppPhysicalAddr Physical address of the buffer if allocation succeeds |
| 206 | * |
| 207 | * @return void* A pointer to the allocated memory (virtual address). |
| 208 | * NULL - fail to allocate memory |
| 209 | */ |
| 210 | void *wpalDmaMemoryAllocate(wpt_uint32 size, void **ppPhysicalAddr) |
| 211 | { |
Arun Kumar Khandavalli | ebb1948 | 2014-03-25 13:56:53 +0530 | [diff] [blame] | 212 | struct device *wcnss_device = (struct device *) gContext.devHandle; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 213 | void *pv = NULL; |
| 214 | dma_addr_t PhyAddr; |
| 215 | wpt_uint32 uAllocLen = size + sizeof(tPalDmaMemInfo); |
| 216 | |
Arun Kumar Khandavalli | ebb1948 | 2014-03-25 13:56:53 +0530 | [diff] [blame] | 217 | pv = dma_alloc_coherent(wcnss_device, uAllocLen, &PhyAddr, GFP_KERNEL); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 218 | if ( NULL == pv ) |
| 219 | { |
| 220 | WPAL_TRACE(eWLAN_MODULE_PAL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Arif Hussain | 9a5d538 | 2013-11-17 22:05:35 -0800 | [diff] [blame] | 221 | "%s Unable to allocate DMA buffer", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 222 | return NULL; |
| 223 | } |
Mihir Shete | f4e7bd3 | 2014-10-27 09:27:41 +0530 | [diff] [blame] | 224 | wpalMemoryZero(pv, uAllocLen); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 225 | |
| 226 | |
| 227 | ((tPalDmaMemInfo *)pv)->length = uAllocLen; |
| 228 | ((tPalDmaMemInfo *)pv)->phyAddr = PhyAddr; |
| 229 | ((tPalDmaMemInfo *)pv)->offset = sizeof(tPalDmaMemInfo); |
| 230 | pv = (wpt_byte *)pv + sizeof(tPalDmaMemInfo); |
| 231 | *ppPhysicalAddr = (void*)PhyAddr + sizeof(tPalDmaMemInfo); |
| 232 | |
| 233 | |
| 234 | return (pv); |
| 235 | }/*wpalDmaMemoryAllocate*/ |
| 236 | |
| 237 | |
| 238 | /** |
| 239 | * @brief wpalDmaMemoryFree - Free memory ready for DMA |
| 240 | * @param pv address for the buffer to be freed |
| 241 | */ |
| 242 | void wpalDmaMemoryFree(void *pv) |
| 243 | { |
Arun Kumar Khandavalli | ebb1948 | 2014-03-25 13:56:53 +0530 | [diff] [blame] | 244 | struct device *wcnss_device = (struct device *) gContext.devHandle; |
| 245 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 246 | tPalDmaMemInfo *pMemInfo = (tPalDmaMemInfo *)(((wpt_byte *)pv) - |
| 247 | sizeof(tPalDmaMemInfo)); |
| 248 | if(pv) |
| 249 | { |
| 250 | pv = (wpt_byte *)pv - pMemInfo->offset; |
Arun Kumar Khandavalli | ebb1948 | 2014-03-25 13:56:53 +0530 | [diff] [blame] | 251 | dma_free_coherent(wcnss_device, pMemInfo->length, pv, pMemInfo->phyAddr); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 252 | } |
| 253 | |
| 254 | }/*wpalDmaMemoryFree*/ |
| 255 | |
| 256 | /** |
| 257 | * @brief wpalDbgReadRegister - Read register from the WiFi BB |
| 258 | chip |
| 259 | * @param regAddr - register address |
| 260 | * @param pregValue - return value from register if success |
| 261 | * @return |
| 262 | eWLAN_PAL_STATUS_SUCCESS - when everything is OK |
| 263 | */ |
| 264 | wpt_status wpalDbgReadRegister(wpt_uint32 regAddr, wpt_uint32 *pregValue) |
| 265 | { |
| 266 | if (NULL == pregValue) |
| 267 | { |
| 268 | return eWLAN_PAL_STATUS_E_INVAL; |
| 269 | } |
| 270 | |
| 271 | return wpalReadRegister(regAddr, pregValue); |
| 272 | } |
| 273 | |
| 274 | /** |
| 275 | * @brief wpalDbgWriteRegister - Write a value to the register |
| 276 | * in the WiFi BB chip Param: |
| 277 | * @param regAddr - register address |
| 278 | * @param regValue - value to be written |
| 279 | * @return |
| 280 | eWLAN_PAL_STATUS_SUCCESS - when everything is OK |
| 281 | */ |
| 282 | wpt_status wpalDbgWriteRegister(wpt_uint32 regAddr, wpt_uint32 regValue) |
| 283 | { |
| 284 | return wpalWriteRegister(regAddr, regValue); |
| 285 | } |
| 286 | |
| 287 | /** |
| 288 | * @brief |
| 289 | wpalDbgReadMemory - Read memory from WiFi BB chip space |
| 290 | * @param memAddr - address of memory |
| 291 | * @param buf - output |
| 292 | * @param len - length to be read |
| 293 | * @return |
| 294 | eWLAN_PAL_STATUS_SUCCESS - when everything is OK |
| 295 | */ |
| 296 | wpt_status wpalDbgReadMemory(wpt_uint32 memAddr, wpt_uint8 *buf, wpt_uint32 len) |
| 297 | { |
| 298 | return wpalReadDeviceMemory(memAddr, buf, len); |
| 299 | } |
| 300 | |
| 301 | /** |
| 302 | * @brief |
| 303 | wpalDbgWriteMemory - Write a value to the memory in the WiFi BB chip space |
| 304 | * @param memAddr - memory address |
| 305 | * @param buf - vlaue to be written |
| 306 | * @param len - length of buf |
| 307 | * @return |
| 308 | eWLAN_PAL_STATUS_SUCCESS - when everything is OK |
| 309 | */ |
| 310 | wpt_status wpalDbgWriteMemory(wpt_uint32 memAddr, wpt_uint8 *buf, wpt_uint32 len) |
| 311 | { |
| 312 | return wpalWriteDeviceMemory(memAddr, buf, len); |
| 313 | } |
| 314 | |
| 315 | /*--------------------------------------------------------------------------- |
| 316 | wpalDriverShutdown - Shutdown WLAN driver |
| 317 | |
| 318 | This API is requied by SSR, call in to 'VOS shutdown' to shutdown WLAN |
| 319 | driver when Riva crashes. |
| 320 | |
| 321 | Param: |
| 322 | None |
| 323 | Return: |
| 324 | eWLAN_PAL_STATUS_SUCCESS - when everything is OK |
| 325 | ---------------------------------------------------------------------------*/ |
| 326 | wpt_status wpalDriverShutdown(void) |
| 327 | { |
| 328 | VOS_STATUS vosStatus; |
| 329 | vosStatus = vos_wlanShutdown(); |
| 330 | |
| 331 | if (VOS_STATUS_SUCCESS == vosStatus) { |
| 332 | return eWLAN_PAL_STATUS_SUCCESS; |
| 333 | } |
| 334 | return eWLAN_PAL_STATUS_E_FAILURE; |
| 335 | } |
| 336 | |
| 337 | /*--------------------------------------------------------------------------- |
| 338 | wpalDriverShutdown - Re-init WLAN driver |
| 339 | |
| 340 | This API is requied by SSR, call in to 'VOS re-init' to re-init WLAN |
| 341 | driver. |
| 342 | |
| 343 | Param: |
| 344 | None |
| 345 | Return: |
| 346 | eWLAN_PAL_STATUS_SUCCESS - when everything is OK |
| 347 | ---------------------------------------------------------------------------*/ |
| 348 | wpt_status wpalDriverReInit(void) |
| 349 | { |
| 350 | VOS_STATUS vosStatus; |
| 351 | |
| 352 | vosStatus = vos_wlanReInit(); |
| 353 | if (VOS_STATUS_SUCCESS == vosStatus) { |
| 354 | return eWLAN_PAL_STATUS_SUCCESS; |
| 355 | } |
| 356 | return eWLAN_PAL_STATUS_E_FAILURE; |
| 357 | } |
| 358 | |
| 359 | /*--------------------------------------------------------------------------- |
| 360 | wpalRivaSubystemRestart - Initiate Riva SSR |
| 361 | |
| 362 | This API is called by WLAN driver to initiate Riva SSR |
| 363 | |
| 364 | Param: |
| 365 | None |
| 366 | Return: |
| 367 | eWLAN_PAL_STATUS_SUCCESS - when everything is OK |
| 368 | ---------------------------------------------------------------------------*/ |
| 369 | wpt_status wpalRivaSubystemRestart(void) |
| 370 | { |
| 371 | /* call SSR only if driver is not in load/unload process. |
| 372 | * A WDI timeout during load/unload cannot be fixed thru |
| 373 | * SSR */ |
| 374 | if (vos_is_load_unload_in_progress(VOS_MODULE_ID_WDI, NULL)) |
| 375 | { |
| 376 | WPAL_TRACE(eWLAN_MODULE_PAL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 377 | "%s: loading/unloading in progress," |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 378 | " SSR will be done at the end of unload", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 379 | return eWLAN_PAL_STATUS_E_FAILURE; |
| 380 | } |
Madan Mohan Koyyalamudi | 3246f5b | 2012-10-15 15:40:02 -0700 | [diff] [blame] | 381 | if (0 == subsystem_restart("wcnss")) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 382 | { |
| 383 | return eWLAN_PAL_STATUS_SUCCESS; |
| 384 | } |
| 385 | return eWLAN_PAL_STATUS_E_FAILURE; |
| 386 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 387 | |
| 388 | /*--------------------------------------------------------------------------- |
| 389 | wpalWlanReload - Initiate WLAN Driver reload |
| 390 | |
| 391 | Param: |
| 392 | None |
| 393 | Return: |
| 394 | NONE |
| 395 | ---------------------------------------------------------------------------*/ |
| 396 | void wpalWlanReload(void) |
| 397 | { |
| 398 | vos_wlanRestart(); |
| 399 | return; |
Madan Mohan Koyyalamudi | 3246f5b | 2012-10-15 15:40:02 -0700 | [diff] [blame] | 400 | } |
Madan Mohan Koyyalamudi | 0bfd000 | 2012-10-24 14:39:37 -0700 | [diff] [blame] | 401 | |
| 402 | /*--------------------------------------------------------------------------- |
| 403 | wpalWcnssResetIntr - Trigger the reset FIQ to Riva |
| 404 | |
| 405 | Param: |
| 406 | None |
| 407 | Return: |
| 408 | NONE |
| 409 | ---------------------------------------------------------------------------*/ |
| 410 | void wpalWcnssResetIntr(void) |
| 411 | { |
Madan Mohan Koyyalamudi | c72a4d6 | 2012-11-08 14:59:34 -0800 | [diff] [blame] | 412 | #ifdef HAVE_WCNSS_RESET_INTR |
Madan Mohan Koyyalamudi | 0bfd000 | 2012-10-24 14:39:37 -0700 | [diff] [blame] | 413 | wcnss_reset_intr(); |
Madan Mohan Koyyalamudi | c72a4d6 | 2012-11-08 14:59:34 -0800 | [diff] [blame] | 414 | #endif |
Madan Mohan Koyyalamudi | 0bfd000 | 2012-10-24 14:39:37 -0700 | [diff] [blame] | 415 | return; |
| 416 | } |
Madan Mohan Koyyalamudi | 6208028 | 2013-08-05 12:51:17 +0530 | [diff] [blame] | 417 | |
| 418 | /*--------------------------------------------------------------------------- |
Siddharth Bhal | b7e8e88 | 2014-10-10 16:27:47 +0530 | [diff] [blame] | 419 | wpalWcnssIsProntoHwVer3 - Check if Pronto Hw ver3 |
| 420 | |
| 421 | Param: |
| 422 | None |
| 423 | Return: |
| 424 | TRUE if Ponto Hw Ver 3 |
| 425 | Therefore use WQ6 instead of WQ23 for TX Low/High Priority Channel |
| 426 | ---------------------------------------------------------------------------*/ |
| 427 | int wpalWcnssIsProntoHwVer3(void) |
| 428 | { |
| 429 | return wcnss_is_hw_pronto_ver3(); |
| 430 | } |
| 431 | |
| 432 | /*--------------------------------------------------------------------------- |
Mihir Shete | e2ae82a | 2015-03-16 14:08:49 +0530 | [diff] [blame] | 433 | wpalIsFwLoggingEnabled - Check if Firmware will send logs using DXE |
| 434 | |
| 435 | Param: |
| 436 | None |
| 437 | Return: |
| 438 | Check the documentation of vos_is_fw_logging_enabled |
| 439 | ---------------------------------------------------------------------------*/ |
| 440 | wpt_uint8 wpalIsFwLoggingEnabled(void) |
| 441 | { |
| 442 | return vos_is_fw_logging_enabled(); |
| 443 | } |
| 444 | |
| 445 | /*--------------------------------------------------------------------------- |
Mihir Shete | d627460 | 2015-04-28 16:13:21 +0530 | [diff] [blame^] | 446 | wpalIsFwLoggingSupported - Check if Firmware supports the fw->host |
| 447 | logging infrastructure |
| 448 | This API can only be called after fw caps |
| 449 | are exchanged. |
| 450 | |
| 451 | Param: |
| 452 | None |
| 453 | Return: |
| 454 | Check the documentation of vos_is_fw_logging_supported |
| 455 | ---------------------------------------------------------------------------*/ |
| 456 | wpt_uint8 wpalIsFwLoggingSupported(void) |
| 457 | { |
| 458 | return vos_is_fw_logging_supported(); |
| 459 | } |
| 460 | |
| 461 | /*--------------------------------------------------------------------------- |
Madan Mohan Koyyalamudi | 6208028 | 2013-08-05 12:51:17 +0530 | [diff] [blame] | 462 | wpalFwDumpReq - Trigger the dump commands to Firmware |
| 463 | |
| 464 | Param: |
Siddharth Bhal | 6811560 | 2015-01-18 20:44:55 +0530 | [diff] [blame] | 465 | cmd - Command No. to execute |
| 466 | arg1 - argument 1 to cmd |
| 467 | arg2 - argument 2 to cmd |
| 468 | arg3 - argument 3 to cmd |
| 469 | arg4 - argument 4 to cmd |
| 470 | async -asynchronous event. Don't wait for completion. |
Madan Mohan Koyyalamudi | 6208028 | 2013-08-05 12:51:17 +0530 | [diff] [blame] | 471 | Return: |
| 472 | NONE |
| 473 | ---------------------------------------------------------------------------*/ |
| 474 | void wpalFwDumpReq(wpt_uint32 cmd, wpt_uint32 arg1, wpt_uint32 arg2, |
Siddharth Bhal | 6811560 | 2015-01-18 20:44:55 +0530 | [diff] [blame] | 475 | wpt_uint32 arg3, wpt_uint32 arg4, wpt_boolean async) |
Madan Mohan Koyyalamudi | 6208028 | 2013-08-05 12:51:17 +0530 | [diff] [blame] | 476 | { |
Siddharth Bhal | 6811560 | 2015-01-18 20:44:55 +0530 | [diff] [blame] | 477 | vos_fwDumpReq(cmd, arg1, arg2, arg3, arg4, async); |
Madan Mohan Koyyalamudi | 6208028 | 2013-08-05 12:51:17 +0530 | [diff] [blame] | 478 | return; |
| 479 | } |
Leo Chang | 00708f6 | 2013-12-03 20:21:51 -0800 | [diff] [blame] | 480 | |
| 481 | /*--------------------------------------------------------------------------- |
| 482 | wpalDevicePanic - Trigger Device Panic |
| 483 | Trigger device panic to help debug |
| 484 | |
| 485 | Param: |
| 486 | NONE |
| 487 | |
| 488 | Return: |
| 489 | NONE |
| 490 | ---------------------------------------------------------------------------*/ |
| 491 | void wpalDevicePanic(void) |
| 492 | { |
Katya Nigam | 91d31cb | 2014-05-20 19:16:15 +0530 | [diff] [blame] | 493 | BUG_ON(1); |
Leo Chang | 00708f6 | 2013-12-03 20:21:51 -0800 | [diff] [blame] | 494 | return; |
| 495 | } |
Katya Nigam | a0e98e4 | 2014-02-05 13:46:40 +0530 | [diff] [blame] | 496 | /*--------------------------------------------------------------------------- |
Siddharth Bhal | 4f6694f | 2015-02-27 17:24:21 +0530 | [diff] [blame] | 497 | wpalIslogPInProgress - calls vos API vos_is_logp_in_progress() |
Katya Nigam | a0e98e4 | 2014-02-05 13:46:40 +0530 | [diff] [blame] | 498 | |
| 499 | Param: |
| 500 | NONE |
| 501 | Return: |
| 502 | STATUS |
| 503 | ---------------------------------------------------------------------------*/ |
Siddharth Bhal | 4f6694f | 2015-02-27 17:24:21 +0530 | [diff] [blame] | 504 | int wpalIslogPInProgress(void) |
Katya Nigam | a0e98e4 | 2014-02-05 13:46:40 +0530 | [diff] [blame] | 505 | { |
Siddharth Bhal | 4f6694f | 2015-02-27 17:24:21 +0530 | [diff] [blame] | 506 | return vos_is_logp_in_progress(VOS_MODULE_ID_WDI, NULL); |
Katya Nigam | a0e98e4 | 2014-02-05 13:46:40 +0530 | [diff] [blame] | 507 | } |
Leo Chang | 00708f6 | 2013-12-03 20:21:51 -0800 | [diff] [blame] | 508 | |
Pradeep Kumar Goudagunta | 22d8e4d | 2014-07-17 15:03:51 +0530 | [diff] [blame] | 509 | /*--------------------------------------------------------------------------- |
| 510 | wpalIsSsrPanicOnFailure - calls vos API isSsrPanicOnFailure() |
| 511 | |
| 512 | Param: |
| 513 | NONE |
| 514 | Return: |
| 515 | STATUS |
| 516 | ---------------------------------------------------------------------------*/ |
| 517 | int wpalIsSsrPanicOnFailure(void) |
| 518 | { |
| 519 | return isSsrPanicOnFailure(); |
| 520 | } |
| 521 | |
Katya Nigam | a6fbf66 | 2015-03-17 18:35:47 +0530 | [diff] [blame] | 522 | int wpalGetDxeReplenishRXTimerVal(void) |
| 523 | { |
| 524 | return vos_get_dxeReplenishRXTimerVal(); |
| 525 | } |
| 526 | |
| 527 | int wpalIsDxeSSREnable(void) |
| 528 | { |
| 529 | return vos_get_dxeSSREnable(); |
| 530 | } |
| 531 | |