Latest NFC stack-drop from Broadcom.

Patches provided by Evan Chu <evanchu@broadcom.com> and
Paul Chaisson <pchaisson@broadcom.com>.

Most important changes:
- Support for BCM20793B4 and BCM20793B5 revisions in the HAL.
- Remove connection handover and SNEP implementations, since
  we already have them in java-land.
- Fix issue where the NFCC is not woken for HCI writes.
- Remove a lot of duplicated code in the HAL.
- Various small fixes.

Change-Id: I00f7457fe7ec23602071532a15bf2be9d7706b37
diff --git a/src/include/nfc_target.h b/src/include/nfc_target.h
index 1ec7e57..bfe0f4e 100755
--- a/src/include/nfc_target.h
+++ b/src/include/nfc_target.h
@@ -129,6 +129,16 @@
 #endif
 
 
+/* NCI msg pool for HAL (for shared NFC/HAL GKI)*/
+#ifndef NFC_HAL_NCI_POOL_ID
+#define NFC_HAL_NCI_POOL_ID         NFC_NCI_POOL_ID
+#endif
+
+#ifndef NFC_HAL_NCI_POOL_BUF_SIZE
+#define NFC_HAL_NCI_POOL_BUF_SIZE   NFC_NCI_POOL_BUF_SIZE
+#endif
+
+
 /******************************************************************************
 **
 ** NCI Transport definitions
@@ -177,9 +187,6 @@
 #endif
 
 /* Define to TRUE to include not openned Broadcom Vendor Specific implementation */
-#ifndef NFC_BRCM_NOT_OPEN_INCLUDED
-#define NFC_BRCM_NOT_OPEN_INCLUDED  FALSE  //Android requires FALSE
-#endif
 
 /* Define to TRUE if compling for NFC Reader/Writer Only mode */
 #ifndef NFC_RW_ONLY
@@ -335,27 +342,6 @@
 #define CE_TEST_INCLUDED            FALSE
 #endif
 
-#if (NFC_BRCM_NOT_OPEN_INCLUDED == TRUE)
-/* Power cycle NFCC to move full power mode from CE low power mode */
-#ifndef NFC_LP_POWER_CYCLE_TO_FULL
-#define NFC_LP_POWER_CYCLE_TO_FULL  TRUE
-#endif
-
-/* Parameter for low power mode command    */
-#ifndef NFC_LP_COMMAND_PARAMS
-#define NFC_LP_COMMAND_PARAMS       5
-#endif
-
-/* Primary Threshold for battery monitor   */
-#ifndef NFC_LP_PRIMARY_THRESHOLD
-#define NFC_LP_PRIMARY_THRESHOLD    0
-#endif
-
-/* Secondary Threshold for battery monitor */
-#ifndef NFC_LP_SECONDARY_THRESHOLD
-#define NFC_LP_SECONDARY_THRESHOLD  8
-#endif
-#endif
 
 /* Quick Timer */
 #ifndef QUICK_TIMER_TICKS_PER_SEC
@@ -527,9 +513,9 @@
 #define NFA_P2P_INCLUDED            TRUE
 #endif
 
-/* Timeout for waiting on other host in HCI Network to initialize */
-#ifndef NFA_HCI_NETWK_INIT_TIMEOUT
-#define NFA_HCI_NETWK_INIT_TIMEOUT  400
+/* Maximum Idle time (no hcp) to wait for EE DISC REQ Ntf(s) */
+#ifndef NFA_HCI_NETWK_INIT_IDLE_TIMEOUT
+#define NFA_HCI_NETWK_INIT_IDLE_TIMEOUT  1000
 #endif
 
 #ifndef NFA_HCI_MAX_HOST_IN_NETWORK
@@ -552,8 +538,8 @@
 #endif
 
 /* Timeout for waiting for the response to HCP Command packet */
-#ifndef NFA_HCI_CMD_RSP_TIMEOUT
-#define NFA_HCI_CMD_RSP_TIMEOUT    1000
+#ifndef NFA_HCI_RESPONSE_TIMEOUT
+#define NFA_HCI_RESPONSE_TIMEOUT    1000
 #endif
 
 /* Default poll duration (may be over-ridden using NFA_SetRfDiscoveryDuration) */
@@ -576,6 +562,11 @@
 #define NFA_DM_AUTO_PRESENCE_CHECK   FALSE  /* Android requires FALSE */
 #endif
 
+/* Default delay to auto presence check after sending raw frame */
+#ifndef NFA_DM_DEFAULT_PRESENCE_CHECK_START_DELAY
+#define NFA_DM_DEFAULT_PRESENCE_CHECK_START_DELAY   750
+#endif
+
 /* Time to restart discovery after deactivated */
 #ifndef NFA_DM_DISC_DELAY_DISCOVERY
 #define NFA_DM_DISC_DELAY_DISCOVERY     1000
@@ -593,7 +584,7 @@
 #endif
 
 #ifndef NFA_CHO_INCLUDED
-#define NFA_CHO_INCLUDED            TRUE
+#define NFA_CHO_INCLUDED            FALSE /* Anddroid must use FALSE to exclude CHO */
 #endif
 
 /* MIU for CHO              */
@@ -626,7 +617,7 @@
 #endif
 
 #ifndef NFA_SNEP_INCLUDED
-#define NFA_SNEP_INCLUDED               TRUE
+#define NFA_SNEP_INCLUDED               FALSE /* Android must use FALSE to exclude SNEP */
 #endif
 
 /* Max acceptable length */
@@ -673,6 +664,19 @@
 #define NFA_DTA_INCLUDED            TRUE
 #endif
 
+
+/*****************************************************************************
+**  Define HAL_WRITE depending on whether HAL is using shared GKI resources
+**  as the NFC stack.
+*****************************************************************************/
+#ifndef HAL_WRITE
+#define HAL_WRITE(p)    {nfc_cb.p_hal->write(p->len, (UINT8 *)(p+1) + p->offset); GKI_freebuf(p);}
+
+
+
+#endif /* HAL_WRITE */
+
+
 #endif /* NFC_TARGET_H */