From 155b05b6ee08aafcead3ffe4a07c5883465b6fab Mon Sep 17 00:00:00 2001 From: Matthew Xie Date: Wed, 10 Aug 2011 19:04:44 -0700 Subject: Revert "Send hci command to disable scan mode in power down function" This reverts commit 6b08f121c817cda19431fa472c9640733df05d6f --- plugins/hciops.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/plugins/hciops.c b/plugins/hciops.c index ad977295..817a180c 100644 --- a/plugins/hciops.c +++ b/plugins/hciops.c @@ -462,15 +462,8 @@ static int hciops_set_pairable(int index, gboolean pairable) static int hciops_power_off(int index) { struct dev_info *dev = &devs[index]; - uint8_t mode; - DBG("hci%d set scan mode off", index); - mode = SCAN_DISABLED; - if (hci_send_cmd(dev->sk, OGF_HOST_CTL, OCF_WRITE_SCAN_ENABLE, - 1, &mode) < 0) - return -errno; - - DBG("hci%d HCIDEVDOWN", index); + DBG("hci%d", index); if (ioctl(dev->sk, HCIDEVDOWN, index) < 0 && errno != EALREADY) return -errno; -- cgit v1.2.3 From 4a6a45b3d2bcfbf23937ca6fcf6decbb42a575ae Mon Sep 17 00:00:00 2001 From: Matthew Xie Date: Fri, 12 Aug 2011 17:01:56 -0700 Subject: Send hci command to disable scan mode in power down function Before we power down HCI dev, we should disable Bluetooth chip scan mode so that the chip set would not repond to device outside inquiry and page. bug 5080232 Change-Id: I357a300ad61332c6f95376c0690602cf396e5973 --- plugins/hciops.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/plugins/hciops.c b/plugins/hciops.c index 817a180c..ad977295 100644 --- a/plugins/hciops.c +++ b/plugins/hciops.c @@ -462,8 +462,15 @@ static int hciops_set_pairable(int index, gboolean pairable) static int hciops_power_off(int index) { struct dev_info *dev = &devs[index]; + uint8_t mode; - DBG("hci%d", index); + DBG("hci%d set scan mode off", index); + mode = SCAN_DISABLED; + if (hci_send_cmd(dev->sk, OGF_HOST_CTL, OCF_WRITE_SCAN_ENABLE, + 1, &mode) < 0) + return -errno; + + DBG("hci%d HCIDEVDOWN", index); if (ioctl(dev->sk, HCIDEVDOWN, index) < 0 && errno != EALREADY) return -errno; -- cgit v1.2.3