code update
authorLee Sangsoo <constant.lee@samsung.com>
Mon, 3 Sep 2012 05:44:37 +0000 (14:44 +0900)
committerLee Sangsoo <constant.lee@samsung.com>
Mon, 3 Sep 2012 05:44:37 +0000 (14:44 +0900)
Change-Id: Ie9325a36f0d2d34f7748b7489f7edbcb1a2481f7

14 files changed:
CMakeLists.txt
Linux_x86/phDal4Nfc.c
inc/phDbgTrace.h
inc/phNfcConfig.h
inc/phNfcTypes.h
src/phDal4Nfc.h
src/phDnldNfc.c
src/phFriNfc_NdefMap.c
src/phHal4Nfc.c
src/phHciNfc_DevMgmt.c
src/phHciNfc_Generic.h
src/phLibNfc.c
src/phLlcNfc_Interface.c
src/phLlcNfc_Timer.h

index a4f52ed..69e3300 100755 (executable)
@@ -44,6 +44,7 @@ IF("${ARCH}" STREQUAL "arm")
 ENDIF("${ARCH}" STREQUAL "arm")
 
 ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
+ADD_DEFINITIONS("-DNFC_TIMER_CONTEXT")
 ADD_DEFINITIONS("-DTIZEN_PUBLIC")
 ADD_DEFINITIONS("-DSLP_DEBUG")
 ADD_DEFINITIONS("-DDAL_TRACE")
index 5816f06..4355e27 100755 (executable)
@@ -106,6 +106,7 @@ static phDal4Nfc_SContext_t           gDalContext;
 static pphDal4Nfc_SContext_t          pgDalContext;
 static phHal_sHwReference_t   *       pgDalHwContext;
 static sem_t                          nfc_read_sem;
+static int                            low_level_traces;
 #ifdef USE_MQ_MESSAGE_QUEUE
 static phDal4Nfc_DeferredCall_Msg_t   nDeferedMessage;
 static mqd_t                          nDeferedCallMessageQueueId;
@@ -125,6 +126,31 @@ static void      phDal4Nfc_FillMsg        (phDal4Nfc_Message_t *pDalMsg, phOsalN
                                 DAL API IMPLEMENTATION
 ------------------------------------------------------------------------------------*/
 
+static void refresh_low_level_traces() {
+#ifdef LOW_LEVEL_TRACES
+    low_level_traces = 1;
+    return;
+#else
+
+#ifdef ANDROID
+    char value[PROPERTY_VALUE_MAX];
+
+    property_get("ro.debuggable", value, "");
+    if (!value[0] || !atoi(value)) {
+        low_level_traces = 0;  // user build, do not allow debug
+        return;
+    }
+
+    property_get("debug.nfc.LOW_LEVEL_TRACES", value, "0");
+    if (value[0]) {
+        low_level_traces = atoi(value);
+        return;
+    }
+#endif
+    low_level_traces = 0;
+#endif
+}
+
 /*-----------------------------------------------------------------------------
 
 FUNCTION: phDal4Nfc_Register
@@ -224,6 +250,8 @@ NFCSTATUS phDal4Nfc_Init(void *pContext, void *pHwRef )
 {
     NFCSTATUS        result = NFCSTATUS_SUCCESS;
 
+ //   refresh_low_level_traces();
+
     if ((NULL != pContext) && (NULL != pHwRef))
     {
         pContext  = pgDalContext;
@@ -247,7 +275,7 @@ NFCSTATUS phDal4Nfc_Init(void *pContext, void *pHwRef )
         else
         {
             static phDal4Nfc_sConfig_t hw_config;
-            hw_config.deviceNode = NULL;\r
+            hw_config.deviceNode = NULL;
             result = phDal4Nfc_Config(&hw_config, pHwRef );
         }
     }
@@ -290,7 +318,7 @@ NFCSTATUS phDal4Nfc_Shutdown( void *pContext, void *pHwRef)
    return result;
 }
 
-NFCSTATUS phDal4Nfc_ConfigRelease( void *pHwRef)
+NFCSTATUS phDal4Nfc_ConfigRelease(void *pHwRef)
 {
 
    NFCSTATUS result = NFCSTATUS_SUCCESS;
@@ -550,7 +578,8 @@ NFCSTATUS phDal4Nfc_Config(pphDal4Nfc_sConfig_t config,void **phwref)
 
    /* Register the link callbacks */
    memset(&gLinkFunc, 0, sizeof(phDal4Nfc_link_cbk_interface_t));
-   switch(PN544_LINK_TYPE_I2C)
+#if 0
+  switch(PN544_LINK_TYPE_I2C)
    {
       case PN544_LINK_TYPE_UART:
       case PN544_LINK_TYPE_USB:
@@ -570,7 +599,9 @@ NFCSTATUS phDal4Nfc_Config(pphDal4Nfc_sConfig_t config,void **phwref)
       break;
 
       case PN544_LINK_TYPE_I2C:
-      {
+     {
+#endif
+
         DAL_PRINT("I2C link Config");
          /* i2c link interface */
          gLinkFunc.init               = phDal4Nfc_i2c_initialize;
@@ -582,15 +613,16 @@ NFCSTATUS phDal4Nfc_Config(pphDal4Nfc_sConfig_t config,void **phwref)
          gLinkFunc.read               = phDal4Nfc_i2c_read;
          gLinkFunc.write              = phDal4Nfc_i2c_write;
          gLinkFunc.reset              = phDal4Nfc_i2c_reset;
+#if 0
          break;
       }
-
       default:
       {
          /* Shound not happen : Bad parameter */
          return PHNFCSTVAL(CID_NFC_DAL, NFCSTATUS_INVALID_PARAMETER);
       }
-   }
+}
+#endif
 
    gLinkFunc.init(); /* So that link interface can initialize its internal state */
    retstatus = gLinkFunc.open_and_configure(config, phwref);
@@ -614,19 +646,7 @@ NFCSTATUS phDal4Nfc_Config(pphDal4Nfc_sConfig_t config,void **phwref)
    nDeferedCallMessageQueueId = config->nClientId;
 #endif
 
-       usleep(50000);
-
-       if(phDal4Nfc_Reset(0) != 0)
-       {
-               perror("power off is failed !!");
-       }
-
-       usleep(50000);
-
-       if(phDal4Nfc_Reset(1) != 0)
-       {
-               perror("power on is failed !!");
-       }
+//   gDalContext.pDev = pn544_dev;
 
    /* Start Read and Write Threads */
    if(NFCSTATUS_SUCCESS != phDal4Nfc_StartThreads())
@@ -635,6 +655,9 @@ NFCSTATUS phDal4Nfc_Config(pphDal4Nfc_sConfig_t config,void **phwref)
    }
 
    gDalContext.hw_valid = TRUE;
+   phDal4Nfc_Reset(1);
+   phDal4Nfc_Reset(0);
+   phDal4Nfc_Reset(1);
 
    return NFCSTATUS_SUCCESS;
 }
@@ -650,7 +673,7 @@ NFCSTATUS phDal4Nfc_Reset(long level)
 {
    NFCSTATUS   retstatus = NFCSTATUS_SUCCESS;
 
-   DAL_DEBUG("phDal4Nfc_Reset: VEN to %d",(int)level);
+   DAL_DEBUG("phDal4Nfc_Reset: VEN to %ld",level);
 
    retstatus = gLinkFunc.reset(level);
 
@@ -664,19 +687,19 @@ FUNCTION: phDal4Nfc_Download
 PURPOSE: Put the PN544 in download mode, using the GPIO4 pin
 
 -----------------------------------------------------------------------------*/
-NFCSTATUS phDal4Nfc_Download()\r
+NFCSTATUS phDal4Nfc_Download()
 {
-   NFCSTATUS   retstatus = NFCSTATUS_SUCCESS;\r
+   NFCSTATUS   retstatus = NFCSTATUS_SUCCESS;
 
-   DAL_DEBUG("phDal4Nfc_Download: GPIO4 to %d",1);\r
+   DAL_DEBUG("phDal4Nfc_Download: GPIO4 to %d",1);
 
-   usleep(10000);\r
-   retstatus = phDal4Nfc_Reset(2);\r
-\r
-   return retstatus;\r
+   usleep(10000);
+   retstatus = phDal4Nfc_Reset(2);
+
+   return retstatus;
 }
-\r
-\r
+
+
 
 /*-----------------------------------------------------------------------------------
                                 DAL INTERNAL IMPLEMENTATION
@@ -913,12 +936,18 @@ void phDal4Nfc_DeferredCb (void  *params)
             break;
         case PHDAL4NFC_WRITE_MESSAGE:
             DAL_PRINT(" Dal deferred write called \n");
-
+#if 0
+            if(low_level_traces)
+            {
+                phOsalNfc_PrintData("SEND", (uint16_t)gReadWriteContext.nNbOfBytesToWrite,
+                        gReadWriteContext.pWriteBuffer, low_level_traces);
+            }
+#endif
             /* DAL_DEBUG("dalMsg->transactInfo.length : %d\n", dalMsg->transactInfo.length); */
             /* Make a Physical WRITE */
             /* NOTE: need to usleep(3000) here if the write is for SWP */
             usleep(500);  /* NXP advise 500us sleep required between I2C writes */
-              gReadWriteContext.nNbOfBytesWritten = gLinkFunc.write(gReadWriteContext.pWriteBuffer, gReadWriteContext.nNbOfBytesToWrite);
+            gReadWriteContext.nNbOfBytesWritten = gLinkFunc.write(gReadWriteContext.pWriteBuffer, gReadWriteContext.nNbOfBytesToWrite);
             if (gReadWriteContext.nNbOfBytesWritten != gReadWriteContext.nNbOfBytesToWrite)
             {
                 /* controller may be in standby. do it again! */
@@ -979,7 +1008,7 @@ void phDal4Nfc_DeferredCb (void  *params)
  */
 void phDal4Nfc_DeferredCall(pphDal4Nfc_DeferFuncPointer_t func, void *param)
 {
-//    int                retvalue = 0;
+    int                retvalue = 0;
     phDal4Nfc_Message_Wrapper_t nDeferedMessageWrapper;
     phDal4Nfc_DeferredCall_Msg_t *pDeferedMessage;
     static phDal4Nfc_DeferredCall_Msg_t nDeferedMessageRead;
index 84a7422..5563752 100644 (file)
-/*
- * Copyright (C) 2010 NXP Semiconductors
- * Copyright (C) 2012 Samsung Elevtronics Co., Ltd
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-/**
- * \file phDbgTrace.h
- * Project: NFC-FRI-1.1 / HAL4.0
- *
- * $Date: Tue Apr 28 11:48:33 2009 $
- * $Author: ing08203 $
- * $Revision: 1.17 $
- * $Aliases: NFC_FRI1.1_WK918_R24_1,NFC_FRI1.1_WK920_PREP1,NFC_FRI1.1_WK920_R25_1,NFC_FRI1.1_WK922_PREP1,NFC_FRI1.1_WK922_R26_1,NFC_FRI1.1_WK924_PREP1,NFC_FRI1.1_WK924_R27_1,NFC_FRI1.1_WK926_R28_1,NFC_FRI1.1_WK928_R29_1,NFC_FRI1.1_WK930_R30_1,NFC_FRI1.1_WK934_PREP_1,NFC_FRI1.1_WK934_R31_1,NFC_FRI1.1_WK941_PREP1,NFC_FRI1.1_WK941_PREP2,NFC_FRI1.1_WK941_1,NFC_FRI1.1_WK943_R32_1,NFC_FRI1.1_WK949_PREP1,NFC_FRI1.1_WK943_R32_10,NFC_FRI1.1_WK943_R32_13,NFC_FRI1.1_WK943_R32_14,NFC_FRI1.1_WK1007_R33_1,NFC_FRI1.1_WK1007_R33_4,NFC_FRI1.1_WK1017_PREP1,NFC_FRI1.1_WK1017_R34_1,NFC_FRI1.1_WK1017_R34_2,NFC_FRI1.1_WK1023_R35_1 $
- *
- */
-
-/*@{*/
-#ifndef PHDBGTRACE_H
-#define PHDBGTRACE_H
-/*@}*/
-
-#include <stdio.h>
-
-
-#ifdef PHDBG_TRACES 
-#define MAX_TRACE_BUFFER       300
-
-#ifndef PHDBG_TRACES_LEVEL_0
-#ifndef PHDBG_TRACES_LEVEL_1
-#ifndef PHDBG_TRACES_LEVEL_2
-#define PHDBG_TRACES_LEVEL_0
-#endif
-#endif
-#endif
-
-       extern char phOsalNfc_DbgTraceBuffer[];
-
-       #ifdef PHDBG_TRACES_LEVEL_0
-       
-       /*indicates an error that causes a program to abort.*/
-       #define PHDBG_FATAL_ERROR(Str)          {\
-                                                                                       snprintf(phOsalNfc_DbgTraceBuffer,MAX_TRACE_BUFFER, \
-                                                                                       "FATAL ERROR in Module :%s\n",__FILE__);\
-                                                                                       phOsalNfc_DbgString(phOsalNfc_DbgTraceBuffer);\
-                                                                                       snprintf(phOsalNfc_DbgTraceBuffer, MAX_TRACE_BUFFER, \
-                                                                                                                       "In Function:%s\n",__FUNCTION__ );      \
-                                                                                       phOsalNfc_DbgString (phOsalNfc_DbgTraceBuffer);\
-                                                                               }
-
-       #define PHDBG_CRITICAL_ERROR(Str)       {\
-                                                                                       snprintf(phOsalNfc_DbgTraceBuffer, MAX_TRACE_BUFFER, \
-                                                                                                                       "CRITICAL ERROR in Module :%s\n",__FILE__);\
-                                                                                       phOsalNfc_DbgString(phOsalNfc_DbgTraceBuffer);\
-                                                                                       snprintf(phOsalNfc_DbgTraceBuffer, MAX_TRACE_BUFFER, \
-                                                                                                                       "In Function:%s\n",__FUNCTION__ );      \
-                                                                                       phOsalNfc_DbgString (phOsalNfc_DbgTraceBuffer);\
-                                                                               }
-       #define PHDBG_WARNING(Str)
-       #define PHDBG_INFO(Str) 
-       #endif  /*End of PHDBG_TRACES_LEVEL_0 */
-
-       #ifdef PHDBG_TRACES_LEVEL_1
-
-       /*indicates an error that causes a program to abort.*/
-       #define PHDBG_FATAL_ERROR(Str)          {\
-                                                                                       snprintf(phOsalNfc_DbgTraceBuffer, MAX_TRACE_BUFFER, \
-                                                                                                                       "FATAL ERROR in Module :%s\n",__FILE__);\
-                                                                                       phOsalNfc_DbgString(phOsalNfc_DbgTraceBuffer);\
-                                                                                       snprintf(phOsalNfc_DbgTraceBuffer, MAX_TRACE_BUFFER, \
-                                                                                                                       "In Function:%s\n",__FUNCTION__ );      \
-                                                                                       phOsalNfc_DbgString (phOsalNfc_DbgTraceBuffer);\
-                                                                               }
-
-       #define PHDBG_CRITICAL_ERROR(Str)       {\
-                                                                                       snprintf(phOsalNfc_DbgTraceBuffer, MAX_TRACE_BUFFER, \
-                                                                                       "CRITICAL ERROR in Module :%s\n",__FILE__);\
-                                                                                       phOsalNfc_DbgString(phOsalNfc_DbgTraceBuffer);\
-                                                                                       snprintf(phOsalNfc_DbgTraceBuffer, MAX_TRACE_BUFFER, \
-                                                                                                                       "In Function:%s\n",__FUNCTION__ );      \
-                                                                                       phOsalNfc_DbgString (phOsalNfc_DbgTraceBuffer);\
-                                                                               }
-       /*Normally this macro shall be used indicate system state that might cause problems in future.*/
-       #define PHDBG_WARNING(Str)                      {\
-                                                                                       snprintf(phOsalNfc_DbgTraceBuffer, MAX_TRACE_BUFFER, \
-                                                                                                                       "WARNING :%s\n",__FILE__);\
-                                                                                       phOsalNfc_DbgString(phOsalNfc_DbgTraceBuffer);\
-                                                                                       phOsalNfc_DbgString (Str);\
-                                                                                       phOsalNfc_DbgString ("\n");\
-                                                                               }
-       #define PHDBG_INFO(Str) 
-       #endif /*End of PHDBG_TRACES_LEVEL_1 */
-
-       #ifdef PHDBG_TRACES_LEVEL_2
-
-       /*indicates an error that causes a program to abort.*/
-       #define PHDBG_FATAL_ERROR(Str)          {\
-                                                                                       snprintf(phOsalNfc_DbgTraceBuffer, MAX_TRACE_BUFFER, \
-                                                                                       "FATAL ERROR in Module :%s\n",__FILE__);\
-                                                                                       phOsalNfc_DbgString(phOsalNfc_DbgTraceBuffer);\
-                                                                                       snprintf(phOsalNfc_DbgTraceBuffer, MAX_TRACE_BUFFER, \
-                                                                                                                       "In Function:%s\n",__FUNCTION__ );      \
-                                                                                       phOsalNfc_DbgString (phOsalNfc_DbgTraceBuffer);\
-                                                                               }
-
-       #define PHDBG_CRITICAL_ERROR(Str)       {\
-                                                                                       snprintf(phOsalNfc_DbgTraceBuffer, MAX_TRACE_BUFFER, \
-                                                                                       "CRITICAL ERROR in Module :%s\n",__FILE__);\
-                                                                                       phOsalNfc_DbgString(phOsalNfc_DbgTraceBuffer);\
-                                                                                       snprintf(phOsalNfc_DbgTraceBuffer, MAX_TRACE_BUFFER, \
-                                                                                                                       "In Function:%s\n",__FUNCTION__ );      \
-                                                                                       phOsalNfc_DbgString (phOsalNfc_DbgTraceBuffer);\
-                                                                               }
-       /*Normally this macro shall be used indicate system state that might cause problems in future.*/
-       #define PHDBG_WARNING(Str)                      {\
-                                                                                       snprintf(phOsalNfc_DbgTraceBuffer, MAX_TRACE_BUFFER, \
-                                                                                       "WARNING :%s\n",__FILE__);\
-                                                                                       phOsalNfc_DbgString(phOsalNfc_DbgTraceBuffer);\
-                                                                                       phOsalNfc_DbgString (Str);\
-                                                                                       phOsalNfc_DbgString ("\n");\
-                                                                               }
-       
-       #define PHDBG_INFO(Str)                         {\
-                                                                                       snprintf(phOsalNfc_DbgTraceBuffer, MAX_TRACE_BUFFER, \
-                                                                                       "DBG INFO :%s\n",__FILE__);\
-                                                                                       phOsalNfc_DbgString(phOsalNfc_DbgTraceBuffer);\
-                                                                                       phOsalNfc_DbgString (Str);\
-                                                                                       phOsalNfc_DbgString ("\n");\
-                                                                               }
-       
-
-
-#endif  /*End of PHDBG_TRACES_LEVEL_2 */
-#else
-#define PHDBG_FATAL_ERROR(Str)
-#define PHDBG_CRITICAL_ERROR(Str)      
-#define PHDBG_WARNING(Str)
-#define PHDBG_INFO(Str)        
-
-
-#endif /*end of DEBUG trace*/
-
-
-#ifdef FRI_CUSTOM_LOG
-
-#include <stdio.h>
-#define LOG_TAG "NFC_STACK"
-#include <dlog.h>
-
-#define LOG_COLOR_RED          "\033[0;31m"
-#define LOG_COLOR_GREEN        "\033[0;32m"
-#define LOG_COLOR_BROWN        "\033[0;33m"
-#define LOG_COLOR_BLUE                 "\033[0;34m"
-#define LOG_COLOR_PURPLE       "\033[0;35m"
-#define LOG_COLOR_CYAN                 "\033[0;36m"
-#define LOG_COLOR_LIGHTBLUE "\033[0;37m"
-#define LOG_COLOR_END          "\033[0;m"
-
-
-#define CUST_MSG_DAL(format,args...) \
-do {\
-       LOGD(LOG_COLOR_BLUE""format""LOG_COLOR_END, ##args);\
-}while(0)
-
-#define CUST_MSG_WFL_DAL(format,args...) \
-do {\
-       LOGD(LOG_COLOR_BLUE"[file = %s : method = %s : line = %d] "LOG_COLOR_END,__FILE__, __func__, __LINE__); \
-       LOGD(LOG_COLOR_BLUE""format""LOG_COLOR_END, ##args);\
-}while(0);
-
-#else
-#define CUST_MSG_DAL(format,args...)   
-#define CUST_MSG_WFL_DAL(format,args...)
-#endif 
-
-
-#endif /* end of PHDBGTRACE_H */
+/*\r
+ * Copyright (C) 2010 NXP Semiconductors\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ *      http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+\r
+/**\r
+ * \file phDbgTrace.h\r
+ * Project: NFC-FRI-1.1 / HAL4.0\r
+ *\r
+ * $Date: Tue Apr 28 11:48:33 2009 $\r
+ * $Author: ing08203 $\r
+ * $Revision: 1.17 $\r
+ * $Aliases: NFC_FRI1.1_WK918_R24_1,NFC_FRI1.1_WK920_PREP1,NFC_FRI1.1_WK920_R25_1,NFC_FRI1.1_WK922_PREP1,NFC_FRI1.1_WK922_R26_1,NFC_FRI1.1_WK924_PREP1,NFC_FRI1.1_WK924_R27_1,NFC_FRI1.1_WK926_R28_1,NFC_FRI1.1_WK928_R29_1,NFC_FRI1.1_WK930_R30_1,NFC_FRI1.1_WK934_PREP_1,NFC_FRI1.1_WK934_R31_1,NFC_FRI1.1_WK941_PREP1,NFC_FRI1.1_WK941_PREP2,NFC_FRI1.1_WK941_1,NFC_FRI1.1_WK943_R32_1,NFC_FRI1.1_WK949_PREP1,NFC_FRI1.1_WK943_R32_10,NFC_FRI1.1_WK943_R32_13,NFC_FRI1.1_WK943_R32_14,NFC_FRI1.1_WK1007_R33_1,NFC_FRI1.1_WK1007_R33_4,NFC_FRI1.1_WK1017_PREP1,NFC_FRI1.1_WK1017_R34_1,NFC_FRI1.1_WK1017_R34_2,NFC_FRI1.1_WK1023_R35_1 $\r
+ *\r
+ */\r
+\r
+/*@{*/\r
+#ifndef PHDBGTRACE_H\r
+#define PHDBGTRACE_H\r
+/*@}*/\r
+\r
+#include <stdio.h>\r
+\r
+\r
+#ifdef PHDBG_TRACES \r
+#define MAX_TRACE_BUFFER       300\r
+\r
+#ifndef PHDBG_TRACES_LEVEL_0\r
+#ifndef PHDBG_TRACES_LEVEL_1\r
+#ifndef PHDBG_TRACES_LEVEL_2\r
+#define PHDBG_TRACES_LEVEL_0\r
+#endif\r
+#endif\r
+#endif\r
+\r
+       extern char phOsalNfc_DbgTraceBuffer[];\r
+\r
+       #ifdef PHDBG_TRACES_LEVEL_0\r
+       \r
+       /*indicates an error that causes a program to abort.*/\r
+       #define PHDBG_FATAL_ERROR(Str)          {\\r
+                                                                                       snprintf(phOsalNfc_DbgTraceBuffer,MAX_TRACE_BUFFER, \\r
+                                                                                       "FATAL ERROR in Module :%s\n",__FILE__);\\r
+                                                                                       phOsalNfc_DbgString(phOsalNfc_DbgTraceBuffer);\\r
+                                                                                       snprintf(phOsalNfc_DbgTraceBuffer, MAX_TRACE_BUFFER, \\r
+                                                                                                                       "In Function:%s\n",__FUNCTION__ );      \\r
+                                                                                       phOsalNfc_DbgString (phOsalNfc_DbgTraceBuffer);\\r
+                                                                               }\r
+\r
+       #define PHDBG_CRITICAL_ERROR(Str)       {\\r
+                                                                                       snprintf(phOsalNfc_DbgTraceBuffer, MAX_TRACE_BUFFER, \\r
+                                                                                                                       "CRITICAL ERROR in Module :%s\n",__FILE__);\\r
+                                                                                       phOsalNfc_DbgString(phOsalNfc_DbgTraceBuffer);\\r
+                                                                                       snprintf(phOsalNfc_DbgTraceBuffer, MAX_TRACE_BUFFER, \\r
+                                                                                                                       "In Function:%s\n",__FUNCTION__ );      \\r
+                                                                                       phOsalNfc_DbgString (phOsalNfc_DbgTraceBuffer);\\r
+                                                                               }\r
+       #define PHDBG_WARNING(Str)\r
+       #define PHDBG_INFO(Str) \r
+       #endif  /*End of PHDBG_TRACES_LEVEL_0 */\r
+\r
+       #ifdef PHDBG_TRACES_LEVEL_1\r
+\r
+       /*indicates an error that causes a program to abort.*/\r
+       #define PHDBG_FATAL_ERROR(Str)          {\\r
+                                                                                       snprintf(phOsalNfc_DbgTraceBuffer, MAX_TRACE_BUFFER, \\r
+                                                                                                                       "FATAL ERROR in Module :%s\n",__FILE__);\\r
+                                                                                       phOsalNfc_DbgString(phOsalNfc_DbgTraceBuffer);\\r
+                                                                                       snprintf(phOsalNfc_DbgTraceBuffer, MAX_TRACE_BUFFER, \\r
+                                                                                                                       "In Function:%s\n",__FUNCTION__ );      \\r
+                                                                                       phOsalNfc_DbgString (phOsalNfc_DbgTraceBuffer);\\r
+                                                                               }\r
+\r
+       #define PHDBG_CRITICAL_ERROR(Str)       {\\r
+                                                                                       snprintf(phOsalNfc_DbgTraceBuffer, MAX_TRACE_BUFFER, \\r
+                                                                                       "CRITICAL ERROR in Module :%s\n",__FILE__);\\r
+                                                                                       phOsalNfc_DbgString(phOsalNfc_DbgTraceBuffer);\\r
+                                                                                       snprintf(phOsalNfc_DbgTraceBuffer, MAX_TRACE_BUFFER, \\r
+                                                                                                                       "In Function:%s\n",__FUNCTION__ );      \\r
+                                                                                       phOsalNfc_DbgString (phOsalNfc_DbgTraceBuffer);\\r
+                                                                               }\r
+       /*Normally this macro shall be used indicate system state that might cause problems in future.*/\r
+       #define PHDBG_WARNING(Str)                      {\\r
+                                                                                       snprintf(phOsalNfc_DbgTraceBuffer, MAX_TRACE_BUFFER, \\r
+                                                                                                                       "WARNING :%s\n",__FILE__);\\r
+                                                                                       phOsalNfc_DbgString(phOsalNfc_DbgTraceBuffer);\\r
+                                                                                       phOsalNfc_DbgString (Str);\\r
+                                                                                       phOsalNfc_DbgString ("\n");\\r
+                                                                               }\r
+       #define PHDBG_INFO(Str) \r
+       #endif /*End of PHDBG_TRACES_LEVEL_1 */\r
+\r
+       #ifdef PHDBG_TRACES_LEVEL_2\r
+\r
+       /*indicates an error that causes a program to abort.*/\r
+       #define PHDBG_FATAL_ERROR(Str)          {\\r
+                                                                                       snprintf(phOsalNfc_DbgTraceBuffer, MAX_TRACE_BUFFER, \\r
+                                                                                       "FATAL ERROR in Module :%s\n",__FILE__);\\r
+                                                                                       phOsalNfc_DbgString(phOsalNfc_DbgTraceBuffer);\\r
+                                                                                       snprintf(phOsalNfc_DbgTraceBuffer, MAX_TRACE_BUFFER, \\r
+                                                                                                                       "In Function:%s\n",__FUNCTION__ );      \\r
+                                                                                       phOsalNfc_DbgString (phOsalNfc_DbgTraceBuffer);\\r
+                                                                               }\r
+\r
+       #define PHDBG_CRITICAL_ERROR(Str)       {\\r
+                                                                                       snprintf(phOsalNfc_DbgTraceBuffer, MAX_TRACE_BUFFER, \\r
+                                                                                       "CRITICAL ERROR in Module :%s\n",__FILE__);\\r
+                                                                                       phOsalNfc_DbgString(phOsalNfc_DbgTraceBuffer);\\r
+                                                                                       snprintf(phOsalNfc_DbgTraceBuffer, MAX_TRACE_BUFFER, \\r
+                                                                                                                       "In Function:%s\n",__FUNCTION__ );      \\r
+                                                                                       phOsalNfc_DbgString (phOsalNfc_DbgTraceBuffer);\\r
+                                                                               }\r
+       /*Normally this macro shall be used indicate system state that might cause problems in future.*/\r
+       #define PHDBG_WARNING(Str)                      {\\r
+                                                                                       snprintf(phOsalNfc_DbgTraceBuffer, MAX_TRACE_BUFFER, \\r
+                                                                                       "WARNING :%s\n",__FILE__);\\r
+                                                                                       phOsalNfc_DbgString(phOsalNfc_DbgTraceBuffer);\\r
+                                                                                       phOsalNfc_DbgString (Str);\\r
+                                                                                       phOsalNfc_DbgString ("\n");\\r
+                                                                               }\r
+       \r
+       #define PHDBG_INFO(Str)                         {\\r
+                                                                                       snprintf(phOsalNfc_DbgTraceBuffer, MAX_TRACE_BUFFER, \\r
+                                                                                       "DBG INFO :%s\n",__FILE__);\\r
+                                                                                       phOsalNfc_DbgString(phOsalNfc_DbgTraceBuffer);\\r
+                                                                                       phOsalNfc_DbgString (Str);\\r
+                                                                                       phOsalNfc_DbgString ("\n");\\r
+                                                                               }\r
+       \r
+\r
+\r
+#endif  /*End of PHDBG_TRACES_LEVEL_2 */\r
+#else\r
+#define PHDBG_FATAL_ERROR(Str)\r
+#define PHDBG_CRITICAL_ERROR(Str)      \r
+#define PHDBG_WARNING(Str)\r
+#define PHDBG_INFO(Str)        \r
+\r
+\r
+#endif /*end of DEBUG trace*/\r
+#endif /* end of PHDBGTRACE_H */\r
index 0d4380a..26386f7 100755 (executable)
@@ -1,6 +1,5 @@
 /*
  * Copyright (C) 2010 NXP Semiconductors
- * Copyright (C) 2012 Samsung Elevtronics Co., Ltd
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 
 
 /**<  Indicates PN544 Power Modes Configuration for the NFC Device,
-      0x00U -> PN544 stays in active bat mode
+      0x00U -> PN544 stays in active bat mode \r
                (except when generating RF field)
-      0x01U -> PN544 goes in standby when possible otherwise
+      0x01U -> PN544 goes in standby when possible otherwise \r
                stays in active bat mode
-      0x02U -> PN544 goes in idle mode as soon as it can
+      0x02U -> PN544 goes in idle mode as soon as it can \r
                (otherwise it is in active bat except when generating RF field)
-      0x03U -> PN544 goes in standby when possible otherwise goes in idle mode
-               as soon as it can (otherwise it is in active bat except when
+      0x03U -> PN544 goes in standby when possible otherwise goes in idle mode \r
+               as soon as it can (otherwise it is in active bat except when \r
                generating RF field)
       */
 
 /**< Max number of remote devices supported */
 
 #ifndef MAX_REMOTE_DEVICES
