update 20170109_TV_ANDROID_7.x_COEX_RTL8822BE-4141_BT
authorhwg <hwg@rock-chips.com>
Wed, 22 Feb 2017 07:46:45 +0000 (15:46 +0800)
committerhwg <hwg@rock-chips.com>
Wed, 22 Feb 2017 07:46:45 +0000 (15:46 +0800)
Change-Id: I166b6daf43e3c35522eed4e5dd2e963b2f7a3986

15 files changed:
rtkbt/addon/bee1/system/usr/keylayout/Vendor_005d_Product_0001.kl
rtkbt/addon/rtkbtAutoPairService/rtkbtAutoPairService/rtkbtAutoPairService.apk
rtkbt/code/bt/bta/hh/bta_hh_le.c
rtkbt/code/bt/btif/src/btif_media_task.c
rtkbt/code/bt/realtek/src/rtkbt_api.c
rtkbt/code/bt/stack/btm/btm_sec.c
rtkbt/code/bt/stack/smp/smp_l2c.c
rtkbt/code/libbt-vendor/uart/src/bt_vendor_rtk.c
rtkbt/code/libbt-vendor/uart/src/hardware.c
rtkbt/code/libbt-vendor/usb/src/bt_vendor_rtk.c
rtkbt/rtkbt.mk
rtkbt/system/etc/bluetooth/rtkbt.conf
rtkbt/system/etc/firmware/rtl8723bs_config
rtkbt/system/etc/firmware/rtl8723bs_fw
rtkbt/system/etc/firmware/rtl8822b_fw

index c76e12ffeaea18672385183d96099702233d9303..0b86eb2bd88aa6a22d0905a229844515745aa817 100755 (executable)
 # Do not edit the generic key layout to support a specific keyboard; instead, create
 # a new key layout file with the required keyboard configuration.
 #
-
 key 1     ESCAPE
-key 28    ENTER
-key 63    F5
-key 102   HOME
+key 2     1
+key 3     2
+key 4     3
+key 5     4
+key 6     5
+key 7     6
+key 8     7
+key 9     8
+key 10    9
+key 11    0
+key 28    DPAD_CENTER
+key 59    HOME
+key 61    MEDIA_REPEAT
+key 62    INFO
+key 63    SEARCH
 key 103   DPAD_UP
+key 104   MEDIA_PREVIOUS
 key 105   DPAD_LEFT
 key 106   DPAD_RIGHT
 key 108   DPAD_DOWN
+key 109   MEDIA_NEXT
+key 113   VOLUME_MUTE
 key 114   VOLUME_DOWN
 key 115   VOLUME_UP
 key 116   POWER
 key 130   MENU
+#key 240   ESCAPE
index 3d1df62e91d4b87bc56432e3e27defda28b013e8..9f146f3a714d923d17c51cf028c29ec4a2707056 100755 (executable)
Binary files a/rtkbt/addon/rtkbtAutoPairService/rtkbtAutoPairService/rtkbtAutoPairService.apk and b/rtkbt/addon/rtkbtAutoPairService/rtkbtAutoPairService/rtkbtAutoPairService.apk differ
index 53283cf9e41a28411a9b72bb91bb8043780352a4..a9fdaa06930c983b086cad7af4cba00403a4f2f3 100755 (executable)
@@ -2142,7 +2142,11 @@ void bta_hh_le_input_rpt_notify(tBTA_GATTC_NOTIFY *p_data)
 
     const tBTA_GATTC_CHARACTERISTIC *p_char = BTA_GATTC_GetCharacteristic(p_dev_cb->conn_id,
                                                                           p_data->handle);
