merge in mnc-release history after reset to mnc-dev
diff --git a/bta/dm/bta_dm_act.c b/bta/dm/bta_dm_act.c
index 8f54d7a..23dd0a1 100644
--- a/bta/dm/bta_dm_act.c
+++ b/bta/dm/bta_dm_act.c
@@ -2728,9 +2728,10 @@
         memcpy(p_auth_cmpl->key, key, LINK_KEY_LEN);
         sec_event.auth_cmpl.fail_reason = HCI_SUCCESS;
 
+#if BLE_INCLUDED == TRUE
         // Report the BR link key based on the BR/EDR address and type
         BTM_ReadDevInfo(bd_addr, &sec_event.auth_cmpl.dev_type, &sec_event.auth_cmpl.addr_type);
-
+#endif
         if(bta_dm_cb.p_sec_cback)
             bta_dm_cb.p_sec_cback(event, &sec_event);
     }
@@ -2765,8 +2766,10 @@
         memcpy(sec_event.auth_cmpl.bd_name, bd_name, (BD_NAME_LEN-1));
         sec_event.auth_cmpl.bd_name[BD_NAME_LEN-1] = 0;
 
+#if BLE_INCLUDED == TRUE
         // Report the BR link key based on the BR/EDR address and type
         BTM_ReadDevInfo(bd_addr, &sec_event.auth_cmpl.dev_type, &sec_event.auth_cmpl.addr_type);
+#endif
         sec_event.auth_cmpl.fail_reason = (UINT8)result;
 
         if(bta_dm_cb.p_sec_cback)
@@ -4385,7 +4388,9 @@
 
         case BTM_LE_COMPLT_EVT:
             bdcpy(sec_event.auth_cmpl.bd_addr, bda);
+#if BLE_INCLUDED == TRUE
             BTM_ReadDevInfo(bda, &sec_event.auth_cmpl.dev_type, &sec_event.auth_cmpl.addr_type);
+#endif
             p_name = BTM_SecReadDevName(bda);
             if (p_name != NULL)
             {
diff --git a/btif/src/btif_dm.c b/btif/src/btif_dm.c
index ddb77b0..7b96bc9 100644
--- a/btif/src/btif_dm.c
+++ b/btif/src/btif_dm.c
@@ -130,6 +130,7 @@
 typedef struct
 {
     bt_bond_state_t state;
+    bt_bdaddr_t static_bdaddr;
     BD_ADDR bd_addr;
     UINT8 bond_type;
     UINT8 pin_code_len;
@@ -143,7 +144,6 @@
 #if (defined(BLE_INCLUDED) && (BLE_INCLUDED == TRUE))
     BOOLEAN is_le_only;
     BOOLEAN is_le_nc; /* LE Numeric comparison */
-    bt_bdaddr_t static_bdaddr;
     btif_dm_ble_cb_t ble;
 #endif
 } btif_dm_pairing_cb_t;
@@ -1115,7 +1115,9 @@
     // Skip SDP for certain  HID Devices
     if (p_auth_cmpl->success)
     {
+#if BLE_INCLUDED == TRUE
         btif_storage_set_remote_addr_type(&bd_addr, p_auth_cmpl->addr_type);
+#endif
         btif_update_remote_properties(p_auth_cmpl->bd_addr,
                                       p_auth_cmpl->bd_name, NULL, p_auth_cmpl->dev_type);
         pairing_cb.timeout_retries = 0;
@@ -1152,6 +1154,8 @@
         {
             /* Trigger SDP on the device */
             pairing_cb.sdp_attempts = 1;;
+
+#if BLE_INCLUDED == TRUE
             /* If bonded due to cross-key, save the static address too*/
             if(pairing_cb.state == BT_BOND_STATE_BONDING &&
               (bdcmp(p_auth_cmpl->bd_addr, pairing_cb.bd_addr) != 0))
@@ -1160,6 +1164,7 @@
                                  __func__);
                 bdcpy(pairing_cb.static_bdaddr.address, p_auth_cmpl->bd_addr);
             }
+#endif
 
             if(btif_dm_inquiry_in_progress)
                 btif_dm_cancel_discovery();
diff --git a/stack/btm/btm_dev.c b/stack/btm/btm_dev.c
index faae4f5..8817101 100644
--- a/stack/btm/btm_dev.c
+++ b/stack/btm/btm_dev.c
@@ -441,12 +441,14 @@
                 if (!memcmp (p_dev_rec->bd_addr, bd_addr, BD_ADDR_LEN))
                     return(p_dev_rec);
 
+#if BLE_INCLUDED == TRUE
                 // If a LE random address is looking for device record
                 if (!memcmp(p_dev_rec->ble.pseudo_addr, bd_addr, BD_ADDR_LEN))
                     return (p_dev_rec);
 
                 if (btm_ble_addr_resolvable(bd_addr, p_dev_rec))
                     return(p_dev_rec);
+#endif
             }
         }
     }
