diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2016-08-27 20:23:39 +0200 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2016-09-19 20:19:34 +0200 |
commit | 03c979c4717c7fa0c058fafe76ac4d6acdd1fb0d (patch) | |
tree | 9a7b7de971d8b15fef28c1446bc3d3634453815d /net/bluetooth | |
parent | 70ecce91e3a2d7e332fe56fd065c67d404b8fccf (diff) | |
download | linux-stable-03c979c4717c7fa0c058fafe76ac4d6acdd1fb0d.tar.gz linux-stable-03c979c4717c7fa0c058fafe76ac4d6acdd1fb0d.tar.bz2 linux-stable-03c979c4717c7fa0c058fafe76ac4d6acdd1fb0d.zip |
Bluetooth: Introduce helper to pack mgmt version information
The mgmt version information will be also needed for the control
changell tracing feature. This provides a helper to pack them.
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Diffstat (limited to 'net/bluetooth')
-rw-r--r-- | net/bluetooth/mgmt.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index 7639290b6de3..9071886df194 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c @@ -278,6 +278,14 @@ static u8 le_addr_type(u8 mgmt_addr_type) return ADDR_LE_DEV_RANDOM; } +void mgmt_fill_version_info(void *ver) +{ + struct mgmt_rp_read_version *rp = ver; + + rp->version = MGMT_VERSION; + rp->revision = cpu_to_le16(MGMT_REVISION); +} + static int read_version(struct sock *sk, struct hci_dev *hdev, void *data, u16 data_len) { @@ -285,8 +293,7 @@ static int read_version(struct sock *sk, struct hci_dev *hdev, void *data, BT_DBG("sock %p", sk); - rp.version = MGMT_VERSION; - rp.revision = cpu_to_le16(MGMT_REVISION); + mgmt_fill_version_info(&rp); return mgmt_cmd_complete(sk, MGMT_INDEX_NONE, MGMT_OP_READ_VERSION, 0, &rp, sizeof(rp)); |