Skip to content

Commit 945a2dc

Browse files
author
CKI KWF Bot
committed
Merge: Rebase the Bluetooth driver to sync with recent upstream branch v6.16
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-10/-/merge_requests/1385 JIRA: https://issues.redhat.com/browse/RHEL-107922 Rebase the Bluetooth driver to sync with recent upstream branch v6.16. Signed-off-by: David Marlin <dmarlin@redhat.com> Approved-by: Eric Chanudet <echanude@redhat.com> Approved-by: Bastien Nocera <bnocera@redhat.com> Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com> Merged-by: CKI GitLab Kmaint Pipeline Bot <26919896-cki-kmaint-pipeline-bot@users.noreply.gitlab.com>
2 parents 2de2a2b + 03a6da9 commit 945a2dc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+1396
-671
lines changed

drivers/bluetooth/bfusb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,7 @@ static int bfusb_probe(struct usb_interface *intf, const struct usb_device_id *i
670670
hdev->flush = bfusb_flush;
671671
hdev->send = bfusb_send_frame;
672672

673-
set_bit(HCI_QUIRK_BROKEN_LOCAL_COMMANDS, &hdev->quirks);
673+
hci_set_quirk(hdev, HCI_QUIRK_BROKEN_LOCAL_COMMANDS);
674674

675675
if (hci_register_dev(hdev) < 0) {
676676
BT_ERR("Can't register HCI device");

drivers/bluetooth/bpa10x.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ static int bpa10x_probe(struct usb_interface *intf,
398398
hdev->send = bpa10x_send_frame;
399399
hdev->set_diag = bpa10x_set_diag;
400400

401-
set_bit(HCI_QUIRK_RESET_ON_CLOSE, &hdev->quirks);
401+
hci_set_quirk(hdev, HCI_QUIRK_RESET_ON_CLOSE);
402402

403403
err = hci_register_dev(hdev);
404404
if (err < 0) {

drivers/bluetooth/btbcm.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ int btbcm_check_bdaddr(struct hci_dev *hdev)
135135
if (btbcm_set_bdaddr_from_efi(hdev) != 0) {
136136
bt_dev_info(hdev, "BCM: Using default device address (%pMR)",
137137
&bda->bdaddr);
138-
set_bit(HCI_QUIRK_INVALID_BDADDR, &hdev->quirks);
138+
hci_set_quirk(hdev, HCI_QUIRK_INVALID_BDADDR);
139139
}
140140
}
141141

@@ -467,7 +467,7 @@ static int btbcm_print_controller_features(struct hci_dev *hdev)
467467

468468
/* Read DMI and disable broken Read LE Min/Max Tx Power */
469469
if (dmi_first_match(disable_broken_read_transmit_power))
470-
set_bit(HCI_QUIRK_BROKEN_READ_TRANSMIT_POWER, &hdev->quirks);
470+
hci_set_quirk(hdev, HCI_QUIRK_BROKEN_READ_TRANSMIT_POWER);
471471

472472
return 0;
473473
}
@@ -706,7 +706,7 @@ int btbcm_finalize(struct hci_dev *hdev, bool *fw_load_done, bool use_autobaud_m
706706

707707
btbcm_check_bdaddr(hdev);
708708

709-
set_bit(HCI_QUIRK_STRICT_DUPLICATE_FILTER, &hdev->quirks);
709+
hci_set_quirk(hdev, HCI_QUIRK_STRICT_DUPLICATE_FILTER);
710710

711711
return 0;
712712
}
@@ -769,7 +769,7 @@ int btbcm_setup_apple(struct hci_dev *hdev)
769769
kfree_skb(skb);
770770
}
771771

772-
set_bit(HCI_QUIRK_STRICT_DUPLICATE_FILTER, &hdev->quirks);
772+
hci_set_quirk(hdev, HCI_QUIRK_STRICT_DUPLICATE_FILTER);
773773

774774
return 0;
775775
}

drivers/bluetooth/btintel.c

Lines changed: 18 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ int btintel_check_bdaddr(struct hci_dev *hdev)
8888
if (!bacmp(&bda->bdaddr, BDADDR_INTEL)) {
8989
bt_dev_err(hdev, "Found Intel default device address (%pMR)",
9090
&bda->bdaddr);
91-
set_bit(HCI_QUIRK_INVALID_BDADDR, &hdev->quirks);
91+
hci_set_quirk(hdev, HCI_QUIRK_INVALID_BDADDR);
9292
}
9393

