Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1 | /* |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame^] | 2 | * Copyright (c) 2012, The Linux Foundation. All rights reserved. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [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. |
| 20 | */ |
| 21 | |
| 22 | /*============================================================================ |
| 23 | Copyright (c) 2007 QUALCOMM Incorporated. |
| 24 | All Rights Reserved. |
| 25 | Qualcomm Confidential and Proprietary |
| 26 | csrLogDump.c |
| 27 | Implements the dump commands specific to the csr module. |
| 28 | ============================================================================*/ |
| 29 | #include "aniGlobal.h" |
| 30 | #include "csrApi.h" |
| 31 | #include "btcApi.h" |
| 32 | #include "logDump.h" |
| 33 | #include "smsDebug.h" |
| 34 | #include "smeInside.h" |
| 35 | #include "csrInsideApi.h" |
| 36 | #if defined(ANI_LOGDUMP) |
| 37 | static char * |
| 38 | dump_csr( tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p ) |
| 39 | { |
| 40 | static tCsrRoamProfile x; |
| 41 | static tSirMacSSid ssid; //To be allocated for array of SSIDs |
| 42 | static tANI_U8 sessionId = 0; // Defined for fixed session ID |
| 43 | palZeroMemory(pMac->hHdd, (void*)&x, sizeof(x)); |
| 44 | x.SSIDs.numOfSSIDs=1 ; |
| 45 | x.SSIDs.SSIDList[0].SSID = ssid ; |
| 46 | ssid.length=6 ; |
| 47 | palCopyMemory(pMac->hHdd, ssid.ssId, "AniNet", 6); |
| 48 | if(HAL_STATUS_SUCCESS(sme_AcquireGlobalLock( &pMac->sme ))) |
| 49 | { |
| 50 | (void)csrRoamConnect(pMac, sessionId, &x, NULL, NULL); |
| 51 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 52 | } |
| 53 | return p; |
| 54 | } |
| 55 | static char *dump_btcSetEvent( tpAniSirGlobal pMac, tANI_U32 arg1, |
| 56 | tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p ) |
| 57 | { |
| 58 | tSmeBtEvent btEvent; |
| 59 | if( arg1 < BT_EVENT_TYPE_MAX ) |
| 60 | { |
| 61 | smsLog(pMac, LOGE, FL(" signal BT event (%d) handle (%d) 3rd param(%d)\n"), arg1, arg2, arg3); |
| 62 | vos_mem_zero(&btEvent, sizeof(tSmeBtEvent)); |
| 63 | btEvent.btEventType = arg1; |
| 64 | switch( arg1 ) |
| 65 | { |
| 66 | case BT_EVENT_SYNC_CONNECTION_COMPLETE: |
| 67 | case BT_EVENT_SYNC_CONNECTION_UPDATED: |
| 68 | btEvent.uEventParam.btSyncConnection.connectionHandle = (v_U16_t)arg2; |
| 69 | btEvent.uEventParam.btSyncConnection.status = (v_U8_t)arg3; |
| 70 | break; |
| 71 | case BT_EVENT_DISCONNECTION_COMPLETE: |
| 72 | btEvent.uEventParam.btDisconnect.connectionHandle = (v_U16_t)arg2; |
| 73 | break; |
| 74 | case BT_EVENT_CREATE_ACL_CONNECTION: |
| 75 | case BT_EVENT_ACL_CONNECTION_COMPLETE: |
| 76 | btEvent.uEventParam.btAclConnection.connectionHandle = (v_U16_t)arg2; |
| 77 | btEvent.uEventParam.btAclConnection.status = (v_U8_t)arg3; |
| 78 | break; |
| 79 | case BT_EVENT_MODE_CHANGED: |
| 80 | btEvent.uEventParam.btAclModeChange.connectionHandle = (v_U16_t)arg2; |
| 81 | break; |
| 82 | default: |
| 83 | break; |
| 84 | } |
| 85 | #ifndef WLAN_MDM_CODE_REDUCTION_OPT |
| 86 | if(HAL_STATUS_SUCCESS(sme_AcquireGlobalLock( &pMac->sme ))) |
| 87 | { |
| 88 | btcSignalBTEvent(pMac, &btEvent); |
| 89 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 90 | } |
| 91 | #endif |
| 92 | } |
| 93 | else |
| 94 | { |
| 95 | smsLog(pMac, LOGE, FL(" invalid event (%d)\n"), arg1); |
| 96 | } |
| 97 | return p; |
| 98 | } |
| 99 | |
| 100 | static tDumpFuncEntry csrMenuDumpTable[] = { |
| 101 | {0, "CSR (850-860)", NULL}, |
| 102 | {851, "CSR: CSR testing connection to AniNet", dump_csr}, |
| 103 | {852, "BTC: Fake BT events (event, handle)", dump_btcSetEvent}, |
| 104 | }; |
| 105 | |
| 106 | void csrDumpInit(tHalHandle hHal) |
| 107 | { |
| 108 | logDumpRegisterTable( (tpAniSirGlobal)hHal, &csrMenuDumpTable[0], |
| 109 | sizeof(csrMenuDumpTable)/sizeof(csrMenuDumpTable[0]) ); |
| 110 | } |
| 111 | |
| 112 | #endif //#if defined(ANI_LOGDUMP) |