summaryrefslogtreecommitdiffstats
path: root/net/bluetooth/hci_sock.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2014-07-02 19:10:33 +0200
committerMarcel Holtmann <marcel@holtmann.org>2014-07-03 17:42:58 +0200
commit4a964404c08fed64d1afd8b0af1e7f2b8f7ae90e (patch)
tree7d802b11df2bece536da78a26bad41740e4336d4 /net/bluetooth/hci_sock.c
parentc103aea6f709c68916160eca4ed20224934e62d7 (diff)
downloadop-kernel-dev-4a964404c08fed64d1afd8b0af1e7f2b8f7ae90e.zip
op-kernel-dev-4a964404c08fed64d1afd8b0af1e7f2b8f7ae90e.tar.gz
Bluetooth: Introduce unconfigured controller state
With the new unconfigured controller state it is possible to provide a fully functional HCI transport, but disable the higher level operations that would normally happen. This way userspace can try to configure the controller before releases the unconfigured state. The internal state is represented by HCI_UNCONFIGURED. This replaces the HCI_QUIRK_RAW_DEVICE quirk as internal state representation. This is now a real state and drivers can use the quirk to actually trigger this state. In the future this will allow a more fine grained switching from unconfigured state to configured state for controller inititialization. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Diffstat (limited to 'net/bluetooth/hci_sock.c')
-rw-r--r--net/bluetooth/hci_sock.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/net/bluetooth/hci_sock.c b/net/bluetooth/hci_sock.c
index 54e4e8f..db96103 100644
--- a/net/bluetooth/hci_sock.c
+++ b/net/bluetooth/hci_sock.c
@@ -453,7 +453,7 @@ static int hci_sock_release(struct socket *sock)
if (hdev) {
if (hci_pi(sk)->channel == HCI_CHANNEL_USER) {
- if (!test_bit(HCI_QUIRK_RAW_DEVICE, &hdev->quirks))
+ if (!test_bit(HCI_UNCONFIGURED, &hdev->dev_flags))
mgmt_index_added(hdev);
clear_bit(HCI_USER_CHANNEL, &hdev->dev_flags);
hci_dev_close(hdev->id);
@@ -518,7 +518,7 @@ static int hci_sock_bound_ioctl(struct sock *sk, unsigned int cmd,
if (test_bit(HCI_USER_CHANNEL, &hdev->dev_flags))
return -EBUSY;
- if (test_bit(HCI_QUIRK_RAW_DEVICE, &hdev->quirks))
+ if (test_bit(HCI_UNCONFIGURED, &hdev->dev_flags))
return -EOPNOTSUPP;
if (hdev->dev_type != HCI_BREDR)
@@ -706,13 +706,13 @@ static int hci_sock_bind(struct socket *sock, struct sockaddr *addr,
goto done;
}
- if (!test_bit(HCI_QUIRK_RAW_DEVICE, &hdev->quirks))
+ if (!test_bit(HCI_UNCONFIGURED, &hdev->dev_flags))
mgmt_index_removed(hdev);
err = hci_dev_open(hdev->id);
if (err) {
clear_bit(HCI_USER_CHANNEL, &hdev->dev_flags);
- if (!test_bit(HCI_QUIRK_RAW_DEVICE, &hdev->quirks))
+ if (!test_bit(HCI_UNCONFIGURED, &hdev->dev_flags))
mgmt_index_added(hdev);
hci_dev_put(hdev);
goto done;
OpenPOWER on IntegriCloud