Lines Matching refs:nfc_hal_info

30 tNFC_HAL_CB nfc_hal_info;  variable
41 if (!nfc_hal_info.stack_cback) return false; in nfc_stack_cback()
43 nfc_hal_info.stack_cback(event, event_status); in nfc_stack_cback()
52 if (!nfc_hal_info.data_cback) return false; in nfc_data_callback()
61 nfc_hal_info.data_cback(len, data); in nfc_data_callback()
98 memset(&nfc_hal_info, 0, sizeof(nfc_hal_info)); in nfc_hal_init()
100 nfc_hal_info.state = HAL_STATE_INIT; in nfc_hal_init()
101 nfc_hal_info.stack_cback = NULL; in nfc_hal_init()
102 nfc_hal_info.data_cback = NULL; in nfc_hal_init()
103 nfc_hal_info.nci_last_pkt = (tNFC_NCI_PKT*)OSI_mem_get(NCI_CTRL_SIZE); in nfc_hal_init()
104 nfc_hal_info.nci_fragment_pkt = NULL; in nfc_hal_init()
105 nfc_hal_info.msg_task = OSI_task_allocate("hal_task", nfc_hal_task); in nfc_hal_init()
106 nfc_hal_info.nci_timer = OSI_timer_allocate("nci_timer"); in nfc_hal_init()
107 nfc_hal_info.sleep_timer = OSI_timer_allocate("sleep_timer"); in nfc_hal_init()
108 nfc_hal_info.msg_q = OSI_queue_allocate("msg_q"); in nfc_hal_init()
109 nfc_hal_info.nci_q = OSI_queue_allocate("nci_q"); in nfc_hal_init()
113 if (!nfc_hal_info.msg_task || !nfc_hal_info.nci_timer || in nfc_hal_init()
114 !nfc_hal_info.sleep_timer || !nfc_hal_info.msg_q || !nfc_hal_info.nci_q) { in nfc_hal_init()
133 nfc_hal_info.state = HAL_STATE_DEINIT; in nfc_hal_deinit()
134 OSI_task_kill(nfc_hal_info.msg_task); in nfc_hal_deinit()
135 nfc_hal_info.stack_cback = NULL; in nfc_hal_deinit()
136 nfc_hal_info.data_cback = NULL; in nfc_hal_deinit()
137 OSI_mem_free((tOSI_MEM_HANDLER)nfc_hal_info.nci_last_pkt); in nfc_hal_deinit()
138 nfc_hal_info.nci_last_pkt = NULL; in nfc_hal_deinit()
139 OSI_mem_free((tOSI_MEM_HANDLER)nfc_hal_info.nci_fragment_pkt); in nfc_hal_deinit()
140 nfc_hal_info.nci_fragment_pkt = NULL; in nfc_hal_deinit()
141 OSI_timer_free(nfc_hal_info.nci_timer); in nfc_hal_deinit()
142 OSI_timer_free(nfc_hal_info.sleep_timer); in nfc_hal_deinit()
143 OSI_queue_free(nfc_hal_info.msg_q); in nfc_hal_deinit()
144 OSI_queue_free(nfc_hal_info.nci_q); in nfc_hal_deinit()
157 if (nfc_hal_info.state == HAL_STATE_POSTINIT) { in nfc_hal_open()
168 if (OSI_OK != OSI_task_run(nfc_hal_info.msg_task)) { in nfc_hal_open()
173 nfc_hal_info.stack_cback = p_cback; in nfc_hal_open()
174 nfc_hal_info.data_cback = p_data_cback; in nfc_hal_open()
175 nfc_hal_info.state = HAL_STATE_OPEN; in nfc_hal_open()
180 OSI_queue_put(nfc_hal_info.msg_q, (void*)msg); in nfc_hal_open()
192 if (nfc_hal_info.state == HAL_STATE_CLOSE) { in nfc_hal_close()
201 OSI_queue_put(nfc_hal_info.msg_q, (void*)msg); in nfc_hal_close()
203 OSI_task_stop(nfc_hal_info.msg_task); in nfc_hal_close()
208 nfc_hal_info.state = HAL_STATE_CLOSE; /* VTS */ in nfc_hal_close()
243 if (OSI_queue_put(nfc_hal_info.msg_q, (void*)msg) == -1) in nfc_hal_write()
261 OSI_queue_put(nfc_hal_info.msg_q, (void*)msg); in nfc_hal_core_initialized()
291 OSI_queue_put(nfc_hal_info.msg_q, (void*)msg); in nfc_hal_control_granted()
302 if (nfc_hal_info.state == HAL_STATE_CLOSE) { in nfc_hal_power_cycle()
310 OSI_queue_put(nfc_hal_info.msg_q, (void*)msg); in nfc_hal_power_cycle()
319 nfc_hal_info.flag &= ~HAL_FLAG_PROP_ONE_TIMER; in setSleepTimeout()
320 nfc_hal_info.cfg.override_timeout = 0; in setSleepTimeout()
324 (int*)&nfc_hal_info.cfg.sleep_timeout)) in setSleepTimeout()
325 nfc_hal_info.cfg.sleep_timeout = timeout; in setSleepTimeout()
327 nfc_hal_info.cfg.override_timeout = timeout; in setSleepTimeout()
328 nfc_hal_info.flag |= HAL_FLAG_PROP_ONE_TIMER; in setSleepTimeout()
330 nfc_hal_info.cfg.sleep_timeout = timeout; in setSleepTimeout()
334 if (nfc_hal_info.flag & HAL_FLAG_PROP_ONE_TIMER) in setSleepTimeout()
335 OSI_logd("Override timeout is %d ms", nfc_hal_info.cfg.override_timeout); in setSleepTimeout()
336 OSI_logd("Sleep timeout is %d ms", nfc_hal_info.cfg.sleep_timeout); in setSleepTimeout()