NOSP-NGEN-artf221204-Taken-patches-as-per-the-list-f
diff --git a/src/nfa/dm/nfa_dm_act.c b/src/nfa/dm/nfa_dm_act.c
index 89fc2cb..560dc1a 100755
--- a/src/nfa/dm/nfa_dm_act.c
+++ b/src/nfa/dm/nfa_dm_act.c
@@ -430,7 +430,7 @@
 
     case NFC_GEN_ERROR_REVT:                     /* generic error command or notification */
 #if(NXP_EXTNS == TRUE)
-        if (p_data->status == 0xE4) //STATUS_EMVCO_PCD_COLLISION
+        if (p_data->status == NXP_NFC_EMVCO_PCD_COLLISION_DETECTED) //STATUS_EMVCO_PCD_COLLISION
         {
             dm_cback_data.status = p_data->status;
             (*nfa_dm_cb.p_dm_cback) (NFA_DM_EMVCO_PCD_COLLISION_EVT, &dm_cback_data);
@@ -485,8 +485,10 @@
         {
             dm_cback_data.status = p_data->status;
         }
-#endif
+        dm_cback_evt = NFA_DM_NFCC_TRANSPORT_ERR_EVT;
+#else
         dm_cback_evt = (event == NFC_NFCC_TIMEOUT_REVT) ? NFA_DM_NFCC_TIMEOUT_EVT : NFA_DM_NFCC_TRANSPORT_ERR_EVT;
+#endif
         (*nfa_dm_cb.p_dm_cback) (dm_cback_evt, NULL);
         break;
 
diff --git a/src/nfa/hci/nfa_hci_act.c b/src/nfa/hci/nfa_hci_act.c
index d9a70c8..60db1b3 100755
--- a/src/nfa/hci/nfa_hci_act.c
+++ b/src/nfa/hci/nfa_hci_act.c
@@ -2526,6 +2526,7 @@
             }
             else
             {
+                status = NFA_STATUS_OK;
                 NFA_TRACE_DEBUG0 ("nfa_hci_api_config_nfcee - APDU Gate is present and pipe is already created!!!");
             }
     }
@@ -3178,7 +3179,7 @@
             return;
         }
     }
-    if (pipeId == 0x00)
+    if (pipeId == NULL)
     {
         /* Invalid pipe ID */
         NFA_TRACE_ERROR1 ("nfa_hci_handle_Nfcee_dynpipe_rsp - Unknown pipe %d",pipeId);
diff --git a/src/nfa/hci/nfa_hci_main.c b/src/nfa/hci/nfa_hci_main.c
index fc1eacd..a8751e0 100755
--- a/src/nfa/hci/nfa_hci_main.c
+++ b/src/nfa/hci/nfa_hci_main.c
@@ -461,7 +461,7 @@
         }
     }
 #if(NXP_EXTNS == TRUE)
-    if (validated_gate_count != gate_count && xx < NFA_HCI_MAX_PIPE_CB)
+    if (validated_gate_count != gate_count && xx > NFA_HCI_MAX_PIPE_CB)
     {
         NFA_TRACE_EVENT1 ("nfa_hci_is_valid_cfg  Invalid Gate: %u", nfa_hci_cb.cfg.dyn_pipes[xx].local_gate);
         return FALSE;
@@ -657,6 +657,7 @@
 #if(NXP_EXTNS == TRUE)
         if (send_host_list)
 #endif
+            /* Received EE DISC REQ Ntf(s) */
             nfa_hciu_send_get_param_cmd (NFA_HCI_ADMIN_PIPE, NFA_HCI_HOST_LIST_INDEX);
     }
 }
@@ -1233,14 +1234,12 @@
         }
         else
         {
-            if(!((pipe == NFA_HCI_CONN_UICC_PIPE ||
-                  pipe == NFA_HCI_CONN_ESE_PIPE
+            if(!((pipe == NFA_HCI_CONN_UICC_PIPE || pipe == NFA_HCI_CONN_ESE_PIPE
 #if(NFC_NXP_STAT_DUAL_UICC_WO_EXT_SWITCH == TRUE)
                   || pipe == NFA_HCI_CONN_UICC2_PIPE
 #endif
-                  ) &&
-                  (nfa_hci_cb.inst_evt == NFA_HCI_EVT_TRANSACTION ||
-                  nfa_hci_cb.inst_evt == NFA_HCI_EVT_CONNECTIVITY)))
+                 ) && (nfa_hci_cb.inst_evt == NFA_HCI_EVT_TRANSACTION ||
+                      nfa_hci_cb.inst_evt == NFA_HCI_EVT_CONNECTIVITY)))
             {
                 /*Stop timer and goto IDLE state when pipe is not connectivity but event received is connectivity*/
                 nfa_sys_stop_timer (&nfa_hci_cb.timer);
diff --git a/src/nfa/hci/nfa_hci_utils.c b/src/nfa/hci/nfa_hci_utils.c
index 1cf00cb..367560f 100755
--- a/src/nfa/hci/nfa_hci_utils.c
+++ b/src/nfa/hci/nfa_hci_utils.c
@@ -292,11 +292,14 @@
             if (nfa_hciu_find_gate_by_gid (gate_id) == NULL)
                 break;
         }
+#if(NXP_EXTNS == TRUE)
+#else
         if (gate_id > NFA_HCI_LAST_PROP_GATE)
         {
             NFA_TRACE_ERROR2 ("nfa_hci_alloc_gate - no free Gate ID: %u  App Handle: 0x%04x", gate_id, app_handle);
             return (NULL);
         }
+#endif
     }
 
     /* Now look for a free control block */