@@ -464,6 +466,7 @@
 *******************************************************************************/
 void btm_consolidate_dev(tBTM_SEC_DEV_REC *p_target_rec)
 {
+#if BLE_INCLUDED == TRUE
     tBTM_SEC_DEV_REC *p_dev_rec = &btm_cb.sec_dev_rec[0];
     tBTM_SEC_DEV_REC temp_rec = *p_target_rec;
     BD_ADDR dummy_bda = {0};
@@ -478,8 +481,8 @@
             {
                 memcpy(p_target_rec, p_dev_rec, sizeof(tBTM_SEC_DEV_REC));
                 p_target_rec->ble = temp_rec.ble;
-                p_target_rec->enc_key_size = temp_rec.enc_key_size;
                 p_target_rec->ble_hci_handle = temp_rec.ble_hci_handle;
+                p_target_rec->enc_key_size = temp_rec.enc_key_size;
                 p_target_rec->conn_params = temp_rec.conn_params;
                 p_target_rec->device_type |= temp_rec.device_type;
                 p_target_rec->sec_flags |= temp_rec.sec_flags;
@@ -504,6 +507,7 @@
             }
         }
     }
+#endif
 }
 
 /*******************************************************************************
diff --git a/stack/btm/btm_int.h b/stack/btm/btm_int.h
index d56d261..2f3cea9 100644
--- a/stack/btm/btm_int.h
+++ b/stack/btm/btm_int.h
@@ -573,12 +573,9 @@
                                         /* HCI_IO_CAPABILITY_REQUEST_EVT from the peer before */
                                         /* it knows peer's support for Secure Connections */
 
-#if (BLE_INCLUDED == TRUE)
     UINT16              ble_hci_handle;         /* use in DUMO connection */
     UINT8               enc_key_size;           /* current link encryption key size */
-    tBTM_SEC_BLE        ble;
     tBT_DEVICE_TYPE     device_type;
-    tBTM_LE_CONN_PRAMS  conn_params;
     BOOLEAN             new_encryption_key_is_p256; /* Set to TRUE when the newly generated LK
                                                     ** is generated from P-256.
                                                     ** Link encrypted with such LK can be used
@@ -587,6 +584,10 @@
     BOOLEAN no_smp_on_br;       /* if set to TRUE then SMP on BR/EDR doesn't */
                                 /* work, i.e. link keys crosspairing */
                                 /* SC BR/EDR->SC LE doesn't happen */
+
+#if BLE_INCLUDED == TRUE
+    tBTM_SEC_BLE        ble;
+    tBTM_LE_CONN_PRAMS  conn_params;
 #endif
 
 // btla-specific ++
