Skip to content
Permalink
Luiz-Augusto-v…
Switch branches/tags

Commits on Dec 8, 2021

  1. Bluetooth: hci_sync: Add hci_le_create_conn_sync

    This adds hci_le_create_conn_sync and make hci_le_connect use it instead
    of queueing multiple commands which may conflict with the likes of
    hci_update_passive_scan which uses hci_cmd_sync_queue.
    
    Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
    Vudentz authored and intel-lab-lkp committed Dec 8, 2021

Commits on Dec 7, 2021

  1. Bluetooth: mgmt: Make use of mgmt_send_event_skb in MGMT_EV_DEVICE_CO…

    …NNECTED
    
    This makes use of mgmt_alloc_skb to build MGMT_EV_DEVICE_CONNECTED so
    the data is copied directly to skb that is then sent using
    mgmt_send_event_skb eliminating the necessity of intermediary buffers.
    
    Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
    Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
    Vudentz authored and holtmann committed Dec 7, 2021
  2. Bluetooth: mgmt: Make use of mgmt_send_event_skb in MGMT_EV_DEVICE_FOUND

    This makes use of mgmt_alloc_skb to build MGMT_EV_DEVICE_FOUND so the
    data is copied directly to skb that is then sent using
    mgmt_send_event_skb eliminating the necessity of intermediary buffers.
    
    Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
    Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
    Vudentz authored and holtmann committed Dec 7, 2021
  3. Bluetooth: mgmt: Introduce mgmt_alloc_skb and mgmt_send_event_skb

    This introduces mgmt_alloc_skb and mgmt_send_event_skb which are
    convenient when building MGMT events that have variable length as the
    likes of skb_put_data can be used to insert portion directly on the skb
    instead of having to first build an intermediate buffer just to be
    copied over the skb.
    
    Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
    Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
    Vudentz authored and holtmann committed Dec 7, 2021
  4. Bluetooth: btusb: Return error code when getting patch status failed

    If there are failure cases in getting patch status, it should return the
    error code (-EIO).
    
    Fixes: fc342c4 ("Bluetooth: btusb: Add protocol support for MediaTek MT7921U USB devices")
    Co-developed-by: Sean Wang <sean.wang@mediatek.com>
    Signed-off-by: Sean Wang <sean.wang@mediatek.com>
    Signed-off-by: Mark Chen <mark-yw.chen@mediatek.com>
    Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
    Mark Chen authored and holtmann committed Dec 7, 2021
  5. Bluetooth: btusb: Handle download_firmware failure cases

    For Mediatek chipset, it can not enabled if there are something wrong
    in btmtk_setup_firmware_79xx(). Thus, the process must be terminated
    and returned error code.
    
    Fixes: fc342c4 ("Bluetooth: btusb: Add protocol support for MediaTek MT7921U USB devices")
    Co-developed-by: Sean Wang <sean.wang@mediatek.com>
    Signed-off-by: Sean Wang <sean.wang@mediatek.com>
    Signed-off-by: Mark Chen <mark-yw.chen@mediatek.com>
    Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
    Mark Chen authored and holtmann committed Dec 7, 2021
  6. Bluetooth: msft: Fix compilation when CONFIG_BT_MSFTEXT is not set

    This fixes compilation when CONFIG_BT_MSFTEXT is not set.
    
    Fixes: 6b3d4c8 ("Bluetooth: hci_event: Use of a function table to handle HCI events")
    Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
    Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
    Vudentz authored and holtmann committed Dec 7, 2021
  7. Bluetooth: hci_sync: Set Privacy Mode when updating the resolving list

    This adds support for Set Privacy Mode when updating the resolving list
    when HCI_CONN_FLAG_DEVICE_PRIVACY so the controller shall use Device
    Mode for devices programmed in the resolving list, Device Mode is
    actually required when the remote device are not able to use RPA as
    otherwise the default mode is Network Privacy Mode in which only
    allows RPAs thus the controller would filter out advertisement using
    identity addresses for which there is an IRK.
    
    Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
    Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
    Vudentz authored and holtmann committed Dec 7, 2021
  8. Bluetooth: Introduce HCI_CONN_FLAG_DEVICE_PRIVACY device flag

    This introduces HCI_CONN_FLAG_DEVICE_PRIVACY which can be used by
    userspace to indicate to the controller to use Device Privacy Mode to a
    specific device.
    
    Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
    Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
    Vudentz authored and holtmann committed Dec 7, 2021
  9. Bluetooth: btusb: Add support for queuing during polling interval

    This makes btusb to queue ACL and events during a polling interval
    by using of a delayed work, with the interval working as a time window
    where frames received from different endpoints are considered to be
    arrived at same time and then attempt to resolve potential conflics by
    processing the events ahead of ACL packets.
    
    It worth noting though that priorizing events over ACL data may result
    in inverting the order compared to how they appeared over the air, for
    instance there may be packets received before a disconnect event that
    will be discarded and unencrypted packets received before encryption
    change which would considered encrypted, because of these potential
    changes on the order the support for queuing during the polling
    interval is not enabled by default so it requires setting
    force_poll_sync debugfs while the adapter is down.
    
    Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
    Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
    Vudentz authored and holtmann committed Dec 7, 2021
  10. Bluetooth: hci_core: Rework hci_conn_params flags

    This reworks hci_conn_params flags to use bitmap_* helpers and add
    support for setting the supported flags in hdev->conn_flags so it can
    easily be accessed.
    
    Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
    Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
    Vudentz authored and holtmann committed Dec 7, 2021
  11. Bluetooth: MGMT: Use hci_dev_test_and_{set,clear}_flag

    This make use of hci_dev_test_and_{set,clear}_flag instead of doing 2
    operations in a row.
    
    Fixes: cbbdfa6 ("Bluetooth: Enable controller RPA resolution using Experimental feature")
    Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
    Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
    Vudentz authored and holtmann committed Dec 7, 2021
  12. Bluetooth: btbcm: disable read tx power for some Macs with the T2 Sec…

    …urity chip
    
    Some Macs with the T2 security chip had Bluetooth not working.
    To fix it we add DMI based quirks to disable querying of LE Tx power.
    
    Signed-off-by: Aditya Garg <gargaditya08@live.com>
    Reported-by: Orlando Chamberlain <redecorating@protonmail.com>
    Tested-by: Orlando Chamberlain <redecorating@protonmail.com>
    Link:
    https://lore.kernel.org/r/4970a940-211b-25d6-edab-21a815313954@protonmail.com
    Fixes: 7c395ea ("Bluetooth: Query LE tx power on startup")
    Cc: stable@vger.kernel.org
    Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
    AdityaGarg8 authored and holtmann committed Dec 7, 2021
  13. Bluetooth: add quirk disabling LE Read Transmit Power

    Some devices have a bug causing them to not work if they query
    LE tx power on startup. Thus we add a quirk in order to not query it
    and default min/max tx power values to HCI_TX_POWER_INVALID.
    
    Signed-off-by: Aditya Garg <gargaditya08@live.com>
    Reported-by: Orlando Chamberlain <redecorating@protonmail.com>
    Tested-by: Orlando Chamberlain <redecorating@protonmail.com>
    Link:
    https://lore.kernel.org/r/4970a940-211b-25d6-edab-21a815313954@protonmail.com
    Fixes: 7c395ea ("Bluetooth: Query LE tx power on startup")
    Cc: stable@vger.kernel.org
    Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
    AdityaGarg8 authored and holtmann committed Dec 7, 2021
  14. Bluetooth: btmtksdio: enable AOSP extension for MT7921

    Similar to MT7921 btusb, we enable AOSP extension for MT7921 btmtksdio
    as well.
    
    Signed-off-by: Sean Wang <sean.wang@mediatek.com>
    Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
    moore-bros authored and holtmann committed Dec 7, 2021
  15. Bluetooth: btmtksdio: enable msft opcode

    Enable msft opcode for mt7921 chip.
    
    Signed-off-by: Łukasz Bartosik <lb@semihalf.com>
    Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
    semihalf-bartosik-lukasz authored and holtmann committed Dec 7, 2021
  16. Bluetooth: btusb: Add one more Bluetooth part for WCN6855

    Add a USB ID 0489:e0e3 of HP to usb_device_id table for WCN6855.
    
    -Device(0489:e0e3) from /sys/kernel/debug/usb/devices
    T:  Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  2 Spd=12   MxCh= 0
    D:  Ver= 1.10 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs=  1
    P:  Vendor=0489 ProdID=e0e3 Rev= 0.01
    C:* #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=100mA
    I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
    E:  Ad=81(I) Atr=03(Int.) MxPS=  16 Ivl=1ms
    E:  Ad=82(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
    E:  Ad=02(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
    I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
    E:  Ad=83(I) Atr=01(Isoc) MxPS=   0 Ivl=1ms
    E:  Ad=03(O) Atr=01(Isoc) MxPS=   0 Ivl=1ms
    I:  If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
    E:  Ad=83(I) Atr=01(Isoc) MxPS=   9 Ivl=1ms
    E:  Ad=03(O) Atr=01(Isoc) MxPS=   9 Ivl=1ms
    I:  If#= 1 Alt= 2 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
    E:  Ad=83(I) Atr=01(Isoc) MxPS=  17 Ivl=1ms
    E:  Ad=03(O) Atr=01(Isoc) MxPS=  17 Ivl=1ms
    I:  If#= 1 Alt= 3 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
    E:  Ad=83(I) Atr=01(Isoc) MxPS=  25 Ivl=1ms
    E:  Ad=03(O) Atr=01(Isoc) MxPS=  25 Ivl=1ms
    I:  If#= 1 Alt= 4 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
    E:  Ad=83(I) Atr=01(Isoc) MxPS=  33 Ivl=1ms
    E:  Ad=03(O) Atr=01(Isoc) MxPS=  33 Ivl=1ms
    I:  If#= 1 Alt= 5 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
    E:  Ad=83(I) Atr=01(Isoc) MxPS=  49 Ivl=1ms
    E:  Ad=03(O) Atr=01(Isoc) MxPS=  49 Ivl=1ms
    I:  If#= 1 Alt= 6 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
    E:  Ad=83(I) Atr=01(Isoc) MxPS=  63 Ivl=1ms
    E:  Ad=03(O) Atr=01(Isoc) MxPS=  63 Ivl=1ms
    I:  If#= 1 Alt= 7 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
    E:  Ad=83(I) Atr=01(Isoc) MxPS=  65 Ivl=1ms
    E:  Ad=03(O) Atr=01(Isoc) MxPS=  65 Ivl=1ms
    
    Signed-off-by: Zijun Hu <quic_zijuhu@quicinc.com>
    Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
    zijun-hu authored and holtmann committed Dec 7, 2021
  17. Bluetooth: hci_event: Use of a function table to handle Command Status

    This change the use of switch statement to a function table which is
    easier to extend.
    
    Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
    Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
    Vudentz authored and holtmann committed Dec 7, 2021
  18. Bluetooth: hci_event: Use of a function table to handle Command Complete

    This change the use of switch statement to a function table which is
    easier to extend and can include min/max length of each command.
    
    Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
    Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
    Vudentz authored and holtmann committed Dec 7, 2021
  19. Bluetooth: hci_event: Use of a function table to handle LE subevents

    This change the use of switch statement to a function table which is
    easier to extend and can include min/max length of each subevent.
    
    Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
    Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
    Vudentz authored and holtmann committed Dec 7, 2021
  20. Bluetooth: hci_event: Use of a function table to handle HCI events

    This change the use of switch statement to a function table
    which is easier to extend and can include min/max length of each HCI
    event.
    
    Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
    Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
    Vudentz authored and holtmann committed Dec 7, 2021
  21. Bluetooth: HCI: Use skb_pull_data to parse LE Direct Advertising Repo…

    …rt event
    
    This uses skb_pull_data to check the LE Direct Advertising Report
    events received have the minimum required length.
    
    Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
    Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
    Vudentz authored and holtmann committed Dec 7, 2021
  22. Bluetooth: HCI: Use skb_pull_data to parse LE Ext Advertising Report …

    …event
    
    This uses skb_pull_data to check the LE Extended Advertising Report
    events received have the minimum required length.
    
    Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
    Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
    Vudentz authored and holtmann committed Dec 7, 2021
  23. Bluetooth: HCI: Use skb_pull_data to parse LE Advertising Report event

    This uses skb_pull_data to check the LE Advertising Report events
    received have the minimum required length.
    
    Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
    Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
    Vudentz authored and holtmann committed Dec 7, 2021
  24. Bluetooth: HCI: Use skb_pull_data to parse LE Metaevents

    This uses skb_pull_data to check the LE Metaevents received have the
    minimum required length.
    
    Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
    Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
    Vudentz authored and holtmann committed Dec 7, 2021
  25. Bluetooth: HCI: Use skb_pull_data to parse Extended Inquiry Result event

    This uses skb_pull_data to check the Extended Inquiry Result events
    received have the minimum required length.
    
    Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
    Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
    Vudentz authored and holtmann committed Dec 7, 2021
  26. Bluetooth: HCI: Use skb_pull_data to parse Inquiry Result with RSSI e…

    …vent
    
    This uses skb_pull_data to check the Inquiry Result with RSSI events
    received have the minimum required length.
    
    Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
    Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
    Vudentz authored and holtmann committed Dec 7, 2021
  27. Bluetooth: HCI: Use skb_pull_data to parse Inquiry Result event

    This uses skb_pull_data to check the Inquiry Result events received
    have the minimum required length.
    
    Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
    Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
    Vudentz authored and holtmann committed Dec 7, 2021
  28. Bluetooth: HCI: Use skb_pull_data to parse Number of Complete Packets…

    … event
    
    This uses skb_pull_data to check the Number of Complete Packets events
    received have the minimum required length.
    
    Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
    Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
    Vudentz authored and holtmann committed Dec 7, 2021
  29. Bluetooth: HCI: Use skb_pull_data to parse Command Complete event

    This uses skb_pull_data to check the Command Complete events received
    have the minimum required length.
    
    Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
    Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
    Vudentz authored and holtmann committed Dec 7, 2021
  30. Bluetooth: HCI: Use skb_pull_data to parse BR/EDR events

    This uses skb_pull_data to check the BR/EDR events received have the
    minimum required length.
    
    Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
    Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
    Vudentz authored and holtmann committed Dec 7, 2021
  31. skbuff: introduce skb_pull_data

    Like skb_pull but returns the original data pointer before pulling the
    data after performing a check against sbk->len.
    
    This allows to change code that does "struct foo *p = (void *)skb->data;"
    which is hard to audit and error prone, to:
    
            p = skb_pull_data(skb, sizeof(*p));
            if (!p)
                    return;
    
    Which is both safer and cleaner.
    
    Acked-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
    Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
    Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
    Vudentz authored and holtmann committed Dec 7, 2021

Commits on Dec 3, 2021

  1. Bluetooth: btmtksdio: fix resume failure

    btmtksdio have to rely on MMC_PM_KEEP_POWER in pm_flags to avoid that
    SDIO power is being shut off during the device is in suspend. That fixes
    the SDIO command fails to access the bus after the device is resumed.
    
    Fixes: 7f3c563 ("Bluetooth: btmtksdio: Add runtime PM support to SDIO based Bluetooth")
    Co-developed-by: Mark-yw Chen <mark-yw.chen@mediatek.com>
    Signed-off-by: Mark-yw Chen <mark-yw.chen@mediatek.com>
    Signed-off-by: Sean Wang <sean.wang@mediatek.com>
    Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
    moore-bros authored and holtmann committed Dec 3, 2021
  2. Bluetooth: btmtksdio: handle runtime pm only when sdio_func is available

    Runtime pm ops is not aware the sdio_func status that is probably
    being disabled by btmtksdio_close. Thus, we are only able to access the
    sdio_func for the runtime pm operations only when the sdio_func is
    available.
    
    Fixes: 7f3c563 ("Bluetooth: btmtksdio: Add runtime PM support to SDIO based Bluetooth")
    Co-developed-by: Mark-yw Chen <mark-yw.chen@mediatek.com>
    Signed-off-by: Mark-yw Chen <mark-yw.chen@mediatek.com>
    Signed-off-by: Sean Wang <sean.wang@mediatek.com>
    Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
    moore-bros authored and holtmann committed Dec 3, 2021
  3. Bluetooth: btusb: Cancel sync commands for certain URB errors

    Cancel sync commands when transmission of URBs fail. This is done for
    both failures to send a command URB and also when the interrupt URB used
    to retrieve a response fails.
    
    This approach is sufficient to quickly deal with certain errors such as
    a device being disconnected while synchronous commands are done during
    initialization.
    
    Signed-off-by: Benjamin Berg <bberg@redhat.com>
    Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
    Benjamin Berg authored and Vudentz committed Dec 3, 2021
Older