Lines Matching refs:nxpncihal_ctrl

44 phNxpNciHal_Control_t nxpncihal_ctrl;  variable
157 if (nxpncihal_ctrl.p_nfc_stack_cback != NULL) { in phNxpNciHal_client_thread()
159 (*nxpncihal_ctrl.p_nfc_stack_cback)(HAL_NFC_OPEN_CPLT_EVT, in phNxpNciHal_client_thread()
168 if (nxpncihal_ctrl.p_nfc_stack_cback != NULL) { in phNxpNciHal_client_thread()
170 (*nxpncihal_ctrl.p_nfc_stack_cback)(HAL_NFC_CLOSE_CPLT_EVT, in phNxpNciHal_client_thread()
172 phNxpNciHal_kill_client_thread(&nxpncihal_ctrl); in phNxpNciHal_client_thread()
180 if (nxpncihal_ctrl.p_nfc_stack_cback != NULL) { in phNxpNciHal_client_thread()
182 (*nxpncihal_ctrl.p_nfc_stack_cback)(HAL_NFC_POST_INIT_CPLT_EVT, in phNxpNciHal_client_thread()
191 if (nxpncihal_ctrl.p_nfc_stack_cback != NULL) { in phNxpNciHal_client_thread()
193 (*nxpncihal_ctrl.p_nfc_stack_cback)(HAL_NFC_PRE_DISCOVER_CPLT_EVT, in phNxpNciHal_client_thread()
202 if (nxpncihal_ctrl.p_nfc_stack_cback != NULL) { in phNxpNciHal_client_thread()
204 (*nxpncihal_ctrl.p_nfc_stack_cback)(HAL_NFC_ERROR_EVT, in phNxpNciHal_client_thread()
213 if (nxpncihal_ctrl.p_nfc_stack_data_cback != NULL) { in phNxpNciHal_client_thread()
214 (*nxpncihal_ctrl.p_nfc_stack_data_cback)(nxpncihal_ctrl.rsp_len, in phNxpNciHal_client_thread()
215 nxpncihal_ctrl.p_rsp_data); in phNxpNciHal_client_thread()
431 if (nxpncihal_ctrl.halStatus == HAL_STATUS_OPEN) { in phNxpNciHal_open()
453 memset(&nxpncihal_ctrl, 0x00, sizeof(nxpncihal_ctrl)); in phNxpNciHal_open()
459 nxpncihal_ctrl.halStatus = HAL_STATUS_OPEN; in phNxpNciHal_open()
461 nxpncihal_ctrl.p_nfc_stack_cback = p_cback; in phNxpNciHal_open()
462 nxpncihal_ctrl.p_nfc_stack_data_cback = p_data_cback; in phNxpNciHal_open()
478 nxpncihal_ctrl.gDrvCfg.nClientId = phDal4Nfc_msgget(0, 0600); in phNxpNciHal_open()
479 nxpncihal_ctrl.gDrvCfg.nLinkType = ENUM_LINK_TYPE_I2C; /* For PN54X */ in phNxpNciHal_open()
481 tOsalConfig.dwCallbackThreadId = (uintptr_t)nxpncihal_ctrl.gDrvCfg.nClientId; in phNxpNciHal_open()
483 tTmlConfig.dwGetMsgThreadId = (uintptr_t)nxpncihal_ctrl.gDrvCfg.nClientId; in phNxpNciHal_open()
506 ret_val = pthread_create(&nxpncihal_ctrl.client_thread, &attr, in phNxpNciHal_open()
507 phNxpNciHal_client_thread, &nxpncihal_ctrl); in phNxpNciHal_open()
519 nxpncihal_ctrl.p_cmd_data, NCI_MAX_DATA_LEN, in phNxpNciHal_open()
534 (nxpncihal_ctrl.retry_cnt >= MAX_RETRY_COUNT)) { in phNxpNciHal_open()
598 nxpncihal_ctrl.p_cmd_data, NCI_MAX_DATA_LEN, in phNxpNciHal_open()
623 (*nxpncihal_ctrl.p_nfc_stack_cback)(HAL_NFC_OPEN_CPLT_EVT, in phNxpNciHal_open()
626 nxpncihal_ctrl.p_nfc_stack_cback = NULL; in phNxpNciHal_open()
627 nxpncihal_ctrl.p_nfc_stack_data_cback = NULL; in phNxpNciHal_open()
629 nxpncihal_ctrl.halStatus = HAL_STATUS_CLOSE; in phNxpNciHal_open()
670 nxpncihal_ctrl.hal_open_status = true; in phNxpNciHal_open_complete()
699 if (nxpncihal_ctrl.halStatus != HAL_STATUS_OPEN) { in phNxpNciHal_write()
703 memcpy(nxpncihal_ctrl.p_cmd_data, p_data, data_len); in phNxpNciHal_write()
704 nxpncihal_ctrl.cmd_len = data_len; in phNxpNciHal_write()
705 if (nxpncihal_ctrl.cmd_len > NCI_MAX_DATA_LEN) { in phNxpNciHal_write()
729 phNxpNciHal_write_ext(&nxpncihal_ctrl.cmd_len, nxpncihal_ctrl.p_cmd_data, in phNxpNciHal_write()
730 &nxpncihal_ctrl.rsp_len, nxpncihal_ctrl.p_rsp_data); in phNxpNciHal_write()
743 data_len = phNxpNciHal_write_unlocked(nxpncihal_ctrl.cmd_len, in phNxpNciHal_write()
744 nxpncihal_ctrl.p_cmd_data); in phNxpNciHal_write()
772 nxpncihal_ctrl.retry_cnt = 0; in phNxpNciHal_write_unlocked()
784 memcpy(nxpncihal_ctrl.p_cmd_data, p_data, data_len); in phNxpNciHal_write_unlocked()
785 nxpncihal_ctrl.cmd_len = data_len; in phNxpNciHal_write_unlocked()
789 data_len = nxpncihal_ctrl.cmd_len; in phNxpNciHal_write_unlocked()
792 (uint8_t*)nxpncihal_ctrl.p_cmd_data, (uint16_t)nxpncihal_ctrl.cmd_len, in phNxpNciHal_write_unlocked()
810 if (nxpncihal_ctrl.retry_cnt++ < MAX_RETRY_COUNT) { in phNxpNciHal_write_unlocked()
820 nxpncihal_ctrl.retry_cnt); in phNxpNciHal_write_unlocked()
829 if (nxpncihal_ctrl.p_nfc_stack_data_cback != NULL && in phNxpNciHal_write_unlocked()
830 nxpncihal_ctrl.p_rx_data != NULL && in phNxpNciHal_write_unlocked()
831 nxpncihal_ctrl.hal_open_status == true) { in phNxpNciHal_write_unlocked()
837 nxpncihal_ctrl.rx_data_len = sizeof(reset_ntf); in phNxpNciHal_write_unlocked()
838 memcpy(nxpncihal_ctrl.p_rx_data, reset_ntf, sizeof(reset_ntf)); in phNxpNciHal_write_unlocked()
839 (*nxpncihal_ctrl.p_nfc_stack_data_cback)(nxpncihal_ctrl.rx_data_len, in phNxpNciHal_write_unlocked()
840 nxpncihal_ctrl.p_rx_data); in phNxpNciHal_write_unlocked()
893 if (nxpncihal_ctrl.read_retry_cnt == 1) { in phNxpNciHal_read_complete()
894 nxpncihal_ctrl.read_retry_cnt = 0; in phNxpNciHal_read_complete()
900 nxpncihal_ctrl.p_rx_data = pInfo->pBuff; in phNxpNciHal_read_complete()
901 nxpncihal_ctrl.rx_data_len = pInfo->wLength; in phNxpNciHal_read_complete()
903 status = phNxpNciHal_process_ext_rsp(nxpncihal_ctrl.p_rx_data, in phNxpNciHal_read_complete()
904 &nxpncihal_ctrl.rx_data_len); in phNxpNciHal_read_complete()
906 phNxpNciHal_print_res_status(nxpncihal_ctrl.p_rx_data, in phNxpNciHal_read_complete()
907 &nxpncihal_ctrl.rx_data_len); in phNxpNciHal_read_complete()
909 if (nxpncihal_ctrl.hal_ext_enabled == 1 && in phNxpNciHal_read_complete()
910 (nxpncihal_ctrl.p_rx_data[0x00] & 0xF0) == 0x40) { in phNxpNciHal_read_complete()
913 nxpncihal_ctrl.ext_cb_data.status = status; in phNxpNciHal_read_complete()
916 if ((nxpncihal_ctrl.p_rx_data[0x00] & 0xF0) == 0x40 || in phNxpNciHal_read_complete()
919 SEM_POST(&(nxpncihal_ctrl.ext_cb_data)); in phNxpNciHal_read_complete()
923 else if ((nxpncihal_ctrl.p_nfc_stack_data_cback != NULL) && in phNxpNciHal_read_complete()
925 (*nxpncihal_ctrl.p_nfc_stack_data_cback)(nxpncihal_ctrl.rx_data_len, in phNxpNciHal_read_complete()
926 nxpncihal_ctrl.p_rx_data); in phNxpNciHal_read_complete()
932 if (nxpncihal_ctrl.halStatus == HAL_STATUS_CLOSE) { in phNxpNciHal_read_complete()
1001 if (nxpncihal_ctrl.halStatus != HAL_STATUS_OPEN) { in phNxpNciHal_core_initialized()
1026 (nxpncihal_ctrl.retry_cnt >= MAX_RETRY_COUNT)) { in phNxpNciHal_core_initialized()
1630 &nxpncihal_ctrl.rsp_len, nxpncihal_ctrl.p_rsp_data); in phNxpNciHal_core_initialized()
1675 if (nxpncihal_ctrl.p_nfc_stack_data_cback != NULL) { in phNxpNciHal_core_initialized()
1678 (*nxpncihal_ctrl.p_nfc_stack_data_cback)(nxpncihal_ctrl.rx_data_len, in phNxpNciHal_core_initialized()
1679 nxpncihal_ctrl.p_rx_data); in phNxpNciHal_core_initialized()
1705 if ((nxpncihal_ctrl.rx_data_len > 0) && (nxpncihal_ctrl.p_rx_data[2] > 0)) { in phNxpNciHal_CheckRFCmdRespStatus()
1706 if (nxpncihal_ctrl.p_rx_data[3] == 0x09) { in phNxpNciHal_CheckRFCmdRespStatus()
1708 } else if (nxpncihal_ctrl.p_rx_data[3] != NFCSTATUS_SUCCESS) { in phNxpNciHal_CheckRFCmdRespStatus()
1751 nxpncihal_ctrl.p_cmd_data, NCI_MAX_DATA_LEN, in phNxpNciHalRFConfigCmdRecSequence()
1856 if (nxpncihal_ctrl.halStatus == HAL_STATUS_CLOSE) { in phNxpNciHal_close()
1866 nxpncihal_ctrl.halStatus = HAL_STATUS_CLOSE; in phNxpNciHal_close()
1883 phDal4Nfc_msgrelease(nxpncihal_ctrl.gDrvCfg.nClientId); in phNxpNciHal_close()
1885 memset(&nxpncihal_ctrl, 0x00, sizeof(nxpncihal_ctrl)); in phNxpNciHal_close()
1932 if (nxpncihal_ctrl.p_nfc_stack_cback != NULL) { in phNxpNciHal_notify_i2c_fragmentation()
1934 (*nxpncihal_ctrl.p_nfc_stack_cback)(HAL_NFC_ENABLE_I2C_FRAGMENTATION_EVT, in phNxpNciHal_notify_i2c_fragmentation()
1952 if (NULL != nxpncihal_ctrl.p_control_granted_cback) { in phNxpNciHal_control_granted()
1953 (*nxpncihal_ctrl.p_control_granted_cback)(); in phNxpNciHal_control_granted()
1973 if (nxpncihal_ctrl.p_nfc_stack_cback != NULL) { in phNxpNciHal_request_control()
1975 (*nxpncihal_ctrl.p_nfc_stack_cback)(HAL_NFC_REQUEST_CONTROL_EVT, in phNxpNciHal_request_control()
1992 if (nxpncihal_ctrl.p_nfc_stack_cback != NULL) { in phNxpNciHal_release_control()
1994 (*nxpncihal_ctrl.p_nfc_stack_cback)(HAL_NFC_RELEASE_CONTROL_EVT, in phNxpNciHal_release_control()
2014 if (nxpncihal_ctrl.halStatus != HAL_STATUS_OPEN) { in phNxpNciHal_power_cycle()
2355 if (nxpncihal_ctrl.p_rx_data[8] == 0x10) { in phNxpNciHal_enable_i2c_fragmentation()
2359 } else if (nxpncihal_ctrl.p_rx_data[8] == 0x00) { in phNxpNciHal_enable_i2c_fragmentation()
2546 (nxpncihal_ctrl.retry_cnt >= MAX_RETRY_COUNT)) { in phNxpNciHal_core_reset_recovery()