Lines Matching defs:hdev

41 static int btbcm_set_bdaddr_from_efi(struct hci_dev *hdev)
63 ret = btbcm_set_bdaddr(hdev, &bdaddr);
67 bt_dev_info(hdev, "BCM: Using EFI device address (%pMR)", &bdaddr);
71 static int btbcm_set_bdaddr_from_efi(struct hci_dev *hdev)
77 int btbcm_check_bdaddr(struct hci_dev *hdev)
82 skb = __hci_cmd_sync(hdev, HCI_OP_READ_BD_ADDR, 0, NULL,
87 bt_dev_err(hdev, "BCM: Reading device address failed (%d)", err);
92 bt_dev_err(hdev, "BCM: Device address length mismatch");
135 if (btbcm_set_bdaddr_from_efi(hdev) != 0) {
136 bt_dev_info(hdev, "BCM: Using default device address (%pMR)",
138 set_bit(HCI_QUIRK_INVALID_BDADDR, &hdev->quirks);
148 int btbcm_set_bdaddr(struct hci_dev *hdev, const bdaddr_t *bdaddr)
153 skb = __hci_cmd_sync(hdev, 0xfc01, 6, bdaddr, HCI_INIT_TIMEOUT);
156 bt_dev_err(hdev, "BCM: Change address command failed (%d)", err);
165 int btbcm_read_pcm_int_params(struct hci_dev *hdev,
171 skb = __hci_cmd_sync(hdev, 0xfc1d, 0, NULL, HCI_INIT_TIMEOUT);
174 bt_dev_err(hdev, "BCM: Read PCM int params failed (%d)", err);
179 bt_dev_err(hdev, "BCM: Read PCM int params length mismatch");
193 int btbcm_write_pcm_int_params(struct hci_dev *hdev,
199 skb = __hci_cmd_sync(hdev, 0xfc1c, 5, params, HCI_INIT_TIMEOUT);
202 bt_dev_err(hdev, "BCM: Write PCM int params failed (%d)", err);
211 int btbcm_patchram(struct hci_dev *hdev, const struct firmware *fw)
221 skb = __hci_cmd_sync(hdev, 0xfc2e, 0, NULL, HCI_INIT_TIMEOUT);
224 bt_dev_err(hdev, "BCM: Download Minidrv command failed (%d)",
244 bt_dev_err(hdev, "BCM: Patch is corrupted");
255 skb = __hci_cmd_sync(hdev, opcode, cmd->plen, cmd_param,
259 bt_dev_err(hdev, "BCM: Patch command %04x failed (%d)",
274 static int btbcm_reset(struct hci_dev *hdev)
278 skb = __hci_cmd_sync(hdev, HCI_OP_RESET, 0, NULL, HCI_INIT_TIMEOUT);
282 bt_dev_err(hdev, "BCM: Reset failed (%d)", err);
293 static struct sk_buff *btbcm_read_local_name(struct hci_dev *hdev)
297 skb = __hci_cmd_sync(hdev, HCI_OP_READ_LOCAL_NAME, 0, NULL,
300 bt_dev_err(hdev, "BCM: Reading local name failed (%ld)",
306 bt_dev_err(hdev, "BCM: Local name length mismatch");
314 static struct sk_buff *btbcm_read_local_version(struct hci_dev *hdev)
318 skb = __hci_cmd_sync(hdev, HCI_OP_READ_LOCAL_VERSION, 0, NULL,
321 bt_dev_err(hdev, "BCM: Reading local version info failed (%ld)",
327 bt_dev_err(hdev, "BCM: Local version length mismatch");
335 static struct sk_buff *btbcm_read_verbose_config(struct hci_dev *hdev)
339 skb = __hci_cmd_sync(hdev, 0xfc79, 0, NULL, HCI_INIT_TIMEOUT);
341 bt_dev_err(hdev, "BCM: Read verbose config info failed (%ld)",
347 bt_dev_err(hdev, "BCM: Verbose config length mismatch");
355 static struct sk_buff *btbcm_read_controller_features(struct hci_dev *hdev)
359 skb = __hci_cmd_sync(hdev, 0xfc6e, 0, NULL, HCI_INIT_TIMEOUT);
361 bt_dev_err(hdev, "BCM: Read controller features failed (%ld)",
367 bt_dev_err(hdev, "BCM: Controller features length mismatch");
375 static struct sk_buff *btbcm_read_usb_product(struct hci_dev *hdev)
379 skb = __hci_cmd_sync(hdev, 0xfc5a, 0, NULL, HCI_INIT_TIMEOUT);
381 bt_dev_err(hdev, "BCM: Read USB product info failed (%ld)",
387 bt_dev_err(hdev, "BCM: USB product length mismatch");
441 static int btbcm_read_info(struct hci_dev *hdev)
446 skb = btbcm_read_verbose_config(hdev);
450 bt_dev_info(hdev, "BCM: chip id %u", skb->data[1]);
456 static int btbcm_print_controller_features(struct hci_dev *hdev)
461 skb = btbcm_read_controller_features(hdev);
465 bt_dev_info(hdev, "BCM: features 0x%2.2x", skb->data[1]);
470 set_bit(HCI_QUIRK_BROKEN_READ_TRANSMIT_POWER, &hdev->quirks);
475 static int btbcm_print_local_name(struct hci_dev *hdev)
480 skb = btbcm_read_local_name(hdev);
484 bt_dev_info(hdev, "%s", (char *)(skb->data + 1));
566 int btbcm_initialize(struct hci_dev *hdev, bool *fw_load_done, bool use_autobaud_mode)
580 board_name = btbcm_get_board_name(&hdev->dev);
583 err = btbcm_reset(hdev);
588 skb = btbcm_read_local_version(hdev);
599 err = btbcm_read_info(hdev);
605 err = btbcm_print_controller_features(hdev);
609 err = btbcm_print_local_name(hdev);
614 bcm_subver_table = (hdev->bus == HCI_USB) ? bcm_usb_subver_table :
624 bt_dev_info(hdev, "%s (%3.3u.%3.3u.%3.3u) build %4.4u",
631 if (hdev->bus == HCI_USB) {
633 skb = btbcm_read_usb_product(hdev);
669 err = firmware_request_nowarn(&fw, fw_name[i], &hdev->dev);
671 bt_dev_info(hdev, "%s '%s' Patch",
679 err = btbcm_patchram(hdev, fw);
681 bt_dev_info(hdev, "BCM: Patch failed (%d)", err);
685 bt_dev_err(hdev, "BCM: firmware Patch file not found, tried:");
687 bt_dev_err(hdev, "BCM: '%s'", fw_name[i]);
695 int btbcm_finalize(struct hci_dev *hdev, bool *fw_load_done, bool use_autobaud_mode)
701 err = btbcm_initialize(hdev, fw_load_done, use_autobaud_mode);
706 btbcm_check_bdaddr(hdev);
708 set_bit(HCI_QUIRK_STRICT_DUPLICATE_FILTER, &hdev->quirks);
714 int btbcm_setup_patchram(struct hci_dev *hdev)
721 err = btbcm_initialize(hdev, &fw_load_done, use_autobaud_mode);
726 return btbcm_finalize(hdev, &fw_load_done, use_autobaud_mode);
730 int btbcm_setup_apple(struct hci_dev *hdev)
736 err = btbcm_reset(hdev);
741 skb = btbcm_read_verbose_config(hdev);
743 bt_dev_info(hdev, "BCM: chip id %u build %4.4u",
749 skb = btbcm_read_usb_product(hdev);
751 bt_dev_info(hdev, "BCM: product %4.4x:%4.4x",
758 skb = btbcm_read_controller_features(hdev);
760 bt_dev_info(hdev, "BCM: features 0x%2.2x", skb->data[1]);
765 skb = btbcm_read_local_name(hdev);
767 bt_dev_info(hdev, "%s", (char *)(skb->data + 1));
771 set_bit(HCI_QUIRK_STRICT_DUPLICATE_FILTER, &hdev->quirks);