-#define MAX_REMOTE_DEVICES        0x0A
+#define MAX_REMOTE_DEVICES        0x0A \r
 #endif
 
 /**<  System Event Notification
 #endif
 
 #ifndef NXP_MIFARE_XCHG_TIMEOUT
-#define NXP_MIFARE_XCHG_TIMEOUT         0x03U
+#define NXP_MIFARE_XCHG_TIMEOUT         0x0BU\r
 #endif
 
 #ifndef NXP_FELICA_XCHG_TIMEOUT
 /**< Presence check interval in milliseconds */
 #ifndef PRESENCE_CHECK_INTERVAL
 #define PRESENCE_CHECK_INTERVAL   500U
-#endif
+#endif \r
 
-/** Resolution value for the timer, here the
+/** Resolution value for the timer, here the \r
     timer resolution is 500 milliseconds */
 #ifndef TIMER_RESOLUTION
 #define TIMER_RESOLUTION                500U
-#endif
+#endif \r
 
 /* Kindly note that the below Timeout values should be
  * in Multiples of the value provided to TIMER_RESOLUTION
  */
 
-/**< Defines guard time out value for LLC timer,
+/**< Defines guard time out value for LLC timer, \r
     1000 is in milliseconds */
 #ifndef LINK_GUARD_TIMEOUT
 #define LINK_GUARD_TIMEOUT              1000U
-#endif
+#endif \r
 
 
-/**< Defines connection time out value for LLC timer,
+/**< Defines connection time out value for LLC timer, \r
     1000 is in milliseconds */
 #ifndef LINK_CONNECTION_TIMEOUT
 #define LINK_CONNECTION_TIMEOUT         1000U
+#endif \r
+\r
+/**< Defines ACK time out value for LLC timer,\r
+    150 is in milliseconds */\r
+#ifndef LINK_ACK_TIMEOUT\r
+#define LINK_ACK_TIMEOUT                1U\r
 #endif
 
 
 
 
 #ifndef NXP_DNLD_COMPLETE_TIMEOUT
-#define NXP_DNLD_COMPLETE_TIMEOUT         120000U
+#define NXP_DNLD_COMPLETE_TIMEOUT         60000U\r
 #endif
 
 
-/**< Define to configure the Active Mode Polling Guard Time-out
+/**< Define to configure the Active Mode Polling Guard Time-out \r
   */
 
 #ifndef DEV_MGMT_ACT_GRD_TO_DEFAULT
 
 #ifndef HOST_CE_A_SAK_DEFAULT
 #define HOST_CE_A_SAK_DEFAULT           0x20U
-#endif
+#endif \r
 
 #ifndef NXP_CE_A_ATQA_HIGH
 #define NXP_CE_A_ATQA_HIGH              0x00U
 
 #ifndef NXP_UICC_CE_RIGHTS
 #define NXP_UICC_CE_RIGHTS              0x0FU
-#endif
+#endif \r
 
 #ifndef NXP_UICC_RD_RIGHTS
 #define NXP_UICC_RD_RIGHTS              0x00U
-#endif
+#endif \r
 
 
 /*
  */
 
 #define ES_HW_VER   32
-
\r
 /*
  *****************************************************************
  *************** FEATURE SPECIFIC MACROS *************************
  * Initialisation */
 
 #if !defined(NXP_SMX)
-#define NXP_SMX 0
+#define NXP_SMX 1\r
 #endif
 
 #if (NXP_SMX == 1)
-#define NXP_HAL_ENABLE_SMX
+#define NXP_HAL_ENABLE_SMX \r
 #endif
 
 /**< Macro to Enable the Host Session
 #define LLC_TIMER_ENABLE
 
 /**< Macro to enable HCI Response timer */
-/* #define NXP_NFC_HCI_TIMER 1 */
+#define NXP_NFC_HCI_TIMER 1\r
 
 /* A Workaround to Delay and obtain the UICC Status Information */
 /* #define UICC_STATUS_DELAY */
index aa91814..fe83f3b 100755 (executable)
@@ -118,7 +118,7 @@ typedef uint8_t                     bool_t;                 /**< \ingroup grp_nfc_common
                                                                                                boolean data type */
 
 typedef uint16_t        NFCSTATUS;      /**< \ingroup grp_nfc_common
-                                             NFC return values
+                                             NFC return values \r
                                          \ref phNfcStatus.h for different status
                                           values */
 
@@ -127,7 +127,7 @@ typedef uint16_t        NFCSTATUS;      /**< \ingroup grp_nfc_common
 #endif
 
 /* This Macro to be used to resolve Unused and unreference
- * compiler warnings.
+ * compiler warnings. \r
  */
 
 #define PHNFC_UNUSED_VARIABLE(x) for((x)=(x);(x)!=(x);)
@@ -166,7 +166,7 @@ typedef uint16_t        NFCSTATUS;      /**< \ingroup grp_nfc_common
 
 #define PHHAL_ATQA_LENGTH               0x02U       /**< ATQA length */
 #define PHHAL_MAX_UID_LENGTH            0x0AU       /**< Maximum UID length expected */
-#define PHHAL_MAX_ATR_LENGTH            0x30U       /**< Maximum ATR_RES (General Bytes)
+#define PHHAL_MAX_ATR_LENGTH            0x30U       /**< Maximum ATR_RES (General Bytes) \r
                                                      *   length expected */
 
 #define PHHAL_ATQB_LENGTH               0x0BU       /**< ATQB length */
@@ -181,7 +181,7 @@ typedef uint16_t        NFCSTATUS;      /**< \ingroup grp_nfc_common
                                                          ISO15693 Tag */
 
 #define VENDOR_NAME_LEN                 0x14U
-#define MAX_TRANSFER_UNIT               0x21U
+#define MAX_TRANSFER_UNIT               0x21U \r
 #define SESSIONID_SIZE                  0x08U
 #define MAX_AID_LEN                     0x10U
 #define MAX_UICC_PARAM_LEN              0xFFU
