From: Aaron Kling Date: Thu, 1 Jul 2021 00:11:09 +0000 (-0500) Subject: rtkbt: Update to 20200422_BT_ANDROID_10.0 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=15f08c183a079a93bf1b6bf9e847e1c2db292daf;p=GitHub%2FLineageOS%2FG12%2Fandroid_hardware_realtek.git rtkbt: Update to 20200422_BT_ANDROID_10.0 --- diff --git a/rtkbt/Firmware/BT/BT_Firmware.mk b/rtkbt/Firmware/BT/BT_Firmware.mk index 8e76e7c..85f0df7 100755 --- a/rtkbt/Firmware/BT/BT_Firmware.mk +++ b/rtkbt/Firmware/BT/BT_Firmware.mk @@ -59,9 +59,5 @@ PRODUCT_COPY_FILES += \ $(CUR_PATH)/Firmware/BT/rtl8761bt_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8761bt_fw \ $(CUR_PATH)/Firmware/BT/rtl8725a_config:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8725a_config \ $(CUR_PATH)/Firmware/BT/rtl8725a_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8725a_fw \ - $(CUR_PATH)/Firmware/BT/rtl8822cu_config:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8822cu_config \ - $(CUR_PATH)/Firmware/BT/rtl8822cu_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8822cu_fw \ - $(CUR_PATH)/Firmware/BT/rtl8822bu_config:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8822bu_config \ - $(CUR_PATH)/Firmware/BT/rtl8822bu_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8822bu_fw \ diff --git a/rtkbt/Firmware/BT/fw_info.txt b/rtkbt/Firmware/BT/fw_info.txt index 69e12f6..b9584b7 100755 --- a/rtkbt/Firmware/BT/fw_info.txt +++ b/rtkbt/Firmware/BT/fw_info.txt @@ -5,28 +5,28 @@ rtl8723c_fw B 16592 0700 rtl8703cs_fw C 17903 0a0a rtl8761aw8192eu_fw D 20411 0007 rtl8761at8812ae_fw D 19653 0006 -rtl8723ds_fw C 22030 2f2f -rtl8761bt_fw B 22017 0202 +rtl8723ds_fw C 22951 3535 +rtl8761bt_fw B 22481 0202 rtl8703bs_fw B 22073 1c00 -rtl8822b_fw C 21525 6c6c -rtl8821cs_fw B 22037 4139 +rtl8822b_fw C 22746 7979 +rtl8821cs_fw B 22956 4a4a rtl8761at_fw D 20411 0007 -rtl8822c_fw D 22017 0d0d -rtl8761b_fw B 22017 0202 +rtl8822c_fw D 22997 1717 +rtl8761b_fw B 22481 0202 rtl8761au8812ae_fw D 19653 0006 rtl8821as_fw B 19132 635d rtl8821a_fw B 19132 635d rtl8723bs_fw B 19897 6d50 -rtl8725a_fw B 22017 0202 +rtl8725a_fw B 22481 0202 rtl8723b_fw B 19897 6d50 rtl8723cs_vf_fw B 15854 5844 rtl8703as_fw B 12234 473d -rtl8822cs_fw D 22017 0d0d +rtl8822cs_fw D 22997 1717 rtl8723cs_xx_fw B 22073 1c00 -rtl8725as_fw B 22017 0202 -rtl8821c_fw B 22037 4139 -rtl8822bs_fw C 21525 6c6c -rtl8723d_fw C 22030 2f2f +rtl8725as_fw B 22481 0202 +rtl8821c_fw B 22956 4a4a +rtl8822bs_fw C 22746 7979 +rtl8723d_fw C 22951 3535 rtl8723cs_cg_fw B 15854 5844 rtl8761at8192ee_fw D 20411 0007 rtl8761cs_fw B 21127 0606 diff --git a/rtkbt/Firmware/BT/readme.txt b/rtkbt/Firmware/BT/readme.txt new file mode 100644 index 0000000..24f2548 --- /dev/null +++ b/rtkbt/Firmware/BT/readme.txt @@ -0,0 +1,33 @@ + Chip Fw_version Coex Svn +RTL8761AU+RTL8192EE 0635 0007 20411 +RTL8761AU 0635 0007 20411 +RTL8723C 2aff 0700 16592 +RTL8703CS a0ee 0a0a 17903 +RTL8761AW+RTL8192EU 0635 0007 20411 +RTL8761AT+RTL8812AE 114b 0006 19653 +RTL8723DS 358f 3535 22951 +RTL8761BT 3079 0202 22481 +RTL8703BS 949d 1c00 22073 +RTL8822B ea25 7979 22746 +RTL8821CS 35ea 4a4a 22956 +RTL8761AT 0635 0007 20411 +RTL8822C 390d 1717 22997 +RTL8761B 3079 0202 22481 +RTL8761AU+RTL8192AE 114b 0006 19653 +RTL8821AS 20a6 635d 19132 +RTL8821A 20a6 635d 19132 +RTL8723BS a747 6d50 19897 +RTL8725A 3079 0202 22481 +RTL8723B a747 6d50 19897 +RTL8723CS_VF 8d8e 5844 15854 +RTL8703AS cfde 473d 12234 +RTL8822CS 390d 1717 22997 +RTL8723CS_XX 949d 1c00 22073 +RTL8725AS 3079 0202 22481 +RTL8821C 35ea 4a4a 22956 +RTL8822BS ea25 7979 22746 +RTL8723D 358f 3535 22951 +RTL8723CS_CG 8d8e 5844 15854 +RTL8761AT+RTL8192EE 0635 0007 20411 +RTL8761CS e928 0606 21127 +RTL8723BS_VQ0 264a 6549 16527 diff --git a/rtkbt/Firmware/BT/rtl8723d_fw b/rtkbt/Firmware/BT/rtl8723d_fw index b5a0f0d..4c1f6d7 100755 Binary files a/rtkbt/Firmware/BT/rtl8723d_fw and b/rtkbt/Firmware/BT/rtl8723d_fw differ diff --git a/rtkbt/Firmware/BT/rtl8723ds_fw b/rtkbt/Firmware/BT/rtl8723ds_fw index a653eeb..5a3a78e 100755 Binary files a/rtkbt/Firmware/BT/rtl8723ds_fw and b/rtkbt/Firmware/BT/rtl8723ds_fw differ diff --git a/rtkbt/Firmware/BT/rtl8725a_fw b/rtkbt/Firmware/BT/rtl8725a_fw index bb43f04..660ce23 100755 Binary files a/rtkbt/Firmware/BT/rtl8725a_fw and b/rtkbt/Firmware/BT/rtl8725a_fw differ diff --git a/rtkbt/Firmware/BT/rtl8725as_fw b/rtkbt/Firmware/BT/rtl8725as_fw index 14433a6..762e48e 100755 Binary files a/rtkbt/Firmware/BT/rtl8725as_fw and b/rtkbt/Firmware/BT/rtl8725as_fw differ diff --git a/rtkbt/Firmware/BT/rtl8761b_fw b/rtkbt/Firmware/BT/rtl8761b_fw index e655a77..8cfce03 100755 Binary files a/rtkbt/Firmware/BT/rtl8761b_fw and b/rtkbt/Firmware/BT/rtl8761b_fw differ diff --git a/rtkbt/Firmware/BT/rtl8761bt_fw b/rtkbt/Firmware/BT/rtl8761bt_fw index 0627ba7..2116087 100755 Binary files a/rtkbt/Firmware/BT/rtl8761bt_fw and b/rtkbt/Firmware/BT/rtl8761bt_fw differ diff --git a/rtkbt/Firmware/BT/rtl8821c_fw b/rtkbt/Firmware/BT/rtl8821c_fw index 285eea1..858b566 100755 Binary files a/rtkbt/Firmware/BT/rtl8821c_fw and b/rtkbt/Firmware/BT/rtl8821c_fw differ diff --git a/rtkbt/Firmware/BT/rtl8821cs_fw b/rtkbt/Firmware/BT/rtl8821cs_fw index 33a3240..f76943b 100755 Binary files a/rtkbt/Firmware/BT/rtl8821cs_fw and b/rtkbt/Firmware/BT/rtl8821cs_fw differ diff --git a/rtkbt/Firmware/BT/rtl8822b_fw b/rtkbt/Firmware/BT/rtl8822b_fw index ca5e636..eb4215c 100755 Binary files a/rtkbt/Firmware/BT/rtl8822b_fw and b/rtkbt/Firmware/BT/rtl8822b_fw differ diff --git a/rtkbt/Firmware/BT/rtl8822bs_fw b/rtkbt/Firmware/BT/rtl8822bs_fw index 8c9888e..8f7644a 100755 Binary files a/rtkbt/Firmware/BT/rtl8822bs_fw and b/rtkbt/Firmware/BT/rtl8822bs_fw differ diff --git a/rtkbt/Firmware/BT/rtl8822bu_config b/rtkbt/Firmware/BT/rtl8822bu_config deleted file mode 100755 index b00270e..0000000 Binary files a/rtkbt/Firmware/BT/rtl8822bu_config and /dev/null differ diff --git a/rtkbt/Firmware/BT/rtl8822bu_fw b/rtkbt/Firmware/BT/rtl8822bu_fw deleted file mode 100755 index ca5e636..0000000 Binary files a/rtkbt/Firmware/BT/rtl8822bu_fw and /dev/null differ diff --git a/rtkbt/Firmware/BT/rtl8822c_fw b/rtkbt/Firmware/BT/rtl8822c_fw index ac459b1..98dddbb 100755 Binary files a/rtkbt/Firmware/BT/rtl8822c_fw and b/rtkbt/Firmware/BT/rtl8822c_fw differ diff --git a/rtkbt/Firmware/BT/rtl8822cs_fw b/rtkbt/Firmware/BT/rtl8822cs_fw index 6d71506..ec75c59 100755 Binary files a/rtkbt/Firmware/BT/rtl8822cs_fw and b/rtkbt/Firmware/BT/rtl8822cs_fw differ diff --git a/rtkbt/Firmware/BT/rtl8822cu_config b/rtkbt/Firmware/BT/rtl8822cu_config deleted file mode 100755 index 91d3f44..0000000 Binary files a/rtkbt/Firmware/BT/rtl8822cu_config and /dev/null differ diff --git a/rtkbt/Firmware/BT/rtl8822cu_fw b/rtkbt/Firmware/BT/rtl8822cu_fw deleted file mode 100755 index 01e739e..0000000 Binary files a/rtkbt/Firmware/BT/rtl8822cu_fw and /dev/null differ diff --git a/rtkbt/Firmware/TV/TV_Firmware.mk b/rtkbt/Firmware/TV/TV_Firmware.mk index 24cc7cf..356841e 100755 --- a/rtkbt/Firmware/TV/TV_Firmware.mk +++ b/rtkbt/Firmware/TV/TV_Firmware.mk @@ -1,43 +1,45 @@ +CUR_PATH := hardware/realtek/rtkbt + PRODUCT_COPY_FILES += \ - $(LOCAL_PATH)/Firmware/TV/rtl8723b_config:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8723b_config \ - $(LOCAL_PATH)/Firmware/TV/rtl8723b_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8723b_fw \ - $(LOCAL_PATH)/Firmware/TV/rtl8723bs_config:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8723bs_config \ - $(LOCAL_PATH)/Firmware/TV/rtl8723bs_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8723bs_fw \ - $(LOCAL_PATH)/Firmware/TV/rtl8723bs_VQ0_config:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8723bs_VQ0_config \ - $(LOCAL_PATH)/Firmware/TV/rtl8723bs_VQ0_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8723bs_VQ0_fw \ - $(LOCAL_PATH)/Firmware/TV/rtl8723bu_config:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8723bu_config \ - $(LOCAL_PATH)/Firmware/TV/rtl8723d_config:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8723d_config \ - $(LOCAL_PATH)/Firmware/TV/rtl8723d_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8723d_fw \ - $(LOCAL_PATH)/Firmware/TV/rtl8723ds_config:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8723ds_config \ - $(LOCAL_PATH)/Firmware/TV/rtl8723ds_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8723ds_fw \ - $(LOCAL_PATH)/Firmware/TV/rtl8761a_config:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8761a_config \ - $(LOCAL_PATH)/Firmware/TV/rtl8761a_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8761a_fw \ - $(LOCAL_PATH)/Firmware/TV/rtl8761at_config:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8761at_config \ - $(LOCAL_PATH)/Firmware/TV/rtl8761at_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8761at_fw \ - $(LOCAL_PATH)/Firmware/TV/rtl8761au8192ee_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8761au8192ee_fw \ - $(LOCAL_PATH)/Firmware/TV/rtl8761au8812ae_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8761au8812ae_fw \ - $(LOCAL_PATH)/Firmware/TV/rtl8761au_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8761au_fw \ - $(LOCAL_PATH)/Firmware/TV/rtl8761aw8192eu_config:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8761aw8192eu_config \ - $(LOCAL_PATH)/Firmware/TV/rtl8761aw8192eu_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8761aw8192eu_fw \ - $(LOCAL_PATH)/Firmware/TV/rtl8821a_config:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8821a_config \ - $(LOCAL_PATH)/Firmware/TV/rtl8821a_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8821a_fw \ - $(LOCAL_PATH)/Firmware/TV/rtl8821as_config:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8821as_config \ - $(LOCAL_PATH)/Firmware/TV/rtl8821as_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8821as_fw \ - $(LOCAL_PATH)/Firmware/TV/rtl8821c_config:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8821c_config \ - $(LOCAL_PATH)/Firmware/TV/rtl8821c_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8821c_fw \ - $(LOCAL_PATH)/Firmware/TV/rtl8821cs_config:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8821cs_config \ - $(LOCAL_PATH)/Firmware/TV/rtl8821cs_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8821cs_fw \ - $(LOCAL_PATH)/Firmware/TV/rtl8822b_config:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8822b_config \ - $(LOCAL_PATH)/Firmware/TV/rtl8822b_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8822b_fw \ - $(LOCAL_PATH)/Firmware/TV/rtl8822bs_config:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8822bs_config \ - $(LOCAL_PATH)/Firmware/TV/rtl8822bs_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8822bs_fw \ - $(LOCAL_PATH)/Firmware/TV/rtl8822c_config:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8822c_config \ - $(LOCAL_PATH)/Firmware/TV/rtl8822c_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8822c_fw \ - $(LOCAL_PATH)/Firmware/TV/rtl8822cs_config:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8822cs_config \ - $(LOCAL_PATH)/Firmware/TV/rtl8822cs_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8822cs_fw \ - $(LOCAL_PATH)/Firmware/TV/rtl8761b_config:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8761b_config \ - $(LOCAL_PATH)/Firmware/TV/rtl8761b_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8761b_fw \ - $(LOCAL_PATH)/Firmware/TV/rtl8761bt_config:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8761bt_config \ - $(LOCAL_PATH)/Firmware/TV/rtl8761bt_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8761bt_fw \ - $(LOCAL_PATH)/Firmware/TV/rtl8725a_config:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8725a_config \ - $(LOCAL_PATH)/Firmware/TV/rtl8725a_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8725a_fw \ + $(CUR_PATH)/Firmware/TV/rtl8723b_config:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8723b_config \ + $(CUR_PATH)/Firmware/TV/rtl8723b_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8723b_fw \ + $(CUR_PATH)/Firmware/TV/rtl8723bs_config:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8723bs_config \ + $(CUR_PATH)/Firmware/TV/rtl8723bs_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8723bs_fw \ + $(CUR_PATH)/Firmware/TV/rtl8723bs_VQ0_config:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8723bs_VQ0_config \ + $(CUR_PATH)/Firmware/TV/rtl8723bs_VQ0_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8723bs_VQ0_fw \ + $(CUR_PATH)/Firmware/TV/rtl8723bu_config:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8723bu_config \ + $(CUR_PATH)/Firmware/TV/rtl8723d_config:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8723d_config \ + $(CUR_PATH)/Firmware/TV/rtl8723d_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8723d_fw \ + $(CUR_PATH)/Firmware/TV/rtl8723ds_config:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8723ds_config \ + $(CUR_PATH)/Firmware/TV/rtl8723ds_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8723ds_fw \ + $(CUR_PATH)/Firmware/TV/rtl8761a_config:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8761a_config \ + $(CUR_PATH)/Firmware/TV/rtl8761a_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8761a_fw \ + $(CUR_PATH)/Firmware/TV/rtl8761at_config:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8761at_config \ + $(CUR_PATH)/Firmware/TV/rtl8761at_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8761at_fw \ + $(CUR_PATH)/Firmware/TV/rtl8761au8192ee_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8761au8192ee_fw \ + $(CUR_PATH)/Firmware/TV/rtl8761au8812ae_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8761au8812ae_fw \ + $(CUR_PATH)/Firmware/TV/rtl8761au_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8761au_fw \ + $(CUR_PATH)/Firmware/TV/rtl8761aw8192eu_config:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8761aw8192eu_config \ + $(CUR_PATH)/Firmware/TV/rtl8761aw8192eu_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8761aw8192eu_fw \ + $(CUR_PATH)/Firmware/TV/rtl8821a_config:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8821a_config \ + $(CUR_PATH)/Firmware/TV/rtl8821a_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8821a_fw \ + $(CUR_PATH)/Firmware/TV/rtl8821as_config:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8821as_config \ + $(CUR_PATH)/Firmware/TV/rtl8821as_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8821as_fw \ + $(CUR_PATH)/Firmware/TV/rtl8821c_config:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8821c_config \ + $(CUR_PATH)/Firmware/TV/rtl8821c_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8821c_fw \ + $(CUR_PATH)/Firmware/TV/rtl8821cs_config:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8821cs_config \ + $(CUR_PATH)/Firmware/TV/rtl8821cs_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8821cs_fw \ + $(CUR_PATH)/Firmware/TV/rtl8822b_config:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8822b_config \ + $(CUR_PATH)/Firmware/TV/rtl8822b_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8822b_fw \ + $(CUR_PATH)/Firmware/TV/rtl8822bs_config:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8822bs_config \ + $(CUR_PATH)/Firmware/TV/rtl8822bs_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8822bs_fw \ + $(CUR_PATH)/Firmware/TV/rtl8822c_config:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8822c_config \ + $(CUR_PATH)/Firmware/TV/rtl8822c_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8822c_fw \ + $(CUR_PATH)/Firmware/TV/rtl8822cs_config:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8822cs_config \ + $(CUR_PATH)/Firmware/TV/rtl8822cs_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8822cs_fw \ + $(CUR_PATH)/Firmware/TV/rtl8761b_config:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8761b_config \ + $(CUR_PATH)/Firmware/TV/rtl8761b_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8761b_fw \ + $(CUR_PATH)/Firmware/TV/rtl8761bt_config:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8761bt_config \ + $(CUR_PATH)/Firmware/TV/rtl8761bt_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8761bt_fw \ + $(CUR_PATH)/Firmware/TV/rtl8725a_config:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8725a_config \ + $(CUR_PATH)/Firmware/TV/rtl8725a_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8725a_fw \ diff --git a/rtkbt/Firmware/TV/fw_info.txt b/rtkbt/Firmware/TV/fw_info.txt index d5ff2a0..deb2726 100755 --- a/rtkbt/Firmware/TV/fw_info.txt +++ b/rtkbt/Firmware/TV/fw_info.txt @@ -3,24 +3,24 @@ rtl8761au8192ee_fw D 13328 3736 rtl8761a_fw D 13328 3736 rtl8761au_fw D 21962 0007 rtl8761aw8192eu_fw D 21962 0007 -rtl8723ds_fw C 22030 2f2f -rtl8761bt_fw B 22017 0202 +rtl8723ds_fw C 22951 3535 +rtl8761bt_fw B 22481 0202 rtl8761bs_fw B 21127 0606 -rtl8822b_fw C 21525 6c6c -rtl8821cs_fw B 22037 4139 +rtl8822b_fw C 22746 7979 +rtl8821cs_fw B 22956 4a4a rtl8761at_fw D 21962 0007 -rtl8822c_fw D 22017 0d0d -rtl8761b_fw B 22017 0202 +rtl8822c_fw D 22997 1717 +rtl8761b_fw B 22481 0202 rtl8761au8812ae_fw D 19648 0006 rtl8821as_fw B 19884 635d rtl8821a_fw B 19884 635d rtl8723bs_fw B 19897 6d50 -rtl8725a_fw B 22017 0202 +rtl8725a_fw B 22481 0202 rtl8723b_fw B 19897 6d50 -rtl8822cs_fw D 22017 0d0d -rtl8725as_fw B 22017 0202 -rtl8821c_fw B 22037 4139 -rtl8822bs_fw C 21525 6c6c -rtl8723d_fw C 22030 2f2f +rtl8822cs_fw D 22997 1717 +rtl8725as_fw B 22481 0202 +rtl8821c_fw B 22956 4a4a +rtl8822bs_fw C 22746 7979 +rtl8723d_fw C 22951 3535 rtl8761at8192er_fw D 21962 0007 rtl8723bs_VQ0_fw B 14422 5844 diff --git a/rtkbt/Firmware/TV/readme.txt b/rtkbt/Firmware/TV/readme.txt new file mode 100644 index 0000000..cf58643 --- /dev/null +++ b/rtkbt/Firmware/TV/readme.txt @@ -0,0 +1,26 @@ + Chip Fw_version Coex Svn +RTL8761AU+RTL8192EE 6d4b 3736 13328 +RTL8761A 6d4b 3736 13328 +RTL8761AU 6ccc 0007 21962 +RTL8761AW+RTL8192EU 6ccc 0007 21962 +RTL8723DS 358f 3535 22951 +RTL8761BT 3079 0202 22481 +RTL8761BS e928 0606 21127 +RTL8822B ea25 7979 22746 +RTL8821CS 35ea 4a4a 22956 +RTL8761AT 6ccc 0007 21962 +RTL8822C 390d 1717 22997 +RTL8761B 3079 0202 22481 +RTL8761AU+RTL8192AE 1e05 0006 19648 +RTL8821AS 8935 635d 19884 +RTL8821A 8935 635d 19884 +RTL8723BS a747 6d50 19897 +RTL8725A 3079 0202 22481 +RTL8723B a747 6d50 19897 +RTL8822CS 390d 1717 22997 +RTL8725AS 3079 0202 22481 +RTL8821C 35ea 4a4a 22956 +RTL8822BS ea25 7979 22746 +RTL8723D 358f 3535 22951 +RTL8761AT+RTL8192ER 6ccc 0007 21962 +RTL8723BS_VQ0 c2da 5844 14422 diff --git a/rtkbt/Firmware/TV/rtl8723d_fw b/rtkbt/Firmware/TV/rtl8723d_fw index 8e49b8e..2405c5e 100755 Binary files a/rtkbt/Firmware/TV/rtl8723d_fw and b/rtkbt/Firmware/TV/rtl8723d_fw differ diff --git a/rtkbt/Firmware/TV/rtl8723ds_fw b/rtkbt/Firmware/TV/rtl8723ds_fw index 5babc4b..18a0571 100755 Binary files a/rtkbt/Firmware/TV/rtl8723ds_fw and b/rtkbt/Firmware/TV/rtl8723ds_fw differ diff --git a/rtkbt/Firmware/TV/rtl8725a_fw b/rtkbt/Firmware/TV/rtl8725a_fw index dd41af4..5f23bc4 100755 Binary files a/rtkbt/Firmware/TV/rtl8725a_fw and b/rtkbt/Firmware/TV/rtl8725a_fw differ diff --git a/rtkbt/Firmware/TV/rtl8725as_fw b/rtkbt/Firmware/TV/rtl8725as_fw index 40e53ba..8c71f14 100755 Binary files a/rtkbt/Firmware/TV/rtl8725as_fw and b/rtkbt/Firmware/TV/rtl8725as_fw differ diff --git a/rtkbt/Firmware/TV/rtl8761b_config b/rtkbt/Firmware/TV/rtl8761b_config index 625efa9..33afaa1 100755 Binary files a/rtkbt/Firmware/TV/rtl8761b_config and b/rtkbt/Firmware/TV/rtl8761b_config differ diff --git a/rtkbt/Firmware/TV/rtl8761b_fw b/rtkbt/Firmware/TV/rtl8761b_fw index e8d8868..eb36474 100755 Binary files a/rtkbt/Firmware/TV/rtl8761b_fw and b/rtkbt/Firmware/TV/rtl8761b_fw differ diff --git a/rtkbt/Firmware/TV/rtl8761bt_config b/rtkbt/Firmware/TV/rtl8761bt_config index 8f8e1e5..a241371 100755 Binary files a/rtkbt/Firmware/TV/rtl8761bt_config and b/rtkbt/Firmware/TV/rtl8761bt_config differ diff --git a/rtkbt/Firmware/TV/rtl8761bt_fw b/rtkbt/Firmware/TV/rtl8761bt_fw index 2bf63f7..458cee9 100755 Binary files a/rtkbt/Firmware/TV/rtl8761bt_fw and b/rtkbt/Firmware/TV/rtl8761bt_fw differ diff --git a/rtkbt/Firmware/TV/rtl8821c_fw b/rtkbt/Firmware/TV/rtl8821c_fw index 5411b13..3195910 100755 Binary files a/rtkbt/Firmware/TV/rtl8821c_fw and b/rtkbt/Firmware/TV/rtl8821c_fw differ diff --git a/rtkbt/Firmware/TV/rtl8821cs_fw b/rtkbt/Firmware/TV/rtl8821cs_fw index a222008..816cb06 100755 Binary files a/rtkbt/Firmware/TV/rtl8821cs_fw and b/rtkbt/Firmware/TV/rtl8821cs_fw differ diff --git a/rtkbt/Firmware/TV/rtl8822b_fw b/rtkbt/Firmware/TV/rtl8822b_fw index 93eb8a5..a39e9f3 100755 Binary files a/rtkbt/Firmware/TV/rtl8822b_fw and b/rtkbt/Firmware/TV/rtl8822b_fw differ diff --git a/rtkbt/Firmware/TV/rtl8822bs_fw b/rtkbt/Firmware/TV/rtl8822bs_fw index 327cbf2..c3190a3 100755 Binary files a/rtkbt/Firmware/TV/rtl8822bs_fw and b/rtkbt/Firmware/TV/rtl8822bs_fw differ diff --git a/rtkbt/Firmware/TV/rtl8822c_fw b/rtkbt/Firmware/TV/rtl8822c_fw index 7976950..0b5f2b6 100755 Binary files a/rtkbt/Firmware/TV/rtl8822c_fw and b/rtkbt/Firmware/TV/rtl8822c_fw differ diff --git a/rtkbt/Firmware/TV/rtl8822cs_fw b/rtkbt/Firmware/TV/rtl8822cs_fw index 2ad15bb..c174660 100755 Binary files a/rtkbt/Firmware/TV/rtl8822cs_fw and b/rtkbt/Firmware/TV/rtl8822cs_fw differ diff --git a/rtkbt/Firmware/TV/rtl8822cu_config b/rtkbt/Firmware/TV/rtl8822cu_config deleted file mode 100755 index 91d3f44..0000000 Binary files a/rtkbt/Firmware/TV/rtl8822cu_config and /dev/null differ diff --git a/rtkbt/Firmware/TV/rtl8822cu_fw b/rtkbt/Firmware/TV/rtl8822cu_fw deleted file mode 100755 index f146b40..0000000 Binary files a/rtkbt/Firmware/TV/rtl8822cu_fw and /dev/null differ diff --git a/rtkbt/code/libbt-vendor/MODULE_LICENSE_APACHE2 b/rtkbt/code/libbt-vendor/MODULE_LICENSE_APACHE2 new file mode 100755 index 0000000..e69de29 diff --git a/rtkbt/code/libbt-vendor/NOTICE b/rtkbt/code/libbt-vendor/NOTICE new file mode 100755 index 0000000..148f85a --- /dev/null +++ b/rtkbt/code/libbt-vendor/NOTICE @@ -0,0 +1,190 @@ + Copyright (C) 2009-2019 Realtek Corporation. + + 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. + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS diff --git a/rtkbt/code/libbt-vendor/codec/plc/sbcplc.c b/rtkbt/code/libbt-vendor/codec/plc/sbcplc.c index ad9ee69..24c3470 100644 --- a/rtkbt/code/libbt-vendor/codec/plc/sbcplc.c +++ b/rtkbt/code/libbt-vendor/codec/plc/sbcplc.c @@ -1,5 +1,7 @@ /************************************************************* SBC Example PLC ANSI-C Source Code +This is copy from HFP spec, just only for study and demo. +Please don't use in commercial product. File: sbcplc.c *************************************************************/ #include diff --git a/rtkbt/code/libbt-vendor/codec/plc/sbcplc.h b/rtkbt/code/libbt-vendor/codec/plc/sbcplc.h index 64b291d..1505a16 100644 --- a/rtkbt/code/libbt-vendor/codec/plc/sbcplc.h +++ b/rtkbt/code/libbt-vendor/codec/plc/sbcplc.h @@ -1,5 +1,7 @@ /******************************************************** SBC Example PLC ANSI-C Source Code +This is copy from HFP spec, just only for study and demo. +Please don't use in commercial product. File: sbcplc.h *****************************************************************************/ #ifndef SBCPLC_H diff --git a/rtkbt/code/libbt-vendor/include/hardware.h b/rtkbt/code/libbt-vendor/include/hardware.h index cacbf55..029fba8 100755 --- a/rtkbt/code/libbt-vendor/include/hardware.h +++ b/rtkbt/code/libbt-vendor/include/hardware.h @@ -38,6 +38,7 @@ #define PATCH_DATA_FIELD_MAX_SIZE 252 #define RTK_VENDOR_CONFIG_MAGIC 0x8723ab55 #define MAX_PATCH_SIZE_24K (1024*24) //24K +#define MAX_PATCH_SIZE_25K (1024*25) //25K for rtl8822b #define MAX_PATCH_SIZE_40K (1024*40) //40K #define MAX_ORG_CONFIG_SIZE (0x100*14) diff --git a/rtkbt/code/libbt-vendor/src/Android.mk b/rtkbt/code/libbt-vendor/src/Android.mk index e13aaa6..a0bceb7 100755 --- a/rtkbt/code/libbt-vendor/src/Android.mk +++ b/rtkbt/code/libbt-vendor/src/Android.mk @@ -35,7 +35,7 @@ LOCAL_SHARED_LIBRARIES := \ LOCAL_WHOLE_STATIC_LIBRARIES := \ libbt-codec -LOCAL_MODULE := libbt-vendor-realtek +LOCAL_MODULE := libbt-vendor LOCAL_MODULE_TAGS := optional LOCAL_PROPRIETARY_MODULE := true LOCAL_MODULE_CLASS := SHARED_LIBRARIES diff --git a/rtkbt/code/libbt-vendor/src/bt_vendor_rtk.c b/rtkbt/code/libbt-vendor/src/bt_vendor_rtk.c index c3de48c..0b6614c 100755 --- a/rtkbt/code/libbt-vendor/src/bt_vendor_rtk.c +++ b/rtkbt/code/libbt-vendor/src/bt_vendor_rtk.c @@ -26,7 +26,7 @@ #undef NDEBUG #define LOG_TAG "libbt_vendor" -#define RTKBT_RELEASE_NAME "20191111_BT_ANDROID_9.0" +#define RTKBT_RELEASE_NAME "20200422_BT_ANDROID_10.0" #include #include "bt_vendor_rtk.h" #include "upio.h" @@ -141,10 +141,7 @@ static int Scan_Usb_Devices_For_RTK(char* path){ } /* Check if it is path. */ if((filestat.st_mode & S_IFDIR) == S_IFDIR){ - if(!Check_Key_Value(newpath,"idVendor",0x0bda) && \ - !Check_Key_Value(newpath,"idVendor",0x0b05) && \ - !Check_Key_Value(newpath,"idVendor",0x04ca) && \ - !Check_Key_Value(newpath,"idVendor",0x13d3)) + if(!Check_Key_Value(newpath,"idVendor",0x0bda)) continue; newpdir =opendir(newpath); /*read sub directory*/ diff --git a/rtkbt/code/libbt-vendor/src/hardware.c b/rtkbt/code/libbt-vendor/src/hardware.c index 6e0ebf7..b414f6e 100755 --- a/rtkbt/code/libbt-vendor/src/hardware.c +++ b/rtkbt/code/libbt-vendor/src/hardware.c @@ -27,7 +27,7 @@ ******************************************************************************/ #define LOG_TAG "bt_hwcfg" -#define RTKBT_RELEASE_NAME "20191111_BT_ANDROID_9.0" +#define RTKBT_RELEASE_NAME "20200422_BT_ANDROID_10.0" #include #include diff --git a/rtkbt/code/libbt-vendor/src/hardware_uart.c b/rtkbt/code/libbt-vendor/src/hardware_uart.c index 08908a6..488083b 100755 --- a/rtkbt/code/libbt-vendor/src/hardware_uart.c +++ b/rtkbt/code/libbt-vendor/src/hardware_uart.c @@ -17,7 +17,7 @@ ******************************************************************************/ #define LOG_TAG "bt_hwcfg_uart" -#define RTKBT_RELEASE_NAME "20191111_BT_ANDROID_9.0" +#define RTKBT_RELEASE_NAME "20200422_BT_ANDROID_10.0" #include #include @@ -119,9 +119,10 @@ static patch_info patch_table[] = { {0x8703, HCI_VERSION_MASK_ALL, HCI_REVISION_MASK_ALL, 1<<3, 1<<7, "rtl8723cs_cg_fw", "rtl8723cs_cg_config", CONFIG_MAC_OFFSET_GEN_3PLUS, MAX_PATCH_SIZE_24K}, //rtl8723cs_cg {0x8703, HCI_VERSION_MASK_ALL, HCI_REVISION_MASK_ALL, 1<<4, 1<<7, "rtl8723cs_vf_fw", "rtl8723cs_vf_config", CONFIG_MAC_OFFSET_GEN_3PLUS, MAX_PATCH_SIZE_24K}, //rtl8723cs_vf // {0x8822, HCI_VERSION_MASK_ALL, HCI_REVISION_MASK_ALL, CHIP_TYPE_MASK_ALL, 1<<8, "rtl8822bs_fw", "rtl8822bs_config", CONFIG_MAC_OFFSET_GEN_3PLUS, MAX_PATCH_SIZE_24K}, //Rtl8822BS - {0x8822, HCI_VERSION_MASK_ALL, ~(1<<0xc), CHIP_TYPE_MASK_ALL, 1<<8, "rtl8822bs_fw", "rtl8822bs_config", CONFIG_MAC_OFFSET_GEN_3PLUS, MAX_PATCH_SIZE_24K}, //Rtl8822BS + {0x8822, HCI_VERSION_MASK_ALL, ~(1<<0xc), CHIP_TYPE_MASK_ALL, 1<<8, "rtl8822bs_fw", "rtl8822bs_config", CONFIG_MAC_OFFSET_GEN_3PLUS, MAX_PATCH_SIZE_25K}, //Rtl8822BS {0x8822, HCI_VERSION_MASK_ALL, (1<<0xc), CHIP_TYPE_MASK_ALL, 1<<13, "rtl8822cs_fw", "rtl8822cs_config", CONFIG_MAC_OFFSET_GEN_4PLUS, MAX_PATCH_SIZE_40K}, //Rtl8822CS + {0x8723, HCI_VERSION_MASK_ALL, (1<<0xd), ~(1<<7), 1<<9, "rtl8723ds_fw", "rtl8723ds_config", CONFIG_MAC_OFFSET_GEN_3PLUS, MAX_PATCH_SIZE_40K}, //Rtl8723ds {0x8723, HCI_VERSION_MASK_ALL, (1<<0xd), 1<<7, 1<<9, "rtl8703cs_fw", "rtl8703cs_config", CONFIG_MAC_OFFSET_GEN_3PLUS, MAX_PATCH_SIZE_40K}, //Rtl8703cs {0x8821, HCI_VERSION_MASK_ALL, (1<<0xc), CHIP_TYPE_MASK_ALL, 1<<10, "rtl8821cs_fw", "rtl8821cs_config", CONFIG_MAC_OFFSET_GEN_3PLUS, MAX_PATCH_SIZE_40K}, //RTL8821CS diff --git a/rtkbt/code/libbt-vendor/src/hardware_usb.c b/rtkbt/code/libbt-vendor/src/hardware_usb.c index 4a671fc..20541e6 100755 --- a/rtkbt/code/libbt-vendor/src/hardware_usb.c +++ b/rtkbt/code/libbt-vendor/src/hardware_usb.c @@ -17,7 +17,7 @@ ******************************************************************************/ #define LOG_TAG "bt_hwcfg_usb" -#define RTKBT_RELEASE_NAME "20191111_BT_ANDROID_9.0" +#define RTKBT_RELEASE_NAME "20200422_BT_ANDROID_10.0" #include #include @@ -131,17 +131,18 @@ static usb_patch_info usb_fw_patch_table[] = { { 0x13D3, 0x3461, 0x8821, 0, 0, "mp_rtl8821a_fw", "rtl8821a_fw", "rtl8821a_config", NULL, 0 ,CONFIG_MAC_OFFSET_GEN_1_2, MAX_PATCH_SIZE_24K}, /* RTL8821AE */ { 0x13D3, 0x3462, 0x8821, 0, 0, "mp_rtl8821a_fw", "rtl8821a_fw", "rtl8821a_config", NULL, 0 ,CONFIG_MAC_OFFSET_GEN_1_2, MAX_PATCH_SIZE_24K}, /* RTL8821AE */ -{ 0x0BDA, 0xB822, 0x8822, 0, 0, "mp_rtl8822b_fw", "rtl8822b_fw", "rtl8822b_config", NULL, 0 ,CONFIG_MAC_OFFSET_GEN_3PLUS, MAX_PATCH_SIZE_24K}, /* RTL8822BE */ -{ 0x0BDA, 0xB82C, 0x8822, 0, 0, "mp_rtl8822b_fw", "rtl8822b_fw", "rtl8822b_config", NULL, 0 ,CONFIG_MAC_OFFSET_GEN_3PLUS, MAX_PATCH_SIZE_24K}, /* RTL8822BU */ -{ 0x0BDA, 0xB81D, 0x8822, 0, 0, "mp_rtl8822b_fw", "rtl8822b_fw", "rtl8822b_config", NULL, 0 ,CONFIG_MAC_OFFSET_GEN_3PLUS, MAX_PATCH_SIZE_24K}, /* RTL8822BU BT only */ -{ 0x0BDA, 0xB82E, 0x8822, 0, 0, "mp_rtl8822b_fw", "rtl8822b_fw", "rtl8822b_config", NULL, 0 ,CONFIG_MAC_OFFSET_GEN_3PLUS, MAX_PATCH_SIZE_24K}, /* RTL8822BU-VN */ -{ 0x0BDA, 0xB023, 0x8822, 0, 0, "mp_rtl8822b_fw", "rtl8822b_fw", "rtl8822b_config", NULL, 0 ,CONFIG_MAC_OFFSET_GEN_3PLUS, MAX_PATCH_SIZE_24K}, /* RTL8822BE */ +{ 0x0BDA, 0xB822, 0x8822, 0, 0, "mp_rtl8822b_fw", "rtl8822b_fw", "rtl8822b_config", NULL, 0 ,CONFIG_MAC_OFFSET_GEN_3PLUS, MAX_PATCH_SIZE_25K}, /* RTL8822BE */ +{ 0x0BDA, 0xB82C, 0x8822, 0, 0, "mp_rtl8822b_fw", "rtl8822b_fw", "rtl8822b_config", NULL, 0 ,CONFIG_MAC_OFFSET_GEN_3PLUS, MAX_PATCH_SIZE_25K}, /* RTL8822BU */ +{ 0x0BDA, 0xB81D, 0x8822, 0, 0, "mp_rtl8822b_fw", "rtl8822b_fw", "rtl8822b_config", NULL, 0 ,CONFIG_MAC_OFFSET_GEN_3PLUS, MAX_PATCH_SIZE_25K}, /* RTL8822BU BT only */ +{ 0x0BDA, 0xB82E, 0x8822, 0, 0, "mp_rtl8822b_fw", "rtl8822b_fw", "rtl8822b_config", NULL, 0 ,CONFIG_MAC_OFFSET_GEN_3PLUS, MAX_PATCH_SIZE_25K}, /* RTL8822BU-VN */ +{ 0x0BDA, 0xB023, 0x8822, 0, 0, "mp_rtl8822b_fw", "rtl8822b_fw", "rtl8822b_config", NULL, 0 ,CONFIG_MAC_OFFSET_GEN_3PLUS, MAX_PATCH_SIZE_25K}, /* RTL8822BE */ { 0x0BDA, 0xB703, 0x8703, 0, 0, "mp_rtl8723c_fw", "rtl8723c_fw", "rtl8723c_config", NULL, 0 ,CONFIG_MAC_OFFSET_GEN_3PLUS, MAX_PATCH_SIZE_24K}, /* RTL8723CU */ { 0x0BDA, 0xC82C, 0x8822, 0, 0, "mp_rtl8822c_fw", "rtl8822c_fw", "rtl8822c_config", NULL, 0 ,CONFIG_MAC_OFFSET_GEN_4PLUS, MAX_PATCH_SIZE_40K}, /* RTL8822CU */ { 0x0BDA, 0xC82E, 0x8822, 0, 0, "mp_rtl8822c_fw", "rtl8822c_fw", "rtl8822c_config", NULL, 0 ,CONFIG_MAC_OFFSET_GEN_4PLUS, MAX_PATCH_SIZE_40K}, /* RTL8822CU-VN */ { 0x0BDA, 0xC81D, 0x8822, 0, 0, "mp_rtl8822c_fw", "rtl8822c_fw", "rtl8822c_config", NULL, 0 ,CONFIG_MAC_OFFSET_GEN_4PLUS, MAX_PATCH_SIZE_40K}, /* RTL8822CU BT only */ { 0x0BDA, 0xC82F, 0x8822, 0, 0, "mp_rtl8822c_fw", "rtl8822c_fw", "rtl8822c_config", NULL, 0 ,CONFIG_MAC_OFFSET_GEN_4PLUS, MAX_PATCH_SIZE_40K}, /* RTL8822CE-VS */ { 0x0BDA, 0xC822, 0x8822, 0, 0, "mp_rtl8822c_fw", "rtl8822c_fw", "rtl8822c_config", NULL, 0 ,CONFIG_MAC_OFFSET_GEN_4PLUS, MAX_PATCH_SIZE_40K}, /* RTL8822CE */ +{ 0x0BDA, 0xB00C, 0x8822, 0, 0, "mp_rtl8822c_fw", "rtl8822c_fw", "rtl8822c_config", NULL, 0 ,CONFIG_MAC_OFFSET_GEN_4PLUS, MAX_PATCH_SIZE_40K}, /* RTL8822CE */ /* todo: RTL8703BU */ { 0x0BDA, 0xD723, 0x8723, 0, 0, "mp_rtl8723d_fw", "rtl8723d_fw", "rtl8723d_config", NULL, 0 ,CONFIG_MAC_OFFSET_GEN_3PLUS, MAX_PATCH_SIZE_40K}, /* RTL8723DU */ @@ -153,15 +154,6 @@ static usb_patch_info usb_fw_patch_table[] = { { 0x0BDA, 0xC821, 0x8821, 0, 0, "mp_rtl8821c_fw", "rtl8821c_fw", "rtl8821c_config", NULL, 0 ,CONFIG_MAC_OFFSET_GEN_3PLUS, MAX_PATCH_SIZE_40K}, /* RTL8821CE */ /* todo: RTL8703CU */ -// for RTL8822BE: AzureWave AW-CB295NF and Lite-On WCBN808L-AD -{ 0x0B05, 0x185C, 0x8822, 0, 0, "mp_rtl8822b_fw", "rtl8822bu_fw", "rtl8822bu_config", NULL, 0 ,CONFIG_MAC_OFFSET_GEN_3PLUS, MAX_PATCH_SIZE_24K}, /* RTL8822BE */ -// for RTL8822CE: Lite-On WCBN810L-AD module -{ 0x04CA, 0x4005, 0x8822, 0, 0, "mp_rtl8822c_fw", "rtl8822cu_fw", "rtl8822cu_config", NULL, 0 ,CONFIG_MAC_OFFSET_GEN_4PLUS, MAX_PATCH_SIZE_40K}, /* RTL8822CE */ -// for RTL8822CE: AzureWave AW-CB375NF module -{ 0x13D3, 0x3548, 0x8822, 0, 0, "mp_rtl8822c_fw", "rtl8822cu_fw", "rtl8822cu_config", NULL, 0 ,CONFIG_MAC_OFFSET_GEN_4PLUS, MAX_PATCH_SIZE_40K}, /* RTL8822CE */ -// for RTL8822CE: AzureWave AW-CB375NF module -{ 0x13D3, 0x3549, 0x8822, 0, 0, "mp_rtl8822c_fw", "rtl8822cu_fw", "rtl8822cu_config", NULL, 0 ,CONFIG_MAC_OFFSET_GEN_4PLUS, MAX_PATCH_SIZE_40K}, /* RTL8822CE */ - /* NOTE: must append patch entries above the null entry */ { 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, 0, 0, 0 } }; @@ -387,6 +379,7 @@ static void rtk_usb_update_altsettings(usb_patch_info *patch_entry, unsigned cha else memset(extra_extry, 0, MAX_ALT_CONFIG_SIZE); + ALOGI("ORG Config len=%08zx:\n", config_len); for(i = 0; i <= config_len; i+= 0x10) { @@ -885,6 +878,16 @@ void hw_usb_config_cback(void *p_mem) hw_cfg_cb.state = 0; is_proceeding = TRUE; + if(hw_cfg_cb.config_len) + { + free(hw_cfg_cb.config_buf); + hw_cfg_cb.config_len = 0; + } + if(hw_cfg_cb.fw_len) + { + free(hw_cfg_cb.fw_buf); + hw_cfg_cb.fw_len= 0; + } } /* if(hw_cfg_cb.lmp_subversion == LMPSUBVERSION_8723a) @@ -903,7 +906,29 @@ void hw_usb_config_cback(void *p_mem) }*/ } else { - ALOGE("status = %d, or p_evt_buf is NULL", status); + ALOGE("status = %d, or p_evt_buf is NULL", status); + if(hw_cfg_cb.total_buf){ + free(hw_cfg_cb.total_buf); + hw_cfg_cb.total_len = 0; + } + + bt_vendor_cbacks->dealloc(p_buf); + bt_vendor_cbacks->fwcfg_cb(BT_VND_OP_RESULT_FAIL); + + hw_cfg_cb.state = 0; + is_proceeding = TRUE; + + if(hw_cfg_cb.config_len) + { + free(hw_cfg_cb.config_buf); + hw_cfg_cb.config_len = 0; + } + + if(hw_cfg_cb.fw_len) + { + free(hw_cfg_cb.fw_buf); + hw_cfg_cb.fw_len= 0; + } } break; } @@ -957,14 +982,15 @@ CFG_USB_START: break; } hw_cfg_cb.max_patch_size = prtk_usb_patch_file_info->max_patch_size; - hw_cfg_cb.config_len = rtk_usb_get_bt_config(&hw_cfg_cb.config_buf, prtk_usb_patch_file_info->config_name, prtk_usb_patch_file_info->mac_offset); + if(!hw_cfg_cb.config_len) + hw_cfg_cb.config_len = rtk_usb_get_bt_config(&hw_cfg_cb.config_buf, prtk_usb_patch_file_info->config_name, prtk_usb_patch_file_info->mac_offset); if (hw_cfg_cb.config_len) { ALOGE("update altsettings"); rtk_usb_update_altsettings(prtk_usb_patch_file_info, hw_cfg_cb.config_buf, &(hw_cfg_cb.config_len)); } - - hw_cfg_cb.fw_len = rtk_get_bt_firmware(&hw_cfg_cb.fw_buf, prtk_usb_patch_file_info->patch_name); + if(!hw_cfg_cb.fw_len) + hw_cfg_cb.fw_len = rtk_get_bt_firmware(&hw_cfg_cb.fw_buf, prtk_usb_patch_file_info->patch_name); if (hw_cfg_cb.fw_len < 0) { ALOGE("Get BT firmware fail"); diff --git a/rtkbt/code/libbt-vendor/src/rtk_btservice.c b/rtkbt/code/libbt-vendor/src/rtk_btservice.c index 0175703..54f7c10 100755 --- a/rtkbt/code/libbt-vendor/src/rtk_btservice.c +++ b/rtkbt/code/libbt-vendor/src/rtk_btservice.c @@ -25,7 +25,7 @@ ******************************************************************************/ #define LOG_TAG "bt_service" -#define RTKBT_RELEASE_NAME "20191111_BT_ANDROID_9.0" +#define RTKBT_RELEASE_NAME "20200422_BT_ANDROID_10.0" #include #include @@ -95,6 +95,7 @@ typedef struct Rtk_Btservice_Info timer_t timer_hcicmd_reply; RT_LIST_HEAD cmdqueue_list; pthread_mutex_t cmdqueue_mutex; + RT_LIST_HEAD socket_node_list; volatile uint8_t cmdqueue_thread_running; volatile uint8_t epoll_thread_running; void (*current_complete_cback)(void *); @@ -109,17 +110,6 @@ typedef struct Rtk_Service_Data void (*complete_cback)(void *); }Rtk_Service_Data; -/* -typedef struct Rtk_Socket_Data -{ - char type; //hci,other,inner - uint8_t opcodeh; - uint8_t opcodel; - uint8_t parameter_len; - uint8_t parameter[0]; -}Rtk_Socket_Data; -*/ - typedef struct Rtk_Queue_Data { RT_LIST_ENTRY list; @@ -130,6 +120,12 @@ typedef struct Rtk_Queue_Data void (*complete_cback)(void *); }Rtkqueuedata; +typedef struct Rtk_socket_node +{ + RT_LIST_ENTRY list; + int client_fd; +}Rtkqueuenode; + extern void rtk_vendor_cmd_to_fw(uint16_t opcode, uint8_t parameter_len, uint8_t* parameter, tINT_CMD_CBACK p_cback); static Rtk_Btservice_Info *rtk_btservice = NULL; static void Rtk_Service_Send_Hwerror_Event(); @@ -353,6 +349,7 @@ void Rtk_Service_Vendorcmd_Hook(Rtk_Service_Data *RtkData, int client_sock) static void Rtk_Service_Cmd_Event_Cback(void *p_mem) { + hcicmd_stop_reply_timer(); if(p_mem != NULL) { if(rtk_btservice->current_complete_cback != NULL) @@ -365,7 +362,6 @@ static void Rtk_Service_Cmd_Event_Cback(void *p_mem) } rtk_btservice->current_complete_cback = NULL; rtk_btservice->opcode = 0; - hcicmd_stop_reply_timer(); sem_post(&rtk_btservice->cmdsend_sem); } } @@ -426,8 +422,8 @@ static void* cmdready_thread() rtk_btservice->current_client_sock = desc->client_sock; rtk_btservice->current_complete_cback = desc->complete_cback; rtk_btservice->opcode = desc->opcode; - rtk_vendor_cmd_to_fw(desc->opcode, desc->parameter_len, desc->parameter, Rtk_Service_Cmd_Event_Cback); hcicmd_start_reply_timer(); + rtk_vendor_cmd_to_fw(desc->opcode, desc->parameter_len, desc->parameter, Rtk_Service_Cmd_Event_Cback); if(desc->parameter_len > 0) free(desc->parameter); } @@ -641,6 +637,9 @@ static int rtk_socket_accept(socketfd) close(client_sock); return -1; } + Rtkqueuenode* node = (Rtkqueuenode*)malloc(sizeof(Rtkqueuenode)); + node->client_fd = client_sock; + ListAddToTail(&node->list, &rtk_btservice->socket_node_list); return 0; } @@ -676,6 +675,18 @@ static void *epoll_thread() { ALOGE("%s unable to register fd %d to epoll set: %s", __func__, events[i].data.fd, strerror(errno)); } + RT_LIST_HEAD * Head = &(rtk_btservice->socket_node_list); + RT_LIST_ENTRY* Iter = NULL, *Temp = NULL; + Rtkqueuenode* desc = NULL; + LIST_FOR_EACH_SAFELY(Iter, Temp, Head) + { + desc = LIST_ENTRY(Iter, Rtkqueuenode, list); + if(desc && (desc->client_fd == events[i].data.fd)) { + ListDeleteNode(&desc->list); + free(desc); + break; + } + } close(events[i].data.fd); } else if(events[i].events & (EPOLLIN | EPOLLHUP | EPOLLERR)) @@ -787,6 +798,19 @@ void RTK_btservice_thread_stop() pthread_join(rtk_btservice->cmdreadythd, NULL); pthread_join(rtk_btservice->epollthd, NULL); close(rtk_btservice->epoll_fd); + //close socket fd connected before + RT_LIST_HEAD * Head = &(rtk_btservice->socket_node_list); + RT_LIST_ENTRY* Iter = NULL, *Temp = NULL; + Rtkqueuenode* desc = NULL; + LIST_FOR_EACH_SAFELY(Iter, Temp, Head) + { + desc = LIST_ENTRY(Iter, Rtkqueuenode, list); + if(desc) { + close(desc->client_fd); + ListDeleteNode(&desc->list); + free(desc); + } + } ALOGD("%s end!", __func__); } @@ -828,6 +852,9 @@ int RTK_btservice_init() goto fail1; } + RT_LIST_HEAD* head = &rtk_btservice->socket_node_list; + ListInitializeHeader(head); + rtk_btservice->epoll_fd = epoll_create(64); if (rtk_btservice->epoll_fd == -1) { ALOGE("%s unable to create epoll instance: %s", __func__, strerror(errno)); diff --git a/rtkbt/code/libbt-vendor/src/rtk_heartbeat.c b/rtkbt/code/libbt-vendor/src/rtk_heartbeat.c index 81c8012..f3ec9bb 100755 --- a/rtkbt/code/libbt-vendor/src/rtk_heartbeat.c +++ b/rtkbt/code/libbt-vendor/src/rtk_heartbeat.c @@ -16,7 +16,7 @@ * ******************************************************************************/ #define LOG_TAG "rtk_heartbeat" -#define RTKBT_RELEASE_NAME "20191111_BT_ANDROID_9.0" +#define RTKBT_RELEASE_NAME "20200422_BT_ANDROID_10.0" #include #include @@ -158,7 +158,7 @@ static void rtkbt_heartbeat_cmpl_cback (void *p_params) { uint8_t status = 0; uint16_t seqnum = 0; - HC_BT_HDR *p_evt_buf = p_params; + HC_BT_HDR *p_evt_buf = NULL; //uint8_t *p = NULL; if(!heartbeatFlag) diff --git a/rtkbt/code/libbt-vendor/src/rtk_parse.c b/rtkbt/code/libbt-vendor/src/rtk_parse.c index 9510a5d..52b91de 100755 --- a/rtkbt/code/libbt-vendor/src/rtk_parse.c +++ b/rtkbt/code/libbt-vendor/src/rtk_parse.c @@ -34,7 +34,7 @@ * ******************************************************************************/ #define LOG_TAG "rtk_parse" -#define RTKBT_RELEASE_NAME "20191111_BT_ANDROID_9.0" +#define RTKBT_RELEASE_NAME "20200422_BT_ANDROID_10.0" #include #include @@ -44,6 +44,7 @@ #include #include #include +#include #include #include #include @@ -66,6 +67,51 @@ #define RTK_COEX_VERSION "3.0" +//#define RTK_ROLE_SWITCH_RETRY + +#ifdef RTK_ROLE_SWITCH_RETRY +#ifndef MAX_LINKS +#define MAX_LINKS 7 +#endif + +#ifndef BD_ADDR_LEN +#define BD_ADDR_LEN 6 +typedef uint8_t BD_ADDR[BD_ADDR_LEN]; +#endif + +typedef enum { + ROLE_SWITCH_COMMAND_NONE, + ROLE_SWITCH_COMMAND_PENDING, + ROLE_SWITCH_COMMAND_SUCCESS, + ROLE_SWITCH_COMMAND_DISALLOW +} role_switch_state; + +/****************************************************************************** +** role switch monitor structions +******************************************************************************/ +typedef struct +{ + bool in_use; /* TRUE when in use, FALSE when not */ + role_switch_state state; + BD_ADDR remote_bd_addr; /* The BD address of the remote */ + bool isMaster; /* is_Master */ + unsigned short handle; /* Link handle */ + timer_t timer_hci_role_switch_cmd; /* CB Timer Entry */ + unsigned short count; /* role swith event(slave) count */ + time_t time; + double diff_s; /*time diff between two successive role switch (slave)event */ +}role_monitor_cb; +BD_ADDR EMPTY_ADDR = {0,0,0,0,0,0}; +role_monitor_cb role_monitor_pool[MAX_LINKS]; /* Role Switch Control Block pool */ +#define TIME_LIMIT_FOR_ROLE_SWITCH (60*5) /*5 minutes*/ +#define UNKOWN_HANDLE (0XFF) +#define HCI_CMD_VNDR_ROLESWITCH 0xFCAD + +typedef void (*tTIMER_HANDLE_ROLE_SWITCH)(union sigval sigval_value); +static void rtk_start_role_switch_schedule(role_monitor_cb * p); +#endif + + char invite_req[] = "INVITE_REQ"; char invite_rsp[] = "INVITE_RSP"; char attend_req[] = "ATTEND_REQ"; @@ -635,6 +681,7 @@ tRTK_CONN_PROF* allocate_connection_by_handle(uint16_t handle) return phci_conn; } + void init_connection_hash(tRTK_PROF* h5) { RT_LIST_HEAD* head = &h5->conn_hash; @@ -923,6 +970,313 @@ void rtk_vendor_cmd_to_fw(uint16_t opcode, uint8_t parameter_len, uint8_t* param return ; } + +#ifdef RTK_ROLE_SWITCH_RETRY + +static timer_t OsAllocateTimer_role_switch(tTIMER_HANDLE_ROLE_SWITCH timer_callback,role_monitor_cb *p_cb) +{ + struct sigevent sigev; + timer_t timerid; + + memset(&sigev, 0, sizeof(struct sigevent)); + sigev.sigev_notify = SIGEV_THREAD; + sigev.sigev_notify_function = timer_callback; + sigev.sigev_value.sival_ptr = p_cb; + + ALOGD("OsAllocateTimer bt_service sigev.sigev_notify_thread_id = syscall(__NR_gettid)!"); + + if (timer_create(CLOCK_REALTIME, &sigev, &timerid) == 0) + { + return timerid; + } + else + { + ALOGE("timer_create error!"); + return (timer_t)-1; + } +} + +static int OsFreeTimer_role_switch(timer_t timerid) +{ + int ret = 0; + if(timerid == (timer_t)-1) { + ALOGE("OsFreeTimer fail timer id error"); + return -1; + } + ret = timer_delete(timerid); + if(ret != 0) + ALOGE("timer_delete fail with errno(%d)", errno); + + return ret; +} + + static int OsStartTimer_role_switch(timer_t timerid, int msec, int mode) + { + struct itimerspec itval; + + if(timerid == (timer_t)-1) { + ALOGE("OsStartTimer fail timer id error"); + return -1; + } + itval.it_value.tv_sec = msec / 1000; + itval.it_value.tv_nsec = (long)(msec % 1000) * (1000000L); + //ALOGE("OsStartTimer_role_switch = %ld itval.it_value.tv_nsec = %ld libs_liu",itval.it_value.tv_sec,itval.it_value.tv_nsec); + if (mode == 1) + { + itval.it_interval.tv_sec = itval.it_value.tv_sec; + itval.it_interval.tv_nsec = itval.it_value.tv_nsec; + } + else + { + itval.it_interval.tv_sec = 0; + itval.it_interval.tv_nsec = 0; + } + + //Set the Timer when to expire through timer_settime + //ALOGE("OsStartTimer_role_switch = %ld itval.it_value.tv_nsec = %ld libs_liu end timerid = %ld",itval.it_value.tv_sec,itval.it_value.tv_nsec,(long)timerid); + if (timer_settime(timerid, 0, &itval, NULL) != 0) + { + ALOGE("time_settime error!"); + return -1; + } + ALOGI("OsStartTimer_role_switch = %ld itval.it_value.tv_nsec = %ld",itval.it_value.tv_sec,itval.it_value.tv_nsec); + + return 0; + +} + +static int OsStopTimer_role_switch(timer_t timerid) +{ + return OsStartTimer_role_switch(timerid, 0, 0); +} + +int find_remote_device_by_address(BD_ADDR address){ + int index = 0; + role_monitor_cb *p_cb = &(role_monitor_pool[0]); + for (index = 0; index < MAX_LINKS; index++,p_cb++){ + if((p_cb->in_use)&&(!memcmp (p_cb->remote_bd_addr, address, BD_ADDR_LEN))){ + return index; + } + } + ALOGE( "find_remote_device_by_address device not found"); + return -1; +} + + +int find_pending_role_switch_process(){ + int index = 0; + role_monitor_cb *p_cb = &(role_monitor_pool[0]); + for (index = 0; index < MAX_LINKS; index++,p_cb++){ + if((p_cb->in_use)&&(p_cb->state == ROLE_SWITCH_COMMAND_PENDING)){ + return index; + } + } + ALOGE( "find_pending_role_switch_process device not found"); + return -1; +} + + +int allocate_role_switch_pool_by_handle(uint16_t handle,BD_ADDR remote_address) +{ + int index = 0; + role_monitor_cb *p_cb = &(role_monitor_pool[0]); + /*check there is no same address exist*/ + if(((index = find_remote_device_by_address(remote_address)) != -1)){ + if(role_monitor_pool[index].handle == UNKOWN_HANDLE){ + ALOGI( "allocate_role_switch_pool_by_handle slot has been exist and is waiting update\n"); + role_monitor_pool[index].handle = handle; + return index; + }else{ + ALOGE( "allocate_role_switch_pool_by_handle slot has been exist it ,return \n"); + return -1; + } + } + for (index = 0; index < MAX_LINKS; index++,p_cb++){ + if(!(p_cb->in_use)){ + p_cb->count = 0; + p_cb->diff_s = 0; + p_cb->handle = handle; + p_cb->time = 0; + p_cb->in_use = TRUE; + p_cb->timer_hci_role_switch_cmd = (timer_t)-1; + memcpy(p_cb->remote_bd_addr,remote_address,BD_ADDR_LEN); + return index; + } + } + ALOGE( "allocate_role_switch_pool_by_handle no slot found"); + return -1; + +} + +static void rtk_record_connection_info(uint8_t* p){ + uint8_t status = 0; + uint16_t handle = 0; + int index = 0; + BD_ADDR remote_address; + status = *p++; + if(status != 0){ + ALOGE("rtk_record_connection_info handle = 0x%x status = %d connection failed! ignore !",handle,status); + return; + } + STREAM_TO_UINT16 (handle, p); + //ALOGE("rtk_record_connection_info handle = 0x%x",handle); + memcpy(remote_address,p,BD_ADDR_LEN); + //ALOGE("rtk_record_connection_info remote_address = %x %x %x %x %x %x libs_liu",remote_address[0],remote_address[1], + // remote_address[2],remote_address[3],remote_address[4],remote_address[5]); + index = allocate_role_switch_pool_by_handle(handle,remote_address); + if(index <0){ + ALOGE("rtk_record_connection_info index = 0x%x",index); + return; + } + ALOGD("rtk_record_connection_info index = 0x%x",index); +} + +static void rtk_connection_info_clear(uint8_t* p){ + + uint8_t status = 0; + uint16_t handle = 0; + status = *p++; + STREAM_TO_UINT16(handle, p); + ALOGE("rtk_connection_info_clear handle = 0x%x libs_liu",handle); + + int index = 0; + role_monitor_cb *p_cb = &(role_monitor_pool[0]); + for (index = 0; index < MAX_LINKS; index++,p_cb++){ + if((p_cb->in_use)&&(p_cb->handle == handle)){ + //ALOGE("rtk_connection_info_clear begin to clear this slot p_cb->timer_hci_role_switch_cmd = %ld",(long)p_cb->timer_hci_role_switch_cmd); + p_cb->in_use = FALSE; + p_cb->state = ROLE_SWITCH_COMMAND_NONE; + p_cb->handle = 0; + p_cb->diff_s = 0; + p_cb->count = 0; + p_cb->isMaster = FALSE; + OsStopTimer_role_switch(p_cb->timer_hci_role_switch_cmd); + OsFreeTimer_role_switch(p_cb->timer_hci_role_switch_cmd); + p_cb->timer_hci_role_switch_cmd = (timer_t)-1; + memcpy(p_cb->remote_bd_addr,EMPTY_ADDR,BD_ADDR_LEN); + return; + } + } + ALOGD( "rtk_connection_info_clear done"); + return ; +} + +static void Rtk_Role_switch_Event_Cback(void *arg) +{ + if(arg != NULL) + { + HC_BT_HDR *p_buf = NULL; + p_buf = (HC_BT_HDR *)arg; + uint8_t *p = p_buf->data; + ALOGE( " Rtk_Role_switch_Event_Cback event_code = %d length = %d",p[0],p[1]); + + /*find out which one inititor this process*/ + int index = find_pending_role_switch_process(); + if(index == -1) + return; + role_monitor_cb *p_cb = &(role_monitor_pool[index]); + p_cb->state = ROLE_SWITCH_COMMAND_SUCCESS; + if(p[5] == 0x0c){ + p_cb->state = ROLE_SWITCH_COMMAND_DISALLOW; + ALOGE( " Rtk_Role_switch_Event_Cback command is disallowed libs_liu"); + p_cb->count = 1; + rtk_start_role_switch_schedule(p_cb); + } + + }else{ + ALOGE("%s Rtk_Role_switch_Event_Cback arg == NULL, it should not happend", __func__); + } +} + + + +static void rtk_send_role_switch_handler(union sigval sigev_value){ + role_monitor_cb * p_cb = (role_monitor_cb *)sigev_value.sival_ptr; + if(!p_cb->in_use){ + ALOGE( "rtk_send_role_switch_handler p_cb now is not in use ,return !"); + return; + } + p_cb->state = ROLE_SWITCH_COMMAND_PENDING; + /*begin to send hci command to controller*/ + uint8_t param_len = 7; + uint8_t param[param_len]; + memcpy(param,p_cb->remote_bd_addr,BD_ADDR_LEN); + param[param_len-1] = 0; + rtk_vendor_cmd_to_fw(HCI_CMD_VNDR_ROLESWITCH,param_len , param, Rtk_Role_switch_Event_Cback); + /*remember to free the timer*/ + OsStopTimer_role_switch(p_cb->timer_hci_role_switch_cmd); + OsFreeTimer_role_switch(p_cb->timer_hci_role_switch_cmd); + p_cb->timer_hci_role_switch_cmd = (timer_t)-1; + +} + +static void rtk_start_role_switch_schedule(role_monitor_cb * p){ + role_monitor_cb *p_cb = p; + double time_out; + if(p_cb == NULL){ + ALOGE("rtk_start_role_switch_schedule p_cb==NULL"); + return; + } + if(p_cb->diff_s > TIME_LIMIT_FOR_ROLE_SWITCH){ + ALOGE("rtk_start_role_switch_schedule p_cb->diff_s is larger then threshold value"); + p_cb->count = 0; + } + time_out = pow((double)2,(double)(p_cb->count))*500; + if(time_out > TIME_LIMIT_FOR_ROLE_SWITCH*1000){ + ALOGE("rtk_start_role_switch_schedule time_out is too large,do not try again"); + } + + p_cb->timer_hci_role_switch_cmd = OsAllocateTimer_role_switch(rtk_send_role_switch_handler,p_cb); + if(p_cb->timer_hci_role_switch_cmd == (timer_t)-1) { + ALOGE("%s : alloc reply timer fail!", __func__); + return; + } + ALOGE("%s : time_out = %lf", __func__,time_out); + OsStartTimer_role_switch(p_cb->timer_hci_role_switch_cmd, (int)time_out, 1); +} + +static void rtk_handle_role_change_evt(uint8_t* p){ + uint8_t status = 0; + int index = 0; + uint8_t new_role = 0; + status = *p++; + BD_ADDR remote_address; + ALOGE("rtk_handle_role_change_evt status = %d",status); + memcpy(remote_address,p,BD_ADDR_LEN); + ALOGE("rtk_handle_role_change_evt remote_address = %x %x %x %x %x %x",remote_address[0],remote_address[1], + remote_address[2],remote_address[3],remote_address[4],remote_address[5]); + p += BD_ADDR_LEN; + new_role = *p; + if(new_role == 0){ + ALOGE("rtk_handle_role_change_evt now is Mastar ,do nothing"); + }else{ + ALOGE("rtk_handle_role_change_evt now is slave "); + /*find the slot */ + index = find_remote_device_by_address(remote_address); + if(index < 0){ + ALOGE("rtk_handle_role_change_evt device not found ,maybe role change comming first and alloc one libs_liu"); + index = allocate_role_switch_pool_by_handle(UNKOWN_HANDLE,remote_address); + if(index <0){ + ALOGE("allocate_role_switch_pool_by_handle failed index = 0x%x libs_liu",index); + return; + } + } + /*get time_r*/ + role_monitor_cb * p_cb = &(role_monitor_pool[index]); + time_t now = time(NULL); + p_cb->diff_s = difftime(now,p_cb->time); + ALOGE("rtk_handle_role_change_evt p_cb->diff_s =%lf libs_liu",p_cb->diff_s); + p_cb->time = now; + p_cb->count++; + p_cb->isMaster = FALSE; + /*begin to schedule timer*/ + rtk_start_role_switch_schedule(p_cb); + } + +} + +#endif + void rtk_notify_profileinfo_to_fw() { RT_LIST_HEAD* head = NULL; @@ -2203,6 +2557,9 @@ void rtk_parse_init(void) ALOGE("UDP socket fail, try to use rtk_btcoex chrdev"); open_btcoex_chrdev(); } +#ifdef RTK_ROLE_SWITCH_RETRY + memset(role_monitor_pool,0,sizeof(role_monitor_pool)); +#endif } void rtk_parse_cleanup() @@ -2758,11 +3115,24 @@ void rtk_parse_internal_event_intercept(uint8_t *p_msg) case HCI_CONNECTION_COMP_EVT: case HCI_ESCO_CONNECTION_COMP_EVT: rtk_handle_connection_complete_evt(p); +#ifdef RTK_ROLE_SWITCH_RETRY + /*update role switch pool ,record this info*/ + rtk_record_connection_info(p); +#endif break; case HCI_DISCONNECTION_COMP_EVT: rtk_handle_disconnect_complete_evt(p); +#ifdef RTK_ROLE_SWITCH_RETRY + rtk_connection_info_clear(p); +#endif + break; + +#ifdef RTK_ROLE_SWITCH_RETRY + case HCI_ROLE_CHANGE_EVT: + rtk_handle_role_change_evt(p); break; +#endif case HCI_VENDOR_SPECIFIC_EVT: { diff --git a/rtkbt/code/libbt-vendor/src/userial_vendor.c b/rtkbt/code/libbt-vendor/src/userial_vendor.c index 3daa5a8..ecc291e 100755 --- a/rtkbt/code/libbt-vendor/src/userial_vendor.c +++ b/rtkbt/code/libbt-vendor/src/userial_vendor.c @@ -77,6 +77,7 @@ extern void Heartbeat_cleanup(); extern void Heartbeat_init(); extern int RTK_btservice_init(); + /****************************************************************************** ** Local type definitions ******************************************************************************/ @@ -312,7 +313,10 @@ static void userial_send_hw_error() *******************************************************************************/ void userial_vendor_init(char *bt_device_node) { +#ifdef RTK_HANDLE_EVENT + memset(&rtkbt_adv_con, 0, sizeof(rtkbt_lescn_t)); +#endif memset(&vnd_userial, 0, sizeof(vnd_userial_cb_t)); vnd_userial.fd = -1; char value[100]; @@ -486,9 +490,14 @@ static void userial_socket_close(void) if ((vnd_userial.uart_fd[1] > 0) && (result = close(vnd_userial.uart_fd[1])) < 0) ALOGE( "%s (fd:%d) FAILED result:%d", __func__, vnd_userial.uart_fd[1], result); - if(vnd_userial.thread_socket_id != -1) - pthread_join(vnd_userial.thread_socket_id, NULL); - + if(vnd_userial.thread_socket_id != -1){ + if ((result = pthread_join(vnd_userial.thread_socket_id, NULL)) < 0) + ALOGE( "data thread pthread_join() vnd_userial.thread_socket_id failed result:%d", result); + else{ + vnd_userial.thread_socket_id = -1; + ALOGE( "data thread pthread_join() vnd_userial.thread_socket_id pthread_join_success result:%d", result); + } + } if(vnd_userial.epoll_fd > 0) close(vnd_userial.epoll_fd); @@ -527,8 +536,14 @@ static void userial_coex_close(void) ALOGE( "%s (fd:%d) FAILED result:%d", __func__, vnd_userial.event_fd, result); close(vnd_userial.cpoll_fd); - if(vnd_userial.thread_coex_id != -1) - pthread_join(vnd_userial.thread_coex_id, NULL); + if(vnd_userial.thread_coex_id != -1){ + if(pthread_join(vnd_userial.thread_coex_id, NULL) != 0){ + ALOGE( "%s vnd_userial.thread_coex_id pthread_join_failed", __func__); + }else{ + vnd_userial.thread_coex_id = -1; + ALOGE( "%s vnd_userial.thread_coex_id pthread_join_success", __func__); + } + } vnd_userial.cpoll_fd = -1; vnd_userial.event_fd = -1; } @@ -540,6 +555,23 @@ void userial_send_close_signal(void) RTK_NO_INTR(ret = write(vnd_userial.signal_fd[0], &close_signal, 1)); } +void userial_quene_close(void) +{ +#if 0 + int data_order_len = 0; + int recv_data_len = 0; + int send_data_len = 0; + data_order_len = RtbGetQueueLen(vnd_userial.data_order); + recv_data_len = RtbGetQueueLen(vnd_userial.recv_data); + send_data_len = RtbGetQueueLen(vnd_userial.send_data); + ALOGE( "%s data_order_len = %d,recv_data_len = %d ,send_data_len = %d", __func__,data_order_len,recv_data_len,send_data_len); +#endif + RtbQueueFree(vnd_userial.data_order); + RtbQueueFree(vnd_userial.recv_data); + RtbQueueFree(vnd_userial.send_data); +} + + /******************************************************************************* ** ** Function userial_vendor_close @@ -579,7 +611,7 @@ void userial_vendor_close(void) userial_uart_close(); userial_coex_close(); userial_socket_close(); - + userial_quene_close(); if((rtkbt_transtype & RTKBT_TRANS_UART) && (rtkbt_transtype & RTKBT_TRANS_H5)) { h5_int_interface->h5_int_cleanup(); } @@ -780,6 +812,7 @@ static void userial_enqueue_coex_rawdata(unsigned char * buffer, int length, boo } } +#ifdef RTK_HANDLE_EVENT static void userial_send_cmd_to_controller(unsigned char * recv_buffer, int total_length) { if(rtkbt_transtype & RTKBT_TRANS_H4) { @@ -791,6 +824,7 @@ static void userial_send_cmd_to_controller(unsigned char * recv_buffer, int tota userial_enqueue_coex_rawdata(recv_buffer, total_length, false); } +#endif static void userial_send_acl_to_controller(unsigned char * recv_buffer, int total_length) { if(rtkbt_transtype & RTKBT_TRANS_H4) { @@ -2317,7 +2351,7 @@ static void* userial_recv_socket_thread(void *arg) } } } - vnd_userial.thread_socket_id = -1; + //vnd_userial.thread_socket_id = -1; ALOGD("%s exit", __func__); return NULL; } @@ -2404,7 +2438,7 @@ static void* userial_coex_thread(void *arg) } } } - vnd_userial.thread_coex_id = -1; + // vnd_userial.thread_coex_id = -1; ALOGD("%s exit", __func__); return NULL; } diff --git a/rtkbt/code/rtkcmd/rtkcmd.c b/rtkbt/code/rtkcmd/rtkcmd.c index f41ae3c..9b9fcef 100755 --- a/rtkbt/code/rtkcmd/rtkcmd.c +++ b/rtkbt/code/rtkcmd/rtkcmd.c @@ -141,23 +141,18 @@ int Rtkbt_Getevent(int sock_fd) int i; ret = read(sock_fd, &type, 1); - if(ret<=0) + if(ret <= 0) return -1; - //printf("event = %x\n",event); ret = read(sock_fd, &event, 1); - if(ret<=0) + if(ret <= 0) return -1; - //printf("event_len = %x\n",event_len); ret = read(sock_fd, &len, 1); - if(ret<=0) + if(ret <= 0) return -1; - //printf("offset = %x\n",offset); tot_len = len + 2; - //printf("layer_specific = %x\n",layer_specific); - recvbuf=(unsigned char *)malloc(sizeof(char)*tot_len); recvbuf[0] = event; recvbuf[1] = len; @@ -252,4 +247,4 @@ int main(int argc , char* argv[]) close(socketfd); -} \ No newline at end of file +} diff --git a/rtkbt/rtkbt.mk b/rtkbt/rtkbt.mk index 62602ca..7b3c53c 100755 --- a/rtkbt/rtkbt.mk +++ b/rtkbt/rtkbt.mk @@ -1,4 +1,4 @@ -# RELEASE NAME: 20191111_BT_ANDROID_9.0 +# RELEASE NAME: 20200422_BT_ANDROID_10.0 # RTKBT_API_VERSION=2.1.1.0 CUR_PATH := hardware/realtek/rtkbt @@ -31,8 +31,7 @@ endif # base bluetooth PRODUCT_PACKAGES += \ Bluetooth \ - libbt-vendor-realtek \ - rtkcmd \ + libbt-vendor \ audio.a2dp.default \ bluetooth.default \ android.hardware.bluetooth@1.0-impl \ @@ -47,7 +46,7 @@ PRODUCT_PROPERTY_OVERRIDES += \ persist.vendor.bluetooth.prefferedrole=master \ persist.vendor.rtkbtadvdisable=false -PRODUCT_SYSTEM_DEFAULT_PROPERTIES += persist.bluetooth.btsnoopenable=false \ +PRODUCT_SYSTEM_DEFAULT_PROPERTIES += persist.bluetooth.btsnooplogmode=disable \ persist.bluetooth.btsnooppath=/data/misc/bluedroid/btsnoop_hci.cfa \ persist.bluetooth.btsnoopsize=0xffff \ persist.bluetooth.showdeviceswithoutnames=false \ diff --git a/rtkbt/vendor/etc/bluetooth/rtkbt.conf b/rtkbt/vendor/etc/bluetooth/rtkbt.conf index 50fe2ad..46994be 100755 --- a/rtkbt/vendor/etc/bluetooth/rtkbt.conf +++ b/rtkbt/vendor/etc/bluetooth/rtkbt.conf @@ -1,4 +1,4 @@ -# RELEASE NAME: 20191111_BT_ANDROID_9.0 +# RELEASE NAME: 20200422_BT_ANDROID_10.0 # Bluetooth Device Name; NULL or comment means "ro.product.model" #Name=Realtek Bluetooth @@ -15,7 +15,7 @@ BtDeviceNode=?/dev/ttyS1:H5 RtkBtsnoopDump=false # BtSnoop log output file -BtSnoopFileName=/data/misc/bluedroid/btsnoop_hci.cfa +BtSnoopFileName=/data/vendor/bluetooth/btsnoop_hci.cfa # Preserve existing BtSnoop log before overwriting BtSnoopSaveLog=true diff --git a/rtkbt/vendor/usr/keylayout/Vendor_005d_Product_0002.kl b/rtkbt/vendor/usr/keylayout/Vendor_005d_Product_0002.kl index 1e894e1..767597a 100644 --- a/rtkbt/vendor/usr/keylayout/Vendor_005d_Product_0002.kl +++ b/rtkbt/vendor/usr/keylayout/Vendor_005d_Product_0002.kl @@ -19,7 +19,7 @@ # 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 1 BACK key 2 1 key 3 2 key 4 3 @@ -32,9 +32,8 @@ key 10 9 key 11 0 key 28 DPAD_CENTER key 59 HOME -key 61 HOME +key 60 TV_INPUT key 62 INFO -key 63 SEARCH key 103 DPAD_UP key 104 MEDIA_PREVIOUS key 105 DPAD_LEFT @@ -46,4 +45,4 @@ key 114 VOLUME_DOWN key 115 VOLUME_UP key 116 POWER key 130 MENU -#key 240 ESCAPE +key 217 ASSIST