summaryrefslogtreecommitdiffstats
path: root/hcid/main.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2005-01-28 17:06:35 +0000
committerMarcel Holtmann <marcel@holtmann.org>2005-01-28 17:06:35 +0000
commit747bc0b292ee5655ef2695c4e8e18f55c4037567 (patch)
tree39de648a1caf56eb6907348605a97fbd2049a8c9 /hcid/main.c
parentc15fb910d23b698af183312eb05f1d1038e88259 (diff)
Don't configure raw devices
Diffstat (limited to 'hcid/main.c')
-rw-r--r--hcid/main.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/hcid/main.c b/hcid/main.c
index 21da79ad..c2c6381c 100644
--- a/hcid/main.c
+++ b/hcid/main.c
@@ -161,6 +161,7 @@ static void configure_device(int hdev)
{
struct device_opts *device_opts;
struct hci_dev_req dr;
+ struct hci_dev_info di;
int s;
/* Do configuration in the separate process */
@@ -182,6 +183,13 @@ static void configure_device(int hdev)
exit(1);
}
+ di.dev_id = hdev;
+ if (ioctl(s, HCIGETDEVINFO, (void *) &di) < 0)
+ exit(1);
+
+ if (hci_test_bit(HCI_RAW, &di.flags))
+ exit(0);
+
dr.dev_id = hdev;
device_opts = get_device_opts(s, hdev);
@@ -241,6 +249,7 @@ static void init_device(int hdev)
{
struct device_opts *device_opts;
struct hci_dev_req dr;
+ struct hci_dev_info di;
int s;
/* Do initialization in the separate process */
@@ -269,6 +278,13 @@ static void init_device(int hdev)
exit(1);
}
+ di.dev_id = hdev;
+ if (ioctl(s, HCIGETDEVINFO, (void *) &di) < 0)
+ exit(1);
+
+ if (hci_test_bit(HCI_RAW, &di.flags))
+ exit(0);
+
dr.dev_id = hdev;
device_opts = get_device_opts(s, hdev);
@@ -326,12 +342,10 @@ static void init_all_devices(int ctl)
if (hcid.auto_init)
init_device(dr->dev_id);
- if (hcid.auto_init && hci_test_bit(HCI_UP, &dr->dev_opt) &&
- !hci_test_bit(HCI_RAW, &dr->dev_opt))
+ if (hcid.auto_init && hci_test_bit(HCI_UP, &dr->dev_opt))
configure_device(dr->dev_id);
- if (hcid.security && hci_test_bit(HCI_UP, &dr->dev_opt) &&
- !hci_test_bit(HCI_RAW, &dr->dev_opt))
+ if (hcid.security && hci_test_bit(HCI_UP, &dr->dev_opt))
start_security_manager(dr->dev_id);
}