Skip to content

Commit 1804fdf

Browse files
tedd-anholtmann
authored andcommitted
Bluetooth: btintel: Combine setting up MSFT extension
This patch combines the setting up MSFT extension for the legacy and TLV based bootloader into the common function based on hw_variant. Signed-off-by: Tedd Ho-Jeong An <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
1 parent c86c728 commit 1804fdf

File tree

1 file changed

+29
-12
lines changed

1 file changed

+29
-12
lines changed

drivers/bluetooth/btintel.c

Lines changed: 29 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1951,18 +1951,6 @@ static int btintel_bootloader_setup(struct hci_dev *hdev,
19511951
btintel_version_info(hdev, &new_ver);
19521952

19531953
finish:
1954-
/* All Intel controllers that support the Microsoft vendor
1955-
* extension are using 0xFC1E for VsMsftOpCode.
1956-
*/
1957-
switch (ver->hw_variant) {
1958-
case 0x11: /* JfP */
1959-
case 0x12: /* ThP */
1960-
case 0x13: /* HrP */
1961-
case 0x14: /* CcP */
1962-
hci_set_msft_opcode(hdev, 0xFC1E);
1963-
break;
1964-
}
1965-
19661954
/* Set the event mask for Intel specific vendor events. This enables
19671955
* a few extra events that are useful during general operation. It
19681956
* does not enable any debugging related events.
@@ -2166,6 +2154,28 @@ static int btintel_bootloader_setup_tlv(struct hci_dev *hdev,
21662154
return 0;
21672155
}
21682156

2157+
static void btintel_set_msft_opcode(struct hci_dev *hdev, u8 hw_variant)
2158+
{
2159+
switch (hw_variant) {
2160+
/* Legacy bootloader devices that supports MSFT Extension */
2161+
case 0x11: /* JfP */
2162+
case 0x12: /* ThP */
2163+
case 0x13: /* HrP */
2164+
case 0x14: /* CcP */
2165+
/* All Intel new genration controllers support the Microsoft vendor
2166+
* extension are using 0xFC1E for VsMsftOpCode.
2167+
*/
2168+
case 0x17:
2169+
case 0x18:
2170+
case 0x19:
2171+
hci_set_msft_opcode(hdev, 0xFC1E);
2172+
break;
2173+
default:
2174+
/* Not supported */
2175+
break;
2176+
}
2177+
}
2178+
21692179
static int btintel_setup_combined(struct hci_dev *hdev)
21702180
{
21712181
const u8 param[1] = { 0xFF };
@@ -2279,6 +2289,9 @@ static int btintel_setup_combined(struct hci_dev *hdev)
22792289
set_bit(HCI_QUIRK_VALID_LE_STATES,
22802290
&hdev->quirks);
22812291

2292+
/* Setup MSFT Extension support */
2293+
btintel_set_msft_opcode(hdev, ver.hw_variant);
2294+
22822295
err = btintel_bootloader_setup(hdev, &ver);
22832296
break;
22842297
default:
@@ -2349,6 +2362,10 @@ static int btintel_setup_combined(struct hci_dev *hdev)
23492362
if (INTEL_HW_VARIANT(ver_tlv.cnvi_bt) == 0x18)
23502363
set_bit(HCI_QUIRK_VALID_LE_STATES, &hdev->quirks);
23512364

2365+
/* Setup MSFT Extension support */
2366+
btintel_set_msft_opcode(hdev,
2367+
INTEL_HW_VARIANT(ver_tlv.cnvi_bt));
2368+
23522369
err = btintel_bootloader_setup_tlv(hdev, &ver_tlv);
23532370
break;
23542371
default:

0 commit comments

Comments
 (0)