-
+#ifdef BLUETOOTH_RTK
+    if(p_char == NULL){
+        return;
+    }
+#endif
     app_id= p_dev_cb->app_id;
 
     p_rpt = bta_hh_le_find_report_entry(p_dev_cb,
index d97d65320934f1ab0b97715215760c2c433c8188..5757481caaec45d88dff25ece00f44f6133c8f97 100755 (executable)
@@ -1857,11 +1857,11 @@ static void btif_media_task_enc_init(BT_HDR *p_msg)
             btif_media_cb.encoder.s16AllocationMethod, btif_media_cb.encoder.u16BitRate,
             btif_media_cb.encoder.s16SamplingFreq);
 
+    /* Reset entirely the SBC encoder */
+    SBC_Encoder_Init(&(btif_media_cb.encoder));
 #ifdef BLUETOOTH_RTK_COEX
     rtk_parse_manager_get_interface()->rtk_add_bitpool_to_fw(btif_media_cb.encoder.s16BitPool);
 #endif
-    /* Reset entirely the SBC encoder */
-    SBC_Encoder_Init(&(btif_media_cb.encoder));
 
     btif_media_cb.tx_sbc_frames = calculate_max_frames_per_packet();
 
index 2b874349b9b8e6add14c8c5a7eecafacebf1df71..fbb1a76172b3928ea582b21fca0b495ad932735c 100755 (executable)
@@ -384,7 +384,7 @@ static bt_status_t init(rtkbt_callbacks_t* callbacks)
     rtkbt_callbacks = callbacks;
     UIPC_Init(0);
     loadplugins(&rtkbt_api_callbacks);
-    //rtkbt_api_Hook(RTKBT_HOOK_ENABLE_BT_COMPLETE, (void *)BT_STATE_ON, 0);
+    rtkbt_api_Hook(RTKBT_HOOK_ENABLE_BT_COMPLETE, (void *)BT_STATE_ON, 0);
     return BT_STATUS_SUCCESS;
 }
 static void cleanup()
