summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authoraig2020-10-18 17:57:52 +0200
committeraig2020-10-18 17:57:52 +0200
commit424226189fe6b694f4799163045ba85d1f4fdd06 (patch)
tree58f45e7d1fb6276f7c6731ba2e0e773441633215
downloadaur-424226189fe6b694f4799163045ba85d1f4fdd06.tar.gz
Initial commit
-rw-r--r--.SRCINFO24
-rw-r--r--.gitignore4
-rw-r--r--01-fix-tml-linker-errors.patch33
-rw-r--r--02-fix-llcp-linker-errors.patch110
-rw-r--r--PKGBUILD39
5 files changed, 210 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..3a8cbecb0ec8
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,24 @@
+pkgbase = libnfc-nci-alt
+ pkgdesc = Linux NFC stack for NCI based NXP NFC Controllers (PN7150, PN7120). With alt-i2c tml.
+ pkgver = 2.4.1
+ pkgrel = 1
+ url = https://github.com/NXPNFCLinux/linux_libnfc-nci/
+ arch = x86_64
+ license = APACHE
+ makedepends = git
+ depends = glibc
+ depends = gcc-libs
+ depends = systemd-libs
+ depends = openssl
+ provides = libnfc-nci
+ conflicts = libnfc-nci-lpcusbsio
+ conflicts = libnfc-nci-i2c
+ source = git+https://github.com/NXPNFCLinux/linux_libnfc-nci#commit=2aff6448cf6a86897d3d1bacb0a0943a594aa9ce
+ source = 01-fix-tml-linker-errors.patch
+ source = 02-fix-llcp-linker-errors.patch
+ sha256sums = SKIP
+ sha256sums = c9992a8449de8ece0324cbf180a24f8bcab82cb7f51832d3d80958c0968a7575
+ sha256sums = c6ece172b50e1d1070a979fbafa2e9ee7f7f7b92d583fa38f8ea433123a9ef4d
+
+pkgname = libnfc-nci-alt
+
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..51772ecd8a0e
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,4 @@
+linux_libnfc-nci/
+pkg/
+src/
+*.pkg.tar.*
diff --git a/01-fix-tml-linker-errors.patch b/01-fix-tml-linker-errors.patch
new file mode 100644
index 000000000000..8d24fc970d2e
--- /dev/null
+++ b/01-fix-tml-linker-errors.patch
@@ -0,0 +1,33 @@
+diff --git a/src/halimpl/pn54x/tml/i2c/phTmlNfc_i2c.h b/src/halimpl/pn54x/tml/i2c/phTmlNfc_i2c.h
+index 724a2bd..dd1ed8f 100644
+--- a/src/halimpl/pn54x/tml/i2c/phTmlNfc_i2c.h
++++ b/src/halimpl/pn54x/tml/i2c/phTmlNfc_i2c.h
+@@ -29,4 +29,4 @@ int phTmlNfc_i2c_read(void *pDevHandle, uint8_t * pBuffer, int nNbBytesToRead);
+ int phTmlNfc_i2c_write(void *pDevHandle,uint8_t * pBuffer, int nNbBytesToWrite);
+ int phTmlNfc_i2c_reset(void *pDevHandle,long level);
+ bool_t getDownloadFlag(void);
+-phTmlNfc_i2cfragmentation_t fragmentation_enabled;
++extern phTmlNfc_i2cfragmentation_t fragmentation_enabled;
+diff --git a/src/halimpl/pn54x/tml/lpcusbsio/phTmlNfc_lpcusbsio.h b/src/halimpl/pn54x/tml/lpcusbsio/phTmlNfc_lpcusbsio.h
+index 724a2bd..dd1ed8f 100644
+--- a/src/halimpl/pn54x/tml/lpcusbsio/phTmlNfc_lpcusbsio.h
++++ b/src/halimpl/pn54x/tml/lpcusbsio/phTmlNfc_lpcusbsio.h
+@@ -29,4 +29,4 @@ int phTmlNfc_i2c_read(void *pDevHandle, uint8_t * pBuffer, int nNbBytesToRead);
+ int phTmlNfc_i2c_write(void *pDevHandle,uint8_t * pBuffer, int nNbBytesToWrite);
+ int phTmlNfc_i2c_reset(void *pDevHandle,long level);
+ bool_t getDownloadFlag(void);
+-phTmlNfc_i2cfragmentation_t fragmentation_enabled;
++extern phTmlNfc_i2cfragmentation_t fragmentation_enabled;
+diff --git a/src/service/extns/src/mifare/phNxpExtns_MifareStd.c b/src/service/extns/src/mifare/phNxpExtns_MifareStd.c
+index 6cd6aaf..f45236c 100644
+--- a/src/service/extns/src/mifare/phNxpExtns_MifareStd.c
++++ b/src/service/extns/src/mifare/phNxpExtns_MifareStd.c
+@@ -20,7 +20,7 @@
+ #include <phNxpLog.h>
+ #include <phNxpExtns_MifareStd.h>
+
+-phNxpExtns_Context_t gphNxpExtns_Context;
++extern phNxpExtns_Context_t gphNxpExtns_Context;
+ phNciNfc_TransceiveInfo_t tNciTranscvInfo;
+ phFriNfc_sNdefSmtCrdFmt_t *NdefSmtCrdFmt = NULL;
+ phFriNfc_NdefMap_t *NdefMap = NULL;
diff --git a/02-fix-llcp-linker-errors.patch b/02-fix-llcp-linker-errors.patch
new file mode 100644
index 000000000000..bcf75109494a
--- /dev/null
+++ b/02-fix-llcp-linker-errors.patch
@@ -0,0 +1,110 @@
+diff --git a/src/libnfc-nci/nfc/cipher/cipher.c b/src/libnfc-nci/nfc/cipher/cipher.c
+index 899fc34..3d97306 100644
+--- a/src/libnfc-nci/nfc/cipher/cipher.c
++++ b/src/libnfc-nci/nfc/cipher/cipher.c
+@@ -31,6 +31,7 @@
+ #if(NFC_NXP_LLCP_SECURED_P2P == TRUE)
+ #include "cipher.h"
+
++tCIPHER_SUITE cipher_suite;
+ void cipher_init()
+ {
+
+@@ -53,6 +54,7 @@ void cipher_deinit()
+
+ }
+
++tECDH_KEY ecdh_key;
+ void cipher_generate_keys()
+ {
+
+diff --git a/src/libnfc-nci/nfc/include/cipher.h b/src/libnfc-nci/nfc/include/cipher.h
+index 5167de2..af7b971 100644
+--- a/src/libnfc-nci/nfc/include/cipher.h
++++ b/src/libnfc-nci/nfc/include/cipher.h
+@@ -79,7 +79,6 @@ typedef struct {
+ UINT32 packet_counter_recv;
+
+ } tCIPHER_SUITE;
+-tCIPHER_SUITE cipher_suite;
+
+ typedef struct {
+ EC_KEY* privKey_local;
+@@ -96,7 +95,6 @@ typedef struct {
+ CMAC_CTX* cctx;
+ EVP_CIPHER_CTX* ccmctx;
+ }tECDH_KEY;
+-tECDH_KEY ecdh_key;
+
+ void cipher_init(void);
+ void cipher_deinit(void);
+diff --git a/src/libnfc-nci/nfc/int/llcp_int.h b/src/libnfc-nci/nfc/int/llcp_int.h
+index 379e1f0..c0ba899 100644
+--- a/src/libnfc-nci/nfc/int/llcp_int.h
++++ b/src/libnfc-nci/nfc/int/llcp_int.h
+@@ -74,7 +74,6 @@ typedef struct {
+ BOOLEAN p2p_flag; /* p2p flag */
+ BT_HDR *dps_msg; /* dps message */
+ } tLLCP_SECURED;
+-tLLCP_SECURED llcp_secured;
+ #endif
+
+
+diff --git a/src/libnfc-nci/nfc/llcp/llcp_api.c b/src/libnfc-nci/nfc/llcp/llcp_api.c
+index 70cb03f..82fe74b 100644
+--- a/src/libnfc-nci/nfc/llcp/llcp_api.c
++++ b/src/libnfc-nci/nfc/llcp/llcp_api.c
+@@ -50,6 +50,10 @@
+ #include "llcp_int.h"
+ #include "llcp_defs.h"
+
++#if(NFC_NXP_LLCP_SECURED_P2P == TRUE)
++tLLCP_SECURED llcp_secured;
++#endif
++
+ #if (LLCP_TEST_INCLUDED == TRUE) /* this is for LLCP testing */
+
+ tLLCP_TEST_PARAMS llcp_test_params =
+diff --git a/src/libnfc-nci/nfc/llcp/llcp_dlc.c b/src/libnfc-nci/nfc/llcp/llcp_dlc.c
+index 9091679..6f1e664 100644
+--- a/src/libnfc-nci/nfc/llcp/llcp_dlc.c
++++ b/src/libnfc-nci/nfc/llcp/llcp_dlc.c
+@@ -42,6 +42,10 @@ static char *llcp_dlsm_get_state_name (tLLCP_DLC_STATE state);
+ static char *llcp_dlsm_get_event_name (tLLCP_DLC_EVENT event);
+ #endif
+
++#if(NFC_NXP_LLCP_SECURED_P2P == TRUE)
++extern tLLCP_SECURED llcp_secured;
++#endif
++
+ /*******************************************************************************
+ **
+ ** Function llcp_dlsm_execute
+diff --git a/src/libnfc-nci/nfc/llcp/llcp_link.c b/src/libnfc-nci/nfc/llcp/llcp_link.c
+index f6fba0f..50f3217 100644
+--- a/src/libnfc-nci/nfc/llcp/llcp_link.c
++++ b/src/libnfc-nci/nfc/llcp/llcp_link.c
+@@ -52,6 +52,8 @@
+ #if(NFC_NXP_LLCP_SECURED_P2P == TRUE)
+ #include "nci_config.h"
+ #include "cipher.h"
++extern tLLCP_SECURED llcp_secured;
++extern tCIPHER_SUITE cipher_suite;
+ #endif
+ const UINT16 llcp_link_rwt[15] = /* RWT = (302us)*2**WT; 302us = 256*16/fc; fc = 13.56MHz */
+ {
+diff --git a/src/libnfc-nci/nfc/llcp/llcp_sdp.c b/src/libnfc-nci/nfc/llcp/llcp_sdp.c
+index fe1faa3..49d371a 100644
+--- a/src/libnfc-nci/nfc/llcp/llcp_sdp.c
++++ b/src/libnfc-nci/nfc/llcp/llcp_sdp.c
+@@ -55,6 +55,10 @@
+ #include "nfa_dm_int.h"
+ #endif
+
++#if(NFC_NXP_LLCP_SECURED_P2P == TRUE)
++extern tLLCP_SECURED llcp_secured;
++#endif
++
+ /*******************************************************************************
+ **
+ ** Function llcp_sdp_proc_data
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..e411ae27a442
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,39 @@
+# Maintainer: aig <aigmx@posteo.de>
+
+pkgname=libnfc-nci-alt
+pkgver=2.4.1
+pkgrel=1
+pkgdesc="Linux NFC stack for NCI based NXP NFC Controllers (PN7150, PN7120). With alt-i2c tml."
+arch=('x86_64')
+url="https://github.com/NXPNFCLinux/linux_libnfc-nci/"
+license=('APACHE')
+depends=('glibc' 'gcc-libs' 'systemd-libs' 'openssl')
+makedepends=('git')
+provides=('libnfc-nci')
+conflicts=('libnfc-nci-lpcusbsio' 'libnfc-nci-i2c')
+source=("git+https://github.com/NXPNFCLinux/linux_libnfc-nci#commit=2aff6448cf6a86897d3d1bacb0a0943a594aa9ce"
+ "01-fix-tml-linker-errors.patch"
+ "02-fix-llcp-linker-errors.patch")
+sha256sums=('SKIP'
+ 'c9992a8449de8ece0324cbf180a24f8bcab82cb7f51832d3d80958c0968a7575'
+ 'c6ece172b50e1d1070a979fbafa2e9ee7f7f7b92d583fa38f8ea433123a9ef4d')
+
+prepare() {
+ cd "$srcdir/linux_libnfc-nci"
+ patch -p1 -i "$srcdir/01-fix-tml-linker-errors.patch"
+ patch -p1 -i "$srcdir/02-fix-llcp-linker-errors.patch"
+}
+
+build() {
+ cd "$srcdir/linux_libnfc-nci"
+ ./bootstrap
+ export openssldir='/usr'
+ ./configure --prefix=/usr --sysconfdir=/etc/libnfc-nci --enable-alt --enable-llcp1_3
+ make
+}
+
+package() {
+ cd "$srcdir/linux_libnfc-nci"
+ make DESTDIR="$pkgdir/" install
+ rm -rf $pkgdir/usr/sbin
+}