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

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'for-net-next-2026-01-29' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next

Luiz Augusto von Dentz says:

====================
bluetooth-next pull request for net-next:

core:
- L2CAP: Add support for setting BT_PHY
- HCI: Add LE Channel Sounding HCI Command/event structures
- hci_conn: Set link_policy on incoming ACL connections
- MGMT: Add idle_timeout to configurable system parameters

drivers:
- btusb: Add support for MediaTek7920 0489:e158
- btusb: Add device ID for Realtek RTL8761BU
- btusb: Reject autosuspend if discovery is active
- btusb: Add new VID/PID for RTL8852CE
- btusb: Add USB ID 0489:e112 for Realtek 8851BE
- dt-bindings: qcom: Split to separate schema
- btqca: Add WCN6855 firmware priority selection feature

* tag 'for-net-next-2026-01-29' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next: (40 commits)
Bluetooth: hci_qca: Enable HFP hardware offload for WCN6855 and WCN7850
Bluetooth: hci_qca: Refactor HFP hardware offload capability handling
Bluetooth: btusb: Add USB ID 7392:e611 for Edimax EW-7611UXB
Bluetooth: L2CAP: Fix not tracking outstanding TX ident
Bluetooth: MGMT: Fix memory leak in set_ssp_complete
Bluetooth: hci_uart: fix null-ptr-deref in hci_uart_write_work
Bluetooth: btusb: Remove duplicate entry for 0x13d3/0x3618
Bluetooth: btusb: Add device ID for Realtek RTL8761BU
Bluetooth: btintel: Remove unneeded CONFIG_PM* #ifdef's
Bluetooth: btnxpuart: Remove unneeded CONFIG_PM ifdef
Bluetooth: btusb: Add new VID/PID for RTL8852CE
Bluetooth: btintel_pcie: Remove unnecessary check before kfree_skb()
Bluetooth: btusb: Reject autosuspend if discovery is active
Bluetooth: hci_core: Export hci_discovery_active
Bluetooth: btusb: Use pm_ptr instead of #ifdef CONFIG_PM
dt-bindings: bluetooth: qcom,wcn7850-bt: Deprecate old supplies
dt-bindings: bluetooth: qcom,wcn7850-bt: Split to separate schema
dt-bindings: bluetooth: qcom,wcn6855-bt: Deprecate old supplies
dt-bindings: bluetooth: qcom,wcn6855-bt: Split to separate schema
dt-bindings: bluetooth: qcom,wcn6750-bt: Deprecate old supplies
...
====================

Link: https://patch.msgid.link/20260129203610.963067-1-luiz.dentz@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

