From: Szymon Janc <szymon.janc@codecoup.pl>
To: linux-bluetooth@vger.kernel.org
Cc: "Michał Narajowski" <michal.narajowski@codecoup.pl>,
"Szymon Janc" <szymon.janc@codecoup.pl>
Subject: [PATCH 4/5] Bluetooth: Add supported data types to ext info changed event
Date: Mon, 19 Sep 2016 20:04:27 +0200 [thread overview]
Message-ID: <1474308268-3940-4-git-send-email-szymon.janc@codecoup.pl> (raw)
In-Reply-To: <1474308268-3940-1-git-send-email-szymon.janc@codecoup.pl>
From: Michał Narajowski <michal.narajowski@codecoup.pl>
This patch adds EIR data to extended info changed event.
Signed-off-by: Michał Narajowski <michal.narajowski@codecoup.pl>
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
---
net/bluetooth/mgmt.c | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index 2c77c63..ce9a249 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -947,12 +947,18 @@ static int read_ext_controller_info(struct sock *sk, struct hci_dev *hdev,
static int ext_info_changed(struct hci_dev *hdev, struct sock *skip)
{
- struct mgmt_ev_ext_info_changed ev;
+ char buf[512];
+ struct mgmt_ev_ext_info_changed *ev = (void *)buf;
+ u16 eir_len;
- ev.eir_len = cpu_to_le16(0);
+ memset(buf, 0, sizeof(buf));
+
+ eir_len = append_eir_data_to_buf(hdev, ev->eir);
+ ev->eir_len = cpu_to_le16(eir_len);
- return mgmt_limited_event(MGMT_EV_EXT_INFO_CHANGED, hdev, &ev,
- sizeof(ev), HCI_MGMT_EXT_INFO_EVENTS, skip);
+ return mgmt_limited_event(MGMT_EV_EXT_INFO_CHANGED, hdev, ev,
+ sizeof(*ev) + eir_len,
+ HCI_MGMT_EXT_INFO_EVENTS, skip);
}
static int send_settings_rsp(struct sock *sk, u16 opcode, struct hci_dev *hdev)
--
2.7.4
next prev parent reply other threads:[~2016-09-19 18:04 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-19 18:04 [PATCH 1/5] Bluetooth: Refactor read_ext_controller_info handler Szymon Janc
2016-09-19 18:04 ` [PATCH 2/5] Bluetooth: Factor appending EIR to separate helper Szymon Janc
2016-09-19 18:04 ` [PATCH 3/5] Bluetooth: Add appearance to Read Ext Controller Info command Szymon Janc
2016-09-19 18:04 ` Szymon Janc [this message]
2016-09-19 18:04 ` [PATCH 5/5] Bluetooth: Fix missing ext info event when setting appearance Szymon Janc
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1474308268-3940-4-git-send-email-szymon.janc@codecoup.pl \
--to=szymon.janc@codecoup.pl \
--cc=linux-bluetooth@vger.kernel.org \
--cc=michal.narajowski@codecoup.pl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).