index 236528858ef26a8585466ff6d3157c362ffb7d48..f7342201b874e410540ffed1312cb5f0e055aee4 100755 (executable)
@@ -115,7 +115,9 @@ static void btm_sec_check_pending_enc_req (tBTM_SEC_DEV_REC  *p_dev_rec, tBT_TRA
 
 static BOOLEAN btm_sec_use_smp_br_chnl(tBTM_SEC_DEV_REC *p_dev_rec);
 static BOOLEAN btm_sec_is_master(tBTM_SEC_DEV_REC *p_dev_rec);
-
+#ifdef BLUETOOTH_RTK
+#include "bta_api.h"
+#endif
 /* TRUE - authenticated link key is possible */
 static const BOOLEAN btm_sec_io_map [BTM_IO_CAP_MAX][BTM_IO_CAP_MAX] =
 {
@@ -4253,6 +4255,9 @@ void btm_sec_encrypt_change (UINT16 handle, UINT8 status, UINT8 encr_enable)
         {
             p_dev_rec->sec_flags &= ~ (BTM_SEC_LE_LINK_KEY_KNOWN);
             p_dev_rec->ble.key_type = BTM_LE_KEY_NONE;
+#ifdef BLUETOOTH_RTK
+            BTA_DmRemoveDevice(p_dev_rec->bd_addr);
+#endif
         }
         btm_ble_link_encrypted(p_dev_rec->ble.pseudo_addr, encr_enable);
         return;
index d4011369a4629d5aa80973831af4de3eb01cc6c7..703f004f7980637dfbe6674f37234ebf46b05285 100755 (executable)
@@ -45,6 +45,10 @@ static void smp_br_connect_callback(UINT16 channel, BD_ADDR bd_addr, BOOLEAN con
                                     tBT_TRANSPORT transport);
 static void smp_br_data_received(UINT16 channel, BD_ADDR bd_addr, BT_HDR *p_buf);
 
+#ifdef BLUETOOTH_RTK
+#include "btcore/include/bdaddr.h"
+BOOLEAN check_cod_hid(const bt_bdaddr_t *remote_bdaddr);
+#endif
 /*******************************************************************************
 **
 ** Function         smp_l2cap_if_init
@@ -159,7 +163,20 @@ static void smp_data_received(UINT16 channel, BD_ADDR bd_addr, BT_HDR *p_buf)
         osi_free(p_buf);
         return;
     }
-
+#ifdef BLUETOOTH_RTK
+    bt_bdaddr_t bd_addr_t;
+    memcpy(bd_addr_t.address,&bd_addr[0],BD_ADDR_LEN);
+    if(check_cod_hid(&bd_addr_t)) {
+        SMP_TRACE_DEBUG("smp_data_received it is a hid device, ignore security request!");
+        if(SMP_OPCODE_SEC_REQ == cmd) {
+            osi_free(p_buf);
+            if(p_cb->state == SMP_STATE_IDLE) {
+                L2CA_RemoveFixedChnl (L2CAP_SMP_CID, bd_addr);
+            }
+            return;
+        }
+    }
+#endif
     /* reject the pairing request if there is an on-going SMP pairing */
     if (SMP_OPCODE_PAIRING_REQ == cmd || SMP_OPCODE_SEC_REQ == cmd)
     {
index 01afe699630d69a78f3446df4252dd6e05527cec..d42a995e3256a1bd70b55fc59b181ceaa28545b1 100755 (executable)
@@ -25,7 +25,8 @@
  ******************************************************************************/
 
 #undef NDEBUG
-#define LOG_TAG "bt_vendor"
+#define LOG_TAG "bt_vendor_uart"
+#define RTKBT_RELEASE_NAME "20170109_TV_ANDROID_7.x"
 #include <utils/Log.h>
 #include "bt_vendor_rtk.h"
 #include "upio.h"
@@ -85,6 +86,7 @@ static const tUSERIAL_CFG userial_init_cfg =
 
 static int init(const bt_vendor_callbacks_t* p_cb, unsigned char *local_bdaddr)
 {
+    ALOGI("RTKBT_RELEASE_NAME: %s",RTKBT_RELEASE_NAME);
     ALOGI("init");
 
     if (p_cb == NULL)
index 21caa8dce051211c4529b76c443eae8900359544..d58f867916f73d03c3282c951959ba7a04a666c5 100755 (executable)
@@ -27,6 +27,7 @@
  ******************************************************************************/
 
 #define LOG_TAG "bt_hwcfg"
+#define RTKBT_RELEASE_NAME "20170109_TV_ANDROID_7.x"
 
 #include <utils/Log.h>
 #include <sys/types.h>
@@ -54,7 +55,7 @@
 /******************************************************************************
 **  Constants &  Macros
 ******************************************************************************/
-#define RTK_VERSION "4.1.0"
+#define RTK_VERSION "4.1.1"
 
 #ifndef BTHW_DBG
 #define BTHW_DBG FALSE
@@ -1393,21 +1394,22 @@ DOWNLOAD_FW:
 
                 if (hw_cfg_cb.patch_frag_idx < hw_cfg_cb.patch_frag_cnt)
                 {
+                    iIndexRx = hw_cfg_cb.patch_frag_idx?((hw_cfg_cb.patch_frag_idx-1)%0x7f+1):0;
                     if (hw_cfg_cb.patch_frag_idx == hw_cfg_cb.patch_frag_cnt - 1)
                     {
                         ALOGI("HW_CFG_DL_FW_PATCH: send last fw fragment");
-                        hw_cfg_cb.patch_frag_idx |= 0x80;
+                        iIndexRx |= 0x80;
                         hw_cfg_cb.patch_frag_len = hw_cfg_cb.patch_frag_tail;
                     }
                     else
                     {
-                        hw_cfg_cb.patch_frag_idx &= 0x7F;
+                        iIndexRx &= 0x7F;
                         hw_cfg_cb.patch_frag_len = PATCH_DATA_FIELD_MAX_SIZE;
                     }
                 }
 
-                is_proceeding = hci_download_patch_h4(p_buf, hw_cfg_cb.patch_frag_idx,
-                                    hw_cfg_cb.total_buf+(hw_cfg_cb.patch_frag_idx&0x7F)*PATCH_DATA_FIELD_MAX_SIZE,
+                is_proceeding = hci_download_patch_h4(p_buf, iIndexRx,
+                                    hw_cfg_cb.total_buf+(hw_cfg_cb.patch_frag_idx*PATCH_DATA_FIELD_MAX_SIZE),
                                     hw_cfg_cb.patch_frag_len);
                 break;
 
@@ -1502,6 +1504,7 @@ void hw_config_start(void)
     memset(&hw_cfg_cb, 0, sizeof(bt_hw_cfg_cb_t));
     hw_cfg_cb.dl_fw_flag = 1;
     hw_cfg_cb.chip_type = CHIPTYPE_NONE;
+    ALOGI("RTKBT_RELEASE_NAME: %s",RTKBT_RELEASE_NAME);
     ALOGI("\nRealtek libbt-vendor_uart Version %s \n",RTK_VERSION);
     HC_BT_HDR  *p_buf = NULL;
     uint8_t     *p;
index a47231deff72f79d33967c7b50015741a725ca2d..3ed2b1f22ba0a8b05b1a9e9c3a1323ffb7736a45 100755 (executable)
@@ -24,7 +24,8 @@
  *
  ******************************************************************************/
 
-#define LOG_TAG "bt_vendor"
+#define LOG_TAG "bt_vendor_usb"
+#define RTKBT_RELEASE_NAME "20170109_TV_ANDROID_7.x"
 
 #include <fcntl.h>
 #include <errno.h>
@@ -78,6 +79,7 @@ static vnd_userial_cb_t vnd_userial;
 
 static int init(const bt_vendor_callbacks_t* p_cb, unsigned char *local_bdaddr,char *bt_device_node)
 {
+    ALOGI("RTKBT_RELEASE_NAME: %s",RTKBT_RELEASE_NAME);
     ALOGI("init");
 
     if (p_cb == NULL)
index f9914c5423a972fd177859bbb1ed0924139d7b7a..e128dfa67eaf85a268a7a42a2321ce660831e435 100755 (executable)
@@ -1,4 +1,4 @@
-# RELEASE NAME: 20161222_TV_ANDROID_7.x
+# RELEASE NAME: 20170109_TV_ANDROID_7.x
 # RTKBT_API_VERSION=3.1.1.0
 
 #BOARD_HAVE_BLUETOOTH := true
index e67a9cc1e9f35b620ac919dec382f14670b129e8..8d16daf094cae72f698ca5132b6893a1dc884741 100755 (executable)
@@ -1,4 +1,4 @@
-# RELEASE NAME: 20161222_TV_ANDROID_7.x
+# RELEASE NAME: 20170109_TV_ANDROID_7.x
 # Bluetooth Device Name; NULL or comment means "ro.product.model"
 #Name=Realtek Bluetooth
 
index d0e3370263e62ab234c94fbb94cc1aa915a69932..87a41287ed65a9ae62798c69636da9fa9b98f129 100755 (executable)
Binary files a/rtkbt/system/etc/firmware/rtl8723bs_config and b/rtkbt/system/etc/firmware/rtl8723bs_config differ
index bbf7ed942569f6aee88f280d00c9ac4347c24b28..a73cce80aea84e92fb345dd820737140239833e8 100755 (executable)
Binary files a/rtkbt/system/etc/firmware/rtl8723bs_fw and b/rtkbt/system/etc/firmware/rtl8723bs_fw differ
index 9ef0d91c6fc64a14500ea6e7c02917a4bd33de5d..76a0de9094857918ce74eff0af3b14ccbe453772 100755 (executable)
Binary files a/rtkbt/system/etc/firmware/rtl8822b_fw and b/rtkbt/system/etc/firmware/rtl8822b_fw differ