Lines Matching defs:nat
73 static void nfc_jni_start_discovery_locked(struct nfc_jni_native_data *nat);
86 struct nfc_jni_native_data *nat = (struct nfc_jni_native_data *)arg;
88 nat->running = FALSE;
91 static void kill_client(nfc_jni_native_data *nat)
102 pMsg->pParameter = (void*)nat;
130 static int nfc_jni_download(struct nfc_jni_native_data *nat, uint8_t update)
248 status = phLibNfc_Mgt_GetstackCapabilities(&caps, (void*)nat);
275 static int nfc_jni_configure_driver(struct nfc_jni_native_data *nat)
299 if(pthread_create(&(nat->thread), NULL, nfc_jni_client_thread, nat) != 0)
311 static int nfc_jni_unconfigure_driver(struct nfc_jni_native_data *nat)
361 static int nfc_jni_initialize(struct nfc_jni_native_data *nat) {
408 nfc_jni_configure_driver(nat);
442 status = phLibNfc_Mgt_GetstackCapabilities(&caps, (void*)nat);
468 status = nfc_jni_download(nat, update);
571 LlcpConfigInfo.miu = nat->miu;
572 LlcpConfigInfo.lto = nat->lto;
573 LlcpConfigInfo.wks = nat->wks;
574 LlcpConfigInfo.option = nat->opt;
598 nat->discovery_cfg.NfcIP_Mode = get_p2p_mode(); //initiator
599 nat->discovery_cfg.Duration = 300000; /* in ms */
600 nat->discovery_cfg.NfcIP_Tgt_Disable = get_p2p_target_disable();
604 ret = phLibNfc_SE_NtfRegister(nfc_jni_transaction_callback,(void *)nat);
623 if(nat)
625 kill_client(nat);
646 void emergency_recovery(struct nfc_jni_native_data *nat) {
673 void nfc_jni_restart_discovery_locked(struct nfc_jni_native_data *nat)
695 ret = phLibNfc_Mgt_ConfigureDiscovery(NFC_DISCOVERY_RESUME,nat->discovery_cfg, nfc_jni_discover_callback, (void *)&cb_data);
698 nat->discovery_cfg.PollDevInfo.PollCfgInfo.EnableIso14443A==TRUE?"3A":"",
699 nat->discovery_cfg.PollDevInfo.PollCfgInfo.EnableIso14443B==TRUE?"3B":"",
700 nat->discovery_cfg.PollDevInfo.PollCfgInfo.EnableFelica212==TRUE?"F2":"",
701 nat->discovery_cfg.PollDevInfo.PollCfgInfo.EnableFelica424==TRUE?"F4":"",
702 nat->discovery_cfg.PollDevInfo.PollCfgInfo.EnableNfcActive==TRUE?"NFC":"",
703 nat->discovery_cfg.PollDevInfo.PollCfgInfo.EnableIso15693==TRUE?"RFID":"",
704 nat->discovery_cfg.PollDevInfo.PollCfgInfo.DisableCardEmulation==FALSE?"CE":"",
705 nat->discovery_cfg.NfcIP_Mode, nat->discovery_cfg.Duration, ret);
709 emergency_recovery(nat);
777 struct nfc_jni_native_data *nat;
782 nat = (struct nfc_jni_native_data *)arg;
785 thread_args.version = nat->env_version;
788 nat->vm->AttachCurrentThread(&e, &thread_args);
792 nat->running = TRUE;
793 while(nat->running == TRUE)
820 nat->vm->DetachCurrentThread();
849 struct nfc_jni_native_data *nat = (nfc_jni_native_data *)pContextData->pContext;
856 nat->vm->GetEnv( (void **)&e, nat->env_version);
895 e->CallVoidMethod(nat->manager, cached_NfcManager_notifyLlcpLinkDeactivated, nat->tag);
899 kill_client(nat);
996 struct nfc_jni_native_data *nat;
1002 nat = (struct nfc_jni_native_data *)pContext;
1004 nat->vm->GetEnv( (void **)&e, nat->env_version);
1011 e->CallVoidMethod(nat->manager, cached_NfcManager_notifyTargetDeselected);
1015 kill_client(nat);
1029 tag_cls = e->GetObjectClass(nat->cached_P2pDevice);
1033 kill_client(nat);
1082 tag_cls = e->GetObjectClass(nat->cached_NfcTag);
1085 kill_client(nat);
1148 if (nat->tag != NULL) {
1149 e->DeleteGlobalRef(nat->tag);
1151 nat->tag = e->NewGlobalRef(tag);
1162 e->CallVoidMethod(nat->manager, cached_NfcManager_notifyLlcpLinkActivation, tag);
1166 kill_client(nat);
1172 e->CallVoidMethod(nat->manager, cached_NfcManager_notifyNdefMessageListeners, tag);
1176 kill_client(nat);
1224 struct nfc_jni_native_data *nat;
1232 nat = (struct nfc_jni_native_data *)context;
1234 nat->vm->GetEnv( (void **)&e, nat->env_version);
1277 e->CallVoidMethod(nat->manager, cached_NfcManager_notifyTransactionListeners, tmp_array);
1309 e->CallVoidMethod(nat->manager, cached_NfcManager_notifySeApduReceived, tmp_array);
1316 e->CallVoidMethod(nat->manager, cached_NfcManager_notifySeEmvCardRemoval);
1336 e->CallVoidMethod(nat->manager, cached_NfcManager_notifySeMifareAccess, mifare_block);
1343 e->CallVoidMethod(nat->manager, cached_NfcManager_notifySeFieldActivated);
1350 e->CallVoidMethod(nat->manager, cached_NfcManager_notifySeFieldDeactivated);
1395 static void nfc_jni_start_discovery_locked(struct nfc_jni_native_data *nat)
1416 ret = phLibNfc_RemoteDev_NtfRegister(&nat->registry_info, nfc_jni_Discovery_notification_callback, (void *)nat);
1424 nat->registry_info.Jewel==TRUE?"J":"",
1425 nat->registry_info.MifareUL==TRUE?"UL":"",
1426 nat->registry_info.MifareStd==TRUE?"Mi":"",
1427 nat->registry_info.Felica==TRUE?"F":"",
1428 nat->registry_info.ISO14443_4A==TRUE?"4A":"",
1429 nat->registry_info.ISO14443_4B==TRUE?"4B":"",
1430 nat->registry_info.NFC==TRUE?"P2P":"",
1431 nat->registry_info.ISO15693==TRUE?"R":"", ret);
1436 ret = phLibNfc_Mgt_ConfigureDiscovery(NFC_DISCOVERY_CONFIG,nat->discovery_cfg, nfc_jni_discover_callback, (void *)&cb_data);
1439 nat->discovery_cfg.PollDevInfo.PollCfgInfo.EnableIso14443A==TRUE?"3A":"",
1440 nat->discovery_cfg.PollDevInfo.PollCfgInfo.EnableIso14443B==TRUE?"3B":"",
1441 nat->discovery_cfg.PollDevInfo.PollCfgInfo.EnableFelica212==TRUE?"F2":"",
1442 nat->discovery_cfg.PollDevInfo.PollCfgInfo.EnableFelica424==TRUE?"F4":"",
1443 nat->discovery_cfg.PollDevInfo.PollCfgInfo.EnableNfcActive==TRUE?"NFC":"",
1444 nat->discovery_cfg.PollDevInfo.PollCfgInfo.EnableIso15693==TRUE?"RFID":"",
1445 nat->discovery_cfg.PollDevInfo.PollCfgInfo.DisableCardEmulation==FALSE?"CE":"",
1446 nat->discovery_cfg.NfcIP_Mode, nat->discovery_cfg.Duration, ret);
1450 emergency_recovery(nat);
1464 static void nfc_jni_stop_discovery_locked(struct nfc_jni_native_data *nat)
1498 nat);
1515 struct nfc_jni_native_data *nat;
1520 nat = nfc_jni_get_nat(e, o);
1522 nfc_jni_stop_discovery_locked(nat);
1530 struct nfc_jni_native_data *nat;
1534 nat = nfc_jni_get_nat(e, o);
1535 nfc_jni_start_discovery_locked(nat);
1697 struct nfc_jni_native_data *nat = NULL;
1705 nat = (nfc_jni_native_data*)malloc(sizeof(struct nfc_jni_native_data));
1706 if(nat == NULL)
1711 memset(nat, 0, sizeof(*nat));
1712 e->GetJavaVM(&(nat->vm));
1713 nat->env_version = e->GetVersion();
1714 nat->manager = e->NewGlobalRef(o);
1718 e->SetIntField(o, f, (jint)nat);
1751 if(nfc_jni_cache_object(e,"com/android/nfc/nxp/NativeNfcTag",&(nat->cached_NfcTag)) == -1)
1757 if(nfc_jni_cache_object(e,"com/android/nfc/nxp/NativeP2pDevice",&(nat->cached_P2pDevice)) == -1)
1770 struct nfc_jni_native_data *nat = NULL;
1788 nat = nfc_jni_get_nat(e, o);
1790 nat->seId = SMX_SECURE_ELEMENT_ID;
1792 nat->lto = 150; // LLCP_LTO
1793 nat->miu = 128; // LLCP_MIU
1794 nat->wks = 1; // LLCP_WKS
1795 nat->opt = 0; // LLCP_OPT
1796 nat->discovery_cfg.PollDevInfo.PollCfgInfo.EnableIso14443A = TRUE;
1797 nat->discovery_cfg.PollDevInfo.PollCfgInfo.EnableIso14443B = TRUE;
1798 nat->discovery_cfg.PollDevInfo.PollCfgInfo.EnableFelica212 = TRUE;
1799 nat->discovery_cfg.PollDevInfo.PollCfgInfo.EnableFelica424 = TRUE;
1800 nat->discovery_cfg.PollDevInfo.PollCfgInfo.EnableIso15693 = TRUE;
1801 nat->discovery_cfg.PollDevInfo.PollCfgInfo.EnableNfcActive = TRUE;
1802 nat->discovery_cfg.PollDevInfo.PollCfgInfo.DisableCardEmulation = FALSE;
1804 nat->registry_info.MifareUL = TRUE;
1805 nat->registry_info.MifareStd = TRUE;
1806 nat->registry_info.ISO14443_4A = TRUE;
1807 nat->registry_info.ISO14443_4B = TRUE;
1808 nat->registry_info.Jewel = TRUE;
1809 nat->registry_info.Felica = TRUE;
1810 nat->registry_info.NFC = TRUE;
1811 nat->registry_info.ISO15693 = TRUE;
1813 exported_nat = nat;
1816 init_result = nfc_jni_initialize(nat);
1830 struct nfc_jni_native_data *nat;
1837 nat = nfc_jni_get_nat(e, o);
1840 memset(&nat->discovery_cfg, 0, sizeof(phLibNfc_sADD_Cfg_t));
1841 memset(&nat->registry_info, 0, sizeof(phLibNfc_Registry_Info_t));
1883 kill_client(nat);
1889 emergency_recovery(nat);
1892 result = nfc_jni_unconfigure_driver(nat);
1942 struct nfc_jni_native_data *nat;
1948 nat = nfc_jni_get_nat(e, o);
1960 ret = phLibNfc_SE_SetMode(nat->seId, phLibNfc_SE_ActModeVirtualVolatile, nfc_jni_se_set_mode_callback,
1982 struct nfc_jni_native_data *nat;
1988 nat = nfc_jni_get_nat(e, o);
2000 ret = phLibNfc_SE_SetMode(nat->seId, phLibNfc_SE_ActModeDefault,
2029 struct nfc_jni_native_data *nat;
2043 nat = nfc_jni_get_nat(e, o);
2046 if (!nfc_cb_data_init(cb_data, (void*)nat))
2116 struct nfc_jni_native_data *nat;
2121 nat = nfc_jni_get_nat(e, o);
2131 (void*)nat);
2199 struct nfc_jni_native_data *nat;
2205 nat = nfc_jni_get_nat(e, o);
2224 (void*)nat);
2324 struct nfc_jni_native_data *nat;
2329 nat = nfc_jni_get_nat(e, o);
2347 (void*)nat);
2453 struct nfc_jni_native_data *nat = NULL;
2464 nat = nfc_jni_get_nat(e, o);
2471 result = nfc_jni_configure_driver(nat);
2540 result = nfc_jni_unconfigure_driver(nat);