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

Bluetooth: btmrvl_sdio: Implement prevent_wake

Use the parent device's power/wakeup to control whether we support
remote wake. If remote wakeup is disabled, Bluetooth will not enable
scanning for incoming connections.

Signed-off-by: Abhishek Pandit-Subedi <abhishekpandit@chromium.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>

authored by

Abhishek Pandit-Subedi and committed by
Marcel Holtmann
76d4c130 70a7808b

+9
+9
drivers/bluetooth/btmrvl_main.c
··· 587 587 return 0; 588 588 } 589 589 590 + static bool btmrvl_prevent_wake(struct hci_dev *hdev) 591 + { 592 + struct btmrvl_private *priv = hci_get_drvdata(hdev); 593 + struct btmrvl_sdio_card *card = priv->btmrvl_dev.card; 594 + 595 + return !device_may_wakeup(&card->func->dev); 596 + } 597 + 590 598 /* 591 599 * This function handles the event generated by firmware, rx data 592 600 * received from firmware, and tx data sent from kernel. ··· 696 688 hdev->send = btmrvl_send_frame; 697 689 hdev->setup = btmrvl_setup; 698 690 hdev->set_bdaddr = btmrvl_set_bdaddr; 691 + hdev->prevent_wake = btmrvl_prevent_wake; 699 692 SET_HCIDEV_DEV(hdev, &card->func->dev); 700 693 701 694 hdev->dev_type = priv->btmrvl_dev.dev_type;