Lines Matching defs:hdev

37 static int btbcm_set_bdaddr_from_efi(struct hci_dev *hdev)
59 ret = btbcm_set_bdaddr(hdev, &bdaddr);
63 bt_dev_info(hdev, "BCM: Using EFI device address (%pMR)", &bdaddr);
67 static int btbcm_set_bdaddr_from_efi(struct hci_dev *hdev)
73 int btbcm_check_bdaddr(struct hci_dev *hdev)
78 skb = __hci_cmd_sync(hdev, HCI_OP_READ_BD_ADDR, 0, NULL,
83 bt_dev_err(hdev, "BCM: Reading device address failed (%d)", err);
88 bt_dev_err(hdev, "BCM: Device address length mismatch");
127 if (btbcm_set_bdaddr_from_efi(hdev) != 0) {
128 bt_dev_info(hdev, "BCM: Using default device address (%pMR)",
130 set_bit(HCI_QUIRK_INVALID_BDADDR, &hdev->quirks);
140 int btbcm_set_bdaddr(struct hci_dev *hdev, const bdaddr_t *bdaddr)
145 skb = __hci_cmd_sync(hdev, 0xfc01, 6, bdaddr, HCI_INIT_TIMEOUT);
148 bt_dev_err(hdev, "BCM: Change address command failed (%d)", err);
157 int btbcm_read_pcm_int_params(struct hci_dev *hdev,
163 skb = __hci_cmd_sync(hdev, 0xfc1d, 0, NULL, HCI_INIT_TIMEOUT);
166 bt_dev_err(hdev, "BCM: Read PCM int params failed (%d)", err);
171 bt_dev_err(hdev, "BCM: Read PCM int params length mismatch");
185 int btbcm_write_pcm_int_params(struct hci_dev *hdev,
191 skb = __hci_cmd_sync(hdev, 0xfc1c, 5, params, HCI_INIT_TIMEOUT);
194 bt_dev_err(hdev, "BCM: Write PCM int params failed (%d)", err);
203 int btbcm_patchram(struct hci_dev *hdev, const struct firmware *fw)
213 skb = __hci_cmd_sync(hdev, 0xfc2e, 0, NULL, HCI_INIT_TIMEOUT);
216 bt_dev_err(hdev, "BCM: Download Minidrv command failed (%d)",
236 bt_dev_err(hdev, "BCM: Patch is corrupted");
247 skb = __hci_cmd_sync(hdev, opcode, cmd->plen, cmd_param,
251 bt_dev_err(hdev, "BCM: Patch command %04x failed (%d)",
266 static int btbcm_reset(struct hci_dev *hdev)
270 skb = __hci_cmd_sync(hdev, HCI_OP_RESET, 0, NULL, HCI_INIT_TIMEOUT);
274 bt_dev_err(hdev, "BCM: Reset failed (%d)", err);
285 static struct sk_buff *btbcm_read_local_name(struct hci_dev *hdev)
289 skb = __hci_cmd_sync(hdev, HCI_OP_READ_LOCAL_NAME, 0, NULL,
292 bt_dev_err(hdev, "BCM: Reading local name failed (%ld)",
298 bt_dev_err(hdev, "BCM: Local name length mismatch");
306 static struct sk_buff *btbcm_read_local_version(struct hci_dev *hdev)
310 skb = __hci_cmd_sync(hdev, HCI_OP_READ_LOCAL_VERSION, 0, NULL,
313 bt_dev_err(hdev, "BCM: Reading local version info failed (%ld)",
319 bt_dev_err(hdev, "BCM: Local version length mismatch");
327 static struct sk_buff *btbcm_read_verbose_config(struct hci_dev *hdev)
331 skb = __hci_cmd_sync(hdev, 0xfc79, 0, NULL, HCI_INIT_TIMEOUT);
333 bt_dev_err(hdev, "BCM: Read verbose config info failed (%ld)",
339 bt_dev_err(hdev, "BCM: Verbose config length mismatch");
347 static struct sk_buff *btbcm_read_controller_features(struct hci_dev *hdev)
351 skb = __hci_cmd_sync(hdev, 0xfc6e, 0, NULL, HCI_INIT_TIMEOUT);
353 bt_dev_err(hdev, "BCM: Read controller features failed (%ld)",
359 bt_dev_err(hdev, "BCM: Controller features length mismatch");
367 static struct sk_buff *btbcm_read_usb_product(struct hci_dev *hdev)
371 skb = __hci_cmd_sync(hdev, 0xfc5a, 0, NULL, HCI_INIT_TIMEOUT);
373 bt_dev_err(hdev, "BCM: Read USB product info failed (%ld)",
379 bt_dev_err(hdev, "BCM: USB product length mismatch");
387 static int btbcm_read_info(struct hci_dev *hdev)
392 skb = btbcm_read_verbose_config(hdev);
396 bt_dev_info(hdev, "BCM: chip id %u", skb->data[1]);
400 skb = btbcm_read_controller_features(hdev);
404 bt_dev_info(hdev, "BCM: features 0x%2.2x", skb->data[1]);
410 static int btbcm_print_local_name(struct hci_dev *hdev)
415 skb = btbcm_read_local_name(hdev);
419 bt_dev_info(hdev, "%s", (char *)(skb->data + 1));
469 int btbcm_initialize(struct hci_dev *hdev, bool *fw_load_done)
483 err = btbcm_reset(hdev);
488 skb = btbcm_read_local_version(hdev);
499 err = btbcm_read_info(hdev);
503 err = btbcm_print_local_name(hdev);
507 bcm_subver_table = (hdev->bus == HCI_USB) ? bcm_usb_subver_table :
517 bt_dev_info(hdev, "%s (%3.3u.%3.3u.%3.3u) build %4.4u",
524 if (hdev->bus == HCI_USB) {
526 skb = btbcm_read_usb_product(hdev);
552 err = firmware_request_nowarn(&fw, fw_name[i], &hdev->dev);
554 bt_dev_info(hdev, "%s '%s' Patch",
562 err = btbcm_patchram(hdev, fw);
564 bt_dev_info(hdev, "BCM: Patch failed (%d)", err);
568 bt_dev_err(hdev, "BCM: firmware Patch file not found, tried:");
570 bt_dev_err(hdev, "BCM: '%s'", fw_name[i]);
578 int btbcm_finalize(struct hci_dev *hdev, bool *fw_load_done)
584 err = btbcm_initialize(hdev, fw_load_done);
589 btbcm_check_bdaddr(hdev);
591 set_bit(HCI_QUIRK_STRICT_DUPLICATE_FILTER, &hdev->quirks);
597 int btbcm_setup_patchram(struct hci_dev *hdev)
603 err = btbcm_initialize(hdev, &fw_load_done);
608 return btbcm_finalize(hdev, &fw_load_done);
612 int btbcm_setup_apple(struct hci_dev *hdev)
618 err = btbcm_reset(hdev);
623 skb = btbcm_read_verbose_config(hdev);
625 bt_dev_info(hdev, "BCM: chip id %u build %4.4u",
631 skb = btbcm_read_usb_product(hdev);
633 bt_dev_info(hdev, "BCM: product %4.4x:%4.4x",
640 skb = btbcm_read_controller_features(hdev);
642 bt_dev_info(hdev, "BCM: features 0x%2.2x", skb->data[1]);
647 skb = btbcm_read_local_name(hdev);
649 bt_dev_info(hdev, "%s", (char *)(skb->data + 1));
653 set_bit(HCI_QUIRK_STRICT_DUPLICATE_FILTER, &hdev->quirks);