+1503 -413
+25
Documentation/devicetree/bindings/net/bluetooth/qcom,bluetooth-common.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/net/bluetooth/qcom,bluetooth-common.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Qualcomm Bluetooth Common Properties 8 + 9 + maintainers: 10 + - Balakrishna Godavarthi <quic_bgodavar@quicinc.com> 11 + - Rocky Liao <quic_rjliao@quicinc.com> 12 + 13 + properties: 14 + firmware-name: 15 + minItems: 1 16 + items: 17 + - description: specify the name of nvm firmware to load 18 + - description: specify the name of rampatch firmware to load 19 + 20 + qcom,local-bd-address-broken: 21 + type: boolean 22 + description: 23 + boot firmware is incorrectly passing the address in big-endian order 24 + 25 + additionalProperties: true
+49
Documentation/devicetree/bindings/net/bluetooth/qcom,qca2066-bt.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/net/bluetooth/qcom,qca2066-bt.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Qualcomm QCA2006 Bluetooth 8 + 9 + maintainers: 10 + - Balakrishna Godavarthi <quic_bgodavar@quicinc.com> 11 + - Rocky Liao <quic_rjliao@quicinc.com> 12 + 13 + properties: 14 + compatible: 15 + enum: 16 + - qcom,qca2066-bt 17 + - qcom,qca6174-bt 18 + 19 + clocks: 20 + items: 21 + - description: External low-power 32.768 kHz clock input 22 + 23 + enable-gpios: 24 + maxItems: 1 25 + 26 + required: 27 + - compatible 28 + - clocks 29 + - enable-gpios 30 + 31 + allOf: 32 + - $ref: bluetooth-controller.yaml# 33 + - $ref: qcom,bluetooth-common.yaml 34 + - $ref: /schemas/serial/serial-peripheral-props.yaml# 35 + 36 + unevaluatedProperties: false 37 + 38 + examples: 39 + - | 40 + #include <dt-bindings/gpio/gpio.h> 41 + 42 + serial { 43 + bluetooth { 44 + compatible = "qcom,qca6174-bt"; 45 + clocks = <&divclk4>; 46 + enable-gpios = <&pm8994_gpios 19 GPIO_ACTIVE_HIGH>; 47 + firmware-name = "nvm_00440302.bin"; 48 + }; 49 + };
+64
Documentation/devicetree/bindings/net/bluetooth/qcom,qca6390-bt.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/net/bluetooth/qcom,qca6390-bt.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Qualcomm QCA6390 Bluetooth 8 + 9 + maintainers: 10 + - Balakrishna Godavarthi <quic_bgodavar@quicinc.com> 11 + - Rocky Liao <quic_rjliao@quicinc.com> 12 + 13 + properties: 14 + compatible: 15 + enum: 16 + - qcom,qca6390-bt 17 + 18 + vddaon-supply: 19 + description: VDD_AON supply regulator handle 20 + 21 + vddbtcmx-supply: 22 + description: VDD_BT_CMX supply regulator handle 23 + 24 + vddrfa0p8-supply: 25 + description: VDD_RFA_0P8 supply regulator handle 26 + 27 + vddrfa1p2-supply: 28 + description: VDD_RFA_1P2 supply regulator handle 29 + 30 + vddrfa1p7-supply: 31 + description: VDD_RFA_1P7 supply regulator handle 32 + 33 + vddrfacmn-supply: 34 + description: VDD_RFA_CMN supply regulator handle 35 + 36 + required: 37 + - compatible 38 + - vddaon-supply 39 + - vddbtcmx-supply 40 + - vddrfa0p8-supply 41 + - vddrfa1p2-supply 42 + - vddrfa1p7-supply 43 + - vddrfacmn-supply 44 + 45 + allOf: 46 + - $ref: bluetooth-controller.yaml# 47 + - $ref: qcom,bluetooth-common.yaml 48 + - $ref: /schemas/serial/serial-peripheral-props.yaml# 49 + 50 + unevaluatedProperties: false 51 + 52 + examples: 53 + - | 54 + serial { 55 + bluetooth { 56 + compatible = "qcom,qca6390-bt"; 57 + vddaon-supply = <&vreg_pmu_aon_0p59>; 58 + vddbtcmx-supply = <&vreg_pmu_btcmx_0p85>; 59 + vddrfa0p8-supply = <&vreg_pmu_rfa_0p8>; 60 + vddrfa1p2-supply = <&vreg_pmu_rfa_1p2>; 61 + vddrfa1p7-supply = <&vreg_pmu_rfa_1p7>; 62 + vddrfacmn-supply = <&vreg_pmu_rfa_cmn>; 63 + }; 64 + };
+58
Documentation/devicetree/bindings/net/bluetooth/qcom,qca9377-bt.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/net/bluetooth/qcom,qca9377-bt.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Qualcomm QCA9377 Bluetooth 8 + 9 + maintainers: 10 + - Balakrishna Godavarthi <quic_bgodavar@quicinc.com> 11 + - Rocky Liao <quic_rjliao@quicinc.com> 12 + 13 + properties: 14 + compatible: 15 + enum: 16 + - qcom,qca9377-bt 17 + 18 + clocks: 19 + items: 20 + - description: External low-power 32.768 kHz clock input 21 + 22 + enable-gpios: 23 + maxItems: 1 24 + 25 + vddio-supply: 26 + description: VDD_IO supply regulator handle 27 + 28 + vddxo-supply: 29 + description: VDD_XO supply regulator handle 30 + 31 + required: 32 + - compatible 33 + - clocks 34 + - enable-gpios 35 + 36 + allOf: 37 + - $ref: bluetooth-controller.yaml# 38 + - $ref: qcom,bluetooth-common.yaml 39 + - $ref: /schemas/serial/serial-peripheral-props.yaml# 40 + 41 + unevaluatedProperties: false 42 + 43 + examples: 44 + - | 45 + #include <dt-bindings/gpio/gpio.h> 46 + 47 + serial { 48 + bluetooth { 49 + compatible = "qcom,qca9377-bt"; 50 + clocks = <&rk809 1>; 51 + enable-gpios = <&gpio3 5 GPIO_ACTIVE_HIGH>; 52 + max-speed = <2000000>; 53 + pinctrl-names = "default"; 54 + pinctrl-0 = <&bt_enable>; 55 + vddio-supply = <&vcc_1v8>; 56 + vddxo-supply = <&vcc3v3_sys>; 57 + }; 58 + };
+67
Documentation/devicetree/bindings/net/bluetooth/qcom,wcn3950-bt.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/net/bluetooth/qcom,wcn3950-bt.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Qualcomm WCN3950/WCN3988 Bluetooth 8 + 9 + maintainers: 10 + - Balakrishna Godavarthi <quic_bgodavar@quicinc.com> 11 + - Rocky Liao <quic_rjliao@quicinc.com> 12 + 13 + properties: 14 + compatible: 15 + enum: 16 + - qcom,wcn3950-bt 17 + - qcom,wcn3988-bt 18 + 19 + enable-gpios: 20 + maxItems: 1 21 + 22 + swctrl-gpios: 23 + maxItems: 1 24 + description: gpio specifier is used to find status 25 + of clock supply to SoC 26 + 27 + vddch0-supply: 28 + description: VDD_CH0 supply regulator handle 29 + 30 + vddio-supply: 31 + description: VDD_IO supply regulator handle 32 + 33 + vddrf-supply: 34 + description: VDD_RF supply regulator handle 35 + 36 + vddxo-supply: 37 + description: VDD_XO supply regulator handle 38 + 39 + required: 40 + - compatible 41 + - vddch0-supply 42 + - vddio-supply 43 + - vddrf-supply 44 + - vddxo-supply 45 + 46 + allOf: 47 + - $ref: bluetooth-controller.yaml# 48 + - $ref: qcom,bluetooth-common.yaml 49 + - $ref: /schemas/serial/serial-peripheral-props.yaml# 50 + 51 + unevaluatedProperties: false 52 + 53 + examples: 54 + - | 55 + #include <dt-bindings/gpio/gpio.h> 56 + 57 + serial { 58 + bluetooth { 59 + compatible = "qcom,wcn3950-bt"; 60 + enable-gpios = <&tlmm 87 GPIO_ACTIVE_HIGH>; 61 + max-speed = <3200000>; 62 + vddch0-supply = <&pm4125_l22>; 63 + vddio-supply = <&pm4125_l15>; 64 + vddrf-supply = <&pm4125_l10>; 65 + vddxo-supply = <&pm4125_l13>; 66 + }; 67 + };
+66
Documentation/devicetree/bindings/net/bluetooth/qcom,wcn3990-bt.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/net/bluetooth/qcom,wcn3990-bt.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Qualcomm WCN3990/WCN3991/WCN3998 Bluetooth 8 + 9 + maintainers: 10 + - Balakrishna Godavarthi <quic_bgodavar@quicinc.com> 11 + - Rocky Liao <quic_rjliao@quicinc.com> 12 + 13 + properties: 14 + compatible: 15 + enum: 16 + - qcom,wcn3990-bt 17 + - qcom,wcn3991-bt 18 + - qcom,wcn3998-bt 19 + 20 + clocks: 21 + items: 22 + - description: External low-power 32.768 kHz clock input 23 + 24 + vddch0-supply: 25 + description: VDD_CH0 supply regulator handle 26 + 27 + vddch1-supply: 28 + description: VDD_CH1 supply regulator handle 29 + 30 + vddio-supply: 31 + description: VDD_IO supply regulator handle 32 + 33 + vddrf-supply: 34 + description: VDD_RF supply regulator handle 35 + 36 + vddxo-supply: 37 + description: VDD_XO supply regulator handle 38 + 39 + required: 40 + - compatible 41 + - vddch0-supply 42 + - vddio-supply 43 + - vddrf-supply 44 + - vddxo-supply 45 + 46 + allOf: 47 + - $ref: bluetooth-controller.yaml# 48 + - $ref: qcom,bluetooth-common.yaml 49 + - $ref: /schemas/serial/serial-peripheral-props.yaml# 50 + 51 + unevaluatedProperties: false 52 + 53 + examples: 54 + - | 55 + serial { 56 + bluetooth { 57 + compatible = "qcom,wcn3990-bt"; 58 + firmware-name = "crnv21.bin"; 59 + max-speed = <3200000>; 60 + vddio-supply = <&vreg_s4a_1p8>; 61 + vddch0-supply = <&vreg_l25a_3p3>; 62 + vddch1-supply = <&vreg_l23a_3p3>; 63 + vddrf-supply = <&vreg_l17a_1p3>; 64 + vddxo-supply = <&vreg_l7a_1p8>; 65 + }; 66 + };
+91
Documentation/devicetree/bindings/net/bluetooth/qcom,wcn6750-bt.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/net/bluetooth/qcom,wcn6750-bt.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Qualcomm WCN6750 Bluetooth 8 + 9 + maintainers: 10 + - Balakrishna Godavarthi <quic_bgodavar@quicinc.com> 11 + - Rocky Liao <quic_rjliao@quicinc.com> 12 + 13 + properties: 14 + compatible: 15 + enum: 16 + - qcom,wcn6750-bt 17 + 18 + enable-gpios: 19 + maxItems: 1 20 + deprecated: true 21 + 22 + swctrl-gpios: 23 + maxItems: 1 24 + description: gpio specifier is used to find status 25 + of clock supply to SoC 26 + deprecated: true 27 + 28 + vddaon-supply: 29 + description: VDD_AON supply regulator handle 30 + 31 + vddasd-supply: 32 + description: VDD_ASD supply regulator handle 33 + deprecated: true 34 + 35 + vddbtcmx-supply: 36 + description: VDD_BT_CMX supply regulator handle 37 + 38 + vddbtcxmx-supply: 39 + description: VDD_BT_CXMX supply regulator handle 40 + deprecated: true 41 + 42 + vddio-supply: 43 + description: VDD_IO supply regulator handle 44 + deprecated: true 45 + 46 + vddrfa0p8-supply: 47 + description: VDD_RFA_0P8 supply regulator handle 48 + 49 + vddrfa1p2-supply: 50 + description: VDD_RFA_1P2 supply regulator handle 51 + 52 + vddrfa1p7-supply: 53 + description: VDD_RFA_1P7 supply regulator handle 54 + 55 + vddrfa2p2-supply: 56 + description: VDD_RFA_2P2 supply regulator handle 57 + 58 + vddrfacmn-supply: 59 + description: VDD_RFA_CMN supply regulator handle 60 + 61 + required: 62 + - compatible 63 + - vddaon-supply 64 + - vddrfa0p8-supply 65 + - vddrfa1p2-supply 66 + - vddrfa1p7-supply 67 + - vddrfacmn-supply 68 + 69 + allOf: 70 + - $ref: bluetooth-controller.yaml# 71 + - $ref: qcom,bluetooth-common.yaml 72 + - $ref: /schemas/serial/serial-peripheral-props.yaml# 73 + 74 + unevaluatedProperties: false 75 + 76 + examples: 77 + - | 78 + serial { 79 + bluetooth { 80 + compatible = "qcom,wcn6750-bt"; 81 + 82 + firmware-name = "msnv11.bin"; 83 + max-speed = <3200000>; 84 + vddaon-supply = <&vreg_pmu_aon_0p59>; 85 + vddbtcmx-supply = <&vreg_pmu_btcmx_0p85>; 86 + vddrfa0p8-supply = <&vreg_pmu_rfa_0p8>; 87 + vddrfa1p2-supply = <&vreg_pmu_rfa_1p2>; 88 + vddrfa1p7-supply = <&vreg_pmu_rfa_1p7>; 89 + vddrfacmn-supply = <&vreg_pmu_rfa_cmn>; 90 + }; 91 + };
+99
Documentation/devicetree/bindings/net/bluetooth/qcom,wcn6855-bt.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/net/bluetooth/qcom,wcn6855-bt.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Qualcomm WCN6855 Bluetooth 8 + 9 + maintainers: 10 + - Bartosz Golaszewski <brgl@bgdev.pl> 11 + - Balakrishna Godavarthi <quic_bgodavar@quicinc.com> 12 + - Rocky Liao <quic_rjliao@quicinc.com> 13 + 14 + properties: 15 + compatible: 16 + enum: 17 + - qcom,wcn6855-bt 18 + 19 + enable-gpios: 20 + maxItems: 1 21 + deprecated: true 22 + 23 + swctrl-gpios: 24 + maxItems: 1 25 + description: gpio specifier is used to find status 26 + of clock supply to SoC 27 + deprecated: true 28 + 29 + vddaon-supply: 30 + description: VDD_AON supply regulator handle 31 + 32 + vddbtcmx-supply: 33 + description: VDD_BT_CMX supply regulator handle 34 + 35 + vddbtcxmx-supply: 36 + description: VDD_BT_CXMX supply regulator handle 37 + deprecated: true 38 + 39 + vddio-supply: 40 + description: VDD_IO supply regulator handle 41 + deprecated: true 42 + 43 + vddrfa0p8-supply: 44 + description: VDD_RFA_0P8 supply regulator handle 45 + 46 + vddrfa1p2-supply: 47 + description: VDD_RFA_1P2 supply regulator handle 48 + 49 + vddrfa1p7-supply: 50 + description: VDD_RFA_1P7 supply regulator handle 51 + deprecated: true 52 + 53 + vddrfa1p8-supply: 54 + description: VDD_RFA_1P8 supply regulator handle 55 + 56 + vddrfacmn-supply: 57 + description: VDD_RFA_CMN supply regulator handle 58 + 59 + vddwlcx-supply: 60 + description: VDD_WLCX supply regulator handle 61 + 62 + vddwlmx-supply: 63 + description: VDD_WLMX supply regulator handle 64 + 65 + required: 66 + - compatible 67 + - vddaon-supply 68 + - vddbtcmx-supply 69 + - vddrfa0p8-supply 70 + - vddrfa1p2-supply 71 + - vddrfa1p8-supply 72 + - vddrfacmn-supply 73 + - vddwlcx-supply 74 + - vddwlmx-supply 75 + 76 + allOf: 77 + - $ref: bluetooth-controller.yaml# 78 + - $ref: qcom,bluetooth-common.yaml 79 + - $ref: /schemas/serial/serial-peripheral-props.yaml# 80 + 81 + unevaluatedProperties: false 82 + 83 + examples: 84 + - | 85 + serial { 86 + bluetooth { 87 + compatible = "qcom,wcn6855-bt"; 88 + 89 + max-speed = <3000000>; 90 + vddaon-supply = <&vreg_pmu_aon_0p8>; 91 + vddbtcmx-supply = <&vreg_pmu_btcmx_0p8>; 92 + vddrfa0p8-supply = <&vreg_pmu_rfa_0p8>; 93 + vddrfa1p2-supply = <&vreg_pmu_rfa_1p2>; 94 + vddrfa1p8-supply = <&vreg_pmu_rfa_1p7>; 95 + vddrfacmn-supply = <&vreg_pmu_rfa_cmn_0p8>; 96 + vddwlcx-supply = <&vreg_pmu_wlcx_0p8>; 97 + vddwlmx-supply = <&vreg_pmu_wlmx_0p8>; 98 + }; 99 + };
+94
Documentation/devicetree/bindings/net/bluetooth/qcom,wcn7850-bt.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/net/bluetooth/qcom,wcn7850-bt.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Qualcomm WCN7850 Bluetooth 8 + 9 + maintainers: 10 + - Bartosz Golaszewski <brgl@bgdev.pl> 11 + - Balakrishna Godavarthi <quic_bgodavar@quicinc.com> 12 + - Rocky Liao <quic_rjliao@quicinc.com> 13 + 14 + properties: 15 + compatible: 16 + enum: 17 + - qcom,wcn7850-bt 18 + 19 + enable-gpios: 20 + maxItems: 1 21 + deprecated: true 22 + 23 + swctrl-gpios: 24 + maxItems: 1 25 + description: gpio specifier is used to find status 26 + of clock supply to SoC 27 + deprecated: true 28 + 29 + vddaon-supply: 30 + description: VDD_AON supply regulator handle 31 + 32 + vdddig-supply: 33 + description: VDD_DIG supply regulator handle 34 + deprecated: true 35 + 36 + vddio-supply: 37 + description: VDD_IO supply regulator handle 38 + deprecated: true 39 + 40 + vddrfa0p8-supply: 41 + description: VDD_RFA_0P8 supply regulator handle 42 + 43 + vddrfa1p2-supply: 44 + description: VDD_RFA_1P2 supply regulator handle 45 + 46 + vddrfa1p8-supply: 47 + description: VDD_RFA_1P8 supply regulator handle 48 + 49 + vddrfa1p9-supply: 50 + description: VDD_RFA_1P9 supply regulator handle 51 + deprecated: true 52 + 53 + vddrfacmn-supply: 54 + description: VDD_RFA_CMN supply regulator handle 55 + 56 + vddwlcx-supply: 57 + description: VDD_WLCX supply regulator handle 58 + 59 + vddwlmx-supply: 60 + description: VDD_WLMX supply regulator handle 61 + 62 + required: 63 + - compatible 64 + - vddrfacmn-supply 65 + - vddaon-supply 66 + - vddwlcx-supply 67 + - vddwlmx-supply 68 + - vddrfa0p8-supply 69 + - vddrfa1p2-supply 70 + - vddrfa1p8-supply 71 + 72 + allOf: 73 + - $ref: bluetooth-controller.yaml# 74 + - $ref: qcom,bluetooth-common.yaml 75 + - $ref: /schemas/serial/serial-peripheral-props.yaml# 76 + 77 + unevaluatedProperties: false 78 + 79 + examples: 80 + - | 81 + serial { 82 + bluetooth { 83 + compatible = "qcom,wcn7850-bt"; 84 + 85 + max-speed = <3200000>; 86 + vddaon-supply = <&vreg_pmu_aon_0p59>; 87 + vddrfa0p8-supply = <&vreg_pmu_rfa_0p8>; 88 + vddrfa1p2-supply = <&vreg_pmu_rfa_1p2>; 89 + vddrfa1p8-supply = <&vreg_pmu_rfa_1p8>; 90 + vddrfacmn-supply = <&vreg_pmu_rfa_cmn>; 91 + vddwlcx-supply = <&vreg_pmu_wlcx_0p8>; 92 + vddwlmx-supply = <&vreg_pmu_wlmx_0p85>; 93 + }; 94 + };
-259
Documentation/devicetree/bindings/net/bluetooth/qualcomm-bluetooth.yaml
··· 1 - # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 2 - %YAML 1.2 3 - --- 4 - $id: http://devicetree.org/schemas/net/bluetooth/qualcomm-bluetooth.yaml# 5 - $schema: http://devicetree.org/meta-schemas/core.yaml# 6 - 7 - title: Qualcomm Bluetooth Chips 8 - 9 - maintainers: 10 - - Balakrishna Godavarthi <quic_bgodavar@quicinc.com> 11 - - Rocky Liao <quic_rjliao@quicinc.com> 12 - 13 - description: 14 - This binding describes Qualcomm UART-attached bluetooth chips. 15 - 16 - properties: 17 - compatible: 18 - enum: 19 - - qcom,qca2066-bt 20 - - qcom,qca6174-bt 21 - - qcom,qca9377-bt 22 - - qcom,wcn3950-bt 23 - - qcom,wcn3988-bt 24 - - qcom,wcn3990-bt 25 - - qcom,wcn3991-bt 26 - - qcom,wcn3998-bt 27 - - qcom,qca6390-bt 28 - - qcom,wcn6750-bt 29 - - qcom,wcn6855-bt 30 - - qcom,wcn7850-bt 31 - 32 - enable-gpios: 33 - maxItems: 1 34 - description: gpio specifier used to enable chip 35 - 36 - swctrl-gpios: 37 - maxItems: 1 38 - description: gpio specifier is used to find status 39 - of clock supply to SoC 40 - 41 - clocks: 42 - maxItems: 1 43 - description: clock provided to the controller (SUSCLK_32KHZ) 44 - 45 - vddio-supply: 46 - description: VDD_IO supply regulator handle 47 - 48 - vddxo-supply: 49 - description: VDD_XO supply regulator handle 50 - 51 - vddrf-supply: 52 - description: VDD_RF supply regulator handle 53 - 54 - vddch0-supply: 55 - description: VDD_CH0 supply regulator handle 56 - 57 - vddch1-supply: 58 - description: VDD_CH1 supply regulator handle 59 - 60 - vddaon-supply: 61 - description: VDD_AON supply regulator handle 62 - 63 - vdddig-supply: 64 - description: VDD_DIG supply regulator handle 65 - 66 - vddbtcmx-supply: 67 - description: VDD_BT_CMX supply regulator handle 68 - 69 - vddbtcxmx-supply: 70 - description: VDD_BT_CXMX supply regulator handle 71 - 72 - vddrfacmn-supply: 73 - description: VDD_RFA_CMN supply regulator handle 74 - 75 - vddrfa0p8-supply: 76 - description: VDD_RFA_0P8 supply regulator handle 77 - 78 - vddrfa1p7-supply: 79 - description: VDD_RFA_1P7 supply regulator handle 80 - 81 - vddrfa1p8-supply: 82 - description: VDD_RFA_1P8 supply regulator handle 83 - 84 - vddrfa1p2-supply: 85 - description: VDD_RFA_1P2 supply regulator handle 86 - 87 - vddrfa1p9-supply: 88 - description: VDD_RFA_1P9 supply regulator handle 89 - 90 - vddrfa2p2-supply: 91 - description: VDD_RFA_2P2 supply regulator handle 92 - 93 - vddasd-supply: 94 - description: VDD_ASD supply regulator handle 95 - 96 - vddwlcx-supply: 97 - description: VDD_WLCX supply regulator handle 98 - 99 - vddwlmx-supply: 100 - description: VDD_WLMX supply regulator handle 101 - 102 - max-speed: true 103 - 104 - firmware-name: 105 - minItems: 1 106 - items: 107 - - description: specify the name of nvm firmware to load 108 - - description: specify the name of rampatch firmware to load 109 - 110 - local-bd-address: true 111 - 112 - qcom,local-bd-address-broken: 113 - type: boolean 114 - description: 115 - boot firmware is incorrectly passing the address in big-endian order 116 - 117 - required: 118 - - compatible 119 - 120 - additionalProperties: false 121 - 122 - allOf: 123 - - $ref: bluetooth-controller.yaml# 124 - - $ref: /schemas/serial/serial-peripheral-props.yaml# 125 - - if: 126 - properties: 127 - compatible: 128 - contains: 129 - enum: 130 - - qcom,qca2066-bt 131 - - qcom,qca6174-bt 132 - then: 133 - required: 134 - - enable-gpios 135 - - clocks 136 - 137 - - if: 138 - properties: 139 - compatible: 140 - contains: 141 - enum: 142 - - qcom,wcn3950-bt 143 - - qcom,wcn3988-bt 144 - - qcom,wcn3990-bt 145 - - qcom,wcn3991-bt 146 - - qcom,wcn3998-bt 147 - then: 148 - required: 149 - - vddio-supply 150 - - vddxo-supply 151 - - vddrf-supply 152 - - vddch0-supply 153 - 154 - - if: 155 - properties: 156 - compatible: 157 - contains: 158 - enum: 159 - - qcom,wcn6750-bt 160 - then: 161 - required: 162 - - vddaon-supply 163 - - vddrfacmn-supply 164 - - vddrfa0p8-supply 165 - - vddrfa1p7-supply 166 - - vddrfa1p2-supply 167 - - if: 168 - properties: 169 - compatible: 170 - contains: 171 - enum: 172 - - qcom,wcn6855-bt 173 - then: 174 - required: 175 - - vddrfacmn-supply 176 - - vddaon-supply 177 - - vddwlcx-supply 178 - - vddwlmx-supply 179 - - vddbtcmx-supply 180 - - vddrfa0p8-supply 181 - - vddrfa1p2-supply 182 - - vddrfa1p8-supply 183 - - if: 184 - properties: 185 - compatible: 186 - contains: 187 - enum: 188 - - qcom,wcn7850-bt 189 - then: 190 - required: 191 - - vddrfacmn-supply 192 - - vddaon-supply 193 - - vddwlcx-supply 194 - - vddwlmx-supply 195 - - vddrfa0p8-supply 196 - - vddrfa1p2-supply 197 - - vddrfa1p8-supply 198 - - if: 199 - properties: 200 - compatible: 201 - contains: 202 - enum: 203 - - qcom,qca6390-bt 204 - then: 205 - required: 206 - - vddrfacmn-supply 207 - - vddaon-supply 208 - - vddbtcmx-supply 209 - - vddrfa0p8-supply 210 - - vddrfa1p2-supply 211 - - vddrfa1p7-supply 212 - 213 - examples: 214 - - | 215 - #include <dt-bindings/gpio/gpio.h> 216 - serial { 217 - 218 - bluetooth { 219 - compatible = "qcom,qca6174-bt"; 220 - enable-gpios = <&pm8994_gpios 19 GPIO_ACTIVE_HIGH>; 221 - clocks = <&divclk4>; 222 - firmware-name = "nvm_00440302.bin"; 223 - }; 224 - }; 225 - - | 226 - serial { 227 - 228 - bluetooth { 229 - compatible = "qcom,wcn3990-bt"; 230 - vddio-supply = <&vreg_s4a_1p8>; 231 - vddxo-supply = <&vreg_l7a_1p8>; 232 - vddrf-supply = <&vreg_l17a_1p3>; 233 - vddch0-supply = <&vreg_l25a_3p3>; 234 - max-speed = <3200000>; 235 - firmware-name = "crnv21.bin"; 236 - }; 237 - }; 238 - - | 239 - serial { 240 - 241 - bluetooth { 242 - compatible = "qcom,wcn6750-bt"; 243 - pinctrl-names = "default"; 244 - pinctrl-0 = <&bt_en_default>; 245 - enable-gpios = <&tlmm 85 GPIO_ACTIVE_HIGH>; 246 - swctrl-gpios = <&tlmm 86 GPIO_ACTIVE_HIGH>; 247 - vddio-supply = <&vreg_l19b_1p8>; 248 - vddaon-supply = <&vreg_s7b_0p9>; 249 - vddbtcxmx-supply = <&vreg_s7b_0p9>; 250 - vddrfacmn-supply = <&vreg_s7b_0p9>; 251 - vddrfa0p8-supply = <&vreg_s7b_0p9>; 252 - vddrfa1p7-supply = <&vreg_s1b_1p8>; 253 - vddrfa1p2-supply = <&vreg_s8b_1p2>; 254 - vddrfa2p2-supply = <&vreg_s1c_2p2>; 255 - vddasd-supply = <&vreg_l11c_2p8>; 256 - max-speed = <3200000>; 257 - firmware-name = "msnv11.bin"; 258 - }; 259 - };
+1
MAINTAINERS
··· 21379 21379 M: Bartosz Golaszewski <brgl@kernel.org> 21380 21380 L: linux-arm-msm@vger.kernel.org 21381 21381 S: Maintained 21382 + F: Documentation/devicetree/bindings/net/bluetooth/qcom,* 21382 21383 F: drivers/bluetooth/btqca.[ch] 21383 21384 F: drivers/bluetooth/btqcomsmd.c 21384 21385 F: drivers/bluetooth/hci_qca.c
+1 -2
drivers/bluetooth/btintel_pcie.c
··· 1190 1190 skb = NULL; /* skb is freed in the callee */ 1191 1191 1192 1192 exit_error: 1193 - if (skb) 1194 - kfree_skb(skb); 1193 + kfree_skb(skb); 1195 1194 1196 1195 if (ret) 1197 1196 hdev->stat.err_rx++;
+1 -7
drivers/bluetooth/btmtksdio.c
··· 1472 1472 hci_free_dev(hdev); 1473 1473 } 1474 1474 1475 - #ifdef CONFIG_PM 1476 1475 static int btmtksdio_runtime_suspend(struct device *dev) 1477 1476 { 1478 1477 struct sdio_func *func = dev_to_sdio_func(dev); ··· 1541 1542 RUNTIME_PM_OPS(btmtksdio_runtime_suspend, btmtksdio_runtime_resume, NULL) 1542 1543 }; 1543 1544 1544 - #define BTMTKSDIO_PM_OPS (&btmtksdio_pm_ops) 1545 - #else /* CONFIG_PM */ 1546 - #define BTMTKSDIO_PM_OPS NULL 1547 - #endif /* CONFIG_PM */ 1548 - 1549 1545 static struct sdio_driver btmtksdio_driver = { 1550 1546 .name = "btmtksdio", 1551 1547 .probe = btmtksdio_probe, 1552 1548 .remove = btmtksdio_remove, 1553 1549 .id_table = btmtksdio_table, 1554 1550 .drv = { 1555 - .pm = BTMTKSDIO_PM_OPS, 1551 + .pm = pm_ptr(&btmtksdio_pm_ops), 1556 1552 } 1557 1553 }; 1558 1554
+2 -4
drivers/bluetooth/btnxpuart.c
··· 1947 1947 hci_free_dev(hdev); 1948 1948 } 1949 1949 1950 - #ifdef CONFIG_PM_SLEEP 1951 - static int nxp_serdev_suspend(struct device *dev) 1950 + static int __maybe_unused nxp_serdev_suspend(struct device *dev) 1952 1951 { 1953 1952 struct btnxpuart_dev *nxpdev = dev_get_drvdata(dev); 1954 1953 struct ps_data *psdata = &nxpdev->psdata; ··· 1961 1962 return 0; 1962 1963 } 1963 1964 1964 - static int nxp_serdev_resume(struct device *dev) 1965 + static int __maybe_unused nxp_serdev_resume(struct device *dev) 1965 1966 { 1966 1967 struct btnxpuart_dev *nxpdev = dev_get_drvdata(dev); 1967 1968 struct ps_data *psdata = &nxpdev->psdata; ··· 1974 1975 ps_control(psdata->hdev, PS_STATE_AWAKE); 1975 1976 return 0; 1976 1977 } 1977 - #endif 1978 1978 1979 1979 #ifdef CONFIG_DEV_COREDUMP 1980 1980 static void nxp_serdev_coredump(struct device *dev)
+35 -23
drivers/bluetooth/btqca.c
··· 581 581 582 582 ret = request_firmware(&fw, config->fwname, &hdev->dev); 583 583 if (ret) { 584 - /* For WCN6750, if mbn file is not present then check for 585 - * tlv file. 586 - */ 587 - if (soc_type == QCA_WCN6750 && config->type == ELF_TYPE_PATCH) { 588 - bt_dev_dbg(hdev, "QCA Failed to request file: %s (%d)", 589 - config->fwname, ret); 590 - config->type = TLV_TYPE_PATCH; 591 - snprintf(config->fwname, sizeof(config->fwname), 592 - "qca/msbtfw%02x.tlv", rom_ver); 593 - bt_dev_info(hdev, "QCA Downloading %s", config->fwname); 594 - ret = request_firmware(&fw, config->fwname, &hdev->dev); 595 - if (ret) { 596 - bt_dev_err(hdev, "QCA Failed to request file: %s (%d)", 597 - config->fwname, ret); 598 - return ret; 599 - } 600 - } 601 584 /* If the board-specific file is missing, try loading the default 602 585 * one, unless that was attempted already. 603 586 */ 604 - else if (config->type == TLV_TYPE_NVM && 605 - qca_get_alt_nvm_file(config->fwname, sizeof(config->fwname))) { 587 + if (config->type == TLV_TYPE_NVM && 588 + qca_get_alt_nvm_file(config->fwname, sizeof(config->fwname))) { 606 589 bt_dev_info(hdev, "QCA Downloading %s", config->fwname); 607 590 ret = request_firmware(&fw, config->fwname, &hdev->dev); 608 591 if (ret) { ··· 830 847 "qca/msbtfw%02x.mbn", rom_ver); 831 848 break; 832 849 case QCA_WCN6855: 850 + /* Due to historical reasons, WCN685x chip has been using firmware 851 + * without the "wcn" prefix. The mapping between the chip and its 852 + * corresponding firmware has now been corrected. 853 + */ 833 854 snprintf(config.fwname, sizeof(config.fwname), 834 - "qca/hpbtfw%02x.tlv", rom_ver); 855 + "qca/wcnhpbtfw%02x.tlv", rom_ver); 835 856 break; 836 857 case QCA_WCN7850: 837 858 snprintf(config.fwname, sizeof(config.fwname), ··· 848 861 } 849 862 850 863 err = qca_download_firmware(hdev, &config, soc_type, rom_ver); 864 + /* For WCN6750, if mbn file is not present then check for 865 + * tlv file. 866 + */ 867 + if (err < 0 && soc_type == QCA_WCN6750) { 868 + bt_dev_dbg(hdev, "QCA Failed to request file: %s (%d)", 869 + config.fwname, err); 870 + config.type = TLV_TYPE_PATCH; 871 + snprintf(config.fwname, sizeof(config.fwname), 872 + "qca/msbtfw%02x.tlv", rom_ver); 873 + bt_dev_info(hdev, "QCA Downloading %s", config.fwname); 874 + err = qca_download_firmware(hdev, &config, soc_type, rom_ver); 875 + } else if (err < 0 && !rampatch_name && soc_type == QCA_WCN6855) { 876 + snprintf(config.fwname, sizeof(config.fwname), 877 + "qca/hpbtfw%02x.tlv", rom_ver); 878 + err = qca_download_firmware(hdev, &config, soc_type, rom_ver); 879 + } 880 + 851 881 if (err < 0) { 852 - bt_dev_err(hdev, "QCA Failed to download patch (%d)", err); 882 + bt_dev_err(hdev, "QCA Failed to request file: %s (%d)", 883 + config.fwname, err); 853 884 return err; 854 885 } 855 886 ··· 928 923 case QCA_WCN6855: 929 924 qca_read_fw_board_id(hdev, &boardid); 930 925 qca_get_nvm_name_by_board(config.fwname, sizeof(config.fwname), 931 - "hpnv", soc_type, ver, rom_ver, boardid); 926 + "wcnhpnv", soc_type, ver, rom_ver, boardid); 932 927 break; 933 928 case QCA_WCN7850: 934 929 qca_get_nvm_name_by_board(config.fwname, sizeof(config.fwname), ··· 941 936 } 942 937 943 938 err = qca_download_firmware(hdev, &config, soc_type, rom_ver); 939 + if (err < 0 && !firmware_name && soc_type == QCA_WCN6855) { 940 + qca_get_nvm_name_by_board(config.fwname, sizeof(config.fwname), 941 + "hpnv", soc_type, ver, rom_ver, boardid); 942 + err = qca_download_firmware(hdev, &config, soc_type, rom_ver); 943 + } 944 + 944 945 if (err < 0) { 945 - bt_dev_err(hdev, "QCA Failed to download NVM (%d)", err); 946 + bt_dev_err(hdev, "QCA Failed to request file: %s (%d)", 947 + config.fwname, err); 946 948 return err; 947 949 } 948 950
+15 -11
drivers/bluetooth/btusb.c
··· 521 521 { USB_DEVICE(0x0bda, 0xb850), .driver_info = BTUSB_REALTEK }, 522 522 { USB_DEVICE(0x13d3, 0x3600), .driver_info = BTUSB_REALTEK }, 523 523 { USB_DEVICE(0x13d3, 0x3601), .driver_info = BTUSB_REALTEK }, 524 + { USB_DEVICE(0x0489, 0xe112), .driver_info = BTUSB_REALTEK | 525 + BTUSB_WIDEBAND_SPEECH }, 524 526 525 527 /* Realtek 8851BU Bluetooth devices */ 526 528 { USB_DEVICE(0x3625, 0x010b), .driver_info = BTUSB_REALTEK | 527 529 BTUSB_WIDEBAND_SPEECH }, 528 530 { USB_DEVICE(0x2001, 0x332a), .driver_info = BTUSB_REALTEK | 531 + BTUSB_WIDEBAND_SPEECH }, 532 + { USB_DEVICE(0x7392, 0xe611), .driver_info = BTUSB_REALTEK | 529 533 BTUSB_WIDEBAND_SPEECH }, 530 534 531 535 /* Realtek 8852AE Bluetooth devices */ ··· 561 557 BTUSB_WIDEBAND_SPEECH }, 562 558 { USB_DEVICE(0x13d3, 0x3592), .driver_info = BTUSB_REALTEK | 563 559 BTUSB_WIDEBAND_SPEECH }, 560 + { USB_DEVICE(0x13d3, 0x3612), .driver_info = BTUSB_REALTEK | 561 + BTUSB_WIDEBAND_SPEECH }, 564 562 { USB_DEVICE(0x0489, 0xe122), .driver_info = BTUSB_REALTEK | 565 563 BTUSB_WIDEBAND_SPEECH }, 566 564 ··· 582 576 { USB_DEVICE(0x13d3, 0x3572), .driver_info = BTUSB_REALTEK | 583 577 BTUSB_WIDEBAND_SPEECH }, 584 578 { USB_DEVICE(0x13d3, 0x3591), .driver_info = BTUSB_REALTEK | 585 - BTUSB_WIDEBAND_SPEECH }, 586 - { USB_DEVICE(0x13d3, 0x3618), .driver_info = BTUSB_REALTEK | 587 579 BTUSB_WIDEBAND_SPEECH }, 588 580 { USB_DEVICE(0x0489, 0xe123), .driver_info = BTUSB_REALTEK | 589 581 BTUSB_WIDEBAND_SPEECH }, ··· 640 636 { USB_DEVICE(0x13d3, 0x3621), .driver_info = BTUSB_MEDIATEK | 641 637 BTUSB_WIDEBAND_SPEECH }, 642 638 { USB_DEVICE(0x13d3, 0x3622), .driver_info = BTUSB_MEDIATEK | 639 + BTUSB_WIDEBAND_SPEECH }, 640 + { USB_DEVICE(0x0489, 0xe158), .driver_info = BTUSB_MEDIATEK | 643 641 BTUSB_WIDEBAND_SPEECH }, 644 642 645 643 /* Additional MediaTek MT7921 Bluetooth devices */ ··· 779 773 780 774 /* Additional Realtek 8723BU Bluetooth devices */ 781 775 { USB_DEVICE(0x7392, 0xa611), .driver_info = BTUSB_REALTEK }, 776 + { USB_DEVICE(0x2c0a, 0x8761), .driver_info = BTUSB_REALTEK }, 782 777 783 778 /* Additional Realtek 8723DE Bluetooth devices */ 784 779 { USB_DEVICE(0x0bda, 0xb009), .driver_info = BTUSB_REALTEK }, ··· 4469 4462 kfree(data); 4470 4463 } 4471 4464 4472 - #ifdef CONFIG_PM 4473 4465 static int btusb_suspend(struct usb_interface *intf, pm_message_t message) 4474 4466 { 4475 4467 struct btusb_data *data = usb_get_intfdata(intf); 4476 4468 4477 4469 BT_DBG("intf %p", intf); 4478 4470 4479 - /* Don't auto-suspend if there are connections; external suspend calls 4480 - * shall never fail. 4471 + /* Don't auto-suspend if there are connections or discovery in 4472 + * progress; external suspend calls shall never fail. 4481 4473 */ 4482 - if (PMSG_IS_AUTO(message) && hci_conn_count(data->hdev)) 4474 + if (PMSG_IS_AUTO(message) && 4475 + (hci_conn_count(data->hdev) || hci_discovery_active(data->hdev))) 4483 4476 return -EBUSY; 4484 4477 4485 4478 if (data->suspend_count++) ··· 4623 4616 4624 4617 return err; 4625 4618 } 4626 - #endif 4627 4619 4628 4620 #ifdef CONFIG_DEV_COREDUMP 4629 4621 static void btusb_coredump(struct device *dev) ··· 4639 4633 .name = "btusb", 4640 4634 .probe = btusb_probe, 4641 4635 .disconnect = btusb_disconnect, 4642 - #ifdef CONFIG_PM 4643 - .suspend = btusb_suspend, 4644 - .resume = btusb_resume, 4645 - #endif 4636 + .suspend = pm_ptr(btusb_suspend), 4637 + .resume = pm_ptr(btusb_resume), 4646 4638 .id_table = btusb_table, 4647 4639 .supports_autosuspend = 1, 4648 4640 .disable_hub_initiated_lpm = 1,
+7 -4
drivers/bluetooth/hci_bcm4377.c
··· 2416 2416 hdev); 2417 2417 } 2418 2418 2419 - static int bcm4377_suspend(struct pci_dev *pdev, pm_message_t state) 2419 + static int bcm4377_suspend(struct device *dev) 2420 2420 { 2421 + struct pci_dev *pdev = to_pci_dev(dev); 2421 2422 struct bcm4377_data *bcm4377 = pci_get_drvdata(pdev); 2422 2423 int ret; 2423 2424 ··· 2432 2431 return 0; 2433 2432 } 2434 2433 2435 - static int bcm4377_resume(struct pci_dev *pdev) 2434 + static int bcm4377_resume(struct device *dev) 2436 2435 { 2436 + struct pci_dev *pdev = to_pci_dev(dev); 2437 2437 struct bcm4377_data *bcm4377 = pci_get_drvdata(pdev); 2438 2438 2439 2439 iowrite32(BCM4377_BAR0_SLEEP_CONTROL_UNQUIESCE, ··· 2442 2440 2443 2441 return hci_resume_dev(bcm4377->hdev); 2444 2442 } 2443 + 2444 + static DEFINE_SIMPLE_DEV_PM_OPS(bcm4377_ops, bcm4377_suspend, bcm4377_resume); 2445 2445 2446 2446 static const struct dmi_system_id bcm4377_dmi_board_table[] = { 2447 2447 { ··· 2545 2541 .name = "hci_bcm4377", 2546 2542 .id_table = bcm4377_devid_table, 2547 2543 .probe = bcm4377_probe, 2548 - .suspend = bcm4377_suspend, 2549 - .resume = bcm4377_resume, 2544 + .driver.pm = &bcm4377_ops, 2550 2545 }; 2551 2546 module_pci_driver(bcm4377_pci_driver); 2552 2547
+2 -8
drivers/bluetooth/hci_intel.c
··· 126 126 return err; 127 127 } 128 128 129 - #ifdef CONFIG_PM 130 129 static int intel_wait_lpm_transaction(struct hci_uart *hu) 131 130 { 132 131 struct intel_data *intel = hu->priv; ··· 236 237 237 238 return 0; 238 239 } 239 - #endif /* CONFIG_PM */ 240 240 241 241 static int intel_lpm_host_wake(struct hci_uart *hu) 242 242 { ··· 1064 1066 MODULE_DEVICE_TABLE(acpi, intel_acpi_match); 1065 1067 #endif 1066 1068 1067 - #ifdef CONFIG_PM 1068 1069 static int intel_suspend_device(struct device *dev) 1069 1070 { 1070 1071 struct intel_device *idev = dev_get_drvdata(dev); ··· 1087 1090 1088 1091 return 0; 1089 1092 } 1090 - #endif 1091 1093 1092 - #ifdef CONFIG_PM_SLEEP 1093 - static int intel_suspend(struct device *dev) 1094 + static int __maybe_unused intel_suspend(struct device *dev) 1094 1095 { 1095 1096 struct intel_device *idev = dev_get_drvdata(dev); 1096 1097 ··· 1098 1103 return intel_suspend_device(dev); 1099 1104 } 1100 1105 1101 - static int intel_resume(struct device *dev) 1106 + static int __maybe_unused intel_resume(struct device *dev) 1102 1107 { 1103 1108 struct intel_device *idev = dev_get_drvdata(dev); 1104 1109 ··· 1107 1112 1108 1113 return intel_resume_device(dev); 1109 1114 } 1110 - #endif 1111 1115 1112 1116 static const struct dev_pm_ops intel_pm_ops = { 1113 1117 SET_SYSTEM_SLEEP_PM_OPS(intel_suspend, intel_resume)
+2 -2
drivers/bluetooth/hci_ldisc.c
··· 685 685 return err; 686 686 } 687 687 688 + set_bit(HCI_UART_PROTO_INIT, &hu->flags); 689 + 688 690 if (test_bit(HCI_UART_INIT_PENDING, &hu->hdev_flags)) 689 691 return 0; 690 692 ··· 713 711 return -EPROTONOSUPPORT; 714 712 715 713 hu->proto = p; 716 - 717 - set_bit(HCI_UART_PROTO_INIT, &hu->flags); 718 714 719 715 err = hci_uart_register_dev(hu); 720 716 if (err) {
+46 -6
drivers/bluetooth/hci_qca.c
··· 87 87 enum qca_capabilities { 88 88 QCA_CAP_WIDEBAND_SPEECH = BIT(0), 89 89 QCA_CAP_VALID_LE_STATES = BIT(1), 90 + QCA_CAP_HFP_HW_OFFLOAD = BIT(2), 90 91 }; 91 92 92 93 /* HCI_IBS transmit side sleep protocol states */ ··· 230 229 u32 init_speed; 231 230 u32 oper_speed; 232 231 bool bdaddr_property_broken; 232 + bool support_hfp_hw_offload; 233 233 const char *firmware_name[2]; 234 234 }; 235 235 ··· 1655 1653 skb_queue_purge(&qca->rx_memdump_q); 1656 1654 } 1657 1655 1656 + /* 1657 + * If the BT chip's bt_en pin is connected to a 3.3V power supply via 1658 + * hardware and always stays high, driver cannot control the bt_en pin. 1659 + * As a result, during SSR (SubSystem Restart), QCA_SSR_TRIGGERED and 1660 + * QCA_IBS_DISABLED flags cannot be cleared, which leads to a reset 1661 + * command timeout. 1662 + * Add an msleep delay to ensure controller completes the SSR process. 1663 + * 1664 + * Host will not download the firmware after SSR, controller to remain 1665 + * in the IBS_WAKE state, and the host needs to synchronize with it 1666 + * 1667 + * Since the bluetooth chip has been reset, clear the memdump state. 1668 + */ 1669 + if (!hci_test_quirk(hu->hdev, HCI_QUIRK_NON_PERSISTENT_SETUP)) { 1670 + /* 1671 + * When the SSR (SubSystem Restart) duration exceeds 2 seconds, 1672 + * it triggers host tx_idle_delay, which sets host TX state 1673 + * to sleep. Reset tx_idle_timer after SSR to prevent 1674 + * host enter TX IBS_Sleep mode. 1675 + */ 1676 + mod_timer(&qca->tx_idle_timer, jiffies + 1677 + msecs_to_jiffies(qca->tx_idle_delay)); 1678 + 1679 + /* Controller reset completion time is 50ms */ 1680 + msleep(50); 1681 + 1682 + clear_bit(QCA_SSR_TRIGGERED, &qca->flags); 1683 + clear_bit(QCA_IBS_DISABLED, &qca->flags); 1684 + 1685 + qca->tx_ibs_state = HCI_IBS_TX_AWAKE; 1686 + qca->memdump_state = QCA_MEMDUMP_IDLE; 1687 + } 1688 + 1658 1689 clear_bit(QCA_HW_ERROR_EVENT, &qca->flags); 1659 1690 } 1660 1691 ··· 1914 1879 const char *rampatch_name = qca_get_rampatch_name(hu); 1915 1880 int ret; 1916 1881 struct qca_btsoc_version ver; 1917 - struct qca_serdev *qcadev; 1882 + struct qca_serdev *qcadev = serdev_device_get_drvdata(hu->serdev); 1918 1883 const char *soc_name; 1919 1884 1920 1885 ret = qca_check_speeds(hu); ··· 1978 1943 case QCA_WCN6750: 1979 1944 case QCA_WCN6855: 1980 1945 case QCA_WCN7850: 1981 - qcadev = serdev_device_get_drvdata(hu->serdev); 1982 1946 if (qcadev->bdaddr_property_broken) 1983 1947 hci_set_quirk(hdev, HCI_QUIRK_BDADDR_PROPERTY_BROKEN); 1984 1948 ··· 2067 2033 else 2068 2034 hu->hdev->set_bdaddr = qca_set_bdaddr; 2069 2035 2070 - if (soc_type == QCA_QCA2066) 2036 + if (qcadev->support_hfp_hw_offload) 2071 2037 qca_configure_hfp_offload(hdev); 2072 2038 2073 2039 qca->fw_version = le16_to_cpu(ver.patch_ver); ··· 2151 2117 static const struct qca_device_data qca_soc_data_qca2066 __maybe_unused = { 2152 2118 .soc_type = QCA_QCA2066, 2153 2119 .num_vregs = 0, 2154 - .capabilities = QCA_CAP_WIDEBAND_SPEECH | QCA_CAP_VALID_LE_STATES, 2120 + .capabilities = QCA_CAP_WIDEBAND_SPEECH | QCA_CAP_VALID_LE_STATES | 2121 + QCA_CAP_HFP_HW_OFFLOAD, 2155 2122 }; 2156 2123 2157 2124 static const struct qca_device_data qca_soc_data_qca6390 __maybe_unused = { ··· 2188 2153 { "vddrfa1p2", 257000 }, 2189 2154 }, 2190 2155 .num_vregs = 6, 2191 - .capabilities = QCA_CAP_WIDEBAND_SPEECH | QCA_CAP_VALID_LE_STATES, 2156 + .capabilities = QCA_CAP_WIDEBAND_SPEECH | QCA_CAP_VALID_LE_STATES | 2157 + QCA_CAP_HFP_HW_OFFLOAD, 2192 2158 }; 2193 2159 2194 2160 static const struct qca_device_data qca_soc_data_wcn7850 __maybe_unused = { ··· 2203 2167 { "vddrfa1p9", 302000 }, 2204 2168 }, 2205 2169 .num_vregs = 6, 2206 - .capabilities = QCA_CAP_WIDEBAND_SPEECH | QCA_CAP_VALID_LE_STATES, 2170 + .capabilities = QCA_CAP_WIDEBAND_SPEECH | QCA_CAP_VALID_LE_STATES | 2171 + QCA_CAP_HFP_HW_OFFLOAD, 2207 2172 }; 2208 2173 2209 2174 static void qca_power_shutdown(struct hci_uart *hu) ··· 2539 2502 2540 2503 if (!(data->capabilities & QCA_CAP_VALID_LE_STATES)) 2541 2504 hci_set_quirk(hdev, HCI_QUIRK_BROKEN_LE_STATES); 2505 + 2506 + if (data->capabilities & QCA_CAP_HFP_HW_OFFLOAD) 2507 + qcadev->support_hfp_hw_offload = true; 2542 2508 } 2543 2509 2544 2510 return 0;
+28 -19
include/net/bluetooth/bluetooth.h
··· 130 130 #define BT_RCVMTU 13 131 131 #define BT_PHY 14 132 132 133 - #define BT_PHY_BR_1M_1SLOT 0x00000001 134 - #define BT_PHY_BR_1M_3SLOT 0x00000002 135 - #define BT_PHY_BR_1M_5SLOT 0x00000004 136 - #define BT_PHY_EDR_2M_1SLOT 0x00000008 137 - #define BT_PHY_EDR_2M_3SLOT 0x00000010 138 - #define BT_PHY_EDR_2M_5SLOT 0x00000020 139 - #define BT_PHY_EDR_3M_1SLOT 0x00000040 140 - #define BT_PHY_EDR_3M_3SLOT 0x00000080 141 - #define BT_PHY_EDR_3M_5SLOT 0x00000100 142 - #define BT_PHY_LE_1M_TX 0x00000200 143 - #define BT_PHY_LE_1M_RX 0x00000400 144 - #define BT_PHY_LE_2M_TX 0x00000800 145 - #define BT_PHY_LE_2M_RX 0x00001000 146 - #define BT_PHY_LE_CODED_TX 0x00002000 147 - #define BT_PHY_LE_CODED_RX 0x00004000 133 + #define BT_PHY_BR_1M_1SLOT BIT(0) 134 + #define BT_PHY_BR_1M_3SLOT BIT(1) 135 + #define BT_PHY_BR_1M_5SLOT BIT(2) 136 + #define BT_PHY_EDR_2M_1SLOT BIT(3) 137 + #define BT_PHY_EDR_2M_3SLOT BIT(4) 138 + #define BT_PHY_EDR_2M_5SLOT BIT(5) 139 + #define BT_PHY_EDR_3M_1SLOT BIT(6) 140 + #define BT_PHY_EDR_3M_3SLOT BIT(7) 141 + #define BT_PHY_EDR_3M_5SLOT BIT(8) 142 + #define BT_PHY_LE_1M_TX BIT(9) 143 + #define BT_PHY_LE_1M_RX BIT(10) 144 + #define BT_PHY_LE_2M_TX BIT(11) 145 + #define BT_PHY_LE_2M_RX BIT(12) 146 + #define BT_PHY_LE_CODED_TX BIT(13) 147 + #define BT_PHY_LE_CODED_RX BIT(14) 148 + 149 + #define BT_PHY_BREDR_MASK (BT_PHY_BR_1M_1SLOT | BT_PHY_BR_1M_3SLOT | \ 150 + BT_PHY_BR_1M_5SLOT | BT_PHY_EDR_2M_1SLOT | \ 151 + BT_PHY_EDR_2M_3SLOT | BT_PHY_EDR_2M_5SLOT | \ 152 + BT_PHY_EDR_3M_1SLOT | BT_PHY_EDR_3M_3SLOT | \ 153 + BT_PHY_EDR_3M_5SLOT) 154 + #define BT_PHY_LE_MASK (BT_PHY_LE_1M_TX | BT_PHY_LE_1M_RX | \ 155 + BT_PHY_LE_2M_TX | BT_PHY_LE_2M_RX | \ 156 + BT_PHY_LE_CODED_TX | BT_PHY_LE_CODED_RX) 148 157 149 158 #define BT_MODE 15 150 159 ··· 182 173 __u32 interval; 183 174 __u16 latency; 184 175 __u16 sdu; 185 - __u8 phy; 176 + __u8 phys; 186 177 __u8 rtn; 187 178 }; 188 179 ··· 221 212 }; 222 213 }; 223 214 224 - #define BT_ISO_PHY_1M 0x01 225 - #define BT_ISO_PHY_2M 0x02 226 - #define BT_ISO_PHY_CODED 0x04 215 + #define BT_ISO_PHY_1M BIT(0) 216 + #define BT_ISO_PHY_2M BIT(1) 217 + #define BT_ISO_PHY_CODED BIT(2) 227 218 #define BT_ISO_PHY_ANY (BT_ISO_PHY_1M | BT_ISO_PHY_2M | \ 228 219 BT_ISO_PHY_CODED) 229 220
+334 -2
include/net/bluetooth/hci.h
··· 654 654 #define HCI_LE_ISO_BROADCASTER 0x40 655 655 #define HCI_LE_ISO_SYNC_RECEIVER 0x80 656 656 #define HCI_LE_LL_EXT_FEATURE 0x80 657 + #define HCI_LE_CS 0x40 658 + #define HCI_LE_CS_HOST 0x80 657 659 658 660 /* Connection modes */ 659 661 #define HCI_CM_ACTIVE 0x0000 ··· 1885 1883 #define HCI_LE_SET_PHY_2M 0x02 1886 1884 #define HCI_LE_SET_PHY_CODED 0x04 1887 1885 1886 + #define HCI_OP_LE_SET_PHY 0x2032 1887 + struct hci_cp_le_set_phy { 1888 + __le16 handle; 1889 + __u8 all_phys; 1890 + __u8 tx_phys; 1891 + __u8 rx_phys; 1892 + __le16 phy_opts; 1893 + } __packed; 1894 + 1888 1895 #define HCI_OP_LE_SET_EXT_SCAN_PARAMS 0x2041 1889 1896 struct hci_cp_le_set_ext_scan_params { 1890 1897 __u8 own_addr_type; ··· 2147 2136 __u8 cis_id; 2148 2137 __le16 c_sdu; 2149 2138 __le16 p_sdu; 2150 - __u8 c_phy; 2151 - __u8 p_phy; 2139 + __u8 c_phys; 2140 + __u8 p_phys; 2152 2141 __u8 c_rtn; 2153 2142 __u8 p_rtn; 2154 2143 } __packed; ··· 2279 2268 __le16 handle; 2280 2269 __u8 pages; 2281 2270 } __packed; 2271 + 2272 + /* Channel Sounding Commands */ 2273 + #define HCI_OP_LE_CS_RD_LOCAL_SUPP_CAP 0x2089 2274 + struct hci_rp_le_cs_rd_local_supp_cap { 2275 + __u8 status; 2276 + __u8 num_config_supported; 2277 + __le16 max_consecutive_procedures_supported; 2278 + __u8 num_antennas_supported; 2279 + __u8 max_antenna_paths_supported; 2280 + __u8 roles_supported; 2281 + __u8 modes_supported; 2282 + __u8 rtt_capability; 2283 + __u8 rtt_aa_only_n; 2284 + __u8 rtt_sounding_n; 2285 + __u8 rtt_random_payload_n; 2286 + __le16 nadm_sounding_capability; 2287 + __le16 nadm_random_capability; 2288 + __u8 cs_sync_phys_supported; 2289 + __le16 subfeatures_supported; 2290 + __le16 t_ip1_times_supported; 2291 + __le16 t_ip2_times_supported; 2292 + __le16 t_fcs_times_supported; 2293 + __le16 t_pm_times_supported; 2294 + __u8 t_sw_time_supported; 2295 + __u8 tx_snr_capability; 2296 + } __packed; 2297 + 2298 + #define HCI_OP_LE_CS_RD_RMT_SUPP_CAP 0x208A 2299 + struct hci_cp_le_cs_rd_local_supp_cap { 2300 + __le16 handle; 2301 + } __packed; 2302 + 2303 + #define HCI_OP_LE_CS_WR_CACHED_RMT_SUPP_CAP 0x208B 2304 + struct hci_cp_le_cs_wr_cached_rmt_supp_cap { 2305 + __le16 handle; 2306 + __u8 num_config_supported; 2307 + __le16 max_consecutive_procedures_supported; 2308 + __u8 num_antennas_supported; 2309 + __u8 max_antenna_paths_supported; 2310 + __u8 roles_supported; 2311 + __u8 modes_supported; 2312 + __u8 rtt_capability; 2313 + __u8 rtt_aa_only_n; 2314 + __u8 rtt_sounding_n; 2315 + __u8 rtt_random_payload_n; 2316 + __le16 nadm_sounding_capability; 2317 + __le16 nadm_random_capability; 2318 + __u8 cs_sync_phys_supported; 2319 + __le16 subfeatures_supported; 2320 + __le16 t_ip1_times_supported; 2321 + __le16 t_ip2_times_supported; 2322 + __le16 t_fcs_times_supported; 2323 + __le16 t_pm_times_supported; 2324 + __u8 t_sw_time_supported; 2325 + __u8 tx_snr_capability; 2326 + } __packed; 2327 + 2328 + struct hci_rp_le_cs_wr_cached_rmt_supp_cap { 2329 + __u8 status; 2330 + __le16 handle; 2331 + } __packed; 2332 + 2333 + #define HCI_OP_LE_CS_SEC_ENABLE 0x208C 2334 + struct hci_cp_le_cs_sec_enable { 2335 + __le16 handle; 2336 + } __packed; 2337 + 2338 + #define HCI_OP_LE_CS_SET_DEFAULT_SETTINGS 0x208D 2339 + struct hci_cp_le_cs_set_default_settings { 2340 + __le16 handle; 2341 + __u8 role_enable; 2342 + __u8 cs_sync_ant_sel; 2343 + __s8 max_tx_power; 2344 + } __packed; 2345 + 2346 + struct hci_rp_le_cs_set_default_settings { 2347 + __u8 status; 2348 + __le16 handle; 2349 + } __packed; 2350 + 2351 + #define HCI_OP_LE_CS_RD_RMT_FAE_TABLE 0x208E 2352 + struct hci_cp_le_cs_rd_rmt_fae_table { 2353 + __le16 handle; 2354 + } __packed; 2355 + 2356 + #define HCI_OP_LE_CS_WR_CACHED_RMT_FAE_TABLE 0x208F 2357 + struct hci_cp_le_cs_wr_rmt_cached_fae_table { 2358 + __le16 handle; 2359 + __u8 remote_fae_table[72]; 2360 + } __packed; 2361 + 2362 + struct hci_rp_le_cs_wr_rmt_cached_fae_table { 2363 + __u8 status; 2364 + __le16 handle; 2365 + } __packed; 2366 + 2367 + #define HCI_OP_LE_CS_CREATE_CONFIG 0x2090 2368 + struct hci_cp_le_cs_create_config { 2369 + __le16 handle; 2370 + __u8 config_id; 2371 + __u8 create_context; 2372 + __u8 main_mode_type; 2373 + __u8 sub_mode_type; 2374 + __u8 min_main_mode_steps; 2375 + __u8 max_main_mode_steps; 2376 + __u8 main_mode_repetition; 2377 + __u8 mode_0_steps; 2378 + __u8 role; 2379 + __u8 rtt_type; 2380 + __u8 cs_sync_phy; 2381 + __u8 channel_map[10]; 2382 + __u8 channel_map_repetition; 2383 + __u8 channel_selection_type; 2384 + __u8 ch3c_shape; 2385 + __u8 ch3c_jump; 2386 + __u8 reserved; 2387 + } __packed; 2388 + 2389 + #define HCI_OP_LE_CS_REMOVE_CONFIG 0x2091 2390 + struct hci_cp_le_cs_remove_config { 2391 + __le16 handle; 2392 + __u8 config_id; 2393 + } __packed; 2394 + 2395 + #define HCI_OP_LE_CS_SET_CH_CLASSIFICATION 0x2092 2396 + struct hci_cp_le_cs_set_ch_classification { 2397 + __u8 ch_classification[10]; 2398 + } __packed; 2399 + 2400 + struct hci_rp_le_cs_set_ch_classification { 2401 + __u8 status; 2402 + } __packed; 2403 + 2404 + #define HCI_OP_LE_CS_SET_PROC_PARAM 0x2093 2405 + struct hci_cp_le_cs_set_proc_param { 2406 + __le16 handle; 2407 + __u8 config_id; 2408 + __le16 max_procedure_len; 2409 + __le16 min_procedure_interval; 2410 + __le16 max_procedure_interval; 2411 + __le16 max_procedure_count; 2412 + __u8 min_subevent_len[3]; 2413 + __u8 max_subevent_len[3]; 2414 + __u8 tone_antenna_config_selection; 2415 + __u8 phy; 2416 + __u8 tx_power_delta; 2417 + __u8 preferred_peer_antenna; 2418 + __u8 snr_control_initiator; 2419 + __u8 snr_control_reflector; 2420 + } __packed; 2421 + 2422 + struct hci_rp_le_cs_set_proc_param { 2423 + __u8 status; 2424 + __le16 handle; 2425 + } __packed; 2426 + 2427 + #define HCI_OP_LE_CS_SET_PROC_ENABLE 0x2094 2428 + struct hci_cp_le_cs_set_proc_enable { 2429 + __le16 handle; 2430 + __u8 config_id; 2431 + __u8 enable; 2432 + } __packed; 2433 + 2434 + #define HCI_OP_LE_CS_TEST 0x2095 2435 + struct hci_cp_le_cs_test { 2436 + __u8 main_mode_type; 2437 + __u8 sub_mode_type; 2438 + __u8 main_mode_repetition; 2439 + __u8 mode_0_steps; 2440 + __u8 role; 2441 + __u8 rtt_type; 2442 + __u8 cs_sync_phy; 2443 + __u8 cs_sync_antenna_selection; 2444 + __u8 subevent_len[3]; 2445 + __le16 subevent_interval; 2446 + __u8 max_num_subevents; 2447 + __u8 transmit_power_level; 2448 + __u8 t_ip1_time; 2449 + __u8 t_ip2_time; 2450 + __u8 t_fcs_time; 2451 + __u8 t_pm_time; 2452 + __u8 t_sw_time; 2453 + __u8 tone_antenna_config_selection; 2454 + __u8 reserved; 2455 + __u8 snr_control_initiator; 2456 + __u8 snr_control_reflector; 2457 + __le16 drbg_nonce; 2458 + __u8 channel_map_repetition; 2459 + __le16 override_config; 2460 + __u8 override_parameters_length; 2461 + __u8 override_parameters_data[]; 2462 + } __packed; 2463 + 2464 + struct hci_rp_le_cs_test { 2465 + __u8 status; 2466 + } __packed; 2467 + 2468 + #define HCI_OP_LE_CS_TEST_END 0x2096 2282 2469 2283 2470 /* ---- HCI Events ---- */ 2284 2471 struct hci_ev_status { ··· 3167 2958 __u8 max_pages; 3168 2959 __u8 valid_pages; 3169 2960 __u8 features[248]; 2961 + } __packed; 2962 + 2963 + /* Channel Sounding Events */ 2964 + #define HCI_EVT_LE_CS_READ_RMT_SUPP_CAP_COMPLETE 0x2C 2965 + struct hci_evt_le_cs_read_rmt_supp_cap_complete { 2966 + __u8 status; 2967 + __le16 handle; 2968 + __u8 num_configs_supp; 2969 + __le16 max_consec_proc_supp; 2970 + __u8 num_ant_supp; 2971 + __u8 max_ant_path_supp; 2972 + __u8 roles_supp; 2973 + __u8 modes_supp; 2974 + __u8 rtt_cap; 2975 + __u8 rtt_aa_only_n; 2976 + __u8 rtt_sounding_n; 2977 + __u8 rtt_rand_payload_n; 2978 + __le16 nadm_sounding_cap; 2979 + __le16 nadm_rand_cap; 2980 + __u8 cs_sync_phys_supp; 2981 + __le16 sub_feat_supp; 2982 + __le16 t_ip1_times_supp; 2983 + __le16 t_ip2_times_supp; 2984 + __le16 t_fcs_times_supp; 2985 + __le16 t_pm_times_supp; 2986 + __u8 t_sw_times_supp; 2987 + __u8 tx_snr_cap; 2988 + } __packed; 2989 + 2990 + #define HCI_EVT_LE_CS_READ_RMT_FAE_TABLE_COMPLETE 0x2D 2991 + struct hci_evt_le_cs_read_rmt_fae_table_complete { 2992 + __u8 status; 2993 + __le16 handle; 2994 + __u8 remote_fae_table[72]; 2995 + } __packed; 2996 + 2997 + #define HCI_EVT_LE_CS_SECURITY_ENABLE_COMPLETE 0x2E 2998 + struct hci_evt_le_cs_security_enable_complete { 2999 + __u8 status; 3000 + __le16 handle; 3001 + } __packed; 3002 + 3003 + #define HCI_EVT_LE_CS_CONFIG_COMPLETE 0x2F 3004 + struct hci_evt_le_cs_config_complete { 3005 + __u8 status; 3006 + __le16 handle; 3007 + __u8 config_id; 3008 + __u8 action; 3009 + __u8 main_mode_type; 3010 + __u8 sub_mode_type; 3011 + __u8 min_main_mode_steps; 3012 + __u8 max_main_mode_steps; 3013 + __u8 main_mode_rep; 3014 + __u8 mode_0_steps; 3015 + __u8 role; 3016 + __u8 rtt_type; 3017 + __u8 cs_sync_phy; 3018 + __u8 channel_map[10]; 3019 + __u8 channel_map_rep; 3020 + __u8 channel_sel_type; 3021 + __u8 ch3c_shape; 3022 + __u8 ch3c_jump; 3023 + __u8 reserved; 3024 + __u8 t_ip1_time; 3025 + __u8 t_ip2_time; 3026 + __u8 t_fcs_time; 3027 + __u8 t_pm_time; 3028 + } __packed; 3029 + 3030 + #define HCI_EVT_LE_CS_PROCEDURE_ENABLE_COMPLETE 0x30 3031 + struct hci_evt_le_cs_procedure_enable_complete { 3032 + __u8 status; 3033 + __le16 handle; 3034 + __u8 config_id; 3035 + __u8 state; 3036 + __u8 tone_ant_config_sel; 3037 + __s8 sel_tx_pwr; 3038 + __u8 sub_evt_len[3]; 3039 + __u8 sub_evts_per_evt; 3040 + __le16 sub_evt_intrvl; 3041 + __le16 evt_intrvl; 3042 + __le16 proc_intrvl; 3043 + __le16 proc_counter; 3044 + __le16 max_proc_len; 3045 + } __packed; 3046 + 3047 + #define HCI_EVT_LE_CS_SUBEVENT_RESULT 0x31 3048 + struct hci_evt_le_cs_subevent_result { 3049 + __le16 handle; 3050 + __u8 config_id; 3051 + __le16 start_acl_conn_evt_counter; 3052 + __le16 proc_counter; 3053 + __le16 freq_comp; 3054 + __u8 ref_pwr_lvl; 3055 + __u8 proc_done_status; 3056 + __u8 subevt_done_status; 3057 + __u8 abort_reason; 3058 + __u8 num_ant_paths; 3059 + __u8 num_steps_reported; 3060 + __u8 step_mode[0]; /* depends on num_steps_reported */ 3061 + __u8 step_channel[0]; /* depends on num_steps_reported */ 3062 + __u8 step_data_length[0]; /* depends on num_steps_reported */ 3063 + __u8 step_data[0]; /* depends on num_steps_reported */ 3064 + } __packed; 3065 + 3066 + #define HCI_EVT_LE_CS_SUBEVENT_RESULT_CONTINUE 0x32 3067 + struct hci_evt_le_cs_subevent_result_continue { 3068 + __le16 handle; 3069 + __u8 config_id; 3070 + __u8 proc_done_status; 3071 + __u8 subevt_done_status; 3072 + __u8 abort_reason; 3073 + __u8 num_ant_paths; 3074 + __u8 num_steps_reported; 3075 + __u8 step_mode[0]; /* depends on num_steps_reported */ 3076 + __u8 step_channel[0]; /* depends on num_steps_reported */ 3077 + __u8 step_data_length[0]; /* depends on num_steps_reported */ 3078 + __u8 step_data[0]; /* depends on num_steps_reported */ 3079 + } __packed; 3080 + 3081 + #define HCI_EVT_LE_CS_TEST_END_COMPLETE 0x33 3082 + struct hci_evt_le_cs_test_end_complete { 3083 + __u8 status; 3170 3084 } __packed; 3171 3085 3172 3086 #define HCI_EV_VENDOR 0xff
+9
include/net/bluetooth/hci_core.h
··· 730 730 __u16 le_per_adv_data_offset; 731 731 __u8 le_adv_phy; 732 732 __u8 le_adv_sec_phy; 733 + __u8 le_tx_def_phys; 734 + __u8 le_rx_def_phys; 733 735 __u8 le_tx_phy; 734 736 __u8 le_rx_phy; 735 737 __s8 rssi; ··· 2073 2071 #define ll_ext_feature_capable(dev) \ 2074 2072 ((dev)->le_features[7] & HCI_LE_LL_EXT_FEATURE) 2075 2073 2074 + /* Channel sounding support */ 2075 + #define le_cs_capable(dev) \ 2076 + ((dev)->le_features[5] & HCI_LE_CS) 2077 + #define le_cs_host_capable(dev) \ 2078 + ((dev)->le_features[5] & HCI_LE_CS_HOST) 2079 + 2076 2080 #define mws_transport_config_capable(dev) (((dev)->commands[30] & 0x08) && \ 2077 2081 (!hci_test_quirk((dev), HCI_QUIRK_BROKEN_MWS_TRANSPORT_CONFIG))) 2078 2082 ··· 2342 2334 void *hci_recv_event_data(struct hci_dev *hdev, __u8 event); 2343 2335 2344 2336 u32 hci_conn_get_phy(struct hci_conn *conn); 2337 + int hci_conn_set_phy(struct hci_conn *conn, u32 phys); 2345 2338 2346 2339 /* ----- HCI Sockets ----- */ 2347 2340 void hci_send_to_sock(struct hci_dev *hdev, struct sk_buff *skb);
+3
include/net/bluetooth/hci_sync.h
··· 191 191 int hci_past_sync(struct hci_conn *conn, struct hci_conn *le); 192 192 193 193 int hci_le_read_remote_features(struct hci_conn *conn); 194 + 195 + int hci_acl_change_pkt_type(struct hci_conn *conn, u16 pkt_type); 196 + int hci_le_set_phy(struct hci_conn *conn, u8 tx_phys, u8 rx_phys);
+1 -2
include/net/bluetooth/l2cap.h
··· 655 655 656 656 struct sk_buff *rx_skb; 657 657 __u32 rx_len; 658 - __u8 tx_ident; 659 - struct mutex ident_lock; 658 + struct ida tx_ida; 660 659 661 660 struct sk_buff_head pending_rx; 662 661 struct work_struct pending_rx_work;
+137 -25
net/bluetooth/hci_conn.c
··· 1002 1002 switch (type) { 1003 1003 case ACL_LINK: 1004 1004 conn->pkt_type = hdev->pkt_type & ACL_PTYPE_MASK; 1005 + conn->link_policy = hdev->link_policy; 1005 1006 conn->mtu = hdev->acl_mtu; 1006 1007 break; 1007 1008 case LE_LINK: 1008 1009 /* conn->src should reflect the local identity address */ 1009 1010 hci_copy_identity_address(hdev, &conn->src, &conn->src_type); 1010 1011 conn->mtu = hdev->le_mtu ? hdev->le_mtu : hdev->acl_mtu; 1012 + /* Use the controller supported PHYS as default until the 1013 + * remote features are resolved. 1014 + */ 1015 + conn->le_tx_def_phys = hdev->le_tx_def_phys; 1016 + conn->le_rx_def_phys = hdev->le_tx_def_phys; 1011 1017 break; 1012 1018 case CIS_LINK: 1013 1019 /* conn->src should reflect the local identity address */ ··· 1825 1819 cp.bis.sdu = cpu_to_le16(qos->bcast.out.sdu); 1826 1820 cp.bis.latency = cpu_to_le16(qos->bcast.out.latency); 1827 1821 cp.bis.rtn = qos->bcast.out.rtn; 1828 - cp.bis.phy = qos->bcast.out.phy; 1822 + cp.bis.phy = qos->bcast.out.phys; 1829 1823 cp.bis.packing = qos->bcast.packing; 1830 1824 cp.bis.framing = qos->bcast.framing; 1831 1825 cp.bis.encryption = qos->bcast.encryption; ··· 1875 1869 cis->cis_id = cis_id; 1876 1870 cis->c_sdu = cpu_to_le16(conn->iso_qos.ucast.out.sdu); 1877 1871 cis->p_sdu = cpu_to_le16(conn->iso_qos.ucast.in.sdu); 1878 - cis->c_phy = qos->ucast.out.phy ? qos->ucast.out.phy : 1879 - qos->ucast.in.phy; 1880 - cis->p_phy = qos->ucast.in.phy ? qos->ucast.in.phy : 1881 - qos->ucast.out.phy; 1872 + cis->c_phys = qos->ucast.out.phys ? qos->ucast.out.phys : 1873 + qos->ucast.in.phys; 1874 + cis->p_phys = qos->ucast.in.phys ? qos->ucast.in.phys : 1875 + qos->ucast.out.phys; 1882 1876 cis->c_rtn = qos->ucast.out.rtn; 1883 1877 cis->p_rtn = qos->ucast.in.rtn; 1884 1878 } ··· 1980 1974 return cis; 1981 1975 1982 1976 /* Update LINK PHYs according to QoS preference */ 1983 - cis->le_tx_phy = qos->ucast.out.phy; 1984 - cis->le_rx_phy = qos->ucast.in.phy; 1977 + cis->le_tx_phy = qos->ucast.out.phys; 1978 + cis->le_rx_phy = qos->ucast.in.phys; 1985 1979 1986 1980 /* If output interval is not set use the input interval as it cannot be 1987 1981 * 0x000000. ··· 2096 2090 } 2097 2091 2098 2092 static void hci_iso_qos_setup(struct hci_dev *hdev, struct hci_conn *conn, 2099 - struct bt_iso_io_qos *qos, __u8 phy) 2093 + struct bt_iso_io_qos *qos, __u8 phys) 2100 2094 { 2101 2095 /* Only set MTU if PHY is enabled */ 2102 - if (!qos->sdu && qos->phy) 2096 + if (!qos->sdu && qos->phys) 2103 2097 qos->sdu = conn->mtu; 2104 2098 2105 2099 /* Use the same PHY as ACL if set to any */ 2106 - if (qos->phy == BT_ISO_PHY_ANY) 2107 - qos->phy = phy; 2100 + if (qos->phys == BT_ISO_PHY_ANY) 2101 + qos->phys = phys; 2108 2102 2109 2103 /* Use LE ACL connection interval if not set */ 2110 2104 if (!qos->interval) ··· 2124 2118 u32 flags = 0; 2125 2119 int err; 2126 2120 2127 - if (qos->bcast.out.phy == 0x02) 2121 + if (qos->bcast.out.phys == BIT(1)) 2128 2122 flags |= MGMT_ADV_FLAG_SEC_2M; 2129 2123 2130 2124 /* Align intervals */ ··· 2233 2227 return conn; 2234 2228 2235 2229 /* Update LINK PHYs according to QoS preference */ 2236 - conn->le_tx_phy = qos->bcast.out.phy; 2237 - conn->le_tx_phy = qos->bcast.out.phy; 2230 + conn->le_tx_def_phys = qos->bcast.out.phys; 2238 2231 2239 2232 /* Add Basic Announcement into Peridic Adv Data if BASE is set */ 2240 2233 if (base_len && base) { ··· 2242 2237 } 2243 2238 2244 2239 hci_iso_qos_setup(hdev, conn, &qos->bcast.out, 2245 - conn->le_tx_phy ? conn->le_tx_phy : 2240 + conn->le_tx_def_phys ? conn->le_tx_def_phys : 2246 2241 hdev->le_tx_def_phys); 2247 2242 2248 2243 conn->iso_qos = *qos; ··· 2362 2357 return le; 2363 2358 2364 2359 hci_iso_qos_setup(hdev, le, &qos->ucast.out, 2365 - le->le_tx_phy ? le->le_tx_phy : hdev->le_tx_def_phys); 2360 + le->le_tx_def_phys ? le->le_tx_def_phys : 2361 + hdev->le_tx_def_phys); 2366 2362 hci_iso_qos_setup(hdev, le, &qos->ucast.in, 2367 - le->le_rx_phy ? le->le_rx_phy : hdev->le_rx_def_phys); 2363 + le->le_rx_def_phys ? le->le_rx_def_phys : 2364 + hdev->le_rx_def_phys); 2368 2365 2369 2366 cis = hci_bind_cis(hdev, dst, dst_type, qos, timeout); 2370 2367 if (IS_ERR(cis)) { ··· 2621 2614 2622 2615 timer: 2623 2616 if (hdev->idle_timeout > 0) 2624 - queue_delayed_work(hdev->workqueue, &conn->idle_work, 2625 - msecs_to_jiffies(hdev->idle_timeout)); 2617 + mod_delayed_work(hdev->workqueue, &conn->idle_work, 2618 + msecs_to_jiffies(hdev->idle_timeout)); 2626 2619 } 2627 2620 2628 2621 /* Drop all connection on the device */ ··· 2935 2928 break; 2936 2929 2937 2930 case LE_LINK: 2938 - if (conn->le_tx_phy & HCI_LE_SET_PHY_1M) 2931 + if (conn->le_tx_def_phys & HCI_LE_SET_PHY_1M) 2939 2932 phys |= BT_PHY_LE_1M_TX; 2940 2933 2941 - if (conn->le_rx_phy & HCI_LE_SET_PHY_1M) 2934 + if (conn->le_rx_def_phys & HCI_LE_SET_PHY_1M) 2942 2935 phys |= BT_PHY_LE_1M_RX; 2943 2936 2944 - if (conn->le_tx_phy & HCI_LE_SET_PHY_2M) 2937 + if (conn->le_tx_def_phys & HCI_LE_SET_PHY_2M) 2945 2938 phys |= BT_PHY_LE_2M_TX; 2946 2939 2947 - if (conn->le_rx_phy & HCI_LE_SET_PHY_2M) 2940 + if (conn->le_rx_def_phys & HCI_LE_SET_PHY_2M) 2948 2941 phys |= BT_PHY_LE_2M_RX; 2949 2942 2950 - if (conn->le_tx_phy & HCI_LE_SET_PHY_CODED) 2943 + if (conn->le_tx_def_phys & HCI_LE_SET_PHY_CODED) 2951 2944 phys |= BT_PHY_LE_CODED_TX; 2952 2945 2953 - if (conn->le_rx_phy & HCI_LE_SET_PHY_CODED) 2946 + if (conn->le_rx_def_phys & HCI_LE_SET_PHY_CODED) 2954 2947 phys |= BT_PHY_LE_CODED_RX; 2955 2948 2956 2949 break; 2957 2950 } 2958 2951 2959 2952 return phys; 2953 + } 2954 + 2955 + static u16 bt_phy_pkt_type(struct hci_conn *conn, u32 phys) 2956 + { 2957 + u16 pkt_type = conn->pkt_type; 2958 + 2959 + if (phys & BT_PHY_BR_1M_3SLOT) 2960 + pkt_type |= HCI_DM3 | HCI_DH3; 2961 + else 2962 + pkt_type &= ~(HCI_DM3 | HCI_DH3); 2963 + 2964 + if (phys & BT_PHY_BR_1M_5SLOT) 2965 + pkt_type |= HCI_DM5 | HCI_DH5; 2966 + else 2967 + pkt_type &= ~(HCI_DM5 | HCI_DH5); 2968 + 2969 + if (phys & BT_PHY_EDR_2M_1SLOT) 2970 + pkt_type &= ~HCI_2DH1; 2971 + else 2972 + pkt_type |= HCI_2DH1; 2973 + 2974 + if (phys & BT_PHY_EDR_2M_3SLOT) 2975 + pkt_type &= ~HCI_2DH3; 2976 + else 2977 + pkt_type |= HCI_2DH3; 2978 + 2979 + if (phys & BT_PHY_EDR_2M_5SLOT) 2980 + pkt_type &= ~HCI_2DH5; 2981 + else 2982 + pkt_type |= HCI_2DH5; 2983 + 2984 + if (phys & BT_PHY_EDR_3M_1SLOT) 2985 + pkt_type &= ~HCI_3DH1; 2986 + else 2987 + pkt_type |= HCI_3DH1; 2988 + 2989 + if (phys & BT_PHY_EDR_3M_3SLOT) 2990 + pkt_type &= ~HCI_3DH3; 2991 + else 2992 + pkt_type |= HCI_3DH3; 2993 + 2994 + if (phys & BT_PHY_EDR_3M_5SLOT) 2995 + pkt_type &= ~HCI_3DH5; 2996 + else 2997 + pkt_type |= HCI_3DH5; 2998 + 2999 + return pkt_type; 3000 + } 3001 + 3002 + static int bt_phy_le_phy(u32 phys, u8 *tx_phys, u8 *rx_phys) 3003 + { 3004 + if (!tx_phys || !rx_phys) 3005 + return -EINVAL; 3006 + 3007 + *tx_phys = 0; 3008 + *rx_phys = 0; 3009 + 3010 + if (phys & BT_PHY_LE_1M_TX) 3011 + *tx_phys |= HCI_LE_SET_PHY_1M; 3012 + 3013 + if (phys & BT_PHY_LE_1M_RX) 3014 + *rx_phys |= HCI_LE_SET_PHY_1M; 3015 + 3016 + if (phys & BT_PHY_LE_2M_TX) 3017 + *tx_phys |= HCI_LE_SET_PHY_2M; 3018 + 3019 + if (phys & BT_PHY_LE_2M_RX) 3020 + *rx_phys |= HCI_LE_SET_PHY_2M; 3021 + 3022 + if (phys & BT_PHY_LE_CODED_TX) 3023 + *tx_phys |= HCI_LE_SET_PHY_CODED; 3024 + 3025 + if (phys & BT_PHY_LE_CODED_RX) 3026 + *rx_phys |= HCI_LE_SET_PHY_CODED; 3027 + 3028 + return 0; 3029 + } 3030 + 3031 + int hci_conn_set_phy(struct hci_conn *conn, u32 phys) 3032 + { 3033 + u8 tx_phys, rx_phys; 3034 + 3035 + switch (conn->type) { 3036 + case SCO_LINK: 3037 + case ESCO_LINK: 3038 + return -EINVAL; 3039 + case ACL_LINK: 3040 + /* Only allow setting BR/EDR PHYs if link type is ACL */ 3041 + if (phys & ~BT_PHY_BREDR_MASK) 3042 + return -EINVAL; 3043 + 3044 + return hci_acl_change_pkt_type(conn, 3045 + bt_phy_pkt_type(conn, phys)); 3046 + case LE_LINK: 3047 + /* Only allow setting LE PHYs if link type is LE */ 3048 + if (phys & ~BT_PHY_LE_MASK) 3049 + return -EINVAL; 3050 + 3051 + if (bt_phy_le_phy(phys, &tx_phys, &rx_phys)) 3052 + return -EINVAL; 3053 + 3054 + return hci_le_set_phy(conn, tx_phys, rx_phys); 3055 + default: 3056 + return -EINVAL; 3057 + } 2960 3058 } 2961 3059 2962 3060 static int abort_conn_sync(struct hci_dev *hdev, void *data)
+1
net/bluetooth/hci_core.c
··· 117 117 return false; 118 118 } 119 119 } 120 + EXPORT_SYMBOL(hci_discovery_active); 120 121 121 122 void hci_discovery_set_state(struct hci_dev *hdev, int state) 122 123 {
+72 -7
net/bluetooth/hci_event.c
··· 2869 2869 hci_dev_unlock(hdev); 2870 2870 } 2871 2871 2872 + static void hci_cs_le_set_phy(struct hci_dev *hdev, u8 status) 2873 + { 2874 + struct hci_cp_le_set_phy *cp; 2875 + struct hci_conn *conn; 2876 + 2877 + bt_dev_dbg(hdev, "status 0x%2.2x", status); 2878 + 2879 + if (status) 2880 + return; 2881 + 2882 + cp = hci_sent_cmd_data(hdev, HCI_OP_LE_SET_PHY); 2883 + if (!cp) 2884 + return; 2885 + 2886 + hci_dev_lock(hdev); 2887 + 2888 + conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(cp->handle)); 2889 + if (conn) { 2890 + conn->le_tx_def_phys = cp->tx_phys; 2891 + conn->le_rx_def_phys = cp->rx_phys; 2892 + } 2893 + 2894 + hci_dev_unlock(hdev); 2895 + } 2896 + 2872 2897 static void hci_cs_le_read_remote_features(struct hci_dev *hdev, u8 status) 2873 2898 { 2874 2899 struct hci_cp_le_read_remote_features *cp; ··· 4384 4359 HCI_CS(HCI_OP_LE_CREATE_CONN, hci_cs_le_create_conn), 4385 4360 HCI_CS(HCI_OP_LE_READ_REMOTE_FEATURES, hci_cs_le_read_remote_features), 4386 4361 HCI_CS(HCI_OP_LE_START_ENC, hci_cs_le_start_enc), 4362 + HCI_CS(HCI_OP_LE_SET_PHY, hci_cs_le_set_phy), 4387 4363 HCI_CS(HCI_OP_LE_EXT_CREATE_CONN, hci_cs_le_ext_create_conn), 4388 4364 HCI_CS(HCI_OP_LE_CREATE_CIS, hci_cs_le_create_cis), 4389 4365 HCI_CS(HCI_OP_LE_CREATE_BIG, hci_cs_le_create_big), ··· 6633 6607 6634 6608 conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->handle)); 6635 6609 if (conn) { 6636 - if (!ev->status) 6637 - memcpy(conn->features[0], ev->features, 8); 6610 + if (!ev->status) { 6611 + memcpy(conn->le_features, ev->features, 8); 6612 + 6613 + /* Update supported PHYs */ 6614 + if (!(conn->le_features[1] & HCI_LE_PHY_2M)) { 6615 + conn->le_tx_def_phys &= ~HCI_LE_SET_PHY_2M; 6616 + conn->le_rx_def_phys &= ~HCI_LE_SET_PHY_2M; 6617 + } 6618 + 6619 + if (!(conn->le_features[1] & HCI_LE_PHY_CODED)) { 6620 + conn->le_tx_def_phys &= ~HCI_LE_SET_PHY_CODED; 6621 + conn->le_rx_def_phys &= ~HCI_LE_SET_PHY_CODED; 6622 + } 6623 + } 6638 6624 6639 6625 if (conn->state == BT_CONFIG) { 6640 6626 __u8 status; ··· 6867 6829 hci_dev_unlock(hdev); 6868 6830 } 6869 6831 6832 + /* Convert LE PHY to QoS PHYs */ 6833 + static u8 le_phy_qos(u8 phy) 6834 + { 6835 + switch (phy) { 6836 + case 0x01: 6837 + return HCI_LE_SET_PHY_1M; 6838 + case 0x02: 6839 + return HCI_LE_SET_PHY_2M; 6840 + case 0x03: 6841 + return HCI_LE_SET_PHY_CODED; 6842 + } 6843 + 6844 + return 0; 6845 + } 6846 + 6870 6847 static void hci_le_cis_established_evt(struct hci_dev *hdev, void *data, 6871 6848 struct sk_buff *skb) 6872 6849 { ··· 6943 6890 1000); 6944 6891 qos->ucast.in.sdu = ev->c_bn ? le16_to_cpu(ev->c_mtu) : 0; 6945 6892 qos->ucast.out.sdu = ev->p_bn ? le16_to_cpu(ev->p_mtu) : 0; 6946 - qos->ucast.in.phy = ev->c_phy; 6947 - qos->ucast.out.phy = ev->p_phy; 6893 + qos->ucast.in.phys = le_phy_qos(ev->c_phy); 6894 + qos->ucast.out.phys = le_phy_qos(ev->p_phy); 6948 6895 break; 6949 6896 case HCI_ROLE_MASTER: 6950 6897 qos->ucast.in.interval = p_sdu_interval; ··· 6958 6905 1000); 6959 6906 qos->ucast.out.sdu = ev->c_bn ? le16_to_cpu(ev->c_mtu) : 0; 6960 6907 qos->ucast.in.sdu = ev->p_bn ? le16_to_cpu(ev->p_mtu) : 0; 6961 - qos->ucast.out.phy = ev->c_phy; 6962 - qos->ucast.in.phy = ev->p_phy; 6908 + qos->ucast.out.phys = le_phy_qos(ev->c_phy); 6909 + qos->ucast.in.phys = le_phy_qos(ev->p_phy); 6963 6910 break; 6964 6911 } 6965 6912 ··· 7274 7221 if (!conn) 7275 7222 goto unlock; 7276 7223 7277 - if (!ev->status) 7224 + if (!ev->status) { 7278 7225 memcpy(conn->le_features, ev->features, 248); 7226 + 7227 + /* Update supported PHYs */ 7228 + if (!(conn->le_features[1] & HCI_LE_PHY_2M)) { 7229 + conn->le_tx_def_phys &= ~HCI_LE_SET_PHY_2M; 7230 + conn->le_rx_def_phys &= ~HCI_LE_SET_PHY_2M; 7231 + } 7232 + 7233 + if (!(conn->le_features[1] & HCI_LE_PHY_CODED)) { 7234 + conn->le_tx_def_phys &= ~HCI_LE_SET_PHY_CODED; 7235 + conn->le_rx_def_phys &= ~HCI_LE_SET_PHY_CODED; 7236 + } 7237 + } 7279 7238 7280 7239 if (conn->state == BT_CONFIG) { 7281 7240 __u8 status;
+113 -12
net/bluetooth/hci_sync.c
··· 2948 2948 if (conn) { 2949 2949 struct bt_iso_qos *qos = &conn->iso_qos; 2950 2950 2951 - if (qos->bcast.in.phy & BT_ISO_PHY_1M || 2952 - qos->bcast.in.phy & BT_ISO_PHY_2M) { 2951 + if (qos->bcast.in.phys & BT_ISO_PHY_1M || 2952 + qos->bcast.in.phys & BT_ISO_PHY_2M) { 2953 2953 cp->scanning_phys |= LE_SCAN_PHY_1M; 2954 2954 hci_le_scan_phy_params(phy, type, 2955 2955 interval, ··· 2958 2958 phy++; 2959 2959 } 2960 2960 2961 - if (qos->bcast.in.phy & BT_ISO_PHY_CODED) { 2961 + if (qos->bcast.in.phys & BT_ISO_PHY_CODED) { 2962 2962 cp->scanning_phys |= LE_SCAN_PHY_CODED; 2963 2963 hci_le_scan_phy_params(phy, type, 2964 2964 interval * 3, ··· 4428 4428 events[4] |= 0x02; /* LE BIG Info Advertising Report */ 4429 4429 } 4430 4430 4431 + if (le_cs_capable(hdev)) { 4432 + /* Channel Sounding events */ 4433 + events[5] |= 0x08; /* LE CS Read Remote Supported Cap Complete event */ 4434 + events[5] |= 0x10; /* LE CS Read Remote FAE Table Complete event */ 4435 + events[5] |= 0x20; /* LE CS Security Enable Complete event */ 4436 + events[5] |= 0x40; /* LE CS Config Complete event */ 4437 + events[5] |= 0x80; /* LE CS Procedure Enable Complete event */ 4438 + events[6] |= 0x01; /* LE CS Subevent Result event */ 4439 + events[6] |= 0x02; /* LE CS Subevent Result Continue event */ 4440 + events[6] |= 0x04; /* LE CS Test End Complete event */ 4441 + } 4431 4442 return __hci_cmd_sync_status(hdev, HCI_OP_LE_SET_EVENT_MASK, 4432 4443 sizeof(events), events, HCI_CMD_TIMEOUT); 4433 4444 } ··· 4571 4560 } 4572 4561 4573 4562 /* LE Set Host Feature */ 4574 - static int hci_le_set_host_feature_sync(struct hci_dev *hdev) 4563 + static int hci_le_set_host_feature_sync(struct hci_dev *hdev, u8 bit, u8 value) 4575 4564 { 4576 4565 struct hci_cp_le_set_host_feature cp; 4577 - 4578 - if (!iso_capable(hdev)) 4579 - return 0; 4580 4566 4581 4567 memset(&cp, 0, sizeof(cp)); 4582 4568 4583 4569 /* Connected Isochronous Channels (Host Support) */ 4584 - cp.bit_number = 32; 4585 - cp.bit_value = iso_enabled(hdev) ? 0x01 : 0x00; 4570 + cp.bit_number = bit; 4571 + cp.bit_value = value; 4586 4572 4587 4573 return __hci_cmd_sync_status(hdev, HCI_OP_LE_SET_HOST_FEATURE, 4588 4574 sizeof(cp), &cp, HCI_CMD_TIMEOUT); 4575 + } 4576 + 4577 + /* Set Host Features, each feature needs to be sent separately since 4578 + * HCI_OP_LE_SET_HOST_FEATURE doesn't support setting all of them at once. 4579 + */ 4580 + static int hci_le_set_host_features_sync(struct hci_dev *hdev) 4581 + { 4582 + int err; 4583 + 4584 + if (iso_capable(hdev)) { 4585 + /* Connected Isochronous Channels (Host Support) */ 4586 + err = hci_le_set_host_feature_sync(hdev, 32, 4587 + (iso_enabled(hdev) ? 0x01 : 4588 + 0x00)); 4589 + if (err) 4590 + return err; 4591 + } 4592 + 4593 + if (le_cs_capable(hdev)) 4594 + /* Channel Sounding (Host Support) */ 4595 + err = hci_le_set_host_feature_sync(hdev, 47, 0x01); 4596 + 4597 + return err; 4589 4598 } 4590 4599 4591 4600 /* LE Controller init stage 3 command sequence */ ··· 4635 4604 /* HCI_OP_WRITE_LE_HOST_SUPPORTED */ 4636 4605 HCI_INIT(hci_set_le_support_sync), 4637 4606 /* HCI_OP_LE_SET_HOST_FEATURE */ 4638 - HCI_INIT(hci_le_set_host_feature_sync), 4607 + HCI_INIT(hci_le_set_host_features_sync), 4639 4608 {} 4640 4609 }; 4641 4610 ··· 6928 6897 6929 6898 conn->attempt++; 6930 6899 6931 - conn->link_policy = hdev->link_policy; 6932 - 6933 6900 memset(&cp, 0, sizeof(cp)); 6934 6901 bacpy(&cp.bdaddr, &conn->dst); 6935 6902 cp.pscan_rep_mode = 0x02; ··· 7447 7418 err = -EOPNOTSUPP; 7448 7419 7449 7420 return err; 7421 + } 7422 + 7423 + static void pkt_type_changed(struct hci_dev *hdev, void *data, int err) 7424 + { 7425 + struct hci_cp_change_conn_ptype *cp = data; 7426 + 7427 + bt_dev_dbg(hdev, "err %d", err); 7428 + 7429 + kfree(cp); 7430 + } 7431 + 7432 + static int hci_change_conn_ptype_sync(struct hci_dev *hdev, void *data) 7433 + { 7434 + struct hci_cp_change_conn_ptype *cp = data; 7435 + 7436 + return __hci_cmd_sync_status_sk(hdev, HCI_OP_CHANGE_CONN_PTYPE, 7437 + sizeof(*cp), cp, 7438 + HCI_EV_PKT_TYPE_CHANGE, 7439 + HCI_CMD_TIMEOUT, NULL); 7440 + } 7441 + 7442 + int hci_acl_change_pkt_type(struct hci_conn *conn, u16 pkt_type) 7443 + { 7444 + struct hci_dev *hdev = conn->hdev; 7445 + struct hci_cp_change_conn_ptype *cp; 7446 + 7447 + cp = kmalloc(sizeof(*cp), GFP_KERNEL); 7448 + if (!cp) 7449 + return -ENOMEM; 7450 + 7451 + cp->handle = cpu_to_le16(conn->handle); 7452 + cp->pkt_type = cpu_to_le16(pkt_type); 7453 + 7454 + return hci_cmd_sync_queue_once(hdev, hci_change_conn_ptype_sync, cp, 7455 + pkt_type_changed); 7456 + } 7457 + 7458 + static void le_phy_update_complete(struct hci_dev *hdev, void *data, int err) 7459 + { 7460 + struct hci_cp_le_set_phy *cp = data; 7461 + 7462 + bt_dev_dbg(hdev, "err %d", err); 7463 + 7464 + kfree(cp); 7465 + } 7466 + 7467 + static int hci_le_set_phy_sync(struct hci_dev *hdev, void *data) 7468 + { 7469 + struct hci_cp_le_set_phy *cp = data; 7470 + 7471 + return __hci_cmd_sync_status_sk(hdev, HCI_OP_LE_SET_PHY, 7472 + sizeof(*cp), cp, 7473 + HCI_EV_LE_PHY_UPDATE_COMPLETE, 7474 + HCI_CMD_TIMEOUT, NULL); 7475 + } 7476 + 7477 + int hci_le_set_phy(struct hci_conn *conn, u8 tx_phys, u8 rx_phys) 7478 + { 7479 + struct hci_dev *hdev = conn->hdev; 7480 + struct hci_cp_le_set_phy *cp; 7481 + 7482 + cp = kmalloc(sizeof(*cp), GFP_KERNEL); 7483 + if (!cp) 7484 + return -ENOMEM; 7485 + 7486 + memset(cp, 0, sizeof(*cp)); 7487 + cp->handle = cpu_to_le16(conn->handle); 7488 + cp->tx_phys = tx_phys; 7489 + cp->rx_phys = rx_phys; 7490 + 7491 + return hci_cmd_sync_queue_once(hdev, hci_le_set_phy_sync, cp, 7492 + le_phy_update_complete); 7450 7493 }
+5 -5
net/bluetooth/iso.c
··· 361 361 } 362 362 363 363 /* Fail if out PHYs are marked as disabled */ 364 - if (!iso_pi(sk)->qos.bcast.out.phy) { 364 + if (!iso_pi(sk)->qos.bcast.out.phys) { 365 365 err = -EINVAL; 366 366 goto unlock; 367 367 } ··· 458 458 } 459 459 460 460 /* Fail if either PHYs are marked as disabled */ 461 - if (!iso_pi(sk)->qos.ucast.in.phy && !iso_pi(sk)->qos.ucast.out.phy) { 461 + if (!iso_pi(sk)->qos.ucast.in.phys && !iso_pi(sk)->qos.ucast.out.phys) { 462 462 err = -EINVAL; 463 463 goto unlock; 464 464 } ··· 894 894 .interval = 10000u, \ 895 895 .latency = 10u, \ 896 896 .sdu = 40u, \ 897 - .phy = BT_ISO_PHY_2M, \ 897 + .phys = BT_ISO_PHY_2M, \ 898 898 .rtn = 2u, \ 899 899 } 900 900 ··· 1661 1661 static bool check_io_qos(struct bt_iso_io_qos *qos) 1662 1662 { 1663 1663 /* If no PHY is enable SDU must be 0 */ 1664 - if (!qos->phy && qos->sdu) 1664 + if (!qos->phys && qos->sdu) 1665 1665 return false; 1666 1666 1667 1667 if (qos->interval && (qos->interval < 0xff || qos->interval > 0xfffff)) ··· 1670 1670 if (qos->latency && (qos->latency < 0x05 || qos->latency > 0xfa0)) 1671 1671 return false; 1672 1672 1673 - if (qos->phy > BT_ISO_PHY_ANY) 1673 + if (qos->phys > BT_ISO_PHY_ANY) 1674 1674 return false; 1675 1675 1676 1676 return true;
+32 -14
net/bluetooth/l2cap_core.c
··· 924 924 initiator); 925 925 } 926 926 927 - static u8 l2cap_get_ident(struct l2cap_conn *conn) 927 + static int l2cap_get_ident(struct l2cap_conn *conn) 928 928 { 929 - u8 id; 929 + /* LE link does not support tools like l2ping so use the full range */ 930 + if (conn->hcon->type == LE_LINK) 931 + return ida_alloc_range(&conn->tx_ida, 1, 255, GFP_ATOMIC); 930 932 931 933 /* Get next available identificator. 932 934 * 1 - 128 are used by kernel. 933 935 * 129 - 199 are reserved. 934 936 * 200 - 254 are used by utilities like l2ping, etc. 935 937 */ 936 - 937 - mutex_lock(&conn->ident_lock); 938 - 939 - if (++conn->tx_ident > 128) 940 - conn->tx_ident = 1; 941 - 942 - id = conn->tx_ident; 943 - 944 - mutex_unlock(&conn->ident_lock); 945 - 946 - return id; 938 + return ida_alloc_range(&conn->tx_ida, 1, 128, GFP_ATOMIC); 947 939 } 948 940 949 941 static void l2cap_send_acl(struct l2cap_conn *conn, struct sk_buff *skb, ··· 1764 1772 */ 1765 1773 if (work_pending(&conn->pending_rx_work)) 1766 1774 cancel_work_sync(&conn->pending_rx_work); 1775 + 1776 + ida_destroy(&conn->tx_ida); 1767 1777 1768 1778 cancel_delayed_work_sync(&conn->id_addr_timer); 1769 1779 ··· 4776 4782 return err; 4777 4783 } 4778 4784 4785 + static void l2cap_put_ident(struct l2cap_conn *conn, u8 code, u8 id) 4786 + { 4787 + switch (code) { 4788 + case L2CAP_COMMAND_REJ: 4789 + case L2CAP_CONN_RSP: 4790 + case L2CAP_CONF_RSP: 4791 + case L2CAP_DISCONN_RSP: 4792 + case L2CAP_ECHO_RSP: 4793 + case L2CAP_INFO_RSP: 4794 + case L2CAP_CONN_PARAM_UPDATE_RSP: 4795 + case L2CAP_ECRED_CONN_RSP: 4796 + case L2CAP_ECRED_RECONF_RSP: 4797 + /* First do a lookup since the remote may send bogus ids that 4798 + * would make ida_free to generate warnings. 4799 + */ 4800 + if (ida_find_first_range(&conn->tx_ida, id, id) >= 0) 4801 + ida_free(&conn->tx_ida, id); 4802 + } 4803 + } 4804 + 4779 4805 static inline int l2cap_bredr_sig_cmd(struct l2cap_conn *conn, 4780 4806 struct l2cap_cmd_hdr *cmd, u16 cmd_len, 4781 4807 u8 *data) 4782 4808 { 4783 4809 int err = 0; 4810 + 4811 + l2cap_put_ident(conn, cmd->code, cmd->ident); 4784 4812 4785 4813 switch (cmd->code) { 4786 4814 case L2CAP_COMMAND_REJ: ··· 5434 5418 u8 *data) 5435 5419 { 5436 5420 int err = 0; 5421 + 5422 + l2cap_put_ident(conn, cmd->code, cmd->ident); 5437 5423 5438 5424 switch (cmd->code) { 5439 5425 case L2CAP_COMMAND_REJ: ··· 6925 6907 hci_dev_test_flag(hcon->hdev, HCI_FORCE_BREDR_SMP))) 6926 6908 conn->local_fixed_chan |= L2CAP_FC_SMP_BREDR; 6927 6909 6928 - mutex_init(&conn->ident_lock); 6929 6910 mutex_init(&conn->lock); 6930 6911 6931 6912 INIT_LIST_HEAD(&conn->chan_l); 6932 6913 INIT_LIST_HEAD(&conn->users); 6933 6914 6934 6915 INIT_DELAYED_WORK(&conn->info_timer, l2cap_info_timeout); 6916 + ida_init(&conn->tx_ida); 6935 6917 6936 6918 skb_queue_head_init(&conn->pending_rx); 6937 6919 INIT_WORK(&conn->pending_rx_work, process_pending_rx);
+19 -1
net/bluetooth/l2cap_sock.c
··· 885 885 struct bt_power pwr; 886 886 struct l2cap_conn *conn; 887 887 int err = 0; 888 - u32 opt; 888 + u32 opt, phys; 889 889 u16 mtu; 890 890 u8 mode; 891 891 ··· 1057 1057 else 1058 1058 chan->imtu = mtu; 1059 1059 1060 + break; 1061 + 1062 + case BT_PHY: 1063 + if (sk->sk_state != BT_CONNECTED) { 1064 + err = -ENOTCONN; 1065 + break; 1066 + } 1067 + 1068 + err = copy_safe_from_sockptr(&phys, sizeof(phys), optval, 1069 + optlen); 1070 + if (err) 1071 + break; 1072 + 1073 + if (!chan->conn) 1074 + break; 1075 + 1076 + conn = chan->conn; 1077 + err = hci_conn_set_phy(conn->hcon, phys); 1060 1078 break; 1061 1079 1062 1080 case BT_MODE:
+3
net/bluetooth/mgmt.c
··· 1966 1966 } 1967 1967 1968 1968 mgmt_cmd_status(cmd->sk, cmd->hdev->id, cmd->opcode, mgmt_err); 1969 + mgmt_pending_free(cmd); 1969 1970 return; 1970 1971 } 1971 1972 ··· 1985 1984 sock_put(match.sk); 1986 1985 1987 1986 hci_update_eir_sync(hdev); 1987 + mgmt_pending_free(cmd); 1988 1988 } 1989 1989 1990 1990 static int set_ssp_sync(struct hci_dev *hdev, void *data) ··· 6440 6438 hci_dev_clear_flag(hdev, HCI_ADVERTISING); 6441 6439 6442 6440 settings_rsp(cmd, &match); 6441 + mgmt_pending_free(cmd); 6443 6442 6444 6443 new_settings(hdev, match.sk); 6445 6444
+21
net/bluetooth/mgmt_config.c
··· 11 11 #include "mgmt_util.h" 12 12 #include "mgmt_config.h" 13 13 14 + #define HDEV_PARAM_U32(_param_name_) \ 15 + struct {\ 16 + struct mgmt_tlv_hdr entry; \ 17 + __le32 value; \ 18 + } __packed _param_name_ 19 + 14 20 #define HDEV_PARAM_U16(_param_name_) \ 15 21 struct {\ 16 22 struct mgmt_tlv_hdr entry; \ ··· 33 27 { \ 34 28 { cpu_to_le16(_param_code_), sizeof(__u16) }, \ 35 29 cpu_to_le16(hdev->_param_name_) \ 30 + } 31 + 32 + #define TLV_SET_U32(_param_code_, _param_name_) \ 33 + { \ 34 + { cpu_to_le16(_param_code_), sizeof(__u32) }, \ 35 + cpu_to_le32(hdev->_param_name_) \ 36 36 } 37 37 38 38 #define TLV_SET_U8(_param_code_, _param_name_) \ ··· 90 78 HDEV_PARAM_U16(advmon_allowlist_duration); 91 79 HDEV_PARAM_U16(advmon_no_filter_duration); 92 80 HDEV_PARAM_U8(enable_advmon_interleave_scan); 81 + HDEV_PARAM_U32(idle_timeout); 93 82 } __packed rp = { 94 83 TLV_SET_U16(0x0000, def_page_scan_type), 95 84 TLV_SET_U16(0x0001, def_page_scan_int), ··· 124 111 TLV_SET_U16(0x001d, advmon_allowlist_duration), 125 112 TLV_SET_U16(0x001e, advmon_no_filter_duration), 126 113 TLV_SET_U8(0x001f, enable_advmon_interleave_scan), 114 + TLV_SET_U32(0x0020, idle_timeout), 127 115 }; 128 116 129 117 bt_dev_dbg(hdev, "sock %p", sk); ··· 136 122 } 137 123 138 124 #define TO_TLV(x) ((struct mgmt_tlv *)(x)) 125 + #define TLV_GET_LE32(tlv) le32_to_cpu(*((__le32 *)(TO_TLV(tlv)->value))) 139 126 #define TLV_GET_LE16(tlv) le16_to_cpu(*((__le16 *)(TO_TLV(tlv)->value))) 140 127 #define TLV_GET_U8(tlv) (*((__u8 *)(TO_TLV(tlv)->value))) 141 128 ··· 205 190 break; 206 191 case 0x001f: 207 192 exp_type_len = sizeof(u8); 193 + break; 194 + case 0x0020: 195 + exp_type_len = sizeof(u32); 208 196 break; 209 197 default: 210 198 exp_type_len = 0; ··· 331 313 break; 332 314 case 0x0001f: 333 315 hdev->enable_advmon_interleave_scan = TLV_GET_U8(buffer); 316 + break; 317 + case 0x00020: 318 + hdev->idle_timeout = TLV_GET_LE32(buffer); 334 319 break; 335 320 default: 336 321 bt_dev_warn(hdev, "unsupported parameter %u", type);