summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSylvain Fonteneau <sylvain.fonteneau@trusted-logic.com>2010-11-03 11:11:22 -0500
committerNick Pelly <npelly@google.com>2010-11-03 13:04:52 -0500
commitb5419c7dd2b703f796dc10480a5a73c907f41e14 (patch)
tree43f39b54f29c5efae41769b5bb0d67e2cdf194da
parentee2202f7fabc87e3d2749a90e1be4b12ea960dce (diff)
downloadlibnfc-nxp-b5419c7dd2b703f796dc10480a5a73c907f41e14.tar.gz
Fixed HAL context issue.
When disconnecting while an internal transceive was ongoing, the HAL context was corrupted. This has been fixed by adding a dedicated context for the disconnect operation. Change-Id: I279474f29164b3ab7d40cdd0e9b8f71f842774b0
-rw-r--r--src/phHal4Nfc_Internal.h1
-rw-r--r--src/phHal4Nfc_P2P.c2
-rw-r--r--src/phHal4Nfc_Reader.c4
3 files changed, 4 insertions, 3 deletions
diff --git a/src/phHal4Nfc_Internal.h b/src/phHal4Nfc_Internal.h
index 27fca61..70f7b16 100644
--- a/src/phHal4Nfc_Internal.h
+++ b/src/phHal4Nfc_Internal.h
@@ -175,6 +175,7 @@ typedef struct phHal4Nfc_UpperLayerInfo{
/**Upper layer's Config discovery/Emulation callback registry*/
pphHal4Nfc_GenCallback_t pConfigCallback;
void *psUpperLayerCtxt;
+ void *psUpperLayerDisconnectCtxt;
/**Upper layer's Open Callback registry*/
pphHal4Nfc_GenCallback_t pUpperOpenCb;
/**Upper layer's Close Callback registry */
diff --git a/src/phHal4Nfc_P2P.c b/src/phHal4Nfc_P2P.c
index 2397812..47a64de 100644
--- a/src/phHal4Nfc_P2P.c
+++ b/src/phHal4Nfc_P2P.c
@@ -368,7 +368,7 @@ void phHal4Nfc_SendCompleteHandler(phHal4Nfc_Hal4Ctxt_t *Hal4Ctxt,void *pInfo)
Hal4Ctxt->sTgtConnectInfo.pUpperDisconnectCb;
Hal4Ctxt->sTgtConnectInfo.pUpperDisconnectCb = NULL;
(*pUpperDisconnectCb)(
- Hal4Ctxt->sUpperLayerInfo.psUpperLayerCtxt,
+ Hal4Ctxt->sUpperLayerInfo.psUpperLayerDisconnectCtxt,
Hal4Ctxt->sTgtConnectInfo.psConnectedDevice,
SendStatus
);/*Notify disconnect failed to upper layer*/
diff --git a/src/phHal4Nfc_Reader.c b/src/phHal4Nfc_Reader.c
index 70f9461..e7a32f4 100644
--- a/src/phHal4Nfc_Reader.c
+++ b/src/phHal4Nfc_Reader.c
@@ -783,7 +783,7 @@ NFCSTATUS phHal4Nfc_Disconnect(
else
{
/*Register upper layer context*/
- Hal4Ctxt->sUpperLayerInfo.psUpperLayerCtxt = pContext;
+ Hal4Ctxt->sUpperLayerInfo.psUpperLayerDisconnectCtxt = pContext;
/*Register upper layer callback*/
Hal4Ctxt->sTgtConnectInfo.pUpperDisconnectCb = pDscntCallback;
/*Register Release Type*/
@@ -1179,7 +1179,7 @@ void phHal4Nfc_DisconnectComplete(
{
PHDBG_INFO("Hal4:Calling Upper layer disconnect callback");
(*pUpperDisconnectCb)(
- Hal4Ctxt->sUpperLayerInfo.psUpperLayerCtxt,
+ Hal4Ctxt->sUpperLayerInfo.psUpperLayerDisconnectCtxt,
psConnectedDevice,
ConnectStatus
);