Commit 2369afb6 authored by David S. Miller's avatar David S. Miller

Merge branch 'for-upstream' of...

Merge branch 'for-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next

Johan Hedberg says:

====================
pull request: bluetooth-next 2019-03-02

Here's one more bluetooth-next pull request for the 5.1 kernel:

 - Added support for MediaTek MT7663U and MT7668U UART devices
 - Cleanups & fixes to the hci_qca driver
 - Fixed wakeup pin behavior for QCA6174A controller

Please let me know if there are any issues pulling. Thanks.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 9eb35914 22eaf6c9
...@@ -9,6 +9,9 @@ Required properties: ...@@ -9,6 +9,9 @@ Required properties:
(more may be added later) are: (more may be added later) are:
"usb1286,204e" (Marvell 8997) "usb1286,204e" (Marvell 8997)
"usbcf3,e300" (Qualcomm QCA6174A)
"usb4ca,301a" (Qualcomm QCA6174A (Lite-On))
Also, vendors that use btusb may have device additional properties, e.g: Also, vendors that use btusb may have device additional properties, e.g:
Documentation/devicetree/bindings/net/marvell-bt-8xxx.txt Documentation/devicetree/bindings/net/marvell-bt-8xxx.txt
......
...@@ -33,3 +33,67 @@ Example: ...@@ -33,3 +33,67 @@ Example:
clock-names = "ref"; clock-names = "ref";
}; };
}; };
MediaTek UART based Bluetooth Devices
==================================
This device is a serial attached device to UART device and thus it must be a
child node of the serial node with UART.
Please refer to the following documents for generic properties:
Documentation/devicetree/bindings/serial/slave-device.txt
Required properties:
- compatible: Must be
"mediatek,mt7663u-bluetooth": for MT7663U device
"mediatek,mt7668u-bluetooth": for MT7668U device
- vcc-supply: Main voltage regulator
- pinctrl-names: Should be "default", "runtime"
- pinctrl-0: Should contain UART RXD low when the device is powered up to
enter proper bootstrap mode.
- pinctrl-1: Should contain UART mode pin ctrl
Optional properties:
- reset-gpios: GPIO used to reset the device whose initial state keeps low,
if the GPIO is missing, then board-level design should be
guaranteed.
- current-speed: Current baud rate of the device whose defaults to 921600
Example:
uart1_pins_boot: uart1-default {
pins-dat {
pinmux = <MT7623_PIN_81_URXD1_FUNC_GPIO81>;
output-low;
};
};
uart1_pins_runtime: uart1-runtime {
pins-dat {
pinmux = <MT7623_PIN_81_URXD1_FUNC_URXD1>,
<MT7623_PIN_82_UTXD1_FUNC_UTXD1>;
};
};
uart1: serial@11003000 {
compatible = "mediatek,mt7623-uart",
"mediatek,mt6577-uart";
reg = <0 0x11003000 0 0x400>;
interrupts = <GIC_SPI 52 IRQ_TYPE_LEVEL_LOW>;
clocks = <&pericfg CLK_PERI_UART1_SEL>,
<&pericfg CLK_PERI_UART1>;
clock-names = "baud", "bus";
bluetooth {
compatible = "mediatek,mt7663u-bluetooth";
vcc-supply = <&reg_5v>;
reset-gpios = <&pio 24 GPIO_ACTIVE_LOW>;
pinctrl-names = "default", "runtime";
pinctrl-0 = <&uart1_pins_boot>;
pinctrl-1 = <&uart1_pins_runtime>;
current-speed = <921600>;
};
};
...@@ -200,6 +200,19 @@ backlight: backlight { ...@@ -200,6 +200,19 @@ backlight: backlight {
pinctrl-0 = <&bl_en>; pinctrl-0 = <&bl_en>;
pwm-delay-us = <10000>; pwm-delay-us = <10000>;
}; };
gpio_keys: gpio-keys {
compatible = "gpio-keys";
pinctrl-names = "default";
pinctrl-0 = <&bt_host_wake_l>;
wake_on_bt: wake-on-bt {
label = "Wake-on-Bluetooth";
gpios = <&gpio0 3 GPIO_ACTIVE_LOW>;
linux,code = <KEY_WAKEUP>;
wakeup-source;
};
};
}; };
&ppvar_bigcpu { &ppvar_bigcpu {
......
...@@ -175,6 +175,21 @@ dmic: dmic { ...@@ -175,6 +175,21 @@ dmic: dmic {
pinctrl-0 = <&dmic_en>; pinctrl-0 = <&dmic_en>;
wakeup-delay-ms = <250>; wakeup-delay-ms = <250>;
}; };
gpio_keys: gpio-keys {
compatible = "gpio-keys";
pinctrl-names = "default";
pinctrl-0 = <&pen_eject_odl>;
pen-insert {
label = "Pen Insert";
/* Insert = low, eject = high */
gpios = <&gpio1 1 GPIO_ACTIVE_LOW>;
linux,code = <SW_PEN_INSERTED>;
linux,input-type = <EV_SW>;
wakeup-source;
};
};
}; };
/* pp900_s0 aliases */ /* pp900_s0 aliases */
...@@ -328,20 +343,6 @@ &cru { ...@@ -328,20 +343,6 @@ &cru {
<400000000>; <400000000>;
}; };
&gpio_keys {
pinctrl-names = "default";
pinctrl-0 = <&bt_host_wake_l>, <&pen_eject_odl>;
pen-insert {
label = "Pen Insert";
/* Insert = low, eject = high */
gpios = <&gpio1 1 GPIO_ACTIVE_LOW>;
linux,code = <SW_PEN_INSERTED>;
linux,input-type = <EV_SW>;
wakeup-source;
};
};
&i2c_tunnel { &i2c_tunnel {
google,remote-bus = <0>; google,remote-bus = <0>;
}; };
...@@ -437,8 +438,19 @@ &spi2 { ...@@ -437,8 +438,19 @@ &spi2 {
status = "okay"; status = "okay";
}; };
&wake_on_bt { &usb_host0_ohci {
gpios = <&gpio1 2 GPIO_ACTIVE_LOW>; #address-cells = <1>;
#size-cells = <0>;
qca_bt: bluetooth@1 {
compatible = "usbcf3,e300", "usb4ca,301a";
reg = <1>;
pinctrl-names = "default";
pinctrl-0 = <&bt_host_wake_l>;
interrupt-parent = <&gpio1>;
interrupts = <2 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "wakeup";
};
}; };
/* PINCTRL OVERRIDES */ /* PINCTRL OVERRIDES */
...@@ -455,7 +467,7 @@ &bl_en { ...@@ -455,7 +467,7 @@ &bl_en {
}; };
&bt_host_wake_l { &bt_host_wake_l {
rockchip,pins = <1 2 RK_FUNC_GPIO &pcfg_pull_up>; rockchip,pins = <1 2 RK_FUNC_GPIO &pcfg_pull_none>;
}; };
&ec_ap_int_l { &ec_ap_int_l {
......
...@@ -269,19 +269,6 @@ ap_rtc_clk: ap-rtc-clk { ...@@ -269,19 +269,6 @@ ap_rtc_clk: ap-rtc-clk {
#clock-cells = <0>; #clock-cells = <0>;
}; };
gpio_keys: gpio-keys {
compatible = "gpio-keys";
pinctrl-names = "default";
pinctrl-0 = <&bt_host_wake_l>;
wake_on_bt: wake-on-bt {
label = "Wake-on-Bluetooth";
gpios = <&gpio0 3 GPIO_ACTIVE_LOW>;
linux,code = <KEY_WAKEUP>;
wakeup-source;
};
};
max98357a: max98357a { max98357a: max98357a {
compatible = "maxim,max98357a"; compatible = "maxim,max98357a";
pinctrl-names = "default"; pinctrl-names = "default";
......
This diff is collapsed.
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
struct btqcomsmd { struct btqcomsmd {
struct hci_dev *hdev; struct hci_dev *hdev;
bdaddr_t bdaddr;
struct rpmsg_endpoint *acl_channel; struct rpmsg_endpoint *acl_channel;
struct rpmsg_endpoint *cmd_channel; struct rpmsg_endpoint *cmd_channel;
}; };
...@@ -116,32 +115,17 @@ static int btqcomsmd_close(struct hci_dev *hdev) ...@@ -116,32 +115,17 @@ static int btqcomsmd_close(struct hci_dev *hdev)
static int btqcomsmd_setup(struct hci_dev *hdev) static int btqcomsmd_setup(struct hci_dev *hdev)
{ {
struct btqcomsmd *btq = hci_get_drvdata(hdev);
struct sk_buff *skb; struct sk_buff *skb;
int err;
skb = __hci_cmd_sync(hdev, HCI_OP_RESET, 0, NULL, HCI_INIT_TIMEOUT); skb = __hci_cmd_sync(hdev, HCI_OP_RESET, 0, NULL, HCI_INIT_TIMEOUT);
if (IS_ERR(skb)) if (IS_ERR(skb))
return PTR_ERR(skb); return PTR_ERR(skb);
kfree_skb(skb); kfree_skb(skb);
/* Devices do not have persistent storage for BD address. If no /* Devices do not have persistent storage for BD address. Retrieve
* BD address has been retrieved during probe, mark the device * it from the firmware node property.
* as having an invalid BD address.
*/
if (!bacmp(&btq->bdaddr, BDADDR_ANY)) {
set_bit(HCI_QUIRK_INVALID_BDADDR, &hdev->quirks);
return 0;
}
/* When setting a configured BD address fails, mark the device
* as having an invalid BD address.
*/ */
err = qca_set_bdaddr_rome(hdev, &btq->bdaddr); set_bit(HCI_QUIRK_USE_BDADDR_PROPERTY, &hdev->quirks);
if (err) {
set_bit(HCI_QUIRK_INVALID_BDADDR, &hdev->quirks);
return 0;
}
return 0; return 0;
} }
...@@ -169,15 +153,6 @@ static int btqcomsmd_probe(struct platform_device *pdev) ...@@ -169,15 +153,6 @@ static int btqcomsmd_probe(struct platform_device *pdev)
if (IS_ERR(btq->cmd_channel)) if (IS_ERR(btq->cmd_channel))
return PTR_ERR(btq->cmd_channel); return PTR_ERR(btq->cmd_channel);
/* The local-bd-address property is usually injected by the
* bootloader which has access to the allocated BD address.
*/
if (!of_property_read_u8_array(pdev->dev.of_node, "local-bd-address",
(u8 *)&btq->bdaddr, sizeof(bdaddr_t))) {
dev_info(&pdev->dev, "BD address %pMR retrieved from device-tree",
&btq->bdaddr);
}
hdev = hci_alloc_dev(); hdev = hci_alloc_dev();
if (!hdev) if (!hdev)
return -ENOMEM; return -ENOMEM;
......
...@@ -2917,6 +2917,8 @@ static irqreturn_t btusb_oob_wake_handler(int irq, void *priv) ...@@ -2917,6 +2917,8 @@ static irqreturn_t btusb_oob_wake_handler(int irq, void *priv)
static const struct of_device_id btusb_match_table[] = { static const struct of_device_id btusb_match_table[] = {
{ .compatible = "usb1286,204e" }, { .compatible = "usb1286,204e" },
{ .compatible = "usbcf3,e300" }, /* QCA6174A */
{ .compatible = "usb4ca,301a" }, /* QCA6174A (Lite-On) */
{ } { }
}; };
MODULE_DEVICE_TABLE(of, btusb_match_table); MODULE_DEVICE_TABLE(of, btusb_match_table);
......
...@@ -696,14 +696,13 @@ static int hci_uart_set_proto(struct hci_uart *hu, int id) ...@@ -696,14 +696,13 @@ static int hci_uart_set_proto(struct hci_uart *hu, int id)
return -EPROTONOSUPPORT; return -EPROTONOSUPPORT;
hu->proto = p; hu->proto = p;
set_bit(HCI_UART_PROTO_READY, &hu->flags);
err = hci_uart_register_dev(hu); err = hci_uart_register_dev(hu);
if (err) { if (err) {
clear_bit(HCI_UART_PROTO_READY, &hu->flags);
return err; return err;
} }
set_bit(HCI_UART_PROTO_READY, &hu->flags);
return 0; return 0;
} }
......
...@@ -59,8 +59,7 @@ ...@@ -59,8 +59,7 @@
#define IBS_WAKE_RETRANS_TIMEOUT_MS 100 #define IBS_WAKE_RETRANS_TIMEOUT_MS 100
#define IBS_TX_IDLE_TIMEOUT_MS 2000 #define IBS_TX_IDLE_TIMEOUT_MS 2000
#define BAUDRATE_SETTLE_TIMEOUT_MS 300 #define CMD_TRANS_TIMEOUT_MS 100
#define POWER_PULSE_TRANS_TIMEOUT_MS 100
/* susclk rate */ /* susclk rate */
#define SUSCLK_RATE_32KHZ 32768 #define SUSCLK_RATE_32KHZ 32768
...@@ -964,6 +963,7 @@ static int qca_set_baudrate(struct hci_dev *hdev, uint8_t baudrate) ...@@ -964,6 +963,7 @@ static int qca_set_baudrate(struct hci_dev *hdev, uint8_t baudrate)
{ {
struct hci_uart *hu = hci_get_drvdata(hdev); struct hci_uart *hu = hci_get_drvdata(hdev);
struct qca_data *qca = hu->priv; struct qca_data *qca = hu->priv;
struct qca_serdev *qcadev;
struct sk_buff *skb; struct sk_buff *skb;
u8 cmd[] = { 0x01, 0x48, 0xFC, 0x01, 0x00 }; u8 cmd[] = { 0x01, 0x48, 0xFC, 0x01, 0x00 };
...@@ -985,13 +985,21 @@ static int qca_set_baudrate(struct hci_dev *hdev, uint8_t baudrate) ...@@ -985,13 +985,21 @@ static int qca_set_baudrate(struct hci_dev *hdev, uint8_t baudrate)
skb_queue_tail(&qca->txq, skb); skb_queue_tail(&qca->txq, skb);
hci_uart_tx_wakeup(hu); hci_uart_tx_wakeup(hu);
/* wait 300ms to change new baudrate on controller side qcadev = serdev_device_get_drvdata(hu->serdev);
* controller will come back after they receive this HCI command
* then host can communicate with new baudrate to controller /* Wait for the baudrate change request to be sent */
*/
set_current_state(TASK_UNINTERRUPTIBLE); while (!skb_queue_empty(&qca->txq))
schedule_timeout(msecs_to_jiffies(BAUDRATE_SETTLE_TIMEOUT_MS)); usleep_range(100, 200);
set_current_state(TASK_RUNNING);
serdev_device_wait_until_sent(hu->serdev,
msecs_to_jiffies(CMD_TRANS_TIMEOUT_MS));
/* Give the controller time to process the request */
if (qcadev->btsoc_type == QCA_WCN3990)
msleep(10);
else
msleep(300);
return 0; return 0;
} }
...@@ -1004,10 +1012,11 @@ static inline void host_set_baudrate(struct hci_uart *hu, unsigned int speed) ...@@ -1004,10 +1012,11 @@ static inline void host_set_baudrate(struct hci_uart *hu, unsigned int speed)
hci_uart_set_baudrate(hu, speed); hci_uart_set_baudrate(hu, speed);
} }
static int qca_send_power_pulse(struct hci_uart *hu, u8 cmd) static int qca_send_power_pulse(struct hci_uart *hu, bool on)
{ {
int ret; int ret;
int timeout = msecs_to_jiffies(POWER_PULSE_TRANS_TIMEOUT_MS); int timeout = msecs_to_jiffies(CMD_TRANS_TIMEOUT_MS);
u8 cmd = on ? QCA_WCN3990_POWERON_PULSE : QCA_WCN3990_POWEROFF_PULSE;
/* These power pulses are single byte command which are sent /* These power pulses are single byte command which are sent
* at required baudrate to wcn3990. On wcn3990, we have an external * at required baudrate to wcn3990. On wcn3990, we have an external
...@@ -1030,11 +1039,14 @@ static int qca_send_power_pulse(struct hci_uart *hu, u8 cmd) ...@@ -1030,11 +1039,14 @@ static int qca_send_power_pulse(struct hci_uart *hu, u8 cmd)
} }
serdev_device_wait_until_sent(hu->serdev, timeout); serdev_device_wait_until_sent(hu->serdev, timeout);
/* Wait for 100 uS for SoC to settle down */
usleep_range(100, 200);
hci_uart_set_flow_control(hu, false); hci_uart_set_flow_control(hu, false);
/* Give to controller time to boot/shutdown */
if (on)
msleep(100);
else
msleep(10);
return 0; return 0;
} }
...@@ -1138,18 +1150,15 @@ static int qca_wcn3990_init(struct hci_uart *hu) ...@@ -1138,18 +1150,15 @@ static int qca_wcn3990_init(struct hci_uart *hu)
/* Forcefully enable wcn3990 to enter in to boot mode. */ /* Forcefully enable wcn3990 to enter in to boot mode. */
host_set_baudrate(hu, 2400); host_set_baudrate(hu, 2400);
ret = qca_send_power_pulse(hu, QCA_WCN3990_POWEROFF_PULSE); ret = qca_send_power_pulse(hu, false);
if (ret) if (ret)
return ret; return ret;
qca_set_speed(hu, QCA_INIT_SPEED); qca_set_speed(hu, QCA_INIT_SPEED);
ret = qca_send_power_pulse(hu, QCA_WCN3990_POWERON_PULSE); ret = qca_send_power_pulse(hu, true);
if (ret) if (ret)
return ret; return ret;
/* Wait for 100 ms for SoC to boot */
msleep(100);
/* Now the device is in ready state to communicate with host. /* Now the device is in ready state to communicate with host.
* To sync host with device we need to reopen port. * To sync host with device we need to reopen port.
* Without this, we will have RTS and CTS synchronization * Without this, we will have RTS and CTS synchronization
...@@ -1192,6 +1201,7 @@ static int qca_setup(struct hci_uart *hu) ...@@ -1192,6 +1201,7 @@ static int qca_setup(struct hci_uart *hu)
* setup for every hci up. * setup for every hci up.
*/ */
set_bit(HCI_QUIRK_NON_PERSISTENT_SETUP, &hdev->quirks); set_bit(HCI_QUIRK_NON_PERSISTENT_SETUP, &hdev->quirks);
set_bit(HCI_QUIRK_USE_BDADDR_PROPERTY, &hdev->quirks);
hu->hdev->shutdown = qca_power_off; hu->hdev->shutdown = qca_power_off;
ret = qca_wcn3990_init(hu); ret = qca_wcn3990_init(hu);
if (ret) if (ret)
...@@ -1289,7 +1299,7 @@ static void qca_power_shutdown(struct hci_uart *hu) ...@@ -1289,7 +1299,7 @@ static void qca_power_shutdown(struct hci_uart *hu)
spin_unlock_irqrestore(&qca->hci_ibs_lock, flags); spin_unlock_irqrestore(&qca->hci_ibs_lock, flags);
host_set_baudrate(hu, 2400); host_set_baudrate(hu, 2400);
qca_send_power_pulse(hu, QCA_WCN3990_POWEROFF_PULSE); qca_send_power_pulse(hu, false);
qca_power_setup(hu, false); qca_power_setup(hu, false);
} }
......
...@@ -158,6 +158,18 @@ enum { ...@@ -158,6 +158,18 @@ enum {
*/ */
HCI_QUIRK_INVALID_BDADDR, HCI_QUIRK_INVALID_BDADDR,
/* When this quirk is set, the public Bluetooth address
* initially reported by HCI Read BD Address command
* is considered invalid. The public BD Address can be
* specified in the fwnode property 'local-bd-address'.
* If this property does not exist or is invalid controller
* configuration is required before this device can be used.
*
* This quirk can be set before hci_register_dev is called or
* during the hdev->setup vendor callback.
*/
HCI_QUIRK_USE_BDADDR_PROPERTY,
/* When this quirk is set, the duplicate filtering during /* When this quirk is set, the duplicate filtering during
* scanning is based on Bluetooth devices addresses. To allow * scanning is based on Bluetooth devices addresses. To allow
* RSSI based updates, restart scanning if needed. * RSSI based updates, restart scanning if needed.
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include <linux/rfkill.h> #include <linux/rfkill.h>
#include <linux/debugfs.h> #include <linux/debugfs.h>
#include <linux/crypto.h> #include <linux/crypto.h>
#include <linux/property.h>
#include <asm/unaligned.h> #include <asm/unaligned.h>
#include <net/bluetooth/bluetooth.h> #include <net/bluetooth/bluetooth.h>
...@@ -1355,6 +1356,32 @@ int hci_inquiry(void __user *arg) ...@@ -1355,6 +1356,32 @@ int hci_inquiry(void __user *arg)
return err; return err;
} }
/**
* hci_dev_get_bd_addr_from_property - Get the Bluetooth Device Address
* (BD_ADDR) for a HCI device from
* a firmware node property.
* @hdev: The HCI device
*
* Search the firmware node for 'local-bd-address'.
*
* All-zero BD addresses are rejected, because those could be properties
* that exist in the firmware tables, but were not updated by the firmware. For
* example, the DTS could define 'local-bd-address', with zero BD addresses.
*/
static void hci_dev_get_bd_addr_from_property(struct hci_dev *hdev)
{
struct fwnode_handle *fwnode = dev_fwnode(hdev->dev.parent);
bdaddr_t ba;
int ret;
ret = fwnode_property_read_u8_array(fwnode, "local-bd-address",
(u8 *)&ba, sizeof(ba));
if (ret < 0 || !bacmp(&ba, BDADDR_ANY))
return;
bacpy(&hdev->public_addr, &ba);
}
static int hci_dev_do_open(struct hci_dev *hdev) static int hci_dev_do_open(struct hci_dev *hdev)
{ {
int ret = 0; int ret = 0;
...@@ -1422,6 +1449,22 @@ static int hci_dev_do_open(struct hci_dev *hdev) ...@@ -1422,6 +1449,22 @@ static int hci_dev_do_open(struct hci_dev *hdev)
if (hdev->setup) if (hdev->setup)
ret = hdev->setup(hdev); ret = hdev->setup(hdev);
if (ret)
goto setup_failed;
if (test_bit(HCI_QUIRK_USE_BDADDR_PROPERTY, &hdev->quirks)) {
if (!bacmp(&hdev->public_addr, BDADDR_ANY))
hci_dev_get_bd_addr_from_property(hdev);
if (bacmp(&hdev->public_addr, BDADDR_ANY) &&
hdev->set_bdaddr)
ret = hdev->set_bdaddr(hdev,
&hdev->public_addr);
else
ret = -EADDRNOTAVAIL;
}
setup_failed:
/* The transport driver can set these quirks before /* The transport driver can set these quirks before
* creating the HCI device or in its setup callback. * creating the HCI device or in its setup callback.
* *
......
...@@ -474,7 +474,6 @@ static int read_ext_index_list(struct sock *sk, struct hci_dev *hdev, ...@@ -474,7 +474,6 @@ static int read_ext_index_list(struct sock *sk, struct hci_dev *hdev,
{ {
struct mgmt_rp_read_ext_index_list *rp; struct mgmt_rp_read_ext_index_list *rp;
struct hci_dev *d; struct hci_dev *d;
size_t rp_len;
u16 count; u16 count;
int err; int err;
...@@ -488,8 +487,7 @@ static int read_ext_index_list(struct sock *sk, struct hci_dev *hdev, ...@@ -488,8 +487,7 @@ static int read_ext_index_list(struct sock *sk, struct hci_dev *hdev,
count++; count++;
} }
rp_len = sizeof(*rp) + (sizeof(rp->entry[0]) * count); rp = kmalloc(struct_size(rp, entry, count), GFP_ATOMIC);
rp = kmalloc(rp_len, GFP_ATOMIC);
if (!rp) { if (!rp) {
read_unlock(&hci_dev_list_lock); read_unlock(&hci_dev_list_lock);
return -ENOMEM; return -ENOMEM;
...@@ -525,7 +523,6 @@ static int read_ext_index_list(struct sock *sk, struct hci_dev *hdev, ...@@ -525,7 +523,6 @@ static int read_ext_index_list(struct sock *sk, struct hci_dev *hdev,
} }
rp->num_controllers = cpu_to_le16(count); rp->num_controllers = cpu_to_le16(count);
rp_len = sizeof(*rp) + (sizeof(rp->entry[0]) * count);
read_unlock(&hci_dev_list_lock); read_unlock(&hci_dev_list_lock);
...@@ -538,7 +535,8 @@ static int read_ext_index_list(struct sock *sk, struct hci_dev *hdev, ...@@ -538,7 +535,8 @@ static int read_ext_index_list(struct sock *sk, struct hci_dev *hdev,
hci_sock_clear_flag(sk, HCI_MGMT_UNCONF_INDEX_EVENTS); hci_sock_clear_flag(sk, HCI_MGMT_UNCONF_INDEX_EVENTS);
err = mgmt_cmd_complete(sk, MGMT_INDEX_NONE, err = mgmt_cmd_complete(sk, MGMT_INDEX_NONE,
MGMT_OP_READ_EXT_INDEX_LIST, 0, rp, rp_len); MGMT_OP_READ_EXT_INDEX_LIST, 0, rp,
struct_size(rp, entry, count));
kfree(rp); kfree(rp);
...@@ -551,7 +549,8 @@ static bool is_configured(struct hci_dev *hdev) ...@@ -551,7 +549,8 @@ static bool is_configured(struct hci_dev *hdev)
!hci_dev_test_flag(hdev, HCI_EXT_CONFIGURED)) !hci_dev_test_flag(hdev, HCI_EXT_CONFIGURED))
return false; return false;
if (test_bit(HCI_QUIRK_INVALID_BDADDR, &hdev->quirks) && if ((test_bit(HCI_QUIRK_INVALID_BDADDR, &hdev->quirks) ||
test_bit(HCI_QUIRK_USE_BDADDR_PROPERTY, &hdev->quirks)) &&
!bacmp(&hdev->public_addr, BDADDR_ANY)) !bacmp(&hdev->public_addr, BDADDR_ANY))
return false; return false;
...@@ -566,7 +565,8 @@ static __le32 get_missing_options(struct hci_dev *hdev) ...@@ -566,7 +565,8 @@ static __le32 get_missing_options(struct hci_dev *hdev)
!hci_dev_test_flag(hdev, HCI_EXT_CONFIGURED)) !hci_dev_test_flag(hdev, HCI_EXT_CONFIGURED))
options |= MGMT_OPTION_EXTERNAL_CONFIG; options |= MGMT_OPTION_EXTERNAL_CONFIG;
if (test_bit(HCI_QUIRK_INVALID_BDADDR, &hdev->quirks) && if ((test_bit(HCI_QUIRK_INVALID_BDADDR, &hdev->quirks) ||
test_bit(HCI_QUIRK_USE_BDADDR_PROPERTY, &hdev->quirks)) &&
!bacmp(&hdev->public_addr, BDADDR_ANY)) !bacmp(&hdev->public_addr, BDADDR_ANY))
options |= MGMT_OPTION_PUBLIC_ADDRESS; options |= MGMT_OPTION_PUBLIC_ADDRESS;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment