Commit 1f4ec585 authored by Lokendra Singh's avatar Lokendra Singh Committed by Marcel Holtmann
Browse files

Bluetooth: btintel: Skip reading firmware file version while in bootloader mode



This skips parsing the firmware version information from the firmware
file while controller is in bootloader mode. As in bootloader mode,
we are supposed to patch unconditionally.

Signed-off-by: default avatarLokendra Singh <lokendra.singh@intel.com>
Signed-off-by: default avatarLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Tested-by: default avatarTedd Ho-Jeong An <tedd.an@intel.com>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent 88981354
Loading
Loading
Loading
Loading
+17 −9
Original line number Diff line number Diff line
@@ -1031,6 +1031,10 @@ int btintel_download_firmware(struct hci_dev *hdev,
		/* Skip version checking */
		break;
	default:
		/* Skip reading firmware file version in bootloader mode */
		if (ver->fw_variant == 0x06)
			break;

		/* Skip download if firmware has the same version */
		if (btintel_firmware_version(hdev, ver->fw_build_num,
					     ver->fw_build_ww, ver->fw_build_yy,
@@ -1070,16 +1074,20 @@ int btintel_download_firmware_newgen(struct hci_dev *hdev,
	int err;
	u32 css_header_ver;

	/* Skip reading firmware file version in bootloader mode */
	if (ver->img_type != 0x01) {
		/* Skip download if firmware has the same version */
		if (btintel_firmware_version(hdev, ver->min_fw_build_nn,
				     ver->min_fw_build_cw, ver->min_fw_build_yy,
					     ver->min_fw_build_cw,
					     ver->min_fw_build_yy,
					     fw, boot_param)) {
			bt_dev_info(hdev, "Firmware already loaded");
		/* Return -EALREADY to indicate that firmware has already been
		 * loaded.
			/* Return -EALREADY to indicate that firmware has
			 * already been loaded.
			 */
			return -EALREADY;
		}
	}

	/* The firmware variant determines if the device is in bootloader
	 * mode or is running operational firmware. The value 0x01 identifies