--- /dev/null
+CUR_PATH := hardware/realtek/rtkbt
+
+PRODUCT_COPY_FILES += \
+ $(CUR_PATH)/Firmware/BT/rtl8703as_config:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8703as_config \
+ $(CUR_PATH)/Firmware/BT/rtl8703as_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8703as_fw \
+ $(CUR_PATH)/Firmware/BT/rtl8703bs_config:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8703bs_config \
+ $(CUR_PATH)/Firmware/BT/rtl8703bs_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8703bs_fw \
+ $(CUR_PATH)/Firmware/BT/rtl8703cs_config:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8703cs_config \
+ $(CUR_PATH)/Firmware/BT/rtl8703cs_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8703cs_fw \
+ $(CUR_PATH)/Firmware/BT/rtl8723a_config:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8723a_config \
+ $(CUR_PATH)/Firmware/BT/rtl8723a_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8723a_fw \
+ $(CUR_PATH)/Firmware/BT/rtl8723as_config:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8723as_config \
+ $(CUR_PATH)/Firmware/BT/rtl8723as_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8723as_fw \
+ $(CUR_PATH)/Firmware/BT/rtl8723b_config:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8723b_config \
+ $(CUR_PATH)/Firmware/BT/rtl8723b_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8723b_fw \
+ $(CUR_PATH)/Firmware/BT/rtl8723bs_config:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8723bs_config \
+ $(CUR_PATH)/Firmware/BT/rtl8723bs_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8723bs_fw \
+ $(CUR_PATH)/Firmware/BT/rtl8723bs_VQ0_config:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8723bs_VQ0_config \
+ $(CUR_PATH)/Firmware/BT/rtl8723bs_VQ0_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8723bs_VQ0_fw \
+ $(CUR_PATH)/Firmware/BT/rtl8723bu_config:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8723bu_config \
+ $(CUR_PATH)/Firmware/BT/rtl8723c_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8723c_fw \
+ $(CUR_PATH)/Firmware/BT/rtl8723cs_cg_config:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8723cs_cg_config \
+ $(CUR_PATH)/Firmware/BT/rtl8723cs_cg_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8723cs_cg_fw \
+ $(CUR_PATH)/Firmware/BT/rtl8723cs_vf_config:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8723cs_vf_config \
+ $(CUR_PATH)/Firmware/BT/rtl8723cs_vf_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8723cs_vf_fw \
+ $(CUR_PATH)/Firmware/BT/rtl8723cs_xx_config:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8723cs_xx_config \
+ $(CUR_PATH)/Firmware/BT/rtl8723cs_xx_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8723cs_xx_fw \
+ $(CUR_PATH)/Firmware/BT/rtl8723d_config:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8723d_config \
+ $(CUR_PATH)/Firmware/BT/rtl8723d_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8723d_fw \
+ $(CUR_PATH)/Firmware/BT/rtl8723ds_config:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8723ds_config \
+ $(CUR_PATH)/Firmware/BT/rtl8723ds_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8723ds_fw \
+ $(CUR_PATH)/Firmware/BT/rtl8761a_config:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8761a_config \
+ $(CUR_PATH)/Firmware/BT/rtl8761at_config:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8761at_config \
+ $(CUR_PATH)/Firmware/BT/rtl8761at_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8761at_fw \
+ $(CUR_PATH)/Firmware/BT/rtl8761au8192ee_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8761au8192ee_fw \
+ $(CUR_PATH)/Firmware/BT/rtl8761au8812ae_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8761au8812ae_fw \
+ $(CUR_PATH)/Firmware/BT/rtl8761au_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8761au_fw \
+ $(CUR_PATH)/Firmware/BT/rtl8761aw8192eu_config:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8761aw8192eu_config \
+ $(CUR_PATH)/Firmware/BT/rtl8761aw8192eu_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8761aw8192eu_fw \
+ $(CUR_PATH)/Firmware/BT/rtl8821a_config:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8821a_config \
+ $(CUR_PATH)/Firmware/BT/rtl8821a_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8821a_fw \
+ $(CUR_PATH)/Firmware/BT/rtl8821as_config:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8821as_config \
+ $(CUR_PATH)/Firmware/BT/rtl8821as_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8821as_fw \
+ $(CUR_PATH)/Firmware/BT/rtl8821c_config:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8821c_config \
+ $(CUR_PATH)/Firmware/BT/rtl8821c_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8821c_fw \
+ $(CUR_PATH)/Firmware/BT/rtl8821cs_config:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8821cs_config \
+ $(CUR_PATH)/Firmware/BT/rtl8821cs_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8821cs_fw \
+ $(CUR_PATH)/Firmware/BT/rtl8822b_config:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8822b_config \
+ $(CUR_PATH)/Firmware/BT/rtl8822b_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8822b_fw \
+ $(CUR_PATH)/Firmware/BT/rtl8822bs_config:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8822bs_config \
+ $(CUR_PATH)/Firmware/BT/rtl8822bs_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8822bs_fw \
+ $(CUR_PATH)/Firmware/BT/rtl8822c_config:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8822c_config \
+ $(CUR_PATH)/Firmware/BT/rtl8822c_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8822c_fw \
+ $(CUR_PATH)/Firmware/BT/rtl8822cs_config:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8822cs_config \
+ $(CUR_PATH)/Firmware/BT/rtl8822cs_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8822cs_fw \
+ $(CUR_PATH)/Firmware/BT/rtl8761b_config:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8761b_config \
+ $(CUR_PATH)/Firmware/BT/rtl8761b_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8761b_fw \
+ $(CUR_PATH)/Firmware/BT/rtl8761bt_config:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8761bt_config \
+ $(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 \
+
+
--- /dev/null
+ FW CUT SVN Coex
+rtl8761au8192ee_fw D 20411 0007
+rtl8761au_fw D 20411 0007
+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
+rtl8703bs_fw B 22073 1c00
+rtl8822b_fw C 21525 6c6c
+rtl8821cs_fw B 22037 4139
+rtl8761at_fw D 20411 0007
+rtl8822c_fw D 22017 0d0d
+rtl8761b_fw B 22017 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
+rtl8723b_fw B 19897 6d50
+rtl8723cs_vf_fw B 15854 5844
+rtl8703as_fw B 12234 473d
+rtl8822cs_fw D 22017 0d0d
+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
+rtl8723cs_cg_fw B 15854 5844
+rtl8761at8192ee_fw D 20411 0007
+rtl8761cs_fw B 21127 0606
+rtl8723bs_VQ0_fw B 16527 6549
--- /dev/null
+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 \
--- /dev/null
+ FW CUT SVN Coex
+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
+rtl8761bs_fw B 21127 0606
+rtl8822b_fw C 21525 6c6c
+rtl8821cs_fw B 22037 4139
+rtl8761at_fw D 21962 0007
+rtl8822c_fw D 22017 0d0d
+rtl8761b_fw B 22017 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
+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
+rtl8761at8192er_fw D 21962 0007
+rtl8723bs_VQ0_fw B 14422 5844
#define BTM_BLE_CONN_TIMEOUT_DEF 200
#define BTIF_HF_SERVICES (BTA_HSP_SERVICE_MASK)
-#define BTIF_HF_SERVICE_NAMES { BTIF_HSAG_SERVICE_NAME, NULL }
+#define BTIF_HF_SERVICE_NAMES { BTIF_HSAG_SERVICE_NAME, "" }
#define BTA_DISABLE_DELAY 1000 /* in milliseconds */
#define BTA_HOST_INTERLEAVE_SEARCH FALSE
include $(CLEAR_VARS)
LOCAL_SRC_FILES := \
+ ./plc/sbcplc.c \
./sbc/sbc.c \
./sbc/sbc_primitives.c \
./sbc/sbc_primitives_mmx.c \
--- /dev/null
+/*************************************************************\r
+SBC Example PLC ANSI-C Source Code\r
+File: sbcplc.c\r
+*************************************************************/\r
+#include <math.h>\r
+//#include "sbc.h"\r
+#include "sbcplc.h"\r
+#include <stdlib.h>\r
+/* Local Function Prototypes */\r
+float CrossCorrelation(short *x, short *y);\r
+int PatternMatch(short *y);\r
+float AmplitudeMatch(short *y, short bestmatch);\r
+/* Raised COSine table for OLA */\r
+float rcos[OLAL] = {0.99148655f,0.96623611f,0.92510857f,0.86950446f,\r
+ 0.80131732f,0.72286918f,0.63683150f,0.54613418f,\r
+ 0.45386582f,0.36316850f,0.27713082f,0.19868268f,\r
+ 0.13049554f,0.07489143f,0.03376389f,0.00851345f};\r
+\r
+/*****************************************************************************\r
+* Function: InitPLC() *\r
+* Purpose: Perform PLC initialization of memory vectors. *\r
+* Inputs: *plc_state - pointer to PLC state memory *\r
+* Outputs: *plc_state - initialized memory. *\r
+* Date: 03-18-2009\r
+*****************************************************************************/\r
+void InitPLC(struct PLC_State *plc_state)\r
+{\r
+ int i;\r
+ plc_state->nbf=0;\r
+ plc_state->bestlag=0;\r
+ for (i=0;i<LHIST+SBCRT;i++)\r
+ plc_state->hist[i] = 0;\r
+}\r
+\r
+/***********************************************************\r
+* Function: PLC_bad_frame()\r
+*\r
+* Purpose: Perform bad frame processing.\r
+*\r
+* Inputs: *plc_state - pointer to PLC state memory\r
+* *ZIRbuf - pointer to the ZIR response of the SBC decoder\r
+*\r
+* Outputs: *out - pointer to the output samples\r
+*\r
+* Date: 03-18-2009\r
+************************************************************/\r
+void PLC_bad_frame(struct PLC_State *plc_state, short *ZIRbuf, short *out)\r
+{\r
+ int i;\r
+ float val;\r
+ float sf;\r
+ plc_state->nbf++;\r
+ sf=1.0f;\r
+ i=0;\r
+ if (plc_state->nbf==1)\r
+ {\r
+ /* Perform pattern matching to find where to replicate */\r
+ plc_state->bestlag = PatternMatch(plc_state->hist);\r
+ plc_state->bestlag += M; /* the replication begins after the template match*/\r
+\r
+ /* Compute Scale Factor to Match Amplitude of Substitution Packet to that of\r
+ Preceding Packet */\r
+ sf = AmplitudeMatch(plc_state->hist, plc_state->bestlag);\r
+\r
+ for (i = 0; i < OLAL; i++)\r
+ {\r
+ val = ZIRbuf[i]*rcos[i] + sf*plc_state->hist[plc_state->bestlag+i]*rcos[OLAL-i-1];\r
+ if (val > 32767.0) val= 32767.0;\r
+ if (val < -32768.0) val=-32768.0;\r
+ plc_state->hist[LHIST+i] = (short)val;\r
+ }\r
+\r
+ for (;i<FS;i++)\r
+ {\r
+ val = sf*plc_state->hist[plc_state->bestlag+i];\r
+ if (val > 32767.0) val= 32767.0;\r
+ if (val < -32768.0) val=-32768.0;\r
+ plc_state->hist[LHIST+i] = (short)val;\r
+ }\r
+\r
+ for (;i<FS+OLAL;i++)\r
+ {\r
+ val = sf*plc_state->hist[plc_state->bestlag+i]*rcos[i-FS]+plc_state->hist[plc_state->bestlag+i]*rcos[OLAL-1-i+FS];\r
+ if (val > 32767.0) val= 32767.0;\r
+ if (val < -32768.0) val=-32768.0;\r
+ plc_state->hist[LHIST+i] = (short)val;\r
+ }\r
+\r
+ for (;i<FS+SBCRT+OLAL;i++)\r
+ plc_state->hist[LHIST+i] = plc_state->hist[plc_state->bestlag+i];\r
+ }\r
+ else\r
+ {\r
+ for (;i<FS;i++)\r
+ plc_state->hist[LHIST+i] = plc_state->hist[plc_state->bestlag+i];\r
+ for (;i<FS+SBCRT+OLAL;i++)\r
+ plc_state->hist[LHIST+i] = plc_state->hist[plc_state->bestlag+i];\r
+ }\r
+\r
+ for (i=0;i<FS;i++)\r
+ out[i] = plc_state->hist[LHIST+i];\r
+\r
+ /* shift the history buffer */\r
+ for (i=0;i<LHIST+SBCRT+OLAL;i++)\r
+ plc_state->hist[i] = plc_state->hist[i+FS];\r
+}\r
+\r
+/****************************************************************************\r
+*\r
+* Function: PLC_good_frame()\r
+*\r
+* Purpose: Perform good frame processing. Most of the time, this function\r
+* just updates history buffers and passes the input to the output,\r
+* but in the first good frame after frame loss, it must conceal the\r
+* received signal as it reconverges with the true output.\r
+*\r
+* Inputs: *plc_state - pointer to PLC state memory\r
+* *in - pointer to the input vector\r
+*\r
+* Outputs: *out - pointer to the output samples\r
+* Date: 03-18-2009\r
+*****************************************************************************/\r
+void PLC_good_frame(struct PLC_State *plc_state, short *in, short *out)\r
+{\r
+ int i;\r
+ i=0;\r
+ if (plc_state->nbf>0)\r
+ {\r
+ for (i=0;i<SBCRT;i++)\r
+ out[i] = plc_state->hist[LHIST+i];\r
+ for (;i<SBCRT+OLAL;i++)\r
+ out[i] = (short)(plc_state->hist[LHIST+i]*rcos[i-SBCRT] + in[i]*rcos[OLAL-1-i+SBCRT]);\r
+ }\r
+\r
+ for (;i<FS;i++)\r
+ out[i] = in[i];\r
+\r
+ /*Copy the output to the history buffer */\r
+ for (i=0;i<FS;i++)\r
+ plc_state->hist[LHIST+i] = out[i];\r
+\r
+ /* shift the history buffer */\r
+ for (i=0;i<LHIST;i++)\r
+ plc_state->hist[i] = plc_state->hist[i+FS];\r
+\r
+ plc_state->nbf=0;\r
+}\r
+\r
+/****************************************************************************\r
+*\r
+* Function: CrossCorrelation()\r
+*\r
+* Purpose: Compute the cross correlation according to Eq. (4) of Goodman\r
+* paper, except that the true correlation is used. His formula\r
+* seems to be incorrect.\r
+*\r
+* Inputs: *x - pointer to x input vector\r
+* *y - pointer to y input vector\r
+*\r
+* Outputs: Cn - return value containing the cross-correlation of x and y\r
+*\r
+* Date: 03-18-2009\r
+*****************************************************************************/\r
+float CrossCorrelation(short *x, short *y)\r
+{\r
+ int m;\r
+ float num;\r
+ float den;\r
+ float Cn;\r
+ float x2, y2;\r
+ num=0;\r
+ den=0;\r
+ x2=0.0;\r
+ y2=0.0;\r
+\r
+ for (m=0;m<M;m++)\r
+ {\r
+ num+=((float)x[m])*y[m];\r
+ x2+=((float)x[m])*x[m];\r
+ y2+=((float)y[m])*y[m];\r
+ }\r
+\r
+ den = (float)sqrt(x2*y2);\r
+ Cn = num/den;\r
+ return(Cn);\r
+}\r
+\r
+/****************************************************************************\r
+*\r
+* Function: PatternMatch()\r
+*\r
+* Purpose: Perform pattern matching to find the match of template with the\r
+* history buffer according to Section B of Goodman paper.\r
+*\r
+* Inputs: *y : pointer to history buffer\r
+*\r
+* Outputs: return(int): the lag corresponding to the best match. The lag is\r
+* with respect to the beginning of the history buffer.\r
+*\r
+* Date: 03-18-2009\r
+*****************************************************************************/\r
+int PatternMatch(short *y)\r
+{\r
+ int n;\r
+ float maxCn;\r
+ float Cn;\r
+ int bestmatch;\r
+ maxCn=-999999.0; /* large negative number */\r
+ bestmatch=0;\r
+\r
+ for (n=0;n<N;n++)\r
+ {\r
+ Cn = CrossCorrelation(&y[LHIST-M] /* x */, &y[n]);\r
+ if (Cn>maxCn)\r
+ {\r
+ bestmatch=n;\r
+ maxCn = Cn;\r
+ }\r
+ }\r
+ return(bestmatch);\r
+}\r
+\r
+/****************************************************************************\r
+*\r
+* Function: AmplitudeMatch()\r
+*\r
+* Purpose: Perform amplitude matching using mean-absolute-value according\r
+* to Goodman paper.\r
+*\r
+* Inputs: *y : pointer to history buffer\r
+* bestmatch : value of the lag to the best match\r
+*\r
+* Outputs: return(float): scale factor\r
+*\r
+* Date: 03-19-2009\r
+*****************************************************************************/\r
+float AmplitudeMatch(short *y, short bestmatch)\r
+{\r
+ int i;\r
+ float sumx;\r
+ float sumy;\r
+ float sf;\r
+ sumx = 0.0;\r
+ sumy = 0.000001f;\r
+\r
+ for (i=0;i<FS;i++)\r
+ {\r
+ sumx += abs(y[LHIST-FS+i]);\r
+ sumy += abs(y[bestmatch+i]);\r
+ }\r
+\r
+ sf = sumx/sumy;\r
+\r
+ /* This is not in the paper, but limit the scaling factor to something\r
+ reasonable to avoid creating artifacts */\r
+ if (sf<0.75f) sf=0.75f;\r
+\r
+ if (sf>1.2f) sf=1.2f;\r
+\r
+ return(sf);\r
+}\r
--- /dev/null
+/********************************************************\r
+SBC Example PLC ANSI-C Source Code\r
+File: sbcplc.h\r
+*****************************************************************************/\r
+#ifndef SBCPLC_H\r
+#define SBCPLC_H\r
+#define FS 120 /* Frame Size */\r
+#define N 256 /* 16ms - Window Length for pattern matching */\r
+#define M 64 /* 4ms - Template for matching */\r
+#define LHIST (N+FS-1) /* Length of history buffer required */\r
+#define SBCRT 36 /* SBC Reconvergence Time (samples) */\r
+#define OLAL 16 /* OverLap-Add Length (samples) */\r
+/* PLC State Information */\r
+struct PLC_State\r
+{\r
+ short hist[LHIST+FS+SBCRT+OLAL];\r
+ short bestlag;\r
+ int nbf;\r
+};\r
+/* Prototypes */\r
+void InitPLC(struct PLC_State *plc_state);\r
+void PLC_bad_frame(struct PLC_State *plc_state, short *ZIRbuf, short *out);\r
+void PLC_good_frame(struct PLC_State *plc_state, short *in, short *out);\r
+#endif /* SBCPLC_H */\r
+\r
#include <cutils/properties.h>
#include "rtk_common.h"
-#define RTK_VERSION "5.0.1"
+#define RTK_VERSION "5.1.1"
/******************************************************************************
** Constants & Macros
******************************************************************************/
/* Device port name where Bluetooth controller attached */
#ifndef BLUETOOTH_UART_DEVICE_PORT
-#define BLUETOOTH_UART_DEVICE_PORT "/dev/ttyS1" /* maguro */
+#define BLUETOOTH_UART_DEVICE_PORT "/dev/ttyO1" /* maguro */
#endif
/* Location of firmware patch files */
#ifndef FW_PATCHFILE_LOCATION
-#define FW_PATCHFILE_LOCATION "/vendor/etc/firmware/" /* maguro */
+#define FW_PATCHFILE_LOCATION "/vendor/firmware/" /* maguro */
#endif
#ifndef UART_TARGET_BAUD_RATE
* firmware patchram (.hcd) file.
*/
#ifndef USE_CONTROLLER_BDADDR
-#define USE_CONTROLLER_BDADDR FALSE
+#define USE_CONTROLLER_BDADDR TRUE //FALSE
#endif
/* sleep mode
#error "Unknown byte order"
#endif
-#define FIRMWARE_DIRECTORY "/vendor//etc/firmware/%s"
-#define BT_CONFIG_DIRECTORY "/vendor/etc/firmware/%s"
+#define FIRMWARE_DIRECTORY "/vendor/firmware/%s"
+#define BT_CONFIG_DIRECTORY "/vendor/firmware/%s"
#define PATCH_DATA_FIELD_MAX_SIZE 252
#define RTK_VENDOR_CONFIG_MAGIC 0x8723ab55
#define MAX_PATCH_SIZE_24K (1024*24) //24K
#define HCI_EVT_CMD_CMPL_OP1009_BDADDR_OFFSET (6) //BD_ADDR's offset in COMMAND Completed Event for OpCode 0x1009(Read BD_ADDR Command)
#define HCI_EVT_CMD_CMPL_OPFC6D_EVERSION_OFFSET (6) //eversion's offset in COMMAND Completed Event for OpCode 0xfc6d(Read eVERSION Vendor Command)
#define HCI_EVT_CMD_CMPL_OPFC61_CHIPTYPE_OFFSET (6) //chip type's offset in COMMAND Completed Event for OpCode 0xfc61(Read ChipType Vendor Command)
+#define HCI_EVT_CMD_CMPL_OPFC61_8761_CHIPTYPE_OFFSET (8) //8761B chip type's offset in COMMAND Completed Event for OpCode 0xfc61(Read ChipType Vendor Command)
//#define UPDATE_BAUDRATE_CMD_PARAM_SIZE (6)
#define HCI_CMD_PREAMBLE_SIZE (3)
#define EVENT_DATA_LENGTH_INDEX 2
+#define USERIAL_HWERR_CODE_RTK 0xfa
+#define H5_HWERR_CODE_RTK 0xfb
+#define HEARTBEAT_HWERR_CODE_RTK 0xfc
+#define RTKSERVICE_HWERR_CODE_RTK 0xfd
+
+#define HCI_CMD_VNDR_HEARTBEAT 0xfc94
+#define HCI_CMD_VNDR_AUTOPAIR 0xfc77
+
+
typedef struct {
uint8_t hci_version;
uint16_t hci_revision;
void userial_recv_rawdata_hook(unsigned char *buffer, unsigned int total_length);
+void userial_set_bt_interface_state(int bt_on);
#define RTK_HANDLE_EVENT
#define RTK_HANDLE_CMD
//#define CONFIG_SCO_OVER_HCI
+//#define CONFIG_SCO_MSBC_PLC
#endif /* USERIAL_VENDOR_H */
+++ /dev/null
-#ifndef _VND_BUILDCFG_H
-#define _VND_BUILDCFG_H
-#define BLUETOOTH_UART_DEVICE_PORT "/dev/ttyS1"
-#define FW_PATCHFILE_LOCATION "/etc/firmware/"
-#define LPM_IDLE_TIMEOUT_MULTIPLE 5
-#define SCO_USE_I2S_INTERFACE TRUE
-#define BTVND_DBG TRUE
-#define BTHW_DBG TRUE
-#define VNDUSERIAL_DBG TRUE
-#define UPIO_DBG TRUE
-#endif
LOCAL_C_INCLUDES += \
$(LOCAL_PATH)/../include \
$(LOCAL_PATH)/../codec/sbc \
+ $(LOCAL_PATH)/../codec/plc \
$(BDROID_DIR)/hci/include
LOCAL_SHARED_LIBRARIES := \
#undef NDEBUG
#define LOG_TAG "libbt_vendor"
-#define RTKBT_RELEASE_NAME "20190520_BT_ANDROID_9.0"
+#define RTKBT_RELEASE_NAME "20191111_BT_ANDROID_9.0"
#include <utils/Log.h>
#include "bt_vendor_rtk.h"
#include "upio.h"
extern uint8_t coex_log_enable;
extern void hw_config_start(char transtype);
extern void hw_usb_config_start(char transtype,uint32_t val);
-extern void RTK_btservice_init();
#if (HW_END_WITH_HCI_RESET == TRUE)
void hw_epilog_process(void);
}
/* Check if it is path. */
if((filestat.st_mode & S_IFDIR) == S_IFDIR){
- if(!Check_Key_Value(newpath,"idVendor",0x0bda))
+ 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))
continue;
newpdir =opendir(newpath);
/*read sub directory*/
else
hw_usb_config_start(RTKBT_TRANS_H4, usb_info);
}
- RTK_btservice_init();
}
break;
case BT_VND_OP_LPM_SET_MODE:
{
-
+ bt_vendor_lpm_mode_t mode = *(bt_vendor_lpm_mode_t *) param;
+ //for now if the mode is BT_VND_LPM_DISABLE, we guess the hareware bt
+ //interface is closing, we shall not send any cmd to the interface.
+ if(mode == BT_VND_LPM_DISABLE) {
+ userial_set_bt_interface_state(0);
+ }
}
break;
******************************************************************************/
#define LOG_TAG "bt_hwcfg"
-#define RTKBT_RELEASE_NAME "20190520_BT_ANDROID_9.0"
+#define RTKBT_RELEASE_NAME "20191111_BT_ANDROID_9.0"
#include <utils/Log.h>
#include <sys/types.h>
char property[100] = {0};
if (property_get("persist.vendor.rtkbt.bdaddr_path", property, "none")) {
if(strcmp(property, "none") == 0) {
+ ALOGE("%s,persist.vendor.rtkbt.bdaddr_path = none", __func__);
return -1;
}
else if(strcmp(property, "default") == 0) {
return 0;
}
}
+ ALOGE("%s,return -1", __func__);
return -1;
}
return hw_cfg_cb.heartbeat;
}
-uint16_t getLmp_subversion()
-{
- return hw_cfg_cb.lmp_subversion;
-}
-uint8_t getchip_type()
-{
- return hw_cfg_cb.chip_type;
-}
-
struct rtk_epatch_entry *rtk_get_patch_entry(bt_hw_cfg_cb_t *cfg_cb)
{
uint16_t i;
******************************************************************************/
#define LOG_TAG "bt_hwcfg_uart"
-#define RTKBT_RELEASE_NAME "20190520_BT_ANDROID_9.0"
+#define RTKBT_RELEASE_NAME "20191111_BT_ANDROID_9.0"
#include <utils/Log.h>
#include <sys/types.h>
{0x8821, HCI_VERSION_MASK_ALL, ~(1<<0xc), CHIP_TYPE_MASK_ALL, 1<<2, "rtl8821as_fw", "rtl8821as_config", CONFIG_MAC_OFFSET_GEN_1_2, MAX_PATCH_SIZE_24K}, //Rtl8821AS
// {0x8761, HCI_VERSION_MASK_ALL, HCI_REVISION_MASK_ALL, CHIP_TYPE_MASK_ALL, 1<<3, "rtl8761at_fw", "rtl8761at_config", CONFIG_MAC_OFFSET_GEN_1_2, MAX_PATCH_SIZE_24K}, //Rtl8761AW
{0x8761, HCI_VERSION_MASK_ALL, ~(1<<0xb), CHIP_TYPE_MASK_ALL, 1<<3, "rtl8761at_fw", "rtl8761at_config", CONFIG_MAC_OFFSET_GEN_1_2, MAX_PATCH_SIZE_24K}, //Rtl8761AW
- {0x8761, HCI_VERSION_MASK_ALL, (1<<0xb), CHIP_TYPE_MASK_ALL, 1<<14, "rtl8761bt_fw", "rtl8761bt_config", CONFIG_MAC_OFFSET_GEN_4PLUS, MAX_PATCH_SIZE_40K}, //Rtl8761BW
+ {0x8761, HCI_VERSION_MASK_ALL, (1<<0xb), 1<<0, 1<<14, "rtl8761bt_fw", "rtl8761bt_config", CONFIG_MAC_OFFSET_GEN_4PLUS, MAX_PATCH_SIZE_40K}, //Rtl8761BW
+ {0x8761, HCI_VERSION_MASK_ALL, (1<<0xb), 1<<5, 1<<14, "rtl8725as_fw", "rtl8725as_config", CONFIG_MAC_OFFSET_GEN_4PLUS, MAX_PATCH_SIZE_40K}, //Rtl8725AS
{0x8723, HCI_VERSION_MASK_21, HCI_REVISION_MASK_ALL, CHIP_TYPE_MASK_ALL, 1<<4, "rtl8703as_fw", "rtl8703as_config", CONFIG_MAC_OFFSET_GEN_1_2, MAX_PATCH_SIZE_24K}, //Rtl8703AS
p = (uint8_t *) (p_buf + 1);
UINT16_TO_STREAM(p, HCI_VSC_READ_CHIP_TYPE);
*p++ = 5;
- UINT8_TO_STREAM(p, 0x00);
- UINT32_TO_STREAM(p, 0xB000A094);
+ if(hw_cfg_cb.lmp_subversion == 0x8761){
+ UINT8_TO_STREAM(p, 0x20);
+ UINT32_TO_STREAM(p, 0xB000A0A4);
+ }else{
+ UINT8_TO_STREAM(p, 0x00);
+ UINT32_TO_STREAM(p, 0xB000A094);
+ }
p_buf->len = HCI_CMD_PREAMBLE_SIZE + HCI_CMD_READ_CHIP_TYPE_SIZE;
pp = (uint8_t *) (p_buf + 1);
BTVNDDBG("READ_CHIP_TYPE event data[%d]= 0x%x", i, *(p+i));
if(status == 0)
{
- hw_cfg_cb.chip_type = ((*((uint8_t *)(p_evt_buf + 1) + HCI_EVT_CMD_CMPL_OPFC61_CHIPTYPE_OFFSET))&0x0F);
+ if(hw_cfg_cb.lmp_subversion == 0x8761)
+ hw_cfg_cb.chip_type = ((*((uint8_t *)(p_evt_buf + 1) + HCI_EVT_CMD_CMPL_OPFC61_8761_CHIPTYPE_OFFSET))&0x0F);
+ else
+ hw_cfg_cb.chip_type = ((*((uint8_t *)(p_evt_buf + 1) + HCI_EVT_CMD_CMPL_OPFC61_CHIPTYPE_OFFSET))&0x0F);
BTVNDDBG("READ_CHIP_TYPE hw_cfg_cb.lmp_subversion = 0x%x", hw_cfg_cb.lmp_subversion);
BTVNDDBG("READ_CHIP_TYPE hw_cfg_cb.hci_version = 0x%x", hw_cfg_cb.hci_version);
BTVNDDBG("READ_CHIP_TYPE hw_cfg_cb.hci_revision = 0x%x", hw_cfg_cb.hci_revision);
******************************************************************************/
#define LOG_TAG "bt_hwcfg_usb"
-#define RTKBT_RELEASE_NAME "20190520_BT_ANDROID_9.0"
+#define RTKBT_RELEASE_NAME "20191111_BT_ANDROID_9.0"
#include <utils/Log.h>
#include <sys/types.h>
{ 0x0BDA, 0x8A60, 0x8761, 0, 0, "mp_rtl8761a_fw", "rtl8761au8812ae_fw", "rtl8761a_config", NULL, 0 ,CONFIG_MAC_OFFSET_GEN_1_2, MAX_PATCH_SIZE_24K}, /* RTL8761AU + 8812AE */
{ 0x0BDA, 0x8771, 0x8761, 0, 0, "mp_rtl8761b_fw", "rtl8761b_fw", "rtl8761b_config", NULL, 0 ,CONFIG_MAC_OFFSET_GEN_4PLUS, MAX_PATCH_SIZE_40K}, /* RTL8761BU */
{ 0x0BDA, 0xa725, 0x8761, 0, 0, "mp_rtl8725a_fw", "rtl8725a_fw", "rtl8725a_config", NULL, 0 ,CONFIG_MAC_OFFSET_GEN_4PLUS, MAX_PATCH_SIZE_40K}, /* RTL8725AU */
+{ 0x0BDA, 0xa72A, 0x8761, 0, 0, "mp_rtl8725a_fw", "rtl8725a_fw", "rtl8725a_config", NULL, 0 ,CONFIG_MAC_OFFSET_GEN_4PLUS, MAX_PATCH_SIZE_40K}, /* RTL8725AU BT only */
{ 0x0BDA, 0x8821, 0x8821, 0, 0, "mp_rtl8821a_fw", "rtl8821a_fw", "rtl8821a_config", NULL, 0 ,CONFIG_MAC_OFFSET_GEN_1_2, MAX_PATCH_SIZE_24K}, /* RTL8821AE */
{ 0x0BDA, 0x0821, 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, 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 */
/* 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 */
+{ 0x0BDA, 0xD72A, 0x8723, 0, 0, "mp_rtl8723d_fw", "rtl8723d_fw", "rtl8723d_config", NULL, 0 ,CONFIG_MAC_OFFSET_GEN_3PLUS, MAX_PATCH_SIZE_40K}, /* RTL8723DU BT only */
{ 0x0BDA, 0xD720, 0x8723, 0, 0, "mp_rtl8723d_fw", "rtl8723d_fw", "rtl8723d_config", NULL, 0 ,CONFIG_MAC_OFFSET_GEN_3PLUS, MAX_PATCH_SIZE_40K}, /* RTL8723DE */
{ 0x0BDA, 0xB820, 0x8821, 0, 0, "mp_rtl8821c_fw", "rtl8821c_fw", "rtl8821c_config", NULL, 0 ,CONFIG_MAC_OFFSET_GEN_3PLUS, MAX_PATCH_SIZE_40K}, /* RTL8821CU */
{ 0x0BDA, 0xC820, 0x8821, 0, 0, "mp_rtl8821c_fw", "rtl8821c_fw", "rtl8821c_config", NULL, 0 ,CONFIG_MAC_OFFSET_GEN_3PLUS, MAX_PATCH_SIZE_40K}, /* RTL8821CU */
+{ 0x0BDA, 0xC82A, 0x8821, 0, 0, "mp_rtl8821c_fw", "rtl8821c_fw", "rtl8821c_config", NULL, 0 ,CONFIG_MAC_OFFSET_GEN_3PLUS, MAX_PATCH_SIZE_40K}, /* RTL8821CU BT only */
{ 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", "rtl8822b_fw", "rtl8822b_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", "rtl8822c_fw", "rtl8822c_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", "rtl8822c_fw", "rtl8822c_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", "rtl8822c_fw", "rtl8822c_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 }
};
******************************************************************************/
#define H5_TRACE_DATA_ENABLE 0//if you want to see data tx and rx, set H5_TRACE_DATA_ENABLE 1
#define H5_LOG_VERBOSE 0
-#define ENABLE_BLE_8703 1
unsigned int h5_log_enable = 1;
#define DATA_RETRANS_COUNT 40 //40*100 = 4000ms(4s)
#define BT_INIT_DATA_RETRANS_COUNT 200 //200*20 = 4000ms(4s)
-//#define SYNC_RETRANS_COUNT 14 //14*250 = 3500ms(3.5s)
#define SYNC_RETRANS_COUNT 350 //350*10 = 3500ms(3.5s)
-//#define CONF_RETRANS_COUNT 14
#define CONF_RETRANS_COUNT 350
#define DATA_RETRANS_TIMEOUT_VALUE 100 //ms
#define BT_INIT_DATA_RETRANS_TIMEOUT_VALUE 20 //ms
-//#define SYNC_RETRANS_TIMEOUT_VALUE 250
#define SYNC_RETRANS_TIMEOUT_VALUE 10
-
-//#define CONF_RETRANS_TIMEOUT_VALUE 250
#define CONF_RETRANS_TIMEOUT_VALUE 20
-//#define WAIT_CT_BAUDRATE_READY_TIMEOUT_VALUE 250
#define WAIT_CT_BAUDRATE_READY_TIMEOUT_VALUE 5
#define H5_HW_INIT_READY_TIMEOUT_VALUE 4000//4
/******************************************************************************
** Local type definitions
******************************************************************************/
-//
-//static const uint16_t msg_evt_table[] =
-//{
-// MSG_HC_TO_STACK_HCI_ERR, /* H4_TYPE_COMMAND */
-// MSG_HC_TO_STACK_HCI_ACL, /* H4_TYPE_ACL_DATA */
-// MSG_HC_TO_STACK_HCI_SCO, /* H4_TYPE_SCO_DATA */
-// MSG_HC_TO_STACK_HCI_EVT /* H4_TYPE_EVENT */
-//};
-
/* Callback function for the returned event of internal issued command */
typedef void (*tTIMER_HANDLE_CBACK)(union sigval sigval_value);
int nRxIndex; // ack index from board
int nNeedRetry; // if no response from board
};
-//static struct patch_struct rtk_patch;
/******************************************************************************
** Static function
static void rtkbt_h5_send_hw_error()
{
unsigned char p_buf[100];
- const char *str = "host stack: h5 send error";
+ const char *str = "host stack: h5 send error\n";
int length = strlen(str) + 1 + 4;
p_buf[0] = HCIT_TYPE_EVENT;//event
p_buf[1] = HCI_VSE_SUBCODE_DEBUG_INFO_SUB_EVT;//firmwre event log
p_buf[0] = HCIT_TYPE_EVENT;//event
p_buf[1] = HCI_HARDWARE_ERROR_EVT;//hardware error
p_buf[2] = 0x01;//len
- p_buf[3] = 0xfb;//h5 error code
+ p_buf[3] = H5_HWERR_CODE_RTK;//h5 error code
userial_recv_rawdata_hook(p_buf,length);
}
}
struct __una_u16 { uint16_t x; };
-/*static __inline uint16_t __get_unaligned_cpu16(const void *p)
-{
- const struct __una_u16 *ptr = (const struct __una_u16 *)p;
- return ptr->x;
-}*/
-
-/*
-static __inline uint16_t get_unaligned_be16(const void *p)
-{
- return __get_unaligned_cpu16((const uint8_t *)p);
-}*/
/**
* Get crc data.
*
rel = H5_UNRELIABLE_PKT;// unreliable
break;
default:
- ALOGE("Unknown packet type");
+ ALOGE("Unknown packet type");
return NULL;
}
}
-/**
-* Realtek send pure ack, send a packet only with an ack
-*
-* @param fd uart file descriptor
-*
-*/
-/*
-static void hci_h5_send_pure_ack(void)
-{
- //uint16_t bytes_sent = 0;
- sk_buff * skb = NULL;
- uint8_t ack_data = 0;
-
- skb = skb_alloc_and_init(H5_ACK_PKT, &ack_data, 0);
- if(!skb) {
- ALOGE("skb_alloc_and_init fail!");
- return;
- }
-
- H5LogMsg("H5: --->>>send pure ack");
- h5_enqueue(skb);
- h5_wake_up();
-
-#if 0
- sk_buff *nskb = h5_prepare_pkt(&rtk_h5, NULL, 0, H5_ACK_PKT);
- if(nskb == NULL)
- {
- ALOGE("h5_prepare_pkt allocate memory fail");
- return;
- }
- H5LogMsg("H5: --->>>send pure ack");
- uint8_t * data = skb_get_data(nskb);
-
-#if H5_TRACE_DATA_ENABLE
- {
- uint32_t iTemp = 0;
- uint32_t iTempTotal = 16;
-
- H5LogMsg("H5 TX: length(%d)", skb_get_data_length(nskb));
- if(iTempTotal > skb_get_data_length(nskb))
- {
- iTempTotal = skb_get_data_length(nskb);
- }
-
- for(iTemp = 0; iTemp < iTempTotal; iTemp++)
- {
- H5LogMsg("0x%x", data[iTemp]);
- }
- }
-#endif
-
- bytes_sent = h5_int_hal_callbacks->h5_int_transmit_data_cb(DATA_TYPE_H5, data, skb_get_data_length(nskb));
- H5LogMsg("bytes_sent(%d)", bytes_sent);
-
- skb_free(&nskb);
-#endif
- return;
-
-}*/
static void hci_h5_send_sync_req()
{
pthread_cond_signal(&rtk_h5.data_cond);
pthread_mutex_unlock(&rtk_h5.data_mutex);
}
-static uint8_t *acl_pack = NULL;
-static uint32_t acl_len=0;
-static uint8_t loopbackmode = 0x00;
-
-static timer_t loopacltimer=0;
-static void loop_acl_cb()
-{
- sk_buff *rx_skb;
- rx_skb = skb_alloc_and_init(HCI_ACLDATA_PKT, acl_pack, acl_len);
-
- pthread_mutex_lock(&rtk_h5.data_mutex);
- skb_queue_tail(rtk_h5.recv_data, rx_skb);
- pthread_cond_signal(&rtk_h5.data_cond);
- pthread_mutex_unlock(&rtk_h5.data_mutex);
-}
-static void loopacl_timer_handler()
-{
- loop_acl_cb();
-}
-static void start_loopacktimer()
-{
- if(loopacltimer == 0)
- loopacltimer = OsAllocateTimer(loopacl_timer_handler);
- OsStartTimer(loopacltimer, 10, 0);
-}
static sk_buff * h5_dequeue()
{
void h5_process_ctl_pkts(void)
{
//process h5 link establish
- //int len;
uint8_t cfg;
- //tHCI_H5_CB *p_cb = &rtk_h5;
sk_buff * skb = rtk_h5.rx_skb;
unsigned char h5sync[2] = {0x01, 0x7E},
*
* @param skb socket buffer
*
-*/
-extern uint16_t getLmp_subversion();
-extern uint8_t getchip_type();
-
-
-#if ENABLE_BLE_8703
-
-const uint8_t le_white_list_size_pack[7]={0x0e, 0x05, 0x02, 0x0f, 0x20, 0x00, 0x20};
-const uint8_t le_buf_size_pack[9]={0x0e, 0x07, 0x02, 0x02, 0x20, 0x00, 0x1b, 0x00, 0x10};
-const uint8_t le_support_state_pack[14]={0x0e,0x0c,0x02,0x1c,0x20,0x00,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00};
-const uint8_t le_local_support_pack[14]={0x0e,0x0c,0x02,0x03,0x20,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00};
-const uint8_t le_set_event_pack[6]={0x0e, 0x04, 0x02, 0x01, 0x20, 0x00};
-const uint8_t le_set_rand[14]={0x0e, 0x0c, 0x02, 0x18, 0x20, 0x00, 0x3c, 0x4d, 0x17, 0x9a, 0x9e, 0xa6, 0x0b, 0x4d};
-
-static void send_fake_le_pack(uint8_t *pack,uint32_t len){
- sk_buff *rx_skb;
- rx_skb = skb_alloc_and_init(HCI_EVENT_PKT, pack, len);
-
- pthread_mutex_lock(&rtk_h5.data_mutex);
- skb_queue_tail(rtk_h5.recv_data, rx_skb);
- pthread_cond_signal(&rtk_h5.data_cond);
- pthread_mutex_unlock(&rtk_h5.data_mutex);
-}
-
-
-static uint16_t encHandle = 0x0000;
-
-static void send_fake_enc_keysize(uint16_t handle,uint8_t keysize){
- sk_buff *rx_skb;
- uint8_t pack[9]={0x0e, 0x07, 0x01, 0x08, 0x14, 0x00, 0x03, 0x00, 0x10};
- pack[6]=(uint8_t)handle;pack[7]=(uint8_t)(handle>>8);
- pack[8] = keysize;
- rx_skb = skb_alloc_and_init(HCI_EVENT_PKT, pack, 9);
-
- pthread_mutex_lock(&rtk_h5.data_mutex);
- skb_queue_tail(rtk_h5.recv_data, rx_skb);
- pthread_cond_signal(&rtk_h5.data_cond);
- pthread_mutex_unlock(&rtk_h5.data_mutex);
-}
-
-
-#endif
+******************************************************************************/
static uint8_t hci_recv_frame(sk_buff *skb, uint8_t pkt_type)
{
uint8_t intercepted = 0;
- //uint32_t i = 0 ;
#if H5_TRACE_DATA_ENABLE
uint8_t *data = skb_get_data(skb);
#endif
event_code = *p++;
len = *p++;
H5LogMsg("hci_recv_frame event_code(0x%x), len = %d", event_code, len);
- if(event_code == HCI_COMMAND_STATUS_EVT && len==0x04
- && p[0]==0x01 && p[1]==0x02 && p[2]==0xff && p[3]==0x3b){
- *( p-2) = HCI_COMMAND_COMPLETE_EVT;
- p[0]=0x02;p[1]=0xff;p[2]=0x3b;p[3]=0x01;
- }// fix HciUnknownCommand test fail
-#if ENABLE_BLE_8703
- if(getLmp_subversion() == 0x8703 && getchip_type()==0x07)
- {
- if(event_code == HCI_COMMAND_COMPLETE_EVT
- && len==0x0c && p[0]==0x02 && p[1]==0x01 && p[2]==0x10){
- p[4]=0x05;
- p[7]=0x05;
- }
- if(event_code == HCI_COMMAND_COMPLETE_EVT
- && len==0x44 && p[0]==0x02 && p[1]==0x02 && p[2]==0x10){
- p[24]|=0x10;
- }
- if(event_code == HCI_COMMAND_COMPLETE_EVT && len==0x0e && p[0]==0x02 && p[1]==0x04 && p[2]==0x10 ){
- if(p[4]==0x00)
- p[10]|=0x40;
- if(p[4]==0x01)
- p[6]|=0x02;
- }
- if(event_code == HCI_COMMAND_COMPLETE_EVT && len==0x04 && p[1]==0x08 &&p[2]==0x14){
- skb_free(&skb);
- intercepted = 1;
- send_fake_enc_keysize(encHandle,0x10);
- }
- if(event_code == HCI_COMMAND_STATUS_EVT && len==0x04 && p[0]==0x01 && p[1]==0x02 && p[2]==0x0f &&p[3]==0x20){
- skb_free(&skb);
- intercepted = 1;
- send_fake_le_pack((uint8_t *)le_white_list_size_pack,7);
- }
- else if(event_code == HCI_COMMAND_STATUS_EVT && len==0x04 && p[0]==0x01 && p[1]==0x02 && p[2]==0x02 &&p[3]==0x20){
- skb_free(&skb);
- intercepted = 1;
- send_fake_le_pack((uint8_t *)le_buf_size_pack,9);
- }
- else if(event_code == HCI_COMMAND_STATUS_EVT && len==0x04 && p[0]==0x01 && p[1]==0x02 && p[2]==0x1c &&p[3]==0x20){
- skb_free(&skb);
- intercepted = 1;
- send_fake_le_pack((uint8_t *)le_support_state_pack,14);
- }
- else if(event_code == HCI_COMMAND_STATUS_EVT && len==0x04 && p[0]==0x01 && p[1]==0x02 && p[2]==0x03 &&p[3]==0x20){
- skb_free(&skb);
- intercepted = 1;
- send_fake_le_pack((uint8_t *)le_local_support_pack,14);
- }
- else if(event_code == HCI_COMMAND_STATUS_EVT && len==0x04 && p[0]==0x01 && p[1]==0x02 && p[2]==0x01 &&p[3]==0x20){
- skb_free(&skb);
- intercepted = 1;
- send_fake_le_pack((uint8_t *)le_set_event_pack,6);
- }
- else if(event_code == HCI_COMMAND_STATUS_EVT && len==0x04 && p[0]==0x01 && p[1]==0x02 && p[2]==0x18 &&p[3]==0x20){
- skb_free(&skb);
- intercepted = 1;
- send_fake_le_pack((uint8_t *)le_set_rand,14);
- }
-
- }
-#endif
-
- if(loopbackmode == 0x01){
- if(event_code == HCI_LOOPBACK_COMMAND_EVT
- && p[0]==0x19 && p[1]==0xfc){
- intercepted = 1;
- skb_free(&skb);
- }
- }//drop 0xfc19 frame when in loopbackmode,fix loopbackmode test fail
-
if (event_code == HCI_COMMAND_COMPLETE_EVT)
{
num_hci_cmd_pkts = *p++;
H5LogMsg("CommandCompleteEvent for command h5_start_wait_controller_baudrate_ready_timer (0x%04X)", opcode);
h5_start_wait_controller_baudrate_ready_timer();
}
- }else if(event_code == 0xff ){
- intercepted = 1;
- skb_free(&skb);
}
}
H5LogMsg("RX HCI RESET Command, stop hw init timer");
h5_stop_hw_init_ready_timer();
}
- if(opcode == HCI_WRITE_LOOPBACK_MODE)
- loopbackmode = 0x01;
- #if ENABLE_BLE_8703
- if(opcode == 0x1408)//enc key size
- encHandle = (uint16_t)data[1] + ((uint16_t)data[2] << 8);
-
- #endif
-
bytes_to_send = h5_wake_up();
return length;
}
*******************************************************************************/
uint16_t hci_h5_send_acl_data(serial_data_type_t type, uint8_t *data, uint16_t length)
{
- uint16_t bytes_to_send;//, lay_spec;
+ uint16_t bytes_to_send;
sk_buff * skb = NULL;
- if(loopbackmode == 1){
- acl_len = length;
- if(!acl_pack)
- acl_pack = malloc(2050);
- if(acl_len>2050)
- acl_len = 2050;
- memcpy(acl_pack,data,acl_len);
- start_loopacktimer();
- return length;
- }
skb = skb_alloc_and_init(type, data, length);
if(!skb) {
uint16_t hci_h5_send_sco_data(serial_data_type_t type, uint8_t *data, uint16_t length)
{
sk_buff * skb = NULL;
- uint16_t bytes_to_send;//, lay_spec;
+ uint16_t bytes_to_send;
skb = skb_alloc_and_init(type, data, length);
if(!skb) {
******************************************************************************/
#define LOG_TAG "bt_service"
-#define RTKBT_RELEASE_NAME "20190520_BT_ANDROID_9.0"
+#define RTKBT_RELEASE_NAME "20191111_BT_ANDROID_9.0"
#include <utils/Log.h>
#include <sys/types.h>
#define RTK_HCICMD 0x01
#define RTK_CLOSESOCRET 0x02
#define RTK_INNER 0x03
+#define RTK_STRING 0x04
#define OTHER 0xff
#define Rtk_Service_Data_SIZE 259
volatile uint8_t cmdqueue_thread_running;
volatile uint8_t epoll_thread_running;
void (*current_complete_cback)(void *);
+ uint16_t opcode;
}Rtk_Btservice_Info;
typedef struct Rtk_Service_Data
sigev.sigev_notify = SIGEV_THREAD;
//sigev.sigev_notify_thread_id = syscall(__NR_gettid);
sigev.sigev_notify_function = timer_callback;
- sigev.sigev_value.sival_ptr = &timerid;
+ sigev.sigev_value.sival_ptr = rtk_btservice;
ALOGD("OsAllocateTimer bt_service sigev.sigev_notify_thread_id = syscall(__NR_gettid)!");
//Create the Timer using timer_create signal
static int OsFreeTimer(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);
{
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);
if (mode == 1)
-
{
itval.it_interval.tv_sec = itval.it_value.tv_sec;
itval.it_interval.tv_nsec = itval.it_value.tv_nsec;
pthread_mutex_unlock(&rtk_info->cmdqueue_mutex);
}
-static void hcicmd_reply_timeout_handler()//(union sigval sigev_value)
+static void hcicmd_reply_timeout_handler(union sigval sigev_value)
{
- Rtk_Service_Send_Hwerror_Event();
- //return;
+ Rtk_Btservice_Info* btservice;
+ btservice = (Rtk_Btservice_Info*)sigev_value.sival_ptr;
+ ALOGE("%s: opcode 0x%x", __func__, btservice->opcode);
+ if(rtk_btservice->opcode == 0)
+ Rtk_Service_Send_Hwerror_Event();
}
-static int hcicmd_alloc_reply_timer()
- {
+static bool hcicmd_alloc_reply_timer()
+{
// Create and set the timer when to expire
rtk_btservice->timer_hcicmd_reply = OsAllocateTimer(hcicmd_reply_timeout_handler);
- return 0;
+ if(rtk_btservice->timer_hcicmd_reply == (timer_t)-1) {
+ ALOGE("%s : alloc reply timer fail!", __func__);
+ return false;
+ }
+ return true;
- }
+}
static int hcicmd_free_reply_timer()
{
- return OsFreeTimer(rtk_btservice->timer_hcicmd_reply);
+ if(rtk_btservice->timer_hcicmd_reply != (timer_t)-1)
+ return OsFreeTimer(rtk_btservice->timer_hcicmd_reply);
+
+ rtk_btservice->timer_hcicmd_reply = (timer_t)-1;
+ return 0;
}
{
HC_BT_HDR *p_evt_buf = (HC_BT_HDR *) p_mem;
unsigned char *sendbuf = NULL;
- int len;
+ ssize_t ret = -1;
if(p_evt_buf != NULL)
{
- len = 8 + p_evt_buf->len;
- sendbuf = p_mem;
+ sendbuf = (uint8_t *)(p_evt_buf + 1) + p_evt_buf->offset;
if(rtk_btservice->current_client_sock != -1)
{
- write(rtk_btservice->current_client_sock,sendbuf,len);
+ if(p_evt_buf->event != HCIT_TYPE_EVENT)
+ return;
+ uint8_t type = HCIT_TYPE_EVENT;
+ RTK_NO_INTR(ret = send(rtk_btservice->current_client_sock,&type, 1, MSG_NOSIGNAL));
+ if(ret < 0) {
+ ALOGE("%s send type errno: %s", __func__, strerror(errno));
+ return;
+ }
+
+ RTK_NO_INTR(ret = send(rtk_btservice->current_client_sock,sendbuf,p_evt_buf->len, MSG_NOSIGNAL));
+ if(ret < 0)
+ ALOGE("%s errno: %s", __func__, strerror(errno));
}
else
{
void Rtk_Service_Vendorcmd_Hook(Rtk_Service_Data *RtkData, int client_sock)
{
Rtkqueuedata* rtkqueue_data = NULL;
- if(!rtk_btservice) {
- ALOGE("rtkbt service is null");
+ pthread_mutex_lock(&rtk_btservice->cmdqueue_mutex);
+ if(!rtk_btservice || (rtk_btservice->cmdqueue_thread_running == 0)){
+ ALOGE("rtkbt service is null or cmdqueue stop");
+ pthread_mutex_unlock(&rtk_btservice->cmdqueue_mutex);
return;
}
- pthread_mutex_lock(&rtk_btservice->cmdqueue_mutex);
rtkqueue_data = (Rtkqueuedata *)malloc(sizeof(Rtkqueuedata));
if (NULL == rtkqueue_data)
{
if(RtkData->parameter_len > 0) {
free(RtkData->parameter);
}
+ pthread_mutex_unlock(&rtk_btservice->cmdqueue_mutex);
return;
}
rtkqueue_data->complete_cback = RtkData->complete_cback;
ListAddToTail(&(rtkqueue_data->list), &(rtk_btservice->cmdqueue_list));
- sem_post(&rtk_btservice->cmdqueue_sem);
pthread_mutex_unlock(&rtk_btservice->cmdqueue_mutex);
+ sem_post(&rtk_btservice->cmdqueue_sem);
}
static void Rtk_Service_Cmd_Event_Cback(void *p_mem)
{
- //int i;
- //unsigned char *a=p_mem;
- //ALOGE("%s p_mem = %x,%x,%x,%x,%x,%x!", __func__,a[0],a[1],a[2],a[3],a[4],a[5]);
if(p_mem != NULL)
{
if(rtk_btservice->current_complete_cback != NULL)
ALOGE("%s current_complete_cback is not exist!", __func__);
}
rtk_btservice->current_complete_cback = NULL;
+ rtk_btservice->opcode = 0;
hcicmd_stop_reply_timer();
sem_post(&rtk_btservice->cmdsend_sem);
}
static void Rtk_Service_Send_Hwerror_Event()
{
- unsigned char p_buf[4];
- int length = 4;
- p_buf[0] = 0x04;//event
- p_buf[1] = 0x10;//hardware error
+ unsigned char p_buf[100];
+ int length;
+ p_buf[0] = HCIT_TYPE_EVENT;//event
+ p_buf[1] = HCI_VSE_SUBCODE_DEBUG_INFO_SUB_EVT;//firmwre event log
+ p_buf[3] = 0x01;// host log opcode
+ length = sprintf((char *)&p_buf[4], "rtk service error\n");
+ p_buf[2] = length + 2;//len
+ length = length + 1 + 4;
+ userial_recv_rawdata_hook(p_buf,length);
+
+ length = 4;
+ p_buf[0] = HCIT_TYPE_EVENT;//event
+ p_buf[1] = HCI_HARDWARE_ERROR_EVT;//hardware error
p_buf[2] = 0x01;//len
- p_buf[3] = 0xfd;//rtkbtservice error code
+ p_buf[3] = RTKSERVICE_HWERR_CODE_RTK;//rtkbtservice error code
userial_recv_rawdata_hook(p_buf,length);
}
pthread_mutex_unlock(&rtk_btservice->cmdqueue_mutex);
if(desc) {
- if(desc->opcode == 0xfc77)
+ if(desc->opcode == HCI_CMD_VNDR_AUTOPAIR)
{
rtk_btservice->autopair_fd = desc->client_sock;
}
- if(desc->opcode != 0xfc94)
+ if(desc->opcode != HCI_CMD_VNDR_HEARTBEAT)
ALOGD("%s, transmit_command Opcode:%x",__func__, desc->opcode);
rtk_btservice->current_client_sock = desc->client_sock;
rtk_btservice->current_complete_cback = desc->complete_cback;
- //bt_vendor_cbacks->xmit_cb(desc->opcode, p_buf, 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();
if(desc->parameter_len > 0)
pthread_exit(0);
}
+static void parseString(int client_sock, char *msg)
+{
+ ALOGD("%s msg = %s", __func__, msg);
+ if(!strcmp(msg, "Service Name")) {
+ char buffer[7] = {'R', 'e', 'a', 'l', 't', 'e', 'k'};
+ write(client_sock, buffer, 7);
+ }
+}
static void Getpacket(int client_sock)
{
ALOGD("%s recvlen=%d,type=%d",__func__,recvlen, type);
if(recvlen <= 0)
{
+ if(epoll_ctl(rtk_btservice->epoll_fd, EPOLL_CTL_DEL, client_sock, NULL) == -1)
+ {
+ ALOGE("%s unable to register fd %d to epoll set: %s", __func__, client_sock, strerror(errno));
+ }
close(client_sock);
if(client_sock == rtk_btservice->autopair_fd)
{
{
case RTK_HCICMD:
{
- recvlen = read(client_sock,&opcodeh,1);
+ recvlen = read(client_sock,&opcodel,1);
if(recvlen <= 0)
{
- ALOGE("read opcode high char error");
+ ALOGE("read opcode low char error");
break;
}
- recvlen = read(client_sock,&opcodel,1);
+ recvlen = read(client_sock,&opcodeh,1);
if(recvlen <= 0)
{
- ALOGE("read opcode low char error");
+ ALOGE("read opcode high char error");
break;
}
recvlen = read(client_sock,¶meter_length,1);
free(p_buf);
break;
}
+
case RTK_CLOSESOCRET:
{
close(client_sock);
//pthread_exit(0);
break;
}
+
+ case RTK_INNER:
+ {
+
+ break;
+ }
+
+ case RTK_STRING:
+ {
+ recvlen = read(client_sock, ¶meter_length, 1);
+ if(recvlen <= 0)
+ {
+ ALOGE("read data error");
+ break;
+ }
+ char* message = (char* )malloc(parameter_length + 1);
+ recvlen = read(client_sock, message, parameter_length);
+ if(recvlen != parameter_length) {
+ ALOGE("%s, read length is not equal to parameter_length", __func__);
+ free(message);
+ break;
+ }
+ message[parameter_length] = '\0';
+ parseString(client_sock , message);
+ free(message);
+ break;
+ }
default:
{
ALOGE("%s The RtkSockData type is not found!", __func__);
}
-static int socket_accept(socketfd)
+static int rtk_socket_accept(socketfd)
{
struct sockaddr_un un;
socklen_t len;
len = sizeof(un);
struct epoll_event event;
- client_sock=accept(socketfd, (struct sockaddr *)&un, &len);
+ client_sock = accept(socketfd, (struct sockaddr *)&un, &len);
if(client_sock<0)
{
- printf("accept failed\n");
+ ALOGE("accept failed\n");
return -1;
}
//pthread_create(&connectthread,NULL,(void *)accept_request_thread,&client_sock);
+ ALOGD("%s client socket fd: %d", __func__, client_sock);
event.data.fd = client_sock;
event.events = EPOLLIN | EPOLLHUP | EPOLLRDHUP | EPOLLERR;
//list_add(client_sock);
if(events[i].data.fd == rtk_btservice->socketfd && events[i].events & EPOLLIN)
{
- if(socket_accept(events[i].data.fd) < 0)
+ if(rtk_socket_accept(events[i].data.fd) < 0)
{
pthread_exit(0);
}
}
- else if(events[i].events & (EPOLLIN | EPOLLHUP | EPOLLRDHUP | EPOLLERR))
+ else if(events[i].events & EPOLLRDHUP) {
+ if(epoll_ctl(rtk_btservice->epoll_fd, EPOLL_CTL_DEL, events[i].data.fd, NULL) == -1)
+ {
+ ALOGE("%s unable to register fd %d to epoll set: %s", __func__, events[i].data.fd, strerror(errno));
+ }
+ close(events[i].data.fd);
+ }
+ else if(events[i].events & (EPOLLIN | EPOLLHUP | EPOLLERR))
{
- ALOGD("%s events[i].data.fd = %d ", __func__, events[i].data.fd);
Getpacket(events[i].data.fd);
}
}
if ((rtk_btservice->socketfd = socket(AF_UNIX, SOCK_STREAM, 0)) < 0)
{
ALOGE("%s create AF_UNIX socket fail!", __func__);
+ rtk_btservice->socketfd = -1;
return -1;
}
if (bind(rtk_btservice->socketfd, (struct sockaddr *)&un, len) < 0)
{
ALOGE("%s bind socket fail!", __func__);
- return -1;
+ goto fail;
}
if (listen(rtk_btservice->socketfd, MAX_CONNECTION_NUMBER) < 0)
{
ALOGE("%s listen socket fail!", __func__);
- return -1;
+ goto fail;
}
/*
if(chmod(RTKBTSERVICE_SOCKETPATH,0666) != 0)
if(epoll_ctl(rtk_btservice->epoll_fd, EPOLL_CTL_ADD, rtk_btservice->socketfd,&event) == -1)
{
ALOGE("%s unable to register fd %d to epoll set: %s", __func__, rtk_btservice->socketfd, strerror(errno));
- return -1;
+ goto fail;
}
event.data.fd = rtk_btservice->sig_fd[1];
if(epoll_ctl(rtk_btservice->epoll_fd, EPOLL_CTL_ADD, rtk_btservice->sig_fd[1], &event) == -1)
{
ALOGE("%s unable to register signal fd %d to epoll set: %s", __func__, rtk_btservice->sig_fd[1], strerror(errno));
- return -1;
+ goto fail;
}
return 0;
+
+fail:
+ close(rtk_btservice->socketfd);
+ rtk_btservice->socketfd = -1;
+ return -1;
}
void RTK_btservice_send_close_signal(void)
void RTK_btservice_thread_stop()
{
+ pthread_mutex_lock(&rtk_btservice->cmdqueue_mutex);
rtk_btservice->epoll_thread_running=0;
rtk_btservice->cmdqueue_thread_running=0;
+ hcicmd_stop_reply_timer();
+ pthread_mutex_unlock(&rtk_btservice->cmdqueue_mutex);
RTK_btservice_send_close_signal();
sem_post(&rtk_btservice->cmdqueue_sem);
sem_post(&rtk_btservice->cmdsend_sem);
{
int ret;
rtk_btservice = (Rtk_Btservice_Info *)malloc(sizeof(Rtk_Btservice_Info));
- if(rtk_btservice)
+ if(rtk_btservice) {
memset(rtk_btservice, 0, sizeof(Rtk_Btservice_Info));
+ }
else {
ALOGE("%s, alloc fail", __func__);
return -1;
rtk_btservice->current_client_sock = -1;
rtk_btservice->current_complete_cback = NULL;
rtk_btservice->autopair_fd = -1;
- hcicmd_alloc_reply_timer();
+ if(!hcicmd_alloc_reply_timer()) {
+ ALOGE("%s alloc timer fail!", __func__);
+ ret = -1;
+ goto fail2;
+ }
sem_init(&rtk_btservice->cmdqueue_sem, 0, 0);
sem_init(&rtk_btservice->cmdsend_sem, 0, 1);
if(bt_vendor_cbacks == NULL)
{
ALOGE("%s bt_vendor_cbacks is NULL!", __func__);
- return -1;
+ ret = -2;
+ goto fail1;
}
if((ret = socketpair(AF_UNIX, SOCK_STREAM, 0, rtk_btservice->sig_fd)) < 0) {
ALOGE("%s, errno : %s", __func__, strerror(errno));
- return ret;
+ goto fail1;
}
rtk_btservice->epoll_fd = epoll_create(64);
if (rtk_btservice->epoll_fd == -1) {
ALOGE("%s unable to create epoll instance: %s", __func__, strerror(errno));
- return -1;
+ ret = -3;
+ close(rtk_btservice->sig_fd[0]);
+ close(rtk_btservice->sig_fd[1]);
+ goto fail1;
}
if(unix_socket_start(RTKBTSERVICE_SOCKETPATH) < 0)
{
ALOGE("%s unix_socket_start fail!", __func__);
- return -1;
+ ret = -4;
+ close(rtk_btservice->epoll_fd);
+ close(rtk_btservice->sig_fd[0]);
+ close(rtk_btservice->sig_fd[1]);
+ goto fail1;
}
ret = RTK_btservice_thread_start();
if(ret < 0)
{
ALOGE("%s RTK_btservice_thread_start fail!", __func__);
- return -1;
+ goto fail0;
}
ALOGD("%s init done!", __func__);
+
return 0;
+
+fail0:
+ close(rtk_btservice->epoll_fd);
+ close(rtk_btservice->sig_fd[0]);
+ close(rtk_btservice->sig_fd[1]);
+ close(rtk_btservice->socketfd);
+ rtk_btservice->socketfd = -1;
+fail1:
+ sem_destroy(&rtk_btservice->cmdqueue_sem);
+ sem_destroy(&rtk_btservice->cmdsend_sem);
+ flush_cmdqueue_hash(rtk_btservice);
+ hcicmd_free_reply_timer();
+ pthread_mutex_destroy(&rtk_btservice->cmdqueue_mutex);
+
+fail2:
+ free(rtk_btservice);
+ rtk_btservice = NULL;
+ return ret;
}
void RTK_btservice_destroyed()
char last_log_path[PATH_MAX];
uint64_t timestamp;
uint32_t usec;
- uint8_t sec,hour, minus,day;
if (hci_btsnoop_fd != -1) {
ALOGE("%s btsnoop log file is already open.", __func__);
}
if(rtk_btsnoop_save_log) {
+ time_t current_time = time(NULL);
+ struct tm* time_created = localtime(¤t_time);
+ char config_time_created[sizeof("YYYY-MM-DD-HH:MM:SS")];
+ strftime(config_time_created, sizeof("YYYY-MM-DD-HH:MM:SS"), "%Y-%m-%d-%H:%M:%S",
+ time_created);
timestamp = rtk_btsnoop_timestamp() - BTSNOOP_EPOCH_DELTA;
usec = (uint32_t)(timestamp % 1000000LL);
- timestamp /= 1000000LL;
- sec = (uint8_t)(timestamp % 60LL);
- timestamp /= 60LL;
- minus = (uint8_t)(timestamp % 60LL);
- timestamp /= 60LL;
- hour = (uint8_t)(timestamp % 24LL);
- timestamp /= 24LL;
- day = (uint8_t)(timestamp % 30LL);
- timestamp /= 30LL;
- //snprintf(last_log_path, PATH_MAX, "%s.%llu", rtk_btsnoop_path, rtk_btsnoop_timestamp());
- snprintf(last_log_path, PATH_MAX, "%s.%uY-%dD-%dH-%dM-%dS-%dUS", rtk_btsnoop_path,
- (uint32_t)timestamp, day, hour, minus, sec, usec);
+ snprintf(last_log_path, PATH_MAX, "%s.%s:%dUS", rtk_btsnoop_path, config_time_created, usec);
if (!rename(rtk_btsnoop_path, last_log_path) && errno != ENOENT)
ALOGE("%s unable to rename '%s' to '%s': %s", __func__, rtk_btsnoop_path, last_log_path, strerror(errno));
}
*
******************************************************************************/
#define LOG_TAG "rtk_heartbeat"
-#define RTKBT_RELEASE_NAME "20190520_BT_ANDROID_9.0"
+#define RTKBT_RELEASE_NAME "20191111_BT_ANDROID_9.0"
#include <utils/Log.h>
#include <sys/types.h>
void (*complete_cback)(void *);
}Rtk_Service_Data;
-#define HCI_CMD_VNDR_HEARTBEAT 0xFC94
-
extern void Rtk_Service_Vendorcmd_Hook(Rtk_Service_Data *RtkData, int client_sock);
extern uint8_t get_heartbeat_from_hardware();
p_buf[0] = HCIT_TYPE_EVENT;//event
p_buf[1] = HCI_VSE_SUBCODE_DEBUG_INFO_SUB_EVT;//firmwre event log
p_buf[3] = 0x01;// host log opcode
- length = sprintf((char *)&p_buf[4], "host stack: heartbeat hw error: %d:%d:%d:%d",
+ length = sprintf((char *)&p_buf[4], "host stack: heartbeat hw error: %d:%d:%d:%d \n",
status, seqnum, next_seqnum, heartbeatCnt);
p_buf[2] = length + 2;//len
length = length + 1 + 4;
p_buf[0] = HCIT_TYPE_EVENT;//event
p_buf[1] = HCI_HARDWARE_ERROR_EVT;//hardware error
p_buf[2] = 0x01;//len
- p_buf[3] = 0xfc;//heartbeat error code
+ p_buf[3] = HEARTBEAT_HWERR_CODE_RTK;//heartbeat error code
userial_recv_rawdata_hook(p_buf,length);
}
*
******************************************************************************/
#define LOG_TAG "rtk_parse"
-#define RTKBT_RELEASE_NAME "20190520_BT_ANDROID_9.0"
+#define RTKBT_RELEASE_NAME "20191111_BT_ANDROID_9.0"
#include <utils/Log.h>
#include <stdlib.h>
bt_vendor_cbacks->dealloc(p_mem);
if(desc) {
- ALOGE("%s, transmit_command Opcode:%x",__func__, desc->opcode);
- rtk_prof.current_cback = desc->p_cback;
- bt_vendor_cbacks->xmit_cb(desc->opcode, desc->p_buf, rtk_cmd_complete_cback);
+ pthread_mutex_lock(&rtk_prof.coex_mutex);
+ if(rtk_prof.bt_on) {
+ ALOGE("%s, transmit_command Opcode:%x",__func__, desc->opcode);
+ rtk_prof.current_cback = desc->p_cback;
+ bt_vendor_cbacks->xmit_cb(desc->opcode, desc->p_buf, rtk_cmd_complete_cback);
+ }
+ pthread_mutex_unlock(&rtk_prof.coex_mutex);
}
free(desc);
if(bt_vendor_cbacks)
{
pthread_mutex_lock(&rtk_prof.coex_mutex);
+ if(!rtk_prof.bt_on) {
+ pthread_mutex_unlock(&rtk_prof.coex_mutex);
+ return;
+ }
if(!coex_cmd_send) {
coex_cmd_send = true;
RtkLogMsg("begin transmit_command Opcode:%x",opcode);
void rtk_set_bt_on(uint8_t bt_on) {
RtkLogMsg("bt stack is init");
+ pthread_mutex_lock(&rtk_prof.coex_mutex);
rtk_prof.bt_on = bt_on;
+ pthread_mutex_unlock(&rtk_prof.coex_mutex);
+ if(!bt_on)
+ return;
uint8_t ttmp[1] = {1};
rtk_vendor_cmd_to_fw(0xfc1b, 1, ttmp, NULL);
}
extern int timer_delete(timer_t timerid);
int timer_settime(timer_t timerid, int flags,
- const struct itimerspec *new_value,
- struct itimerspec * old_value);
+ const struct itimerspec *new_value,
+ struct itimerspec * old_value);
/******************************************************************************
** Static variables
******************************************************************************/
#ifdef CONFIG_SCO_OVER_HCI
#include "sbc.h"
+#ifdef CONFIG_SCO_MSBC_PLC
+#include "sbcplc.h"
+unsigned char indices0[] = {0xad, 0x0, 0x0, 0xc5, 0x0, 0x0, 0x0, 0x0, 0x77, 0x6d,
+ 0xb6, 0xdd, 0xdb, 0x6d, 0xb7, 0x76, 0xdb, 0x6d, 0xdd, 0xb6, 0xdb, 0x77, 0x6d,
+ 0xb6, 0xdd, 0xdb, 0x6d, 0xb7, 0x76, 0xdb, 0x6d, 0xdd, 0xb6, 0xdb, 0x77, 0x6d,
+ 0xb6, 0xdd, 0xdb, 0x6d, 0xb7, 0x76, 0xdb, 0x6d, 0xdd, 0xb6, 0xdb, 0x77, 0x6d,
+ 0xb6, 0xdd, 0xdb, 0x6d, 0xb7, 0x76, 0xdb, 0x6c, 0x00}; //padding at the end
+#endif
#endif
/******************************************************************************
** Constants & Macros
extern char rtkbt_transtype;
extern void Heartbeat_cleanup();
extern void Heartbeat_init();
+extern int RTK_btservice_init();
/******************************************************************************
** Local type definitions
int ctrl_fd, data_fd;
sbc_t sbc_dec, sbc_enc;
uint32_t pcm_enc_seq;
+ int8_t pcm_dec_seq;
+ uint32_t pcm_dec_frame;
int signal_fd[2];
}sco_cb_t;
#endif
/*****************************************************************************
** Userial Vendor API Functions
*****************************************************************************/
+static void userial_send_hw_error()
+{
+ unsigned char p_buf[100];
+ int length;
+ p_buf[0] = HCIT_TYPE_EVENT;//event
+ p_buf[1] = HCI_VSE_SUBCODE_DEBUG_INFO_SUB_EVT;//firmwre event log
+ p_buf[3] = 0x01;// host log opcode
+ length = sprintf((char *)&p_buf[4], "host stack: userial error \n");
+ p_buf[2] = length + 2;//len
+ length = length + 1 + 4;
+ userial_recv_rawdata_hook(p_buf,length);
+
+ length = 4;
+ p_buf[0] = HCIT_TYPE_EVENT;//event
+ p_buf[1] = HCI_HARDWARE_ERROR_EVT;//hardware error
+ p_buf[2] = 0x01;//len
+ p_buf[3] = USERIAL_HWERR_CODE_RTK;//userial error code
+ userial_recv_rawdata_hook(p_buf,length);
+}
/*******************************************************************************
**
int res = 0;
size_t writen = 0;
prctl(PR_SET_NAME, (unsigned long)"userial_recv_sco_thread", 0, 0, 0);
+ sco_cb.pcm_dec_seq = -1;
+ sco_cb.pcm_dec_frame = 0;
+#ifdef CONFIG_SCO_MSBC_PLC
+ unsigned char plc_data[480];
+ struct PLC_State plc_state;
+ InitPLC(&plc_state);
+#endif
/*
FILE *file;
unsigned char enc_data[60];
}
}
*/
- res = sbc_decode(&sco_cb.sbc_dec, (p_data+2), 58, dec_data, 240, &writen);
+ uint8_t seq = (p_data[1] >> 4) & 0x0F;
+ uint32_t last_dec_frame = sco_cb.pcm_dec_frame;
+ if(sco_cb.pcm_dec_seq == -1) {
+ uint8_t step = 0;
+ sco_cb.pcm_dec_seq = (int8_t)seq;
+ step += (seq & 0x03)/2;
+ step += ((seq >> 2) & 0x03) / 2;
+ sco_cb.pcm_dec_frame += step;
+ }
+ else {
+ do{
+ sco_cb.pcm_dec_seq = (uint8_t)((btui_msbc_h2[(++sco_cb.pcm_dec_frame) % 4] >> 12) & 0x0F);
+ }while(sco_cb.pcm_dec_seq != seq);
+
+ if((last_dec_frame + 1) != sco_cb.pcm_dec_frame) {
+ ALOGE("lost frame: %d, may use the plc function", (sco_cb.pcm_dec_frame - last_dec_frame));
+#ifdef CONFIG_SCO_MSBC_PLC
+ uint8_t lost_frame = sco_cb.pcm_dec_frame - last_dec_frame - 1;
+ int i = 0;
+ for(i = 0; i < lost_frame; i++) {
+ sbc_decode(&sco_cb.sbc_dec, indices0, 58, dec_data, 240, &writen);
+ PLC_bad_frame(&plc_state, (short*)dec_data, (short*)plc_data);
+ memcpy(&pcm_data[240 * index], plc_data, 240);
+ index = (index + 1) % 4;
+ if(index == 0) {
+ Skt_Send_noblock(sco_cb.data_fd, pcm_data, 960);
+ }
+ }
+#endif
+ }
+ }
+
+ res = sbc_decode(&sco_cb.sbc_dec, (p_data + 2), 58, dec_data, 240, &writen);
if(res > 0) {
+#ifdef CONFIG_SCO_MSBC_PLC
+ PLC_good_frame(&plc_state, (short*)dec_data, (short*)plc_data);
+ memcpy(&pcm_data[240 * index], plc_data, 240);
+#else
memcpy(&pcm_data[240 * index], dec_data, 240);
+#endif
//if (fwrite(dec_data, 240, 1, file2) != 240) {
//ALOGE("Error capturing sample");
//}
}
}
else {
- ALOGE("msbc decode fail!");
+ ALOGE("msbc decode fail! May use PLC function");
+#ifdef CONFIG_SCO_MSBC_PLC
+ sbc_decode(&sco_cb.sbc_dec, indices0, 58, dec_data, 240, &writen);
+ PLC_bad_frame(&plc_state, (short*)dec_data, (short*)plc_data);
+ memcpy(&pcm_data[240 * index], plc_data, 240);
+ index = (index + 1) % 4;
+ if(index == 0) {
+ Skt_Send_noblock(sco_cb.data_fd, pcm_data, 960);
+ }
+#endif
+
}
}
RtbFree(skb_sco_data);
if(rtkbt_version.hci_version > HCI_PROTO_VERSION_4_2) {
break;
}
- if(recv_buffer[2] == 0x01) {
+ if(recv_buffer[3] == 0x01) {
rtkbt_adv_con.adverting_start = TRUE;
}
- else if(recv_buffer[2] == 0x00) {
+ else if(recv_buffer[3] == 0x00) {
rtkbt_adv_con.adverting_type = 0;
rtkbt_adv_con.adverting_enable = FALSE;
rtkbt_adv_con.adverting_start = FALSE;
RTK_BUFFER* skb_sco_data;
int i;
sco_handle = *((uint16_t *)p_data);
+ uint8_t packet_flag = (uint8_t)((sco_handle >> 12) & 0x0003);
+ sco_handle &= 0x0FFF;
uint16_t current_pos = sco_cb.current_pos;
uint16_t sco_packet_len = sco_cb.sco_packet_len;
sco_length = p_data[SCO_PREAMBLE_SIZE - 1];
p_data += SCO_PREAMBLE_SIZE;
+ if(packet_flag != 0x00)
+ ALOGE("sco data receive wrong packet_flag : %d", packet_flag);
if(current_pos) {
if((sco_packet_len - current_pos) <= sco_length) {
memcpy(&sco_cb.enc_data[current_pos], p_data, (sco_packet_len - current_pos));
ALOGE("%s poll error, fd : %d", __func__, vnd_userial.fd);
vnd_userial.btdriver_state = false;
close(vnd_userial.fd);
+ userial_send_hw_error();
return NULL;
}
if (ret < 0)
}
}
+ RTK_btservice_init();
ret = vnd_userial.uart_fd[0];
return ret;
}
return vnd_userial.fd;
}
+void userial_set_bt_interface_state(int bt_on)
+{
+ if(rtk_parse_manager) {
+ rtk_parse_manager->rtk_set_bt_on(bt_on);
+ }
+}
+
+
+/******************************************************************************
+ *
+ * Copyright (C) 2009-2018 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.
+ *
+ ******************************************************************************/
#include <stdio.h>
#include <getopt.h>
#include <string.h>
typedef struct Rtk_Socket_Data
{
unsigned char type; //hci,other,inner
- unsigned char opcodeh;
unsigned char opcodel;
+ unsigned char opcodeh;
unsigned char parameter_len;
unsigned char parameter[0];
}Rtk_Socket_Data;
int Rtkbt_Getevent(int sock_fd)
{
- unsigned short event=0;
- unsigned short event_len=0;
- unsigned short offset=0;
- unsigned short layer_specific=0;
+ unsigned char type = 0;
+ unsigned char event = 0;
+ unsigned char len = 0;
unsigned char *recvbuf = NULL;
+ unsigned char tot_len = 0;
int ret=0;
int i;
- ret = read(sock_fd,&event,2);
+ ret = read(sock_fd, &type, 1);
if(ret<=0)
return -1;
//printf("event = %x\n",event);
- ret = read(sock_fd,&event_len,2);
+ ret = read(sock_fd, &event, 1);
if(ret<=0)
return -1;
//printf("event_len = %x\n",event_len);
- ret = read(sock_fd,&offset,2);
+ ret = read(sock_fd, &len, 1);
if(ret<=0)
return -1;
//printf("offset = %x\n",offset);
- ret = read(sock_fd,&layer_specific,2);
- if(ret<=0)
- return -1;
+ tot_len = len + 2;
//printf("layer_specific = %x\n",layer_specific);
- recvbuf=(unsigned char *)malloc(sizeof(char)*event_len);
- ret = read(sock_fd,recvbuf,event_len);
- if(ret < event_len)
+ recvbuf=(unsigned char *)malloc(sizeof(char)*tot_len);
+ recvbuf[0] = event;
+ recvbuf[1] = len;
+ ret = read(sock_fd,recvbuf+2,len);
+ if(ret < len)
return -1;
printf("Event: ");
- for(i=0;i<event_len-1;i++)
+ for(i=0;i<tot_len-1;i++)
printf("0x%02x ",recvbuf[i]);
- printf("0x%02x\n",recvbuf[event_len-1]);
+ printf("0x%02x\n",recvbuf[tot_len-1]);
free(recvbuf);
return 0;
-# RELEASE NAME: 20180702_BT_ANDROID_9.0
+# RELEASE NAME: 20191111_BT_ANDROID_9.0
# RTKBT_API_VERSION=2.1.1.0
CUR_PATH := hardware/realtek/rtkbt
BOARD_HAVE_BLUETOOTH := true
BOARD_HAVE_BLUETOOTH_RTK := true
-BOARD_HAVE_BLUETOOTH_RTK_COEX := true
-
-ifneq ($(filter atv box, $(strip $(TARGET_BOARD_PLATFORM_PRODUCT))), )
-BOARD_BLUETOOTH_BDROID_BUILDCFG_INCLUDE_DIR := $(CUR_PATH)/bluetooth
-endif
-ifneq ($(filter rk3328, $(strip $(TARGET_BOARD_PLATFORM))), )
-PRODUCT_COPY_FILES += \
- $(CUR_PATH)/vendor/etc/bluetooth/rtkbt_S0.conf:vendor/etc/bluetooth/rtkbt.conf
+BOARD_HAVE_BLUETOOTH_RTK_TV := false
+ifeq ($(BOARD_HAVE_BLUETOOTH_RTK_TV), true)
+#Firmware For Tv
+include $(CUR_PATH)/Firmware/TV/TV_Firmware.mk
else
-PRODUCT_COPY_FILES += \
- $(CUR_PATH)/vendor/etc/bluetooth/rtkbt.conf:vendor/etc/bluetooth/rtkbt.conf
-
+#Firmware For Tablet
+include $(CUR_PATH)/Firmware/BT/BT_Firmware.mk
endif
-ifeq ($(strip $(TARGET_BOARD_PLATFORM_PRODUCT)), tablet)
-BT_FIRMWARE_FILES := $(shell ls $(CUR_PATH)/vendor/firmware)
+BOARD_BLUETOOTH_BDROID_BUILDCFG_INCLUDE_DIR := $(CUR_PATH)/bluetooth
+
PRODUCT_COPY_FILES += \
- $(foreach file, $(BT_FIRMWARE_FILES), $(CUR_PATH)/vendor/firmware/$(file):$(TARGET_COPY_OUT_VENDOR)/etc/firmware/$(file))
-else
-BT_FIRMWARE_FILES := $(shell ls $(CUR_PATH)/vendor/firmware_box)
+ $(CUR_PATH)/vendor/etc/bluetooth/rtkbt.conf:vendor/etc/bluetooth/rtkbt.conf \
+ $(CUR_PATH)/system/etc/permissions/android.hardware.bluetooth_le.xml:system/etc/permissions/android.hardware.bluetooth_le.xml \
+ $(CUR_PATH)/system/etc/permissions/android.hardware.bluetooth.xml:system/etc/permissions/android.hardware.bluetooth.xml \
+
+ifeq ($(BOARD_HAVE_BLUETOOTH_RTK_TV), true)
PRODUCT_COPY_FILES += \
- $(foreach file, $(BT_FIRMWARE_FILES), $(CUR_PATH)/vendor/firmware_box/$(file):$(TARGET_COPY_OUT_VENDOR)/etc/firmware/$(file))
+ $(CUR_PATH)/vendor/usr/keylayout/Vendor_005d_Product_0001.kl:vendor/usr/keylayout/Vendor_005d_Product_0001.kl \
+ $(CUR_PATH)/vendor/usr/keylayout/Vendor_005d_Product_0002.kl:vendor/usr/keylayout/Vendor_005d_Product_0002.kl
endif
+# base bluetooth
PRODUCT_PACKAGES += \
- libbt-vendor-realtek
-
-PRODUCT_PROPERTY_OVERRIDES += \
- persist.bluetooth.btsnoopenable=false \
- persist.bluetooth.btsnooppath=/sdcard/btsnoop_hci.cfa \
- persist.bluetooth.btsnoopsize=0xffff \
- persist.bluetooth.rtkcoex=true \
- bluetooth.enable_timeout_ms=11000
+ Bluetooth \
+ libbt-vendor-realtek \
+ rtkcmd \
+ audio.a2dp.default \
+ bluetooth.default \
+ android.hardware.bluetooth@1.0-impl \
+ android.hidl.memory@1.0-impl \
+ android.hardware.bluetooth@1.0-service \
+ android.hardware.bluetooth@1.0-service.rc \
+PRODUCT_PROPERTY_OVERRIDES += \
+ persist.vendor.bluetooth.rtkcoex=true \
+ persist.vendor.rtkbt.bdaddr_path=none \
+ persist.vendor.bluetooth.prefferedrole=master \
+ persist.vendor.rtkbtadvdisable=false
+
+PRODUCT_SYSTEM_DEFAULT_PROPERTIES += persist.bluetooth.btsnoopenable=false \
+ persist.bluetooth.btsnooppath=/data/misc/bluedroid/btsnoop_hci.cfa \
+ persist.bluetooth.btsnoopsize=0xffff \
+ persist.bluetooth.showdeviceswithoutnames=false \
+ vendor.bluetooth.enable_timeout_ms=11000
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2013 The Android Open Source Project
+
+ 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.
+-->
+<!-- Adds the feature indicating support for the Bluetooth Low Energy API -->
+<permissions>
+ <feature name="android.hardware.bluetooth" />
+</permissions>
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2013 The Android Open Source Project
+
+ 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.
+-->
+<!-- Adds the feature indicating support for the Bluetooth Low Energy API -->
+<permissions>
+ <feature name="android.hardware.bluetooth_le" />
+</permissions>
-# RELEASE NAME: 20180702_BT_ANDROID_9.0
+# RELEASE NAME: 20191111_BT_ANDROID_9.0
# Bluetooth Device Name; NULL or comment means "ro.product.model"
#Name=Realtek Bluetooth
DevClassMinorClass=0x1C
#Indicate USB or UART driver bluetooth
-#BtDeviceNode=/dev/rtk_btusb
BtDeviceNode=?/dev/ttyS1:H5
# Enable BtSnoop logging function
+++ /dev/null
-# RELEASE NAME: 20180702_BT_ANDROID_9.0
-# Bluetooth Device Name; NULL or comment means "ro.product.model"
-#Name=Realtek Bluetooth
-
-# Device Class
-DevClassServiceClass=0x1A
-DevClassMajorClass=0x01
-DevClassMinorClass=0x1C
-
-#Indicate USB or UART driver bluetooth
-#BtDeviceNode=/dev/rtk_btusb
-BtDeviceNode=?/dev/ttyS0:H5
-
-# Enable BtSnoop logging function
-# valid value : true, false
-RtkBtsnoopDump=false
-
-# BtSnoop log output file
-BtSnoopFileName=/data/misc/bluedroid/btsnoop_hci.cfa
-
-# Preserve existing BtSnoop log before overwriting
-BtSnoopSaveLog=true
-
-#bit0 = 1,don't show heartbeat packet in btsnoop
-RtkbtLogFilter=1
-
-# configuration for uart card to save HCI log for slave
-H5LogOutput=0
-
-# Enable Coex log
-BtCoexLogOutput=0
-
-# Enable net btsnoop Dump
-RtkBtsnoopNetDump=false
-
-
-# Enable auto restart bt
-RtkBtAutoRestart=true
+++ /dev/null
-PRODUCT_COPY_FILES += \
- $(LOCAL_PATH)/Firmware/BT/rtl8703as_config:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8703as_config \
- $(LOCAL_PATH)/Firmware/BT/rtl8703as_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8703as_fw \
- $(LOCAL_PATH)/Firmware/BT/rtl8703bs_config:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8703bs_config \
- $(LOCAL_PATH)/Firmware/BT/rtl8703bs_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8703bs_fw \
- $(LOCAL_PATH)/Firmware/BT/rtl8703cs_config:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8703cs_config \
- $(LOCAL_PATH)/Firmware/BT/rtl8703cs_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8703cs_fw \
- $(LOCAL_PATH)/Firmware/BT/rtl8723a_config:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8723a_config \
- $(LOCAL_PATH)/Firmware/BT/rtl8723a_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8723a_fw \
- $(LOCAL_PATH)/Firmware/BT/rtl8723as_config:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8723as_config \
- $(LOCAL_PATH)/Firmware/BT/rtl8723as_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8723as_fw \
- $(LOCAL_PATH)/Firmware/BT/rtl8723b_config:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8723b_config \
- $(LOCAL_PATH)/Firmware/BT/rtl8723b_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8723b_fw \
- $(LOCAL_PATH)/Firmware/BT/rtl8723bs_config:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8723bs_config \
- $(LOCAL_PATH)/Firmware/BT/rtl8723bs_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8723bs_fw \
- $(LOCAL_PATH)/Firmware/BT/rtl8723bs_VQ0_config:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8723bs_VQ0_config \
- $(LOCAL_PATH)/Firmware/BT/rtl8723bs_VQ0_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8723bs_VQ0_fw \
- $(LOCAL_PATH)/Firmware/BT/rtl8723bu_config:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8723bu_config \
- $(LOCAL_PATH)/Firmware/BT/rtl8723c_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8723c_fw \
- $(LOCAL_PATH)/Firmware/BT/rtl8723cs_cg_config:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8723cs_cg_config \
- $(LOCAL_PATH)/Firmware/BT/rtl8723cs_cg_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8723cs_cg_fw \
- $(LOCAL_PATH)/Firmware/BT/rtl8723cs_vf_config:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8723cs_vf_config \
- $(LOCAL_PATH)/Firmware/BT/rtl8723cs_vf_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8723cs_vf_fw \
- $(LOCAL_PATH)/Firmware/BT/rtl8723cs_xx_config:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8723cs_xx_config \
- $(LOCAL_PATH)/Firmware/BT/rtl8723cs_xx_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8723cs_xx_fw \
- $(LOCAL_PATH)/Firmware/BT/rtl8723d_config:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8723d_config \
- $(LOCAL_PATH)/Firmware/BT/rtl8723d_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8723d_fw \
- $(LOCAL_PATH)/Firmware/BT/rtl8723ds_config:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8723ds_config \
- $(LOCAL_PATH)/Firmware/BT/rtl8723ds_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8723ds_fw \
- $(LOCAL_PATH)/Firmware/BT/rtl8761a_config:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8761a_config \
- $(LOCAL_PATH)/Firmware/BT/rtl8761at_config:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8761at_config \
- $(LOCAL_PATH)/Firmware/BT/rtl8761at_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8761at_fw \
- $(LOCAL_PATH)/Firmware/BT/rtl8761au8192ee_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8761au8192ee_fw \
- $(LOCAL_PATH)/Firmware/BT/rtl8761au8812ae_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8761au8812ae_fw \
- $(LOCAL_PATH)/Firmware/BT/rtl8761au_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8761au_fw \
- $(LOCAL_PATH)/Firmware/BT/rtl8761aw8192eu_config:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8761aw8192eu_config \
- $(LOCAL_PATH)/Firmware/BT/rtl8761aw8192eu_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8761aw8192eu_fw \
- $(LOCAL_PATH)/Firmware/BT/rtl8821a_config:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8821a_config \
- $(LOCAL_PATH)/Firmware/BT/rtl8821a_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8821a_fw \
- $(LOCAL_PATH)/Firmware/BT/rtl8821as_config:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8821as_config \
- $(LOCAL_PATH)/Firmware/BT/rtl8821as_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8821as_fw \
- $(LOCAL_PATH)/Firmware/BT/rtl8821c_config:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8821c_config \
- $(LOCAL_PATH)/Firmware/BT/rtl8821c_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8821c_fw \
- $(LOCAL_PATH)/Firmware/BT/rtl8821cs_config:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8821cs_config \
- $(LOCAL_PATH)/Firmware/BT/rtl8821cs_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8821cs_fw \
- $(LOCAL_PATH)/Firmware/BT/rtl8822b_config:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8822b_config \
- $(LOCAL_PATH)/Firmware/BT/rtl8822b_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8822b_fw \
- $(LOCAL_PATH)/Firmware/BT/rtl8822bs_config:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8822bs_config \
- $(LOCAL_PATH)/Firmware/BT/rtl8822bs_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8822bs_fw \
- $(LOCAL_PATH)/Firmware/BT/rtl8822c_config:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8822c_config \
- $(LOCAL_PATH)/Firmware/BT/rtl8822c_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8822c_fw \
- $(LOCAL_PATH)/Firmware/BT/rtl8822cs_config:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8822cs_config \
- $(LOCAL_PATH)/Firmware/BT/rtl8822cs_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8822cs_fw \
- $(LOCAL_PATH)/Firmware/BT/rtl8761b_config:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8761b_config \
- $(LOCAL_PATH)/Firmware/BT/rtl8761b_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8761b_fw \
- $(LOCAL_PATH)/Firmware/BT/rtl8761bt_config:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8761bt_config \
- $(LOCAL_PATH)/Firmware/BT/rtl8761bt_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8761bt_fw \
- $(LOCAL_PATH)/Firmware/BT/rtl8725a_config:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8725a_config \
- $(LOCAL_PATH)/Firmware/BT/rtl8725a_fw:$(TARGET_COPY_OUT_VENDOR)/firmware/rtl8725a_fw \
-
-
+++ /dev/null
- FW CUT SVN Coex
-rtl8761au8192ee_fw D 20411 0007
-rtl8761au_fw D 20411 0007
-rtl8723c_fw B 16592 0700
-rtl8703cs_fw C 17903 0a0a
-rtl8761aw8192eu_fw D 20411 0007
-rtl8761at8812ae_fw D 19653 0006
-rtl8723ds_fw C 21291 2d2d
-rtl8761bt_fw B 21430 0909
-rtl8703bs_fw B 20010 1c00
-rtl8822b_fw C 21253 6c6c
-rtl8821cs_fw B 21209 3939
-rtl8761at_fw D 20411 0007
-rtl8822c_fw D 21479 0a0a
-rtl8761b_fw B 21475 0a0a
-rtl8761au8812ae_fw D 19653 0006
-rtl8821as_fw B 19132 635d
-rtl8821a_fw B 19132 635d
-rtl8723bs_fw B 19897 6d50
-rtl8725a_fw B 21430 0909
-rtl8723b_fw B 19897 6d50
-rtl8723cs_vf_fw B 15854 5844
-rtl8703as_fw B 12234 473d
-rtl8822cs_fw D 21479 0a0a
-rtl8723cs_xx_fw B 19927 1c00
-rtl8821c_fw B 21209 3939
-rtl8822bs_fw C 21253 6c6c
-rtl8723d_fw C 21291 2d2d
-rtl8723cs_cg_fw B 15854 5844
-rtl8761at8192ee_fw D 20411 0007
-rtl8723bs_VQ0_fw B 16527 6549
+++ /dev/null
-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 \
-
+++ /dev/null
- FW CUT SVN Coex
-rtl8761au8192ee_fw D 13328 3736
-rtl8761a_fw D 13328 3736
-rtl8761au_fw D 20340 0007
-rtl8761aw8192eu_fw D 20340 0007
-rtl8723ds_fw C 20318 2323
-rtl8822b_fw C 20294 5a5a
-rtl8821cs_fw B 19894 1d1d
-rtl8761at_fw D 20340 0007
-rtl8761au8812ae_fw D 19648 0006
-rtl8821as_fw B 19884 635d
-rtl8821a_fw B 19884 635d
-rtl8723bs_fw B 19897 6d50
-rtl8723b_fw B 19897 6d50
-rtl8821c_fw B 19894 1d1d
-rtl8822bs_fw C 20294 5a5a
-rtl8723d_fw C 20318 2323
-rtl8761at8192er_fw D 20340 0007
-rtl8723bs_VQ0_fw B 14422 5844
--- /dev/null
+# Copyright (C) 2010 The Android Open Source Project
+#
+# 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.
+
+#
+# Generic key layout file for full alphabetic US English PC style external keyboards.
+#
+# This file is intentionally very generic and is intended to support a broad rang of keyboards.
+# 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 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 HOME
+key 62 INFO
+key 63 F5
+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
--- /dev/null
+# Copyright (C) 2010 The Android Open Source Project
+#
+# 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.
+
+#
+# Generic key layout file for full alphabetic US English PC style external keyboards.
+#
+# This file is intentionally very generic and is intended to support a broad rang of keyboards.
+# 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 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 HOME
+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