diff options
author | Mattias Agren <magren@broadcom.com> | 2012-04-25 12:12:11 +0200 |
---|---|---|
committer | Matthew Xie <mattx@google.com> | 2012-07-14 11:19:18 -0700 |
commit | bc5b4b2e7c7d923a861039d3ca5d9a7492a5f328 (patch) | |
tree | f09e3cc18cc5c7e128d47a8cd034e81c14bc9154 /stack | |
parent | 8100af272c43a887d28663dd64c02c97e9da4a74 (diff) | |
download | external_bluetooth_bluedroid-bc5b4b2e7c7d923a861039d3ca5d9a7492a5f328.zip external_bluetooth_bluedroid-bc5b4b2e7c7d923a861039d3ca5d9a7492a5f328.tar.gz external_bluetooth_bluedroid-bc5b4b2e7c7d923a861039d3ca5d9a7492a5f328.tar.bz2 |
Enabled acl link priority control to ensure robust a2dp streaming
during inquiry scanning etc
Change-Id: Iadcd9242dac707a6db857bc9f2ab89e59499764b
Diffstat (limited to 'stack')
-rw-r--r-- | stack/include/hcidefs.h | 6 | ||||
-rwxr-xr-x[-rw-r--r--] | stack/l2cap/l2c_utils.c | 16 |
2 files changed, 13 insertions, 9 deletions
diff --git a/stack/include/hcidefs.h b/stack/include/hcidefs.h index f70f100..c2ee429 100644 --- a/stack/include/hcidefs.h +++ b/stack/include/hcidefs.h @@ -996,6 +996,12 @@ typedef struct #define HCIT_LM_DIAG_LENGTH 63 +/* Parameter information for HCI_BRCM_SET_ACL_PRIORITY */ +#define HCI_BRCM_ACL_PRIORITY_PARAM_SIZE 3 +#define HCI_BRCM_ACL_PRIORITY_LOW 0x00 +#define HCI_BRCM_ACL_PRIORITY_HIGH 0xFF +#define HCI_BRCM_SET_ACL_PRIORITY (0x0057 | HCI_GRP_VENDOR_SPECIFIC) + /* Define values for LMP Test Control parameters ** Test Scenario, Hopping Mode, Power Control Mode */ diff --git a/stack/l2cap/l2c_utils.c b/stack/l2cap/l2c_utils.c index 0c1fb60..80d092e 100644..100755 --- a/stack/l2cap/l2c_utils.c +++ b/stack/l2cap/l2c_utils.c @@ -2336,14 +2336,15 @@ BOOLEAN l2cu_lcb_disconnecting (void) ** Returns TRUE if a valid channel, else FALSE ** *******************************************************************************/ + BOOLEAN l2cu_set_acl_priority (BD_ADDR bd_addr, UINT8 priority, BOOLEAN reset_after_rs) { tL2C_LCB *p_lcb; -#ifdef BRCM_VS UINT8 *pp; UINT8 command[HCI_BRCM_ACL_PRIORITY_PARAM_SIZE]; UINT8 vs_param; -#endif + + APPL_TRACE_EVENT1("SET ACL PRIORITY %d", priority); /* Find the link control block for the acl channel */ if ((p_lcb = l2cu_find_lcb_by_bd_addr(bd_addr)) == NULL) @@ -2352,23 +2353,21 @@ BOOLEAN l2cu_set_acl_priority (BD_ADDR bd_addr, UINT8 priority, BOOLEAN reset_af return (FALSE); } -#ifdef BRCM_VS if (BTM_IS_BRCM_CONTROLLER()) { /* Called from above L2CAP through API; send VSC if changed */ if ((!reset_after_rs && (priority != p_lcb->acl_priority)) || - /* Called because of a master/slave role switch; if high resend VSC */ ( reset_after_rs && p_lcb->acl_priority == L2CAP_PRIORITY_HIGH)) { pp = command; - vs_param = (priority == L2CAP_PRIORITY_HIGH) ? HCI_BRCM_ACL_PRIORITY_HIGH : HCI_BRCM_ACL_PRIORITY_LOW; + vs_param = (priority == L2CAP_PRIORITY_HIGH) ? HCI_BRCM_ACL_PRIORITY_HIGH : HCI_BRCM_ACL_PRIORITY_LOW; - UINT16_TO_STREAM (pp, p_lcb->handle); - UINT8_TO_STREAM (pp, vs_param); + UINT16_TO_STREAM (pp, p_lcb->handle); + UINT8_TO_STREAM (pp, vs_param); - BTM_VendorSpecificCommand (HCI_BRCM_SET_ACL_PRIORITY, HCI_BRCM_ACL_PRIORITY_PARAM_SIZE, command, NULL); + BTM_VendorSpecificCommand (HCI_BRCM_SET_ACL_PRIORITY, HCI_BRCM_ACL_PRIORITY_PARAM_SIZE, command, NULL); /* Adjust lmp buffer allocation for this channel if priority changed */ if (p_lcb->acl_priority != priority) @@ -2378,7 +2377,6 @@ BOOLEAN l2cu_set_acl_priority (BD_ADDR bd_addr, UINT8 priority, BOOLEAN reset_af } } } -#endif return(TRUE); } |