Lines Matching refs:hdev

55 int btintel_check_bdaddr(struct hci_dev *hdev)  in btintel_check_bdaddr()  argument
60 skb = __hci_cmd_sync(hdev, HCI_OP_READ_BD_ADDR, 0, NULL, in btintel_check_bdaddr()
64 bt_dev_err(hdev, "Reading Intel device address failed (%d)", in btintel_check_bdaddr()
70 bt_dev_err(hdev, "Intel device address length mismatch"); in btintel_check_bdaddr()
83 bt_dev_err(hdev, "Found Intel default device address (%pMR)", in btintel_check_bdaddr()
85 set_bit(HCI_QUIRK_INVALID_BDADDR, &hdev->quirks); in btintel_check_bdaddr()
94 int btintel_enter_mfg(struct hci_dev *hdev) in btintel_enter_mfg() argument
99 skb = __hci_cmd_sync(hdev, 0xfc11, 2, param, HCI_CMD_TIMEOUT); in btintel_enter_mfg()
101 bt_dev_err(hdev, "Entering manufacturer mode failed (%ld)", in btintel_enter_mfg()
111 int btintel_exit_mfg(struct hci_dev *hdev, bool reset, bool patched) in btintel_exit_mfg() argument
124 skb = __hci_cmd_sync(hdev, 0xfc11, 2, param, HCI_CMD_TIMEOUT); in btintel_exit_mfg()
126 bt_dev_err(hdev, "Exiting manufacturer mode failed (%ld)", in btintel_exit_mfg()
136 int btintel_set_bdaddr(struct hci_dev *hdev, const bdaddr_t *bdaddr) in btintel_set_bdaddr() argument
141 skb = __hci_cmd_sync(hdev, 0xfc31, 6, bdaddr, HCI_INIT_TIMEOUT); in btintel_set_bdaddr()
144 bt_dev_err(hdev, "Changing Intel device address failed (%d)", in btintel_set_bdaddr()
154 static int btintel_set_event_mask(struct hci_dev *hdev, bool debug) in btintel_set_event_mask() argument
163 skb = __hci_cmd_sync(hdev, 0xfc52, 8, mask, HCI_INIT_TIMEOUT); in btintel_set_event_mask()
166 bt_dev_err(hdev, "Setting Intel event mask failed (%d)", err); in btintel_set_event_mask()
174 int btintel_set_diag(struct hci_dev *hdev, bool enable) in btintel_set_diag() argument
190 skb = __hci_cmd_sync(hdev, 0xfc43, 3, param, HCI_INIT_TIMEOUT); in btintel_set_diag()
195 bt_dev_err(hdev, "Changing Intel diagnostic mode failed (%d)", in btintel_set_diag()
202 btintel_set_event_mask(hdev, enable); in btintel_set_diag()
207 static int btintel_set_diag_mfg(struct hci_dev *hdev, bool enable) in btintel_set_diag_mfg() argument
211 err = btintel_enter_mfg(hdev); in btintel_set_diag_mfg()
215 ret = btintel_set_diag(hdev, enable); in btintel_set_diag_mfg()
217 err = btintel_exit_mfg(hdev, false, false); in btintel_set_diag_mfg()
224 static int btintel_set_diag_combined(struct hci_dev *hdev, bool enable) in btintel_set_diag_combined() argument
233 if (btintel_test_flag(hdev, INTEL_ROM_LEGACY)) in btintel_set_diag_combined()
234 ret = btintel_set_diag_mfg(hdev, enable); in btintel_set_diag_combined()
236 ret = btintel_set_diag(hdev, enable); in btintel_set_diag_combined()
241 void btintel_hw_error(struct hci_dev *hdev, u8 code) in btintel_hw_error() argument
246 bt_dev_err(hdev, "Hardware error 0x%2.2x", code); in btintel_hw_error()
248 skb = __hci_cmd_sync(hdev, HCI_OP_RESET, 0, NULL, HCI_INIT_TIMEOUT); in btintel_hw_error()
250 bt_dev_err(hdev, "Reset after hardware error failed (%ld)", in btintel_hw_error()
256 skb = __hci_cmd_sync(hdev, 0xfc22, 1, &type, HCI_INIT_TIMEOUT); in btintel_hw_error()
258 bt_dev_err(hdev, "Retrieving Intel exception info failed (%ld)", in btintel_hw_error()
264 bt_dev_err(hdev, "Exception info size mismatch"); in btintel_hw_error()
269 bt_dev_err(hdev, "Exception info %s", (char *)(skb->data + 1)); in btintel_hw_error()
275 int btintel_version_info(struct hci_dev *hdev, struct intel_version *ver) in btintel_version_info() argument
283 bt_dev_err(hdev, "Unsupported Intel hardware platform (%u)", in btintel_version_info()
305 bt_dev_err(hdev, "Unsupported Intel hardware variant (%u)", in btintel_version_info()
324 bt_dev_err(hdev, "Unsupported firmware variant(%02x)", ver->fw_variant); in btintel_version_info()
331 bt_dev_info(hdev, "%s revision %u.%u build %u week %u %u", in btintel_version_info()
340 static int btintel_secure_send(struct hci_dev *hdev, u8 fragment_type, u32 plen, in btintel_secure_send() argument
350 skb = __hci_cmd_sync(hdev, 0xfc09, fragment_len + 1, in btintel_secure_send()
364 int btintel_load_ddc_config(struct hci_dev *hdev, const char *ddc_name) in btintel_load_ddc_config() argument
371 err = request_firmware_direct(&fw, ddc_name, &hdev->dev); in btintel_load_ddc_config()
373 bt_dev_err(hdev, "Failed to load Intel DDC file %s (%d)", in btintel_load_ddc_config()
378 bt_dev_info(hdev, "Found Intel DDC parameters: %s", ddc_name); in btintel_load_ddc_config()
388 skb = __hci_cmd_sync(hdev, 0xfc8b, cmd_plen, fw_ptr, in btintel_load_ddc_config()
391 bt_dev_err(hdev, "Failed to send Intel_Write_DDC (%ld)", in btintel_load_ddc_config()
403 bt_dev_info(hdev, "Applying Intel DDC parameters completed"); in btintel_load_ddc_config()
409 int btintel_set_event_mask_mfg(struct hci_dev *hdev, bool debug) in btintel_set_event_mask_mfg() argument
413 err = btintel_enter_mfg(hdev); in btintel_set_event_mask_mfg()
417 ret = btintel_set_event_mask(hdev, debug); in btintel_set_event_mask_mfg()
419 err = btintel_exit_mfg(hdev, false, false); in btintel_set_event_mask_mfg()
427 int btintel_read_version(struct hci_dev *hdev, struct intel_version *ver) in btintel_read_version() argument
431 skb = __hci_cmd_sync(hdev, 0xfc05, 0, NULL, HCI_CMD_TIMEOUT); in btintel_read_version()
433 bt_dev_err(hdev, "Reading Intel version information failed (%ld)", in btintel_read_version()
439 bt_dev_err(hdev, "Intel version event size mismatch"); in btintel_read_version()
452 int btintel_version_info_tlv(struct hci_dev *hdev, in btintel_version_info_tlv() argument
461 bt_dev_err(hdev, "Unsupported Intel hardware platform (0x%2x)", in btintel_version_info_tlv()
482 bt_dev_err(hdev, "Unsupported Intel hardware variant (0x%x)", in btintel_version_info_tlv()
495 bt_dev_err(hdev, "Unsupported Intel firmware loading method (0x%x)", in btintel_version_info_tlv()
502 bt_dev_err(hdev, "Unsupported Intel secure boot engine type (0x%x)", in btintel_version_info_tlv()
507 bt_dev_info(hdev, "Device revision is %u", version->dev_rev_id); in btintel_version_info_tlv()
508 bt_dev_info(hdev, "Secure boot is %s", in btintel_version_info_tlv()
510 bt_dev_info(hdev, "OTP lock is %s", in btintel_version_info_tlv()
512 bt_dev_info(hdev, "API lock is %s", in btintel_version_info_tlv()
514 bt_dev_info(hdev, "Debug lock is %s", in btintel_version_info_tlv()
516 bt_dev_info(hdev, "Minimum firmware build %u week %u %u", in btintel_version_info_tlv()
527 bt_dev_err(hdev, "Unsupported image type(%02x)", version->img_type); in btintel_version_info_tlv()
534 bt_dev_info(hdev, "%s timestamp %u.%u buildtype %u build %u", variant, in btintel_version_info_tlv()
538 bt_dev_info(hdev, "Firmware SHA1: 0x%8.8x", version->git_sha1); in btintel_version_info_tlv()
544 int btintel_parse_version_tlv(struct hci_dev *hdev, in btintel_parse_version_tlv() argument
654 static int btintel_read_version_tlv(struct hci_dev *hdev, in btintel_read_version_tlv() argument
663 skb = __hci_cmd_sync(hdev, 0xfc05, 1, param, HCI_CMD_TIMEOUT); in btintel_read_version_tlv()
665 bt_dev_err(hdev, "Reading Intel version information failed (%ld)", in btintel_read_version_tlv()
671 bt_dev_err(hdev, "Intel Read Version command failed (%02x)", in btintel_read_version_tlv()
677 btintel_parse_version_tlv(hdev, version, skb); in btintel_read_version_tlv()
690 struct hci_dev *hdev; member
738 bt_dev_dbg(ctx->hdev, "Register (0x%x) read", le32_to_cpu(cp.addr)); in regmap_ibt_read()
740 skb = hci_cmd_sync(ctx->hdev, ctx->op_read, sizeof(cp), &cp, in regmap_ibt_read()
744 bt_dev_err(ctx->hdev, "regmap: Register (0x%x) read error (%d)", in regmap_ibt_read()
750 bt_dev_err(ctx->hdev, "regmap: Register (0x%x) read error, bad len", in regmap_ibt_read()
759 bt_dev_err(ctx->hdev, "regmap: Register (0x%x) read error, bad addr", in regmap_ibt_read()
810 bt_dev_dbg(ctx->hdev, "Register (0x%x) write", le32_to_cpu(cp->addr)); in regmap_ibt_gather_write()
812 skb = hci_cmd_sync(ctx->hdev, ctx->op_write, plen, cp, HCI_CMD_TIMEOUT); in regmap_ibt_gather_write()
815 bt_dev_err(ctx->hdev, "regmap: Register (0x%x) write error (%d)", in regmap_ibt_gather_write()
858 struct regmap *btintel_regmap_init(struct hci_dev *hdev, u16 opcode_read, in btintel_regmap_init() argument
863 bt_dev_info(hdev, "regmap: Init R%x-W%x region", opcode_read, in btintel_regmap_init()
872 ctx->hdev = hdev; in btintel_regmap_init()
874 return regmap_init(&hdev->dev, &regmap_ibt, ctx, &regmap_ibt_cfg); in btintel_regmap_init()
878 int btintel_send_intel_reset(struct hci_dev *hdev, u32 boot_param) in btintel_send_intel_reset() argument
885 skb = __hci_cmd_sync(hdev, 0xfc01, sizeof(params), &params, in btintel_send_intel_reset()
888 bt_dev_err(hdev, "Failed to send Intel Reset command"); in btintel_send_intel_reset()
898 int btintel_read_boot_params(struct hci_dev *hdev, in btintel_read_boot_params() argument
903 skb = __hci_cmd_sync(hdev, 0xfc0d, 0, NULL, HCI_INIT_TIMEOUT); in btintel_read_boot_params()
905 bt_dev_err(hdev, "Reading Intel boot parameters failed (%ld)", in btintel_read_boot_params()
911 bt_dev_err(hdev, "Intel boot parameters size mismatch"); in btintel_read_boot_params()
921 bt_dev_err(hdev, "Intel boot parameters command failed (%02x)", in btintel_read_boot_params()
926 bt_dev_info(hdev, "Device revision is %u", in btintel_read_boot_params()
929 bt_dev_info(hdev, "Secure boot is %s", in btintel_read_boot_params()
932 bt_dev_info(hdev, "OTP lock is %s", in btintel_read_boot_params()
935 bt_dev_info(hdev, "API lock is %s", in btintel_read_boot_params()
938 bt_dev_info(hdev, "Debug lock is %s", in btintel_read_boot_params()
941 bt_dev_info(hdev, "Minimum firmware build %u week %u %u", in btintel_read_boot_params()
949 static int btintel_sfi_rsa_header_secure_send(struct hci_dev *hdev, in btintel_sfi_rsa_header_secure_send() argument
957 err = btintel_secure_send(hdev, 0x00, 128, fw->data); in btintel_sfi_rsa_header_secure_send()
959 bt_dev_err(hdev, "Failed to send firmware header (%d)", err); in btintel_sfi_rsa_header_secure_send()
966 err = btintel_secure_send(hdev, 0x03, 256, fw->data + 128); in btintel_sfi_rsa_header_secure_send()
968 bt_dev_err(hdev, "Failed to send firmware pkey (%d)", err); in btintel_sfi_rsa_header_secure_send()
975 err = btintel_secure_send(hdev, 0x02, 256, fw->data + 388); in btintel_sfi_rsa_header_secure_send()
977 bt_dev_err(hdev, "Failed to send firmware signature (%d)", err); in btintel_sfi_rsa_header_secure_send()
985 static int btintel_sfi_ecdsa_header_secure_send(struct hci_dev *hdev, in btintel_sfi_ecdsa_header_secure_send() argument
993 err = btintel_secure_send(hdev, 0x00, 128, fw->data + 644); in btintel_sfi_ecdsa_header_secure_send()
995 bt_dev_err(hdev, "Failed to send firmware header (%d)", err); in btintel_sfi_ecdsa_header_secure_send()
1002 err = btintel_secure_send(hdev, 0x03, 96, fw->data + 644 + 128); in btintel_sfi_ecdsa_header_secure_send()
1004 bt_dev_err(hdev, "Failed to send firmware pkey (%d)", err); in btintel_sfi_ecdsa_header_secure_send()
1011 err = btintel_secure_send(hdev, 0x02, 96, fw->data + 644 + 224); in btintel_sfi_ecdsa_header_secure_send()
1013 bt_dev_err(hdev, "Failed to send firmware signature (%d)", in btintel_sfi_ecdsa_header_secure_send()
1020 static int btintel_download_firmware_payload(struct hci_dev *hdev, in btintel_download_firmware_payload() argument
1046 err = btintel_secure_send(hdev, 0x01, frag_len, fw_ptr); in btintel_download_firmware_payload()
1048 bt_dev_err(hdev, in btintel_download_firmware_payload()
1063 static bool btintel_firmware_version(struct hci_dev *hdev, in btintel_firmware_version() argument
1087 bt_dev_info(hdev, "Boot Address: 0x%x", *boot_addr); in btintel_firmware_version()
1089 bt_dev_info(hdev, "Firmware Version: %u-%u.%u", in btintel_firmware_version()
1104 int btintel_download_firmware(struct hci_dev *hdev, in btintel_download_firmware() argument
1122 if (btintel_firmware_version(hdev, ver->fw_build_num, in btintel_download_firmware()
1125 bt_dev_info(hdev, "Firmware already loaded"); in btintel_download_firmware()
1144 err = btintel_sfi_rsa_header_secure_send(hdev, fw); in btintel_download_firmware()
1148 return btintel_download_firmware_payload(hdev, fw, RSA_HEADER_LEN); in btintel_download_firmware()
1152 static int btintel_download_fw_tlv(struct hci_dev *hdev, in btintel_download_fw_tlv() argument
1161 if (btintel_firmware_version(hdev, ver->min_fw_build_nn, in btintel_download_fw_tlv()
1165 bt_dev_info(hdev, "Firmware already loaded"); in btintel_download_fw_tlv()
1197 bt_dev_err(hdev, "Invalid CSS Header version"); in btintel_download_fw_tlv()
1203 bt_dev_err(hdev, "Invalid SBE type for hardware variant (%d)", in btintel_download_fw_tlv()
1208 err = btintel_sfi_rsa_header_secure_send(hdev, fw); in btintel_download_fw_tlv()
1212 err = btintel_download_firmware_payload(hdev, fw, RSA_HEADER_LEN); in btintel_download_fw_tlv()
1223 bt_dev_err(hdev, "Invalid CSS Header version"); in btintel_download_fw_tlv()
1228 err = btintel_sfi_rsa_header_secure_send(hdev, fw); in btintel_download_fw_tlv()
1232 err = btintel_download_firmware_payload(hdev, fw, in btintel_download_fw_tlv()
1237 err = btintel_sfi_ecdsa_header_secure_send(hdev, fw); in btintel_download_fw_tlv()
1241 err = btintel_download_firmware_payload(hdev, fw, in btintel_download_fw_tlv()
1250 static void btintel_reset_to_bootloader(struct hci_dev *hdev) in btintel_reset_to_bootloader() argument
1276 skb = __hci_cmd_sync(hdev, 0xfc01, sizeof(params), in btintel_reset_to_bootloader()
1279 bt_dev_err(hdev, "FW download error recovery failed (%ld)", in btintel_reset_to_bootloader()
1283 bt_dev_info(hdev, "Intel reset sent to retry FW download"); in btintel_reset_to_bootloader()
1294 static int btintel_read_debug_features(struct hci_dev *hdev, in btintel_read_debug_features() argument
1303 skb = __hci_cmd_sync(hdev, 0xfca6, sizeof(page_no), &page_no, in btintel_read_debug_features()
1306 bt_dev_err(hdev, "Reading supported features failed (%ld)", in btintel_read_debug_features()
1312 bt_dev_err(hdev, "Supported features event size mismatch"); in btintel_read_debug_features()
1325 static int btintel_set_debug_features(struct hci_dev *hdev, in btintel_set_debug_features() argument
1335 bt_dev_warn(hdev, "Debug features not read"); in btintel_set_debug_features()
1340 bt_dev_info(hdev, "Telemetry exception format not supported"); in btintel_set_debug_features()
1344 skb = __hci_cmd_sync(hdev, 0xfc8b, 11, mask, HCI_INIT_TIMEOUT); in btintel_set_debug_features()
1346 bt_dev_err(hdev, "Setting Intel telemetry ddc write event mask failed (%ld)", in btintel_set_debug_features()
1352 skb = __hci_cmd_sync(hdev, 0xfc8b, 5, period, HCI_INIT_TIMEOUT); in btintel_set_debug_features()
1354 bt_dev_err(hdev, "Setting periodicity for link statistics traces failed (%ld)", in btintel_set_debug_features()
1360 skb = __hci_cmd_sync(hdev, 0xfca1, 1, &trace_enable, HCI_INIT_TIMEOUT); in btintel_set_debug_features()
1362 bt_dev_err(hdev, "Enable tracing of link statistics events failed (%ld)", in btintel_set_debug_features()
1368 bt_dev_info(hdev, "set debug features: trace_enable 0x%02x mask 0x%02x", in btintel_set_debug_features()
1374 static int btintel_reset_debug_features(struct hci_dev *hdev, in btintel_reset_debug_features() argument
1383 bt_dev_warn(hdev, "Debug features not read"); in btintel_reset_debug_features()
1388 bt_dev_info(hdev, "Telemetry exception format not supported"); in btintel_reset_debug_features()
1393 skb = __hci_cmd_sync(hdev, 0xfca1, 1, &trace_enable, HCI_INIT_TIMEOUT); in btintel_reset_debug_features()
1395 bt_dev_err(hdev, "Stop tracing of link statistics events failed (%ld)", in btintel_reset_debug_features()
1401 skb = __hci_cmd_sync(hdev, 0xfc8b, 11, mask, HCI_INIT_TIMEOUT); in btintel_reset_debug_features()
1403 bt_dev_err(hdev, "Setting Intel telemetry ddc write event mask failed (%ld)", in btintel_reset_debug_features()
1409 bt_dev_info(hdev, "reset debug features: trace_enable 0x%02x mask 0x%02x", in btintel_reset_debug_features()
1415 int btintel_set_quality_report(struct hci_dev *hdev, bool enable) in btintel_set_quality_report() argument
1420 bt_dev_dbg(hdev, "enable %d", enable); in btintel_set_quality_report()
1425 err = btintel_read_debug_features(hdev, &features); in btintel_set_quality_report()
1431 err = btintel_set_debug_features(hdev, &features); in btintel_set_quality_report()
1433 err = btintel_reset_debug_features(hdev, &features); in btintel_set_quality_report()
1439 static void btintel_coredump(struct hci_dev *hdev) in btintel_coredump() argument
1443 skb = __hci_cmd_sync(hdev, 0xfc4e, 0, NULL, HCI_CMD_TIMEOUT); in btintel_coredump()
1445 bt_dev_err(hdev, "Coredump failed (%ld)", PTR_ERR(skb)); in btintel_coredump()
1452 static void btintel_dmp_hdr(struct hci_dev *hdev, struct sk_buff *skb) in btintel_dmp_hdr() argument
1471 static int btintel_register_devcoredump_support(struct hci_dev *hdev) in btintel_register_devcoredump_support() argument
1476 err = btintel_read_debug_features(hdev, &features); in btintel_register_devcoredump_support()
1478 bt_dev_info(hdev, "Error reading debug features"); in btintel_register_devcoredump_support()
1483 bt_dev_dbg(hdev, "Telemetry exception format not supported"); in btintel_register_devcoredump_support()
1487 hci_devcd_register(hdev, btintel_coredump, btintel_dmp_hdr, NULL); in btintel_register_devcoredump_support()
1492 static const struct firmware *btintel_legacy_rom_get_fw(struct hci_dev *hdev, in btintel_legacy_rom_get_fw() argument
1505 ret = request_firmware(&fw, fwname, &hdev->dev); in btintel_legacy_rom_get_fw()
1508 bt_dev_err(hdev, "Intel firmware file request failed (%d)", in btintel_legacy_rom_get_fw()
1513 bt_dev_err(hdev, "failed to open Intel firmware file: %s (%d)", in btintel_legacy_rom_get_fw()
1521 if (request_firmware(&fw, fwname, &hdev->dev) < 0) { in btintel_legacy_rom_get_fw()
1522 bt_dev_err(hdev, "failed to open default fw file: %s", in btintel_legacy_rom_get_fw()
1528 bt_dev_info(hdev, "Intel Bluetooth firmware file: %s", fwname); in btintel_legacy_rom_get_fw()
1533 static int btintel_legacy_rom_patching(struct hci_dev *hdev, in btintel_legacy_rom_patching() argument
1552 bt_dev_err(hdev, "Intel fw corrupted: invalid cmd read"); in btintel_legacy_rom_patching()
1566 bt_dev_err(hdev, "Intel fw corrupted: invalid cmd len"); in btintel_legacy_rom_patching()
1599 bt_dev_err(hdev, "Intel fw corrupted: invalid evt len"); in btintel_legacy_rom_patching()
1613 bt_dev_err(hdev, "Intel fw corrupted: invalid evt read"); in btintel_legacy_rom_patching()
1617 skb = __hci_cmd_sync_ev(hdev, le16_to_cpu(cmd->opcode), cmd->plen, in btintel_legacy_rom_patching()
1620 bt_dev_err(hdev, "sending Intel patch command (0x%4.4x) failed (%ld)", in btintel_legacy_rom_patching()
1630 bt_dev_err(hdev, "mismatch event length (opcode 0x%4.4x)", in btintel_legacy_rom_patching()
1637 bt_dev_err(hdev, "mismatch event parameter (opcode 0x%4.4x)", in btintel_legacy_rom_patching()
1647 static int btintel_legacy_rom_setup(struct hci_dev *hdev, in btintel_legacy_rom_setup() argument
1655 BT_DBG("%s", hdev->name); in btintel_legacy_rom_setup()
1662 bt_dev_info(hdev, in btintel_legacy_rom_setup()
1674 fw = btintel_legacy_rom_get_fw(hdev, ver); in btintel_legacy_rom_setup()
1683 err = btintel_enter_mfg(hdev); in btintel_legacy_rom_setup()
1714 ret = btintel_legacy_rom_patching(hdev, fw, &fw_ptr, in btintel_legacy_rom_setup()
1728 err = btintel_exit_mfg(hdev, true, true); in btintel_legacy_rom_setup()
1735 err = btintel_read_version(hdev, &new_ver); in btintel_legacy_rom_setup()
1739 bt_dev_info(hdev, "Intel BT fw patch 0x%02x completed & activated", in btintel_legacy_rom_setup()
1746 err = btintel_exit_mfg(hdev, false, false); in btintel_legacy_rom_setup()
1750 bt_dev_info(hdev, "Intel firmware patch completed"); in btintel_legacy_rom_setup()
1760 err = btintel_exit_mfg(hdev, true, false); in btintel_legacy_rom_setup()
1764 bt_dev_info(hdev, "Intel firmware patch completed and deactivated"); in btintel_legacy_rom_setup()
1770 btintel_set_event_mask_mfg(hdev, false); in btintel_legacy_rom_setup()
1772 btintel_check_bdaddr(hdev); in btintel_legacy_rom_setup()
1777 static int btintel_download_wait(struct hci_dev *hdev, ktime_t calltime, int msec) in btintel_download_wait() argument
1783 btintel_set_flag(hdev, INTEL_FIRMWARE_LOADED); in btintel_download_wait()
1785 bt_dev_info(hdev, "Waiting for firmware download to complete"); in btintel_download_wait()
1787 err = btintel_wait_on_flag_timeout(hdev, INTEL_DOWNLOADING, in btintel_download_wait()
1791 bt_dev_err(hdev, "Firmware loading interrupted"); in btintel_download_wait()
1796 bt_dev_err(hdev, "Firmware loading timeout"); in btintel_download_wait()
1800 if (btintel_test_flag(hdev, INTEL_FIRMWARE_FAILED)) { in btintel_download_wait()
1801 bt_dev_err(hdev, "Firmware loading failed"); in btintel_download_wait()
1809 bt_dev_info(hdev, "Firmware loaded in %llu usecs", duration); in btintel_download_wait()
1814 static int btintel_boot_wait(struct hci_dev *hdev, ktime_t calltime, int msec) in btintel_boot_wait() argument
1820 bt_dev_info(hdev, "Waiting for device to boot"); in btintel_boot_wait()
1822 err = btintel_wait_on_flag_timeout(hdev, INTEL_BOOTING, in btintel_boot_wait()
1826 bt_dev_err(hdev, "Device boot interrupted"); in btintel_boot_wait()
1831 bt_dev_err(hdev, "Device boot timeout"); in btintel_boot_wait()
1839 bt_dev_info(hdev, "Device booted in %llu usecs", duration); in btintel_boot_wait()
1844 static int btintel_boot(struct hci_dev *hdev, u32 boot_addr) in btintel_boot() argument
1851 btintel_set_flag(hdev, INTEL_BOOTING); in btintel_boot()
1853 err = btintel_send_intel_reset(hdev, boot_addr); in btintel_boot()
1855 bt_dev_err(hdev, "Intel Soft Reset failed (%d)", err); in btintel_boot()
1856 btintel_reset_to_bootloader(hdev); in btintel_boot()
1867 err = btintel_boot_wait(hdev, calltime, 1000); in btintel_boot()
1869 btintel_reset_to_bootloader(hdev); in btintel_boot()
1904 static int btintel_download_fw(struct hci_dev *hdev, in btintel_download_fw() argument
1931 btintel_clear_flag(hdev, INTEL_BOOTLOADER); in btintel_download_fw()
1932 btintel_check_bdaddr(hdev); in btintel_download_fw()
1950 err = btintel_read_boot_params(hdev, params); in btintel_download_fw()
1959 bt_dev_err(hdev, "Unsupported Intel firmware loading method (%u)", in btintel_download_fw()
1968 bt_dev_info(hdev, "No device address configured"); in btintel_download_fw()
1969 set_bit(HCI_QUIRK_INVALID_BDADDR, &hdev->quirks); in btintel_download_fw()
1996 if (!btintel_test_flag(hdev, INTEL_BOOTLOADER)) { in btintel_download_fw()
1998 btintel_set_flag(hdev, INTEL_FIRMWARE_LOADED); in btintel_download_fw()
2002 bt_dev_err(hdev, "Unsupported Intel firmware naming"); in btintel_download_fw()
2006 err = firmware_request_nowarn(&fw, fwname, &hdev->dev); in btintel_download_fw()
2008 if (!btintel_test_flag(hdev, INTEL_BOOTLOADER)) { in btintel_download_fw()
2010 btintel_set_flag(hdev, INTEL_FIRMWARE_LOADED); in btintel_download_fw()
2014 bt_dev_err(hdev, "Failed to load Intel firmware file %s (%d)", in btintel_download_fw()
2019 bt_dev_info(hdev, "Found device firmware: %s", fwname); in btintel_download_fw()
2022 bt_dev_err(hdev, "Invalid size of firmware file (%zu)", in btintel_download_fw()
2030 btintel_set_flag(hdev, INTEL_DOWNLOADING); in btintel_download_fw()
2033 err = btintel_download_firmware(hdev, ver, fw, boot_param); in btintel_download_fw()
2037 btintel_set_flag(hdev, INTEL_FIRMWARE_LOADED); in btintel_download_fw()
2045 btintel_reset_to_bootloader(hdev); in btintel_download_fw()
2060 err = btintel_download_wait(hdev, calltime, 5000); in btintel_download_fw()
2062 btintel_reset_to_bootloader(hdev); in btintel_download_fw()
2069 static int btintel_bootloader_setup(struct hci_dev *hdev, in btintel_bootloader_setup() argument
2078 BT_DBG("%s", hdev->name); in btintel_bootloader_setup()
2086 btintel_set_flag(hdev, INTEL_BOOTLOADER); in btintel_bootloader_setup()
2088 err = btintel_download_fw(hdev, ver, &params, &boot_param); in btintel_bootloader_setup()
2096 err = btintel_boot(hdev, boot_param); in btintel_bootloader_setup()
2100 btintel_clear_flag(hdev, INTEL_BOOTLOADER); in btintel_bootloader_setup()
2106 bt_dev_err(hdev, "Unsupported Intel firmware naming"); in btintel_bootloader_setup()
2114 btintel_load_ddc_config(hdev, ddcname); in btintel_bootloader_setup()
2117 hci_dev_clear_flag(hdev, HCI_QUALITY_REPORT); in btintel_bootloader_setup()
2120 err = btintel_read_version(hdev, &new_ver); in btintel_bootloader_setup()
2124 btintel_version_info(hdev, &new_ver); in btintel_bootloader_setup()
2134 btintel_set_event_mask(hdev, false); in btintel_bootloader_setup()
2201 static int btintel_prepare_fw_download_tlv(struct hci_dev *hdev, in btintel_prepare_fw_download_tlv() argument
2227 btintel_clear_flag(hdev, INTEL_BOOTLOADER); in btintel_prepare_fw_download_tlv()
2228 btintel_check_bdaddr(hdev); in btintel_prepare_fw_download_tlv()
2236 bt_dev_info(hdev, "No device address configured"); in btintel_prepare_fw_download_tlv()
2237 set_bit(HCI_QUIRK_INVALID_BDADDR, &hdev->quirks); in btintel_prepare_fw_download_tlv()
2255 err = firmware_request_nowarn(&fw, fwname, &hdev->dev); in btintel_prepare_fw_download_tlv()
2257 if (!btintel_test_flag(hdev, INTEL_BOOTLOADER)) { in btintel_prepare_fw_download_tlv()
2259 btintel_set_flag(hdev, INTEL_FIRMWARE_LOADED); in btintel_prepare_fw_download_tlv()
2263 bt_dev_err(hdev, "Failed to load Intel firmware file %s (%d)", in btintel_prepare_fw_download_tlv()
2269 bt_dev_info(hdev, "Found device firmware: %s", fwname); in btintel_prepare_fw_download_tlv()
2272 bt_dev_err(hdev, "Invalid size of firmware file (%zu)", in btintel_prepare_fw_download_tlv()
2280 btintel_set_flag(hdev, INTEL_DOWNLOADING); in btintel_prepare_fw_download_tlv()
2283 err = btintel_download_fw_tlv(hdev, ver, fw, boot_param, in btintel_prepare_fw_download_tlv()
2289 btintel_set_flag(hdev, INTEL_FIRMWARE_LOADED); in btintel_prepare_fw_download_tlv()
2297 btintel_reset_to_bootloader(hdev); in btintel_prepare_fw_download_tlv()
2312 err = btintel_download_wait(hdev, calltime, 5000); in btintel_prepare_fw_download_tlv()
2314 btintel_reset_to_bootloader(hdev); in btintel_prepare_fw_download_tlv()
2321 static int btintel_get_codec_config_data(struct hci_dev *hdev, in btintel_get_codec_config_data() argument
2334 bt_dev_err(hdev, "Invalid link type(%u)", link); in btintel_get_codec_config_data()
2354 bt_dev_err(hdev, "Invalid codec id(%u)", codec->id); in btintel_get_codec_config_data()
2370 static int btintel_get_data_path_id(struct hci_dev *hdev, __u8 *data_path_id) in btintel_get_data_path_id() argument
2377 static int btintel_configure_offload(struct hci_dev *hdev) in btintel_configure_offload() argument
2383 skb = __hci_cmd_sync(hdev, 0xfc86, 0, NULL, HCI_INIT_TIMEOUT); in btintel_configure_offload()
2385 bt_dev_err(hdev, "Reading offload use cases failed (%ld)", in btintel_configure_offload()
2403 hdev->get_data_path_id = btintel_get_data_path_id; in btintel_configure_offload()
2404 hdev->get_codec_config_data = btintel_get_codec_config_data; in btintel_configure_offload()
2411 static void btintel_set_ppag(struct hci_dev *hdev, struct intel_version_tlv *ver) in btintel_set_ppag() argument
2426 bt_dev_dbg(hdev, "PPAG not supported for Intel CNVr (0x%3x)", in btintel_set_ppag()
2431 handle = ACPI_HANDLE(GET_HCIDEV_DEV(hdev)); in btintel_set_ppag()
2433 bt_dev_info(hdev, "No support for BT device in ACPI firmware"); in btintel_set_ppag()
2440 bt_dev_dbg(hdev, "PPAG-BT: ACPI entry not found"); in btintel_set_ppag()
2443 bt_dev_warn(hdev, "PPAG-BT: ACPI Failure: %s", acpi_format_exception(status)); in btintel_set_ppag()
2449 bt_dev_warn(hdev, "PPAG-BT: Invalid object type: %d or package count: %d", in btintel_set_ppag()
2465 bt_dev_dbg(hdev, "PPAG-BT: Bluetooth domain is disabled in ACPI firmware"); in btintel_set_ppag()
2478 bt_dev_dbg(hdev, "PPAG-BT: EU, China mode are disabled in BIOS"); in btintel_set_ppag()
2484 skb = __hci_cmd_sync(hdev, INTEL_OP_PPAG_CMD, sizeof(ppag_cmd), in btintel_set_ppag()
2487 bt_dev_warn(hdev, "Failed to send PPAG Enable (%ld)", PTR_ERR(skb)); in btintel_set_ppag()
2490 bt_dev_info(hdev, "PPAG-BT: Enabled (Mode %d)", mode); in btintel_set_ppag()
2494 static int btintel_acpi_reset_method(struct hci_dev *hdev) in btintel_acpi_reset_method() argument
2501 status = acpi_evaluate_object(ACPI_HANDLE(GET_HCIDEV_DEV(hdev)), "_PRR", NULL, &buffer); in btintel_acpi_reset_method()
2503 bt_dev_err(hdev, "Failed to run _PRR method"); in btintel_acpi_reset_method()
2510 bt_dev_err(hdev, "Invalid arguments"); in btintel_acpi_reset_method()
2517 bt_dev_err(hdev, "Invalid object type: 0x%x", ref->type); in btintel_acpi_reset_method()
2524 bt_dev_err(hdev, "Failed to run_RST method"); in btintel_acpi_reset_method()
2534 static void btintel_set_dsm_reset_method(struct hci_dev *hdev, in btintel_set_dsm_reset_method() argument
2537 struct btintel_data *data = hci_get_priv(hdev); in btintel_set_dsm_reset_method()
2538 acpi_handle handle = ACPI_HANDLE(GET_HCIDEV_DEV(hdev)); in btintel_set_dsm_reset_method()
2546 handle = ACPI_HANDLE(GET_HCIDEV_DEV(hdev)); in btintel_set_dsm_reset_method()
2549 bt_dev_dbg(hdev, "No support for bluetooth device in ACPI firmware"); in btintel_set_dsm_reset_method()
2554 bt_dev_err(hdev, "No support for _PRR ACPI method"); in btintel_set_dsm_reset_method()
2568 bt_dev_err(hdev, "No dsm support to set reset delay"); in btintel_set_dsm_reset_method()
2577 bt_dev_err(hdev, "Failed to call dsm to set reset delay"); in btintel_set_dsm_reset_method()
2583 bt_dev_info(hdev, "DSM reset method type: 0x%02x", reset_payload[2]); in btintel_set_dsm_reset_method()
2587 bt_dev_warn(hdev, "No support for dsm to set reset method"); in btintel_set_dsm_reset_method()
2597 bt_dev_err(hdev, "Failed to call dsm to set reset method"); in btintel_set_dsm_reset_method()
2606 static u8 btintel_classify_pkt_type(struct hci_dev *hdev, struct sk_buff *skb) in btintel_classify_pkt_type() argument
2687 static int btintel_set_dsbr(struct hci_dev *hdev, struct intel_version_tlv *ver) in btintel_set_dsbr() argument
2714 bt_dev_dbg(hdev, "Error reading efi: %ls (%d)", in btintel_set_dsbr()
2720 bt_dev_info(hdev, "dsbr: enable: 0x%2.2x value: 0x%2.2x", cmd.enable, in btintel_set_dsbr()
2723 skb = __hci_cmd_sync(hdev, 0xfc0a, sizeof(cmd), &cmd, HCI_CMD_TIMEOUT); in btintel_set_dsbr()
2736 int btintel_bootloader_setup_tlv(struct hci_dev *hdev, in btintel_bootloader_setup_tlv() argument
2744 bt_dev_dbg(hdev, ""); in btintel_bootloader_setup_tlv()
2752 btintel_set_flag(hdev, INTEL_BOOTLOADER); in btintel_bootloader_setup_tlv()
2754 err = btintel_prepare_fw_download_tlv(hdev, ver, &boot_param); in btintel_bootloader_setup_tlv()
2762 err = btintel_boot(hdev, boot_param); in btintel_bootloader_setup_tlv()
2766 err = btintel_read_version_tlv(hdev, ver); in btintel_bootloader_setup_tlv()
2771 err = btintel_set_dsbr(hdev, ver); in btintel_bootloader_setup_tlv()
2773 bt_dev_err(hdev, "Failed to send dsbr command (%d)", err); in btintel_bootloader_setup_tlv()
2781 err = btintel_prepare_fw_download_tlv(hdev, ver, &boot_param); in btintel_bootloader_setup_tlv()
2785 err = btintel_boot(hdev, boot_param); in btintel_bootloader_setup_tlv()
2790 btintel_clear_flag(hdev, INTEL_BOOTLOADER); in btintel_bootloader_setup_tlv()
2799 btintel_load_ddc_config(hdev, ddcname); in btintel_bootloader_setup_tlv()
2802 btintel_configure_offload(hdev); in btintel_bootloader_setup_tlv()
2804 hci_dev_clear_flag(hdev, HCI_QUALITY_REPORT); in btintel_bootloader_setup_tlv()
2807 btintel_set_ppag(hdev, ver); in btintel_bootloader_setup_tlv()
2810 err = btintel_read_version_tlv(hdev, &new_ver); in btintel_bootloader_setup_tlv()
2814 btintel_version_info_tlv(hdev, &new_ver); in btintel_bootloader_setup_tlv()
2824 btintel_set_event_mask(hdev, false); in btintel_bootloader_setup_tlv()
2830 void btintel_set_msft_opcode(struct hci_dev *hdev, u8 hw_variant) in btintel_set_msft_opcode() argument
2848 hci_set_msft_opcode(hdev, 0xFC1E); in btintel_set_msft_opcode()
2857 void btintel_print_fseq_info(struct hci_dev *hdev) in btintel_print_fseq_info() argument
2864 skb = __hci_cmd_sync(hdev, 0xfcb3, 0, NULL, HCI_CMD_TIMEOUT); in btintel_print_fseq_info()
2866 bt_dev_dbg(hdev, "Reading fseq status command failed (%ld)", in btintel_print_fseq_info()
2872 bt_dev_dbg(hdev, "Malformed packet of length %u received", in btintel_print_fseq_info()
2880 bt_dev_dbg(hdev, "Failed to get fseq status (0x%2.2x)", *p); in btintel_print_fseq_info()
2902 bt_dev_err(hdev, "Fseq status: %s (0x%2.2x)", str, *p); in btintel_print_fseq_info()
2907 bt_dev_info(hdev, "Fseq status: %s (0x%2.2x)", str, *p); in btintel_print_fseq_info()
2910 bt_dev_dbg(hdev, "Reason: 0x%8.8x", val); in btintel_print_fseq_info()
2913 bt_dev_dbg(hdev, "Global version: 0x%8.8x", val); in btintel_print_fseq_info()
2916 bt_dev_dbg(hdev, "Installed version: 0x%8.8x", val); in btintel_print_fseq_info()
2920 bt_dev_info(hdev, "Fseq executed: %2.2u.%2.2u.%2.2u.%2.2u", p[0], p[1], in btintel_print_fseq_info()
2925 bt_dev_info(hdev, "Fseq BT Top: %2.2u.%2.2u.%2.2u.%2.2u", p[0], p[1], in btintel_print_fseq_info()
2929 bt_dev_dbg(hdev, "Fseq Top init version: 0x%8.8x", val); in btintel_print_fseq_info()
2932 bt_dev_dbg(hdev, "Fseq Cnvio init version: 0x%8.8x", val); in btintel_print_fseq_info()
2935 bt_dev_dbg(hdev, "Fseq MBX Wifi file version: 0x%8.8x", val); in btintel_print_fseq_info()
2938 bt_dev_dbg(hdev, "Fseq BT version: 0x%8.8x", val); in btintel_print_fseq_info()
2941 bt_dev_dbg(hdev, "Fseq Top reset address: 0x%8.8x", val); in btintel_print_fseq_info()
2944 bt_dev_dbg(hdev, "Fseq MBX timeout: 0x%8.8x", val); in btintel_print_fseq_info()
2947 bt_dev_dbg(hdev, "Fseq MBX ack: 0x%8.8x", val); in btintel_print_fseq_info()
2950 bt_dev_dbg(hdev, "Fseq CNVi id: 0x%8.8x", val); in btintel_print_fseq_info()
2953 bt_dev_dbg(hdev, "Fseq CNVr id: 0x%8.8x", val); in btintel_print_fseq_info()
2956 bt_dev_dbg(hdev, "Fseq Error handle: 0x%8.8x", val); in btintel_print_fseq_info()
2959 bt_dev_dbg(hdev, "Fseq Magic noalive indication: 0x%8.8x", val); in btintel_print_fseq_info()
2962 bt_dev_dbg(hdev, "Fseq OTP version: 0x%8.8x", val); in btintel_print_fseq_info()
2965 bt_dev_dbg(hdev, "Fseq MBX otp version: 0x%8.8x", val); in btintel_print_fseq_info()
2971 static int btintel_setup_combined(struct hci_dev *hdev) in btintel_setup_combined() argument
2979 BT_DBG("%s", hdev->name); in btintel_setup_combined()
2995 if (btintel_test_flag(hdev, INTEL_BROKEN_INITIAL_NCMD) || in btintel_setup_combined()
2996 btintel_test_flag(hdev, INTEL_BROKEN_SHUTDOWN_LED)) { in btintel_setup_combined()
2997 skb = __hci_cmd_sync(hdev, HCI_OP_RESET, 0, NULL, in btintel_setup_combined()
3000 bt_dev_err(hdev, in btintel_setup_combined()
3014 skb = __hci_cmd_sync(hdev, 0xfc05, 1, param, HCI_CMD_TIMEOUT); in btintel_setup_combined()
3016 bt_dev_err(hdev, "Reading Intel version command failed (%ld)", in btintel_setup_combined()
3023 bt_dev_err(hdev, "Intel Read Version command failed (%02x)", in btintel_setup_combined()
3030 set_bit(HCI_QUIRK_STRICT_DUPLICATE_FILTER, &hdev->quirks); in btintel_setup_combined()
3031 set_bit(HCI_QUIRK_SIMULTANEOUS_DISCOVERY, &hdev->quirks); in btintel_setup_combined()
3032 set_bit(HCI_QUIRK_NON_PERSISTENT_DIAG, &hdev->quirks); in btintel_setup_combined()
3035 hdev->set_quality_report = btintel_set_quality_report; in btintel_setup_combined()
3039 bt_dev_dbg(hdev, "Read the legacy Intel version information"); in btintel_setup_combined()
3044 btintel_version_info(hdev, &ver); in btintel_setup_combined()
3057 btintel_set_flag(hdev, INTEL_ROM_LEGACY); in btintel_setup_combined()
3068 if (!btintel_test_flag(hdev, in btintel_setup_combined()
3071 &hdev->quirks); in btintel_setup_combined()
3073 err = btintel_legacy_rom_setup(hdev, &ver); in btintel_setup_combined()
3087 &hdev->quirks); in btintel_setup_combined()
3090 set_bit(HCI_QUIRK_BROKEN_LE_CODED, &hdev->quirks); in btintel_setup_combined()
3093 btintel_set_msft_opcode(hdev, ver.hw_variant); in btintel_setup_combined()
3095 err = btintel_bootloader_setup(hdev, &ver); in btintel_setup_combined()
3096 btintel_register_devcoredump_support(hdev); in btintel_setup_combined()
3099 bt_dev_err(hdev, "Unsupported Intel hw variant (%u)", in btintel_setup_combined()
3104 hci_set_hw_info(hdev, in btintel_setup_combined()
3117 err = btintel_parse_version_tlv(hdev, &ver_tlv, skb); in btintel_setup_combined()
3119 bt_dev_err(hdev, "Failed to parse TLV version information"); in btintel_setup_combined()
3124 bt_dev_err(hdev, "Unsupported Intel hardware platform (0x%2x)", in btintel_setup_combined()
3158 err = btintel_read_version(hdev, &ver); in btintel_setup_combined()
3166 set_bit(HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED, &hdev->quirks); in btintel_setup_combined()
3169 set_bit(HCI_QUIRK_BROKEN_LE_CODED, &hdev->quirks); in btintel_setup_combined()
3172 btintel_set_msft_opcode(hdev, ver.hw_variant); in btintel_setup_combined()
3174 err = btintel_bootloader_setup(hdev, &ver); in btintel_setup_combined()
3175 btintel_register_devcoredump_support(hdev); in btintel_setup_combined()
3180 hdev->classify_pkt_type = btintel_classify_pkt_type; in btintel_setup_combined()
3188 btintel_version_info_tlv(hdev, &ver_tlv); in btintel_setup_combined()
3194 set_bit(HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED, &hdev->quirks); in btintel_setup_combined()
3197 btintel_set_msft_opcode(hdev, in btintel_setup_combined()
3199 btintel_set_dsm_reset_method(hdev, &ver_tlv); in btintel_setup_combined()
3201 err = btintel_bootloader_setup_tlv(hdev, &ver_tlv); in btintel_setup_combined()
3205 btintel_register_devcoredump_support(hdev); in btintel_setup_combined()
3206 btintel_print_fseq_info(hdev); in btintel_setup_combined()
3209 bt_dev_err(hdev, "Unsupported Intel hw variant (%u)", in btintel_setup_combined()
3215 hci_set_hw_info(hdev, "INTEL platform=%u variant=%u", in btintel_setup_combined()
3225 int btintel_shutdown_combined(struct hci_dev *hdev) in btintel_shutdown_combined() argument
3234 skb = __hci_cmd_sync(hdev, HCI_OP_RESET, 0, NULL, HCI_INIT_TIMEOUT); in btintel_shutdown_combined()
3236 bt_dev_err(hdev, "HCI reset during shutdown failed"); in btintel_shutdown_combined()
3247 if (btintel_test_flag(hdev, INTEL_BROKEN_SHUTDOWN_LED)) { in btintel_shutdown_combined()
3248 skb = __hci_cmd_sync(hdev, 0xfc3f, 0, NULL, HCI_INIT_TIMEOUT); in btintel_shutdown_combined()
3251 bt_dev_err(hdev, "turning off Intel device LED failed"); in btintel_shutdown_combined()
3261 int btintel_configure_setup(struct hci_dev *hdev, const char *driver_name) in btintel_configure_setup() argument
3263 hdev->manufacturer = 2; in btintel_configure_setup()
3264 hdev->setup = btintel_setup_combined; in btintel_configure_setup()
3265 hdev->shutdown = btintel_shutdown_combined; in btintel_configure_setup()
3266 hdev->hw_error = btintel_hw_error; in btintel_configure_setup()
3267 hdev->set_diag = btintel_set_diag_combined; in btintel_configure_setup()
3268 hdev->set_bdaddr = btintel_set_bdaddr; in btintel_configure_setup()
3276 static int btintel_diagnostics(struct hci_dev *hdev, struct sk_buff *skb) in btintel_diagnostics() argument
3290 if (!hci_devcd_init(hdev, skb->len)) { in btintel_diagnostics()
3291 hci_devcd_append(hdev, skb_clone(skb, GFP_ATOMIC)); in btintel_diagnostics()
3292 hci_devcd_complete(hdev); in btintel_diagnostics()
3294 bt_dev_err(hdev, "Failed to generate devcoredump"); in btintel_diagnostics()
3298 bt_dev_err(hdev, "Invalid exception type %02X", tlv->val[0]); in btintel_diagnostics()
3302 return hci_recv_frame(hdev, skb); in btintel_diagnostics()
3305 int btintel_recv_event(struct hci_dev *hdev, struct sk_buff *skb) in btintel_recv_event() argument
3315 if (btintel_test_flag(hdev, INTEL_BOOTLOADER)) { in btintel_recv_event()
3322 btintel_bootup(hdev, ptr, len); in btintel_recv_event()
3330 btintel_secure_send_result(hdev, ptr, len); in btintel_recv_event()
3341 return btintel_diagnostics(hdev, skb); in btintel_recv_event()
3345 return hci_recv_frame(hdev, skb); in btintel_recv_event()
3349 void btintel_bootup(struct hci_dev *hdev, const void *ptr, unsigned int len) in btintel_bootup() argument
3356 if (btintel_test_and_clear_flag(hdev, INTEL_BOOTING)) in btintel_bootup()
3357 btintel_wake_up_flag(hdev, INTEL_BOOTING); in btintel_bootup()
3361 void btintel_secure_send_result(struct hci_dev *hdev, in btintel_secure_send_result() argument
3370 btintel_set_flag(hdev, INTEL_FIRMWARE_FAILED); in btintel_secure_send_result()
3372 if (btintel_test_and_clear_flag(hdev, INTEL_DOWNLOADING) && in btintel_secure_send_result()
3373 btintel_test_flag(hdev, INTEL_FIRMWARE_LOADED)) in btintel_secure_send_result()
3374 btintel_wake_up_flag(hdev, INTEL_DOWNLOADING); in btintel_secure_send_result()