Lines Matching +full:patch +full:- +full:address
1 // SPDX-License-Identifier: GPL-2.0-or-later
37 /* For kmalloc-ing the fw-name array instead of putting it on the stack */
51 return -EOPNOTSUPP; in btbcm_set_bdaddr_from_efi()
56 return -ENXIO; in btbcm_set_bdaddr_from_efi()
59 return -EIO; in btbcm_set_bdaddr_from_efi()
67 bt_dev_info(hdev, "BCM: Using EFI device address (%pMR)", &bdaddr); in btbcm_set_bdaddr_from_efi()
73 return -EOPNOTSUPP; in btbcm_set_bdaddr_from_efi()
87 bt_dev_err(hdev, "BCM: Reading device address failed (%d)", err); in btbcm_check_bdaddr()
91 if (skb->len != sizeof(*bda)) { in btbcm_check_bdaddr()
92 bt_dev_err(hdev, "BCM: Device address length mismatch"); in btbcm_check_bdaddr()
94 return -EIO; in btbcm_check_bdaddr()
97 bda = (struct hci_rp_read_bd_addr *)skb->data; in btbcm_check_bdaddr()
99 /* Check if the address indicates a controller with either an in btbcm_check_bdaddr()
100 * invalid or default address. In both cases the device needs in btbcm_check_bdaddr()
101 * to be marked as not having a valid address. in btbcm_check_bdaddr()
103 * The address 00:20:70:02:A0:00 indicates a BCM20702A0 controller in btbcm_check_bdaddr()
104 * with no configured address. in btbcm_check_bdaddr()
106 * The address 20:70:02:A0:00:00 indicates a BCM20702A1 controller in btbcm_check_bdaddr()
107 * with no configured address. in btbcm_check_bdaddr()
109 * The address 20:76:A0:00:56:79 indicates a BCM2076B1 controller in btbcm_check_bdaddr()
110 * with no configured address. in btbcm_check_bdaddr()
112 * The address 43:24:B3:00:00:00 indicates a BCM4324B3 controller in btbcm_check_bdaddr()
115 * The address 43:30:B1:00:00:00 indicates a BCM4330B1 controller in btbcm_check_bdaddr()
118 * The address 43:43:A0:12:1F:AC indicates a BCM43430A0 controller in btbcm_check_bdaddr()
119 * with no configured address. in btbcm_check_bdaddr()
121 * The address AA:AA:AA:AA:AA:AA indicates a BCM43430A1 controller in btbcm_check_bdaddr()
122 * with no configured address. in btbcm_check_bdaddr()
124 if (!bacmp(&bda->bdaddr, BDADDR_BCM20702A0) || in btbcm_check_bdaddr()
125 !bacmp(&bda->bdaddr, BDADDR_BCM20702A1) || in btbcm_check_bdaddr()
126 !bacmp(&bda->bdaddr, BDADDR_BCM2076B1) || in btbcm_check_bdaddr()
127 !bacmp(&bda->bdaddr, BDADDR_BCM4324B3) || in btbcm_check_bdaddr()
128 !bacmp(&bda->bdaddr, BDADDR_BCM4330B1) || in btbcm_check_bdaddr()
129 !bacmp(&bda->bdaddr, BDADDR_BCM4334B0) || in btbcm_check_bdaddr()
130 !bacmp(&bda->bdaddr, BDADDR_BCM4345C5) || in btbcm_check_bdaddr()
131 !bacmp(&bda->bdaddr, BDADDR_BCM43430A0) || in btbcm_check_bdaddr()
132 !bacmp(&bda->bdaddr, BDADDR_BCM43430A1) || in btbcm_check_bdaddr()
133 !bacmp(&bda->bdaddr, BDADDR_BCM43341B)) { in btbcm_check_bdaddr()
136 bt_dev_info(hdev, "BCM: Using default device address (%pMR)", in btbcm_check_bdaddr()
137 &bda->bdaddr); in btbcm_check_bdaddr()
138 set_bit(HCI_QUIRK_INVALID_BDADDR, &hdev->quirks); in btbcm_check_bdaddr()
156 bt_dev_err(hdev, "BCM: Change address command failed (%d)", err); in btbcm_set_bdaddr()
178 if (skb->len != 6 || skb->data[0]) { in btbcm_read_pcm_int_params()
181 return -EIO; in btbcm_read_pcm_int_params()
185 memcpy(params, skb->data + 1, 5); in btbcm_read_pcm_int_params()
233 fw_ptr = fw->data; in btbcm_patchram()
234 fw_size = fw->size; in btbcm_patchram()
241 fw_size -= sizeof(*cmd); in btbcm_patchram()
243 if (fw_size < cmd->plen) { in btbcm_patchram()
244 bt_dev_err(hdev, "BCM: Patch is corrupted"); in btbcm_patchram()
245 err = -EINVAL; in btbcm_patchram()
250 fw_ptr += cmd->plen; in btbcm_patchram()
251 fw_size -= cmd->plen; in btbcm_patchram()
253 opcode = le16_to_cpu(cmd->opcode); in btbcm_patchram()
255 skb = __hci_cmd_sync(hdev, opcode, cmd->plen, cmd_param, in btbcm_patchram()
259 bt_dev_err(hdev, "BCM: Patch command %04x failed (%d)", in btbcm_patchram()
305 if (skb->len != sizeof(struct hci_rp_read_local_name)) { in btbcm_read_local_name()
308 return ERR_PTR(-EIO); in btbcm_read_local_name()
326 if (skb->len != sizeof(struct hci_rp_read_local_version)) { in btbcm_read_local_version()
329 return ERR_PTR(-EIO); in btbcm_read_local_version()
346 if (skb->len != 7) { in btbcm_read_verbose_config()
349 return ERR_PTR(-EIO); in btbcm_read_verbose_config()
366 if (skb->len != 9) { in btbcm_read_controller_features()
369 return ERR_PTR(-EIO); in btbcm_read_controller_features()
386 if (skb->len != 5) { in btbcm_read_usb_product()
389 return ERR_PTR(-EIO); in btbcm_read_usb_product()
450 bt_dev_info(hdev, "BCM: chip id %u", skb->data[1]); in btbcm_read_info()
465 bt_dev_info(hdev, "BCM: features 0x%2.2x", skb->data[1]); in btbcm_print_controller_features()
470 set_bit(HCI_QUIRK_BROKEN_READ_TRANSMIT_POWER, &hdev->quirks); in btbcm_print_controller_features()
484 bt_dev_info(hdev, "%s", (char *)(skb->data + 1)); in btbcm_print_local_name()
557 strreplace(board_type, '/', '-'); in btbcm_get_board_name()
580 board_name = btbcm_get_board_name(&hdev->dev); in btbcm_initialize()
592 ver = (struct hci_rp_read_local_version *)skb->data; in btbcm_initialize()
593 rev = le16_to_cpu(ver->hci_rev); in btbcm_initialize()
594 subver = le16_to_cpu(ver->lmp_subver); in btbcm_initialize()
614 bcm_subver_table = (hdev->bus == HCI_USB) ? bcm_usb_subver_table : in btbcm_initialize()
631 if (hdev->bus == HCI_USB) { in btbcm_initialize()
637 vid = get_unaligned_le16(skb->data + 1); in btbcm_initialize()
638 pid = get_unaligned_le16(skb->data + 3); in btbcm_initialize()
641 snprintf(postfix, sizeof(postfix), "-%4.4x-%4.4x", vid, pid); in btbcm_initialize()
646 return -ENOMEM; in btbcm_initialize()
669 err = firmware_request_nowarn(&fw, fw_name[i], &hdev->dev); in btbcm_initialize()
671 bt_dev_info(hdev, "%s '%s' Patch", in btbcm_initialize()
681 bt_dev_info(hdev, "BCM: Patch failed (%d)", err); in btbcm_initialize()
685 bt_dev_err(hdev, "BCM: firmware Patch file not found, tried:"); in btbcm_initialize()
699 /* Re-initialize if necessary */ in btbcm_finalize()
708 set_bit(HCI_QUIRK_STRICT_DUPLICATE_FILTER, &hdev->quirks); in btbcm_finalize()
725 /* Re-initialize after loading Patch */ in btbcm_setup_patchram()
744 skb->data[1], get_unaligned_le16(skb->data + 5)); in btbcm_setup_apple()
752 get_unaligned_le16(skb->data + 1), in btbcm_setup_apple()
753 get_unaligned_le16(skb->data + 3)); in btbcm_setup_apple()
760 bt_dev_info(hdev, "BCM: features 0x%2.2x", skb->data[1]); in btbcm_setup_apple()
767 bt_dev_info(hdev, "%s", (char *)(skb->data + 1)); in btbcm_setup_apple()
771 set_bit(HCI_QUIRK_STRICT_DUPLICATE_FILTER, &hdev->quirks); in btbcm_setup_apple()