diff options
author | DoHyun Pyun <dh79.pyun@samsung.com> | 2016-10-21 09:10:04 +0900 |
---|---|---|
committer | Seung-Woo Kim <sw0312.kim@samsung.com> | 2016-12-14 13:53:29 +0900 |
commit | 71e3eb2264f0dd8c4acbe7bee07903b6cccf8e3f (patch) | |
tree | b435f2cf1313ae4df6b06da86f35d369d53830c1 | |
parent | c5262bfa09c8285e17c73b8cc532efc49a76ef1f (diff) | |
download | linux-exynos-71e3eb2264f0dd8c4acbe7bee07903b6cccf8e3f.tar.gz linux-exynos-71e3eb2264f0dd8c4acbe7bee07903b6cccf8e3f.tar.bz2 linux-exynos-71e3eb2264f0dd8c4acbe7bee07903b6cccf8e3f.zip |
Bluetooth: Don't send the sco vendor commands to other vendor chips
There are BCM sco WBC/NBC commands, and they are only for BCM chips.
So this patch fix not to send the sco commands to non BCM vendor
chips which causes sco command timeout and disconnection.
Change-Id: Iae67b6e6de2ecf68b79e47136c2b80aa530a281c
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
-rw-r--r-- | net/bluetooth/sco.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/net/bluetooth/sco.c b/net/bluetooth/sco.c index b20345885c82..f8ec5b42946a 100644 --- a/net/bluetooth/sco.c +++ b/net/bluetooth/sco.c @@ -1118,6 +1118,9 @@ void sco_connect_set_gw_nbc(struct hci_dev *hdev) hci_send_cmd(hdev, HCI_OP_WRITE_VOICE_SETTING, sizeof(cp1), &cp1); hdev->voice_setting = cpu_to_le16(0x0060); + if (hdev->manufacturer != 0x000F) + return; + cp2.role = 0x00; /* WbDisable */ cp2.pkt_type = cpu_to_le16(0x0002); hci_send_cmd(hdev, HCI_BCM_ENABLE_WBS_REQ, sizeof(cp2), &cp2); @@ -1148,6 +1151,9 @@ void sco_connect_set_gw_wbc(struct hci_dev *hdev) hci_send_cmd(hdev, HCI_OP_WRITE_VOICE_SETTING, sizeof(cp1), &cp1); hdev->voice_setting = cpu_to_le16(0x0003 | 0x0060); + if (hdev->manufacturer != 0x000F) + return; + cp2.role = 0x01; /* Enable */ cp2.pkt_type = cpu_to_le16(0x0002); hci_send_cmd(hdev, HCI_BCM_ENABLE_WBS_REQ, sizeof(cp2), &cp2); @@ -1179,6 +1185,9 @@ void sco_connect_set_nbc(struct hci_dev *hdev) hci_send_cmd(hdev, HCI_OP_WRITE_VOICE_SETTING, sizeof(cp1), &cp1); hdev->voice_setting = cpu_to_le16(0x0060); + if (hdev->manufacturer != 0x000F) + return; + cp2.role = 0x00; /* WbDisable */ cp2.pkt_type = cpu_to_le16(0x0002); hci_send_cmd(hdev, HCI_BCM_ENABLE_WBS_REQ, sizeof(cp2), &cp2); @@ -1209,6 +1218,9 @@ void sco_connect_set_wbc(struct hci_dev *hdev) hci_send_cmd(hdev, HCI_OP_WRITE_VOICE_SETTING, sizeof(cp1), &cp1); hdev->voice_setting = cpu_to_le16(0x0003 | 0x0060); + if (hdev->manufacturer != 0x000F) + return; + cp2.role = 0x01; /* Enable */ cp2.pkt_type = cpu_to_le16(0x0002); hci_send_cmd(hdev, HCI_BCM_ENABLE_WBS_REQ, sizeof(cp2), &cp2); @@ -1260,6 +1272,9 @@ int sco_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr, __u8 *flags) read_unlock(&sco_sk_list.lock); #ifdef TIZEN_BT + if (hdev->manufacturer != 0x000F) + return lm; + /* WBC/NBC feature */ if ((lm & HCI_LM_ACCEPT) && !hci_conn_hash_lookup_sco(hdev)) { struct hci_conn *hcon_acl; @@ -1308,7 +1323,8 @@ static void sco_connect_cfm(struct hci_conn *hcon, __u8 status) #ifdef TIZEN_BT /* Link policy */ - hci_write_acl_link_policy(hcon, HCI_LP_RSWITCH); + if (hcon->hdev->manufacturer == 0x000F) + hci_write_acl_link_policy(hcon, HCI_LP_RSWITCH); #endif } else sco_conn_del(hcon, bt_to_errno(status)); @@ -1323,7 +1339,8 @@ static void sco_disconn_cfm(struct hci_conn *hcon, __u8 reason) #ifdef TIZEN_BT /* Link policy */ - hci_write_acl_link_policy(hcon, HCI_LP_SNIFF | HCI_LP_RSWITCH); + if (hcon->hdev->manufacturer == 0x000F) + hci_write_acl_link_policy(hcon, HCI_LP_SNIFF | HCI_LP_RSWITCH); #endif sco_conn_del(hcon, bt_to_errno(reason)); |