Lines Matching refs:contextPtr

91     cy_stc_ipc_bt_context_t *contextPtr = btIpcContext;  in Cy_BTIPC_IRQ_Handler()  local
99 if (NULL == contextPtr) in Cy_BTIPC_IRQ_Handler()
106 contextPtr->ipc_int_count++; in Cy_BTIPC_IRQ_Handler()
109 ipcIntrPtr = Cy_IPC_Drv_GetIntrBaseAddr(contextPtr->intStuctureSelf); in Cy_BTIPC_IRQ_Handler()
126 if ((release & (uint32_t)(0x1UL << contextPtr->ulChannelHPC)) != 0UL) in Cy_BTIPC_IRQ_Handler()
129 contextPtr->ipc_hpc_release_count++; in Cy_BTIPC_IRQ_Handler()
133 if ((release & (uint32_t)(0x1UL << contextPtr->ulChannelHCI)) != 0UL) in Cy_BTIPC_IRQ_Handler()
136 contextPtr->ipc_hci_release_count++; in Cy_BTIPC_IRQ_Handler()
142 if ((contextPtr->ulReleaseCallbackPtr) != NULL ) in Cy_BTIPC_IRQ_Handler()
144 contextPtr->ulReleaseCallbackPtr(); in Cy_BTIPC_IRQ_Handler()
155 if ((notify & (uint32_t)(0x1UL << contextPtr->dlChannelHPC)) != 0UL) in Cy_BTIPC_IRQ_Handler()
158 contextPtr->ipc_hpc_notify_count++; in Cy_BTIPC_IRQ_Handler()
159 if (contextPtr->ipc_hci_fifo_full > 0UL) in Cy_BTIPC_IRQ_Handler()
161 contextPtr->ipc_hci_notify_in_fifo_full++; in Cy_BTIPC_IRQ_Handler()
164 channelHPC = contextPtr->dlChannelHPC; in Cy_BTIPC_IRQ_Handler()
179 if ((contextPtr->internal_hpc_notify_cb) != NULL) in Cy_BTIPC_IRQ_Handler()
182 contextPtr->internal_hpc_notify_cb((void*)contextPtr, mesg); in Cy_BTIPC_IRQ_Handler()
187 …d, Notify HPC cb %p, msgType %d\n",idx, contextPtr->hpcNotifyCallbackParam[idx].hpcNotifyCallbackP… in Cy_BTIPC_IRQ_Handler()
188 if ((contextPtr->hpcNotifyCallbackParam[idx].msgType == msgType) && in Cy_BTIPC_IRQ_Handler()
189 (contextPtr->hpcNotifyCallbackParam[idx].hpcNotifyCallbackPtr != NULL)) in Cy_BTIPC_IRQ_Handler()
191 …BTIPC_LOG_L1("Calling Notify HPC cb %p\n",contextPtr->hpcNotifyCallbackParam[idx].hpcNotifyCallbac… in Cy_BTIPC_IRQ_Handler()
195 *(((uint8_t*)mesg)+2) = contextPtr->bootType; in Cy_BTIPC_IRQ_Handler()
197 mesg[1] = contextPtr->certError; in Cy_BTIPC_IRQ_Handler()
199 contextPtr->hpcNotifyCallbackParam[idx].hpcNotifyCallbackPtr(mesg); in Cy_BTIPC_IRQ_Handler()
203 …(void)Cy_BTIPC_HPC_RelChannel(contextPtr, backup); /* Suppress a compiler warning about unused ret… in Cy_BTIPC_IRQ_Handler()
205 contextPtr->ipc_hpc_peer_release_count++; in Cy_BTIPC_IRQ_Handler()
210 …(void)Cy_BTIPC_HPC_RelBuffer(contextPtr, backup); /* Suppress a compiler warning about unused retu… in Cy_BTIPC_IRQ_Handler()
216 if((cy_en_btipc_boottype_t)contextPtr->bootType == CY_BT_IPC_BOOT_FULLY_UP) in Cy_BTIPC_IRQ_Handler()
222 if ((notify & (uint32_t)(0x1UL << contextPtr->dlChannelHCI)) != 0UL) in Cy_BTIPC_IRQ_Handler()
225 contextPtr->ipc_hci_notify_count++; in Cy_BTIPC_IRQ_Handler()
227 channelHCI = contextPtr->dlChannelHCI; in Cy_BTIPC_IRQ_Handler()
234 if (((uint32_t)Cy_BTIPC_HCI_FIFOPut(contextPtr, mesg)) == 0UL) in Cy_BTIPC_IRQ_Handler()
236 if (((uint16_t)MAX_IPC_FIFO_SIZE) > Cy_BTIPC_HCI_FIFOCount(contextPtr)) in Cy_BTIPC_IRQ_Handler()
239 …(void)Cy_BTIPC_HCI_RelChannel(contextPtr); /* Suppress a compiler warning about unused return valu… in Cy_BTIPC_IRQ_Handler()
241 contextPtr->ipc_hci_peer_release_count++; in Cy_BTIPC_IRQ_Handler()
246 contextPtr->ipc_hci_fifo_full++; in Cy_BTIPC_IRQ_Handler()
249 BTIPC_LOG_L1("FIFO count %d\n",contextPtr->IpcFifo.bufLen); in Cy_BTIPC_IRQ_Handler()
252 if ((contextPtr->dlNotifyCallbackPtr) != NULL) in Cy_BTIPC_IRQ_Handler()
256 contextPtr->dlNotifyCallbackPtr(mesg); in Cy_BTIPC_IRQ_Handler()
262 contextPtr->droppedHCI++; in Cy_BTIPC_IRQ_Handler()
277 cy_stc_ipc_bt_context_t *contextPtr = btIpcContext; in Cy_BTIPC_HCI_RelChannel() local
279 if (NULL == contextPtr) in Cy_BTIPC_HCI_RelChannel()
284 ipcPtr = Cy_IPC_Drv_GetIpcBaseAddress (contextPtr->dlChannelHCI); in Cy_BTIPC_HCI_RelChannel()
286 rel_mask = (uint32_t)(1UL << contextPtr->intStucturePeer); in Cy_BTIPC_HCI_RelChannel()
299 cy_stc_ipc_bt_context_t *contextPtr = btIpcContext; in Cy_BTIPC_HPC_RelChannel() local
303 if ((NULL == contextPtr) || (NULL == buf)) in Cy_BTIPC_HPC_RelChannel()
309 ipcPtr = Cy_IPC_Drv_GetIpcBaseAddress (contextPtr->dlChannelHPC); in Cy_BTIPC_HPC_RelChannel()
311 rel_mask = (uint32_t)(1UL << contextPtr->intStucturePeer); in Cy_BTIPC_HPC_RelChannel()
322 cy_stc_ipc_bt_context_t *contextPtr = btIpcContext; in Cy_BTIPC_HCI_RelBuffer() local
328 if ((NULL == contextPtr) || (NULL == msgPtr)) in Cy_BTIPC_HCI_RelBuffer()
336 (void)Cy_BTIPC_HCI_FIFOGet(contextPtr, &pMsg, 1); in Cy_BTIPC_HCI_RelBuffer()
345 if (Cy_IPC_Drv_IsLockAcquired (Cy_IPC_Drv_GetIpcBaseAddress(contextPtr->ulChannelHPC))) in Cy_BTIPC_HCI_RelBuffer()
353 if (contextPtr->toFreeBuf[idx].bufPtr == (uint8_t*)msgPtr[1]) in Cy_BTIPC_HCI_RelBuffer()
356 ipcMsgAlloc.bufType = ((uint8_t)contextPtr->toFreeBuf[idx].bufType); in Cy_BTIPC_HCI_RelBuffer()
357 ipcMsgAlloc.bufSize = contextPtr->toFreeBuf[idx].bufLen; in Cy_BTIPC_HCI_RelBuffer()
358 ipcMsgAlloc.bufAddr = contextPtr->toFreeBuf[idx].bufPtr; in Cy_BTIPC_HCI_RelBuffer()
360 contextPtr->toFreeBuf[idx].bufType = CY_BT_IPC_HCI_INVALID_BUF; in Cy_BTIPC_HCI_RelBuffer()
361 contextPtr->toFreeBuf[idx].bufLen = 0; in Cy_BTIPC_HCI_RelBuffer()
362 contextPtr->toFreeBuf[idx].bufPtr = NULL; in Cy_BTIPC_HCI_RelBuffer()
370 (void)Cy_BTIPC_HCI_FIFOGet(contextPtr, &pMsg, 1); in Cy_BTIPC_HCI_RelBuffer()
375 contextPtr->ipc_hci_peer_outbuf_count++; in Cy_BTIPC_HCI_RelBuffer()
377 return (Cy_BTIPC_HPC_Write(contextPtr, &ipcMsgAlloc, (size_t) 2)); in Cy_BTIPC_HCI_RelBuffer()
389 cy_stc_ipc_bt_context_t *contextPtr = btIpcContext; in Cy_BTIPC_HPC_RelBuffer() local
391 if ((NULL == contextPtr) || (NULL == msgPtr)) in Cy_BTIPC_HPC_RelBuffer()
398 contextPtr->ipc_hpc_peer_outbuf_count++; in Cy_BTIPC_HPC_RelBuffer()
405 return (Cy_BTIPC_HPC_Write(contextPtr, &ipcMsgAlloc, (size_t) 2)); in Cy_BTIPC_HPC_RelBuffer()
412 cy_stc_ipc_bt_context_t *contextPtr = (cy_stc_ipc_bt_context_t*) btIpcContext; in Cy_BTIPC_HPC_Notify() local
413 if ((NULL == contextPtr) || (NULL == msgPtr)) in Cy_BTIPC_HPC_Notify()
426 (void)Cy_bt_handle_hpclong_msg(contextPtr, msgPtr); in Cy_BTIPC_HPC_Notify()
429 (void)Cy_bt_handle_buf_add(contextPtr, msgPtr); in Cy_BTIPC_HPC_Notify()
432 (void)Cy_bt_handle_buf_remove(contextPtr, msgPtr); in Cy_BTIPC_HPC_Notify()
443 cy_stc_ipc_bt_context_t *contextPtr = btIpcContext; in Cy_BTIPC_Init() local
447 if ((NULL == contextPtr) || (NULL == btIpcConfig)) in Cy_BTIPC_Init()
452 contextPtr->dlChannelHCI = btIpcConfig->dlChannelHCI; in Cy_BTIPC_Init()
453 contextPtr->ulChannelHCI = btIpcConfig->ulChannelHCI; in Cy_BTIPC_Init()
455 contextPtr->dlChannelHPC = btIpcConfig->dlChannelHPC; in Cy_BTIPC_Init()
456 contextPtr->ulChannelHPC = btIpcConfig->ulChannelHPC; in Cy_BTIPC_Init()
458 contextPtr->intStuctureSelf = btIpcConfig->intStuctureSelf; in Cy_BTIPC_Init()
459 contextPtr->intStucturePeer = btIpcConfig->intStucturePeer; in Cy_BTIPC_Init()
460 contextPtr->intPeerMask = (uint32_t) (0x1UL << btIpcConfig->intStucturePeer); in Cy_BTIPC_Init()
462 contextPtr->dlNotifyCallbackPtr = NULL; in Cy_BTIPC_Init()
463 contextPtr->ulReleaseCallbackPtr = btIpcConfig->ulReleaseCallbackPtr; in Cy_BTIPC_Init()
464 contextPtr->bufCallbackPtr = btIpcConfig->bufCallbackPtr; in Cy_BTIPC_Init()
466 contextPtr->irqHandlerPtr = btIpcConfig->irqHandlerPtr; in Cy_BTIPC_Init()
467 contextPtr->ipcIntConfig.intrSrc = btIpcConfig->ipcIntConfig.intrSrc; in Cy_BTIPC_Init()
468 contextPtr->ipcIntConfig.intrPriority = btIpcConfig->ipcIntConfig.intrPriority; in Cy_BTIPC_Init()
470 contextPtr->internal_hpc_notify_cb = btIpcConfig->internal_hpc_notify_cb; in Cy_BTIPC_Init()
472contextPtr->dlNotifyMask = (uint32_t)((uint32_t)(0x1UL << btIpcConfig->dlChannelHCI) | (uint32_t)(… in Cy_BTIPC_Init()
473contextPtr->ulReleaseMask = (uint32_t)((uint32_t)(0x1UL << btIpcConfig->ulChannelHCI) | (uint32_t)… in Cy_BTIPC_Init()
475 contextPtr->droppedHCI = 0; in Cy_BTIPC_Init()
477 contextPtr->bootType = 0xFF; in Cy_BTIPC_Init()
481 contextPtr->hpcNotifyCallbackParam[idx].hpcNotifyCallbackPtr = NULL; in Cy_BTIPC_Init()
482 contextPtr->hpcNotifyCallbackParam[idx].msgType = CY_BT_IPC_HPC_RESERVED; in Cy_BTIPC_Init()
487 contextPtr->buffPool[idx].bufPtr = NULL; in Cy_BTIPC_Init()
488 contextPtr->buffPool[idx].bufType = CY_BT_IPC_HCI_INVALID_BUF; in Cy_BTIPC_Init()
493 contextPtr->IpcFifo.fifo[idx].msg[0] = 0; in Cy_BTIPC_Init()
494 contextPtr->IpcFifo.fifo[idx].msg[1] = 0; in Cy_BTIPC_Init()
496 contextPtr->IpcFifo.rdIdx = 0; in Cy_BTIPC_Init()
497 contextPtr->IpcFifo.wrIdx = 0; in Cy_BTIPC_Init()
498 contextPtr->IpcFifo.bufLen = 0; in Cy_BTIPC_Init()
502 contextPtr->toFreeBuf[idx].bufPtr = NULL; in Cy_BTIPC_Init()
503 contextPtr->toFreeBuf[idx].bufType = CY_BT_IPC_HCI_INVALID_BUF; in Cy_BTIPC_Init()
504 contextPtr->toFreeBuf[idx].bufLen = 0; in Cy_BTIPC_Init()
507 status = Cy_BTIPC_WarmInit(contextPtr, btIpcConfig); in Cy_BTIPC_Init()
510 contextPtr->ipc_int_count = 0; in Cy_BTIPC_Init()
512 contextPtr->ipc_hci_cmd_count = 0; in Cy_BTIPC_Init()
513 contextPtr->ipc_hpc_cmd_count = 0; in Cy_BTIPC_Init()
515 contextPtr->ipc_hci_release_count = 0; in Cy_BTIPC_Init()
516 contextPtr->ipc_hpc_release_count = 0; in Cy_BTIPC_Init()
518 contextPtr->ipc_hci_notify_count = 0; in Cy_BTIPC_Init()
519 contextPtr->ipc_hpc_notify_count = 0; in Cy_BTIPC_Init()
521 contextPtr->ipc_hci_peer_release_count = 0; in Cy_BTIPC_Init()
522 contextPtr->ipc_hpc_peer_release_count = 0; in Cy_BTIPC_Init()
524 contextPtr->ipc_hci_peer_inbuf_count = 0; in Cy_BTIPC_Init()
525 contextPtr->ipc_hci_peer_outbuf_count = 0; in Cy_BTIPC_Init()
527 contextPtr->ipc_hpc_peer_inbuf_count = 0; in Cy_BTIPC_Init()
528 contextPtr->ipc_hpc_peer_outbuf_count = 0; in Cy_BTIPC_Init()
530 contextPtr->ipc_hci_cmd_self_outbuf_count = 0; in Cy_BTIPC_Init()
531 contextPtr->ipc_hci_cmd_self_inbuf_count = 0; in Cy_BTIPC_Init()
532 contextPtr->ipc_hci_cmd_self_outbuf_success = 0; in Cy_BTIPC_Init()
534 contextPtr->ipc_hci_fifo_full = 0; in Cy_BTIPC_Init()
535 contextPtr->ipc_hci_notify_in_fifo_full = 0; in Cy_BTIPC_Init()
544 cy_stc_ipc_bt_context_t *contextPtr = btIpcContext; in Cy_BTIPC_WarmInit() local
546 if ((NULL == contextPtr) || (NULL == btIpcConfig)) in Cy_BTIPC_WarmInit()
551 intrStatus = Cy_SysInt_Init(&contextPtr->ipcIntConfig, contextPtr->irqHandlerPtr); in Cy_BTIPC_WarmInit()
558 NVIC_EnableIRQ(contextPtr->ipcIntConfig.intrSrc); in Cy_BTIPC_WarmInit()
562 …etInterruptMask(Cy_IPC_Drv_GetIntrBaseAddr(contextPtr->intStuctureSelf), contextPtr->ulReleaseMask… in Cy_BTIPC_WarmInit()
569 cy_stc_ipc_bt_context_t *contextPtr = btIpcContext; in Cy_BTIPC_Deinit() local
572 if (NULL == contextPtr) in Cy_BTIPC_Deinit()
578 NVIC_DisableIRQ(contextPtr->ipcIntConfig.intrSrc); in Cy_BTIPC_Deinit()
580 contextPtr->irqHandlerPtr = NULL; in Cy_BTIPC_Deinit()
581 contextPtr->internal_hpc_notify_cb = NULL; in Cy_BTIPC_Deinit()
585 contextPtr->hpcNotifyCallbackParam[idx].hpcNotifyCallbackPtr = NULL; in Cy_BTIPC_Deinit()
586 contextPtr->hpcNotifyCallbackParam[idx].msgType = CY_BT_IPC_HPC_RESERVED; in Cy_BTIPC_Deinit()
591 contextPtr->buffPool[idx].bufPtr = NULL; in Cy_BTIPC_Deinit()
592 contextPtr->buffPool[idx].bufType = CY_BT_IPC_HCI_INVALID_BUF; in Cy_BTIPC_Deinit()
646 cy_stc_ipc_bt_context_t *contextPtr = btIpcContext; in Cy_BTIPC_HCI_GetReadBufPtr() local
658 if ((NULL == contextPtr) || (NULL == ppData)) in Cy_BTIPC_HCI_GetReadBufPtr()
663 status = Cy_BTIPC_HCI_FIFOGet(contextPtr, &pMsg, 0); in Cy_BTIPC_HCI_GetReadBufPtr()
685 contextPtr->ipc_hci_peer_inbuf_count++; in Cy_BTIPC_HCI_GetReadBufPtr()
698 if (contextPtr->toFreeBuf[idx].bufPtr == NULL) in Cy_BTIPC_HCI_GetReadBufPtr()
700 contextPtr->toFreeBuf[idx].bufType = Cy_bt_get_buf_type(actualPti); in Cy_BTIPC_HCI_GetReadBufPtr()
701 contextPtr->toFreeBuf[idx].bufLen = (uint16_t)(*pLength); in Cy_BTIPC_HCI_GetReadBufPtr()
702 contextPtr->toFreeBuf[idx].bufPtr = ipcMsgBuf->bufAddr; in Cy_BTIPC_HCI_GetReadBufPtr()
731 cy_stc_ipc_bt_context_t *contextPtr = btIpcContext; in Cy_BTIPC_HCI_GetWriteBufPtr() local
738 if ((NULL == contextPtr) || (NULL == ppData)) in Cy_BTIPC_HCI_GetWriteBufPtr()
745 if (Cy_IPC_Drv_IsLockAcquired (Cy_IPC_Drv_GetIpcBaseAddress(contextPtr->ulChannelHCI))) in Cy_BTIPC_HCI_GetWriteBufPtr()
757 status = Cy_bt_GetBuffer (contextPtr, (void **)&destBuf, bufType, length); in Cy_BTIPC_HCI_GetWriteBufPtr()
777 cy_stc_ipc_bt_context_t *contextPtr = btIpcContext; in Cy_BTIPC_HCI_Write() local
784 if ((NULL == contextPtr) || (NULL == data)) in Cy_BTIPC_HCI_Write()
830 if (Cy_IPC_Drv_SendMsgDWord(Cy_IPC_Drv_GetIpcBaseAddress(contextPtr->ulChannelHCI), in Cy_BTIPC_HCI_Write()
831 contextPtr->intPeerMask, msgPtr) == CY_IPC_DRV_SUCCESS) in Cy_BTIPC_HCI_Write()
834 contextPtr->ipc_hci_cmd_count++; in Cy_BTIPC_HCI_Write()
850 cy_stc_ipc_bt_context_t *contextPtr = btIpcContext; in Cy_BTIPC_HPC_GetWriteBufPtr() local
856 if ((NULL == contextPtr) || (NULL == ppData)) in Cy_BTIPC_HPC_GetWriteBufPtr()
863 if (Cy_IPC_Drv_IsLockAcquired (Cy_IPC_Drv_GetIpcBaseAddress(contextPtr->ulChannelHPC))) in Cy_BTIPC_HPC_GetWriteBufPtr()
872 status = Cy_bt_GetBuffer (contextPtr, (void **)&destBuf, CY_BT_IPC_CTRL_BUF, length); in Cy_BTIPC_HPC_GetWriteBufPtr()
885 cy_stc_ipc_bt_context_t *contextPtr = btIpcContext; in Cy_BTIPC_HPC_Write() local
889 if ((NULL == contextPtr) || (NULL == data)) in Cy_BTIPC_HPC_Write()
894 if (!((bool)(Cy_IPC_Drv_SendMsgDWord(Cy_IPC_Drv_GetIpcBaseAddress(contextPtr->ulChannelHPC), in Cy_BTIPC_HPC_Write()
895 contextPtr->intPeerMask, (uint32_t*) dataPtr)))) in Cy_BTIPC_HPC_Write()
898 contextPtr->ipc_hpc_cmd_count++; in Cy_BTIPC_HPC_Write()
913 cy_stc_ipc_bt_context_t *contextPtr = btIpcContext; in Cy_BTIPC_HCI_RegisterCb() local
915 if ((NULL == contextPtr) || (NULL == hciNotifyCallbackPtr)) in Cy_BTIPC_HCI_RegisterCb()
920 contextPtr->dlNotifyCallbackPtr = hciNotifyCallbackPtr; in Cy_BTIPC_HCI_RegisterCb()
927 cy_stc_ipc_bt_context_t *contextPtr = btIpcContext; in Cy_BTIPC_HCI_UnregisterCb() local
929 if (NULL == contextPtr) in Cy_BTIPC_HCI_UnregisterCb()
934 contextPtr->dlNotifyCallbackPtr = NULL; in Cy_BTIPC_HCI_UnregisterCb()
942 cy_stc_ipc_bt_context_t *contextPtr = btIpcContext; in Cy_BTIPC_HPC_RegisterCb() local
946 if ((NULL == contextPtr) || (NULL == pHpcNotifyCallbackParam)) in Cy_BTIPC_HPC_RegisterCb()
954 if ((contextPtr->hpcNotifyCallbackParam[idx].hpcNotifyCallbackPtr == NULL) && in Cy_BTIPC_HPC_RegisterCb()
955 (contextPtr->hpcNotifyCallbackParam[idx].msgType == CY_BT_IPC_HPC_RESERVED)) in Cy_BTIPC_HPC_RegisterCb()
957contextPtr->hpcNotifyCallbackParam[idx].hpcNotifyCallbackPtr = pHpcNotifyCallbackParam->hpcNotifyC… in Cy_BTIPC_HPC_RegisterCb()
958 contextPtr->hpcNotifyCallbackParam[idx].msgType = pHpcNotifyCallbackParam->msgType; in Cy_BTIPC_HPC_RegisterCb()
977 cy_stc_ipc_bt_context_t *contextPtr = btIpcContext; in Cy_BTIPC_HPC_UnregisterCb() local
981 if ((NULL == contextPtr) || (NULL == pHpcNotifyCallbackParam)) in Cy_BTIPC_HPC_UnregisterCb()
989 …if ((contextPtr->hpcNotifyCallbackParam[idx].hpcNotifyCallbackPtr == pHpcNotifyCallbackParam->hpcN… in Cy_BTIPC_HPC_UnregisterCb()
990 (contextPtr->hpcNotifyCallbackParam[idx].msgType == pHpcNotifyCallbackParam->msgType)) in Cy_BTIPC_HPC_UnregisterCb()
992 contextPtr->hpcNotifyCallbackParam[idx].hpcNotifyCallbackPtr = NULL; in Cy_BTIPC_HPC_UnregisterCb()
993 contextPtr->hpcNotifyCallbackParam[idx].msgType = CY_BT_IPC_HPC_RESERVED; in Cy_BTIPC_HPC_UnregisterCb()
1012 cy_stc_ipc_bt_context_t *contextPtr = btIpcContext; in Cy_BTIPC_Buffer_RegisterCb() local
1015 if ((NULL == contextPtr) || (NULL == bufCallbackPtr)) in Cy_BTIPC_Buffer_RegisterCb()
1021 contextPtr->bufCallbackPtr = bufCallbackPtr; in Cy_BTIPC_Buffer_RegisterCb()
1031 cy_stc_ipc_bt_context_t *contextPtr = btIpcContext; in Cy_bt_GetBuffer() local
1037 if ((NULL == contextPtr) || (NULL == ppBuf)) in Cy_bt_GetBuffer()
1053 contextPtr->ipc_hci_cmd_self_outbuf_count++; in Cy_bt_GetBuffer()
1058 …e 0x%x, bufLen %d, bufPtr %p\n",idx, contextPtr->buffPool[idx].bufType,contextPtr->buffPool[idx].b… in Cy_bt_GetBuffer()
1060 … if ((contextPtr->buffPool[idx].bufType == bufType) && (contextPtr->buffPool[idx].bufPtr != NULL)) in Cy_bt_GetBuffer()
1062 if (length <= contextPtr->buffPool[idx].bufLen) in Cy_bt_GetBuffer()
1064 *ppBuf = (void*)contextPtr->buffPool[idx].bufPtr; in Cy_bt_GetBuffer()
1071 contextPtr->buffPool[idx].bufPtr = NULL; in Cy_bt_GetBuffer()
1072 contextPtr->buffPool[idx].bufType = CY_BT_IPC_HCI_INVALID_BUF; in Cy_bt_GetBuffer()
1077 contextPtr->ipc_hci_cmd_self_outbuf_success++; in Cy_bt_GetBuffer()
1110 cy_stc_ipc_bt_context_t *contextPtr = btIpcContext; in Cy_bt_PutBuffer() local
1117 if ((NULL == contextPtr) || (NULL == bufDecriptor) || (bufDecriptor->bufPtr == NULL)) in Cy_bt_PutBuffer()
1127 if ((contextPtr->buffPool[idx].bufType == bufDecriptor->bufType) && in Cy_bt_PutBuffer()
1128 (contextPtr->buffPool[idx].bufPtr == bufDecriptor->bufPtr)) in Cy_bt_PutBuffer()
1134 else if (contextPtr->buffPool[idx].bufType == CY_BT_IPC_HCI_INVALID_BUF) in Cy_bt_PutBuffer()
1136 contextPtr->buffPool[idx] = *bufDecriptor; in Cy_bt_PutBuffer()
1150 if ((status == CY_BT_IPC_DRV_SUCCESS) && (NULL != contextPtr->bufCallbackPtr)) in Cy_bt_PutBuffer()
1152 contextPtr->bufCallbackPtr(bufDecriptor->bufType); in Cy_bt_PutBuffer()
1161 cy_stc_ipc_bt_context_t *contextPtr = btIpcContext; in Cy_bt_RemoveBuffer() local
1168 if ((NULL == contextPtr)) in Cy_bt_RemoveBuffer()
1178 if (contextPtr->buffPool[idx].bufType == buftype) in Cy_bt_RemoveBuffer()
1181 contextPtr->buffPool[idx].bufPtr = NULL; in Cy_bt_RemoveBuffer()
1182 contextPtr->buffPool[idx].bufType = CY_BT_IPC_HCI_INVALID_BUF; in Cy_bt_RemoveBuffer()
1201 cy_stc_ipc_bt_context_t *contextPtr = btIpcContext; in Cy_bt_handle_buf_remove() local
1206 if ((NULL == contextPtr) || (NULL == msgPtr)) in Cy_bt_handle_buf_remove()
1217 contextPtr->ipc_hci_cmd_self_outbuf_count++; in Cy_bt_handle_buf_remove()
1220 status = Cy_bt_RemoveBuffer(contextPtr, (cy_en_btipc_buftype_t)remBuf.bufType); in Cy_bt_handle_buf_remove()
1232 cy_stc_ipc_bt_context_t *contextPtr = btIpcContext; in Cy_bt_handle_hpclong_msg() local
1243 if ((NULL == contextPtr) || (NULL == msgPtr)) in Cy_bt_handle_hpclong_msg()
1255 contextPtr->ipc_hpc_peer_inbuf_count++; in Cy_bt_handle_hpclong_msg()
1277 contextPtr->bootType = ptr->bootType; in Cy_bt_handle_hpclong_msg()
1282 bDptr = (uint8_t*)(&contextPtr->certError); in Cy_bt_handle_hpclong_msg()
1295 ptr, ptr->bootType, ptr->payLoadLen, contextPtr->certError , bufCount); in Cy_bt_handle_hpclong_msg()
1306 contextPtr->buffPool[idx].bufPtr = NULL; in Cy_bt_handle_hpclong_msg()
1307 contextPtr->buffPool[idx].bufType = CY_BT_IPC_HCI_INVALID_BUF; in Cy_bt_handle_hpclong_msg()
1333 status = Cy_bt_PutBuffer(contextPtr, &bufDescriptor); in Cy_bt_handle_hpclong_msg()
1370 cy_stc_ipc_bt_context_t *contextPtr = btIpcContext; in Cy_bt_handle_buf_add() local
1375 if ((NULL == contextPtr) || (NULL == msgPtr)) in Cy_bt_handle_buf_add()
1389 contextPtr->ipc_hci_cmd_self_inbuf_count++; in Cy_bt_handle_buf_add()
1392 status = Cy_bt_PutBuffer(contextPtr, &bufDescriptor); in Cy_bt_handle_buf_add()
1514 cy_stc_ipc_bt_context_t *contextPtr = btIpcContext; in Cy_BTIPC_HCI_FIFOPut() local
1518 if (contextPtr->IpcFifo.bufLen == ((uint8_t)MAX_IPC_FIFO_SIZE)) in Cy_BTIPC_HCI_FIFOPut()
1525 contextPtr->IpcFifo.fifo[contextPtr->IpcFifo.wrIdx].msg[0] = pMsg[0]; in Cy_BTIPC_HCI_FIFOPut()
1526 contextPtr->IpcFifo.fifo[contextPtr->IpcFifo.wrIdx].msg[1] = pMsg[1]; in Cy_BTIPC_HCI_FIFOPut()
1528 contextPtr->IpcFifo.bufLen++; in Cy_BTIPC_HCI_FIFOPut()
1529 contextPtr->IpcFifo.wrIdx++; in Cy_BTIPC_HCI_FIFOPut()
1532 if (contextPtr->IpcFifo.wrIdx == ((uint8_t)MAX_IPC_FIFO_SIZE)) in Cy_BTIPC_HCI_FIFOPut()
1534 contextPtr->IpcFifo.wrIdx = 0; in Cy_BTIPC_HCI_FIFOPut()
1544 cy_stc_ipc_bt_context_t *contextPtr = btIpcContext; in Cy_BTIPC_HCI_FIFOGet() local
1548 if (contextPtr->IpcFifo.bufLen == 0U) in Cy_BTIPC_HCI_FIFOGet()
1554 *ppMsg = contextPtr->IpcFifo.fifo[contextPtr->IpcFifo.rdIdx].msg; in Cy_BTIPC_HCI_FIFOGet()
1558 contextPtr->IpcFifo.bufLen--; in Cy_BTIPC_HCI_FIFOGet()
1559 contextPtr->IpcFifo.rdIdx++; in Cy_BTIPC_HCI_FIFOGet()
1562 if (contextPtr->IpcFifo.rdIdx == ((uint8_t)MAX_IPC_FIFO_SIZE)) in Cy_BTIPC_HCI_FIFOGet()
1564 contextPtr->IpcFifo.rdIdx = 0; in Cy_BTIPC_HCI_FIFOGet()
1569 if ((delete != 0UL) && (((uint8_t)MAX_IPC_FIFO_SIZE - 1U) == contextPtr->IpcFifo.bufLen)) in Cy_BTIPC_HCI_FIFOGet()
1572 …(void)Cy_BTIPC_HCI_RelChannel(contextPtr); /* Suppress a compiler warning about unused return valu… in Cy_BTIPC_HCI_FIFOGet()
1574 contextPtr->ipc_hci_peer_release_count++; in Cy_BTIPC_HCI_FIFOGet()
1585 cy_stc_ipc_bt_context_t *contextPtr = btIpcContext; in Cy_BTIPC_HCI_FIFOCount() local
1590 count = contextPtr->IpcFifo.bufLen; in Cy_BTIPC_HCI_FIFOCount()
1598 cy_stc_ipc_bt_context_t *contextPtr = btIpcContext; in Cy_BTIPC_RetrieveContext() local
1601 if ((NULL == contextPtr) || (NULL == pContextRet)) in Cy_BTIPC_RetrieveContext()
1608 pContextRet->buffPool[i].bufType = (uint16_t) contextPtr->buffPool[i].bufType; in Cy_BTIPC_RetrieveContext()
1609 pContextRet->buffPool[i].bufLen = contextPtr->buffPool[i].bufLen; in Cy_BTIPC_RetrieveContext()
1610 pContextRet->buffPool[i].bufPtr = contextPtr->buffPool[i].bufPtr; in Cy_BTIPC_RetrieveContext()
1617 cy_stc_ipc_bt_context_t *contextPtr = btIpcContext; in Cy_BTIPC_RestoreContext() local
1619 if ((NULL == contextPtr) || (NULL == pContextRet)) in Cy_BTIPC_RestoreContext()
1626 contextPtr->buffPool[i].bufType = (cy_en_btipc_buftype_t) pContextRet->buffPool[i].bufType; in Cy_BTIPC_RestoreContext()
1627 contextPtr->buffPool[i].bufLen = pContextRet->buffPool[i].bufLen; in Cy_BTIPC_RestoreContext()
1628 contextPtr->buffPool[i].bufPtr = pContextRet->buffPool[i].bufPtr; in Cy_BTIPC_RestoreContext()
1636 cy_stc_ipc_bt_context_t *contextPtr = btIpcContext; in Cy_bt_PrintStatus() local
1640 if (NULL == contextPtr) in Cy_bt_PrintStatus()
1651 … bufLen %d, bufPtr 0x%x\n",idx, contextPtr->buffPool[idx].bufType,contextPtr->buffPool[idx].bufLen… in Cy_bt_PrintStatus()
1653 …e 0x%x, bufLen %d, bufPtr %p\n",idx, contextPtr->buffPool[idx].bufType,contextPtr->buffPool[idx].b… in Cy_bt_PrintStatus()
1661 …printf("idx %d, msg[0] 0x%x, msg[1] 0x%x\n",idx, contextPtr->IpcFifo.fifo[idx].msg[0], contextPtr-… in Cy_bt_PrintStatus()
1663 …printf("idx %d, msg[0] 0x%lx, msg[1] 0x%lx\n",idx, contextPtr->IpcFifo.fifo[idx].msg[0], contextPt… in Cy_bt_PrintStatus()
1666 …printf("rdIdx %d, wrIdx %d, bufLen %d\n",contextPtr->IpcFifo.rdIdx, contextPtr->IpcFifo.wrIdx, con… in Cy_bt_PrintStatus()
1673 (uint32_t)(contextPtr->hpcNotifyCallbackParam[idx].hpcNotifyCallbackPtr), in Cy_bt_PrintStatus()
1674 contextPtr->hpcNotifyCallbackParam[idx].msgType); in Cy_bt_PrintStatus()
1677 contextPtr->hpcNotifyCallbackParam[idx].hpcNotifyCallbackPtr, in Cy_bt_PrintStatus()
1678 contextPtr->hpcNotifyCallbackParam[idx].msgType); in Cy_bt_PrintStatus()