summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2006-07-28 01:36:38 +0000
committerMarcel Holtmann <marcel@holtmann.org>2006-07-28 01:36:38 +0000
commit276a7aeaed518f61b0ec85f9658c62829d99a925 (patch)
tree8bc63099be7e1b820b3fcab1613b946da8c296bc
parent99c432aacb510614489b6af49d5f4da1a9391a16 (diff)
Don't change inquiry mode for Bluetooth 1.1 adapters
-rw-r--r--hcid/device.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/hcid/device.c b/hcid/device.c
index 59760e68..a9ea8fc6 100644
--- a/hcid/device.c
+++ b/hcid/device.c
@@ -189,6 +189,7 @@ int start_device(uint16_t dev_id)
if (hci_read_local_version(dd, &ver, 1000) < 0) {
error("Can't read version info for hci%d: %s (%d)",
dev_id, strerror(errno), errno);
+ hci_close_dev(dd);
return -errno;
}
@@ -200,19 +201,24 @@ int start_device(uint16_t dev_id)
if (hci_read_local_features(dd, features, 1000) < 0) {
error("Can't read features for hci%d: %s (%d)",
dev_id, strerror(errno), errno);
+ hci_close_dev(dd);
return -errno;
}
memcpy(dev->features, features, 8);
inqmode = get_inquiry_mode(dev);
+ if (inqmode < 1)
+ goto done;
if (hci_write_inquiry_mode(dd, inqmode, 1000) < 0) {
error("Can't write inquiry mode for hci%d: %s (%d)",
dev_id, strerror(errno), errno);
+ hci_close_dev(dd);
return -errno;
}
+done:
hci_close_dev(dd);
info("Device hci%d has been activated", dev_id);