diff options
Diffstat (limited to 'hcid')
-rw-r--r-- | hcid/main.c | 22 | ||||
-rw-r--r-- | hcid/security.c | 3 |
2 files changed, 21 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); } diff --git a/hcid/security.c b/hcid/security.c index 8cc25036..f0bf12bd 100644 --- a/hcid/security.c +++ b/hcid/security.c @@ -427,6 +427,9 @@ static gboolean io_security_event(GIOChannel *chan, GIOCondition cond, gpointer ioctl(dev, HCIGETDEVINFO, (void *) di); + if (hci_test_bit(HCI_RAW, &di->flags)) + return TRUE; + switch (eh->evt) { case EVT_REMOTE_NAME_REQ_COMPLETE: remote_name_information(dev, &di->bdaddr, ptr); |