9494
kfree_skb(skb);
@@ -2027,7 +2027,7 @@ static int btintel_download_fw(struct hci_dev *hdev,
20272027
*/
20282028
if (!bacmp(&params->otp_bdaddr, BDADDR_ANY)) {
20292029
bt_dev_info(hdev, "No device address configured");
2030-
set_bit(HCI_QUIRK_INVALID_BDADDR, &hdev->quirks);
2030+
hci_set_quirk(hdev, HCI_QUIRK_INVALID_BDADDR);
20312031
}
20322032

20332033
download:
@@ -2295,7 +2295,7 @@ static int btintel_prepare_fw_download_tlv(struct hci_dev *hdev,
22952295
*/
22962296
if (!bacmp(&ver->otp_bd_addr, BDADDR_ANY)) {
22972297
bt_dev_info(hdev, "No device address configured");
2298-
set_bit(HCI_QUIRK_INVALID_BDADDR, &hdev->quirks);
2298+
hci_set_quirk(hdev, HCI_QUIRK_INVALID_BDADDR);
22992299
}
23002300
}
23012301

@@ -2670,7 +2670,7 @@ static u8 btintel_classify_pkt_type(struct hci_dev *hdev, struct sk_buff *skb)
26702670
* Distinguish ISO data packets form ACL data packets
26712671
* based on their connection handle value range.
26722672
*/
2673-
if (hci_skb_pkt_type(skb) == HCI_ACLDATA_PKT) {
2673+
if (iso_capable(hdev) && hci_skb_pkt_type(skb) == HCI_ACLDATA_PKT) {
26742674
__u16 handle = __le16_to_cpu(hci_acl_hdr(skb)->handle);
26752675

26762676
if (hci_handle(handle) >= BTINTEL_ISODATA_HANDLE_BASE)
@@ -2719,7 +2719,7 @@ static int btintel_uefi_get_dsbr(u32 *dsbr_var)
27192719
} __packed data;
27202720

27212721
efi_status_t status;
2722-
unsigned long data_size = 0;
2722+
unsigned long data_size = sizeof(data);
27232723
efi_guid_t guid = EFI_GUID(0xe65d8884, 0xd4af, 0x4b20, 0x8d, 0x03,
27242724
0x77, 0x2e, 0xcc, 0x3d, 0xa5, 0x31);
27252725

@@ -2729,16 +2729,10 @@ static int btintel_uefi_get_dsbr(u32 *dsbr_var)
27292729
if (!efi_rt_services_supported(EFI_RT_SUPPORTED_GET_VARIABLE))
27302730
return -EOPNOTSUPP;
27312731

2732-
status = efi.get_variable(BTINTEL_EFI_DSBR, &guid, NULL, &data_size,
2733-
NULL);
2734-
2735-
if (status != EFI_BUFFER_TOO_SMALL || !data_size)
2736-
return -EIO;
2737-
27382732
status = efi.get_variable(BTINTEL_EFI_DSBR, &guid, NULL, &data_size,
27392733
&data);
27402734

2741-
if (status != EFI_SUCCESS)
2735+
if (status != EFI_SUCCESS || data_size != sizeof(data))
27422736
return -ENXIO;
27432737

27442738
*dsbr_var = data.dsbr;
@@ -3441,9 +3435,9 @@ static int btintel_setup_combined(struct hci_dev *hdev)
34413435
}
34423436

34433437
/* Apply the common HCI quirks for Intel device */
3444-
set_bit(HCI_QUIRK_STRICT_DUPLICATE_FILTER, &hdev->quirks);
3445-
set_bit(HCI_QUIRK_SIMULTANEOUS_DISCOVERY, &hdev->quirks);
3446-
set_bit(HCI_QUIRK_NON_PERSISTENT_DIAG, &hdev->quirks);
3438+
hci_set_quirk(hdev, HCI_QUIRK_STRICT_DUPLICATE_FILTER);
3439+
hci_set_quirk(hdev, HCI_QUIRK_SIMULTANEOUS_DISCOVERY);
3440+
hci_set_quirk(hdev, HCI_QUIRK_NON_PERSISTENT_DIAG);
34473441

34483442
/* Set up the quality report callback for Intel devices */
34493443
hdev->set_quality_report = btintel_set_quality_report;
@@ -3481,8 +3475,8 @@ static int btintel_setup_combined(struct hci_dev *hdev)
34813475
*/
34823476
if (!btintel_test_flag(hdev,
34833477
INTEL_ROM_LEGACY_NO_WBS_SUPPORT))
3484-
set_bit(HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED,
3485-
&hdev->quirks);
3478+
hci_set_quirk(hdev,
3479+
HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED);
34863480

34873481
err = btintel_legacy_rom_setup(hdev, &ver);
34883482
break;
@@ -3497,11 +3491,11 @@ static int btintel_setup_combined(struct hci_dev *hdev)
34973491
*
34983492
* All Legacy bootloader devices support WBS
34993493
*/
3500-
set_bit(HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED,
3501-
&hdev->quirks);
3494+
hci_set_quirk(hdev,
3495+
HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED);
35023496

35033497
/* These variants don't seem to support LE Coded PHY */
3504-
set_bit(HCI_QUIRK_BROKEN_LE_CODED, &hdev->quirks);
3498+
hci_set_quirk(hdev, HCI_QUIRK_BROKEN_LE_CODED);
35053499

35063500
/* Setup MSFT Extension support */
35073501
btintel_set_msft_opcode(hdev, ver.hw_variant);
@@ -3577,10 +3571,10 @@ static int btintel_setup_combined(struct hci_dev *hdev)
35773571
*
35783572
* All Legacy bootloader devices support WBS
35793573
*/
3580-
set_bit(HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED, &hdev->quirks);
3574+
hci_set_quirk(hdev, HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED);
35813575

35823576
/* These variants don't seem to support LE Coded PHY */
3583-
set_bit(HCI_QUIRK_BROKEN_LE_CODED, &hdev->quirks);
3577+
hci_set_quirk(hdev, HCI_QUIRK_BROKEN_LE_CODED);
35843578

35853579
/* Setup MSFT Extension support */
35863580
btintel_set_msft_opcode(hdev, ver.hw_variant);
@@ -3606,7 +3600,7 @@ static int btintel_setup_combined(struct hci_dev *hdev)
36063600
*
36073601
* All TLV based devices support WBS
36083602
*/
3609-
set_bit(HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED, &hdev->quirks);
3603+
hci_set_quirk(hdev, HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED);
36103604

36113605
/* Setup MSFT Extension support */
36123606
btintel_set_msft_opcode(hdev,
@@ -3688,7 +3682,7 @@ int btintel_configure_setup(struct hci_dev *hdev, const char *driver_name)
36883682
}
36893683
EXPORT_SYMBOL_GPL(btintel_configure_setup);
36903684

3691-
int btintel_diagnostics(struct hci_dev *hdev, struct sk_buff *skb)
3685+
static int btintel_diagnostics(struct hci_dev *hdev, struct sk_buff *skb)
36923686
{
36933687
struct intel_tlv *tlv = (void *)&skb->data[5];
36943688

@@ -3716,7 +3710,6 @@ int btintel_diagnostics(struct hci_dev *hdev, struct sk_buff *skb)
37163710
recv_frame:
37173711
return hci_recv_frame(hdev, skb);
37183712
}
3719-
EXPORT_SYMBOL_GPL(btintel_diagnostics);
37203713

37213714
int btintel_recv_event(struct hci_dev *hdev, struct sk_buff *skb)
37223715
{

drivers/bluetooth/btintel.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,6 @@ int btintel_bootloader_setup_tlv(struct hci_dev *hdev,
277277
int btintel_shutdown_combined(struct hci_dev *hdev);
278278
void btintel_hw_error(struct hci_dev *hdev, u8 code);
279279
void btintel_print_fseq_info(struct hci_dev *hdev);
280-
int btintel_diagnostics(struct hci_dev *hdev, struct sk_buff *skb);
281280
#else
282281

283282
static inline int btintel_check_bdaddr(struct hci_dev *hdev)
@@ -411,9 +410,4 @@ static inline void btintel_hw_error(struct hci_dev *hdev, u8 code)
411410
static inline void btintel_print_fseq_info(struct hci_dev *hdev)
412411
{
413412
}
414-
415-
static inline int btintel_diagnostics(struct hci_dev *hdev, struct sk_buff *skb)
416-
{
417-
return -EOPNOTSUPP;
418-
}
419413
#endif

0 commit comments

Comments
 (0)