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

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

Merge "bluetooth: Check FW status before downloading the firmware"

parents 268112d2 70aa8da2
Loading
Loading
Loading
Loading
+17 −4
Original line number Diff line number Diff line
@@ -56,8 +56,10 @@
#define ATH3K_MODE_MASK				0x3F
#define ATH3K_NORMAL_MODE			0x0E

#define ATH3K_PATCH_UPDATE			0x80
#define ATH3K_SYSCFG_UPDATE			0x40
#define ATH3K_PATCH_UPDATE			0xA0
#define ATH3K_SYSCFG_UPDATE			0x60
#define ATH3K_PATCH_SYSCFG_UPDATE		(ATH3K_PATCH_UPDATE | \
							ATH3K_SYSCFG_UPDATE)

#define ATH3K_XTAL_FREQ_26M			0x00
#define ATH3K_XTAL_FREQ_40M			0x01
@@ -449,10 +451,13 @@ static int ath3k_load_patch(struct usb_device *udev)
		return ret;
	}

	if (fw_state & ATH3K_PATCH_UPDATE) {
		BT_DBG("Patch was already downloaded");
	if ((fw_state == ATH3K_PATCH_UPDATE) ||
		(fw_state == ATH3K_PATCH_SYSCFG_UPDATE)) {
		BT_INFO("%s: Patch already downloaded(fw_state: %d)", __func__,
			fw_state);
		return 0;
	}
	BT_DBG("Downloading RamPatch(fw_state: %d)", fw_state);

	ret = ath3k_get_version(udev, &fw_version);
	if (ret < 0) {
@@ -533,6 +538,14 @@ static int ath3k_load_syscfg(struct usb_device *udev)
		return -EBUSY;
	}

	if ((fw_state == ATH3K_SYSCFG_UPDATE) ||
		(fw_state == ATH3K_PATCH_SYSCFG_UPDATE)) {
		BT_INFO("%s: NVM already downloaded(fw_state: %d)", __func__,
			fw_state);
		return 0;
	}
	BT_DBG("Downloading NVM(fw_state: %d)", fw_state);

	ret = ath3k_get_version(udev, &fw_version);
	if (ret < 0) {
		BT_ERR("Can't get version to change to load ram patch err");
+6 −2
Original line number Diff line number Diff line
/*
   BlueZ - Bluetooth protocol stack for Linux
   Copyright (c) 2000-2001, 2010, Code Aurora Forum. All rights reserved.
   Copyright (c) 2000-2001, 2010, 2014, Code Aurora Forum. All rights
   reserved.

   Written 2000,2001 by Maxim Krasnyansky <maxk@qualcomm.com>

@@ -502,6 +503,7 @@ struct hci_conn *hci_conn_add(struct hci_dev *hdev, int type, bdaddr_t *dst,
int hci_conn_del(struct hci_conn *conn)
{
	struct hci_dev *hdev = conn->hdev;
	__u8 type;

	BT_DBG("%s hcon %p handle %d", hdev->name, conn, conn->handle);

@@ -537,7 +539,9 @@ int hci_conn_del(struct hci_conn *conn)
		amp_mgr_put(conn->amp_mgr);

	hci_conn_hash_del(hdev, conn);
	if (hdev->notify)

	type = conn->type;
	if (hdev->notify && (type == SCO_LINK || type == ESCO_LINK))
		hdev->notify(hdev, HCI_NOTIFY_CONN_DEL);

	skb_queue_purge(&conn->data_q);