@@ -213,9 +213,9 @@ typedef uint16_t        NFCSTATUS;      /**< \ingroup grp_nfc_common
 /**
  * Data Buffer Structure to hold the Data Buffer
  *
- * This structure holds the Data in the Buffer of the specified
+ * This structure holds the Data in the Buffer of the specified \r
  * size.
- *
+ * \r
  */
 typedef struct phNfc_sData_t
 {
@@ -242,7 +242,7 @@ typedef enum
  * \brief Possible Hardware Configuration exposed to upper layer.
  * Typically this should be at least the communication link (Ex:"COM1","COM2")
  * the controller is connected to.
- */
+ */   \r
 typedef struct phLibNfc_sConfig_t
 {
    /** Device node of the controller */
@@ -275,21 +275,21 @@ typedef struct phLibNfc_Message_t
 
 /**
  *\brief Deferred call declaration.
- * This type of API is called from ClientApplication ( main thread) to notify
+ * This type of API is called from ClientApplication ( main thread) to notify \r
  * specific callback.
  */
 typedef  void (*pphLibNfc_DeferredCallback_t) (void*);
 /**
  *\brief Deferred parameter declaration.
- * This type of data is passed as parameter from ClientApplication (main thread) to the
+ * This type of data is passed as parameter from ClientApplication (main thread) to the \r
  * callback.
  */
 typedef  void *pphLibNfc_DeferredParameter_t;
 /**
  *\brief Deferred message specific info declaration.
- * This type of information is packed as message data when \ref PH_LIBNFC_DEFERREDCALL_MSG
+ * This type of information is packed as message data when \ref PH_LIBNFC_DEFERREDCALL_MSG \r
  * type message is posted to message handler thread.
- */
+ */ \r
 typedef struct phLibNfc_DeferredCall_t
 {
                pphLibNfc_DeferredCallback_t  pCallback;/**< pointer to Deferred callback */
@@ -309,7 +309,7 @@ typedef struct phLibNfc_DeferredCall_t
  */
 typedef struct phNfc_sSupProtocol_t
 {
-    unsigned int MifareUL    : 1;  /**< Protocol Mifare Ultra Light or
+    unsigned int MifareUL    : 1;  /**< Protocol Mifare Ultra Light or \r
                                    any NFC Forum Type-2 tags */
     unsigned int MifareStd   : 1;  /**< Protocol Mifare Standard. */
     unsigned int ISO14443_4A : 1;  /**< Protocol ISO14443-4 Type A.  */
@@ -328,11 +328,11 @@ typedef struct phNfc_sSupProtocol_t
  *  \brief Information related to the NFC Device
  *
  *  The <em> Device Information Structure </em> holds information
- *  related to the NFC IC read during initialization time.
+ *  related to the NFC IC read during initialization time. \r
  *  It allows the caller firware, hardware version, the model id,
- *  HCI verison supported and vendor name. Refer to the NFC Device
+ *  HCI verison supported and vendor name. Refer to the NFC Device \r
  *  User Manual on how to interpret each of the values. In addition
- *  it also contains capabilities of the NFC Device such as the
+ *  it also contains capabilities of the NFC Device such as the \r
  *  protocols supported in Reader and emulation mode
  *
  */
@@ -353,10 +353,10 @@ typedef struct phNfc_sDeviceCapabilities_t
                                               Vendor name (Null terminated string)*/
     uint8_t                 full_version[NXP_FULL_VERSION_LEN];
 
-    phNfc_sSupProtocol_t    ReaderSupProtocol; /**< Supported protocols
+    phNfc_sSupProtocol_t    ReaderSupProtocol; /**< Supported protocols \r
                                                       (Bitmapped) in Reader mode. */
     phNfc_sSupProtocol_t    EmulationSupProtocol;    /**< Supported protocols
-                                                       (Bitmapped) in Emulation
+                                                       (Bitmapped) in Emulation \r
                                                         mode. */
     char                    firmware_update_info; /** */
 } phNfc_sDeviceCapabilities_t;
@@ -377,79 +377,79 @@ typedef struct phNfc_sDeviceCapabilities_t
 typedef enum phNfc_eMifareCmdList_t
 {
     phNfc_eMifareRaw        = 0x00U,     /**< This command performs raw transcations .
-                                              Format of the phLibNfc_sTransceiveInfo_t
-                                              content in this case shall be as below:
-                                                ?  cmd: filed shall set to  phHal_eMifareRaw .
-                                                ?  addr : doesn't carry any significance.
-                                                ?  sSendData : Shall contain formatted raw buffer
-                                                                based on MIFARE commands type used.
-                                                                Formatted buffer shall follow below
+                                              Format of the phLibNfc_sTransceiveInfo_t \r
+                                              content in this case shall be as below: \r
+                                                \95   cmd: filed shall set to  phHal_eMifareRaw . \r
+                                                \95   addr : doesn't carry any significance.\r
+                                                \95   sSendData : Shall contain formatted raw buffer \r
+                                                                based on MIFARE commands type used. \r
+                                                                Formatted buffer shall follow below \r
                                                                 formating scheme.
-
\r
                                               CmdType+ Block No + CommandSpecific data + 2 byte CRC
-                                              Ex: With  Write  4 byte command  on block 8  looks as
-                                              " 0xA2,0x08,0x01,0x02,0x03,0x04,CRC1,CRC2
-                                              Note :  For MIFARE Std card we recommend use MIFARE
+                                              Ex: With  Write  4 byte command  on block 8  looks as \r
+                                              " 0xA2,0x08,0x01,0x02,0x03,0x04,CRC1,CRC2 \r
+                                              Note :  For MIFARE Std card we recommend use MIFARE \r
                                                       commands directly.
                                            */
     phNfc_eMifareAuthentA   = 0x60U,     /**< Mifare Standard:\n
                                               This command performs an authentication with KEY A for a sector.\n
-                                              Format of the phLibNfc_sTransceiveInfo_t content in this case is :
-                                                ?      cmd: field shall set to  phHal_eMifareAuthentA .
-                                                ?      addr : indicates MIFARE block address.
+                                              Format of the phLibNfc_sTransceiveInfo_t content in this case is : \r
+                                                \95       cmd: field shall set to  phHal_eMifareAuthentA . \r
+                                                \95       addr : indicates MIFARE block address. \r
                                                            Ex: 0x08 indicates block 8 needs to be authenticated.
-                                                ?      sSendData : Shall contain authentication key values.
-                                                                    sSendData ,buffer shall contain authentication
-                                                                    key values 01 02 03 04 05 06 authenticates
-                                                                    block 08 with the key 0x01[..]06. If this
-                                                                    command fails, then  user needs to reactivate
-                                                                    the remote Mifare card.
+                                                \95       sSendData : Shall contain authentication key values. \r
+                                                                    sSendData ,buffer shall contain authentication \r
+                                                                    key values 01 02 03 04 05 06 authenticates \r
+                                                                    block 08 with the key 0x01[..]06. If this \r
+                                                                    command fails, then  user needs to reactivate \r
+                                                                    the remote Mifare card.                                            \r
                                           */
     phNfc_eMifareAuthentB   = 0x61U,     /**< Mifare Standard:\n
                                               This command performs an authentication with KEY B for a sector.\n
-                                              Format of the phLibNfc_sTransceiveInfo_t content in this case is :
-                                                ?      cmd: field shall set to  phHal_eMifareAuthentB .
-                                                ?      addr : indicates MIFARE block address.
+                                              Format of the phLibNfc_sTransceiveInfo_t content in this case is : \r
+                                                \95       cmd: field shall set to  phHal_eMifareAuthentB . \r
+                                                \95       addr : indicates MIFARE block address. \r
                                                            Ex: 0x08 indicates block 8 needs to be authenticated.
-                                                ?      sSendData : Shall contain authentication key values.
-                                                                    sSendData ,buffer shall contain authentication
-                                                                    key values 01 02 03 04 05 06 authenticates
-                                                                    block 08 with the key 0x01[..]06. If this
-                                                                    command fails, then  user needs to reactivate
-                                                                    the remote Mifare card.
+                                                \95       sSendData : Shall contain authentication key values. \r
+                                                                    sSendData ,buffer shall contain authentication \r
+                                                                    key values 01 02 03 04 05 06 authenticates \r
+                                                                    block 08 with the key 0x01[..]06. If this \r
+                                                                    command fails, then  user needs to reactivate \r
+                                                                    the remote Mifare card.   \r
                                           */
     phNfc_eMifareRead16     = 0x30U,     /**< Mifare Standard and Ultra Light:\n
                                               Read 16 Bytes from a Mifare Standard block or 4 Mifare Ultra Light pages.\n
-                                              Format of the phLibNfc_sTransceiveInfo_t content in this case is :
-                                                ?      cmd: field shall set to  phHal_eMifareRead16 .
-                                                ?      addr : memory adress to read.
-                                                ?      sRecvData : Shall contain buffer of size 16
-                                                                    to read the data into.
+                                              Format of the phLibNfc_sTransceiveInfo_t content in this case is : \r
+                                                \95       cmd: field shall set to  phHal_eMifareRead16 . \r
+                                                \95       addr : memory adress to read.   \r
+                                                \95       sRecvData : Shall contain buffer of size 16 \r
+                                                                    to read the data into.                                                                  \r
 
-                                              If this command fails, the user needs to reactivate the
+                                              If this command fails, the user needs to reactivate the \r
                                               the remote Mifare card
                                           */
     phNfc_eMifareRead       = 0x30U,
     phNfc_eMifareWrite16    = 0xA0U,     /**< Mifare Standard and Ultra Light:\n
                                               Write 16 Bytes to a Mifare Standard block or 4 Mifare Ultra Light pages.\n
-                                              Format of the phLibNfc_sTransceiveInfo_t content in this case is :
-                                                ?      cmd: field shall set to  phHal_eMifareWrite16 .
-                                                ?      addr : starting memory adress to write from.
-                                                ?      sSendData : Shall contain buffer of size 16 containing
-                                                                    the data bytes to be written.
-
-                                              If this command fails, the user needs to reactivate the
+                                              Format of the phLibNfc_sTransceiveInfo_t content in this case is : \r
+                                                \95       cmd: field shall set to  phHal_eMifareWrite16 . \r
+                                                \95       addr : starting memory adress to write from.   \r
+                                                \95       sSendData : Shall contain buffer of size 16 containing\r
+                                                                    the data bytes to be written.                                                                  \r
+                                             \r
+                                              If this command fails, the user needs to reactivate the \r
                                               the remote Mifare card
                                            */
     phNfc_eMifareWrite4     = 0xA2U,     /**< Mifare Ultra Light:\n
                                               Write 4 bytes.\n
-                                              Format of the phLibNfc_sTransceiveInfo_t content in this case is :
-                                                ?      cmd: field shall set to  phHal_eMifareWrite4 .
-                                                ?      addr : starting memory adress to write from.
-                                                ?      sSendData : Shall contain buffer of size 4 containing
-                                                                    the data bytes to be written.
+                                              Format of the phLibNfc_sTransceiveInfo_t content in this case is : \r
+                                                \95       cmd: field shall set to  phHal_eMifareWrite4 . \r
+                                                \95       addr : starting memory adress to write from.   \r
+                                                \95       sSendData : Shall contain buffer of size 4 containing\r
+                                                                    the data bytes to be written.                                                                  \r
 
-                                              If this command fails, the user needs to reactivate the
+                                              If this command fails, the user needs to reactivate the \r
                                               the remote Mifare card
                                           */
     phNfc_eMifareInc        = 0xC1U,     /**< Increment. */
@@ -472,7 +472,7 @@ typedef enum phNfc_eMifareCmdList_t
 typedef enum phNfc_eIso14443_4_CmdList_t
 {
     phNfc_eIso14443_4_Raw             = 0x00U /**< ISO 14443-4 Exchange command:\n
-                                                 - This command sends the data buffer directly
+                                                 - This command sends the data buffer directly \r
                                                  to the remote device */
 
 } phNfc_eIso14443_4_CmdList_t;
@@ -488,7 +488,7 @@ typedef enum phNfc_eIso14443_4_CmdList_t
 typedef enum phNfc_eNfcIP1CmdList_t
 {
        phNfc_eNfcIP1_Raw             = 0x00U /**< NfcIP Exchange command:\n
-                                                 - This command sends the data buffer directly
+                                                 - This command sends the data buffer directly \r
                                                   to the remote device */
 }phNfc_eNfcIP1CmdList_t;
 
@@ -504,11 +504,11 @@ typedef enum phNfc_eIso15693_CmdList_t
 {
 #if 0
     phNfc_eIso15693_Raw             = 0x00U, /**< ISO 15693 Exchange Raw command:\n
-                                                 - This command sends the data buffer directly
+                                                 - This command sends the data buffer directly \r
                                                  to the remote device */
 #endif
     phNfc_eIso15693_Cmd             = 0x20U, /**< ISO 15693 Exchange command:\n
-                                                 - This command is used to access the card
+                                                 - This command is used to access the card \r
                                                  to the remote device */
     phNfc_eIso15693_Invalid         = 0xFFU      /**< Invalid Command */
 } phNfc_eIso15693_CmdList_t;
@@ -524,7 +524,7 @@ typedef enum phNfc_eIso15693_CmdList_t
 typedef enum phNfc_eFelicaCmdList_t
 {
     phNfc_eFelica_Raw             = 0xF0U, /**< Felica Raw command:\n
-                                                 - This command sends the data buffer directly
+                                                 - This command sends the data buffer directly \r
                                                  to the remote device */
     phNfc_eFelica_Check           = 0x00, /**< Felica Check command:\n
                                                  - This command checks the data from the Felica
@@ -546,7 +546,7 @@ typedef enum phNfc_eFelicaCmdList_t
 typedef enum phNfc_eJewelCmdList_t
 {
     phNfc_eJewel_Raw            = 0x00U, /**< Jewel command:\n
-                                                 - This command sends the data buffer directly
+                                                 - This command sends the data buffer directly \r
                                                  to the remote device */
     phNfc_eJewel_Invalid        = 0xFFU  /**< Invalid jewel command */
 }phNfc_eJewelCmdList_t;
@@ -554,10 +554,10 @@ typedef enum phNfc_eJewelCmdList_t
 
 /** \ingroup grp_hal_nfci
 *
-*  \brief Remote Device Reader A RF Gate Information Container
+*  \brief Remote Device Reader A RF Gate Information Container \r
 *
 *  The <em> Reader A structure </em> includes the available information
-*  related to the discovered ISO14443A remote device. This information
+*  related to the discovered ISO14443A remote device. This information \r
 *  is updated for every device discovery.
 *  \note None.
 *
@@ -566,11 +566,11 @@ typedef struct phNfc_sIso14443AInfo_t
 {
     uint8_t         Uid[PHHAL_MAX_UID_LENGTH];      /**< UID information of the TYPE A
                                                        Tag Discovered */
-    uint8_t         UidLength;                      /**< UID information length, shall not be greater
+    uint8_t         UidLength;                      /**< UID information length, shall not be greater \r
                                                     than PHHAL_MAX_UID_LENGTH i.e., 10 */
-    uint8_t         AppData[PHHAL_MAX_ATR_LENGTH]; /**< Application data information of the
-                                                        tag discovered (= Historical bytes for
-                                                        type A) */
+    uint8_t         AppData[PHHAL_MAX_ATR_LENGTH]; /**< Application data information of the \r
+                                                        tag discovered (= Historical bytes for \r
+                                                        type A) */  \r
     uint8_t         AppDataLength;                  /**< Application data length */
     uint8_t         Sak;                            /**< SAK informationof the TYPE A
                                                        Tag Discovered */
@@ -578,23 +578,23 @@ typedef struct phNfc_sIso14443AInfo_t
                                                        Tag Discovered */
     uint8_t         MaxDataRate;                    /**< Maximum data rate supported by the TYPE A
                                                        Tag Discovered */
-    uint8_t         Fwi_Sfgt;                       /**< Frame waiting time and start up frame guard
-                                                    time as defined in ISO/IEC 14443-4[7] for
+    uint8_t         Fwi_Sfgt;                       /**< Frame waiting time and start up frame guard \r
+                                                    time as defined in ISO/IEC 14443-4[7] for \r
                                                     type A */
 } phNfc_sIso14443AInfo_t;
 
 
 /** \ingroup grp_hal_nfci
 *
-*  \brief Remote Device Reader B RF Gate Information Container
+*  \brief Remote Device Reader B RF Gate Information Container \r
 *
 *  The <em> Reader B structure </em> includes the available information
-*  related to the discovered ISO14443B remote device. This information
+*  related to the discovered ISO14443B remote device. This information \r
 *  is updated for every device discovery.
 *  \note None.
 *
 */
-typedef struct phNfc_sIso14443BInfo_t
+typedef struct phNfc_sIso14443BInfo_t \r
 {
     union phNfc_uAtqBInfo
     {
@@ -610,8 +610,8 @@ typedef struct phNfc_sIso14443BInfo_t
         uint8_t         AtqRes[PHHAL_ATQB_LENGTH];          /**< ATQB Response Information of TYPE B
                                                                 Tag Discovered */
     } AtqB;
-    uint8_t         HiLayerResp[PHHAL_MAX_ATR_LENGTH];  /**< Higher Layer Response information
-                                                             in answer to ATRRIB Command for Type B */
+    uint8_t         HiLayerResp[PHHAL_MAX_ATR_LENGTH];  /**< Higher Layer Response information  \r
+                                                             in answer to ATRRIB Command for Type B */  \r
     uint8_t         HiLayerRespLength;                  /**< Higher Layer Response length */
     uint8_t         Afi;                                /**< Application Family Identifier of TYPE B
                                                                 Tag Discovered */
@@ -622,10 +622,10 @@ typedef struct phNfc_sIso14443BInfo_t
 
 /** \ingroup grp_hal_nfci
 *
-*  \brief Remote Device Reader B prime RF Gate Information Container
+*  \brief Remote Device Reader B prime RF Gate Information Container \r
 *
 */
-typedef struct phNfc_sIso14443BPrimeInfo_t
+typedef struct phNfc_sIso14443BPrimeInfo_t \r
 {
     /* TODO: This will be updated later */
     void *BPrimeCtxt;
@@ -634,19 +634,19 @@ typedef struct phNfc_sIso14443BPrimeInfo_t
 
 /** \ingroup grp_hal_nfci
 *
-*  \brief Remote Device Jewel Reader RF Gate Information Container
+*  \brief Remote Device Jewel Reader RF Gate Information Container \r
 *
 *  The <em> Jewel Reader structure </em> includes the available information
-*  related to the discovered Jewel remote device. This information
+*  related to the discovered Jewel remote device. This information \r
 *  is updated for every device discovery.
 *  \note None.
 *
 */
-typedef struct phNfc_sJewelInfo_t
+typedef struct phNfc_sJewelInfo_t \r
 {
     uint8_t         Uid[PHHAL_MAX_UID_LENGTH];      /**< UID information of the TYPE A
                                                          Tag Discovered */
-    uint8_t         UidLength;                      /**< UID information length, shall not be greater
+    uint8_t         UidLength;                      /**< UID information length, shall not be greater \r
                                                     than PHHAL_MAX_UID_LENGTH i.e., 10 */
     uint8_t         HeaderRom0; /**< Header Rom byte zero */
     uint8_t         HeaderRom1; /**< Header Rom byte one */
@@ -656,10 +656,10 @@ typedef struct phNfc_sJewelInfo_t
 
 /** \ingroup grp_hal_nfci
 *
-*  \brief Remote Device Felica Reader RF Gate Information Container
+*  \brief Remote Device Felica Reader RF Gate Information Container \r
 *
 *  The <em> Felica Reader structure </em> includes the available information
-*  related to the discovered Felica remote device. This information
+*  related to the discovered Felica remote device. This information \r
 *  is updated for every device discovery.
 *  \note None.
 *
@@ -667,7 +667,7 @@ typedef struct phNfc_sJewelInfo_t
 typedef struct phNfc_sFelicaInfo_t
 {
     uint8_t     IDm[(PHHAL_FEL_ID_LEN + 2)];              /**< Current ID of Felica tag */
-    uint8_t     IDmLength;                          /**< IDm length, shall not be greater
+    uint8_t     IDmLength;                          /**< IDm length, shall not be greater \r
                                                     than PHHAL_FEL_ID_LEN i.e., 8 */
     uint8_t     PMm[PHHAL_FEL_PM_LEN];              /**< Current PM of Felica tag */
     uint8_t     SystemCode[PHHAL_FEL_SYS_CODE_LEN]; /**< System code of Felica tag */
@@ -676,10 +676,10 @@ typedef struct phNfc_sFelicaInfo_t
 
 /** \ingroup grp_hal_nfci
 *
-*  \brief Remote Device Reader 15693 RF Gate Information Container
+*  \brief Remote Device Reader 15693 RF Gate Information Container \r
 *
 *  The <em> Reader A structure </em> includes the available information
-*  related to the discovered ISO15693 remote device. This information
+*  related to the discovered ISO15693 remote device. This information \r
 *  is updated for every device discovery.
 *  \note None.
 *
@@ -689,7 +689,7 @@ typedef struct phNfc_sIso15693Info_t
 {
     uint8_t         Uid[PHHAL_15693_UID_LENGTH];      /**< UID information of the 15693
                                                        Tag Discovered */
-    uint8_t         UidLength;                      /**< UID information length, shall not be greater
+    uint8_t         UidLength;                      /**< UID information length, shall not be greater \r
                                                     than PHHAL_15693_UID_LENGTH i.e., 8 */
     uint8_t         Dsfid;                          /**< DSF information of the 15693
                                                        Tag Discovered */
@@ -704,7 +704,7 @@ typedef struct phNfc_sIso15693Info_t
 *
 *  \brief NFC Data Rate Supported between the Reader and the Target
 *
-*  The <em> \ref phHalNfc_eDataRate enum </em> lists all the Data Rate
+*  The <em> \ref phHalNfc_eDataRate enum </em> lists all the Data Rate \r
 *  values to be used to determine the rate at which the data is transmitted
 *  to the target.
 *
@@ -714,41 +714,41 @@ typedef struct phNfc_sIso15693Info_t
 
 /** \ingroup grp_hal_nfci
 *
-*  \brief NFCIP1 Data rates
+*  \brief NFCIP1 Data rates \r
 *
 */
 typedef enum phNfc_eDataRate_t{
-    phNfc_eDataRate_106    = 0x00U,
-    phNfc_eDataRate_212,
-    phNfc_eDataRate_424,
-    /* phNfc_eDataRate_848,
-    phNfc_eDataRate_1696,
-    phNfc_eDataRate_3392,
+    phNfc_eDataRate_106    = 0x00U, \r
+    phNfc_eDataRate_212, \r
+    phNfc_eDataRate_424, \r
+    /* phNfc_eDataRate_848, \r
+    phNfc_eDataRate_1696, \r
+    phNfc_eDataRate_3392, \r
     phNfc_eDataRate_6784,*/
-    phNfc_eDataRate_RFU
+    phNfc_eDataRate_RFU \r
 } phNfc_eDataRate_t;
 
 
 /** \ingroup grp_hal_nfci
 *
-*  \brief NFCIP1 Gate Information Container
+*  \brief NFCIP1 Gate Information Container \r
 *
 *  The <em> NFCIP1 structure </em> includes the available information
-*  related to the discovered NFCIP1 remote device. This information
+*  related to the discovered NFCIP1 remote device. This information \r
 *  is updated for every device discovery.
 *  \note None.
 *
 */
-typedef struct phNfc_sNfcIPInfo_t
+typedef struct phNfc_sNfcIPInfo_t \r
 {
-    /* Contains the random NFCID3I conveyed with the ATR_REQ.
-        always 10 bytes length
+    /* Contains the random NFCID3I conveyed with the ATR_REQ. \r
+        always 10 bytes length \r
         or contains the random NFCID3T conveyed with the ATR_RES.
         always 10 bytes length */
-    uint8_t         NFCID[PHHAL_MAX_UID_LENGTH];
+    uint8_t         NFCID[PHHAL_MAX_UID_LENGTH];    \r
     uint8_t         NFCID_Length;
     /* ATR_RES = General bytes length, Max length = 48 bytes */
-    uint8_t         ATRInfo[PHHAL_MAX_ATR_LENGTH];
+    uint8_t         ATRInfo[PHHAL_MAX_ATR_LENGTH];  \r
     uint8_t         ATRInfo_Length;
     /**< SAK information of the tag discovered */
     uint8_t         SelRes;
@@ -756,7 +756,7 @@ typedef struct phNfc_sNfcIPInfo_t
     uint8_t         SenseRes[PHHAL_ATQA_LENGTH];
     /**< Is Detection Mode of the NFCIP Target Active */
     uint8_t         Nfcip_Active;
-    /**< Maximum frame length supported by the NFCIP device */
+    /**< Maximum frame length supported by the NFCIP device */  \r
     uint16_t        MaxFrameLength;
     /**< Data rate supported by the NFCIP device */
     phNfc_eDataRate_t         Nfcip_Datarate;
@@ -792,7 +792,7 @@ typedef union phNfc_uRemoteDevInfo_t
 *
 *  The <em> RF Device Type List </em> is used to identify the type of
 *  remote device that is discovered/connected. There seperate
-*  types to identify a Remote Reader (denoted by _PCD) and
+*  types to identify a Remote Reader (denoted by _PCD) and \r
 *  Remote Tag (denoted by _PICC)
 *  \note None.
 *
@@ -826,8 +826,8 @@ typedef enum phNfc_eRFDevType_t
     phNfc_eISO15693_PICC,
 
     /* NFC-IP1 Device Types */
-    phNfc_eNfcIP1_Target,
-    phNfc_eNfcIP1_Initiator,
+    phNfc_eNfcIP1_Target, \r
+    phNfc_eNfcIP1_Initiator, \r
 
     /* Other Sources */
     phNfc_eInvalid_DevType
@@ -876,18 +876,18 @@ typedef union phNfc_uCommand_t
  *  Device detected by the polling function .\n
  *  It lists parameters common to all supported remote devices.
  *
- *  \note
+ *  \note \r
  *
  *  \sa \ref phHal4Nfc_ConfigureDiscovery and \ref phHal4Nfc_Connect
  *
  */
 typedef struct phNfc_sRemoteDevInformation_t
 {
-    uint8_t                    SessionOpened;       /**< [out] Boolean
+    uint8_t                    SessionOpened;       /**< [out] Boolean \r
                                                      *   Flag indicating the validity of
                                                      *   the handle of the remote device. */
-    phNfc_eRemDevType_t        RemDevType;          /**< [out] Remote device type which says that remote
-                                                    is Reader A or Reader B or NFCIP or Felica or
+    phNfc_eRemDevType_t        RemDevType;          /**< [out] Remote device type which says that remote \r
+                                                    is Reader A or Reader B or NFCIP or Felica or \r
                                                     Reader B Prime or Jewel*/
     phNfc_uRemoteDevInfo_t     RemoteDevInfo;       /**< Union of available Remote Device.
                                                      *   \ref phNfc_uRemoteDevInfo_t Information.  */
@@ -900,10 +900,10 @@ typedef struct phNfc_sRemoteDevInformation_t
 
 /** \ingroup  grp_hal_common
  *
- *  \brief Transceive Information Data Structure for sending commands/response
+ *  \brief Transceive Information Data Structure for sending commands/response \r
  *         to the remote device
  *
- *  The <em> Transceive Information Data Structure </em> is used to pass the
+ *  The <em> Transceive Information Data Structure </em> is used to pass the \r
  *  Command, Address (only required for MIFARE) and the send and receive data
  *  data structure (buffer and length) for communication with remote device
  *
@@ -929,8 +929,8 @@ typedef struct phNfc_sTransceiveInfo_t
 *  \brief Poll Device Information for conifiguring the discovery wheel
           Reader and Card Emulation Phases
 *
-*  The <em> \ref phNfc_sPollDevInfo_t enum </em> is used to enable/disable
-*  phases of the discovery wheel related to specific reader types and
+*  The <em> \ref phNfc_sPollDevInfo_t enum </em> is used to enable/disable \r
+*  phases of the discovery wheel related to specific reader types and \r
 *  card emulation phase
 *  \note Enabling specific Reader technology when NFCIP1 speed is set in the
 *        phNfc_sADD_Cfg_t is implicitly done in HAL. Use this structure to only
@@ -938,23 +938,23 @@ typedef struct phNfc_sTransceiveInfo_t
 */
 typedef struct phNfc_sPollDevInfo_t
 {
-    unsigned                    EnableIso14443A : 1;      /**< Flag to enable
+    unsigned                    EnableIso14443A : 1;      /**< Flag to enable \r
                                                         Reader A discovery */
-    unsigned                    EnableIso14443B : 1;      /**< Flag to enable
+    unsigned                    EnableIso14443B : 1;      /**< Flag to enable \r
                                                         Reader B discovery */
     unsigned                    EnableFelica212 : 1;   /**< Flag to enable
                                                         Felica 212 discovery */
     unsigned                    EnableFelica424 : 1;   /**< Flag to enable
                                                         Felica 424 discovery */
-    unsigned                    EnableIso15693 : 1;     /**< Flag to enable
+    unsigned                    EnableIso15693 : 1;     /**< Flag to enable \r
                                                         ISO 15693 discovery */
-    unsigned                    EnableNfcActive : 1; /**< Flag to enable
-                                                        Active Mode of NFC-IP discovery.
-                                                        This is updated internally
+    unsigned                    EnableNfcActive : 1; /**< Flag to enable \r
+                                                        Active Mode of NFC-IP discovery. \r
+                                                        This is updated internally \r
                                                         based on the NFC-IP speed.
                                                         */
     unsigned                    RFU : 1;                /**< Reserved for future use */
-    unsigned                    DisableCardEmulation : 1;    /**< Flag to
+    unsigned                    DisableCardEmulation : 1;    /**< Flag to \r
                                                             disable the card emulation */
 } phNfc_sPollDevInfo_t;
 
@@ -963,7 +963,7 @@ typedef struct phNfc_sPollDevInfo_t
 *
 *  \brief P2P speed for the Initiator
 *
-*  The <em> \ref phNfc_eP2PMode_t enum </em> lists all the NFCIP1 speeds
+*  The <em> \ref phNfc_eP2PMode_t enum </em> lists all the NFCIP1 speeds \r
 *  to be used for configuring the NFCIP1 discovery
 *
 *  \note None.
@@ -1002,7 +1002,7 @@ typedef enum phNfc_eNotificationType_t
 
 /** \ingroup grp_hal_common
 *
-*  \brief
+*  \brief \r
 *
 *  \note None.
 */
@@ -1026,11 +1026,11 @@ typedef struct phNfc_sUiccInfo_t
 *
 *  \note None.
 */
-typedef struct phNfc_sNfcIPCfg_t
+typedef struct phNfc_sNfcIPCfg_t \r
 {
     /* ATR_RES = General bytes length, Max length = 48 bytes */
     uint8_t         generalBytesLength;
-    uint8_t         generalBytes[PHHAL_MAX_ATR_LENGTH];
+    uint8_t         generalBytes[PHHAL_MAX_ATR_LENGTH];  \r
 
     /* TODO: This will be updated later for any additional params*/
 } phNfc_sNfcIPCfg_t;
@@ -1041,19 +1041,19 @@ typedef struct phNfc_sNfcIPCfg_t
 *  \brief Discovery Configuration Mode
 *
 *  This enumeration is used to choose the Discovery Configuration
-*  Mode :- Configure and Start, Stop or Start with last set
+*  Mode :- Configure and Start, Stop or Start with last set \r
 *  configuration
 *  \note None.
 */
 typedef enum phNfc_eDiscoveryConfigMode_t
 {
-    NFC_DISCOVERY_CONFIG  = 0x00U,/**< Configure discovery with values
-                                       in phNfc_sADD_Cfg_t and start
+    NFC_DISCOVERY_CONFIG  = 0x00U,/**< Configure discovery with values \r
+                                       in phNfc_sADD_Cfg_t and start \r
                                        discovery */
     NFC_DISCOVERY_START,         /**< Start Discovery with previously set
                                       configuration */
     NFC_DISCOVERY_STOP,          /**< Stop the Discovery */
-    NFC_DISCOVERY_RESUME       /**< Resume the Discovery with previously
+    NFC_DISCOVERY_RESUME       /**< Resume the Discovery with previously \r
                                    *  set configuration.
                                    *  This is valid only when the Target
                                    *  is not connected.
@@ -1064,14 +1064,14 @@ typedef enum phNfc_eDiscoveryConfigMode_t
 *
 *  \brief Target or Tag Release Mode
 *
-*  This enumeration defines various modes of releasing an acquired target
+*  This enumeration defines various modes of releasing an acquired target \r
 *  or tag.
 *  \note None.
 */
 typedef enum phNfc_eReleaseType_t
 {
     NFC_INVALID_RELEASE_TYPE    =0x00U,/**<Invalid release type */
-    NFC_DISCOVERY_RESTART,      /**< Release current target and
+    NFC_DISCOVERY_RESTART,      /**< Release current target and \r
                                      restart discovery within same technology*/
     NFC_DISCOVERY_CONTINUE,    /**< Release current target and continue
                                     discovery with next technology in the wheel */
@@ -1083,8 +1083,8 @@ typedef enum phNfc_eReleaseType_t
 *
 *  \brief Poll configuration structure
 *
-*  The <em> Poll configuration structure </em> holds information about the
-*  enabling the the type of discovery required by the application. This
+*  The <em> Poll configuration structure </em> holds information about the \r
+*  enabling the the type of discovery required by the application. This \r
 *  structure is the input parameter for the discovery call
 *
 *  \note All members of this structure are input parameters [out].
@@ -1094,27 +1094,27 @@ typedef enum phNfc_eReleaseType_t
 */
 typedef struct phNfc_sADD_Cfg_t
 {
-    union
+    union \r
     {
-        phNfc_sPollDevInfo_t        PollCfgInfo;        /**<  Enable/Disable Specific
-                                                              Reader Functionality and
-                                                              Card Emulation */
+        phNfc_sPollDevInfo_t        PollCfgInfo;        /**<  Enable/Disable Specific \r
+                                                              Reader Functionality and \r
+                                                              Card Emulation */ \r
         unsigned                    PollEnabled;     /** Can be used to set polling 'Off'
                                                       by setting PollEnabled to zero */
 
     } PollDevInfo;
-    uint32_t                    Duration;           /**< Duration of virtual or idle
+    uint32_t                    Duration;           /**< Duration of virtual or idle \r
                                                     period in microseconds in the step size
                                                     of 48 microseconds.If duration is set less
                                                     than  48 microseconds then default value is
-                                                    used.For more details please refer PN 544
+                                                    used.For more details please refer PN 544 \r
                                                     user manual*/
     uint8_t                     NfcIP_Mode ;      /**< Select the P2P
                                                     speeds using phNfc_eP2PMode_t type.
-                                                    This is used to enable NFC-IP Discovery
+                                                    This is used to enable NFC-IP Discovery \r
                                                     The related Reader Type will be implicitly
                                                     selected */
-    uint8_t                     NfcIP_Tgt_Disable;   /**< Flag to
+    uint8_t                     NfcIP_Tgt_Disable;   /**< Flag to \r
                                                    disable the NFCIP1 TARGET */
 } phNfc_sADD_Cfg_t;
 
index a991452..908f3d7 100644 (file)
@@ -387,7 +387,7 @@ typedef phLibNfc_sConfig_t *pphDal4Nfc_sConfig_t;
  * This asynchronous function reads the data from the driver in which length\r
  * and the required buffer are sent by upper layer. This interface enables\r
  * reader thread in case there is no read requests pending and returns sucessfully.\r
- * Once read operation is complete, it notifies  to upper layer through callback\r
+ * Once read operation is complete, it notifies  to upper layer through callback \r
  * registered in the \b \e phDal4Nfc_Register() function.\r
  *\r
  *\r
@@ -443,10 +443,10 @@ typedef phLibNfc_sConfig_t *pphDal4Nfc_sConfig_t;
  * \brief Allows to wait before reading data block from HW Interface.\r
  *\r
  * This asynchronous function waits before reading the data from the\r
- * driver in which length  and the required buffer are sent by upper layer.\r
+ * driver in which length  and the required buffer are sent by upper layer.  \r
  * This interface  enables reader thread  to wait for predefined time period\r
- * (predefined time period is configurable by the DAL implementer) to complete\r
- * read request.Once read operation is complete, it notifies to upper layer\r
+ * (predefined time period is configurable by the DAL implementer) to complete  \r
+ * read request.Once read operation is complete, it notifies to upper layer \r
  * through callback registered in the \b \e phDal4Nfc_Register()\r
  * function. Read request is expected to get complete within this time.\r
  *\r
@@ -558,7 +558,7 @@ typedef phLibNfc_sConfig_t *pphDal4Nfc_sConfig_t;
  * sends the HANDLE to the caller.\r
  *\r
  * \param[in]       config     DAL configuration details as provided\r
- *                             by the upper layer.\r
+ *                             by the upper layer. \r
  * \param[in,out]   phwref     pointer to which valid Handle to DAL\r
  *                             interface is assigned.\r
  *\r
@@ -589,7 +589,7 @@ typedef phLibNfc_sConfig_t *pphDal4Nfc_sConfig_t;
  *\r
  * \brief Release configuration for the given HW Interface.\r
  *\r
- * \copydoc page_reg Release all the variables of the DAL component, that has been\r
+ * \copydoc page_reg Release all the variables of the DAL component, that has been \r
  *      initialised in \b phDal4Nfc_Config function (Synchronous function).\r
  *\r
  * \param[in] pHwRef            Link information of the hardware\r
@@ -610,20 +610,20 @@ typedef phLibNfc_sConfig_t *pphDal4Nfc_sConfig_t;
  *UpperLayer=>phDal4Nfc [label="phDal4Nfc_Shutdown()",URL="\ref        phDal4Nfc_Shutdown"];\r
  *UpperLayer<<phDal4Nfc [label="NFCSTATUS_SUCCESS"];\r
  *ClientApp=>phDal4Nfc [label="phDal4Nfc_ConfigRelease()",URL="\ref phDal4Nfc_ConfigRelease"];\r
- *ClientApp<<phDal4Nfc [label="NFCSTATUS_SUCCESS"];\r
+ *ClientApp<<phDal4Nfc [label="NFCSTATUS_SUCCESS"]; \r
  *\endmsc\r
  */\r
-extern\r
-NFCSTATUS\r
+extern \r
+NFCSTATUS \r
 phDal4Nfc_ConfigRelease(\r
     void        *pHwRef);\r
 \r
-extern\r
-NFCSTATUS\r
+extern \r
+NFCSTATUS \r
 phDal4Nfc_Reset(long level);\r
 \r
-extern\r
-NFCSTATUS\r
+extern \r
+NFCSTATUS \r
 phDal4Nfc_Download();\r
 \r
 /******************** Function declarations *************************/\r
index 55d1f96..d129b26 100644 (file)
@@ -103,8 +103,6 @@ extern char phOsalNfc_DbgTraceBuffer[];
 \r
 #define NXP_FW_MIN_TX_RX_LEN     0x0AU\r
 \r
-#define NFC_TIMER_CONTEXT\r
-\r
 \r
 #if defined( NXP_FW_MAX_TX_RX_LEN ) && \\r
      ( NXP_FW_MAX_TX_RX_LEN > NXP_FW_MIN_TX_RX_LEN )\r
@@ -526,7 +524,7 @@ typedef struct phDnldNfc_sContext
          * to compare the written data */\r
     phNfc_sData_t               dnld_store;\r
 \r
-    /** \internal Previously downloaded trimmed data stored\r
+    /** \internal Previously downloaded trimmed data stored  \r
          * to compare the written data */\r
     phNfc_sData_t               trim_store;\r
 \r
@@ -804,16 +802,16 @@ phDnldNfc_ComputeCrc16(
 #define CRC32_POLYNOMIAL     0xEDB88320L\r
 \r
 static uint32_t CRC32Table[0x100];\r
-\r
\r
 void BuildCRCTable()\r
 {\r
     unsigned long crc;\r
     uint8_t i = 0, j = 0;\r
-\r
-    for ( i = 0; i <= 0xFF ; i++ )\r
\r
+    for ( i = 0; i <= 0xFF ; i++ ) \r
     {\r
         crc = i;\r
-        for ( j = 8 ; j> 0; j-- )\r
+        for ( j = 8 ; j> 0; j-- ) \r
         {\r
             if ( crc & 1 )\r
             {\r
@@ -833,13 +831,13 @@ void BuildCRCTable()
 * table lookup method. It accepts an original value for the crc,\r
 * and returns the updated value.\r
 */\r
-\r
\r
 uint32_t CalculateCRC32( void *buffer , uint32_t count, uint32_t crc )\r
 {\r
     uint8_t *p;\r
     uint32_t temp1;\r
     uint32_t temp2;\r
-\r
\r
     p = (uint8_t *) buffer;\r
     while ( count-- != 0 ) {\r
         temp1 = ( crc>> 8 ) & 0x00FFFFFFL;\r
@@ -1432,7 +1430,7 @@ phDnldNfc_Process_Write(
                                  ,psDnldContext->dnld_store.length);\r
                 p_sec_info->section_read = FALSE;\r
                 p_sec_info->section_write = FALSE;\r
-                DNLD_DEBUG(" FW_DNLD: %X Bytes Write Complete ",\r
+                DNLD_DEBUG(" FW_DNLD: %X Bytes Write Complete ", \r
                                     psDnldContext->dnld_store.length);\r
                 DNLD_DEBUG(" Comparison Status %X\n", cmp_val);\r
             }\r
@@ -1529,7 +1527,7 @@ phDnldNfc_Process_Write(
 \r
 /*\r
 if(bit 0 of 0x813D is equal to 1) then\r
-\r
+   \r
    Do not overwrite 0x9931 / 0x9981 during download\r
 \r
 else\r
@@ -1537,25 +1535,25 @@ else
    @0x9931 = 0x79 // card Mode\r
    @0x9981 = 0x79 // Reader Mode\r
 */\r
-                trim_addr = p_sec_info->p_sec_hdr->section_address\r
+                trim_addr = p_sec_info->p_sec_hdr->section_address \r
                                     + p_sec_info->p_trim_data[i+1];\r
                 if (NXP_FW_VMID_TRIM_CHK_ADDR == trim_addr)\r
                 {\r
-                    psDnldContext->vmid_trim_update =\r
+                    psDnldContext->vmid_trim_update = \r
                             p_sm_trim_data[p_sec_info->p_trim_data[i+1]] ;\r
                 }\r
 \r
-                if((NXP_FW_VMID_CARD_MODE_ADDR == trim_addr)\r
+                if((NXP_FW_VMID_CARD_MODE_ADDR == trim_addr) \r
                         || (NXP_FW_VMID_RD_MODE_ADDR == trim_addr))\r
                 {\r
-                    if (TRUE == psDnldContext->vmid_trim_update)\r
+                    if (TRUE == psDnldContext->vmid_trim_update) \r
                     {\r
                         dnld_data->data_packet[p_sec_info->p_trim_data[i+1]] =\r
                                 p_sm_trim_data[p_sec_info->p_trim_data[i+1]] ;\r
                     }\r
                 }\r
                 else\r
-\r
+                     \r
 #endif\r
                 {\r
                     dnld_data->data_packet[p_sec_info->p_trim_data[i+1]] =\r
@@ -2303,7 +2301,7 @@ phDnldNfc_Raw_Write(
             {\r
                 if(TRUE != skip_frame)\r
                {\r
-                   psDnldContext->raw_mode_upgrade =\r
+                   psDnldContext->raw_mode_upgrade = \r
                        (psDnldContext->raw_mode_upgrade &\r
                               ~(frame_type & ~PHDNLD_MARKER_MASK));\r
                }\r
@@ -2494,9 +2492,9 @@ phDnldNfc_Resume(
 #if  (NXP_FW_INTEGRITY_CHK >= 0x01)\r
             uint8_t verify_crc = 0x96;\r
 \r
-            if ( (NULL != psDnldContext->p_flash_code_crc)\r
-                  && (NULL != psDnldContext->p_patch_code_crc)\r
-                   && (NULL != psDnldContext->p_patch_table_crc)\r
+            if ( (NULL != psDnldContext->p_flash_code_crc) \r
+                  && (NULL != psDnldContext->p_patch_code_crc) \r
+                   && (NULL != psDnldContext->p_patch_table_crc) \r
                   )\r
             {\r
                 uint8_t     crc_i = 0;\r
@@ -2519,11 +2517,11 @@ phDnldNfc_Resume(
                         | psDnldContext->chk_integrity_crc.patch_code.Chk_Crc32[crc_i]\r
                                 << (crc_i * BYTE_SIZE)  ;\r
                 }\r
-                verify_crc =(uint8_t)( (*((uint32_t *) psDnldContext->p_flash_code_crc)) !=\r
+                verify_crc =(uint8_t)( (*((uint32_t *) psDnldContext->p_flash_code_crc)) != \r
                           flash_code_crc );\r
-                verify_crc |=(uint8_t)( (*((uint32_t *) psDnldContext->p_patch_code_crc)) !=\r
+                verify_crc |=(uint8_t)( (*((uint32_t *) psDnldContext->p_patch_code_crc)) != \r
                           patch_code_crc );\r
-                verify_crc |=(uint8_t)( (*((uint16_t *) psDnldContext->p_patch_table_crc)) !=\r
+                verify_crc |=(uint8_t)( (*((uint16_t *) psDnldContext->p_patch_table_crc)) != \r
                           patch_table_crc );\r
             }\r
             else\r
@@ -2534,12 +2532,12 @@ phDnldNfc_Resume(
 \r
 #endif /* #if  (NXP_FW_INTEGRITY_CHK >= 0x01) */\r
 \r
-            integrity_chk = psDnldContext->chk_integrity_crc.config_page.Chk_status +\r
+            integrity_chk = psDnldContext->chk_integrity_crc.config_page.Chk_status + \r
                         psDnldContext->chk_integrity_crc.patch_table.Chk_status +\r
                         psDnldContext->chk_integrity_crc.flash_code.Chk_status +\r
                         psDnldContext->chk_integrity_crc.patch_code.Chk_status;\r
 \r
-            if ( ( 0 != integrity_chk )\r
+            if ( ( 0 != integrity_chk ) \r
 #if  (NXP_FW_INTEGRITY_CHK >= 0x01)\r
                 || ( 0 != verify_crc )\r
 #endif /* #if  (NXP_FW_INTEGRITY_CHK >= 0x01) */\r
@@ -2681,7 +2679,7 @@ phDnldNfc_Receive_Complete (
             /* Handle the Error Scenario */\r
             status = PHNFCSTVAL( CID_NFC_DNLD,  NFCSTATUS_FAILED );\r
         }\r
-        else if ((0 == length)\r
+        else if ((0 == length) \r
             || (PHDNLD_MIN_PACKET > length ))\r
         {\r
             DNLD_DEBUG(" Receive Response Length = %u .... \n",length);\r
@@ -2746,39 +2744,39 @@ phDnldNfc_Receive_Complete (
                                                               == psDnldContext->raw_mode_upgrade)\r
                                                        {\r
 #if  (NXP_FW_INTEGRITY_CHK >= 0x01)\r
-                            phDnldNfc_sChkCrcComplete_t *p_dnld_crc_all =\r
+                            phDnldNfc_sChkCrcComplete_t *p_dnld_crc_all = \r
                                 &psDnldContext->chk_integrity_crc;\r
                             switch(psDnldContext->chk_integrity_param)\r
                             {\r
                                 case CHK_INTEGRITY_CONFIG_PAGE_CRC:\r
                                 {\r
-                                    (void)memcpy(&p_dnld_crc_all->config_page,\r
-                                                (((uint8_t *)pdata) + PHDNLD_MIN_PACKET), resp_length);\r
+                                    (void)memcpy(&p_dnld_crc_all->config_page,  \r
+                                                (((uint8_t *)pdata) + PHDNLD_MIN_PACKET), resp_length); \r
                                     break;\r
                                 }\r
                                 case CHK_INTEGRITY_PATCH_TABLE_CRC:\r
                                 {\r
-                                    (void)memcpy(&p_dnld_crc_all->patch_table,\r
-                                                (((uint8_t *)pdata) + PHDNLD_MIN_PACKET), resp_length);\r
+                                    (void)memcpy(&p_dnld_crc_all->patch_table,  \r
+                                                (((uint8_t *)pdata) + PHDNLD_MIN_PACKET), resp_length); \r
                                     break;\r
                                 }\r
                                 case CHK_INTEGRITY_FLASH_CODE_CRC:\r
                                 {\r
-                                    (void)memcpy(&p_dnld_crc_all->flash_code,\r
-                                                (((uint8_t *)pdata) + PHDNLD_MIN_PACKET), resp_length);\r
+                                    (void)memcpy(&p_dnld_crc_all->flash_code,  \r
+                                                (((uint8_t *)pdata) + PHDNLD_MIN_PACKET), resp_length); \r
                                     break;\r
                                 }\r
                                 case CHK_INTEGRITY_PATCH_CODE_CRC:\r
                                 {\r
-                                    (void)memcpy(&p_dnld_crc_all->patch_code,\r
-                                                (((uint8_t *)pdata) + PHDNLD_MIN_PACKET), resp_length);\r
+                                    (void)memcpy(&p_dnld_crc_all->patch_code,  \r
+                                                (((uint8_t *)pdata) + PHDNLD_MIN_PACKET), resp_length); \r
                                     break;\r
                                 }\r
                                 case CHK_INTEGRITY_COMPLETE_CRC:\r
                                 {\r
                                     (void)memcpy(p_dnld_crc_all,\r
-                                            (((uint8_t *)pdata) + PHDNLD_MIN_PACKET), resp_length);\r
-                                    DNLD_DEBUG(" FW_DNLD: Check Integrity Complete Structure Size  = %X \n",\r
+                                            (((uint8_t *)pdata) + PHDNLD_MIN_PACKET), resp_length); \r
+                                    DNLD_DEBUG(" FW_DNLD: Check Integrity Complete Structure Size  = %X \n", \r
                                                     sizeof(psDnldContext->chk_integrity_crc));\r
                                     break;\r
                                 }\r
@@ -3275,7 +3273,7 @@ phDnldNfc_Send_Command(
 #if  (NXP_FW_INTEGRITY_CHK >= 0x01)\r
             if ((NULL != params) && ( param_length > 0 ))\r
             {\r
-                psDnldContext->chk_integrity_param =\r
+                psDnldContext->chk_integrity_param = \r
                             (phDnldNfc_eChkCrc_t)(*(uint8_t *)params);\r
                 tx_length = param_length;\r
             }\r
@@ -3291,21 +3289,21 @@ phDnldNfc_Send_Command(
                 case CHK_INTEGRITY_CONFIG_PAGE_CRC:\r
                 case CHK_INTEGRITY_PATCH_TABLE_CRC:\r
                 {\r
-                    psDnldContext->resp_length = PHDNLD_MIN_PACKET\r
+                    psDnldContext->resp_length = PHDNLD_MIN_PACKET \r
                                          + CHECK_INTEGRITY_RESP_CRC16_LEN;\r
                     break;\r
                 }\r
                 case CHK_INTEGRITY_FLASH_CODE_CRC:\r
                 case CHK_INTEGRITY_PATCH_CODE_CRC:\r
                 {\r
-                    psDnldContext->resp_length = PHDNLD_MIN_PACKET\r
+                    psDnldContext->resp_length = PHDNLD_MIN_PACKET \r
                                         +  CHECK_INTEGRITY_RESP_CRC32_LEN;\r
                     break;\r
                 }\r
                 case CHK_INTEGRITY_COMPLETE_CRC:\r
                 default:\r
                 {\r
-                    psDnldContext->resp_length = PHDNLD_MIN_PACKET\r
+                    psDnldContext->resp_length = PHDNLD_MIN_PACKET \r
                                         +  CHECK_INTEGRITY_RESP_COMP_LEN;\r
                     break;\r
                 }\r
@@ -3363,7 +3361,7 @@ phDnldNfc_Check_FW(
             DNLD_PRINT(" FW_DNLD_CHK: Forceful Upgrade of the Firmware .... Required \n");\r
             status = NFCSTATUS_SUCCESS;\r
         }\r
-        else    if ( (pHwRef->device_info.fw_version >> (BYTE_SIZE * 2))\r
+        else    if ( (pHwRef->device_info.fw_version >> (BYTE_SIZE * 2)) \r
                 != ( cur_fw_hdr->fw_version >> (BYTE_SIZE * 2) ))\r
         {\r
             /* Check for the Compatible Romlib Version for the Hardware */\r
@@ -3552,24 +3550,24 @@ phDnldNfc_Process_FW(
                {\r
                    case DNLD_FW_CODE_ADDR:\r
                    {\r
-                       psDnldContext->p_flash_code_crc =\r
-                           p_cur_sec->p_sec_data\r
+                       psDnldContext->p_flash_code_crc = \r
+                           p_cur_sec->p_sec_data \r
                              + p_cur_sec->p_sec_hdr->section_length\r
                                 - DNLD_CRC32_SIZE;\r
                        break;\r
                    }\r
                    case DNLD_PATCH_CODE_ADDR:\r
                    {\r
-                       psDnldContext->p_patch_code_crc =\r
-                           p_cur_sec->p_sec_data\r
+                       psDnldContext->p_patch_code_crc = \r
+                           p_cur_sec->p_sec_data \r
                              + p_cur_sec->p_sec_hdr->section_length\r
                                 - DNLD_CRC32_SIZE;\r
                        break;\r
                    }\r
                    case DNLD_PATCH_TABLE_ADDR:\r
                    {\r
-                       psDnldContext->p_patch_table_crc =\r
-                           p_cur_sec->p_sec_data\r
+                       psDnldContext->p_patch_table_crc = \r
+                           p_cur_sec->p_sec_data \r
                              + p_cur_sec->p_sec_hdr->section_length\r
                                 - DNLD_CRC16_SIZE;\r
                        break;\r
@@ -3783,7 +3781,7 @@ phDnldNfc_Upgrade (
                     {\r
                         DNLD_PRINT("\n FW_DNLD: Initial Reset .... \n");\r
 \r
-#if defined(FW_DOWNLOAD_TIMER)\r
+#if defined(FW_DOWNLOAD_TIMER) \r
 \r
                         psDnldContext->timer_id = phOsalNfc_Timer_Create( );\r
 \r
@@ -3805,8 +3803,8 @@ phDnldNfc_Upgrade (
                 else if (NFCSTATUS_SUCCESS == PHNFCSTATUS(status))\r
                 {\r
 #if  defined (NXP_FW_INTEGRITY_VERIFY)\r
-                    /*\r
-                     * To check for the integrity if the firmware is already\r
+                    /* \r
+                     * To check for the integrity if the firmware is already \r
                      * Upgraded.\r
                      */\r
                     status = phDnldNfc_Send_Command( psDnldContext, pHwRef,\r
@@ -3815,13 +3813,13 @@ phDnldNfc_Upgrade (
                     {\r
                         DNLD_PRINT("\n FW_DNLD: Integrity Reset .... \n");\r
                         (void)phDnldNfc_Set_Seq(psDnldContext, DNLD_SEQ_COMPLETE);\r
-                        status = PHNFCSTVAL( CID_NFC_DNLD,\r
+                        status = PHNFCSTVAL( CID_NFC_DNLD, \r
                                         NFCSTATUS_PENDING );\r
-#if defined(FW_DOWNLOAD_TIMER)\r
+#if defined(FW_DOWNLOAD_TIMER) \r
                         psDnldContext->timer_id = phOsalNfc_Timer_Create( );\r
 #if (FW_DOWNLOAD_TIMER < 2)\r
                         phOsalNfc_Timer_Start( psDnldContext->timer_id,\r
-                                NXP_DNLD_COMPLETE_TIMEOUT,\r
+                                NXP_DNLD_COMPLETE_TIMEOUT, \r
                                 (ppCallBck_t) phDnldNfc_Abort\r
 #ifdef NFC_TIMER_CONTEXT\r
                                 , (void *) psDnldContext\r
index b24f7e6..ad9ece3 100644 (file)
@@ -654,7 +654,7 @@ phFriNfc_NdefMap_ConvertToReadOnly (
     {\r
         result = PHNFCSTVAL(CID_FRI_NFC_NDEF_MAP, NFCSTATUS_INVALID_PARAMETER);\r
     }\r
-    else if ((NdefMap->CompletionRoutine->CompletionRoutine == NULL)\r
+    else if ((NdefMap->CompletionRoutine->CompletionRoutine == NULL) \r
         || (NdefMap->CompletionRoutine->Context == NULL))\r
     {\r
         result = PHNFCSTVAL(CID_FRI_NFC_NDEF_MAP, NFCSTATUS_INVALID_PARAMETER);\r
@@ -761,7 +761,7 @@ NFCSTATUS phFriNfc_NdefMap_ChkNdef( phFriNfc_NdefMap_t     *NdefMap)
                 break;\r
             }\r
 #else /* #ifndef PH_FRINFC_MAP_ISO15693_DISABLED */\r
-            status = PHNFCSTVAL(CID_FRI_NFC_NDEF_MAP,\r
+            status = PHNFCSTVAL(CID_FRI_NFC_NDEF_MAP, \r
                                 NFCSTATUS_INVALID_REMOTE_DEVICE);\r
 #endif /* #ifndef PH_FRINFC_MAP_ISO15693_DISABLED */\r
 \r
@@ -1416,16 +1416,16 @@ NFCSTATUS phFriNfc_NdefMap_GetContainerSize(const phFriNfc_NdefMap_t *NdefMap,ui
 \r
                 block_no = (uint16_t)\r
                     ISO15693_GET_VALUE_FIELD_BLOCK_NO (\r
-                        NdefMap->ISO15693Container.ndef_tlv_type_blk,\r
-                        NdefMap->ISO15693Container.ndef_tlv_type_byte,\r
+                        NdefMap->ISO15693Container.ndef_tlv_type_blk, \r
+                        NdefMap->ISO15693Container.ndef_tlv_type_byte, \r
                         NdefMap->ISO15693Container.actual_ndef_size);\r
                 byte_no = (uint8_t)\r
                     ISO15693_GET_VALUE_FIELD_BYTE_NO (\r
-                        NdefMap->ISO15693Container.ndef_tlv_type_blk,\r
-                        NdefMap->ISO15693Container.ndef_tlv_type_byte,\r
+                        NdefMap->ISO15693Container.ndef_tlv_type_blk, \r
+                        NdefMap->ISO15693Container.ndef_tlv_type_byte, \r
                         NdefMap->ISO15693Container.actual_ndef_size);\r
 \r
-                *maxSize = (NdefMap->ISO15693Container.max_data_size -\r
+                *maxSize = (NdefMap->ISO15693Container.max_data_size - \r
                             ((block_no * ISO15693_BYTES_PER_BLOCK) + byte_no));\r
 #else /* #if 1 */\r
                 /* 2 is used to exclude the T and L part of the TLV */\r
index ebc5e57..2ea0da1 100644 (file)
@@ -215,7 +215,7 @@ static void phHal4Nfc_CloseComplete(
                         Hal4Ctxt->psTrcvCtxtInfo->sLowerRecvData.buffer\r
                         );\r
             }\r
-            if((NULL == Hal4Ctxt->sTgtConnectInfo.psConnectedDevice)\r
+            if((NULL == Hal4Ctxt->sTgtConnectInfo.psConnectedDevice) \r
                 && (NULL != Hal4Ctxt->psTrcvCtxtInfo->psUpperSendData))\r
             {\r
                 phOsalNfc_FreeMemory(Hal4Ctxt->psTrcvCtxtInfo->psUpperSendData);\r
@@ -301,40 +301,52 @@ phHal4Nfc_Configure_Layers(
 \r
 \r
 \r
+#ifdef ANDROID\r
 \r
-const unsigned char *nxp_nfc_full_version;
-const unsigned char *nxp_nfc_fw;
-static void *handle = NULL;
+#define LOG_TAG "NFC-HCI"\r
 \r
-int dlopen_firmware() {\r
-#ifdef TIZEN_PUBLIC\r
-    return 0;\r
-#else\r
+#include <utils/Log.h>\r
+#include <dlfcn.h>\r
+\r
+#define FW_PATH "/system/vendor/firmware/libpn544_fw.so"\r
 \r
-       void *p;\r
+const unsigned char *nxp_nfc_full_version = NULL;\r
+const unsigned char *nxp_nfc_fw = NULL;\r
+\r
+int dlopen_firmware() {\r
+    void *p;\r
 \r
-    void *handle = dlopen("/lib/libpn544_fw.so", RTLD_NOW);
+    void *handle = dlopen(FW_PATH, RTLD_NOW);\r
     if (handle == NULL) {\r
-        PHDBG_INFO("Could not open libpn544.so");
+        LOGE("Could not open %s", FW_PATH);\r
         return -1;\r
     }\r
 \r
     p = dlsym(handle, "nxp_nfc_full_version");\r
     if (p == NULL) {\r
-        PHDBG_INFO("Could not link nxp_nfc_full_version");
+        LOGE("Could not link nxp_nfc_full_version");\r
         return -1;\r
     }\r
     nxp_nfc_full_version = (unsigned char *)p;\r
 \r
     p = dlsym(handle, "nxp_nfc_fw");\r
     if (p == NULL) {\r
-        PHDBG_INFO("Could not link nxp_nfc_fw");
+        LOGE("Could not link nxp_nfc_fw");\r
         return -1;\r
     }\r
     nxp_nfc_fw = (unsigned char *)p;\r
 \r
     return 0;\r
-#endif\r
+}\r
+#else\r
+\r
+const unsigned char *nxp_nfc_full_version;
+const unsigned char *nxp_nfc_fw;
+static void *handle = NULL;
+\r
+int dlopen_firmware() {\r
+    return 0;\r
+\r
 }\r
 
 void dlclose_firmware()
@@ -345,7 +357,7 @@ void dlclose_firmware()
                handle = NULL;
        }
 }
-\r
+#endif\r
 /**\r
  *  The open function called by the upper HAL when HAL4 is to be opened\r
  *  (initialized).\r
@@ -437,7 +449,7 @@ NFCSTATUS phHal4Nfc_Open(
                 /*Hci Init did not succeed.free Resources and return*/\r
                 if( (openRetVal != NFCSTATUS_SUCCESS)\r
                             && (PHNFCSTATUS (openRetVal) != NFCSTATUS_PENDING) )\r
-                {\r
+                {                    \r
                     phOsalNfc_FreeMemory(Hal4Ctxt->pHal4Nfc_LayerCfg);\r
                     phOsalNfc_FreeMemory(Hal4Ctxt);\r
                     Hal4Ctxt = NULL;\r
@@ -485,7 +497,7 @@ NFCSTATUS phHal4Nfc_Ioctl(
         if(NFC_FW_DOWNLOAD_CHECK == IoctlCode)\r
         {\r
             RetStatus = phDnldNfc_Run_Check(\r
-                psHwReference\r
+                psHwReference                       \r
                 );\r
         }\r
         else\r
@@ -496,7 +508,7 @@ NFCSTATUS phHal4Nfc_Ioctl(
             Hal4Ctxt = (phHal4Nfc_Hal4Ctxt_t *)\r
                 phOsalNfc_GetMemory((uint32_t)sizeof(\r
                                                 phHal4Nfc_Hal4Ctxt_t)\r
-                                                );\r
+                                                );      \r
             if(NULL == Hal4Ctxt)\r
             {\r
                 RetStatus = PHNFCSTVAL(CID_NFC_HAL,\r
@@ -504,15 +516,15 @@ NFCSTATUS phHal4Nfc_Ioctl(
             }\r
             else\r
             {\r
-                ((phHal_sHwReference_t *)psHwReference)->hal_context\r
+                ((phHal_sHwReference_t *)psHwReference)->hal_context \r
                     = Hal4Ctxt;\r
                 (void)memset((void *)Hal4Ctxt,\r
                                  0,\r
-                                   ((uint32_t)sizeof(phHal4Nfc_Hal4Ctxt_t)));\r
-                Hal4Ctxt->sUpperLayerInfo.psUpperLayerCtxt = pContext;\r
+                                   ((uint32_t)sizeof(phHal4Nfc_Hal4Ctxt_t)));               \r
+                Hal4Ctxt->sUpperLayerInfo.psUpperLayerCtxt = pContext;                                              \r
                 Hal4Ctxt->sUpperLayerInfo.pUpperIoctlCb\r
                     = pIoctlCallback;/*Register upper layer callback*/\r
-                Hal4Ctxt->sUpperLayerInfo.pIoctlOutParam = pOutParam;\r
+                Hal4Ctxt->sUpperLayerInfo.pIoctlOutParam = pOutParam;   \r
                 /*Upgrade the firmware*/\r
                 RetStatus = phDnldNfc_Upgrade (\r
                         psHwReference,\r
@@ -531,7 +543,7 @@ NFCSTATUS phHal4Nfc_Ioctl(
         else\r
 #endif/*NFC_FW_DOWNLOAD*/\r
         {\r
-            RetStatus = PHNFCSTVAL(CID_NFC_HAL ,NFCSTATUS_NOT_INITIALISED);\r
+            RetStatus = PHNFCSTVAL(CID_NFC_HAL ,NFCSTATUS_NOT_INITIALISED);     \r
         }\r
     }\r
     else/*Status is Initialised*/\r
@@ -595,7 +607,7 @@ NFCSTATUS phHal4Nfc_Ioctl(
                     );\r
             }\r
             break;\r
-        /*Used to Read Memory/Registers .3 bytes of Array passed form the\r
+        /*Used to Read Memory/Registers .3 bytes of Array passed form the \r
           address to read from in MSB first format.*/\r
         case NFC_MEM_READ:\r
             {\r
@@ -621,8 +633,8 @@ NFCSTATUS phHal4Nfc_Ioctl(
                 }\r
             }\r
             break;\r
-        /*Used to Write Memory/Registers .First 3 bytes of Array passed in MSB\r
-          first format form the address to write to.The 4th Byte is the 8 bit\r
+        /*Used to Write Memory/Registers .First 3 bytes of Array passed in MSB \r
+          first format form the address to write to.The 4th Byte is the 8 bit \r
           value to be written to the address*/\r
         case NFC_MEM_WRITE:\r
             {\r
@@ -631,7 +643,7 @@ NFCSTATUS phHal4Nfc_Ioctl(
                 {\r
                     for( ind = 0; ind < 3; ind++ )\r
                     {\r
-                        config_type = ((config_type << BYTE_SIZE )\r
+                        config_type = ((config_type << BYTE_SIZE ) \r
                                         | (pInParam->buffer[ind] ));\r
                     }\r
                     RetStatus = phHciNfc_System_Configure (\r
@@ -643,7 +655,7 @@ NFCSTATUS phHal4Nfc_Ioctl(
                 }\r
                 else\r
                 {\r
-                    RetStatus = PHNFCSTVAL(CID_NFC_HAL ,\r
+                    RetStatus = PHNFCSTVAL(CID_NFC_HAL , \r
                         NFCSTATUS_INVALID_PARAMETER);\r
                 }\r
             }\r
@@ -666,7 +678,7 @@ NFCSTATUS phHal4Nfc_Ioctl(
 \r
 /**\r
  *  The close function called by the upper layer when HAL4 is to be closed\r
- *  (shutdown).\r
+ *  (shutdown).  \r
  */\r
 NFCSTATUS phHal4Nfc_Close(\r
                           phHal_sHwReference_t *psHwReference,\r
@@ -684,10 +696,10 @@ NFCSTATUS phHal4Nfc_Close(
     }\r
     else if((NULL == psHwReference->hal_context)\r
                         || (((phHal4Nfc_Hal4Ctxt_t *)\r
-                                psHwReference->hal_context)->Hal4CurrentState\r
+                                psHwReference->hal_context)->Hal4CurrentState \r
                                                < eHal4StateSelfTestMode)\r
                         || (((phHal4Nfc_Hal4Ctxt_t *)\r
-                                psHwReference->hal_context)->Hal4NextState\r
+                                psHwReference->hal_context)->Hal4NextState \r
                                                == eHal4StateClosed))\r
     {\r
         /*return already closed*/\r
@@ -789,7 +801,7 @@ void phHal4Nfc_Hal4Reset(
                 phOsalNfc_FreeMemory(Hal4Ctxt->psTrcvCtxtInfo\r
                                                     ->sLowerRecvData.buffer);\r
             }\r
-            if((NULL == Hal4Ctxt->sTgtConnectInfo.psConnectedDevice)\r
+            if((NULL == Hal4Ctxt->sTgtConnectInfo.psConnectedDevice) \r
                 && (NULL != Hal4Ctxt->psTrcvCtxtInfo->psUpperSendData))\r
             {\r
                 phOsalNfc_FreeMemory(Hal4Ctxt->psTrcvCtxtInfo->psUpperSendData);\r
@@ -839,10 +851,10 @@ NFCSTATUS phHal4Nfc_GetDeviceCapabilities(
     /*Check for Initialized state*/\r
     else if((NULL == psHwReference->hal_context)\r
                         || (((phHal4Nfc_Hal4Ctxt_t *)\r
-                                psHwReference->hal_context)->Hal4CurrentState\r
+                                psHwReference->hal_context)->Hal4CurrentState \r
                                                < eHal4StateOpenAndReady)\r
                         || (((phHal4Nfc_Hal4Ctxt_t *)\r
-                                psHwReference->hal_context)->Hal4NextState\r
+                                psHwReference->hal_context)->Hal4NextState \r
                                                == eHal4StateClosed))\r
     {\r
         retstatus = PHNFCSTVAL(CID_NFC_HAL ,NFCSTATUS_NOT_INITIALISED);\r
@@ -908,7 +920,7 @@ static void phHal4Nfc_LowerNotificationHandler(
                 gpphHal4Nfc_Hwref = (phHal_sHwReference_t *)pHwRef;\r
             }\r
         }\r
-        else/*No Copy of Hw ref in HAL.Copy both Hwref and Hal context passed\r
+        else/*No Copy of Hw ref in HAL.Copy both Hwref and Hal context passed \r
              by Hci*/\r
         {\r
             Hal4Ctxt = (phHal4Nfc_Hal4Ctxt_t *)pContext;\r
@@ -1033,7 +1045,7 @@ static void phHal4Nfc_LowerNotificationHandler(
                                             = Hal4Ctxt->sUpperLayerInfo.psUpperLayerCtxt;\r
                 static phHal4Nfc_NotificationInfo_t uNotificationInfo;\r
                 if(NULL != Hal4Ctxt->sUpperLayerInfo.pDefaultEventHandler)\r
-                {\r
+                {                    \r
                     Hal4Ctxt->Hal4NextState = eHal4StateInvalid;\r
                     Hal4Ctxt->sUpperLayerInfo.pDefaultEventHandler(\r
                         Hal4Ctxt->sUpperLayerInfo.DefaultListenerCtxt,\r
@@ -1072,8 +1084,8 @@ static void phHal4Nfc_LowerNotificationHandler(
                 break;\r
             }\r
             case NFC_NOTIFY_CONNECT_FAILED:\r
-            case NFC_NOTIFY_DISCONNECT_FAILED:\r
-            /*Generic Error type received from Hci.Handle the error based on\r
+            case NFC_NOTIFY_DISCONNECT_FAILED:   \r
+            /*Generic Error type received from Hci.Handle the error based on \r
               Hal4 next state and which past callback was Pending*/\r
             case NFC_NOTIFY_ERROR:\r
             {\r
@@ -1167,7 +1179,7 @@ static void phHal4Nfc_HandleEvent(
                         break;\r
                     default:\r
                         break;\r
-                }\r
+                }           \r
             }\r
         }\r
             break;\r
@@ -1198,7 +1210,7 @@ static void phHal4Nfc_HandleEvent(
         case NFC_EVT_PROTECTED:\r
         {\r
 #ifdef IGNORE_EVT_PROTECTED\r
-            /*Ignore_Event_Protected is set to false during Field Off event and\r
+            /*Ignore_Event_Protected is set to false during Field Off event and \r
               Set protection Configuration.After a NFC_EVT_PROTECTED is received\r
               once all subsequent NFC_EVT_PROTECTED events are ignored*/\r
             if(FALSE == Hal4Ctxt->Ignore_Event_Protected)\r
@@ -1208,7 +1220,7 @@ static void phHal4Nfc_HandleEvent(
                 sNotificationInfo.info = psEventInfo;\r
                 sNotificationInfo.status = NFCSTATUS_SUCCESS;\r
                 sNotificationInfo.type = NFC_EVENT_NOTIFICATION;\r
-                pInfo = &sNotificationInfo;\r
+                pInfo = &sNotificationInfo;            \r
                 phHal4Nfc_HandleEmulationEvent(Hal4Ctxt,pInfo);\r
 #ifdef IGNORE_EVT_PROTECTED\r
             }\r
@@ -1246,20 +1258,20 @@ static void phHal4Nfc_HandleEvent(
             }\r
             if(NULL != Hal4Ctxt->psADDCtxtInfo)\r
             {\r
-                Hal4Ctxt->psADDCtxtInfo->sADDCfg.PollDevInfo.PollEnabled\r
+                Hal4Ctxt->psADDCtxtInfo->sADDCfg.PollDevInfo.PollEnabled \r
                                 |= psEventInfo->eventInfo.rd_phases;\r
-                /*Configure HCI Discovery*/\r
+                /*Configure HCI Discovery*/ \r
                 RetStatus = phHciNfc_Config_Discovery(\r
                     (void *)Hal4Ctxt->psHciHandle,\r
                     gpphHal4Nfc_Hwref,\r
                     &(Hal4Ctxt->psADDCtxtInfo->sADDCfg)\r
-                    );\r
+                    ); \r
                 Hal4Ctxt->Hal4NextState = (NFCSTATUS_PENDING == RetStatus?\r
                                                 eHal4StateConfiguring:\r
                                                 Hal4Ctxt->Hal4NextState);\r
             }\r
             break;\r
-        }\r
+        }   \r
         /*Call Default Event handler for these Events*/\r
         case NFC_INFO_TXLDO_OVERCUR:\r
         case NFC_INFO_MEM_VIOLATION:\r
@@ -1288,7 +1300,7 @@ static void phHal4Nfc_HandleEvent(
         case NFC_EVT_TRANSACTION:\r
         case NFC_EVT_START_OF_TRANSACTION:\r
         case NFC_EVT_END_OF_TRANSACTION:\r
-        case NFC_EVT_CONNECTIVITY:\r
+        case NFC_EVT_CONNECTIVITY:   \r
         case NFC_EVT_OPERATION_ENDED:\r
         case NFC_EVT_MIFARE_ACCESS:\r
         case NFC_EVT_APDU_RECEIVED:\r
@@ -1306,7 +1318,7 @@ static void phHal4Nfc_HandleEvent(
             sNotificationInfo.type = NFC_EVENT_NOTIFICATION;\r
             pInfo = &sNotificationInfo;\r
             PHDBG_INFO("Hal4:Event Field ON\n");\r
-            phHal4Nfc_HandleEmulationEvent(Hal4Ctxt,pInfo);\r
+            phHal4Nfc_HandleEmulationEvent(Hal4Ctxt,pInfo);        \r
             break;\r
         case NFC_EVT_FIELD_OFF:\r
     #ifdef IGNORE_EVT_PROTECTED\r
@@ -1317,7 +1329,7 @@ static void phHal4Nfc_HandleEvent(
             sNotificationInfo.type = NFC_EVENT_NOTIFICATION;\r
             pInfo = &sNotificationInfo;\r
             PHDBG_INFO("Hal4:Event Field OFF\n");\r
-            phHal4Nfc_HandleEmulationEvent(Hal4Ctxt,pInfo);\r
+            phHal4Nfc_HandleEmulationEvent(Hal4Ctxt,pInfo); \r
             break;\r
         default:\r
             PHDBG_WARNING("Hal4:Unhandled Event type received");\r
@@ -1381,14 +1393,14 @@ static void phHal4Nfc_IoctlComplete(
 {\r
     /*Copy status*/\r
     NFCSTATUS status = (((phNfc_sCompletionInfo_t *)pInfo)->status);\r
-    pphHal4Nfc_IoctlCallback_t pUpper_IoctlCb\r
+    pphHal4Nfc_IoctlCallback_t pUpper_IoctlCb \r
                                     = Hal4Ctxt->sUpperLayerInfo.pUpperIoctlCb;\r
 #ifdef MERGE_SAK_SW2\r
-    pphHal4Nfc_GenCallback_t pConfigCallback =\r
+    pphHal4Nfc_GenCallback_t pConfigCallback = \r
         Hal4Ctxt->sUpperLayerInfo.pConfigCallback;\r
 #endif/*#ifdef MERGE_SAK_SW2*/\r
     void  *pUpper_Context = Hal4Ctxt->sUpperLayerInfo.psUpperLayerCtxt;\r
-    Hal4Ctxt->sUpperLayerInfo.pUpperIoctlCb = NULL;\r
+    Hal4Ctxt->sUpperLayerInfo.pUpperIoctlCb = NULL;    \r
 #ifdef MERGE_SAK_SW1 /*Software workaround 1*/\r
     if(eHal4StateOpenAndReady == Hal4Ctxt->Hal4NextState)\r
     {\r
@@ -1400,7 +1412,7 @@ static void phHal4Nfc_IoctlComplete(
             NFCSTATUS_SUCCESS\r
             );\r
     }\r
-#endif/*#ifdef MERGE_SAK_SW1*/\r
+#endif/*#ifdef MERGE_SAK_SW1*/    \r
 #ifdef MERGE_SAK_SW2 /*Software workaround 2*/\r
     else if((eHal4StateConfiguring == Hal4Ctxt->Hal4NextState)\r
             &&(NULL != pConfigCallback))\r
@@ -1419,7 +1431,7 @@ static void phHal4Nfc_IoctlComplete(
             || (NFC_GPIO_READ == Hal4Ctxt->Ioctl_Type)\r
             )\r
         {\r
-            Hal4Ctxt->sUpperLayerInfo.pIoctlOutParam->length\r
+            Hal4Ctxt->sUpperLayerInfo.pIoctlOutParam->length \r
                 = sizeof (uint8_t);\r
         }\r
          /*Call registered Ioctl callback*/\r
index 4d161a4..242ca9f 100644 (file)
@@ -1,5 +1,6 @@
 /*\r
  * Copyright (C) 2010 NXP Semiconductors\r
+ * Copyright (C) 2012 Samsung Elevtronics Co., Ltd\r
  *\r
  * Licensed under the Apache License, Version 2.0 (the "License");\r
  * you may not use this file except in compliance with the License.\r
@@ -1370,7 +1371,7 @@ phHciNfc_Recv_DevMgmt_Event(
             case NXP_EVT_INFO_MEM_VIOLATION:\r
             {\r
                 event_info.eventType = NFC_INFO_MEM_VIOLATION;\r
-                LOGW("Your NFC controller is kinda hosed, take it to npelly@ to fix");\r
+//                LOGW("Your NFC controller is kinda hosed, take it to npelly@ to fix");\r
                 break;\r
             }\r
             case NXP_EVT_INFO_TEMP_OVERHEAT:\r
index a1eb589..f51651c 100644 (file)
@@ -28,7 +28,7 @@
 * $Date: Mon Mar 29 17:34:47 2010 $                                           *\r
 * $Author: ing04880 $                                                         *\r
 * $Revision: 1.73 $                                                           *\r
-* $Aliases: NFC_FRI1.1_WK1007_R33_4,NFC_FRI1.1_WK1017_PREP1,NFC_FRI1.1_WK1017_R34_1,NFC_FRI1.1_WK1017_R34_2,NFC_FRI1.1_WK1023_R35_1 $\r
+* $Aliases: NFC_FRI1.1_WK1007_R33_4,NFC_FRI1.1_WK1017_PREP1,NFC_FRI1.1_WK1017_R34_1,NFC_FRI1.1_WK1017_R34_2,NFC_FRI1.1_WK1023_R35_1 $  \r
 *                                                                             *\r
 * =========================================================================== *\r
 */\r
@@ -93,12 +93,12 @@ extern char phOsalNfc_DbgTraceBuffer[];
 #include <phDbgTrace.h>\r
 #if defined(PHDBG_TRACES) && !defined(HCI_TRACE)\r
 #define HCI_PRINT( str )  PHDBG_INFO(str)\r
-#define HCI_DEBUG(str, arg)\r
-#define HCI_PRINT_BUFFER(msg,buf,len)\r
+#define HCI_DEBUG(str, arg) \r
+#define HCI_PRINT_BUFFER(msg,buf,len)   \r
 #else\r
-#define HCI_PRINT( str )\r
+#define HCI_PRINT( str ) \r
 #define HCI_DEBUG(...)\r
-#define HCI_PRINT_BUFFER(msg,buf,len)\r
+#define HCI_PRINT_BUFFER(msg,buf,len)   \r
 #endif  /* #if defined(PHDBG_TRACES) */\r
 /* #if defined(PHDBG_INFO) && defined (PHDBG_CRITICAL_ERROR) */\r
 \r
@@ -569,26 +569,26 @@ typedef struct phHciNfc_Pipe_Info{
     uint8_t                     recv_msg_type;\r
     /** \internal previous message sent to this pipe */\r
     uint8_t                     prev_msg;\r
-    /** \internal Index of the previous Set/Get Parameter command\r
+    /** \internal Index of the previous Set/Get Parameter command \r
      *  sent to this pipe */\r
     uint8_t                     reg_index;\r
-    /** \internal length of Parameter of the Set/Get Parameter\r
+    /** \internal length of Parameter of the Set/Get Parameter \r
      *  command sent to this pipe */\r
     uint16_t                    param_length;\r
-    /** \internal Parameter of the Set/Get Parameter command\r
+    /** \internal Parameter of the Set/Get Parameter command \r
      *  sent to this pipe */\r
     void                        *param_info;\r
     /** \internal Pointer to a Pipe specific Receive Response function */\r
-    pphHciNfc_Pipe_Receive_t    recv_resp;\r
+    pphHciNfc_Pipe_Receive_t    recv_resp; \r
     /** \internal Pointer to a Pipe specific Receive Event function */\r
-    pphHciNfc_Pipe_Receive_t    recv_event;\r
+    pphHciNfc_Pipe_Receive_t    recv_event; \r
     /** \internal Pointer to a Pipe specific Receive Command function */\r
-    pphHciNfc_Pipe_Receive_t    recv_cmd;\r
+    pphHciNfc_Pipe_Receive_t    recv_cmd; \r
 }phHciNfc_Pipe_Info_t;\r
 \r
 \r
 typedef struct phHciNfc_sContext{\r
-    /** \internal HCI Layer Pointer from the upper layer for\r
+    /** \internal HCI Layer Pointer from the upper layer for \r
                         lower layer function registration */\r
     phNfcLayer_sCfg_t           *p_hci_layer;\r
     /** \internal Pointer to the upper layer context */\r
@@ -643,7 +643,7 @@ typedef struct phHciNfc_sContext{
     void                        *p_device_mgmt_info;\r
     /** \internal HCI RF Reader Gates Management Information */\r
     void                        *p_reader_mgmt_info;\r
-    /** \internal HCI Card Application Gates and Emulation\r
+    /** \internal HCI Card Application Gates and Emulation \r
                   Information */\r
     void                        *p_emulation_mgmt_info;\r
     /** \internal HCI RF Reader A Gate Information */\r
@@ -664,7 +664,7 @@ typedef struct phHciNfc_sContext{
     /** \internal HCI ISO15693 Reader Gate Information */\r
     void                        *p_iso_15693_info;\r
 #endif\r
-\r
+    \r
 #ifdef ENABLE_P2P\r
     /** \internal HCI NFC-IP1 Peer to Peer Information */\r
     void                        *p_nfcip_info;\r
@@ -708,8 +708,8 @@ typedef struct phHciNfc_sContext{
     volatile uint16_t           rx_total;\r
     /** \internal Number of bytes received */\r
     volatile uint16_t           rx_recvd;\r
-    /** \internal Index of the received data in the\r
-    *   response packet\r
+    /** \internal Index of the received data in the \r
+    *   response packet  \r
     */\r
 \r
     /** \internal Send HCP Chaining Information */\r
@@ -953,7 +953,7 @@ phHciNfc_Transceive_Notify(
  *                                      the Device Interface Link .\r
  *  \param[in]  type                    type of the notification to\r
  *                                      the upper HAL layer.\r
- *  \param[in]  pInfo                   completion information returned\r
+ *  \param[in]  pInfo                   completion information returned \r
  *                                      to the Upper HAL Layer.\r
  *  NFCSTATUS_SUCCESS                   Notification successfully completed .\r
  *  NFCSTATUS_INVALID_PARAMETER         One or more of the supplied parameters\r
@@ -1006,7 +1006,7 @@ phHciNfc_Release_Notify(
 /**\r
  * \ingroup grp_hci_nfc\r
  *\r
- *  The phHciNfc_Send_Generic_Cmd function sends the HCI Generic Commands\r
+ *  The phHciNfc_Send_Generic_Cmd function sends the HCI Generic Commands \r
  *  to the device.\r
  *\r
  *  \param[in]  psHciContext            psHciContext is the context of\r
@@ -1019,9 +1019,9 @@ phHciNfc_Release_Notify(
  *                                      particular pipe .\r
  *\r
  *  \retval NFCSTATUS_PENDING           HCI Generic Command send in progress .\r
- *  \retval\r
- *  NFCSTATUS_INSUFFICIENT_RESOURCES    The memory could not be allocated\r
- *                                      as required amount of memory\r
+ *  \retval \r
+ *  NFCSTATUS_INSUFFICIENT_RESOURCES    The memory could not be allocated \r
+ *                                      as required amount of memory \r
  *                                      is not sufficient.\r
  *\r
  */\r
@@ -1038,7 +1038,7 @@ phHciNfc_Send_Generic_Cmd (
 /**\r
  * \ingroup grp_hci_nfc\r
  *\r
- *  The phHciNfc_Set_Param function configures the Gate specific register\r
+ *  The phHciNfc_Set_Param function configures the Gate specific register \r
  *  with the provided value.\r
  *\r
  *  \param[in]  psHciContext            psHciContext is the context of\r
@@ -1046,15 +1046,15 @@ phHciNfc_Send_Generic_Cmd (
  *  \param[in]  pHwRef                  pHwRef is the Information of\r
  *                                      the Device Interface Link .\r
  *  \param[in]  p_pipe_info             Pointer to pipe specific information.\r
- *  \param[in]  reg_index               Index of the register to be\r
+ *  \param[in]  reg_index               Index of the register to be \r
  *                                      configured .\r
- *  \param[in]  p_param                 Value to the configured in\r
+ *  \param[in]  p_param                 Value to the configured in \r
  *                                      particular register.\r
  *  \param[in]  param_length            Length of the parameter provided\r
  *                                      for the configuration.\r
  *\r
  *  \retval NFCSTATUS_PENDING           HCI Set parameter in progress .\r
- *  \retval\r
+ *  \retval \r
  *  NFCSTATUS_INVALID_HCI_INFORMATION   The Information like p_pipe_info,\r
  *                                      p_param or param_length is invalid\r
  *\r
@@ -1074,7 +1074,7 @@ phHciNfc_Set_Param (
 /**\r
  * \ingroup grp_hci_nfc\r
  *\r
- *  The phHciNfc_Send_HCP function sends the HCI Host Control Packet\r
+ *  The phHciNfc_Send_HCP function sends the HCI Host Control Packet \r
  *  Frames to the device.\r
  *\r
  *  \param[in]  psHciContext            psHciContext is the context of\r
@@ -1101,14 +1101,14 @@ phHciNfc_Send_HCP (
 /**\r
  * \ingroup grp_hci_nfc\r
  *\r
- *  The phHciNfc_Build_HCPFrame function initially builds the HCP Packet Frame\r
+ *  The phHciNfc_Build_HCPFrame function initially builds the HCP Packet Frame \r
  *  with the values passed in the arguments .\r
  *\r
  *  \param[in]  hcp_packet              hcp_packet is the frame packet structure\r
- *                                      in which the frame is populated with the\r
+ *                                      in which the frame is populated with the \r
  *                                      appropriate fields.\r
- *  \param[in]  chainbit                chainbit specifies whether the following\r
- *                                      HCP frames are chained or the frame is a\r
+ *  \param[in]  chainbit                chainbit specifies whether the following \r
+ *                                      HCP frames are chained or the frame is a \r
  *                                      normal frame.\r
  *  \param[in]  pipe_id                 pipe_id of the pipe to which the frame has\r
  *                                      to be sent.\r
@@ -1133,13 +1133,13 @@ phHciNfc_Build_HCPFrame (
 /**\r
  * \ingroup grp_hci_nfc\r
  *\r
- *  The phHciNfc_Append_HCPFrame function Appends the HCP Packet Frame\r
+ *  The phHciNfc_Append_HCPFrame function Appends the HCP Packet Frame \r
  *  with the values passed in the arguments .\r
  *\r
- *  \param[in]  hcp_data            hcp_data is the pointer to the HCP\r
+ *  \param[in]  hcp_data            hcp_data is the pointer to the HCP \r
  *                                  payload to which the data is to be\r
  *                                  appended.\r
- *  \param[in]  hcp_index           hcp_index is the index from which\r
+ *  \param[in]  hcp_index           hcp_index is the index from which \r
  *                                  the data source needs to be appended.\r
  *  \param[in]  src_data            src_data that is to be appended to the\r
  *                                  HCP packet.\r
@@ -1161,7 +1161,7 @@ void
 /**\r
  * \ingroup grp_hci_nfc\r
  *\r
- *  The phHciNfc_Allocate_Resource function allocates and initialises the\r
+ *  The phHciNfc_Allocate_Resource function allocates and initialises the \r
  *  resource memory for the HCI layer.\r
  *\r
  *  \param[in] ppBuffer                 ppBuffer is the pointer to which the\r
@@ -1171,9 +1171,9 @@ void
  *\r
  *  \retval NFCSTATUS_SUCCESS           The Resource Memory was allocated\r
  *                                      successfully .\r
- *  \retval\r
- *  NFCSTATUS_INSUFFICIENT_RESOURCES    The memory could not be allocated\r
- *                                      as required amount of memory\r
+ *  \retval \r
+ *  NFCSTATUS_INSUFFICIENT_RESOURCES    The memory could not be allocated \r
+ *                                      as required amount of memory \r
  *                                      is not suffient.\r
  *\r
  */\r
@@ -1187,7 +1187,7 @@ NFCSTATUS
 /**\r
  * \ingroup grp_hci_nfc\r
  *\r
- *  The phHciNfc_Release_Resources function releases all the resources\r
+ *  The phHciNfc_Release_Resources function releases all the resources \r
  *  allocated in the HCI Layer.\r
  *\r
  *  \param[in]  psHciContext            psHciContext is the context of\r
@@ -1206,7 +1206,7 @@ extern
 /**\r
  * \ingroup grp_hci_nfc\r
  *\r
- *  The phHciNfc_Release_Lower function initiates the release of the\r
+ *  The phHciNfc_Release_Lower function initiates the release of the \r
  *  lower layers.\r
  *\r
  *  \param[in]  psHciContext            psHciContext is the context of\r
index 46cce46..4499202 100644 (file)
@@ -74,10 +74,10 @@ STATIC void phLibNfc_InitCb(void *pContext,NFCSTATUS status);
 /* Shutdown callback */\r
 STATIC void phLibNfc_ShutdownCb(void *pContext,NFCSTATUS status);\r
 \r
-/**Default notification handler registered with lower layer immediately after\r
+/**Default notification handler registered with lower layer immediately after \r
    successful initialization*/\r
 STATIC void phLibNfc_DefaultHandler(\r
-                                void                        *context,\r
+                                void                        *context,                                 \r
                                 phHal_eNotificationType_t    type,\r
                                 phHal4Nfc_NotificationInfo_t info,\r
                                 NFCSTATUS                    status\r
@@ -92,7 +92,7 @@ NFCSTATUS phLibNfc_Mgt_ConfigureDriver (pphLibNfc_sConfig_t     psConfig,
     if(NULL != gpphLibContext)\r
     {\r
         return NFCSTATUS_ALREADY_INITIALISED;\r
-    }\r
+    }   \r
 \r
     return phDal4Nfc_Config(psConfig, ppDriverHandle);\r
 }\r
@@ -102,7 +102,7 @@ NFCSTATUS phLibNfc_Mgt_UnConfigureDriver (void *                 pDriverHandle)
     if(NULL != gpphLibContext)\r
     {\r
         return NFCSTATUS_ALREADY_INITIALISED;\r
-    }\r
+    }   \r
 \r
    return phDal4Nfc_ConfigRelease(pDriverHandle);\r
 }\r
@@ -179,7 +179,7 @@ NFCSTATUS phLibNfc_Mgt_Initialize(void                *pDriverHandle,
                                  pphLibNfc_RspCb_t    pInitCb,\r
                                  void                 *pContext)\r
 {\r
-     NFCSTATUS Status = NFCSTATUS_SUCCESS;\r
+     NFCSTATUS Status = NFCSTATUS_SUCCESS;     \r
      if((NULL == pDriverHandle)||(NULL == pInitCb))\r
      {\r
         Status = NFCSTATUS_INVALID_PARAMETER;\r
@@ -265,22 +265,22 @@ STATIC void phLibNfc_InitCb(void *pContext,NFCSTATUS status)
             gpphLibContext->sSeContext.eActivatedMode = phLibNfc_SE_ActModeDefault;\r
             sSecuredElementInfo[LIBNFC_SE_UICC_INDEX].eSE_CurrentState=phLibNfc_SE_Active;\r
             pLibContext->sSeContext.uUiccActivate=TRUE;\r
-        }\r
+        }              \r
         if(pLibContext->psHwReference->smx_connected==TRUE)\r
         {\r
             /* populate state of the secured element */\r
             gpphLibContext->sSeContext.eActivatedMode = phLibNfc_SE_ActModeDefault;\r
-            sSecuredElementInfo[LIBNFC_SE_SMARTMX_INDEX].eSE_CurrentState=phLibNfc_SE_Inactive;\r
+            sSecuredElementInfo[LIBNFC_SE_SMARTMX_INDEX].eSE_CurrentState=phLibNfc_SE_Inactive; \r
             pLibContext->sSeContext.uSmxActivate =FALSE;\r
         }\r
 \r
         phLibNfc_UpdateCurState(status,pLibContext);\r
-        (void)phHal4Nfc_RegisterNotification(\r
+        (void)phHal4Nfc_RegisterNotification(                                            \r
                                 pLibContext->psHwReference,\r
                                 eRegisterDefault,\r
                                 phLibNfc_DefaultHandler,\r
                                 (void*)pLibContext\r
-                                );\r
+                                ); \r
         /* call the upper layer register function */\r
         (*pClientCb)(pUpperLayerContext,status);\r
 \r
@@ -307,15 +307,15 @@ STATIC void phLibNfc_InitCb(void *pContext,NFCSTATUS status)
         phOsalNfc_FreeMemory(pLibContext);\r
         pLibContext= NULL;\r
         gpphLibContext = NULL;\r
-\r
+        \r
     }\r
     return;\r
 }\r
 \r
-/**Default notification handler registered with lower layer immediately after\r
+/**Default notification handler registered with lower layer immediately after \r
    successful initialization*/\r
 STATIC void phLibNfc_DefaultHandler(\r
-                                void                        *context,\r
+                                void                        *context,                                 \r
                                 phHal_eNotificationType_t    type,\r
                                 phHal4Nfc_NotificationInfo_t info,\r
                                 NFCSTATUS                    status\r
@@ -400,7 +400,7 @@ NFCSTATUS phLibNfc_Mgt_DeInitialize(void *                      pDriverHandle,
           {\r
               Status =NFCSTATUS_FAILED;\r
           }\r
-        }\r
+        }       \r
     }\r
     return Status;\r
 }\r
@@ -431,7 +431,7 @@ STATIC void phLibNfc_ShutdownCb(void *pContext,NFCSTATUS status)
             phLibNfc_UpdateCurState(status,pLibContext);\r
 \r
             pLibContext->status.GenCb_pending_status=FALSE;\r
-\r
+            \r
             /* Allocate the Memory for the Transceive info */\r
             if(pClientCb!=NULL)\r
             {\r
@@ -459,11 +459,11 @@ STATIC void phLibNfc_ShutdownCb(void *pContext,NFCSTATUS status)
             }\r
             /*Free the memory allocated during NDEF read,write\r
               and NDEF formatting*/\r
-            phLibNfc_Ndef_DeInit();\r
+            phLibNfc_Ndef_DeInit();        \r
                 phOsalNfc_FreeMemory(pLibContext);\r
                 gpphLibContext=NULL;\r
                 pLibContext= NULL;\r
-\r
+       \r
         }\r
         else\r
         {\r
@@ -510,8 +510,8 @@ NFCSTATUS phLibNfc_Mgt_Reset(void  *pContext)
             == eLibNfcHalStateShutdown))\r
     {   /*Lib Nfc not initlized*/\r
         Status = NFCSTATUS_NOT_INITIALISED;\r
-    }\r
-    else if(NULL == pContext)\r
+    }  \r
+    else if(NULL == pContext) \r
     {\r
         Status = NFCSTATUS_INVALID_PARAMETER;\r
     }\r
@@ -523,7 +523,7 @@ NFCSTATUS phLibNfc_Mgt_Reset(void  *pContext)
         Status = NFCSTATUS_SHUTDOWN;\r
     }\r
     else\r
-    {\r
+    {                     \r
         /*Reset all callback status*/\r
         (void) memset(&(gpphLibContext->RegNtfType),0,\r
                         sizeof(phLibNfc_Registry_Info_t));\r
@@ -586,7 +586,7 @@ NFCSTATUS phLibNfc_Mgt_Reset(void  *pContext)
             phOsalNfc_FreeMemory(gpphLibContext->ndef_cntx.ndef_fmt);\r
             gpphLibContext->ndef_cntx.ndef_fmt = NULL;\r
         }\r
-        if(NULL != pNdefRecord)\r
+        if(NULL != pNdefRecord) \r
         {\r
             if(NULL != pNdefRecord->Id)\r
             {\r
@@ -608,7 +608,7 @@ NFCSTATUS phLibNfc_Mgt_Reset(void  *pContext)
         {\r
             phOsalNfc_FreeMemory(NdefInfo.pNdefRecord);\r
             NdefInfo.pNdefRecord = NULL;\r
-        }\r
+        }          \r
         if(NULL != gpphLibContext->phLib_NdefRecCntx.NdefCb)\r
         {\r
             phOsalNfc_FreeMemory(gpphLibContext->phLib_NdefRecCntx.NdefCb);\r
@@ -620,9 +620,9 @@ NFCSTATUS phLibNfc_Mgt_Reset(void  *pContext)
             gpphLibContext->phLib_NdefRecCntx.ndef_message.buffer = NULL;\r
         }\r
         /* No device is connected */\r
-        gpphLibContext->Connected_handle = 0x00;\r
+        gpphLibContext->Connected_handle = 0x00;       \r
         gpphLibContext->Prev_Connected_handle = 0x00;\r
-        gpphLibContext->ReleaseType = NFC_INVALID_RELEASE_TYPE;\r
+        gpphLibContext->ReleaseType = NFC_INVALID_RELEASE_TYPE;        \r
         gpphLibContext->eLibNfcCfgMode = NFC_DISCOVERY_STOP;\r
         /*Lib Nfc Stack is initilized and in idle state*/\r
         gpphLibContext->LibNfcState.cur_state = eLibNfcHalStateInitandIdle;\r
@@ -662,8 +662,8 @@ NFCSTATUS phLibNfc_Mgt_Reset(void  *pContext)
         gpphLibContext->sSeContext.sSeCallabackInfo.pSEsetModeCb = NULL;\r
         gpphLibContext->sSeContext.sSeCallabackInfo.pSEsetModeCtxt = NULL;\r
         /*No callback is pending*/\r
-        gpphLibContext->status.GenCb_pending_status = FALSE;\r
-\r
+        gpphLibContext->status.GenCb_pending_status = FALSE;        \r
+                    \r
     }\r
     return Status;\r
 }\r
@@ -755,7 +755,7 @@ phLibNfc_UpdateNextState(
     default:\r
         break;\r
     }\r
-    pLibContext->LibNfcState.next_state =\r
+    pLibContext->LibNfcState.next_state = \r
         (uint8_t)((NFCSTATUS_SUCCESS == status)?next_state:pLibContext->LibNfcState.next_state);\r
 \r
     return status;\r
@@ -800,26 +800,26 @@ NFCSTATUS phLibNfc_Mgt_GetstackCapabilities(
 {\r
     NFCSTATUS RetVal = NFCSTATUS_FAILED;\r
     /*Check Lib Nfc stack is initilized*/\r
-    if((NULL == gpphLibContext)||\r
+    if((NULL == gpphLibContext)|| \r
         (gpphLibContext->LibNfcState.cur_state == eLibNfcHalStateShutdown))\r
     {\r
         RetVal = NFCSTATUS_NOT_INITIALISED;\r
-    }\r
+    }   \r
     /*Check application has sent the valid parameters*/\r
     else if((NULL == phLibNfc_StackCapabilities)\r
         || (NULL == pContext))\r
     {\r
         RetVal= NFCSTATUS_INVALID_PARAMETER;\r
-    }\r
+    }   \r
     else if(gpphLibContext->LibNfcState.next_state == eLibNfcHalStateShutdown)\r
     {\r
         RetVal = NFCSTATUS_SHUTDOWN;\r
     }\r
-    else if(TRUE == gpphLibContext->status.GenCb_pending_status)\r
+    else if(TRUE == gpphLibContext->status.GenCb_pending_status)       \r
     {\r
         /*Previous operation is pending  */\r
         RetVal = NFCSTATUS_BUSY;\r
-    }\r
+    }    \r
     else\r
     {\r
         /* Tag Format Capabilities*/\r
@@ -840,24 +840,24 @@ NFCSTATUS phLibNfc_Mgt_GetstackCapabilities(
         phLibNfc_StackCapabilities->psMappingCapabilities.ISO14443_4B = TRUE;\r
         phLibNfc_StackCapabilities->psMappingCapabilities.MifareStd = TRUE;\r
         phLibNfc_StackCapabilities->psMappingCapabilities.MifareUL = TRUE;\r
-        phLibNfc_StackCapabilities->psMappingCapabilities.MifareULC = TRUE;\r
+        phLibNfc_StackCapabilities->psMappingCapabilities.MifareULC = TRUE;     \r
         phLibNfc_StackCapabilities->psMappingCapabilities.Jewel = TRUE;\r
         phLibNfc_StackCapabilities->psMappingCapabilities.ISO15693 = FALSE;\r
-\r
+        \r
         /*Call Hal4 Get Dev Capabilities to get info about protocols supported\r
           by Lib Nfc*/\r
         PHDBG_INFO("LibNfc:Get Stack capabilities ");\r
-        RetVal= phHal4Nfc_GetDeviceCapabilities(\r
-                        gpphLibContext->psHwReference,\r
+        RetVal= phHal4Nfc_GetDeviceCapabilities(                                          \r
+                        gpphLibContext->psHwReference,                            \r
                         &(phLibNfc_StackCapabilities->psDevCapabilities),\r
-                        (void *)gpphLibContext);\r
+                        (void *)gpphLibContext); \r
 \r
         LIB_NFC_VERSION_SET(phLibNfc_StackCapabilities->psDevCapabilities.hal_version,\r
                             PH_HAL4NFC_VERSION,\r
                             PH_HAL4NFC_REVISION,\r
                             PH_HAL4NFC_PATCH,\r
                             PH_HAL4NFC_BUILD);\r
-\r
+                \r
         phLibNfc_StackCapabilities->psDevCapabilities.fw_version=\r
             gpphLibContext->psHwReference->device_info.fw_version;\r
         phLibNfc_StackCapabilities->psDevCapabilities.hci_version=\r
@@ -865,11 +865,10 @@ NFCSTATUS phLibNfc_Mgt_GetstackCapabilities(
         phLibNfc_StackCapabilities->psDevCapabilities.hw_version=\r
             gpphLibContext->psHwReference->device_info.hw_version;\r
         phLibNfc_StackCapabilities->psDevCapabilities.model_id=\r
-            gpphLibContext->psHwReference->device_info.model_id;\r
+            gpphLibContext->psHwReference->device_info.model_id;        \r
         (void)memcpy(phLibNfc_StackCapabilities->psDevCapabilities.full_version,\r
             gpphLibContext->psHwReference->device_info.full_version,NXP_FULL_VERSION_LEN);\r
         /* Check the firmware version */\r
-\r
         if (nxp_nfc_full_version == NULL) {\r
             // Couldn't load firmware, just pretend we're up to date.\r
 //            LOGW("Firmware image not available: this device might be running old NFC firmware!");\r
@@ -880,7 +879,7 @@ NFCSTATUS phLibNfc_Mgt_GetstackCapabilities(
         }\r
 \r
         if(NFCSTATUS_SUCCESS != RetVal)\r
-        {\r
+        {       \r
             RetVal = NFCSTATUS_FAILED;\r
         }\r
     }\r
@@ -897,18 +896,18 @@ NFCSTATUS phLibNfc_Mgt_ConfigureTestMode(void   *pDriverHandle,
                                  phLibNfc_Cfg_Testmode_t eTstmode,\r
                                  void                *pContext)\r
 {\r
-     NFCSTATUS Status = NFCSTATUS_SUCCESS;\r
+     NFCSTATUS Status = NFCSTATUS_SUCCESS;  \r
      phHal4Nfc_InitType_t eInitType=eInitDefault;\r
-\r
+     \r
      if((NULL == pDriverHandle)||(NULL == pTestModeCb))\r
      {\r
         Status = NFCSTATUS_INVALID_PARAMETER;\r
      }\r
      else if((NULL != gpphLibContext) && \\r
          (gpphLibContext->LibNfcState.next_state==eLibNfcHalStateShutdown))\r
-     {\r
+     { \r
         Status = NFCSTATUS_SHUTDOWN;\r
-     }\r
+     } \r
      else if( (eTstmode == phLibNfc_TstMode_On) && (NULL != gpphLibContext))\r
      {\r
         Status=NFCSTATUS_ALREADY_INITIALISED;\r
@@ -918,7 +917,7 @@ NFCSTATUS phLibNfc_Mgt_ConfigureTestMode(void   *pDriverHandle,
         Status = NFCSTATUS_NOT_INITIALISED;\r
      }\r
      else if( (eTstmode == phLibNfc_TstMode_Off) && (NULL != gpphLibContext))\r
-     {\r
+     {          \r
         if (NULL!= gpphLibContext->CBInfo.pClientShutdownCb)\r
         {   /* Previous callback pending */\r
             Status = NFCSTATUS_BUSY;\r
@@ -943,9 +942,9 @@ NFCSTATUS phLibNfc_Mgt_ConfigureTestMode(void   *pDriverHandle,
             {\r
                 Status =NFCSTATUS_FAILED;\r
             }\r
-        }\r
+        }       \r
      }\r
-     else\r
+     else \r
      {\r
             /* Initialize the Lib context */\r
         gpphLibContext=(pphLibNfc_LibContext_t)phOsalNfc_GetMemory(\r
@@ -993,7 +992,7 @@ NFCSTATUS phLibNfc_Mgt_ConfigureTestMode(void   *pDriverHandle,
             phLibNfc_Ndef_Init();\r
         }\r
     }\r
-\r
+    \r
    return Status;\r
 }\r
 \r
index fe39151..45540ae 100644 (file)
@@ -1,6 +1,6 @@
 /*\r
- * Copyright (C) 2010 NXP Semiconductors
- * Copyright (C) 2012 Samsung Elevtronics Co., Ltd\r
+ * Copyright (C) 2010 NXP Semiconductors\r
+ * Copyright (C) 2012 Samsung Elevtronics Co., Ltd *\r
  *\r
  * Licensed under the Apache License, Version 2.0 (the "License");\r
  * you may not use this file except in compliance with the License.\r
@@ -46,6 +46,7 @@
 #endif\r
 #define LOG_TAG "NFC-LLC"\r
 \r
+//#include <utils/Log.h>\r
 /*********************** End of includes ****************************/\r
 \r
 /***************************** Macros *******************************/\r
 \r
 /*********************** Local functions ****************************/\r
 static\r
-void\r
+void \r
 phLlcNfc_WrResp_Cb(\r
-                   void                        *pContext,\r
-                   void                        *pHwInfo,\r
+                   void                        *pContext, \r
+                   void                        *pHwInfo, \r
                    phNfc_sTransactionInfo_t    *pCompInfo\r
                    );\r
 \r
 static\r
-void\r
+void \r
 phLlcNfc_RdResp_Cb(\r
                    void                        *pContext,\r
-                   void                        *pHwInfo,\r
+                   void                        *pHwInfo, \r
                    phNfc_sTransactionInfo_t    *pCompInfo\r
                    );\r
 \r
@@ -77,28 +78,28 @@ int libnfc_llc_error_count = 0;
 \r
 /******************** End of Global Variables ***********************/\r
 \r
-NFCSTATUS\r
+NFCSTATUS \r
 phLlcNfc_Interface_Register(\r
-    phLlcNfc_Context_t          *psLlcCtxt,\r
+    phLlcNfc_Context_t          *psLlcCtxt, \r
     phNfcLayer_sCfg_t           *psIFConfig\r
 )\r
 {\r
     NFCSTATUS                   result = NFCSTATUS_SUCCESS;\r
     phNfcIF_sCallBack_t         if_cb = {0,0,0,0};\r
     phNfcIF_sReference_t        sreference = {0,0,0};\r
-\r
+    \r
     if ((NULL == psLlcCtxt) || (NULL == psIFConfig))\r
     {\r
-        result = PHNFCSTVAL(CID_NFC_LLC,\r
+        result = PHNFCSTVAL(CID_NFC_LLC, \r
                             NFCSTATUS_INVALID_PARAMETER);\r
     }\r
-    else\r
+    else \r
     {\r
         result = NFCSTATUS_SUCCESS;\r
         if_cb.notify = NULL;\r
         if_cb.receive_complete = (pphNfcIF_Transact_Completion_CB_t)&phLlcNfc_RdResp_Cb;\r
         if_cb.send_complete = (pphNfcIF_Transact_Completion_CB_t)&phLlcNfc_WrResp_Cb;\r
-        if_cb.pif_ctxt = psLlcCtxt;\r
+        if_cb.pif_ctxt = psLlcCtxt; \r
         sreference.plower_if = &(psLlcCtxt->lower_if);\r
         result = PHNFCSTVAL(CID_NFC_LLC, NFCSTATUS_INVALID_PARAMETER);\r
 #ifdef PH_LLCNFC_STUB\r
@@ -107,12 +108,12 @@ phLlcNfc_Interface_Register(
 #ifdef PH_LLCNFC_DALINT\r
         result = phDal4Nfc_Register(&sreference, if_cb, psIFConfig->layer_next);\r
 #else\r
-        if ((NULL != psIFConfig->layer_next) &&\r
+        if ((NULL != psIFConfig->layer_next) && \r
             (NULL != psIFConfig->layer_next->layer_registry))\r
         {\r
             result = psIFConfig->layer_next->layer_registry(\r
-                        &sreference,\r
-                        if_cb,\r
+                        &sreference, \r
+                        if_cb, \r
                         (void *)&psIFConfig[(psIFConfig->layer_index - 1)]);\r
         }\r
 #endif /* #ifdef PH_LLCNFC_DALINT */\r
@@ -120,8 +121,8 @@ phLlcNfc_Interface_Register(
     PH_LLCNFC_DEBUG("Llc Dal Interface Register result : 0x%x\n", result);\r
     return result;\r
 }\r
-\r
-NFCSTATUS\r
\r
+NFCSTATUS \r
 phLlcNfc_Interface_Init(\r
     phLlcNfc_Context_t      *psLlcCtxt\r
 )\r
@@ -130,63 +131,63 @@ phLlcNfc_Interface_Init(
         1. Get the pointer of the main llc context\r
     */\r
     NFCSTATUS   result = NFCSTATUS_SUCCESS;\r
-    if ((NULL == psLlcCtxt) ||\r
+    if ((NULL == psLlcCtxt) ||  \r
         (NULL == psLlcCtxt->lower_if.init))\r
     {\r
-        result = PHNFCSTVAL(CID_NFC_LLC,\r
+        result = PHNFCSTVAL(CID_NFC_LLC, \r
                             NFCSTATUS_INVALID_PARAMETER);\r
     }\r
     else\r
-    {\r
+    {        \r
         /* Initialise the main context */\r
-        result = psLlcCtxt->lower_if.init(  psLlcCtxt->lower_if.pcontext,\r
-                                            psLlcCtxt->phwinfo);\r
+        result = psLlcCtxt->lower_if.init(  psLlcCtxt->lower_if.pcontext, \r
+                                            psLlcCtxt->phwinfo);        \r
     }\r
     PH_LLCNFC_DEBUG("Llc Dal Interface Init result : 0x%x\n", result);\r
     return result;\r
 }\r
 \r
-NFCSTATUS\r
+NFCSTATUS \r
 phLlcNfc_Interface_Read(\r
-    phLlcNfc_Context_t      *psLlcCtxt,\r
-    uint8_t                 readWaitOn,\r
-    uint8_t                 *pLlcBuffer,\r
+    phLlcNfc_Context_t      *psLlcCtxt, \r
+    uint8_t                 readWaitOn, \r
+    uint8_t                 *pLlcBuffer, \r
     uint32_t                llcBufferLength\r
 )\r
 {\r
     NFCSTATUS   result = NFCSTATUS_PENDING;\r
     /*\r
-        1. Call DAL or TL read with "phLlcNfc_LlcTl_RdResp_Cb" as\r
+        1. Call DAL or TL read with "phLlcNfc_LlcTl_RdResp_Cb" as \r
             callback function\r
     */\r
     PH_LLCNFC_PRINT("Llc Dal Interface Read called\n");\r
-    if ((NULL == psLlcCtxt) || (NULL == pLlcBuffer) ||\r
-        (0 == llcBufferLength) || (NULL == psLlcCtxt->lower_if.receive) ||\r
+    if ((NULL == psLlcCtxt) || (NULL == pLlcBuffer) || \r
+        (0 == llcBufferLength) || (NULL == psLlcCtxt->lower_if.receive) || \r
         (readWaitOn > PH_LLCNFC_READWAIT_ON))\r
     {\r
         result = PHNFCSTVAL(CID_NFC_LLC, NFCSTATUS_INVALID_PARAMETER);\r
     }\r
-    else if (PH_LLCNFC_READPEND_FLAG_OFF !=\r
+    else if (PH_LLCNFC_READPEND_FLAG_OFF != \r
             psLlcCtxt->s_frameinfo.read_pending)\r
     {\r
         /* do nothing */\r
-    }\r
-    else\r
+    } \r
+    else \r
     {\r
         if (PH_LLCNFC_READWAIT_OFF == readWaitOn)\r
-        {\r
+        {   \r
             result = psLlcCtxt->lower_if.receive(\r
-                            psLlcCtxt->lower_if.pcontext,\r
-                            psLlcCtxt->phwinfo,\r
-                            pLlcBuffer,\r
+                            psLlcCtxt->lower_if.pcontext, \r
+                            psLlcCtxt->phwinfo, \r
+                            pLlcBuffer, \r
                             (uint8_t)llcBufferLength);\r
-        }\r
+        } \r
         else\r
         {\r
             result = psLlcCtxt->lower_if.receive_wait(\r
-                            psLlcCtxt->lower_if.pcontext,\r
-                            psLlcCtxt->phwinfo,\r
-                            pLlcBuffer,\r
+                            psLlcCtxt->lower_if.pcontext, \r
+                            psLlcCtxt->phwinfo, \r
+                            pLlcBuffer, \r
                             (uint16_t)llcBufferLength);\r
         }\r
 \r
@@ -194,12 +195,12 @@ phLlcNfc_Interface_Read(
         {\r
             if (PH_LLCNFC_READPEND_ONE_BYTE == llcBufferLength)\r
             {\r
-                psLlcCtxt->s_frameinfo.read_pending =\r
+                psLlcCtxt->s_frameinfo.read_pending = \r
                                     PH_LLCNFC_READPEND_ONE_BYTE;\r
             }\r
             else\r
             {\r
-                psLlcCtxt->s_frameinfo.read_pending =\r
+                psLlcCtxt->s_frameinfo.read_pending = \r
                                     PH_LLCNFC_READPEND_REMAIN_BYTE;\r
             }\r
         }\r
@@ -208,10 +209,10 @@ phLlcNfc_Interface_Read(
     return result;\r
 }\r
 \r
-NFCSTATUS\r
+NFCSTATUS \r
 phLlcNfc_Interface_Write(\r
     phLlcNfc_Context_t      *psLlcCtxt,\r
-    uint8_t             *pLlcBuffer,\r
+    uint8_t             *pLlcBuffer, \r
     uint32_t            llcBufferLength\r
 )\r
 {\r
@@ -219,11 +220,11 @@ phLlcNfc_Interface_Write(
 \r
     PH_LLCNFC_PRINT("Llc Dal Interface Write called\n");\r
     /*\r
-        1. Call DAL or TL write with "phLlcNfc_LlcTl_WrResp_Cb" as\r
+        1. Call DAL or TL write with "phLlcNfc_LlcTl_WrResp_Cb" as \r
             callback function\r
     */\r
-    if ((NULL == psLlcCtxt) || (NULL == pLlcBuffer) ||\r
-        (0 == llcBufferLength) ||\r
+    if ((NULL == psLlcCtxt) || (NULL == pLlcBuffer) || \r
+        (0 == llcBufferLength) || \r
         (NULL == psLlcCtxt->lower_if.send))\r
     {\r
         PH_LLCNFC_DEBUG ("psLlcCtxt : 0x%p\n", psLlcCtxt);\r
@@ -231,13 +232,13 @@ phLlcNfc_Interface_Write(
         PH_LLCNFC_DEBUG ("llcBufferLength : 0x%08X\n", llcBufferLength);\r
         result = PHNFCSTVAL(CID_NFC_LLC, NFCSTATUS_INVALID_PARAMETER);\r
     }\r
-    else\r
-    {\r
+    else \r
+    {        \r
         PH_LLCNFC_PRINT("Buffer to be send to Dal : \n");\r
         PH_LLCNFC_PRINT_BUFFER(pLlcBuffer, llcBufferLength);\r
 \r
-        if ((TRUE == psLlcCtxt->s_frameinfo.write_pending) ||\r
-            (PH_LLCNFC_READPEND_REMAIN_BYTE ==\r
+        if ((TRUE == psLlcCtxt->s_frameinfo.write_pending) || \r
+            (PH_LLCNFC_READPEND_REMAIN_BYTE == \r
             psLlcCtxt->s_frameinfo.read_pending))\r
         {\r
             result = PHNFCSTVAL(CID_NFC_LLC, NFCSTATUS_BUSY);\r
@@ -248,15 +249,15 @@ phLlcNfc_Interface_Write(
 \r
             PH_LLCNFC_PRINT_DATA (pLlcBuffer, llcBufferLength);\r
             PH_LLCNFC_STRING (";\n");\r
-\r
+    \r
 #endif /* LLC_DATA_BYTES */\r
 \r
             psLlcCtxt->s_frameinfo.s_llcpacket.llcbuf_len = (uint8_t)llcBufferLength;\r
             (void)memcpy ((void *)&(psLlcCtxt->s_frameinfo.s_llcpacket.s_llcbuf),\r
                         (void *)pLlcBuffer, llcBufferLength);\r
 \r
-            result = psLlcCtxt->lower_if.send(psLlcCtxt->lower_if.pcontext,\r
-                                                psLlcCtxt->phwinfo,\r
+            result = psLlcCtxt->lower_if.send(psLlcCtxt->lower_if.pcontext, \r
+                                                psLlcCtxt->phwinfo, \r
                                                 (uint8_t *)&(psLlcCtxt->s_frameinfo.s_llcpacket.s_llcbuf),\r
                                                 (uint16_t)llcBufferLength);\r
             if(NFCSTATUS_PENDING == result)\r
@@ -276,16 +277,16 @@ phLlcNfc_Interface_Write(
 }\r
 \r
 static\r
-void\r
+void \r
 phLlcNfc_WrResp_Cb(\r
-    void                        *pContext,\r
-    void                        *pHwInfo,\r
+    void                        *pContext, \r
+    void                        *pHwInfo, \r
     phNfc_sTransactionInfo_t    *pCompInfo\r
 )\r
 {\r
-    /*\r
+    /* \r
         1. Check the window size, if window size = windows\r
-        1. Call the send callback, which has been registered by upper\r
+        1. Call the send callback, which has been registered by upper \r
             layer\r
     */\r
     NFCSTATUS                   result = NFCSTATUS_SUCCESS;\r
@@ -297,13 +298,13 @@ phLlcNfc_WrResp_Cb(
     uint8_t                     count = 0;\r
 \r
     PH_LLCNFC_PRINT("\n\nLLC : WRITE RESP CB CALLED\n\n");\r
-\r
+    \r
     if ((NULL != ps_llc_ctxt) && (NULL != pCompInfo) && (NULL != pHwInfo))\r
     {\r
         ps_llc_ctxt->s_frameinfo.write_pending = FALSE;\r
 \r
         PHNFC_UNUSED_VARIABLE(result);\r
-\r
+        \r
         if(NFCSTATUS_SUCCESS == pCompInfo->status)\r
         {\r
             ps_frame_info = &(ps_llc_ctxt->s_frameinfo);\r
@@ -323,14 +324,14 @@ phLlcNfc_WrResp_Cb(
             {\r
                 case init_u_rset_frame:\r
                 {\r
-                    /* First U frame sent properly, update sent frame type\r
+                    /* First U frame sent properly, update sent frame type \r
                         in the callback */\r
-                    result = phLlcNfc_Interface_Read (ps_llc_ctxt,\r
-                                    PH_LLCNFC_READWAIT_OFF,\r
+                    result = phLlcNfc_Interface_Read (ps_llc_ctxt, \r
+                                    PH_LLCNFC_READWAIT_OFF, \r
                                     &(ps_recv_pkt->s_llcbuf.llc_length_byte),\r
                                     (uint8_t)PH_LLCNFC_BYTES_INIT_READ);\r
 \r
-                    if (NFCSTATUS_BUSY ==\r
+                    if (NFCSTATUS_BUSY == \r
                         PHNFCSTATUS (ps_frame_info->write_status))\r
                     {\r
                         ps_frame_info->write_status = NFCSTATUS_PENDING;\r
@@ -341,12 +342,12 @@ phLlcNfc_WrResp_Cb(
 \r
                 case init_u_a_frame:\r
                 {\r
-                    /* First UA frame sent properly, update sent frame type\r
-                        in the callback. Send the notification to the\r
+                    /* First UA frame sent properly, update sent frame type \r
+                        in the callback. Send the notification to the \r
                         upper layer */\r
                     ps_frame_info->sent_frame_type = write_resp_received;\r
-                    result = phLlcNfc_Interface_Read (ps_llc_ctxt,\r
-                                    PH_LLCNFC_READWAIT_OFF,\r
+                    result = phLlcNfc_Interface_Read (ps_llc_ctxt, \r
+                                    PH_LLCNFC_READWAIT_OFF, \r
                                     &(ps_recv_pkt->s_llcbuf.llc_length_byte),\r
                                     (uint8_t)PH_LLCNFC_BYTES_INIT_READ);\r
 \r
@@ -354,11 +355,11 @@ phLlcNfc_WrResp_Cb(
                     {\r
                         notifyinfo.status = NFCSTATUS_SUCCESS;\r
                         ps_llc_ctxt->cb_for_if.notify (\r
-                                        ps_llc_ctxt->cb_for_if.pif_ctxt,\r
-                                        ps_llc_ctxt->phwinfo,\r
-                                        NFC_NOTIFY_INIT_COMPLETED,\r
+                                        ps_llc_ctxt->cb_for_if.pif_ctxt, \r
+                                        ps_llc_ctxt->phwinfo, \r
+                                        NFC_NOTIFY_INIT_COMPLETED, \r
                                         &notifyinfo);\r
-                    }\r
+                    }                    \r
                     break;\r
                 }\r
 \r
@@ -367,7 +368,7 @@ phLlcNfc_WrResp_Cb(
                     /* Retries has failed to work, so U frame is sent */\r
                     ps_frame_info->sent_frame_type = write_resp_received;\r
 \r
-                    if (NFCSTATUS_BUSY ==\r
+                    if (NFCSTATUS_BUSY == \r
                         PHNFCSTATUS (ps_frame_info->write_status))\r
                     {\r
                         ps_frame_info->write_status = NFCSTATUS_PENDING;\r
@@ -381,52 +382,52 @@ phLlcNfc_WrResp_Cb(
                     /* Send complete */\r
                     count = ps_frame_info->n_s;\r
 \r
-                    ps_store_frame->s_llcpacket[count].frame_to_send =\r
+                    ps_store_frame->s_llcpacket[count].frame_to_send = \r
                     ps_frame_info->sent_frame_type = write_resp_received;\r
 \r
                     /* N(S) shall be incremented now, because, this callback\r
                         ensures that packet is sent */\r
-                    count =\r
-                    ps_frame_info->n_s = ((ps_frame_info->n_s + 1) %\r
+                    count = \r
+                    ps_frame_info->n_s = ((ps_frame_info->n_s + 1) % \r
                                             PH_LLCNFC_MOD_NS_NR);\r
 \r
-                    result = phLlcNfc_Interface_Read(ps_llc_ctxt,\r
-                                    PH_LLCNFC_READWAIT_OFF,\r
+                    result = phLlcNfc_Interface_Read(ps_llc_ctxt, \r
+                                    PH_LLCNFC_READWAIT_OFF, \r
                                     &(ps_recv_pkt->s_llcbuf.llc_length_byte),\r
                                     (uint8_t)PH_LLCNFC_BYTES_INIT_READ);\r
 \r
-                    if (NFCSTATUS_BUSY ==\r
+                    if (NFCSTATUS_BUSY == \r
                         PHNFCSTATUS (ps_frame_info->write_status))\r
                     {\r
                         ps_frame_info->write_status = NFCSTATUS_PENDING;\r
                         result = phLlcNfc_H_WriteWaitCall (ps_llc_ctxt);\r
                     }\r
+                   \r
 \r
-\r
-                    if ((((ps_store_frame->start_pos + ps_store_frame->winsize_cnt) %\r
-                        PH_LLCNFC_MOD_NS_NR) == ps_frame_info->n_s) &&\r
+                    if ((((ps_store_frame->start_pos + ps_store_frame->winsize_cnt) % \r
+                        PH_LLCNFC_MOD_NS_NR) == ps_frame_info->n_s) && \r
                         (ps_frame_info->window_size == ps_store_frame->winsize_cnt))\r
                     {\r
-                        /* Don't call the upper layer send completion callback,\r
-                            because last sent frame is the maximum that can be\r
+                        /* Don't call the upper layer send completion callback, \r
+                            because last sent frame is the maximum that can be \r
                             held by LLC due to windowing\r
-                            store the callback info, call send completion shall\r
-                            be sent to upper layer only after the ACK is received for the\r
+                            store the callback info, call send completion shall \r
+                            be sent to upper layer only after the ACK is received for the \r
                             I frames */\r
-                        ps_llc_ctxt->send_cb_len = (pCompInfo->length -\r
+                        ps_llc_ctxt->send_cb_len = (pCompInfo->length - \r
                                                     PH_LLCNFC_APPEND_LEN);\r
                     }\r
-                    else\r
+                    else \r
                     {\r
-                        /* Send completion is sent to upper layer\r
+                        /* Send completion is sent to upper layer \r
                         Actually, this allows the upper layer to send data, if any\r
                         */\r
-                        if (NULL != ps_llc_ctxt->cb_for_if.send_complete)\r
-                        {\r
-                            pCompInfo->length = (pCompInfo->length -\r
+                        if (NULL != ps_llc_ctxt->cb_for_if.send_complete) \r
+                        {                            \r
+                            pCompInfo->length = (pCompInfo->length - \r
                                                 PH_LLCNFC_APPEND_LEN);\r
                             ps_llc_ctxt->cb_for_if.send_complete (\r
-                                        ps_llc_ctxt->cb_for_if.pif_ctxt,\r
+                                        ps_llc_ctxt->cb_for_if.pif_ctxt, \r
                                         pHwInfo, pCompInfo);\r
                         }\r
                     }\r
@@ -438,15 +439,15 @@ phLlcNfc_WrResp_Cb(
 #if 0\r
                     uint8_t         i_frame_ns_value = 0;\r
 #endif /* #if 0 */\r
-                    /* S frame is only sent when ever a I frame is received from\r
-                        the PN544 in the read response callback, so the received I\r
-                        frame is acknowledged with S frame. The write response\r
+                    /* S frame is only sent when ever a I frame is received from  \r
+                        the PN544 in the read response callback, so the received I \r
+                        frame is acknowledged with S frame. The write response \r
                         callback for sent S frame is in progress. */\r
                     ps_frame_info->sent_frame_type = write_resp_received;\r
 \r
 #if 0\r
-                    i_frame_ns_value =\r
-                        ((ps_store_frame->s_llcpacket[count].s_llcbuf.sllcpayload.llcheader\r
+                    i_frame_ns_value = \r
+                        ((ps_store_frame->s_llcpacket[count].s_llcbuf.sllcpayload.llcheader \r
                         & LLC_NS_FRAME_HEADER_MASK) >> PH_LLCNFC_NS_START_BIT_POS);\r
 \r
 \r
@@ -459,7 +460,7 @@ phLlcNfc_WrResp_Cb(
                      PH_LLCNFC_DEBUG("frame to send : 0x%02X\n",\r
                               ps_store_frame->s_llcpacket[count].frame_to_send);\r
 \r
-                    if (NFCSTATUS_BUSY ==\r
+                    if (NFCSTATUS_BUSY == \r
                         PHNFCSTATUS(ps_frame_info->write_status))\r
                     {\r
                         ps_frame_info->write_status = NFCSTATUS_PENDING;\r
@@ -474,7 +475,7 @@ phLlcNfc_WrResp_Cb(
 #ifdef LLC_RR_INSTEAD_OF_REJ\r
                 case rej_rr_s_frame:\r
                 {\r
-                    if (NFCSTATUS_BUSY ==\r
+                    if (NFCSTATUS_BUSY == \r
                         PHNFCSTATUS(ps_frame_info->write_status))\r
                     {\r
                         ps_frame_info->write_status = NFCSTATUS_PENDING;\r
@@ -486,12 +487,12 @@ phLlcNfc_WrResp_Cb(
 \r
                 case resend_i_frame:\r
                 {\r
-                    /* The code reaches here, only if stored I frame is sent\r
-                        No changes here, but send next I frame from the stored list,\r
-                        in the read response callback, only if proper S or I frame\r
-                        is received from the PN544 */\r
-                    result = phLlcNfc_Interface_Read(ps_llc_ctxt,\r
-                                    PH_LLCNFC_READWAIT_OFF,\r
+                    /* The code reaches here, only if stored I frame is sent \r
+                        No changes here, but send next I frame from the stored list, \r
+                        in the read response callback, only if proper S or I frame \r
+                        is received from the PN544 */                    \r
+                    result = phLlcNfc_Interface_Read(ps_llc_ctxt, \r
+                                    PH_LLCNFC_READWAIT_OFF, \r
                                     &(ps_recv_pkt->s_llcbuf.llc_length_byte),\r
                                     (uint8_t)PH_LLCNFC_BYTES_INIT_READ);\r
 \r
@@ -501,32 +502,32 @@ phLlcNfc_WrResp_Cb(
                         result = phLlcNfc_H_WriteWaitCall (ps_llc_ctxt);\r
                     }\r
 \r
-                    if (ps_store_frame->winsize_cnt ==\r
+                    if (ps_store_frame->winsize_cnt == \r
                         ps_frame_info->window_size)\r
                     {\r
-                        /* Don't call the upper layer send completion callback,\r
-                            store the callback info, call send completion after\r
-                            ack for written frame\r
+                        /* Don't call the upper layer send completion callback, \r
+                            store the callback info, call send completion after \r
+                            ack for written frame \r
                         ps_llc_ctxt->send_cb_len = pCompInfo->length; */\r
                     }\r
-                    else\r
+                    else \r
                     {\r
                         /* ***** This notification needs to be disabled ***** */\r
-                        if(NULL != ps_llc_ctxt->cb_for_if.send_complete)\r
+                        if(NULL != ps_llc_ctxt->cb_for_if.send_complete) \r
                         {\r
-                            pCompInfo->length = (pCompInfo->length -\r
+                            pCompInfo->length = (pCompInfo->length - \r
                                                 PH_LLCNFC_APPEND_LEN);\r
                             ps_llc_ctxt->cb_for_if.send_complete(\r
-                                        ps_llc_ctxt->cb_for_if.pif_ctxt,\r
+                                        ps_llc_ctxt->cb_for_if.pif_ctxt, \r
                                         pHwInfo, pCompInfo);\r
                         }\r
-                    }\r
+                    } \r
 \r
-                    if(user_i_frame ==\r
+                    if(user_i_frame == \r
                         ps_store_frame->s_llcpacket[count].frame_to_send)\r
                     {\r
                         /* Send complete */\r
-                        ps_store_frame->s_llcpacket[count].frame_to_send =\r
+                        ps_store_frame->s_llcpacket[count].frame_to_send = \r
                                                             resend_i_frame;\r
                     }\r
                     break;\r
@@ -536,10 +537,10 @@ phLlcNfc_WrResp_Cb(
                 {\r
                     /* Update the sent frame type, if window size count is 0 */\r
                     ps_frame_info->sent_frame_type = write_resp_received;\r
-                    /* The code enters here, whenever a I frame is resent and for\r
-                        this resent I frame, an I frame received from PN544.\r
+                    /* The code enters here, whenever a I frame is resent and for \r
+                        this resent I frame, an I frame received from PN544. \r
                         So the S frame is sent as the acknowledgment */\r
-                    if (NFCSTATUS_BUSY ==\r
+                    if (NFCSTATUS_BUSY == \r
                             PHNFCSTATUS(ps_frame_info->write_status))\r
                     {\r
                         ps_frame_info->write_status = NFCSTATUS_PENDING;\r
@@ -552,16 +553,16 @@ phLlcNfc_WrResp_Cb(
                 {\r
                     /* Update the sent frame type, if window size count is 0 */\r
                     ps_frame_info->sent_frame_type = write_resp_received;\r
-                    /* The code enters here, whenever a I frame is resent and for\r
-                        this resent I frame, an I frame received from PN544.\r
+                    /* The code enters here, whenever a I frame is resent and for \r
+                        this resent I frame, an I frame received from PN544. \r
                         So the S frame is sent as the acknowledgment */\r
-                    if (NFCSTATUS_BUSY ==\r
+                    if (NFCSTATUS_BUSY == \r
                             PHNFCSTATUS(ps_frame_info->write_status))\r
                     {\r
                         ps_frame_info->write_status = NFCSTATUS_PENDING;\r
                         result = phLlcNfc_H_WriteWaitCall (ps_llc_ctxt);\r
                     }\r
-\r
+                    \r
 #ifdef LLC_UPP_LAYER_NTFY_WRITE_RSP_CB\r
                     phLlcNfc_H_SendInfo (ps_llc_ctxt);\r
 #endif /* #ifdef LLC_UPP_LAYER_NTFY_WRITE_RSP_CB */\r
@@ -570,12 +571,12 @@ phLlcNfc_WrResp_Cb(
 \r
                 case reject_s_frame:\r
                 {\r
-                    result = phLlcNfc_Interface_Read(ps_llc_ctxt,\r
-                                    PH_LLCNFC_READWAIT_OFF,\r
+                    result = phLlcNfc_Interface_Read(ps_llc_ctxt, \r
+                                    PH_LLCNFC_READWAIT_OFF, \r
                                     &(ps_recv_pkt->s_llcbuf.llc_length_byte),\r
                                     (uint8_t)PH_LLCNFC_BYTES_INIT_READ);\r
 \r
-                    if (NFCSTATUS_BUSY ==\r
+                    if (NFCSTATUS_BUSY == \r
                         PHNFCSTATUS(ps_frame_info->write_status))\r
                     {\r
                         ps_frame_info->write_status = NFCSTATUS_PENDING;\r
@@ -586,8 +587,8 @@ phLlcNfc_WrResp_Cb(
 \r
                 case u_a_frame:\r
                 {\r
-                    result = phLlcNfc_Interface_Read(ps_llc_ctxt,\r
-                                    PH_LLCNFC_READWAIT_OFF,\r
+                    result = phLlcNfc_Interface_Read(ps_llc_ctxt, \r
+                                    PH_LLCNFC_READWAIT_OFF, \r
                                     &(ps_recv_pkt->s_llcbuf.llc_length_byte),\r
                                     (uint8_t)PH_LLCNFC_BYTES_INIT_READ);\r
 \r
@@ -603,8 +604,8 @@ phLlcNfc_WrResp_Cb(
 \r
                 case resend_rej_s_frame:\r
                 {\r
-                    result = phLlcNfc_Interface_Read(ps_llc_ctxt,\r
-                                    PH_LLCNFC_READWAIT_OFF,\r
+                    result = phLlcNfc_Interface_Read(ps_llc_ctxt, \r
+                                    PH_LLCNFC_READWAIT_OFF, \r
                                     &(ps_recv_pkt->s_llcbuf.llc_length_byte),\r
                                     (uint8_t)PH_LLCNFC_BYTES_INIT_READ);\r
 \r
@@ -629,11 +630,11 @@ phLlcNfc_WrResp_Cb(
             /* Write not successful */\r
             if(NULL != ps_llc_ctxt->cb_for_if.send_complete)\r
             {\r
-                phLlcNfc_StopTimers(PH_LLCNFC_GUARDTIMER,\r
+                phLlcNfc_StopTimers(PH_LLCNFC_GUARDTIMER, \r
                                     ps_llc_ctxt->s_timerinfo.guard_to_count);\r
                 PH_LLCNFC_DEBUG("Error status received : 0x%x\n", pCompInfo->status);\r
                 ps_llc_ctxt->cb_for_if.send_complete(\r
-                                    ps_llc_ctxt->cb_for_if.pif_ctxt,\r
+                                    ps_llc_ctxt->cb_for_if.pif_ctxt, \r
                                     pHwInfo, pCompInfo);\r
             }\r
         }\r
@@ -642,7 +643,7 @@ phLlcNfc_WrResp_Cb(
 }\r
 \r
 static\r
-void\r
+void \r
 phLlcNfc_RdResp_Cb(\r
     void                        *pContext,\r
     void                        *pHwInfo,\r
@@ -650,16 +651,16 @@ phLlcNfc_RdResp_Cb(
 )\r
 {\r
     /*\r
-        1. LLC Receive has been called by the upper layer, the response\r
+        1. LLC Receive has been called by the upper layer, the response \r
             for this function is called by the lower layer\r
         2. Get the frame information from the receive buffer\r
-        3. Depending on the received frame type, process the received\r
+        3. Depending on the received frame type, process the received \r
             buffer\r
     */\r
     NFCSTATUS                   result = NFCSTATUS_SUCCESS;\r
     phLlcNfc_Context_t          *ps_llc_ctxt = (phLlcNfc_Context_t*)pContext;\r
     void                        *p_upperctxt = NULL;\r
-    uint8_t                     crc1 = 0,\r
+    uint8_t                     crc1 = 0, \r
                                 crc2 = 0;\r
     phLlcNfc_Frame_t            *ps_frame_info = NULL;\r
     phLlcNfc_LlcPacket_t        *ps_recv_pkt = NULL;\r
@@ -668,7 +669,7 @@ phLlcNfc_RdResp_Cb(
     phNfc_sCompletionInfo_t     notifyinfo = {0,0,0};\r
 \r
     PH_LLCNFC_PRINT("\n\nLLC : READ RESP CB CALLED\n\n");\r
-\r
+    \r
     if ((NULL != ps_llc_ctxt) && (NULL != pCompInfo) && (NULL != pHwInfo)\r
        && (NULL != pCompInfo->buffer))\r
     {\r
@@ -677,7 +678,7 @@ phLlcNfc_RdResp_Cb(
         ps_llc_payload = &(ps_recv_pkt->s_llcbuf.sllcpayload);\r
 \r
         ps_llc_ctxt->s_frameinfo.read_pending = PH_LLCNFC_READPEND_FLAG_OFF;\r
-\r
+        \r
         if (NFCSTATUS_SUCCESS == pCompInfo->status)\r
         {\r
             if ((PH_LLCNFC_MIN_BUFLEN_RECVD == pCompInfo->length) &&\r
@@ -688,45 +689,45 @@ phLlcNfc_RdResp_Cb(
                 PH_LLCNFC_PRINT_BUFFER(pCompInfo->buffer, pCompInfo->length);\r
 \r
 #if 0\r
-                /* Received length is 1 and receive buffer\r
-                contains the length field which is greater than 2,\r
+                /* Received length is 1 and receive buffer \r
+                contains the length field which is greater than 2, \r
                 so read the remaining bytes*/\r
                 ps_recv_pkt->s_llcbuf.llc_length_byte = pCompInfo->buffer[0];\r
 #endif\r
-                result = phLlcNfc_Interface_Read(ps_llc_ctxt,\r
-                                PH_LLCNFC_READWAIT_OFF,\r
-                                (uint8_t *)ps_llc_payload,\r
+                result = phLlcNfc_Interface_Read(ps_llc_ctxt, \r
+                                PH_LLCNFC_READWAIT_OFF, \r
+                                (uint8_t *)ps_llc_payload, \r
                                 (uint32_t)(ps_recv_pkt->s_llcbuf.llc_length_byte));\r
 \r
-                if ((init_u_rset_frame == ps_frame_info->sent_frame_type) &&\r
-                    (NFCSTATUS_PENDING != result) &&\r
+                if ((init_u_rset_frame == ps_frame_info->sent_frame_type) && \r
+                    (NFCSTATUS_PENDING != result) && \r
                     (NULL != ps_llc_ctxt->cb_for_if.notify))\r
                 {\r
                     PH_LLCNFC_PRINT("Initialised error\n");\r
                     notifyinfo.status = result;\r
-                    /* Copy the upper layer callback pointer and the upper\r
+                    /* Copy the upper layer callback pointer and the upper \r
                         layer context, after that call release */\r
                     notifyul = ps_llc_ctxt->cb_for_if.notify;\r
                     p_upperctxt = ps_llc_ctxt->cb_for_if.pif_ctxt;\r
                     result = phLlcNfc_Release(ps_llc_ctxt, pHwInfo);\r
 \r
                     /* Wrong result, so Init failed sent */\r
-                    notifyul(p_upperctxt, pHwInfo,\r
+                    notifyul(p_upperctxt, pHwInfo, \r
                             NFC_NOTIFY_INIT_FAILED, &notifyinfo);\r
                 }\r
             }\r
             else if (TRUE == ps_llc_ctxt->s_frameinfo.write_pending)\r
             {\r
-                /* Ignore the bytes as write is not complete and\r
+                /* Ignore the bytes as write is not complete and \r
                 pend a read for reading 1 byte */\r
-                result = phLlcNfc_Interface_Read(ps_llc_ctxt,\r
-                                PH_LLCNFC_READWAIT_OFF,\r
+                result = phLlcNfc_Interface_Read(ps_llc_ctxt, \r
+                                PH_LLCNFC_READWAIT_OFF, \r
                                 (uint8_t *)&(\r
-                                ps_recv_pkt->s_llcbuf.llc_length_byte),\r
+                                ps_recv_pkt->s_llcbuf.llc_length_byte), \r
                                 PH_LLCNFC_MIN_BUFLEN_RECVD);\r
             }\r
             else if (((PH_LLCNFC_MIN_BUFLEN_RECVD + 1) < pCompInfo->length) &&\r
-                (PH_LLCNFC_MAX_BUFLEN_RECV_SEND > pCompInfo->length) &&\r
+                (PH_LLCNFC_MAX_BUFLEN_RECV_SEND > pCompInfo->length) && \r
                 (pCompInfo->length == ps_recv_pkt->s_llcbuf.llc_length_byte))\r
             {\r
                 PH_LLCNFC_PRINT("Buffer received : \n");\r
@@ -736,42 +737,42 @@ phLlcNfc_RdResp_Cb(
                 /* Receive is complete, so move the state to INITIALISED */\r
                 if (phLlcNfc_Resend_State != ps_llc_ctxt->state)\r
                 {\r
-                    result = phLlcNfc_H_ChangeState(ps_llc_ctxt,\r
+                    result = phLlcNfc_H_ChangeState(ps_llc_ctxt, \r
                                                     phLlcNfc_Initialised_State);\r
                 }\r
                 /* Copy the received buffer and length */\r
                 ps_recv_pkt->llcbuf_len = (uint8_t)\r
                                 (ps_recv_pkt->s_llcbuf.llc_length_byte + 1);\r
 #if 0\r
-                (void)memcpy(ps_llc_payload, pCompInfo->buffer,\r
+                (void)memcpy(ps_llc_payload, pCompInfo->buffer, \r
                             pCompInfo->length);\r
 #endif\r
 \r
-                /*\r
+                /* \r
                 Check the CRC\r
-                ps_llc_ctxt->s_frameinfo.s_recvpacket.s_llcbuf :\r
-                        consists llc length byte + llc header + data + CRC\r
+                ps_llc_ctxt->s_frameinfo.s_recvpacket.s_llcbuf : \r
+                        consists llc length byte + llc header + data + CRC \r
                         (which needs to be calculated by the below function)\r
-                ps_llc_ctxt->s_frameinfo.s_recvpacket.llcbuf_len :\r
+                ps_llc_ctxt->s_frameinfo.s_recvpacket.llcbuf_len : \r
                         Total length of the above buffer\r
-                ps_llc_ctxt->s_frameinfo.s_recvpacket.llcbuf_len - 2 :\r
-                        -2 because the CRC has to be calculated, only for the\r
-                        bytes which has llc length byte + llc header + data.\r
-                        But total length (llcbuf_len) consists of above mentioned\r
-                        things with 2 byte CRC\r
-                ps_llc_ctxt->s_frameinfo.s_recvpacket.s_llcbuf.sllcpayload.llcpayload :\r
+                ps_llc_ctxt->s_frameinfo.s_recvpacket.llcbuf_len - 2 : \r
+                        -2 because the CRC has to be calculated, only for the \r
+                        bytes which has llc length byte + llc header + data. \r
+                        But total length (llcbuf_len) consists of above mentioned \r
+                        things with 2 byte CRC \r
+                ps_llc_ctxt->s_frameinfo.s_recvpacket.s_llcbuf.sllcpayload.llcpayload : \r
                         consists only data (no length byte and no llc header)\r
-                        (psllcctxt->s_frameinfo.s_recvpacket.llcbuf_len - 4) :\r
+                        (psllcctxt->s_frameinfo.s_recvpacket.llcbuf_len - 4) : \r
                         is the array index of the first CRC byte to be calculated\r
-                        (psllcctxt->s_frameinfo.s_recvpacket.llcbuf_len - 3) :\r
+                        (psllcctxt->s_frameinfo.s_recvpacket.llcbuf_len - 3) : \r
                         is the array index of the second CRC byte to be calculated\r
                 */\r
-                phLlcNfc_H_ComputeCrc((uint8_t *)&(ps_recv_pkt->s_llcbuf),\r
-                                    (ps_recv_pkt->llcbuf_len - 2),\r
+                phLlcNfc_H_ComputeCrc((uint8_t *)&(ps_recv_pkt->s_llcbuf), \r
+                                    (ps_recv_pkt->llcbuf_len - 2), \r
                                     &crc1, &crc2);\r
 \r
                 if ((crc1 == ps_llc_payload->llcpayload[\r
-                            (ps_recv_pkt->llcbuf_len - 4)])\r
+                            (ps_recv_pkt->llcbuf_len - 4)]) \r
                     && (crc2 == ps_llc_payload->llcpayload[\r
                             (ps_recv_pkt->llcbuf_len - 3)]))\r
                 {\r
@@ -779,11 +780,11 @@ phLlcNfc_RdResp_Cb(
                 }\r
 #ifdef LLC_DISABLE_CRC\r
                 else\r
-                {\r
+                {   \r
                     result = phLlcNfc_H_ProRecvFrame(ps_llc_ctxt);\r
                 }\r
 #else\r
-                else if (ps_frame_info->recv_error_count <\r
+                else if (ps_frame_info->recv_error_count < \r
                     PH_LLCNFC_MAX_REJ_RETRY_COUNT)\r
                 {\r
 //                    LOGW("LLC bad crc");\r
@@ -794,9 +795,9 @@ phLlcNfc_RdResp_Cb(
                                     (ps_frame_info->recv_error_count + 1);\r
                     libnfc_llc_error_count++;\r
 \r
-                    result = phLlcNfc_Interface_Read(ps_llc_ctxt,\r
-                        PH_LLCNFC_READWAIT_OFF,\r
-                        (uint8_t *)&(ps_recv_pkt->s_llcbuf.llc_length_byte),\r
+                    result = phLlcNfc_Interface_Read(ps_llc_ctxt, \r
+                        PH_LLCNFC_READWAIT_OFF, \r
+                        (uint8_t *)&(ps_recv_pkt->s_llcbuf.llc_length_byte), \r
                         PH_LLCNFC_BYTES_INIT_READ);\r
 #ifdef CRC_ERROR_REJ\r
                     /* Send REJ (S frame), as the CRC received has error  */\r
@@ -808,61 +809,61 @@ phLlcNfc_RdResp_Cb(
                 else\r
                 {\r
 //                    LOGE("max LLC retries exceeded, stack restart");\r
-                    result = phLlcNfc_Interface_Read (ps_llc_ctxt,\r
-                                PH_LLCNFC_READWAIT_OFF,\r
-                                (uint8_t *)&(ps_recv_pkt->s_llcbuf.llc_length_byte),\r
+                    result = phLlcNfc_Interface_Read (ps_llc_ctxt, \r
+                                PH_LLCNFC_READWAIT_OFF, \r
+                                (uint8_t *)&(ps_recv_pkt->s_llcbuf.llc_length_byte), \r
                                 PH_LLCNFC_BYTES_INIT_READ);\r
 \r
                     /* Raise the exception for CRC error received from the  */\r
-                    notifyinfo.status = PHNFCSTVAL(CID_NFC_LLC,\r
+                    notifyinfo.status = PHNFCSTVAL(CID_NFC_LLC, \r
                                             NFCSTATUS_BOARD_COMMUNICATION_ERROR);\r
 #if 0\r
-                    phOsalNfc_RaiseException(phOsalNfc_e_UnrecovFirmwareErr,1);\r
+                    phOsalNfc_RaiseException(phOsalNfc_e_UnrecovFirmwareErr,1); \r
 #endif /* #if 0 */\r
                         /* Resend done, no answer from the device */\r
                     ps_llc_ctxt->cb_for_if.notify (\r
                                     ps_llc_ctxt->cb_for_if.pif_ctxt,\r
-                                    ps_llc_ctxt->phwinfo,\r
-                                    NFC_NOTIFY_DEVICE_ERROR,\r
+                                    ps_llc_ctxt->phwinfo, \r
+                                    NFC_NOTIFY_DEVICE_ERROR, \r
                                     &notifyinfo);\r
                 }\r
 \r
 #endif /* #ifdef LLC_DISABLE_CRC */\r
             } /* read more than 1 byte */\r
-            else if (ps_frame_info->recv_error_count >=\r
+            else if (ps_frame_info->recv_error_count >= \r
                     PH_LLCNFC_MAX_REJ_RETRY_COUNT)\r
             {\r
- //               LOGE("max LLC retries exceeded, stack restart");\r
-                result = phLlcNfc_Interface_Read (ps_llc_ctxt,\r
-                        PH_LLCNFC_READWAIT_OFF,\r
-                        (uint8_t *)&(ps_recv_pkt->s_llcbuf.llc_length_byte),\r
+//                LOGE("max LLC retries exceeded, stack restart");\r
+                result = phLlcNfc_Interface_Read (ps_llc_ctxt, \r
+                        PH_LLCNFC_READWAIT_OFF, \r
+                        (uint8_t *)&(ps_recv_pkt->s_llcbuf.llc_length_byte), \r
                         PH_LLCNFC_BYTES_INIT_READ);\r
 \r
                 /* Raise the exception for CRC error received from the  */\r
-                notifyinfo.status = PHNFCSTVAL(CID_NFC_LLC,\r
+                notifyinfo.status = PHNFCSTVAL(CID_NFC_LLC, \r
                                         NFCSTATUS_BOARD_COMMUNICATION_ERROR);\r
 #if 0\r
-                phOsalNfc_RaiseException(phOsalNfc_e_UnrecovFirmwareErr,1);\r
+                phOsalNfc_RaiseException(phOsalNfc_e_UnrecovFirmwareErr,1); \r
 #endif /* #if 0 */\r
                     /* Resend done, no answer from the device */\r
                 ps_llc_ctxt->cb_for_if.notify (\r
                                 ps_llc_ctxt->cb_for_if.pif_ctxt,\r
-                                ps_llc_ctxt->phwinfo,\r
-                                NFC_NOTIFY_DEVICE_ERROR,\r
+                                ps_llc_ctxt->phwinfo, \r
+                                NFC_NOTIFY_DEVICE_ERROR, \r
                                 &notifyinfo);\r
             }\r
             else if (((PH_LLCNFC_MIN_BUFLEN_RECVD + 1) < pCompInfo->length) &&\r
-                (PH_LLCNFC_MAX_BUFLEN_RECV_SEND > pCompInfo->length) &&\r
+                (PH_LLCNFC_MAX_BUFLEN_RECV_SEND > pCompInfo->length) && \r
                 (pCompInfo->length != ps_recv_pkt->s_llcbuf.llc_length_byte))\r
             {\r
- //               LOGE("bad LLC length1 %d", pCompInfo->length);\r
+//                LOGE("bad LLC length1 %d", pCompInfo->length);\r
                 ps_frame_info->recv_error_count = (uint8_t)\r
                                     (ps_frame_info->recv_error_count + 1);\r
                 libnfc_llc_error_count++;\r
 \r
-                result = phLlcNfc_Interface_Read(ps_llc_ctxt,\r
-                        PH_LLCNFC_READWAIT_OFF,\r
-                        (uint8_t *)&(ps_recv_pkt->s_llcbuf.llc_length_byte),\r
+                result = phLlcNfc_Interface_Read(ps_llc_ctxt, \r
+                        PH_LLCNFC_READWAIT_OFF, \r
+                        (uint8_t *)&(ps_recv_pkt->s_llcbuf.llc_length_byte), \r
                         PH_LLCNFC_BYTES_INIT_READ);\r
 \r
 #ifdef CRC_ERROR_REJ\r
@@ -876,11 +877,11 @@ phLlcNfc_RdResp_Cb(
                 ((*(pCompInfo->buffer) > (PH_LLCNFC_MAX_BUFLEN_RECV_SEND - 1))\r
                 ||(*(pCompInfo->buffer) <= (PH_LLCNFC_MIN_BUFLEN_RECVD + 1))))\r
             {\r
-                /* Temporary fix for the 0xFF data received\r
+                /* Temporary fix for the 0xFF data received  \r
                     Solution for the read one byte, giving error in buffer\r
-                    PH_LLCNFC_MAX_BUFLEN_RECV_SEND (0x21) is the maximum\r
-                    bytes expected by LLC, if the buffer\r
-                    value is greater than (0x21 - 1), then pend a read to\r
+                    PH_LLCNFC_MAX_BUFLEN_RECV_SEND (0x21) is the maximum \r
+                    bytes expected by LLC, if the buffer \r
+                    value is greater than (0x21 - 1), then pend a read to \r
                     get 1 byte again\r
                 */\r
 //                LOGW("bad LLC length byte %x\n", *(pCompInfo->buffer));\r
@@ -888,32 +889,32 @@ phLlcNfc_RdResp_Cb(
                                     (ps_frame_info->recv_error_count + 1);\r
                 libnfc_llc_error_count++;\r
 \r
-                result = phLlcNfc_Interface_Read(ps_llc_ctxt,\r
-                        PH_LLCNFC_READWAIT_OFF,\r
-                        (uint8_t *)&(ps_recv_pkt->s_llcbuf.llc_length_byte),\r
+                result = phLlcNfc_Interface_Read(ps_llc_ctxt, \r
+                        PH_LLCNFC_READWAIT_OFF, \r
+                        (uint8_t *)&(ps_recv_pkt->s_llcbuf.llc_length_byte), \r
                         PH_LLCNFC_BYTES_INIT_READ);\r
             }\r
             else\r
             {\r
-  //              LOGW("unknown LLC error1");\r
+//                LOGW("unknown LLC error1");\r
                 ps_frame_info->recv_error_count = (uint8_t)\r
                                     (ps_frame_info->recv_error_count + 1);\r
                 libnfc_llc_error_count++;\r
 \r
-                phLlcNfc_StopTimers(PH_LLCNFC_GUARDTIMER,\r
+                phLlcNfc_StopTimers(PH_LLCNFC_GUARDTIMER, \r
                                     ps_llc_ctxt->s_timerinfo.guard_to_count);\r
-                pCompInfo->status = PHNFCSTVAL(CID_NFC_LLC,\r
+                pCompInfo->status = PHNFCSTVAL(CID_NFC_LLC, \r
                                                 NFCSTATUS_INVALID_FORMAT);\r
                 pCompInfo->buffer = NULL;\r
                 pCompInfo->length = 0;\r
-                result = phLlcNfc_Interface_Read(ps_llc_ctxt,\r
-                        PH_LLCNFC_READWAIT_OFF,\r
-                        (uint8_t *)&(ps_recv_pkt->s_llcbuf.llc_length_byte),\r
+                result = phLlcNfc_Interface_Read(ps_llc_ctxt, \r
+                        PH_LLCNFC_READWAIT_OFF, \r
+                        (uint8_t *)&(ps_recv_pkt->s_llcbuf.llc_length_byte), \r
                         PH_LLCNFC_BYTES_INIT_READ);\r
                 if (NULL != ps_llc_ctxt->cb_for_if.receive_complete)\r
                 {\r
                     ps_llc_ctxt->cb_for_if.receive_complete(\r
-                                        ps_llc_ctxt->cb_for_if.pif_ctxt,\r
+                                        ps_llc_ctxt->cb_for_if.pif_ctxt, \r
                                         pHwInfo, pCompInfo);\r
                 }\r
             }\r
@@ -931,29 +932,29 @@ phLlcNfc_RdResp_Cb(
         }\r
         else\r
         {\r
- //           LOGW("unknown LLC error2");\r
+//            LOGW("unknown LLC error2");\r
             ps_frame_info->recv_error_count = (uint8_t)\r
                                     (ps_frame_info->recv_error_count + 1);\r
             libnfc_llc_error_count++;\r
 \r
-            phLlcNfc_StopTimers(PH_LLCNFC_GUARDTIMER,\r
+            phLlcNfc_StopTimers(PH_LLCNFC_GUARDTIMER, \r
                                 ps_llc_ctxt->s_timerinfo.guard_to_count);\r
             PH_LLCNFC_DEBUG("Status Error : 0x%x\n", pCompInfo->status);\r
             if (NULL != ps_llc_ctxt->cb_for_if.receive_complete)\r
             {\r
                 ps_llc_ctxt->cb_for_if.receive_complete(\r
-                                    ps_llc_ctxt->cb_for_if.pif_ctxt,\r
+                                    ps_llc_ctxt->cb_for_if.pif_ctxt, \r
                                     pHwInfo, pCompInfo);\r
             }\r
         }\r
     }\r
     else\r
     {\r
-        if ((NULL != ps_llc_ctxt) && (NULL != pCompInfo)\r
+        if ((NULL != ps_llc_ctxt) && (NULL != pCompInfo) \r
             && (NULL != ps_llc_ctxt->cb_for_if.receive_complete))\r
         {\r
             ps_llc_ctxt->cb_for_if.receive_complete(\r
-                                    ps_llc_ctxt->cb_for_if.pif_ctxt,\r
+                                    ps_llc_ctxt->cb_for_if.pif_ctxt, \r
                                     pHwInfo, pCompInfo);\r
         }\r
     }\r
@@ -961,7 +962,7 @@ phLlcNfc_RdResp_Cb(
     PH_LLCNFC_PRINT("\n\nLLC : READ RESP CB END\n\n");\r
 }\r
 \r
-void\r
+void \r
 phLlcNfc_H_SendInfo (\r
                     phLlcNfc_Context_t          *psLlcCtxt\r
                     )\r
@@ -973,13 +974,13 @@ phLlcNfc_H_SendInfo (
     ps_frame_info = &(psLlcCtxt->s_frameinfo);\r
     ps_recv_pkt = &(ps_frame_info->s_recvpacket);\r
 \r
-    if ((ps_recv_pkt->llcbuf_len > 0) &&\r
+    if ((ps_recv_pkt->llcbuf_len > 0) && \r
         (ps_recv_pkt->llcbuf_len <= PH_LLCNFC_MAX_LLC_PAYLOAD))\r
     {\r
         comp_info.status = NFCSTATUS_SUCCESS;\r
         /* Chop the extra Llc bytes received */\r
 #if 0\r
-        comp_info.length = (ps_recv_pkt->llcbuf_len -\r
+        comp_info.length = (ps_recv_pkt->llcbuf_len - \r
                             PH_LLCNFC_LEN_APPEND);\r
 #else\r
         comp_info.length = (uint16_t)psLlcCtxt->recvbuf_length;\r
@@ -989,7 +990,7 @@ phLlcNfc_H_SendInfo (
         {\r
 #if 0\r
             (void)memcpy ((void *)psLlcCtxt->precv_buf, (void *)(\r
-                        ps_recv_pkt->s_llcbuf.sllcpayload.llcpayload),\r
+                        ps_recv_pkt->s_llcbuf.sllcpayload.llcpayload), \r
                         comp_info.length);\r
 #endif /* #if 0 */\r
             comp_info.buffer = psLlcCtxt->precv_buf;\r
@@ -1001,32 +1002,32 @@ phLlcNfc_H_SendInfo (
     }\r
     else\r
     {\r
-        comp_info.status = PHNFCSTVAL(CID_NFC_LLC,\r
+        comp_info.status = PHNFCSTVAL(CID_NFC_LLC, \r
                                     NFCSTATUS_INVALID_FORMAT);\r
         comp_info.length = 0;\r
         comp_info.buffer = NULL;\r
     }\r
 \r
-    (void)phLlcNfc_Interface_Read(psLlcCtxt,\r
-                        PH_LLCNFC_READWAIT_OFF,\r
+    (void)phLlcNfc_Interface_Read(psLlcCtxt, \r
+                        PH_LLCNFC_READWAIT_OFF, \r
                         &(ps_recv_pkt->s_llcbuf.llc_length_byte),\r
                         (uint8_t)PH_LLCNFC_BYTES_INIT_READ);\r
 \r
-    if ((NFCSTATUS_SUCCESS == comp_info.status) &&\r
+    if ((NFCSTATUS_SUCCESS == comp_info.status) && \r
         (0 == comp_info.length))\r
     {\r
-        /* May be a NULL I frame received from PN544, so dont do\r
+        /* May be a NULL I frame received from PN544, so dont do \r
             any thing */\r
     }\r
     else\r
     {\r
-        if ((NULL != psLlcCtxt->cb_for_if.receive_complete) &&\r
+        if ((NULL != psLlcCtxt->cb_for_if.receive_complete) && \r
             (TRUE == ps_frame_info->upper_recv_call))\r
         {\r
             ps_frame_info->upper_recv_call = FALSE;\r
             psLlcCtxt->cb_for_if.receive_complete(\r
-                                psLlcCtxt->cb_for_if.pif_ctxt,\r
-                                psLlcCtxt->phwinfo,\r
+                                psLlcCtxt->cb_for_if.pif_ctxt, \r
+                                psLlcCtxt->phwinfo, \r
                                 &comp_info);\r
         }\r
         else\r
@@ -1034,9 +1035,9 @@ phLlcNfc_H_SendInfo (
             if (NULL != psLlcCtxt->cb_for_if.notify)\r
             {\r
                     psLlcCtxt->cb_for_if.notify(\r
-                            psLlcCtxt->cb_for_if.pif_ctxt,\r
-                            psLlcCtxt->phwinfo,\r
-                            NFC_NOTIFY_RECV_COMPLETED,\r
+                            psLlcCtxt->cb_for_if.pif_ctxt, \r
+                            psLlcCtxt->phwinfo, \r
+                            NFC_NOTIFY_RECV_COMPLETED, \r
                             &comp_info);\r
             }\r
         }\r
index a33acb7..3655990 100644 (file)
@@ -1,6 +1,5 @@
 /*\r
- * Copyright (C) 2010 NXP Semiconductors
- * Copyright (C) 2012 Samsung Elevtronics Co., Ltd\r
+ * Copyright (C) 2010 NXP Semiconductors\r
  *\r
  * Licensed under the Apache License, Version 2.0 (the "License");\r
  * you may not use this file except in compliance with the License.\r
@@ -59,7 +58,7 @@
 \r
 #ifdef PIGGY_BACK\r
 \r
-#define PH_LLCNFC_ACK_TO_VALUE              1000\r
+#define PH_LLCNFC_ACK_TO_VALUE              LINK_ACK_TIMEOUT\r
 \r
 #endif /* #ifdef PIGGY_BACK */\r
 \r
@@ -95,7 +94,7 @@
 * \retval NFCSTATUS_INVALID_PARAMETER       At least one parameter of the function is invalid.\r
 *\r
 */\r
-NFCSTATUS\r
+NFCSTATUS \r
 phLlcNfc_TimerInit (\r
     phLlcNfc_Context_t  *psLlcCtxt\r
 );\r
@@ -113,7 +112,7 @@ phLlcNfc_TimerInit (
 * \retval NFCSTATUS_INVALID_PARAMETER       At least one parameter of the function is invalid.\r
 *\r
 */\r
-void\r
+void \r
 phLlcNfc_TimerUnInit (\r
     phLlcNfc_Context_t  *psLlcCtxt\r
 );\r
@@ -127,7 +126,7 @@ phLlcNfc_TimerUnInit (
 *\r
 *\r
 */\r
-void\r
+void \r
 phLlcNfc_CreateTimers (void);\r
 \r
 /**\r
@@ -145,9 +144,9 @@ phLlcNfc_CreateTimers (void);
 * \retval Others                            Errors related to OsalNfc.\r
 *\r
 */\r
-NFCSTATUS\r
+NFCSTATUS \r
 phLlcNfc_StartTimers (\r
-    uint8_t             TimerType,\r
+    uint8_t             TimerType, \r
     uint8_t             ns_value\r
 );\r
 \r
@@ -159,14 +158,14 @@ phLlcNfc_StartTimers (
 * \copydoc page_reg stop the timer type given by the user\r
 *\r
 * \param[in] TimerType              Timer type to start\r
-* \param[in] no_of_gaurd_to_del     Guard time-out count shall be decreased as and when\r
+* \param[in] no_of_gaurd_to_del     Guard time-out count shall be decreased as and when  \r
 *                                   frame is removed\r
 *\r
 *\r
 */\r
-void\r
+void \r
 phLlcNfc_StopTimers (\r
-    uint8_t             TimerType,\r
+    uint8_t             TimerType, \r
     uint8_t             no_of_guard_to_del\r
 );\r
 \r
@@ -181,7 +180,7 @@ phLlcNfc_StopTimers (
 *\r
 *\r
 */\r
-void\r
+void \r
 phLlcNfc_StopAllTimers (void);\r
 \r
 \r
@@ -197,7 +196,7 @@ phLlcNfc_StopAllTimers (void);
 * \retval Others                            Errors related to OsalNfc.\r
 *\r
 */\r
-void\r
+void \r
 phLlcNfc_DeleteTimer (void);\r
 \r
 #ifdef LLC_URSET_NO_DELAY\r
@@ -206,7 +205,7 @@ phLlcNfc_DeleteTimer (void);
 \r
 #else /* #ifdef LLC_URSET_NO_DELAY */\r
 \r
-void\r
+void \r
 phLlcNfc_URSET_Delay_Notify (\r
 \r
     uint32_t            delay_id);\r