aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/bluetooth/mgmt.h
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2011-03-16 08:29:36 -0400
committerGustavo F. Padovan <padovan@profusion.mobi>2011-03-31 13:22:54 -0400
commitdc4fe30b8675033e538e2dea50be8af9c75f1b6a (patch)
tree8958c01fd4b57d0680b23e67cce45e0cdf51de5e /include/net/bluetooth/mgmt.h
parent1f6c6378c59f3ddac9ed89a68ccefe2611300c09 (diff)
Bluetooth: mgmt: Add local name information to read_info reply
This patch adds the name of the adapter to the reply of the read_info management command. The management messages reserve 249 bytes for the name instead of 248 (like in the HCI spec) so that there is always a guarantee that it is nul-terminated. That way it can safely be passed onto string manipulation functions. Signed-off-by: Johan Hedberg <johan.hedberg@nokia.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Diffstat (limited to 'include/net/bluetooth/mgmt.h')
-rw-r--r--include/net/bluetooth/mgmt.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/net/bluetooth/mgmt.h b/include/net/bluetooth/mgmt.h
index 5fabfa886b3e..7d0749bed090 100644
--- a/include/net/bluetooth/mgmt.h
+++ b/include/net/bluetooth/mgmt.h
@@ -41,6 +41,10 @@ struct mgmt_rp_read_index_list {
41 __le16 index[0]; 41 __le16 index[0];
42} __packed; 42} __packed;
43 43
44/* Reserve one extra byte for names in management messages so that they
45 * are always guaranteed to be nul-terminated */
46#define MGMT_MAX_NAME_LENGTH (HCI_MAX_NAME_LENGTH + 1)
47
44#define MGMT_OP_READ_INFO 0x0004 48#define MGMT_OP_READ_INFO 0x0004
45struct mgmt_rp_read_info { 49struct mgmt_rp_read_info {
46 __u8 type; 50 __u8 type;
@@ -55,6 +59,7 @@ struct mgmt_rp_read_info {
55 __u16 manufacturer; 59 __u16 manufacturer;
56 __u8 hci_ver; 60 __u8 hci_ver;
57 __u16 hci_rev; 61 __u16 hci_rev;
62 __u8 name[MGMT_MAX_NAME_LENGTH];
58} __packed; 63} __packed;
59 64
60struct mgmt_mode { 65struct mgmt_mode {