diff --git a/stack/btm/btm_sec.c b/stack/btm/btm_sec.c
index 33d0efc..309ae82 100644
--- a/stack/btm/btm_sec.c
+++ b/stack/btm/btm_sec.c
@@ -5873,9 +5873,11 @@
     {
         p_dev_rec->p_callback = NULL;
 
+#if BLE_INCLUDED == TRUE
         if (is_le_transport)
            (*p_callback) (p_dev_rec->ble.pseudo_addr, BT_TRANSPORT_LE, p_dev_rec->p_ref_data, res);
         else
+#endif
            (*p_callback) (p_dev_rec->bd_addr, BT_TRANSPORT_BR_EDR, p_dev_rec->p_ref_data, res);
     }
 
@@ -6131,7 +6133,6 @@
     tBTM_SEC_QUEUE_ENTRY    *p_e;
     BUFFER_Q                *bq = &btm_cb.sec_pending_q;
     UINT8                   res = encr_enable ? BTM_SUCCESS : BTM_ERR_PROCESSING;
-    UINT8                   sec_act ;
 
     p_e = (tBTM_SEC_QUEUE_ENTRY *)GKI_getfirst(bq);
 
@@ -6143,7 +6144,9 @@
 #endif
             )
         {
-            sec_act = *(UINT8 *)(p_e->p_ref_data);
+#if BLE_INCLUDED == TRUE
+            UINT8 sec_act = *(UINT8 *)(p_e->p_ref_data);
+#endif
 
             if (encr_enable == 0 || transport == BT_TRANSPORT_BR_EDR
 #if BLE_INCLUDED == TRUE
@@ -6178,7 +6181,6 @@
     return cur_security | sec_level4_flags;
 }
 
-#if (BLE_INCLUDED == TRUE)
 /*******************************************************************************
 **
 ** Function         btm_sec_clear_ble_keys
@@ -6220,8 +6222,10 @@
     BOOLEAN is_bonded= FALSE;
 
     if (p_dev_rec &&
-#if (SMP_INCLUDED== TRUE)
+#if (SMP_INCLUDED == TRUE)
         ((p_dev_rec->ble.key_type && (p_dev_rec->sec_flags & BTM_SEC_LE_LINK_KEY_KNOWN))||
+#else
+        (
 #endif
          (p_dev_rec->sec_flags & BTM_SEC_LINK_KEY_KNOWN)))
     {
@@ -6340,5 +6344,3 @@
     return (p && (p->link_role == BTM_ROLE_MASTER));
 }
 
-#endif /* BLE_INCLUDED */
-
diff --git a/stack/l2cap/l2c_api.c b/stack/l2cap/l2c_api.c
index 3a8d5de..e7dbf36 100644
--- a/stack/l2cap/l2c_api.c
+++ b/stack/l2cap/l2c_api.c
@@ -1420,9 +1420,11 @@
         // Fixed channels are mandatory on LE transports so ignore the received
         // channel mask and use the locally cached LE channel mask.
 
+#if BLE_INCLUDED == TRUE
         if (transport == BT_TRANSPORT_LE)
             peer_channel_mask = l2cb.l2c_ble_fixed_chnls_mask;
         else
+#endif
             peer_channel_mask = p_lcb->peer_chnl_mask[0];
 
         // Check for supported channel
@@ -1544,9 +1546,11 @@
     tL2C_BLE_FIXED_CHNLS_MASK peer_channel_mask;
 
     // Select peer channels mask to use depending on transport
+#if BLE_INCLUDED == TRUE
     if (transport == BT_TRANSPORT_LE)
         peer_channel_mask = l2cb.l2c_ble_fixed_chnls_mask;
     else
+#endif
         peer_channel_mask = p_lcb->peer_chnl_mask[0];
 
     if ((peer_channel_mask & (1 << fixed_cid)) == 0)
diff --git a/stack/l2cap/l2c_link.c b/stack/l2cap/l2c_link.c
index 97bf58d..822257e 100644
--- a/stack/l2cap/l2c_link.c
+++ b/stack/l2cap/l2c_link.c
@@ -1156,11 +1156,13 @@
                   (l2cb.round_robin_unacked >= l2cb.round_robin_quota))
 #if (BLE_INCLUDED == TRUE)
                 && (p_lcb->transport == BT_TRANSPORT_BR_EDR)
