From 2489007e7d740ccbc3e0a202914e243ad5178787 Mon Sep 17 00:00:00 2001 From: codeworkx Date: Sat, 22 Sep 2012 09:48:20 +0200 Subject: merge opensource jb u5 Change-Id: I1aaec157aa196f3448eff8636134fce89a814cf2 --- net/bluetooth/l2cap_core.c | 32 ++++++++++++++++++++++++++++++++ net/bluetooth/sco.c | 5 +++++ 2 files changed, 37 insertions(+) (limited to 'net/bluetooth') diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c index 50f95cf..b044c38 100644 --- a/net/bluetooth/l2cap_core.c +++ b/net/bluetooth/l2cap_core.c @@ -56,6 +56,24 @@ #include #include +/* BEGIN SLP_Bluetooth :: fix av chopping issue. */ +#ifdef CONFIG_SLP +#define HCI_BROADCOMM_QOS_PATCH +#endif + +#ifdef HCI_BROADCOMM_QOS_PATCH +#define L2CAP_PSM_AVDTP 25 +#define HCI_BROADCOM_QOS_CMD 0xFC57 /* For bcm4329/bcm4330 chipset */ +#define PRIORITY_NORMAL 0x00 /* Broadcom ACL priority for bcm4330 chipset */ +#define PRIORITY_HIGH 0x01 + +struct hci_cp_broadcom_cmd { + __le16 handle; + __u8 priority; /* Only for bcm4330 chipset */ +} __attribute__ ((__packed__)); +#endif +/* END SLP_Bluetooth */ + int disable_ertm; static u32 l2cap_feat_mask = L2CAP_FEAT_FIXED_CHAN; @@ -2552,6 +2570,20 @@ static inline int l2cap_connect_rsp(struct l2cap_conn *conn, struct l2cap_cmd_hd if (test_and_set_bit(CONF_REQ_SENT, &chan->conf_state)) break; +/* BEGIN SLP_Bluetooth :: fix av chopping issue. */ +#ifdef HCI_BROADCOMM_QOS_PATCH + /* To gurantee the A2DP packet*/ + if (chan->psm == L2CAP_PSM_AVDTP) { + struct hci_cp_broadcom_cmd cp; + cp.handle = cpu_to_le16(conn->hcon->handle); + cp.priority = PRIORITY_HIGH; + + hci_send_cmd(conn->hcon->hdev, HCI_BROADCOM_QOS_CMD, + sizeof(cp), &cp); + } +#endif +/* END SLP_Bluetooth */ + l2cap_send_cmd(conn, l2cap_get_ident(conn), L2CAP_CONF_REQ, l2cap_build_conf_req(chan, req), req); chan->num_conf_req++; diff --git a/net/bluetooth/sco.c b/net/bluetooth/sco.c index d3d48b5..db9b289 100644 --- a/net/bluetooth/sco.c +++ b/net/bluetooth/sco.c @@ -890,6 +890,11 @@ static void sco_conn_ready(struct sco_conn *conn) bacpy(&bt_sk(sk)->src, conn->src); bacpy(&bt_sk(sk)->dst, conn->dst); + if (!conn->hcon) { + BT_ERR("conn->hcon = NULL"); + /* to do */ + } + hci_conn_hold(conn->hcon); __sco_chan_add(conn, sk, parent); -- cgit v1.1