]> git.baikalelectronics.ru Git - kernel.git/commit
Bluetooth: Fix waiting for EIR update when setting local name
authorJohan Hedberg <johan.hedberg@intel.com>
Fri, 15 Mar 2013 22:07:00 +0000 (17:07 -0500)
committerGustavo Padovan <gustavo.padovan@collabora.co.uk>
Mon, 18 Mar 2013 17:02:03 +0000 (14:02 -0300)
commit4334821d0a4424e30c776aef09f4a28706d0ea79
tree1e17017716aa44cd435ef28cc095b85dd451c218
parent3b06c17ace24d3e91bc797b415da530cd2a42c62
Bluetooth: Fix waiting for EIR update when setting local name

We shouldn't respond to the mgmt_set_local_name command until all
related HCI commands have completed. This patch fixes the issue by
running the local name HCI command and the EIR update in the same
asynchronous request, and returning the mgmt command complete through
the complete callback of the request.

The downside of this is that we must set hdev->dev_name before the local
name HCI command has completed since otherwise the generated EIR
command doesn't contain the new name. This means that we can no-longer
reliably detect when the name has really changed and when not. Luckily
this only affects scenarios where the mgmt interface is *not* used (e.g.
hciconfig) so redundant mgmt_ev_local_name_changed events in these cases
are an acceptable drawback.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
net/bluetooth/mgmt.c