commit 548f5eda9bcb199eccb02e722f374e87bd6c71a4 Author: Brian Rogers Date: Sat Mar 1 17:29:41 2008 -0800 Revert "[Bluetooth] Add support for handling simple eSCO links" This reverts commit b6a0dc822497e1c0b9e8c4add270cc27fce48454. Conflicts: net/bluetooth/hci_core.c diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h index 65a8e6b..0771100 100644 --- a/include/net/bluetooth/hci_core.h +++ b/include/net/bluetooth/hci_core.h @@ -315,7 +315,6 @@ static inline struct hci_conn *hci_conn_hash_lookup_state(struct hci_dev *hdev, void hci_acl_connect(struct hci_conn *conn); void hci_acl_disconn(struct hci_conn *conn, __u8 reason); void hci_add_sco(struct hci_conn *conn, __u16 handle); -void hci_setup_sync(struct hci_conn *conn, __u16 handle); struct hci_conn *hci_conn_add(struct hci_dev *hdev, int type, bdaddr_t *dst); int hci_conn_del(struct hci_conn *conn); diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c index e71af27..dbea663 100644 --- a/net/bluetooth/hci_conn.c +++ b/net/bluetooth/hci_conn.c @@ -127,28 +127,6 @@ void hci_add_sco(struct hci_conn *conn, __u16 handle) hci_send_cmd(hdev, HCI_OP_ADD_SCO, sizeof(cp), &cp); } -void hci_setup_sync(struct hci_conn *conn, __u16 handle) -{ - struct hci_dev *hdev = conn->hdev; - struct hci_cp_setup_sync_conn cp; - - BT_DBG("%p", conn); - - conn->state = BT_CONNECT; - conn->out = 1; - - cp.handle = cpu_to_le16(handle); - cp.pkt_type = cpu_to_le16(hdev->esco_type); - - cp.tx_bandwidth = cpu_to_le32(0x00001f40); - cp.rx_bandwidth = cpu_to_le32(0x00001f40); - cp.max_latency = cpu_to_le16(0xffff); - cp.voice_setting = cpu_to_le16(hdev->voice_setting); - cp.retrans_effort = 0xff; - - hci_send_cmd(hdev, HCI_OP_SETUP_SYNC_CONN, sizeof(cp), &cp); -} - static void hci_conn_timeout(unsigned long arg) { struct hci_conn *conn = (void *) arg; @@ -163,10 +141,7 @@ static void hci_conn_timeout(unsigned long arg) switch (conn->state) { case BT_CONNECT: - if (conn->type == ACL_LINK) - hci_acl_connect_cancel(conn); - else - hci_acl_disconn(conn, 0x13); + hci_acl_connect_cancel(conn); break; case BT_CONNECTED: hci_acl_disconn(conn, 0x13); @@ -373,12 +348,8 @@ struct hci_conn *hci_connect(struct hci_dev *hdev, int type, bdaddr_t *dst) hci_conn_hold(sco); if (acl->state == BT_CONNECTED && - (sco->state == BT_OPEN || sco->state == BT_CLOSED)) { - if (lmp_esco_capable(hdev)) - hci_setup_sync(sco, acl->handle); - else - hci_add_sco(sco, acl->handle); - } + (sco->state == BT_OPEN || sco->state == BT_CLOSED)) + hci_add_sco(sco, acl->handle); return sco; } diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index 9a99247..0cf80a7 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c @@ -544,34 +544,7 @@ static void hci_cs_remote_name_req(struct hci_dev *hdev, __u8 status) static void hci_cs_setup_sync_conn(struct hci_dev *hdev, __u8 status) { - struct hci_cp_setup_sync_conn *cp; - struct hci_conn *acl, *sco; - __u16 handle; - BT_DBG("%s status 0x%x", hdev->name, status); - - if (!status) - return; - - cp = hci_sent_cmd_data(hdev, HCI_OP_SETUP_SYNC_CONN); - if (!cp) - return; - - handle = __le16_to_cpu(cp->handle); - - BT_DBG("%s handle %d", hdev->name, handle); - - hci_dev_lock(hdev); - - acl = hci_conn_hash_lookup_handle(hdev, handle); - if (acl && (sco = acl->link)) { - sco->state = BT_CLOSED; - - hci_proto_connect_cfm(sco, status); - hci_conn_del(sco); - } - - hci_dev_unlock(hdev); } static void hci_cs_sniff_mode(struct hci_dev *hdev, __u8 status) @@ -719,12 +692,9 @@ static inline void hci_conn_complete_evt(struct hci_dev *hdev, struct sk_buff *s if (conn->type == ACL_LINK) { struct hci_conn *sco = conn->link; if (sco) { - if (!ev->status) { - if (lmp_esco_capable(hdev)) - hci_setup_sync(sco, conn->handle); - else - hci_add_sco(sco, conn->handle); - } else { + if (!ev->status) + hci_add_sco(sco, conn->handle); + else { hci_proto_connect_cfm(sco, ev->status); hci_conn_del(sco); } @@ -754,6 +724,7 @@ static inline void hci_conn_request_evt(struct hci_dev *hdev, struct sk_buff *sk if (mask & HCI_LM_ACCEPT) { /* Connection accepted */ struct hci_conn *conn; + struct hci_cp_accept_conn_req cp; hci_dev_lock(hdev); @@ -771,33 +742,14 @@ static inline void hci_conn_request_evt(struct hci_dev *hdev, struct sk_buff *sk hci_dev_unlock(hdev); - if (ev->link_type == ACL_LINK || !lmp_esco_capable(hdev)) { - struct hci_cp_accept_conn_req cp; - - bacpy(&cp.bdaddr, &ev->bdaddr); - - if (lmp_rswitch_capable(hdev) && (mask & HCI_LM_MASTER)) - cp.role = 0x00; /* Become master */ - else - cp.role = 0x01; /* Remain slave */ - - hci_send_cmd(hdev, HCI_OP_ACCEPT_CONN_REQ, - sizeof(cp), &cp); - } else { - struct hci_cp_accept_sync_conn_req cp; - - bacpy(&cp.bdaddr, &ev->bdaddr); - cp.pkt_type = cpu_to_le16(hdev->esco_type); + bacpy(&cp.bdaddr, &ev->bdaddr); - cp.tx_bandwidth = cpu_to_le32(0x00001f40); - cp.rx_bandwidth = cpu_to_le32(0x00001f40); - cp.max_latency = cpu_to_le16(0xffff); - cp.content_format = cpu_to_le16(hdev->voice_setting); - cp.retrans_effort = 0xff; + if (lmp_rswitch_capable(hdev) && (mask & HCI_LM_MASTER)) + cp.role = 0x00; /* Become master */ + else + cp.role = 0x01; /* Remain slave */ - hci_send_cmd(hdev, HCI_OP_ACCEPT_SYNC_CONN_REQ, - sizeof(cp), &cp); - } + hci_send_cmd(hdev, HCI_OP_ACCEPT_CONN_REQ, sizeof(cp), &cp); } else { /* Connection rejected */ struct hci_cp_reject_conn_req cp; @@ -1302,29 +1254,7 @@ static inline void hci_remote_ext_features_evt(struct hci_dev *hdev, struct sk_b static inline void hci_sync_conn_complete_evt(struct hci_dev *hdev, struct sk_buff *skb) { - struct hci_ev_sync_conn_complete *ev = (void *) skb->data; - struct hci_conn *conn; - - BT_DBG("%s status %d", hdev->name, ev->status); - - hci_dev_lock(hdev); - - conn = hci_conn_hash_lookup_ba(hdev, ev->link_type, &ev->bdaddr); - if (!conn) - goto unlock; - - if (!ev->status) { - conn->handle = __le16_to_cpu(ev->handle); - conn->state = BT_CONNECTED; - } else - conn->state = BT_CLOSED; - - hci_proto_connect_cfm(conn, ev->status); - if (ev->status) - hci_conn_del(conn); - -unlock: - hci_dev_unlock(hdev); + BT_DBG("%s", hdev->name); } static inline void hci_sync_conn_changed_evt(struct hci_dev *hdev, struct sk_buff *skb) diff --git a/net/bluetooth/sco.c b/net/bluetooth/sco.c index 14a39cb..11d50e5 100644 --- a/net/bluetooth/sco.c +++ b/net/bluetooth/sco.c @@ -222,7 +222,7 @@ static int sco_connect(struct sock *sk) struct sco_conn *conn; struct hci_conn *hcon; struct hci_dev *hdev; - int err, type; + int err = 0; BT_DBG("%s -> %s", batostr(src), batostr(dst)); @@ -233,9 +233,7 @@ static int sco_connect(struct sock *sk) err = -ENOMEM; - type = lmp_esco_capable(hdev) ? ESCO_LINK : SCO_LINK; - - hcon = hci_connect(hdev, type, dst); + hcon = hci_connect(hdev, SCO_LINK, dst); if (!hcon) goto done; @@ -953,7 +951,7 @@ static int sco_connect_cfm(struct hci_conn *hcon, __u8 status) { BT_DBG("hcon %p bdaddr %s status %d", hcon, batostr(&hcon->dst), status); - if (hcon->type != SCO_LINK && hcon->type != ESCO_LINK) + if (hcon->type != SCO_LINK) return 0; if (!status) { @@ -972,7 +970,7 @@ static int sco_disconn_ind(struct hci_conn *hcon, __u8 reason) { BT_DBG("hcon %p reason %d", hcon, reason); - if (hcon->type != SCO_LINK && hcon->type != ESCO_LINK) + if (hcon->type != SCO_LINK) return 0; sco_conn_del(hcon, bt_err(reason));