diff --git a/src/nfc/include/nfc_api.h b/src/nfc/include/nfc_api.h
index 6c99037..cf18895 100755
--- a/src/nfc/include/nfc_api.h
+++ b/src/nfc/include/nfc_api.h
@@ -132,13 +132,14 @@
   * NFC Config Parameter IDs defined by NXP NFC
   **********************************************/
 #define NXP_NFC_SET_CONFIG_PARAM_EXT        ((unsigned char)0xA0)   /* NXP NFC set config extension ID*/
-#define NXP_NFC_PARAM_ID_SWP1               ((unsigned char)0xEC)   /*SWP1 parameter ID  UICC*/
-#define NXP_NFC_PARAM_ID_SWP2               ((unsigned char)0xED)   /*SWP1 parameter ID  ESE */
-#define NXP_NFC_PARAM_ID_SWP1A              ((unsigned char)0xD4)   /*SWP1 parameter ID  UICC2 */
-#define NXP_NFC_PARAM_ID_NDEF_NFCEE         ((unsigned char)0x95)   /*SWP1 parameter ID  NDEF NFCEE */
+#define NXP_NFC_PARAM_ID_SWP1               ((unsigned char)0xEC)   /* SWP1 parameter ID  UICC*/
+#define NXP_NFC_PARAM_ID_SWP2               ((unsigned char)0xED)   /* SWP1 parameter ID  ESE */
+#define NXP_NFC_PARAM_ID_SWP1A              ((unsigned char)0xD4)   /* SWP1 parameter ID  UICC2 */
+#define NXP_NFC_PARAM_ID_NDEF_NFCEE         ((unsigned char)0x95)   /* SWP1 parameter ID  NDEF NFCEE */
 #define NXP_NFC_PARAM_ID_RF_PARAM_UICC      ((unsigned char)0xEF)   /* UICC CE RF parameter  */
 #define NXP_NFC_PARAM_ID_RF_PARAM_ESE       ((unsigned char)0xF0)   /* ESE RF parameter   */
 #define NXP_NFC_PARAM_ID_NFCC_RF_CONFIG     ((unsigned char)0x9B)   /* NFCC RF config parameter*/
+#define NXP_NFC_EMVCO_PCD_COLLISION_DETECTED ((unsigned char)0xE4)  /* Core generic error for EMVCO collision detected */
 #define NXP_NFC_PARAM_ID_RF_PARAM_UICC2     ((unsigned char)0xE8)   /* UICC2 CE RF parameter  */
 #define NXP_NFC_PARAM_SWP_SESSIONID_INT2    ((unsigned char)0xEB)   /* param for retrieveing HCI session ID for ESE */
 #define NXP_NFC_PARAM_SWP_SESSIONID_INT1    ((unsigned char)0xEA)   /* param for retrieveing HCI session ID for UICC */
diff --git a/src/nfc/nfc/nfc_ncif.c b/src/nfc/nfc/nfc_ncif.c
index 07b565b..6cd550e 100644
--- a/src/nfc/nfc/nfc_ncif.c
+++ b/src/nfc/nfc/nfc_ncif.c
@@ -459,8 +459,12 @@
     /* try to send the first data packet in the tx queue  */
     p_data = (BT_HDR *)GKI_getfirst (&p_cb->tx_q);
 
-    /* post data fragment to NCIT task as credits are available */
-    while (p_data && (p_data->len >= 0) && (p_cb->num_buff > 0))
+#if(NXP_EXTNS == TRUE)
+     /* post data fragment to NCIT task as credits are available */
+     while (p_data && (p_cb->num_buff > 0))
+#else
+     while (p_data && (p_data->len >= 0) && (p_cb->num_buff > 0))
+#endif
     {
         if (p_data->len <= buffer_size)
         {
diff --git a/src/nfc/tags/rw_t3t.c b/src/nfc/tags/rw_t3t.c
index bf44026..746e971 100644
--- a/src/nfc/tags/rw_t3t.c
+++ b/src/nfc/tags/rw_t3t.c
@@ -2421,7 +2421,7 @@
         else if(p_data)
             rw_t3t_process_error (p_data->status);
 #if(NXP_EXTNS == TRUE)
-        if(p_data != NULL)
+        if((p_data != NULL) && (p_data->data.p_data != NULL))
         {
             RW_TRACE_DEBUG0 ("rw_t3t_conn_cback: free GKI buffer");
             GKI_freebuf ((BT_HDR *)(p_data->data.p_data));