Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9c399c7d authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "bluetooth: Fix SCO connection synchronization."

parents a69c5312 dc86dbf1
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -32,7 +32,8 @@
static bool disable_scofix;
static bool force_scofix;

static bool reset = 1;
static int sco_conn;
static int reset = 1;

static struct usb_driver btusb_driver;

@@ -1121,8 +1122,9 @@ static void btusb_notify(struct hci_dev *hdev, unsigned int evt)

	BT_DBG("%s evt %d", hdev->name, evt);

	if (hci_conn_num(hdev, SCO_LINK) != data->sco_num) {
		data->sco_num = hci_conn_num(hdev, SCO_LINK);
	if ((evt == HCI_NOTIFY_SCO_COMPLETE) || (evt == HCI_NOTIFY_CONN_DEL)) {
		BT_DBG("SCO conn state changed: evt %d", evt);
		sco_conn = (evt == HCI_NOTIFY_SCO_COMPLETE) ? 1 : 0;
		schedule_work(&data->work);
	}
}
@@ -1177,7 +1179,7 @@ static void btusb_work(struct work_struct *work)
	int new_alts;
	int err;

	if (data->sco_num > 0) {
	if (sco_conn) {
		if (!test_bit(BTUSB_DID_ISO_RESUME, &data->flags)) {
			err = usb_autopm_get_interface(data->isoc ? data->isoc : data->intf);
			if (err < 0) {
+1 −0
Original line number Diff line number Diff line
@@ -49,6 +49,7 @@
#define HCI_NOTIFY_CONN_ADD		1
#define HCI_NOTIFY_CONN_DEL		2
#define HCI_NOTIFY_VOICE_SETTING	3
#define HCI_NOTIFY_SCO_COMPLETE		4

/* HCI bus types */
#define HCI_VIRTUAL	0
+3 −0
Original line number Diff line number Diff line
@@ -3486,6 +3486,9 @@ static void hci_sync_conn_complete_evt(struct hci_dev *hdev,
		conn->state  = BT_CONNECTED;

		hci_conn_add_sysfs(conn);
		BT_DBG("SCO conn complete");
		if (hdev->notify)
			hdev->notify(hdev, HCI_NOTIFY_SCO_COMPLETE);
		break;

	case 0x10:	/* Connection Accept Timeout */