Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Bluetooth: btintel: Define a macro for Intel Reset vendor command

Use macro for Intel Reset command (0xfc01) instead of hard coded value.

Signed-off-by: Kiran K <kiran.k@intel.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

authored by

Kiran K and committed by
Luiz Augusto von Dentz
15843c7f 0e492dba

+19 -17
+2 -2
drivers/bluetooth/btintel.c
··· 889 889 890 890 params.boot_param = cpu_to_le32(boot_param); 891 891 892 - skb = __hci_cmd_sync(hdev, 0xfc01, sizeof(params), &params, 892 + skb = __hci_cmd_sync(hdev, BTINTEL_HCI_OP_RESET, sizeof(params), &params, 893 893 HCI_INIT_TIMEOUT); 894 894 if (IS_ERR(skb)) { 895 895 bt_dev_err(hdev, "Failed to send Intel Reset command"); ··· 1287 1287 params.boot_option = 0x00; 1288 1288 params.boot_param = cpu_to_le32(0x00000000); 1289 1289 1290 - skb = __hci_cmd_sync(hdev, 0xfc01, sizeof(params), 1290 + skb = __hci_cmd_sync(hdev, BTINTEL_HCI_OP_RESET, sizeof(params), 1291 1291 &params, HCI_INIT_TIMEOUT); 1292 1292 if (IS_ERR(skb)) { 1293 1293 bt_dev_err(hdev, "FW download error recovery failed (%ld)",
+2
drivers/bluetooth/btintel.h
··· 52 52 u8 val[]; 53 53 } __packed; 54 54 55 + #define BTINTEL_HCI_OP_RESET 0xfc01 56 + 55 57 #define BTINTEL_CNVI_BLAZARI 0x900 56 58 #define BTINTEL_CNVI_BLAZARIW 0x901 57 59 #define BTINTEL_CNVI_GAP 0x910
+6 -6
drivers/bluetooth/btintel_pcie.c
··· 1977 1977 struct hci_command_hdr *cmd = (void *)skb->data; 1978 1978 __u16 opcode = le16_to_cpu(cmd->opcode); 1979 1979 1980 - /* When the 0xfc01 command is issued to boot into 1981 - * the operational firmware, it will actually not 1982 - * send a command complete event. To keep the flow 1980 + /* When the BTINTEL_HCI_OP_RESET command is issued to 1981 + * boot into the operational firmware, it will actually 1982 + * not send a command complete event. To keep the flow 1983 1983 * control working inject that event here. 1984 1984 */ 1985 - if (opcode == 0xfc01) 1985 + if (opcode == BTINTEL_HCI_OP_RESET) 1986 1986 btintel_pcie_inject_cmd_complete(hdev, opcode); 1987 1987 } 1988 1988 /* Firmware raises alive interrupt on HCI_OP_RESET */ ··· 2017 2017 } 2018 2018 2019 2019 if (type == BTINTEL_PCIE_HCI_CMD_PKT && 2020 - (opcode == HCI_OP_RESET || opcode == 0xfc01)) { 2020 + (opcode == HCI_OP_RESET || opcode == BTINTEL_HCI_OP_RESET)) { 2021 2021 old_ctxt = data->alive_intr_ctxt; 2022 2022 data->alive_intr_ctxt = 2023 - (opcode == 0xfc01 ? BTINTEL_PCIE_INTEL_HCI_RESET1 : 2023 + (opcode == BTINTEL_HCI_OP_RESET ? BTINTEL_PCIE_INTEL_HCI_RESET1 : 2024 2024 BTINTEL_PCIE_HCI_RESET); 2025 2025 bt_dev_dbg(data->hdev, "sent cmd: 0x%4.4x alive context changed: %s -> %s", 2026 2026 opcode, btintel_pcie_alivectxt_state2str(old_ctxt),
+4 -4
drivers/bluetooth/btusb.c
··· 2605 2605 else 2606 2606 urb = alloc_ctrl_urb(hdev, skb); 2607 2607 2608 - /* When the 0xfc01 command is issued to boot into 2609 - * the operational firmware, it will actually not 2610 - * send a command complete event. To keep the flow 2608 + /* When the BTINTEL_HCI_OP_RESET command is issued to 2609 + * boot into the operational firmware, it will actually 2610 + * not send a command complete event. To keep the flow 2611 2611 * control working inject that event here. 2612 2612 */ 2613 - if (opcode == 0xfc01) 2613 + if (opcode == BTINTEL_HCI_OP_RESET) 2614 2614 inject_cmd_complete(hdev, opcode); 2615 2615 } else { 2616 2616 urb = alloc_ctrl_urb(hdev, skb);
+5 -5
drivers/bluetooth/hci_intel.c
··· 1029 1029 struct hci_command_hdr *cmd = (void *)skb->data; 1030 1030 __u16 opcode = le16_to_cpu(cmd->opcode); 1031 1031 1032 - /* When the 0xfc01 command is issued to boot into 1033 - * the operational firmware, it will actually not 1034 - * send a command complete event. To keep the flow 1035 - * control working inject that event here. 1032 + /* When the BTINTEL_HCI_OP_RESET command is issued to boot into 1033 + * the operational firmware, it will actually not send a command 1034 + * complete event. To keep the flow control working inject that 1035 + * event here. 1036 1036 */ 1037 - if (opcode == 0xfc01) 1037 + if (opcode == BTINTEL_HCI_OP_RESET) 1038 1038 inject_cmd_complete(hu->hdev, opcode); 1039 1039 } 1040 1040