• Jonas Dreßler's avatar
    Bluetooth: Disconnect connected devices before rfkilling adapter · d77433cd
    Jonas Dreßler authored
    
    
    On a lot of platforms (at least the MS Surface devices, M1 macbooks, and
    a few ThinkPads) firmware doesn't do its job when rfkilling a device
    and the bluetooth adapter is not actually shut down properly on rfkill.
    This leads to connected devices remaining in connected state and the
    bluetooth connection eventually timing out after rfkilling an adapter.
    
    Use the rfkill hook in the HCI driver to go through the full power-off
    sequence (including stopping scans and disconnecting devices) before
    rfkilling it, just like MGMT_OP_SET_POWERED would do.
    
    In case anything during the larger power-off sequence fails, make sure
    the device is still closed and the rfkill ends up being effective in
    the end.
    Signed-off-by: default avatarJonas Dreßler <verdre@v0yd.nl>
    Signed-off-by: default avatarLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
    d77433cd
hci_core.c 95.5 KB