summaryrefslogtreecommitdiffstats
path: root/net/bluetooth/hci_sock.c
diff options
context:
space:
mode:
authorJohan Hedberg2011-12-14 23:47:37 +0100
committerGustavo F. Padovan2011-12-18 20:37:26 +0100
commit14c0b60829751135346d71e7d11649c4f72dc9af (patch)
tree1b1520fdb7a3175f3cba319a5678416da7a168f8 /net/bluetooth/hci_sock.c
parentBluetooth: Move mgmt_set_fast_connectable to the right location (diff)
downloadkernel-qcow2-linux-14c0b60829751135346d71e7d11649c4f72dc9af.tar.gz
kernel-qcow2-linux-14c0b60829751135346d71e7d11649c4f72dc9af.tar.xz
kernel-qcow2-linux-14c0b60829751135346d71e7d11649c4f72dc9af.zip
Bluetooth: Remove mgmt_set_service_cache
Instead of having an explicit service cache command we can make the mgmt API simpler by implicitly enabling the cache when mgmt_read_info is called for the first time and disabling it when mgmt_set_dev_class is called. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Acked-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Diffstat (limited to 'net/bluetooth/hci_sock.c')
-rw-r--r--net/bluetooth/hci_sock.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/net/bluetooth/hci_sock.c b/net/bluetooth/hci_sock.c
index cd064068d94a..189a667c293b 100644
--- a/net/bluetooth/hci_sock.c
+++ b/net/bluetooth/hci_sock.c
@@ -343,8 +343,11 @@ static int hci_sock_bind(struct socket *sock, struct sockaddr *addr, int addr_le
if (haddr.hci_channel > HCI_CHANNEL_CONTROL)
return -EINVAL;
- if (haddr.hci_channel == HCI_CHANNEL_CONTROL && !enable_mgmt)
- return -EINVAL;
+ if (haddr.hci_channel == HCI_CHANNEL_CONTROL) {
+ if (!enable_mgmt)
+ return -EINVAL;
+ set_bit(HCI_PI_MGMT_INIT, &hci_pi(sk)->flags);
+ }
lock_sock(sk);