diff options
| author | Akash Patel <akashp@codeaurora.org> | 2014-02-21 01:48:04 -0800 |
|---|---|---|
| committer | Akash Patel <akashp@codeaurora.org> | 2014-02-21 02:06:48 -0800 |
| commit | aefdfac503172a79ef2e35f772cdcf8784662947 (patch) | |
| tree | c65db27baddf3de78f4c4f52d9dcd66c142b9701 /CORE/BAP/src | |
| parent | aa57f24c536606920cf9d1d17facd60f9f0ef4f3 (diff) | |
| parent | 455a1583e7ee80a0d3741bd3ef31195f1359afe1 (diff) | |
Merge remote-tracking branch 'origin/caf/caf-wlan/master'
Release 1.0.0.40 QCACLD WLAN DRIVER
Change-Id: Icdff9678ec419817fb5996873e1a1b73e07bcdf3
* origin/caf/caf-wlan/master:
cafstaging Release 1.0.0.40
qcalcd: Fix of double fre panic in SLUB builds
qcacld: Fail to suspend when host has pending commands in cfg80211 suspend
qcacld: CORE/BAP cleanfile
qcacld: CL 842584 - update fw common interface files
qcacld: txrx: support rx forward switch for intra-bss
qcacld: Update host-side FW debug logs
qcacld: Add the memory corruption fix to SSR routine
Fix cnss-diag for file based logging.
qcacld: csr: Fix frame size warning
qcacld: hdd: Add channel 144 support
wlan: set short GI for fixed rate mcast
MAC: Avoid host requesting NOA if scanoffload is enabled.
qcacld: ini: ipa: Disable IPA-RM in ini
qcacld: Enable dbglog for EBT
qcacld: voss: Validate 5G channel power list
Diffstat (limited to 'CORE/BAP/src')
34 files changed, 4158 insertions, 4202 deletions
diff --git a/CORE/BAP/src/bapApiData.c b/CORE/BAP/src/bapApiData.c index f9249a4a0f70..5817253c7db7 100644 --- a/CORE/BAP/src/bapApiData.c +++ b/CORE/BAP/src/bapApiData.c @@ -28,16 +28,16 @@ /*=========================================================================== b a p A p i D a t a . C - + OVERVIEW: - + This software unit holds the implementation of the WLAN BAP modules "platform independent" Data path functions. - - The functions externalized by this module are to be called ONLY by other + + The functions externalized by this module are to be called ONLY by other WLAN modules (HDD) that properly register with the BAP Layer initially. - DEPENDENCIES: + DEPENDENCIES: Are listed for each API below. ===========================================================================*/ @@ -70,9 +70,9 @@ #include "wlan_qct_hal.h" -/* BT-AMP PAL API header file */ -#include "bapApi.h" -#include "bapInternal.h" +/* BT-AMP PAL API header file */ +#include "bapApi.h" +#include "bapInternal.h" #include "bapApiTimer.h" //#define BAP_DEBUG @@ -87,7 +87,7 @@ /*LLC header definitions*/ /* Length of the LLC header*/ -#define WLANBAP_LLC_HEADER_LEN 8 +#define WLANBAP_LLC_HEADER_LEN 8 #if 0 /*Offset of the OUI field inside the LLC/SNAP header*/ #define WLANBAP_LLC_OUI_OFFSET 3 @@ -167,7 +167,7 @@ static v_U8_t WLANBAP_LLC_HEADER[] = {0xAA, 0xAA, 0x03, 0x00, 0x00, 0x00 }; // Don't we have this type defined somewhere? #if 0 /* 802.3 header */ -typedef struct +typedef struct { /* Destination address field */ v_U8_t vDA[VOS_MAC_ADDR_SIZE]; @@ -196,17 +196,17 @@ typedef struct * ~ ~ * +--------+---------+--------+--------+ * - * NB: + * NB: * This is in little-endian * 1) phy_link_handle is the first 8 bits - * 2) log_link_handle is the next 4 bits + * 2) log_link_handle is the next 4 bits * 3) PB flag is the next 2 bits * 4) BC flags is the next 2 bits * 5) Total length of the data field is the next 16 bits * */ -typedef struct +typedef struct { #ifndef BAP_LITTLE_BIT_ENDIAN @@ -262,45 +262,45 @@ typedef struct FUNCTION WLANBAP_XlateTxDataPkt - DESCRIPTION + DESCRIPTION - HDD will call this API when it has a HCI Data Packet and it wants + HDD will call this API when it has a HCI Data Packet and it wants to translate it into a 802.3 LLC frame - ready to send using TL. - PARAMETERS + PARAMETERS btampHandle: The BT-AMP PAL handle returned in WLANBAP_GetNewHndl. - phy_link_handle: Used by BAP to indentify the WLAN assoc. (StaId) + phy_link_handle: Used by BAP to indentify the WLAN assoc. (StaId) - pucAC: Pointer to return the access category - vosDataBuff: The data buffer containing the BT-AMP packet to be + pucAC: Pointer to return the access category + vosDataBuff: The data buffer containing the BT-AMP packet to be translated to an 802.3 LLC frame tlMetaInfo: return meta info gleaned from the outgoing frame, here. - + RETURN VALUE - The result code associated with performing the operation + The result code associated with performing the operation + + VOS_STATUS_E_INVAL: Input parameters are invalid + VOS_STATUS_E_FAULT: BAP handle is NULL + VOS_STATUS_SUCCESS: Everything is good :) - VOS_STATUS_E_INVAL: Input parameters are invalid - VOS_STATUS_E_FAULT: BAP handle is NULL - VOS_STATUS_SUCCESS: Everything is good :) + SIDE EFFECTS - SIDE EFFECTS - ============================================================================*/ VOS_STATUS WLANBAP_XlateTxDataPkt -( +( ptBtampHandle btampHandle, /* Used by BAP to identify the actual session - and therefore addresses */ + and therefore addresses */ v_U8_t phy_link_handle, /* Used by BAP to indentify the WLAN assoc. (StaId) */ WLANTL_ACEnumType *pucAC, /* Return the AC here */ WLANTL_MetaInfoType *tlMetaInfo, /* Return the MetaInfo here. An assist to WLANBAP_STAFetchPktCBType */ vos_pkt_t *vosDataBuff ) { - ptBtampContext pBtampCtx = (ptBtampContext) btampHandle; + ptBtampContext pBtampCtx = (ptBtampContext) btampHandle; tpBtampLogLinkCtx pLogLinkContext; WLANBAP_8023HeaderType w8023Header; WLANBAP_HCIACLHeaderType hciACLHeader = { 0 }; @@ -313,22 +313,22 @@ WLANBAP_XlateTxDataPkt uintptr_t value = 0; /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ - + /*------------------------------------------------------------------------ Sanity check params ------------------------------------------------------------------------*/ - if ( NULL == pBtampCtx) + if ( NULL == pBtampCtx) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "Invalid BAP handle value in %s", __func__); return VOS_STATUS_E_FAULT; } - // Here, I have to make the assumption that this is an - // HCI ACL Data packet that I am being handed. + // Here, I have to make the assumption that this is an + // HCI ACL Data packet that I am being handed. vosStatus = vos_pkt_pop_head( vosDataBuff, &hciACLHeader, WLANBAP_HCI_ACL_HEADER_LEN); - if ( VOS_STATUS_SUCCESS != vosStatus ) + if ( VOS_STATUS_SUCCESS != vosStatus ) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "WLAN BAP: Failed to pop HCI ACL header from packet %d", @@ -337,10 +337,10 @@ WLANBAP_XlateTxDataPkt return vosStatus; } - // JEZ081003: Remove this after debugging - // Sanity check the phy_link_handle value + // JEZ081003: Remove this after debugging + // Sanity check the phy_link_handle value - if ( phy_link_handle != hciACLHeader.phyLinkHandle ) + if ( phy_link_handle != hciACLHeader.phyLinkHandle ) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "WLAN BAP: phy_link_handle mismatch in %s phy_link_handle=%d hciACLHeader.phyLinkHandle=%d", @@ -349,26 +349,26 @@ WLANBAP_XlateTxDataPkt } - /* Lookup the StaId using the phy_link_handle and the BAP context */ + /* Lookup the StaId using the phy_link_handle and the BAP context */ - vosStatus = WLANBAP_GetStaIdFromLinkCtx ( - btampHandle, /* btampHandle value in */ + vosStatus = WLANBAP_GetStaIdFromLinkCtx ( + btampHandle, /* btampHandle value in */ phy_link_handle, /* phy_link_handle value in */ &ucSTAId, /* The StaId (used by TL, PE, and HAL) */ &pHddHdl); /* Handle to return BSL context */ - if ( VOS_STATUS_SUCCESS != vosStatus ) + if ( VOS_STATUS_SUCCESS != vosStatus ) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO, "Unable to retrieve STA Id from BAP context and phy_link_handle in %s", __func__); return VOS_STATUS_E_FAULT; } - // JEZ081003: Remove this after debugging - // Sanity check the log_link_handle value + // JEZ081003: Remove this after debugging + // Sanity check the log_link_handle value if (!BTAMP_VALID_LOG_LINK( hciACLHeader.logLinkHandle)) { - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, - "WLAN BAP: Invalid logical link handle (%d) in %s. Corrected.", + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, + "WLAN BAP: Invalid logical link handle (%d) in %s. Corrected.", hciACLHeader.logLinkHandle, __func__); @@ -377,16 +377,16 @@ WLANBAP_XlateTxDataPkt //return VOS_STATUS_E_INVAL; } - /* Use the log_link_handle to retrieve the logical link context */ - /* JEZ081006: abstract this with a proc. So you can change the impl later */ + /* Use the log_link_handle to retrieve the logical link context */ + /* JEZ081006: abstract this with a proc. So you can change the impl later */ pLogLinkContext = &(pBtampCtx->btampLogLinkCtx[ hciACLHeader.logLinkHandle ]); - // JEZ081003: Remove this after debugging - // Sanity check the log_link_handle value - // JEZ081113: I changed this to fail on an UNOCCUPIED entry + // JEZ081003: Remove this after debugging + // Sanity check the log_link_handle value + // JEZ081113: I changed this to fail on an UNOCCUPIED entry if ( pLogLinkContext->present != VOS_TRUE) { - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "WLAN BAP: Invalid logical link entry in %s", __func__); @@ -397,7 +397,7 @@ WLANBAP_XlateTxDataPkt // Now copy the AC values from the Logical Link context *pucAC = pLogLinkContext->btampAC; - // Now copy the values from the Logical Link context to the MetaInfo + // Now copy the values from the Logical Link context to the MetaInfo tlMetaInfo->ucTID = pLogLinkContext->ucTID; tlMetaInfo->ucUP = pLogLinkContext->ucUP; tlMetaInfo->ucIsEapol = VOS_FALSE; @@ -411,10 +411,10 @@ WLANBAP_XlateTxDataPkt vos_mem_copy( w8023Header.vDA, pBtampCtx->peer_mac_addr, VOS_MAC_ADDR_SIZE); vos_mem_copy( w8023Header.vSA, pBtampCtx->self_mac_addr, VOS_MAC_ADDR_SIZE); - + /* Now this length passed down in HCI...is in little-endian */ - headerLength = vos_le16_to_cpu(hciACLHeader.dataLength); - headerLength += WLANBAP_LLC_HEADER_LEN; + headerLength = vos_le16_to_cpu(hciACLHeader.dataLength); + headerLength += WLANBAP_LLC_HEADER_LEN; /* Now the 802.3 length field is big-endian?! */ w8023Header.usLenType = vos_cpu_to_be16(headerLength); @@ -422,26 +422,26 @@ WLANBAP_XlateTxDataPkt protoType = vos_cpu_to_be16( protoType); /* Now form the LLC header */ - vos_mem_copy(aucLLCHeader, - WLANBAP_LLC_HEADER, + vos_mem_copy(aucLLCHeader, + WLANBAP_LLC_HEADER, sizeof(WLANBAP_LLC_HEADER)); - vos_mem_copy(&aucLLCHeader[WLANBAP_LLC_OUI_OFFSET], - WLANBAP_BT_AMP_OUI, + vos_mem_copy(&aucLLCHeader[WLANBAP_LLC_OUI_OFFSET], + WLANBAP_BT_AMP_OUI, WLANBAP_LLC_OUI_SIZE); - vos_mem_copy(&aucLLCHeader[WLANBAP_LLC_PROTO_TYPE_OFFSET], + vos_mem_copy(&aucLLCHeader[WLANBAP_LLC_PROTO_TYPE_OFFSET], &protoType, //WLANBAP_BT_AMP_TYPE_DATA WLANBAP_LLC_PROTO_TYPE_SIZE); - + /* Push on the LLC header */ - vos_pkt_push_head(vosDataBuff, - aucLLCHeader, - WLANBAP_LLC_HEADER_LEN); + vos_pkt_push_head(vosDataBuff, + aucLLCHeader, + WLANBAP_LLC_HEADER_LEN); /* Push on the 802.3 header */ vos_pkt_push_head(vosDataBuff, &w8023Header, sizeof(w8023Header)); - /*Set the logical link handle as user data so that we can retrieve it on + /*Set the logical link handle as user data so that we can retrieve it on Tx Complete */ value = (uintptr_t)hciACLHeader.logLinkHandle; vos_pkt_set_user_data_ptr( vosDataBuff, VOS_PKT_USER_DATA_ID_BAP, @@ -454,42 +454,42 @@ WLANBAP_XlateTxDataPkt FUNCTION WLANBAP_GetAcFromTxDataPkt - DESCRIPTION + DESCRIPTION - HDD will call this API when it has a HCI Data Packet (SKB) and it wants + HDD will call this API when it has a HCI Data Packet (SKB) and it wants to find AC type of the data frame from the HCI header on the data pkt - to be send using TL. - PARAMETERS + PARAMETERS btampHandle: The BT-AMP PAL handle returned in WLANBAP_GetNewHndl. - + pHciData: Pointer to the HCI data frame - - pucAC: Pointer to return the access category - + + pucAC: Pointer to return the access category + RETURN VALUE - The result code associated with performing the operation + The result code associated with performing the operation + + VOS_STATUS_E_INVAL: Input parameters are invalid + VOS_STATUS_E_FAULT: BAP handle is NULL + VOS_STATUS_SUCCESS: Everything is good :) - VOS_STATUS_E_INVAL: Input parameters are invalid - VOS_STATUS_E_FAULT: BAP handle is NULL - VOS_STATUS_SUCCESS: Everything is good :) + SIDE EFFECTS - SIDE EFFECTS - ============================================================================*/ VOS_STATUS WLANBAP_GetAcFromTxDataPkt -( +( ptBtampHandle btampHandle, /* Used by BAP to identify the actual session and therefore addresses */ void *pHciData, /* Pointer to the HCI data frame */ WLANTL_ACEnumType *pucAC /* Return the AC here */ ) { - ptBtampContext pBtampCtx; + ptBtampContext pBtampCtx; tpBtampLogLinkCtx pLogLinkContext; WLANBAP_HCIACLHeaderType hciACLHeader; /*------------------------------------------------------------------------ @@ -504,26 +504,26 @@ WLANBAP_GetAcFromTxDataPkt pBtampCtx = (ptBtampContext) btampHandle; vos_mem_copy( &hciACLHeader, pHciData, WLANBAP_HCI_ACL_HEADER_LEN); - // Sanity check the log_link_handle value + // Sanity check the log_link_handle value if (!BTAMP_VALID_LOG_LINK( hciACLHeader.logLinkHandle)) { - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, - "WLAN BAP: Invalid logical link handle (%d) in %s", + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, + "WLAN BAP: Invalid logical link handle (%d) in %s", hciACLHeader.logLinkHandle, __func__); return VOS_STATUS_E_INVAL; } - /* Use the log_link_handle to retrieve the logical link context */ - /* JEZ081006: abstract this with a proc. So you can change the impl later */ + /* Use the log_link_handle to retrieve the logical link context */ + /* JEZ081006: abstract this with a proc. So you can change the impl later */ pLogLinkContext = &(pBtampCtx->btampLogLinkCtx[ hciACLHeader.logLinkHandle ]); - // Sanity check the log_link_handle value - // JEZ081113: I changed this to fail on an UNOCCUPIED entry + // Sanity check the log_link_handle value + // JEZ081113: I changed this to fail on an UNOCCUPIED entry if ( pLogLinkContext->present != VOS_TRUE) { - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "WLAN BAP: Invalid logical link entry in %s", __func__); @@ -542,35 +542,35 @@ WLANBAP_GetAcFromTxDataPkt FUNCTION WLANBAP_XlateRxDataPkt - DESCRIPTION + DESCRIPTION - HDD will call this API when it has received a 802.3 (TL/UMA has - Xlated from 802.11) frame from TL and it wants to form a + HDD will call this API when it has received a 802.3 (TL/UMA has + Xlated from 802.11) frame from TL and it wants to form a BT HCI Data Packet - ready to signal up to the BT stack application. - PARAMETERS + PARAMETERS btampHandle: The BT-AMP PAL handle returned in WLANBAP_GetNewHndl. - pucAC: Pointer to return the access category - vosDataBuff: The data buffer containing the 802.3 frame to be + pucAC: Pointer to return the access category + vosDataBuff: The data buffer containing the 802.3 frame to be translated to BT HCI Data Packet - + RETURN VALUE - The result code associated with performing the operation + The result code associated with performing the operation + + VOS_STATUS_E_INVAL: Input parameters are invalid + VOS_STATUS_E_FAULT: BAP handle is NULL + VOS_STATUS_SUCCESS: Everything is good :) - VOS_STATUS_E_INVAL: Input parameters are invalid - VOS_STATUS_E_FAULT: BAP handle is NULL - VOS_STATUS_SUCCESS: Everything is good :) + SIDE EFFECTS - SIDE EFFECTS - ============================================================================*/ VOS_STATUS WLANBAP_XlateRxDataPkt -( - ptBtampHandle btampHandle, +( + ptBtampHandle btampHandle, v_U8_t phy_link_handle, /* Used by BAP to indentify the WLAN assoc. (StaId) */ WLANTL_ACEnumType *pucAC, /* Return the AC here. I don't think this is needed */ vos_pkt_t *vosDataBuff @@ -579,7 +579,7 @@ WLANBAP_XlateRxDataPkt WLANBAP_8023HeaderType w8023Header; WLANBAP_HCIACLHeaderType hciACLHeader; v_U8_t aucLLCHeader[WLANBAP_LLC_HEADER_LEN]; - ptBtampContext pBtampCtx = (ptBtampContext) btampHandle; + ptBtampContext pBtampCtx = (ptBtampContext) btampHandle; VOS_STATUS vosStatus; //v_PVOID_t pHddHdl; /* Handle to return BSL context in */ v_U16_t hciDataLength; /* The HCI packet data length*/ @@ -589,19 +589,19 @@ WLANBAP_XlateRxDataPkt /*------------------------------------------------------------------------ Sanity check params ------------------------------------------------------------------------*/ - if ( NULL == pBtampCtx) + if ( NULL == pBtampCtx) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "Invalid BAP handle value in %s", __func__); return VOS_STATUS_E_FAULT; } - // Here, I have to make the assumption that this is an - // 802.3 header followed by an LLC/SNAP packet. + // Here, I have to make the assumption that this is an + // 802.3 header followed by an LLC/SNAP packet. vos_mem_set( &w8023Header, sizeof(w8023Header), 0 ); vosStatus = vos_pkt_pop_head( vosDataBuff, &w8023Header, sizeof(w8023Header)); - if ( VOS_STATUS_SUCCESS != vosStatus ) + if ( VOS_STATUS_SUCCESS != vosStatus ) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "WLAN BAP: Failed to pop 802.3 header from packet %d", @@ -610,12 +610,12 @@ WLANBAP_XlateRxDataPkt return vosStatus; } - // Here, is that LLC/SNAP header. - // With the BT SIG OUI that I am being handed. + // Here, is that LLC/SNAP header. + // With the BT SIG OUI that I am being handed. vos_mem_set( aucLLCHeader, WLANBAP_LLC_HEADER_LEN, 0 ); vosStatus = vos_pkt_pop_head( vosDataBuff, aucLLCHeader, WLANBAP_LLC_HEADER_LEN); - if ( VOS_STATUS_SUCCESS != vosStatus ) + if ( VOS_STATUS_SUCCESS != vosStatus ) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "WLAN BAP: Failed to pop LLC/SNAP header from packet %d", @@ -625,15 +625,15 @@ WLANBAP_XlateRxDataPkt } #ifdef BAP_DEBUG - // JEZ081003: Remove this after debugging + // JEZ081003: Remove this after debugging // Should I double check that I am getting the BT SIG OUI ? - if ( !(vos_mem_compare( aucLLCHeader, - WLANBAP_LLC_HEADER, - sizeof(WLANBAP_LLC_HEADER) - - WLANBAP_LLC_OUI_SIZE) /* Don't check the last three bytes here */ - && vos_mem_compare( &aucLLCHeader[WLANBAP_LLC_OUI_OFFSET], - (v_VOID_t*)WLANBAP_BT_AMP_OUI, - WLANBAP_LLC_OUI_SIZE))) /* check them here */ + if ( !(vos_mem_compare( aucLLCHeader, + WLANBAP_LLC_HEADER, + sizeof(WLANBAP_LLC_HEADER) + - WLANBAP_LLC_OUI_SIZE) /* Don't check the last three bytes here */ + && vos_mem_compare( &aucLLCHeader[WLANBAP_LLC_OUI_OFFSET], + (v_VOID_t*)WLANBAP_BT_AMP_OUI, + WLANBAP_LLC_OUI_SIZE))) /* check them here */ { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, @@ -646,11 +646,11 @@ WLANBAP_XlateRxDataPkt protoType = vos_cpu_to_be16( protoType); // check if this is a data frame or other, internal to BAP, type... // we are only handling data frames in here... - // The others (Security and AR) are handled by TLs BAP client API. + // The others (Security and AR) are handled by TLs BAP client API. // (Verify with TL) - if ( !(vos_mem_compare( &aucLLCHeader[WLANBAP_LLC_PROTO_TYPE_OFFSET], + if ( !(vos_mem_compare( &aucLLCHeader[WLANBAP_LLC_PROTO_TYPE_OFFSET], &protoType, //WLANBAP_BT_AMP_TYPE_DATA - WLANBAP_LLC_PROTO_TYPE_SIZE))) + WLANBAP_LLC_PROTO_TYPE_SIZE))) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, @@ -659,13 +659,13 @@ WLANBAP_XlateRxDataPkt } #ifdef BAP_DEBUG - // JEZ081003: Remove this after debugging + // JEZ081003: Remove this after debugging /*------------------------------------------------------------------------ - Sanity check the MAC address in the physical link context + Sanity check the MAC address in the physical link context against the value in the incoming Rx Frame. ------------------------------------------------------------------------*/ if ( !(vos_mem_compare( w8023Header.vDA, pBtampCtx->self_mac_addr, VOS_MAC_ADDR_SIZE) - && vos_mem_compare( w8023Header.vSA, pBtampCtx->peer_mac_addr, VOS_MAC_ADDR_SIZE))) + && vos_mem_compare( w8023Header.vSA, pBtampCtx->peer_mac_addr, VOS_MAC_ADDR_SIZE))) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, @@ -674,16 +674,16 @@ WLANBAP_XlateRxDataPkt } #endif //BAP_DEBUG - /* No lookup is needed. Because TL has already told WLANBAP_STARxCB - * the StaId. And I told WLANBAP_STARxCBType the corresponding BSL context - * Which he used to lookup the phy_link_handle value. - */ + /* No lookup is needed. Because TL has already told WLANBAP_STARxCB + * the StaId. And I told WLANBAP_STARxCBType the corresponding BSL context + * Which he used to lookup the phy_link_handle value. + */ - // Start filling in the HCI header + // Start filling in the HCI header hciACLHeader.phyLinkHandle = phy_link_handle; - // Continue filling in the HCI header + // Continue filling in the HCI header //JEZ100913: On Rx the Logical Link is ALWAYS 0. See Vol 2, Sec E, 5.4.2 of spec. hciACLHeader.logLinkHandle = 0; hciACLHeader.PBFlag = WLANBAP_HCI_PKT_AMP; @@ -694,12 +694,12 @@ WLANBAP_XlateRxDataPkt /* Max length WLANBAP_MAX_80211_PAL_PDU_SIZE (1492) */ hciDataLength -= WLANBAP_LLC_HEADER_LEN; /* The HCI packet data length is Little-endian */ - hciACLHeader.dataLength = vos_cpu_to_le16(hciDataLength); + hciACLHeader.dataLength = vos_cpu_to_le16(hciDataLength); - /* Return the AC here. + /* Return the AC here. * (I can't because there is no way to figure out what it is.) */ - *pucAC = 0; + *pucAC = 0; /* Push on the HCI header */ vos_pkt_push_head(vosDataBuff, &hciACLHeader, WLANBAP_HCI_ACL_HEADER_LEN); @@ -709,46 +709,46 @@ WLANBAP_XlateRxDataPkt /*---------------------------------------------------------------------------- - FUNCTION WLANBAP_STAFetchPktCB + FUNCTION WLANBAP_STAFetchPktCB - DESCRIPTION - The fetch packet callback registered with TL. - - It is called by the TL when the scheduling algorithms allows for - transmission of another packet to the module. - It will be called in the context of the BAL fetch transmit packet - function, initiated by the bus lower layer. + DESCRIPTION + The fetch packet callback registered with TL. + + It is called by the TL when the scheduling algorithms allows for + transmission of another packet to the module. + It will be called in the context of the BAL fetch transmit packet + function, initiated by the bus lower layer. - PARAMETERS + PARAMETERS IN - pvosGCtx: pointer to the global vos context; a handle - to TL's or HDD's control block can be extracted - from its context + pvosGCtx: pointer to the global vos context; a handle + to TL's or HDD's control block can be extracted + from its context IN/OUT - pucSTAId: the Id of the station for which TL is requesting a - packet, in case HDD does not maintain per station - queues it can give the next packet in its queue - and put in the right value for the - pucAC: access category requested by TL, if HDD does not have - packets on this AC it can choose to service another AC + pucSTAId: the Id of the station for which TL is requesting a + packet, in case HDD does not maintain per station + queues it can give the next packet in its queue + and put in the right value for the + pucAC: access category requested by TL, if HDD does not have + packets on this AC it can choose to service another AC queue in the order of priority OUT - vosDataBuff: pointer to the VOSS data buffer that was transmitted + vosDataBuff: pointer to the VOSS data buffer that was transmitted tlMetaInfo: meta info related to the data frame - - RETURN VALUE + + RETURN VALUE The result code associated with performing the operation ----------------------------------------------------------------------------*/ -VOS_STATUS -WLANBAP_STAFetchPktCB -( +VOS_STATUS +WLANBAP_STAFetchPktCB +( v_PVOID_t pvosGCtx, v_U8_t* pucSTAId, v_U8_t ucAC, @@ -756,32 +756,32 @@ WLANBAP_STAFetchPktCB WLANTL_MetaInfoType* tlMetaInfo ) { - VOS_STATUS vosStatus; - ptBtampHandle bapHdl; /* holds ptBtampHandle value returned */ - ptBtampContext bapContext; /* Holds the btampContext value returned */ + VOS_STATUS vosStatus; + ptBtampHandle bapHdl; /* holds ptBtampHandle value returned */ + ptBtampContext bapContext; /* Holds the btampContext value returned */ v_PVOID_t pHddHdl; /* Handle to return BSL context in */ - /* Lookup the BSL and BAP contexts using the StaId */ + /* Lookup the BSL and BAP contexts using the StaId */ - vosStatus = WLANBAP_GetCtxFromStaId ( + vosStatus = WLANBAP_GetCtxFromStaId ( *pucSTAId, /* The StaId (used by TL, PE, and HAL) */ - &bapHdl, /* "handle" to return ptBtampHandle value in */ - &bapContext, /* "handle" to return ptBtampContext value in */ + &bapHdl, /* "handle" to return ptBtampHandle value in */ + &bapContext, /* "handle" to return ptBtampContext value in */ &pHddHdl); /* "handle" to return BSL context in */ - if ( VOS_STATUS_SUCCESS != vosStatus ) + if ( VOS_STATUS_SUCCESS != vosStatus ) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO, "Unable to retrieve BSL or BAP context from STA Id in WLANBAP_STAFetchPktCB"); return VOS_STATUS_E_FAULT; } - /* Invoke the callback that BSL registered with me */ - vosStatus = (*bapContext->pfnBtampFetchPktCB)( - pHddHdl, - (WLANTL_ACEnumType) ucAC, /* typecast it for now */ - vosDataBuff, - tlMetaInfo); - if ( VOS_STATUS_SUCCESS != vosStatus ) + /* Invoke the callback that BSL registered with me */ + vosStatus = (*bapContext->pfnBtampFetchPktCB)( + pHddHdl, + (WLANTL_ACEnumType) ucAC, /* typecast it for now */ + vosDataBuff, + tlMetaInfo); + if ( VOS_STATUS_SUCCESS != vosStatus ) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO, "Callback registered by BSL failed to fetch pkt in WLANNBAP_STAFetchPktCB"); @@ -789,64 +789,64 @@ WLANBAP_STAFetchPktCB } return vosStatus; -} /* WLANBAP_STAFetchPktCB */ +} /* WLANBAP_STAFetchPktCB */ #ifndef QCA_WIFI_2_0 /*---------------------------------------------------------------------------- FUNCTION WLANBAP_STARxCB - DESCRIPTION - The receive callback registered with TL. - - TL will call this to notify the client when a packet was received + DESCRIPTION + The receive callback registered with TL. + + TL will call this to notify the client when a packet was received for a registered STA. - PARAMETERS + PARAMETERS IN - pvosGCtx: pointer to the global vos context; a handle to - TL's or HDD's control block can be extracted from - its context + pvosGCtx: pointer to the global vos context; a handle to + TL's or HDD's control block can be extracted from + its context vosDataBuff: pointer to the VOSS data buffer that was received - (it may be a linked list) + (it may be a linked list) ucSTAId: station id - pRxMetaInfo: meta info for the received packet(s) - - RETURN VALUE + pRxMetaInfo: meta info for the received packet(s) + + RETURN VALUE The result code associated with performing the operation ----------------------------------------------------------------------------*/ -VOS_STATUS +VOS_STATUS WLANBAP_STARxCB -( +( v_PVOID_t pvosGCtx, vos_pkt_t* vosDataBuff, v_U8_t ucSTAId, WLANTL_RxMetaInfoType* pRxMetaInfo ) { - VOS_STATUS vosStatus; - ptBtampHandle bapHdl; /* holds ptBtampHandle value returned */ - ptBtampContext bapContext; /* Holds the btampContext value returned */ + VOS_STATUS vosStatus; + ptBtampHandle bapHdl; /* holds ptBtampHandle value returned */ + ptBtampContext bapContext; /* Holds the btampContext value returned */ v_PVOID_t pHddHdl; /* Handle to return BSL context in */ ptBtampHandle btampHandle; WLANBAP_8023HeaderType w8023Header; v_U8_t aucLLCHeader[WLANBAP_LLC_HEADER_LEN]; v_U16_t protoType ; v_SIZE_t llcHeaderLen = WLANBAP_LLC_HEADER_LEN ; - + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO, "In WLANBAP_STARxCB"); - /* Lookup the BSL and BAP contexts using the StaId */ + /* Lookup the BSL and BAP contexts using the StaId */ - vosStatus = WLANBAP_GetCtxFromStaId ( + vosStatus = WLANBAP_GetCtxFromStaId ( ucSTAId, /* The StaId (used by TL, PE, and HAL) */ - &bapHdl, /* "handle" to return ptBtampHandle value in */ - &bapContext, /* "handle" to return ptBtampContext value in */ + &bapHdl, /* "handle" to return ptBtampHandle value in */ + &bapContext, /* "handle" to return ptBtampContext value in */ &pHddHdl); /* "handle" to return BSL context in */ - if ( VOS_STATUS_SUCCESS != vosStatus ) + if ( VOS_STATUS_SUCCESS != vosStatus ) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO, "Unable to retrieve BSL or BAP context from STA Id in WLANBAP_STARxCB"); @@ -867,24 +867,24 @@ WLANBAP_STARxCB vos_pkt_return_packet(vosDataBuff); return VOS_STATUS_E_FAULT; } - + vos_mem_copy(&protoType,&aucLLCHeader[WLANBAP_LLC_PROTO_TYPE_OFFSET],WLANBAP_LLC_PROTO_TYPE_SIZE); protoType = vos_be16_to_cpu(protoType); - + VOS_TRACE( VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_ERROR, "%s: received : %d, => BAP",__func__, protoType); - + if(WLANBAP_BT_AMP_TYPE_DATA == protoType) { if (bapContext->bapLinkSupervisionTimerInterval) { /* Reset Link Supervision timer */ - //vosStatus = WLANBAP_StopLinkSupervisionTimer(bapContext); + //vosStatus = WLANBAP_StopLinkSupervisionTimer(bapContext); //vosStatus = WLANBAP_StartLinkSupervisionTimer(bapContext,7000); - bapContext->dataPktPending = VOS_TRUE;//Indication for LinkSupervision module that data is pending - /* Invoke the callback that BSL registered with me */ - vosStatus = (*bapContext->pfnBtamp_STARxCB)( + bapContext->dataPktPending = VOS_TRUE;//Indication for LinkSupervision module that data is pending + /* Invoke the callback that BSL registered with me */ + vosStatus = (*bapContext->pfnBtamp_STARxCB)( pHddHdl, vosDataBuff, pRxMetaInfo); @@ -902,14 +902,14 @@ WLANBAP_STARxCB VOS_TRACE( VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_ERROR, "%s: link Supervision packet received over TL: %d, => BAP", __func__,protoType); - btampHandle = (ptBtampHandle)bapContext; + btampHandle = (ptBtampHandle)bapContext; vosStatus = WLANBAP_RxProcLsPkt( btampHandle, bapContext->phy_link_handle, protoType, vosDataBuff ); - } + } return vosStatus; } /* WLANBAP_STARxCB */ @@ -952,85 +952,85 @@ WLANBAP_STARxCB(v_PVOID_t pvosGCtx, FUNCTION WLANBAP_TxCompCB - DESCRIPTION - The tx complete callback registered with TL. - - TL will call this to notify the client when a transmission for a - packet has ended. + DESCRIPTION + The tx complete callback registered with TL. + + TL will call this to notify the client when a transmission for a + packet has ended. - PARAMETERS + PARAMETERS IN - pvosGCtx: pointer to the global vos context; a handle to - TL/HAL/PE/BAP/HDD control block can be extracted from - its context - vosDataBuff: pointer to the VOSS data buffer that was transmitted - wTxSTAtus: status of the transmission - - - RETURN VALUE + pvosGCtx: pointer to the global vos context; a handle to + TL/HAL/PE/BAP/HDD control block can be extracted from + its context + vosDataBuff: pointer to the VOSS data buffer that was transmitted + wTxSTAtus: status of the transmission + + + RETURN VALUE The result code associated with performing the operation ----------------------------------------------------------------------------*/ -VOS_STATUS +VOS_STATUS WLANBAP_TxCompCB -( +( v_PVOID_t pvosGCtx, vos_pkt_t* vosDataBuff, - VOS_STATUS wTxSTAtus + VOS_STATUS wTxSTAtus ) { VOS_STATUS vosStatus; ptBtampHandle bapHdl; /* holds ptBtampHandle value returned */ - ptBtampContext bapContext; /* Holds the btampContext value returned */ + ptBtampContext bapContext; /* Holds the btampContext value returned */ v_PVOID_t pHddHdl; /* Handle to return BSL context in */ v_PVOID_t pvlogLinkHandle = NULL; uintptr_t value; WLANBAP_HCIACLHeaderType hciACLHeader; - /* retrieve the BSL and BAP contexts */ + /* retrieve the BSL and BAP contexts */ /* I don't really know how to do this - in the general case. */ /* So, for now, I will just use something that works. */ /* (In general, I will have to keep a list of the outstanding transmit */ /* buffers, in order to determine which assoc they are with.) */ - //vosStatus = WLANBAP_GetCtxFromStaId ( + //vosStatus = WLANBAP_GetCtxFromStaId ( // ucSTAId, /* The StaId (used by TL, PE, and HAL) */ - // &bapHdl, /* "handle" to return ptBtampHandle value in */ - // &bapContext, /* "handle" to return ptBtampContext value in */ + // &bapHdl, /* "handle" to return ptBtampHandle value in */ + // &bapContext, /* "handle" to return ptBtampContext value in */ // &pHddHdl); /* "handle" to return BSL context in */ - /* Temporarily we do the following*/ + /* Temporarily we do the following*/ //bapHdl = &btampCtx; bapHdl = (v_PVOID_t)gpBtampCtx; - /* Typecast the handle into a context. Works as we have only one link*/ - bapContext = ((ptBtampContext) bapHdl); + /* Typecast the handle into a context. Works as we have only one link*/ + bapContext = ((ptBtampContext) bapHdl); /*------------------------------------------------------------------------ Sanity check params ------------------------------------------------------------------------*/ - if ( NULL == vosDataBuff) + if ( NULL == vosDataBuff) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "Invalid vosDataBuff value in %s", __func__); return VOS_STATUS_E_FAULT; } - if ( NULL == bapContext) + if ( NULL == bapContext) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "Invalid bapContext value in %s", __func__); - vos_pkt_return_packet( vosDataBuff ); + vos_pkt_return_packet( vosDataBuff ); return VOS_STATUS_E_FAULT; } pHddHdl = bapContext->pHddHdl; vosStatus = VOS_STATUS_SUCCESS; - if ( VOS_STATUS_SUCCESS != vosStatus ) + if ( VOS_STATUS_SUCCESS != vosStatus ) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO, "Unable to retrieve BSL or BAP context from STA Id in WLANBAP_TxCompCB"); - vos_pkt_return_packet( vosDataBuff ); + vos_pkt_return_packet( vosDataBuff ); return VOS_STATUS_E_FAULT; } @@ -1047,7 +1047,7 @@ WLANBAP_TxCompCB "WLAN BAP Context Monitor: bapContext value = %p in %s:%d. vosDataBuff=%p", bapContext, __func__, __LINE__, vosDataBuff ); #endif //BAP_DEBUG - // Sanity check the log_link_handle value + // Sanity check the log_link_handle value // JEZ100722: Temporary changes. if (BTAMP_VALID_LOG_LINK( hciACLHeader.logLinkHandle)) { @@ -1056,14 +1056,14 @@ WLANBAP_TxCompCB // &bapContext->btampLogLinkCtx[0].uTxPktCompleted); // vos_atomic_increment_U32( // &bapContext->btampLogLinkCtx[1].uTxPktCompleted); - } else + } else { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "In %s:%d: Invalid logical link handle: %d", __func__, __LINE__, hciACLHeader.logLinkHandle); } - /* Invoke the callback that BSL registered with me */ - vosStatus = (*bapContext->pfnBtampTxCompCB)( + /* Invoke the callback that BSL registered with me */ + vosStatus = (*bapContext->pfnBtampTxCompCB)( pHddHdl, vosDataBuff, wTxSTAtus); @@ -1075,52 +1075,52 @@ WLANBAP_TxCompCB FUNCTION WLANBAP_RegisterDataPlane - DESCRIPTION + DESCRIPTION The HDD calls this routine to register the "data plane" routines for Tx, Rx, and Tx complete with BT-AMP. For now, with only one - physical association supported at a time, this COULD be called + physical association supported at a time, this COULD be called by HDD at the same time as WLANBAP_GetNewHndl. But, in general it needs to be called upon each new physical link establishment. - + This registration is really two part. The routines themselves are registered here. But, the mapping between the BSL context and the - actual physical link takes place during WLANBAP_PhysicalLinkCreate. - - DEPENDENCIES - - PARAMETERS + actual physical link takes place during WLANBAP_PhysicalLinkCreate. + + DEPENDENCIES + + PARAMETERS IN btampHandle: The BT-AMP PAL handle returned in WLANBAP_GetNewHndl. - + RETURN VALUE - The result code associated with performing the operation + The result code associated with performing the operation - VOS_STATUS_E_FAULT: pointer to BAP cb is NULL ; access would cause a page - fault - VOS_STATUS_SUCCESS: Everything is good :) + VOS_STATUS_E_FAULT: pointer to BAP cb is NULL ; access would cause a page + fault + VOS_STATUS_SUCCESS: Everything is good :) + + SIDE EFFECTS - SIDE EFFECTS - ============================================================================*/ -VOS_STATUS +VOS_STATUS WLANBAP_RegisterDataPlane -( - ptBtampHandle btampHandle, /* BTAMP context */ - WLANBAP_STAFetchPktCBType pfnBtampFetchPktCB, +( + ptBtampHandle btampHandle, /* BTAMP context */ + WLANBAP_STAFetchPktCBType pfnBtampFetchPktCB, WLANBAP_STARxCBType pfnBtamp_STARxCB, WLANBAP_TxCompCBType pfnBtampTxCompCB, // phy_link_handle, of course, doesn't come until much later. At Physical Link create. v_PVOID_t pHddHdl /* BSL specific context */ ) { - ptBtampContext pBtampCtx = (ptBtampContext) btampHandle; + ptBtampContext pBtampCtx = (ptBtampContext) btampHandle; + - /*------------------------------------------------------------------------ Sanity check params ------------------------------------------------------------------------*/ - if ( NULL == pBtampCtx) + if ( NULL == pBtampCtx) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "Invalid BAP handle value in WLANBAP_RegisterDataPlane"); @@ -1128,13 +1128,13 @@ WLANBAP_RegisterDataPlane } // Include the HDD BAP Shim Layer callbacks for Fetch, TxComp, and RxPkt - pBtampCtx->pfnBtampFetchPktCB = pfnBtampFetchPktCB; + pBtampCtx->pfnBtampFetchPktCB = pfnBtampFetchPktCB; pBtampCtx->pfnBtamp_STARxCB = pfnBtamp_STARxCB; pBtampCtx->pfnBtampTxCompCB = pfnBtampTxCompCB; // (Right now, there is only one) pBtampCtx->pHddHdl = pHddHdl; - /* Set the default data transfer mode */ + /* Set the default data transfer mode */ pBtampCtx->ucDataTrafficMode = WLANBAP_FLOW_CONTROL_MODE_BLOCK_BASED; return VOS_STATUS_SUCCESS; @@ -1145,53 +1145,53 @@ WLANBAP_RegisterDataPlane FUNCTION WLANBAP_STAPktPending - DESCRIPTION + DESCRIPTION - HDD will call this API when a packet is pending transmission in its + HDD will call this API when a packet is pending transmission in its queues. HDD uses this instead of WLANTL_STAPktPending because he is not aware of the mapping from session to STA ID. - DEPENDENCIES + DEPENDENCIES HDD must have called WLANBAP_GetNewHndl before calling this API. - PARAMETERS + PARAMETERS btampHandle: The BT-AMP PAL handle returned in WLANBAP_GetNewHndl. BSL can obtain this from the physical handle value in the downgoing HCI Data Packet. He, after all, was there - when the PhysicalLink was created. He knew the btampHandle + when the PhysicalLink was created. He knew the btampHandle value returned by WLANBAP_GetNewHndl. He knows as well, his own pHddHdl (see next). phy_link_handle: Used by BAP to indentify the WLAN assoc. (StaId) ucAc: The access category for the pending frame - + RETURN VALUE - The result code associated with performing the operation + The result code associated with performing the operation + + VOS_STATUS_E_INVAL: Input parameters are invalid + VOS_STATUS_E_FAULT: BAP handle is NULL + VOS_STATUS_SUCCESS: Everything is good :) - VOS_STATUS_E_INVAL: Input parameters are invalid - VOS_STATUS_E_FAULT: BAP handle is NULL - VOS_STATUS_SUCCESS: Everything is good :) + SIDE EFFECTS - SIDE EFFECTS - ============================================================================*/ VOS_STATUS -WLANBAP_STAPktPending -( - ptBtampHandle btampHandle, /* Used by BAP to identify the app context and VOSS ctx (!?) */ +WLANBAP_STAPktPending +( + ptBtampHandle btampHandle, /* Used by BAP to identify the app context and VOSS ctx (!?) */ v_U8_t phy_link_handle, /* Used by BAP to indentify the WLAN assoc. (StaId) */ WLANTL_ACEnumType ucAc /* This is the first instance of a TL type in bapApi.h */ ) { - VOS_STATUS vosStatus; - ptBtampContext pBtampCtx = (ptBtampContext) btampHandle; + VOS_STATUS vosStatus; + ptBtampContext pBtampCtx = (ptBtampContext) btampHandle; v_PVOID_t pvosGCtx; v_U8_t ucSTAId; /* The StaId (used by TL, PE, and HAL) */ v_PVOID_t pHddHdl; /* Handle to return BSL context in */ - + #ifdef BAP_DEBUG /* Trace the tBtampCtx being passed in. */ VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, @@ -1201,24 +1201,24 @@ WLANBAP_STAPktPending /*------------------------------------------------------------------------ Sanity check params ------------------------------------------------------------------------*/ - if ( NULL == pBtampCtx) + if ( NULL == pBtampCtx) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, - "Invalid BAP handle value in WLANBAP_STAPktPending"); + "Invalid BAP handle value in WLANBAP_STAPktPending"); return VOS_STATUS_E_FAULT; } // Retrieve the VOSS context pvosGCtx = pBtampCtx->pvosGCtx; - - /* Lookup the StaId using the phy_link_handle and the BAP context */ - vosStatus = WLANBAP_GetStaIdFromLinkCtx ( - btampHandle, /* btampHandle value in */ + /* Lookup the StaId using the phy_link_handle and the BAP context */ + + vosStatus = WLANBAP_GetStaIdFromLinkCtx ( + btampHandle, /* btampHandle value in */ phy_link_handle, /* phy_link_handle value in */ &ucSTAId, /* The StaId (used by TL, PE, and HAL) */ &pHddHdl); /* Handle to return BSL context */ - if ( VOS_STATUS_SUCCESS != vosStatus ) + if ( VOS_STATUS_SUCCESS != vosStatus ) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO, "Unable to retrieve STA Id from BAP context and phy_link_handle in WLANBAP_STAPktPending"); @@ -1227,79 +1227,77 @@ WLANBAP_STAPktPending // Let TL know we have a packet to send... - vosStatus = WLANTL_STAPktPending( + vosStatus = WLANTL_STAPktPending( pvosGCtx, ucSTAId, ucAc); - if ( VOS_STATUS_SUCCESS != vosStatus ) + if ( VOS_STATUS_SUCCESS != vosStatus ) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "Tx: Packet rejected by TL in WLANBAP_STAPktPending"); return vosStatus; - } - pBtampCtx->dataPktPending = VOS_TRUE;//Indication for LinkSupervision module that data is pending + } + pBtampCtx->dataPktPending = VOS_TRUE;//Indication for LinkSupervision module that data is pending return VOS_STATUS_SUCCESS; -} /* WLANBAP_STAPktPending */ +} /* WLANBAP_STAPktPending */ /*---------------------------------------------------------------------------- - FUNCTION WLAN_BAPRegisterBAPCallbacks() + FUNCTION WLAN_BAPRegisterBAPCallbacks() - DESCRIPTION + DESCRIPTION Register the BAP "Event" callbacks. Return the per instance handle. - DEPENDENCIES - NA. + DEPENDENCIES + NA. - PARAMETERS + PARAMETERS IN btampHandle: The BT-AMP PAL handle returned in WLANBAP_GetNewHndl. pBapHCIEventCB: pointer to the Event callback pAppHdl: The context passed in by caller. (I.E., BSL app specific context.) - + RETURN VALUE - The result code associated with performing the operation + The result code associated with performing the operation - VOS_STATUS_E_FAULT: pointer to pBapHCIEventCB is NULL + VOS_STATUS_E_FAULT: pointer to pBapHCIEventCB is NULL VOS_STATUS_SUCCESS: Success - - SIDE EFFECTS - + + SIDE EFFECTS + ----------------------------------------------------------------------------*/ -VOS_STATUS -WLAN_BAPRegisterBAPCallbacks -( +VOS_STATUS +WLAN_BAPRegisterBAPCallbacks +( ptBtampHandle btampHandle, /* BSL uses my handle to talk to me */ /* Returned from WLANBAP_GetNewHndl() */ /* It's like each of us is using the other */ /* guys reference when invoking him. */ - tpWLAN_BAPEventCB pBapHCIEventCB, /*Implements the callback for ALL asynchronous events. */ + tpWLAN_BAPEventCB pBapHCIEventCB, /*Implements the callback for ALL asynchronous events. */ v_PVOID_t pAppHdl // Per-app BSL context ) { - ptBtampContext pBtampCtx = (ptBtampContext) btampHandle; + ptBtampContext pBtampCtx = (ptBtampContext) btampHandle; + - /*------------------------------------------------------------------------ Sanity check params ------------------------------------------------------------------------*/ - if ( NULL == pBtampCtx) + if ( NULL == pBtampCtx) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "Invalid BAP handle value in WLAN_BAPRegisterBAPCallbacks"); return VOS_STATUS_E_FAULT; } - // Save the Event callback - pBtampCtx->pBapHCIEventCB = pBapHCIEventCB; + // Save the Event callback + pBtampCtx->pBapHCIEventCB = pBapHCIEventCB; // (Right now, there is only one) pBtampCtx->pAppHdl = pAppHdl; return VOS_STATUS_SUCCESS; } /* WLAN_BAPRegisterBAPCallbacks */ - - diff --git a/CORE/BAP/src/bapApiDebug.c b/CORE/BAP/src/bapApiDebug.c index c9d490236918..f3fb5a677eee 100644 --- a/CORE/BAP/src/bapApiDebug.c +++ b/CORE/BAP/src/bapApiDebug.c @@ -28,16 +28,16 @@ /*=========================================================================== b a p A p i D e b u g . C - + OVERVIEW: - + This software unit holds the implementation of the WLAN BAP modules Debug functions. - - The functions externalized by this module are to be called ONLY by other + + The functions externalized by this module are to be called ONLY by other WLAN modules (HDD) that properly register with the BAP Layer initially. - DEPENDENCIES: + DEPENDENCIES: Are listed for each API below. ===========================================================================*/ @@ -66,9 +66,9 @@ //#include "wlan_qct_tl.h" #include "vos_trace.h" -/* BT-AMP PAL API header file */ -#include "bapApi.h" -#include "bapInternal.h" +/* BT-AMP PAL API header file */ +#include "bapApi.h" +#include "bapInternal.h" // //#define BAP_DEBUG @@ -109,38 +109,38 @@ Debug Commands FUNCTION WLAN_BAPReadLoopbackMode() - DESCRIPTION - Implements the actual HCI Read Loopback Mode command. There - is no need for a callback because when this call returns the action + DESCRIPTION + Implements the actual HCI Read Loopback Mode command. There + is no need for a callback because when this call returns the action has been completed. - DEPENDENCIES - NA. + DEPENDENCIES + NA. - PARAMETERS + PARAMETERS IN btampHandle: pointer to the BAP handle. Returned from WLANBAP_GetNewHndl. pBapHCIReadLoopbackMode: pointer to the "HCI Read Loopback Mode". - + IN/OUT - pBapHCIEvent: Return event value for the command complete event. - (The caller of this routine is responsible for sending + pBapHCIEvent: Return event value for the command complete event. + (The caller of this routine is responsible for sending the Command Complete event up the HCI interface.) - + RETURN VALUE - The result code associated with performing the operation + The result code associated with performing the operation - VOS_STATUS_E_FAULT: pointer to pBapHCIReadLoopbackMode or + VOS_STATUS_E_FAULT: pointer to pBapHCIReadLoopbackMode or pBapHCILoopbackMode is NULL. VOS_STATUS_SUCCESS: Success - - SIDE EFFECTS - + + SIDE EFFECTS + ----------------------------------------------------------------------------*/ -VOS_STATUS +VOS_STATUS WLAN_BAPReadLoopbackMode -( +( ptBtampHandle btampHandle, tBtampTLVHCI_Read_Loopback_Mode_Cmd *pBapHCIReadLoopbackMode, tpBtampHCI_Event pBapHCIEvent /* This now encodes ALL event types */ @@ -155,37 +155,37 @@ WLAN_BAPReadLoopbackMode FUNCTION WLAN_BAPWriteLoopbackMode() - DESCRIPTION - Implements the actual HCI Write Loopback Mode command. There - is no need for a callback because when this call returns the action + DESCRIPTION + Implements the actual HCI Write Loopback Mode command. There + is no need for a callback because when this call returns the action has been completed. - DEPENDENCIES - NA. + DEPENDENCIES + NA. - PARAMETERS + PARAMETERS IN btampHandle: pointer to the BAP handle. Returned from WLANBAP_GetNewHndl. pBapHCIWriteLoopbackMode: pointer to the "HCI Write Loopback Mode" Structure. - + IN/OUT - pBapHCIEvent: Return event value for the command complete event. - (The caller of this routine is responsible for sending + pBapHCIEvent: Return event value for the command complete event. + (The caller of this routine is responsible for sending the Command Complete event up the HCI interface.) - + RETURN VALUE - The result code associated with performing the operation + The result code associated with performing the operation - VOS_STATUS_E_FAULT: pointer to pBapHCIWriteLoopbackMode is NULL + VOS_STATUS_E_FAULT: pointer to pBapHCIWriteLoopbackMode is NULL VOS_STATUS_SUCCESS: Success - - SIDE EFFECTS - + + SIDE EFFECTS + ----------------------------------------------------------------------------*/ -VOS_STATUS +VOS_STATUS WLAN_BAPWriteLoopbackMode -( +( ptBtampHandle btampHandle, tBtampTLVHCI_Write_Loopback_Mode_Cmd *pBapHCIWriteLoopbackMode, tpBtampHCI_Event pBapHCIEvent /* This now encodes ALL event types */ @@ -195,8 +195,3 @@ WLAN_BAPWriteLoopbackMode return VOS_STATUS_SUCCESS; } /* WLAN_BAPWriteLoopbackMode */ - - - - - diff --git a/CORE/BAP/src/bapApiExt.c b/CORE/BAP/src/bapApiExt.c index 81d70c6d9bbd..2335965a2f00 100644 --- a/CORE/BAP/src/bapApiExt.c +++ b/CORE/BAP/src/bapApiExt.c @@ -28,18 +28,18 @@ /*=========================================================================== b a p A p i E x t . C - + OVERVIEW: - + This software unit holds the implementation of the external interfaces - required by the WLAN BAP module. It is currently a temporary + required by the WLAN BAP module. It is currently a temporary respository for API routines which should be furnished by CSR or TL, but aren't yet implemented. - - The functions provide by this module are called by the rest of + + The functions provide by this module are called by the rest of the BT-AMP PAL module. - DEPENDENCIES: + DEPENDENCIES: Are listed for each API below. ===========================================================================*/ @@ -82,7 +82,7 @@ * -------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------- - * External declarations for global context + * External declarations for global context * -------------------------------------------------------------------------*/ @@ -103,38 +103,38 @@ * -------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------- - * Utility Function implementations + * Utility Function implementations * -------------------------------------------------------------------------*/ /*========================================================================== FUNCTION WLANBAP_GetCurrentChannel - DESCRIPTION + DESCRIPTION Clear out all fields in the BAP context. - - DEPENDENCIES - - PARAMETERS + + DEPENDENCIES + + PARAMETERS IN pBtampCtx: pointer to the BAP control block channel: current configured channel number. activeFlag: flag indicating whether there is an active link. - + RETURN VALUE - The result code associated with performing the operation + The result code associated with performing the operation + + VOS_STATUS_E_FAULT: pointer to return channel is NULL ; access would cause a page + fault + VOS_STATUS_SUCCESS: Everything is good :) - VOS_STATUS_E_FAULT: pointer to return channel is NULL ; access would cause a page - fault - VOS_STATUS_SUCCESS: Everything is good :) + SIDE EFFECTS - SIDE EFFECTS - ============================================================================*/ -VOS_STATUS +VOS_STATUS WLANBAP_GetCurrentChannel -( +( ptBtampContext pBtampCtx, v_U32_t *channel, // return current channel here v_U32_t *activeFlag // return active flag here @@ -144,7 +144,7 @@ WLANBAP_GetCurrentChannel tHalHandle halHandle; /*------------------------------------------------------------------------ - Sanity check BAP control block + Sanity check BAP control block ------------------------------------------------------------------------*/ if (( NULL == pBtampCtx ) || (NULL == channel) || (NULL == activeFlag)) @@ -163,8 +163,8 @@ WLANBAP_GetCurrentChannel return VOS_STATUS_E_FAULT; } - if (ccmCfgGetInt(halHandle, WNI_CFG_CURRENT_CHANNEL, channel) - != eHAL_STATUS_SUCCESS ) + if (ccmCfgGetInt(halHandle, WNI_CFG_CURRENT_CHANNEL, channel) + != eHAL_STATUS_SUCCESS ) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "Get CFG failed in %s", __func__); @@ -175,5 +175,3 @@ WLANBAP_GetCurrentChannel return VOS_STATUS_SUCCESS; }/* WLANBAP_GetCurrentChannel */ - - diff --git a/CORE/BAP/src/bapApiExt.h b/CORE/BAP/src/bapApiExt.h index 5f8d878f6bc7..4efd89856138 100644 --- a/CORE/BAP/src/bapApiExt.h +++ b/CORE/BAP/src/bapApiExt.h @@ -30,12 +30,12 @@ /*=========================================================================== - W L A N B T - A M P P A L L A Y E R + W L A N B T - A M P P A L L A Y E R E X T E R N A L A P I - - + + DESCRIPTION - This file contains the external APIs used by the wlan BT-AMP PAL layer + This file contains the external APIs used by the wlan BT-AMP PAL layer module. ===========================================================================*/ @@ -69,16 +69,16 @@ when who what, where, why /*---------------------------------------------------------------------------- * Include Files * -------------------------------------------------------------------------*/ -// Pick up all the BT-AMP internal definitions +// Pick up all the BT-AMP internal definitions // And underlying supporting types. (Including VOSS, CSR, and...) -#include "bapInternal.h" +#include "bapInternal.h" -/* Pick up the SIRIUS and HAL types */ -// Already taken care of, above +/* Pick up the SIRIUS and HAL types */ +// Already taken care of, above //#include "sirApi.h" //#include "halTypes.h" -/* Pick up the CCM API def'n */ +/* Pick up the CCM API def'n */ #include "ccmApi.h" /*---------------------------------------------------------------------------- @@ -86,19 +86,19 @@ when who what, where, why * -------------------------------------------------------------------------*/ #ifdef __cplusplus extern "C" { - #endif - + #endif + /*---------------------------------------------------------------------------- * Defines * -------------------------------------------------------------------------*/ -// Temporary +// Temporary //#define BAP_DEBUG -// How do I get BAP context from voss context? -//#define VOS_GET_BAP_CB(ctx) vos_get_context( VOS_MODULE_ID_BAP, ctx) -// How do I get halHandle from voss context? -//#define VOS_GET_HAL_CB(ctx) vos_get_context( VOS_MODULE_ID_HAL, ctx) +// How do I get BAP context from voss context? +//#define VOS_GET_BAP_CB(ctx) vos_get_context( VOS_MODULE_ID_BAP, ctx) +// How do I get halHandle from voss context? +//#define VOS_GET_HAL_CB(ctx) vos_get_context( VOS_MODULE_ID_HAL, ctx) /*---------------------------------------------------------------------------- * Typedefs @@ -106,47 +106,47 @@ when who what, where, why /*---------------------------------------------------------------------------- - * External declarations for global context + * External declarations for global context * -------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------- - * Function prototypes + * Function prototypes * -------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------- - * Utility Function prototypes + * Utility Function prototypes * -------------------------------------------------------------------------*/ /*========================================================================== FUNCTION WLANBAP_GetCurrentChannel - DESCRIPTION + DESCRIPTION Clear out all fields in the BAP context. - - DEPENDENCIES - - PARAMETERS + + DEPENDENCIES + + PARAMETERS IN pBtampCtx: pointer to the BAP control block channel: current configured channel number. activeFlag: flag indicating whether there is an active link. - + RETURN VALUE - The result code associated with performing the operation + The result code associated with performing the operation - VOS_STATUS_E_FAULT: pointer to return channel is NULL ; access would cause a page - fault - VOS_STATUS_SUCCESS: Everything is good :) + VOS_STATUS_E_FAULT: pointer to return channel is NULL ; access would cause a page + fault + VOS_STATUS_SUCCESS: Everything is good :) + + SIDE EFFECTS - SIDE EFFECTS - ============================================================================*/ -VOS_STATUS +VOS_STATUS WLANBAP_GetCurrentChannel -( +( ptBtampContext pBtampCtx, v_U32_t *channel, // return current channel here v_U32_t *activeFlag // return active flag here @@ -155,8 +155,7 @@ WLANBAP_GetCurrentChannel #ifdef __cplusplus } -#endif +#endif #endif /* #ifndef WLAN_QCT_WLANBAP_API_EXT_H */ - diff --git a/CORE/BAP/src/bapApiHCBB.c b/CORE/BAP/src/bapApiHCBB.c index d0dc51053c12..565e9fa2d0a8 100644 --- a/CORE/BAP/src/bapApiHCBB.c +++ b/CORE/BAP/src/bapApiHCBB.c @@ -28,16 +28,16 @@ /*=========================================================================== b a p A p i H C B B . C - + OVERVIEW: - + This software unit holds the implementation of the WLAN BAP modules Host Controller and Baseband functions. - - The functions externalized by this module are to be called ONLY by other + + The functions externalized by this module are to be called ONLY by other WLAN modules (HDD) that properly register with the BAP Layer initially. - DEPENDENCIES: + DEPENDENCIES: Are listed for each API below. ===========================================================================*/ @@ -68,9 +68,9 @@ // Pick up the sme callback registration API #include "sme_Api.h" -/* BT-AMP PAL API header file */ -#include "bapApi.h" -#include "bapInternal.h" +/* BT-AMP PAL API header file */ +#include "bapApi.h" +#include "bapInternal.h" //#define BAP_DEBUG /*---------------------------------------------------------------------------- @@ -109,30 +109,30 @@ FUNCTION WLAN_BAPReset() - DESCRIPTION + DESCRIPTION Implements the actual HCI Reset command. - Produces an asynchronous command complete event. Through the + Produces an asynchronous command complete event. Through the command complete callback. (I.E., (*tpWLAN_BAPEventCB).) - DEPENDENCIES - NA. + DEPENDENCIES + NA. - PARAMETERS + PARAMETERS IN btampHandle: pointer to the BAP handle. Returned from WLANBAP_GetNewHndl. - + RETURN VALUE - The result code associated with performing the operation + The result code associated with performing the operation VOS_STATUS_SUCCESS: Success - - SIDE EFFECTS - + + SIDE EFFECTS + ----------------------------------------------------------------------------*/ -VOS_STATUS +VOS_STATUS WLAN_BAPReset -( +( ptBtampHandle btampHandle ) { @@ -144,8 +144,8 @@ WLAN_BAPReset VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "%s: btampHandle value: %p", __func__, btampHandle); - /* Validate params */ - if (btampHandle == NULL) + /* Validate params */ + if (btampHandle == NULL) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "btampHandle is NULL in %s", __func__); @@ -153,9 +153,9 @@ WLAN_BAPReset return VOS_STATUS_E_FAULT; } - /* Perform a "reset" */ + /* Perform a "reset" */ hHal = VOS_GET_HAL_CB(btampContext->pvosGCtx); - if (NULL == hHal) + if (NULL == hHal) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "hHal is NULL in %s", __func__); @@ -176,30 +176,30 @@ WLAN_BAPReset /* Need to reset the timers as well*/ /* Connection Accept Timer interval*/ - btampContext->bapConnectionAcceptTimerInterval = WLANBAP_CONNECTION_ACCEPT_TIMEOUT; + btampContext->bapConnectionAcceptTimerInterval = WLANBAP_CONNECTION_ACCEPT_TIMEOUT; /* Link Supervision Timer interval*/ - btampContext->bapLinkSupervisionTimerInterval = WLANBAP_LINK_SUPERVISION_TIMEOUT; + btampContext->bapLinkSupervisionTimerInterval = WLANBAP_LINK_SUPERVISION_TIMEOUT; /* Logical Link Accept Timer interval*/ - btampContext->bapLogicalLinkAcceptTimerInterval = WLANBAP_LOGICAL_LINK_ACCEPT_TIMEOUT; + btampContext->bapLogicalLinkAcceptTimerInterval = WLANBAP_LOGICAL_LINK_ACCEPT_TIMEOUT; /* Best Effort Flush timer interval*/ - btampContext->bapBEFlushTimerInterval = WLANBAP_BE_FLUSH_TIMEOUT; + btampContext->bapBEFlushTimerInterval = WLANBAP_BE_FLUSH_TIMEOUT; - /* Form and immediately return the command complete event... */ + /* Form and immediately return the command complete event... */ bapHCIEvent.bapHCIEventCode = BTAMP_TLV_HCI_COMMAND_COMPLETE_EVENT; bapHCIEvent.u.btampCommandCompleteEvent.present = 1; bapHCIEvent.u.btampCommandCompleteEvent.num_hci_command_packets = 1; - bapHCIEvent.u.btampCommandCompleteEvent.command_opcode + bapHCIEvent.u.btampCommandCompleteEvent.command_opcode = BTAMP_TLV_HCI_RESET_CMD; - bapHCIEvent.u.btampCommandCompleteEvent.cc_event.Reset.status + bapHCIEvent.u.btampCommandCompleteEvent.cc_event.Reset.status = WLANBAP_STATUS_SUCCESS; - vosStatus = (*btampContext->pBapHCIEventCB) - ( + vosStatus = (*btampContext->pBapHCIEventCB) + ( //btampContext->pHddHdl, /* this refers to the BSL per connection context */ btampContext->pAppHdl, /* this refers the BSL per application context */ &bapHCIEvent, /* This now encodes ALL event types */ - VOS_FALSE /* Flag to indicate assoc-specific event */ + VOS_FALSE /* Flag to indicate assoc-specific event */ ); return vosStatus; @@ -209,36 +209,36 @@ WLAN_BAPReset FUNCTION WLAN_BAPSetEventMask() - DESCRIPTION - Implements the actual HCI Set Event Mask command. There is no need for + DESCRIPTION + Implements the actual HCI Set Event Mask command. There is no need for a callback because when this call returns the action has been completed. - DEPENDENCIES - NA. + DEPENDENCIES + NA. - PARAMETERS + PARAMETERS IN btampHandle: pointer to the BAP handle. Returned from WLANBAP_GetNewHndl. pBapHCISetEventMask: pointer to the "HCI Set Event Mask" Structure. - + IN/OUT - pBapHCIEvent: Return event value for the command complete event. - (The caller of this routine is responsible for sending + pBapHCIEvent: Return event value for the command complete event. + (The caller of this routine is responsible for sending the Command Complete event up the HCI interface.) - + RETURN VALUE - The result code associated with performing the operation + The result code associated with performing the operation - VOS_STATUS_E_FAULT: pointer to pBapHCISetEventMask is NULL + VOS_STATUS_E_FAULT: pointer to pBapHCISetEventMask is NULL VOS_STATUS_SUCCESS: Success - - SIDE EFFECTS - + + SIDE EFFECTS + ----------------------------------------------------------------------------*/ -VOS_STATUS +VOS_STATUS WLAN_BAPSetEventMask -( +( ptBtampHandle btampHandle, tBtampTLVHCI_Set_Event_Mask_Cmd *pBapHCISetEventMask, tpBtampHCI_Event pBapHCIEvent /* This now encodes ALL event types */ @@ -253,33 +253,33 @@ WLAN_BAPSetEventMask FUNCTION WLAN_BAPFlush() - DESCRIPTION + DESCRIPTION Implements the actual HCI Flush command - Produces an asynchronous command complete event. Through the - event callback. And an asynchronous Flush occurred event. Also through the + Produces an asynchronous command complete event. Through the + event callback. And an asynchronous Flush occurred event. Also through the event callback. - DEPENDENCIES - NA. + DEPENDENCIES + NA. - PARAMETERS + PARAMETERS IN btampHandle: pointer to the BAP handle. Returned from WLANBAP_GetNewHndl. pBapHCIFlush: pointer to the "HCI Flush" Structure. - + RETURN VALUE - The result code associated with performing the operation + The result code associated with performing the operation - VOS_STATUS_E_FAULT: pointer to pBapHCIFlush is NULL + VOS_STATUS_E_FAULT: pointer to pBapHCIFlush is NULL VOS_STATUS_SUCCESS: Success - - SIDE EFFECTS - + + SIDE EFFECTS + ----------------------------------------------------------------------------*/ -VOS_STATUS +VOS_STATUS WLAN_BAPFlush -( +( ptBtampHandle btampHandle, tBtampTLVHCI_Flush_Cmd *pBapHCIFlush ) @@ -291,26 +291,26 @@ WLAN_BAPFlush VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "%s: btampHandle value: %p", __func__, btampHandle); - /* Validate params */ + /* Validate params */ if (btampHandle == NULL) { return VOS_STATUS_E_FAULT; } - /* Form and immediately return the command complete event... */ + /* Form and immediately return the command complete event... */ bapHCIEvent.bapHCIEventCode = BTAMP_TLV_HCI_COMMAND_COMPLETE_EVENT; bapHCIEvent.u.btampCommandCompleteEvent.present = 1; bapHCIEvent.u.btampCommandCompleteEvent.num_hci_command_packets = 1; - bapHCIEvent.u.btampCommandCompleteEvent.command_opcode + bapHCIEvent.u.btampCommandCompleteEvent.command_opcode = BTAMP_TLV_HCI_FLUSH_CMD; bapHCIEvent.u.btampCommandCompleteEvent.cc_event.Flush.status = WLANBAP_STATUS_SUCCESS; - vosStatus = (*btampContext->pBapHCIEventCB) - ( + vosStatus = (*btampContext->pBapHCIEventCB) + ( //btampContext->pHddHdl, /* this refers to the BSL per connection context */ btampContext->pAppHdl, /* this refers the BSL per application context */ &bapHCIEvent, /* This now encodes ALL event types */ - VOS_FALSE /* Flag to indicate assoc-specific event */ + VOS_FALSE /* Flag to indicate assoc-specific event */ ); return vosStatus; @@ -320,36 +320,36 @@ WLAN_BAPFlush FUNCTION WLAN_EnhancedBAPFlush() - DESCRIPTION + DESCRIPTION Implements the actual HCI Enhanced Flush command - Produces an asynchronous command complete event. Through the command status - event callback. And an asynchronous Enhanced Flush Complete event. + Produces an asynchronous command complete event. Through the command status + event callback. And an asynchronous Enhanced Flush Complete event. - DEPENDENCIES - NA. + DEPENDENCIES + NA. - PARAMETERS + PARAMETERS IN btampHandle: pointer to the BAP handle. Returned from WLANBAP_GetNewHndl. pBapHCIFlush: pointer to the "HCI Enhanced Flush" Structure. IN/OUT - pBapHCIEvent: Return event value for the command complete event. - (The caller of this routine is responsible for sending + pBapHCIEvent: Return event value for the command complete event. + (The caller of this routine is responsible for sending the Command Complete event up the HCI interface.) - + RETURN VALUE - The result code associated with performing the operation + The result code associated with performing the operation - VOS_STATUS_E_FAULT: pointer to pBapHCIFlush is NULL + VOS_STATUS_E_FAULT: pointer to pBapHCIFlush is NULL VOS_STATUS_SUCCESS: Success - - SIDE EFFECTS - + + SIDE EFFECTS + ----------------------------------------------------------------------------*/ -VOS_STATUS +VOS_STATUS WLAN_EnhancedBAPFlush -( +( ptBtampHandle btampHandle, tBtampTLVHCI_Enhanced_Flush_Cmd *pBapHCIFlush, tpBtampHCI_Event pBapHCIEvent /* This now encodes ALL event types */ @@ -364,8 +364,8 @@ WLAN_EnhancedBAPFlush VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "%s: btampHandle value: %p", __func__, btampHandle); - /* Validate params */ - /* Validate params */ + /* Validate params */ + /* Validate params */ if ((NULL == btampHandle) || (NULL == pBapHCIEvent)) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, @@ -382,18 +382,18 @@ WLAN_EnhancedBAPFlush = BTAMP_TLV_HCI_ENHANCED_FLUSH_CMD; bapHCIEvent.u.btampCommandStatusEvent.status = WLANBAP_STATUS_SUCCESS; - /* Form and immediately return the command complete event... */ + /* Form and immediately return the command complete event... */ pBapHCIEvent->bapHCIEventCode = BTAMP_TLV_HCI_ENHANCED_FLUSH_COMPLETE_EVENT; pBapHCIEvent->u.btampEnhancedFlushCompleteEvent.present = 1; - pBapHCIEvent->u.btampEnhancedFlushCompleteEvent.log_link_handle = + pBapHCIEvent->u.btampEnhancedFlushCompleteEvent.log_link_handle = pBapHCIFlush->log_link_handle; - vosStatus = (*btampContext->pBapHCIEventCB) - ( + vosStatus = (*btampContext->pBapHCIEventCB) + ( //btampContext->pHddHdl, /* this refers to the BSL per connection context */ btampContext->pAppHdl, /* this refers the BSL per application context */ &bapHCIEvent, /* This now encodes ALL event types */ - VOS_FALSE /* Flag to indicate assoc-specific event */ + VOS_FALSE /* Flag to indicate assoc-specific event */ ); return vosStatus; @@ -403,36 +403,36 @@ WLAN_EnhancedBAPFlush FUNCTION WLAN_BAPReadConnectionAcceptTimeout() - DESCRIPTION - Implements the actual HCI Read Connection Accept Timeout command. There - is no need for a callback because when this call returns the action + DESCRIPTION + Implements the actual HCI Read Connection Accept Timeout command. There + is no need for a callback because when this call returns the action has been completed. - DEPENDENCIES - NA. + DEPENDENCIES + NA. - PARAMETERS + PARAMETERS IN btampHandle: pointer to the BAP handle. Returned from WLANBAP_GetNewHndl. - + IN/OUT - pBapHCIEvent: Return event value for the command complete event. - (The caller of this routine is responsible for sending + pBapHCIEvent: Return event value for the command complete event. + (The caller of this routine is responsible for sending the Command Complete event up the HCI interface.) - + RETURN VALUE - The result code associated with performing the operation + The result code associated with performing the operation - VOS_STATUS_E_FAULT: pointer to pBapHCIReadConnectionAcceptTimeout is NULL + VOS_STATUS_E_FAULT: pointer to pBapHCIReadConnectionAcceptTimeout is NULL VOS_STATUS_SUCCESS: Success - - SIDE EFFECTS - + + SIDE EFFECTS + ----------------------------------------------------------------------------*/ -VOS_STATUS +VOS_STATUS WLAN_BAPReadConnectionAcceptTimeout -( +( ptBtampHandle btampHandle, tpBtampHCI_Event pBapHCIEvent /* This now encodes ALL event types */ /* Including "Read" Command Complete */ @@ -444,7 +444,7 @@ WLAN_BAPReadConnectionAcceptTimeout VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "%s: btampHandle value: %p", __func__, btampHandle); - /* Validate params */ + /* Validate params */ if ((NULL == btampHandle) || (NULL == pBapHCIEvent)) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, @@ -452,11 +452,11 @@ WLAN_BAPReadConnectionAcceptTimeout return VOS_STATUS_E_FAULT; } - /* Fill in the parameters for command complete event... */ + /* Fill in the parameters for command complete event... */ pBapHCIEvent->bapHCIEventCode = BTAMP_TLV_HCI_COMMAND_COMPLETE_EVENT; pBapHCIEvent->u.btampCommandCompleteEvent.present = TRUE; pBapHCIEvent->u.btampCommandCompleteEvent.num_hci_command_packets = 1; - pBapHCIEvent->u.btampCommandCompleteEvent.command_opcode + pBapHCIEvent->u.btampCommandCompleteEvent.command_opcode = BTAMP_TLV_HCI_READ_CONNECTION_ACCEPT_TIMEOUT_CMD; pBapHCIEvent->u.btampCommandCompleteEvent.cc_event.Read_Connection_Accept_TO.status = WLANBAP_STATUS_SUCCESS; @@ -470,37 +470,37 @@ WLAN_BAPReadConnectionAcceptTimeout FUNCTION WLAN_BAPWriteConnectionAcceptTimeout() - DESCRIPTION - Implements the actual HCI Write Connection Accept Timeout command. There - is no need for a callback because when this call returns the action + DESCRIPTION + Implements the actual HCI Write Connection Accept Timeout command. There + is no need for a callback because when this call returns the action has been completed. - DEPENDENCIES - NA. + DEPENDENCIES + NA. - PARAMETERS + PARAMETERS IN btampHandle: pointer to the BAP handle. Returned from WLANBAP_GetNewHndl. pBapHCIWriteConnectionAcceptTimeout: pointer to the "HCI Connection Accept Timeout" Structure. - + IN/OUT - pBapHCIEvent: Return event value for the command complete event. - (The caller of this routine is responsible for sending + pBapHCIEvent: Return event value for the command complete event. + (The caller of this routine is responsible for sending the Command Complete event up the HCI interface.) - + RETURN VALUE - The result code associated with performing the operation + The result code associated with performing the operation - VOS_STATUS_E_FAULT: pointer to pBapHCIWriteConnectionAcceptTimeout is NULL + VOS_STATUS_E_FAULT: pointer to pBapHCIWriteConnectionAcceptTimeout is NULL VOS_STATUS_SUCCESS: Success - - SIDE EFFECTS - + + SIDE EFFECTS + ----------------------------------------------------------------------------*/ -VOS_STATUS +VOS_STATUS WLAN_BAPWriteConnectionAcceptTimeout -( +( ptBtampHandle btampHandle, tBtampTLVHCI_Write_Connection_Accept_Timeout_Cmd *pBapHCIWriteConnectionAcceptTimeout, tpBtampHCI_Event pBapHCIEvent /* This now encodes ALL event types */ @@ -513,7 +513,7 @@ WLAN_BAPWriteConnectionAcceptTimeout VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "%s: btampHandle value: %p", __func__, btampHandle); - /* Validate params */ + /* Validate params */ if ((NULL == btampHandle) || (NULL == pBapHCIWriteConnectionAcceptTimeout) || (NULL == pBapHCIEvent)) { @@ -524,7 +524,7 @@ WLAN_BAPWriteConnectionAcceptTimeout /* Validate the allowed timeout interval range */ if ((pBapHCIWriteConnectionAcceptTimeout->connection_accept_timeout > - WLANBAP_CON_ACCEPT_TIMEOUT_MAX_RANGE) || + WLANBAP_CON_ACCEPT_TIMEOUT_MAX_RANGE) || (pBapHCIWriteConnectionAcceptTimeout->connection_accept_timeout < WLANBAP_CON_ACCEPT_TIMEOUT_MIN_RANGE)) { @@ -537,7 +537,7 @@ WLAN_BAPWriteConnectionAcceptTimeout else { /* Save the Physical link connection accept timeout value */ - btampContext->bapConnectionAcceptTimerInterval = + btampContext->bapConnectionAcceptTimerInterval = pBapHCIWriteConnectionAcceptTimeout->connection_accept_timeout; /* Return status for command complete event */ @@ -545,11 +545,11 @@ WLAN_BAPWriteConnectionAcceptTimeout = WLANBAP_STATUS_SUCCESS; } - /* Fill in the parameters for command complete event... */ + /* Fill in the parameters for command complete event... */ pBapHCIEvent->bapHCIEventCode = BTAMP_TLV_HCI_COMMAND_COMPLETE_EVENT; pBapHCIEvent->u.btampCommandCompleteEvent.present = TRUE; pBapHCIEvent->u.btampCommandCompleteEvent.num_hci_command_packets = 1; - pBapHCIEvent->u.btampCommandCompleteEvent.command_opcode + pBapHCIEvent->u.btampCommandCompleteEvent.command_opcode = BTAMP_TLV_HCI_WRITE_CONNECTION_ACCEPT_TIMEOUT_CMD; return VOS_STATUS_SUCCESS; @@ -560,36 +560,36 @@ WLAN_BAPWriteConnectionAcceptTimeout FUNCTION WLAN_BAPReadLinkSupervisionTimeout() - DESCRIPTION - Implements the actual HCI Read Link Supervision Timeout command. There - is no need for a callback because when this call returns the action + DESCRIPTION + Implements the actual HCI Read Link Supervision Timeout command. There + is no need for a callback because when this call returns the action has been completed. - DEPENDENCIES - NA. + DEPENDENCIES + NA. - PARAMETERS + PARAMETERS IN btampHandle: pointer to the BAP handle. Returned from WLANBAP_GetNewHndl. - + IN/OUT - pBapHCIEvent: Return event value for the command complete event. - (The caller of this routine is responsible for sending + pBapHCIEvent: Return event value for the command complete event. + (The caller of this routine is responsible for sending the Command Complete event up the HCI interface.) - + RETURN VALUE - The result code associated with performing the operation + The result code associated with performing the operation - VOS_STATUS_E_FAULT: pointer to pBapHCIReadLinkSupervisionTimeout is NULL + VOS_STATUS_E_FAULT: pointer to pBapHCIReadLinkSupervisionTimeout is NULL VOS_STATUS_SUCCESS: Success - - SIDE EFFECTS - + + SIDE EFFECTS + ----------------------------------------------------------------------------*/ -VOS_STATUS +VOS_STATUS WLAN_BAPReadLinkSupervisionTimeout -( +( ptBtampHandle btampHandle, /* Only 8 bits (phy_link_handle) of this log_link_handle are valid. */ tBtampTLVHCI_Read_Link_Supervision_Timeout_Cmd *pBapHCIReadLinkSupervisionTimeout, @@ -604,7 +604,7 @@ WLAN_BAPReadLinkSupervisionTimeout VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "%s: btampHandle value: %p", __func__, btampHandle); - /* Validate params */ + /* Validate params */ if ((NULL == btampHandle) || (NULL == pBapHCIReadLinkSupervisionTimeout) || (NULL == pBapHCIEvent)) { @@ -638,11 +638,11 @@ WLAN_BAPReadLinkSupervisionTimeout = WLANBAP_STATUS_SUCCESS; } - /* Fill in the parameters for command complete event... */ + /* Fill in the parameters for command complete event... */ pBapHCIEvent->bapHCIEventCode = BTAMP_TLV_HCI_COMMAND_COMPLETE_EVENT; pBapHCIEvent->u.btampCommandCompleteEvent.present = TRUE; pBapHCIEvent->u.btampCommandCompleteEvent.num_hci_command_packets = 1; - pBapHCIEvent->u.btampCommandCompleteEvent.command_opcode + pBapHCIEvent->u.btampCommandCompleteEvent.command_opcode = BTAMP_TLV_HCI_READ_LINK_SUPERVISION_TIMEOUT_CMD; return VOS_STATUS_SUCCESS; @@ -652,37 +652,37 @@ WLAN_BAPReadLinkSupervisionTimeout FUNCTION WLAN_BAPWriteLinkSupervisionTimeout() - DESCRIPTION - Implements the actual HCI Write Link Supervision Timeout command. There - is no need for a callback because when this call returns the action + DESCRIPTION + Implements the actual HCI Write Link Supervision Timeout command. There + is no need for a callback because when this call returns the action has been completed. - DEPENDENCIES - NA. + DEPENDENCIES + NA. - PARAMETERS + PARAMETERS IN btampHandle: pointer to the BAP handle. Returned from WLANBAP_GetNewHndl. pBapHCIWriteLinkSupervisionTimeout: pointer to the "HCI Link Supervision Timeout" Structure. - + IN/OUT - pBapHCIEvent: Return event value for the command complete event. - (The caller of this routine is responsible for sending + pBapHCIEvent: Return event value for the command complete event. + (The caller of this routine is responsible for sending the Command Complete event up the HCI interface.) - + RETURN VALUE - The result code associated with performing the operation + The result code associated with performing the operation - VOS_STATUS_E_FAULT: pointer to pBapHCIWriteLinkSupervisionTimeout is NULL + VOS_STATUS_E_FAULT: pointer to pBapHCIWriteLinkSupervisionTimeout is NULL VOS_STATUS_SUCCESS: Success - - SIDE EFFECTS - + + SIDE EFFECTS + ----------------------------------------------------------------------------*/ -VOS_STATUS +VOS_STATUS WLAN_BAPWriteLinkSupervisionTimeout -( +( ptBtampHandle btampHandle, tBtampTLVHCI_Write_Link_Supervision_Timeout_Cmd *pBapHCIWriteLinkSupervisionTimeout, tpBtampHCI_Event pBapHCIEvent /* This now encodes ALL event types */ @@ -696,7 +696,7 @@ WLAN_BAPWriteLinkSupervisionTimeout VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "%s: btampHandle value: %p", __func__, btampHandle); - /* Validate params */ + /* Validate params */ if ((NULL == btampHandle) || (NULL == pBapHCIWriteLinkSupervisionTimeout) || (NULL == pBapHCIEvent)) { @@ -730,11 +730,11 @@ WLAN_BAPWriteLinkSupervisionTimeout = WLANBAP_STATUS_SUCCESS; } - /* Fill in the parameters for command complete event... */ + /* Fill in the parameters for command complete event... */ pBapHCIEvent->bapHCIEventCode = BTAMP_TLV_HCI_COMMAND_COMPLETE_EVENT; pBapHCIEvent->u.btampCommandCompleteEvent.present = TRUE; pBapHCIEvent->u.btampCommandCompleteEvent.num_hci_command_packets = 1; - pBapHCIEvent->u.btampCommandCompleteEvent.command_opcode + pBapHCIEvent->u.btampCommandCompleteEvent.command_opcode = BTAMP_TLV_HCI_WRITE_LINK_SUPERVISION_TIMEOUT_CMD; return VOS_STATUS_SUCCESS; @@ -747,36 +747,36 @@ WLAN_BAPWriteLinkSupervisionTimeout FUNCTION WLAN_BAPReadLogicalLinkAcceptTimeout() - DESCRIPTION - Implements the actual HCI Read Logical Link Accept Timeout command. There - is no need for a callback because when this call returns the action + DESCRIPTION + Implements the actual HCI Read Logical Link Accept Timeout command. There + is no need for a callback because when this call returns the action has been completed. - DEPENDENCIES - NA. + DEPENDENCIES + NA. - PARAMETERS + PARAMETERS IN btampHandle: pointer to the BAP handle. Returned from WLANBAP_GetNewHndl. - + IN/OUT - pBapHCIEvent: Return event value for the command complete event. - (The caller of this routine is responsible for sending + pBapHCIEvent: Return event value for the command complete event. + (The caller of this routine is responsible for sending the Command Complete event up the HCI interface.) - + RETURN VALUE - The result code associated with performing the operation + The result code associated with performing the operation - VOS_STATUS_E_FAULT: pointer to pBapHCIReadLogicalLinkAcceptTimeout is NULL + VOS_STATUS_E_FAULT: pointer to pBapHCIReadLogicalLinkAcceptTimeout is NULL VOS_STATUS_SUCCESS: Success - - SIDE EFFECTS - + + SIDE EFFECTS + ----------------------------------------------------------------------------*/ -VOS_STATUS +VOS_STATUS WLAN_BAPReadLogicalLinkAcceptTimeout -( +( ptBtampHandle btampHandle, tpBtampHCI_Event pBapHCIEvent /* This now encodes ALL event types */ /* Including "Read" Command Complete*/ @@ -788,7 +788,7 @@ WLAN_BAPReadLogicalLinkAcceptTimeout VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "%s: btampHandle value: %p", __func__, btampHandle); - /* Validate params */ + /* Validate params */ if ((NULL == btampHandle) || (NULL == pBapHCIEvent)) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, @@ -796,11 +796,11 @@ WLAN_BAPReadLogicalLinkAcceptTimeout return VOS_STATUS_E_FAULT; } - /* Fill in the parameters for command complete event... */ + /* Fill in the parameters for command complete event... */ pBapHCIEvent->bapHCIEventCode = BTAMP_TLV_HCI_COMMAND_COMPLETE_EVENT; pBapHCIEvent->u.btampCommandCompleteEvent.present = TRUE; pBapHCIEvent->u.btampCommandCompleteEvent.num_hci_command_packets = 1; - pBapHCIEvent->u.btampCommandCompleteEvent.command_opcode + pBapHCIEvent->u.btampCommandCompleteEvent.command_opcode = BTAMP_TLV_HCI_READ_LOGICAL_LINK_ACCEPT_TIMEOUT_CMD; pBapHCIEvent->u.btampCommandCompleteEvent.cc_event.Read_Logical_Link_Accept_TO.status = WLANBAP_STATUS_SUCCESS; @@ -814,37 +814,37 @@ WLAN_BAPReadLogicalLinkAcceptTimeout FUNCTION WLAN_BAPWriteLogicalLinkAcceptTimeout() - DESCRIPTION - Implements the actual HCI Write Logical Link Accept Timeout command. There - is no need for a callback because when this call returns the action + DESCRIPTION + Implements the actual HCI Write Logical Link Accept Timeout command. There + is no need for a callback because when this call returns the action has been completed. - DEPENDENCIES - NA. + DEPENDENCIES + NA. - PARAMETERS + PARAMETERS IN btampHandle: pointer to the BAP handle. Returned from WLANBAP_GetNewHndl. pBapHCIWriteLogicalLinkAcceptTimeout: pointer to the "HCI Logical Link Accept Timeout" Structure. - + IN/OUT - pBapHCIEvent: Return event value for the command complete event. - (The caller of this routine is responsible for sending + pBapHCIEvent: Return event value for the command complete event. + (The caller of this routine is responsible for sending the Command Complete event up the HCI interface.) - + RETURN VALUE - The result code associated with performing the operation + The result code associated with performing the operation - VOS_STATUS_E_FAULT: pointer to pBapHCIWriteLogicalLinkAcceptTimeout is NULL + VOS_STATUS_E_FAULT: pointer to pBapHCIWriteLogicalLinkAcceptTimeout is NULL VOS_STATUS_SUCCESS: Success - - SIDE EFFECTS - + + SIDE EFFECTS + ----------------------------------------------------------------------------*/ -VOS_STATUS +VOS_STATUS WLAN_BAPWriteLogicalLinkAcceptTimeout -( +( ptBtampHandle btampHandle, tBtampTLVHCI_Write_Logical_Link_Accept_Timeout_Cmd *pBapHCIWriteLogicalLinkAcceptTimeout, tpBtampHCI_Event pBapHCIEvent /* This now encodes ALL event types */ @@ -857,7 +857,7 @@ WLAN_BAPWriteLogicalLinkAcceptTimeout VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "%s: btampHandle value: %p", __func__, btampHandle); - /* Validate params */ + /* Validate params */ if ((NULL == btampHandle) || (NULL == pBapHCIWriteLogicalLinkAcceptTimeout) || (NULL == pBapHCIEvent)) { @@ -868,7 +868,7 @@ WLAN_BAPWriteLogicalLinkAcceptTimeout /* Validate the allowed timeout interval range */ if ((pBapHCIWriteLogicalLinkAcceptTimeout->logical_link_accept_timeout > - WLANBAP_CON_ACCEPT_TIMEOUT_MAX_RANGE) || + WLANBAP_CON_ACCEPT_TIMEOUT_MAX_RANGE) || (pBapHCIWriteLogicalLinkAcceptTimeout->logical_link_accept_timeout < WLANBAP_CON_ACCEPT_TIMEOUT_MIN_RANGE)) { @@ -881,7 +881,7 @@ WLAN_BAPWriteLogicalLinkAcceptTimeout else { /* Save the Physical link connection accept timeout value */ - btampContext->bapLogicalLinkAcceptTimerInterval = + btampContext->bapLogicalLinkAcceptTimerInterval = pBapHCIWriteLogicalLinkAcceptTimeout->logical_link_accept_timeout; /* Return status for command complete event */ @@ -889,11 +889,11 @@ WLAN_BAPWriteLogicalLinkAcceptTimeout = WLANBAP_STATUS_SUCCESS; } - /* Fill in the parameters for command complete event... */ + /* Fill in the parameters for command complete event... */ pBapHCIEvent->bapHCIEventCode = BTAMP_TLV_HCI_COMMAND_COMPLETE_EVENT; pBapHCIEvent->u.btampCommandCompleteEvent.present = TRUE; pBapHCIEvent->u.btampCommandCompleteEvent.num_hci_command_packets = 1; - pBapHCIEvent->u.btampCommandCompleteEvent.command_opcode + pBapHCIEvent->u.btampCommandCompleteEvent.command_opcode = BTAMP_TLV_HCI_WRITE_LOGICAL_LINK_ACCEPT_TIMEOUT_CMD; return VOS_STATUS_SUCCESS; @@ -903,36 +903,36 @@ WLAN_BAPWriteLogicalLinkAcceptTimeout FUNCTION WLAN_BAPSetEventMaskPage2() - DESCRIPTION - Implements the actual HCI Set Event Mask Page 2 command. There is no need for + DESCRIPTION + Implements the actual HCI Set Event Mask Page 2 command. There is no need for a callback because when this call returns the action has been completed. - DEPENDENCIES - NA. + DEPENDENCIES + NA. - PARAMETERS + PARAMETERS IN btampHandle: pointer to the BAP handle. Returned from WLANBAP_GetNewHndl. pBapHCISetEventMaskPage2: pointer to the "HCI Set Event Mask Page 2" Structure. - + IN/OUT - pBapHCIEvent: Return event value for the command complete event. - (The caller of this routine is responsible for sending + pBapHCIEvent: Return event value for the command complete event. + (The caller of this routine is responsible for sending the Command Complete event up the HCI interface.) - + RETURN VALUE - The result code associated with performing the operation + The result code associated with performing the operation - VOS_STATUS_E_FAULT: pointer to pBapHCISetEventMaskPage2 is NULL + VOS_STATUS_E_FAULT: pointer to pBapHCISetEventMaskPage2 is NULL VOS_STATUS_SUCCESS: Success - - SIDE EFFECTS - + + SIDE EFFECTS + ----------------------------------------------------------------------------*/ -VOS_STATUS +VOS_STATUS WLAN_BAPSetEventMaskPage2 -( +( ptBtampHandle btampHandle, tBtampTLVHCI_Set_Event_Mask_Page_2_Cmd *pBapHCISetEventMaskPage2, tpBtampHCI_Event pBapHCIEvent /* This now encodes ALL event types */ @@ -945,7 +945,7 @@ WLAN_BAPSetEventMaskPage2 VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "%s: btampHandle value: %p", __func__, btampHandle); - /* Validate params */ + /* Validate params */ if ((NULL == btampHandle) || (NULL == pBapHCISetEventMaskPage2) || (NULL == pBapHCIEvent)) { @@ -956,20 +956,20 @@ WLAN_BAPSetEventMaskPage2 /* Save away the event mask */ - vos_mem_copy( - btampContext->event_mask_page_2, - pBapHCISetEventMaskPage2->event_mask_page_2, + vos_mem_copy( + btampContext->event_mask_page_2, + pBapHCISetEventMaskPage2->event_mask_page_2, 8 ); /* Return status for command complete event */ pBapHCIEvent->u.btampCommandCompleteEvent.cc_event.Set_Event_Mask_Page_2.status = WLANBAP_STATUS_SUCCESS; - /* Fill in the parameters for command complete event... */ + /* Fill in the parameters for command complete event... */ pBapHCIEvent->bapHCIEventCode = BTAMP_TLV_HCI_COMMAND_COMPLETE_EVENT; pBapHCIEvent->u.btampCommandCompleteEvent.present = TRUE; pBapHCIEvent->u.btampCommandCompleteEvent.num_hci_command_packets = 1; - pBapHCIEvent->u.btampCommandCompleteEvent.command_opcode + pBapHCIEvent->u.btampCommandCompleteEvent.command_opcode = BTAMP_TLV_HCI_SET_EVENT_MASK_PAGE_2_CMD; return VOS_STATUS_SUCCESS; @@ -979,36 +979,36 @@ WLAN_BAPSetEventMaskPage2 FUNCTION WLAN_BAPReadLocationData() - DESCRIPTION - Implements the actual HCI Read Location Data command. There - is no need for a callback because when this call returns the action + DESCRIPTION + Implements the actual HCI Read Location Data command. There + is no need for a callback because when this call returns the action has been completed. - DEPENDENCIES - NA. + DEPENDENCIES + NA. - PARAMETERS + PARAMETERS IN btampHandle: pointer to the BAP handle. Returned from WLANBAP_GetNewHndl. - + IN/OUT - pBapHCIEvent: Return event value for the command complete event. - (The caller of this routine is responsible for sending + pBapHCIEvent: Return event value for the command complete event. + (The caller of this routine is responsible for sending the Command Complete event up the HCI interface.) - + RETURN VALUE - The result code associated with performing the operation + The result code associated with performing the operation - VOS_STATUS_E_FAULT: pointer to pBapHCIReadLocationData is NULL + VOS_STATUS_E_FAULT: pointer to pBapHCIReadLocationData is NULL VOS_STATUS_SUCCESS: Success - - SIDE EFFECTS - + + SIDE EFFECTS + ----------------------------------------------------------------------------*/ -VOS_STATUS +VOS_STATUS WLAN_BAPReadLocationData -( +( ptBtampHandle btampHandle, tpBtampHCI_Event pBapHCIEvent /* This now encodes ALL event types */ /* Including "Read" Command Complete*/ @@ -1020,7 +1020,7 @@ WLAN_BAPReadLocationData VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "%s: btampHandle value: %p", __func__, btampHandle); - /* Validate params */ + /* Validate params */ if ((NULL == btampHandle) || (NULL == pBapHCIEvent)) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, @@ -1036,20 +1036,20 @@ WLAN_BAPReadLocationData pBapHCIEvent->u.btampCommandCompleteEvent.cc_event.Read_Location_Data.loc_options = btampContext->btamp_Location_Data_Info.loc_options; - vos_mem_copy( + vos_mem_copy( pBapHCIEvent->u.btampCommandCompleteEvent.cc_event.Read_Location_Data.loc_domain, - btampContext->btamp_Location_Data_Info.loc_domain, + btampContext->btamp_Location_Data_Info.loc_domain, 3 ); /* Return status for command complete event */ pBapHCIEvent->u.btampCommandCompleteEvent.cc_event.Read_Location_Data.status = WLANBAP_STATUS_SUCCESS; - /* Fill in the parameters for command complete event... */ + /* Fill in the parameters for command complete event... */ pBapHCIEvent->bapHCIEventCode = BTAMP_TLV_HCI_COMMAND_COMPLETE_EVENT; pBapHCIEvent->u.btampCommandCompleteEvent.present = TRUE; pBapHCIEvent->u.btampCommandCompleteEvent.num_hci_command_packets = 1; - pBapHCIEvent->u.btampCommandCompleteEvent.command_opcode + pBapHCIEvent->u.btampCommandCompleteEvent.command_opcode = BTAMP_TLV_HCI_READ_LOCATION_DATA_CMD; return VOS_STATUS_SUCCESS; @@ -1059,37 +1059,37 @@ WLAN_BAPReadLocationData FUNCTION WLAN_BAPWriteLocationData() - DESCRIPTION - Implements the actual HCI Write Location Data command. There - is no need for a callback because when this call returns the action + DESCRIPTION + Implements the actual HCI Write Location Data command. There + is no need for a callback because when this call returns the action has been completed. - DEPENDENCIES - NA. + DEPENDENCIES + NA. - PARAMETERS + PARAMETERS IN btampHandle: pointer to the BAP handle. Returned from WLANBAP_GetNewHndl. pBapHCIWriteLocationData: pointer to the "HCI Write Location Data" Structure. - + IN/OUT - pBapHCIEvent: Return event value for the command complete event. - (The caller of this routine is responsible for sending + pBapHCIEvent: Return event value for the command complete event. + (The caller of this routine is responsible for sending the Command Complete event up the HCI interface.) - + RETURN VALUE - The result code associated with performing the operation + The result code associated with performing the operation - VOS_STATUS_E_FAULT: pointer to pBapHCIWriteLocationData is NULL + VOS_STATUS_E_FAULT: pointer to pBapHCIWriteLocationData is NULL VOS_STATUS_SUCCESS: Success - - SIDE EFFECTS - + + SIDE EFFECTS + ----------------------------------------------------------------------------*/ -VOS_STATUS +VOS_STATUS WLAN_BAPWriteLocationData -( +( ptBtampHandle btampHandle, tBtampTLVHCI_Write_Location_Data_Cmd *pBapHCIWriteLocationData, tpBtampHCI_Event pBapHCIEvent /* This now encodes ALL event types */ @@ -1102,7 +1102,7 @@ WLAN_BAPWriteLocationData VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "%s: btampHandle value: %p", __func__, btampHandle); - /* Validate params */ + /* Validate params */ if ((NULL == btampHandle) || (NULL == pBapHCIWriteLocationData) || (NULL == pBapHCIEvent)) { @@ -1113,26 +1113,26 @@ WLAN_BAPWriteLocationData btampContext = (ptBtampContext) btampHandle; - btampContext->btamp_Location_Data_Info.loc_domain_aware = + btampContext->btamp_Location_Data_Info.loc_domain_aware = pBapHCIWriteLocationData->loc_domain_aware; - - btampContext->btamp_Location_Data_Info.loc_options = + + btampContext->btamp_Location_Data_Info.loc_options = pBapHCIWriteLocationData->loc_options; - vos_mem_copy( - btampContext->btamp_Location_Data_Info.loc_domain, - pBapHCIWriteLocationData->loc_domain, + vos_mem_copy( + btampContext->btamp_Location_Data_Info.loc_domain, + pBapHCIWriteLocationData->loc_domain, 3 ); /* Return status for command complete event */ pBapHCIEvent->u.btampCommandCompleteEvent.cc_event.Write_Location_Data.status = WLANBAP_STATUS_SUCCESS; - /* Fill in the parameters for command complete event... */ + /* Fill in the parameters for command complete event... */ pBapHCIEvent->bapHCIEventCode = BTAMP_TLV_HCI_COMMAND_COMPLETE_EVENT; pBapHCIEvent->u.btampCommandCompleteEvent.present = TRUE; pBapHCIEvent->u.btampCommandCompleteEvent.num_hci_command_packets = 1; - pBapHCIEvent->u.btampCommandCompleteEvent.command_opcode + pBapHCIEvent->u.btampCommandCompleteEvent.command_opcode = BTAMP_TLV_HCI_WRITE_LOCATION_DATA_CMD; return VOS_STATUS_SUCCESS; @@ -1143,36 +1143,36 @@ WLAN_BAPWriteLocationData FUNCTION WLAN_BAPReadFlowControlMode() - DESCRIPTION - Implements the actual HCI Read Flow Control Mode command. There - is no need for a callback because when this call returns the action + DESCRIPTION + Implements the actual HCI Read Flow Control Mode command. There + is no need for a callback because when this call returns the action has been completed. - DEPENDENCIES - NA. + DEPENDENCIES + NA. - PARAMETERS + PARAMETERS IN btampHandle: pointer to the BAP handle. Returned from WLANBAP_GetNewHndl. - + IN/OUT - pBapHCIEvent: Return event value for the command complete event. - (The caller of this routine is responsible for sending + pBapHCIEvent: Return event value for the command complete event. + (The caller of this routine is responsible for sending the Command Complete event up the HCI interface.) - + RETURN VALUE - The result code associated with performing the operation + The result code associated with performing the operation - VOS_STATUS_E_FAULT: pointer to pBapHCIReadFlowControlMode is NULL + VOS_STATUS_E_FAULT: pointer to pBapHCIReadFlowControlMode is NULL VOS_STATUS_SUCCESS: Success - - SIDE EFFECTS - + + SIDE EFFECTS + ----------------------------------------------------------------------------*/ -VOS_STATUS +VOS_STATUS WLAN_BAPReadFlowControlMode -( +( ptBtampHandle btampHandle, tpBtampHCI_Event pBapHCIEvent /* This now encodes ALL event types */ /* Including "Read" Command Complete*/ @@ -1183,7 +1183,7 @@ WLAN_BAPReadFlowControlMode VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "%s: btampHandle value: %p", __func__, btampHandle); - /* Validate params */ + /* Validate params */ if ((NULL == btampHandle) || (NULL == pBapHCIEvent)) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, @@ -1191,11 +1191,11 @@ WLAN_BAPReadFlowControlMode return VOS_STATUS_E_FAULT; } - /* Fill in the parameters for command complete event... */ + /* Fill in the parameters for command complete event... */ pBapHCIEvent->bapHCIEventCode = BTAMP_TLV_HCI_COMMAND_COMPLETE_EVENT; pBapHCIEvent->u.btampCommandCompleteEvent.present = TRUE; pBapHCIEvent->u.btampCommandCompleteEvent.num_hci_command_packets = 1; - pBapHCIEvent->u.btampCommandCompleteEvent.command_opcode + pBapHCIEvent->u.btampCommandCompleteEvent.command_opcode = BTAMP_TLV_HCI_READ_FLOW_CONTROL_MODE_CMD; pBapHCIEvent->u.btampCommandCompleteEvent.cc_event.Read_Flow_Control_Mode.status = WLANBAP_STATUS_SUCCESS; @@ -1209,37 +1209,37 @@ WLAN_BAPReadFlowControlMode FUNCTION WLAN_BAPWriteFlowControlMode() - DESCRIPTION - Implements the actual HCI Write Flow Control Mode command. There - is no need for a callback because when this call returns the action + DESCRIPTION + Implements the actual HCI Write Flow Control Mode command. There + is no need for a callback because when this call returns the action has been completed. - DEPENDENCIES - NA. + DEPENDENCIES + NA. - PARAMETERS + PARAMETERS IN btampHandle: pointer to the BAP handle. Returned from WLANBAP_GetNewHndl. pBapHCIWriteFlowControlMode: pointer to the "HCI Write Flow Control Mode" Structure. - + IN/OUT - pBapHCIEvent: Return event value for the command complete event. - (The caller of this routine is responsible for sending + pBapHCIEvent: Return event value for the command complete event. + (The caller of this routine is responsible for sending the Command Complete event up the HCI interface.) - + RETURN VALUE - The result code associated with performing the operation + The result code associated with performing the operation - VOS_STATUS_E_FAULT: pointer to pBapHCIWriteFlowControlMode is NULL + VOS_STATUS_E_FAULT: pointer to pBapHCIWriteFlowControlMode is NULL VOS_STATUS_SUCCESS: Success - - SIDE EFFECTS - + + SIDE EFFECTS + ----------------------------------------------------------------------------*/ -VOS_STATUS +VOS_STATUS WLAN_BAPWriteFlowControlMode -( +( ptBtampHandle btampHandle, tBtampTLVHCI_Write_Flow_Control_Mode_Cmd *pBapHCIWriteFlowControlMode, tpBtampHCI_Event pBapHCIEvent /* This now encodes ALL event types */ @@ -1254,36 +1254,36 @@ WLAN_BAPWriteFlowControlMode FUNCTION WLAN_BAPReadBestEffortFlushTimeout() - DESCRIPTION - Implements the actual HCI Read Best Effort Flush Timeout command. There - is no need for a callback because when this call returns the action + DESCRIPTION + Implements the actual HCI Read Best Effort Flush Timeout command. There + is no need for a callback because when this call returns the action has been completed. - DEPENDENCIES - NA. + DEPENDENCIES + NA. - PARAMETERS + PARAMETERS IN btampHandle: pointer to the BAP handle. Returned from WLANBAP_GetNewHndl. - + IN/OUT - pBapHCIEvent: Return event value for the command complete event. - (The caller of this routine is responsible for sending + pBapHCIEvent: Return event value for the command complete event. + (The caller of this routine is responsible for sending the Command Complete event up the HCI interface.) - + RETURN VALUE - The result code associated with performing the operation + The result code associated with performing the operation - VOS_STATUS_E_FAULT: pointer to pBapHCIReadBEFlushTO is NULL + VOS_STATUS_E_FAULT: pointer to pBapHCIReadBEFlushTO is NULL VOS_STATUS_SUCCESS: Success - - SIDE EFFECTS - + + SIDE EFFECTS + ----------------------------------------------------------------------------*/ -VOS_STATUS +VOS_STATUS WLAN_BAPReadBestEffortFlushTimeout -( +( ptBtampHandle btampHandle, /* The log_link_hanlde identifies which logical link's BE TO*/ tBtampTLVHCI_Read_Best_Effort_Flush_Timeout_Cmd *pBapHCIReadBEFlushTO, @@ -1299,37 +1299,37 @@ WLAN_BAPReadBestEffortFlushTimeout FUNCTION WLAN_BAPWriteBestEffortFlushTimeout() - DESCRIPTION - Implements the actual HCI Write Best Effort Flush TO command. There - is no need for a callback because when this call returns the action + DESCRIPTION + Implements the actual HCI Write Best Effort Flush TO command. There + is no need for a callback because when this call returns the action has been completed. - DEPENDENCIES - NA. + DEPENDENCIES + NA. - PARAMETERS + PARAMETERS IN btampHandle: pointer to the BAP handle. Returned from WLANBAP_GetNewHndl. pBapHCIWriteBEFlushTO: pointer to the "HCI Write BE Flush TO" Structure. - + IN/OUT - pBapHCIEvent: Return event value for the command complete event. - (The caller of this routine is responsible for sending + pBapHCIEvent: Return event value for the command complete event. + (The caller of this routine is responsible for sending the Command Complete event up the HCI interface.) - + RETURN VALUE - The result code associated with performing the operation + The result code associated with performing the operation - VOS_STATUS_E_FAULT: pointer to pBapHCIWriteBEFlushTO is NULL + VOS_STATUS_E_FAULT: pointer to pBapHCIWriteBEFlushTO is NULL VOS_STATUS_SUCCESS: Success - - SIDE EFFECTS - + + SIDE EFFECTS + ----------------------------------------------------------------------------*/ -VOS_STATUS +VOS_STATUS WLAN_BAPWriteBestEffortFlushTimeout -( +( ptBtampHandle btampHandle, tBtampTLVHCI_Write_Best_Effort_Flush_Timeout_Cmd *pBapHCIWriteBEFlushTO, tpBtampHCI_Event pBapHCIEvent /* This now encodes ALL event types */ @@ -1345,36 +1345,36 @@ WLAN_BAPWriteBestEffortFlushTimeout FUNCTION WLAN_BAPSetShortRangeMode() - DESCRIPTION - Implements the actual HCI Set Short Range Mode command. There is no need for + DESCRIPTION + Implements the actual HCI Set Short Range Mode command. There is no need for a callback because when this call returns the action has been completed. - DEPENDENCIES - NA. + DEPENDENCIES + NA. - PARAMETERS + PARAMETERS IN btampHandle: pointer to the BAP handle. Returned from WLANBAP_GetNewHndl. pBapHCIShortRangeMode: pointer to the "HCI Set Short Range Mode" Structure. - + IN/OUT - pBapHCIEvent: Return event value for the command complete event. - (The caller of this routine is responsible for sending + pBapHCIEvent: Return event value for the command complete event. + (The caller of this routine is responsible for sending the Command Complete event up the HCI interface.) - + RETURN VALUE - The result code associated with performing the operation + The result code associated with performing the operation - VOS_STATUS_E_FAULT: pointer to pBapHCIShortRangeMode is NULL + VOS_STATUS_E_FAULT: pointer to pBapHCIShortRangeMode is NULL VOS_STATUS_SUCCESS: Success - - SIDE EFFECTS - + + SIDE EFFECTS + ----------------------------------------------------------------------------*/ -VOS_STATUS +VOS_STATUS WLAN_BAPSetShortRangeMode -( +( ptBtampHandle btampHandle, tBtampTLVHCI_Set_Short_Range_Mode_Cmd *pBapHCIShortRangeMode, tpBtampHCI_Event pBapHCIEvent /* This now encodes ALL event types */ @@ -1438,7 +1438,7 @@ WLAN_BAPSetShortRangeMode VOS_FALSE /* Flag to indicate assoc-specific event */ ); - /* Format the Short Range Mode Complete event to return... */ + /* Format the Short Range Mode Complete event to return... */ pBapHCIEvent->bapHCIEventCode = BTAMP_TLV_HCI_SHORT_RANGE_MODE_CHANGE_COMPLETE_EVENT; pBapHCIEvent->u.btampShortRangeModeChangeCompleteEvent.present = 1; @@ -1655,31 +1655,31 @@ WLAN_BAPVendorSpecificCmd1 /*---------------------------------------------------------------------------- - DESCRIPTION + DESCRIPTION Callback registered with TL for BAP, this is required in order for - TL to inform BAP, that the flush operation requested has been completed. - - The registered reception callback is being triggered by TL whenever a + TL to inform BAP, that the flush operation requested has been completed. + + The registered reception callback is being triggered by TL whenever a frame SIR_TL_HAL_FLUSH_AC_RSP is received by TL from HAL. - PARAMETERS + PARAMETERS IN - pvosGCtx: pointer to the global vos context; a handle to TL's - or SME's control block can be extracted from its context + pvosGCtx: pointer to the global vos context; a handle to TL's + or SME's control block can be extracted from its context ucStaId: station identifier for the requested value - ucTid: identifier of the tspec + ucTid: identifier of the tspec status: status of the Flush operation - - RETURN VALUE + + RETURN VALUE The result code associated with performing the operation ----------------------------------------------------------------------------*/ VOS_STATUS WLANBAP_TLFlushCompCallback -( +( v_PVOID_t pvosGCtx, - v_U8_t ucStaId, - v_U8_t ucTID, + v_U8_t ucStaId, + v_U8_t ucTID, v_U8_t status ) { @@ -1689,8 +1689,3 @@ VOS_STATUS WLANBAP_TLFlushCompCallback /* End of v3.0 Host Controller and Baseband Commands */ - - - - - diff --git a/CORE/BAP/src/bapApiInfo.c b/CORE/BAP/src/bapApiInfo.c index c7aa0947f935..29b29314cd4c 100644 --- a/CORE/BAP/src/bapApiInfo.c +++ b/CORE/BAP/src/bapApiInfo.c @@ -28,16 +28,16 @@ /*=========================================================================== b a p A p i I n f o . C - + OVERVIEW: - + This software unit holds the implementation of the WLAN BAP modules Information functions. - - The functions externalized by this module are to be called ONLY by other + + The functions externalized by this module are to be called ONLY by other WLAN modules (HDD) that properly register with the BAP Layer initially. - DEPENDENCIES: + DEPENDENCIES: Are listed for each API below. ===========================================================================*/ @@ -66,9 +66,9 @@ //#include "wlan_qct_tl.h" #include "vos_trace.h" #include "sme_Api.h" -/* BT-AMP PAL API header file */ -#include "bapApi.h" -#include "bapInternal.h" +/* BT-AMP PAL API header file */ +#include "bapApi.h" +#include "bapInternal.h" //#define BAP_DEBUG /*---------------------------------------------------------------------------- @@ -107,45 +107,45 @@ FUNCTION WLAN_BAPReadLocalVersionInfo() - DESCRIPTION - Implements the actual HCI Read Local Version Info command. There - is no need for a callback because when this call returns the action + DESCRIPTION + Implements the actual HCI Read Local Version Info command. There + is no need for a callback because when this call returns the action has been completed. - DEPENDENCIES - NA. + DEPENDENCIES + NA. - PARAMETERS + PARAMETERS IN btampHandle: pointer to the BAP handle. Returned from WLANBAP_GetNewHndl. - // There are really no input parameters in this command. + // There are really no input parameters in this command. // Just the command opcode itself is sufficient. - + IN/OUT - pBapHCIEvent: Return event value for the command complete event. - (The caller of this routine is responsible for sending + pBapHCIEvent: Return event value for the command complete event. + (The caller of this routine is responsible for sending the Command Complete event up the HCI interface.) - + RETURN VALUE - The result code associated with performing the operation + The result code associated with performing the operation - VOS_STATUS_E_FAULT: pointer to pBapHCIReadLocalVersionInfo is NULL + VOS_STATUS_E_FAULT: pointer to pBapHCIReadLocalVersionInfo is NULL VOS_STATUS_SUCCESS: Success - - SIDE EFFECTS - + + SIDE EFFECTS + ----------------------------------------------------------------------------*/ -VOS_STATUS +VOS_STATUS WLAN_BAPReadLocalVersionInfo -( +( ptBtampHandle btampHandle, tpBtampHCI_Event pBapHCIEvent /* This now encodes ALL event types */ /* Including "Read" Command Complete*/ ) { - /* Validate params */ + /* Validate params */ if (btampHandle == NULL) { return VOS_STATUS_E_FAULT; } @@ -154,13 +154,13 @@ WLAN_BAPReadLocalVersionInfo VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "%s: btampHandle value: %p", __func__, btampHandle); - /* Format the command complete event to return... */ + /* Format the command complete event to return... */ pBapHCIEvent->bapHCIEventCode = BTAMP_TLV_HCI_COMMAND_COMPLETE_EVENT; pBapHCIEvent->u.btampCommandCompleteEvent.present = 1; pBapHCIEvent->u.btampCommandCompleteEvent.num_hci_command_packets = 1; - pBapHCIEvent->u.btampCommandCompleteEvent.command_opcode + pBapHCIEvent->u.btampCommandCompleteEvent.command_opcode = BTAMP_TLV_HCI_READ_LOCAL_VERSION_INFO_CMD; - pBapHCIEvent->u.btampCommandCompleteEvent.cc_event.Read_Local_Version_Info.status + pBapHCIEvent->u.btampCommandCompleteEvent.cc_event.Read_Local_Version_Info.status = WLANBAP_STATUS_SUCCESS; pBapHCIEvent->u.btampCommandCompleteEvent.cc_event.Read_Local_Version_Info.HC_HCI_Version = WLANBAP_HCI_VERSION; @@ -180,38 +180,38 @@ WLAN_BAPReadLocalVersionInfo FUNCTION WLAN_BAPReadLocalSupportedCmds() - DESCRIPTION - Implements the actual HCI Read Local Supported Commands. There - is no need for a callback because when this call returns the action + DESCRIPTION + Implements the actual HCI Read Local Supported Commands. There + is no need for a callback because when this call returns the action has been completed. - DEPENDENCIES - NA. + DEPENDENCIES + NA. - PARAMETERS + PARAMETERS IN btampHandle: pointer to the BAP handle. Returned from WLANBAP_GetNewHndl. - // There are really no input parameters in this command. + // There are really no input parameters in this command. // Just the command opcode itself is sufficient. - + IN/OUT - pBapHCIEvent: Return event value for the command complete event. - (The caller of this routine is responsible for sending + pBapHCIEvent: Return event value for the command complete event. + (The caller of this routine is responsible for sending the Command Complete event up the HCI interface.) - + RETURN VALUE - The result code associated with performing the operation + The result code associated with performing the operation - VOS_STATUS_E_FAULT: pointer to pBapHCIReadLocalSupportedCmds is NULL + VOS_STATUS_E_FAULT: pointer to pBapHCIReadLocalSupportedCmds is NULL VOS_STATUS_SUCCESS: Success - - SIDE EFFECTS - + + SIDE EFFECTS + ----------------------------------------------------------------------------*/ -VOS_STATUS +VOS_STATUS WLAN_BAPReadLocalSupportedCmds -( +( ptBtampHandle btampHandle, tpBtampHCI_Event pBapHCIEvent /* This now encodes ALL event types */ /* Including "Read" Command Complete*/ @@ -221,7 +221,7 @@ WLAN_BAPReadLocalSupportedCmds /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ - /* Validate params */ + /* Validate params */ if (btampHandle == NULL) { return VOS_STATUS_E_FAULT; } @@ -230,19 +230,19 @@ WLAN_BAPReadLocalSupportedCmds VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "%s: btampHandle value: %p", __func__, btampHandle); - /* Format the command complete event to return... */ + /* Format the command complete event to return... */ pBapHCIEvent->bapHCIEventCode = BTAMP_TLV_HCI_COMMAND_COMPLETE_EVENT; pBapHCIEvent->u.btampCommandCompleteEvent.present = 1; pBapHCIEvent->u.btampCommandCompleteEvent.num_hci_command_packets = 1; - pBapHCIEvent->u.btampCommandCompleteEvent.command_opcode + pBapHCIEvent->u.btampCommandCompleteEvent.command_opcode = BTAMP_TLV_HCI_READ_LOCAL_SUPPORTED_CMDS_CMD; - pBapHCIEvent->u.btampCommandCompleteEvent.cc_event.Read_Local_Supported_Cmds.status + pBapHCIEvent->u.btampCommandCompleteEvent.cc_event.Read_Local_Supported_Cmds.status = WLANBAP_STATUS_SUCCESS; - /* Return the supported commands bitmask */ - vos_mem_copy( + /* Return the supported commands bitmask */ + vos_mem_copy( pBapHCIEvent->u.btampCommandCompleteEvent.cc_event.Read_Local_Supported_Cmds.HC_Support_Cmds, supportedCmds, - sizeof( supportedCmds)); + sizeof( supportedCmds)); return VOS_STATUS_SUCCESS; } /* WLAN_BAPReadLocalSupportedCmds */ @@ -251,43 +251,43 @@ WLAN_BAPReadLocalSupportedCmds FUNCTION WLAN_BAPReadBufferSize() - DESCRIPTION - Implements the actual HCI Read Buffer Size command. There - is no need for a callback because when this call returns the action + DESCRIPTION + Implements the actual HCI Read Buffer Size command. There + is no need for a callback because when this call returns the action has been completed. - DEPENDENCIES - NA. + DEPENDENCIES + NA. - PARAMETERS + PARAMETERS IN btampHandle: pointer to the BAP handle. Returned from WLANBAP_GetNewHndl. pBapHCIReadBufferSize: pointer to the "HCI Read Buffer Size" Structure. - + IN/OUT - pBapHCIEvent: Return event value for the command complete event. - (The caller of this routine is responsible for sending + pBapHCIEvent: Return event value for the command complete event. + (The caller of this routine is responsible for sending the Command Complete event up the HCI interface.) - + RETURN VALUE - The result code associated with performing the operation + The result code associated with performing the operation - VOS_STATUS_E_FAULT: pointer to pBapHCIReadBufferSize is NULL + VOS_STATUS_E_FAULT: pointer to pBapHCIReadBufferSize is NULL VOS_STATUS_SUCCESS: Success - - SIDE EFFECTS - + + SIDE EFFECTS + ----------------------------------------------------------------------------*/ -VOS_STATUS +VOS_STATUS WLAN_BAPReadBufferSize -( +( ptBtampHandle btampHandle, tpBtampHCI_Event pBapHCIEvent /* This now encodes ALL event types */ /* Including "Read" Command Complete*/ ) { - /* Validate params */ + /* Validate params */ if (btampHandle == NULL) { return VOS_STATUS_E_FAULT; } @@ -296,15 +296,15 @@ WLAN_BAPReadBufferSize VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "%s: btampHandle value: %p", __func__, btampHandle); - /* Format the command complete event to return... */ + /* Format the command complete event to return... */ pBapHCIEvent->bapHCIEventCode = BTAMP_TLV_HCI_COMMAND_COMPLETE_EVENT; pBapHCIEvent->u.btampCommandCompleteEvent.present = 1; pBapHCIEvent->u.btampCommandCompleteEvent.num_hci_command_packets = 1; - pBapHCIEvent->u.btampCommandCompleteEvent.command_opcode + pBapHCIEvent->u.btampCommandCompleteEvent.command_opcode = BTAMP_TLV_HCI_READ_BUFFER_SIZE_CMD; - pBapHCIEvent->u.btampCommandCompleteEvent.cc_event.Read_Buffer_Size.status + pBapHCIEvent->u.btampCommandCompleteEvent.cc_event.Read_Buffer_Size.status = WLANBAP_STATUS_SUCCESS; - /* Return the supported Buffer sizes */ + /* Return the supported Buffer sizes */ pBapHCIEvent->u.btampCommandCompleteEvent.cc_event.Read_Buffer_Size.HC_ACL_Data_Packet_Length = WLANBAP_MAX_80211_PAL_PDU_SIZE; pBapHCIEvent->u.btampCommandCompleteEvent.cc_event.Read_Buffer_Size.HC_SCO_Packet_Length @@ -321,42 +321,42 @@ WLAN_BAPReadBufferSize FUNCTION WLAN_BAPReadDataBlockSize() - DESCRIPTION - Implements the actual HCI Read Data Block Size command. There - is no need for a callback because when this call returns the action + DESCRIPTION + Implements the actual HCI Read Data Block Size command. There + is no need for a callback because when this call returns the action has been completed. - DEPENDENCIES - NA. + DEPENDENCIES + NA. - PARAMETERS + PARAMETERS IN btampHandle: pointer to the BAP handle. Returned from WLANBAP_GetNewHndl. - + IN/OUT - pBapHCIEvent: Return event value for the command complete event. - (The caller of this routine is responsible for sending + pBapHCIEvent: Return event value for the command complete event. + (The caller of this routine is responsible for sending the Command Complete event up the HCI interface.) - + RETURN VALUE - The result code associated with performing the operation + The result code associated with performing the operation - VOS_STATUS_E_FAULT: pointer to pBapHCIReadDataBlockSize is NULL + VOS_STATUS_E_FAULT: pointer to pBapHCIReadDataBlockSize is NULL VOS_STATUS_SUCCESS: Success - - SIDE EFFECTS - + + SIDE EFFECTS + ----------------------------------------------------------------------------*/ -VOS_STATUS +VOS_STATUS WLAN_BAPReadDataBlockSize -( +( ptBtampHandle btampHandle, tpBtampHCI_Event pBapHCIEvent /* This now encodes ALL event types */ /* Including "Read" Command Complete*/ ) { - /* Validate params */ + /* Validate params */ if ((btampHandle == NULL) || (NULL == pBapHCIEvent)) { return VOS_STATUS_E_FAULT; @@ -366,15 +366,15 @@ WLAN_BAPReadDataBlockSize VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "%s: btampHandle value: %p", __func__, btampHandle); - /* Format the command complete event to return... */ + /* Format the command complete event to return... */ pBapHCIEvent->bapHCIEventCode = BTAMP_TLV_HCI_COMMAND_COMPLETE_EVENT; pBapHCIEvent->u.btampCommandCompleteEvent.present = 1; pBapHCIEvent->u.btampCommandCompleteEvent.num_hci_command_packets = 1; - pBapHCIEvent->u.btampCommandCompleteEvent.command_opcode + pBapHCIEvent->u.btampCommandCompleteEvent.command_opcode = BTAMP_TLV_HCI_READ_DATA_BLOCK_SIZE_CMD; - pBapHCIEvent->u.btampCommandCompleteEvent.cc_event.Read_Data_Block_Size.status + pBapHCIEvent->u.btampCommandCompleteEvent.cc_event.Read_Data_Block_Size.status = WLANBAP_STATUS_SUCCESS; - /* Return the supported Block sizes */ + /* Return the supported Block sizes */ pBapHCIEvent->u.btampCommandCompleteEvent.cc_event.Read_Data_Block_Size.HC_Data_Block_Length = WLANBAP_MAX_80211_PAL_PDU_SIZE; pBapHCIEvent->u.btampCommandCompleteEvent.cc_event.Read_Data_Block_Size.HC_Max_ACL_Data_Packet_Length @@ -390,48 +390,48 @@ WLAN_BAPReadDataBlockSize FUNCTION WLAN_BAPSetConfig() - DESCRIPTION + DESCRIPTION The function updates some configuration for BAP module in SME during SMEs close -> open sequence. - + BAP applies the new configuration at the next transaction. - DEPENDENCIES - NA. + DEPENDENCIES + NA. - PARAMETERS + PARAMETERS IN btampHandle: pointer to the BAP handle. Returned from WLANBAP_GetNewHndl. pBapHCIReadRSSI: pointer to the "HCI Read RSSI" structure. - + IN pConfig: a pointer to a caller allocated object of typedef struct WLANBAP_ConfigType. - + RETURN VALUE - The result code associated with performing the operation + The result code associated with performing the operation - VOS_STATUS_E_FAULT: pConfig or btampHandle is NULL + VOS_STATUS_E_FAULT: pConfig or btampHandle is NULL VOS_STATUS_SUCCESS: Success - - SIDE EFFECTS - + + SIDE EFFECTS + ----------------------------------------------------------------------------*/ -VOS_STATUS +VOS_STATUS WLAN_BAPSetConfig -( +( ptBtampHandle btampHandle, WLANBAP_ConfigType *pConfig ) { ptBtampContext btampContext; - /* Validate params */ - if ((NULL == btampHandle)|| (NULL == pConfig)) + /* Validate params */ + if ((NULL == btampHandle)|| (NULL == pConfig)) { return VOS_STATUS_E_FAULT; } - btampContext = (ptBtampContext) btampHandle; /* btampContext value */ + btampContext = (ptBtampContext) btampHandle; /* btampContext value */ btampContext->config.ucPreferredChannel = pConfig->ucPreferredChannel; return VOS_STATUS_SUCCESS; @@ -441,46 +441,46 @@ WLAN_BAPSetConfig FUNCTION WLAN_BAPGetMask() - DESCRIPTION + DESCRIPTION The function gets the updated event mask from BAP core. - - DEPENDENCIES - NA. - PARAMETERS + DEPENDENCIES + NA. + + PARAMETERS IN btampHandle: pointer to the BAP handle. Returned from WLANBAP_GetNewHndl. - - + + IN pEvent_mask_page_2: a pointer to a caller allocated object of 8 bytes. - + RETURN VALUE - The result code associated with performing the operation + The result code associated with performing the operation - VOS_STATUS_E_FAULT: pEvent_mask_page_2 or btampHandle is NULL + VOS_STATUS_E_FAULT: pEvent_mask_page_2 or btampHandle is NULL VOS_STATUS_SUCCESS: Success - - SIDE EFFECTS - + + SIDE EFFECTS + ----------------------------------------------------------------------------*/ VOS_STATUS -WLAN_BAPGetMask( ptBtampHandle btampHandle, +WLAN_BAPGetMask( ptBtampHandle btampHandle, v_U8_t *pEvent_mask_page_2) { ptBtampContext btampContext; - /* Validate params */ - if ((NULL == btampHandle)|| (NULL == pEvent_mask_page_2)) + /* Validate params */ + if ((NULL == btampHandle)|| (NULL == pEvent_mask_page_2)) { return VOS_STATUS_E_FAULT; } - btampContext = (ptBtampContext) btampHandle; /* btampContext value */ + btampContext = (ptBtampContext) btampHandle; /* btampContext value */ - vos_mem_copy( pEvent_mask_page_2, - btampContext->event_mask_page_2, + vos_mem_copy( pEvent_mask_page_2, + btampContext->event_mask_page_2, 8 ); return VOS_STATUS_SUCCESS; } @@ -489,32 +489,32 @@ WLAN_BAPGetMask( ptBtampHandle btampHandle, FUNCTION WLAN_BAPDisconnect() - DESCRIPTION + DESCRIPTION The function to request to BAP core to disconnect currecnt AMP connection. - - DEPENDENCIES - NA. - PARAMETERS + DEPENDENCIES + NA. + + PARAMETERS IN btampHandle: pointer to the BAP handle. Returned from WLANBAP_GetNewHndl. - - + + RETURN VALUE - The result code associated with performing the operation + The result code associated with performing the operation - VOS_STATUS_E_FAULT: btampHandle is NULL + VOS_STATUS_E_FAULT: btampHandle is NULL VOS_STATUS_SUCCESS: Success - - SIDE EFFECTS - + + SIDE EFFECTS + ----------------------------------------------------------------------------*/ -VOS_STATUS +VOS_STATUS WLAN_BAPDisconnect -( +( ptBtampHandle btampHandle ) { @@ -526,8 +526,8 @@ WLAN_BAPDisconnect VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_FATAL, "%s: btampHandle value: %p", __func__, btampHandle); - /* Validate params */ - if (btampHandle == NULL) + /* Validate params */ + if (btampHandle == NULL) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_FATAL, "btampHandle is NULL in %s", __func__); @@ -535,20 +535,20 @@ WLAN_BAPDisconnect return VOS_STATUS_E_FAULT; } - /* Fill in the event structure */ + /* Fill in the event structure */ bapEvent.event = eWLAN_BAP_MAC_INDICATES_MEDIA_DISCONNECTION; bapEvent.params = NULL; - /* Handle event */ + /* Handle event */ vosStatus = btampFsm(btampContext, &bapEvent, &status); - /* Fill in the event structure */ + /* Fill in the event structure */ bapEvent.event = eWLAN_BAP_MAC_READY_FOR_CONNECTIONS; bapEvent.params = NULL; - /* Handle event */ + /* Handle event */ vosStatus = btampFsm(btampContext, &bapEvent, &status); @@ -559,31 +559,31 @@ WLAN_BAPDisconnect FUNCTION WLAN_BAPSessionOn() - DESCRIPTION + DESCRIPTION The function to check from BAP core if AMP connection is up right now. - - DEPENDENCIES - NA. - PARAMETERS + DEPENDENCIES + NA. + + PARAMETERS IN btampHandle: pointer to the BAP handle. Returned from WLANBAP_GetNewHndl. RETURN VALUE - The result code associated with performing the operation + The result code associated with performing the operation - VOS_TRUE: AMP connection is on + VOS_TRUE: AMP connection is on VOS_FALSE: AMP connection is not on - - SIDE EFFECTS - + + SIDE EFFECTS + ----------------------------------------------------------------------------*/ v_BOOL_t WLAN_BAPSessionOn -( +( ptBtampHandle btampHandle ) { @@ -592,8 +592,8 @@ v_BOOL_t WLAN_BAPSessionOn VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "%s: btampHandle value: %p", __func__, btampHandle); - /* Validate params */ - if (btampHandle == NULL) + /* Validate params */ + if (btampHandle == NULL) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "btampHandle is NULL in %s", __func__); diff --git a/CORE/BAP/src/bapApiLinkCntl.c b/CORE/BAP/src/bapApiLinkCntl.c index f2302d153e77..7531a017eef8 100644 --- a/CORE/BAP/src/bapApiLinkCntl.c +++ b/CORE/BAP/src/bapApiLinkCntl.c @@ -28,16 +28,16 @@ /*=========================================================================== b a p A p i L i n k C n t l . C - + OVERVIEW: - + This software unit holds the implementation of the WLAN BAP modules Link Control functions. - - The functions externalized by this module are to be called ONLY by other + + The functions externalized by this module are to be called ONLY by other WLAN modules (HDD) that properly register with the BAP Layer initially. - DEPENDENCIES: + DEPENDENCIES: Are listed for each API below. ===========================================================================*/ @@ -68,9 +68,9 @@ // Pick up the CSR callback definition #include "csrApi.h" -/* BT-AMP PAL API header file */ -#include "bapApi.h" -#include "bapInternal.h" +/* BT-AMP PAL API header file */ +#include "bapApi.h" +#include "bapInternal.h" #include "btampFsm.h" //#define BAP_DEBUG @@ -107,13 +107,13 @@ FUNCTION WLANBAP_RoamCallback() - DESCRIPTION - Callback for Roam (connection status) Events + DESCRIPTION + Callback for Roam (connection status) Events - DEPENDENCIES - NA. + DEPENDENCIES + NA. - PARAMETERS + PARAMETERS IN pContext: is the pContext passed in with the roam request @@ -122,20 +122,20 @@ roamId: is to identify the callback related roam request. 0 means unsolicited roamStatus: is a flag indicating the status of the callback roamResult: is the result - + RETURN VALUE - The eHalStatus code associated with performing the operation + The eHalStatus code associated with performing the operation eHAL_STATUS_SUCCESS: Success - - SIDE EFFECTS - + + SIDE EFFECTS + ----------------------------------------------------------------------------*/ #if 0 -eCSR_ROAM_RESULT_WDS_STARTED +eCSR_ROAM_RESULT_WDS_STARTED #define eWLAN_BAP_MAC_START_BSS_SUCCESS /* bapRoamCompleteCallback with eCSR_ROAM_RESULT_WDS_STARTED */ -eCSR_ROAM_RESULT_FAILURE +eCSR_ROAM_RESULT_FAILURE eCSR_ROAM_RESULT_NOT_ASSOCIATED #define eWLAN_BAP_MAC_START_FAILS /* bapRoamCompleteCallback with eCSR_ROAM_RESULT_FAILURE or eCSR_ROAM_RESULT_NOT_ASSOCIATED */ @@ -143,8 +143,8 @@ eCSR_ROAM_RESULT_WDS_ASSOCIATED #define eWLAN_BAP_MAC_CONNECT_COMPLETED /* bapRoamCompleteCallback with eCSR_ROAM_RESULT_WDS_ASSOCIATED */ -eCSR_ROAM_RESULT_FAILURE -eCSR_ROAM_RESULT_NOT_ASSOCIATED +eCSR_ROAM_RESULT_FAILURE +eCSR_ROAM_RESULT_NOT_ASSOCIATED #define eWLAN_BAP_MAC_CONNECT_FAILED /* bapRoamCompleteCallback with eCSR_ROAM_RESULT_FAILURE or eCSR_ROAM_RESULT_NOT_ASSOCIATED */ @@ -152,7 +152,7 @@ eCSR_ROAM_RESULT_WDS_ASSOCIATION_IND #define eWLAN_BAP_MAC_CONNECT_INDICATION /* bapRoamCompleteCallback with eCSR_ROAM_RESULT_WDS_ASSOCIATION_IND */ -eCSR_ROAM_RESULT_KEY_SET +eCSR_ROAM_RESULT_KEY_SET #define eWLAN_BAP_MAC_KEY_SET_SUCCESS /* bapRoamCompleteCallback with eCSR_ROAM_RESULT_KEY_SET */ @@ -169,85 +169,85 @@ eCSR_ROAM_RESULT_WDS_STOPPED eHalStatus WLANBAP_RoamCallback ( - void *pContext, + void *pContext, tCsrRoamInfo *pCsrRoamInfo, - tANI_U32 roamId, - eRoamCmdStatus roamStatus, + tANI_U32 roamId, + eRoamCmdStatus roamStatus, eCsrRoamResult roamResult ) { - eHalStatus halStatus = eHAL_STATUS_SUCCESS; - /* btampContext value */ - ptBtampContext btampContext = (ptBtampContext) pContext; + eHalStatus halStatus = eHAL_STATUS_SUCCESS; + /* btampContext value */ + ptBtampContext btampContext = (ptBtampContext) pContext; tWLAN_BAPEvent bapEvent; /* State machine event */ - VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; + VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; v_U8_t status; /* return the BT-AMP status here */ /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, before switch on roamStatus = %d", __func__, roamStatus); switch (roamStatus) { - //JEZ081110: For testing purposes, with Infra STA as BT STA, this - //actually takes care of the "eCSR_ROAM_RESULT_WDS_STARTED" case, - //below, better than "eCSR_ROAM_RESULT_IBSS_STARTED". - //case eCSR_ROAM_ROAMING_START: - case eCSR_ROAM_ASSOCIATION_START: + //JEZ081110: For testing purposes, with Infra STA as BT STA, this + //actually takes care of the "eCSR_ROAM_RESULT_WDS_STARTED" case, + //below, better than "eCSR_ROAM_RESULT_IBSS_STARTED". + //case eCSR_ROAM_ROAMING_START: + case eCSR_ROAM_ASSOCIATION_START: /* bapRoamCompleteCallback with eCSR_ROAM_RESULT_WDS_STARTED */ - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, CSR roamResult = %s (%d)", __func__, "eCSR_ROAM_ROAMING_START", roamResult); - // This only gets called when CSR decides to roam on its own - due to lostlink. + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, CSR roamResult = %s (%d)", __func__, "eCSR_ROAM_ROAMING_START", roamResult); + // This only gets called when CSR decides to roam on its own - due to lostlink. #if 0 if ((pCsrRoamInfo) && (pCsrRoamInfo->pConnectedProfile) && (pCsrRoamInfo->pConnectedProfile->pBssDesc)) { memcpy(bssid.ether_addr_octet, pCsrRoamInfo->pConnectedProfile->pBssDesc->bssId, - sizeof(tSirMacAddr)); - apple80211Interface->willRoam(&bssid); // Return result isn't significant + sizeof(tSirMacAddr)); + apple80211Interface->willRoam(&bssid); // Return result isn't significant VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "%s: willRoam returns\n", __func__); } #endif //0 - /* Fill in the event structure */ - bapEvent.event = eWLAN_BAP_MAC_START_BSS_SUCCESS; + /* Fill in the event structure */ + bapEvent.event = eWLAN_BAP_MAC_START_BSS_SUCCESS; bapEvent.params = pCsrRoamInfo; bapEvent.u1 = roamStatus; bapEvent.u2 = roamResult; - /* Handle event */ + /* Handle event */ vosStatus = btampFsm(btampContext, &bapEvent, &status); break; case eCSR_ROAM_SET_KEY_COMPLETE: /* bapRoamCompleteCallback with eCSR_ROAM_SET_KEY_COMPLETE */ - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, CSR roamStatus = %s (%d)", __func__, "eCSR_ROAM_SET_KEY_COMPLETE", roamStatus); + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, CSR roamStatus = %s (%d)", __func__, "eCSR_ROAM_SET_KEY_COMPLETE", roamStatus); - /* Fill in the event structure */ - bapEvent.event = eWLAN_BAP_MAC_KEY_SET_SUCCESS; + /* Fill in the event structure */ + bapEvent.event = eWLAN_BAP_MAC_KEY_SET_SUCCESS; bapEvent.params = pCsrRoamInfo; bapEvent.u1 = roamStatus; bapEvent.u2 = roamResult; - /* Handle event */ + /* Handle event */ vosStatus = btampFsm(btampContext, &bapEvent, &status); - + break; - case eCSR_ROAM_DISASSOCIATED: + case eCSR_ROAM_DISASSOCIATED: /* bapRoamCompleteCallback with eCSR_ROAM_DISASSOCIATED */ - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, CSR roamStatus = %s (%d)", __func__, "eCSR_ROAM_DISASSOCIATED", roamStatus); + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, CSR roamStatus = %s (%d)", __func__, "eCSR_ROAM_DISASSOCIATED", roamStatus); case eCSR_ROAM_LOSTLINK: /* bapRoamCompleteCallback with eCSR_ROAM_LOSTLINK */ - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, CSR roamStatus = %s (%d)", __func__, "eCSR_ROAM_LOSTLINK", roamStatus); + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, CSR roamStatus = %s (%d)", __func__, "eCSR_ROAM_LOSTLINK", roamStatus); if (roamResult != eCSR_ROAM_RESULT_NONE) { - /* Fill in the event structure */ - bapEvent.event = eWLAN_BAP_MAC_READY_FOR_CONNECTIONS; + /* Fill in the event structure */ + bapEvent.event = eWLAN_BAP_MAC_READY_FOR_CONNECTIONS; bapEvent.params = pCsrRoamInfo; bapEvent.u1 = roamStatus; - bapEvent.u2 = roamResult; - - /* Handle event */ + bapEvent.u2 = roamResult; + + /* Handle event */ vosStatus = btampFsm(btampContext, &bapEvent, &status); } - + break; default: @@ -259,184 +259,184 @@ WLANBAP_RoamCallback VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, before switch on roamResult = %d", __func__, roamResult); switch (roamResult) { - //JEZ081110: Commented out for testing. Test relies upon IBSS. - case eCSR_ROAM_RESULT_IBSS_STARTED: - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, CSR roamResult = %s (%d)", __func__, "eCSR_ROAM_RESULT_IBSS_STARTED", roamResult); - case eCSR_ROAM_RESULT_WDS_STARTED: + //JEZ081110: Commented out for testing. Test relies upon IBSS. + case eCSR_ROAM_RESULT_IBSS_STARTED: + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, CSR roamResult = %s (%d)", __func__, "eCSR_ROAM_RESULT_IBSS_STARTED", roamResult); + case eCSR_ROAM_RESULT_WDS_STARTED: /* bapRoamCompleteCallback with eCSR_ROAM_RESULT_WDS_STARTED */ - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, CSR roamResult = %s (%d)", __func__, "eCSR_ROAM_RESULT_WDS_STARTED", roamResult); + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, CSR roamResult = %s (%d)", __func__, "eCSR_ROAM_RESULT_WDS_STARTED", roamResult); - /* Fill in the event structure */ - bapEvent.event = eWLAN_BAP_MAC_START_BSS_SUCCESS; + /* Fill in the event structure */ + bapEvent.event = eWLAN_BAP_MAC_START_BSS_SUCCESS; bapEvent.params = pCsrRoamInfo; bapEvent.u1 = roamStatus; bapEvent.u2 = roamResult; - /* Handle event */ + /* Handle event */ vosStatus = btampFsm(btampContext, &bapEvent, &status); - + break; - //JEZ081110: Commented out for testing. Test relies upon IBSS. - //JEZ081110: But I cannot rely upon IBSS for the initial testing. - case eCSR_ROAM_RESULT_FAILURE: + //JEZ081110: Commented out for testing. Test relies upon IBSS. + //JEZ081110: But I cannot rely upon IBSS for the initial testing. + case eCSR_ROAM_RESULT_FAILURE: //case eCSR_ROAM_RESULT_NOT_ASSOCIATED: //case eCSR_ROAM_RESULT_IBSS_START_FAILED: /* bapRoamCompleteCallback with eCSR_ROAM_RESULT_FAILURE or eCSR_ROAM_RESULT_NOT_ASSOCIATED */ - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, CSR roamResult = %s (%d)", __func__, "eCSR_ROAM_RESULT_FAILURE", roamResult); + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, CSR roamResult = %s (%d)", __func__, "eCSR_ROAM_RESULT_FAILURE", roamResult); #ifdef FEATURE_WLAN_BTAMP_UT_RF break; #endif case eCSR_ROAM_RESULT_WDS_START_FAILED: /* bapRoamCompleteCallback with eCSR_ROAM_RESULT_WDS_START_FAILED */ - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, CSR roamResult = %s (%d)", __func__, "eCSR_ROAM_RESULT_WDS_START_FAILED", roamResult); + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, CSR roamResult = %s (%d)", __func__, "eCSR_ROAM_RESULT_WDS_START_FAILED", roamResult); - /* Fill in the event structure */ - /* I don't think I should signal a eCSR_ROAM_RESULT_FAILURE + /* Fill in the event structure */ + /* I don't think I should signal a eCSR_ROAM_RESULT_FAILURE * as a eWLAN_BAP_MAC_START_FAILS - */ - bapEvent.event = eWLAN_BAP_MAC_START_FAILS; + */ + bapEvent.event = eWLAN_BAP_MAC_START_FAILS; bapEvent.params = pCsrRoamInfo; bapEvent.u1 = roamStatus; bapEvent.u2 = roamResult; - /* Handle event */ + /* Handle event */ vosStatus = btampFsm(btampContext, &bapEvent, &status); break; //JEZ081110: Commented out for testing. This handles both Infra STA and IBSS STA. case eCSR_ROAM_RESULT_IBSS_CONNECT: - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, CSR roamResult = %s (%d)", __func__, "eCSR_ROAM_RESULT_IBSS_CONNECT", roamResult); + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, CSR roamResult = %s (%d)", __func__, "eCSR_ROAM_RESULT_IBSS_CONNECT", roamResult); case eCSR_ROAM_RESULT_ASSOCIATED: - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, CSR roamResult = %s (%d)", __func__, "eCSR_ROAM_RESULT_ASSOCIATED", roamResult); + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, CSR roamResult = %s (%d)", __func__, "eCSR_ROAM_RESULT_ASSOCIATED", roamResult); case eCSR_ROAM_RESULT_WDS_ASSOCIATED: /* bapRoamCompleteCallback with eCSR_ROAM_RESULT_WDS_ASSOCIATED */ - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, CSR roamResult = %s (%d)", __func__, "eCSR_ROAM_RESULT_WDS_ASSOCIATED", roamResult); + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, CSR roamResult = %s (%d)", __func__, "eCSR_ROAM_RESULT_WDS_ASSOCIATED", roamResult); - /* Fill in the event structure */ + /* Fill in the event structure */ bapEvent.event = eWLAN_BAP_MAC_CONNECT_COMPLETED; bapEvent.params = pCsrRoamInfo; bapEvent.u1 = roamStatus; bapEvent.u2 = roamResult; - /* Handle event */ + /* Handle event */ vosStatus = btampFsm(btampContext, &bapEvent, &status); - + break; - //JEZ081110: Commented out for testing. Test relies upon IBSS. - //JEZ081110: But I cannot rely upon IBSS for the initial testing. - //case eCSR_ROAM_RESULT_FAILURE: + //JEZ081110: Commented out for testing. Test relies upon IBSS. + //JEZ081110: But I cannot rely upon IBSS for the initial testing. + //case eCSR_ROAM_RESULT_FAILURE: case eCSR_ROAM_RESULT_IBSS_START_FAILED: - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, CSR roamResult = %s (%d)", __func__, "eCSR_ROAM_RESULT_IBSS_START_FAILED", roamResult); + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, CSR roamResult = %s (%d)", __func__, "eCSR_ROAM_RESULT_IBSS_START_FAILED", roamResult); case eCSR_ROAM_RESULT_NOT_ASSOCIATED: /* bapRoamCompleteCallback with eCSR_ROAM_RESULT_FAILURE or eCSR_ROAM_RESULT_NOT_ASSOCIATED */ - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, CSR roamResult = %s (%d)", __func__, "eCSR_ROAM_RESULT_NOT_ASSOCIATED", roamResult); + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, CSR roamResult = %s (%d)", __func__, "eCSR_ROAM_RESULT_NOT_ASSOCIATED", roamResult); #ifdef FEATURE_WLAN_BTAMP_UT_RF break; #endif case eCSR_ROAM_RESULT_WDS_NOT_ASSOCIATED: /* bapRoamCompleteCallback with eCSR_ROAM_RESULT_WDS_NOT_ASSOCIATED */ - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, CSR roamResult = %s (%d)", __func__, "eCSR_ROAM_RESULT_WDS_NOT_ASSOCIATED", roamResult); + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, CSR roamResult = %s (%d)", __func__, "eCSR_ROAM_RESULT_WDS_NOT_ASSOCIATED", roamResult); - /* Fill in the event structure */ - bapEvent.event = eWLAN_BAP_MAC_CONNECT_FAILED; + /* Fill in the event structure */ + bapEvent.event = eWLAN_BAP_MAC_CONNECT_FAILED; bapEvent.params = pCsrRoamInfo; bapEvent.u1 = roamStatus; bapEvent.u2 = roamResult; - /* Handle event */ + /* Handle event */ vosStatus = btampFsm(btampContext, &bapEvent, &status); - + break; //JEZ081110: I think I have to check for the bssType to - //differentiate between IBSS Start and IBSS Join success. + //differentiate between IBSS Start and IBSS Join success. //case eCSR_ROAM_RESULT_IBSS_CONNECT: - //VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, CSR roamResult = %s (%d)", __func__, "eCSR_ROAM_RESULT_IBSS_CONNECT", roamResult); + //VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, CSR roamResult = %s (%d)", __func__, "eCSR_ROAM_RESULT_IBSS_CONNECT", roamResult); - //JEZ081110: Commented out for testing. Test relies upon IBSS. - // No longer commented out. + //JEZ081110: Commented out for testing. Test relies upon IBSS. + // No longer commented out. case eCSR_ROAM_RESULT_WDS_ASSOCIATION_IND: /* bapRoamCompleteCallback with eCSR_ROAM_RESULT_WDS_ASSOCIATION_IND */ - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, CSR roamResult = %s (%d)", __func__, "eCSR_ROAM_RESULT_WDS_ASSOCIATION_IND", roamResult); + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, CSR roamResult = %s (%d)", __func__, "eCSR_ROAM_RESULT_WDS_ASSOCIATION_IND", roamResult); - /* Fill in the event structure */ + /* Fill in the event structure */ bapEvent.event = eWLAN_BAP_MAC_CONNECT_INDICATION; bapEvent.params = pCsrRoamInfo; bapEvent.u1 = roamStatus; bapEvent.u2 = roamResult; - /* Handle event */ + /* Handle event */ vosStatus = btampFsm(btampContext, &bapEvent, &status); - - /* If BAP doesn't like the incoming association, signal SME/CSR */ - if ( status != WLANBAP_STATUS_SUCCESS) + + /* If BAP doesn't like the incoming association, signal SME/CSR */ + if ( status != WLANBAP_STATUS_SUCCESS) halStatus = eHAL_STATUS_FAILURE; - + break; - //JEZ081110: Not supported in SME and CSR, yet. + //JEZ081110: Not supported in SME and CSR, yet. #if 0 - case eCSR_ROAM_RESULT_KEY_SET: + case eCSR_ROAM_RESULT_KEY_SET: /* bapRoamCompleteCallback with eCSR_ROAM_RESULT_KEY_SET */ - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, CSR roamResult = %s (%d)", __func__, "eCSR_ROAM_RESULT_KEY_SET", roamResult); + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, CSR roamResult = %s (%d)", __func__, "eCSR_ROAM_RESULT_KEY_SET", roamResult); - /* Fill in the event structure */ - bapEvent.event = eWLAN_BAP_MAC_KEY_SET_SUCCESS; + /* Fill in the event structure */ + bapEvent.event = eWLAN_BAP_MAC_KEY_SET_SUCCESS; bapEvent.params = pCsrRoamInfo; bapEvent.u1 = roamStatus; bapEvent.u2 = roamResult; - /* Handle event */ + /* Handle event */ vosStatus = btampFsm(btampContext, &bapEvent, &status); - + break; #endif //0 case eCSR_ROAM_RESULT_DISASSOC_IND: - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, CSR roamResult = %s (%d)", __func__, "eCSR_ROAM_RESULT_DISASSOC_IND", roamResult); + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, CSR roamResult = %s (%d)", __func__, "eCSR_ROAM_RESULT_DISASSOC_IND", roamResult); case eCSR_ROAM_RESULT_WDS_DISASSOCIATED: /* bapRoamCompleteCallback with eCSR_ROAM_RESULT_WDS_DISASSOCIATED */ - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, CSR roamResult = %s (%d)", __func__, "eCSR_ROAM_RESULT_WDS_DISASSOCIATED", roamResult); + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, CSR roamResult = %s (%d)", __func__, "eCSR_ROAM_RESULT_WDS_DISASSOCIATED", roamResult); - /* Fill in the event structure */ - bapEvent.event = eWLAN_BAP_MAC_INDICATES_MEDIA_DISCONNECTION; + /* Fill in the event structure */ + bapEvent.event = eWLAN_BAP_MAC_INDICATES_MEDIA_DISCONNECTION; bapEvent.params = pCsrRoamInfo; bapEvent.u1 = roamStatus; bapEvent.u2 = roamResult; - /* Handle event */ + /* Handle event */ vosStatus = btampFsm(btampContext, &bapEvent, &status); - - /* Fill in the event structure */ + + /* Fill in the event structure */ bapEvent.event = eWLAN_BAP_MAC_READY_FOR_CONNECTIONS; bapEvent.params = pCsrRoamInfo; bapEvent.u1 = roamStatus; bapEvent.u2 = roamResult; - /* Handle event */ + /* Handle event */ vosStatus = btampFsm(btampContext, &bapEvent, &status); break; - //JEZ081110: Commented out for testing. Test relies upon IBSS. + //JEZ081110: Commented out for testing. Test relies upon IBSS. case eCSR_ROAM_RESULT_IBSS_INACTIVE: - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, CSR roamResult = %s (%d)", __func__, "eCSR_ROAM_RESULT_IBSS_INACTIVE", roamResult); + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, CSR roamResult = %s (%d)", __func__, "eCSR_ROAM_RESULT_IBSS_INACTIVE", roamResult); case eCSR_ROAM_RESULT_WDS_STOPPED: /* bapRoamCompleteCallback with eCSR_ROAM_RESULT_WDS_STOPPED */ - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, CSR roamResult = %s (%d)", __func__, "eCSR_ROAM_RESULT_WDS_STOPPED", roamResult); + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, CSR roamResult = %s (%d)", __func__, "eCSR_ROAM_RESULT_WDS_STOPPED", roamResult); - /* Fill in the event structure */ - bapEvent.event = eWLAN_BAP_MAC_READY_FOR_CONNECTIONS; + /* Fill in the event structure */ + bapEvent.event = eWLAN_BAP_MAC_READY_FOR_CONNECTIONS; bapEvent.params = pCsrRoamInfo; bapEvent.u1 = roamStatus; bapEvent.u2 = roamResult; - /* Handle event */ + /* Handle event */ vosStatus = btampFsm(btampContext, &bapEvent, &status); - + break; default: @@ -454,7 +454,7 @@ WLANBAP_RoamCallback btampContext->mAssociatedStatus = WLANBAP_STATUS_SUCCESS; btampContext->mAssociated = VOS_TRUE; // update "assocBssid" with the BSSID of the IBSS - if (pCsrRoamInfo) + if (pCsrRoamInfo) memcpy(btampContext->assocBssid, pCsrRoamInfo->peerMacOrBssidForIBSS, 6); // We must update the system role to match that of the @@ -462,12 +462,12 @@ WLANBAP_RoamCallback // joining the network in infrastructure mode if the // initial join in IBSS mode fails. Andreas Wolf // (awolf@apple.com) explains the behavior as follows: - // "If the client attempts to join an open network and it fails + // "If the client attempts to join an open network and it fails // on the first attempt, it reverts back to b-only mode. This // workaround was specifically put in place to allow the client // to associate to some third party b-only infrastructure APs. // It did not take IBSS into account, it seems that the fallback - // always forces infrastructure." + // always forces infrastructure." btampContext->systemRole = eSYSTEM_STA_IN_IBSS_ROLE; @@ -514,12 +514,12 @@ WLANBAP_RoamCallback btampContext->mAssociated = true; if ((pCsrRoamInfo) && (pCsrRoamInfo->pBssDesc)) { - ccpCsrToAppleScanResult(mPMacObject, pCsrRoamInfo->pBssDesc, &scanResult); - + ccpCsrToAppleScanResult(mPMacObject, pCsrRoamInfo->pBssDesc, &scanResult); + /* Save away the IEs used by the AP */ ccpCsrToAssocApiedata( mPMacObject, pCsrRoamInfo->pBssDesc, &(btampContext->apiedata)); - - if (BssidChanged((tCsrBssid*) btampContext->assocBssid, (ether_addr*) scanResult.asr_bssid)) { + + if (BssidChanged((tCsrBssid*) btampContext->assocBssid, (ether_addr*) scanResult.asr_bssid)) { memcpy(btampContext->assocBssid, scanResult.asr_bssid, 6); ((IO80211Interface*) mNetworkIF)->postMessage(APPLE80211_M_BSSID_CHANGED ); } @@ -555,7 +555,7 @@ WLANBAP_RoamCallback DBGLOG("%s: link already down in %s\n", __func__, "eCSR_ROAM_RESULT_NOT_ASSOCIATED"); } break; - + case eCSR_ROAM_RESULT_FAILURE: btampContext->mAssociatedStatus = APPLE80211_STATUS_UNSPECIFIED_FAILURE; btampContext->mAssociated = false; @@ -571,7 +571,7 @@ WLANBAP_RoamCallback DBGLOG("%s: link already down in %s\n", __func__, "eCSR_ROAM_RESULT_FAILURE"); } break; - + case eCSR_ROAM_RESULT_DISASSOC_IND: { btampContext->mAssociated = false; @@ -589,24 +589,24 @@ WLANBAP_RoamCallback //if (pCsrRoamInfo) // For now, leave this commented out. Until CSR changes integrated. { - // Now set the reason and status codes. - // Actually, the "result code" field in the tSirSmeDisassocInd should be named reasonCode and NOT statusCode. - // "Reason Codes" are found in DisAssoc or DeAuth Ind. "Status Code" fields are found in Rsp Mgmt Frame. - // For now, we are going to have to (painfully) map the only "result code" type information we have - // available at ALL from LIM/CSR. And that is the statusCode field of type tSirResultCodes - // BTW, tSirResultCodes is the COMPLETELY WRONG TYPE for this "result code" field. It SHOULD be - // of type tSirMacReasonCodes. + // Now set the reason and status codes. + // Actually, the "result code" field in the tSirSmeDisassocInd should be named reasonCode and NOT statusCode. + // "Reason Codes" are found in DisAssoc or DeAuth Ind. "Status Code" fields are found in Rsp Mgmt Frame. + // For now, we are going to have to (painfully) map the only "result code" type information we have + // available at ALL from LIM/CSR. And that is the statusCode field of type tSirResultCodes + // BTW, tSirResultCodes is the COMPLETELY WRONG TYPE for this "result code" field. It SHOULD be + // of type tSirMacReasonCodes. // Right now, we don't even have that. So, I have to just make up some "reason code" that I will - // pretend I found in the incoming DisAssoc Indication. - //btampContext->statusCode = ((tpSirSmeDisassocInd) pCallbackInfo)->statusCode; // tSirResultCodes - //btampContext->reasonCode = ((tpSirSmeDisassocInd) pCallbackInfo)->statusCode; // tSirResultCodes - btampContext->reasonCode = (tANI_U16) eSIR_MAC_UNSPEC_FAILURE_REASON; //tANI_U16 // tSirMacReasonCodes - btampContext->deAuthReasonCode = 0; // tANI_U16 // eSIR_SME_DEAUTH_FROM_PEER + // pretend I found in the incoming DisAssoc Indication. + //btampContext->statusCode = ((tpSirSmeDisassocInd) pCallbackInfo)->statusCode; // tSirResultCodes + //btampContext->reasonCode = ((tpSirSmeDisassocInd) pCallbackInfo)->statusCode; // tSirResultCodes + btampContext->reasonCode = (tANI_U16) eSIR_MAC_UNSPEC_FAILURE_REASON; //tANI_U16 // tSirMacReasonCodes + btampContext->deAuthReasonCode = 0; // tANI_U16 // eSIR_SME_DEAUTH_FROM_PEER // Shouldn't the next line really use a tANI_U16? //0; // tANI_U16 // eSIR_SME_DISASSOC_FROM_PEER - btampContext->disassocReasonCode = btampContext->reasonCode; // tSirMacReasonCodes + btampContext->disassocReasonCode = btampContext->reasonCode; // tSirMacReasonCodes // Let's remember the peer who just disassoc'd us //memcpy(btampContext->peerMacAddr, pCsrRoamInfo->peerMacOrBssidForIBSS, 6); - } + } } break; @@ -627,55 +627,55 @@ WLANBAP_RoamCallback //if (pCsrRoamInfo) // For now, leave this commented out. Until CSR changes integrated. { - // Now set the reason and status codes. - // Actually, the "result code" field in the tSirSmeDeauthInd should be named reasonCode and NOT statusCode. - // "Reason Codes" are found in DisAssoc or DeAuth Ind. "Status Code" fields are found in Rsp Mgmt Frame. - // For now, we are going to have to (painfully) map the only "result code" type information we have - // available at ALL from LIM/CSR. And that is the statusCode field of type tSirResultCodes - // BTW, tSirResultCodes is the COMPLETELY WRONG TYPE for this "result code" field. It SHOULD be - // of type tSirMacReasonCodes. + // Now set the reason and status codes. + // Actually, the "result code" field in the tSirSmeDeauthInd should be named reasonCode and NOT statusCode. + // "Reason Codes" are found in DisAssoc or DeAuth Ind. "Status Code" fields are found in Rsp Mgmt Frame. + // For now, we are going to have to (painfully) map the only "result code" type information we have + // available at ALL from LIM/CSR. And that is the statusCode field of type tSirResultCodes + // BTW, tSirResultCodes is the COMPLETELY WRONG TYPE for this "result code" field. It SHOULD be + // of type tSirMacReasonCodes. // Right now, we don't even have that. So, I have to just make up some "reason code" that I will - // pretend I found in the incoming DeAuth Indication. - //btampContext->statusCode = ((tpSirSmeDeauthInd) pCallbackInfo)->statusCode; // tSirResultCodes - //btampContext->reasonCode = ((tpSirSmeDeauthInd) pCallbackInfo)->statusCode; // tSirResultCodes - btampContext->reasonCode = (tANI_U16) eSIR_MAC_UNSPEC_FAILURE_REASON; //tANI_U16 // tSirMacReasonCodes - btampContext->disassocReasonCode = 0; // tANI_U16 // eSIR_SME_DISASSOC_FROM_PEER + // pretend I found in the incoming DeAuth Indication. + //btampContext->statusCode = ((tpSirSmeDeauthInd) pCallbackInfo)->statusCode; // tSirResultCodes + //btampContext->reasonCode = ((tpSirSmeDeauthInd) pCallbackInfo)->statusCode; // tSirResultCodes + btampContext->reasonCode = (tANI_U16) eSIR_MAC_UNSPEC_FAILURE_REASON; //tANI_U16 // tSirMacReasonCodes + btampContext->disassocReasonCode = 0; // tANI_U16 // eSIR_SME_DISASSOC_FROM_PEER // Shouldn't the next line really use a tANI_U16? //0; // tANI_U16 // eSIR_SME_DEAUTH_FROM_PEER - btampContext->deAuthReasonCode = btampContext->reasonCode; // tSirMacReasonCodes + btampContext->deAuthReasonCode = btampContext->reasonCode; // tSirMacReasonCodes // Let's remember the peer who just de-auth'd us - //memcpy(btampContext->peerMacAddr, ((tpSirSmeDeauthInd) pCallbackInfo)->peerMacAddr, 6); - } + //memcpy(btampContext->peerMacAddr, ((tpSirSmeDeauthInd) pCallbackInfo)->peerMacAddr, 6); + } } break; - case eCSR_ROAM_RESULT_MIC_ERROR_UNICAST: + case eCSR_ROAM_RESULT_MIC_ERROR_UNICAST: //if (eCSR_ROAM_MIC_ERROR_IND == roamStatus) // Make sure - { + { if (btampContext->mTKIPCounterMeasures) { - ((IO80211Interface*) mNetworkIF)->postMessage(APPLE80211_M_MIC_ERROR_UCAST); - DBGLOG("%s: TKIP Countermeasures in effect in %s\n", __func__, "eCSR_ROAM_RESULT_MIC_ERROR_UNICAST"); - } - else - { - DBGLOG("%s: TKIP Countermeasures disabled in %s\n", __func__, "eCSR_ROAM_RESULT_MIC_ERROR_UNICAST"); + ((IO80211Interface*) mNetworkIF)->postMessage(APPLE80211_M_MIC_ERROR_UCAST); + DBGLOG("%s: TKIP Countermeasures in effect in %s\n", __func__, "eCSR_ROAM_RESULT_MIC_ERROR_UNICAST"); + } + else + { + DBGLOG("%s: TKIP Countermeasures disabled in %s\n", __func__, "eCSR_ROAM_RESULT_MIC_ERROR_UNICAST"); } } break; - case eCSR_ROAM_RESULT_MIC_ERROR_GROUP: + case eCSR_ROAM_RESULT_MIC_ERROR_GROUP: //if (eCSR_ROAM_MIC_ERROR_IND == roamStatus) // Make sure - { + { if (btampContext->mTKIPCounterMeasures) - { - ((IO80211Interface*) mNetworkIF)->postMessage(APPLE80211_M_MIC_ERROR_MCAST); - DBGLOG("%s: TKIP Countermeasures in effect in %s\n", __func__, "eCSR_ROAM_RESULT_MIC_ERROR_GROUP"); - } - else - { - DBGLOG("%s: TKIP Countermeasures disabled in %s\n", __func__, "eCSR_ROAM_RESULT_MIC_ERROR_GROUP"); + { + ((IO80211Interface*) mNetworkIF)->postMessage(APPLE80211_M_MIC_ERROR_MCAST); + DBGLOG("%s: TKIP Countermeasures in effect in %s\n", __func__, "eCSR_ROAM_RESULT_MIC_ERROR_GROUP"); + } + else + { + DBGLOG("%s: TKIP Countermeasures disabled in %s\n", __func__, "eCSR_ROAM_RESULT_MIC_ERROR_GROUP"); } } break; @@ -684,15 +684,15 @@ WLANBAP_RoamCallback break; } switch (roamStatus) { - case eCSR_ROAM_ROAMING_START: + case eCSR_ROAM_ROAMING_START: DBGLOG("%s: In %s\n", __func__, "eCSR_ROAM_ROAMING_START"); - // This only gets called when CSR decides to roam on its own - due to lostlink. + // This only gets called when CSR decides to roam on its own - due to lostlink. // Apple still needs to be told. if ((pCsrRoamInfo) && (pCsrRoamInfo->pConnectedProfile) && (pCsrRoamInfo->pConnectedProfile->pBssDesc)) { memcpy(bssid.ether_addr_octet, pCsrRoamInfo->pConnectedProfile->pBssDesc->bssId, - sizeof(tSirMacAddr)); - apple80211Interface->willRoam(&bssid); // Return result isn't significant + sizeof(tSirMacAddr)); + apple80211Interface->willRoam(&bssid); // Return result isn't significant DBGLOG("%s: willRoam returns\n", __func__); } break; @@ -700,28 +700,28 @@ WLANBAP_RoamCallback case eCSR_ROAM_SHOULD_ROAM: if ((pCsrRoamInfo) && (pCsrRoamInfo->pBssDesc)) { // pCallbackInfo points to the BSS desc. Convert to Apple Scan Result. - halStatus = ccpCsrToAppleScanResult( - mPMacObject, - pCsrRoamInfo->pBssDesc, - &scanResult); - if ( halStatus != 0 ) + halStatus = ccpCsrToAppleScanResult( + mPMacObject, + pCsrRoamInfo->pBssDesc, + &scanResult); + if ( halStatus != 0 ) return eHAL_STATUS_FAILURE; roamAccepted = apple80211Interface->shouldRoam(&scanResult); // Return result is crucial - if (roamAccepted == true) { - // If the roam is acceptable, return SUCCESS + if (roamAccepted == true) { + // If the roam is acceptable, return SUCCESS DBGLOG("%s: shouldRoam returns \"acceptable\"\n", __func__); //#if 0 // Actually, before returning, immediately signal willRoam - // This is a workaround for a CSR bug. Eventually, when + // This is a workaround for a CSR bug. Eventually, when // eCSR_ROAM_ASSOCIATION_START gets called WITH callback param p1 // pointing to a tBssDescription, this work-around can be removed. - memcpy(bssid.ether_addr_octet, pCsrRoamInfo->pBssDesc->bssId, sizeof(tSirMacAddr)); - apple80211Interface->willRoam(&bssid); // Return result isn't significant + memcpy(bssid.ether_addr_octet, pCsrRoamInfo->pBssDesc->bssId, sizeof(tSirMacAddr)); + apple80211Interface->willRoam(&bssid); // Return result isn't significant DBGLOG("%s: willRoam (called out of order) returns\n", __func__); DBGLOG(" with BSSID = " MAC_ADDR_STRING(bssid.ether_addr_octet)); //#endif return eHAL_STATUS_SUCCESS; - } else { + } else { // If the roam is NOT acceptable, return FAILURE DBGLOG("%s: shouldRoam returns \"NOT acceptable\"\n", __func__); return eHAL_STATUS_FAILURE; @@ -767,12 +767,12 @@ WLANBAP_RoamCallback DBGLOG("%s: In %s\n", __func__, "eCSR_ROAM_ASSOCIATION_START"); #if 0 // This is the right place to call willRoam - for an "initial" association. - // But, unfortunately, when eCSR_ROAM_ASSOCIATION_START gets called, - // it doesn't have a pointer to the tBssDescription in the roaming callback + // But, unfortunately, when eCSR_ROAM_ASSOCIATION_START gets called, + // it doesn't have a pointer to the tBssDescription in the roaming callback // routines parameter p1 (pCallbackInfo in SetWextState). So, don't use this code, yet. if ((pCsrRoamInfo) && (pCsrRoamInfo->pBssDesc) { - memcpy(bssid.ether_addr_octet, pCsrRoamInfo->pBssDesc->bssId, 6); - apple80211Interface->willRoam(&bssid); // Return result isn't significant + memcpy(bssid.ether_addr_octet, pCsrRoamInfo->pBssDesc->bssId, 6); + apple80211Interface->willRoam(&bssid); // Return result isn't significant DBGLOG("%s: willRoam returns\n", __func__); DBGLOG(" with BSSID = " MAC_ADDR_STRING(bssid.ether_addr_octet)); } @@ -802,7 +802,7 @@ WLANBAP_RoamCallback /** BT v3.0 Link Control commands */ /*---------------------------------------------------------------------------- - Each of the next eight command result in asynchronous events (e.g., + Each of the next eight command result in asynchronous events (e.g., HCI_PHYSICAL_LINK_COMPLETE_EVENT, HCI_LOGICAL_LINK_COMPLETE_EVENT, etc...) These are signalled thru the event callback. (I.E., (*tpWLAN_BAPEventCB).) ---------------------------------------------------------------------------*/ @@ -811,39 +811,39 @@ WLANBAP_RoamCallback FUNCTION WLAN_BAPPhysicalLinkCreate() - DESCRIPTION + DESCRIPTION Implements the actual HCI Create Physical Link command - DEPENDENCIES - NA. + DEPENDENCIES + NA. - PARAMETERS + PARAMETERS IN btampHandle: pointer to the BAP handle. Returned from WLANBAP_GetNewHndl. - WLANBAP_GetNewHndl has to be called before every call to - WLAN_BAPPhysicalLinkCreate. Since the context is per + WLANBAP_GetNewHndl has to be called before every call to + WLAN_BAPPhysicalLinkCreate. Since the context is per physical link. pBapHCIPhysLinkCreate: pointer to the "HCI Create Physical Link" Structure. pHddHdl: The context passed in by the caller. (e.g., BSL specific context) IN/OUT - pBapHCIEvent: Return event value for the command status event. - (The caller of this routine is responsible for sending + pBapHCIEvent: Return event value for the command status event. + (The caller of this routine is responsible for sending the Command Status event up the HCI interface.) - + RETURN VALUE - The result code associated with performing the operation + The result code associated with performing the operation - VOS_STATUS_E_FAULT: pointer to pBapHCIPhysLinkCreate is NULL + VOS_STATUS_E_FAULT: pointer to pBapHCIPhysLinkCreate is NULL VOS_STATUS_SUCCESS: Success - - SIDE EFFECTS - + + SIDE EFFECTS + ----------------------------------------------------------------------------*/ -VOS_STATUS -WLAN_BAPPhysicalLinkCreate -( +VOS_STATUS +WLAN_BAPPhysicalLinkCreate +( ptBtampHandle btampHandle, tBtampTLVHCI_Create_Physical_Link_Cmd *pBapHCIPhysLinkCreate, v_PVOID_t pHddHdl, /* BSL passes in its specific context */ @@ -854,17 +854,17 @@ WLAN_BAPPhysicalLinkCreate { tWLAN_BAPEvent bapEvent; /* State machine event */ VOS_STATUS vosStatus; - /* I am using btampContext, instead of pBapPhysLinkMachine */ + /* I am using btampContext, instead of pBapPhysLinkMachine */ //tWLAN_BAPbapPhysLinkMachine *pBapPhysLinkMachine; - ptBtampContext btampContext = (ptBtampContext) btampHandle; /* btampContext value */ + ptBtampContext btampContext = (ptBtampContext) btampHandle; /* btampContext value */ v_U8_t status; /* return the BT-AMP status here */ BTAMPFSM_INSTANCEDATA_T *instanceVar = &(btampContext->bapPhysLinkMachine); - /* Validate params */ + /* Validate params */ if ((pBapHCIPhysLinkCreate == NULL) || (NULL == btampContext)) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "%s: btampHandle value: %p, pBapHCIPhysLinkCreate is %p", - __func__, btampHandle, pBapHCIPhysLinkCreate); + __func__, btampHandle, pBapHCIPhysLinkCreate); return VOS_STATUS_E_FAULT; } @@ -878,75 +878,75 @@ WLAN_BAPPhysicalLinkCreate } else { - /* Fill in the event structure */ + /* Fill in the event structure */ bapEvent.event = eWLAN_BAP_HCI_PHYSICAL_LINK_CREATE; bapEvent.params = pBapHCIPhysLinkCreate; //bapEvent.callback = pBapHCIPhysLinkCreateCB; - /* Allocate a new state machine instance */ + /* Allocate a new state machine instance */ /* There will only ever be one of these (NB: Don't assume this.) */ - /* So for now this returns a pointer to a static structure */ + /* So for now this returns a pointer to a static structure */ /* (With all state set to initial values) */ - vosStatus = WLANBAP_CreateNewPhyLinkCtx ( - btampHandle, + vosStatus = WLANBAP_CreateNewPhyLinkCtx ( + btampHandle, pBapHCIPhysLinkCreate->phy_link_handle, /* I get phy_link_handle from the Command */ pHddHdl, /* BSL passes in its specific context */ - &btampContext, /* Handle to return per assoc btampContext value in */ - BT_INITIATOR); /* BT_INITIATOR */ + &btampContext, /* Handle to return per assoc btampContext value in */ + BT_INITIATOR); /* BT_INITIATOR */ VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "%s: btampContext value: %p", __func__, btampContext); - /* Handle event */ + /* Handle event */ vosStatus = btampFsm(btampContext, &bapEvent, &status); } - - /* Format the command status event to return... */ + + /* Format the command status event to return... */ pBapHCIEvent->bapHCIEventCode = BTAMP_TLV_HCI_COMMAND_STATUS_EVENT; pBapHCIEvent->u.btampCommandStatusEvent.present = 1; pBapHCIEvent->u.btampCommandStatusEvent.status = status; pBapHCIEvent->u.btampCommandStatusEvent.num_hci_command_packets = 1; - pBapHCIEvent->u.btampCommandStatusEvent.command_opcode + pBapHCIEvent->u.btampCommandStatusEvent.command_opcode = BTAMP_TLV_HCI_CREATE_PHYSICAL_LINK_CMD; - /* ... */ + /* ... */ return VOS_STATUS_SUCCESS; -} /* WLAN_BAPPhysicalLinkCreate */ +} /* WLAN_BAPPhysicalLinkCreate */ /*---------------------------------------------------------------------------- FUNCTION WLAN_BAPPhysicalLinkAccept() - DESCRIPTION + DESCRIPTION Implements the actual HCI Accept Physical Link command - DEPENDENCIES - NA. + DEPENDENCIES + NA. - PARAMETERS + PARAMETERS IN btampHandle: pointer to the BAP handle. Returned from WLANBAP_GetNewHndl. pBapHCIPhysLinkAccept: pointer to the "HCI Accept Physical Link" Structure. pHddHdl: The context passed in by the caller. (e.g., BSL specific context) - + IN/OUT - pBapHCIEvent: Return event value for the command status event. - (The caller of this routine is responsible for sending + pBapHCIEvent: Return event value for the command status event. + (The caller of this routine is responsible for sending the Command Status event up the HCI interface.) - + RETURN VALUE - The result code associated with performing the operation + The result code associated with performing the operation - VOS_STATUS_E_FAULT: pointer to pBapHCIPhysLinkAccept is NULL + VOS_STATUS_E_FAULT: pointer to pBapHCIPhysLinkAccept is NULL VOS_STATUS_SUCCESS: Success - - SIDE EFFECTS - + + SIDE EFFECTS + ----------------------------------------------------------------------------*/ -VOS_STATUS -WLAN_BAPPhysicalLinkAccept -( +VOS_STATUS +WLAN_BAPPhysicalLinkAccept +( ptBtampHandle btampHandle, tBtampTLVHCI_Accept_Physical_Link_Cmd *pBapHCIPhysLinkAccept, v_PVOID_t pHddHdl, /* BSL passes in its specific context */ @@ -957,17 +957,17 @@ WLAN_BAPPhysicalLinkAccept { tWLAN_BAPEvent bapEvent; /* State machine event */ VOS_STATUS vosStatus; - /* I am using btampContext, instead of pBapPhysLinkMachine */ + /* I am using btampContext, instead of pBapPhysLinkMachine */ //tWLAN_BAPbapPhysLinkMachine *pBapPhysLinkMachine; - ptBtampContext btampContext = (ptBtampContext) btampHandle; /* btampContext value */ + ptBtampContext btampContext = (ptBtampContext) btampHandle; /* btampContext value */ v_U8_t status; /* return the BT-AMP status here */ BTAMPFSM_INSTANCEDATA_T *instanceVar; - /* Validate params */ + /* Validate params */ if ((pBapHCIPhysLinkAccept == NULL) || (NULL == btampContext)) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "%s: btampHandle value: %p, pBapHCIPhysLinkAccept is %p", - __func__, btampHandle, pBapHCIPhysLinkAccept); + __func__, btampHandle, pBapHCIPhysLinkAccept); return VOS_STATUS_E_FAULT; } @@ -982,74 +982,74 @@ WLAN_BAPPhysicalLinkAccept } else { - /* Fill in the event structure */ + /* Fill in the event structure */ bapEvent.event = eWLAN_BAP_HCI_PHYSICAL_LINK_ACCEPT; bapEvent.params = pBapHCIPhysLinkAccept; //bapEvent.callback = pBapHCIPhysLinkAcceptCB; - /* Allocate a new state machine instance */ + /* Allocate a new state machine instance */ /* There will only ever be one of these (NB: Don't assume this.) */ - /* So for now this returns a pointer to a static structure */ + /* So for now this returns a pointer to a static structure */ /* (With all state set to initial values) */ - vosStatus = WLANBAP_CreateNewPhyLinkCtx ( - btampHandle, + vosStatus = WLANBAP_CreateNewPhyLinkCtx ( + btampHandle, pBapHCIPhysLinkAccept->phy_link_handle, /* I get phy_link_handle from the Command */ pHddHdl, /* BSL passes in its specific context */ - &btampContext, /* Handle to return per assoc btampContext value in */ - BT_RESPONDER); /* BT_RESPONDER */ + &btampContext, /* Handle to return per assoc btampContext value in */ + BT_RESPONDER); /* BT_RESPONDER */ VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "%s: btampContext value: %p", __func__, btampContext); - /* Handle event */ + /* Handle event */ vosStatus = btampFsm(btampContext, &bapEvent, &status); - + } - /* Format the command status event to return... */ + /* Format the command status event to return... */ pBapHCIEvent->bapHCIEventCode = BTAMP_TLV_HCI_COMMAND_STATUS_EVENT; pBapHCIEvent->u.btampCommandStatusEvent.present = 1; pBapHCIEvent->u.btampCommandStatusEvent.status = status; pBapHCIEvent->u.btampCommandStatusEvent.num_hci_command_packets = 1; - pBapHCIEvent->u.btampCommandStatusEvent.command_opcode + pBapHCIEvent->u.btampCommandStatusEvent.command_opcode = BTAMP_TLV_HCI_ACCEPT_PHYSICAL_LINK_CMD; - /* ... */ + /* ... */ return VOS_STATUS_SUCCESS; -} /* WLAN_BAPPhysicalLinkAccept */ +} /* WLAN_BAPPhysicalLinkAccept */ /*---------------------------------------------------------------------------- FUNCTION WLAN_BAPPhysicalLinkDisconnect() - DESCRIPTION + DESCRIPTION Implements the actual HCI Disconnect Physical Link command - DEPENDENCIES - NA. + DEPENDENCIES + NA. - PARAMETERS + PARAMETERS IN btampHandle: pointer to the BAP handle. Returned from WLANBAP_GetNewHndl. pBapHCIPhysLinkDisconnect: pointer to the "HCI Disconnect Physical Link" Structure. - + IN/OUT - pBapHCIEvent: Return event value for the command status event. - (The caller of this routine is responsible for sending + pBapHCIEvent: Return event value for the command status event. + (The caller of this routine is responsible for sending the Command Status event up the HCI interface.) - + RETURN VALUE - The result code associated with performing the operation + The result code associated with performing the operation - VOS_STATUS_E_FAULT: pointer to pBapHCIPhysLinkDisconnect is NULL + VOS_STATUS_E_FAULT: pointer to pBapHCIPhysLinkDisconnect is NULL VOS_STATUS_SUCCESS: Success - - SIDE EFFECTS - + + SIDE EFFECTS + ----------------------------------------------------------------------------*/ -VOS_STATUS -WLAN_BAPPhysicalLinkDisconnect -( +VOS_STATUS +WLAN_BAPPhysicalLinkDisconnect +( ptBtampHandle btampHandle, tBtampTLVHCI_Disconnect_Physical_Link_Cmd *pBapHCIPhysLinkDisconnect, tpBtampHCI_Event pBapHCIEvent /* This now encodes ALL event types */ @@ -1058,12 +1058,12 @@ WLAN_BAPPhysicalLinkDisconnect { tWLAN_BAPEvent bapEvent; /* State machine event */ VOS_STATUS vosStatus; - /* I am using btampContext, instead of pBapPhysLinkMachine */ + /* I am using btampContext, instead of pBapPhysLinkMachine */ //tWLAN_BAPbapPhysLinkMachine *pBapPhysLinkMachine; - ptBtampContext btampContext = (ptBtampContext) btampHandle; /* btampContext value */ + ptBtampContext btampContext = (ptBtampContext) btampHandle; /* btampContext value */ v_U8_t status; /* return the BT-AMP status here */ - /* Validate params */ + /* Validate params */ if (pBapHCIPhysLinkDisconnect == NULL) { return VOS_STATUS_E_FAULT; } @@ -1071,9 +1071,9 @@ WLAN_BAPPhysicalLinkDisconnect VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "%s: btampHandle value: %p", __func__, btampHandle); /* Validate the Physical link handle */ - if (pBapHCIPhysLinkDisconnect->phy_link_handle != btampContext->phy_link_handle) + if (pBapHCIPhysLinkDisconnect->phy_link_handle != btampContext->phy_link_handle) { - /* Format the command status event to return... */ + /* Format the command status event to return... */ pBapHCIEvent->bapHCIEventCode = BTAMP_TLV_HCI_COMMAND_STATUS_EVENT; pBapHCIEvent->u.btampCommandStatusEvent.present = 1; pBapHCIEvent->u.btampCommandStatusEvent.status = WLANBAP_ERROR_NO_CNCT; @@ -1083,24 +1083,24 @@ WLAN_BAPPhysicalLinkDisconnect return VOS_STATUS_SUCCESS; } - /* Fill in the event structure */ + /* Fill in the event structure */ bapEvent.event = eWLAN_BAP_HCI_PHYSICAL_LINK_DISCONNECT; bapEvent.params = pBapHCIPhysLinkDisconnect; VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "%s: btampContext value: %p", __func__, btampContext); - /* Handle event */ + /* Handle event */ vosStatus = btampFsm(btampContext, &bapEvent, &status); - - /* Fill in the event structure */ + + /* Fill in the event structure */ bapEvent.event = eWLAN_BAP_MAC_READY_FOR_CONNECTIONS; bapEvent.params = pBapHCIPhysLinkDisconnect; - /* Handle event */ + /* Handle event */ vosStatus = btampFsm(btampContext, &bapEvent, &status); - /* Format the command status event to return... */ + /* Format the command status event to return... */ pBapHCIEvent->bapHCIEventCode = BTAMP_TLV_HCI_COMMAND_STATUS_EVENT; pBapHCIEvent->u.btampCommandStatusEvent.present = 1; pBapHCIEvent->u.btampCommandStatusEvent.status = status; @@ -1108,7 +1108,7 @@ WLAN_BAPPhysicalLinkDisconnect pBapHCIEvent->u.btampCommandStatusEvent.command_opcode = BTAMP_TLV_HCI_DISCONNECT_PHYSICAL_LINK_CMD; - /* ... */ + /* ... */ return VOS_STATUS_SUCCESS; } /* WLAN_BAPPhysicalLinkDisconnect */ @@ -1117,35 +1117,35 @@ WLAN_BAPPhysicalLinkDisconnect FUNCTION WLAN_BAPLogicalLinkCreate() - DESCRIPTION + DESCRIPTION Implements the actual HCI Create Logical Link command - DEPENDENCIES - NA. + DEPENDENCIES + NA. - PARAMETERS + PARAMETERS IN btampHandle: pointer to the BAP handle. Returned from WLANBAP_GetNewHndl. pBapHCILogLinkCreate: pointer to the "HCI Create Logical Link" Structure. - + IN/OUT - pBapHCIEvent: Return event value for the command status event. - (The caller of this routine is responsible for sending + pBapHCIEvent: Return event value for the command status event. + (The caller of this routine is responsible for sending the Command Status event up the HCI interface.) - + RETURN VALUE - The result code associated with performing the operation + The result code associated with performing the operation - VOS_STATUS_E_FAULT: pointer to pBapHCILogLinkCreate is NULL + VOS_STATUS_E_FAULT: pointer to pBapHCILogLinkCreate is NULL VOS_STATUS_SUCCESS: Success - - SIDE EFFECTS - + + SIDE EFFECTS + ----------------------------------------------------------------------------*/ -VOS_STATUS +VOS_STATUS WLAN_BAPLogicalLinkCreate -( +( ptBtampHandle btampHandle, tBtampTLVHCI_Create_Logical_Link_Cmd *pBapHCILogLinkCreate, tpBtampHCI_Event pBapHCIEvent /* This now encodes ALL event types */ @@ -1162,12 +1162,12 @@ WLAN_BAPLogicalLinkCreate /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ - /* Validate params */ + /* Validate params */ if (btampHandle == NULL) { return VOS_STATUS_E_FAULT; } - /* Validate params */ + /* Validate params */ if (pBapHCILogLinkCreate == NULL) { return VOS_STATUS_E_FAULT; } @@ -1178,11 +1178,11 @@ WLAN_BAPLogicalLinkCreate /* Validate the BAP state to accept the logical link request Logical Link create/accept requests are allowed only in CONNECTED state */ - /* Form and immediately return the command status event... */ + /* Form and immediately return the command status event... */ bapHCIEvent.bapHCIEventCode = BTAMP_TLV_HCI_COMMAND_STATUS_EVENT; bapHCIEvent.u.btampCommandStatusEvent.present = 1; bapHCIEvent.u.btampCommandStatusEvent.num_hci_command_packets = 1; - bapHCIEvent.u.btampCommandStatusEvent.command_opcode + bapHCIEvent.u.btampCommandStatusEvent.command_opcode = BTAMP_TLV_HCI_CREATE_LOGICAL_LINK_CMD; retval = VOS_STATUS_E_FAILURE; @@ -1228,8 +1228,8 @@ WLAN_BAPLogicalLinkCreate if(FALSE == btampContext->btamp_async_logical_link_create) { /* Allocate a logical link index for these flow specs */ - vosStatus = WLANBAP_CreateNewLogLinkCtx( - btampContext, /* per assoc btampContext value */ + vosStatus = WLANBAP_CreateNewLogLinkCtx( + btampContext, /* per assoc btampContext value */ pBapHCILogLinkCreate->phy_link_handle, /* I get phy_link_handle from the Command */ pBapHCILogLinkCreate->tx_flow_spec, /* I get tx_flow_spec from the Command */ pBapHCILogLinkCreate->rx_flow_spec, /* I get rx_flow_spec from the Command */ @@ -1254,7 +1254,7 @@ WLAN_BAPLogicalLinkCreate } else { - btampContext->btamp_logical_link_req_info.phyLinkHandle = + btampContext->btamp_logical_link_req_info.phyLinkHandle = pBapHCILogLinkCreate->phy_link_handle; vos_mem_copy(btampContext->btamp_logical_link_req_info.txFlowSpec, pBapHCILogLinkCreate->tx_flow_spec, 18); @@ -1273,32 +1273,32 @@ WLAN_BAPLogicalLinkCreate bapHCIEvent.u.btampCommandStatusEvent.status = WLANBAP_ERROR_INVALID_HCI_CMND_PARAM; btampContext->btamp_logical_link_state = WLAN_BAPLogLinkClosed; } - + } } } - vosStatus = (*btampContext->pBapHCIEventCB) - ( + vosStatus = (*btampContext->pBapHCIEventCB) + ( btampContext->pHddHdl, /* this refers to the BSL per connection context */ &bapHCIEvent, /* This now encodes ALL event types */ - VOS_TRUE /* Flag to indicate assoc-specific event */ + VOS_TRUE /* Flag to indicate assoc-specific event */ ); index_for_logLinkCtx = log_link_index >> 8; - /* Format the Logical Link Complete event to return... */ + /* Format the Logical Link Complete event to return... */ pBapHCIEvent->bapHCIEventCode = BTAMP_TLV_HCI_LOGICAL_LINK_COMPLETE_EVENT; pBapHCIEvent->u.btampLogicalLinkCompleteEvent.present = 1; /* Return the logical link index here */ - pBapHCIEvent->u.btampLogicalLinkCompleteEvent.log_link_handle + pBapHCIEvent->u.btampLogicalLinkCompleteEvent.log_link_handle = log_link_index; - pBapHCIEvent->u.btampLogicalLinkCompleteEvent.phy_link_handle + pBapHCIEvent->u.btampLogicalLinkCompleteEvent.phy_link_handle = pBapHCILogLinkCreate->phy_link_handle; pBapHCIEvent->u.btampLogicalLinkCompleteEvent.flow_spec_id = btampContext->btampLogLinkCtx[index_for_logLinkCtx].btampFlowSpec.flow_spec_id; - /* ... */ + /* ... */ return retval; } /* WLAN_BAPLogicalLinkCreate */ @@ -1307,35 +1307,35 @@ WLAN_BAPLogicalLinkCreate FUNCTION WLAN_BAPLogicalLinkAccept() - DESCRIPTION + DESCRIPTION Implements the actual HCI Accept Logical Link command - DEPENDENCIES - NA. + DEPENDENCIES + NA. - PARAMETERS + PARAMETERS IN btampHandle: pointer to the BAP handle. Returned from WLANBAP_GetNewHndl. pBapHCILogLinkAccept: pointer to the "HCI Accept Logical Link" Structure. - + IN/OUT - pBapHCIEvent: Return event value for the command status event. - (The caller of this routine is responsible for sending + pBapHCIEvent: Return event value for the command status event. + (The caller of this routine is responsible for sending the Command Status event up the HCI interface.) - + RETURN VALUE - The result code associated with performing the operation + The result code associated with performing the operation - VOS_STATUS_E_FAULT: pointer to pBapHCILogLinkAccept is NULL + VOS_STATUS_E_FAULT: pointer to pBapHCILogLinkAccept is NULL VOS_STATUS_SUCCESS: Success - - SIDE EFFECTS - + + SIDE EFFECTS + ----------------------------------------------------------------------------*/ -VOS_STATUS +VOS_STATUS WLAN_BAPLogicalLinkAccept -( +( ptBtampHandle btampHandle, tBtampTLVHCI_Accept_Logical_Link_Cmd *pBapHCILogLinkAccept, tpBtampHCI_Event pBapHCIEvent /* This now encodes ALL event types */ @@ -1352,12 +1352,12 @@ WLAN_BAPLogicalLinkAccept /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ - /* Validate params */ + /* Validate params */ if (btampHandle == NULL) { return VOS_STATUS_E_FAULT; } - /* Validate params */ + /* Validate params */ if (pBapHCILogLinkAccept == NULL) { return VOS_STATUS_E_FAULT; } @@ -1368,11 +1368,11 @@ WLAN_BAPLogicalLinkAccept /* Validate the BAP state to accept the logical link request Logical Link create/accept requests are allowed only in CONNECTED state */ - /* Form and immediately return the command status event... */ + /* Form and immediately return the command status event... */ bapHCIEvent.bapHCIEventCode = BTAMP_TLV_HCI_COMMAND_STATUS_EVENT; bapHCIEvent.u.btampCommandStatusEvent.present = 1; bapHCIEvent.u.btampCommandStatusEvent.num_hci_command_packets = 1; - bapHCIEvent.u.btampCommandStatusEvent.command_opcode + bapHCIEvent.u.btampCommandStatusEvent.command_opcode = BTAMP_TLV_HCI_ACCEPT_LOGICAL_LINK_CMD; retval = VOS_STATUS_E_FAILURE; @@ -1417,8 +1417,8 @@ WLAN_BAPLogicalLinkAccept if(FALSE == btampContext->btamp_async_logical_link_create) { /* Allocate a logical link index for these flow specs */ - vosStatus = WLANBAP_CreateNewLogLinkCtx( - btampContext, /* per assoc btampContext value */ + vosStatus = WLANBAP_CreateNewLogLinkCtx( + btampContext, /* per assoc btampContext value */ pBapHCILogLinkAccept->phy_link_handle, /* I get phy_link_handle from the Command */ pBapHCILogLinkAccept->tx_flow_spec, /* I get tx_flow_spec from the Command */ pBapHCILogLinkAccept->rx_flow_spec, /* I get rx_flow_spec from the Command */ @@ -1443,7 +1443,7 @@ WLAN_BAPLogicalLinkAccept } else { - btampContext->btamp_logical_link_req_info.phyLinkHandle = + btampContext->btamp_logical_link_req_info.phyLinkHandle = pBapHCILogLinkAccept->phy_link_handle; vos_mem_copy(btampContext->btamp_logical_link_req_info.txFlowSpec, pBapHCILogLinkAccept->tx_flow_spec, 18); @@ -1462,31 +1462,31 @@ WLAN_BAPLogicalLinkAccept bapHCIEvent.u.btampCommandStatusEvent.status = WLANBAP_ERROR_INVALID_HCI_CMND_PARAM; btampContext->btamp_logical_link_state = WLAN_BAPLogLinkClosed; } - + } } } - vosStatus = (*btampContext->pBapHCIEventCB) - ( + vosStatus = (*btampContext->pBapHCIEventCB) + ( btampContext->pHddHdl, /* this refers to the BSL per connection context */ &bapHCIEvent, /* This now encodes ALL event types */ - VOS_TRUE /* Flag to indicate assoc-specific event */ + VOS_TRUE /* Flag to indicate assoc-specific event */ ); index_for_logLinkCtx = log_link_index >> 8; - /* Format the Logical Link Complete event to return... */ + /* Format the Logical Link Complete event to return... */ pBapHCIEvent->bapHCIEventCode = BTAMP_TLV_HCI_LOGICAL_LINK_COMPLETE_EVENT; pBapHCIEvent->u.btampLogicalLinkCompleteEvent.present = 1; /* Return the logical link index here */ - pBapHCIEvent->u.btampLogicalLinkCompleteEvent.log_link_handle + pBapHCIEvent->u.btampLogicalLinkCompleteEvent.log_link_handle = log_link_index; - pBapHCIEvent->u.btampLogicalLinkCompleteEvent.phy_link_handle + pBapHCIEvent->u.btampLogicalLinkCompleteEvent.phy_link_handle = pBapHCILogLinkAccept->phy_link_handle; pBapHCIEvent->u.btampLogicalLinkCompleteEvent.flow_spec_id = btampContext->btampLogLinkCtx[index_for_logLinkCtx].btampFlowSpec.flow_spec_id; - /* ... */ + /* ... */ return retval; } /* WLAN_BAPLogicalLinkAccept */ @@ -1495,35 +1495,35 @@ WLAN_BAPLogicalLinkAccept FUNCTION WLAN_BAPLogicalLinkDisconnect() - DESCRIPTION + DESCRIPTION Implements the actual HCI Disconnect Logical Link command - DEPENDENCIES - NA. + DEPENDENCIES + NA. - PARAMETERS + PARAMETERS IN btampHandle: pointer to the BAP handle. Returned from WLANBAP_GetNewHndl. pBapHCILogLinkDisconnect: pointer to the "HCI Disconnect Logical Link" Structure. - + IN/OUT - pBapHCIEvent: Return event value for the command status event. - (The caller of this routine is responsible for sending + pBapHCIEvent: Return event value for the command status event. + (The caller of this routine is responsible for sending the Command Status event up the HCI interface.) - + RETURN VALUE - The result code associated with performing the operation + The result code associated with performing the operation - VOS_STATUS_E_FAULT: pointer to pBapHCILogLinkDisconnect is NULL + VOS_STATUS_E_FAULT: pointer to pBapHCILogLinkDisconnect is NULL VOS_STATUS_SUCCESS: Success - - SIDE EFFECTS - + + SIDE EFFECTS + ----------------------------------------------------------------------------*/ -VOS_STATUS +VOS_STATUS WLAN_BAPLogicalLinkDisconnect -( +( ptBtampHandle btampHandle, tBtampTLVHCI_Disconnect_Logical_Link_Cmd *pBapHCILogLinkDisconnect, tpBtampHCI_Event pBapHCIEvent /* This now encodes ALL event types */ @@ -1544,10 +1544,10 @@ WLAN_BAPLogicalLinkDisconnect if (( NULL == pBapHCILogLinkDisconnect ) || ( NULL == btampContext)) { - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, - "Critical error: Invalid input parameter on %s", - __func__); - return VOS_STATUS_E_FAULT; + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, + "Critical error: Invalid input parameter on %s", + __func__); + return VOS_STATUS_E_FAULT; } /* Derive logical link index from handle */ @@ -1555,16 +1555,16 @@ WLAN_BAPLogicalLinkDisconnect if( log_link_index >= WLANBAP_MAX_LOG_LINKS ) { - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, - "Critical error: Invalid input parameter on %s", - __func__); + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, + "Critical error: Invalid input parameter on %s", + __func__); /* Fill in the event code to propagate the event notification to BRM BRM generates the Command status Event based on this.*/ pBapHCIEvent->bapHCIEventCode = BTAMP_TLV_HCI_DISCONNECT_LOGICAL_LINK_COMPLETE_EVENT; pBapHCIEvent->u.btampDisconnectLogicalLinkCompleteEvent.present = 1; pBapHCIEvent->u.btampDisconnectLogicalLinkCompleteEvent.status = WLANBAP_ERROR_INVALID_HCI_CMND_PARAM; - return VOS_STATUS_E_INVAL; + return VOS_STATUS_E_INVAL; } @@ -1577,17 +1577,17 @@ WLAN_BAPLogicalLinkDisconnect bapHCIEvent.bapHCIEventCode = BTAMP_TLV_HCI_COMMAND_STATUS_EVENT; bapHCIEvent.u.btampCommandStatusEvent.present = 1; bapHCIEvent.u.btampCommandStatusEvent.num_hci_command_packets = 1; - bapHCIEvent.u.btampCommandStatusEvent.command_opcode + bapHCIEvent.u.btampCommandStatusEvent.command_opcode = BTAMP_TLV_HCI_DISCONNECT_LOGICAL_LINK_CMD; /*------------------------------------------------------------------------ FIXME: Validate the Logical Link handle, Generation and freeing... - Here the Logical link is not validated and assumed that it is correct to. - get the Logical link context. . + Here the Logical link is not validated and assumed that it is correct to. + get the Logical link context. . ------------------------------------------------------------------------*/ - pLogLinkContext = + pLogLinkContext = &(btampContext->btampLogLinkCtx[log_link_index]); - + // Validate whether the context is active. if ((VOS_FALSE == pLogLinkContext->present) || (pBapHCILogLinkDisconnect->log_link_handle != pLogLinkContext->log_link_handle)) @@ -1601,7 +1601,7 @@ WLAN_BAPLogicalLinkDisconnect #ifdef BAP_DEBUG /* Log the error. */ VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, - "%s:%d Invalid Logical Link handle(should be) = %d(%d)", __func__, __LINE__, + "%s:%d Invalid Logical Link handle(should be) = %d(%d)", __func__, __LINE__, pBapHCILogLinkDisconnect->log_link_handle, pLogLinkContext->log_link_handle); VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, " Logical Link index = %d", log_link_index); @@ -1609,35 +1609,35 @@ WLAN_BAPLogicalLinkDisconnect } else { - /* Form and return the command status event... */ + /* Form and return the command status event... */ bapHCIEvent.u.btampCommandStatusEvent.status = WLANBAP_STATUS_SUCCESS; - pBapHCIEvent->u.btampDisconnectLogicalLinkCompleteEvent.status + pBapHCIEvent->u.btampDisconnectLogicalLinkCompleteEvent.status = WLANBAP_STATUS_SUCCESS; - - pLogLinkContext->present = VOS_FALSE; + + pLogLinkContext->present = VOS_FALSE; pLogLinkContext->uTxPktCompleted = 0; pLogLinkContext->log_link_handle = 0; /* Decrement the total logical link count */ btampContext->total_log_link_index--; btampContext->btamp_logical_link_state = WLAN_BAPLogLinkClosed; } - + /* Notify the Command status Event */ - (*btampContext->pBapHCIEventCB) - ( + (*btampContext->pBapHCIEventCB) + ( btampContext->pHddHdl, /* this refers to the BSL per connection context */ &bapHCIEvent, /* This now encodes ALL event types */ - VOS_TRUE /* Flag to indicate assoc-specific event */ + VOS_TRUE /* Flag to indicate assoc-specific event */ ); - /* Format the Logical Link Complete event to return... */ + /* Format the Logical Link Complete event to return... */ pBapHCIEvent->bapHCIEventCode = BTAMP_TLV_HCI_DISCONNECT_LOGICAL_LINK_COMPLETE_EVENT; pBapHCIEvent->u.btampDisconnectLogicalLinkCompleteEvent.present = 1; /* Return the logical link index here */ - pBapHCIEvent->u.btampDisconnectLogicalLinkCompleteEvent.log_link_handle + pBapHCIEvent->u.btampDisconnectLogicalLinkCompleteEvent.log_link_handle = pBapHCILogLinkDisconnect->log_link_handle; - pBapHCIEvent->u.btampDisconnectLogicalLinkCompleteEvent.reason + pBapHCIEvent->u.btampDisconnectLogicalLinkCompleteEvent.reason = WLANBAP_ERROR_TERM_BY_LOCAL_HOST; return retval; @@ -1647,38 +1647,38 @@ WLAN_BAPLogicalLinkDisconnect FUNCTION WLAN_BAPLogicalLinkCancel() - DESCRIPTION + DESCRIPTION Implements the actual HCI Cancel Logical Link command - DEPENDENCIES - NA. + DEPENDENCIES + NA. - PARAMETERS + PARAMETERS IN btampHandle: pointer to the BAP handle. Returned from WLANBAP_GetNewHndl. pBapHCILogLinkCancel: pointer to the "HCI Cancel Logical Link" Structure. - + IN/OUT - pBapHCIEvent: Return event value for the command complete event. - (The caller of this routine is responsible for sending + pBapHCIEvent: Return event value for the command complete event. + (The caller of this routine is responsible for sending the Command Complete event up the HCI interface.) - (BTW, the required "HCI Logical Link Complete Event" - will be generated by the BAP state machine and sent up + (BTW, the required "HCI Logical Link Complete Event" + will be generated by the BAP state machine and sent up via the (*tpWLAN_BAPEventCB).) - + RETURN VALUE - The result code associated with performing the operation + The result code associated with performing the operation - VOS_STATUS_E_FAULT: pointer to pBapHCILogLinkCancel is NULL + VOS_STATUS_E_FAULT: pointer to pBapHCILogLinkCancel is NULL VOS_STATUS_SUCCESS: Success - - SIDE EFFECTS - + + SIDE EFFECTS + ----------------------------------------------------------------------------*/ -VOS_STATUS +VOS_STATUS WLAN_BAPLogicalLinkCancel -( +( ptBtampHandle btampHandle, tBtampTLVHCI_Logical_Link_Cancel_Cmd *pBapHCILogLinkCancel, tpBtampHCI_Event pBapHCIEvent /* This now encodes ALL event types */ @@ -1687,26 +1687,26 @@ WLAN_BAPLogicalLinkCancel { ptBtampContext btampContext; BTAMPFSM_INSTANCEDATA_T *instanceVar; - /* Validate params */ - if ((btampHandle == NULL) || (pBapHCILogLinkCancel == NULL) || + /* Validate params */ + if ((btampHandle == NULL) || (pBapHCILogLinkCancel == NULL) || (pBapHCIEvent == NULL)) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, - "%s: Null Parameters Not allowed", __func__); + "%s: Null Parameters Not allowed", __func__); return VOS_STATUS_E_FAULT; } btampContext = (ptBtampContext) btampHandle; instanceVar = &(btampContext->bapPhysLinkMachine); - /* Form and immediately return the command status event... */ + /* Form and immediately return the command status event... */ pBapHCIEvent->bapHCIEventCode = BTAMP_TLV_HCI_COMMAND_COMPLETE_EVENT; pBapHCIEvent->u.btampCommandCompleteEvent.present = 1; pBapHCIEvent->u.btampCommandCompleteEvent.command_opcode = BTAMP_TLV_HCI_LOGICAL_LINK_CANCEL_CMD; pBapHCIEvent->u.btampCommandCompleteEvent.num_hci_command_packets = 1; - if (pBapHCILogLinkCancel->phy_link_handle != btampContext->phy_link_handle) + if (pBapHCILogLinkCancel->phy_link_handle != btampContext->phy_link_handle) { pBapHCIEvent->u.btampCommandCompleteEvent.cc_event.Logical_Link_Cancel.status = WLANBAP_ERROR_NO_CNCT; @@ -1727,7 +1727,7 @@ WLAN_BAPLogicalLinkCancel { /* Cancel Logical link request in conected state */ pBapHCIEvent->u.btampCommandCompleteEvent.cc_event.Logical_Link_Cancel.status = - WLANBAP_ERROR_MAX_NUM_ACL_CNCTS; + WLANBAP_ERROR_MAX_NUM_ACL_CNCTS; } else if(WLAN_BAPLogLinkInProgress == btampContext->btamp_logical_link_state ) { @@ -1735,7 +1735,7 @@ WLAN_BAPLogicalLinkCancel creation as well */ btampContext->btamp_logical_link_cancel_pending = TRUE; pBapHCIEvent->u.btampCommandCompleteEvent.cc_event.Logical_Link_Cancel.status = - WLANBAP_STATUS_SUCCESS; + WLANBAP_STATUS_SUCCESS; } else { @@ -1747,7 +1747,7 @@ WLAN_BAPLogicalLinkCancel pBapHCILogLinkCancel->phy_link_handle; /* Since the status is not success, the Tx flow spec Id is not meaningful and filling with 0 */ - pBapHCIEvent->u.btampCommandCompleteEvent.cc_event.Logical_Link_Cancel.tx_flow_spec_id = + pBapHCIEvent->u.btampCommandCompleteEvent.cc_event.Logical_Link_Cancel.tx_flow_spec_id = pBapHCILogLinkCancel->tx_flow_spec_id; return VOS_STATUS_SUCCESS; @@ -1757,37 +1757,37 @@ WLAN_BAPLogicalLinkCancel FUNCTION WLAN_BAPFlowSpecModify() - DESCRIPTION + DESCRIPTION Implements the actual HCI Modify Logical Link command - Produces an asynchronous flow spec modify complete event. Through the + Produces an asynchronous flow spec modify complete event. Through the event callback. - DEPENDENCIES - NA. + DEPENDENCIES + NA. - PARAMETERS + PARAMETERS IN btampHandle: pointer to the BAP handle. Returned from WLANBAP_GetNewHndl. pBapHCIFlowSpecModify: pointer to the "HCI Flow Spec Modify" Structure. - + IN/OUT - pBapHCIEvent: Return event value for the command status event. - (The caller of this routine is responsible for sending + pBapHCIEvent: Return event value for the command status event. + (The caller of this routine is responsible for sending the Command Status event up the HCI interface.) - + RETURN VALUE - The result code associated with performing the operation + The result code associated with performing the operation - VOS_STATUS_E_FAULT: pointer to pBapHCIFlowSpecModify is NULL + VOS_STATUS_E_FAULT: pointer to pBapHCIFlowSpecModify is NULL VOS_STATUS_SUCCESS: Success - - SIDE EFFECTS - + + SIDE EFFECTS + ----------------------------------------------------------------------------*/ -VOS_STATUS +VOS_STATUS WLAN_BAPFlowSpecModify -( +( ptBtampHandle btampHandle, tBtampTLVHCI_Flow_Spec_Modify_Cmd *pBapHCIFlowSpecModify, tpBtampHCI_Event pBapHCIEvent /* This now encodes ALL event types */ @@ -1801,12 +1801,12 @@ WLAN_BAPFlowSpecModify VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; tBtampHCI_Event bapHCIEvent; /* This now encodes ALL event types */ /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ - /* Validate params */ - if ((btampHandle == NULL) || (pBapHCIFlowSpecModify == NULL) || + /* Validate params */ + if ((btampHandle == NULL) || (pBapHCIFlowSpecModify == NULL) || (pBapHCIEvent == NULL)) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, - "%s: Null Parameters Not allowed", __func__); + "%s: Null Parameters Not allowed", __func__); return VOS_STATUS_E_FAULT; } @@ -1819,13 +1819,13 @@ WLAN_BAPFlowSpecModify bapHCIEvent.bapHCIEventCode = BTAMP_TLV_HCI_COMMAND_STATUS_EVENT; bapHCIEvent.u.btampCommandStatusEvent.present = 1; bapHCIEvent.u.btampCommandStatusEvent.num_hci_command_packets = 1; - bapHCIEvent.u.btampCommandStatusEvent.command_opcode + bapHCIEvent.u.btampCommandStatusEvent.command_opcode = BTAMP_TLV_HCI_FLOW_SPEC_MODIFY_CMD; /*------------------------------------------------------------------------ Evaluate the Tx and Rx Flow specification for this logical link. ------------------------------------------------------------------------*/ - // Currently we only support flow specs with service types of BE (0x01) + // Currently we only support flow specs with service types of BE (0x01) /*------------------------------------------------------------------------ Now configure the Logical Link context. @@ -1847,23 +1847,23 @@ WLAN_BAPFlowSpecModify else { bapHCIEvent.u.btampCommandStatusEvent.status = WLANBAP_STATUS_SUCCESS; - pBapHCIEvent->u.btampFlowSpecModifyCompleteEvent.status + pBapHCIEvent->u.btampFlowSpecModifyCompleteEvent.status = WLANBAP_STATUS_SUCCESS; } /* Notify the Command status Event */ - vosStatus = - (*btampContext->pBapHCIEventCB) - ( + vosStatus = + (*btampContext->pBapHCIEventCB) + ( btampContext->pHddHdl, /* this refers to the BSL per connection context */ &bapHCIEvent, /* This now encodes ALL event types */ - VOS_TRUE /* Flag to indicate assoc-specific event */ + VOS_TRUE /* Flag to indicate assoc-specific event */ ); - /* Form and immediately return the command status event... */ + /* Form and immediately return the command status event... */ pBapHCIEvent->bapHCIEventCode = BTAMP_TLV_HCI_FLOW_SPEC_MODIFY_COMPLETE_EVENT; pBapHCIEvent->u.btampFlowSpecModifyCompleteEvent.present = 1; - pBapHCIEvent->u.btampFlowSpecModifyCompleteEvent.log_link_handle = + pBapHCIEvent->u.btampFlowSpecModifyCompleteEvent.log_link_handle = pBapHCIFlowSpecModify->log_link_handle; return vosStatus; @@ -1877,10 +1877,10 @@ void WLAN_BAPEstablishLogicalLink(ptBtampContext btampContext) v_U16_t index_for_logLinkCtx = 0; VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; - if (btampContext == NULL) + if (btampContext == NULL) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, - "%s: Null Parameters Not allowed", __func__); + "%s: Null Parameters Not allowed", __func__); return; } @@ -1893,8 +1893,8 @@ void WLAN_BAPEstablishLogicalLink(ptBtampContext btampContext) else { /* Allocate a logical link index for these flow specs */ - vosStatus = WLANBAP_CreateNewLogLinkCtx( - btampContext, /* per assoc btampContext value */ + vosStatus = WLANBAP_CreateNewLogLinkCtx( + btampContext, /* per assoc btampContext value */ btampContext->btamp_logical_link_req_info.phyLinkHandle, /* I get phy_link_handle from the Command */ btampContext->btamp_logical_link_req_info.txFlowSpec, /* I get tx_flow_spec from the Command */ btampContext->btamp_logical_link_req_info.rxFlowSpec, /* I get rx_flow_spec from the Command */ @@ -1912,28 +1912,25 @@ void WLAN_BAPEstablishLogicalLink(ptBtampContext btampContext) btampContext->btamp_logical_link_state = WLAN_BAPLogLinkOpen; } } - + index_for_logLinkCtx = log_link_index >> 8; - /* Format the Logical Link Complete event to return... */ + /* Format the Logical Link Complete event to return... */ bapHCIEvent.bapHCIEventCode = BTAMP_TLV_HCI_LOGICAL_LINK_COMPLETE_EVENT; bapHCIEvent.u.btampLogicalLinkCompleteEvent.present = 1; /* Return the logical link index here */ - bapHCIEvent.u.btampLogicalLinkCompleteEvent.log_link_handle + bapHCIEvent.u.btampLogicalLinkCompleteEvent.log_link_handle = log_link_index; - bapHCIEvent.u.btampLogicalLinkCompleteEvent.phy_link_handle + bapHCIEvent.u.btampLogicalLinkCompleteEvent.phy_link_handle = btampContext->btamp_logical_link_req_info.phyLinkHandle; bapHCIEvent.u.btampLogicalLinkCompleteEvent.flow_spec_id = btampContext->btampLogLinkCtx[index_for_logLinkCtx].btampFlowSpec.flow_spec_id; - vosStatus = (*btampContext->pBapHCIEventCB) - ( + vosStatus = (*btampContext->pBapHCIEventCB) + ( btampContext->pHddHdl, /* this refers to the BSL per connection context */ &bapHCIEvent, /* This now encodes ALL event types */ - VOS_TRUE /* Flag to indicate assoc-specific event */ + VOS_TRUE /* Flag to indicate assoc-specific event */ ); return; } - - - diff --git a/CORE/BAP/src/bapApiLinkSupervision.c b/CORE/BAP/src/bapApiLinkSupervision.c index 4c7495714326..4425e2fcd06d 100644 --- a/CORE/BAP/src/bapApiLinkSupervision.c +++ b/CORE/BAP/src/bapApiLinkSupervision.c @@ -28,16 +28,16 @@ /*=========================================================================== b a p A p i LinkSupervision . C - + OVERVIEW: - + This software unit holds the implementation of the WLAN BAP modules "platform independent" Data path functions. - - The functions externalized by this module are to be called ONLY by other + + The functions externalized by this module are to be called ONLY by other WLAN modules (HDD) that properly register with the BAP Layer initially. - DEPENDENCIES: + DEPENDENCIES: Are listed for each API below. ===========================================================================*/ @@ -66,8 +66,8 @@ //I need the TL types and API #include "wlan_qct_tl.h" -/* BT-AMP PAL API header file */ -#include "bapApi.h" +/* BT-AMP PAL API header file */ +#include "bapApi.h" #include "bapInternal.h" #include "bapApiTimer.h" @@ -112,7 +112,7 @@ WLANBAP_AcquireLSPacket( ptBtampContext pBtampCtx, vos_pkt_t **ppPacket, v_U16_t v_U16_t headerLength; /* The 802.3 frame length*/ v_U16_t protoType; v_U8_t *pData = NULL; - + if(isLsReq) { @@ -121,10 +121,10 @@ WLANBAP_AcquireLSPacket( ptBtampContext pBtampCtx, vos_pkt_t **ppPacket, v_U16_t else { protoType = WLANTL_BT_AMP_TYPE_LS_REP; - } + } //If success, vosTxLsPacket is the packet and pData points to the head. - vosStatus = vos_pkt_get_packet( &pPacket, VOS_PKT_TYPE_TX_802_11_MGMT,size, 1, + vosStatus = vos_pkt_get_packet( &pPacket, VOS_PKT_TYPE_TX_802_11_MGMT,size, 1, VOS_TRUE, NULL, NULL ); if( VOS_IS_STATUS_SUCCESS( vosStatus ) ) { @@ -150,25 +150,25 @@ WLANBAP_AcquireLSPacket( ptBtampContext pBtampCtx, vos_pkt_t **ppPacket, v_U16_t headerLength = WLANBAP_LLC_HEADER_LEN; /* Now the 802.3 length field is big-endian?! */ - w8023Header.usLenType = vos_cpu_to_be16(headerLength); - + w8023Header.usLenType = vos_cpu_to_be16(headerLength); + /* Now adjust the protocol type bytes*/ protoType = vos_cpu_to_be16( protoType); /* Now form the LLC header */ - vos_mem_copy(aucLLCHeader, - WLANBAP_LLC_HEADER, + vos_mem_copy(aucLLCHeader, + WLANBAP_LLC_HEADER, sizeof(WLANBAP_LLC_HEADER)); - vos_mem_copy(&aucLLCHeader[WLANBAP_LLC_OUI_OFFSET], - WLANBAP_BT_AMP_OUI, + vos_mem_copy(&aucLLCHeader[WLANBAP_LLC_OUI_OFFSET], + WLANBAP_BT_AMP_OUI, WLANBAP_LLC_OUI_SIZE); - vos_mem_copy(&aucLLCHeader[WLANBAP_LLC_PROTO_TYPE_OFFSET], + vos_mem_copy(&aucLLCHeader[WLANBAP_LLC_PROTO_TYPE_OFFSET], &protoType, //WLANBAP_BT_AMP_TYPE_LS_REQ WLANBAP_LLC_PROTO_TYPE_SIZE); - + /* Push on the LLC header */ - vos_pkt_push_head(pPacket, - aucLLCHeader, - WLANBAP_LLC_HEADER_LEN); + vos_pkt_push_head(pPacket, + aucLLCHeader, + WLANBAP_LLC_HEADER_LEN); /* Push on the 802.3 header */ vos_pkt_push_head(pPacket, &w8023Header, sizeof(w8023Header)); @@ -182,47 +182,47 @@ WLANBAP_AcquireLSPacket( ptBtampContext pBtampCtx, vos_pkt_t **ppPacket, v_U16_t FUNCTION WLANBAP_InitLinkSupervision - DESCRIPTION + DESCRIPTION This API will be called when Link Supervision module is to be initialized when connected at BAP - PARAMETERS + PARAMETERS btampHandle: The BT-AMP PAL handle returned in WLANBAP_GetNewHndl. - + RETURN VALUE - The result code associated with performing the operation + The result code associated with performing the operation - VOS_STATUS_E_INVAL: Input parameters are invalid - VOS_STATUS_E_FAULT: BAP handle is NULL - VOS_STATUS_SUCCESS: Everything is good :) + VOS_STATUS_E_INVAL: Input parameters are invalid + VOS_STATUS_E_FAULT: BAP handle is NULL + VOS_STATUS_SUCCESS: Everything is good :) + + SIDE EFFECTS - SIDE EFFECTS - ============================================================================*/ #define TX_LS_DATALEN 32 VOS_STATUS WLANBAP_InitLinkSupervision -( +( ptBtampHandle btampHandle ) { VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; ptBtampContext pBtampCtx = (ptBtampContext) btampHandle; - vos_pkt_t *pLSReqPacket; - vos_pkt_t *pLSRepPacket; - v_U16_t lsPktln; + vos_pkt_t *pLSReqPacket; + vos_pkt_t *pLSRepPacket; + v_U16_t lsPktln; - if ( NULL == pBtampCtx) + if ( NULL == pBtampCtx) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "Invalid BAP handle value in %s", __func__); return VOS_STATUS_E_FAULT; } -#if 0 +#if 0 /* Initialize Link supervision data structure */ vos_mem_set(pLsInfo, sizeof(tBtampLS),0); @@ -246,7 +246,7 @@ WLANBAP_InitLinkSupervision VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO, "%s:AcquireLSPacket failed\n",__func__); pBtampCtx->lsReqPacket = NULL; - return vosStatus; + return vosStatus; } vosStatus = WLANBAP_AcquireLSPacket( pBtampCtx, &pLSRepPacket,32,FALSE ); @@ -259,12 +259,12 @@ WLANBAP_InitLinkSupervision VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO, "%s:AcquireLSPacket failed\n",__func__); pBtampCtx->lsRepPacket = NULL; - return vosStatus; - } + return vosStatus; + } - vosStatus = vos_pkt_get_packet_length(pBtampCtx->lsRepPacket,&lsPktln); + vosStatus = vos_pkt_get_packet_length(pBtampCtx->lsRepPacket,&lsPktln); - if ( VOS_STATUS_SUCCESS != vosStatus ) + if ( VOS_STATUS_SUCCESS != vosStatus ) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO, "%s:vos_pkt_get_length error",__func__); @@ -283,7 +283,7 @@ WLANBAP_InitLinkSupervision VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO, "%s:No LS configured for infinite",__func__); } - + return vosStatus; } @@ -291,35 +291,35 @@ WLANBAP_InitLinkSupervision FUNCTION WLANBAP_DeInitLinkSupervision - DESCRIPTION + DESCRIPTION - This API will be called when Link Supervision module is to be stopped after disconnected at BAP + This API will be called when Link Supervision module is to be stopped after disconnected at BAP - PARAMETERS + PARAMETERS btampHandle: The BT-AMP PAL handle returned in WLANBAP_GetNewHndl. - + RETURN VALUE - The result code associated with performing the operation + The result code associated with performing the operation - VOS_STATUS_E_INVAL: Input parameters are invalid - VOS_STATUS_E_FAULT: BAP handle is NULL - VOS_STATUS_SUCCESS: Everything is good :) + VOS_STATUS_E_INVAL: Input parameters are invalid + VOS_STATUS_E_FAULT: BAP handle is NULL + VOS_STATUS_SUCCESS: Everything is good :) + + SIDE EFFECTS - SIDE EFFECTS - ============================================================================*/ VOS_STATUS WLANBAP_DeInitLinkSupervision -( - ptBtampHandle btampHandle +( + ptBtampHandle btampHandle ) { VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; ptBtampContext pBtampCtx = (ptBtampContext) btampHandle; - if ( NULL == pBtampCtx) + if ( NULL == pBtampCtx) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "Invalid BAP handle value in %s", __func__); @@ -330,7 +330,7 @@ WLANBAP_DeInitLinkSupervision vosStatus = WLANBAP_StopLinkSupervisionTimer(pBtampCtx); - + /*Free the vos packet*/ if ( pBtampCtx->lsRepPacket ) { @@ -341,9 +341,9 @@ WLANBAP_DeInitLinkSupervision if ( pBtampCtx->lsReqPacket ) { vosStatus = vos_pkt_return_packet(pBtampCtx->lsReqPacket); - pBtampCtx->lsReqPacket = NULL; + pBtampCtx->lsReqPacket = NULL; } - + return vosStatus; } @@ -352,32 +352,32 @@ WLANBAP_DeInitLinkSupervision FUNCTION WLANBAP_RxProcLsPkt - DESCRIPTION + DESCRIPTION This API will be called when Link Supervision frames are received at BAP - PARAMETERS + PARAMETERS btampHandle: The BT-AMP PAL handle returned in WLANBAP_GetNewHndl. - pucAC: Pointer to return the access category - vosDataBuff: The data buffer containing the 802.3 frame to be + pucAC: Pointer to return the access category + vosDataBuff: The data buffer containing the 802.3 frame to be translated to BT HCI Data Packet - + RETURN VALUE - The result code associated with performing the operation + The result code associated with performing the operation + + VOS_STATUS_E_INVAL: Input parameters are invalid + VOS_STATUS_E_FAULT: BAP handle is NULL + VOS_STATUS_SUCCESS: Everything is good :) - VOS_STATUS_E_INVAL: Input parameters are invalid - VOS_STATUS_E_FAULT: BAP handle is NULL - VOS_STATUS_SUCCESS: Everything is good :) + SIDE EFFECTS - SIDE EFFECTS - ============================================================================*/ VOS_STATUS WLANBAP_RxProcLsPkt -( - ptBtampHandle btampHandle, +( + ptBtampHandle btampHandle, v_U8_t phy_link_handle, /* Used by BAP to indentify the WLAN assoc. (StaId) */ v_U16_t RxProtoType, /* Protocol Type from the frame received */ vos_pkt_t *vosRxLsBuff @@ -392,7 +392,7 @@ WLANBAP_RxProcLsPkt /*------------------------------------------------------------------------ Sanity check params ------------------------------------------------------------------------*/ - if ( NULL == pBtampCtx) + if ( NULL == pBtampCtx) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "Invalid BAP handle value in %s", __func__); @@ -401,7 +401,7 @@ WLANBAP_RxProcLsPkt VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "In %s Received RxProtoType=%x", __func__,RxProtoType); - + vos_pkt_extract_data(vosRxLsBuff,0,(v_VOID_t*)&w8023Header,&HeaderLen); if ( !(vos_mem_compare( w8023Header.vDA, pBtampCtx->self_mac_addr, VOS_MAC_ADDR_SIZE) && vos_mem_compare( w8023Header.vSA, pBtampCtx->peer_mac_addr, VOS_MAC_ADDR_SIZE))) @@ -421,10 +421,10 @@ WLANBAP_RxProcLsPkt return VOS_STATUS_E_FAULT; } - + /* Reset Link Supervision timer */ if (RxProtoType == WLANTL_BT_AMP_TYPE_LS_REP) - { + { pBtampCtx->lsReqPktPending = FALSE; pBtampCtx->retries = 0; if (pBtampCtx->bapLinkSupervisionTimerInterval) @@ -448,8 +448,8 @@ WLANBAP_RxProcLsPkt // Handle LS rep frame vosStatus = WLANBAP_TxLinkSupervision( btampHandle, phy_link_handle, pBtampCtx->pPacket, WLANTL_BT_AMP_TYPE_LS_REP); } - - return vosStatus; + + return vosStatus; } @@ -462,8 +462,8 @@ static VOS_STATUS WLANBAP_TxLinkSupervisionCB ) { VOS_STATUS vosStatus; - ptBtampContext bapContext; /* Holds the btampContext value returned */ - vos_pkt_t *pLSPacket; + ptBtampContext bapContext; /* Holds the btampContext value returned */ + vos_pkt_t *pLSPacket; VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO, "TxCompCB reached for LS Pkt"); @@ -486,7 +486,7 @@ static VOS_STATUS WLANBAP_TxLinkSupervisionCB /* Return the packet & reallocate */ - + if( pPacket == bapContext->lsReqPacket ) { vosStatus = WLANBAP_AcquireLSPacket( bapContext, &pLSPacket,32, TRUE ); @@ -499,7 +499,7 @@ static VOS_STATUS WLANBAP_TxLinkSupervisionCB VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO, "%s:AcquireLSPacket failed\n",__func__); bapContext->lsReqPacket = NULL; - return vosStatus; + return vosStatus; } } else @@ -514,7 +514,7 @@ static VOS_STATUS WLANBAP_TxLinkSupervisionCB VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO, "%s:AcquireLSPacket failed\n",__func__); bapContext->lsRepPacket = NULL; - return vosStatus; + return vosStatus; } } VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO, @@ -529,32 +529,32 @@ static VOS_STATUS WLANBAP_TxLinkSupervisionCB FUNCTION WLANBAP_TxLinkSupervision - DESCRIPTION + DESCRIPTION This API will be called to process Link Supervision Request received - PARAMETERS + PARAMETERS btampHandle: The BT-AMP PAL handle returned in WLANBAP_GetNewHndl. - pucAC: Pointer to return the access category - vosDataBuff: The data buffer containing the 802.3 frame to be + pucAC: Pointer to return the access category + vosDataBuff: The data buffer containing the 802.3 frame to be translated to BT HCI Data Packet - - RETURN VALUE - The result code associated with performing the operation + RETURN VALUE + + The result code associated with performing the operation + + VOS_STATUS_E_INVAL: Input parameters are invalid + VOS_STATUS_E_FAULT: BAP handle is NULL + VOS_STATUS_SUCCESS: Everything is good :) - VOS_STATUS_E_INVAL: Input parameters are invalid - VOS_STATUS_E_FAULT: BAP handle is NULL - VOS_STATUS_SUCCESS: Everything is good :) + SIDE EFFECTS - SIDE EFFECTS - ============================================================================*/ VOS_STATUS WLANBAP_TxLinkSupervision -( - ptBtampHandle btampHandle, +( + ptBtampHandle btampHandle, v_U8_t phy_link_handle, /* Used by BAP to indentify the WLAN assoc. (StaId) */ vos_pkt_t *pPacket, v_U16_t protoType @@ -574,15 +574,15 @@ WLANBAP_TxLinkSupervision // Retrieve the VOSS context pvosGCtx = pBtampCtx->pvosGCtx; - /* Lookup the StaId using the phy_link_handle and the BAP context */ + /* Lookup the StaId using the phy_link_handle and the BAP context */ - vosStatus = WLANBAP_GetStaIdFromLinkCtx ( - btampHandle, /* btampHandle value in */ + vosStatus = WLANBAP_GetStaIdFromLinkCtx ( + btampHandle, /* btampHandle value in */ phy_link_handle, /* phy_link_handle value in */ &ucSTAId, /* The StaId (used by TL, PE, and HAL) */ &pHddHdl); /* Handle to return BSL context */ - - if ( VOS_STATUS_SUCCESS != vosStatus ) + + if ( VOS_STATUS_SUCCESS != vosStatus ) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "Unable to retrieve STA Id from BAP context and phy_link_handle in WLANBAP_TxLinKSupervisionReq"); @@ -590,14 +590,14 @@ WLANBAP_TxLinkSupervision } vos_mem_zero( &metaInfo, sizeof( WLANTL_MetaInfoType ) ); - + metaInfo.ucTID = 0x00 ; metaInfo.ucUP = 0x00; metaInfo.ucIsEapol = VOS_FALSE;//Notify TL that this is NOT an EAPOL frame metaInfo.ucDisableFrmXtl = VOS_FALSE; metaInfo.ucType = 0x00; pBtampCtx->metaInfo = metaInfo; - + vosStatus = WLANTL_TxBAPFrm( pvosGCtx, pPacket, &metaInfo, WLANBAP_TxLinkSupervisionCB ); if( !VOS_IS_STATUS_SUCCESS( vosStatus ) ) { @@ -605,13 +605,13 @@ WLANBAP_TxLinkSupervision "Tx: Packet rejected by TL in WLANBAP_TxLinkSupervisionReq"); return vosStatus; } - + if(protoType == WLANTL_BT_AMP_TYPE_LS_REQ) { pBtampCtx->lsReqPktPending = TRUE; pBtampCtx->retries++; } - + if (pBtampCtx->bapLinkSupervisionTimerInterval) { /* Restart the LS timer */ @@ -626,9 +626,6 @@ WLANBAP_TxLinkSupervision "WLANBAP_TxLinkSupervisionReq failed to Start LinkSupervision Timer\n" ); return vosStatus; } - + return vosStatus; } /* WLANBAP_RxLinkSupervisionReq */ - - - diff --git a/CORE/BAP/src/bapApiStatus.c b/CORE/BAP/src/bapApiStatus.c index b24030866016..7fdf1dfc5b87 100644 --- a/CORE/BAP/src/bapApiStatus.c +++ b/CORE/BAP/src/bapApiStatus.c @@ -28,16 +28,16 @@ /*=========================================================================== b a p A p i S t a t u s . C - + OVERVIEW: - + This software unit holds the implementation of the WLAN BAP modules Status functions. - - The functions externalized by this module are to be called ONLY by other + + The functions externalized by this module are to be called ONLY by other WLAN modules (HDD) that properly register with the BAP Layer initially. - DEPENDENCIES: + DEPENDENCIES: Are listed for each API below. ===========================================================================*/ @@ -66,9 +66,9 @@ //#include "wlan_qct_tl.h" #include "vos_trace.h" -/* BT-AMP PAL API header file */ -#include "bapApi.h" -#include "bapInternal.h" +/* BT-AMP PAL API header file */ +#include "bapApi.h" +#include "bapInternal.h" //#define BAP_DEBUG /*---------------------------------------------------------------------------- @@ -108,39 +108,39 @@ Status Parameters FUNCTION WLAN_BAPReadFailedContactCounter() - DESCRIPTION - Implements the actual HCI Read Failed Contact Counter command. There - is no need for a callback because when this call returns the action + DESCRIPTION + Implements the actual HCI Read Failed Contact Counter command. There + is no need for a callback because when this call returns the action has been completed. - DEPENDENCIES - NA. + DEPENDENCIES + NA. - PARAMETERS + PARAMETERS IN btampHandle: pointer to the BAP handle. Returned from WLANBAP_GetNewHndl. pBapHCIReadFailedContactCounter: pointer to the "HCI Read Failed Contact Counter" structure. pFailedContactCounter: pointer to return value for the "Failed Contact Counter" - + IN/OUT - pBapHCIEvent: Return event value for the command complete event. - (The caller of this routine is responsible for sending + pBapHCIEvent: Return event value for the command complete event. + (The caller of this routine is responsible for sending the Command Complete event up the HCI interface.) - + RETURN VALUE - The result code associated with performing the operation + The result code associated with performing the operation VOS_STATUS_E_FAULT: pointer to pBapHCIReadFailedContactCounter or - pFailedContactCounter is NULL + pFailedContactCounter is NULL VOS_STATUS_SUCCESS: Success - - SIDE EFFECTS - + + SIDE EFFECTS + ----------------------------------------------------------------------------*/ -VOS_STATUS +VOS_STATUS WLAN_BAPReadFailedContactCounter -( +( ptBtampHandle btampHandle, tBtampTLVHCI_Read_Failed_Contact_Counter_Cmd *pBapHCIReadFailedContactCounter, tpBtampHCI_Event pBapHCIEvent /* This now encodes ALL event types */ @@ -155,37 +155,37 @@ WLAN_BAPReadFailedContactCounter FUNCTION WLAN_BAPResetFailedContactCounter() - DESCRIPTION - Implements the actual HCI Reset Failed Contact Counter command. There - is no need for a callback because when this call returns the action + DESCRIPTION + Implements the actual HCI Reset Failed Contact Counter command. There + is no need for a callback because when this call returns the action has been completed. - DEPENDENCIES - NA. + DEPENDENCIES + NA. - PARAMETERS + PARAMETERS IN btampHandle: pointer to the BAP handle. Returned from WLANBAP_GetNewHndl. pBapHCIResetFailedContactCounter: pointer to the "HCI Reset Failed Contact Counter" structure. - + IN/OUT - pBapHCIEvent: Return event value for the command complete event. - (The caller of this routine is responsible for sending + pBapHCIEvent: Return event value for the command complete event. + (The caller of this routine is responsible for sending the Command Complete event up the HCI interface.) - + RETURN VALUE - The result code associated with performing the operation + The result code associated with performing the operation VOS_STATUS_E_FAULT: pointer to pBapHCIResetFailedContactCounter is NULL VOS_STATUS_SUCCESS: Success - - SIDE EFFECTS - + + SIDE EFFECTS + ----------------------------------------------------------------------------*/ -VOS_STATUS +VOS_STATUS WLAN_BAPResetFailedContactCounter -( +( ptBtampHandle btampHandle, tBtampTLVHCI_Reset_Failed_Contact_Counter_Cmd *pBapHCIResetFailedContactCounter, tpBtampHCI_Event pBapHCIEvent /* This now encodes ALL event types */ @@ -200,39 +200,39 @@ WLAN_BAPResetFailedContactCounter FUNCTION WLAN_BAPReadLinkQuality() - DESCRIPTION - Implements the actual HCI Read Link Quality command. There - is no need for a callback because when this call returns the action + DESCRIPTION + Implements the actual HCI Read Link Quality command. There + is no need for a callback because when this call returns the action has been completed. - DEPENDENCIES - NA. + DEPENDENCIES + NA. - PARAMETERS + PARAMETERS IN btampHandle: pointer to the BAP handle. Returned from WLANBAP_GetNewHndl. pBapHCIReadLinkQuality: pointer to the "HCI Read Link Quality" structure. pBapHCILinkQuality: pointer to return value for the "Link Quality" - + IN/OUT - pBapHCIEvent: Return event value for the command complete event. - (The caller of this routine is responsible for sending + pBapHCIEvent: Return event value for the command complete event. + (The caller of this routine is responsible for sending the Command Complete event up the HCI interface.) - + RETURN VALUE - The result code associated with performing the operation + The result code associated with performing the operation - VOS_STATUS_E_FAULT: pointer to pBapHCIReadLinkQuality or - pBapHCILinkQuality is NULL + VOS_STATUS_E_FAULT: pointer to pBapHCIReadLinkQuality or + pBapHCILinkQuality is NULL VOS_STATUS_SUCCESS: Success - - SIDE EFFECTS - + + SIDE EFFECTS + ----------------------------------------------------------------------------*/ -VOS_STATUS +VOS_STATUS WLAN_BAPReadLinkQuality -( +( ptBtampHandle btampHandle, tBtampTLVHCI_Read_Link_Quality_Cmd *pBapHCIReadLinkQuality, tpBtampHCI_Event pBapHCIEvent /* This now encodes ALL event types */ @@ -246,7 +246,7 @@ WLAN_BAPReadLinkQuality VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "%s: btampHandle value: %p", __func__, btampHandle); - /* Validate params */ + /* Validate params */ if ((NULL == btampHandle) || (NULL == pBapHCIReadLinkQuality) || (NULL == pBapHCIEvent)) { @@ -282,11 +282,11 @@ WLAN_BAPReadLinkQuality = WLANBAP_STATUS_SUCCESS; } - /* Fill in the parameters for command complete event... */ + /* Fill in the parameters for command complete event... */ pBapHCIEvent->bapHCIEventCode = BTAMP_TLV_HCI_COMMAND_COMPLETE_EVENT; pBapHCIEvent->u.btampCommandCompleteEvent.present = TRUE; pBapHCIEvent->u.btampCommandCompleteEvent.num_hci_command_packets = 1; - pBapHCIEvent->u.btampCommandCompleteEvent.command_opcode + pBapHCIEvent->u.btampCommandCompleteEvent.command_opcode = BTAMP_TLV_HCI_READ_LINK_QUALITY_CMD; return VOS_STATUS_SUCCESS; @@ -296,39 +296,39 @@ WLAN_BAPReadLinkQuality FUNCTION WLAN_BAPReadRSSI() - DESCRIPTION - Implements the actual HCI Read RSSI command. There - is no need for a callback because when this call returns the action + DESCRIPTION + Implements the actual HCI Read RSSI command. There + is no need for a callback because when this call returns the action has been completed. - DEPENDENCIES - NA. + DEPENDENCIES + NA. - PARAMETERS + PARAMETERS IN btampHandle: pointer to the BAP handle. Returned from WLANBAP_GetNewHndl. pBapHCIReadRSSI: pointer to the "HCI Read RSSI" structure. pBapHCIRSSI: pointer to return value for the "RSSI". - + IN/OUT - pBapHCIEvent: Return event value for the command complete event. - (The caller of this routine is responsible for sending + pBapHCIEvent: Return event value for the command complete event. + (The caller of this routine is responsible for sending the Command Complete event up the HCI interface.) - + RETURN VALUE - The result code associated with performing the operation + The result code associated with performing the operation VOS_STATUS_E_FAULT: pointer to pBapHCIReadRSSI or - pBapHCIRSSI is NULL + pBapHCIRSSI is NULL VOS_STATUS_SUCCESS: Success - - SIDE EFFECTS - + + SIDE EFFECTS + ----------------------------------------------------------------------------*/ -VOS_STATUS +VOS_STATUS WLAN_BAPReadRSSI -( +( ptBtampHandle btampHandle, tBtampTLVHCI_Read_RSSI_Cmd *pBapHCIReadRSSI, tpBtampHCI_Event pBapHCIEvent /* This now encodes ALL event types */ @@ -343,7 +343,7 @@ WLAN_BAPReadRSSI VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "%s: btampHandle value: %p", __func__, btampHandle); - /* Validate params */ + /* Validate params */ if ((NULL == btampHandle) || (NULL == pBapHCIReadRSSI) || (NULL == pBapHCIEvent)) { @@ -388,11 +388,11 @@ WLAN_BAPReadRSSI } } - /* Fill in the parameters for command complete event... */ + /* Fill in the parameters for command complete event... */ pBapHCIEvent->bapHCIEventCode = BTAMP_TLV_HCI_COMMAND_COMPLETE_EVENT; pBapHCIEvent->u.btampCommandCompleteEvent.present = TRUE; pBapHCIEvent->u.btampCommandCompleteEvent.num_hci_command_packets = 1; - pBapHCIEvent->u.btampCommandCompleteEvent.command_opcode + pBapHCIEvent->u.btampCommandCompleteEvent.command_opcode = BTAMP_TLV_HCI_READ_RSSI_CMD; return VOS_STATUS_SUCCESS; @@ -402,50 +402,50 @@ WLAN_BAPReadRSSI FUNCTION WLAN_BAPReadLocalAMPInfo() - DESCRIPTION - Implements the actual HCI Read Local AMP Information command. There - is no need for a callback because when this call returns the action + DESCRIPTION + Implements the actual HCI Read Local AMP Information command. There + is no need for a callback because when this call returns the action has been completed. - DEPENDENCIES - NA. + DEPENDENCIES + NA. - PARAMETERS + PARAMETERS IN btampHandle: pointer to the BAP handle. Returned from WLANBAP_GetNewHndl. pBapHCIReadLocalAMPInfo: pointer to the "HCI Read Local AMP Info" Structure. - + IN/OUT - pBapHCIEvent: Return event value for the command complete event. - (The caller of this routine is responsible for sending + pBapHCIEvent: Return event value for the command complete event. + (The caller of this routine is responsible for sending the Command Complete event up the HCI interface.) - + RETURN VALUE - The result code associated with performing the operation + The result code associated with performing the operation - VOS_STATUS_E_FAULT: pointer to pBapHCIReadLocalAMPInfo or + VOS_STATUS_E_FAULT: pointer to pBapHCIReadLocalAMPInfo or pBapHCILocalAMPInfo is NULL VOS_STATUS_SUCCESS: Success - - SIDE EFFECTS - + + SIDE EFFECTS + ----------------------------------------------------------------------------*/ -VOS_STATUS +VOS_STATUS WLAN_BAPReadLocalAMPInfo -( +( ptBtampHandle btampHandle, tBtampTLVHCI_Read_Local_AMP_Information_Cmd *pBapHCIReadLocalAMPInfo, tpBtampHCI_Event pBapHCIEvent /* This now encodes ALL event types */ /* Including Command Complete and Command Status*/ ) { - /* Validate params */ + /* Validate params */ if (btampHandle == NULL) { return VOS_STATUS_E_FAULT; } - /* Validate params */ + /* Validate params */ if (pBapHCIReadLocalAMPInfo == NULL) { return VOS_STATUS_E_FAULT; } @@ -453,13 +453,13 @@ WLAN_BAPReadLocalAMPInfo VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "%s: btampHandle value: %p", __func__, btampHandle); - /* Format the command complete event to return... */ + /* Format the command complete event to return... */ pBapHCIEvent->bapHCIEventCode = BTAMP_TLV_HCI_COMMAND_COMPLETE_EVENT; pBapHCIEvent->u.btampCommandCompleteEvent.present = 1; pBapHCIEvent->u.btampCommandCompleteEvent.num_hci_command_packets = 1; - pBapHCIEvent->u.btampCommandCompleteEvent.command_opcode + pBapHCIEvent->u.btampCommandCompleteEvent.command_opcode = BTAMP_TLV_HCI_READ_LOCAL_AMP_INFORMATION_CMD; - pBapHCIEvent->u.btampCommandCompleteEvent.cc_event.Read_Local_AMP_Info.status + pBapHCIEvent->u.btampCommandCompleteEvent.cc_event.Read_Local_AMP_Info.status = WLANBAP_STATUS_SUCCESS; pBapHCIEvent->u.btampCommandCompleteEvent.cc_event.Read_Local_AMP_Info.HC_AMP_Status = WLANBAP_HCI_AMP_STATUS_NOT_SHARED; @@ -471,7 +471,7 @@ WLAN_BAPReadLocalAMPInfo = 100; pBapHCIEvent->u.btampCommandCompleteEvent.cc_event.Read_Local_AMP_Info.HC_Max_PDU_Size = WLANBAP_MAX_80211_PAL_PDU_SIZE; - pBapHCIEvent->u.btampCommandCompleteEvent.cc_event.Read_Local_AMP_Info.HC_Controller_Type + pBapHCIEvent->u.btampCommandCompleteEvent.cc_event.Read_Local_AMP_Info.HC_Controller_Type = 1; #if 0 AMP Info PAL_Capabilities: Size: 2 Octets @@ -499,39 +499,39 @@ Value Parameter Description FUNCTION WLAN_BAPReadLocalAMPAssoc() - DESCRIPTION - Implements the actual HCI Read Local AMP Assoc command. There - is no need for a callback because when this call returns the action + DESCRIPTION + Implements the actual HCI Read Local AMP Assoc command. There + is no need for a callback because when this call returns the action has been completed. - DEPENDENCIES - NA. + DEPENDENCIES + NA. - PARAMETERS + PARAMETERS IN btampHandle: pointer to the BAP handle. Returned from WLANBAP_GetNewHndl. pBapHCIReadLocalAMPAssoc: pointer to the "HCI Read Local AMP Assoc" Structure. - + IN/OUT - pBapHCIEvent: Return event value for the command complete event. - (The caller of this routine is responsible for sending + pBapHCIEvent: Return event value for the command complete event. + (The caller of this routine is responsible for sending the Command Complete event up the HCI interface.) - - + + RETURN VALUE - The result code associated with performing the operation + The result code associated with performing the operation - VOS_STATUS_E_FAULT: pointer to pBapHCIReadLocalAMPAssoc - (or pBapHCILocalAMPAssoc) is NULL + VOS_STATUS_E_FAULT: pointer to pBapHCIReadLocalAMPAssoc + (or pBapHCILocalAMPAssoc) is NULL VOS_STATUS_SUCCESS: Success - - SIDE EFFECTS - + + SIDE EFFECTS + ----------------------------------------------------------------------------*/ -VOS_STATUS +VOS_STATUS WLAN_BAPReadLocalAMPAssoc -( +( ptBtampHandle btampHandle, tBtampTLVHCI_Read_Local_AMP_Assoc_Cmd *pBapHCIReadLocalAMPAssoc, tpBtampHCI_Event pBapHCIEvent /* This now encodes ALL event types */ @@ -539,14 +539,14 @@ WLAN_BAPReadLocalAMPAssoc ) { VOS_STATUS vosStatus; - ptBtampContext btampContext = (ptBtampContext) btampHandle; /* btampContext value */ + ptBtampContext btampContext = (ptBtampContext) btampHandle; /* btampContext value */ tHalHandle hHal; - tBtampAMP_ASSOC btamp_ASSOC; + tBtampAMP_ASSOC btamp_ASSOC; v_U32_t nConsumed = 0; /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ - /* Validate params */ + /* Validate params */ if ((pBapHCIReadLocalAMPAssoc == NULL) || (NULL == btampHandle)) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, @@ -555,7 +555,7 @@ WLAN_BAPReadLocalAMPAssoc return VOS_STATUS_E_FAULT; } hHal = VOS_GET_HAL_CB(btampContext->pvosGCtx); - if (NULL == hHal) + if (NULL == hHal) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "hHal is NULL in %s", __func__); @@ -564,9 +564,9 @@ WLAN_BAPReadLocalAMPAssoc VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "%s: btampHandle value: %p", __func__, btampHandle); - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, - "In %s, phy_link_handle = %d", __func__, - pBapHCIReadLocalAMPAssoc->phy_link_handle); + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, + "In %s, phy_link_handle = %d", __func__, + pBapHCIReadLocalAMPAssoc->phy_link_handle); /* Update the MAC address and SSID if in case the Read Local AMP Assoc * Request is made before Create Physical Link creation. @@ -574,44 +574,44 @@ WLAN_BAPReadLocalAMPAssoc WLANBAP_ReadMacConfig (btampContext); /* Fill in the contents of an AMP_Assoc structure in preparation - * for Packing it into the AMP_assoc_fragment field of the Read - * Local AMP Assoc Command Complete Event - */ - /* Return the local MAC address */ + * for Packing it into the AMP_assoc_fragment field of the Read + * Local AMP Assoc Command Complete Event + */ + /* Return the local MAC address */ btamp_ASSOC.AMP_Assoc_MAC_Addr.present = 1; - vos_mem_copy( - btamp_ASSOC.AMP_Assoc_MAC_Addr.mac_addr, - btampContext->self_mac_addr, - sizeof(btampContext->self_mac_addr)); + vos_mem_copy( + btamp_ASSOC.AMP_Assoc_MAC_Addr.mac_addr, + btampContext->self_mac_addr, + sizeof(btampContext->self_mac_addr)); /*Save the local AMP assoc info*/ vos_mem_copy(btampContext->btamp_AMP_Assoc.HC_mac_addr, - btampContext->self_mac_addr, - sizeof(btampContext->self_mac_addr)); + btampContext->self_mac_addr, + sizeof(btampContext->self_mac_addr)); - /* JEZ090303: This logic should return a single channel list with the */ + /* JEZ090303: This logic should return a single channel list with the */ /* selected channel, if we have one. */ - //if (btampContext->channel) - if (1) - { - /* Return the local Preferred Channel List */ - /* Return both the Regulatory Info and one channel list */ - btamp_ASSOC.AMP_Assoc_Preferred_Channel_List.present = 1; - memcpy (btamp_ASSOC.AMP_Assoc_Preferred_Channel_List.country, "XXX", 3); + //if (btampContext->channel) + if (1) + { + /* Return the local Preferred Channel List */ + /* Return both the Regulatory Info and one channel list */ + btamp_ASSOC.AMP_Assoc_Preferred_Channel_List.present = 1; + memcpy (btamp_ASSOC.AMP_Assoc_Preferred_Channel_List.country, "XXX", 3); /*Save the local AMP assoc info*/ vos_mem_copy(btampContext->btamp_AMP_Assoc.HC_pref_country, "XXX", 3); - btamp_ASSOC.AMP_Assoc_Preferred_Channel_List.num_triplets = 2; - btamp_ASSOC.AMP_Assoc_Preferred_Channel_List.triplets[0][0] = 201; - btamp_ASSOC.AMP_Assoc_Preferred_Channel_List.triplets[0][1] = 254; - btamp_ASSOC.AMP_Assoc_Preferred_Channel_List.triplets[0][2] = 0; + btamp_ASSOC.AMP_Assoc_Preferred_Channel_List.num_triplets = 2; + btamp_ASSOC.AMP_Assoc_Preferred_Channel_List.triplets[0][0] = 201; + btamp_ASSOC.AMP_Assoc_Preferred_Channel_List.triplets[0][1] = 254; + btamp_ASSOC.AMP_Assoc_Preferred_Channel_List.triplets[0][2] = 0; if (( BT_INITIATOR == btampContext->BAPDeviceRole ) && ( 0 != btampContext->channel )) { btamp_ASSOC.AMP_Assoc_Preferred_Channel_List.triplets[1][0] = btampContext->channel; - btamp_ASSOC.AMP_Assoc_Preferred_Channel_List.triplets[1][1] = 0x01; //we are AP - we start on their 1st preferred channel + btamp_ASSOC.AMP_Assoc_Preferred_Channel_List.triplets[1][1] = 0x01; //we are AP - we start on their 1st preferred channel btamp_ASSOC.AMP_Assoc_Preferred_Channel_List.triplets[1][2] = 0x11; } else @@ -619,56 +619,56 @@ WLAN_BAPReadLocalAMPAssoc if (btampContext->config.ucPreferredChannel) { btamp_ASSOC.AMP_Assoc_Preferred_Channel_List.triplets[1][0] = btampContext->config.ucPreferredChannel; - btamp_ASSOC.AMP_Assoc_Preferred_Channel_List.triplets[1][1] = - 0x0B - btampContext->config.ucPreferredChannel + 1; + btamp_ASSOC.AMP_Assoc_Preferred_Channel_List.triplets[1][1] = + 0x0B - btampContext->config.ucPreferredChannel + 1; } else { - btamp_ASSOC.AMP_Assoc_Preferred_Channel_List.triplets[1][0] = 0x01; - btamp_ASSOC.AMP_Assoc_Preferred_Channel_List.triplets[1][1] = 0x0B; //all channels for 1 to 11 + btamp_ASSOC.AMP_Assoc_Preferred_Channel_List.triplets[1][0] = 0x01; + btamp_ASSOC.AMP_Assoc_Preferred_Channel_List.triplets[1][1] = 0x0B; //all channels for 1 to 11 } btamp_ASSOC.AMP_Assoc_Preferred_Channel_List.triplets[1][2] = 0x11; } - } else - { - /* Return the local Preferred Channel List */ - /* Return only the Regulatory Info */ - btamp_ASSOC.AMP_Assoc_Preferred_Channel_List.present = 1; - memcpy (btamp_ASSOC.AMP_Assoc_Preferred_Channel_List.country, "XXX", 3); - btamp_ASSOC.AMP_Assoc_Preferred_Channel_List.num_triplets = 1; - btamp_ASSOC.AMP_Assoc_Preferred_Channel_List.triplets[0][0] = 201; - btamp_ASSOC.AMP_Assoc_Preferred_Channel_List.triplets[0][1] = 254; + } else + { + /* Return the local Preferred Channel List */ + /* Return only the Regulatory Info */ + btamp_ASSOC.AMP_Assoc_Preferred_Channel_List.present = 1; + memcpy (btamp_ASSOC.AMP_Assoc_Preferred_Channel_List.country, "XXX", 3); + btamp_ASSOC.AMP_Assoc_Preferred_Channel_List.num_triplets = 1; + btamp_ASSOC.AMP_Assoc_Preferred_Channel_List.triplets[0][0] = 201; + btamp_ASSOC.AMP_Assoc_Preferred_Channel_List.triplets[0][1] = 254; btamp_ASSOC.AMP_Assoc_Preferred_Channel_List.triplets[0][2] = 0; - } + } /*Save the local AMP assoc info*/ btampContext->btamp_AMP_Assoc.HC_pref_num_triplets = btamp_ASSOC.AMP_Assoc_Preferred_Channel_List.num_triplets; btampContext->btamp_AMP_Assoc.HC_pref_triplets[0][0] = btamp_ASSOC.AMP_Assoc_Preferred_Channel_List.triplets[0][0]; - btampContext->btamp_AMP_Assoc.HC_pref_triplets[0][1] = btamp_ASSOC.AMP_Assoc_Preferred_Channel_List.triplets[0][1]; + btampContext->btamp_AMP_Assoc.HC_pref_triplets[0][1] = btamp_ASSOC.AMP_Assoc_Preferred_Channel_List.triplets[0][1]; btampContext->btamp_AMP_Assoc.HC_pref_triplets[0][2] = btamp_ASSOC.AMP_Assoc_Preferred_Channel_List.triplets[0][2]; btampContext->btamp_AMP_Assoc.HC_pref_triplets[1][0] = btamp_ASSOC.AMP_Assoc_Preferred_Channel_List.triplets[1][0]; - btampContext->btamp_AMP_Assoc.HC_pref_triplets[1][1] = btamp_ASSOC.AMP_Assoc_Preferred_Channel_List.triplets[1][1]; + btampContext->btamp_AMP_Assoc.HC_pref_triplets[1][1] = btamp_ASSOC.AMP_Assoc_Preferred_Channel_List.triplets[1][1]; btampContext->btamp_AMP_Assoc.HC_pref_triplets[1][2] = btamp_ASSOC.AMP_Assoc_Preferred_Channel_List.triplets[1][2]; /* Also, at this point, lie and tell the other side we are connected on */ /* the one channel we support. I hope this convinces the peer as BT-AMP AP */ - /* We really want him to use our channel. Since we only support one.*/ - /* Return the local Connected Channel */ - btamp_ASSOC.AMP_Assoc_Connected_Channel.present = 1; - memcpy (btamp_ASSOC.AMP_Assoc_Connected_Channel.country, "XXX", 3); - btamp_ASSOC.AMP_Assoc_Connected_Channel.num_triplets = 2; - btamp_ASSOC.AMP_Assoc_Connected_Channel.triplets[0][0] = 201; - btamp_ASSOC.AMP_Assoc_Connected_Channel.triplets[0][1] = 254; - btamp_ASSOC.AMP_Assoc_Connected_Channel.triplets[0][2] = 0; - //btamp_ASSOC.AMP_Assoc_Connected_Channel.triplets[1][0] = 0x01; - btamp_ASSOC.AMP_Assoc_Connected_Channel.triplets[1][0] = (0 != btampContext->channel)?btampContext->channel:0x01; - btamp_ASSOC.AMP_Assoc_Connected_Channel.triplets[1][1] = 0x01; + /* We really want him to use our channel. Since we only support one.*/ + /* Return the local Connected Channel */ + btamp_ASSOC.AMP_Assoc_Connected_Channel.present = 1; + memcpy (btamp_ASSOC.AMP_Assoc_Connected_Channel.country, "XXX", 3); + btamp_ASSOC.AMP_Assoc_Connected_Channel.num_triplets = 2; + btamp_ASSOC.AMP_Assoc_Connected_Channel.triplets[0][0] = 201; + btamp_ASSOC.AMP_Assoc_Connected_Channel.triplets[0][1] = 254; + btamp_ASSOC.AMP_Assoc_Connected_Channel.triplets[0][2] = 0; + //btamp_ASSOC.AMP_Assoc_Connected_Channel.triplets[1][0] = 0x01; + btamp_ASSOC.AMP_Assoc_Connected_Channel.triplets[1][0] = (0 != btampContext->channel)?btampContext->channel:0x01; + btamp_ASSOC.AMP_Assoc_Connected_Channel.triplets[1][1] = 0x01; btamp_ASSOC.AMP_Assoc_Connected_Channel.triplets[1][2] = 0x11; - /* Return the local PAL Capabilities */ + /* Return the local PAL Capabilities */ btamp_ASSOC.AMP_Assoc_PAL_Capabilities.present = 1; #if 0 @@ -693,52 +693,52 @@ AMP ASSOC Pal Capabilities: Size: 4 Octets #endif //0 - btamp_ASSOC.AMP_Assoc_PAL_Capabilities.pal_capabilities -// = btampContext->btamp_Remote_AMP_Assoc.HC_pal_capabilities; + btamp_ASSOC.AMP_Assoc_PAL_Capabilities.pal_capabilities +// = btampContext->btamp_Remote_AMP_Assoc.HC_pal_capabilities; //= 0x03; = 0x00; - /* Return the local PAL Version */ + /* Return the local PAL Version */ btamp_ASSOC.AMP_Assoc_PAL_Version.present = 1; - /* Return the version and company ID data */ + /* Return the version and company ID data */ btamp_ASSOC.AMP_Assoc_PAL_Version.pal_version = WLANBAP_PAL_VERSION; btamp_ASSOC.AMP_Assoc_PAL_Version.pal_CompanyID = WLANBAP_QUALCOMM_COMPANY_ID; // Qualcomm Company ID btamp_ASSOC.AMP_Assoc_PAL_Version.pal_subversion = WLANBAP_PAL_SUBVERSION; //Pack the AMP Assoc structure vosStatus = btampPackAMP_ASSOC( - hHal, - &btamp_ASSOC, - pBapHCIEvent->u.btampCommandCompleteEvent.cc_event.Read_Read_Local_AMP_Assoc.AMP_assoc_fragment, - 248, + hHal, + &btamp_ASSOC, + pBapHCIEvent->u.btampCommandCompleteEvent.cc_event.Read_Read_Local_AMP_Assoc.AMP_assoc_fragment, + 248, &nConsumed); - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "%s: nConsumed value: %d", __func__, nConsumed); + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "%s: nConsumed value: %d", __func__, nConsumed); - /* Format the command complete event to return... */ + /* Format the command complete event to return... */ pBapHCIEvent->bapHCIEventCode = BTAMP_TLV_HCI_COMMAND_COMPLETE_EVENT; pBapHCIEvent->u.btampCommandCompleteEvent.present = 1; pBapHCIEvent->u.btampCommandCompleteEvent.num_hci_command_packets = 1; - pBapHCIEvent->u.btampCommandCompleteEvent.command_opcode + pBapHCIEvent->u.btampCommandCompleteEvent.command_opcode = BTAMP_TLV_HCI_READ_LOCAL_AMP_ASSOC_CMD; /*Validate the Physical handle*/ - if(pBapHCIReadLocalAMPAssoc->phy_link_handle != - btampContext->phy_link_handle) { - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, - "%s: Wrong Physical Link handle in Read Local AMP Assoc cmd: current: %x, new: %x", __func__, - btampContext->phy_link_handle, + if(pBapHCIReadLocalAMPAssoc->phy_link_handle != + btampContext->phy_link_handle) { + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, + "%s: Wrong Physical Link handle in Read Local AMP Assoc cmd: current: %x, new: %x", __func__, + btampContext->phy_link_handle, pBapHCIReadLocalAMPAssoc->phy_link_handle); pBapHCIEvent->u.btampCommandCompleteEvent.cc_event.Read_Read_Local_AMP_Assoc.status = WLANBAP_ERROR_NO_CNCT; } else - pBapHCIEvent->u.btampCommandCompleteEvent.cc_event.Read_Read_Local_AMP_Assoc.status + pBapHCIEvent->u.btampCommandCompleteEvent.cc_event.Read_Read_Local_AMP_Assoc.status = WLANBAP_STATUS_SUCCESS; - pBapHCIEvent->u.btampCommandCompleteEvent.cc_event.Read_Read_Local_AMP_Assoc.phy_link_handle + pBapHCIEvent->u.btampCommandCompleteEvent.cc_event.Read_Read_Local_AMP_Assoc.phy_link_handle = pBapHCIReadLocalAMPAssoc->phy_link_handle; - /* We will fit in one fragment, so remaining is exactly equal to encoded size*/ - pBapHCIEvent->u.btampCommandCompleteEvent.cc_event.Read_Read_Local_AMP_Assoc.remaining_length + /* We will fit in one fragment, so remaining is exactly equal to encoded size*/ + pBapHCIEvent->u.btampCommandCompleteEvent.cc_event.Read_Read_Local_AMP_Assoc.remaining_length = nConsumed; return VOS_STATUS_SUCCESS; @@ -748,37 +748,37 @@ AMP ASSOC Pal Capabilities: Size: 4 Octets FUNCTION WLAN_BAPWriteRemoteAMPAssoc() - DESCRIPTION - Implements the actual HCI Write Remote AMP Assoc command. There - is no need for a callback because when this call returns the action + DESCRIPTION + Implements the actual HCI Write Remote AMP Assoc command. There + is no need for a callback because when this call returns the action has been completed. - DEPENDENCIES - NA. + DEPENDENCIES + NA. - PARAMETERS + PARAMETERS IN btampHandle: pointer to the BAP handle. Returned from WLANBAP_GetNewHndl. pBapHCIWriteRemoteAMPAssoc: pointer to the "HCI Write Remote AMP Assoc" Structure. - + IN/OUT - pBapHCIEvent: Return event value for the command complete event. - (The caller of this routine is responsible for sending + pBapHCIEvent: Return event value for the command complete event. + (The caller of this routine is responsible for sending the Command Complete event up the HCI interface.) - + RETURN VALUE - The result code associated with performing the operation + The result code associated with performing the operation - VOS_STATUS_E_FAULT: pointer to pBapHCIWriteRemoteAMPAssoc is NULL + VOS_STATUS_E_FAULT: pointer to pBapHCIWriteRemoteAMPAssoc is NULL VOS_STATUS_SUCCESS: Success - - SIDE EFFECTS - + + SIDE EFFECTS + ----------------------------------------------------------------------------*/ -VOS_STATUS +VOS_STATUS WLAN_BAPWriteRemoteAMPAssoc -( +( ptBtampHandle btampHandle, tBtampTLVHCI_Write_Remote_AMP_ASSOC_Cmd *pBapHCIWriteRemoteAMPAssoc, tpBtampHCI_Event pBapHCIEvent /* This now encodes ALL event types */ @@ -789,64 +789,58 @@ WLAN_BAPWriteRemoteAMPAssoc VOS_STATUS vosStatus; tBtampHCI_Event bapHCIEvent; - /* I am using btampContext, instead of pBapPhysLinkMachine */ + /* I am using btampContext, instead of pBapPhysLinkMachine */ //tWLAN_BAPbapPhysLinkMachine *pBapPhysLinkMachine; - ptBtampContext btampContext = (ptBtampContext) btampHandle; /* btampContext value */ + ptBtampContext btampContext = (ptBtampContext) btampHandle; /* btampContext value */ v_U8_t status; /* return the BT-AMP status here */ - /* Validate params */ + /* Validate params */ if (pBapHCIWriteRemoteAMPAssoc == NULL) { return VOS_STATUS_E_FAULT; } VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "%s: btampHandle value: %p", __func__, btampHandle); - /* Fill in the event structure */ + /* Fill in the event structure */ bapEvent.event = eWLAN_BAP_HCI_WRITE_REMOTE_AMP_ASSOC; bapEvent.params = pBapHCIWriteRemoteAMPAssoc; VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "%s: btampContext value: %p", __func__, btampContext); - /* Handle event */ + /* Handle event */ vosStatus = btampFsm(btampContext, &bapEvent, &status); - - /* Format the command complete event to return... */ + + /* Format the command complete event to return... */ pBapHCIEvent->bapHCIEventCode = BTAMP_TLV_HCI_COMMAND_COMPLETE_EVENT; pBapHCIEvent->u.btampCommandCompleteEvent.present = 1; pBapHCIEvent->u.btampCommandCompleteEvent.num_hci_command_packets = 1; - pBapHCIEvent->u.btampCommandCompleteEvent.command_opcode + pBapHCIEvent->u.btampCommandCompleteEvent.command_opcode = BTAMP_TLV_HCI_WRITE_REMOTE_AMP_ASSOC_CMD; - pBapHCIEvent->u.btampCommandCompleteEvent.cc_event.Write_Remote_AMP_Assoc.status + pBapHCIEvent->u.btampCommandCompleteEvent.cc_event.Write_Remote_AMP_Assoc.status = status; - pBapHCIEvent->u.btampCommandCompleteEvent.cc_event.Write_Remote_AMP_Assoc.phy_link_handle + pBapHCIEvent->u.btampCommandCompleteEvent.cc_event.Write_Remote_AMP_Assoc.phy_link_handle = pBapHCIWriteRemoteAMPAssoc->phy_link_handle; if(WLANBAP_ERROR_NO_SUITABLE_CHANNEL == status) { - /* Format the Physical Link Complete event to return... */ + /* Format the Physical Link Complete event to return... */ bapHCIEvent.bapHCIEventCode = BTAMP_TLV_HCI_PHYSICAL_LINK_COMPLETE_EVENT; bapHCIEvent.u.btampPhysicalLinkCompleteEvent.present = 1; bapHCIEvent.u.btampPhysicalLinkCompleteEvent.status = status; - bapHCIEvent.u.btampPhysicalLinkCompleteEvent.phy_link_handle + bapHCIEvent.u.btampPhysicalLinkCompleteEvent.phy_link_handle = btampContext->phy_link_handle; - bapHCIEvent.u.btampPhysicalLinkCompleteEvent.ch_number + bapHCIEvent.u.btampPhysicalLinkCompleteEvent.ch_number = 0; - - vosStatus = (*btampContext->pBapHCIEventCB) - ( + + vosStatus = (*btampContext->pBapHCIEventCB) + ( btampContext->pHddHdl, /* this refers the BSL per application context */ &bapHCIEvent, /* This now encodes ALL event types */ - VOS_TRUE /* Flag to indicate assoc-specific event */ + VOS_TRUE /* Flag to indicate assoc-specific event */ ); } - /* ... */ + /* ... */ return VOS_STATUS_SUCCESS; } /* WLAN_BAPWriteRemoteAMPAssoc */ - - - - - - diff --git a/CORE/BAP/src/bapApiTimer.c b/CORE/BAP/src/bapApiTimer.c index 085ed16f4ca1..bc234b1dbfdf 100644 --- a/CORE/BAP/src/bapApiTimer.c +++ b/CORE/BAP/src/bapApiTimer.c @@ -28,16 +28,16 @@ /*=========================================================================== b a p A p i T i m e r . C - + OVERVIEW: - + This software unit holds the implementation of the timer routines - required by the WLAN BAP module. - - The functions provide by this module are called by the rest of + required by the WLAN BAP module. + + The functions provide by this module are called by the rest of the BT-AMP PAL module. - DEPENDENCIES: + DEPENDENCIES: Are listed for each API below. ===========================================================================*/ @@ -83,7 +83,7 @@ * -------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------- - * External declarations for global context + * External declarations for global context * -------------------------------------------------------------------------*/ #if 1 //*BT-AMP packet LLC OUI value*/ @@ -108,35 +108,35 @@ static const v_U8_t WLANBAP_BT_AMP_OUI[] = {0x00, 0x19, 0x58 }; * -------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------- - * Utility Function implementations + * Utility Function implementations * -------------------------------------------------------------------------*/ /*========================================================================== FUNCTION WLANBAP_InitConnectionAcceptTimer - DESCRIPTION + DESCRIPTION Initialize the Connection Accept Timer. - - DEPENDENCIES - - PARAMETERS + + DEPENDENCIES + + PARAMETERS IN pBtampCtx: pointer to the BAP control block - + RETURN VALUE - The result code associated with performing the operation + The result code associated with performing the operation - VOS_STATUS_E_FAULT: access would cause a page fault - VOS_STATUS_SUCCESS: Everything is good :) + VOS_STATUS_E_FAULT: access would cause a page fault + VOS_STATUS_SUCCESS: Everything is good :) + + SIDE EFFECTS - SIDE EFFECTS - ============================================================================*/ -VOS_STATUS +VOS_STATUS WLANBAP_InitConnectionAcceptTimer -( +( ptBtampContext pBtampCtx ) { @@ -146,10 +146,10 @@ WLANBAP_InitConnectionAcceptTimer /*------------------------------------------------------------------------ - Sanity check BAP control block + Sanity check BAP control block ------------------------------------------------------------------------*/ - if ( NULL == pBtampCtx ) + if ( NULL == pBtampCtx ) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "Invalid BAP pointer in %s", __func__); @@ -157,12 +157,12 @@ WLANBAP_InitConnectionAcceptTimer } /*Initialize the timer */ - vosStatus = vos_timer_init( + vosStatus = vos_timer_init( &pBtampCtx->bapConnectionAcceptTimer, VOS_TIMER_TYPE_SW, /* use this type */ WLANBAP_ConnectionAcceptTimerHandler, pBtampCtx); - + return VOS_STATUS_SUCCESS; }/* WLANBAP_InitConnectionAcceptTimer */ @@ -170,28 +170,28 @@ WLANBAP_InitConnectionAcceptTimer FUNCTION WLANBAP_DeinitConnectionAcceptTimer - DESCRIPTION + DESCRIPTION Destroy the Connection Accept Timer. - - DEPENDENCIES - - PARAMETERS + + DEPENDENCIES + + PARAMETERS IN pBtampCtx: pointer to the BAP control block - + RETURN VALUE - The result code associated with performing the operation + The result code associated with performing the operation - VOS_STATUS_E_FAULT: access would cause a page fault - VOS_STATUS_SUCCESS: Everything is good :) + VOS_STATUS_E_FAULT: access would cause a page fault + VOS_STATUS_SUCCESS: Everything is good :) + + SIDE EFFECTS - SIDE EFFECTS - ============================================================================*/ -VOS_STATUS +VOS_STATUS WLANBAP_DeinitConnectionAcceptTimer -( +( ptBtampContext pBtampCtx ) { @@ -201,10 +201,10 @@ WLANBAP_DeinitConnectionAcceptTimer /*------------------------------------------------------------------------ - Sanity check BAP control block + Sanity check BAP control block ------------------------------------------------------------------------*/ - if ( NULL == pBtampCtx ) + if ( NULL == pBtampCtx ) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "Invalid BAP pointer in %s", __func__); @@ -212,9 +212,9 @@ WLANBAP_DeinitConnectionAcceptTimer } /*Initialize and then Start the timer */ - vosStatus = vos_timer_destroy ( + vosStatus = vos_timer_destroy ( &pBtampCtx->bapConnectionAcceptTimer ); - + return VOS_STATUS_SUCCESS; }/* WLANBAP_DeinitConnectionAcceptTimer */ @@ -222,38 +222,38 @@ WLANBAP_DeinitConnectionAcceptTimer FUNCTION WLANBAP_StartConnectionAcceptTimer - DESCRIPTION + DESCRIPTION Start the Connection Accept Timer. - - DEPENDENCIES - - PARAMETERS + + DEPENDENCIES + + PARAMETERS IN pBtampCtx: pointer to the BAP control block interval: time interval. - + RETURN VALUE - The result code associated with performing the operation + The result code associated with performing the operation - VOS_STATUS_E_FAULT: access would cause a page fault - VOS_STATUS_SUCCESS: Everything is good :) + VOS_STATUS_E_FAULT: access would cause a page fault + VOS_STATUS_SUCCESS: Everything is good :) + + SIDE EFFECTS - SIDE EFFECTS - ============================================================================*/ -VOS_STATUS +VOS_STATUS WLANBAP_StartConnectionAcceptTimer -( +( ptBtampContext pBtampCtx, v_U32_t interval ) { /*------------------------------------------------------------------------ - Sanity check BAP control block + Sanity check BAP control block ------------------------------------------------------------------------*/ - if ( NULL == pBtampCtx ) + if ( NULL == pBtampCtx ) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "Invalid BAP pointer in %s", __func__); @@ -261,7 +261,7 @@ WLANBAP_StartConnectionAcceptTimer } /*Start the connection accept timer*/ - vos_timer_start( + vos_timer_start( &pBtampCtx->bapConnectionAcceptTimer, interval); @@ -271,30 +271,30 @@ WLANBAP_StartConnectionAcceptTimer /*========================================================================== - FUNCTION WLANBAP_StopConnectionAcceptTimer + FUNCTION WLANBAP_StopConnectionAcceptTimer - DESCRIPTION + DESCRIPTION Stop the Connection Accept Timer. - - DEPENDENCIES - - PARAMETERS + + DEPENDENCIES + + PARAMETERS IN pBtampCtx: pointer to the BAP control block - + RETURN VALUE - The result code associated with performing the operation + The result code associated with performing the operation + + VOS_STATUS_E_FAULT: access would cause a page fault + VOS_STATUS_SUCCESS: Everything is good :) - VOS_STATUS_E_FAULT: access would cause a page fault - VOS_STATUS_SUCCESS: Everything is good :) + SIDE EFFECTS - SIDE EFFECTS - ============================================================================*/ -VOS_STATUS -WLANBAP_StopConnectionAcceptTimer -( +VOS_STATUS +WLANBAP_StopConnectionAcceptTimer +( ptBtampContext pBtampCtx ) { @@ -303,10 +303,10 @@ WLANBAP_StopConnectionAcceptTimer /*------------------------------------------------------------------------ - Sanity check BAP control block + Sanity check BAP control block ------------------------------------------------------------------------*/ - if ( NULL == pBtampCtx ) + if ( NULL == pBtampCtx ) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "Invalid BAP pointer in %s", __func__); @@ -314,12 +314,12 @@ WLANBAP_StopConnectionAcceptTimer } /*Stop the timer */ - vosStatus = vos_timer_stop( + vosStatus = vos_timer_stop( &pBtampCtx->bapConnectionAcceptTimer); - - + + return VOS_STATUS_SUCCESS; -}/* WLANBAP_StopConnectionAcceptTimer */ +}/* WLANBAP_StopConnectionAcceptTimer */ @@ -327,27 +327,27 @@ WLANBAP_StopConnectionAcceptTimer FUNCTION WLANBAP_ConnectionAcceptTimerHandler - DESCRIPTION + DESCRIPTION Callback function registered with vos timer for the Connection - Accept timer - - DEPENDENCIES - - PARAMETERS + Accept timer + + DEPENDENCIES + + PARAMETERS IN - userData: pointer can be used to retrive the BT-AMP context - + userData: pointer can be used to retrive the BT-AMP context + RETURN VALUE None - - SIDE EFFECTS - + + SIDE EFFECTS + ============================================================================*/ -v_VOID_t +v_VOID_t WLANBAP_ConnectionAcceptTimerHandler -( - v_PVOID_t userData +( + v_PVOID_t userData ) { ptBtampContext pBtampCtx = (ptBtampContext)userData; @@ -357,31 +357,31 @@ WLANBAP_ConnectionAcceptTimerHandler /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ /*----------------------------------------------------------------------- - Sanity check + Sanity check -----------------------------------------------------------------------*/ if ( NULL == pBtampCtx ) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "WLAN BAP: Fatal error in %s", __func__ ); VOS_ASSERT(0); - return; + return; } /*--------------------------------------------------------------------- - Feed this timeout to the BTAMP FSM + Feed this timeout to the BTAMP FSM ---------------------------------------------------------------------*/ - /* Fill in the event structure */ + /* Fill in the event structure */ bapEvent.event = eWLAN_BAP_TIMER_CONNECT_ACCEPT_TIMEOUT; bapEvent.params = NULL; - /* Handle event */ + /* Handle event */ vosStatus = btampFsm(pBtampCtx, &bapEvent, &status); - /* Now transition to fully disconnected and notify phy link disconnect*/ + /* Now transition to fully disconnected and notify phy link disconnect*/ bapEvent.event = eWLAN_BAP_MAC_READY_FOR_CONNECTIONS; bapEvent.params = NULL; - /* Handle event */ + /* Handle event */ vosStatus = btampFsm(pBtampCtx, &bapEvent, &status); @@ -391,28 +391,28 @@ WLANBAP_ConnectionAcceptTimerHandler FUNCTION WLANBAP_InitLinkSupervisionTimer - DESCRIPTION + DESCRIPTION Initialize the Link Supervision Timer. - - DEPENDENCIES - - PARAMETERS + + DEPENDENCIES + + PARAMETERS IN pBtampCtx: pointer to the BAP control block - + RETURN VALUE - The result code associated with performing the operation + The result code associated with performing the operation + + VOS_STATUS_E_FAULT: access would cause a page fault + VOS_STATUS_SUCCESS: Everything is good :) - VOS_STATUS_E_FAULT: access would cause a page fault - VOS_STATUS_SUCCESS: Everything is good :) + SIDE EFFECTS - SIDE EFFECTS - ============================================================================*/ -VOS_STATUS +VOS_STATUS WLANBAP_InitLinkSupervisionTimer -( +( ptBtampContext pBtampCtx ) { @@ -422,10 +422,10 @@ WLANBAP_InitLinkSupervisionTimer /*------------------------------------------------------------------------ - Sanity check BAP control block + Sanity check BAP control block ------------------------------------------------------------------------*/ - if ( NULL == pBtampCtx ) + if ( NULL == pBtampCtx ) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "Invalid BAP pointer in %s", __func__); @@ -433,12 +433,12 @@ WLANBAP_InitLinkSupervisionTimer } /*Initialize the timer */ - vosStatus = vos_timer_init( + vosStatus = vos_timer_init( &pBtampCtx->bapLinkSupervisionTimer, VOS_TIMER_TYPE_SW, /* use this type */ WLANBAP_LinkSupervisionTimerHandler, pBtampCtx); - + return VOS_STATUS_SUCCESS; }/* WLANBAP_InitLinkSupervisionTimer */ @@ -446,28 +446,28 @@ WLANBAP_InitLinkSupervisionTimer FUNCTION WLANBAP_DeinitLinkSupervisionTimer - DESCRIPTION + DESCRIPTION Destroy the Link Supervision Timer. - - DEPENDENCIES - - PARAMETERS + + DEPENDENCIES + + PARAMETERS IN pBtampCtx: pointer to the BAP control block - + RETURN VALUE - The result code associated with performing the operation + The result code associated with performing the operation + + VOS_STATUS_E_FAULT: access would cause a page fault + VOS_STATUS_SUCCESS: Everything is good :) - VOS_STATUS_E_FAULT: access would cause a page fault - VOS_STATUS_SUCCESS: Everything is good :) + SIDE EFFECTS - SIDE EFFECTS - ============================================================================*/ -VOS_STATUS +VOS_STATUS WLANBAP_DeinitLinkSupervisionTimer -( +( ptBtampContext pBtampCtx ) { @@ -477,10 +477,10 @@ WLANBAP_DeinitLinkSupervisionTimer /*------------------------------------------------------------------------ - Sanity check BAP control block + Sanity check BAP control block ------------------------------------------------------------------------*/ - if ( NULL == pBtampCtx ) + if ( NULL == pBtampCtx ) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "Invalid BAP pointer in %s", __func__); @@ -488,9 +488,9 @@ WLANBAP_DeinitLinkSupervisionTimer } /*Initialize and then Start the timer */ - vosStatus = vos_timer_destroy ( + vosStatus = vos_timer_destroy ( &pBtampCtx->bapLinkSupervisionTimer ); - + return VOS_STATUS_SUCCESS; }/* WLANBAP_DeinitLinkSupervisionTimer */ @@ -498,45 +498,45 @@ WLANBAP_DeinitLinkSupervisionTimer FUNCTION WLANBAP_StartLinkSupervisionTimer - DESCRIPTION + DESCRIPTION Start the LinkSupervisionTimer Timer. - - DEPENDENCIES - - PARAMETERS + + DEPENDENCIES + + PARAMETERS IN pBtampCtx: pointer to the BAP control block interval: time interval. - + RETURN VALUE - The result code associated with performing the operation + The result code associated with performing the operation - VOS_STATUS_E_FAULT: access would cause a page fault - VOS_STATUS_SUCCESS: Everything is good :) + VOS_STATUS_E_FAULT: access would cause a page fault + VOS_STATUS_SUCCESS: Everything is good :) + + SIDE EFFECTS - SIDE EFFECTS - ============================================================================*/ -VOS_STATUS +VOS_STATUS WLANBAP_StartLinkSupervisionTimer -( +( ptBtampContext pBtampCtx, v_U32_t interval ) { /*------------------------------------------------------------------------ - Sanity check BAP control block + Sanity check BAP control block ------------------------------------------------------------------------*/ - if ( NULL == pBtampCtx ) + if ( NULL == pBtampCtx ) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "Invalid BAP pointer in %s", __func__); return VOS_STATUS_E_FAULT; } - vos_timer_start( + vos_timer_start( &pBtampCtx->bapLinkSupervisionTimer, interval); @@ -545,30 +545,30 @@ WLANBAP_StartLinkSupervisionTimer /*========================================================================== - FUNCTION WLANBAP_StopLinkSupervisionTimer + FUNCTION WLANBAP_StopLinkSupervisionTimer - DESCRIPTION + DESCRIPTION Stop the LinkSupervision Timer. - - DEPENDENCIES - - PARAMETERS + + DEPENDENCIES + + PARAMETERS IN pBtampCtx: pointer to the BAP control block - + RETURN VALUE - The result code associated with performing the operation + The result code associated with performing the operation + + VOS_STATUS_E_FAULT: access would cause a page fault + VOS_STATUS_SUCCESS: Everything is good :) - VOS_STATUS_E_FAULT: access would cause a page fault - VOS_STATUS_SUCCESS: Everything is good :) + SIDE EFFECTS - SIDE EFFECTS - ============================================================================*/ -VOS_STATUS -WLANBAP_StopLinkSupervisionTimer -( +VOS_STATUS +WLANBAP_StopLinkSupervisionTimer +( ptBtampContext pBtampCtx ) { @@ -577,10 +577,10 @@ WLANBAP_StopLinkSupervisionTimer /*------------------------------------------------------------------------ - Sanity check BAP control block + Sanity check BAP control block ------------------------------------------------------------------------*/ - if ( NULL == pBtampCtx ) + if ( NULL == pBtampCtx ) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "Invalid BAP pointer in %s", __func__); @@ -588,38 +588,38 @@ WLANBAP_StopLinkSupervisionTimer } /*Stop the timer */ - vosStatus = vos_timer_stop( + vosStatus = vos_timer_stop( &pBtampCtx->bapLinkSupervisionTimer); - - + + return VOS_STATUS_SUCCESS; -}/* WLANBAP_StopLinkSupervisionTimer */ +}/* WLANBAP_StopLinkSupervisionTimer */ /*========================================================================== FUNCTION WLANBAP_LinkSupervisionTimerHandler - DESCRIPTION - Callback function registered with vos timer for the LinkSupervision timer - - DEPENDENCIES - - PARAMETERS + DESCRIPTION + Callback function registered with vos timer for the LinkSupervision timer + + DEPENDENCIES + + PARAMETERS IN - userData: pointer can be used to retrive the BT-AMP context - + userData: pointer can be used to retrive the BT-AMP context + RETURN VALUE None - - SIDE EFFECTS - + + SIDE EFFECTS + ============================================================================*/ -v_VOID_t +v_VOID_t WLANBAP_LinkSupervisionTimerHandler -( - v_PVOID_t userData +( + v_PVOID_t userData ) { ptBtampContext pBtampCtx = (ptBtampContext)userData; @@ -631,14 +631,14 @@ WLANBAP_LinkSupervisionTimerHandler /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ /*----------------------------------------------------------------------- - Sanity check + Sanity check -----------------------------------------------------------------------*/ if ( NULL == pBtampCtx ) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "WLAN BAP: Fatal error in %s", __func__ ); VOS_ASSERT(0); - return; + return; } phy_link_handle = pBtampCtx->phy_link_handle; @@ -660,79 +660,79 @@ WLANBAP_LinkSupervisionTimerHandler //Data is seen. or our previous packet is not yet fetched by TL.Don't do any thing.Just return; return; } - else if((pBtampCtx->lsReqPktPending == VOS_TRUE ) + else if((pBtampCtx->lsReqPktPending == VOS_TRUE ) && (pBtampCtx->retries == WLANBAP_LINK_SUPERVISION_RETRIES)) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "#########WLAN BAP: LinkSupervision Timed OUT######## %s", __func__ ); /*--------------------------------------------------------------------- - Feed this timeout to the BTAMP FSM + Feed this timeout to the BTAMP FSM ---------------------------------------------------------------------*/ - /* Fill in the event structure */ - /* JEZ110307: Which should this be? */ + /* Fill in the event structure */ + /* JEZ110307: Which should this be? */ //bapEvent.event =eWLAN_BAP_HCI_PHYSICAL_LINK_DISCONNECT; bapEvent.event =eWLAN_BAP_MAC_INDICATES_MEDIA_DISCONNECTION; bapEvent.params = NULL; - /* Handle event */ + /* Handle event */ vosStatus = btampFsm(pBtampCtx, &bapEvent, (v_U8_t *)&vosStatus); } else - { + { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "%s: Resend the LS packet", __func__ ); /* If we have transmit pkt pending and the time out occurred,resend the ls packet */ WLANBAP_StopLinkSupervisionTimer(pBtampCtx); pBtampCtx->pPacket = pBtampCtx->lsReqPacket; - vosStatus = WLANBAP_TxLinkSupervision( btampHandle, - phy_link_handle, + vosStatus = WLANBAP_TxLinkSupervision( btampHandle, + phy_link_handle, pBtampCtx->pPacket , WLANTL_BT_AMP_TYPE_LS_REQ); } - + }/*WLANBAP_LinkSupervisionTimerHandler*/ /*========================================================================== FUNCTION WLANBAP_StartTxPacketMonitorTimer - DESCRIPTION + DESCRIPTION Start the Tx Packet Monitor Timer. - - DEPENDENCIES - - PARAMETERS + + DEPENDENCIES + + PARAMETERS IN pBtampCtx: pointer to the BAP control block interval: time interval. - + RETURN VALUE - The result code associated with performing the operation + The result code associated with performing the operation + + VOS_STATUS_E_FAULT: access would cause a page fault + VOS_STATUS_SUCCESS: Everything is good :) - VOS_STATUS_E_FAULT: access would cause a page fault - VOS_STATUS_SUCCESS: Everything is good :) + SIDE EFFECTS - SIDE EFFECTS - ============================================================================*/ -VOS_STATUS +VOS_STATUS WLANBAP_StartTxPacketMonitorTimer -( +( ptBtampContext pBtampCtx ) { VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; - v_U32_t uInterval = WLAN_BAP_TX_PKT_MONITOR_TIME; + v_U32_t uInterval = WLAN_BAP_TX_PKT_MONITOR_TIME; /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ /*------------------------------------------------------------------------ - Sanity check BAP control block + Sanity check BAP control block ------------------------------------------------------------------------*/ - if ( NULL == pBtampCtx ) + if ( NULL == pBtampCtx ) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "Invalid BAP pointer in %s", __func__); @@ -749,30 +749,30 @@ WLANBAP_StartTxPacketMonitorTimer /*========================================================================== - FUNCTION WLANBAP_StopTxPacketMonitorTimer + FUNCTION WLANBAP_StopTxPacketMonitorTimer - DESCRIPTION + DESCRIPTION Stop the Tx Packet Monitor Timer. - - DEPENDENCIES - - PARAMETERS + + DEPENDENCIES + + PARAMETERS IN pBtampCtx: pointer to the BAP control block - + RETURN VALUE - The result code associated with performing the operation + The result code associated with performing the operation + + VOS_STATUS_E_FAULT: access would cause a page fault + VOS_STATUS_SUCCESS: Everything is good :) - VOS_STATUS_E_FAULT: access would cause a page fault - VOS_STATUS_SUCCESS: Everything is good :) + SIDE EFFECTS - SIDE EFFECTS - ============================================================================*/ -VOS_STATUS -WLANBAP_StopTxPacketMonitorTimer -( +VOS_STATUS +WLANBAP_StopTxPacketMonitorTimer +( ptBtampContext pBtampCtx ) { @@ -781,9 +781,9 @@ WLANBAP_StopTxPacketMonitorTimer /*------------------------------------------------------------------------ - Sanity check BAP control block + Sanity check BAP control block ------------------------------------------------------------------------*/ - if ( NULL == pBtampCtx ) + if ( NULL == pBtampCtx ) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "Invalid BAP pointer in %s", __func__); @@ -792,55 +792,55 @@ WLANBAP_StopTxPacketMonitorTimer /*Stop the timer */ vosStatus = vos_timer_stop( &pBtampCtx->bapTxPktMonitorTimer); - - + + return vosStatus; -}/* WLANBAP_StopTxPacketMonitorTimer */ +}/* WLANBAP_StopTxPacketMonitorTimer */ /*========================================================================== FUNCTION WLANBAP_SendCompletedPktsEvent - DESCRIPTION - Utility function for sending the NUM_OF_COMPLETED_PKTS_EVENT to HCI - - DEPENDENCIES - - PARAMETERS + DESCRIPTION + Utility function for sending the NUM_OF_COMPLETED_PKTS_EVENT to HCI + + DEPENDENCIES + + PARAMETERS IN - pBtampCtx: pointer to the BAP control block - + pBtampCtx: pointer to the BAP control block + RETURN VALUE None - - SIDE EFFECTS - + + SIDE EFFECTS + ============================================================================*/ -v_VOID_t +v_VOID_t WLANBAP_SendCompletedPktsEvent -( - ptBtampContext pBtampCtx +( + ptBtampContext pBtampCtx ) { v_U8_t i, j; tBtampHCI_Event bapHCIEvent; /* This now encodes ALL event types */ - v_U32_t uTxCompleted = 0; + v_U32_t uTxCompleted = 0; tpBtampLogLinkCtx pLogLinkContext = NULL; /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ - /* Format the Number of completed packets event */ + /* Format the Number of completed packets event */ bapHCIEvent.bapHCIEventCode = BTAMP_TLV_HCI_NUM_OF_COMPLETED_PKTS_EVENT; bapHCIEvent.u.btampNumOfCompletedPktsEvent.num_handles = 0; /*--------------------------------------------------------------------- Check if LL still exists, if TRUE generate num_pkt_event and - restart the timer + restart the timer ---------------------------------------------------------------------*/ - for (i = 0, j = 0; i < WLANBAP_MAX_LOG_LINKS ; i++) + for (i = 0, j = 0; i < WLANBAP_MAX_LOG_LINKS ; i++) { pLogLinkContext = &pBtampCtx->btampLogLinkCtx[i]; - if ( pLogLinkContext->present ) + if ( pLogLinkContext->present ) { uTxCompleted = pLogLinkContext->uTxPktCompleted; bapHCIEvent.u.btampNumOfCompletedPktsEvent.conn_handles[j] = @@ -853,10 +853,10 @@ WLANBAP_SendCompletedPktsEvent vos_atomic_decrement_U32_by_value((v_U32_t *) &pLogLinkContext->uTxPktCompleted, (v_U32_t) uTxCompleted); - if (uTxCompleted) { - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, - "wlan bap: %s Log Link handle - %d No Of Pkts - %d", __func__, - pLogLinkContext->log_link_handle, uTxCompleted); + if (uTxCompleted) { + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, + "wlan bap: %s Log Link handle - %d No Of Pkts - %d", __func__, + pLogLinkContext->log_link_handle, uTxCompleted); } } } @@ -874,7 +874,7 @@ WLANBAP_SendCompletedPktsEvent ( pBtampCtx->pHddHdl, /* this refers the BSL per application context */ &bapHCIEvent, /* This now encodes ALL event types */ - VOS_TRUE /* Flag to indicate assoc-specific event */ + VOS_TRUE /* Flag to indicate assoc-specific event */ ); } @@ -884,45 +884,45 @@ WLANBAP_SendCompletedPktsEvent FUNCTION WLANBAP_SendCompletedDataBlksEvent - DESCRIPTION - Utility function for sending the NUM_OF_COMPLETED_DATA_BLOCKS_EVENT to HCI - - DEPENDENCIES - - PARAMETERS + DESCRIPTION + Utility function for sending the NUM_OF_COMPLETED_DATA_BLOCKS_EVENT to HCI + + DEPENDENCIES + + PARAMETERS IN - pBtampCtx: pointer to the BAP control block - + pBtampCtx: pointer to the BAP control block + RETURN VALUE None - - SIDE EFFECTS - + + SIDE EFFECTS + ============================================================================*/ -v_VOID_t +v_VOID_t WLANBAP_SendCompletedDataBlksEvent -( - ptBtampContext pBtampCtx +( + ptBtampContext pBtampCtx ) { v_U8_t i, j; tBtampHCI_Event bapHCIEvent; /* This now encodes ALL event types */ - v_U32_t uTxCompleted = 0; + v_U32_t uTxCompleted = 0; tpBtampLogLinkCtx pLogLinkContext = NULL; /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ - /* Format the Number of completed data blocks event */ + /* Format the Number of completed data blocks event */ bapHCIEvent.bapHCIEventCode = BTAMP_TLV_HCI_NUM_OF_COMPLETED_DATA_BLOCKS_EVENT; bapHCIEvent.u.btampNumOfCompletedDataBlocksEvent.num_handles = 0; /*--------------------------------------------------------------------- Check if LL still exists, if TRUE generate num_data_blocks_event and - restart the timer + restart the timer ---------------------------------------------------------------------*/ - for (i = 0, j = 0; i < WLANBAP_MAX_LOG_LINKS ; i++) + for (i = 0, j = 0; i < WLANBAP_MAX_LOG_LINKS ; i++) { pLogLinkContext = &pBtampCtx->btampLogLinkCtx[i]; - if ( pLogLinkContext->present ) + if ( pLogLinkContext->present ) { uTxCompleted = pLogLinkContext->uTxPktCompleted; bapHCIEvent.u.btampNumOfCompletedDataBlocksEvent.conn_handles[j] = @@ -938,10 +938,10 @@ WLANBAP_SendCompletedDataBlksEvent vos_atomic_decrement_U32_by_value((v_U32_t *) &pLogLinkContext->uTxPktCompleted, (v_U32_t) uTxCompleted); - if (uTxCompleted) { - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, - "wlan bap: %s Log Link handle - %d No Of Pkts - %d", __func__, - pLogLinkContext->log_link_handle, uTxCompleted); + if (uTxCompleted) { + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, + "wlan bap: %s Log Link handle - %d No Of Pkts - %d", __func__, + pLogLinkContext->log_link_handle, uTxCompleted); } } } @@ -959,7 +959,7 @@ WLANBAP_SendCompletedDataBlksEvent ( pBtampCtx->pHddHdl, /* this refers the BSL per application context */ &bapHCIEvent, /* This now encodes ALL event types */ - VOS_TRUE /* Flag to indicate assoc-specific event */ + VOS_TRUE /* Flag to indicate assoc-specific event */ ); } @@ -969,27 +969,27 @@ WLANBAP_SendCompletedDataBlksEvent FUNCTION WLANBAP_TxPacketMonitorHandler - DESCRIPTION - Callback function registered with vos timer for the Tx Packet Monitor + DESCRIPTION + Callback function registered with vos timer for the Tx Packet Monitor Timer. - - DEPENDENCIES - - PARAMETERS + + DEPENDENCIES + + PARAMETERS IN - userData: pointer can be used to retrive the BT-AMP context - + userData: pointer can be used to retrive the BT-AMP context + RETURN VALUE None - - SIDE EFFECTS - + + SIDE EFFECTS + ============================================================================*/ -v_VOID_t +v_VOID_t WLANBAP_TxPacketMonitorHandler -( - v_PVOID_t userData +( + v_PVOID_t userData ) { ptBtampContext pBtampCtx = (ptBtampContext)userData; @@ -997,14 +997,14 @@ WLANBAP_TxPacketMonitorHandler /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ /*----------------------------------------------------------------------- - Sanity check + Sanity check -----------------------------------------------------------------------*/ if ( NULL == pBtampCtx ) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "WLAN BAP: Fatal error in %s", __func__ ); VOS_ASSERT(0); - return; + return; } #if 0 //BAP_DEBUG @@ -1023,13 +1023,12 @@ WLANBAP_TxPacketMonitorHandler } /* Restart the Packet monitoring timer if still Physical link - * is present. - * It is possible that when the physical link is tear down, - * timer start request is in Q and could start again. + * is present. + * It is possible that when the physical link is tear down, + * timer start request is in Q and could start again. */ if (CONNECTED == instanceVar->stateVar) { WLANBAP_StartTxPacketMonitorTimer(pBtampCtx); } }/*WLANBAP_TxPacketMonitorHandler*/ - diff --git a/CORE/BAP/src/bapApiTimer.h b/CORE/BAP/src/bapApiTimer.h index 1f8a657ea6ae..5c4a3662a368 100644 --- a/CORE/BAP/src/bapApiTimer.h +++ b/CORE/BAP/src/bapApiTimer.h @@ -30,12 +30,12 @@ /*=========================================================================== - W L A N B T - A M P P A L L A Y E R + W L A N B T - A M P P A L L A Y E R T I M E R S E R V I C E S A P I - - + + DESCRIPTION - This file contains the timer APIs used by the wlan BT-AMP PAL layer + This file contains the timer APIs used by the wlan BT-AMP PAL layer module. ===========================================================================*/ @@ -69,16 +69,16 @@ when who what, where, why /*---------------------------------------------------------------------------- * Include Files * -------------------------------------------------------------------------*/ -// Pick up all the BT-AMP internal definitions +// Pick up all the BT-AMP internal definitions // And underlying supporting types. (Including VOSS, CSR, and...) -#include "bapInternal.h" +#include "bapInternal.h" -/* Pick up the SIRIUS and HAL types */ -// Already taken care of, above +/* Pick up the SIRIUS and HAL types */ +// Already taken care of, above //#include "sirApi.h" //#include "halTypes.h" -/* Pick up the CCM API def'n */ +/* Pick up the CCM API def'n */ #include "ccmApi.h" /*---------------------------------------------------------------------------- @@ -86,13 +86,13 @@ when who what, where, why * -------------------------------------------------------------------------*/ #ifdef __cplusplus extern "C" { - #endif - + #endif + /*---------------------------------------------------------------------------- * Defines * -------------------------------------------------------------------------*/ -// Temporary +// Temporary //#define BAP_DEBUG @@ -102,16 +102,16 @@ when who what, where, why /*---------------------------------------------------------------------------- - * External declarations for global context + * External declarations for global context * -------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------- - * Function prototypes + * Function prototypes * -------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------- - * Utility Function prototypes + * Utility Function prototypes * -------------------------------------------------------------------------*/ #if 0 @@ -119,123 +119,122 @@ when who what, where, why FUNCTION WLANBAP_StartConnectionAcceptTimer - DESCRIPTION + DESCRIPTION Clear out all fields in the BAP context. - - DEPENDENCIES - - PARAMETERS + + DEPENDENCIES + + PARAMETERS IN pBtampCtx: pointer to the BAP control block interval: time interval. - + RETURN VALUE - The result code associated with performing the operation + The result code associated with performing the operation - VOS_STATUS_E_FAULT: access would cause a page fault - VOS_STATUS_SUCCESS: Everything is good :) + VOS_STATUS_E_FAULT: access would cause a page fault + VOS_STATUS_SUCCESS: Everything is good :) + + SIDE EFFECTS - SIDE EFFECTS - ============================================================================*/ -VOS_STATUS +VOS_STATUS WLANBAP_StartConnectionAcceptTimer -( +( ptBtampContext pBtampCtx, v_U32_t interval ); #endif // 0 /* Connection Accept timer*/ -VOS_STATUS WLANBAP_InitConnectionAcceptTimer +VOS_STATUS WLANBAP_InitConnectionAcceptTimer ( ptBtampContext pBtampCtx); VOS_STATUS WLANBAP_DeinitConnectionAcceptTimer ( ptBtampContext pBtampCtx); -VOS_STATUS WLANBAP_StartConnectionAcceptTimer +VOS_STATUS WLANBAP_StartConnectionAcceptTimer (ptBtampContext pBtampCtx, v_U32_t interval); -VOS_STATUS WLANBAP_StopConnectionAcceptTimer +VOS_STATUS WLANBAP_StopConnectionAcceptTimer ( ptBtampContext pBtampCtx); -v_VOID_t WLANBAP_ConnectionAcceptTimerHandler +v_VOID_t WLANBAP_ConnectionAcceptTimerHandler ( v_PVOID_t userData ); /* Link Supervision timer*/ -VOS_STATUS WLANBAP_InitLinkSupervisionTimer +VOS_STATUS WLANBAP_InitLinkSupervisionTimer ( ptBtampContext pBtampCtx); -VOS_STATUS WLANBAP_DeinitLinkSupervisionTimer +VOS_STATUS WLANBAP_DeinitLinkSupervisionTimer ( ptBtampContext pBtampCtx); -VOS_STATUS WLANBAP_StartLinkSupervisionTimer +VOS_STATUS WLANBAP_StartLinkSupervisionTimer (ptBtampContext pBtampCtx, v_U32_t interval); -VOS_STATUS WLANBAP_StopLinkSupervisionTimer +VOS_STATUS WLANBAP_StopLinkSupervisionTimer ( ptBtampContext pBtampCtx); -v_VOID_t WLANBAP_LinkSupervisionTimerHandler +v_VOID_t WLANBAP_LinkSupervisionTimerHandler ( v_PVOID_t userData ); /* Logical Link Accept timer*/ -VOS_STATUS WLANBAP_InitLogicalLinkAcceptTimer +VOS_STATUS WLANBAP_InitLogicalLinkAcceptTimer ( ptBtampContext pBtampCtx); -VOS_STATUS WLANBAP_DeinitLogicalLinkAcceptTimer +VOS_STATUS WLANBAP_DeinitLogicalLinkAcceptTimer ( ptBtampContext pBtampCtx); -VOS_STATUS WLANBAP_StartLogicalLinkAcceptTimer +VOS_STATUS WLANBAP_StartLogicalLinkAcceptTimer (ptBtampContext pBtampCtx, v_U32_t interval); -VOS_STATUS WLANBAP_StopLogicalLinkAcceptTimer +VOS_STATUS WLANBAP_StopLogicalLinkAcceptTimer ( ptBtampContext pBtampCtx); -v_VOID_t WLANBAP_LogicalLinkAcceptTimerHandler +v_VOID_t WLANBAP_LogicalLinkAcceptTimerHandler ( v_PVOID_t userData ); /* Best Effort Flush timer*/ -VOS_STATUS WLANBAP_InitBEFlushTimer +VOS_STATUS WLANBAP_InitBEFlushTimer ( ptBtampContext pBtampCtx); -VOS_STATUS WLANBAP_DeinitBEFlushTimer +VOS_STATUS WLANBAP_DeinitBEFlushTimer ( ptBtampContext pBtampCtx); -VOS_STATUS WLANBAP_StartBEFlushTimer +VOS_STATUS WLANBAP_StartBEFlushTimer (ptBtampContext pBtampCtx, v_U32_t interval); -VOS_STATUS WLANBAP_StopBEFlushTimer +VOS_STATUS WLANBAP_StopBEFlushTimer ( ptBtampContext pBtampCtx); -v_VOID_t WLANBAP_BEFlushTimerHandler +v_VOID_t WLANBAP_BEFlushTimerHandler ( v_PVOID_t userData ); /* Tx Packet monitor timer handler */ -v_VOID_t +v_VOID_t WLANBAP_TxPacketMonitorHandler -( - v_PVOID_t userData +( + v_PVOID_t userData ); /* Tx Packet monitor start timer */ -VOS_STATUS +VOS_STATUS WLANBAP_StartTxPacketMonitorTimer -( +( ptBtampContext pBtampCtx ); /* Tx Packet monitor stop timer */ -VOS_STATUS -WLANBAP_StopTxPacketMonitorTimer -( +VOS_STATUS +WLANBAP_StopTxPacketMonitorTimer +( ptBtampContext pBtampCtx ); #ifdef __cplusplus } -#endif +#endif #endif /* #ifndef WLAN_QCT_WLANBAP_API_TIMER_H */ - diff --git a/CORE/BAP/src/bapInternal.h b/CORE/BAP/src/bapInternal.h index f2dfadf7b13c..4bb17d9e4bbe 100644 --- a/CORE/BAP/src/bapInternal.h +++ b/CORE/BAP/src/bapInternal.h @@ -30,12 +30,12 @@ /*=========================================================================== - W L A N B T - A M P P A L L A Y E R + W L A N B T - A M P P A L L A Y E R I N T E R N A L A P I - - + + DESCRIPTION - This file contains the internal API exposed by the wlan BT-AMP PAL layer + This file contains the internal API exposed by the wlan BT-AMP PAL layer module. ===========================================================================*/ @@ -69,15 +69,15 @@ when who what, where, why /*---------------------------------------------------------------------------- * Include Files * -------------------------------------------------------------------------*/ -#include "vos_api.h" -#include "vos_packet.h" +#include "vos_api.h" +#include "vos_packet.h" // Pick up the CSR API definitions #include "csrApi.h" -/* BT-AMP PAL API structure types - FramesC generated */ -#include "btampHCI.h" -#include "bapApi.h" +/* BT-AMP PAL API structure types - FramesC generated */ +#include "btampHCI.h" +#include "bapApi.h" // Pick up the BTAMP FSM definitions #include "fsmDefs.h" @@ -95,24 +95,24 @@ when who what, where, why * -------------------------------------------------------------------------*/ #ifdef __cplusplus extern "C" { - #endif - + #endif + /*---------------------------------------------------------------------------- * Defines * -------------------------------------------------------------------------*/ // Temporary so that I can compile //#define VOS_MODULE_ID_BAP 9 -// Temporary +// Temporary //#define BAP_DEBUG -// Used to enable or disable security on the BT-AMP link +// Used to enable or disable security on the BT-AMP link #define WLANBAP_SECURITY_ENABLED_STATE VOS_TRUE -// How do I get BAP context from voss context? -#define VOS_GET_BAP_CB(ctx) vos_get_context( VOS_MODULE_ID_BAP, ctx) -// How do I get halHandle from voss context? -#define VOS_GET_HAL_CB(ctx) vos_get_context( VOS_MODULE_ID_SME, ctx) +// How do I get BAP context from voss context? +#define VOS_GET_BAP_CB(ctx) vos_get_context( VOS_MODULE_ID_BAP, ctx) +// How do I get halHandle from voss context? +#define VOS_GET_HAL_CB(ctx) vos_get_context( VOS_MODULE_ID_SME, ctx) // Default timeout values (in BR/EDR baseband slots) // Physical Link Connection Accept Timer interval (0x1FA0 * 0.625 = 5.06 sec) @@ -145,7 +145,7 @@ when who what, where, why #define WLANBAP_BE_FLUSH_TIMEOUT 10 /* Length of the LLC header*/ -#define WLANBAP_LLC_HEADER_LEN 8 +#define WLANBAP_LLC_HEADER_LEN 8 /*Size of the protocol type field inside the LLC/SNAP header*/ #define WLANBAP_LLC_PROTO_TYPE_SIZE 2 @@ -171,7 +171,7 @@ when who what, where, why typedef struct sBtampHCI_Buffer_Size { // v_U8_t present; /* D9r14 says Max80211PALPDUSize 1492 */ - v_U16_t HC_ACL_Data_Packet_Length; + v_U16_t HC_ACL_Data_Packet_Length; v_U8_t HC_SCO_Packet_Length; v_U16_t HC_Total_Num_ACL_Packets; v_U16_t HC_Total_Num_SCO_Packets; @@ -181,7 +181,7 @@ typedef struct sBtampHCI_Data_Block_Size { // v_U8_t present; v_U8_t status; /* D9r14 says Max80211PALPDUSize 1492 */ - v_U16_t HC_Max_ACL_Data_Packet_Length; + v_U16_t HC_Max_ACL_Data_Packet_Length; v_U16_t HC_Data_Block_Length; v_U16_t HC_Total_Num_Data_Blocks; } tBtampHCI_Data_Block_Size; @@ -189,10 +189,10 @@ typedef struct sBtampHCI_Data_Block_Size { typedef struct sBtampHCI_Version_Info { // v_U8_t present; v_U8_t HC_HCI_Version; - v_U16_t HC_HCI_Revision; + v_U16_t HC_HCI_Revision; v_U8_t HC_PAL_Version; /* for 802.11 AMP: 0x01 */ - v_U16_t HC_PAL_Sub_Version; /* for 802.11 AMP: Vendor specific */ - v_U16_t HC_Manufac_Name; /* See BT assigned numbers */ + v_U16_t HC_PAL_Sub_Version; /* for 802.11 AMP: Vendor specific */ + v_U16_t HC_Manufac_Name; /* See BT assigned numbers */ } tBtampHCI_Version_Info; typedef struct sBtampHCI_Supported_Cmds { @@ -246,10 +246,10 @@ typedef struct sBtampLogLinkCtx { v_U16_t log_link_handle; /* 8 bits of phy_link_handle and our index */ /* The flow spec (From section 5.6 of Generic AMP spec) */ - tBtampTLVFlow_Spec btampFlowSpec; + tBtampTLVFlow_Spec btampFlowSpec; /* The Access category */ - WLANTL_ACEnumType btampAC; + WLANTL_ACEnumType btampAC; /* The TID */ v_U8_t ucTID; @@ -257,9 +257,9 @@ typedef struct sBtampLogLinkCtx { /* UP of the packet being sent */ v_U8_t ucUP; - /*Number of packets completed since the last time num pkt complete event + /*Number of packets completed since the last time num pkt complete event was issued*/ - v_U32_t uTxPktCompleted; + v_U32_t uTxPktCompleted; } tBtampLogLinkCtx, *tpBtampLogLinkCtx ; @@ -274,13 +274,13 @@ typedef struct sBtampQosCfg { /*---------------------------------------------------------------------------- * Opaque BAP context Type Declaration * -------------------------------------------------------------------------*/ -// We were only using this syntax, when this was truly opaque. +// We were only using this syntax, when this was truly opaque. // (I.E., it was defined in a different file.) //typedef struct sBtampContext tBtampContext, *ptBtampContext; -// Validity check the logical link value -#define BTAMP_VALID_LOG_LINK(a) ( a > 0 && a < WLANBAP_MAX_LOG_LINKS ? 1 : 0) +// Validity check the logical link value +#define BTAMP_VALID_LOG_LINK(a) ( a > 0 && a < WLANBAP_MAX_LOG_LINKS ? 1 : 0) /* Instance data definition of state machine */ // Moved here from the BTAMP FSM definitions in btampFsm.h @@ -317,7 +317,7 @@ typedef struct sBtampContext { #ifndef BTAMP_MULTIPLE_PHY_LINKS // Include the enclosing VOSS context here - v_PVOID_t pvosGCtx; + v_PVOID_t pvosGCtx; // include the phy link state machine structure here tWLAN_BAPbapPhysLinkMachine bapPhysLinkMachine; @@ -327,13 +327,13 @@ typedef struct sBtampContext { // Include the SME(CSR) sessionId here v_U8_t sessionId; - // Actual storage for AP and self (STA) SSID + // Actual storage for AP and self (STA) SSID //tSirMacSSid SSID[2]; tCsrSSIDInfo SSIDList[2]; - // Actual storage for AP bssid + // Actual storage for AP bssid tCsrBssid bssid; // Include the SME(CSR) context here - tCsrRoamProfile csrRoamProfile; + tCsrRoamProfile csrRoamProfile; tANI_U32 csrRoamId; // QOS config @@ -344,26 +344,26 @@ typedef struct sBtampContext { // associated boolean flag v_U8_t mAssociated; - // associated status + // associated status v_U8_t mAssociatedStatus; - tCsrBssid assocBssid; - tBssSystemRole systemRole; + tCsrBssid assocBssid; + tBssSystemRole systemRole; - // own SSID + // own SSID v_U8_t ownSsid[32]; v_U32_t ownSsidLen; - // incoming Assoc SSID + // incoming Assoc SSID v_U8_t assocSsid[32]; v_U32_t assocSsidLen; // gNeedPhysLinkCompEvent v_U8_t gNeedPhysLinkCompEvent; - // gPhysLinkStatus + // gPhysLinkStatus v_U8_t gPhysLinkStatus; // gDiscRequested v_U8_t gDiscRequested; - // gDiscReason + // gDiscReason v_U8_t gDiscReason; // Include the BSL per-application context here @@ -372,7 +372,7 @@ typedef struct sBtampContext { // (Right now, there is only one) v_PVOID_t pHddHdl; /* 8 bits of phy_link_handle identifies this association */ - v_U8_t phy_link_handle; + v_U8_t phy_link_handle; // Short Range Mode setting for this physical link v_U8_t phy_link_srm; @@ -380,38 +380,38 @@ typedef struct sBtampContext { v_U8_t key_type; v_U8_t key_length; v_U8_t key_material[32]; - + /* Physical link quality status After the physical link is up, SME indicates the link quality through callback. This value is returned to upper layer on request. */ v_U8_t link_quality; - + /* Connection Accept timer*/ - vos_timer_t bapConnectionAcceptTimer; + vos_timer_t bapConnectionAcceptTimer; /* Link Supervision timer*/ - vos_timer_t bapLinkSupervisionTimer; + vos_timer_t bapLinkSupervisionTimer; /* Logical Link Accept timer*/ - vos_timer_t bapLogicalLinkAcceptTimer; + vos_timer_t bapLogicalLinkAcceptTimer; /* Best Effort Flush timer*/ - vos_timer_t bapBEFlushTimer; + vos_timer_t bapBEFlushTimer; /* TX Packet Monitoring timer*/ - vos_timer_t bapTxPktMonitorTimer; + vos_timer_t bapTxPktMonitorTimer; /* Connection Accept Timer interval (in BR/EDR baseband slots) * Interval length = N * 0.625 msec (1 BR/EDR baseband slot) */ - v_U16_t bapConnectionAcceptTimerInterval; + v_U16_t bapConnectionAcceptTimerInterval; /* Link Supervision Timer interval (in BR/EDR baseband slots) */ - v_U16_t bapLinkSupervisionTimerInterval; + v_U16_t bapLinkSupervisionTimerInterval; /* Logical Link Accept Timer interval (in BR/EDR baseband slots) */ - v_U16_t bapLogicalLinkAcceptTimerInterval; + v_U16_t bapLogicalLinkAcceptTimerInterval; /* Best Effort Flush timer interval*/ - v_U32_t bapBEFlushTimerInterval; + v_U32_t bapBEFlushTimerInterval; // Include the current channel here v_U32_t channel; @@ -425,25 +425,25 @@ typedef struct sBtampContext { // The array of logical links /* the last small integer (<16) value assigned by us */ - v_U8_t current_log_link_index; /* assigned mod 16 */ - v_U8_t total_log_link_index; /* should never be >16 */ + v_U8_t current_log_link_index; /* assigned mod 16 */ + v_U8_t total_log_link_index; /* should never be >16 */ /* The actual array */ - tBtampLogLinkCtx btampLogLinkCtx[WLANBAP_MAX_LOG_LINKS]; - + tBtampLogLinkCtx btampLogLinkCtx[WLANBAP_MAX_LOG_LINKS]; + // Include the HDD BAP Shim Layer callbacks for Fetch, TxComp, and RxPkt WLANBAP_STAFetchPktCBType pfnBtampFetchPktCB; WLANBAP_STARxCBType pfnBtamp_STARxCB; WLANBAP_TxCompCBType pfnBtampTxCompCB; - /* Implements the callback for ALL asynchronous events. */ + /* Implements the callback for ALL asynchronous events. */ tpWLAN_BAPEventCB pBapHCIEventCB; - // Save Page2 of the event mask. + // Save Page2 of the event mask. v_U8_t event_mask_page_2[8]; // Include the Local Assoc structure. - // (This gets filled during initialization. It is used, for example, to - // obtain the local MAC address for forming the 802.3 frame.) + // (This gets filled during initialization. It is used, for example, to + // obtain the local MAC address for forming the 802.3 frame.) // <<Why don't I just pull out the individ fields I need? Like MAC addr.>> tBtampHCI_AMP_Assoc btamp_AMP_Assoc; @@ -466,7 +466,7 @@ typedef struct sBtampContext { vos_pkt_t *lsRepPacket; v_U16_t lsPktln; v_U16_t lsPending; - WLANTL_MetaInfoType metaInfo; + WLANTL_MetaInfoType metaInfo; tANI_BOOLEAN isBapSessionOpen; tWLAN_BAPLogLinkState btamp_logical_link_state; @@ -482,7 +482,7 @@ typedef struct sBtampContext { #else // defined(BTAMP_MULTIPLE_PHY_LINKS) // Include the enclosing VOSS context here - v_PVOID_t pvosGCtx; + v_PVOID_t pvosGCtx; // include the state machine structure here @@ -492,7 +492,7 @@ typedef struct sBtampContext { // (Right now, there is only one) v_PVOID_t pHddHdl; /* 8 bits of phy_link_handle identifies this association */ - v_U8_t phy_link_handle; + v_U8_t phy_link_handle; // Short Range Mode setting for this physical link v_U8_t phy_link_srm; @@ -505,32 +505,32 @@ typedef struct sBtampContext { // The array of logical links /* the last small integer (<16) value assigned by us */ - v_U8_t current_log_link_index; /* assigned mod 16 */ - v_U8_t total_log_link_index; /* should never be >16 */ + v_U8_t current_log_link_index; /* assigned mod 16 */ + v_U8_t total_log_link_index; /* should never be >16 */ /* The actual array */ - tBtampLogLinkCtx btampLogLinkCtx[WLANBAP_MAX_LOG_LINKS]; - + tBtampLogLinkCtx btampLogLinkCtx[WLANBAP_MAX_LOG_LINKS]; + // Include the HDD BAP Shim Layer callbacks for Fetch, TxComp, and RxPkt WLANBAP_STAFetchPktCBType pfnBtampFetchPktCB; WLANBAP_STARxCBType pfnBtamp_STARxCB; WLANBAP_TxCompCBType pfnBtampTxCompCB; - /* Implements the callback for ALL asynchronous events. */ + /* Implements the callback for ALL asynchronous events. */ tpWLAN_BAPEventCB pBapHCIEventCB; // Include the Local Assoc structure. - // (This gets filled during initialization. It is used, for example, to - // obtain the local MAC address for forming the 802.3 frame.) + // (This gets filled during initialization. It is used, for example, to + // obtain the local MAC address for forming the 802.3 frame.) // <<Why don't I just pull out the individ fields I need? Like MAC addr.>> tBtampHCI_AMP_Assoc btamp_AMP_Assoc; - //LinkSupervision packet - tANI_BOOLEAN lsReqPktPending; + //LinkSupervision packet + tANI_BOOLEAN lsReqPktPending; tANI_U8 retries; vos_pkt_t *pPacket; vos_pkt_t *lsReqPacket; vos_pkt_t *lsRepPacket; v_U16_t lsPktln; - WLANTL_MetaInfoType* metaInfo; + WLANTL_MetaInfoType* metaInfo; tANI_BOOLEAN isBapSessionOpen; //End of LinkSupervision packet #endif //BTAMP_MULTIPLE_PHY_LINKS @@ -540,7 +540,7 @@ typedef struct sBtampContext { vos_lock_t bapLock; // Either Block mode or Pkt mode v_U8_t ucDataTrafficMode; -}*ptBtampContext; +}*ptBtampContext; //tBtampContext, *ptBtampContext; /*---------------------------------------------------------------------------- @@ -567,20 +567,20 @@ typedef struct sBtampContext tBtampSessCtx; /*---------------------------------------------------------------------------- * BAP state machine event definition * -------------------------------------------------------------------------*/ -/* The event structure */ +/* The event structure */ typedef struct sWLAN_BAPEvent { v_U32_t event; /* State machine input event message */ v_PVOID_t params; /* A VOID pointer type for all possible inputs */ v_U32_t u1; /* introduced to handle csrRoamCompleteCallback roamStatus */ v_U32_t u2; /* introduced to handle csrRoamCompleteCallback roamResult */ -} tWLAN_BAPEvent, *ptWLAN_BAPEvent; - +} tWLAN_BAPEvent, *ptWLAN_BAPEvent; + // Pick up the BTAMP FSM definitions #include "btampFsm.h" /*---------------------------------------------------------------------------- - * External declarations for global context + * External declarations for global context * -------------------------------------------------------------------------*/ // The main per-Physical Link (per WLAN association) context. //extern tBtampContext btampCtx; @@ -597,7 +597,7 @@ extern tBtampHCI_Supported_Cmds btampHCI_Supported_Cmds; /*---------------------------------------------------------------------------- - * Function prototypes + * Function prototypes * -------------------------------------------------------------------------*/ /* I don't think any of this is needed */ @@ -606,46 +606,46 @@ extern tBtampHCI_Supported_Cmds btampHCI_Supported_Cmds; /*---------------------------------------------------------------------------- - FUNCTION WLANBAP_STAFetchPktCB + FUNCTION WLANBAP_STAFetchPktCB + + DESCRIPTION + The fetch packet callback registered with TL. - DESCRIPTION - The fetch packet callback registered with TL. - - It is called by the TL when the scheduling algorithms allows for - transmission of another packet to the module. - It will be called in the context of the BAL fetch transmit packet - function, initiated by the bus lower layer. + It is called by the TL when the scheduling algorithms allows for + transmission of another packet to the module. + It will be called in the context of the BAL fetch transmit packet + function, initiated by the bus lower layer. - PARAMETERS + PARAMETERS IN - pvosGCtx: pointer to the global vos context; a handle - to TL's or HDD's control block can be extracted - from its context + pvosGCtx: pointer to the global vos context; a handle + to TL's or HDD's control block can be extracted + from its context IN/OUT - pucSTAId: the Id of the station for which TL is requesting a - packet, in case HDD does not maintain per station - queues it can give the next packet in its queue - and put in the right value for the - pucAC: access category requested by TL, if HDD does not have - packets on this AC it can choose to service another AC + pucSTAId: the Id of the station for which TL is requesting a + packet, in case HDD does not maintain per station + queues it can give the next packet in its queue + and put in the right value for the + pucAC: access category requested by TL, if HDD does not have + packets on this AC it can choose to service another AC queue in the order of priority OUT - vosDataBuff: pointer to the VOSS data buffer that was transmitted + vosDataBuff: pointer to the VOSS data buffer that was transmitted tlMetaInfo: meta info related to the data frame - - RETURN VALUE + + RETURN VALUE The result code associated with performing the operation ----------------------------------------------------------------------------*/ -VOS_STATUS -WLANBAP_STAFetchPktCB -( +VOS_STATUS +WLANBAP_STAFetchPktCB +( v_PVOID_t pvosGCtx, v_U8_t* pucSTAId, v_U8_t ucAC, @@ -658,32 +658,32 @@ WLANBAP_STAFetchPktCB FUNCTION WLANBAP_STARxCB - DESCRIPTION - The receive callback registered with TL. - - TL will call this to notify the client when a packet was received + DESCRIPTION + The receive callback registered with TL. + + TL will call this to notify the client when a packet was received for a registered STA. - PARAMETERS + PARAMETERS IN - pvosGCtx: pointer to the global vos context; a handle to - TL's or HDD's control block can be extracted from - its context + pvosGCtx: pointer to the global vos context; a handle to + TL's or HDD's control block can be extracted from + its context vosDataBuff: pointer to the VOSS data buffer that was received - (it may be a linked list) + (it may be a linked list) ucSTAId: station id - - RETURN VALUE + + RETURN VALUE The result code associated with performing the operation ----------------------------------------------------------------------------*/ -VOS_STATUS +VOS_STATUS WLANBAP_STARxCB ( - v_PVOID_t pvosGCtx, + v_PVOID_t pvosGCtx, vos_pkt_t* vosDataBuff, - v_U8_t ucSTAId, + v_U8_t ucSTAId, WLANTL_RxMetaInfoType* pRxMetaInfo ); #else @@ -718,32 +718,32 @@ WLANBAP_STARxCB(v_PVOID_t pvosGCtx, adf_nbuf_t rxBufChain, v_U8_t ucSTAId); FUNCTION WLANBAP_TxCompCB - DESCRIPTION - The tx complete callback registered with TL. - - TL will call this to notify the client when a transmission for a - packet has ended. + DESCRIPTION + The tx complete callback registered with TL. + + TL will call this to notify the client when a transmission for a + packet has ended. - PARAMETERS + PARAMETERS IN - pvosGCtx: pointer to the global vos context; a handle to - TL/HAL/PE/BAP/HDD control block can be extracted from - its context - vosDataBuff: pointer to the VOSS data buffer that was transmitted - wTxSTAtus: status of the transmission - - - RETURN VALUE + pvosGCtx: pointer to the global vos context; a handle to + TL/HAL/PE/BAP/HDD control block can be extracted from + its context + vosDataBuff: pointer to the VOSS data buffer that was transmitted + wTxSTAtus: status of the transmission + + + RETURN VALUE The result code associated with performing the operation ----------------------------------------------------------------------------*/ -VOS_STATUS +VOS_STATUS WLANBAP_TxCompCB -( +( v_PVOID_t pvosGCtx, vos_pkt_t* vosDataBuff, - VOS_STATUS wTxSTAtus + VOS_STATUS wTxSTAtus ); /* Callbacks Registered with TL by WLANTL_RegisterBAPClient */ @@ -752,21 +752,21 @@ WLANBAP_TxCompCB /*---------------------------------------------------------------------------- - DESCRIPTION - The receive callback registered with TL for BAP. - - The registered reception callback is being triggered by TL whenever a - frame was received and it was filtered as a non-data BT AMP packet. + DESCRIPTION + The receive callback registered with TL for BAP. + + The registered reception callback is being triggered by TL whenever a + frame was received and it was filtered as a non-data BT AMP packet. - PARAMETERS + PARAMETERS IN - pvosGCtx: pointer to the global vos context; a handle to TL's - or SME's control block can be extracted from its context - vosDataBuff: pointer to the vOSS buffer containing the received packet; - no chaining will be done on this path - - RETURN VALUE + pvosGCtx: pointer to the global vos context; a handle to TL's + or SME's control block can be extracted from its context + vosDataBuff: pointer to the vOSS buffer containing the received packet; + no chaining will be done on this path + + RETURN VALUE The result code associated with performing the operation ----------------------------------------------------------------------------*/ @@ -774,54 +774,54 @@ WLANTL_BAPRxCBType WLANBAP_TLRsnRxCallback ( v_PVOID_t pvosGCtx, vos_pkt_t* vosDataBuff -); +); /* Flush complete Callback */ /*---------------------------------------------------------------------------- - DESCRIPTION + DESCRIPTION Callback registered with TL for BAP, this is required inorder for - TL to inform BAP, that the flush operation requested has been completed. - - The registered reception callback is being triggered by TL whenever a + TL to inform BAP, that the flush operation requested has been completed. + + The registered reception callback is being triggered by TL whenever a frame SIR_TL_HAL_FLUSH_AC_RSP is received by TL from HAL. - PARAMETERS + PARAMETERS IN - pvosGCtx: pointer to the global vos context; a handle to TL's - or SME's control block can be extracted from its context + pvosGCtx: pointer to the global vos context; a handle to TL's + or SME's control block can be extracted from its context ucStaId: station identifier for the requested value - ucTid: identifier of the tspec + ucTid: identifier of the tspec status: status of the Flush operation - - RETURN VALUE + + RETURN VALUE The result code associated with performing the operation ----------------------------------------------------------------------------*/ VOS_STATUS WLANBAP_TLFlushCompCallback -( +( v_PVOID_t pvosGCtx, - v_U8_t ucStaId, - v_U8_t ucTID, + v_U8_t ucStaId, + v_U8_t ucTID, v_U8_t status ); /*---------------------------------------------------------------------------- - * CSR Roam (Connection Status) callback + * CSR Roam (Connection Status) callback * -------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------- FUNCTION WLANBAP_RoamCallback() - DESCRIPTION - Callback for Roam (connection status) Events + DESCRIPTION + Callback for Roam (connection status) Events - DEPENDENCIES - NA. + DEPENDENCIES + NA. - PARAMETERS + PARAMETERS IN pContext: is the pContext passed in with the roam request @@ -830,57 +830,57 @@ VOS_STATUS WLANBAP_TLFlushCompCallback roamId: is to identify the callback related roam request. 0 means unsolicited roamStatus: is a flag indicating the status of the callback roamResult: is the result - + RETURN VALUE - The result code associated with performing the operation + The result code associated with performing the operation eHAL_STATUS_SUCCESS: Success - - SIDE EFFECTS - + + SIDE EFFECTS + ----------------------------------------------------------------------------*/ eHalStatus WLANBAP_RoamCallback ( - void *pContext, + void *pContext, tCsrRoamInfo *pCsrRoamInfo, - tANI_U32 roamId, - eRoamCmdStatus roamStatus, + tANI_U32 roamId, + eRoamCmdStatus roamStatus, eCsrRoamResult roamResult ); /*---------------------------------------------------------------------------- - * Utility Function prototypes + * Utility Function prototypes * -------------------------------------------------------------------------*/ /*========================================================================== FUNCTION WLANBAP_CleanCB - DESCRIPTION + DESCRIPTION Clear out all fields in the BAP context. - - DEPENDENCIES - - PARAMETERS + + DEPENDENCIES + + PARAMETERS IN pBtampCtx: pointer to the BAP control block freeFlag: flag indicating whether to free any allocations. - + RETURN VALUE - The result code associated with performing the operation + The result code associated with performing the operation - VOS_STATUS_E_FAULT: pointer to BAP cb is NULL ; access would cause a page - fault - VOS_STATUS_SUCCESS: Everything is good :) + VOS_STATUS_E_FAULT: pointer to BAP cb is NULL ; access would cause a page + fault + VOS_STATUS_SUCCESS: Everything is good :) + + SIDE EFFECTS - SIDE EFFECTS - ============================================================================*/ -VOS_STATUS +VOS_STATUS WLANBAP_CleanCB -( +( ptBtampContext pBtampCtx, v_U32_t freeFlag // 0 /*do not empty*/); ); @@ -889,38 +889,38 @@ WLANBAP_CleanCB FUNCTION WLANBAP_GetCtxFromStaId - DESCRIPTION + DESCRIPTION Called inside the BT-AMP PAL (BAP) layer whenever we need either the BSL context or the BTAMP context from the StaId. - - - DEPENDENCIES - - PARAMETERS + + + DEPENDENCIES + + PARAMETERS IN - ucSTAId: The StaId (used by TL, PE, and HAL) - + ucSTAId: The StaId (used by TL, PE, and HAL) + OUT - hBtampHandle: Handle (pointer to a pointer) to return the + hBtampHandle: Handle (pointer to a pointer) to return the btampHandle value in. hHddHdl: Handle to return the BSL context pointer in. - + RETURN VALUE - The result code associated with performing the operation + The result code associated with performing the operation - VOS_STATUS_E_FAULT: NULL pointer; access would cause a page fault - VOS_STATUS_SUCCESS: Everything is good :) + VOS_STATUS_E_FAULT: NULL pointer; access would cause a page fault + VOS_STATUS_SUCCESS: Everything is good :) + + SIDE EFFECTS - SIDE EFFECTS - ============================================================================*/ -VOS_STATUS +VOS_STATUS WLANBAP_GetCtxFromStaId -( +( v_U8_t ucSTAId, /* The StaId (used by TL, PE, and HAL) */ - ptBtampHandle *hBtampHandle, /* Handle to return per app btampHandle value in */ - ptBtampContext *hBtampContext, /* Handle to return per assoc btampContext value in */ + ptBtampHandle *hBtampHandle, /* Handle to return per app btampHandle value in */ + ptBtampContext *hBtampContext, /* Handle to return per assoc btampContext value in */ v_PVOID_t *hHddHdl /* Handle to return BSL context in */ ); @@ -928,37 +928,37 @@ WLANBAP_GetCtxFromStaId FUNCTION WLANBAP_GetStaIdFromLinkCtx - DESCRIPTION + DESCRIPTION Called inside the BT-AMP PAL (BAP) layer whenever we need the StaId (or hHddHdl) from the BTAMP context and phy_link_handle. - - - DEPENDENCIES - - PARAMETERS + + + DEPENDENCIES + + PARAMETERS IN - hBtampHandle: Handle (pointer to a pointer) to return the + hBtampHandle: Handle (pointer to a pointer) to return the btampHandle value in. - phy_link_handle: physical link handle value. Unique per assoc. - + phy_link_handle: physical link handle value. Unique per assoc. + OUT - pucSTAId: The StaId (used by TL, PE, and HAL) + pucSTAId: The StaId (used by TL, PE, and HAL) hHddHdl: Handle to return the BSL context pointer in. - + RETURN VALUE - The result code associated with performing the operation + The result code associated with performing the operation + + VOS_STATUS_E_FAULT: NULL pointer; access would cause a page fault + VOS_STATUS_SUCCESS: Everything is good :) - VOS_STATUS_E_FAULT: NULL pointer; access would cause a page fault - VOS_STATUS_SUCCESS: Everything is good :) + SIDE EFFECTS - SIDE EFFECTS - ============================================================================*/ -VOS_STATUS +VOS_STATUS WLANBAP_GetStaIdFromLinkCtx -( - ptBtampHandle btampHandle, /* btampHandle value in */ +( + ptBtampHandle btampHandle, /* btampHandle value in */ v_U8_t phy_link_handle, /* phy_link_handle value in */ v_U8_t *pucSTAId, /* The StaId (used by TL, PE, and HAL) */ v_PVOID_t *hHddHdl /* Handle to return BSL context */ @@ -968,39 +968,39 @@ WLANBAP_GetStaIdFromLinkCtx FUNCTION WLANBAP_CreateNewPhyLinkCtx - DESCRIPTION + DESCRIPTION Called in order to create (or update) a BAP Physical Link "context" - - - DEPENDENCIES - - PARAMETERS + + + DEPENDENCIES + + PARAMETERS IN btampHandle: BAP app context handle - phy_link_handle: phy_link_handle from the Command + phy_link_handle: phy_link_handle from the Command pHddHdl: BSL passes in its specific context - + OUT - hBtampContext: Handle (pointer to a pointer) to return the + hBtampContext: Handle (pointer to a pointer) to return the per "Phy Link" ptBtampContext value in. - + RETURN VALUE - The result code associated with performing the operation + The result code associated with performing the operation + + VOS_STATUS_E_FAULT: NULL pointer; access would cause a page fault + VOS_STATUS_SUCCESS: Everything is good :) - VOS_STATUS_E_FAULT: NULL pointer; access would cause a page fault - VOS_STATUS_SUCCESS: Everything is good :) + SIDE EFFECTS - SIDE EFFECTS - ============================================================================*/ -VOS_STATUS +VOS_STATUS WLANBAP_CreateNewPhyLinkCtx -( +( ptBtampHandle btampHandle, v_U8_t phy_link_handle, /* I get phy_link_handle from the Command */ v_PVOID_t pHddHdl, /* BSL passes in its specific context */ - ptBtampContext *hBtampContext, /* Handle to return per assoc btampContext value in */ + ptBtampContext *hBtampContext, /* Handle to return per assoc btampContext value in */ tWLAN_BAPRole BAPDeviceRole /* Needed to determine which MAC address to use for self MAC */ ); @@ -1008,32 +1008,32 @@ WLANBAP_CreateNewPhyLinkCtx FUNCTION WLANBAP_UpdatePhyLinkCtxStaId - DESCRIPTION + DESCRIPTION Called to update the STAId value associated with Physical Link "context" - - - DEPENDENCIES - - PARAMETERS + + + DEPENDENCIES + + PARAMETERS IN pBtampContext: ptBtampContext to update. - ucSTAId: The StaId (used by TL, PE, and HAL) - - + ucSTAId: The StaId (used by TL, PE, and HAL) + + RETURN VALUE - The result code associated with performing the operation + The result code associated with performing the operation + + VOS_STATUS_E_FAULT: NULL pointer; access would cause a page fault + VOS_STATUS_SUCCESS: Everything is good :) - VOS_STATUS_E_FAULT: NULL pointer; access would cause a page fault - VOS_STATUS_SUCCESS: Everything is good :) + SIDE EFFECTS - SIDE EFFECTS - ============================================================================*/ -VOS_STATUS +VOS_STATUS WLANBAP_UpdatePhyLinkCtxStaId -( - ptBtampContext pBtampContext, /* btampContext value in */ +( + ptBtampContext pBtampContext, /* btampContext value in */ v_U8_t ucSTAId ); @@ -1041,34 +1041,34 @@ WLANBAP_UpdatePhyLinkCtxStaId FUNCTION WLANBAP_CreateNewLogLinkCtx - DESCRIPTION + DESCRIPTION Called in order to allocate a BAP Logical Link "context" and "index" - - - DEPENDENCIES - - PARAMETERS + + + DEPENDENCIES + + PARAMETERS IN pBtampContext: Pointer to the ptBtampContext value in. - phy_link_handle: phy_link_handle involved - + phy_link_handle: phy_link_handle involved + OUT - pLog_link_handle: return the log_link_handle here - + pLog_link_handle: return the log_link_handle here + RETURN VALUE - The result code associated with performing the operation + The result code associated with performing the operation + + VOS_STATUS_E_FAULT: NULL pointer; access would cause a page fault + VOS_STATUS_SUCCESS: Everything is good :) - VOS_STATUS_E_FAULT: NULL pointer; access would cause a page fault - VOS_STATUS_SUCCESS: Everything is good :) + SIDE EFFECTS - SIDE EFFECTS - ============================================================================*/ -VOS_STATUS +VOS_STATUS WLANBAP_CreateNewLogLinkCtx -( - ptBtampContext pBtampContext, /* pointer to the per assoc btampContext value */ +( + ptBtampContext pBtampContext, /* pointer to the per assoc btampContext value */ v_U8_t phy_link_handle, /* I get phy_link_handle from the Command */ v_U8_t tx_flow_spec[18], v_U8_t rx_flow_spec[18], @@ -1079,63 +1079,63 @@ WLANBAP_CreateNewLogLinkCtx FUNCTION WLANBAP_pmcFullPwrReqCB - DESCRIPTION - Callback provide to PMC in the pmcRequestFullPower API. - - - DEPENDENCIES - - PARAMETERS + DESCRIPTION + Callback provide to PMC in the pmcRequestFullPower API. + + + DEPENDENCIES + + PARAMETERS IN - callbackContext: The user passed in a context to identify - status: The halStatus - - + callbackContext: The user passed in a context to identify + status: The halStatus + + RETURN VALUE None - SIDE EFFECTS - + SIDE EFFECTS + ============================================================================*/ -void +void WLANBAP_pmcFullPwrReqCB -( - void *callbackContext, +( + void *callbackContext, eHalStatus status ); - + /*=========================================================================== FUNCTION WLANBAP_RxProcLsPkt - DESCRIPTION + DESCRIPTION This API will be called when Link Supervision frames are received at BAP - PARAMETERS + PARAMETERS btampHandle: The BT-AMP PAL handle returned in WLANBAP_GetNewHndl. - pucAC: Pointer to return the access category + pucAC: Pointer to return the access category RxProtoType: Protocol type of Received Packet - vosDataBuff: The data buffer containing the 802.3 frame to be + vosDataBuff: The data buffer containing the 802.3 frame to be translated to BT HCI Data Packet - + RETURN VALUE - The result code associated with performing the operation + The result code associated with performing the operation + + VOS_STATUS_E_INVAL: Input parameters are invalid + VOS_STATUS_E_FAULT: BAP handle is NULL + VOS_STATUS_SUCCESS: Everything is good :) - VOS_STATUS_E_INVAL: Input parameters are invalid - VOS_STATUS_E_FAULT: BAP handle is NULL - VOS_STATUS_SUCCESS: Everything is good :) + SIDE EFFECTS - SIDE EFFECTS - ============================================================================*/ VOS_STATUS WLANBAP_RxProcLsPkt -( - ptBtampHandle btampHandle, +( + ptBtampHandle btampHandle, v_U8_t phy_link_handle, /* Used by BAP to indentify the WLAN assoc. (StaId) */ v_U16_t RxProtoType, /* Protocol Type from the frame received */ vos_pkt_t *vosRxLsBuff @@ -1146,36 +1146,36 @@ WLANBAP_RxProcLsPkt FUNCTION WLANBAP_TxLinkSupervisionReq() - DESCRIPTION + DESCRIPTION Implements the LinkSupervision Tx Request procedure.This will be called by APIs that want - to transmit LinkSupervision Packets + to transmit LinkSupervision Packets Calls PktPending CB to indicate a packet is pending for transmission - - DEPENDENCIES - NA. - PARAMETERS + DEPENDENCIES + NA. + + PARAMETERS IN btampHandle: pointer to the BAP handle. Returned from WLANBAP_GetNewHndl. phy_link_handle: Used by BAP to indentify the WLAN assoc. (StaId) vosDataBuff:The actual packet being sent in Tx request - protoType : specifies if it is a LS REQ or LS REP packet - + protoType : specifies if it is a LS REQ or LS REP packet + RETURN VALUE - The result code associated with performing the operation + The result code associated with performing the operation - VOS_STATUS_E_FAULT: Failure of Transmit procedure + VOS_STATUS_E_FAULT: Failure of Transmit procedure VOS_STATUS_SUCCESS: Success - - SIDE EFFECTS - + + SIDE EFFECTS + ----------------------------------------------------------------------------*/ VOS_STATUS WLANBAP_TxLinkSupervision -( - ptBtampHandle btampHandle, +( + ptBtampHandle btampHandle, v_U8_t phy_link_handle, /* Used by BAP to indentify the WLAN assoc. (StaId) */ vos_pkt_t *vosDataBuff, v_U16_t protoType @@ -1185,53 +1185,53 @@ WLANBAP_TxLinkSupervision FUNCTION WLANBAP_ReadMacConfig - DESCRIPTION + DESCRIPTION This function sets the MAC config (Address and SSID to BT-AMP context - - DEPENDENCIES - - PARAMETERS - - pvosGCtx: pointer to the global vos context; a handle to BAP's - control block can be extracted from its context - + + DEPENDENCIES + + PARAMETERS + + pvosGCtx: pointer to the global vos context; a handle to BAP's + control block can be extracted from its context + RETURN VALUE None - SIDE EFFECTS - + SIDE EFFECTS + ============================================================================*/ void WLANBAP_ReadMacConfig -( - ptBtampContext pBtampCtx +( + ptBtampContext pBtampCtx ); /*========================================================================== FUNCTION WLANBAP_NeedBTCoexPriority - DESCRIPTION + DESCRIPTION This function will cause a message to be sent to BTC firmware if a change in priority has occurred. (From AMP's point-of-view.) - - DEPENDENCIES - - PARAMETERS - - pvosGCtx: pointer to the global vos context; a handle to HAL's - control block can be extracted from its context - + + DEPENDENCIES + + PARAMETERS + + pvosGCtx: pointer to the global vos context; a handle to HAL's + control block can be extracted from its context + RETURN VALUE None - SIDE EFFECTS - + SIDE EFFECTS + ============================================================================*/ void WLANBAP_NeedBTCoexPriority -( - ptBtampContext pBtampCtx, +( + ptBtampContext pBtampCtx, v_U32_t needCoexPriority ); @@ -1240,27 +1240,27 @@ WLANBAP_NeedBTCoexPriority FUNCTION WLANBAP_RxCallback - DESCRIPTION + DESCRIPTION This function is called by TL call this function for all frames except for Data frames - - DEPENDENCIES - - PARAMETERS - pvosGCtx: pointer to the global vos context; a handle to BAP's + DEPENDENCIES + + PARAMETERS + + pvosGCtx: pointer to the global vos context; a handle to BAP's control block can be extracted from its context pPacket Vos packet frameType Frame type - + RETURN VALUE None - SIDE EFFECTS - + SIDE EFFECTS + ============================================================================*/ VOS_STATUS WLANBAP_RxCallback ( - v_PVOID_t pvosGCtx, + v_PVOID_t pvosGCtx, vos_pkt_t *pPacket, WLANTL_BAPFrameEnumType frameType ); @@ -1270,30 +1270,30 @@ VOS_STATUS WLANBAP_RxCallback FUNCTION WLANBAP_InitLinkSupervision - DESCRIPTION + DESCRIPTION This API will be called when Link Supervision module is to be initialized when connected at BAP - PARAMETERS + PARAMETERS btampHandle: The BT-AMP PAL handle returned in WLANBAP_GetNewHndl. - + RETURN VALUE - The result code associated with performing the operation + The result code associated with performing the operation - VOS_STATUS_E_INVAL: Input parameters are invalid - VOS_STATUS_E_FAULT: BAP handle is NULL - VOS_STATUS_SUCCESS: Everything is good :) + VOS_STATUS_E_INVAL: Input parameters are invalid + VOS_STATUS_E_FAULT: BAP handle is NULL + VOS_STATUS_SUCCESS: Everything is good :) + + SIDE EFFECTS - SIDE EFFECTS - ============================================================================*/ #define TX_LS_DATALEN 32 VOS_STATUS WLANBAP_InitLinkSupervision -( +( ptBtampHandle btampHandle ); @@ -1302,29 +1302,29 @@ WLANBAP_InitLinkSupervision FUNCTION WLANBAP_DeInitLinkSupervision - DESCRIPTION + DESCRIPTION - This API will be called when Link Supervision module is to be stopped after disconnected at BAP + This API will be called when Link Supervision module is to be stopped after disconnected at BAP - PARAMETERS + PARAMETERS btampHandle: The BT-AMP PAL handle returned in WLANBAP_GetNewHndl. - + RETURN VALUE - The result code associated with performing the operation + The result code associated with performing the operation - VOS_STATUS_E_INVAL: Input parameters are invalid - VOS_STATUS_E_FAULT: BAP handle is NULL - VOS_STATUS_SUCCESS: Everything is good :) + VOS_STATUS_E_INVAL: Input parameters are invalid + VOS_STATUS_E_FAULT: BAP handle is NULL + VOS_STATUS_SUCCESS: Everything is good :) + + SIDE EFFECTS - SIDE EFFECTS - ============================================================================*/ VOS_STATUS WLANBAP_DeInitLinkSupervision -( - ptBtampHandle btampHandle +( + ptBtampHandle btampHandle ); void WLAN_BAPEstablishLogicalLink(ptBtampContext btampContext); @@ -1333,8 +1333,7 @@ void WLAN_BAPEstablishLogicalLink(ptBtampContext btampContext); } -#endif +#endif #endif /* #ifndef WLAN_QCT_WLANBAP_INTERNAL_H */ - diff --git a/CORE/BAP/src/bapModule.c b/CORE/BAP/src/bapModule.c index 1b3ed01c4eca..f7f9a48a1429 100644 --- a/CORE/BAP/src/bapModule.c +++ b/CORE/BAP/src/bapModule.c @@ -68,20 +68,20 @@ // Pull in some message types used by BTC #include "sirParams.h" //#include "halFwApi.h" - + #include "wlan_qct_tl.h" #include "vos_trace.h" // Pick up the sme callback registration API #include "sme_Api.h" #include "ccmApi.h" -/* BT-AMP PAL API header file */ -#include "bapApi.h" -#include "bapInternal.h" +/* BT-AMP PAL API header file */ +#include "bapApi.h" +#include "bapInternal.h" // Pick up the BTAMP RSN definitions #include "bapRsnTxRx.h" -//#include "assert.h" +//#include "assert.h" #include "bapApiTimer.h" #if defined(ANI_OS_TYPE_ANDROID) @@ -92,7 +92,7 @@ /*---------------------------------------------------------------------------- * Preprocessor Definitions and Constants * -------------------------------------------------------------------------*/ -//#define VOS_GET_BAP_CB(ctx) vos_get_context( VOS_MODULE_ID_BAP, ctx) +//#define VOS_GET_BAP_CB(ctx) vos_get_context( VOS_MODULE_ID_BAP, ctx) /*---------------------------------------------------------------------------- @@ -103,16 +103,16 @@ * Global Data Definitions * -------------------------------------------------------------------------*/ // include the phy link state machine structure here -static tWLAN_BAPbapPhysLinkMachine bapPhysLinkMachineInitial +static tWLAN_BAPbapPhysLinkMachine bapPhysLinkMachineInitial = BTAMPFSM_INSTANCEDATA_INIT; /*---------------------------------------------------------------------------- - * External declarations for global context + * External declarations for global context * -------------------------------------------------------------------------*/ // No! Get this from VOS. // The main per-Physical Link (per WLAN association) context. //tBtampContext btampCtx; -ptBtampContext gpBtampCtx; +ptBtampContext gpBtampCtx; // Include the Local AMP Info structure. tBtampHCI_AMP_Info btampHCI_AMP_Info; @@ -126,7 +126,7 @@ tBtampHCI_Supported_Cmds btampHCI_Supported_Cmds; static unsigned char pBtStaOwnMacAddr[WNI_CFG_BSSID_LEN]; /*BT-AMP SSID; per spec should have this format: "AMP-00-0a-f5-04-05-08" */ -#define WLAN_BAP_SSID_MAX_LEN 21 +#define WLAN_BAP_SSID_MAX_LEN 21 static char pBtStaOwnSsid[WLAN_BAP_SSID_MAX_LEN]; /*---------------------------------------------------------------------------- @@ -149,45 +149,45 @@ static char pBtStaOwnSsid[WLAN_BAP_SSID_MAX_LEN]; FUNCTION WLANBAP_Open - DESCRIPTION - Called at driver initialization (vos_open). BAP will initialize - all its internal resources and will wait for the call to start to - register with the other modules. - - DEPENDENCIES - - PARAMETERS + DESCRIPTION + Called at driver initialization (vos_open). BAP will initialize + all its internal resources and will wait for the call to start to + register with the other modules. + + DEPENDENCIES + + PARAMETERS IN - pvosGCtx: pointer to the global vos context; a handle to BAP's - control block can be extracted from its context - + pvosGCtx: pointer to the global vos context; a handle to BAP's + control block can be extracted from its context + RETURN VALUE - The result code associated with performing the operation + The result code associated with performing the operation + + VOS_STATUS_E_FAULT: pointer to BAP cb is NULL ; access would cause a page + fault + VOS_STATUS_SUCCESS: Everything is good :) - VOS_STATUS_E_FAULT: pointer to BAP cb is NULL ; access would cause a page - fault - VOS_STATUS_SUCCESS: Everything is good :) + SIDE EFFECTS - SIDE EFFECTS - ============================================================================*/ -VOS_STATUS +VOS_STATUS WLANBAP_Open -( - v_PVOID_t pvosGCtx +( + v_PVOID_t pvosGCtx ) { - ptBtampContext pBtampCtx = NULL; + ptBtampContext pBtampCtx = NULL; /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ /*------------------------------------------------------------------------ - Allocate (and sanity check?!) BAP control block + Allocate (and sanity check?!) BAP control block ------------------------------------------------------------------------*/ vos_alloc_context(pvosGCtx, VOS_MODULE_ID_BAP, (v_VOID_t**)&pBtampCtx, sizeof(tBtampContext)); pBtampCtx = VOS_GET_BAP_CB(pvosGCtx); - if ( NULL == pBtampCtx ) + if ( NULL == pBtampCtx ) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "Invalid BAP pointer from pvosGCtx on WLANBAP_Open"); @@ -204,10 +204,10 @@ WLANBAP_Open // Setup the "link back" to the VOSS context pBtampCtx->pvosGCtx = pvosGCtx; - + // Store a pointer to the BAP context provided by VOSS gpBtampCtx = pBtampCtx; - + /*------------------------------------------------------------------------ Allocate internal resources ------------------------------------------------------------------------*/ @@ -220,47 +220,47 @@ WLANBAP_Open FUNCTION WLANBAP_Start - DESCRIPTION - Called as part of the overall start procedure (vos_start). BAP will - use this call to register with TL as the BAP entity for - BT-AMP RSN frames. - - DEPENDENCIES - - PARAMETERS + DESCRIPTION + Called as part of the overall start procedure (vos_start). BAP will + use this call to register with TL as the BAP entity for + BT-AMP RSN frames. + + DEPENDENCIES + + PARAMETERS IN - pvosGCtx: pointer to the global vos context; a handle to BAP's - control block can be extracted from its context - + pvosGCtx: pointer to the global vos context; a handle to BAP's + control block can be extracted from its context + RETURN VALUE - The result code associated with performing the operation + The result code associated with performing the operation - VOS_STATUS_E_FAULT: pointer to BAP cb is NULL ; access would cause a page - fault - VOS_STATUS_SUCCESS: Everything is good :) + VOS_STATUS_E_FAULT: pointer to BAP cb is NULL ; access would cause a page + fault + VOS_STATUS_SUCCESS: Everything is good :) Other codes can be returned as a result of a BAL failure; - - SIDE EFFECTS - + + SIDE EFFECTS + ============================================================================*/ -VOS_STATUS +VOS_STATUS WLANBAP_Start -( - v_PVOID_t pvosGCtx +( + v_PVOID_t pvosGCtx ) { - ptBtampContext pBtampCtx = NULL; + ptBtampContext pBtampCtx = NULL; VOS_STATUS vosStatus; /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ /*------------------------------------------------------------------------ Sanity check - Extract BAP control block + Extract BAP control block ------------------------------------------------------------------------*/ pBtampCtx = VOS_GET_BAP_CB(pvosGCtx); - if ( NULL == pBtampCtx ) + if ( NULL == pBtampCtx ) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "Invalid BAP pointer from pvosGCtx on WLANBAP_Start"); @@ -268,12 +268,12 @@ WLANBAP_Start } /*------------------------------------------------------------------------ - Register with TL as an BT-AMP RSN client + Register with TL as an BT-AMP RSN client ------------------------------------------------------------------------*/ VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "WLANBAP_Start TL register"); /*------------------------------------------------------------------------ - Register with CSR for Roam (connection status) Events + Register with CSR for Roam (connection status) Events ------------------------------------------------------------------------*/ VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "WLANBAP_Start CSR Register"); @@ -282,7 +282,7 @@ WLANBAP_Start WLANBAP_InitConnectionAcceptTimer (pBtampCtx ); WLANBAP_InitLinkSupervisionTimer(pBtampCtx); - vosStatus = vos_timer_init( + vosStatus = vos_timer_init( &pBtampCtx->bapTxPktMonitorTimer, VOS_TIMER_TYPE_SW, /* use this type */ WLANBAP_TxPacketMonitorHandler, @@ -301,45 +301,45 @@ WLANBAP_Start FUNCTION WLANBAP_Stop - DESCRIPTION - Called by vos_stop to stop operation in BAP, before close. BAP will suspend all - BT-AMP Protocol Adaption Layer operation and will wait for the close - request to clean up its resources. - - DEPENDENCIES - - PARAMETERS + DESCRIPTION + Called by vos_stop to stop operation in BAP, before close. BAP will suspend all + BT-AMP Protocol Adaption Layer operation and will wait for the close + request to clean up its resources. + + DEPENDENCIES + + PARAMETERS IN - pvosGCtx: pointer to the global vos context; a handle to BAP's - control block can be extracted from its context - + pvosGCtx: pointer to the global vos context; a handle to BAP's + control block can be extracted from its context + RETURN VALUE - The result code associated with performing the operation + The result code associated with performing the operation + + VOS_STATUS_E_FAULT: pointer to BAP cb is NULL ; access would cause a page + fault + VOS_STATUS_SUCCESS: Everything is good :) - VOS_STATUS_E_FAULT: pointer to BAP cb is NULL ; access would cause a page - fault - VOS_STATUS_SUCCESS: Everything is good :) + SIDE EFFECTS - SIDE EFFECTS - ============================================================================*/ -VOS_STATUS +VOS_STATUS WLANBAP_Stop -( - v_PVOID_t pvosGCtx +( + v_PVOID_t pvosGCtx ) { - ptBtampContext pBtampCtx = NULL; + ptBtampContext pBtampCtx = NULL; VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ /*------------------------------------------------------------------------ Sanity check - Extract BAP control block + Extract BAP control block ------------------------------------------------------------------------*/ pBtampCtx = VOS_GET_BAP_CB(pvosGCtx); - if ( NULL == pBtampCtx ) + if ( NULL == pBtampCtx ) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "Invalid BAP pointer from pvosGCtx on WLANBAP_Stop"); @@ -347,7 +347,7 @@ WLANBAP_Stop } /*------------------------------------------------------------------------ - Stop BAP (de-register RSN handler!?) + Stop BAP (de-register RSN handler!?) ------------------------------------------------------------------------*/ vosStatus = WLANBAP_DeinitConnectionAcceptTimer(pBtampCtx); if ( VOS_STATUS_SUCCESS != vosStatus) @@ -363,7 +363,7 @@ WLANBAP_Stop "Couldn't destroy bapLinkSupervisionTimer"); } - vosStatus = vos_timer_destroy ( + vosStatus = vos_timer_destroy ( &pBtampCtx->bapTxPktMonitorTimer ); if ( VOS_STATUS_SUCCESS != vosStatus) { @@ -378,43 +378,43 @@ WLANBAP_Stop FUNCTION WLANBAP_Close - DESCRIPTION - Called by vos_close during general driver close procedure. BAP will clean up - all the internal resources. - - DEPENDENCIES - - PARAMETERS + DESCRIPTION + Called by vos_close during general driver close procedure. BAP will clean up + all the internal resources. + + DEPENDENCIES + + PARAMETERS IN - pvosGCtx: pointer to the global vos context; a handle to BAP's - control block can be extracted from its context - + pvosGCtx: pointer to the global vos context; a handle to BAP's + control block can be extracted from its context + RETURN VALUE - The result code associated with performing the operation + The result code associated with performing the operation - VOS_STATUS_E_FAULT: pointer to BAP cb is NULL ; access would cause a page - fault - VOS_STATUS_SUCCESS: Everything is good :) + VOS_STATUS_E_FAULT: pointer to BAP cb is NULL ; access would cause a page + fault + VOS_STATUS_SUCCESS: Everything is good :) + + SIDE EFFECTS - SIDE EFFECTS - ============================================================================*/ -VOS_STATUS +VOS_STATUS WLANBAP_Close -( - v_PVOID_t pvosGCtx +( + v_PVOID_t pvosGCtx ) { - ptBtampContext pBtampCtx = NULL; + ptBtampContext pBtampCtx = NULL; /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ /*------------------------------------------------------------------------ Sanity check - Extract BAP control block + Extract BAP control block ------------------------------------------------------------------------*/ pBtampCtx = VOS_GET_BAP_CB(pvosGCtx); - if ( NULL == pBtampCtx ) + if ( NULL == pBtampCtx ) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "Invalid BAP pointer from pvosGCtx on WLANBAP_Close"); @@ -422,7 +422,7 @@ WLANBAP_Close } /*------------------------------------------------------------------------ - Cleanup BAP control block. + Cleanup BAP control block. ------------------------------------------------------------------------*/ VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "WLANBAP_Close"); WLANBAP_CleanCB(pBtampCtx, 1 /* empty queues/lists/pkts if any*/); @@ -430,58 +430,58 @@ WLANBAP_Close BSL_Deinit(pvosGCtx); #endif /*------------------------------------------------------------------------ - Free BAP context from VOSS global + Free BAP context from VOSS global ------------------------------------------------------------------------*/ vos_free_context(pvosGCtx, VOS_MODULE_ID_BAP, pBtampCtx); return VOS_STATUS_SUCCESS; }/* WLANBAP_Close */ /*---------------------------------------------------------------------------- - HDD interfaces - Per instance initialization + HDD interfaces - Per instance initialization ---------------------------------------------------------------------------*/ /*========================================================================== FUNCTION WLANBAP_GetNewHndl - DESCRIPTION - Called by HDD at driver open (BSL_Open). BAP will initialize + DESCRIPTION + Called by HDD at driver open (BSL_Open). BAP will initialize allocate a per-instance "file handle" equivalent for this specific - open call. - - There should only ever be one call to BSL_Open. Since + open call. + + There should only ever be one call to BSL_Open. Since the open app user is the BT stack. - - - DEPENDENCIES - - PARAMETERS + + + DEPENDENCIES + + PARAMETERS IN hBtampHandle: Handle to return btampHandle value in. - + RETURN VALUE - The result code associated with performing the operation + The result code associated with performing the operation - VOS_STATUS_E_FAULT: pointer to BAP cb is NULL ; access would cause a page - fault - VOS_STATUS_SUCCESS: Everything is good :) + VOS_STATUS_E_FAULT: pointer to BAP cb is NULL ; access would cause a page + fault + VOS_STATUS_SUCCESS: Everything is good :) + + SIDE EFFECTS - SIDE EFFECTS - ============================================================================*/ -VOS_STATUS +VOS_STATUS WLANBAP_GetNewHndl -( - ptBtampHandle *hBtampHandle /* Handle to return btampHandle value in */ +( + ptBtampHandle *hBtampHandle /* Handle to return btampHandle value in */ ) { - ptBtampContext btampContext = NULL; + ptBtampContext btampContext = NULL; /*------------------------------------------------------------------------ Sanity check params ------------------------------------------------------------------------*/ - if ( NULL == hBtampHandle) + if ( NULL == hBtampHandle) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "Invalid BAP handle pointer in WLANBAP_GetNewHndl"); @@ -490,19 +490,19 @@ WLANBAP_GetNewHndl #ifndef BTAMP_MULTIPLE_PHY_LINKS /*------------------------------------------------------------------------ - Sanity check the BAP control block pointer + Sanity check the BAP control block pointer ------------------------------------------------------------------------*/ - if ( NULL == gpBtampCtx ) + if ( NULL == gpBtampCtx ) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "Invalid BAP pointer in WLANBAP_GetNewHndl"); return VOS_STATUS_E_FAULT; } - //*hBtampHandle = (ptBtampHandle) &btampCtx; - /* return a pointer to the tBtampContext structure - allocated by VOS for us */ - *hBtampHandle = (ptBtampHandle) gpBtampCtx; - btampContext = gpBtampCtx; + //*hBtampHandle = (ptBtampHandle) &btampCtx; + /* return a pointer to the tBtampContext structure - allocated by VOS for us */ + *hBtampHandle = (ptBtampHandle) gpBtampCtx; + btampContext = gpBtampCtx; /* Update the MAC address and SSID if in case the Read Local AMP Assoc * Request is made before Create Physical Link creation. @@ -518,55 +518,55 @@ WLANBAP_GetNewHndl FUNCTION WLANBAP_ReleaseHndl - DESCRIPTION - Called by HDD at driver open (BSL_Close). BAP will reclaim (invalidate) + DESCRIPTION + Called by HDD at driver open (BSL_Close). BAP will reclaim (invalidate) the "file handle" passed into this call. - - - DEPENDENCIES - - PARAMETERS + + + DEPENDENCIES + + PARAMETERS IN btampHandle: btampHandle value to invalidate. - + RETURN VALUE - The result code associated with performing the operation + The result code associated with performing the operation - VOS_STATUS_E_FAULT: btampHandle is NULL ; access would cause a - page fault - VOS_STATUS_SUCCESS: Everything is good :) + VOS_STATUS_E_FAULT: btampHandle is NULL ; access would cause a + page fault + VOS_STATUS_SUCCESS: Everything is good :) + + SIDE EFFECTS - SIDE EFFECTS - ============================================================================*/ -VOS_STATUS +VOS_STATUS WLANBAP_ReleaseHndl -( - ptBtampHandle btampHandle /* btamp handle value to release */ +( + ptBtampHandle btampHandle /* btamp handle value to release */ ) { - /* obtain btamp Context */ - ptBtampContext btampContext = (ptBtampContext) btampHandle; + /* obtain btamp Context */ + ptBtampContext btampContext = (ptBtampContext) btampHandle; tHalHandle halHandle; eHalStatus halStatus = eHAL_STATUS_SUCCESS; /*------------------------------------------------------------------------ Sanity check params ------------------------------------------------------------------------*/ - if ( NULL == btampHandle) + if ( NULL == btampHandle) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "Invalid BAP handle value in WLANBAP_ReleaseHndl"); return VOS_STATUS_E_FAULT; } - /* JEZ081001: TODO: Major: */ + /* JEZ081001: TODO: Major: */ /* Check to see if any wireless associations are still active */ - /* ...if so, I have to call - * sme_RoamDisconnect(VOS_GET_HAL_CB(btampHandle->pvosGCtx), - * btampHandle->sessionId, - * eCSR_DISCONNECT_REASON_UNSPECIFIED); - * on all of them */ + /* ...if so, I have to call + * sme_RoamDisconnect(VOS_GET_HAL_CB(btampHandle->pvosGCtx), + * btampHandle->sessionId, + * eCSR_DISCONNECT_REASON_UNSPECIFIED); + * on all of them */ halHandle = VOS_GET_HAL_CB(btampContext->pvosGCtx); if(NULL == halHandle) @@ -578,7 +578,7 @@ WLANBAP_ReleaseHndl if( btampContext->isBapSessionOpen == TRUE ) { - halStatus = sme_CloseSession(halHandle, + halStatus = sme_CloseSession(halHandle, btampContext->sessionId, NULL, NULL); if(eHAL_STATUS_SUCCESS == halStatus) { @@ -586,55 +586,55 @@ WLANBAP_ReleaseHndl } } - /* release the btampHandle */ + /* release the btampHandle */ return VOS_STATUS_SUCCESS; }/* WLANBAP_ReleaseHndl */ /*---------------------------------------------------------------------------- - * Utility Function implementations + * Utility Function implementations * -------------------------------------------------------------------------*/ /*========================================================================== FUNCTION WLANBAP_CleanCB - DESCRIPTION + DESCRIPTION Clear out all fields in the BAP context. - - DEPENDENCIES - - PARAMETERS + + DEPENDENCIES + + PARAMETERS IN pBtampCtx: pointer to the BAP control block freeFlag: flag indicating whether to free any allocations. - + RETURN VALUE - The result code associated with performing the operation + The result code associated with performing the operation - VOS_STATUS_E_FAULT: pointer to BAP cb is NULL ; access would cause a page - fault - VOS_STATUS_SUCCESS: Everything is good :) + VOS_STATUS_E_FAULT: pointer to BAP cb is NULL ; access would cause a page + fault + VOS_STATUS_SUCCESS: Everything is good :) + + SIDE EFFECTS - SIDE EFFECTS - ============================================================================*/ -VOS_STATUS +VOS_STATUS WLANBAP_CleanCB -( +( ptBtampContext pBtampCtx, v_U32_t freeFlag // 0 /*do not empty*/); ) { v_U16_t i; /* Logical Link index */ tpBtampLogLinkCtx pLogLinkContext = NULL; - + /*------------------------------------------------------------------------ - Sanity check BAP control block + Sanity check BAP control block ------------------------------------------------------------------------*/ - if ( NULL == pBtampCtx ) + if ( NULL == pBtampCtx ) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "Invalid BAP pointer in WLANBAP_CleanCB"); @@ -653,17 +653,17 @@ WLANBAP_CleanCB // Initialize physical link state machine to DISCONNECTED state //pBtampCtx->bapPhysLinkMachine = BTAMPFSM_INSTANCEDATA_INIT; - + // Initialize physical link state machine to DISCONNECTED state - vos_mem_copy( + vos_mem_copy( &pBtampCtx->bapPhysLinkMachine, &bapPhysLinkMachineInitial, /* BTAMPFSM_INSTANCEDATA_INIT; */ sizeof( pBtampCtx->bapPhysLinkMachine)); - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "%s: Initializing State: %d", __func__, bapPhysLinkMachineInitial.stateVar); - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "%s: Initialized State: %d", __func__, pBtampCtx->bapPhysLinkMachine.stateVar); + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "%s: Initializing State: %d", __func__, bapPhysLinkMachineInitial.stateVar); + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "%s: Initialized State: %d", __func__, pBtampCtx->bapPhysLinkMachine.stateVar); - //VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "%s: btampContext value: %x", __func__, pBtampCtx); + //VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "%s: btampContext value: %x", __func__, pBtampCtx); #ifdef BAP_DEBUG /* Trace the tBtampCtx being passed in. */ VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, @@ -675,70 +675,70 @@ WLANBAP_CleanCB pBtampCtx->pAppHdl = NULL; // Per-app BSL context pBtampCtx->pHddHdl = NULL; // Per-app BSL context /* 8 bits of phy_link_handle identifies this association */ - pBtampCtx->phy_link_handle = 0; - pBtampCtx->channel = 0; - pBtampCtx->BAPDeviceRole = BT_RESPONDER; - pBtampCtx->ucSTAId = 0; + pBtampCtx->phy_link_handle = 0; + pBtampCtx->channel = 0; + pBtampCtx->BAPDeviceRole = BT_RESPONDER; + pBtampCtx->ucSTAId = 0; // gNeedPhysLinkCompEvent pBtampCtx->gNeedPhysLinkCompEvent = VOS_FALSE; - // gPhysLinkStatus + // gPhysLinkStatus pBtampCtx->gPhysLinkStatus = WLANBAP_STATUS_SUCCESS; // gDiscRequested pBtampCtx->gDiscRequested = VOS_FALSE; - // gDiscReason + // gDiscReason pBtampCtx->gDiscReason = WLANBAP_STATUS_SUCCESS; /* Connection Accept Timer interval*/ - pBtampCtx->bapConnectionAcceptTimerInterval = WLANBAP_CONNECTION_ACCEPT_TIMEOUT; + pBtampCtx->bapConnectionAcceptTimerInterval = WLANBAP_CONNECTION_ACCEPT_TIMEOUT; /* Link Supervision Timer interval*/ - pBtampCtx->bapLinkSupervisionTimerInterval = WLANBAP_LINK_SUPERVISION_TIMEOUT; + pBtampCtx->bapLinkSupervisionTimerInterval = WLANBAP_LINK_SUPERVISION_TIMEOUT; /* Logical Link Accept Timer interval*/ - pBtampCtx->bapLogicalLinkAcceptTimerInterval = WLANBAP_LOGICAL_LINK_ACCEPT_TIMEOUT; + pBtampCtx->bapLogicalLinkAcceptTimerInterval = WLANBAP_LOGICAL_LINK_ACCEPT_TIMEOUT; /* Best Effort Flush timer interval*/ - pBtampCtx->bapBEFlushTimerInterval = WLANBAP_BE_FLUSH_TIMEOUT; + pBtampCtx->bapBEFlushTimerInterval = WLANBAP_BE_FLUSH_TIMEOUT; // Include the associations MAC addresses - vos_mem_copy( - pBtampCtx->self_mac_addr, + vos_mem_copy( + pBtampCtx->self_mac_addr, pBtStaOwnMacAddr, /* Where do I get the current MAC address? */ - sizeof(pBtampCtx->self_mac_addr)); + sizeof(pBtampCtx->self_mac_addr)); - vos_mem_set( - pBtampCtx->peer_mac_addr, + vos_mem_set( + pBtampCtx->peer_mac_addr, sizeof(pBtampCtx->peer_mac_addr), - 0); + 0); // The array of logical links - pBtampCtx->current_log_link_index = 0; /* assigned mod 16 */ - pBtampCtx->total_log_link_index = 0; /* should never be >16 */ + pBtampCtx->current_log_link_index = 0; /* assigned mod 16 */ + pBtampCtx->total_log_link_index = 0; /* should never be >16 */ // Clear up the array of logical links - for (i = 0; i < WLANBAP_MAX_LOG_LINKS ; i++) + for (i = 0; i < WLANBAP_MAX_LOG_LINKS ; i++) { pLogLinkContext = &pBtampCtx->btampLogLinkCtx[i]; - pLogLinkContext->present = 0; + pLogLinkContext->present = 0; pLogLinkContext->uTxPktCompleted = 0; pLogLinkContext->log_link_handle = 0; } // Include the HDD BAP Shim Layer callbacks for Fetch, TxComp, and RxPkt - pBtampCtx->pfnBtampFetchPktCB = NULL; - pBtampCtx->pfnBtamp_STARxCB = NULL; - pBtampCtx->pfnBtampTxCompCB = NULL; - /* Implements the callback for ALL asynchronous events. */ - pBtampCtx->pBapHCIEventCB = NULL; - - /* Set the default for event mask */ - vos_mem_set( - pBtampCtx->event_mask_page_2, + pBtampCtx->pfnBtampFetchPktCB = NULL; + pBtampCtx->pfnBtamp_STARxCB = NULL; + pBtampCtx->pfnBtampTxCompCB = NULL; + /* Implements the callback for ALL asynchronous events. */ + pBtampCtx->pBapHCIEventCB = NULL; + + /* Set the default for event mask */ + vos_mem_set( + pBtampCtx->event_mask_page_2, sizeof(pBtampCtx->event_mask_page_2), - 0); + 0); - /* Set the default for location data. */ - pBtampCtx->btamp_Location_Data_Info.loc_options = 0x58; - /* Set the default data transfer mode */ + /* Set the default for location data. */ + pBtampCtx->btamp_Location_Data_Info.loc_options = 0x58; + /* Set the default data transfer mode */ pBtampCtx->ucDataTrafficMode = WLANBAP_FLOW_CONTROL_MODE_BLOCK_BASED; return VOS_STATUS_SUCCESS; @@ -748,55 +748,55 @@ WLANBAP_CleanCB FUNCTION WLANBAP_GetCtxFromStaId - DESCRIPTION + DESCRIPTION Called inside the BT-AMP PAL (BAP) layer whenever we need either the BSL context or the BTAMP context from the StaId. - - - DEPENDENCIES - - PARAMETERS + + + DEPENDENCIES + + PARAMETERS IN - ucSTAId: The StaId (used by TL, PE, and HAL) - + ucSTAId: The StaId (used by TL, PE, and HAL) + OUT - hBtampHandle: Handle (pointer to a pointer) to return the + hBtampHandle: Handle (pointer to a pointer) to return the btampHandle value in. hHddHdl: Handle to return the BSL context pointer in. - + RETURN VALUE - The result code associated with performing the operation + The result code associated with performing the operation - VOS_STATUS_E_FAULT: NULL pointer; access would cause a page fault - VOS_STATUS_SUCCESS: Everything is good :) + VOS_STATUS_E_FAULT: NULL pointer; access would cause a page fault + VOS_STATUS_SUCCESS: Everything is good :) + + SIDE EFFECTS - SIDE EFFECTS - ============================================================================*/ -VOS_STATUS +VOS_STATUS WLANBAP_GetCtxFromStaId -( +( v_U8_t ucSTAId, /* The StaId (used by TL, PE, and HAL) */ - ptBtampHandle *hBtampHandle, /* Handle to return per app btampHandle value in */ - ptBtampContext *hBtampContext, /* Handle to return per assoc btampContext value in */ + ptBtampHandle *hBtampHandle, /* Handle to return per app btampHandle value in */ + ptBtampContext *hBtampContext, /* Handle to return per assoc btampContext value in */ v_PVOID_t *hHddHdl /* Handle to return BSL context in */ ) { #ifndef BTAMP_MULTIPLE_PHY_LINKS - /* For now, we know there is only one application context */ - /* ...and only one physical link context */ - //*hBtampHandle = &((ptBtampContext) btampCtx); - //*hBtampHandle = &btampCtx; - *hBtampHandle = (v_VOID_t*)gpBtampCtx; - + /* For now, we know there is only one application context */ + /* ...and only one physical link context */ + //*hBtampHandle = &((ptBtampContext) btampCtx); + //*hBtampHandle = &btampCtx; + *hBtampHandle = (v_VOID_t*)gpBtampCtx; + //*hBtampContext = &btampCtx; *hBtampContext = gpBtampCtx; /* Handle to return BSL context in */ - //*hHddHdl = btampCtx.pHddHdl; - *hHddHdl = gpBtampCtx->pHddHdl; + //*hHddHdl = btampCtx.pHddHdl; + *hHddHdl = gpBtampCtx->pHddHdl; return VOS_STATUS_SUCCESS; #else // defined(BTAMP_MULTIPLE_PHY_LINKS) @@ -808,49 +808,49 @@ WLANBAP_GetCtxFromStaId FUNCTION WLANBAP_GetStaIdFromLinkCtx - DESCRIPTION + DESCRIPTION Called inside the BT-AMP PAL (BAP) layer whenever we need the StaId (or hHddHdl) from the BTAMP context and phy_link_handle. - - - DEPENDENCIES - - PARAMETERS + + + DEPENDENCIES + + PARAMETERS IN - hBtampHandle: Handle (pointer to a pointer) to return the + hBtampHandle: Handle (pointer to a pointer) to return the btampHandle value in. - phy_link_handle: physical link handle value. Unique per assoc. - + phy_link_handle: physical link handle value. Unique per assoc. + OUT - pucSTAId: The StaId (used by TL, PE, and HAL) + pucSTAId: The StaId (used by TL, PE, and HAL) hHddHdl: Handle to return the BSL context pointer in. - + RETURN VALUE - The result code associated with performing the operation + The result code associated with performing the operation + + VOS_STATUS_E_FAULT: NULL pointer; access would cause a page fault + VOS_STATUS_SUCCESS: Everything is good :) - VOS_STATUS_E_FAULT: NULL pointer; access would cause a page fault - VOS_STATUS_SUCCESS: Everything is good :) + SIDE EFFECTS - SIDE EFFECTS - ============================================================================*/ -VOS_STATUS +VOS_STATUS WLANBAP_GetStaIdFromLinkCtx -( - ptBtampHandle btampHandle, /* btampHandle value in */ +( + ptBtampHandle btampHandle, /* btampHandle value in */ v_U8_t phy_link_handle, /* phy_link_handle value in */ v_U8_t *pucSTAId, /* The StaId (used by TL, PE, and HAL) */ v_PVOID_t *hHddHdl /* Handle to return BSL context */ ) { #ifndef BTAMP_MULTIPLE_PHY_LINKS - ptBtampContext pBtampCtx = (ptBtampContext) btampHandle; - + ptBtampContext pBtampCtx = (ptBtampContext) btampHandle; + /*------------------------------------------------------------------------ Sanity check params ------------------------------------------------------------------------*/ - if ( NULL == pBtampCtx) + if ( NULL == pBtampCtx) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "Invalid BAP handle value in %s", __func__); @@ -858,13 +858,13 @@ WLANBAP_GetStaIdFromLinkCtx } /* Since there is only one physical link...we have stored all - * the physical link specific context in the application context - */ + * the physical link specific context in the application context + */ /* The StaId (used by TL, PE, and HAL) */ - *pucSTAId = pBtampCtx->ucSTAId; + *pucSTAId = pBtampCtx->ucSTAId; /* Handle to return BSL context */ - *hHddHdl = pBtampCtx->pHddHdl; + *hHddHdl = pBtampCtx->pHddHdl; return VOS_STATUS_SUCCESS; #else // defined(BTAMP_MULTIPLE_PHY_LINKS) @@ -876,39 +876,39 @@ WLANBAP_GetStaIdFromLinkCtx FUNCTION WLANBAP_CreateNewPhyLinkCtx - DESCRIPTION + DESCRIPTION Called in order to create (or update) a BAP Physical Link "context" - - - DEPENDENCIES - - PARAMETERS + + + DEPENDENCIES + + PARAMETERS IN btampHandle: BAP app context handle - phy_link_handle: phy_link_handle from the Command + phy_link_handle: phy_link_handle from the Command pHddHdl: BSL passes in its specific context - + OUT - hBtampContext: Handle (pointer to a pointer) to return the + hBtampContext: Handle (pointer to a pointer) to return the per "Phy Link" ptBtampContext value in. - + RETURN VALUE - The result code associated with performing the operation + The result code associated with performing the operation + + VOS_STATUS_E_FAULT: NULL pointer; access would cause a page fault + VOS_STATUS_SUCCESS: Everything is good :) - VOS_STATUS_E_FAULT: NULL pointer; access would cause a page fault - VOS_STATUS_SUCCESS: Everything is good :) + SIDE EFFECTS - SIDE EFFECTS - ============================================================================*/ -VOS_STATUS +VOS_STATUS WLANBAP_CreateNewPhyLinkCtx -( +( ptBtampHandle btampHandle, v_U8_t phy_link_handle, /* I get phy_link_handle from the Command */ v_PVOID_t pHddHdl, /* BSL passes in its specific context */ - ptBtampContext *hBtampContext, /* Handle to return per assoc btampContext value in */ + ptBtampContext *hBtampContext, /* Handle to return per assoc btampContext value in */ tWLAN_BAPRole BAPDeviceRole ) { @@ -938,24 +938,24 @@ WLANBAP_CreateNewPhyLinkCtx /*------------------------------------------------------------------------ Now configure the roaming profile links. To SSID and bssid. ------------------------------------------------------------------------*/ - // We have room for two SSIDs. - pBtampCtx->csrRoamProfile.SSIDs.numOfSSIDs = 1; // This is true for now. - pBtampCtx->csrRoamProfile.SSIDs.SSIDList = pBtampCtx->SSIDList; //Array of two + // We have room for two SSIDs. + pBtampCtx->csrRoamProfile.SSIDs.numOfSSIDs = 1; // This is true for now. + pBtampCtx->csrRoamProfile.SSIDs.SSIDList = pBtampCtx->SSIDList; //Array of two pBtampCtx->csrRoamProfile.SSIDs.SSIDList[0].SSID.length = 0; pBtampCtx->csrRoamProfile.SSIDs.SSIDList[0].handoffPermitted = VOS_FALSE; pBtampCtx->csrRoamProfile.SSIDs.SSIDList[0].ssidHidden = VOS_FALSE; - pBtampCtx->csrRoamProfile.BSSIDs.numOfBSSIDs = 1; // This is true for now. - pBtampCtx->csrRoamProfile.BSSIDs.bssid = &pBtampCtx->bssid; + pBtampCtx->csrRoamProfile.BSSIDs.numOfBSSIDs = 1; // This is true for now. + pBtampCtx->csrRoamProfile.BSSIDs.bssid = &pBtampCtx->bssid; // Now configure the auth type in the roaming profile. To open. - //pBtampCtx->csrRoamProfile.AuthType = eCSR_AUTH_TYPE_OPEN_SYSTEM; // open is the default - //pBtampCtx->csrRoamProfile.negotiatedAuthType = eCSR_AUTH_TYPE_OPEN_SYSTEM; // open is the default - pBtampCtx->csrRoamProfile.negotiatedAuthType = eCSR_AUTH_TYPE_RSN_PSK; - pBtampCtx->csrRoamProfile.negotiatedUCEncryptionType = eCSR_ENCRYPT_TYPE_AES; + //pBtampCtx->csrRoamProfile.AuthType = eCSR_AUTH_TYPE_OPEN_SYSTEM; // open is the default + //pBtampCtx->csrRoamProfile.negotiatedAuthType = eCSR_AUTH_TYPE_OPEN_SYSTEM; // open is the default + pBtampCtx->csrRoamProfile.negotiatedAuthType = eCSR_AUTH_TYPE_RSN_PSK; + pBtampCtx->csrRoamProfile.negotiatedUCEncryptionType = eCSR_ENCRYPT_TYPE_AES; pBtampCtx->phy_link_handle = phy_link_handle; - /* For now, we know there is only one physical link context */ + /* For now, we know there is only one physical link context */ //*hBtampContext = &btampCtx; pBtampCtx->pHddHdl = pHddHdl; @@ -974,32 +974,32 @@ WLANBAP_CreateNewPhyLinkCtx FUNCTION WLANBAP_UpdatePhyLinkCtxStaId - DESCRIPTION + DESCRIPTION Called to update the STAId value associated with Physical Link "context" - - - DEPENDENCIES - - PARAMETERS + + + DEPENDENCIES + + PARAMETERS IN pBtampContext: ptBtampContext to update. - ucSTAId: The StaId (used by TL, PE, and HAL) - - + ucSTAId: The StaId (used by TL, PE, and HAL) + + RETURN VALUE - The result code associated with performing the operation + The result code associated with performing the operation + + VOS_STATUS_E_FAULT: NULL pointer; access would cause a page fault + VOS_STATUS_SUCCESS: Everything is good :) - VOS_STATUS_E_FAULT: NULL pointer; access would cause a page fault - VOS_STATUS_SUCCESS: Everything is good :) + SIDE EFFECTS - SIDE EFFECTS - ============================================================================*/ -VOS_STATUS +VOS_STATUS WLANBAP_UpdatePhyLinkCtxStaId -( - ptBtampContext pBtampContext, /* btampContext value in */ +( + ptBtampContext pBtampContext, /* btampContext value in */ v_U8_t ucSTAId ) { @@ -1008,7 +1008,7 @@ WLANBAP_UpdatePhyLinkCtxStaId /*------------------------------------------------------------------------ Sanity check params ------------------------------------------------------------------------*/ - if ( NULL == pBtampContext) + if ( NULL == pBtampContext) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "Invalid BAP handle value in %s", __func__); @@ -1016,7 +1016,7 @@ WLANBAP_UpdatePhyLinkCtxStaId } /* The StaId (used by TL, PE, and HAL) */ - pBtampContext->ucSTAId = ucSTAId; + pBtampContext->ucSTAId = ucSTAId; return VOS_STATUS_SUCCESS; #else // defined(BTAMP_MULTIPLE_PHY_LINKS) @@ -1024,48 +1024,48 @@ WLANBAP_UpdatePhyLinkCtxStaId #endif //BTAMP_MULTIPLE_PHY_LINKS }/* WLANBAP_UpdatePhyLinkCtxStaId */ -v_U8_t +v_U8_t bapAllocNextLogLinkIndex -( - ptBtampContext pBtampContext, /* Pointer to the per assoc btampContext value */ +( + ptBtampContext pBtampContext, /* Pointer to the per assoc btampContext value */ v_U8_t phy_link_handle /* I get phy_link_handle from the Command */ ) { - return ++(pBtampContext->current_log_link_index) % WLANBAP_MAX_LOG_LINKS; + return ++(pBtampContext->current_log_link_index) % WLANBAP_MAX_LOG_LINKS; }/* bapAllocNextLogLinkIndex */ /*========================================================================== FUNCTION WLANBAP_CreateNewLogLinkCtx - DESCRIPTION + DESCRIPTION Called in order to allocate a BAP Logical Link "context" and "index" - - - DEPENDENCIES - - PARAMETERS + + + DEPENDENCIES + + PARAMETERS IN pBtampContext: Pointer to the ptBtampContext value in. - phy_link_handle: phy_link_handle involved - + phy_link_handle: phy_link_handle involved + OUT - pLog_link_handle: return the log_link_handle here - + pLog_link_handle: return the log_link_handle here + RETURN VALUE - The result code associated with performing the operation + The result code associated with performing the operation - VOS_STATUS_E_FAULT: NULL pointer; access would cause a page fault - VOS_STATUS_SUCCESS: Everything is good :) + VOS_STATUS_E_FAULT: NULL pointer; access would cause a page fault + VOS_STATUS_SUCCESS: Everything is good :) + + SIDE EFFECTS - SIDE EFFECTS - ============================================================================*/ -VOS_STATUS +VOS_STATUS WLANBAP_CreateNewLogLinkCtx -( - ptBtampContext pBtampContext, /* Pointer to the per assoc btampContext value */ +( + ptBtampContext pBtampContext, /* Pointer to the per assoc btampContext value */ v_U8_t phy_link_handle, /* I get phy_link_handle from the Command */ v_U8_t tx_flow_spec[18], v_U8_t rx_flow_spec[18], @@ -1081,9 +1081,9 @@ WLANBAP_CreateNewLogLinkCtx /*------------------------------------------------------------------------ For now, allocate the logical links serially. ------------------------------------------------------------------------*/ - i = pBtampContext->current_log_link_index + i = pBtampContext->current_log_link_index = bapAllocNextLogLinkIndex(pBtampContext, phy_link_handle); - pBtampContext->total_log_link_index++; + pBtampContext->total_log_link_index++; *pLog_link_handle = (i << 8) + ( v_U16_t ) phy_link_handle ; /* Return the logical link index here */ VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO, @@ -1092,7 +1092,7 @@ WLANBAP_CreateNewLogLinkCtx /*------------------------------------------------------------------------ Evaluate the Tx and Rx Flow specification for this logical link. ------------------------------------------------------------------------*/ - // Currently we only support flow specs with service types of BE (0x01) + // Currently we only support flow specs with service types of BE (0x01) #ifdef BAP_DEBUG /* Trace the tBtampCtx being passed in. */ @@ -1123,7 +1123,7 @@ WLANBAP_CreateNewLogLinkCtx */ pLogLinkContext->log_link_handle = *pLog_link_handle; - // Mark this entry as OCCUPIED + // Mark this entry as OCCUPIED pLogLinkContext->present = VOS_TRUE; // Now initialize the Logical Link context pLogLinkContext->btampAC = 1; @@ -1142,29 +1142,29 @@ WLANBAP_CreateNewLogLinkCtx FUNCTION WLANBAP_pmcFullPwrReqCB - DESCRIPTION - Callback provide to PMC in the pmcRequestFullPower API. - - - DEPENDENCIES - - PARAMETERS + DESCRIPTION + Callback provide to PMC in the pmcRequestFullPower API. + + + DEPENDENCIES + + PARAMETERS IN - callbackContext: The user passed in a context to identify - status: The halStatus - - + callbackContext: The user passed in a context to identify + status: The halStatus + + RETURN VALUE None - SIDE EFFECTS - + SIDE EFFECTS + ============================================================================*/ -void +void WLANBAP_pmcFullPwrReqCB -( - void *callbackContext, +( + void *callbackContext, eHalStatus status ) { @@ -1176,26 +1176,26 @@ WLANBAP_pmcFullPwrReqCB FUNCTION WLANBAP_ReadMacConfig - DESCRIPTION + DESCRIPTION This function sets the MAC config (Address and SSID to BT-AMP context - - DEPENDENCIES - - PARAMETERS - - pvosGCtx: pointer to the global vos context; a handle to BAP's - control block can be extracted from its context - + + DEPENDENCIES + + PARAMETERS + + pvosGCtx: pointer to the global vos context; a handle to BAP's + control block can be extracted from its context + RETURN VALUE None - SIDE EFFECTS - + SIDE EFFECTS + ============================================================================*/ void WLANBAP_ReadMacConfig -( - ptBtampContext pBtampCtx +( + ptBtampContext pBtampCtx ) { tANI_U32 len = WNI_CFG_BSSID_LEN; @@ -1204,7 +1204,7 @@ WLANBAP_ReadMacConfig /*------------------------------------------------------------------------ Temporary method to get the self MAC address ------------------------------------------------------------------------*/ - if (NULL == pBtampCtx) + if (NULL == pBtampCtx) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "pBtampCtx is NULL in %s", __func__); @@ -1213,7 +1213,7 @@ WLANBAP_ReadMacConfig } pMac = (tHalHandle)vos_get_context( VOS_MODULE_ID_SME, pBtampCtx->pvosGCtx); - if (NULL == pMac) + if (NULL == pMac) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "pMac is NULL in %s", __func__); @@ -1233,55 +1233,55 @@ WLANBAP_ReadMacConfig /* Form the SSID from Mac address */ VOS_SNPRINTF( pBtStaOwnSsid, WLAN_BAP_SSID_MAX_LEN, "AMP-%02x-%02x-%02x-%02x-%02x-%02x", - pBtStaOwnMacAddr[0], pBtStaOwnMacAddr[1], pBtStaOwnMacAddr[2], + pBtStaOwnMacAddr[0], pBtStaOwnMacAddr[1], pBtStaOwnMacAddr[2], pBtStaOwnMacAddr[3], pBtStaOwnMacAddr[4], pBtStaOwnMacAddr[5]); /*------------------------------------------------------------------------ Set the MAC address for this instance ------------------------------------------------------------------------*/ - vos_mem_copy( - pBtampCtx->self_mac_addr, + vos_mem_copy( + pBtampCtx->self_mac_addr, pBtStaOwnMacAddr, - sizeof(pBtampCtx->self_mac_addr)); - + sizeof(pBtampCtx->self_mac_addr)); + /*------------------------------------------------------------------------ Set our SSID value ------------------------------------------------------------------------*/ - pBtampCtx->ownSsidLen = 21; + pBtampCtx->ownSsidLen = 21; vos_mem_copy( - pBtampCtx->ownSsid, + pBtampCtx->ownSsid, pBtStaOwnSsid, - pBtampCtx->ownSsidLen); + pBtampCtx->ownSsidLen); } /*========================================================================== FUNCTION WLANBAP_NeedBTCoexPriority - DESCRIPTION + DESCRIPTION This function will cause a message to be sent to BTC firmware if a change in priority has occurred. (From AMP's point-of-view.) - DEPENDENCIES + DEPENDENCIES - PARAMETERS + PARAMETERS + + pvosGCtx: pointer to the global vos context; a handle to HAL's + control block can be extracted from its context - pvosGCtx: pointer to the global vos context; a handle to HAL's - control block can be extracted from its context - RETURN VALUE None - SIDE EFFECTS - + SIDE EFFECTS + ============================================================================*/ // Global static int gBapCoexPriority; void WLANBAP_NeedBTCoexPriority -( - ptBtampContext pBtampCtx, +( + ptBtampContext pBtampCtx, v_U32_t needCoexPriority ) { @@ -1296,9 +1296,9 @@ WLANBAP_NeedBTCoexPriority // Is re-entrancy protection needed for this? if (needCoexPriority != gBapCoexPriority) { - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "Calling %s with needCoexPriority=%d.", __func__, needCoexPriority); - + gBapCoexPriority = needCoexPriority; switch ( needCoexPriority) { @@ -1336,35 +1336,35 @@ WLANBAP_NeedBTCoexPriority FUNCTION WLANBAP_RxCallback - DESCRIPTION + DESCRIPTION This function is called by TL call this function for all frames except for Data frames - - DEPENDENCIES - - PARAMETERS - pvosGCtx: pointer to the global vos context; a handle to BAP's + DEPENDENCIES + + PARAMETERS + + pvosGCtx: pointer to the global vos context; a handle to BAP's control block can be extracted from its context pPacket Vos packet frameType Frame type - + RETURN VALUE None - SIDE EFFECTS - + SIDE EFFECTS + ============================================================================*/ VOS_STATUS WLANBAP_RxCallback ( - v_PVOID_t pvosGCtx, + v_PVOID_t pvosGCtx, vos_pkt_t *pPacket, WLANTL_BAPFrameEnumType frameType ) { - ptBtampContext pBtampCtx = NULL; + ptBtampContext pBtampCtx = NULL; pBtampCtx = VOS_GET_BAP_CB(pvosGCtx); - if ( NULL == pBtampCtx ) + if ( NULL == pBtampCtx ) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "Invalid BAP pointer from pvosGCtx on WLANBAP_Start"); diff --git a/CORE/BAP/src/bapRsn8021xAuthFsm.c b/CORE/BAP/src/bapRsn8021xAuthFsm.c index 07037ce00dbd..9d67cd899f87 100644 --- a/CORE/BAP/src/bapRsn8021xAuthFsm.c +++ b/CORE/BAP/src/bapRsn8021xAuthFsm.c @@ -60,7 +60,7 @@ #define INITIALIZE 2 #define AUTHENTICATION 3 #define AUTHENTICATION_2 4 -#define GET_PSK 5 +#define GET_PSK 5 #define GET_EAP_KEY 6 #define PTK_START 7 #define PTK_INIT_NEGO 8 @@ -81,27 +81,27 @@ static v_U8_t aniSsmIeRsnOui[] = ANI_SSM_IE_RSN_OUI; * Static functions in this module **************************************/ -static +static int zeroOutPtk(tAuthRsnFsm *fsm); -static +static int stopAllTimers(tAuthRsnFsm *fsm); static -int checkMic(tAuthRsnFsm *fsm, +int checkMic(tAuthRsnFsm *fsm, tAniEapolKeyAvailEventData *data); -static -int checkLocalReplayCounter(tAuthRsnFsm *fsm, +static +int checkLocalReplayCounter(tAuthRsnFsm *fsm, tAniEapolKeyAvailEventData *data); -static -int checkPeerReplayCounter(tAuthRsnFsm *fsm, +static +int checkPeerReplayCounter(tAuthRsnFsm *fsm, tAniEapolKeyAvailEventData *data); static int checkInfoElement(tAuthRsnFsm *fsm, tAniEapolKeyAvailEventData *data); static -int derivePtk(tAuthRsnFsm *fsm, +int derivePtk(tAuthRsnFsm *fsm, tAniEapolKeyAvailEventData *data); @@ -156,7 +156,7 @@ authRsnFsmInit(tAuthRsnFsmConsts *constsIn) * FUNCTION * Allocates and initializes the state of an RSN key FSM instance for * the given STA context. - * + * * @parm staCtx the STA context whose instance is being created * @param pskBased pass in eANI_BOOLEAN_TRUE is this STA is to be * authenticated based on a pre-shared key as opposed to EAP. @@ -185,7 +185,7 @@ authRsnFsmCreate(tBtampContext *ctx) // Allocate the station context fsm->staCtx = (tStaContext *)vos_mem_malloc( sizeof(tStaContext) ); - if (fsm->staCtx == NULL) + if (fsm->staCtx == NULL) { retVal = ANI_E_MALLOC_FAILED; VOS_ASSERT( 0 ); @@ -193,7 +193,7 @@ authRsnFsmCreate(tBtampContext *ctx) } // Clear out the station context vos_mem_zero( fsm->staCtx, sizeof(tStaContext) ); - + fsm->ctx = ctx; fsm->staCtx->authRsnFsm = fsm; //Only support CCMP @@ -216,14 +216,14 @@ authRsnFsmCreate(tBtampContext *ctx) retVal = aniAsfPacketAllocateExplicit(&fsm->lastEapol, RSN_MAX_PACKET_SIZE, EAPOL_TX_HEADER_SIZE ); - if (retVal != ANI_OK) + if (retVal != ANI_OK) { VOS_ASSERT( 0 ); goto error; } aniAsfPacketAllocate(&fsm->staCtx->pmk); - if (fsm->staCtx->pmk == NULL) + if (fsm->staCtx->pmk == NULL) { retVal = ANI_E_MALLOC_FAILED; VOS_ASSERT( 0 ); @@ -233,7 +233,7 @@ authRsnFsmCreate(tBtampContext *ctx) aniAsfPacketAllocateExplicit(&fsm->staCtx->ieSta, RSN_IE_MAX_PACKET_SIZE, RSN_IE_HEADER_SIZE ); - if (fsm->staCtx->ieSta == NULL) + if (fsm->staCtx->ieSta == NULL) { retVal = ANI_E_MALLOC_FAILED; VOS_ASSERT( 0 ); @@ -260,7 +260,7 @@ authRsnFsmCreate(tBtampContext *ctx) authRsnFsmFree(ctx); return retVal; - + } /** @@ -269,7 +269,7 @@ authRsnFsmCreate(tBtampContext *ctx) * FUNCTION * Frees a previously allocated RSN Key FSM in a STA context. If the * RSN Key FSM is not yet allocated, then this is an error. - * + * * @param ctx the STA context whose FSM instance is to be freed * * @return ANI_OK if the operation succeeds @@ -285,8 +285,8 @@ authRsnFsmFree(tBtampContext *ctx) { vos_crypto_deinit( fsm->cryptHandle ); } - - bapRsnClearTxRxCallbacks(); + + bapRsnClearTxRxCallbacks(); if ( fsm->staCtx ) { @@ -297,9 +297,9 @@ authRsnFsmFree(tBtampContext *ctx) if ( VOS_TIMER_STATE_UNUSED != fsm->msg4Timer.state ) vos_timer_destroy( &fsm->msg4Timer ); if (fsm->lastEapol) - { + { aniAsfPacketFree(fsm->lastEapol); - fsm->lastEapol = NULL; + fsm->lastEapol = NULL; } if( fsm->staCtx ) @@ -310,7 +310,7 @@ authRsnFsmFree(tBtampContext *ctx) fsm->staCtx->pmk = NULL; } vos_mem_free(fsm->staCtx); - fsm->staCtx = NULL; + fsm->staCtx = NULL; } vos_mem_zero( fsm, sizeof(tAuthRsnFsm) ); @@ -323,7 +323,7 @@ authRsnFsmFree(tBtampContext *ctx) * * FUNCTION * Passes an event to the RSN key FSM instance for immediate processing. - * + * * @param fsm the RSN Key FSM instance * @param eventId the AAG event to process * @param arg an optional argument for this event @@ -354,7 +354,7 @@ authRsnFsmProcessEvent(tAuthRsnFsm *fsm, tRsnFsmEvent eventId, void *arg) fsm->integFailed = eANI_BOOLEAN_TRUE; break; default: - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "Unknown event for Auth RSN Key Fsm: %d\n", eventId); VOS_ASSERT( 0 ); return ANI_E_ILLEGAL_ARG; @@ -370,7 +370,7 @@ authRsnFsmProcessEvent(tAuthRsnFsm *fsm, tRsnFsmEvent eventId, void *arg) int authRsnAuthStartEventHandler(tAuthRsnFsm *fsm) { - static v_U8_t btampStaRSNIE[] = {0x30, 0x14, 0x01, 0x00, 0x00, 0x0f, 0xac, 0x04, 0x01, 0x00, + static v_U8_t btampStaRSNIE[] = {0x30, 0x14, 0x01, 0x00, 0x00, 0x0f, 0xac, 0x04, 0x01, 0x00, 0x00, 0x0f, 0xac, 0x04, 0x01, 0x00, 0x00, 0x0f, 0xac, 0x02, 0x00, 0x00 }; // Copy required info vos_mem_copy( &fsm->staCtx->authMac, fsm->ctx->self_mac_addr, 6); @@ -398,8 +398,8 @@ gotoStateInit(tAuthRsnFsm *fsm) fsm->currentState = INITIALIZE; // TODO: Move this to a global position which applies to WEP as - // well - //initGlobalKeys = eANI_BOOLEAN_FALSE; + // well + //initGlobalKeys = eANI_BOOLEAN_FALSE; fsm->authReq = eANI_BOOLEAN_FALSE; fsm->eapolAvail = eANI_BOOLEAN_FALSE; @@ -410,9 +410,9 @@ gotoStateInit(tAuthRsnFsm *fsm) // Create two replay counter's..one for our requests, and another // for STA's requests. Initialize the first one randomly. - aniSsmReplayCtrCreate(fsm->cryptHandle, &fsm->staCtx->localReplayCtr, + aniSsmReplayCtrCreate(fsm->cryptHandle, &fsm->staCtx->localReplayCtr, ANI_EAPOL_KEY_RSN_RSC_SIZE, 0); - aniSsmReplayCtrCreate(fsm->cryptHandle, &fsm->staCtx->peerReplayCtr, + aniSsmReplayCtrCreate(fsm->cryptHandle, &fsm->staCtx->peerReplayCtr, ANI_EAPOL_KEY_RSN_RSC_SIZE, 0); return ANI_OK; @@ -458,9 +458,9 @@ gotoStateGetPsk(tAuthRsnFsm *fsm) fsm->currentState = GET_PSK; fsm->numTries = 0; - + checkTransition(fsm, NULL); - + return ANI_OK; } @@ -474,8 +474,8 @@ gotoStatePtkStart(tAuthRsnFsm *fsm) fsm->currentState = PTK_START; // Create a new packet if we don't have one to retransmit - //if (aniAsfPacketGetLen(fsm->lastEapol) == 0) -#if 0 + //if (aniAsfPacketGetLen(fsm->lastEapol) == 0) +#if 0 if( fsm->lastEapol ) { aniAsfPacketFree( fsm->lastEapol ); @@ -484,20 +484,20 @@ gotoStatePtkStart(tAuthRsnFsm *fsm) retVal = aniAsfPacketAllocateExplicit(&fsm->lastEapol, RSN_MAX_PACKET_SIZE, EAPOL_TX_HEADER_SIZE ); -#endif - aniAsfPacketEmptyExplicit(fsm->lastEapol, +#endif + aniAsfPacketEmptyExplicit(fsm->lastEapol, EAPOL_TX_HEADER_SIZE); //} - // if (1) + // if (1) //{ vos_mem_zero( &txDesc, sizeof(txDesc) ); // The Key Information bits... - if (fsm->staCtx->pwCipherType == eCSR_ENCRYPT_TYPE_AES) + if (fsm->staCtx->pwCipherType == eCSR_ENCRYPT_TYPE_AES) { txDesc.info.keyDescVers = ANI_EAPOL_KEY_DESC_VERS_AES; - } + } else { return ANI_E_ILLEGAL_ARG; } @@ -521,11 +521,11 @@ gotoStatePtkStart(tAuthRsnFsm *fsm) return retVal; } #if 0 - } + } else { retransmit = eANI_BOOLEAN_TRUE; } -#endif +#endif if( VOS_IS_STATUS_SUCCESS( bapRsnSendEapolFrame( fsm->ctx->pvosGCtx, fsm->lastEapol ) ) ) { @@ -550,7 +550,7 @@ gotoStatePtkInitNego(tAuthRsnFsm *fsm, void *arg) // new packet fsm->numTries = 0; - aniAsfPacketEmptyExplicit(fsm->lastEapol, + aniAsfPacketEmptyExplicit(fsm->lastEapol, EAPOL_TX_HEADER_SIZE); checkTransition(fsm, arg); @@ -565,7 +565,7 @@ getRsnIeFromAdvertizedIes(tAuthRsnFsm *fsm, v_U8_t **rsnIe) int retVal = ANI_E_ILLEGAL_ARG; v_U8_t *ptr = fsm->advertizedRsnIe; - if (*ptr == ANI_SSM_IE_RSN_ELEM_ID) + if (*ptr == ANI_SSM_IE_RSN_ELEM_ID) { retVal = *(ptr + 1) + 2; // The L field from the TLV + 2B TL *rsnIe = ptr; @@ -576,7 +576,7 @@ getRsnIeFromAdvertizedIes(tAuthRsnFsm *fsm, v_U8_t **rsnIe) // Use this only with trusted IE like the one we generated locally static void -addPad( +addPad( v_U8_t *dataBytes, int dataLen, int padLen) @@ -586,12 +586,12 @@ addPad( // The first byte of padding is 0xdd. The rest are 0x00's // See 802.11i section 8.5.2 subsection "Key Data Encapsulation" - for ( i=dataLen ; i < dataLen+padLen; i++) + for ( i=dataLen ; i < dataLen+padLen; i++) { - if ( i == dataLen ) + if ( i == dataLen ) { dataBytes[i] = 0xdd; - } + } else { dataBytes[i] = 0x00; } @@ -663,7 +663,7 @@ aagAppendGroupKeyForRsn(tAniPacket *packet) // Obtain the position for the length aniAsfPacketGetBytesFromTail(packet, &lenPtr); - // Write out a dummy length - we'll fill this in later. It will be + // Write out a dummy length - we'll fill this in later. It will be // 6 bytes more than the length of the GTK retVal = aniAsfPacketAppend8(packet, 0); //CHECK_NO_ERROR(retVal); @@ -675,7 +675,7 @@ aagAppendGroupKeyForRsn(tAniPacket *packet) // Indicate that the key type is group key retVal = aniAsfPacketAppend8(packet, ANI_SSM_IE_RSN_GROUP_KEY_DATA_ENCAPS_ID); //CHECK_NO_ERROR(retVal); - + // Copy the key-id to the first two bits of the next byte // Copy the Tx bit the third bit of the same byte // (Here, I assume the Group Key is to be used for both STA Tx and Rx) @@ -691,7 +691,7 @@ aagAppendGroupKeyForRsn(tAniPacket *packet) // Copy the real key bytes retVal = aniAsfPacketAppendBuffer(packet, groupKeyBytes, groupKeyLen); //CHECK_NO_ERROR(retVal); - + // Calculate and enter the length of the entire encoding aniAsfPacketGetBytesFromTail(packet, &endPtr); *lenPtr = endPtr - (lenPtr + 1) ; // subtract one to avoid tail @@ -723,7 +723,7 @@ gotoStatePtkInitNegoTx(tAuthRsnFsm *fsm) fsm->msg4TimeOut = VOS_FALSE; fsm->currentState = PTK_INIT_NEGO_TX ; - if (keyData == NULL) + if (keyData == NULL) { // Allocate the packet the first time around that you enter retVal = aniAsfPacketAllocateExplicit(&keyData, 1024, 10); @@ -731,7 +731,7 @@ gotoStatePtkInitNegoTx(tAuthRsnFsm *fsm) { return retVal; } - } + } else { // Just empty out the packet aniAsfPacketEmptyExplicit(keyData, 10); @@ -740,7 +740,7 @@ gotoStatePtkInitNegoTx(tAuthRsnFsm *fsm) do { // Create a new EAPOL frame if we don't have one to retransmit - //if (aniAsfPacketGetLen(fsm->lastEapol) == 0) + //if (aniAsfPacketGetLen(fsm->lastEapol) == 0) #if 0 if( fsm->lastEapol ) { @@ -750,21 +750,21 @@ gotoStatePtkInitNegoTx(tAuthRsnFsm *fsm) retVal = aniAsfPacketAllocateExplicit(&fsm->lastEapol, RSN_MAX_PACKET_SIZE, EAPOL_TX_HEADER_SIZE ); -#endif - aniAsfPacketEmptyExplicit(fsm->lastEapol, +#endif + aniAsfPacketEmptyExplicit(fsm->lastEapol, EAPOL_TX_HEADER_SIZE); // } - if (1) + if (1) { vos_mem_zero( &txDesc, sizeof(txDesc) ); // The Key Information bits... - if (fsm->staCtx->pwCipherType == eCSR_ENCRYPT_TYPE_AES) + if (fsm->staCtx->pwCipherType == eCSR_ENCRYPT_TYPE_AES) { txDesc.info.keyDescVers = ANI_EAPOL_KEY_DESC_VERS_AES; - } + } else { txDesc.info.keyDescVers = ANI_EAPOL_KEY_DESC_VERS_RC4; } @@ -791,7 +791,7 @@ gotoStatePtkInitNegoTx(tAuthRsnFsm *fsm) if( !ANI_IS_STATUS_SUCCESS( retVal ) ) break; groupKeyLen = aniAsfPacketGetBytes(keyData, &groupKeyBytes); - if( !ANI_IS_STATUS_SUCCESS( groupKeyLen ) ) + if( !ANI_IS_STATUS_SUCCESS( groupKeyLen ) ) { retVal = ANI_E_FAILED; break; @@ -800,7 +800,7 @@ gotoStatePtkInitNegoTx(tAuthRsnFsm *fsm) txDesc.info.secureFlag = eANI_BOOLEAN_TRUE; txDesc.info.encKeyDataFlag = eANI_BOOLEAN_TRUE; - if ( fsm->staCtx->pwCipherType == eCSR_ENCRYPT_TYPE_AES ) + if ( fsm->staCtx->pwCipherType == eCSR_ENCRYPT_TYPE_AES ) { /* * Use the AES key wrap algorithm if either one of the pairwise @@ -817,7 +817,7 @@ gotoStatePtkInitNegoTx(tAuthRsnFsm *fsm) padLen = groupKeyLen % ANI_SSM_AES_KEY_WRAP_BLOCK_SIZE; if (padLen != 0) { padLen = ANI_SSM_AES_KEY_WRAP_BLOCK_SIZE - padLen; - + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "Before AES Key Wrap: padLen = %d", padLen); @@ -836,16 +836,16 @@ gotoStatePtkInitNegoTx(tAuthRsnFsm *fsm) #endif retVal = ANI_E_FAILED; } - // OK, after you compute the pad length, you need to + // OK, after you compute the pad length, you need to // add the padding - 0xdd followed by 0x00's addPad( groupKeyBytes , groupKeyLen , padLen ); // add the padding length groupKeyLen += padLen; - // IMMEDIATELY adjust the packet size to reflect the pad - aniAsfPacketMoveRight(keyData, padLen); + // IMMEDIATELY adjust the packet size to reflect the pad + aniAsfPacketMoveRight(keyData, padLen); if( !ANI_IS_STATUS_SUCCESS( retVal) ) break; } - + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "Before AES Key Wrap: padded groupKeyLen = %d", groupKeyLen); @@ -867,11 +867,11 @@ gotoStatePtkInitNegoTx(tAuthRsnFsm *fsm) memcpy( groupKeyBytes, wrappedKey, groupKeyLen); // Free the array used to hold the wrapped key if (wrappedKey) vos_mem_free( wrappedKey); - // IMMEDIATELY adjust the packet size to reflect the IV + // IMMEDIATELY adjust the packet size to reflect the IV aniAsfPacketMoveRight(keyData, ANI_SSM_AES_KEY_WRAP_BLOCK_SIZE); - } + } else { - + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "Auth RC4 Key Wrap invoked. groupKeyLen = %d", groupKeyLen); } @@ -886,7 +886,7 @@ gotoStatePtkInitNegoTx(tAuthRsnFsm *fsm) fsm->staCtx->ptk, CSR_AES_KEY_LEN); if( !ANI_IS_STATUS_SUCCESS( retVal) ) break; - } + } else { retransmit = eANI_BOOLEAN_TRUE; } @@ -924,7 +924,7 @@ gotoStatePtkInitDone(tAuthRsnFsm *fsm, tAniEapolKeyAvailEventData *data) vos_mem_copy( setKeyInfo.peerMac, fsm->staCtx->suppMac, sizeof( tAniMacAddr ) ); setKeyInfo.paeRole = 0; //this is a supplicant setKeyInfo.keyId = 0; //always - setKeyInfo.keyLength = CSR_AES_KEY_LEN; + setKeyInfo.keyLength = CSR_AES_KEY_LEN; vos_mem_copy( setKeyInfo.Key, (v_U8_t *)fsm->staCtx->ptk + (2 * CSR_AES_KEY_LEN ), CSR_AES_KEY_LEN ); //fsm->suppCtx->ptk contains the 3 16-bytes keys. We need the last one. if( VOS_IS_STATUS_SUCCESS( bapSetKey( fsm->ctx->pvosGCtx, &setKeyInfo ) ) ) @@ -980,7 +980,7 @@ gotoStateKeyUpdate(tAuthRsnFsm *fsm) // Replay counter will be automatically updated when we create a // new packet - + checkTransition(fsm, NULL); // UCT return ANI_OK; @@ -1001,13 +1001,13 @@ gotoStateDisconnect(tAuthRsnFsm *fsm) return ANI_OK; } -static +static int zeroOutPtk(tAuthRsnFsm *fsm) { return ANI_OK; } -static +static int stopAllTimers(tAuthRsnFsm *fsm) { vos_timer_stop( &fsm->msg2Timer ); @@ -1028,7 +1028,7 @@ int derivePtk(tAuthRsnFsm *fsm, tAniEapolKeyAvailEventData *data) return ANI_E_NULL_VALUE; } - switch (fsm->staCtx->pwCipherType) + switch (fsm->staCtx->pwCipherType) { case eCSR_ENCRYPT_TYPE_AES: prfLen = AAG_RSN_PTK_PRF_LEN_CCMP; @@ -1052,8 +1052,8 @@ int derivePtk(tAuthRsnFsm *fsm, tAniEapolKeyAvailEventData *data) rxDesc->keyNonce); } -static int -checkMic(tAuthRsnFsm *fsm, +static int +checkMic(tAuthRsnFsm *fsm, tAniEapolKeyAvailEventData *data) { int retVal; @@ -1065,31 +1065,31 @@ checkMic(tAuthRsnFsm *fsm, fsm->staCtx->ptk, CSR_AES_KEY_LEN); - if (retVal == ANI_E_MIC_FAILED) + if (retVal == ANI_E_MIC_FAILED) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, - "Auth failed EAPOL-MIC check in pairwise key exchange!\n"); + "Auth failed EAPOL-MIC check in pairwise key exchange!\n"); } return retVal; } -static int -checkLocalReplayCounter(tAuthRsnFsm *fsm, +static int +checkLocalReplayCounter(tAuthRsnFsm *fsm, tAniEapolKeyAvailEventData *data) { int retVal = ANI_E_NULL_VALUE; int cmp; tAniEapolRsnKeyDesc *rxDesc; - + rxDesc = data->keyDesc; if( rxDesc ) { cmp = aniSsmReplayCtrCmp(fsm->staCtx->localReplayCtr, rxDesc->replayCounter); // The STA should have sent back the same replay ctr as in our request - if (cmp != 0) + if (cmp != 0) { retVal = ANI_E_REPLAY_CHECK_FAILED; } @@ -1102,14 +1102,14 @@ checkLocalReplayCounter(tAuthRsnFsm *fsm, return retVal; } -static -int checkPeerReplayCounter(tAuthRsnFsm *fsm, +static +int checkPeerReplayCounter(tAuthRsnFsm *fsm, tAniEapolKeyAvailEventData *data) { int retVal = ANI_E_NULL_VALUE; int cmp; tAniEapolRsnKeyDesc *rxDesc; - + rxDesc = data->keyDesc; if( rxDesc ) { @@ -1117,7 +1117,7 @@ int checkPeerReplayCounter(tAuthRsnFsm *fsm, // The STA should have sent a newer replay ctr than its old // request. The first message is exempted from the check. - if (fsm->staCtx->pastFirstPeerRequest && cmp >= 0) + if (fsm->staCtx->pastFirstPeerRequest && cmp >= 0) { retVal = ANI_E_REPLAY_CHECK_FAILED; } @@ -1145,7 +1145,7 @@ static int checkInfoElement(tAuthRsnFsm *fsm, } if ((desc->keyDataLen != ieStaLen) || - ( !vos_mem_compare(desc->keyData, ieStaBytes, ieStaLen-2) )) + ( !vos_mem_compare(desc->keyData, ieStaBytes, ieStaLen-2) )) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "Auth STA sent inconsistent RSN IE!\n"); @@ -1164,7 +1164,7 @@ static int checkInfoElement(tAuthRsnFsm *fsm, } -static +static int checkTransition(tAuthRsnFsm *fsm, void *arg) { int retVal; @@ -1172,21 +1172,21 @@ int checkTransition(tAuthRsnFsm *fsm, void *arg) tAniEapolRsnKeyDesc *rxDesc; tSirMicFailureInfo *micFailureInfo; - if (fsm->disconnect) + if (fsm->disconnect) { stopAllTimers(fsm); gotoStateDisconnect(fsm); return ANI_OK; } - if (fsm->authReq) + if (fsm->authReq) { stopAllTimers(fsm); gotoStateAuthentication(fsm); return ANI_OK; } - switch (fsm->currentState) + switch (fsm->currentState) { case INITIALIZE: break; @@ -1201,7 +1201,7 @@ int checkTransition(tAuthRsnFsm *fsm, void *arg) gotoStatePtkStart(fsm); break; case PTK_START: - if ( fsm->eapolAvail ) + if ( fsm->eapolAvail ) { fsm->eapolAvail = eANI_BOOLEAN_FALSE; if (NULL == arg) @@ -1222,22 +1222,22 @@ int checkTransition(tAuthRsnFsm *fsm, void *arg) return retVal; } retVal = checkMic(fsm, data); - if (retVal != ANI_OK) + if (retVal != ANI_OK) { bapAuthDisconnect( fsm->ctx ); return retVal; } retVal = gotoStatePtkInitNego(fsm, arg); - } - else if ( fsm->msg2TimeOut ) + } + else if ( fsm->msg2TimeOut ) { - if (fsm->numTries <= authConsts.maxTries) + if (fsm->numTries <= authConsts.maxTries) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "Auth Retransmitting EAPOL-Key Msg1\n"); // Stay in the same state but repeat actions gotoStatePtkStart(fsm); - } + } else { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "Auth failed to recv EAPOL-Key Msg2 " @@ -1256,16 +1256,16 @@ int checkTransition(tAuthRsnFsm *fsm, void *arg) } data = (tAniEapolKeyAvailEventData *) arg; retVal = checkInfoElement(fsm, data); - if (retVal != ANI_OK) + if (retVal != ANI_OK) { gotoStateDisconnect(fsm); - } + } else { gotoStatePtkInitNegoTx(fsm); } break; case PTK_INIT_NEGO_TX: - if (fsm->eapolAvail) + if (fsm->eapolAvail) { fsm->eapolAvail = eANI_BOOLEAN_FALSE; if (NULL == arg) @@ -1279,21 +1279,21 @@ int checkTransition(tAuthRsnFsm *fsm, void *arg) if (retVal != ANI_OK) return ANI_OK; // Caller should not fail retVal = checkMic(fsm, data); - if (retVal != ANI_OK) + if (retVal != ANI_OK) { bapAuthDisconnect( fsm->ctx ); return retVal; } retVal = gotoStatePtkInitDone(fsm, data); - } else if ( fsm->msg4TimeOut ) + } else if ( fsm->msg4TimeOut ) { - if (fsm->numTries <= authConsts.maxTries) + if (fsm->numTries <= authConsts.maxTries) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "Auth retransmitting EAPOL-Key Msg3 \n"); // Stay in the same state but repeat actions gotoStatePtkInitNegoTx(fsm); - } + } else { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "Auth failed to recv EAPOL-Key Msg4 " @@ -1316,7 +1316,7 @@ int checkTransition(tAuthRsnFsm *fsm, void *arg) data = (tAniEapolKeyAvailEventData *) arg; rxDesc = (tAniEapolRsnKeyDesc *) data->keyDesc; - if (rxDesc->info.requestFlag) + if (rxDesc->info.requestFlag) { retVal = checkPeerReplayCounter(fsm, data); @@ -1324,7 +1324,7 @@ int checkTransition(tAuthRsnFsm *fsm, void *arg) return ANI_OK; // Caller should not fail retVal = checkMic(fsm, data); - if (retVal != ANI_OK) + if (retVal != ANI_OK) { bapAuthDisconnect( fsm->ctx->pvosGCtx ); return retVal; @@ -1332,7 +1332,7 @@ int checkTransition(tAuthRsnFsm *fsm, void *arg) retVal = gotoStateUpdateKeysReq(fsm, arg); } - } + } else if (fsm->integFailed) { micFailureInfo = (tSirMicFailureInfo *) arg; @@ -1351,7 +1351,7 @@ int checkTransition(tAuthRsnFsm *fsm, void *arg) data = (tAniEapolKeyAvailEventData *) arg; rxDesc = (tAniEapolRsnKeyDesc *) data->keyDesc; - if (rxDesc->info.errorFlag) + if (rxDesc->info.errorFlag) { /* @@ -1377,7 +1377,7 @@ int checkTransition(tAuthRsnFsm *fsm, void *arg) vos_mem_copy(micFailureInfo->TSC, rxDesc->keyRecvSeqCounter, SIR_CIPHER_SEQ_CTR_SIZE); gotoStateIntegFailure(fsm, micFailureInfo); vos_mem_free(micFailureInfo); - } + } else { // TBD: Untested. Why are local aNonce and local replyCtr not incremented in spec? gotoStatePtkStart(fsm); @@ -1405,7 +1405,7 @@ int checkTransition(tAuthRsnFsm *fsm, void *arg) static void msg2TimerCallback( void *pv ) { tAuthRsnFsm *fsm = (tAuthRsnFsm *)pv; - if (NULL == fsm) + if (NULL == fsm) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "fsm is NULL in %s", __func__); @@ -1425,7 +1425,7 @@ static void msg2TimerCallback( void *pv ) static void msg4TimerCallback( void *pv ) { tAuthRsnFsm *fsm = (tAuthRsnFsm *)pv; - if (NULL == fsm) + if (NULL == fsm) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "fsm is NULL in %s", __func__); @@ -1452,7 +1452,7 @@ static int authRsnRxFrameHandler( v_PVOID_t pvosGCtx, vos_pkt_t *pPacket ) tBtampContext *ctx; tAuthRsnFsm *fsm; - /* Validate params */ + /* Validate params */ if ((pvosGCtx == NULL) || (NULL == pPacket)) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, @@ -1462,7 +1462,7 @@ static int authRsnRxFrameHandler( v_PVOID_t pvosGCtx, vos_pkt_t *pPacket ) } ctx = (tBtampContext *)VOS_GET_BAP_CB( pvosGCtx ); - if (NULL == ctx) + if (NULL == ctx) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "ctx is NULL in %s", __func__); @@ -1471,7 +1471,7 @@ static int authRsnRxFrameHandler( v_PVOID_t pvosGCtx, vos_pkt_t *pPacket ) } fsm = &ctx->uFsm.authFsm; - if (NULL == fsm) + if (NULL == fsm) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "fsm is NULL in %s", __func__); @@ -1509,7 +1509,7 @@ static int authRsnTxCompleteHandler( v_PVOID_t pvosGCtx, vos_pkt_t *pPacket, VOS tAuthRsnFsm *fsm; vos_pkt_return_packet( pPacket ); - if (NULL == ctx) + if (NULL == ctx) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "ctx is NULL in %s", __func__); @@ -1518,7 +1518,7 @@ static int authRsnTxCompleteHandler( v_PVOID_t pvosGCtx, vos_pkt_t *pPacket, VOS } fsm = &ctx->uFsm.authFsm; - if (NULL == fsm) + if (NULL == fsm) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "fsm is NULL in %s", __func__); @@ -1541,7 +1541,7 @@ static int authRsnTxCompleteHandler( v_PVOID_t pvosGCtx, vos_pkt_t *pPacket, VOS vos_timer_stop( &fsm->msg2Timer ); vos_timer_start(&fsm->msg2Timer, authConsts.timeoutPeriod); } - else if( ( PTK_INIT_NEGO == fsm->currentState ) || + else if( ( PTK_INIT_NEGO == fsm->currentState ) || ( PTK_INIT_NEGO_TX == fsm->currentState ) ) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO, @@ -1570,23 +1570,23 @@ authEapolKeyHandler( tAuthRsnFsm *fsm, tAniPacket *eapolFrame, tAniMacAddr staMa retVal = aniEapolParseKey(eapolFrame, &descType, &keyDesc); if( !ANI_IS_STATUS_SUCCESS( retVal ) ) break; - if ((descType == ANI_EAPOL_KEY_DESC_TYPE_RSN_NEW) - || (descType == ANI_EAPOL_KEY_DESC_TYPE_RSN)) + if ((descType == ANI_EAPOL_KEY_DESC_TYPE_RSN_NEW) + || (descType == ANI_EAPOL_KEY_DESC_TYPE_RSN)) { rsnDesc = (tAniEapolRsnKeyDesc *) keyDesc; data.keyDesc = keyDesc; data.eapolFrame = eapolFrame; // Pass on the event to the RSN FSM only if it is for a pairwise key - if (rsnDesc->info.unicastFlag) + if (rsnDesc->info.unicastFlag) { - retVal = authRsnFsmProcessEvent(fsm, + retVal = authRsnFsmProcessEvent(fsm, RSN_FSM_EAPOL_FRAME_AVAILABLE, &data); - } + } else { //Not worry about GTK stuff } - } + } else { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, @@ -1602,11 +1602,11 @@ authEapolKeyHandler( tAuthRsnFsm *fsm, tAniPacket *eapolFrame, tAniMacAddr staMa void authEapolHandler( tAuthRsnFsm *fsm, tAniPacket *eapolFrame, - tAniMacAddr dstMac, + tAniMacAddr dstMac, tAniMacAddr srcMac, v_U8_t *type) { - switch (*type) + switch (*type) { case ANI_EAPOL_TYPE_START: //No doing anything because we only support WPA2-PSK diff --git a/CORE/BAP/src/bapRsn8021xAuthFsm.h b/CORE/BAP/src/bapRsn8021xAuthFsm.h index dd8558ba8dbd..9758cca7a675 100644 --- a/CORE/BAP/src/bapRsn8021xAuthFsm.h +++ b/CORE/BAP/src/bapRsn8021xAuthFsm.h @@ -70,7 +70,7 @@ authRsnFsmInit(tAuthRsnFsmConsts *consts); * FUNCTION * Allocates and initializes the state of an RSN key FSM instance for * the given STA context. - * + * * @parm ctx the STA context whose instance is being created * @param pskBased pass in eANI_BOOLEAN_TRUE is this STA is to be * authenticated based on a pre-shared key as opposed to EAP. diff --git a/CORE/BAP/src/bapRsn8021xFsm.h b/CORE/BAP/src/bapRsn8021xFsm.h index 5fd07e9f1ec7..bbfab979d8d6 100644 --- a/CORE/BAP/src/bapRsn8021xFsm.h +++ b/CORE/BAP/src/bapRsn8021xFsm.h @@ -61,7 +61,7 @@ typedef struct tSuppContext tSuppContext; #define ANI_SSM_AES_KEY_WRAP_BLOCK_SIZE 8 // Bytes #define BAP_SET_RSN_KEY 1 -#define BAP_RESET_RSN_KEY 0 +#define BAP_RESET_RSN_KEY 0 #define AAG_ACL_LOOKUP_NEEDED(ctx) \ @@ -81,17 +81,17 @@ typedef struct tSuppContext tSuppContext; /************************ * AuthRsnFsm structure: *************************/ -typedef struct tagAuthRsnFsm +typedef struct tagAuthRsnFsm { v_U8_t currentState; - + tBtampContext *ctx; - tStaContext *staCtx; + tStaContext *staCtx; // Variables used for EAPOL-Key messages v_U8_t aNonce[ANI_EAPOL_KEY_RSN_NONCE_SIZE]; v_U8_t sNonce[ANI_EAPOL_KEY_RSN_NONCE_SIZE]; - + // Flags set by external events v_U8_t authReq; v_U8_t eapolAvail; @@ -120,7 +120,7 @@ typedef struct tagAuthRsnFsm typedef struct tagSuppRsnFsm { v_U8_t currentState; - + tBtampContext *ctx; tSuppContext *suppCtx; @@ -152,19 +152,19 @@ typedef enum { //Internal to RSN //This event is triggered by RSN’s timers - RSN_FSM_TIMER_EXPIRED, + RSN_FSM_TIMER_EXPIRED, //BAP use this event to inform auth/supp to start processing - //authentication. When BAP send this event to RSN, it is presumed + //authentication. When BAP send this event to RSN, it is presumed //that the PMK is available. - RSN_FSM_AUTH_START, + RSN_FSM_AUTH_START, //Internal to RSN //This event is triggered by the Rx routine when called by TL - RSN_FSM_EAPOL_FRAME_AVAILABLE, - //BAP use this event to inform RSN that the connection is lost - RSN_FSM_DISCONNECT, + RSN_FSM_EAPOL_FRAME_AVAILABLE, + //BAP use this event to inform RSN that the connection is lost + RSN_FSM_DISCONNECT, //Internal to RSN //This event hannpens when RSN detect key integraty check fails - RSN_FSM_INTEG_FAILED, + RSN_FSM_INTEG_FAILED, }tRsnFsmEvent; @@ -191,7 +191,7 @@ typedef enum * message is generated, this one is freed and the new one is * stored. */ -typedef struct tEapInfo +typedef struct tEapInfo { tAniPacket *message; @@ -221,7 +221,7 @@ struct tStaContext { // Local association point tAniMacAddr authMac; - v_U8_t ssidName[SIR_MAC_MAX_SSID_LENGTH + 1]; + v_U8_t ssidName[SIR_MAC_MAX_SSID_LENGTH + 1]; tAagSsidEntry *ssid; // The different FSM's that can be instantiated for the STA @@ -359,7 +359,7 @@ typedef struct tSuppFsmConsts { v_U16_t authPeriod; v_U16_t heldPeriod; v_U16_t startPeriod; - v_U8_t maxStart; + v_U8_t maxStart; } tSuppFsmConsts; /** @@ -387,7 +387,7 @@ typedef struct tAuthRsnGroupKeyFsmConsts { * FUNCTION * Frees a previously allocated RSN Key FSM in a STA context. If the * RSN Key FSM is not yet allocated, then this is an error. - * + * * @param ctx the STA context whose FSM instance is to be freed * * @return ANI_OK if the operation succeeds @@ -400,7 +400,7 @@ authRsnFsmFree(tBtampContext *ctx); * * FUNCTION * Passes an event to the RSN key FSM instance for immediate processing. - * + * * @param fsm the RSN Key FSM instance * @param eventId the AAG event to process * @param arg an optional argument for this event @@ -417,7 +417,7 @@ authRsnFsmProcessEvent(tAuthRsnFsm *fsm, tRsnFsmEvent eventId, void *arg); * FUNCTION * Allocates and initializes the state of an SuppFsm instance for the * given STA context. - * + * * @parm ctx the supplicant context whose SuppFsm is being created * * @return ANI_OK if the operation succeeds @@ -430,7 +430,7 @@ suppRsnFsmCreate(tBtampContext *ctx); * * FUNCTION * Frees a previously allocated SuppFsm. - * + * * @param suppCtx the supplicant context whose suppFsm is to be freed * * @return ANI_OK if the operation succeeds @@ -443,7 +443,7 @@ suppRsnFsmFree(tBtampContext *ctx); * * FUNCTION * Passes an event to the suppFsm for immediate processing. - * + * * Note: The pertinent event data is already stored in the context. * * @param suppFsm the suppFsm diff --git a/CORE/BAP/src/bapRsn8021xPrf.c b/CORE/BAP/src/bapRsn8021xPrf.c index 673d41b4ae93..156f7f6b99d7 100644 --- a/CORE/BAP/src/bapRsn8021xPrf.c +++ b/CORE/BAP/src/bapRsn8021xPrf.c @@ -116,7 +116,7 @@ int aagPtkPrf(v_U32_t cryptHandle, v_U8_t result[AAG_PRF_MAX_OUTPUT_SIZE], v_U32_t prfLen, - tAniPacket *pmk, + tAniPacket *pmk, tAniMacAddr authAddr, tAniMacAddr suppAddr, v_U8_t aNonce[ANI_EAPOL_KEY_RSN_NONCE_SIZE], @@ -161,8 +161,8 @@ aagPtkPrf(v_U32_t cryptHandle, } return aagPrf(cryptHandle, - result, - keyBytes, keyLen, + result, + keyBytes, keyLen, (v_U8_t *)AAG_PTK_PRF_CONST, AAG_PTK_PRF_CONST_LEN, text, sizeof(text), prfLen); @@ -252,7 +252,7 @@ aagPrf(v_U32_t cryptHandle, numLoops = prfLen + AAG_PTK_PRF_ADD_PARAM; numLoops /= AAG_PTK_PRF_DIV_PARAM; - for (i = 0; i < numLoops; i++) + for (i = 0; i < numLoops; i++) { if ((resultOffset - result + VOS_DIGEST_SHA1_SIZE) > AAG_PRF_MAX_OUTPUT_SIZE) { @@ -276,4 +276,3 @@ aagPrf(v_U32_t cryptHandle, return retVal; } - diff --git a/CORE/BAP/src/bapRsn8021xPrf.h b/CORE/BAP/src/bapRsn8021xPrf.h index 2ea8e02af21d..de4ffea3a482 100644 --- a/CORE/BAP/src/bapRsn8021xPrf.h +++ b/CORE/BAP/src/bapRsn8021xPrf.h @@ -116,7 +116,7 @@ int aagPtkPrf(v_U32_t cryptHandle, v_U8_t result[AAG_PRF_MAX_OUTPUT_SIZE], v_U32_t prfLen, - tAniPacket *pmk, + tAniPacket *pmk, tAniMacAddr authAddr, tAniMacAddr suppAddr, v_U8_t aNonce[ANI_EAPOL_KEY_RSN_NONCE_SIZE], diff --git a/CORE/BAP/src/bapRsn8021xSuppRsnFsm.c b/CORE/BAP/src/bapRsn8021xSuppRsnFsm.c index 8338c87cb51b..6071ab73a70c 100644 --- a/CORE/BAP/src/bapRsn8021xSuppRsnFsm.c +++ b/CORE/BAP/src/bapRsn8021xSuppRsnFsm.c @@ -54,7 +54,7 @@ #define GOT_PMK 2 #define STA_KEY_START 3 #define STA_KEY_SET 4 -#define KEY_UPDATE 5 +#define KEY_UPDATE 5 #define REKEY_MSG 6 #define GROUP_KEY_SET 7 #define NUM_STATES (GROUP_KEY_SET + 1) @@ -68,11 +68,11 @@ int gReadToSetKey; * Static functions in this module **************************************/ -static +static int zeroOutPtk(tSuppRsnFsm *fsm); static -int checkMic(tSuppRsnFsm *fsm, +int checkMic(tSuppRsnFsm *fsm, tAniEapolKeyAvailEventData *data, v_BOOL_t pwKeyExchange); @@ -80,7 +80,7 @@ static int checkInfoElement(tSuppRsnFsm *fsm, tAniEapolKeyAvailEventData *data); static -int checkPeerReplayCounter(tSuppRsnFsm *fsm, +int checkPeerReplayCounter(tSuppRsnFsm *fsm, tAniEapolKeyAvailEventData *data, v_BOOL_t *retransmit, v_BOOL_t actualMicFlag, @@ -88,10 +88,10 @@ int checkPeerReplayCounter(tSuppRsnFsm *fsm, ); static -int derivePtk(tSuppRsnFsm *fsm, +int derivePtk(tSuppRsnFsm *fsm, tAniEapolKeyAvailEventData *data); -static +static int checkTransition(tSuppRsnFsm *fsm, void *arg); static int @@ -137,7 +137,7 @@ suppRsnFsmInit(void) * FUNCTION * Allocates and initializes the state of an RSN key FSM instance for * the given BP context. - * + * * @parm ctx the BP context whose instance is being created * @param pskBased pass in eANI_BOOLEAN_TRUE is this BP is to be * authenticated based on a pre-shared key as opposed to EAP. @@ -166,7 +166,7 @@ suppRsnFsmCreate(tBtampContext *ctx) // Allocate the supplicant context fsm->suppCtx = (tSuppContext *)vos_mem_malloc( sizeof(tSuppContext) ); - if (fsm->suppCtx == NULL) + if (fsm->suppCtx == NULL) { retVal = ANI_E_MALLOC_FAILED; VOS_ASSERT( 0 ); @@ -182,21 +182,21 @@ suppRsnFsmCreate(tBtampContext *ctx) retVal = aniAsfPacketAllocateExplicit(&fsm->lastEapol, RSN_MAX_PACKET_SIZE, EAPOL_TX_HEADER_SIZE); - if (retVal != ANI_OK) + if (retVal != ANI_OK) { VOS_ASSERT( 0 ); goto error; } aniAsfPacketAllocate(&fsm->suppCtx->pmk); - if (fsm->suppCtx->pmk == NULL) + if (fsm->suppCtx->pmk == NULL) { retVal = ANI_E_MALLOC_FAILED; VOS_ASSERT( 0 ); goto error; } - fsm->suppCtx->ieAp = NULL; + fsm->suppCtx->ieAp = NULL; fsm->cryptHandle = 0; if( !VOS_IS_STATUS_SUCCESS( vos_crypto_init( &fsm->cryptHandle ) ) ) @@ -216,7 +216,7 @@ suppRsnFsmCreate(tBtampContext *ctx) suppRsnFsmFree( ctx ); return retVal; - + } /** @@ -225,7 +225,7 @@ suppRsnFsmCreate(tBtampContext *ctx) * FUNCTION * Frees a previously allocated RSN Key FSM in a BP context. If the * RSN Key FSM is not yet allocated, then this is an error. - * + * * @param ctx the BP context whose FSM instance is to be freed * * @return ANI_OK if the operation succeeds @@ -238,11 +238,11 @@ suppRsnFsmFree(tBtampContext *ctx) fsm = &ctx->uFsm.suppFsm; if( fsm->cryptHandle ) - { + { vos_crypto_deinit( fsm->cryptHandle ); } - bapRsnClearTxRxCallbacks(); + bapRsnClearTxRxCallbacks(); if (fsm->lastEapol) aniAsfPacketFree(fsm->lastEapol); @@ -267,7 +267,7 @@ suppRsnFsmFree(tBtampContext *ctx) * * FUNCTION * Passes an event to the RSN key FSM instance for immediate processing. - * + * * @param fsm the RSN Key FSM instance * @param eventId the AAG event to process * @param arg an optional argument for this event @@ -278,7 +278,7 @@ int suppRsnFsmProcessEvent(tSuppRsnFsm *fsm, tRsnFsmEvent eventId, void *arg) { - switch (eventId) + switch (eventId) { case RSN_FSM_TIMER_EXPIRED: // Proceed straight to checkTransition @@ -369,20 +369,20 @@ gotoStateGotPmk(tSuppRsnFsm *fsm) } static int -gotoStateStaKeyStart(tSuppRsnFsm *fsm, +gotoStateStaKeyStart(tSuppRsnFsm *fsm, tAniEapolKeyAvailEventData *data, v_BOOL_t retransmit) { int retVal; tAniEapolRsnKeyDesc txDesc; tAniEapolRsnKeyDesc *rxDesc; - static v_U8_t btampRSNIE[] = {0x30, 0x14, 0x01, 0x00, 0x00, 0x0f, 0xac, 0x04, 0x01, 0x00, + static v_U8_t btampRSNIE[] = {0x30, 0x14, 0x01, 0x00, 0x00, 0x0f, 0xac, 0x04, 0x01, 0x00, 0x00, 0x0f, 0xac, 0x04, 0x01, 0x00, 0x00, 0x0f, 0xac, 0x02, 0x00, 0x00 }; fsm->currentState = STA_KEY_START; // Create a new EAPOL frame if we don't have to retransmit - // if (!retransmit) + // if (!retransmit) //{ rxDesc = data->keyDesc; @@ -402,7 +402,7 @@ gotoStateStaKeyStart(tSuppRsnFsm *fsm, vos_mem_zero( &txDesc, sizeof(txDesc) ); // The Key Information bits... - if (fsm->suppCtx->pwCipherType == eCSR_ENCRYPT_TYPE_AES) + if (fsm->suppCtx->pwCipherType == eCSR_ENCRYPT_TYPE_AES) { txDesc.info.keyDescVers = ANI_EAPOL_KEY_DESC_VERS_AES; } @@ -411,13 +411,13 @@ gotoStateStaKeyStart(tSuppRsnFsm *fsm, txDesc.keyLen = 0; //RSN_80211_KEY_LEN; // Send back the same replayCtr that the authenticator sent - vos_mem_copy(txDesc.replayCounter, - rxDesc->replayCounter, + vos_mem_copy(txDesc.replayCounter, + rxDesc->replayCounter, sizeof(txDesc.replayCounter)); vos_mem_copy(txDesc.keyNonce, fsm->sNonce, sizeof(txDesc.keyNonce)); txDesc.keyDataLen = sizeof(btampRSNIE);//aniAsfPacketGetBytes(fsm->suppCtx->ieBp, - //&txDesc.keyData); + //&txDesc.keyData); txDesc.keyData = btampRSNIE; retVal = aniEapolWriteKey(fsm->cryptHandle, fsm->lastEapol, @@ -425,7 +425,7 @@ gotoStateStaKeyStart(tSuppRsnFsm *fsm, fsm->suppCtx->suppMac, ANI_EAPOL_KEY_DESC_TYPE_RSN_NEW, &txDesc, - fsm->suppCtx->ptk, + fsm->suppCtx->ptk, CSR_AES_KEY_LEN); if( !ANI_IS_STATUS_SUCCESS( retVal ) ) { @@ -434,7 +434,7 @@ gotoStateStaKeyStart(tSuppRsnFsm *fsm, return retVal; } //} - + if( VOS_IS_STATUS_SUCCESS( bapRsnSendEapolFrame( fsm->ctx->pvosGCtx, fsm->lastEapol ) ) ) { retVal = ANI_OK; @@ -448,28 +448,28 @@ gotoStateStaKeyStart(tSuppRsnFsm *fsm, } static int -gotoStateStaKeySet(tSuppRsnFsm *fsm, +gotoStateStaKeySet(tSuppRsnFsm *fsm, tAniEapolKeyAvailEventData *data, v_BOOL_t retransmit) { int retVal=0; tAniEapolRsnKeyDesc txDesc; tAniEapolRsnKeyDesc *rxDesc = NULL; - + fsm->currentState = STA_KEY_SET; - if (data == NULL) + if (data == NULL) { // We don't need to do anything return ANI_OK; } - + // Create a new EAPOL frame if we don't have to retransmit - if (!retransmit) + if (!retransmit) { // First check the IE that the AP sent retVal = checkInfoElement(fsm, data); - if (retVal != ANI_OK) + if (retVal != ANI_OK) { //FIX_RSN aagSetSuppFailureAndCleanup(fsm->suppCtx); @@ -484,13 +484,13 @@ gotoStateStaKeySet(tSuppRsnFsm *fsm, if( NULL == rxDesc ) return ANI_E_NULL_VALUE; - aniAsfPacketEmptyExplicit(fsm->lastEapol, + aniAsfPacketEmptyExplicit(fsm->lastEapol, EAPOL_TX_HEADER_SIZE ); vos_mem_zero( &txDesc, sizeof(txDesc) ); // The Key Information bits... - if (fsm->suppCtx->pwCipherType == eCSR_ENCRYPT_TYPE_AES) + if (fsm->suppCtx->pwCipherType == eCSR_ENCRYPT_TYPE_AES) { txDesc.info.keyDescVers = ANI_EAPOL_KEY_DESC_VERS_AES; } @@ -501,8 +501,8 @@ gotoStateStaKeySet(tSuppRsnFsm *fsm, txDesc.keyLen = 0; //RSN_80211_KEY_LEN; // Send back the same replayCtr that the authenticator sent - vos_mem_copy(txDesc.replayCounter, - rxDesc->replayCounter, + vos_mem_copy(txDesc.replayCounter, + rxDesc->replayCounter, sizeof(txDesc.replayCounter)); retVal = aniEapolWriteKey(fsm->cryptHandle, @@ -532,7 +532,7 @@ gotoStateStaKeySet(tSuppRsnFsm *fsm, vos_mem_copy( setKeyInfo.peerMac, fsm->suppCtx->authMac, sizeof( tAniMacAddr ) ); setKeyInfo.paeRole = 0; //this is a supplicant setKeyInfo.keyId = 0; //always - setKeyInfo.keyLength = CSR_AES_KEY_LEN; + setKeyInfo.keyLength = CSR_AES_KEY_LEN; vos_mem_copy( setKeyInfo.Key, (v_U8_t *)fsm->suppCtx->ptk + (2 * CSR_AES_KEY_LEN ), CSR_AES_KEY_LEN ); //fsm->suppCtx->ptk contains the 3 16-bytes keys. We need the last one. /* @@ -554,7 +554,7 @@ gotoStateStaKeySet(tSuppRsnFsm *fsm, } static int -gotoStateGroupKeySet(tSuppRsnFsm *fsm, +gotoStateGroupKeySet(tSuppRsnFsm *fsm, tAniEapolKeyAvailEventData *data) { int retVal; @@ -562,40 +562,40 @@ gotoStateGroupKeySet(tSuppRsnFsm *fsm, tAniEapolRsnKeyDesc *rxDesc; int groupKeyLen; - + fsm->currentState = GROUP_KEY_SET; - + do { rxDesc = (tAniEapolRsnKeyDesc *) data->keyDesc; - if( NULL == rxDesc) + if( NULL == rxDesc) { retVal = ANI_E_NULL_VALUE; break; } - if (rxDesc->keyDataLen == 0 || rxDesc->keyData == NULL) + if (rxDesc->keyDataLen == 0 || rxDesc->keyData == NULL) { - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "Supp: AP sent no group key in group EAPOL-Key message!\n" ); retVal = ANI_E_ILLEGAL_ARG; break; } - if ( rxDesc->info.keyDescVers == ANI_EAPOL_KEY_DESC_VERS_AES ) + if ( rxDesc->info.keyDescVers == ANI_EAPOL_KEY_DESC_VERS_AES ) { groupKeyLen = rxDesc->keyDataLen - ANI_SSM_AES_KEY_WRAP_BLOCK_SIZE; if( groupKeyLen <= 0 ) { - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "Supp: AP sent GTK too short\n" ); retVal = ANI_E_ILLEGAL_ARG; break; } - } + } else { - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "Supp: AP sent unsupported keyDescVer %d!\n", rxDesc->info.keyDescVers ); retVal = ANI_E_ILLEGAL_ARG; break; @@ -603,13 +603,13 @@ gotoStateGroupKeySet(tSuppRsnFsm *fsm, // Always create a new EAPOL frame - aniAsfPacketEmptyExplicit( fsm->lastEapol, + aniAsfPacketEmptyExplicit( fsm->lastEapol, EAPOL_TX_HEADER_SIZE ); - + vos_mem_zero( &txDesc, sizeof(txDesc) ); // The Key Information bits... - if (fsm->suppCtx->grpCipherType == eCSR_ENCRYPT_TYPE_AES) + if (fsm->suppCtx->grpCipherType == eCSR_ENCRYPT_TYPE_AES) { txDesc.info.keyDescVers = ANI_EAPOL_KEY_DESC_VERS_AES; } @@ -621,8 +621,8 @@ gotoStateGroupKeySet(tSuppRsnFsm *fsm, txDesc.keyLen = RSN_80211_KEY_LEN; // Send back the same replayCtr that the authenticator sent - vos_mem_copy(txDesc.replayCounter, - rxDesc->replayCounter, + vos_mem_copy(txDesc.replayCounter, + rxDesc->replayCounter, sizeof(txDesc.replayCounter)); retVal = aniEapolWriteKey(fsm->cryptHandle, @@ -633,7 +633,7 @@ gotoStateGroupKeySet(tSuppRsnFsm *fsm, &txDesc, fsm->suppCtx->ptk, CSR_AES_KEY_LEN); - if( !ANI_IS_STATUS_SUCCESS( retVal ) ) break; + if( !ANI_IS_STATUS_SUCCESS( retVal ) ) break; if( !VOS_IS_STATUS_SUCCESS( bapRsnSendEapolFrame( fsm->ctx->pvosGCtx, fsm->lastEapol ) ) ) { @@ -645,7 +645,7 @@ gotoStateGroupKeySet(tSuppRsnFsm *fsm, //FIX_RSN there is no need to set GTK retVal = setGtk(fsm->suppCtx, rxDesc->keyRecvSeqCounter); // This is never retransmitted - aniAsfPacketEmptyExplicit( fsm->lastEapol, + aniAsfPacketEmptyExplicit( fsm->lastEapol, EAPOL_TX_HEADER_SIZE ); checkTransition(fsm, NULL); // UCT rule @@ -672,7 +672,7 @@ gotoStateRekeyMsg(tSuppRsnFsm *fsm, tSirMicFailureInfo *micFailureInfo) return ANI_OK; } -static +static int zeroOutPtk(tSuppRsnFsm *fsm) { return ANI_OK; @@ -684,7 +684,7 @@ int derivePtk(tSuppRsnFsm *fsm, tAniEapolKeyAvailEventData *data) v_U32_t prfLen; tAniEapolRsnKeyDesc *rxDesc; - switch (fsm->suppCtx->pwCipherType) + switch (fsm->suppCtx->pwCipherType) { case eCSR_ENCRYPT_TYPE_AES: prfLen = AAG_RSN_PTK_PRF_LEN_CCMP; @@ -710,7 +710,7 @@ int derivePtk(tSuppRsnFsm *fsm, tAniEapolKeyAvailEventData *data) } static -int checkMic(tSuppRsnFsm *fsm, +int checkMic(tSuppRsnFsm *fsm, tAniEapolKeyAvailEventData *data, v_BOOL_t pwKeyExchange) { @@ -745,10 +745,10 @@ static int checkInfoElement(tSuppRsnFsm *fsm, { if ((desc->keyDataLen != ieApLen) || - ( vos_mem_compare(desc->keyData, ieApBytes, ieApLen) )) + ( vos_mem_compare(desc->keyData, ieApBytes, ieApLen) )) { // TODO: Send a fault here - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "Supp AP sent inconsistent RSN IE!\n" ); return ANI_E_FAILED; } @@ -757,8 +757,8 @@ static int checkInfoElement(tSuppRsnFsm *fsm, return ANI_OK; } -static -int checkPeerReplayCounter(tSuppRsnFsm *fsm, +static +int checkPeerReplayCounter(tSuppRsnFsm *fsm, tAniEapolKeyAvailEventData *data, v_BOOL_t *retransmit, v_BOOL_t actualMicFlag, @@ -767,7 +767,7 @@ int checkPeerReplayCounter(tSuppRsnFsm *fsm, int retVal = ANI_OK; int cmp; tAniEapolRsnKeyDesc *rxDesc; - + rxDesc = data->keyDesc; if( NULL == rxDesc ) { @@ -775,31 +775,31 @@ int checkPeerReplayCounter(tSuppRsnFsm *fsm, } *retransmit = eANI_BOOLEAN_FALSE; - + cmp = aniSsmReplayCtrCmp(fsm->peerReplayCtr, rxDesc->replayCounter); - + // The AP should send us a replay counter greater than or equal to // the last one it sent /*Unless we are forgiving with this we will have interop issues with some vendros like CSR*/ - if (cmp > 0) + if (cmp > 0) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "BP got old EAPOL replay counter from AP" ); retVal = ANI_E_REPLAY_CHECK_FAILED; - } - else if (cmp <= 0) + } + else if (cmp <= 0) { - if ( actualMicFlag == reTxMicFlag ) - { - *retransmit = eANI_BOOLEAN_TRUE; + if ( actualMicFlag == reTxMicFlag ) + { + *retransmit = eANI_BOOLEAN_TRUE; } } return retVal; } -static +static int checkTransition(tSuppRsnFsm *fsm, void *arg) { tAniEapolKeyAvailEventData *data; @@ -807,13 +807,13 @@ int checkTransition(tSuppRsnFsm *fsm, void *arg) v_BOOL_t retransmit; int retVal; - if (fsm->authReq) + if (fsm->authReq) { gotoStateAuthentication(fsm); return ANI_OK; } - switch (fsm->currentState) + switch (fsm->currentState) { case INITIALIZE: break; @@ -828,7 +828,7 @@ int checkTransition(tSuppRsnFsm *fsm, void *arg) data = (tAniEapolKeyAvailEventData *) arg; rxDesc = (tAniEapolRsnKeyDesc *) data->keyDesc; - if (rxDesc->info.ackFlag) + if (rxDesc->info.ackFlag) { aniSsmReplayCtrUpdate(fsm->peerReplayCtr, @@ -850,9 +850,9 @@ int checkTransition(tSuppRsnFsm *fsm, void *arg) if (rxDesc->info.ackFlag) { retVal = checkPeerReplayCounter( - fsm, - data, - &retransmit, + fsm, + data, + &retransmit, rxDesc->info.micFlag, 0); // MIC not set means check for re-Tx M1. if (retVal != ANI_OK) @@ -865,10 +865,10 @@ int checkTransition(tSuppRsnFsm *fsm, void *arg) "supplicant to AP" ); retVal = gotoStateStaKeyStart(fsm, data, eANI_BOOLEAN_TRUE); - } + } else { retVal = checkMic(fsm, data, rxDesc->info.unicastFlag); - if (retVal != ANI_OK) + if (retVal != ANI_OK) { bapSuppDisconnect( fsm->ctx ); return retVal; @@ -884,25 +884,25 @@ int checkTransition(tSuppRsnFsm *fsm, void *arg) } break; case STA_KEY_SET: - if (fsm->eapolAvail) + if (fsm->eapolAvail) { fsm->eapolAvail = eANI_BOOLEAN_FALSE; data = (tAniEapolKeyAvailEventData *) arg; rxDesc = (tAniEapolRsnKeyDesc *) data->keyDesc; retVal = checkPeerReplayCounter( - fsm, - data, - &retransmit, + fsm, + data, + &retransmit, rxDesc->info.micFlag, 1); // MIC set means check for re-Tx M3. if (retVal != ANI_OK) return ANI_OK; // Caller should not fail - if (!retransmit) + if (!retransmit) { retVal = checkMic(fsm, data, rxDesc->info.unicastFlag); - if (retVal != ANI_OK) + if (retVal != ANI_OK) { bapSuppDisconnect( fsm->ctx ); return retVal; @@ -912,28 +912,28 @@ int checkTransition(tSuppRsnFsm *fsm, void *arg) } - if (rxDesc->info.unicastFlag) + if (rxDesc->info.unicastFlag) { - /* + /* * Handle pairwise key message...in this state * pairwise key messages can only be for retransmissions. */ - if (retransmit) + if (retransmit) { - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "Resending EAPOL-Key Msg4 from " "supplicant \n" ); retVal = gotoStateStaKeySet(fsm, data, eANI_BOOLEAN_TRUE); } } - else + else { /* * Handle group key message...with group key messages, * the replay counter has to change on * retransmissions. */ - if (!retransmit) + if (!retransmit) { retVal = gotoStateGroupKeySet(fsm, data); if( !ANI_IS_STATUS_SUCCESS( retVal ) ) @@ -942,10 +942,10 @@ int checkTransition(tSuppRsnFsm *fsm, void *arg) return retVal; } } - } - } + } + } else { - if (fsm->integFailed) + if (fsm->integFailed) { gotoStateKeyUpdate(fsm, arg); } @@ -971,11 +971,11 @@ int checkTransition(tSuppRsnFsm *fsm, void *arg) static int suppEapolKeyHandler( tSuppRsnFsm *fsm, - tAniPacket *eapolFrame, + tAniPacket *eapolFrame, tAniMacAddr suppMac) { int retVal; - + int descType; void *keyDesc; tAniEapolRsnKeyDesc *rsnDesc; @@ -989,7 +989,7 @@ suppEapolKeyHandler( tSuppRsnFsm *fsm, return retVal; } - if (descType == ANI_EAPOL_KEY_DESC_TYPE_RSN_NEW) + if (descType == ANI_EAPOL_KEY_DESC_TYPE_RSN_NEW) { rsnDesc = (tAniEapolRsnKeyDesc *) keyDesc; /* @@ -998,10 +998,10 @@ suppEapolKeyHandler( tSuppRsnFsm *fsm, */ data.keyDesc = keyDesc; data.eapolFrame = eapolFrame; - retVal = suppRsnFsmProcessEvent(fsm, + retVal = suppRsnFsmProcessEvent(fsm, RSN_FSM_EAPOL_FRAME_AVAILABLE, &data); - } + } else { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "Supp: Got unexpected 802.1x RC4 Key message \n" ); @@ -1024,7 +1024,7 @@ static int suppRsnRxFrameHandler( v_PVOID_t pvosGCtx, vos_pkt_t *pPacket ) tAniPacket *pAniPacket; tBtampContext *ctx; tSuppRsnFsm *fsm; - /* Validate params */ + /* Validate params */ if ((pvosGCtx == NULL) || (NULL == pPacket)) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, @@ -1033,7 +1033,7 @@ static int suppRsnRxFrameHandler( v_PVOID_t pvosGCtx, vos_pkt_t *pPacket ) return retVal; } ctx = (tBtampContext *)VOS_GET_BAP_CB( pvosGCtx ); - if (NULL == ctx) + if (NULL == ctx) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "ctx is NULL in %s", __func__); @@ -1042,7 +1042,7 @@ static int suppRsnRxFrameHandler( v_PVOID_t pvosGCtx, vos_pkt_t *pPacket ) } fsm = &ctx->uFsm.suppFsm; - if (NULL == fsm) + if (NULL == fsm) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "fsm is NULL in %s", __func__); @@ -1088,7 +1088,7 @@ static int suppRsnTxCompleteHandler( v_PVOID_t pvosGCtx, vos_pkt_t *pPacket, VOS return ANI_ERROR; } - if (NULL == ctx) + if (NULL == ctx) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "ctx is NULL in %s", __func__); @@ -1097,7 +1097,7 @@ static int suppRsnTxCompleteHandler( v_PVOID_t pvosGCtx, vos_pkt_t *pPacket, VOS } fsm = &ctx->uFsm.authFsm; - if (NULL == fsm) + if (NULL == fsm) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "fsm is NULL in %s", __func__); @@ -1106,7 +1106,7 @@ static int suppRsnTxCompleteHandler( v_PVOID_t pvosGCtx, vos_pkt_t *pPacket, VOS } //Synchronization needed - + if(!VOS_IS_STATUS_SUCCESS( retStatus ) ) { //This is bad. @@ -1145,11 +1145,11 @@ static int suppRsnTxCompleteHandler( v_PVOID_t pvosGCtx, vos_pkt_t *pPacket, VOS * @return ANI_OK if the operation succeeds */ void suppEapolHandler( tSuppRsnFsm *fsm, tAniPacket *eapolFrame, - tAniMacAddr dstMac, + tAniMacAddr dstMac, tAniMacAddr srcMac, v_U8_t *type ) { - switch (*type) + switch (*type) { case ANI_EAPOL_TYPE_PACKET: // Ignore EAP becasue it is only WPA2-PSK diff --git a/CORE/BAP/src/bapRsnAsfPacket.c b/CORE/BAP/src/bapRsnAsfPacket.c index 74c50f4fbf44..d6561ea7c65a 100644 --- a/CORE/BAP/src/bapRsnAsfPacket.c +++ b/CORE/BAP/src/bapRsnAsfPacket.c @@ -154,7 +154,7 @@ aniAsfPacketAllocateExplicit(tAniPacket **packetPtr, packet = (tAniPacket *) vos_mem_malloc( sizeof(tAniPacket) ); - if (packet == NULL) + if (packet == NULL) { VOS_ASSERT( 0 ); return ANI_E_MALLOC_FAILED; @@ -164,7 +164,7 @@ aniAsfPacketAllocateExplicit(tAniPacket **packetPtr, size = (size + 4) & 0xfffffffc; packet->buf = (v_U8_t *)vos_mem_malloc( sizeof(v_U8_t) * size ); - if (packet->buf == NULL) + if (packet->buf == NULL) { vos_mem_free( packet ); VOS_ASSERT( 0 ); @@ -192,7 +192,7 @@ aniAsfPacketAllocateExplicit(tAniPacket **packetPtr, * @param oldPacket the original packet that should be duplicated * * @return ANI_OK if the operation succeeds; ANI_E_NULL if oldPacket - * is NULL; + * is NULL; */ int aniAsfPacketDuplicate(tAniPacket **newPacketPtr, tAniPacket *oldPacket) @@ -213,14 +213,14 @@ aniAsfPacketDuplicate(tAniPacket **newPacketPtr, tAniPacket *oldPacket) retVal = aniAsfPacketAppendBuffer(packet, oldPacket->head, oldPacket->len); - if (retVal != ANI_OK) + if (retVal != ANI_OK) { VOS_ASSERT( 0 ); aniAsfPacketFree(packet); return ANI_E_FAILED; } - if (oldPacket->recordHeader != NULL) + if (oldPacket->recordHeader != NULL) { recordPos = oldPacket->recordHeader - oldPacket->buf; packet->recordHeader = packet->buf + recordPos; @@ -928,7 +928,7 @@ aniAsfPacketGetMac(tAniPacket *packet, tAniMacAddr macAddr) * interfacing with other libraries that only support byte array * manipulation. * - * WARNING: + * WARNING: * Applications are discouraged from using this function * because correct usage is a two-step process - one: copy some bytes * to the packet's internal buffer, two: move head and length. This @@ -961,7 +961,7 @@ aniAsfPacketMoveLeft(tAniPacket *packet, v_U32_t count) * interfacing with other libraries that only support byte array * manipulation. * - * WARNING: + * WARNING: * Applications are discouraged from using this function * because correct usage is a two-step process - one: copy some bytes * to the packet's internal buffer, two: move tail and length. This @@ -988,16 +988,16 @@ aniAsfPacketMoveRight(tAniPacket *packet, v_U32_t count) * aniAsfPacketGetBytesFromTail * * FUNCTION: - * Returns a pointer to the tail of the valid data stored + * Returns a pointer to the tail of the valid data stored * in the packet. * - * WARNING: + * WARNING: * Applications are discouraged from using this function * because correct usage is a three-step process - one: call this - * routine to obtain a pointer to the current tail of the packet. - * two: treat this returned pointer like a simple array and copy - * some bytes to the packet's internal buffer, and finally - * three: move tail and length. This violates the encapsulation + * routine to obtain a pointer to the current tail of the packet. + * two: treat this returned pointer like a simple array and copy + * some bytes to the packet's internal buffer, and finally + * three: move tail and length. This violates the encapsulation * the packet library aims to provide. * * @param packet the packet whose bytes we need @@ -1017,4 +1017,3 @@ aniAsfPacketGetBytesFromTail(tAniPacket *packet, v_U8_t **rawBytesPtr) *rawBytesPtr = packet->tail; return 0; // The length of used bytes returned is zero } - diff --git a/CORE/BAP/src/bapRsnAsfPacket.h b/CORE/BAP/src/bapRsnAsfPacket.h index 24625025b281..c38c8d32caaa 100644 --- a/CORE/BAP/src/bapRsnAsfPacket.h +++ b/CORE/BAP/src/bapRsnAsfPacket.h @@ -149,7 +149,7 @@ aniAsfPacketFree(tAniPacket *packet); * * FUNCTION: * Returns a printable representation of the data contained in the - * packet. + * packet. * Note: This function returns a static buffer used by aniAsfHexStr. * * @param packet the packet whose contents need to be printed @@ -543,7 +543,7 @@ aniAsfPacketGetMac(tAniPacket *packet, tAniMacAddr macAddr); * interfacing with other libraries that only support byte array * manipulation. * - * WARNING: + * WARNING: * Applications are discouraged from using this function * because correct usage is a two-step process - one: copy some bytes * to the packet's internal buffer, two: move head and length. This @@ -567,7 +567,7 @@ aniAsfPacketMoveLeft(tAniPacket *packet, v_U32_t count); * interfacing with other libraries that only support byte array * manipulation. * - * WARNING: + * WARNING: * Applications are discouraged from using this function * because correct usage is a two-step process - one: copy some bytes * to the packet's internal buffer, two: move tail and length. This @@ -585,16 +585,16 @@ aniAsfPacketMoveRight(tAniPacket *packet, v_U32_t count); * aniAsfPacketGetBytesFromTail * * FUNCTION: - * Returns a pointer to the tail of the valid data stored + * Returns a pointer to the tail of the valid data stored * in the packet. * - * WARNING: + * WARNING: * Applications are discouraged from using this function * because correct usage is a three-step process - one: call this - * routine to obtain a pointer to the current tail of the packet. - * two: treat this returned pointer like a simple array and copy - * some bytes to the packet's internal buffer, and finally - * three: move tail and length. This violates the encapsulation + * routine to obtain a pointer to the current tail of the packet. + * two: treat this returned pointer like a simple array and copy + * some bytes to the packet's internal buffer, and finally + * three: move tail and length. This violates the encapsulation * the packet library aims to provide. * * @param packet the packet whose bytes we need diff --git a/CORE/BAP/src/bapRsnErrors.h b/CORE/BAP/src/bapRsnErrors.h index add44be54b4b..a1f9712fe9f2 100644 --- a/CORE/BAP/src/bapRsnErrors.h +++ b/CORE/BAP/src/bapRsnErrors.h @@ -71,15 +71,15 @@ #define ANI_E_RAND_FAILED -5 /// RNG failed #define ANI_E_SHORT_PACKET -6 /// Packet is too small to contain data #define ANI_E_ELEM_NOT_FND -7 /// Element not found -#define ANI_E_INVALID_LEN -8 /// Element has invalid Length -#define ANI_E_INVALID_DT -9 /// Invalid Data Type +#define ANI_E_INVALID_LEN -8 /// Element has invalid Length +#define ANI_E_INVALID_DT -9 /// Invalid Data Type #define ANI_E_TIMEOUT -10 /// Timeout occurred #define ANI_E_DBM_INVALID_ID -11 /// Invalid DB id sent to server #define ANI_E_DBM_KEY_NOT_FOUND -12 /// Key's mapping was not found #define ANI_E_FILE_EMPTY -13 /// file empty #define ANI_E_INVALID_MT -14 /// Invalid ANI message type #define ANI_E_NOT_IMPLEMENTED -15 /// Feature not implemented -#define ANI_E_INVALID_PT -16 /// Invalid Parameter Type +#define ANI_E_INVALID_PT -16 /// Invalid Parameter Type #define ANI_E_INVALID_PV -17 /// Invalid Paramter Value #define ANI_E_IPCOPEN -18 /// IPC open failed #define ANI_E_IPCCONNECT -19 /// IPC connect failed diff --git a/CORE/BAP/src/bapRsnSsmAesKeyWrap.c b/CORE/BAP/src/bapRsnSsmAesKeyWrap.c index 8310ab1ba64f..1f826c4cd69d 100644 --- a/CORE/BAP/src/bapRsnSsmAesKeyWrap.c +++ b/CORE/BAP/src/bapRsnSsmAesKeyWrap.c @@ -101,7 +101,7 @@ xor(tANI_U8 a[ANI_SSM_AES_KEY_WRAP_BLOCK_SIZE], tANI_U32 t); * blocks. The first block is the IV from section 2.2.3 o the * RFC. Note: It is the caller's responsibility to free the returned * value. - * + * * @param plainText the plaintext data to wrap * @param len the length of the plaintext, which must be a multiple of * ANI_SSM_AES_KEY_WRAP_BLOCK_SIZE. @@ -148,7 +148,7 @@ aniSsmAesKeyWrap(v_U32_t cryptHandle, tANI_U8 *plainText, tANI_U32 len, for (j = 0; j <= 5; j++) { for (i = 1; i <= n; i++) { - retVal = aes(cryptHandle, keyEncKey, keyEncKeyLen, + retVal = aes(cryptHandle, keyEncKey, keyEncKeyLen, a, r + i*ANI_SSM_AES_KEY_WRAP_BLOCK_SIZE, b); @@ -227,8 +227,8 @@ aniSsmAesKeyUnwrap(v_U32_t cryptHandle, tANI_U8 *cipherText, tANI_U32 len, } vos_mem_copy(a, cipherText, sizeof(a)); - vos_mem_copy(r + ANI_SSM_AES_KEY_WRAP_BLOCK_SIZE, - cipherText + ANI_SSM_AES_KEY_WRAP_BLOCK_SIZE, + vos_mem_copy(r + ANI_SSM_AES_KEY_WRAP_BLOCK_SIZE, + cipherText + ANI_SSM_AES_KEY_WRAP_BLOCK_SIZE, len - ANI_SSM_AES_KEY_WRAP_BLOCK_SIZE); for (j = 5; j >= 0; j--) { @@ -236,7 +236,7 @@ aniSsmAesKeyUnwrap(v_U32_t cryptHandle, tANI_U8 *cipherText, tANI_U32 len, t = n*j + i; xor(a, t); - retVal = aes_1(cryptHandle, keyEncKey, keyEncKeyLen, + retVal = aes_1(cryptHandle, keyEncKey, keyEncKeyLen, a, r + i*ANI_SSM_AES_KEY_WRAP_BLOCK_SIZE, b); @@ -280,7 +280,7 @@ aes(v_U32_t cryptHandle, tANI_U8 *keyBytes, tANI_U32 keyLen, // Concatenate A and R[i] vos_mem_copy(in, a, ANI_SSM_AES_KEY_WRAP_BLOCK_SIZE); - vos_mem_copy(in + ANI_SSM_AES_KEY_WRAP_BLOCK_SIZE, + vos_mem_copy(in + ANI_SSM_AES_KEY_WRAP_BLOCK_SIZE, ri, ANI_SSM_AES_KEY_WRAP_BLOCK_SIZE); out = b; @@ -322,7 +322,7 @@ aes_1(v_U32_t cryptHandle, tANI_U8 *keyBytes, tANI_U32 keyLen, // Concatenate A and R[i] vos_mem_copy(in, at, ANI_SSM_AES_KEY_WRAP_BLOCK_SIZE); - vos_mem_copy(in + ANI_SSM_AES_KEY_WRAP_BLOCK_SIZE, + vos_mem_copy(in + ANI_SSM_AES_KEY_WRAP_BLOCK_SIZE, ri, ANI_SSM_AES_KEY_WRAP_BLOCK_SIZE); out = b; @@ -353,8 +353,8 @@ aes_1(v_U32_t cryptHandle, tANI_U8 *keyBytes, tANI_U32 keyLen, /* - * Put a long in host order into a char array in network order. - * + * Put a long in host order into a char array in network order. + * */ static inline char *aniAsfWr32(char *cp, tANI_U32 x) { @@ -374,8 +374,8 @@ static inline char *aniAsfWr32(char *cp, tANI_U32 x) // From file : aniAsfMisc.c /* - * Put a long in host order into a char array in network order. - * + * Put a long in host order into a char array in network order. + * */ char *aniAsfPut32(char *cp, tANI_U32 x) { @@ -394,4 +394,3 @@ xor(tANI_U8 a[ANI_SSM_AES_KEY_WRAP_BLOCK_SIZE], tANI_U32 t) a[ANI_SSM_AES_KEY_WRAP_BLOCK_SIZE-4] ^= tmp[0]; return ANI_OK; } - diff --git a/CORE/BAP/src/bapRsnSsmAesKeyWrap.h b/CORE/BAP/src/bapRsnSsmAesKeyWrap.h index 9c9efad8445b..b3a3e95b615d 100644 --- a/CORE/BAP/src/bapRsnSsmAesKeyWrap.h +++ b/CORE/BAP/src/bapRsnSsmAesKeyWrap.h @@ -59,7 +59,7 @@ typedef union uAniU32ValAry{ * blocks. The first block is the IV from section 2.2.3 o the * RFC. Note: It is the caller's responsibility to free the returned * value. - * + * * @param plainText the plaintext data to wrap * @param len the length of the plaintext, which must be a multiple of * ANI_SSM_AES_KEY_WRAP_BLOCK_SIZE. @@ -102,4 +102,3 @@ aniSsmAesKeyUnwrap(v_U32_t cryptHandle, tANI_U8 *cipherText, tANI_U32 len, #endif //_ANI_SSM_AES_KEY_WRAP_H_ - diff --git a/CORE/BAP/src/bapRsnSsmEapol.c b/CORE/BAP/src/bapRsnSsmEapol.c index 6675106bc39c..bf42b8b3593e 100644 --- a/CORE/BAP/src/bapRsnSsmEapol.c +++ b/CORE/BAP/src/bapRsnSsmEapol.c @@ -95,32 +95,32 @@ /** * Other hard coded values for convenience: */ -static const v_U8_t +static const v_U8_t ANI_ETH_P_EAPOL_BYTES[2] = {0x00, 0x03};//BT-AMP security type{0x88, 0x8e}; -static const v_U8_t +static const v_U8_t EAPOL_VERSION_BYTES[1] = {EAPOL_VERSION_1}; -static const v_U8_t +static const v_U8_t ANI_EAPOL_TYPE_PACKET_BYTES[1] = {ANI_EAPOL_TYPE_PACKET}; -static const v_U8_t +static const v_U8_t ANI_EAPOL_TYPE_START_BYTES[1] = {ANI_EAPOL_TYPE_START}; -static const v_U8_t +static const v_U8_t ANI_EAPOL_TYPE_LOGOFF_BYTES[1] = {ANI_EAPOL_TYPE_LOGOFF}; -static const v_U8_t +static const v_U8_t ANI_EAPOL_TYPE_KEY_BYTES[1] = {ANI_EAPOL_TYPE_KEY}; -static const v_U8_t +static const v_U8_t ANI_EAPOL_TYPE_ASF_ALERT_BYTES[1] = {ANI_EAPOL_TYPE_ASF_ALERT}; -static const v_U8_t +static const v_U8_t ZERO_BYTES[16] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; static v_U8_t BAP_RSN_LLC_HEADER[] = {0xAA, 0xAA, 0x03, 0x00, 0x19, 0x58 }; static int -parseRsnKeyDesc(tAniPacket *packet, +parseRsnKeyDesc(tAniPacket *packet, tAniEapolRsnKeyDesc **rsnDescPtr); static int -parseRsnKeyInfo(tAniPacket *packet, +parseRsnKeyInfo(tAniPacket *packet, tAniRsnKeyInfo *info); static int @@ -133,9 +133,9 @@ writeRsnKeyInfo(tAniPacket *packet, tAniRsnKeyInfo *info); static int writeRsnKeyMic(v_U32_t cryptHandle, - tAniPacket *eapolFrame, + tAniPacket *eapolFrame, tAniEapolRsnKeyDesc *rsnDesc, - v_U8_t *micKey, + v_U8_t *micKey, v_U32_t micKeyLen); static int @@ -146,11 +146,11 @@ checkRsnKeyMic(v_U32_t cryptHandle, v_U32_t micKeyLen); extern void authEapolHandler( tAuthRsnFsm *fsm, tAniPacket *eapolFrame, - tAniMacAddr dstMac, + tAniMacAddr dstMac, tAniMacAddr srcMac, v_U8_t *type); extern void suppEapolHandler( tSuppRsnFsm *fsm, tAniPacket *eapolFrame, - tAniMacAddr dstMac, + tAniMacAddr dstMac, tAniMacAddr srcMac, v_U8_t *type); @@ -172,14 +172,14 @@ extern void suppEapolHandler( tSuppRsnFsm *fsm, tAniPacket *eapolFrame, * @return ANI_OK if the operation succeeds */ static int -addEapolHeaders(tAniPacket *packet, - tAniMacAddr dstMac, - tAniMacAddr srcMac, +addEapolHeaders(tAniPacket *packet, + tAniMacAddr dstMac, + tAniMacAddr srcMac, v_U8_t eapolType) { int retVal; v_U16_t len; - + do { retVal = aniAsfPacketGetLen(packet); @@ -237,7 +237,7 @@ addEapolHeaders(tAniPacket *packet, * @return ANI_OK if the operation succeeds */ int -aniEapolWriteStart(tAniPacket *packet, +aniEapolWriteStart(tAniPacket *packet, tAniMacAddr dstMac, tAniMacAddr srcMac) { @@ -267,8 +267,8 @@ aniEapolWriteStart(tAniPacket *packet, * @return ANI_OK if the operation succeeds */ int -aniEapolWriteEapPacket(tAniPacket *eapPacket, - tAniMacAddr dstMac, +aniEapolWriteEapPacket(tAniPacket *eapPacket, + tAniMacAddr dstMac, tAniMacAddr srcMac) { return( addEapolHeaders(eapPacket, dstMac, srcMac, ANI_EAPOL_TYPE_PACKET) ); @@ -279,7 +279,7 @@ aniEapolWriteEapPacket(tAniPacket *eapPacket, * * FUNCTION: * Parses an EAPoL frame to the first level of headers (no EAP - * headers are parsed). + * headers are parsed). * * NOTE: This is a non-destructive read, that is the * headers are not stripped off the packet. However, any additional @@ -297,10 +297,10 @@ aniEapolWriteEapPacket(tAniPacket *eapPacket, * @return the non-negative length of the EAPOL payload if the operation * succeeds */ -int +int aniEapolParse(tAniPacket *packet, - v_U8_t **dstMac, - v_U8_t **srcMac, + v_U8_t **dstMac, + v_U8_t **srcMac, v_U8_t **type) { v_U16_t frameType; @@ -338,20 +338,20 @@ aniEapolParse(tAniPacket *packet, *type = ptr + ANI_EAPOL_TYPE_POS; retVal = (ptr[EAPOL_BODY_LEN_POS] << 8) + ptr[EAPOL_BODY_LEN_POS + 1]; - - /* - * Validate the length of the body. Allow for longer + + /* + * Validate the length of the body. Allow for longer * packets than encoded, but encoding should not be larger than * packet. * Note: EAPOL body len does not include headers */ tmp = aniAsfPacketGetLen(packet) - EAPOL_RX_HEADER_SIZE; - if (retVal > tmp) + if (retVal > tmp) { retVal = ANI_E_ILLEGAL_ARG; - } + } else { - if (retVal < tmp) + if (retVal < tmp) { retVal = aniAsfPacketTruncateFromRear(packet, tmp - retVal); } @@ -387,8 +387,8 @@ aniEapolParse(tAniPacket *packet, int aniEapolWriteKey(v_U32_t cryptHandle, tAniPacket *packet, - tAniMacAddr dstMac, - tAniMacAddr srcMac, + tAniMacAddr dstMac, + tAniMacAddr srcMac, int descType, void *keyDescData, v_U8_t *micKey, @@ -401,14 +401,14 @@ aniEapolWriteKey(v_U32_t cryptHandle, do { - if ((descType == ANI_EAPOL_KEY_DESC_TYPE_RSN_NEW) - || (descType == ANI_EAPOL_KEY_DESC_TYPE_RSN)) + if ((descType == ANI_EAPOL_KEY_DESC_TYPE_RSN_NEW) + || (descType == ANI_EAPOL_KEY_DESC_TYPE_RSN)) { retVal = writeRsnKeyDesc(packet, (tAniEapolRsnKeyDesc *) keyDescData, - // Indicate - // ANI_EAPOL_KEY_DESC_TYPE_RSN_NEW + // Indicate + // ANI_EAPOL_KEY_DESC_TYPE_RSN_NEW // or ANI_EAPOL_KEY_DESC_TYPE_RSN descType); if( !ANI_IS_STATUS_SUCCESS( retVal ) ) @@ -420,12 +420,12 @@ aniEapolWriteKey(v_U32_t cryptHandle, if( !ANI_IS_STATUS_SUCCESS(retVal) ) break; retVal = writeRsnKeyMic(cryptHandle, - packet, + packet, (tAniEapolRsnKeyDesc *) keyDescData, micKey, micKeyLen); if( !ANI_IS_STATUS_SUCCESS(retVal) ) break; - } + } else { VOS_ASSERT( 0 ); return ANI_E_ILLEGAL_ARG; @@ -480,30 +480,30 @@ aniEapolParseKey(tAniPacket *packet, { eapolFrameLen = aniAsfPacketGetLen(packet); - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO, "Supp parsing EAPOL-Key frame of len %d\n", + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO, "Supp parsing EAPOL-Key frame of len %d\n", eapolFrameLen); retVal = aniAsfPacketTruncateFromFront(packet, EAPOL_RX_HEADER_SIZE); if( !ANI_IS_STATUS_SUCCESS(retVal) ) break; - + retVal = aniAsfPacketGetBytes(packet, &bytes); if( !ANI_IS_STATUS_SUCCESS(retVal) ) break; if (*bytes == ANI_EAPOL_KEY_DESC_TYPE_RSN || - *bytes == ANI_EAPOL_KEY_DESC_TYPE_RSN_NEW) + *bytes == ANI_EAPOL_KEY_DESC_TYPE_RSN_NEW) { tAniEapolRsnKeyDesc *rsnDesc = NULL; //*descType = ANI_EAPOL_KEY_DESC_TYPE_RSN; - *descType = (*bytes == ANI_EAPOL_KEY_DESC_TYPE_RSN_NEW ? + *descType = (*bytes == ANI_EAPOL_KEY_DESC_TYPE_RSN_NEW ? ANI_EAPOL_KEY_DESC_TYPE_RSN_NEW : ANI_EAPOL_KEY_DESC_TYPE_RSN) ; retVal = parseRsnKeyDesc(packet, &rsnDesc); if( !ANI_IS_STATUS_SUCCESS(retVal) ) break; *keyDescData = rsnDesc; - } - else + } + else { - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "Supp received unknown EAPOL-Key descriptor: %d\n", *bytes); retVal = ANI_E_ILLEGAL_ARG; @@ -512,14 +512,14 @@ aniEapolParseKey(tAniPacket *packet, aniAsfPacketMoveLeft(packet, eapolFrameLen); }while( 0 ); - + return retVal; } static int -parseRsnKeyDesc(tAniPacket *packet, +parseRsnKeyDesc(tAniPacket *packet, tAniEapolRsnKeyDesc **rsnDescPtr) { int retVal = ANI_OK; @@ -531,10 +531,10 @@ parseRsnKeyDesc(tAniPacket *packet, { aniAsfPacketTruncateFromFront(packet, 1); // Desc-Type - rsnDesc = (tAniEapolRsnKeyDesc *) + rsnDesc = (tAniEapolRsnKeyDesc *) vos_mem_malloc( sizeof(tAniEapolRsnKeyDesc) ); - if (rsnDesc == NULL) + if (rsnDesc == NULL) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "Supp could not malloc EAPOL-Key Descriptor for RSN\n"); @@ -581,7 +581,7 @@ parseRsnKeyDesc(tAniPacket *packet, { break; } - vos_mem_copy(rsnDesc->keyRecvSeqCounter, bytes, len); + vos_mem_copy(rsnDesc->keyRecvSeqCounter, bytes, len); len = sizeof(rsnDesc->keyId); retVal = aniAsfPacketGetN(packet, len, &bytes); @@ -614,7 +614,7 @@ parseRsnKeyDesc(tAniPacket *packet, break; } rsnDesc->keyData = (v_U8_t*)vos_mem_malloc(len); - if (rsnDesc->keyData == NULL) + if (rsnDesc->keyData == NULL) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "Could not allocate RSN key bytes!\n"); VOS_ASSERT( 0 ); @@ -622,7 +622,7 @@ parseRsnKeyDesc(tAniPacket *packet, break; } vos_mem_copy(rsnDesc->keyData, bytes, len); - } + } else { rsnDesc->keyData = NULL; } @@ -640,7 +640,7 @@ parseRsnKeyDesc(tAniPacket *packet, } static int -parseRsnKeyInfo(tAniPacket *packet, +parseRsnKeyInfo(tAniPacket *packet, tAniRsnKeyInfo *info) { v_U16_t tmp; @@ -652,13 +652,13 @@ parseRsnKeyInfo(tAniPacket *packet, return retVal; } - info->keyDescVers = (tmp & ANI_SSM_RSN_KEY_DESC_VERS_MASK) + info->keyDescVers = (tmp & ANI_SSM_RSN_KEY_DESC_VERS_MASK) >> ANI_SSM_RSN_KEY_DESC_VERS_OFFSET; if (info->keyDescVers != ANI_EAPOL_KEY_DESC_VERS_RC4 && info->keyDescVers != ANI_EAPOL_KEY_DESC_VERS_AES) return ANI_E_ILLEGAL_ARG; - info->unicastFlag = (tmp & ANI_SSM_RSN_UNICAST_MASK) ? + info->unicastFlag = (tmp & ANI_SSM_RSN_UNICAST_MASK) ? eANI_BOOLEAN_TRUE : eANI_BOOLEAN_FALSE; info->keyId = (tmp & ANI_SSM_RSN_KEY_INDEX_MASK) >> ANI_SSM_RSN_KEY_INDEX_OFFSET; @@ -682,7 +682,7 @@ parseRsnKeyInfo(tAniPacket *packet, static int -writeRsnKeyDesc(tAniPacket *packet, +writeRsnKeyDesc(tAniPacket *packet, tAniEapolRsnKeyDesc *rsnDesc, v_U8_t keyDescType) { @@ -701,44 +701,44 @@ writeRsnKeyDesc(tAniPacket *packet, retVal = aniAsfPacketAppend16(packet, rsnDesc->keyLen); if( !ANI_IS_STATUS_SUCCESS( retVal ) ) break; - retVal = aniAsfPacketAppendBuffer(packet, + retVal = aniAsfPacketAppendBuffer(packet, rsnDesc->replayCounter, sizeof(rsnDesc->replayCounter)); if( !ANI_IS_STATUS_SUCCESS( retVal ) ) break; - retVal = aniAsfPacketAppendBuffer(packet, - rsnDesc->keyNonce, + retVal = aniAsfPacketAppendBuffer(packet, + rsnDesc->keyNonce, sizeof(rsnDesc->keyNonce)); if( !ANI_IS_STATUS_SUCCESS( retVal ) ) break; - retVal = aniAsfPacketAppendBuffer(packet, - rsnDesc->keyIv, + retVal = aniAsfPacketAppendBuffer(packet, + rsnDesc->keyIv, sizeof(rsnDesc->keyIv)); if( !ANI_IS_STATUS_SUCCESS( retVal ) ) break; - retVal = aniAsfPacketAppendBuffer(packet, - rsnDesc->keyRecvSeqCounter, + retVal = aniAsfPacketAppendBuffer(packet, + rsnDesc->keyRecvSeqCounter, sizeof(rsnDesc->keyRecvSeqCounter)); if( !ANI_IS_STATUS_SUCCESS( retVal ) ) break; - retVal = aniAsfPacketAppendBuffer(packet, - rsnDesc->keyId, + retVal = aniAsfPacketAppendBuffer(packet, + rsnDesc->keyId, sizeof(rsnDesc->keyId)); if( !ANI_IS_STATUS_SUCCESS( retVal ) ) break; // Zero out the key MIC - retVal = aniAsfPacketAppendBuffer(packet, - ZERO_BYTES, + retVal = aniAsfPacketAppendBuffer(packet, + ZERO_BYTES, sizeof(rsnDesc->keyMic)); if( !ANI_IS_STATUS_SUCCESS( retVal ) ) break; retVal = aniAsfPacketAppend16(packet, rsnDesc->keyDataLen); if( !ANI_IS_STATUS_SUCCESS( retVal ) ) break; - if (rsnDesc->keyDataLen != 0) + if (rsnDesc->keyDataLen != 0) { - retVal = aniAsfPacketAppendBuffer(packet, - rsnDesc->keyData, + retVal = aniAsfPacketAppendBuffer(packet, + rsnDesc->keyData, rsnDesc->keyDataLen); if( !ANI_IS_STATUS_SUCCESS( retVal ) ) break; } @@ -784,10 +784,10 @@ writeRsnKeyInfo(tAniPacket *packet, tAniRsnKeyInfo *info) if (info->requestFlag) infoValue |= ANI_SSM_RSN_REQUEST_MASK; - + if (info->encKeyDataFlag) infoValue |= ANI_SSM_RSN_ENC_KEY_DATA_MASK; - + retVal = aniAsfPacketAppend16(packet, infoValue); return retVal; @@ -796,9 +796,9 @@ writeRsnKeyInfo(tAniPacket *packet, tAniRsnKeyInfo *info) static int writeRsnKeyMic(v_U32_t cryptHandle, - tAniPacket *eapolFrame, + tAniPacket *eapolFrame, tAniEapolRsnKeyDesc *rsnDesc, - v_U8_t *micKey, + v_U8_t *micKey, v_U32_t micKeyLen) { int retVal = ANI_OK; @@ -810,18 +810,18 @@ writeRsnKeyMic(v_U32_t cryptHandle, // Sanity check the arguments and return if no MIC generation is // needed - if (micKey != NULL) + if (micKey != NULL) { - if (micKeyLen == 0 || !rsnDesc->info.micFlag) + if (micKeyLen == 0 || !rsnDesc->info.micFlag) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "Supp MIC key provided but micKeyLen or micFlag is not set!\n"); VOS_ASSERT( 0 ); return ANI_E_ILLEGAL_ARG; } - } + } else { - if (rsnDesc->info.micFlag) + if (rsnDesc->info.micFlag) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "Supp micFlag is set but MIC key not provided!\n"); @@ -847,7 +847,7 @@ writeRsnKeyMic(v_U32_t cryptHandle, ptr += EAPOL_VERSION_POS + SNAP_HEADER_SIZE; len -= (EAPOL_VERSION_POS + SNAP_HEADER_SIZE); - if (rsnDesc->info.keyDescVers == ANI_EAPOL_KEY_DESC_VERS_AES) + if (rsnDesc->info.keyDescVers == ANI_EAPOL_KEY_DESC_VERS_AES) { if( VOS_IS_STATUS_SUCCESS( vos_sha1_hmac_str(cryptHandle, ptr, len, micKey, micKeyLen, result) ) ) { @@ -857,13 +857,13 @@ writeRsnKeyMic(v_U32_t cryptHandle, { retVal = ANI_ERROR; } - } + } else { VOS_ASSERT( 0 ); retVal = ANI_E_ILLEGAL_ARG; } - if (retVal == ANI_OK) + if (retVal == ANI_OK) { // Copy only 16B which is the smaller of the two and the same as // ANI_EAPOL_KEY_RSN_MIC_SIZE @@ -893,10 +893,10 @@ aniEapolKeyCheckMic(v_U32_t cryptHandle, v_U8_t *micKey, v_U32_t micKeyLen) { - if (descType == ANI_EAPOL_KEY_DESC_TYPE_RSN_NEW) + if (descType == ANI_EAPOL_KEY_DESC_TYPE_RSN_NEW) { return checkRsnKeyMic(cryptHandle, eapolFrame, keyDescData, micKey, micKeyLen); - } + } else { VOS_ASSERT( 0 ); return ANI_E_ILLEGAL_ARG; @@ -909,7 +909,7 @@ checkRsnKeyMic(v_U32_t cryptHandle, tAniPacket *eapolFrame, tAniEapolRsnKeyDesc *rsnDesc, v_U8_t *micKey, - v_U32_t micKeyLen) + v_U32_t micKeyLen) { int retVal = ANI_ERROR; int len; @@ -920,7 +920,7 @@ checkRsnKeyMic(v_U32_t cryptHandle, v_U8_t result[VOS_DIGEST_SHA1_SIZE]; // Larger of the two v_U8_t incomingMic[ANI_EAPOL_KEY_RSN_MIC_SIZE]; - if (!rsnDesc->info.micFlag) + if (!rsnDesc->info.micFlag) { VOS_ASSERT( 0 ); return ANI_E_ILLEGAL_ARG; @@ -939,19 +939,19 @@ checkRsnKeyMic(v_U32_t cryptHandle, vos_mem_copy( incomingMic, micPos, ANI_EAPOL_KEY_RSN_MIC_SIZE ); vos_mem_zero( micPos, ANI_EAPOL_KEY_RSN_MIC_SIZE ); - if (rsnDesc->info.keyDescVers == ANI_EAPOL_KEY_DESC_VERS_AES) + if (rsnDesc->info.keyDescVers == ANI_EAPOL_KEY_DESC_VERS_AES) { if( VOS_IS_STATUS_SUCCESS( vos_sha1_hmac_str(cryptHandle, ptr, len, micKey, micKeyLen, result) ) ) { retVal = ANI_OK; } - } + } else { VOS_ASSERT( 0 ); retVal = ANI_E_ILLEGAL_ARG; } - if (retVal == ANI_OK) + if (retVal == ANI_OK) { if ( !vos_mem_compare(incomingMic, result, ANI_EAPOL_KEY_RSN_MIC_SIZE)) { @@ -980,15 +980,15 @@ aniEapolKeyFreeDesc(int descType, void *keyDescData) if( keyDescData ) { - if ((descType == ANI_EAPOL_KEY_DESC_TYPE_RSN_NEW) - || (descType == ANI_EAPOL_KEY_DESC_TYPE_RSN)) + if ((descType == ANI_EAPOL_KEY_DESC_TYPE_RSN_NEW) + || (descType == ANI_EAPOL_KEY_DESC_TYPE_RSN)) { rsnDesc = (tAniEapolRsnKeyDesc *) keyDescData; if (rsnDesc->keyData != NULL) vos_mem_free(rsnDesc->keyData); - } + } else { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, @@ -1005,7 +1005,7 @@ aniEapolKeyFreeDesc(int descType, void *keyDescData) v_U8_t * aniEapolType2Str(v_U8_t type) { - switch (type) + switch (type) { case ANI_EAPOL_TYPE_PACKET: return (v_U8_t *)ANI_EAPOL_TYPE_PACKET_STR; @@ -1060,7 +1060,7 @@ void bapRsnEapolHandler( v_PVOID_t pvFsm, tAniPacket *packet, v_BOOL_t fIsAuth ) VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "eapolHandler Received bad EAPOL message of len %d (status=%d)\n", aniAsfPacketGetLen(packet), retVal ); - } + } aniAsfPacketFree( packet ); } @@ -1082,7 +1082,7 @@ int bapRsnFormPktFromVosPkt( tAniPacket **ppPacket, vos_pkt_t *pVosPacket ) if( (uPktLen < BAP_RSN_ETHERNET_3_HEADER_LEN) ) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, - " authRsnRxFrameHandler receive eapol packet size (%d) too small (%d)\n", + " authRsnRxFrameHandler receive eapol packet size (%d) too small (%d)\n", uPktLen, BAP_RSN_ETHERNET_3_HEADER_LEN ); break; } @@ -1092,7 +1092,7 @@ int bapRsnFormPktFromVosPkt( tAniPacket **ppPacket, vos_pkt_t *pVosPacket ) if( !ANI_IS_STATUS_SUCCESS( retVal ) ) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, - " authRsnRxFrameHandler failed to get buffer size (%d) \n", + " authRsnRxFrameHandler failed to get buffer size (%d) \n", uPktLen ); break; } @@ -1110,12 +1110,12 @@ int bapRsnFormPktFromVosPkt( tAniPacket **ppPacket, vos_pkt_t *pVosPacket ) break; } - retVal = aniAsfPacketAppendBuffer( pAniPacket, pFrame + BAP_RSN_ETHERNET_3_HEADER_LEN, + retVal = aniAsfPacketAppendBuffer( pAniPacket, pFrame + BAP_RSN_ETHERNET_3_HEADER_LEN, uPktLen ); - if( !ANI_IS_STATUS_SUCCESS( retVal ) ) + if( !ANI_IS_STATUS_SUCCESS( retVal ) ) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, - " authRsnRxFrameHandler cannot retrieve eapol payload size (%d)\n", + " authRsnRxFrameHandler cannot retrieve eapol payload size (%d)\n", uPktLen ); break; } @@ -1132,5 +1132,3 @@ int bapRsnFormPktFromVosPkt( tAniPacket **ppPacket, vos_pkt_t *pVosPacket ) return retVal; } - - diff --git a/CORE/BAP/src/bapRsnSsmEapol.h b/CORE/BAP/src/bapRsnSsmEapol.h index fba9d3d639e8..8cbff4364373 100644 --- a/CORE/BAP/src/bapRsnSsmEapol.h +++ b/CORE/BAP/src/bapRsnSsmEapol.h @@ -64,7 +64,7 @@ #define SNAP_HEADER_SIZE 8 #define ANI_EAPOL_KEY_DESC_TYPE_LEGACY_RC4 1 -// JEZ20041012 This needs to be fixed. This needs to support BOTH +// JEZ20041012 This needs to be fixed. This needs to support BOTH // the older WPA Key Descriptor type of 254 AS WELL AS the newer // Key Descriptor type of 2 #define ANI_EAPOL_KEY_DESC_TYPE_RSN 254 @@ -174,8 +174,8 @@ aniEapolWriteStart(tAniPacket *packet, * @return ANI_OK if the operation succeeds */ int -aniEapolWriteEapPacket(tAniPacket *eapPacket, - tAniMacAddr dstMac, +aniEapolWriteEapPacket(tAniPacket *eapPacket, + tAniMacAddr dstMac, tAniMacAddr srcMac); /** @@ -183,7 +183,7 @@ aniEapolWriteEapPacket(tAniPacket *eapPacket, * * FUNCTION: * Parses an EAPoL frame to the first level of headers (no EAP - * headers are parsed). + * headers are parsed). * * NOTE: This is a non-destructive read, that is the * headers are not stripped off the packet. However, any additional @@ -201,10 +201,10 @@ aniEapolWriteEapPacket(tAniPacket *eapPacket, * @return the non-negative length of the EAPOL payload if the operation * succeeds */ -int +int aniEapolParse(tAniPacket *packet, - v_U8_t **dstMac, - v_U8_t **srcMac, + v_U8_t **dstMac, + v_U8_t **srcMac, v_U8_t **type); /** @@ -234,8 +234,8 @@ aniEapolParse(tAniPacket *packet, int aniEapolWriteKey(v_U32_t cryptHandle, tAniPacket *packet, - tAniMacAddr dstMac, - tAniMacAddr srcMac, + tAniMacAddr dstMac, + tAniMacAddr srcMac, int descType, void *keyDescData, v_U8_t *micKey, diff --git a/CORE/BAP/src/bapRsnSsmReplayCtr.c b/CORE/BAP/src/bapRsnSsmReplayCtr.c index f6eac3824dc2..c59de6862636 100644 --- a/CORE/BAP/src/bapRsnSsmReplayCtr.c +++ b/CORE/BAP/src/bapRsnSsmReplayCtr.c @@ -93,7 +93,7 @@ updateCtrBuf(tAniSsmReplayCtr *ctr); * @return ANI_OK if the operation succeeds */ int -aniSsmReplayCtrCreate(v_U32_t cryptHandle, tAniSsmReplayCtr **ctrPtr, +aniSsmReplayCtrCreate(v_U32_t cryptHandle, tAniSsmReplayCtr **ctrPtr, v_U8_t size, int initValue) { @@ -106,7 +106,7 @@ aniSsmReplayCtrCreate(v_U32_t cryptHandle, tAniSsmReplayCtr **ctrPtr, } ctr->buf = vos_mem_malloc( size ); - if (ctr->buf == NULL) + if (ctr->buf == NULL) { VOS_ASSERT( 0 ); vos_mem_free(ctr); @@ -122,13 +122,13 @@ aniSsmReplayCtrCreate(v_U32_t cryptHandle, tAniSsmReplayCtr **ctrPtr, // If initValue is negative, initialize the ctr randomly, else // initialize it to what the user specified. - if (initValue < 0) + if (initValue < 0) { if( !VOS_IS_STATUS_SUCCESS( vos_rand_get_bytes(cryptHandle, ctr->buf, ctr->size) ) ) { return ANI_ERROR; } - } + } else { ctr->currentValue = initValue - 1; } @@ -150,7 +150,7 @@ updateCtrBuf(tAniSsmReplayCtr *ctr) numBytes = (4 <= ctr->size) ? 4 : ctr->size; offset = 4 - numBytes; - vos_mem_copy(ctr->buf + ctr->size - numBytes, + vos_mem_copy(ctr->buf + ctr->size - numBytes, ((v_U8_t *) &tmp) + offset, numBytes); return ANI_OK; @@ -160,7 +160,7 @@ updateCtrBuf(tAniSsmReplayCtr *ctr) * aniSsmReplayCtrCmp * * Used to check if the passed in value is greater - * than, less than, or the same as the previous value. + * than, less than, or the same as the previous value. * * Can be used on the TX side to determine if the response to a * request contains the same counter as the one in the request. diff --git a/CORE/BAP/src/bapRsnSsmReplayCtr.h b/CORE/BAP/src/bapRsnSsmReplayCtr.h index e5c3bd2f3f05..59c842929617 100644 --- a/CORE/BAP/src/bapRsnSsmReplayCtr.h +++ b/CORE/BAP/src/bapRsnSsmReplayCtr.h @@ -79,7 +79,7 @@ typedef struct sAniSsmReplayCtr tAniSsmReplayCtr; * @return ANI_OK if the operation succeeds */ int -aniSsmReplayCtrCreate(v_U32_t cryptHandle, tAniSsmReplayCtr **ctrPtr, +aniSsmReplayCtrCreate(v_U32_t cryptHandle, tAniSsmReplayCtr **ctrPtr, v_U8_t size, int initValue); @@ -87,7 +87,7 @@ aniSsmReplayCtrCreate(v_U32_t cryptHandle, tAniSsmReplayCtr **ctrPtr, * aniSsmReplayCtrCmp * * Used to check if the passed in value is greater - * than, less than, or the same as the previous value. + * than, less than, or the same as the previous value. * * Can be used on the TX side to determine if the response to a * request contains the same counter as the one in the request. diff --git a/CORE/BAP/src/bapRsnSsmServices.h b/CORE/BAP/src/bapRsnSsmServices.h index 7bbbc0863ec5..41ad73926461 100644 --- a/CORE/BAP/src/bapRsnSsmServices.h +++ b/CORE/BAP/src/bapRsnSsmServices.h @@ -29,7 +29,7 @@ * $File: //depot/software/projects/feature_branches/gen5_phase1/os/linux/classic/ap/apps/include/aniSsmServices.h $ * * Contains definitions of common types that the SSM exports to other - * modules. + * modules. * * Author: Mayank D. Upadhyay * Date: 23-January-2003 @@ -71,7 +71,7 @@ /* * PMKSA ID data type - * (PMKID is an HMAC-SHA1-128 value) + * (PMKID is an HMAC-SHA1-128 value) */ #define ANI_AAG_PMKID_SIZE 16 @@ -137,7 +137,7 @@ typedef struct sAniSsmUserId { /* * PMKSA ID data type - * (PMKID is an HMAC-SHA1-128 value) + * (PMKID is an HMAC-SHA1-128 value) */ typedef v_U8_t tAniSsmPmkId[ANI_AAG_PMKID_SIZE]; @@ -199,7 +199,7 @@ aniSsmIsStaMacAllowed(const tAniMacAddr staMac, const tAniSSID *ssid); * open-auth in the lowest security level, the STA is required to * initiate EAPOL in order to establish WEP keys, or WEP cannot be not * used.) - * + * * @param secMode the security mode that is in force * @param macAuthType the MAC-level authentication type to check * @param ieLen is set 0 if no RSN IE is present, or to the number of @@ -216,7 +216,7 @@ aniSsmIsStaMacAllowed(const tAniMacAddr staMac, const tAniSSID *ssid); */ v_BOOL_t aniSsmIsSecModeAllowed(v_U32_t secMode, - tAniAuthType macAuthType, + tAniAuthType macAuthType, v_U8_t ieLen, v_U8_t *ieData, v_BOOL_t bpIndicator, diff --git a/CORE/BAP/src/bapRsnTxRx.c b/CORE/BAP/src/bapRsnTxRx.c index 60c05f340cc9..654e8eefbeed 100644 --- a/CORE/BAP/src/bapRsnTxRx.c +++ b/CORE/BAP/src/bapRsnTxRx.c @@ -76,7 +76,7 @@ static VOS_STATUS bapRsnAcquirePacket( vos_pkt_t **ppPacket, v_U8_t **ppData, v_ VOS_STATUS status; vos_pkt_t *pPacket = NULL; - status = vos_pkt_get_packet( &pPacket, VOS_PKT_TYPE_TX_802_11_MGMT, size, 1, + status = vos_pkt_get_packet( &pPacket, VOS_PKT_TYPE_TX_802_11_MGMT, size, 1, VOS_TRUE, NULL, NULL ); if( VOS_IS_STATUS_SUCCESS( status ) ) { @@ -105,11 +105,11 @@ static VOS_STATUS bapRsnAcquirePacket( vos_pkt_t **ppPacket, v_U8_t **ppData, v_ static VOS_STATUS bapRsnTxCompleteCallback( v_PVOID_t pvosGCtx, vos_pkt_t *pPacket, VOS_STATUS retStatus ) { int retVal; - ptBtampContext btampContext; // use btampContext value + ptBtampContext btampContext; // use btampContext value tCsrRoamSetKey setKeyInfo; tSuppRsnFsm *fsm; - if (NULL == pvosGCtx) + if (NULL == pvosGCtx) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "pvosGCtx is NULL in %s", __func__); @@ -117,8 +117,8 @@ static VOS_STATUS bapRsnTxCompleteCallback( v_PVOID_t pvosGCtx, vos_pkt_t *pPack return VOS_STATUS_E_FAULT; } - btampContext = VOS_GET_BAP_CB(pvosGCtx); - if (NULL == btampContext) + btampContext = VOS_GET_BAP_CB(pvosGCtx); + if (NULL == btampContext) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "btampContext is NULL in %s", __func__); @@ -127,7 +127,7 @@ static VOS_STATUS bapRsnTxCompleteCallback( v_PVOID_t pvosGCtx, vos_pkt_t *pPack } fsm = &btampContext->uFsm.suppFsm; - if (NULL == fsm) + if (NULL == fsm) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "fsm is NULL in %s", __func__); @@ -136,7 +136,7 @@ static VOS_STATUS bapRsnTxCompleteCallback( v_PVOID_t pvosGCtx, vos_pkt_t *pPack } //If we get a disconect from upper layer before getting the pkt from TL the - //bapRsnFsmTxCmpHandler could be NULL + //bapRsnFsmTxCmpHandler could be NULL //VOS_ASSERT( bapRsnFsmTxCmpHandler ); if( bapRsnFsmTxCmpHandler ) @@ -162,7 +162,7 @@ static VOS_STATUS bapRsnTxCompleteCallback( v_PVOID_t pvosGCtx, vos_pkt_t *pPack vos_mem_copy( setKeyInfo.peerMac, fsm->suppCtx->authMac, sizeof( tAniMacAddr ) ); setKeyInfo.paeRole = 0; //this is a supplicant setKeyInfo.keyId = 0; //always - setKeyInfo.keyLength = CSR_AES_KEY_LEN; + setKeyInfo.keyLength = CSR_AES_KEY_LEN; vos_mem_copy( setKeyInfo.Key, (v_U8_t *)fsm->suppCtx->ptk + (2 * CSR_AES_KEY_LEN ), CSR_AES_KEY_LEN ); if( !VOS_IS_STATUS_SUCCESS( bapSetKey( fsm->ctx->pvosGCtx, &setKeyInfo ) ) ) @@ -197,7 +197,7 @@ static VOS_STATUS bapRsnTxFrame( v_PVOID_t pvosGCtx, vos_pkt_t *pPacket ) /* \brief bapRsnSendEapolFrame - To push an eapol frame to TL. + To push an eapol frame to TL. \param pAniPkt - a ready eapol frame that is prepared in tAniPacket format */ @@ -269,5 +269,3 @@ VOS_STATUS bapRsnRegisterRxCallback( v_PVOID_t pvosGCtx ) return ( status ); } - - diff --git a/CORE/BAP/src/bapRsnTxRx.h b/CORE/BAP/src/bapRsnTxRx.h index 963694bcc1d7..61ce6f0bff71 100644 --- a/CORE/BAP/src/bapRsnTxRx.h +++ b/CORE/BAP/src/bapRsnTxRx.h @@ -49,7 +49,7 @@ typedef int (*pnfRxFrameHandler)( v_PVOID_t pvosGCtx, vos_pkt_t *pPacket ); /* \brief bapRsnSendEapolFrame - To push an eapol frame to TL. + To push an eapol frame to TL. \param pAniPkt - a ready eapol frame that is prepared in tAniPacket format */ @@ -79,7 +79,3 @@ VOS_STATUS bapRsnRegisterRxCallback( v_PVOID_t pvosGCtx ); VOS_STATUS bapRsnRxCallback(v_PVOID_t pv, vos_pkt_t *pPacket); #endif //__BAPRSN_TXRX_H - - - - diff --git a/CORE/BAP/src/btampFsm.c b/CORE/BAP/src/btampFsm.c index 643306498da5..15534b6da942 100644 --- a/CORE/BAP/src/btampFsm.c +++ b/CORE/BAP/src/btampFsm.c @@ -101,7 +101,7 @@ typedef struct sAniSirGlobal *tpAniSirGlobal; #if 0 /* - * Event-related Defines. + * Event-related Defines. * - Ultimately, these events will be values * - from an enumeration. That are set by some * - of the following events. @@ -122,7 +122,7 @@ typedef struct sAniSirGlobal *tpAniSirGlobal; #endif /* 0 */ -/*Min and max channel values in 2.4GHz band for operational channel validation +/*Min and max channel values in 2.4GHz band for operational channel validation on connect*/ #define WLAN_BAP_MIN_24G_CH 1 #define WLAN_BAP_MAX_24G_CH 14 @@ -131,8 +131,8 @@ typedef struct sAniSirGlobal *tpAniSirGlobal; /* The HCI Disconnect Logical Link Complete Event signalling routine*/ VOS_STATUS signalHCIDiscLogLinkCompEvent -( - ptBtampContext btampContext, /* btampContext value */ +( + ptBtampContext btampContext, /* btampContext value */ v_U8_t status, /* the BT-AMP status */ v_U16_t log_link_handle, /* The Logical Link that disconnected*/ v_U8_t reason /* the BT-AMP reason code */ @@ -161,27 +161,27 @@ bapSetKey( v_PVOID_t pvosGCtx, tCsrRoamSetKey *pSetKeyInfo ) { tWLAN_BAPEvent bapEvent; /* State machine event */ VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; - ptBtampContext btampContext; /* use btampContext value */ + ptBtampContext btampContext; /* use btampContext value */ v_U8_t status; /* return the BT-AMP status here */ eHalStatus halStatus; v_U32_t roamId = 0xFF; tHalHandle hHal = NULL; - v_U8_t groupMac[ANI_MAC_ADDR_SIZE] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}; - - /* Validate params */ + v_U8_t groupMac[ANI_MAC_ADDR_SIZE] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}; + + /* Validate params */ if ((pvosGCtx == NULL) || (pSetKeyInfo == NULL)) { return VOS_STATUS_E_FAULT; } - btampContext = VOS_GET_BAP_CB(pvosGCtx); - /* Validate params */ + btampContext = VOS_GET_BAP_CB(pvosGCtx); + /* Validate params */ if ( btampContext == NULL) { return VOS_STATUS_E_FAULT; } hHal = VOS_GET_HAL_CB(btampContext->pvosGCtx); - if (NULL == hHal) + if (NULL == hHal) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "hHal is NULL in %s", __func__); @@ -191,46 +191,46 @@ bapSetKey( v_PVOID_t pvosGCtx, tCsrRoamSetKey *pSetKeyInfo ) VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "%s: btampContext value: %p", __func__, btampContext); - /* Fill in the event structure */ + /* Fill in the event structure */ bapEvent.event = eWLAN_BAP_RSN_SUCCESS; bapEvent.params = NULL; - /* Signal the successful RSN auth and key exchange event */ - /* (You have to signal BEFORE calling sme_RoamSetKey) */ + /* Signal the successful RSN auth and key exchange event */ + /* (You have to signal BEFORE calling sme_RoamSetKey) */ vosStatus = btampFsm(btampContext, &bapEvent, &status); - /* Set the Pairwise Key */ - halStatus = sme_RoamSetKey( - hHal, - btampContext->sessionId, - pSetKeyInfo, + /* Set the Pairwise Key */ + halStatus = sme_RoamSetKey( + hHal, + btampContext->sessionId, + pSetKeyInfo, &roamId ); if ( halStatus != eHAL_STATUS_SUCCESS ) { - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "[%4d] sme_RoamSetKey returned ERROR status= %d", __LINE__, halStatus ); return VOS_STATUS_E_FAULT; } - - /* Set the Group Key */ + + /* Set the Group Key */ vos_mem_copy( pSetKeyInfo->peerMac, groupMac, sizeof( tAniMacAddr ) ); - halStatus = sme_RoamSetKey( - hHal, - btampContext->sessionId, - pSetKeyInfo, + halStatus = sme_RoamSetKey( + hHal, + btampContext->sessionId, + pSetKeyInfo, &roamId ); if ( halStatus != eHAL_STATUS_SUCCESS ) { - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "[%4d] sme_RoamSetKey returned ERROR status= %d", __LINE__, halStatus ); return VOS_STATUS_E_FAULT; } - + return vosStatus; } /* - * Debug-related Defines. + * Debug-related Defines. * - Ultimately, these events will be values * - from an enumeration. That are set by some * - of the following events. @@ -249,21 +249,21 @@ bapSetKey( v_PVOID_t pvosGCtx, tCsrRoamSetKey *pSetKeyInfo ) #endif /* - * State transition procedures + * State transition procedures */ VOS_STATUS gotoS1 -( - ptBtampContext btampContext, /* btampContext value */ +( + ptBtampContext btampContext, /* btampContext value */ ptWLAN_BAPEvent bapEvent, /* State machine event */ tWLAN_BAPRole BAPDeviceRole, v_U8_t *status /* return the BT-AMP status here */ -) +) { - tBtampTLVHCI_Create_Physical_Link_Cmd *pBapHCIPhysLinkCreate + tBtampTLVHCI_Create_Physical_Link_Cmd *pBapHCIPhysLinkCreate = (tBtampTLVHCI_Create_Physical_Link_Cmd *) bapEvent->params; - tBtampTLVHCI_Accept_Physical_Link_Cmd *pBapHCIPhysLinkAccept + tBtampTLVHCI_Accept_Physical_Link_Cmd *pBapHCIPhysLinkAccept = (tBtampTLVHCI_Accept_Physical_Link_Cmd *) bapEvent->params; VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; v_U32_t conAcceptTOInterval; @@ -280,20 +280,20 @@ gotoS1 /* Copy out the key material from the HCI command */ btampContext->key_type = pBapHCIPhysLinkCreate->key_type; btampContext->key_length = pBapHCIPhysLinkCreate->key_length; - vos_mem_copy( - btampContext->key_material, - pBapHCIPhysLinkCreate->key_material, + vos_mem_copy( + btampContext->key_material, + pBapHCIPhysLinkCreate->key_material, 32); /* Need a key size define */ break; case BT_RESPONDER: /* Copy down the phy_link_handle value */ btampContext->phy_link_handle = pBapHCIPhysLinkAccept->phy_link_handle; /* Copy out the key material from the HCI command */ - btampContext->key_type = pBapHCIPhysLinkAccept->key_type; - btampContext->key_length = pBapHCIPhysLinkAccept->key_length; - vos_mem_copy( - btampContext->key_material, - pBapHCIPhysLinkAccept->key_material, + btampContext->key_type = pBapHCIPhysLinkAccept->key_type; + btampContext->key_length = pBapHCIPhysLinkAccept->key_length; + vos_mem_copy( + btampContext->key_material, + pBapHCIPhysLinkAccept->key_material, 32); /* Need a key size define */ break; default: @@ -303,19 +303,19 @@ gotoS1 conAcceptTOInterval = (btampContext->bapConnectionAcceptTimerInterval * 5)/ 8; /* Start the Connection Accept Timer */ - vosStatus = WLANBAP_StartConnectionAcceptTimer ( - btampContext, + vosStatus = WLANBAP_StartConnectionAcceptTimer ( + btampContext, conAcceptTOInterval); *status = WLANBAP_STATUS_SUCCESS; /* return the BT-AMP status here */ - + return VOS_STATUS_SUCCESS; } //gotoS1 VOS_STATUS gotoScanning -( - ptBtampContext btampContext, /* btampContext value */ +( + ptBtampContext btampContext, /* btampContext value */ tWLAN_BAPRole BAPDeviceRole, v_U8_t *status /* return the BT-AMP status here */ ) @@ -330,7 +330,7 @@ gotoScanning #if 0 /*========================================================================== - + FUNCTION: convertRoleToBssType DESCRIPTION: Return one of the following values: @@ -340,26 +340,26 @@ gotoScanning eCSR_BSS_TYPE_START_IBSS, // an IBSS network we will start if no partners detected. eCSR_BSS_TYPE_WDS_AP, // BT-AMP AP eCSR_BSS_TYPE_WDS_STA, // BT-AMP station - eCSR_BSS_TYPE_ANY, + eCSR_BSS_TYPE_ANY, ============================================================================*/ #endif -eCsrRoamBssType +eCsrRoamBssType convertRoleToBssType ( tWLAN_BAPRole bapRole /* BT-AMP role */ -) +) { switch (bapRole) { - case BT_RESPONDER: + case BT_RESPONDER: // an WDS network we will join - return eCSR_BSS_TYPE_WDS_STA; - //return eCSR_BSS_TYPE_INFRASTRUCTURE; + return eCSR_BSS_TYPE_WDS_STA; + //return eCSR_BSS_TYPE_INFRASTRUCTURE; //return eCSR_BSS_TYPE_IBSS; // Initial testing with IBSS on both ends makes more sense - case BT_INITIATOR: + case BT_INITIATOR: // an WDS network we will start if no partners detected. - return eCSR_BSS_TYPE_WDS_AP; - //return eCSR_BSS_TYPE_START_IBSS; // I really should try IBSS on both ends + return eCSR_BSS_TYPE_WDS_AP; + //return eCSR_BSS_TYPE_START_IBSS; // I really should try IBSS on both ends default: return eCSR_BSS_TYPE_INFRASTRUCTURE; } @@ -373,7 +373,7 @@ char hexValue[] = {'0', '1', '2', '3', '4', '5', '6', '7', #define BAP_MIN(x, y) ((x) < (y) ? (x) : (y)) #define MAX_BYTES 8 // Each byte will be converted to hex digits followed by a -// punctuation (which is specified in the "delimiter" param.) Thus +// punctuation (which is specified in the "delimiter" param.) Thus // allocate three times the storage. v_U8_t * bapBin2Hex(const v_U8_t *bytes, v_U32_t len, char delimiter) @@ -402,23 +402,23 @@ bapBin2Hex(const v_U8_t *bytes, v_U32_t len, char delimiter) char bapSsidPrefixValue[] = {'A', 'M', 'P', '-'}; -v_U8_t * +v_U8_t * convertBSSIDToSSID ( v_U8_t *bssid /* BSSID value */ -) +) { - static v_U8_t ssId[32]; + static v_U8_t ssId[32]; - vos_mem_copy( - ssId, - bapSsidPrefixValue, - 4); + vos_mem_copy( + ssId, + bapSsidPrefixValue, + 4); - vos_mem_copy( - &ssId[4], + vos_mem_copy( + &ssId[4], bapBin2Hex(bssid, 6, '-'), - 17); + 17); return ssId; } // convertBSSIDToSSID @@ -426,12 +426,12 @@ convertBSSIDToSSID VOS_STATUS convertToCsrProfile ( - ptBtampContext btampContext, /* btampContext value */ + ptBtampContext btampContext, /* btampContext value */ eCsrRoamBssType bssType, tCsrRoamProfile *pProfile /* return the profile info here */ -) +) { - static v_U8_t btampRSNIE[] = {0x30, 0x14, 0x01, 0x00, 0x00, 0x0f, 0xac, 0x04, 0x01, 0x00, + static v_U8_t btampRSNIE[] = {0x30, 0x14, 0x01, 0x00, 0x00, 0x0f, 0xac, 0x04, 0x01, 0x00, 0x00, 0x0f, 0xac, 0x04, 0x01, 0x00, 0x00, 0x0f, 0xac, 0x02, 0x00, 0x00 }; VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; @@ -442,7 +442,7 @@ convertToCsrProfile v_U8_t firstChannel; v_U8_t numChannels; /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ - if (NULL == btampContext) + if (NULL == btampContext) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "btampContext is NULL in %s", __func__); @@ -451,7 +451,7 @@ convertToCsrProfile } hHal = VOS_GET_HAL_CB(btampContext->pvosGCtx); - if (NULL == hHal) + if (NULL == hHal) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "hHal is NULL in %s", __func__); @@ -463,86 +463,86 @@ convertToCsrProfile //vos_mem_zero(pProfile,sizeof(tCsrRoamProfile)); //Set the BSS Type - //pProfile->BSSType = convertRoleToBssType(btampContext->BAPDeviceRole ); - pProfile->BSSType = bssType; + //pProfile->BSSType = convertRoleToBssType(btampContext->BAPDeviceRole ); + pProfile->BSSType = bssType; //pProfile->BSSType = eCSR_BSS_TYPE_INFRASTRUCTURE; //Set the SSID - if ( bssType == eCSR_BSS_TYPE_WDS_STA) + if ( bssType == eCSR_BSS_TYPE_WDS_STA) { pProfile->SSIDs.numOfSSIDs = 2; VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "%s: bssType = %s, SSID specified = %s\n", __func__, "eCSR_BSS_TYPE_WDS_STA", convertBSSIDToSSID(btampContext->btamp_Remote_AMP_Assoc.HC_mac_addr)); - - vos_mem_zero(pProfile->SSIDs.SSIDList[0].SSID.ssId, + + vos_mem_zero(pProfile->SSIDs.SSIDList[0].SSID.ssId, sizeof(pProfile->SSIDs.SSIDList[0].SSID.ssId)); vos_mem_copy(pProfile->SSIDs.SSIDList[0].SSID.ssId, convertBSSIDToSSID(btampContext->btamp_Remote_AMP_Assoc.HC_mac_addr), 21); // Length of BTAMP SSID is 21 bytes pProfile->SSIDs.SSIDList[0].SSID.length = 21; - vos_mem_zero(pProfile->SSIDs.SSIDList[1].SSID.ssId, + vos_mem_zero(pProfile->SSIDs.SSIDList[1].SSID.ssId, sizeof(pProfile->SSIDs.SSIDList[1].SSID.ssId)); vos_mem_copy(pProfile->SSIDs.SSIDList[1].SSID.ssId, convertBSSIDToSSID(btampContext->self_mac_addr), 21); // Length of BTAMP SSID is 21 bytes pProfile->SSIDs.SSIDList[1].SSID.length = 21; - + //Set the BSSID to the Remote AP pProfile->BSSIDs.numOfBSSIDs = 1; - vos_mem_copy(pProfile->BSSIDs.bssid, - btampContext->btamp_Remote_AMP_Assoc.HC_mac_addr, - sizeof( tCsrBssid ) ); - + vos_mem_copy(pProfile->BSSIDs.bssid, + btampContext->btamp_Remote_AMP_Assoc.HC_mac_addr, + sizeof( tCsrBssid ) ); + } else if ( bssType == eCSR_BSS_TYPE_WDS_AP) { pProfile->SSIDs.numOfSSIDs = 1; VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "%s: bssType = %s, SSID specified = %s\n", __func__, "eCSR_BSS_TYPE_WDS_AP", convertBSSIDToSSID(btampContext->self_mac_addr)); - - vos_mem_zero(pProfile->SSIDs.SSIDList[0].SSID.ssId, + + vos_mem_zero(pProfile->SSIDs.SSIDList[0].SSID.ssId, sizeof(pProfile->SSIDs.SSIDList[0].SSID.ssId)); vos_mem_copy(pProfile->SSIDs.SSIDList[0].SSID.ssId, convertBSSIDToSSID(btampContext->self_mac_addr), 21); // Length of BTAMP SSID is 21 bytes pProfile->SSIDs.SSIDList[0].SSID.length = 21; - + #if 0 //In case you are an AP, don't set the BSSID pProfile->BSSIDs.numOfBSSIDs = 0; #endif //0 - + //Set the BSSID to your "self MAC Addr" pProfile->BSSIDs.numOfBSSIDs = 1; - vos_mem_copy(pProfile->BSSIDs.bssid, + vos_mem_copy(pProfile->BSSIDs.bssid, btampContext->self_mac_addr, - sizeof( tCsrBssid ) ); - + sizeof( tCsrBssid ) ); + } else // Handle everything else as bssType eCSR_BSS_TYPE_INFRASTRUCTURE { pProfile->SSIDs.numOfSSIDs = 1; - + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "%s: bssType = %s, SSID specified = %s\n", __func__, "eCSR_BSS_TYPE_WDS_STA", convertBSSIDToSSID(btampContext->btamp_Remote_AMP_Assoc.HC_mac_addr)); - vos_mem_zero(pProfile->SSIDs.SSIDList[0].SSID.ssId, + vos_mem_zero(pProfile->SSIDs.SSIDList[0].SSID.ssId, sizeof(pProfile->SSIDs.SSIDList[0].SSID.ssId)); vos_mem_copy(pProfile->SSIDs.SSIDList[0].SSID.ssId, convertBSSIDToSSID(btampContext->btamp_Remote_AMP_Assoc.HC_mac_addr), 21); // Length of BTAMP SSID is 21 bytes pProfile->SSIDs.SSIDList[0].SSID.length = 21; - + //Set the BSSID to the Remote AP pProfile->BSSIDs.numOfBSSIDs = 1; - vos_mem_copy(pProfile->BSSIDs.bssid, - btampContext->btamp_Remote_AMP_Assoc.HC_mac_addr, - sizeof( tCsrBssid ) ); - + vos_mem_copy(pProfile->BSSIDs.bssid, + btampContext->btamp_Remote_AMP_Assoc.HC_mac_addr, + sizeof( tCsrBssid ) ); + } - + //Always set the Auth Type //pProfile->negotiatedAuthType = eCSR_AUTH_TYPE_RSN_PSK; //pProfile->negotiatedAuthType = eCSR_AUTH_TYPE_NONE; @@ -567,7 +567,7 @@ convertToCsrProfile pProfile->pRSNReqIE = &btampRSNIE[0]; pProfile->nRSNReqIELength = 0x16; //TODO //pProfile->pRSNReqIE = NULL; - + /** We don't use the WPAIE.But NULL it to avoid being used **/ pProfile->pWPAReqIE = NULL; pProfile->nWPAReqIELength = 0; @@ -697,13 +697,13 @@ convertToCsrProfile connection, else we can use the user preferred one*/ if(-1 != sessionid) { - pProfile->operationChannel = - sme_GetInfraOperationChannel(hHal, + pProfile->operationChannel = + sme_GetInfraOperationChannel(hHal, sessionid); } - + if(sme_IsChannelValid(hHal, pProfile->operationChannel)) - { + { btampContext->channel = pProfile->operationChannel; } else @@ -711,13 +711,13 @@ convertToCsrProfile //no valid channel, not proceeding with connection return VOS_STATUS_E_INVAL; } - - if ( BT_INITIATOR == btampContext->BAPDeviceRole ) + + if ( BT_INITIATOR == btampContext->BAPDeviceRole ) { pProfile->ChannelInfo.numOfChannels = 1; pProfile->ChannelInfo.ChannelList = &pProfile->operationChannel; } - else + else { pProfile->ChannelInfo.numOfChannels = 1; pProfile->ChannelInfo.ChannelList = &pProfile->operationChannel; @@ -746,23 +746,23 @@ convertToCsrProfile VOS_STATUS gotoStarting ( - ptBtampContext btampContext, /* btampContext value */ + ptBtampContext btampContext, /* btampContext value */ ptWLAN_BAPEvent bapEvent, /* State machine event */ eCsrRoamBssType bssType, v_U8_t *status /* return the BT-AMP status here */ -) +) { VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; eHalStatus halStatus; v_U32_t parseStatus, type, subType; - /* tHalHandle */ + /* tHalHandle */ tHalHandle hHal; - tBtampTLVHCI_Write_Remote_AMP_ASSOC_Cmd *pBapHCIWriteRemoteAMPAssoc + tBtampTLVHCI_Write_Remote_AMP_ASSOC_Cmd *pBapHCIWriteRemoteAMPAssoc = (tBtampTLVHCI_Write_Remote_AMP_ASSOC_Cmd *) bapEvent->params; - tBtampAMP_ASSOC btamp_ASSOC; + tBtampAMP_ASSOC btamp_ASSOC; /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ - if (NULL == btampContext) + if (NULL == btampContext) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "btampContext is NULL in %s", __func__); @@ -771,7 +771,7 @@ gotoStarting } hHal = VOS_GET_HAL_CB(btampContext->pvosGCtx); - if (NULL == hHal) + if (NULL == hHal) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "hHal is NULL in %s", __func__); @@ -793,122 +793,122 @@ gotoStarting //Tell PMC to exit BMPS; halStatus = pmcRequestFullPower( - hHal, - WLANBAP_pmcFullPwrReqCB, + hHal, + WLANBAP_pmcFullPwrReqCB, btampContext, eSME_REASON_OTHER); - // JEZ081210: This has to wait until we sync down from + // JEZ081210: This has to wait until we sync down from // /main/latest as of 12/4. We are currently at 12/3. //eSME_FULL_PWR_NEEDED_BY_BAP); - //Need to check the result...because Host may have been told by - //OS to go to standby (D2) device state. In that case, I have to - //fail the HCI Create Physical Link + //Need to check the result...because Host may have been told by + //OS to go to standby (D2) device state. In that case, I have to + //fail the HCI Create Physical Link - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, - "In %s, amp_assoc_remaining_length = %d", __func__, - pBapHCIWriteRemoteAMPAssoc->amp_assoc_remaining_length); + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, + "In %s, amp_assoc_remaining_length = %d", __func__, + pBapHCIWriteRemoteAMPAssoc->amp_assoc_remaining_length); #if 0 - DUMPLOG(1, __func__, "amp_assoc_fragment", - pBapHCIWriteRemoteAMPAssoc->amp_assoc_fragment, + DUMPLOG(1, __func__, "amp_assoc_fragment", + pBapHCIWriteRemoteAMPAssoc->amp_assoc_fragment, 64); #endif //0 //What about parsing the AMP Assoc structure? parseStatus = btampUnpackAMP_ASSOC( - hHal, - pBapHCIWriteRemoteAMPAssoc->amp_assoc_fragment, - pBapHCIWriteRemoteAMPAssoc->amp_assoc_remaining_length, + hHal, + pBapHCIWriteRemoteAMPAssoc->amp_assoc_fragment, + pBapHCIWriteRemoteAMPAssoc->amp_assoc_remaining_length, &btamp_ASSOC); /* Unknown or Reserved TLVs are allowed in the write AMP assoc fragment */ - if ((BTAMP_PARSE_SUCCESS != parseStatus ) && (BTAMP_UNKNOWN_TLVS != parseStatus)) + if ((BTAMP_PARSE_SUCCESS != parseStatus ) && (BTAMP_UNKNOWN_TLVS != parseStatus)) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, parseStatus = %d", __func__, parseStatus); *status = WLANBAP_ERROR_INVALID_HCI_CMND_PARAM; return VOS_STATUS_E_BADMSG; } - //What about writing the peer MAC address, and other info to the BTAMP + //What about writing the peer MAC address, and other info to the BTAMP //context for this physical link? if (btamp_ASSOC.AMP_Assoc_MAC_Addr.present == 1) { - /* Save the peer MAC address */ - vos_mem_copy( - btampContext->btamp_Remote_AMP_Assoc.HC_mac_addr, - btamp_ASSOC.AMP_Assoc_MAC_Addr.mac_addr, - sizeof(btampContext->btamp_Remote_AMP_Assoc.HC_mac_addr)); - /* Save it in the peer MAC address field */ - vos_mem_copy( - btampContext->peer_mac_addr, - btamp_ASSOC.AMP_Assoc_MAC_Addr.mac_addr, - sizeof(btampContext->peer_mac_addr)); + /* Save the peer MAC address */ + vos_mem_copy( + btampContext->btamp_Remote_AMP_Assoc.HC_mac_addr, + btamp_ASSOC.AMP_Assoc_MAC_Addr.mac_addr, + sizeof(btampContext->btamp_Remote_AMP_Assoc.HC_mac_addr)); + /* Save it in the peer MAC address field */ + vos_mem_copy( + btampContext->peer_mac_addr, + btamp_ASSOC.AMP_Assoc_MAC_Addr.mac_addr, + sizeof(btampContext->peer_mac_addr)); } if (btamp_ASSOC.AMP_Assoc_Preferred_Channel_List.present == 1) { - /* Save the peer Preferred Channel List */ - vos_mem_copy( - btampContext->btamp_Remote_AMP_Assoc.HC_pref_country, - btamp_ASSOC.AMP_Assoc_Preferred_Channel_List.country, - sizeof(btampContext->btamp_Remote_AMP_Assoc.HC_pref_country)); - /* Save the peer Preferred Channel List */ - btampContext->btamp_Remote_AMP_Assoc.HC_pref_num_triplets = - btamp_ASSOC.AMP_Assoc_Preferred_Channel_List.num_triplets; - if(WLANBAP_MAX_NUM_TRIPLETS < + /* Save the peer Preferred Channel List */ + vos_mem_copy( + btampContext->btamp_Remote_AMP_Assoc.HC_pref_country, + btamp_ASSOC.AMP_Assoc_Preferred_Channel_List.country, + sizeof(btampContext->btamp_Remote_AMP_Assoc.HC_pref_country)); + /* Save the peer Preferred Channel List */ + btampContext->btamp_Remote_AMP_Assoc.HC_pref_num_triplets = + btamp_ASSOC.AMP_Assoc_Preferred_Channel_List.num_triplets; + if(WLANBAP_MAX_NUM_TRIPLETS < btampContext->btamp_Remote_AMP_Assoc.HC_pref_num_triplets) { - btampContext->btamp_Remote_AMP_Assoc.HC_pref_num_triplets = + btampContext->btamp_Remote_AMP_Assoc.HC_pref_num_triplets = WLANBAP_MAX_NUM_TRIPLETS; } - vos_mem_copy( - btampContext->btamp_Remote_AMP_Assoc.HC_pref_triplets, - btamp_ASSOC.AMP_Assoc_Preferred_Channel_List.triplets, + vos_mem_copy( + btampContext->btamp_Remote_AMP_Assoc.HC_pref_triplets, + btamp_ASSOC.AMP_Assoc_Preferred_Channel_List.triplets, sizeof(btampContext->btamp_Remote_AMP_Assoc.HC_pref_triplets[0]) * - btampContext->btamp_Remote_AMP_Assoc.HC_pref_num_triplets - ); + btampContext->btamp_Remote_AMP_Assoc.HC_pref_num_triplets + ); } if (btamp_ASSOC.AMP_Assoc_Connected_Channel.present == 1) { - /* Save the peer Connected Channel */ - vos_mem_copy( - btampContext->btamp_Remote_AMP_Assoc.HC_cnct_country, - btamp_ASSOC.AMP_Assoc_Connected_Channel.country, - sizeof(btampContext->btamp_Remote_AMP_Assoc.HC_cnct_country)); - /* Save the peer Connected Channel */ - btampContext->btamp_Remote_AMP_Assoc.HC_cnct_num_triplets = + /* Save the peer Connected Channel */ + vos_mem_copy( + btampContext->btamp_Remote_AMP_Assoc.HC_cnct_country, + btamp_ASSOC.AMP_Assoc_Connected_Channel.country, + sizeof(btampContext->btamp_Remote_AMP_Assoc.HC_cnct_country)); + /* Save the peer Connected Channel */ + btampContext->btamp_Remote_AMP_Assoc.HC_cnct_num_triplets = btamp_ASSOC.AMP_Assoc_Connected_Channel.num_triplets; - if(WLANBAP_MAX_NUM_TRIPLETS < + if(WLANBAP_MAX_NUM_TRIPLETS < btampContext->btamp_Remote_AMP_Assoc.HC_cnct_num_triplets) { - btampContext->btamp_Remote_AMP_Assoc.HC_cnct_num_triplets = + btampContext->btamp_Remote_AMP_Assoc.HC_cnct_num_triplets = WLANBAP_MAX_NUM_TRIPLETS; } - vos_mem_copy( - btampContext->btamp_Remote_AMP_Assoc.HC_cnct_triplets, - btamp_ASSOC.AMP_Assoc_Connected_Channel.triplets, + vos_mem_copy( + btampContext->btamp_Remote_AMP_Assoc.HC_cnct_triplets, + btamp_ASSOC.AMP_Assoc_Connected_Channel.triplets, sizeof(btampContext->btamp_Remote_AMP_Assoc.HC_cnct_triplets[0]) * btampContext->btamp_Remote_AMP_Assoc.HC_cnct_num_triplets - ); + ); } if (btamp_ASSOC.AMP_Assoc_PAL_Capabilities.present == 1) { - /* Save the peer PAL Capabilities */ - btampContext->btamp_Remote_AMP_Assoc.HC_pal_capabilities + /* Save the peer PAL Capabilities */ + btampContext->btamp_Remote_AMP_Assoc.HC_pal_capabilities = btamp_ASSOC.AMP_Assoc_PAL_Capabilities.pal_capabilities; } if (btamp_ASSOC.AMP_Assoc_PAL_Version.present == 1) { - /* Save the peer PAL Version */ - btampContext->btamp_Remote_AMP_Assoc.HC_pal_version + /* Save the peer PAL Version */ + btampContext->btamp_Remote_AMP_Assoc.HC_pal_version = btamp_ASSOC.AMP_Assoc_PAL_Version.pal_version; - btampContext->btamp_Remote_AMP_Assoc.HC_pal_CompanyID + btampContext->btamp_Remote_AMP_Assoc.HC_pal_CompanyID = btamp_ASSOC.AMP_Assoc_PAL_Version.pal_CompanyID; - btampContext->btamp_Remote_AMP_Assoc.HC_pal_subversion + btampContext->btamp_Remote_AMP_Assoc.HC_pal_subversion = btamp_ASSOC.AMP_Assoc_PAL_Version.pal_subversion; } @@ -937,12 +937,12 @@ gotoStarting "failed to get vdev type"); return VOS_STATUS_E_FAILURE; } - halStatus = sme_OpenSession(hHal, - WLANBAP_RoamCallback, + halStatus = sme_OpenSession(hHal, + WLANBAP_RoamCallback, btampContext, // <=== JEZ081210: FIXME - //(tANI_U8 *) btampContext->self_mac_addr, - btampContext->self_mac_addr, + //(tANI_U8 *) btampContext->self_mac_addr, + btampContext->self_mac_addr, &btampContext->sessionId, type,subType); if(eHAL_STATUS_SUCCESS == halStatus) @@ -962,8 +962,8 @@ gotoStarting // Taken care of, above //halStatus = csrRoamConnect(newSession, bssType); // Final - vosStatus = convertToCsrProfile ( - btampContext, /* btampContext value */ + vosStatus = convertToCsrProfile ( + btampContext, /* btampContext value */ bssType, &btampContext->csrRoamProfile); /* return the profile info here */ if(VOS_STATUS_E_INVAL == vosStatus) @@ -974,22 +974,22 @@ gotoStarting return VOS_STATUS_E_INVAL; } #if 0 - halStatus = sme_RoamConnect(VOS_GET_HAL_CB(btampContext->pvosGCtx), - &btampContext->csrRoamProfile, - NULL, /* tScanResultHandle hBssListIn, */ + halStatus = sme_RoamConnect(VOS_GET_HAL_CB(btampContext->pvosGCtx), + &btampContext->csrRoamProfile, + NULL, /* tScanResultHandle hBssListIn, */ &btampContext->csrRoamId); #endif //0 //#if 0 - halStatus = sme_RoamConnect(hHal, - btampContext->sessionId, - &btampContext->csrRoamProfile, + halStatus = sme_RoamConnect(hHal, + btampContext->sessionId, + &btampContext->csrRoamProfile, &btampContext->csrRoamId); //#endif //0 //Map the halStatus into a vosStatus return vosStatus; } //gotoStarting - + VOS_STATUS gotoConnecting( ptBtampContext btampContext /* btampContext value */ @@ -1003,7 +1003,7 @@ gotoConnecting( return vosStatus; } //gotoConnecting - + VOS_STATUS gotoAuthenticating( ptBtampContext btampContext /* btampContext value */ @@ -1026,7 +1026,7 @@ VOID initRsnSupplicant() VOS_STATUS initRsnSupplicant ( - ptBtampContext btampContext, /* btampContext value */ + ptBtampContext btampContext, /* btampContext value */ tWLAN_BAPRole BAPDeviceRole ) { @@ -1058,7 +1058,7 @@ VOID initRsnAuthenticator() VOS_STATUS initRsnAuthenticator ( - ptBtampContext btampContext, /* btampContext value */ + ptBtampContext btampContext, /* btampContext value */ tWLAN_BAPRole BAPDeviceRole ) { @@ -1082,7 +1082,7 @@ initRsnAuthenticator VOS_STATUS regStaWithTl ( - ptBtampContext btampContext, /* btampContext value */ + ptBtampContext btampContext, /* btampContext value */ tWLAN_BAPRole BAPDeviceRole, tCsrRoamInfo *pCsrRoamInfo ) @@ -1095,33 +1095,33 @@ regStaWithTl /* Fill in everything I know about the STA */ btampContext->ucSTAId = staDesc.ucSTAId = pCsrRoamInfo->staId; - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "BAP register TL ucSTAId=%d\n", + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "BAP register TL ucSTAId=%d\n", staDesc.ucSTAId ); /* Fill in the peer MAC address */ - vos_mem_copy( - staDesc.vSTAMACAddress.bytes, - btampContext->peer_mac_addr, - sizeof(btampContext->peer_mac_addr)); + vos_mem_copy( + staDesc.vSTAMACAddress.bytes, + btampContext->peer_mac_addr, + sizeof(btampContext->peer_mac_addr)); /* Fill in the self MAC address */ - vos_mem_copy( - staDesc.vSelfMACAddress.bytes, - btampContext->self_mac_addr, - sizeof(btampContext->peer_mac_addr)); + vos_mem_copy( + staDesc.vSelfMACAddress.bytes, + btampContext->self_mac_addr, + sizeof(btampContext->peer_mac_addr)); /* Set the STA Type */ staDesc.wSTAType = WLAN_STA_BT_AMP; // Set the QoS field appropriately, if the info available if( pCsrRoamInfo->u.pConnectedProfile) - { - btampContext->bapQosCfg.bWmmIsEnabled = //1; + { + btampContext->bapQosCfg.bWmmIsEnabled = //1; pCsrRoamInfo->u.pConnectedProfile->qosConnection; } else { - btampContext->bapQosCfg.bWmmIsEnabled = 0; + btampContext->bapQosCfg.bWmmIsEnabled = 0; } // set the QoS field appropriately @@ -1134,15 +1134,15 @@ regStaWithTl staDesc.ucQosEnabled = 0; } - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "BAP register TL QoS_enabled=%d\n", + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "BAP register TL QoS_enabled=%d\n", staDesc.ucQosEnabled ); - // UMA is ready we inform TL not to do frame + // UMA is ready we inform TL not to do frame // translation for WinMob 6.1 //*** Not to enabled UMA. /* Enable UMA for TX translation only when there is no concurrent session active */ staDesc.ucSwFrameTXXlation = 1; - staDesc.ucSwFrameRXXlation = 1; + staDesc.ucSwFrameRXXlation = 1; staDesc.ucAddRmvLLC = 0; if ( btampContext->ucSecEnabled ) @@ -1154,7 +1154,7 @@ regStaWithTl staDesc.ucProtectedFrame = 0; } - staDesc.ucUcastSig = pCsrRoamInfo->ucastSig; + staDesc.ucUcastSig = pCsrRoamInfo->ucastSig; staDesc.ucBcastSig = pCsrRoamInfo->bcastSig; staDesc.ucInitState = ( btampContext->ucSecEnabled)? WLANTL_STA_CONNECTED:WLANTL_STA_AUTHENTICATED; @@ -1164,40 +1164,40 @@ regStaWithTl rssi = pCsrRoamInfo->pBssDesc->rssi; } /* register our STA with TL */ - vosStatus = WLANTL_RegisterSTAClient - ( + vosStatus = WLANTL_RegisterSTAClient + ( btampContext->pvosGCtx, - WLANBAP_STARxCB, - WLANBAP_TxCompCB, + WLANBAP_STARxCB, + WLANBAP_TxCompCB, (WLANTL_STAFetchPktCBType)WLANBAP_STAFetchPktCB, &staDesc , - rssi); + rssi); if ( !VOS_IS_STATUS_SUCCESS( vosStatus ) ) { - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "%s: WLANTL_RegisterSTAClient() failed to register. Status= %d [0x%08X]", __func__, vosStatus, vosStatus ); - } - + } + if ( ! btampContext->ucSecEnabled ) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_MED, "open/shared auth StaId= %d. Changing TL state to AUTHENTICATED at Join time", btampContext->ucSTAId); - + // Connections that do not need Upper layer auth, transition TL directly - // to 'Authenticated' state. - vosStatus = WLANTL_ChangeSTAState( btampContext->pvosGCtx, staDesc.ucSTAId, + // to 'Authenticated' state. + vosStatus = WLANTL_ChangeSTAState( btampContext->pvosGCtx, staDesc.ucSTAId, WLANTL_STA_AUTHENTICATED ); - } + } else { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_MED, "ULA auth StaId= %d. Changing TL state to CONNECTED at Join time", btampContext->ucSTAId ); - - vosStatus = WLANTL_ChangeSTAState( btampContext->pvosGCtx, staDesc.ucSTAId, + + vosStatus = WLANTL_ChangeSTAState( btampContext->pvosGCtx, staDesc.ucSTAId, WLANTL_STA_CONNECTED ); - } + } return VOS_STATUS_SUCCESS; } /* regStaWithTl */ @@ -1215,7 +1215,7 @@ regStaWithTl VOS_STATUS determineChan ( - ptBtampContext btampContext, /* btampContext value */ + ptBtampContext btampContext, /* btampContext value */ tWLAN_BAPRole BAPDeviceRole, v_U32_t *channel, /* Current channel */ v_U8_t *status /* return the BT-AMP status here */ @@ -1249,15 +1249,15 @@ determineChan } // determineChan VOS_STATUS -gotoDisconnected +gotoDisconnected ( - ptBtampContext btampContext /* btampContext value */ + ptBtampContext btampContext /* btampContext value */ ) { VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ - //Is it legitimate to always make this call? + //Is it legitimate to always make this call? //What if pmcRequestFullPower wasn't called? //Tell PMC to resume BMPS; /* Whatever the previous BMPS "state" was */ //Comment this out until such time as we have PMC support @@ -1268,12 +1268,12 @@ gotoDisconnected //Map the halStatus into a vosStatus return vosStatus; -} // gotoDisconnected +} // gotoDisconnected VOS_STATUS -gotoDisconnecting +gotoDisconnecting ( - ptBtampContext btampContext, /* btampContext value */ + ptBtampContext btampContext, /* btampContext value */ v_U8_t needPhysLinkCompEvent, v_U8_t physLinkStatus, /* BT-AMP disconnecting status */ // v_U8_t statusPresent, /* BT-AMP disconnecting status present */ @@ -1284,11 +1284,11 @@ gotoDisconnecting // gNeedPhysLinkCompEvent btampContext->gNeedPhysLinkCompEvent = needPhysLinkCompEvent; - // gPhysLinkStatus + // gPhysLinkStatus btampContext->gPhysLinkStatus = physLinkStatus; /* BT-AMP disconnecting status */ // gDiscRequested btampContext->gDiscRequested = discRequested; - // gDiscReason + // gDiscReason btampContext->gDiscReason = discReason; /* BT-AMP disconnecting reason */ //WLANBAP_DeInitLinkSupervision( btampHandle); @@ -1300,12 +1300,12 @@ gotoDisconnecting send_btc_nlink_msg(WLAN_AMP_ASSOC_DONE_IND, 0); return VOS_STATUS_SUCCESS; -} //gotoDisconnecting +} //gotoDisconnecting VOS_STATUS gotoConnected ( - ptBtampContext btampContext /* btampContext value */ + ptBtampContext btampContext /* btampContext value */ ) { VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; @@ -1320,36 +1320,36 @@ gotoConnected /* Signal BT Coex in firmware to now honor only priority BT requests */ WLANBAP_NeedBTCoexPriority ( btampContext, 2); - // If required after successful Upper layer auth, transition TL - // to 'Authenticated' state. + // If required after successful Upper layer auth, transition TL + // to 'Authenticated' state. if ( btampContext->ucSecEnabled ) - { - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_MED, + { + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_MED, "open/shared auth StaId= %d. Changing TL state to AUTHENTICATED at Join time", btampContext->ucSTAId); - - vosStatus = WLANTL_ChangeSTAState( - btampContext->pvosGCtx, - btampContext->ucSTAId, + + vosStatus = WLANTL_ChangeSTAState( + btampContext->pvosGCtx, + btampContext->ucSTAId, WLANTL_STA_AUTHENTICATED ); } btampContext->dataPktPending = VOS_FALSE; vosStatus = WLANBAP_InitLinkSupervision( btampHandle); - + /* Inform user space of the AMP channel selected, for AFH purposes */ VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_LOW, "Calling send_btc_nlink_msg() with AMP channel %d", btampContext->channel); send_btc_nlink_msg(WLAN_AMP_ASSOC_DONE_IND, btampContext->channel); return vosStatus; -} //gotoConnected +} //gotoConnected /* the HCI Event signalling routine*/ VOS_STATUS signalHCIPhysLinkCompEvent -( - ptBtampContext btampContext, /* btampContext value */ +( + ptBtampContext btampContext, /* btampContext value */ v_U8_t status /* the BT-AMP status */ ) { @@ -1357,13 +1357,13 @@ signalHCIPhysLinkCompEvent tBtampHCI_Event bapHCIEvent; /* This now encodes ALL event types */ /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ - /* Format the Physical Link Complete event to return... */ + /* Format the Physical Link Complete event to return... */ bapHCIEvent.bapHCIEventCode = BTAMP_TLV_HCI_PHYSICAL_LINK_COMPLETE_EVENT; bapHCIEvent.u.btampPhysicalLinkCompleteEvent.present = 1; bapHCIEvent.u.btampPhysicalLinkCompleteEvent.status = status; - bapHCIEvent.u.btampPhysicalLinkCompleteEvent.phy_link_handle + bapHCIEvent.u.btampPhysicalLinkCompleteEvent.phy_link_handle = btampContext->phy_link_handle; - bapHCIEvent.u.btampPhysicalLinkCompleteEvent.ch_number + bapHCIEvent.u.btampPhysicalLinkCompleteEvent.ch_number = btampContext->channel; if(WLANBAP_STATUS_SUCCESS == status) @@ -1376,21 +1376,21 @@ signalHCIPhysLinkCompEvent btampContext->phy_link_handle = 0; } - vosStatus = (*btampContext->pBapHCIEventCB) - ( + vosStatus = (*btampContext->pBapHCIEventCB) + ( btampContext->pHddHdl, /* this refers the BSL per application context */ &bapHCIEvent, /* This now encodes ALL event types */ - VOS_TRUE /* Flag to indicate assoc-specific event */ + VOS_TRUE /* Flag to indicate assoc-specific event */ ); - + return vosStatus; } /* signalHCIPhysLinkCompEvent */ /* the HCI Disconnect Complete Event signalling routine*/ VOS_STATUS signalHCIPhysLinkDiscEvent -( - ptBtampContext btampContext, /* btampContext value */ +( + ptBtampContext btampContext, /* btampContext value */ v_U8_t status, /* the BT-AMP status */ v_U8_t reason /* the BT-AMP reason code */ ) @@ -1412,76 +1412,76 @@ signalHCIPhysLinkDiscEvent { pLogLinkContext = &(btampContext->btampLogLinkCtx[i]); - if (pLogLinkContext->present == VOS_TRUE) - { - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, + if (pLogLinkContext->present == VOS_TRUE) + { + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "WLAN BAP: Deleting logical link entry %d in %s", i, - __func__); + __func__); /* Mark this Logical Link index value as free */ - pLogLinkContext->present = VOS_FALSE; + pLogLinkContext->present = VOS_FALSE; // signalHCIDiscLogLink(status = SUCCESS, reason = CONNECTION_TERM_BY_REMOTE_HOST); - signalHCIDiscLogLinkCompEvent - ( btampContext, - WLANBAP_STATUS_SUCCESS, - i, // logical link + signalHCIDiscLogLinkCompEvent + ( btampContext, + WLANBAP_STATUS_SUCCESS, + i, // logical link // I don't know how to signal CONNECTION_TERM_BY_REMOTE_HOST WLANBAP_ERROR_TERM_BY_LOCAL_HOST); } } /*Reset current_log_link_index and total_log_link_index values*/ - btampContext->current_log_link_index = 0; - btampContext->total_log_link_index = 0; + btampContext->current_log_link_index = 0; + btampContext->total_log_link_index = 0; - /* Format the Physical Link Disconnect Complete event to return... */ + /* Format the Physical Link Disconnect Complete event to return... */ bapHCIEvent.bapHCIEventCode = BTAMP_TLV_HCI_DISCONNECT_PHYSICAL_LINK_COMPLETE_EVENT; bapHCIEvent.u.btampDisconnectPhysicalLinkCompleteEvent.present = 1; bapHCIEvent.u.btampDisconnectPhysicalLinkCompleteEvent.status = status; bapHCIEvent.u.btampDisconnectPhysicalLinkCompleteEvent.reason = reason;//uncommented to debug - bapHCIEvent.u.btampDisconnectPhysicalLinkCompleteEvent.phy_link_handle + bapHCIEvent.u.btampDisconnectPhysicalLinkCompleteEvent.phy_link_handle = btampContext->phy_link_handle; /* Stop the Tx packet monitoring timer */ WLANBAP_StopTxPacketMonitorTimer(btampContext); - /*Need to clean up the phy link handle as we are disconnected at this + /*Need to clean up the phy link handle as we are disconnected at this point ?? - do we need to do any more cleanup on this*/ - btampContext->phy_link_handle = 0; - vosStatus = (*btampContext->pBapHCIEventCB) - ( + btampContext->phy_link_handle = 0; + vosStatus = (*btampContext->pBapHCIEventCB) + ( btampContext->pHddHdl, /* this refers the BSL per application context */ &bapHCIEvent, /* This now encodes ALL event types */ - VOS_TRUE /* Flag to indicate assoc-specific event */ + VOS_TRUE /* Flag to indicate assoc-specific event */ ); - + return vosStatus; } /* signalHCIPhysLinkDiscEvent */ /* the HCI Channel Select Event signalling routine*/ VOS_STATUS signalHCIChanSelEvent -( - ptBtampContext btampContext /* btampContext value */ +( + ptBtampContext btampContext /* btampContext value */ ) { VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; tBtampHCI_Event bapHCIEvent; /* This now encodes ALL event types */ /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ - /* Format the Physical Link Disconnect Complete event to return... */ + /* Format the Physical Link Disconnect Complete event to return... */ bapHCIEvent.bapHCIEventCode = BTAMP_TLV_HCI_CHANNEL_SELECTED_EVENT; bapHCIEvent.u.btampChannelSelectedEvent.present = 1; - bapHCIEvent.u.btampChannelSelectedEvent.phy_link_handle + bapHCIEvent.u.btampChannelSelectedEvent.phy_link_handle = btampContext->phy_link_handle; - - vosStatus = (*btampContext->pBapHCIEventCB) - ( + + vosStatus = (*btampContext->pBapHCIEventCB) + ( btampContext->pHddHdl, /* this refers the BSL per application context */ &bapHCIEvent, /* This now encodes ALL event types */ - VOS_TRUE /* Flag to indicate assoc-specific event */ + VOS_TRUE /* Flag to indicate assoc-specific event */ ); return vosStatus; @@ -1491,8 +1491,8 @@ signalHCIChanSelEvent /* the HCI Disconnect Logical Link Complete Event signalling routine*/ VOS_STATUS signalHCIDiscLogLinkCompEvent -( - ptBtampContext btampContext, /* btampContext value */ +( + ptBtampContext btampContext, /* btampContext value */ v_U8_t status, /* the BT-AMP status */ v_U16_t log_link_handle, /* The Logical Link that disconnected*/ v_U8_t reason /* the BT-AMP reason code */ @@ -1502,25 +1502,25 @@ signalHCIDiscLogLinkCompEvent tBtampHCI_Event bapHCIEvent; /* This now encodes ALL event types */ /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ - /* Format the Logical Link Disconnect Complete event to return... */ + /* Format the Logical Link Disconnect Complete event to return... */ bapHCIEvent.bapHCIEventCode = BTAMP_TLV_HCI_DISCONNECT_LOGICAL_LINK_COMPLETE_EVENT; bapHCIEvent.u.btampDisconnectLogicalLinkCompleteEvent.present = 1; bapHCIEvent.u.btampDisconnectLogicalLinkCompleteEvent.status = status; bapHCIEvent.u.btampDisconnectLogicalLinkCompleteEvent.reason = reason; - bapHCIEvent.u.btampDisconnectLogicalLinkCompleteEvent.log_link_handle + bapHCIEvent.u.btampDisconnectLogicalLinkCompleteEvent.log_link_handle = (log_link_handle << 8) + btampContext->phy_link_handle; - vosStatus = (*btampContext->pBapHCIEventCB) - ( + vosStatus = (*btampContext->pBapHCIEventCB) + ( btampContext->pHddHdl, /* this refers the BSL per application context */ &bapHCIEvent, /* This now encodes ALL event types */ - VOS_TRUE /* Flag to indicate assoc-specific event */ + VOS_TRUE /* Flag to indicate assoc-specific event */ ); - + return vosStatus; } /* signalHCIDiscLogLinkCompEvent */ - + // These are needed to recognize RSN suite types #define WLANBAP_RSN_OUI_SIZE 4 tANI_U8 pRSNOui00[ WLANBAP_RSN_OUI_SIZE ] = { 0x00, 0x0F, 0xAC, 0x00 }; // group cipher @@ -1530,82 +1530,82 @@ tANI_U8 pRSNOui03[ WLANBAP_RSN_OUI_SIZE ] = { 0x00, 0x0F, 0xAC, 0x03 }; // Reser tANI_U8 pRSNOui04[ WLANBAP_RSN_OUI_SIZE ] = { 0x00, 0x0F, 0xAC, 0x04 }; // AES-CCMP tANI_U8 pRSNOui05[ WLANBAP_RSN_OUI_SIZE ] = { 0x00, 0x0F, 0xAC, 0x05 }; // WEP-104 -#define GET_IE_LEN_IN_BSS(lenInBss) ( lenInBss + sizeof(lenInBss) - ((int) OFFSET_OF( tSirBssDescription, ieFields))) +#define GET_IE_LEN_IN_BSS(lenInBss) ( lenInBss + sizeof(lenInBss) - ((int) OFFSET_OF( tSirBssDescription, ieFields))) /* Incoming Association indication validation predicate */ -v_U32_t +v_U32_t validAssocInd -( - ptBtampContext btampContext, /* btampContext value */ +( + ptBtampContext btampContext, /* btampContext value */ tCsrRoamInfo *pRoamInfo ) { - /* tHalHandle */ + /* tHalHandle */ tHalHandle hHal = VOS_GET_HAL_CB(btampContext->pvosGCtx); - v_U32_t ieLen; - - /* For now, always return true */ + v_U32_t ieLen; + + /* For now, always return true */ return VOS_TRUE; /* Check for a valid peer MAC address */ /* For an incoming Assoc Indication, the peer MAC address - * should match the value that the BlueTooth AMP + * should match the value that the BlueTooth AMP * configured us with. */ - if ( !vos_mem_compare( btampContext->peer_mac_addr, - pRoamInfo->peerMac, + if ( !vos_mem_compare( btampContext->peer_mac_addr, + pRoamInfo->peerMac, sizeof(btampContext->peer_mac_addr) )) { - /* Return not valid */ + /* Return not valid */ return VOS_FALSE; } - /* JEZ081115: For now, ignore the RSN IE */ - /* Otherwise, it is valid */ + /* JEZ081115: For now, ignore the RSN IE */ + /* Otherwise, it is valid */ return VOS_TRUE; /* Check for a trivial case: IEs missing */ if( pRoamInfo->prsnIE == NULL ) { //btampContext->ieFields = NULL; - //btampContext->ieLen = 0; - /* Return not valid */ + //btampContext->ieLen = 0; + /* Return not valid */ return VOS_FALSE; } //btampContext->ieLen = GET_IE_LEN_IN_BSS( pBssDesc->length ); //ieLen = GET_IE_LEN_IN_BSS( pBssDesc->length ); ieLen = pRoamInfo->rsnIELen; - + /* Check for a trivial case: IEs zero length */ //if( btampContext->ieLen == 0 ) if( ieLen == 0 ) { //btampContext->ieFields = NULL; - //btampContext->ieLen = 0; - /* Return not valid */ + //btampContext->ieLen = 0; + /* Return not valid */ return VOS_FALSE; } { // --- Start of block --- - tDot11fBeaconIEs dot11BeaconIEs; + tDot11fBeaconIEs dot11BeaconIEs; tDot11fIESSID *pDot11SSID; tDot11fIERSN *pDot11RSN; - + // JEZ081215: This really needs to be updated to just validate the RSN IE. // Validating the SSID can be done directly from... - + // "Unpack" really wants tpAniSirGlobal (pMac) as its first param. // But since it isn't used, I just pass in some arbitrary "context" pointer. // So hHalHandle will make it happy. - dot11fUnpackBeaconIEs((tpAniSirGlobal) hHal, + dot11fUnpackBeaconIEs((tpAniSirGlobal) hHal, (tANI_U8 *) pRoamInfo->prsnIE, - ieLen, + ieLen, &dot11BeaconIEs); //DUMPLOG(9, __func__, "dot11BeaconIEs", &dot11BeaconIEs, 64); - pDot11SSID = &dot11BeaconIEs.SSID; + pDot11SSID = &dot11BeaconIEs.SSID; // Assume there wasn't an SSID in the Assoc Request btampContext->assocSsidLen = 0; @@ -1615,24 +1615,24 @@ validAssocInd //DUMPLOG(10, __func__, "pDot11SSID present", pDot11SSID, 64); - btampContext->assocSsidLen = pDot11SSID->num_ssid; - vos_mem_copy(btampContext->assocSsid, - pDot11SSID->ssid, + btampContext->assocSsidLen = pDot11SSID->num_ssid; + vos_mem_copy(btampContext->assocSsid, + pDot11SSID->ssid, btampContext->assocSsidLen ); } else return VOS_FALSE; // Check the validity of the SSID against our SSID value - if ( !vos_mem_compare( btampContext->ownSsid, - pDot11SSID->ssid, + if ( !vos_mem_compare( btampContext->ownSsid, + pDot11SSID->ssid, btampContext->ownSsidLen )) { - /* Return not valid */ + /* Return not valid */ return VOS_FALSE; } - pDot11RSN = &dot11BeaconIEs.RSN; + pDot11RSN = &dot11BeaconIEs.RSN; // Assume there wasn't an RSN IE in the Assoc Request //btampContext->assocRsnIeLen = 0; @@ -1642,16 +1642,16 @@ validAssocInd //DUMPLOG(10, __func__, "pDot11RSN present", pDot11RSN, 64); - //The 802.11 BT-AMP PAL only supports WPA2-PSK + //The 802.11 BT-AMP PAL only supports WPA2-PSK if (!vos_mem_compare(pRSNOui02, // RSN-PSK - pDot11RSN->akm_suites[0], - WLANBAP_RSN_OUI_SIZE)) + pDot11RSN->akm_suites[0], + WLANBAP_RSN_OUI_SIZE)) return VOS_FALSE; - //The 802.11 BT-AMP PAL only supports AES-CCMP Unicast + //The 802.11 BT-AMP PAL only supports AES-CCMP Unicast if (!vos_mem_compare(pRSNOui04, // AES-CCMP - pDot11RSN->pwise_cipher_suites[0], - WLANBAP_RSN_OUI_SIZE)) + pDot11RSN->pwise_cipher_suites[0], + WLANBAP_RSN_OUI_SIZE)) return VOS_FALSE; } else @@ -1660,38 +1660,38 @@ validAssocInd } // --- End of block --- - /* Otherwise, it is valid */ + /* Otherwise, it is valid */ return VOS_TRUE; } /* validAssocInd */ /* the change state function*/ -void +void btampfsmChangeToState ( - BTAMPFSM_INSTANCEDATA_T *instance, + BTAMPFSM_INSTANCEDATA_T *instance, BTAMPFSM_STATES_T state ) { instance->stateVar = state; //BTAMPFSM_ENTRY_FLAG_T disconnectedEntry; - + } /* Physical Link state machine function */ -//int +//int VOS_STATUS btampFsm ( //BTAMPFSM_INSTANCEDATA_T *instanceVar - ptBtampContext btampContext, /* btampContext value */ + ptBtampContext btampContext, /* btampContext value */ // tBtampSessCtx *tpBtampSessCtx, /* btampContext value */ ptWLAN_BAPEvent bapEvent, /* State machine event */ v_U8_t *status /* return the BT-AMP status here */ ) { - /* Retrieve the phy link state machine structure - * from the btampContext value - */ + /* Retrieve the phy link state machine structure + * from the btampContext value + */ BTAMPFSM_INSTANCEDATA_T *instanceVar; v_U32_t msg = bapEvent->event; /* State machine input event message */ v_U32_t channel; /* Current channel */ @@ -1702,15 +1702,15 @@ btampFsm v_PVOID_t pHddHdl; /* Handle to return BSL context in */ tHalHandle hHal = NULL; /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ - /* Validate params */ - if (btampHandle == NULL) + /* Validate params */ + if (btampHandle == NULL) { return VOS_STATUS_E_FAULT; } instanceVar = &(btampContext->bapPhysLinkMachine); hHal = VOS_GET_HAL_CB(btampContext->pvosGCtx); - if (NULL == hHal) + if (NULL == hHal) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "hHal is NULL in %s", __func__); @@ -1719,7 +1719,7 @@ btampFsm } - + #define CHANNEL_NOT_SELECTED (WLANBAP_GetCurrentChannel (btampContext, &channel, &activeFlag) != VOS_STATUS_SUCCESS) /*Initialize BTAMP PAL status code being returned to the btampFsm caller */ @@ -1733,21 +1733,21 @@ btampFsm { /*Transition from DISCONNECTED to S1 (both without substates)*/ VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, from state %s => %s", __func__, "DISCONNECTED", "S1"); - + #if 0 /* This will have issues in multisession. Need not close the session */ - /* TODO : Need to have better handling */ + /* TODO : Need to have better handling */ if(btampContext->isBapSessionOpen == TRUE)//We want to close only BT-AMP Session { sme_CloseSession(VOS_GET_HAL_CB(btampContext->pvosGCtx), btampContext->sessionId); /*Added by Luiza:*/ - btampContext->isBapSessionOpen = FALSE; - } + btampContext->isBapSessionOpen = FALSE; + } #endif /* Set BAP device role */ - vosStatus = gotoS1( btampContext, bapEvent, BT_INITIATOR, status); + vosStatus = gotoS1( btampContext, bapEvent, BT_INITIATOR, status); VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, cmd status is %d", __func__, *status); /*Advance outer statevar */ btampfsmChangeToState(instanceVar,S1); @@ -1756,14 +1756,14 @@ btampFsm { /*Transition from DISCONNECTED to S1 (both without substates)*/ VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, from state %s => %s", __func__, "DISCONNECTED", "S1"); - + #if 0 if(btampContext->isBapSessionOpen == TRUE) { sme_CloseSession(VOS_GET_HAL_CB(btampContext->pvosGCtx), btampContext->sessionId); /*Added by Luiza:*/ - btampContext->isBapSessionOpen = FALSE; + btampContext->isBapSessionOpen = FALSE; } /*Action code for transition */ #endif @@ -1791,8 +1791,8 @@ btampFsm vosStatus = determineChan(btampContext, BT_INITIATOR, &channel, status); /*Advance outer statevar */ btampfsmChangeToState(instanceVar,STARTING); - // This has to be commented out until I get the BT-AMP SME/CSR changes - vosStatus = gotoStarting( btampContext, bapEvent, eCSR_BSS_TYPE_WDS_AP, status); + // This has to be commented out until I get the BT-AMP SME/CSR changes + vosStatus = gotoStarting( btampContext, bapEvent, eCSR_BSS_TYPE_WDS_AP, status); if (VOS_STATUS_SUCCESS != vosStatus) { btampfsmChangeToState(instanceVar, S1); @@ -1804,8 +1804,8 @@ btampFsm VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, from state %s => %s", __func__, "S1", "DISCONNECTED"); /*Action code for transition */ - /* Set everything back as dis-connected */ - gotoDisconnected( btampContext); + /* Set everything back as dis-connected */ + gotoDisconnected( btampContext); /*Advance outer statevar */ btampfsmChangeToState(instanceVar,DISCONNECTED); /*Signal the disconnect */ @@ -1821,8 +1821,8 @@ btampFsm /*Advance outer statevar */ btampfsmChangeToState(instanceVar,DISCONNECTED); /*Signal the successful physical link disconnect */ - signalHCIPhysLinkDiscEvent - ( btampContext, + signalHCIPhysLinkDiscEvent + ( btampContext, WLANBAP_STATUS_SUCCESS, WLANBAP_ERROR_TERM_BY_LOCAL_HOST); /*Signal the unsuccessful physical link creation */ @@ -1838,10 +1838,10 @@ btampFsm //determineChan(BT_RESPONDER); vosStatus = determineChan(btampContext, BT_RESPONDER, &channel, status); btampfsmChangeToState(instanceVar,STARTING);//Moved to here to debug - // This has to be commented out until I get the BT-AMP SME/CSR changes + // This has to be commented out until I get the BT-AMP SME/CSR changes /*Advance outer statevar */ // btampfsmChangeToState(instanceVar,STARTING); - vosStatus = gotoStarting( btampContext, bapEvent, eCSR_BSS_TYPE_WDS_STA, status); + vosStatus = gotoStarting( btampContext, bapEvent, eCSR_BSS_TYPE_WDS_STA, status); if (VOS_STATUS_SUCCESS != vosStatus) { btampfsmChangeToState(instanceVar, S1); @@ -1880,7 +1880,7 @@ btampFsm /*Action code for transition */ signalHCIChanSelEvent(btampContext); - + } else if((msg==(BTAMPFSM_EVENT_T)eWLAN_BAP_HCI_PHYSICAL_LINK_DISCONNECT)) { @@ -1889,26 +1889,26 @@ btampFsm /*Action code for transition */ //csrRoamDisconnect(); - sme_RoamDisconnect(hHal, - //JEZ081115: Fixme - btampContext->sessionId, + sme_RoamDisconnect(hHal, + //JEZ081115: Fixme + btampContext->sessionId, // Danlin, where are the richer reason codes? // I want to be able to convey everything 802.11 supports... eCSR_DISCONNECT_REASON_UNSPECIFIED); gotoDisconnecting( btampContext, - VOS_TRUE, - WLANBAP_ERROR_NO_CNCT, - //VOS_TRUE, // Should be VOS_FALSE !!! - VOS_FALSE, + VOS_TRUE, + WLANBAP_ERROR_NO_CNCT, + //VOS_TRUE, // Should be VOS_FALSE !!! + VOS_FALSE, WLANBAP_ERROR_TERM_BY_LOCAL_HOST); /*Advance outer statevar */ btampfsmChangeToState(instanceVar,DISCONNECTING); // It is NOT clear that we need to send the Phy Link Disconnect // Complete Event here. - signalHCIPhysLinkDiscEvent - ( btampContext, + signalHCIPhysLinkDiscEvent + ( btampContext, WLANBAP_STATUS_SUCCESS, WLANBAP_ERROR_TERM_BY_LOCAL_HOST); } @@ -1937,7 +1937,7 @@ btampFsm btampfsmChangeToState(instanceVar,CONNECTING); /*Action code for transition */ gotoConnecting(btampContext); - + } else if((msg==(BTAMPFSM_EVENT_T)eWLAN_BAP_TIMER_CONNECT_ACCEPT_TIMEOUT)) { @@ -1946,14 +1946,14 @@ btampFsm /*Action code for transition */ //csrRoamDisconnect(); - sme_RoamDisconnect(hHal, - //JEZ081115: Fixme - btampContext->sessionId, + sme_RoamDisconnect(hHal, + //JEZ081115: Fixme + btampContext->sessionId, eCSR_DISCONNECT_REASON_UNSPECIFIED); gotoDisconnecting( - btampContext, + btampContext, VOS_TRUE, - WLANBAP_ERROR_HOST_TIMEOUT, + WLANBAP_ERROR_HOST_TIMEOUT, VOS_FALSE, 0); /*Advance outer statevar */ @@ -1999,9 +1999,9 @@ btampFsm btampfsmChangeToState(instanceVar,CONNECTED); #endif /* register our STA with TL */ - regStaWithTl ( - btampContext, /* btampContext value */ - BT_RESPONDER, + regStaWithTl ( + btampContext, /* btampContext value */ + BT_RESPONDER, (tCsrRoamInfo *)bapEvent->params); } @@ -2012,23 +2012,23 @@ btampFsm /*Action code for transition */ //csrRoamDisconnect(); - sme_RoamDisconnect(hHal, - //JEZ081115: Fixme - btampContext->sessionId, + sme_RoamDisconnect(hHal, + //JEZ081115: Fixme + btampContext->sessionId, eCSR_DISCONNECT_REASON_UNSPECIFIED); gotoDisconnecting( btampContext, - VOS_TRUE, - WLANBAP_ERROR_NO_CNCT, - //VOS_TRUE, // Should be VOS_FALSE !!! - VOS_FALSE, + VOS_TRUE, + WLANBAP_ERROR_NO_CNCT, + //VOS_TRUE, // Should be VOS_FALSE !!! + VOS_FALSE, WLANBAP_ERROR_TERM_BY_LOCAL_HOST); /*Advance outer statevar */ btampfsmChangeToState(instanceVar,DISCONNECTING); // It is NOT clear that we need to send the Phy Link Disconnect // Complete Event here. - signalHCIPhysLinkDiscEvent - ( btampContext, + signalHCIPhysLinkDiscEvent + ( btampContext, WLANBAP_STATUS_SUCCESS, WLANBAP_ERROR_TERM_BY_LOCAL_HOST); } @@ -2041,16 +2041,16 @@ btampFsm /*Action code for transition */ //csrRoamDisconnect(DEAUTH); //JEZ081120: Danlin points out that I could just ignore this - sme_RoamDisconnect(hHal, - //JEZ081115: Fixme - btampContext->sessionId, + sme_RoamDisconnect(hHal, + //JEZ081115: Fixme + btampContext->sessionId, eCSR_DISCONNECT_REASON_DEAUTH); //eCSR_DISCONNECT_REASON_UNSPECIFIED); gotoDisconnecting( btampContext, - VOS_TRUE, - WLANBAP_ERROR_AUTHENT_FAILURE, - VOS_FALSE, + VOS_TRUE, + WLANBAP_ERROR_AUTHENT_FAILURE, + VOS_FALSE, 0); /*Set the status code being returned to the btampFsm caller */ @@ -2073,22 +2073,22 @@ btampFsm // callback itself. This messes up my state machine. //csrRoamAccept(); - // No! This is fine. + // No! This is fine. /*Set the status code being returned to the btampFsm caller */ *status = WLANBAP_STATUS_SUCCESS; - /* JEZ081215: N.B.: Currently, I don't get the + /* JEZ081215: N.B.: Currently, I don't get the * eCSR_ROAM_RESULT_WDS_ASSOCIATED as an AP. - * So, I have to register with TL, here. This + * So, I have to register with TL, here. This * seems weird. */ /* register our STA with TL */ - regStaWithTl ( - btampContext, /* btampContext value */ - BT_INITIATOR, + regStaWithTl ( + btampContext, /* btampContext value */ + BT_INITIATOR, (tCsrRoamInfo *)bapEvent->params ); - + gotoAuthenticating(btampContext); /*Action code for transition */ initRsnAuthenticator(btampContext, BT_INITIATOR); @@ -2114,15 +2114,15 @@ btampFsm sme_RoamDisconnect(hHal, btampContext->sessionId, eCSR_DISCONNECT_REASON_UNSPECIFIED); - /* Section 3.1.8 and section 3.1.9 have contradictory semantics for 0x16. - * 3.1.8 is "connection terminated by local host". 3.1.9 is "failed connection". + /* Section 3.1.8 and section 3.1.9 have contradictory semantics for 0x16. + * 3.1.8 is "connection terminated by local host". 3.1.9 is "failed connection". */ //gotoDisconnecting(FAILED_CONNECTION); gotoDisconnecting( btampContext, - VOS_TRUE, + VOS_TRUE, WLANBAP_ERROR_TERM_BY_LOCAL_HOST, //FAILED_CONNECTION - VOS_FALSE, + VOS_FALSE, 0); /*Advance outer statevar */ btampfsmChangeToState(instanceVar,DISCONNECTING); @@ -2134,15 +2134,15 @@ btampFsm /*Action code for transition */ //csrRoamDisconnect(); - sme_RoamDisconnect(hHal, - //JEZ081115: Fixme - btampContext->sessionId, + sme_RoamDisconnect(hHal, + //JEZ081115: Fixme + btampContext->sessionId, eCSR_DISCONNECT_REASON_UNSPECIFIED); gotoDisconnecting( btampContext, - VOS_TRUE, + VOS_TRUE, WLANBAP_ERROR_HOST_TIMEOUT, - VOS_FALSE, + VOS_FALSE, 0); /*Advance outer statevar */ btampfsmChangeToState(instanceVar,DISCONNECTING); @@ -2162,16 +2162,16 @@ btampFsm VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, from state %s => %s", __func__, "AUTHENTICATING", "KEYING"); /*Action code for transition */ - //sme_RoamSetContext(); + //sme_RoamSetContext(); #if 0 sme_RoamSetKey( - VOS_GET_HAL_CB(btampContext->pvosGCtx), - btampContext->sessionId, - tSirMacAddr peerBssId, + VOS_GET_HAL_CB(btampContext->pvosGCtx), + btampContext->sessionId, + tSirMacAddr peerBssId, eCsrEncryptionType encryptType, - tANI_U16 keyLength, + tANI_U16 keyLength, tANI_U8 *pKey, - VOS_TRUE, // TRUE + VOS_TRUE, // TRUE tANI_U8 paeRole); #endif //0 /*Advance outer statevar */ @@ -2184,16 +2184,16 @@ btampFsm VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, from state %s => %s", __func__, "AUTHENTICATING", "KEYING"); /*Action code for transition */ - //sme_RoamSetContext(); + //sme_RoamSetContext(); #if 0 sme_RoamSetKey( - VOS_GET_HAL_CB(btampContext->pvosGCtx), - btampContext->sessionId, - tSirMacAddr peerBssId, + VOS_GET_HAL_CB(btampContext->pvosGCtx), + btampContext->sessionId, + tSirMacAddr peerBssId, eCsrEncryptionType encryptType, - tANI_U16 keyLength, + tANI_U16 keyLength, tANI_U8 *pKey, - VOS_TRUE, // TRUE + VOS_TRUE, // TRUE tANI_U8 paeRole); #endif //0 /*Advance outer statevar */ @@ -2206,18 +2206,18 @@ btampFsm gotoDisconnecting( btampContext, - VOS_TRUE, + VOS_TRUE, WLANBAP_ERROR_HOST_TIMEOUT, - VOS_FALSE, + VOS_FALSE, 0); /*Advance outer statevar */ btampfsmChangeToState(instanceVar,DISCONNECTING); /*Action code for transition */ - sme_RoamDisconnect(hHal, - //JEZ081115: Fixme - btampContext->sessionId, + sme_RoamDisconnect(hHal, + //JEZ081115: Fixme + btampContext->sessionId, eCSR_DISCONNECT_REASON_UNSPECIFIED); - + } else if((msg==(BTAMPFSM_EVENT_T)eWLAN_BAP_HCI_PHYSICAL_LINK_DISCONNECT)) { @@ -2226,23 +2226,23 @@ btampFsm /*Action code for transition */ //csrRoamDisconnect(); - sme_RoamDisconnect(hHal, - //JEZ081115: Fixme - btampContext->sessionId, + sme_RoamDisconnect(hHal, + //JEZ081115: Fixme + btampContext->sessionId, eCSR_DISCONNECT_REASON_UNSPECIFIED); gotoDisconnecting( btampContext, - VOS_TRUE, + VOS_TRUE, WLANBAP_ERROR_NO_CNCT, - //VOS_TRUE, // Should be VOS_FALSE !!! - VOS_FALSE, + //VOS_TRUE, // Should be VOS_FALSE !!! + VOS_FALSE, WLANBAP_ERROR_TERM_BY_LOCAL_HOST); /*Advance outer statevar */ btampfsmChangeToState(instanceVar,DISCONNECTING); // It is NOT clear that we need to send the Phy Link Disconnect // Complete Event here. - signalHCIPhysLinkDiscEvent - ( btampContext, + signalHCIPhysLinkDiscEvent + ( btampContext, WLANBAP_STATUS_SUCCESS, WLANBAP_ERROR_TERM_BY_LOCAL_HOST); } @@ -2253,16 +2253,16 @@ btampFsm /*Action code for transition */ //csrRoamDisconnect(DEAUTH); - sme_RoamDisconnect(hHal, - //JEZ081115: Fixme - btampContext->sessionId, + sme_RoamDisconnect(hHal, + //JEZ081115: Fixme + btampContext->sessionId, eCSR_DISCONNECT_REASON_DEAUTH); //eCSR_DISCONNECT_REASON_UNSPECIFIED); gotoDisconnecting( btampContext, - VOS_TRUE, - WLANBAP_ERROR_AUTHENT_FAILURE, - VOS_FALSE, + VOS_TRUE, + WLANBAP_ERROR_AUTHENT_FAILURE, + VOS_FALSE, 0); /*Advance outer statevar */ btampfsmChangeToState(instanceVar,DISCONNECTING); @@ -2282,9 +2282,9 @@ btampFsm gotoDisconnecting( btampContext, - VOS_FALSE, - 0, - VOS_TRUE, + VOS_FALSE, + 0, + VOS_TRUE, WLANBAP_ERROR_TERM_BY_LOCAL_HOST); /*Advance outer statevar */ btampfsmChangeToState(instanceVar,DISCONNECTING); @@ -2292,9 +2292,9 @@ btampFsm WLANBAP_DeInitLinkSupervision(( ptBtampHandle)btampContext); /*Action code for transition */ //csrRoamDisconnect(); - sme_RoamDisconnect(hHal, - //JEZ081115: Fixme - btampContext->sessionId, + sme_RoamDisconnect(hHal, + //JEZ081115: Fixme + btampContext->sessionId, eCSR_DISCONNECT_REASON_UNSPECIFIED); } else if((msg==(BTAMPFSM_EVENT_T)eWLAN_BAP_MAC_INDICATES_MEDIA_DISCONNECTION)) @@ -2306,9 +2306,9 @@ btampFsm gotoDisconnecting( btampContext, - VOS_FALSE, - 0, - VOS_TRUE, + VOS_FALSE, + 0, + VOS_TRUE, WLANBAP_ERROR_TERM_BY_LOCAL_HOST); /*Action code for transition */ sme_RoamDisconnect(hHal, @@ -2341,8 +2341,8 @@ btampFsm //Clear gDiscRequested; btampContext->gDiscRequested = VOS_FALSE; - - if(btampContext->BAPDeviceRole == BT_INITIATOR) + + if(btampContext->BAPDeviceRole == BT_INITIATOR) { if(!VOS_IS_STATUS_SUCCESS(vos_lock_acquire(&btampContext->bapLock))) { @@ -2359,13 +2359,13 @@ btampFsm suppRsnFsmFree(btampContext); } - /* Lookup the StaId using the phy_link_handle and the BAP context */ - vosStatus = WLANBAP_GetStaIdFromLinkCtx ( - btampHandle, /* btampHandle value in */ + /* Lookup the StaId using the phy_link_handle and the BAP context */ + vosStatus = WLANBAP_GetStaIdFromLinkCtx ( + btampHandle, /* btampHandle value in */ btampContext->phy_link_handle, /* phy_link_handle value in */ &ucSTAId, /* The StaId (used by TL, PE, and HAL) */ &pHddHdl); /* Handle to return BSL context */ - if ( VOS_STATUS_SUCCESS != vosStatus ) + if ( VOS_STATUS_SUCCESS != vosStatus ) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO, "Unable to retrieve STA Id from BAP context and phy_link_handle in %s", __func__); @@ -2379,8 +2379,8 @@ btampFsm /*Advance outer statevar */ // btampfsmChangeToState(instanceVar,DISCONNECTED); - signalHCIPhysLinkDiscEvent - ( btampContext, + signalHCIPhysLinkDiscEvent + ( btampContext, WLANBAP_STATUS_SUCCESS, btampContext->gDiscReason); /*sme_CloseSession(VOS_GET_HAL_CB(btampContext->pvosGCtx), @@ -2397,7 +2397,7 @@ btampFsm { /*Transition from DISCONNECTING to DISCONNECTED (both without substates)*/ VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, from state %s => %s gNeedPhysLinkComp TRUE", __func__, "DISCONNECTING", "DISCONNECTED"); - if(btampContext->BAPDeviceRole == BT_INITIATOR) + if(btampContext->BAPDeviceRole == BT_INITIATOR) { if(!VOS_IS_STATUS_SUCCESS(vos_lock_acquire(&btampContext->bapLock))) { @@ -2414,13 +2414,13 @@ btampFsm { suppRsnFsmFree(btampContext); } - /* Lookup the StaId using the phy_link_handle and the BAP context */ - vosStatus = WLANBAP_GetStaIdFromLinkCtx ( - btampHandle, /* btampHandle value in */ + /* Lookup the StaId using the phy_link_handle and the BAP context */ + vosStatus = WLANBAP_GetStaIdFromLinkCtx ( + btampHandle, /* btampHandle value in */ btampContext->phy_link_handle, /* phy_link_handle value in */ &ucSTAId, /* The StaId (used by TL, PE, and HAL) */ &pHddHdl); /* Handle to return BSL context */ - if ( VOS_STATUS_SUCCESS != vosStatus ) + if ( VOS_STATUS_SUCCESS != vosStatus ) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO, "Unable to retrieve STA Id from BAP context and phy_link_handle in %s", __func__); @@ -2454,15 +2454,15 @@ btampFsm /*Action code for transition */ //csrRoamDisconnect(); - sme_RoamDisconnect(hHal, - //JEZ081115: Fixme - btampContext->sessionId, + sme_RoamDisconnect(hHal, + //JEZ081115: Fixme + btampContext->sessionId, eCSR_DISCONNECT_REASON_UNSPECIFIED); gotoDisconnecting( btampContext, - VOS_TRUE, + VOS_TRUE, WLANBAP_ERROR_HOST_TIMEOUT, - VOS_FALSE, + VOS_FALSE, 0); /*Advance outer statevar */ btampfsmChangeToState(instanceVar,DISCONNECTING); @@ -2474,25 +2474,25 @@ btampFsm /*Action code for transition */ //csrRoamDisconnect(); - sme_RoamDisconnect(hHal, - //JEZ081115: Fixme - btampContext->sessionId, + sme_RoamDisconnect(hHal, + //JEZ081115: Fixme + btampContext->sessionId, eCSR_DISCONNECT_REASON_UNSPECIFIED); gotoDisconnecting( btampContext, - VOS_TRUE, + VOS_TRUE, WLANBAP_ERROR_NO_CNCT, - //VOS_TRUE, // Should be VOS_FALSE !!! - VOS_FALSE, + //VOS_TRUE, // Should be VOS_FALSE !!! + VOS_FALSE, WLANBAP_ERROR_TERM_BY_LOCAL_HOST); /*Advance outer statevar */ btampfsmChangeToState(instanceVar,DISCONNECTING); // It is NOT clear that we need to send the Phy Link Disconnect // Complete Event here. - signalHCIPhysLinkDiscEvent - ( btampContext, + signalHCIPhysLinkDiscEvent + ( btampContext, WLANBAP_STATUS_SUCCESS, WLANBAP_ERROR_TERM_BY_LOCAL_HOST); } @@ -2522,10 +2522,10 @@ btampFsm /*Action code for transition */ vosStatus = determineChan(btampContext, BT_INITIATOR, &channel, status); - // This has to be commented out until I get the BT-AMP SME/CSR changes + // This has to be commented out until I get the BT-AMP SME/CSR changes /*Advance outer statevar */ btampfsmChangeToState(instanceVar,STARTING); - vosStatus = gotoStarting( btampContext, bapEvent, eCSR_BSS_TYPE_WDS_AP, status); + vosStatus = gotoStarting( btampContext, bapEvent, eCSR_BSS_TYPE_WDS_AP, status); if (VOS_STATUS_SUCCESS != vosStatus) { btampfsmChangeToState(instanceVar, SCANNING); @@ -2552,8 +2552,8 @@ btampFsm gotoDisconnected(btampContext); /*Advance outer statevar */ btampfsmChangeToState(instanceVar,DISCONNECTED); - signalHCIPhysLinkDiscEvent - ( btampContext, + signalHCIPhysLinkDiscEvent + ( btampContext, WLANBAP_STATUS_SUCCESS, WLANBAP_ERROR_TERM_BY_LOCAL_HOST); signalHCIPhysLinkCompEvent( btampContext, WLANBAP_ERROR_NO_CNCT); @@ -2585,15 +2585,15 @@ btampFsm /*Action code for transition */ //csrRoamDisconnect(); - sme_RoamDisconnect(hHal, - //JEZ081115: Fixme - btampContext->sessionId, + sme_RoamDisconnect(hHal, + //JEZ081115: Fixme + btampContext->sessionId, eCSR_DISCONNECT_REASON_UNSPECIFIED); gotoDisconnecting( btampContext, - VOS_TRUE, + VOS_TRUE, WLANBAP_ERROR_HOST_TIMEOUT, - VOS_FALSE, + VOS_FALSE, 0); /*Advance outer statevar */ btampfsmChangeToState(instanceVar,DISCONNECTING); @@ -2605,25 +2605,25 @@ btampFsm /*Action code for transition */ //csrRoamDisconnect(); - sme_RoamDisconnect(hHal, - //JEZ081115: Fixme - btampContext->sessionId, + sme_RoamDisconnect(hHal, + //JEZ081115: Fixme + btampContext->sessionId, eCSR_DISCONNECT_REASON_UNSPECIFIED); gotoDisconnecting( btampContext, - VOS_TRUE, + VOS_TRUE, WLANBAP_ERROR_NO_CNCT, - //VOS_TRUE, // Should be VOS_FALSE !!! - VOS_FALSE, + //VOS_TRUE, // Should be VOS_FALSE !!! + VOS_FALSE, WLANBAP_ERROR_TERM_BY_LOCAL_HOST); /*Advance outer statevar */ btampfsmChangeToState(instanceVar,DISCONNECTING); // It is NOT clear that we need to send the Phy Link Disconnect // Complete Event here. - signalHCIPhysLinkDiscEvent - ( btampContext, + signalHCIPhysLinkDiscEvent + ( btampContext, WLANBAP_STATUS_SUCCESS, WLANBAP_ERROR_TERM_BY_LOCAL_HOST); } @@ -2644,14 +2644,14 @@ btampFsm } VOS_STATUS btampEstablishLogLink(ptBtampContext btampContext) -{ +{ VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; vos_msg_t msg; tAniBtAmpLogLinkReq *pMsg; pMsg = vos_mem_malloc(sizeof(tAniBtAmpLogLinkReq)); - if ( NULL == pMsg ) + if ( NULL == pMsg ) { VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "In %s, failed to allocate mem for req", __func__); return VOS_STATUS_E_NOMEM; @@ -2690,15 +2690,14 @@ void btampEstablishLogLinkHdlr(void* pMsg) } else { - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "In %s, btampContext is NULL", __func__); + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "In %s, btampContext is NULL", __func__); return; } - + } else { - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "In %s, pBtAmpLogLinkReq is NULL", __func__); + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, "In %s, pBtAmpLogLinkReq is NULL", __func__); } return; } - diff --git a/CORE/BAP/src/btampHCI.c b/CORE/BAP/src/btampHCI.c index adbf96231fae..05d3c14bd56d 100644 --- a/CORE/BAP/src/btampHCI.c +++ b/CORE/BAP/src/btampHCI.c @@ -59,11 +59,11 @@ # pragma warning (disable: 4996) /* ... was declared deprecated */ #endif /* Microsoft C/C++ */ -/*Length of the value field expected in a TLV of type Connected Channel in an +/*Length of the value field expected in a TLV of type Connected Channel in an AMP Assoc*/ #define WLAN_BAP_PAL_AMP_ASSOC_CONN_CH_TLV_MIN_LEN 3 -/*Length of the value field expected in a TLV of type Preferred Channel in an +/*Length of the value field expected in a TLV of type Preferred Channel in an AMP Assoc*/ #define WLAN_BAP_PAL_AMP_ASSOC_PREF_CH_TLV_MIN_LEN 3 @@ -98,19 +98,19 @@ #define WLAN_BAP_PAL_FLOW_SPEC_MOD_TLV_LEN 34 /*Length of the value field expected in a TLV of type Flush*/ -#define WLAN_BAP_PAL_FLUSH_TLV_LEN 2 +#define WLAN_BAP_PAL_FLUSH_TLV_LEN 2 /*Length of the value field expected in a TLV of type enhanced Flush*/ -#define WLAN_BAP_PAL_ENHANCED_FLUSH_TLV_LEN 3 +#define WLAN_BAP_PAL_ENHANCED_FLUSH_TLV_LEN 3 /*Length of the value field expected in a TLV of type Cancel Log Link*/ #define WLAN_BAP_PAL_CANCEL_LOG_LINK_TLV_LEN 2 -/*Length of the value field expected in a TLV of type Read Best Effort Flush +/*Length of the value field expected in a TLV of type Read Best Effort Flush Timeout*/ #define WLAN_BAP_PAL_READ_BE_FLUSH_TIMEOUT_TLV_LEN 2 -/*Length of the value field expected in a TLV of type Read Failed Contact +/*Length of the value field expected in a TLV of type Read Failed Contact Counter*/ #define WLAN_BAP_PAL_READ_FAILED_CONTACT_CNT_TLV_LEN 2 @@ -127,7 +127,7 @@ /*Length of the value field expected in a TLV of type Read RSSI*/ #define WLAN_BAP_PAL_READ_RSSI_TLV_LEN 2 -/*Length of the value field expected in a TLV of type Reset Failed Contact +/*Length of the value field expected in a TLV of type Reset Failed Contact Counter*/ #define WLAN_BAP_PAL_RESET_FAILED_CONTACT_CNT_TLV_LEN 2 @@ -140,11 +140,11 @@ /*Length of the value field expected in a TLV of type Set SHort Range Mode*/ #define WLAN_BAP_PAL_SET_SHORT_RANGE_MODE_TLV_LEN 2 -/*Length of the value field expected in a TLV of type Write Best Effort Flush +/*Length of the value field expected in a TLV of type Write Best Effort Flush Timeout*/ #define WLAN_BAP_PAL_WRITE_BE_FLUSH_TIMEOUT_TLV_LEN 6 -/*Length of the value field expected in a TLV of type Write Connection Accept +/*Length of the value field expected in a TLV of type Write Connection Accept Timeout*/ #define WLAN_BAP_PAL_WRITE_CON_ACC_TIMEOUT_TLV_LEN 2 @@ -165,7 +165,7 @@ #define WLAN_BAP_PAL_WRITE_LOOOPBACK_MODE_TLV_LEN 1 /*Length of the value field expected in a TLV of type Write Remote AMP Assoc*/ -#define WLAN_BAP_PAL_WRITE_REMOTE_AMP_ASSOC_MIN_TLV_LEN 5 +#define WLAN_BAP_PAL_WRITE_REMOTE_AMP_ASSOC_MIN_TLV_LEN 5 /* As per AMP specification */ /* Regulatory Extension Identifier for channel list */ @@ -546,13 +546,13 @@ static tTLVDefn* FindTLVDefn( void * pCtx, v_U32_t sType, sLen; v_U32_t pec; v_U16_t id; - + sType = 1; sLen = 2; - + (void)pCtx; - - if (sType == 2) + + if (sType == 2) framesntohs( pCtx, &id, pBuf, 2 ); else { id = *pBuf; @@ -607,19 +607,19 @@ v_U32_t btampUnpackTlvAMP_Assoc_Connected_Channel(void * pCtx, v_U8_t *pBuf, v_U (void)pBuf; (void)tlvlen; /* Shutup the compiler */ /*----------------------------------------------------------------------- - TLV Sanity check + TLV Sanity check -------------------------------------------------------------------------*/ - if ( WLAN_BAP_PAL_AMP_ASSOC_CONN_CH_TLV_MIN_LEN > tlvlen ) + if ( WLAN_BAP_PAL_AMP_ASSOC_CONN_CH_TLV_MIN_LEN > tlvlen ) { #ifdef WLAN_BAPHCI_ENABLE_LOGGING /*Log invalid len*/ - VOS_TRACE(VOS_MODULE_ID_BAP,VOS_TRACE_LEVEL_ERROR, "Invalid TLV len on %s", __func__); -#endif - return BTAMP_INVALID_TLV_LENGTH; + VOS_TRACE(VOS_MODULE_ID_BAP,VOS_TRACE_LEVEL_ERROR, "Invalid TLV len on %s", __func__); +#endif + return BTAMP_INVALID_TLV_LENGTH; } /*----------------------------------------------------------------------- - Parse TLV + Parse TLV -----------------------------------------------------------------------*/ @@ -660,19 +660,19 @@ v_U32_t btampUnpackTlvAMP_Assoc_MAC_Addr(void * pCtx, v_U8_t *pBuf, v_U16_t tlvl (void)pBuf; (void)tlvlen; /* Shutup the compiler */ /*----------------------------------------------------------------------- - TLV Sanity check + TLV Sanity check -------------------------------------------------------------------------*/ - if ( WLAN_BAP_PAL_MAC_ADDR_TLV_LEN != tlvlen ) + if ( WLAN_BAP_PAL_MAC_ADDR_TLV_LEN != tlvlen ) { -#ifdef WLAN_BAPHCI_ENABLE_LOGGING +#ifdef WLAN_BAPHCI_ENABLE_LOGGING /*Log invalid len*/ - VOS_TRACE(VOS_MODULE_ID_BAP,VOS_TRACE_LEVEL_ERROR,"Invalid TLV len on %s", __func__); -#endif - return BTAMP_INVALID_TLV_LENGTH; + VOS_TRACE(VOS_MODULE_ID_BAP,VOS_TRACE_LEVEL_ERROR,"Invalid TLV len on %s", __func__); +#endif + return BTAMP_INVALID_TLV_LENGTH; } /*----------------------------------------------------------------------- - Parse TLV + Parse TLV -----------------------------------------------------------------------*/ pDst->present = 1; BTAMP_MEMCPY(pCtx, pDst->mac_addr, pBuf, 6); @@ -693,19 +693,19 @@ v_U32_t btampUnpackTlvAMP_Assoc_PAL_Capabilities(void * pCtx, v_U8_t *pBuf, v_U1 (void)pBuf; (void)tlvlen; /* Shutup the compiler */ /*----------------------------------------------------------------------- - TLV Sanity check + TLV Sanity check -------------------------------------------------------------------------*/ - if ( WLAN_BAP_PAL_CAPABILITIES_TLV_LEN != tlvlen ) + if ( WLAN_BAP_PAL_CAPABILITIES_TLV_LEN != tlvlen ) { -#ifdef WLAN_BAPHCI_ENABLE_LOGGING +#ifdef WLAN_BAPHCI_ENABLE_LOGGING /*Log invalid len*/ - VOS_TRACE(VOS_MODULE_ID_BAP,VOS_TRACE_LEVEL_ERROR,"Invalid TLV len on %s", __func__); -#endif - return BTAMP_INVALID_TLV_LENGTH; + VOS_TRACE(VOS_MODULE_ID_BAP,VOS_TRACE_LEVEL_ERROR,"Invalid TLV len on %s", __func__); +#endif + return BTAMP_INVALID_TLV_LENGTH; } /*----------------------------------------------------------------------- - Parse TLV + Parse TLV -----------------------------------------------------------------------*/ pDst->present = 1; framesntohl(pCtx, &pDst->pal_capabilities, pBuf, 0); @@ -727,23 +727,23 @@ v_U32_t btampUnpackTlvAMP_Assoc_PAL_Version(void * pCtx, v_U8_t *pBuf, v_U16_t t /*----------------------------------------------------------------------- - TLV Sanity check + TLV Sanity check -------------------------------------------------------------------------*/ - if ( WLAN_BAP_PAL_VERSION_TLV_LEN != tlvlen ) + if ( WLAN_BAP_PAL_VERSION_TLV_LEN != tlvlen ) { -#ifdef WLAN_BAPHCI_ENABLE_LOGGING +#ifdef WLAN_BAPHCI_ENABLE_LOGGING /*Log invalid len*/ - VOS_TRACE(VOS_MODULE_ID_BAP,VOS_TRACE_LEVEL_ERROR,"Invalid TLV len on %s", __func__); -#endif - return BTAMP_INVALID_TLV_LENGTH; + VOS_TRACE(VOS_MODULE_ID_BAP,VOS_TRACE_LEVEL_ERROR,"Invalid TLV len on %s", __func__); +#endif + return BTAMP_INVALID_TLV_LENGTH; } /*----------------------------------------------------------------------- - Parse TLV + Parse TLV -----------------------------------------------------------------------*/ pDst->present = 1; pDst->pal_version = *pBuf; - pBuf += 1; + pBuf += 1; tlvlen -= (v_U8_t)1; framesntohs(pCtx, &pDst->pal_CompanyID, pBuf, 0); pBuf += 2; @@ -766,19 +766,19 @@ v_U32_t btampUnpackTlvAMP_Assoc_Preferred_Channel_List(void * pCtx, v_U8_t *pBuf (void)pBuf; (void)tlvlen; /* Shutup the compiler */ /*----------------------------------------------------------------------- - TLV Sanity check + TLV Sanity check -------------------------------------------------------------------------*/ - if ( WLAN_BAP_PAL_AMP_ASSOC_PREF_CH_TLV_MIN_LEN > tlvlen ) + if ( WLAN_BAP_PAL_AMP_ASSOC_PREF_CH_TLV_MIN_LEN > tlvlen ) { -#ifdef WLAN_BAPHCI_ENABLE_LOGGING +#ifdef WLAN_BAPHCI_ENABLE_LOGGING /*Log invalid len*/ - VOS_TRACE(VOS_MODULE_ID_BAP,VOS_TRACE_LEVEL_ERROR,"Invalid TLV len on %s", __func__); -#endif - return BTAMP_INVALID_TLV_LENGTH; + VOS_TRACE(VOS_MODULE_ID_BAP,VOS_TRACE_LEVEL_ERROR,"Invalid TLV len on %s", __func__); +#endif + return BTAMP_INVALID_TLV_LENGTH; } /*----------------------------------------------------------------------- - Parse TLV + Parse TLV -----------------------------------------------------------------------*/ pDst->present = 1; /* Contry String - 3 bytes */ @@ -818,20 +818,20 @@ v_U32_t btampUnpackTlvFlow_Spec(void * pCtx, v_U8_t *pBuf, v_U16_t tlvlen, tBtam (void)pBuf; (void)tlvlen; /* Shutup the compiler */ /*----------------------------------------------------------------------- - TLV Sanity check + TLV Sanity check -------------------------------------------------------------------------*/ - if ( WLAN_BAP_PAL_FLOW_SPEC_TLV_LEN != tlvlen ) + if ( WLAN_BAP_PAL_FLOW_SPEC_TLV_LEN != tlvlen ) { -#ifdef WLAN_BAPHCI_ENABLE_LOGGING +#ifdef WLAN_BAPHCI_ENABLE_LOGGING /*Log invalid len*/ - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, - "Invalid TLV len on %s", __func__); -#endif - return BTAMP_INVALID_TLV_LENGTH; + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, + "Invalid TLV len on %s", __func__); +#endif + return BTAMP_INVALID_TLV_LENGTH; } /*----------------------------------------------------------------------- - Parse TLV + Parse TLV -----------------------------------------------------------------------*/ pDst->present = 1; pDst->flow_spec_id = *pBuf; @@ -867,22 +867,22 @@ v_U32_t btampUnpackTlvHCI_Accept_Logical_Link_Cmd(void * pCtx, v_U8_t *pBuf, v_U (void)pBuf; (void)tlvlen; /* Shutup the compiler */ /*----------------------------------------------------------------------- - TLV Sanity check + TLV Sanity check -------------------------------------------------------------------------*/ #ifdef WLAN_BAPHCI_ENABLE_VALIDITY_CHECKING - if ( WLAN_BAP_PAL_ACC_LOG_LINK_TLV_LEN != tlvlen ) + if ( WLAN_BAP_PAL_ACC_LOG_LINK_TLV_LEN != tlvlen ) { #ifdef WLAN_BAPHCI_ENABLE_LOGGING /*Log invalid len*/ - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, - "Invalid TLV len on %s", __func__); -#endif -// return BTAMP_INVALID_TLV_LENGTH; + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, + "Invalid TLV len on %s", __func__); +#endif +// return BTAMP_INVALID_TLV_LENGTH; } #endif /*----------------------------------------------------------------------- - Parse TLV + Parse TLV -----------------------------------------------------------------------*/ pDst->present = 1; @@ -910,20 +910,20 @@ v_U32_t btampUnpackTlvHCI_Accept_Physical_Link_Cmd(void * pCtx, v_U8_t *pBuf, v_ (void)pBuf; (void)tlvlen; /* Shutup the compiler */ /*----------------------------------------------------------------------- - TLV Sanity check + TLV Sanity check -------------------------------------------------------------------------*/ - if ( WLAN_BAP_PAL_ACC_PHY_LINK_TLV_MIN_LEN > tlvlen ) + if ( WLAN_BAP_PAL_ACC_PHY_LINK_TLV_MIN_LEN > tlvlen ) { #ifdef WLAN_BAPHCI_ENABLE_LOGGING /*Log invalid len*/ - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, - "Invalid TLV len on %s", __func__); -#endif - return BTAMP_INVALID_TLV_LENGTH; + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, + "Invalid TLV len on %s", __func__); +#endif + return BTAMP_INVALID_TLV_LENGTH; } /*----------------------------------------------------------------------- - Parse TLV + Parse TLV -----------------------------------------------------------------------*/ pDst->present = 1; pDst->phy_link_handle = *pBuf; @@ -1326,21 +1326,21 @@ v_U32_t btampUnpackTlvHCI_Create_Logical_Link_Cmd(void * pCtx, v_U8_t *pBuf, v_U (void)pBuf; (void)tlvlen; /* Shutup the compiler */ /*----------------------------------------------------------------------- - TLV Sanity check + TLV Sanity check -------------------------------------------------------------------------*/ #ifdef WLAN_BAPHCI_ENABLE_VALIDITY_CHECKING - if ( WLAN_BAP_PAL_CREATE_LOG_LINK_TLV_LEN != tlvlen ) + if ( WLAN_BAP_PAL_CREATE_LOG_LINK_TLV_LEN != tlvlen ) { -#ifdef WLAN_BAPHCI_ENABLE_LOGGING +#ifdef WLAN_BAPHCI_ENABLE_LOGGING /*Log invalid len*/ - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, - "Invalid TLV len on %s", __func__); -#endif -// return BTAMP_INVALID_TLV_LENGTH; + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, + "Invalid TLV len on %s", __func__); +#endif +// return BTAMP_INVALID_TLV_LENGTH; } -#endif +#endif /*----------------------------------------------------------------------- - Parse TLV + Parse TLV -----------------------------------------------------------------------*/ pDst->present = 1; pDst->phy_link_handle = *pBuf; @@ -1367,20 +1367,20 @@ v_U32_t btampUnpackTlvHCI_Create_Physical_Link_Cmd(void * pCtx, v_U8_t *pBuf, v_ (void)pBuf; (void)tlvlen; /* Shutup the compiler */ /*----------------------------------------------------------------------- - TLV Sanity check + TLV Sanity check -------------------------------------------------------------------------*/ - if ( WLAN_BAP_PAL_CREATE_PHY_LINK_TLV_MIN_LEN > tlvlen ) + if ( WLAN_BAP_PAL_CREATE_PHY_LINK_TLV_MIN_LEN > tlvlen ) { -#ifdef WLAN_BAPHCI_ENABLE_LOGGING +#ifdef WLAN_BAPHCI_ENABLE_LOGGING /*Log invalid len*/ - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, - "Invalid TLV len on %s", __func__); -#endif - return BTAMP_INVALID_TLV_LENGTH; + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, + "Invalid TLV len on %s", __func__); +#endif + return BTAMP_INVALID_TLV_LENGTH; } /*----------------------------------------------------------------------- - Parse TLV + Parse TLV -----------------------------------------------------------------------*/ pDst->present = 1; pDst->phy_link_handle = *pBuf; @@ -1432,20 +1432,20 @@ v_U32_t btampUnpackTlvHCI_Disconnect_Logical_Link_Cmd(void * pCtx, v_U8_t *pBuf, (void)pBuf; (void)tlvlen; /* Shutup the compiler */ /*----------------------------------------------------------------------- - TLV Sanity check + TLV Sanity check -------------------------------------------------------------------------*/ - if ( WLAN_BAP_PAL_DISC_LOG_LINK_TLV_LEN != tlvlen ) + if ( WLAN_BAP_PAL_DISC_LOG_LINK_TLV_LEN != tlvlen ) { #ifdef WLAN_BAPHCI_ENABLE_LOGGING /*Log invalid len*/ - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, - "Invalid TLV len on %s", __func__); -#endif - return BTAMP_INVALID_TLV_LENGTH; + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, + "Invalid TLV len on %s", __func__); +#endif + return BTAMP_INVALID_TLV_LENGTH; } /*----------------------------------------------------------------------- - Parse TLV + Parse TLV -----------------------------------------------------------------------*/ pDst->present = 1; framesntohs(pCtx, &pDst->log_link_handle, pBuf, 0); @@ -1489,22 +1489,22 @@ v_U32_t btampUnpackTlvHCI_Disconnect_Physical_Link_Cmd(void * pCtx, v_U8_t *pBuf (void)pBuf; (void)tlvlen; /* Shutup the compiler */ /*----------------------------------------------------------------------- - TLV Sanity check + TLV Sanity check -------------------------------------------------------------------------*/ #ifdef WLAN_BAPHCI_ENABLE_VALIDITY_CHECKING - if ( WLAN_BAP_PAL_DISC_PHY_LINK_TLV_LEN != tlvlen ) + if ( WLAN_BAP_PAL_DISC_PHY_LINK_TLV_LEN != tlvlen ) { #ifdef WLAN_BAPHCI_ENABLE_LOGGING /*Log invalid len*/ - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, - "Invalid TLV len on %s", __func__); -#endif -// return BTAMP_INVALID_TLV_LENGTH; + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, + "Invalid TLV len on %s", __func__); +#endif +// return BTAMP_INVALID_TLV_LENGTH; } -#endif +#endif /*----------------------------------------------------------------------- - Parse TLV + Parse TLV -----------------------------------------------------------------------*/ pDst->present = 1; pDst->phy_link_handle = *pBuf; @@ -1551,20 +1551,20 @@ v_U32_t btampUnpackTlvHCI_Flow_Spec_Modify_Cmd(void * pCtx, v_U8_t *pBuf, v_U16_ (void)pBuf; (void)tlvlen; /* Shutup the compiler */ /*----------------------------------------------------------------------- - TLV Sanity check + TLV Sanity check -------------------------------------------------------------------------*/ - if ( WLAN_BAP_PAL_FLOW_SPEC_MOD_TLV_LEN != tlvlen ) + if ( WLAN_BAP_PAL_FLOW_SPEC_MOD_TLV_LEN != tlvlen ) { #ifdef WLAN_BAPHCI_ENABLE_LOGGING /*Log invalid len*/ - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, - "Invalid TLV len on %s", __func__); -#endif - return BTAMP_INVALID_TLV_LENGTH; + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, + "Invalid TLV len on %s", __func__); +#endif + return BTAMP_INVALID_TLV_LENGTH; } /*----------------------------------------------------------------------- - Parse TLV + Parse TLV -----------------------------------------------------------------------*/ pDst->present = 1; framesntohs(pCtx, &pDst->log_link_handle, pBuf, 0); @@ -1614,20 +1614,20 @@ v_U32_t btampUnpackTlvHCI_Flush_Cmd(void * pCtx, v_U8_t *pBuf, v_U16_t tlvlen, t (void)pBuf; (void)tlvlen; /* Shutup the compiler */ /*----------------------------------------------------------------------- - TLV Sanity check + TLV Sanity check -------------------------------------------------------------------------*/ - if ( WLAN_BAP_PAL_FLUSH_TLV_LEN != tlvlen ) + if ( WLAN_BAP_PAL_FLUSH_TLV_LEN != tlvlen ) { #ifdef WLAN_BAPHCI_ENABLE_LOGGING /*Log invalid len*/ - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, - "Invalid TLV len on %s", __func__); -#endif - return BTAMP_INVALID_TLV_LENGTH; + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, + "Invalid TLV len on %s", __func__); +#endif + return BTAMP_INVALID_TLV_LENGTH; } /*----------------------------------------------------------------------- - Parse TLV + Parse TLV -----------------------------------------------------------------------*/ pDst->present = 1; framesntohs(pCtx, &pDst->log_link_handle, pBuf, 0); @@ -1705,20 +1705,20 @@ v_U32_t btampUnpackTlvHCI_Logical_Link_Cancel_Cmd(void * pCtx, v_U8_t *pBuf, v_U (void)pBuf; (void)tlvlen; /* Shutup the compiler */ /*----------------------------------------------------------------------- - TLV Sanity check + TLV Sanity check -------------------------------------------------------------------------*/ - if ( WLAN_BAP_PAL_CANCEL_LOG_LINK_TLV_LEN != tlvlen ) + if ( WLAN_BAP_PAL_CANCEL_LOG_LINK_TLV_LEN != tlvlen ) { #ifdef WLAN_BAPHCI_ENABLE_LOGGING /*Log invalid len*/ - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, - "Invalid TLV len on %s", __func__); -#endif - return BTAMP_INVALID_TLV_LENGTH; + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, + "Invalid TLV len on %s", __func__); +#endif + return BTAMP_INVALID_TLV_LENGTH; } /*----------------------------------------------------------------------- - Parse TLV + Parse TLV -----------------------------------------------------------------------*/ pDst->present = 1; pDst->phy_link_handle = *pBuf; @@ -1856,20 +1856,20 @@ v_U32_t btampUnpackTlvHCI_Read_Best_Effort_Flush_Timeout_Cmd(void * pCtx, v_U8_t (void)pBuf; (void)tlvlen; /* Shutup the compiler */ /*----------------------------------------------------------------------- - TLV Sanity check + TLV Sanity check -------------------------------------------------------------------------*/ - if ( WLAN_BAP_PAL_READ_BE_FLUSH_TIMEOUT_TLV_LEN != tlvlen ) + if ( WLAN_BAP_PAL_READ_BE_FLUSH_TIMEOUT_TLV_LEN != tlvlen ) { #ifdef WLAN_BAPHCI_ENABLE_LOGGING /*Log invalid len*/ - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, - "Invalid TLV len on %s", __func__); -#endif - return BTAMP_INVALID_TLV_LENGTH; + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, + "Invalid TLV len on %s", __func__); +#endif + return BTAMP_INVALID_TLV_LENGTH; } /*----------------------------------------------------------------------- - Parse TLV + Parse TLV -----------------------------------------------------------------------*/ pDst->present = 1; framesntohs(pCtx, &pDst->log_link_handle, pBuf, 0); @@ -1932,20 +1932,20 @@ v_U32_t btampUnpackTlvHCI_Read_Failed_Contact_Counter_Cmd(void * pCtx, v_U8_t *p (void)pBuf; (void)tlvlen; /* Shutup the compiler */ /*----------------------------------------------------------------------- - TLV Sanity check + TLV Sanity check -------------------------------------------------------------------------*/ - if ( WLAN_BAP_PAL_READ_FAILED_CONTACT_CNT_TLV_LEN != tlvlen ) + if ( WLAN_BAP_PAL_READ_FAILED_CONTACT_CNT_TLV_LEN != tlvlen ) { #ifdef WLAN_BAPHCI_ENABLE_LOGGING /*Log invalid len*/ - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, - "Invalid TLV len on %s", __func__); -#endif - return BTAMP_INVALID_TLV_LENGTH; + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, + "Invalid TLV len on %s", __func__); +#endif + return BTAMP_INVALID_TLV_LENGTH; } /*----------------------------------------------------------------------- - Parse TLV + Parse TLV -----------------------------------------------------------------------*/ pDst->present = 1; framesntohs(pCtx, &pDst->log_link_handle, pBuf, 0); @@ -1980,20 +1980,20 @@ v_U32_t btampUnpackTlvHCI_Read_Link_Quality_Cmd(void * pCtx, v_U8_t *pBuf, v_U16 (void)pBuf; (void)tlvlen; /* Shutup the compiler */ /*----------------------------------------------------------------------- - TLV Sanity check + TLV Sanity check -------------------------------------------------------------------------*/ - if ( WLAN_BAP_PAL_READ_LINK_QUALITY_TLV_LEN != tlvlen ) + if ( WLAN_BAP_PAL_READ_LINK_QUALITY_TLV_LEN != tlvlen ) { #ifdef WLAN_BAPHCI_ENABLE_LOGGING /*Log invalid len*/ - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, - "Invalid TLV len on %s", __func__); -#endif - return BTAMP_INVALID_TLV_LENGTH; + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, + "Invalid TLV len on %s", __func__); +#endif + return BTAMP_INVALID_TLV_LENGTH; } /*----------------------------------------------------------------------- - Parse TLV + Parse TLV -----------------------------------------------------------------------*/ pDst->present = 1; framesntohs(pCtx, &pDst->log_link_handle, pBuf, 0); @@ -2014,20 +2014,20 @@ v_U32_t btampUnpackTlvHCI_Read_Link_Supervision_Timeout_Cmd(void * pCtx, v_U8_t (void)pBuf; (void)tlvlen; /* Shutup the compiler */ /*----------------------------------------------------------------------- - TLV Sanity check + TLV Sanity check -------------------------------------------------------------------------*/ - if ( WLAN_BAP_PAL_READ_LINK_SVISISON_TIMEOUT_TLV_LEN != tlvlen ) + if ( WLAN_BAP_PAL_READ_LINK_SVISISON_TIMEOUT_TLV_LEN != tlvlen ) { #ifdef WLAN_BAPHCI_ENABLE_LOGGING /*Log invalid len*/ - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, - "Invalid TLV len on %s", __func__); -#endif - return BTAMP_INVALID_TLV_LENGTH; + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, + "Invalid TLV len on %s", __func__); +#endif + return BTAMP_INVALID_TLV_LENGTH; } /*----------------------------------------------------------------------- - Parse TLV + Parse TLV -----------------------------------------------------------------------*/ pDst->present = 1; framesntohs(pCtx, &pDst->log_link_handle, pBuf, 0); @@ -2048,25 +2048,25 @@ v_U32_t btampUnpackTlvHCI_Read_Local_AMP_Assoc_Cmd(void * pCtx, v_U8_t *pBuf, v_ (void)pBuf; (void)tlvlen; /* Shutup the compiler */ /*----------------------------------------------------------------------- - TLV Sanity check + TLV Sanity check -------------------------------------------------------------------------*/ - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, - "Invalid TLV len on %s. tlvlen=%d.", __func__, tlvlen); + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, + "Invalid TLV len on %s. tlvlen=%d.", __func__, tlvlen); #ifdef WLAN_BAPHCI_ENABLE_VALIDITY_CHECKING - if ( WLAN_BAP_PAL_READ_LOCAL_AMP_ASSOC_TLV_LEN != tlvlen ) + if ( WLAN_BAP_PAL_READ_LOCAL_AMP_ASSOC_TLV_LEN != tlvlen ) { #ifdef WLAN_BAPHCI_ENABLE_LOGGING /*Log invalid len*/ - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, - "Invalid TLV len on %s", __func__); -#endif -// return BTAMP_INVALID_TLV_LENGTH; + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, + "Invalid TLV len on %s", __func__); +#endif +// return BTAMP_INVALID_TLV_LENGTH; } -#endif +#endif /*----------------------------------------------------------------------- - Parse TLV + Parse TLV -----------------------------------------------------------------------*/ pDst->present = 1; pDst->phy_link_handle = *pBuf; @@ -2177,20 +2177,20 @@ v_U32_t btampUnpackTlvHCI_Read_RSSI_Cmd(void * pCtx, v_U8_t *pBuf, v_U16_t tlvle (void)pBuf; (void)tlvlen; /* Shutup the compiler */ /*----------------------------------------------------------------------- - TLV Sanity check + TLV Sanity check -------------------------------------------------------------------------*/ - if ( WLAN_BAP_PAL_READ_RSSI_TLV_LEN != tlvlen ) + if ( WLAN_BAP_PAL_READ_RSSI_TLV_LEN != tlvlen ) { #ifdef WLAN_BAPHCI_ENABLE_LOGGING /*Log invalid len*/ - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, - "Invalid TLV len on %s", __func__); -#endif - return BTAMP_INVALID_TLV_LENGTH; + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, + "Invalid TLV len on %s", __func__); +#endif + return BTAMP_INVALID_TLV_LENGTH; } /*----------------------------------------------------------------------- - Parse TLV + Parse TLV -----------------------------------------------------------------------*/ pDst->present = 1; framesntohs(pCtx, &pDst->log_link_handle, pBuf, 0); @@ -2225,20 +2225,20 @@ v_U32_t btampUnpackTlvHCI_Reset_Failed_Contact_Counter_Cmd(void * pCtx, v_U8_t * (void)pBuf; (void)tlvlen; /* Shutup the compiler */ /*----------------------------------------------------------------------- - TLV Sanity check + TLV Sanity check -------------------------------------------------------------------------*/ - if ( WLAN_BAP_PAL_RESET_FAILED_CONTACT_CNT_TLV_LEN != tlvlen ) + if ( WLAN_BAP_PAL_RESET_FAILED_CONTACT_CNT_TLV_LEN != tlvlen ) { #ifdef WLAN_BAPHCI_ENABLE_LOGGING /*Log invalid len*/ - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, - "Invalid TLV len on %s", __func__); -#endif - return BTAMP_INVALID_TLV_LENGTH; + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, + "Invalid TLV len on %s", __func__); +#endif + return BTAMP_INVALID_TLV_LENGTH; } /*----------------------------------------------------------------------- - Parse TLV + Parse TLV -----------------------------------------------------------------------*/ pDst->present = 1; framesntohs(pCtx, &pDst->log_link_handle, pBuf, 0); @@ -2259,20 +2259,20 @@ v_U32_t btampUnpackTlvHCI_Set_Event_Mask_Cmd(void * pCtx, v_U8_t *pBuf, v_U16_t (void)pBuf; (void)tlvlen; /* Shutup the compiler */ /*----------------------------------------------------------------------- - TLV Sanity check + TLV Sanity check -------------------------------------------------------------------------*/ - if ( WLAN_BAP_PAL_SET_EVENT_MASK_TLV_LEN != tlvlen ) + if ( WLAN_BAP_PAL_SET_EVENT_MASK_TLV_LEN != tlvlen ) { #ifdef WLAN_BAPHCI_ENABLE_LOGGING /*Log invalid len*/ - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, - "Invalid TLV len on %s", __func__); -#endif - return BTAMP_INVALID_TLV_LENGTH; + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, + "Invalid TLV len on %s", __func__); +#endif + return BTAMP_INVALID_TLV_LENGTH; } /*----------------------------------------------------------------------- - Parse TLV + Parse TLV -----------------------------------------------------------------------*/ pDst->present = 1; BTAMP_MEMCPY(pCtx, pDst->event_mask, pBuf, 8); @@ -2293,25 +2293,25 @@ v_U32_t btampUnpackTlvHCI_Set_Event_Mask_Page_2_Cmd(void * pCtx, v_U8_t *pBuf, v (void)pBuf; (void)tlvlen; /* Shutup the compiler */ /*----------------------------------------------------------------------- - TLV Sanity check + TLV Sanity check -------------------------------------------------------------------------*/ - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, - "Invalid TLV len on %s. tlvlen=%d.", __func__, tlvlen); + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, + "Invalid TLV len on %s. tlvlen=%d.", __func__, tlvlen); #ifdef WLAN_BAPHCI_ENABLE_VALIDITY_CHECKING - if ( WLAN_BAP_PAL_SET_EVENT_MASK2_TLV_LEN != tlvlen ) + if ( WLAN_BAP_PAL_SET_EVENT_MASK2_TLV_LEN != tlvlen ) { #ifdef WLAN_BAPHCI_ENABLE_LOGGING /*Log invalid len*/ - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, - "Invalid TLV len on %s", __func__); -#endif -// return BTAMP_INVALID_TLV_LENGTH; + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, + "Invalid TLV len on %s", __func__); +#endif +// return BTAMP_INVALID_TLV_LENGTH; } -#endif +#endif /*----------------------------------------------------------------------- - Parse TLV + Parse TLV -----------------------------------------------------------------------*/ pDst->present = 1; BTAMP_MEMCPY(pCtx, pDst->event_mask_page_2, pBuf, 8); @@ -2332,20 +2332,20 @@ v_U32_t btampUnpackTlvHCI_Set_Short_Range_Mode_Cmd(void * pCtx, v_U8_t *pBuf, v_ (void)pBuf; (void)tlvlen; /* Shutup the compiler */ /*----------------------------------------------------------------------- - TLV Sanity check + TLV Sanity check -------------------------------------------------------------------------*/ - if ( WLAN_BAP_PAL_SET_SHORT_RANGE_MODE_TLV_LEN != tlvlen ) + if ( WLAN_BAP_PAL_SET_SHORT_RANGE_MODE_TLV_LEN != tlvlen ) { #ifdef WLAN_BAPHCI_ENABLE_LOGGING /*Log invalid len*/ - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, - "Invalid TLV len on %s", __func__); -#endif - return BTAMP_INVALID_TLV_LENGTH; + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, + "Invalid TLV len on %s", __func__); +#endif + return BTAMP_INVALID_TLV_LENGTH; } /*----------------------------------------------------------------------- - Parse TLV + Parse TLV -----------------------------------------------------------------------*/ pDst->present = 1; pDst->phy_link_handle = *pBuf; @@ -2392,20 +2392,20 @@ v_U32_t btampUnpackTlvHCI_Write_Best_Effort_Flush_Timeout_Cmd(void * pCtx, v_U8_ (void)pBuf; (void)tlvlen; /* Shutup the compiler */ /*----------------------------------------------------------------------- - TLV Sanity check + TLV Sanity check -------------------------------------------------------------------------*/ - if ( WLAN_BAP_PAL_WRITE_BE_FLUSH_TIMEOUT_TLV_LEN != tlvlen ) + if ( WLAN_BAP_PAL_WRITE_BE_FLUSH_TIMEOUT_TLV_LEN != tlvlen ) { #ifdef WLAN_BAPHCI_ENABLE_LOGGING /*Log invalid len*/ - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, - "Invalid TLV len on %s", __func__); -#endif - return BTAMP_INVALID_TLV_LENGTH; + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, + "Invalid TLV len on %s", __func__); +#endif + return BTAMP_INVALID_TLV_LENGTH; } /*----------------------------------------------------------------------- - Parse TLV + Parse TLV -----------------------------------------------------------------------*/ pDst->present = 1; framesntohs(pCtx, &pDst->log_link_handle, pBuf, 0); @@ -2429,20 +2429,20 @@ v_U32_t btampUnpackTlvHCI_Write_Connection_Accept_Timeout_Cmd(void * pCtx, v_U8_ (void)pBuf; (void)tlvlen; /* Shutup the compiler */ /*----------------------------------------------------------------------- - TLV Sanity check + TLV Sanity check -------------------------------------------------------------------------*/ - if ( WLAN_BAP_PAL_WRITE_CON_ACC_TIMEOUT_TLV_LEN != tlvlen ) + if ( WLAN_BAP_PAL_WRITE_CON_ACC_TIMEOUT_TLV_LEN != tlvlen ) { #ifdef WLAN_BAPHCI_ENABLE_LOGGING /*Log invalid len*/ - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, - "Invalid TLV len on %s", __func__); -#endif - return BTAMP_INVALID_TLV_LENGTH; + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, + "Invalid TLV len on %s", __func__); +#endif + return BTAMP_INVALID_TLV_LENGTH; } /*----------------------------------------------------------------------- - Parse TLV + Parse TLV -----------------------------------------------------------------------*/ pDst->present = 1; framesntohs(pCtx, &pDst->connection_accept_timeout, pBuf, 0); @@ -2463,20 +2463,20 @@ v_U32_t btampUnpackTlvHCI_Write_Flow_Control_Mode_Cmd(void * pCtx, v_U8_t *pBuf, (void)pBuf; (void)tlvlen; /* Shutup the compiler */ /*----------------------------------------------------------------------- - TLV Sanity check + TLV Sanity check -------------------------------------------------------------------------*/ - if ( WLAN_BAP_PAL_WRITE_FLOW_CTRL_MODE_TLV_LEN != tlvlen ) + if ( WLAN_BAP_PAL_WRITE_FLOW_CTRL_MODE_TLV_LEN != tlvlen ) { #ifdef WLAN_BAPHCI_ENABLE_LOGGING /*Log invalid len*/ - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, - "Invalid TLV len on %s", __func__); -#endif - return BTAMP_INVALID_TLV_LENGTH; + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, + "Invalid TLV len on %s", __func__); +#endif + return BTAMP_INVALID_TLV_LENGTH; } /*----------------------------------------------------------------------- - Parse TLV + Parse TLV -----------------------------------------------------------------------*/ pDst->present = 1; pDst->flow_control_mode = *pBuf; @@ -2496,20 +2496,20 @@ v_U32_t btampUnpackTlvHCI_Write_Link_Supervision_Timeout_Cmd(void * pCtx, v_U8_t v_U32_t status = BTAMP_PARSE_SUCCESS; (void)pBuf; (void)tlvlen; /* Shutup the compiler */ /*----------------------------------------------------------------------- - TLV Sanity check + TLV Sanity check -------------------------------------------------------------------------*/ - if ( WLAN_BAP_PAL_WRITE_LINK_SVISION_TIMEOUT_TLV_LEN != tlvlen ) + if ( WLAN_BAP_PAL_WRITE_LINK_SVISION_TIMEOUT_TLV_LEN != tlvlen ) { #ifdef WLAN_BAPHCI_ENABLE_LOGGING /*Log invalid len*/ - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, - "Invalid TLV len on %s", __func__); -#endif - return BTAMP_INVALID_TLV_LENGTH; + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, + "Invalid TLV len on %s", __func__); +#endif + return BTAMP_INVALID_TLV_LENGTH; } /*----------------------------------------------------------------------- - Parse TLV + Parse TLV -----------------------------------------------------------------------*/ pDst->present = 1; framesntohs(pCtx, &pDst->log_link_handle, pBuf, 0); @@ -2533,20 +2533,20 @@ v_U32_t btampUnpackTlvHCI_Write_Location_Data_Cmd(void * pCtx, v_U8_t *pBuf, v_U (void)pBuf; (void)tlvlen; /* Shutup the compiler */ /*----------------------------------------------------------------------- - TLV Sanity check + TLV Sanity check -------------------------------------------------------------------------*/ - if ( WLAN_BAP_PAL_WRITE_LOCATION_DATA_CMD_TLV_LEN != tlvlen ) + if ( WLAN_BAP_PAL_WRITE_LOCATION_DATA_CMD_TLV_LEN != tlvlen ) { #ifdef WLAN_BAPHCI_ENABLE_LOGGING /*Log invalid len*/ - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, - "Invalid TLV len on %s", __func__); -#endif - return BTAMP_INVALID_TLV_LENGTH; + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, + "Invalid TLV len on %s", __func__); +#endif + return BTAMP_INVALID_TLV_LENGTH; } /*----------------------------------------------------------------------- - Parse TLV + Parse TLV -----------------------------------------------------------------------*/ pDst->present = 1; pDst->loc_domain_aware = *pBuf; @@ -2573,20 +2573,20 @@ v_U32_t btampUnpackTlvHCI_Write_Logical_Link_Accept_Timeout_Cmd(void * pCtx, v_U (void)pBuf; (void)tlvlen; /* Shutup the compiler */ /*----------------------------------------------------------------------- - TLV Sanity check + TLV Sanity check -------------------------------------------------------------------------*/ - if ( WLAN_BAP_PAL_WRITE_LOG_LINK_ACC_TIMEOUT_TLV_LEN != tlvlen ) + if ( WLAN_BAP_PAL_WRITE_LOG_LINK_ACC_TIMEOUT_TLV_LEN != tlvlen ) { #ifdef WLAN_BAPHCI_ENABLE_LOGGING /*Log invalid len*/ - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, - "Invalid TLV len on %s", __func__); -#endif - return BTAMP_INVALID_TLV_LENGTH; + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, + "Invalid TLV len on %s", __func__); +#endif + return BTAMP_INVALID_TLV_LENGTH; } /*----------------------------------------------------------------------- - Parse TLV + Parse TLV -----------------------------------------------------------------------*/ pDst->present = 1; framesntohs(pCtx, &pDst->logical_link_accept_timeout, pBuf, 0); @@ -2607,20 +2607,20 @@ v_U32_t btampUnpackTlvHCI_Write_Loopback_Mode_Cmd(void * pCtx, v_U8_t *pBuf, v_U (void)pBuf; (void)tlvlen; /* Shutup the compiler */ /*----------------------------------------------------------------------- - TLV Sanity check + TLV Sanity check -------------------------------------------------------------------------*/ - if ( WLAN_BAP_PAL_WRITE_LOOOPBACK_MODE_TLV_LEN != tlvlen ) + if ( WLAN_BAP_PAL_WRITE_LOOOPBACK_MODE_TLV_LEN != tlvlen ) { #ifdef WLAN_BAPHCI_ENABLE_LOGGING /*Log invalid len*/ - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, - "Invalid TLV len on %s", __func__); -#endif - return BTAMP_INVALID_TLV_LENGTH; + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, + "Invalid TLV len on %s", __func__); +#endif + return BTAMP_INVALID_TLV_LENGTH; } /*----------------------------------------------------------------------- - Parse TLV + Parse TLV -----------------------------------------------------------------------*/ pDst->present = 1; pDst->loopback_mode = *pBuf; @@ -2641,20 +2641,20 @@ v_U32_t btampUnpackTlvHCI_Write_Remote_AMP_ASSOC_Cmd(void * pCtx, v_U8_t *pBuf, (void)pBuf; (void)tlvlen; /* Shutup the compiler */ /*----------------------------------------------------------------------- - TLV Sanity check + TLV Sanity check -------------------------------------------------------------------------*/ - if ( WLAN_BAP_PAL_WRITE_REMOTE_AMP_ASSOC_MIN_TLV_LEN > tlvlen ) + if ( WLAN_BAP_PAL_WRITE_REMOTE_AMP_ASSOC_MIN_TLV_LEN > tlvlen ) { #ifdef WLAN_BAPHCI_ENABLE_LOGGING /*Log invalid len*/ - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, - "Invalid TLV len on %s", __func__); -#endif - return BTAMP_INVALID_TLV_LENGTH; + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, + "Invalid TLV len on %s", __func__); +#endif + return BTAMP_INVALID_TLV_LENGTH; } /*----------------------------------------------------------------------- - Parse TLV + Parse TLV -----------------------------------------------------------------------*/ pDst->present = 1; pDst->phy_link_handle = *pBuf; @@ -2688,20 +2688,20 @@ v_U32_t btampUnpackTlvHCI_Enhanced_Flush_Cmd(void * pCtx, v_U8_t *pBuf, v_U16_t (void)pBuf; (void)tlvlen; /* Shutup the compiler */ /*----------------------------------------------------------------------- - TLV Sanity check + TLV Sanity check -------------------------------------------------------------------------*/ - if ( WLAN_BAP_PAL_ENHANCED_FLUSH_TLV_LEN != tlvlen ) + if ( WLAN_BAP_PAL_ENHANCED_FLUSH_TLV_LEN != tlvlen ) { #ifdef WLAN_BAPHCI_ENABLE_LOGGING /*Log invalid len*/ - VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, - "Invalid TLV len on %s", __func__); -#endif - return BTAMP_INVALID_TLV_LENGTH; + VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR, + "Invalid TLV len on %s", __func__); +#endif + return BTAMP_INVALID_TLV_LENGTH; } /*----------------------------------------------------------------------- - Parse TLV + Parse TLV -----------------------------------------------------------------------*/ pDst->present = 1; framesntohs(pCtx, &pDst->log_link_handle, pBuf, 0); @@ -2751,8 +2751,8 @@ v_U32_t btampUnpackAMP_ASSOC(void * pCtx, v_U8_t *pBuf, v_U32_t nBuf, tBtampAMP_ v_U32_t status = 0; #ifdef WLAN_BAPHCI_ENABLE_LOGGING VOS_TRACE(VOS_MODULE_ID_BAP,VOS_TRACE_LEVEL_ERROR, - "In btampUnpackAMP_ASSOC. nBuf - %d\n", nBuf); -#endif + "In btampUnpackAMP_ASSOC. nBuf - %d\n", nBuf); +#endif status |= UnpackTlvCore(pCtx,pBuf,nBuf,TLVS,(v_U8_t*)pFrm,sizeof(*pFrm)); @@ -2841,8 +2841,8 @@ static v_U32_t UnpackTlvCore( void * pCtx, nBufRemaining = nBuf; #ifdef WLAN_BAPHCI_ENABLE_LOGGING VOS_TRACE(VOS_MODULE_ID_BAP,VOS_TRACE_LEVEL_ERROR, - "In UnpackTlvCore, nBufRemaining - %d\n", nBufRemaining); -#endif + "In UnpackTlvCore, nBufRemaining - %d\n", nBufRemaining); +#endif // While we have data... while ( nBufRemaining ) @@ -2859,7 +2859,7 @@ static v_U32_t UnpackTlvCore( void * pCtx, npec = 0U; #ifdef WLAN_BAPHCI_ENABLE_LOGGING VOS_TRACE(VOS_MODULE_ID_BAP,VOS_TRACE_LEVEL_ERROR, - "Calling FindTLVDefn...\n", nBufRemaining); + "Calling FindTLVDefn...\n", nBufRemaining); #endif // Look for a matching TLV definition, @@ -2867,10 +2867,10 @@ static v_U32_t UnpackTlvCore( void * pCtx, sType = 1; sLen = 2; // consume the type, - if (sType == 2) + if (sType == 2) framesntohs(pCtx, &id, pBufRemaining, 1); - else { - id = *pBufRemaining; + else { + id = *pBufRemaining; } pBufRemaining += sType; nBufRemaining -= sType; @@ -2886,7 +2886,7 @@ static v_U32_t UnpackTlvCore( void * pCtx, { #ifdef WLAN_BAPHCI_ENABLE_LOGGING VOS_TRACE(VOS_MODULE_ID_BAP,VOS_TRACE_LEVEL_ERROR, - "3 > nBufRemaining\n"); + "3 > nBufRemaining\n"); #endif FRAMES_LOG2(pCtx, FRLOGW, FRFL("TLV %d reports length" @@ -2906,7 +2906,7 @@ static v_U32_t UnpackTlvCore( void * pCtx, } #ifdef WLAN_BAPHCI_ENABLE_LOGGING VOS_TRACE(VOS_MODULE_ID_BAP,VOS_TRACE_LEVEL_ERROR, - "Len - %d nBufRemaining - %d\n", len, nBufRemaining); + "Len - %d nBufRemaining - %d\n", len, nBufRemaining); #endif // Whether we found a hit or not, we can validate the reported @@ -2956,7 +2956,7 @@ static v_U32_t UnpackTlvCore( void * pCtx, { #ifdef WLAN_BAPHCI_ENABLE_LOGGING VOS_TRACE(VOS_MODULE_ID_BAP,VOS_TRACE_LEVEL_ERROR, - "pTlv->sig - %d\n", pTlv->sig); + "pTlv->sig - %d\n", pTlv->sig); #endif switch (pTlv->sig) @@ -3157,7 +3157,7 @@ static v_U32_t UnpackTlvCore( void * pCtx, status |= status2; #ifdef WLAN_BAPHCI_ENABLE_LOGGING VOS_TRACE(VOS_MODULE_ID_BAP,VOS_TRACE_LEVEL_ERROR, - "status - %x\n", status); + "status - %x\n", status); #endif } else @@ -3172,7 +3172,7 @@ static v_U32_t UnpackTlvCore( void * pCtx, pBufRemaining += len; #ifdef WLAN_BAPHCI_ENABLE_LOGGING VOS_TRACE(VOS_MODULE_ID_BAP,VOS_TRACE_LEVEL_ERROR, - "len - %d nBufRemaining - %d\n", len, nBufRemaining); + "len - %d nBufRemaining - %d\n", len, nBufRemaining); #endif if (len > nBufRemaining) @@ -3194,8 +3194,8 @@ MandatoryCheck: pTlv = &TLVs[0]; #ifdef WLAN_BAPHCI_ENABLE_LOGGING VOS_TRACE(VOS_MODULE_ID_BAP,VOS_TRACE_LEVEL_ERROR, - "pTlv->id - %x\n", pTlv->id); -#endif + "pTlv->id - %x\n", pTlv->id); +#endif while (0xffff != pTlv->id) { @@ -3224,8 +3224,8 @@ v_U32_t btampGetPackedTlvAMP_Assoc_Connected_Channel(void * pCtx, tBtampTLVAMP_A (void)pCtx; (void)pTlv; (void)pnNeeded; #ifdef WLAN_BAPHCI_ENABLE_LOGGING VOS_TRACE(VOS_MODULE_ID_BAP,VOS_TRACE_LEVEL_ERROR, - "In btampGetPackedTlvAMP_Assoc_Connected_Channel\n"); -#endif + "In btampGetPackedTlvAMP_Assoc_Connected_Channel\n"); +#endif while ( pTlv->present ) { @@ -3249,8 +3249,8 @@ v_U32_t btampGetPackedTlvAMP_Assoc_MAC_Addr(void * pCtx, tBtampTLVAMP_Assoc_MAC_ (void)pCtx; (void)pTlv; (void)pnNeeded; #ifdef WLAN_BAPHCI_ENABLE_LOGGING VOS_TRACE(VOS_MODULE_ID_BAP,VOS_TRACE_LEVEL_ERROR, - "In btampGetPackedTlvAMP_Assoc_MAC_Addr\n"); -#endif + "In btampGetPackedTlvAMP_Assoc_MAC_Addr\n"); +#endif while ( pTlv->present ) { @@ -3269,8 +3269,8 @@ v_U32_t btampGetPackedTlvAMP_Assoc_PAL_Capabilities(void * pCtx, tBtampTLVAMP_As (void)pCtx; (void)pTlv; (void)pnNeeded; #ifdef WLAN_BAPHCI_ENABLE_LOGGING VOS_TRACE(VOS_MODULE_ID_BAP,VOS_TRACE_LEVEL_ERROR, - "In btampGetPackedTlvAMP_Assoc_PAL_Capabilities\n"); -#endif + "In btampGetPackedTlvAMP_Assoc_PAL_Capabilities\n"); +#endif while ( pTlv->present ) { @@ -3306,8 +3306,8 @@ v_U32_t btampGetPackedTlvAMP_Assoc_Preferred_Channel_List(void * pCtx, tBtampTLV (void)pCtx; (void)pTlv; (void)pnNeeded; #ifdef WLAN_BAPHCI_ENABLE_LOGGING VOS_TRACE(VOS_MODULE_ID_BAP,VOS_TRACE_LEVEL_ERROR, - "In btampGetPackedTlvAMP_Assoc_Preferred_Channel_List\n"); -#endif + "In btampGetPackedTlvAMP_Assoc_Preferred_Channel_List\n"); +#endif while ( pTlv->present ) { @@ -3761,14 +3761,14 @@ v_U32_t btampGetPackedTlvHCI_Num_Completed_Pkts_Event(void * pCtx, tBtampTLVHCI_ *pnNeeded += 2; *pnNeeded += 2; #if 0 -// New +// New *pnNeeded += 2; *pnNeeded += 2; *pnNeeded += 2; *pnNeeded += 2; *pnNeeded += 2; *pnNeeded += 2; -// End of New +// End of New #endif // break; } @@ -4376,8 +4376,8 @@ v_U32_t btampGetPackedTlvHCI_Write_Remote_AMP_ASSOC_Cmd(void * pCtx, tBtampTLVHC (void)pCtx; (void)pTlv; (void)pnNeeded; #ifdef WLAN_BAPHCI_ENABLE_LOGGING VOS_TRACE(VOS_MODULE_ID_BAP,VOS_TRACE_LEVEL_ERROR, - "In btampGetPackedTlvHCI_Write_Remote_AMP_ASSOC_Cmd\n"); -#endif + "In btampGetPackedTlvHCI_Write_Remote_AMP_ASSOC_Cmd\n"); +#endif while ( pTlv->present ) { @@ -4439,8 +4439,8 @@ v_U32_t btampGetPackedAMP_ASSOCSize(void * pCtx, tBtampAMP_ASSOC *pFrm, v_U32_t *pnNeeded = 0; #ifdef WLAN_BAPHCI_ENABLE_LOGGING VOS_TRACE(VOS_MODULE_ID_BAP,VOS_TRACE_LEVEL_ERROR, - "In btampGetPackedAMP_ASSOCSize\n"); -#endif + "In btampGetPackedAMP_ASSOCSize\n"); +#endif status |= GetPackedSizeTlvCore(pCtx,(v_U8_t*)pFrm,pnNeeded,TLVS); return status; @@ -4459,8 +4459,8 @@ static v_U32_t GetPackedSizeTlvCore(void * pCtx, status2 = BTAMP_PARSE_SUCCESS; #ifdef WLAN_BAPHCI_ENABLE_LOGGING VOS_TRACE(VOS_MODULE_ID_BAP,VOS_TRACE_LEVEL_ERROR, - "In GetPackedSizeTlvCore\n"); -#endif + "In GetPackedSizeTlvCore\n"); +#endif pTlv = &( TLVs[0] ); while ( 0xffff != pTlv->id ) @@ -4473,7 +4473,7 @@ static v_U32_t GetPackedSizeTlvCore(void * pCtx, if ( pTlv->pec ) *pnNeeded += 3U; #ifdef WLAN_BAPHCI_ENABLE_LOGGING VOS_TRACE(VOS_MODULE_ID_BAP,VOS_TRACE_LEVEL_ERROR, - "In GetPackedSizeTlvCore, pTlv->sig - %d\n", pTlv->sig); + "In GetPackedSizeTlvCore, pTlv->sig - %d\n", pTlv->sig); #endif switch (pTlv->sig) @@ -4749,8 +4749,8 @@ v_U32_t btampPackTlvAMP_Assoc_Connected_Channel(void * pCtx, sLen = 2; #ifdef WLAN_BAPHCI_ENABLE_LOGGING VOS_TRACE(VOS_MODULE_ID_BAP,VOS_TRACE_LEVEL_ERROR, - "In btampPackTlvAMP_Assoc_Connected_Channel\n"); -#endif + "In btampPackTlvAMP_Assoc_Connected_Channel\n"); +#endif // sanity checking if( pCtx == NULL || pSrc == NULL || pBuf == NULL || pnConsumed == NULL) @@ -4790,7 +4790,7 @@ v_U32_t btampPackTlvAMP_Assoc_Connected_Channel(void * pCtx, if (pTlvLen && sLen == 2) { frameshtons( pCtx, pTlvLen, *pnConsumed - nConsumedOnEntry - sType - sLen, 0); - } + } else if(NULL != pTlvLen) { *pTlvLen = (v_U8_t)(*pnConsumed - nConsumedOnEntry - sType - sLen); @@ -4817,8 +4817,8 @@ v_U32_t btampPackTlvAMP_Assoc_MAC_Addr(void * pCtx, sLen = 2; #ifdef WLAN_BAPHCI_ENABLE_LOGGING VOS_TRACE(VOS_MODULE_ID_BAP,VOS_TRACE_LEVEL_ERROR, - "In btampPackTlvAMP_Assoc_MAC_Addr\n"); -#endif + "In btampPackTlvAMP_Assoc_MAC_Addr\n"); +#endif // sanity checking if( pCtx == NULL || pSrc == NULL || pBuf == NULL || pnConsumed == NULL) @@ -4877,8 +4877,8 @@ v_U32_t btampPackTlvAMP_Assoc_PAL_Capabilities(void * pCtx, sLen = 2; #ifdef WLAN_BAPHCI_ENABLE_LOGGING VOS_TRACE(VOS_MODULE_ID_BAP,VOS_TRACE_LEVEL_ERROR, - "In btampPackTlvAMP_Assoc_PAL_Capabilities\n"); -#endif + "In btampPackTlvAMP_Assoc_PAL_Capabilities\n"); +#endif // sanity checking if( pCtx == NULL || pSrc == NULL || pBuf == NULL || pnConsumed == NULL) @@ -4937,8 +4937,8 @@ v_U32_t btampPackTlvAMP_Assoc_PAL_Version(void * pCtx, sLen = 2; #ifdef WLAN_BAPHCI_ENABLE_LOGGING VOS_TRACE(VOS_MODULE_ID_BAP,VOS_TRACE_LEVEL_ERROR, - "In btampPackTlvAMP_Assoc_PAL_Version\n"); -#endif + "In btampPackTlvAMP_Assoc_PAL_Version\n"); +#endif // sanity checking if( pCtx == NULL || pSrc == NULL || pBuf == NULL || pnConsumed == NULL) @@ -5005,8 +5005,8 @@ v_U32_t btampPackTlvAMP_Assoc_Preferred_Channel_List(void * pCtx, sLen = 2; #ifdef WLAN_BAPHCI_ENABLE_LOGGING VOS_TRACE(VOS_MODULE_ID_BAP,VOS_TRACE_LEVEL_ERROR, - "In btampPackTlvAMP_Assoc_Preferred_Channel_List\n"); -#endif + "In btampPackTlvAMP_Assoc_Preferred_Channel_List\n"); +#endif // sanity checking if( pCtx == NULL || pSrc == NULL || pBuf == NULL || pnConsumed == NULL) @@ -5122,7 +5122,7 @@ v_U32_t btampPackTlvFlow_Spec(void * pCtx, if (pTlvLen && sLen == 2) { frameshtons( pCtx, pTlvLen, *pnConsumed - nConsumedOnEntry - sType - sLen, 0); - } else if(NULL != pTlvLen) + } else if(NULL != pTlvLen) { *pTlvLen = (v_U8_t)(*pnConsumed - nConsumedOnEntry - sType - sLen); } @@ -7481,7 +7481,7 @@ v_U32_t btampPackTlvHCI_Read_Flow_Control_Mode_Cmd(void * pCtx, pBuf += sLen; nBuf -= sLen; *pnConsumed += sLen; break; } - + if (pTlvLen && sLen == 2) { frameshtons( pCtx, pTlvLen, *pnConsumed - nConsumedOnEntry - sType - sLen, 0); @@ -7535,7 +7535,7 @@ v_U32_t btampPackTlvHCI_Read_Link_Quality_Cmd(void * pCtx, nBuf -= 2; break; } - + if (pTlvLen && sLen == 2) { frameshtons( pCtx, pTlvLen, *pnConsumed - nConsumedOnEntry - sType - sLen, 0); @@ -7805,7 +7805,7 @@ v_U32_t btampPackTlvHCI_Read_Local_Version_Info_Cmd(void * pCtx, if (pTlvLen && sLen == 2) { frameshtons( pCtx, pTlvLen, *pnConsumed - nConsumedOnEntry - sType - sLen, 0); - } else if(NULL != pTlvLen) + } else if(NULL != pTlvLen) { *pTlvLen = (v_U8_t)(*pnConsumed - nConsumedOnEntry - sType - sLen); } @@ -9308,4 +9308,3 @@ static v_U32_t PackTlvCore(void * pCtx, return status; } - diff --git a/CORE/BAP/src/fsmDefs.h b/CORE/BAP/src/fsmDefs.h index 4cf67f788462..cb8b744e9d02 100644 --- a/CORE/BAP/src/fsmDefs.h +++ b/CORE/BAP/src/fsmDefs.h @@ -30,7 +30,7 @@ #define __FSMDEFS_H__ /* Temporary fix until I clean up all the type names */ -#define BTAMPFSM_INSTANCEDATA_T tWLAN_BAPbapPhysLinkMachine +#define BTAMPFSM_INSTANCEDATA_T tWLAN_BAPbapPhysLinkMachine typedef unsigned char BTAMPFSM_ENTRY_FLAG_T; typedef unsigned char BTAMPFSM_STATEVAR_T; |
