Loading system/stack/include/hcidefs.h +9 −0 Original line number Diff line number Diff line Loading @@ -916,6 +916,9 @@ typedef struct { // TODO Remove this once all UNISOC specific hacks are removed. #define LMP_COMPID_UNISOC 0x073F // TODO Remove this once all Mediatek specific hacks are removed. #define LMP_COMPID_MEDIATEK 0x0046 /* Parameter information for HCI_SYNA_SET_ACL_PRIORITY */ #define HCI_SYNA_ACL_PRIORITY_PARAM_SIZE 3 #define HCI_SYNA_ACL_NORMAL_PRIORITY 0xF0 Loading @@ -929,6 +932,12 @@ typedef struct { #define HCI_UNISOC_ACL_NORMAL_PRIORITY 0x00 #define HCI_UNISOC_ACL_HIGH_PRIORITY 0xFF /* Parameter information for HCI_MTK_SET_ACL_PRIORITY */ #define HCI_MTK_ACL_PRIORITY_PARAM_SIZE 1 #define HCI_MTK_SET_ACL_PRIORITY (0xFD95 | HCI_GRP_VENDOR_SPECIFIC) #define HCI_MTK_ACL_NORMAL_PRIORITY 0x00 #define HCI_MTK_ACL_HIGH_PRIORITY 0x01 /* * Define packet size */ Loading system/stack/l2cap/l2c_utils.cc +32 −0 Original line number Diff line number Diff line Loading @@ -2335,6 +2335,34 @@ static void l2cu_set_acl_priority_unisoc(tL2C_LCB* p_lcb, HCI_UNISOC_ACL_PRIORITY_PARAM_SIZE, command, NULL); } /******************************************************************************* * * Function l2cu_set_acl_priority_latency_mtk * * Description Sends a VSC to set the ACL priority and recorded latency on * Mediatek chip. * * Returns void * ******************************************************************************/ static void l2cu_set_acl_priority_latency_mtk(tL2C_LCB* p_lcb, tL2CAP_PRIORITY priority) { uint8_t vs_param; if (priority == L2CAP_PRIORITY_HIGH) { // priority to high, if using latency mode check preset latency LOG_INFO("Set ACL priority: High Priority Mode"); vs_param = HCI_MTK_ACL_HIGH_PRIORITY; } else { // priority to normal LOG_INFO("Set ACL priority: Normal Mode"); vs_param = HCI_MTK_ACL_NORMAL_PRIORITY; } BTM_VendorSpecificCommand(HCI_MTK_SET_ACL_PRIORITY, HCI_MTK_ACL_PRIORITY_PARAM_SIZE, &vs_param, NULL); } /******************************************************************************* * * Function l2cu_set_acl_priority Loading Loading @@ -2379,6 +2407,10 @@ bool l2cu_set_acl_priority(const RawAddress& bd_addr, tL2CAP_PRIORITY priority, l2cu_set_acl_priority_unisoc(p_lcb, priority); break; case LMP_COMPID_MEDIATEK: l2cu_set_acl_priority_latency_mtk(p_lcb, priority); break; default: /* Not supported/required for other vendors */ break; Loading Loading
system/stack/include/hcidefs.h +9 −0 Original line number Diff line number Diff line Loading @@ -916,6 +916,9 @@ typedef struct { // TODO Remove this once all UNISOC specific hacks are removed. #define LMP_COMPID_UNISOC 0x073F // TODO Remove this once all Mediatek specific hacks are removed. #define LMP_COMPID_MEDIATEK 0x0046 /* Parameter information for HCI_SYNA_SET_ACL_PRIORITY */ #define HCI_SYNA_ACL_PRIORITY_PARAM_SIZE 3 #define HCI_SYNA_ACL_NORMAL_PRIORITY 0xF0 Loading @@ -929,6 +932,12 @@ typedef struct { #define HCI_UNISOC_ACL_NORMAL_PRIORITY 0x00 #define HCI_UNISOC_ACL_HIGH_PRIORITY 0xFF /* Parameter information for HCI_MTK_SET_ACL_PRIORITY */ #define HCI_MTK_ACL_PRIORITY_PARAM_SIZE 1 #define HCI_MTK_SET_ACL_PRIORITY (0xFD95 | HCI_GRP_VENDOR_SPECIFIC) #define HCI_MTK_ACL_NORMAL_PRIORITY 0x00 #define HCI_MTK_ACL_HIGH_PRIORITY 0x01 /* * Define packet size */ Loading
system/stack/l2cap/l2c_utils.cc +32 −0 Original line number Diff line number Diff line Loading @@ -2335,6 +2335,34 @@ static void l2cu_set_acl_priority_unisoc(tL2C_LCB* p_lcb, HCI_UNISOC_ACL_PRIORITY_PARAM_SIZE, command, NULL); } /******************************************************************************* * * Function l2cu_set_acl_priority_latency_mtk * * Description Sends a VSC to set the ACL priority and recorded latency on * Mediatek chip. * * Returns void * ******************************************************************************/ static void l2cu_set_acl_priority_latency_mtk(tL2C_LCB* p_lcb, tL2CAP_PRIORITY priority) { uint8_t vs_param; if (priority == L2CAP_PRIORITY_HIGH) { // priority to high, if using latency mode check preset latency LOG_INFO("Set ACL priority: High Priority Mode"); vs_param = HCI_MTK_ACL_HIGH_PRIORITY; } else { // priority to normal LOG_INFO("Set ACL priority: Normal Mode"); vs_param = HCI_MTK_ACL_NORMAL_PRIORITY; } BTM_VendorSpecificCommand(HCI_MTK_SET_ACL_PRIORITY, HCI_MTK_ACL_PRIORITY_PARAM_SIZE, &vs_param, NULL); } /******************************************************************************* * * Function l2cu_set_acl_priority Loading Loading @@ -2379,6 +2407,10 @@ bool l2cu_set_acl_priority(const RawAddress& bd_addr, tL2CAP_PRIORITY priority, l2cu_set_acl_priority_unisoc(p_lcb, priority); break; case LMP_COMPID_MEDIATEK: l2cu_set_acl_priority_latency_mtk(p_lcb, priority); break; default: /* Not supported/required for other vendors */ break; Loading