From patchwork Tue Feb 9 18:37:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Augusto von Dentz X-Patchwork-Id: 12078863 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CCF4DC433DB for ; Tue, 9 Feb 2021 18:56:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 83E5F64EAA for ; Tue, 9 Feb 2021 18:56:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233302AbhBISze (ORCPT ); Tue, 9 Feb 2021 13:55:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40556 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233149AbhBISr5 (ORCPT ); Tue, 9 Feb 2021 13:47:57 -0500 Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com [IPv6:2607:f8b0:4864:20::102d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 27DF9C0613D6 for ; Tue, 9 Feb 2021 10:37:48 -0800 (PST) Received: by mail-pj1-x102d.google.com with SMTP id nm1so2062203pjb.3 for ; Tue, 09 Feb 2021 10:37:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=rDNH5v+jq07sE7bkuSIB98VTRGWz93CwkUe23BjV33w=; b=q3KZ/yB9jyPiuqUDE4JVS2LsQRu3pOM58nWjl4HyTNkYDvQGghlm7M/amSybtoHcp0 /PgmlA3MULfOMfaRp6U+OFMKo3PKqOkgTJBrDWg06CI5EVGgFX0sxJlIASiel4TOiRQI U8jEx0Fmbf3udafxDEYrtZrHlP/NdM0I8MIKcIYUf9GKQVoZl2XYi99SRwtafASaSeMe OB4qPGb152kEc5oqjsbVC4H/7ho7jMlYMvojYKETCBcXJ4ME/p17z+ip2Mm5ggLEx5ma QDKEMNCPhtWPJ0CPsQDfeewKoxa4K9f1xPAD+TjheMe/lYFZXHNui9AopMLmRQuNZMDr NzCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=rDNH5v+jq07sE7bkuSIB98VTRGWz93CwkUe23BjV33w=; b=XQurYA/yMTb32UwJBGpMKsoQekZ5CJpl7MLqlWi9JXgQGiqHDDHdiC+pRTpuDl2tSY EVnTmzUwKJ/HmRO5RFt2XFRlHyfFz8rY/qg+7+qJf3SyoMwcWR+D0FI00vEfpQvtGZRO 9EPTCB3Goyh5WTB1iQhjr2siPOsXAcEqRA1OF4VP1BbxPAjcNVncou9pEEUBSW2OaSGD JXZTeDJk5aoFBa//q9wqPWAQpPOXd+jwEb3mrNfVENmgzswuW9WNnL1gJsEaEpfAHRKe 3cKYxm2+/fTChQ3hf7hQKD0ntcRY25vEA6YXOe7rziEqYSmKCtviWBE1kaaQvsoCI01R tchQ== X-Gm-Message-State: AOAM531dNAtOj1EeLkNdROat84MCrdeUzpr09jk7cu2SdR1aD/BW3Ab/ MuPYL4bJZX8/lU0sDkOtuVQ2oNyqLKI3jA== X-Google-Smtp-Source: ABdhPJwPD3UA1G4HOZQBX/j5WH7ylqVSV1EtDb9wJVZpzI+lClx/xOEKcRZn/sFZQNoF1JwN7nxdwg== X-Received: by 2002:a17:90a:5a86:: with SMTP id n6mr5560084pji.65.1612895867376; Tue, 09 Feb 2021 10:37:47 -0800 (PST) Received: from lvondent-mobl4.intel.com (c-71-56-157-77.hsd1.or.comcast.net. [71.56.157.77]) by smtp.gmail.com with ESMTPSA id w1sm3178760pjq.38.2021.02.09.10.37.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Feb 2021 10:37:46 -0800 (PST) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH v2 1/2] Bluetooth: btintel: Check firmware version before download Date: Tue, 9 Feb 2021 10:37:44 -0800 Message-Id: <20210209183745.1855624-1-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org From: Luiz Augusto von Dentz This checks the firmware build number, week and year matches with repective version loaded and then skip the download process. Signed-off-by: Luiz Augusto von Dentz --- v2: Add patch that mover checks for operational mode after the version checking. drivers/bluetooth/btintel.c | 94 +++++++++++++++++++++++++++-------- drivers/bluetooth/btintel.h | 5 +- drivers/bluetooth/btusb.c | 16 +++++- drivers/bluetooth/hci_intel.c | 7 ++- 4 files changed, 96 insertions(+), 26 deletions(-) diff --git a/drivers/bluetooth/btintel.c b/drivers/bluetooth/btintel.c index 88ce5f0ffc4b..153989bd8d5f 100644 --- a/drivers/bluetooth/btintel.c +++ b/drivers/bluetooth/btintel.c @@ -24,6 +24,14 @@ #define ECDSA_OFFSET 644 #define ECDSA_HEADER_LEN 320 +#define CMD_WRITE_BOOT_PARAMS 0xfc0e +struct cmd_write_boot_params { + u32 boot_addr; + u8 fw_build_num; + u8 fw_build_ww; + u8 fw_build_yy; +} __packed; + int btintel_check_bdaddr(struct hci_dev *hdev) { struct hci_rp_read_bd_addr *bda; @@ -841,7 +849,7 @@ static int btintel_sfi_ecdsa_header_secure_send(struct hci_dev *hdev, static int btintel_download_firmware_payload(struct hci_dev *hdev, const struct firmware *fw, - u32 *boot_param, size_t offset) + size_t offset) { int err; const u8 *fw_ptr; @@ -854,20 +862,6 @@ static int btintel_download_firmware_payload(struct hci_dev *hdev, while (fw_ptr - fw->data < fw->size) { struct hci_command_hdr *cmd = (void *)(fw_ptr + frag_len); - /* Each SKU has a different reset parameter to use in the - * HCI_Intel_Reset command and it is embedded in the firmware - * data. So, instead of using static value per SKU, check - * the firmware data and save it for later use. - */ - if (le16_to_cpu(cmd->opcode) == 0xfc0e) { - /* The boot parameter is the first 32-bit value - * and rest of 3 octets are reserved. - */ - *boot_param = get_unaligned_le32(fw_ptr + sizeof(*cmd)); - - bt_dev_dbg(hdev, "boot_param=0x%x", *boot_param); - } - frag_len += sizeof(*cmd) + cmd->plen; /* The parameter length of the secure send command requires @@ -896,28 +890,90 @@ static int btintel_download_firmware_payload(struct hci_dev *hdev, return err; } +static bool btintel_firmware_version(struct hci_dev *hdev, + u8 num, u8 ww, u8 yy, + const struct firmware *fw, + u32 *boot_addr) +{ + const u8 *fw_ptr; + u32 frag_len; + + fw_ptr = fw->data; + frag_len = 0; + + while (fw_ptr - fw->data < fw->size) { + struct hci_command_hdr *cmd = (void *)(fw_ptr + frag_len); + + /* Each SKU has a different reset parameter to use in the + * HCI_Intel_Reset command and it is embedded in the firmware + * data. So, instead of using static value per SKU, check + * the firmware data and save it for later use. + */ + if (le16_to_cpu(cmd->opcode) == CMD_WRITE_BOOT_PARAMS) { + struct cmd_write_boot_params *params; + + params = (void *)(fw_ptr + sizeof(*cmd)); + + bt_dev_dbg(hdev, "Boot Address: 0x%x", + le32_to_cpu(params->boot_addr)); + + bt_dev_dbg(hdev, "Firmware Version: %u-%u.%u", + params->fw_build_num, params->fw_build_ww, + params->fw_build_yy); + + return (num == params->fw_build_num && + ww == params->fw_build_ww && + yy == params->fw_build_yy); + } + + frag_len += sizeof(*cmd) + cmd->plen; + } + + return false; +} + int btintel_download_firmware(struct hci_dev *hdev, + struct intel_version *ver, const struct firmware *fw, u32 *boot_param) { int err; + /* 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, fw, boot_param)) { + /* Return -EALREADY to indicate that the firmware has already + * been loaded. + */ + return -EALREADY; + } + err = btintel_sfi_rsa_header_secure_send(hdev, fw); if (err) return err; - return btintel_download_firmware_payload(hdev, fw, boot_param, - RSA_HEADER_LEN); + return btintel_download_firmware_payload(hdev, fw, RSA_HEADER_LEN); } EXPORT_SYMBOL_GPL(btintel_download_firmware); int btintel_download_firmware_newgen(struct hci_dev *hdev, + struct intel_version_tlv *ver, const struct firmware *fw, u32 *boot_param, u8 hw_variant, u8 sbe_type) { int err; u32 css_header_ver; + /* 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, + fw, boot_param)) { + /* Return -EALREADY to indicate that firmware has already been + * loaded. + */ + return -EALREADY; + } + /* iBT hardware variants 0x0b, 0x0c, 0x11, 0x12, 0x13, 0x14 support * only RSA secure boot engine. Hence, the corresponding sfi file will * have RSA header of 644 bytes followed by Command Buffer. @@ -947,7 +1003,7 @@ int btintel_download_firmware_newgen(struct hci_dev *hdev, if (err) return err; - err = btintel_download_firmware_payload(hdev, fw, boot_param, RSA_HEADER_LEN); + err = btintel_download_firmware_payload(hdev, fw, RSA_HEADER_LEN); if (err) return err; } else if (hw_variant >= 0x17) { @@ -968,7 +1024,6 @@ int btintel_download_firmware_newgen(struct hci_dev *hdev, return err; err = btintel_download_firmware_payload(hdev, fw, - boot_param, RSA_HEADER_LEN + ECDSA_HEADER_LEN); if (err) return err; @@ -978,7 +1033,6 @@ int btintel_download_firmware_newgen(struct hci_dev *hdev, return err; err = btintel_download_firmware_payload(hdev, fw, - boot_param, RSA_HEADER_LEN + ECDSA_HEADER_LEN); if (err) return err; diff --git a/drivers/bluetooth/btintel.h b/drivers/bluetooth/btintel.h index 6511b091caf5..51f1f2c883b4 100644 --- a/drivers/bluetooth/btintel.h +++ b/drivers/bluetooth/btintel.h @@ -163,9 +163,10 @@ struct regmap *btintel_regmap_init(struct hci_dev *hdev, u16 opcode_read, int btintel_send_intel_reset(struct hci_dev *hdev, u32 boot_param); int btintel_read_boot_params(struct hci_dev *hdev, struct intel_boot_params *params); -int btintel_download_firmware(struct hci_dev *dev, const struct firmware *fw, - u32 *boot_param); +int btintel_download_firmware(struct hci_dev *dev, struct intel_version *ver, + const struct firmware *fw, u32 *boot_param); int btintel_download_firmware_newgen(struct hci_dev *hdev, + struct intel_version_tlv *ver, const struct firmware *fw, u32 *boot_param, u8 hw_variant, u8 sbe_type); diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c index 66ada8217797..e896c6702d60 100644 --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c @@ -2623,10 +2623,16 @@ static int btusb_intel_download_firmware_newgen(struct hci_dev *hdev, set_bit(BTUSB_DOWNLOADING, &data->flags); /* Start firmware downloading and get boot parameter */ - err = btintel_download_firmware_newgen(hdev, fw, boot_param, + err = btintel_download_firmware_newgen(hdev, ver, fw, boot_param, INTEL_HW_VARIANT(ver->cnvi_bt), ver->sbe_type); if (err < 0) { + if (err == -EALREADY) { + /* Firmware has already been loaded */ + set_bit(BTUSB_FIRMWARE_LOADED, &data->flags); + goto done; + } + /* When FW download fails, send Intel Reset to retry * FW download. */ @@ -2817,8 +2823,14 @@ static int btusb_intel_download_firmware(struct hci_dev *hdev, set_bit(BTUSB_DOWNLOADING, &data->flags); /* Start firmware downloading and get boot parameter */ - err = btintel_download_firmware(hdev, fw, boot_param); + err = btintel_download_firmware(hdev, ver, fw, boot_param); if (err < 0) { + if (err == -EALREADY) { + /* Firmware has already been loaded */ + set_bit(BTUSB_FIRMWARE_LOADED, &data->flags); + goto done; + } + /* When FW download fails, send Intel Reset to retry * FW download. */ diff --git a/drivers/bluetooth/hci_intel.c b/drivers/bluetooth/hci_intel.c index b20a40fab83e..7249b91d9b91 100644 --- a/drivers/bluetooth/hci_intel.c +++ b/drivers/bluetooth/hci_intel.c @@ -735,7 +735,7 @@ static int intel_setup(struct hci_uart *hu) set_bit(STATE_DOWNLOADING, &intel->flags); /* Start firmware downloading and get boot parameter */ - err = btintel_download_firmware(hdev, fw, &boot_param); + err = btintel_download_firmware(hdev, &ver, fw, &boot_param); if (err < 0) goto done; @@ -784,7 +784,10 @@ static int intel_setup(struct hci_uart *hu) done: release_firmware(fw); - if (err < 0) + /* Check if there was an error and if is not -EALREADY which means the + * firmware has already been loaded. + */ + if (err < 0 && err != -EALREADY) return err; /* We need to restore the default speed before Intel reset */ From patchwork Tue Feb 9 18:37:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Augusto von Dentz X-Patchwork-Id: 12078865 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1848AC433DB for ; Tue, 9 Feb 2021 18:56:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C8D2664EC4 for ; Tue, 9 Feb 2021 18:56:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233358AbhBISzu (ORCPT ); Tue, 9 Feb 2021 13:55:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233559AbhBIStG (ORCPT ); Tue, 9 Feb 2021 13:49:06 -0500 Received: from mail-pj1-x102c.google.com (mail-pj1-x102c.google.com [IPv6:2607:f8b0:4864:20::102c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 13FC8C061788 for ; Tue, 9 Feb 2021 10:37:49 -0800 (PST) Received: by mail-pj1-x102c.google.com with SMTP id t2so2189860pjq.2 for ; Tue, 09 Feb 2021 10:37:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=9r39e0FawigOYrzHIRBqg19OWikqKQp5VXTUpj5s8XA=; b=pbpvQ4xZ3hOR9inzJvfRex3bV+iKg8aSkIkGIHkTVvxujzbVqVLwYh8JYiiFxng3kk K2Ugpy5TCwYwF7DIKRSZIEJ9weGoCkDPMGrDDs+F1y86CQctlvhJ9hMtOrkqxa/9pf/8 3Wz4jX9hY9K/Hm94wEoZDPxW24aLsCOSROwKRQuXQWr2sc4ZPzvNNeptyrtpw1v4nZnb HeaJwZ73YDM9ZbIVZVBDeVB5oLZya8jIVuD/Hcpxl6WTIeEHDtAC8hzA0J7AMTzHK1pd r/QZJZL4yyyF/PSV49OZvR/oCOAjHefU40BO3zyNFpUgMa36V3vtzrYsD7F+DUPmektT pheg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=9r39e0FawigOYrzHIRBqg19OWikqKQp5VXTUpj5s8XA=; b=oshTfnxQj3hTyji+RT37v5Xp5seTeNZKUJnd0UlRGQuWwnX2Ou7a6a8spCwyg99Mr3 V7h50CFTvscCvhpZ0XvGiNG3B0ndzrR8eiS1UFpxxK8l1rjVhYVwziFxVGkin9lrripE UY+RVyW8Vyi7CA3+k/M5PpAZzfuWAbD8hqoHtzs29RZUB7CIAav7bJj1IsUYsgDvLRDL iu7wtr5RS9t74DRUVb+j8lrX34z04+STDuHrlE+MVECwzYKJRoM8iK4Iz3lx7AOl/azJ a6CcyP0Dg6ntfF2pfQ/M8viYraA0QvZu36oghg03HyZVsMTmHhN42EpazBROx/lYKvA4 lZtw== X-Gm-Message-State: AOAM530PVzjsj50Xa8p/ArDkyOCE4SekmBpgijon3625IULRDQ0oos/A TYxTWVyAuuVpH4sS98zuTJ3pWtnM57DTJw== X-Google-Smtp-Source: ABdhPJyYQAUUgrBdBb9eCksATsSBG8jBdFIur9pOoOY5cN6zYeOH2dWqe0HiMIDfMWScmoE3mZhzRw== X-Received: by 2002:a17:90b:3805:: with SMTP id mq5mr5309781pjb.93.1612895868404; Tue, 09 Feb 2021 10:37:48 -0800 (PST) Received: from lvondent-mobl4.intel.com (c-71-56-157-77.hsd1.or.comcast.net. [71.56.157.77]) by smtp.gmail.com with ESMTPSA id w1sm3178760pjq.38.2021.02.09.10.37.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Feb 2021 10:37:48 -0800 (PST) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH v2 2/2] Bluetooth: btintel: Move operational checks after version check Date: Tue, 9 Feb 2021 10:37:45 -0800 Message-Id: <20210209183745.1855624-2-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210209183745.1855624-1-luiz.dentz@gmail.com> References: <20210209183745.1855624-1-luiz.dentz@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org From: Luiz Augusto von Dentz In order to allow new firmware to be loaded it first needs to check if the firmware version on file matches the one loaded if it doesn't then it needs to revert to boorloader mode in order to load the new firmware. Signed-off-by: Luiz Augusto von Dentz --- drivers/bluetooth/btintel.c | 22 +++++++++++++++++++++ drivers/bluetooth/btusb.c | 38 ------------------------------------- 2 files changed, 22 insertions(+), 38 deletions(-) diff --git a/drivers/bluetooth/btintel.c b/drivers/bluetooth/btintel.c index 153989bd8d5f..ccab05f67df9 100644 --- a/drivers/bluetooth/btintel.c +++ b/drivers/bluetooth/btintel.c @@ -948,6 +948,17 @@ int btintel_download_firmware(struct hci_dev *hdev, return -EALREADY; } + /* The firmware variant determines if the device is in bootloader + * mode or is running operational firmware. The value 0x06 identifies + * the bootloader and the value 0x23 identifies the operational + * firmware. + * + * If the firmware version has changed that means it needs to be reset + * to bootloader when operational so the new firmware can be loaded. + */ + if (ver->fw_variant == 0x23) + return -EINVAL; + err = btintel_sfi_rsa_header_secure_send(hdev, fw); if (err) return err; @@ -974,6 +985,17 @@ int btintel_download_firmware_newgen(struct hci_dev *hdev, return -EALREADY; } + /* The firmware variant determines if the device is in bootloader + * mode or is running operational firmware. The value 0x03 identifies + * the bootloader and the value 0x23 identifies the operational + * firmware. + * + * If the firmware version has changed that means it needs to be reset + * to bootloader when operational so the new firmware can be loaded. + */ + if (ver->img_type == 0x03) + return -EINVAL; + /* iBT hardware variants 0x0b, 0x0c, 0x11, 0x12, 0x13, 0x14 support * only RSA secure boot engine. Hence, the corresponding sfi file will * have RSA header of 644 bytes followed by Command Buffer. diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c index e896c6702d60..971dbad31e26 100644 --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c @@ -2534,25 +2534,6 @@ static int btusb_intel_download_firmware_newgen(struct hci_dev *hdev, return -EINVAL; } - /* The firmware variant determines if the device is in bootloader - * mode or is running operational firmware. The value 0x03 identifies - * the bootloader and the value 0x23 identifies the operational - * firmware. - * - * When the operational firmware is already present, then only - * the check for valid Bluetooth device address is needed. This - * determines if the device will be added as configured or - * unconfigured controller. - * - * It is not possible to use the Secure Boot Parameters in this - * case since that command is only available in bootloader mode. - */ - if (ver->img_type == 0x03) { - clear_bit(BTUSB_BOOTLOADER, &data->flags); - btintel_check_bdaddr(hdev); - return 0; - } - /* Check for supported iBT hardware variants of this firmware * loading method. * @@ -2724,25 +2705,6 @@ static int btusb_intel_download_firmware(struct hci_dev *hdev, btintel_version_info(hdev, ver); - /* The firmware variant determines if the device is in bootloader - * mode or is running operational firmware. The value 0x06 identifies - * the bootloader and the value 0x23 identifies the operational - * firmware. - * - * When the operational firmware is already present, then only - * the check for valid Bluetooth device address is needed. This - * determines if the device will be added as configured or - * unconfigured controller. - * - * It is not possible to use the Secure Boot Parameters in this - * case since that command is only available in bootloader mode. - */ - if (ver->fw_variant == 0x23) { - clear_bit(BTUSB_BOOTLOADER, &data->flags); - btintel_check_bdaddr(hdev); - return 0; - } - /* If the device is not in bootloader mode, then the only possible * choice is to return an error and abort the device initialization. */