Lines Matching defs:hdev
40 static int btbcm_set_bdaddr_from_efi(struct hci_dev *hdev)
62 ret = btbcm_set_bdaddr(hdev, &bdaddr);
66 bt_dev_info(hdev, "BCM: Using EFI device address (%pMR)", &bdaddr);
70 static int btbcm_set_bdaddr_from_efi(struct hci_dev *hdev)
76 int btbcm_check_bdaddr(struct hci_dev *hdev)
81 skb = __hci_cmd_sync(hdev, HCI_OP_READ_BD_ADDR, 0, NULL,
86 bt_dev_err(hdev, "BCM: Reading device address failed (%d)", err);
91 bt_dev_err(hdev, "BCM: Device address length mismatch");
134 if (btbcm_set_bdaddr_from_efi(hdev) != 0) {
135 bt_dev_info(hdev, "BCM: Using default device address (%pMR)",
137 set_bit(HCI_QUIRK_INVALID_BDADDR, &hdev->quirks);
147 int btbcm_set_bdaddr(struct hci_dev *hdev, const bdaddr_t *bdaddr)
152 skb = __hci_cmd_sync(hdev, 0xfc01, 6, bdaddr, HCI_INIT_TIMEOUT);
155 bt_dev_err(hdev, "BCM: Change address command failed (%d)", err);
164 int btbcm_read_pcm_int_params(struct hci_dev *hdev,
170 skb = __hci_cmd_sync(hdev, 0xfc1d, 0, NULL, HCI_INIT_TIMEOUT);
173 bt_dev_err(hdev, "BCM: Read PCM int params failed (%d)", err);
178 bt_dev_err(hdev, "BCM: Read PCM int params length mismatch");
192 int btbcm_write_pcm_int_params(struct hci_dev *hdev,
198 skb = __hci_cmd_sync(hdev, 0xfc1c, 5, params, HCI_INIT_TIMEOUT);
201 bt_dev_err(hdev, "BCM: Write PCM int params failed (%d)", err);
210 int btbcm_patchram(struct hci_dev *hdev, const struct firmware *fw)
220 skb = __hci_cmd_sync(hdev, 0xfc2e, 0, NULL, HCI_INIT_TIMEOUT);
223 bt_dev_err(hdev, "BCM: Download Minidrv command failed (%d)",
243 bt_dev_err(hdev, "BCM: Patch is corrupted");
254 skb = __hci_cmd_sync(hdev, opcode, cmd->plen, cmd_param,
258 bt_dev_err(hdev, "BCM: Patch command %04x failed (%d)",
273 static int btbcm_reset(struct hci_dev *hdev)
277 skb = __hci_cmd_sync(hdev, HCI_OP_RESET, 0, NULL, HCI_INIT_TIMEOUT);
281 bt_dev_err(hdev, "BCM: Reset failed (%d)", err);
292 static struct sk_buff *btbcm_read_local_name(struct hci_dev *hdev)
296 skb = __hci_cmd_sync(hdev, HCI_OP_READ_LOCAL_NAME, 0, NULL,
299 bt_dev_err(hdev, "BCM: Reading local name failed (%ld)",
305 bt_dev_err(hdev, "BCM: Local name length mismatch");
313 static struct sk_buff *btbcm_read_local_version(struct hci_dev *hdev)
317 skb = __hci_cmd_sync(hdev, HCI_OP_READ_LOCAL_VERSION, 0, NULL,
320 bt_dev_err(hdev, "BCM: Reading local version info failed (%ld)",
326 bt_dev_err(hdev, "BCM: Local version length mismatch");
334 static struct sk_buff *btbcm_read_verbose_config(struct hci_dev *hdev)
338 skb = __hci_cmd_sync(hdev, 0xfc79, 0, NULL, HCI_INIT_TIMEOUT);
340 bt_dev_err(hdev, "BCM: Read verbose config info failed (%ld)",
346 bt_dev_err(hdev, "BCM: Verbose config length mismatch");
354 static struct sk_buff *btbcm_read_controller_features(struct hci_dev *hdev)
358 skb = __hci_cmd_sync(hdev, 0xfc6e, 0, NULL, HCI_INIT_TIMEOUT);
360 bt_dev_err(hdev, "BCM: Read controller features failed (%ld)",
366 bt_dev_err(hdev, "BCM: Controller features length mismatch");
374 static struct sk_buff *btbcm_read_usb_product(struct hci_dev *hdev)
378 skb = __hci_cmd_sync(hdev, 0xfc5a, 0, NULL, HCI_INIT_TIMEOUT);
380 bt_dev_err(hdev, "BCM: Read USB product info failed (%ld)",
386 bt_dev_err(hdev, "BCM: USB product length mismatch");
440 static int btbcm_read_info(struct hci_dev *hdev)
445 skb = btbcm_read_verbose_config(hdev);
449 bt_dev_info(hdev, "BCM: chip id %u", skb->data[1]);
455 static int btbcm_print_controller_features(struct hci_dev *hdev)
460 skb = btbcm_read_controller_features(hdev);
464 bt_dev_info(hdev, "BCM: features 0x%2.2x", skb->data[1]);
469 set_bit(HCI_QUIRK_BROKEN_READ_TRANSMIT_POWER, &hdev->quirks);
474 static int btbcm_print_local_name(struct hci_dev *hdev)
479 skb = btbcm_read_local_name(hdev);
483 bt_dev_info(hdev, "%s", (char *)(skb->data + 1));
572 int btbcm_initialize(struct hci_dev *hdev, bool *fw_load_done, bool use_autobaud_mode)
586 board_name = btbcm_get_board_name(&hdev->dev);
589 err = btbcm_reset(hdev);
594 skb = btbcm_read_local_version(hdev);
605 err = btbcm_read_info(hdev);
611 err = btbcm_print_controller_features(hdev);
615 err = btbcm_print_local_name(hdev);
620 bcm_subver_table = (hdev->bus == HCI_USB) ? bcm_usb_subver_table :
630 bt_dev_info(hdev, "%s (%3.3u.%3.3u.%3.3u) build %4.4u",
637 if (hdev->bus == HCI_USB) {
639 skb = btbcm_read_usb_product(hdev);
675 err = firmware_request_nowarn(&fw, fw_name[i], &hdev->dev);
677 bt_dev_info(hdev, "%s '%s' Patch",
685 err = btbcm_patchram(hdev, fw);
687 bt_dev_info(hdev, "BCM: Patch failed (%d)", err);
691 bt_dev_err(hdev, "BCM: firmware Patch file not found, tried:");
693 bt_dev_err(hdev, "BCM: '%s'", fw_name[i]);
701 int btbcm_finalize(struct hci_dev *hdev, bool *fw_load_done, bool use_autobaud_mode)
707 err = btbcm_initialize(hdev, fw_load_done, use_autobaud_mode);
712 btbcm_check_bdaddr(hdev);
714 set_bit(HCI_QUIRK_STRICT_DUPLICATE_FILTER, &hdev->quirks);
720 int btbcm_setup_patchram(struct hci_dev *hdev)
727 err = btbcm_initialize(hdev, &fw_load_done, use_autobaud_mode);
732 return btbcm_finalize(hdev, &fw_load_done, use_autobaud_mode);
736 int btbcm_setup_apple(struct hci_dev *hdev)
742 err = btbcm_reset(hdev);
747 skb = btbcm_read_verbose_config(hdev);
749 bt_dev_info(hdev, "BCM: chip id %u build %4.4u",
755 skb = btbcm_read_usb_product(hdev);
757 bt_dev_info(hdev, "BCM: product %4.4x:%4.4x",
764 skb = btbcm_read_controller_features(hdev);
766 bt_dev_info(hdev, "BCM: features 0x%2.2x", skb->data[1]);
771 skb = btbcm_read_local_name(hdev);
773 bt_dev_info(hdev, "%s", (char *)(skb->data + 1));
777 set_bit(HCI_QUIRK_STRICT_DUPLICATE_FILTER, &hdev->quirks);