1. 11 Aug, 2023 40 commits
    • Luiz Augusto von Dentz's avatar
      Bluetooth: hci_sync: Introduce PTR_UINT/UINT_PTR macros · a1f6c3ae
      Luiz Augusto von Dentz authored
      This introduces PTR_UINT/UINT_PTR macros and replace the use of
      PTR_ERR/ERR_PTR.
      Signed-off-by: default avatarLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
      a1f6c3ae
    • Luiz Augusto von Dentz's avatar
      Bluetooth: hci_conn: Fix hci_le_set_cig_params · a0912892
      Luiz Augusto von Dentz authored
      When running with concurrent task only one CIS was being assigned so
      this attempts to rework the way the PDU is constructed so it is handled
      later at the callback instead of in place.
      
      Fixes: 26afbd82 ("Bluetooth: Add initial implementation of CIS connections")
      Signed-off-by: default avatarLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
      a0912892
    • Luiz Augusto von Dentz's avatar
      Bluetooth: hci_core: Make hci_is_le_conn_scanning public · f8867016
      Luiz Augusto von Dentz authored
      This moves hci_is_le_conn_scanning to hci_core.h so it can be used by
      different files without having to duplicate its code.
      Signed-off-by: default avatarLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
      f8867016
    • Luiz Augusto von Dentz's avatar
      Bluetooth: hci_conn: Fix not allowing valid CIS ID · f2f84a70
      Luiz Augusto von Dentz authored
      Only the number of CIS shall be limited to 0x1f, the CIS ID in the
      other hand is up to 0xef.
      
      Fixes: 26afbd82 ("Bluetooth: Add initial implementation of CIS connections")
      Signed-off-by: default avatarLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
      f2f84a70
    • Luiz Augusto von Dentz's avatar
      Bluetooth: hci_conn: Fix modifying handle while aborting · 16e3b642
      Luiz Augusto von Dentz authored
      This introduces hci_conn_set_handle which takes care of verifying the
      conditions where the hci_conn handle can be modified, including when
      hci_conn_abort has been called and also checks that the handles is
      valid as well.
      Signed-off-by: default avatarLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
      16e3b642
    • Luiz Augusto von Dentz's avatar
      Bluetooth: ISO: Fix not checking for valid CIG/CIS IDs · b7f923b1
      Luiz Augusto von Dentz authored
      Valid range of CIG/CIS are 0x00 to 0xEF, so this checks they are
      properly checked before attempting to use HCI_OP_LE_SET_CIG_PARAMS.
      
      Fixes: ccf74f23 ("Bluetooth: Add BTPROTO_ISO socket type")
      Signed-off-by: default avatarLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
      b7f923b1
    • Luiz Augusto von Dentz's avatar
      Bluetooth: hci_sync: Fix UAF on hci_abort_conn_sync · 5af1f84e
      Luiz Augusto von Dentz authored
      Connections may be cleanup while waiting for the commands to complete so
      this attempts to check if the connection handle remains valid in case of
      errors that would lead to call hci_conn_failed:
      
      BUG: KASAN: slab-use-after-free in hci_conn_failed+0x1f/0x160
      Read of size 8 at addr ffff888001376958 by task kworker/u3:0/52
      
      CPU: 0 PID: 52 Comm: kworker/u3:0 Not tainted
      6.5.0-rc1-00527-g2dfe76d58d3a #5615
      Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS
      1.16.2-1.fc38 04/01/2014
      Workqueue: hci0 hci_cmd_sync_work
      Call Trace:
       <TASK>
       dump_stack_lvl+0x1d/0x70
       print_report+0xce/0x620
       ? __virt_addr_valid+0xd4/0x150
       ? hci_conn_failed+0x1f/0x160
       kasan_report+0xd1/0x100
       ? hci_conn_failed+0x1f/0x160
       hci_conn_failed+0x1f/0x160
       hci_abort_conn_sync+0x237/0x360
      Signed-off-by: default avatarLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
      5af1f84e
    • Luiz Augusto von Dentz's avatar
      Bluetooth: hci_sync: Fix handling of HCI_OP_CREATE_CONN_CANCEL · 094e3639
      Luiz Augusto von Dentz authored
      When sending HCI_OP_CREATE_CONN_CANCEL it shall Wait for
      HCI_EV_CONN_COMPLETE, not HCI_EV_CMD_STATUS, when the reason is
      anything but HCI_ERROR_REMOTE_POWER_OFF. This reason is used when
      suspending or powering off, where we don't want to wait for the peer's
      response.
      Signed-off-by: default avatarLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
      094e3639
    • Pauli Virtanen's avatar
      Bluetooth: hci_sync: delete CIS in BT_OPEN/CONNECT/BOUND when aborting · 2889bdd0
      Pauli Virtanen authored
      Dropped CIS that are in state BT_OPEN/BT_BOUND, and in state BT_CONNECT
      with HCI_CONN_CREATE_CIS unset, should be cleaned up immediately.
      Closing CIS ISO sockets should result to the hci_conn be deleted, so
      that potentially pending CIG removal can run.
      
      hci_abort_conn cannot refer to them by handle, since their handle is
      still unset if Set CIG Parameters has not yet completed.
      
      This fixes CIS not being terminated if the socket is shut down
      immediately after connection, so that the hci_abort_conn runs before Set
      CIG Parameters completes. See new BlueZ test "ISO Connect Close - Success"
      Signed-off-by: default avatarPauli Virtanen <pav@iki.fi>
      Signed-off-by: default avatarLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
      2889bdd0
    • Pauli Virtanen's avatar
      Bluetooth: ISO: handle bound CIS cleanup via hci_conn · 69997d50
      Pauli Virtanen authored
      Calling hci_conn_del in __iso_sock_close is invalid. It needs
      hdev->lock, but it cannot be acquired there due to lock ordering.
      
      Fix this by doing cleanup via hci_conn_drop.
      
      Return hci_conn with refcount 1 from hci_bind_cis and hci_connect_cis,
      so that the iso_conn always holds one reference.  This also fixes
      refcounting when error handling.
      
      Since hci_conn_abort shall handle termination of connections in any
      state properly, we can handle BT_CONNECT socket state in the same way as
      BT_CONNECTED.
      Signed-off-by: default avatarPauli Virtanen <pav@iki.fi>
      Signed-off-by: default avatarLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
      69997d50
    • Yue Haibing's avatar
      Bluetooth: Remove unused declaration amp_read_loc_info() · 90005880
      Yue Haibing authored
      This is introduced in commit 903e4541 but was never implemented.
      
      Fixes: 903e4541 ("Bluetooth: AMP: Use HCI cmd to Read Loc AMP Assoc")
      Signed-off-by: default avatarYue Haibing <yuehaibing@huawei.com>
      Signed-off-by: default avatarLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
      90005880
    • Luiz Augusto von Dentz's avatar
      Bluetooth: btusb: Move btusb_recv_event_intel to btintel · 123c2631
      Luiz Augusto von Dentz authored
      btusb_recv_event_intel is specific to Intel controllers therefore it
      shall be placed inside btintel.c so btusb don't have a mix of vendor
      specific code with the generic parts.
      Signed-off-by: default avatarLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
      123c2631
    • Luca Weiss's avatar
      Bluetooth: btqca: Add WCN3988 support · f904feef
      Luca Weiss authored
      Add support for the Bluetooth chip codenamed APACHE which is part of
      WCN3988.
      
      The firmware for this chip has a slightly different naming scheme
      compared to most others. For ROM Version 0x0200 we need to use
      apbtfw10.tlv + apnv10.bin and for ROM version 0x201 apbtfw11.tlv +
      apnv11.bin
      Signed-off-by: default avatarLuca Weiss <luca.weiss@fairphone.com>
      Signed-off-by: default avatarLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
      f904feef
    • Luca Weiss's avatar
      dt-bindings: net: qualcomm: Add WCN3988 · 606a8bff
      Luca Weiss authored
      Add the compatible for the Bluetooth part of the Qualcomm WCN3988
      chipset.
      Acked-by: default avatarKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
      Signed-off-by: default avatarLuca Weiss <luca.weiss@fairphone.com>
      Signed-off-by: default avatarLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
      606a8bff
    • Neeraj Sanjay Kale's avatar
      Bluetooth: btnxpuart: Add support for AW693 chipset · c55c8a7c
      Neeraj Sanjay Kale authored
      This adds support for NXP AW693 chipset in btnxpuart driver
      by adding FW name and bootloader signature. Based on the
      loader version bits 7:6 of the bootloader signature, the
      driver can choose between selecting secure and non-secure
      FW files.
      Signed-off-by: default avatarNeeraj Sanjay Kale <neeraj.sanjaykale@nxp.com>
      Signed-off-by: default avatarLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
      c55c8a7c
    • Yuanjun Gong's avatar
      Bluetooth: nokia: fix value check in nokia_bluetooth_serdev_probe() · e8b5aed3
      Yuanjun Gong authored
      in nokia_bluetooth_serdev_probe(), check the return value of
      clk_prepare_enable() and return the error code if
      clk_prepare_enable() returns an unexpected value.
      
      Fixes: 7bb31868 ("Bluetooth: add nokia driver")
      Signed-off-by: default avatarYuanjun Gong <ruc_gongyuanjun@163.com>
      Signed-off-by: default avatarLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
      e8b5aed3
    • Rob Herring's avatar
      bluetooth: Explicitly include correct DT includes · e15f44fb
      Rob Herring authored
      The DT of_device.h and of_platform.h date back to the separate
      of_platform_bus_type before it as merged into the regular platform bus.
      As part of that merge prepping Arm DT support 13 years ago, they
      "temporarily" include each other. They also include platform_device.h
      and of.h. As a result, there's a pretty much random mix of those include
      files used throughout the tree. In order to detangle these headers and
      replace the implicit includes with struct declarations, users need to
      explicitly include the correct includes.
      Signed-off-by: default avatarRob Herring <robh@kernel.org>
      Signed-off-by: default avatarLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
      e15f44fb
    • Mans Rullgard's avatar
      Bluetooth: btbcm: add default address for BCM43430A1 · 47e90f6b
      Mans Rullgard authored
      The BCM43430A1 has a default MAC address of AA:AA:AA:AA:AA:AA.
      Although, unlike some other entries, this does not include the
      chip name, it is clearly not a real address. This was found in
      AzureWave AW-NB197SM and AW-NM372SM modules.
      Signed-off-by: default avatarMans Rullgard <mans@mansr.com>
      Signed-off-by: default avatarLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
      47e90f6b
    • Luiz Augusto von Dentz's avatar
      Bluetooth: ISO: Add support for BT_PKT_STATUS · 0731c5ab
      Luiz Augusto von Dentz authored
      This adds support for BT_PKT_STATUS socketopt by setting
      BT_SK_PKT_STATUS. Then upon receiving an ISO packet the code would
      attempt to store the Packet_Status_Flag to hci_skb_pkt_status which
      is then forward to userspace in the form of BT_SCM_PKT_STATUS whenever
      BT_PKT_STATUS has been enabled/set.
      Signed-off-by: default avatarLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
      0731c5ab
    • Luiz Augusto von Dentz's avatar
      Bluetooth: af_bluetooth: Make BT_PKT_STATUS generic · 3f19ffb2
      Luiz Augusto von Dentz authored
      This makes the handling of BT_PKT_STATUS more generic so it can be
      reused by sockets other than SCO like BT_DEFER_SETUP, etc.
      Signed-off-by: default avatarLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
      3f19ffb2
    • Chris Lu's avatar
      Bluetooth: btmtk: Fix kernel crash when processing coredump · 0e72e3b1
      Chris Lu authored
      There may be a potential kernel crash risk if 'skb->len
      - MTK_COREDUMP_END_LEN' value is less than 0 when doing
      memcmp in btmtk_process_coredump().
      Check the value is valid before doing memcmp.
      
      [215.021695] Unable to handle kernel paging request at
                   virtual address ffffff939fffd3c5
      [215.021781] Mem abort info:
      [215.021805]   ESR = 0x96000005
      [215.021833]   EC = 0x25: DABT (current EL), IL = 32 bits
      [215.021861]   SET = 0, FnV = 0
      [215.021875]   EA = 0, S1PTW = 0
      [215.021886] Data abort info:
      [215.021899]   ISV = 0, ISS = 0x00000005
      [215.021912]   CM = 0, WnR = 0
      [215.021929] swapper pgtable: 4k pages, 39-bit VAs,
                   pgdp=00000000410de000
      [215.021943] [ffffff939fffd3c5] pgd=0000000000000000,
                   p4d=0000000000000000, pud=0000000000000000
      [215.021979] Internal error: Oops: 96000005 [#1] PREEMPT SMP
      [215.022496] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.10.186#3
                   (HASH:ad23 4)
      [215.022511] Hardware name: MediaTek Tomato board (DT)
      [215.022530] pstate: 80400009 (Nzcv daif +PAN -UAO -TCO BTYPE=--)
      [215.022556] pc : __pi_memcmp+0xd0/0x1b8
      [215.022579] lr : btmtk_process_coredump+0xb0/0x5f8 [btmtk]
      [215.022593] sp : ffffffc010003d40
      [215.022607] x29: ffffffc010003d40 x28: 0000000000000006
      [215.022633] x27: ffffffda696350c0 x26: 0000000000000002
      [215.022659] x25: 00000000000003ff x24: ffffff9360cca804
      [215.022685] x23: 0000000000000000 x22: ffffff9365638500
      [215.022710] x21: ffffff9365638700 x20: 0000000000000000
      [215.022736] x19: ffffff936002e000 x18: 0000000000000000
      [215.022761] x17: 0000000000000180 x16: ffffffda6881b8b4
      [215.022787] x15: 0000000000000001 x14: 0000000000002d00
      [215.022812] x13: 0000000000060000 x12: 0000000000000181
      [215.022837] x11: 0000000000000006 x10: fffffffffffffffd
      [215.022862] x9 : 0000000000000006 x8 : 0000000000000003
      [215.022887] x7 : 0000000000000000 x6 : 0000000000000000
      [215.022913] x5 : ffffff93656387b8 x4 : 0000000000000000
      [215.022938] x3 : ffffffc010003c18 x2 : 0000000000000006
      [215.022963] x1 : ffffffda09d4124a x0 : ffffff939fffd3c5
      [215.022989] Call trace:
      [215.023012]  __pi_memcmp+0xd0/0x1b8
      [215.023053]  btusb_recv_acl_mtk+0x64/0x90 [btusb (HASH:dc6b 5)]
      [215.023087]  btusb_recv_bulk+0x118/0x170 [btusb (HASH:dc6b 5)]
      [215.023121]  btusb_bulk_complete+0x8c/0x148 [btusb (HASH:dc6b 5)]
      [215.023144]  __usb_hcd_giveback_urb+0xbc/0x148
      [215.023164]  usb_giveback_urb_bh+0xb4/0x190
      [215.023184]  tasklet_action_common+0x98/0x1a0
      [215.023201]  tasklet_action+0x2c/0x38
      [215.023220]  __do_softirq+0xe0/0x38c
      [215.023241]  invoke_softirq+0x34/0x6c
      [215.023258]  irq_exit+0x6c/0xb0
      [215.023279]  __handle_domain_irq+0x98/0xd4
      [215.023296]  gic_handle_irq+0x5c/0x11c
      [215.023313]  el1_irq+0xd0/0x180
      [215.023332]  cpuidle_enter_state+0xac/0x338
      [215.023349]  cpuidle_enter+0x40/0x70
      [215.023366]  do_idle+0x150/0x278
      [215.023384]  cpu_startup_entry+0x2c/0x58
      [215.023401]  rest_init+0xdc/0xec
      [215.023419]  arch_call_rest_init+0x18/0x24
      [215.023435]  start_kernel+0x334/0x400
      [215.023460] Code: 91002129 eb09010a 9a89810b cb0b0042 (38401403)
      [215.023478] ---[ end trace 28668fd20c7a90cd ]
      
      Fixes: 2822cd0173ad ("Bluetooth: btusb: mediatek: add MediaTek devcoredump support")
      Signed-off-by: default avatarChris Lu <chris.lu@mediatek.com>
      Co-developed-by: default avatarSean Wang <sean.wang@mediatek.com>
      Signed-off-by: default avatarSean Wang <sean.wang@mediatek.com>
      Signed-off-by: default avatarLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
      0e72e3b1
    • Roger Gammans's avatar
      Bluetooth: btusb: Add support for another MediaTek 7922 VID/PID · 0cefdaed
      Roger Gammans authored
      This one is found on the Dell Inspiron 2-in-1 7435
      
      The information in /sys/kernel/debug/usb/devices about the Bluetooth
      device is listed as the below.
      
      T:  Bus=03 Lev=01 Prnt=01 Port=02 Cnt=01 Dev#=  2 Spd=480  MxCh= 0
      D:  Ver= 2.10 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs=  1
      P:  Vendor=0489 ProdID=e0f1 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 avatarRoger Gammans <rgammans@gammascience.co.uk>
      Signed-off-by: default avatarLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
      0cefdaed
    • Ying Hsu's avatar
      Bluetooth: Fix hci_suspend_sync crash · 573ebae1
      Ying Hsu authored
      If hci_unregister_dev() frees the hci_dev object but hci_suspend_notifier
      may still be accessing it, it can cause the program to crash.
      Here's the call trace:
        <4>[102152.653246] Call Trace:
        <4>[102152.653254]  hci_suspend_sync+0x109/0x301 [bluetooth]
        <4>[102152.653259]  hci_suspend_dev+0x78/0xcd [bluetooth]
        <4>[102152.653263]  hci_suspend_notifier+0x42/0x7a [bluetooth]
        <4>[102152.653268]  notifier_call_chain+0x43/0x6b
        <4>[102152.653271]  __blocking_notifier_call_chain+0x48/0x69
        <4>[102152.653273]  __pm_notifier_call_chain+0x22/0x39
        <4>[102152.653276]  pm_suspend+0x287/0x57c
        <4>[102152.653278]  state_store+0xae/0xe5
        <4>[102152.653281]  kernfs_fop_write+0x109/0x173
        <4>[102152.653284]  __vfs_write+0x16f/0x1a2
        <4>[102152.653287]  ? selinux_file_permission+0xca/0x16f
        <4>[102152.653289]  ? security_file_permission+0x36/0x109
        <4>[102152.653291]  vfs_write+0x114/0x21d
        <4>[102152.653293]  __x64_sys_write+0x7b/0xdb
        <4>[102152.653296]  do_syscall_64+0x59/0x194
        <4>[102152.653299]  entry_SYSCALL_64_after_hwframe+0x5c/0xc1
      
      This patch holds the reference count of the hci_dev object while
      processing it in hci_suspend_notifier to avoid potential crash
      caused by the race condition.
      Signed-off-by: default avatarYing Hsu <yinghsu@chromium.org>
      Signed-off-by: default avatarLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
      573ebae1
    • Lee, Chun-Yi's avatar
      Bluetooth: hci_ldisc: check HCI_UART_PROTO_READY flag in HCIUARTGETPROTO · 9c33663a
      Lee, Chun-Yi authored
      This patch adds code to check HCI_UART_PROTO_READY flag before
      accessing hci_uart->proto. It fixes the race condition in
      hci_uart_tty_ioctl() between HCIUARTSETPROTO and HCIUARTGETPROTO.
      This issue bug found by Yu Hao and Weiteng Chen:
      
      BUG: general protection fault in hci_uart_tty_ioctl [1]
      
      The information of C reproducer can also reference the link [2]
      Reported-by: default avatarYu Hao <yhao016@ucr.edu>
      Closes: https://lore.kernel.org/all/CA+UBctC3p49aTgzbVgkSZ2+TQcqq4fPDO7yZitFT5uBPDeCO2g@mail.gmail.com/ [1]
      Reported-by: default avatarWeiteng Chen <wchen130@ucr.edu>
      Closes: https://lore.kernel.org/lkml/CA+UBctDPEvHdkHMwD340=n02rh+jNRJNNQ5LBZNA+Wm4Keh2ow@mail.gmail.com/T/ [2]
      Signed-off-by: default avatar"Lee, Chun-Yi" <jlee@suse.com>
      Signed-off-by: default avatarLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
      9c33663a
    • Christophe JAILLET's avatar
      Bluetooth: hci_debugfs: Use kstrtobool() instead of strtobool() · 82eae9dc
      Christophe JAILLET authored
      strtobool() is the same as kstrtobool().
      However, the latter is more used within the kernel.
      
      In order to remove strtobool() and slightly simplify kstrtox.h, switch to
      the other function name.
      
      While at it, include the corresponding header file (<linux/kstrtox.h>)
      Signed-off-by: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
      Signed-off-by: default avatarLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
      82eae9dc
    • Chris Lu's avatar
      Bluetooth: btusb: Add new VID/PID 04ca/3804 for MT7922 · 59be4be8
      Chris Lu authored
      Add VID 04ca & PID 3804 for MediaTek MT7922 USB Bluetooth chip.
      
      The information in /sys/kernel/debug/usb/devices about the Bluetooth
      device is listed as the below.
      
      T:  Bus=05 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  2 Spd=480  MxCh= 0
      D:  Ver= 2.10 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs=  1
      P:  Vendor=04ca ProdID=3804 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 avatarChris Lu <chris.lu@mediatek.com>
      Signed-off-by: default avatarLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
      59be4be8
    • Chris Lu's avatar
      Bluetooth: btusb: Add new VID/PID 0489/e102 for MT7922 · bf809efd
      Chris Lu authored
      Add VID 0489 & PID e102 for MediaTek MT7922 USB Bluetooth chip.
      
      The information in /sys/kernel/debug/usb/devices about the Bluetooth
      device is listed as the below.
      
      T:  Bus=05 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  2 Spd=480  MxCh= 0
      D:  Ver= 2.10 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs=  1
      P:  Vendor=0489 ProdID=e102 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 avatarChris Lu <chris.lu@mediatek.com>
      Signed-off-by: default avatarLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
      bf809efd
    • Luiz Augusto von Dentz's avatar
      Bluetooth: MGMT: Fix always using HCI_MAX_AD_LENGTH · 112b5090
      Luiz Augusto von Dentz authored
      HCI_MAX_AD_LENGTH shall only be used if the controller doesn't support
      extended advertising, otherwise HCI_MAX_EXT_AD_LENGTH shall be used
      instead.
      Signed-off-by: default avatarLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
      112b5090
    • Douglas Anderson's avatar
      Bluetooth: hci_sync: Don't double print name in add/remove adv_monitor · 6f55eea1
      Douglas Anderson authored
      The hci_add_adv_monitor() hci_remove_adv_monitor() functions call
      bt_dev_dbg() to print some debug statements. The bt_dev_dbg() macro
      automatically adds in the device's name. That means that we shouldn't
      include the name in the bt_dev_dbg() calls.
      Suggested-by: default avatarLuiz Augusto von Dentz <luiz.dentz@gmail.com>
      Signed-off-by: default avatarDouglas Anderson <dianders@chromium.org>
      Signed-off-by: default avatarLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
      6f55eea1
    • Kiran K's avatar
      Bluetooth: Add support for Gale Peak (8087:0036) · 999a8a6b
      Kiran K authored
      Devices from /sys/kernel/debug/usb/devices:
      
      T:  Bus=09 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  2 Spd=12   MxCh= 0
      D:  Ver= 2.01 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs=  1
      P:  Vendor=8087 ProdID=0036 Rev= 0.00
      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=  64 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
      I:  If#= 1 Alt= 6 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E:  Ad=03(O) Atr=01(Isoc) MxPS=  63 Ivl=1ms
      E:  Ad=83(I) Atr=01(Isoc) MxPS=  63 Ivl=1ms
      Signed-off-by: default avatarKiran K <kiran.k@intel.com>
      Signed-off-by: default avatarLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
      999a8a6b
    • Chris Lu's avatar
      Bluetooth: btusb: Add a new VID/PID 0489/e0f6 for MT7922 · b6cfa1c2
      Chris Lu authored
      Add VID/PID 0489/e0f6 for MediaTek MT7922 USB Bluetooth chip.
      
      The information in /sys/kernel/debug/usb/devices about the Bluetooth
      device is listed as the below.
      
      T:  Bus=01 Lev=01 Prnt=01 Port=04 Cnt=03 Dev#=  4 Spd=480  MxCh= 0
      D:  Ver= 2.10 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs=  1
      P:  Vendor=0489 ProdID=e0f6 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 avatarChris Lu <chris.lu@mediatek.com>
      Signed-off-by: default avatarLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
      b6cfa1c2
    • Dan Carpenter's avatar
      Bluetooth: msft: Fix error code in msft_cancel_address_filter_sync() · 528b2acf
      Dan Carpenter authored
      Return negative -EIO instead of positive EIO.
      
      Fixes: 926df8962f3f ("Bluetooth: msft: Extended monitor tracking by address filter")
      Signed-off-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
      Reviewed-by: default avatarSimon Horman <simon.horman@corigine.com>
      Signed-off-by: default avatarLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
      528b2acf
    • Iulia Tanasescu's avatar
      Bluetooth: ISO: Notify user space about failed bis connections · f777d882
      Iulia Tanasescu authored
      Some use cases require the user to be informed if BIG synchronization
      fails. This commit makes it so that even if the BIG sync established
      event arrives with error status, a new hconn is added for each BIS,
      and the iso layer is notified about the failed connections.
      
      Unsuccesful bis connections will be marked using the
      HCI_CONN_BIG_SYNC_FAILED flag. From the iso layer, the POLLERR event
      is triggered on the newly allocated bis sockets, before adding them
      to the accept list of the parent socket.
      
      From user space, a new fd for each failed bis connection will be
      obtained by calling accept. The user should check for the POLLERR
      event on the new socket, to determine if the connection was successful
      or not.
      
      The HCI_CONN_BIG_SYNC flag has been added to mark whether the BIG sync
      has been successfully established. This flag is checked at bis cleanup,
      so the HCI LE BIG Terminate Sync command is only issued if needed.
      
      The BT_SK_BIG_SYNC flag indicates if BIG create sync has been called
      for a listening socket, to avoid issuing the command everytime a BIGInfo
      advertising report is received.
      Signed-off-by: default avatarIulia Tanasescu <iulia.tanasescu@nxp.com>
      Signed-off-by: default avatarLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
      f777d882
    • Valentin David's avatar
      Bluetooth: btusb: Add device 0489:e0f5 as MT7922 device · e160a8f4
      Valentin David authored
      Asus ROG Ally gaming computer has a MediaTek MT7922 chip that uses USB id
      0489:e0f5 and needs to be added to the table. Without this, the device is
      not usable and gives the following error:
      
      Bluetooth: hci0: Opcode 0x c03 failed: -110
      
      Output from /sys/kernel/debug/usb/devices:
      
      T:  Bus=01 Lev=01 Prnt=01 Port=03 Cnt=03 Dev#=  4 Spd=480  MxCh= 0
      D:  Ver= 2.10 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs=  1
      P:  Vendor=0489 ProdID=e0f5 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 avatarValentin David <valentin.david@gmail.com>
      Signed-off-by: default avatarLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
      e160a8f4
    • Luiz Augusto von Dentz's avatar
      Bluetooth: hci_conn: Always allocate unique handles · 9f78191c
      Luiz Augusto von Dentz authored
      This attempts to always allocate a unique handle for connections so they
      can be properly aborted by the likes of hci_abort_conn, so this uses the
      invalid range as a pool of unset handles that way if userspace is trying
      to create multiple connections at once each will be given a unique
      handle which will be considered unset.
      Signed-off-by: default avatarLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
      9f78191c
    • Luiz Augusto von Dentz's avatar
      Bluetooth: hci_sync: Fix not handling ISO_LINK in hci_abort_conn_sync · 04a51d61
      Luiz Augusto von Dentz authored
      ISO_LINK connections where not being handled properly on
      hci_abort_conn_sync which sometimes resulted in sending the wrong
      commands, or in case of having the reject command being sent by the
      socket code (iso.c) which is sort of a layer violation.
      Signed-off-by: default avatarLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
      04a51d61
    • Luiz Augusto von Dentz's avatar
      Bluetooth: hci_conn: Consolidate code for aborting connections · a13f316e
      Luiz Augusto von Dentz authored
      This consolidates code for aborting connections using
      hci_cmd_sync_queue so it is synchronized with other threads, but
      because of the fact that some commands may block the cmd_sync_queue
      while waiting specific events this attempt to cancel those requests by
      using hci_cmd_sync_cancel.
      Signed-off-by: default avatarLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
      a13f316e
    • Jing Cai's avatar
      Bluetooth: btusb: mediatek: add MediaTek devcoredump support · 0b701513
      Jing Cai authored
      This patch implement function .coredump() and dmp_hdr() in btusb
      driver for MediaTek controller.  FW core dump was triggered by FW
      specific event to show something unexpected happened in the controller.
      
      The driver would be responsible for collecting and uploading the device
      core dump pieces in hci driver using core dump API. Once we finished
      the whole process, the driver would reset the controller to recover the
      kind of fatal error.
      Co-developed-by: default avatarChris Lu <chris.lu@mediatek.com>
      Signed-off-by: default avatarChris Lu <chris.lu@mediatek.com>
      Co-developed-by: default avatarSean Wang <sean.wang@mediatek.com>
      Signed-off-by: default avatarSean Wang <sean.wang@mediatek.com>
      Signed-off-by: default avatarJing Cai <jing.cai@mediatek.com>
      Signed-off-by: default avatarLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
      0b701513
    • Jing Cai's avatar
      Bluetooth: btmtk: introduce btmtk reset work · 25b6d759
      Jing Cai authored
      Introduce btmtk_reset_work which can be called whenever the firmware abort,
      HCI command timeout, other fatal error happen.
      Co-developed-by: default avatarChris Lu <chris.lu@mediatek.com>
      Signed-off-by: default avatarChris Lu <chris.lu@mediatek.com>
      Co-developed-by: default avatarSean Wang <sean.wang@mediatek.com>
      Signed-off-by: default avatarSean Wang <sean.wang@mediatek.com>
      Signed-off-by: default avatarJing Cai <jing.cai@mediatek.com>
      Signed-off-by: default avatarLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
      25b6d759
    • Sean Wang's avatar
      Bluetooth: btusb: mediatek: readx_poll_timeout replaces open coding · ca58330c
      Sean Wang authored
      Use readx_poll_timeout instead of open coding to poll the hardware reset
      status until it is done.
      Signed-off-by: default avatarSean Wang <sean.wang@mediatek.com>
      Signed-off-by: default avatarLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
      ca58330c