-#endif
                 )
               || (p_lcb->transport == BT_TRANSPORT_LE &&
                  (l2cb.ble_round_robin_unacked >= l2cb.ble_round_robin_quota ||
                   l2cb.controller_le_xmit_window == 0 )))
+#else
+                ))
+#endif
             break;
 
 
diff --git a/stack/l2cap/l2c_main.c b/stack/l2cap/l2c_main.c
index 212d5df..fcc53d5 100644
--- a/stack/l2cap/l2c_main.c
+++ b/stack/l2cap/l2c_main.c
@@ -186,10 +186,12 @@
     STREAM_TO_UINT16 (l2cap_len, p);
     STREAM_TO_UINT16 (rcv_cid, p);
 
+#if BLE_INCLUDED == TRUE
    /* for BLE channel, always notify connection when ACL data received on the link */
    if (p_lcb && p_lcb->transport == BT_TRANSPORT_LE && p_lcb->link_state != LST_DISCONNECTING)
       /* only process fixed channel data as channel open indication when link is not in disconnecting mode */
         l2cble_notify_le_connection(p_lcb->remote_bd_addr);
+#endif
 
     /* Find the CCB for this CID */
     if (rcv_cid >= L2CAP_BASE_APPL_CID)
@@ -894,8 +896,10 @@
     l2cb.high_pri_min_xmit_quota = L2CAP_HIGH_PRI_MIN_XMIT_QUOTA;
 #endif
 
+#if BLE_INCLUDED == TRUE
     l2cb.l2c_ble_fixed_chnls_mask =
          L2CAP_FIXED_CHNL_ATT_BIT | L2CAP_FIXED_CHNL_BLE_SIG_BIT | L2CAP_FIXED_CHNL_SMP_BIT;
+#endif
 
     l2cb.rcv_pending_q = list_new(NULL);
     if (l2cb.rcv_pending_q == NULL)
diff --git a/stack/smp/smp_act.c b/stack/smp/smp_act.c
index f1c6936..7c5bd8e 100644
--- a/stack/smp/smp_act.c
+++ b/stack/smp/smp_act.c
@@ -23,6 +23,7 @@
 #include "l2c_api.h"
 #include "smp_int.h"
 
+#if SMP_INCLUDED == TRUE
 const UINT8 smp_association_table[2][SMP_IO_CAP_MAX][SMP_IO_CAP_MAX] =
 {
     /* initiator */
@@ -2088,4 +2089,4 @@
     smp_proc_pairing_cmpl(p_cb);
 }
 
-
+#endif
diff --git a/stack/smp/smp_br_main.c b/stack/smp/smp_br_main.c
index 573db7f..11039ec 100644
--- a/stack/smp/smp_br_main.c
+++ b/stack/smp/smp_br_main.c
@@ -21,6 +21,8 @@
 #include <string.h>
 #include "smp_int.h"
 
+#if BLE_INCLUDED == TRUE
+
 const char *const smp_br_state_name [SMP_BR_STATE_MAX+1] =
 {
     "SMP_BR_STATE_IDLE",
@@ -394,4 +396,4 @@
     SMP_TRACE_DEBUG( "result state = %s", smp_get_br_state_name( p_cb->br_state ) ) ;
 }
 
-
+#endif
diff --git a/stack/smp/smp_int.h b/stack/smp/smp_int.h
index 52b0301..a058bab 100644
--- a/stack/smp/smp_int.h
+++ b/stack/smp/smp_int.h
@@ -24,6 +24,8 @@
 #ifndef  SMP_INT_H
 #define  SMP_INT_H
 
+#if BLE_INCLUDED == TRUE
+
 #include "btu.h"
 #include "btm_ble_api.h"
 #include "btm_api.h"
@@ -536,4 +538,6 @@
                                                  UINT16 tlen, UINT8 *p_signature);
 extern void print128(BT_OCTET16 x, const UINT8 *key_name);
 
+#endif
+
 #endif /* SMP_INT_H */