diff options
author | Johan Hedberg <johan.hedberg@nokia.com> | 2011-03-16 08:29:37 -0400 |
---|---|---|
committer | Gustavo F. Padovan <padovan@profusion.mobi> | 2011-03-31 13:22:54 -0400 |
commit | b312b161ecb833b1bce5c4a97853f4a4f40c7901 (patch) | |
tree | 7700417fc16114030316a3a2ba2fcd58ea37a25d /net/bluetooth/hci_event.c | |
parent | dc4fe30b8675033e538e2dea50be8af9c75f1b6a (diff) |
Bluetooth: mgmt: Add support for setting the local name
This patch adds a new set_local_name management command as well as a
local_name_changed management event. With these user space can both
change the local name as well as monitor changes to it by others.
Signed-off-by: Johan Hedberg <johan.hedberg@nokia.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Diffstat (limited to 'net/bluetooth/hci_event.c')
-rw-r--r-- | net/bluetooth/hci_event.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index 91ef52673ed3..0def3e1fe5ef 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c | |||
@@ -193,13 +193,16 @@ static void hci_cc_write_local_name(struct hci_dev *hdev, struct sk_buff *skb) | |||
193 | 193 | ||
194 | BT_DBG("%s status 0x%x", hdev->name, status); | 194 | BT_DBG("%s status 0x%x", hdev->name, status); |
195 | 195 | ||
196 | if (status) | ||
197 | return; | ||
198 | |||
199 | sent = hci_sent_cmd_data(hdev, HCI_OP_WRITE_LOCAL_NAME); | 196 | sent = hci_sent_cmd_data(hdev, HCI_OP_WRITE_LOCAL_NAME); |
200 | if (!sent) | 197 | if (!sent) |
201 | return; | 198 | return; |
202 | 199 | ||
200 | if (test_bit(HCI_MGMT, &hdev->flags)) | ||
201 | mgmt_set_local_name_complete(hdev->id, sent, status); | ||
202 | |||
203 | if (status) | ||
204 | return; | ||
205 | |||
203 | memcpy(hdev->dev_name, sent, HCI_MAX_NAME_LENGTH); | 206 | memcpy(hdev->dev_name, sent, HCI_MAX_NAME_LENGTH); |
204 | } | 207 | } |
205 | 208 | ||