summaryrefslogtreecommitdiffstats
path: root/net/bluetooth/mgmt.c
diff options
context:
space:
mode:
authorYu Liu <yudiliu@google.com>2021-04-10 00:04:06 +0200
committerMarcel Holtmann <marcel@holtmann.org>2021-06-26 07:12:23 +0200
commit1c6ed31b1696d9b5462ba5ce15b83f5ea955600c (patch)
treef29e293387cd40bb4172eb9a9a60701013cb435b /net/bluetooth/mgmt.c
parentBluetooth: use flexible-array member instead of zero-length array (diff)
downloadlinux-1c6ed31b1696d9b5462ba5ce15b83f5ea955600c.tar.xz
linux-1c6ed31b1696d9b5462ba5ce15b83f5ea955600c.zip
Bluetooth: Return whether a connection is outbound
When an MGMT_EV_DEVICE_CONNECTED event is reported back to the user space we will set the flags to tell if the established connection is outbound or not. This is useful for the user space to log better metrics and error messages. Reviewed-by: Miao-chen Chou <mcchou@chromium.org> Reviewed-by: Alain Michaud <alainm@chromium.org> Signed-off-by: Yu Liu <yudiliu@google.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to '')
-rw-r--r--net/bluetooth/mgmt.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index f290d0c54d32..f6e510d06bec 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -8767,15 +8767,19 @@ void mgmt_new_conn_param(struct hci_dev *hdev, bdaddr_t *bdaddr,
}
void mgmt_device_connected(struct hci_dev *hdev, struct hci_conn *conn,
- u32 flags, u8 *name, u8 name_len)
+ u8 *name, u8 name_len)
{
char buf[512];
struct mgmt_ev_device_connected *ev = (void *) buf;
u16 eir_len = 0;
+ u32 flags = 0;
bacpy(&ev->addr.bdaddr, &conn->dst);
ev->addr.type = link_to_bdaddr(conn->type, conn->dst_type);
+ if (conn->out)
+ flags |= MGMT_DEV_FOUND_INITIATED_CONN;
+
ev->flags = __cpu_to_le32(flags);
/* We must ensure that the EIR Data fields are ordered and