1. 10 Aug, 2021 1 commit
    • Desmond Cheong Zhi Xi's avatar
      Bluetooth: schedule SCO timeouts with delayed_work · ba316be1
      Desmond Cheong Zhi Xi authored
      struct sock.sk_timer should be used as a sock cleanup timer. However,
      SCO uses it to implement sock timeouts.
      
      This causes issues because struct sock.sk_timer's callback is run in
      an IRQ context, and the timer callback function sco_sock_timeout takes
      a spin lock on the socket. However, other functions such as
      sco_conn_del and sco_conn_ready take the spin lock with interrupts
      enabled.
      
      This inconsistent {SOFTIRQ-ON-W} -> {IN-SOFTIRQ-W} lock usage could
      lead to deadlocks as reported by Syzbot [1]:
             CPU0
             ----
        lock(slock-AF_BLUETOOTH-BTPROTO_SCO);
        <Interrupt>
          lock(slock-AF_BLUETOOTH-BTPROTO_SCO);
      
      To fix this, we use delayed work to implement SCO sock timouts
      instead. This allows us to avoid taking the spin lock on the socket in
      an IRQ context, and corrects the misuse of struct sock.sk_timer.
      
      As a note, cancel_delayed_work is used instead of
      cancel_delayed_work_sync in sco_sock_set_timer and
      sco_sock_clear_timer to avoid a deadlock. In the future, the call to
      bh_lock_sock inside sco_sock_timeout should be changed to lock_sock to
      synchronize with other functions using lock_sock. However, since
      sco_sock_set_timer and sco_sock_clear_timer are sometimes called under
      the locked socket (in sco_connect and __sco_sock_close),
      cancel_delayed_work_sync might cause them to sleep until an
      sco_sock_timeout that has started finishes running. But
      sco_sock_timeout would also sleep until it can grab the lock_sock.
      
      Using cancel_delayed_work is fine because sco_sock_timeout does not
      change from run to run, hence there is no functional difference
      between:
      1. waiting for a timeout to finish running before scheduling another
      timeout
      2. scheduling another timeout while a timeout is running.
      
      Link: https://syzkaller.appspot.com/bug?id=9089d89de0502e120f234ca0fc8a703f7368b31e [1]
      Reported-by: syzbot+2f6d7c28bb4bf7e82060@syzkaller.appspotmail.com
      Tested-by: syzbot+2f6d7c28bb4bf7e82060@syzkaller.appspotmail.com
      Signed-off-by: default avatarDesmond Cheong Zhi Xi <desmondcheongzx@gmail.com>
      Signed-off-by: default avatarLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
      ba316be1
  2. 06 Aug, 2021 1 commit
  3. 05 Aug, 2021 13 commits
  4. 04 Aug, 2021 4 commits
    • Larry Finger's avatar
      Bluetooth: Add additional Bluetooth part for Realtek 8852AE · 6eefec4a
      Larry Finger authored
      This Realtek device has both wifi and BT components. The latter reports
      a USB ID of 04ca:4006, which is not in the table.
      
      The portion of /sys/kernel/debug/usb/devices pertaining to this device is
      
      T:  Bus=02 Lev=01 Prnt=01 Port=12 Cnt=04 Dev#=  4 Spd=12   MxCh= 0
      D:  Ver= 1.00 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs=  1
      P:  Vendor=04ca ProdID=4006 Rev= 0.00
      S:  Manufacturer=Realtek
      S:  Product=Bluetooth Radio
      S:  SerialNumber=00e04c000001
      C:* #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=500mA
      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=02(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
      E:  Ad=82(I) 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=03(O) Atr=01(Isoc) MxPS=   0 Ivl=1ms
      E:  Ad=83(I) 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=03(O) Atr=01(Isoc) MxPS=   9 Ivl=1ms
      E:  Ad=83(I) 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=03(O) Atr=01(Isoc) MxPS=  17 Ivl=1ms
      E:  Ad=83(I) 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=03(O) Atr=01(Isoc) MxPS=  25 Ivl=1ms
      E:  Ad=83(I) 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=03(O) Atr=01(Isoc) MxPS=  33 Ivl=1ms
      E:  Ad=83(I) 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=03(O) Atr=01(Isoc) MxPS=  49 Ivl=1ms
      E:  Ad=83(I) Atr=01(Isoc) MxPS=  49 Ivl=1ms
      Signed-off-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
      Cc: Stable <stable@vger.kernel.org>
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      6eefec4a
    • mark-yw.chen's avatar
      Bluetooth: btusb: Support Bluetooth Reset for Mediatek Chip(MT7921) · e9478026
      mark-yw.chen authored
      When the firmware hang or command no response, driver can reset the
      bluetooth mcu via USB to recovery it. The reset steps as follows.
      
      1. Cancel USB transfer requests before reset.
      2. It use speicific USB HW Register to reset Bluetooth MCU, at the
         same time, the USB Endpoint0 still keep alive.
      3. Poll the USB HW register until reset is completed by Endpoint0.
      4. To recovery unexpected USB state and behavior during resetting the
         Bluetooth MCU, the driver need to reset the USB device for MT7921.
      5. After the reset is completed, the Bluetooth MCU need to re-setup,
         such as download patch, power-on sequence and etc.
      Signed-off-by: default avatarmark-yw.chen <mark-yw.chen@mediatek.com>
      Reviewed-by: default avatarMichael Sun <michaelfsun@google.com>
      Reviewed-by: default avatarArchie Pusaka <apusaka@chromium.org>
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      e9478026
    • mark-yw.chen's avatar
      Bluetooth: btusb: Record debug log for Mediatek Chip. · 0b10c8c8
      mark-yw.chen authored
      Mediatek Bluetooth controller sends the FW log and FW dump via EP2.
      This patch creates an MTK specified callback(btusb_recv_acl_mtk) to
      replace the original one (hci_recv_frame) when an MTK controller is
      detected. The new callback will separate the firmware dump traffics
      from the ACL data to have them process separately.
      
      1. Add a new field (recv_acl) to the btusb_data struct to store
      vendor-specific ACL callback handler.
      2. Add the MTK-specific ACL callback handler (btusb_recv_acl_mtk) to
      process ACL data, debug log, and firmware dump.
      3. The debug log traces LMP/LL events and connection quality reports.
      4. The upper layer can use hci_channel_monitor to receive these
      packets.
      
      Example btmon: firmware debug log.
      1. Enable firmware debug log.
      < HCI Command: Vendor (0x3f|0x005d) plen 4
              00 00 02 02                                      ....
      > HCI Event: Command Complete (0x0e) plen 8
            Vendor (0x3f|0x005d) ncmd 1
              Status: Success (0x00)
              00 00 02 02                                      ....
      2. Diagnostic packet from controller
      = Vendor Diagnostic (len 500)
                ff 05 f0 01 fd ff 02 0e 08 01 5d fc 00 00 00 02
                02 aa aa aa cb e3 f0 15 b0 0c 5f 01 00 d1 0f 33
                01 7f 00 08 57 61 0c 00 00 00 00 00 23 37 17 00
                fd ff 00 00 29 60 ff ff b1 56 e8 00 57 40 0a 40
                39 95 f2 00 47 40 43 00 fc f0 16 00 57 61 0c 00
                00 00 00 00 23 37 17 00 fd ff 00 00 29 60 ff ff
                65 95 f2 00 57 40 0a 40 ec d3 fc 00 47 40 3b 00
                2c f1 17 00 57 61 0c 00 00 00 00 00 23 37 17 00
                fd ff 00 00 29 60 ff ff 19 d4 fc 00 57 40 76 1c
                b2 61 01 01 47 40 b3 04 0b 63 18 00 fe ff 02 01
                04 05 33 8b 9e 08 00 aa aa aa aa aa 27 38 01 02
                01 00 00 00 02 e0 10 00 20 00 20 00 2a 08 40 00
                20 00 20 08 2a 08 02 00 40 00 00 01 2e 08 40 00
                01 67 b0 c2 2e 08 3e 07 ff ff ff ff 40 08 01 00
                02 00 00 00 34 08 a3 00 00 00 00 00 34 08 a3 00
                00 00 00 00 35 08 45 01 00 00 00 00 2e 08 40 00
                01 67 b0 c2 30 35 01 02 00 00 00 00 2c 31 01 00
                02 00 00 40 2d 19 03 00 00 40 00 00 fd ff 02 0f
                04 00 01 01 04 aa aa aa aa aa aa aa 57 61 0c 00
                00 00 00 00 23 46 32 00 01 00 00 00 2f 35 00 02
                00 00 00 00 29 35 ff 02 00 22 00 00 2d 31 a6 02
                02 00 00 00 31 6c 40 00 14 63 18 1b 31 6c 40 00
                14 63 18 23 51 08 53 00 12 63 18 00 2c 35 12 01
                fe 00 00 00 2b 35 fe 02 02 00 00 00 2f 31 21 00
                00 00 02 00 75 61 01 00 4c 1b 93 00 79 61 01 00
                00 00 00 00 12 e3 63 18 20 31 86 01 74 61 68 03
                00 00 04 00 a1 73 ff 00 b9 01 00 00 a1 73 04 00
                00 00 00 00 a1 73 00 00 00 00 00 00 a1 73 00 00
                02 00 00 00 31 6c 40 00 16 63 18 0c 31 6c 40 00
                16 63 18 1c 77 61 40 00 48 33 40 00 14 e3 63 18
                40 31 86 01 00 d1 02 c5 07 23 a1 34 73 61 37 02
                02 00 00 a1
      Signed-off-by: default avatarmark-yw.chen <mark-yw.chen@mediatek.com>
      Reviewed-by: default avatarMichael Sun <michaelfsun@google.com>
      Reviewed-by: default avatarArchie Pusaka <apusaka@chromium.org>
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      0b10c8c8
    • Andy Shevchenko's avatar
      Bluetooth: hci_bcm: Fix kernel doc comments · 67cbdd74
      Andy Shevchenko authored
      Kernel doc validator complains about few missed parameter descriptions.
      Fill the gap by describing them.
      Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      67cbdd74
  5. 03 Aug, 2021 2 commits
  6. 02 Aug, 2021 1 commit
  7. 29 Jul, 2021 6 commits
    • Ismael Ferreras Morezuelas's avatar
      Bluetooth: btusb: Make the CSR clone chip force-suspend workaround more generic · f4292e2f
      Ismael Ferreras Morezuelas authored
      Turns out Hans de Goede completed the work I started last year trying to
      improve Chinese-clone detection of CSR controller chips. Quirk after quirk
      these Bluetooth dongles are more usable now.
      
      Even after a few BlueZ regressions; these clones are so fickle that some
      days they stop working altogether. Except on Windows, they work fine.
      
      But this force-suspend initialization quirk seems to mostly do the trick,
      after a lot of testing Bluetooth now seems to work *all* the time.
      
      The only problem is that the solution ended up being masked under a very
      stringent check; when there are probably hundreds of fake dongle
      models out there that benefit from a good reset. Make it so.
      
      Fixes: 81cac64b ("Bluetooth: Deal with USB devices that are faking CSR vendor")
      Fixes: cde1a8a9 ("Bluetooth: btusb: Fix and detect most of the Chinese Bluetooth controllers")
      Fixes: d74e0ae7 ("Bluetooth: btusb: Fix detection of some fake CSR controllers with a bcdDevice val of 0x0134")
      Fixes: 0671c066 ("Bluetooth: btusb: Add workaround for remote-wakeup issues with Barrot 8041a02 fake CSR controllers")
      
      Cc: stable@vger.kernel.org
      Cc: Hans de Goede <hdegoede@redhat.com>
      Tested-by: default avatarIsmael Ferreras Morezuelas <swyterzone@gmail.com>
      Signed-off-by: default avatarIsmael Ferreras Morezuelas <swyterzone@gmail.com>
      Reviewed-by: default avatarHans de Goede <hdegoede@redhat.com>
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      f4292e2f
    • Chethan T N's avatar
      Bluetooth: btusb: Enable MSFT extension for Intel next generation controllers · f283f476
      Chethan T N authored
      The Intel TyphoonPeak, GarfieldPeak Bluetooth controllers
      support the Microsoft vendor extension and they are using
      0xFC1E for VsMsftOpCode.
      
      Verified on a GarfieldPeak device through bluetoothctl show
      Signed-off-by: default avatarChethan T N <chethan.tumkur.narayan@intel.com>
      Signed-off-by: default avatarMichael Sun <michaelfsun@google.com>
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      f283f476
    • Michael Sun's avatar
      Bluetooth: btusb: Enable MSFT extension for WCN6855 controller · cbe6a044
      Michael Sun authored
      The Qualcomm WCN6855 Bluetooth controller supports the Microsoft vendor
      extension, enable them by setting VsMsftOpCode to 0xFD70.
      
      Verified on a WCN6855 device through bluetoothctl show
      Signed-off-by: default avatarMichael Sun <michaelfsun@google.com>
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      cbe6a044
    • Ian Mackinnon's avatar
      Bluetooth: btusb: Load Broadcom firmware for Dell device 413c:8197 · 340cd23d
      Ian Mackinnon authored
      Remove the btusb_table entry for 413c:8197 so the device is handled
      by the later Dell vendor entry, which specifies patchram loading.
      
      T:  Bus=01 Lev=02 Prnt=02 Port=03 Cnt=02 Dev#=  4 Spd=12   MxCh= 0
      D:  Ver= 2.00 Cls=ff(vend.) Sub=01 Prot=01 MxPS=64 #Cfgs=  1
      P:  Vendor=413c ProdID=8197 Rev= 1.12
      S:  Manufacturer=Dell Computer Corp
      S:  Product=DW380 Bluetooth Module
      S:  SerialNumber=74E54354F609
      C:* #Ifs= 4 Cfg#= 1 Atr=e0 MxPwr=  0mA
      I:* If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) 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=ff(vend.) 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=ff(vend.) 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=ff(vend.) 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=ff(vend.) 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=ff(vend.) 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=ff(vend.) 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#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=btusb
      E:  Ad=84(I) Atr=02(Bulk) MxPS=  32 Ivl=0ms
      E:  Ad=04(O) Atr=02(Bulk) MxPS=  32 Ivl=0ms
      I:* If#= 3 Alt= 0 #EPs= 0 Cls=fe(app. ) Sub=01 Prot=01 Driver=(none)
      Signed-off-by: default avatarIan Mackinnon <imackinnon@gmail.com>
      Tested-By: default avatarAathif Naseer <aathif394@gmail.com>
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      340cd23d
    • Len Baker's avatar
      Bluetooth: btmrvl_sdio: Remove all strcpy() uses · 785077fa
      Len Baker authored
      strcpy() performs no bounds checking on the destination buffer. This
      could result in linear overflows beyond the end of the buffer, leading
      to all kinds of misbehaviors. The safe replacement is strscpy() but in
      this case it is better to use the scnprintf to simplify the arithmetic.
      
      This is a previous step in the path to remove the strcpy() function
      entirely from the kernel.
      Signed-off-by: default avatarLen Baker <len.baker@gmx.com>
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      785077fa
    • Desmond Cheong Zhi Xi's avatar
      Bluetooth: skip invalid hci_sync_conn_complete_evt · 92fe24a7
      Desmond Cheong Zhi Xi authored
      Syzbot reported a corrupted list in kobject_add_internal [1]. This
      happens when multiple HCI_EV_SYNC_CONN_COMPLETE event packets with
      status 0 are sent for the same HCI connection. This causes us to
      register the device more than once which corrupts the kset list.
      
      As this is forbidden behavior, we add a check for whether we're
      trying to process the same HCI_EV_SYNC_CONN_COMPLETE event multiple
      times for one connection. If that's the case, the event is invalid, so
      we report an error that the device is misbehaving, and ignore the
      packet.
      
      Link: https://syzkaller.appspot.com/bug?extid=66264bf2fd0476be7e6c [1]
      Reported-by: syzbot+66264bf2fd0476be7e6c@syzkaller.appspotmail.com
      Tested-by: syzbot+66264bf2fd0476be7e6c@syzkaller.appspotmail.com
      Signed-off-by: default avatarDesmond Cheong Zhi Xi <desmondcheongzx@gmail.com>
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      92fe24a7
  8. 28 Jul, 2021 2 commits
  9. 24 Jul, 2021 1 commit
  10. 23 Jul, 2021 3 commits
  11. 22 Jul, 2021 6 commits
    • Aaron Ma's avatar
      Bluetooth: btusb: Add support for Foxconn Mediatek Chip · 64832df2
      Aaron Ma authored
      Add support for another Foxconn / Hon Hai device with MT7921 chip.
      
      T:  Bus=05 Lev=01 Prnt=01 Port=03 Cnt=02 Dev#=  3 Spd=480  MxCh= 0
      D:  Ver= 2.10 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs=  1
      P:  Vendor=0489 ProdID=e0cd Rev= 1.00
      S:  Manufacturer=MediaTek Inc.
      S:  Product=Wireless_Device
      S:  SerialNumber=000000000
      C:* #Ifs= 3 Cfg#= 1 Atr=e0 MxPwr=100mA
      A:  FirstIf#= 0 IfCount= 3 Cls=e0(wlcon) Sub=01 Prot=01
      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=125us
      E:  Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 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#= 2 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=(none)
      E:  Ad=8a(I) Atr=03(Int.) MxPS=  64 Ivl=125us
      E:  Ad=0a(O) Atr=03(Int.) MxPS=  64 Ivl=125us
      I:  If#= 2 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=(none)
      E:  Ad=8a(I) Atr=03(Int.) MxPS= 512 Ivl=125us
      E:  Ad=0a(O) Atr=03(Int.) MxPS= 512 Ivl=125us
      Signed-off-by: default avatarAaron Ma <aaron.ma@canonical.com>
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      64832df2
    • Randy Dunlap's avatar
      Bluetooth: btrsi: use non-kernel-doc comment for copyright · ee3f96ad
      Randy Dunlap authored
      kernel-doc complains about a non-kernel-doc comment that uses "/**"
      to begin the comment, so change it to just "/*".
      
      drivers/bluetooth/btrsi.c:2: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst
          * Copyright (c) 2017 Redpine Signals Inc.
      Signed-off-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Reported-by: default avatarkernel test robot <lkp@intel.com>
      Cc: Aditya Srivastava <yashsri421@gmail.com>
      Cc: Marcel Holtmann <marcel@holtmann.org>
      Cc: Johan Hedberg <johan.hedberg@gmail.com>
      Cc: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
      Cc: linux-bluetooth@vger.kernel.org
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Jakub Kicinski <kuba@kernel.org>
      Cc: netdev@vger.kernel.org
      Cc: Prameela Rani Garnepudi <prameela.j04cs@gmail.com>
      Cc: Sanjay Kumar Konduri <sanjay.konduri@redpinesignals.com>
      Cc: Siva Rebbagondla <siva.rebbagondla@redpinesignals.com>
      Cc: Kalle Valo <kvalo@codeaurora.org>
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      ee3f96ad
    • Archie Pusaka's avatar
      Bluetooth: btrtl: Set MSFT opcode for RTL8852 · 7f6a750a
      Archie Pusaka authored
      RTL8852 support MSFT HCI extension, therefore set the proper MSFT
      opcode.
      Signed-off-by: default avatarArchie Pusaka <apusaka@chromium.org>
      Reviewed-by: default avatarMiao-chen Chou <mcchou@chromium.org>
      Reviewed-by: default avatarHilda Wu <hildawu@realtek.com>
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      7f6a750a
    • Colin Ian King's avatar
      6lowpan: iphc: Fix an off-by-one check of array index · 9af41761
      Colin Ian King authored
      The bounds check of id is off-by-one and the comparison should
      be >= rather >. Currently the WARN_ON_ONCE check does not stop
      the out of range indexing of &ldev->ctx.table[id] so also add
      a return path if the bounds are out of range.
      
      Addresses-Coverity: ("Illegal address computation").
      Fixes: 5609c185 ("6lowpan: iphc: add support for stateful compression")
      Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      9af41761
    • Forest Crossman's avatar
      Bluetooth: btusb: Add support for LG LGSBWAC92/TWCM-K505D · 37356827
      Forest Crossman authored
      The LG LGSBWAC92/TWCM-K505D/EAT64454801/EAT64454802 (it goes by many
      names) is a combo WiFi/Bluetooth module that's used in several models of
      LG TVs. It uses the MediaTek MT7668AUN, which is already supported in
      btusb, but this device has a non-MediaTek VID:PID pair so to get it to
      work we just need to add it to the list of devices to probe.
      
      Device from /sys/kernel/debug/usb/devices:
      
      T:  Bus=09 Lev=02 Prnt=02 Port=00 Cnt=01 Dev#=  6 Spd=480  MxCh= 0
      D:  Ver= 2.10 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs=  1
      P:  Vendor=043e ProdID=3109 Rev= 1.00
      S:  Manufacturer=MediaTek Inc.
      S:  Product=Wireless_Device
      S:  SerialNumber=000000000
      C:* #Ifs= 3 Cfg#= 1 Atr=a0 MxPwr=100mA
      A:  FirstIf#= 0 IfCount= 2 Cls=e0(wlcon) Sub=01 Prot=01
      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=125us
      E:  Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 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#= 2 Alt= 0 #EPs= 8 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)
      E:  Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=85(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=08(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=06(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=07(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=09(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      Signed-off-by: default avatarForest Crossman <cyrozap@gmail.com>
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      37356827
    • Jun Miao's avatar
      Bluetooth: btusb: Fix a unspported condition to set available debug features · 20a831f0
      Jun Miao authored
      When reading the support debug features failed, there are not available
      features init. Continue to set the debug features is illogical, we should
      skip btintel_set_debug_features(), even if check it by "if (!features)".
      
      Fixes: c453b10c ("Bluetooth: btusb: Configure Intel debug feature based on available support")
      Signed-off-by: default avatarJun Miao <jun.miao@windriver.com>
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      20a831f0