Return-Path: Date: Tue, 24 May 2011 13:51:36 +0300 From: Ville Tervo To: ext Andre Guedes Cc: linux-bluetooth@vger.kernel.org Subject: Re: [PATCH v2 05/11] Bluetooth: Clear advertising cache before scanning Message-ID: <20110524105136.GE2480@null> References: <1305936645-15007-1-git-send-email-andre.guedes@openbossa.org> <1305936645-15007-5-git-send-email-andre.guedes@openbossa.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: <1305936645-15007-5-git-send-email-andre.guedes@openbossa.org> Sender: linux-bluetooth-owner@vger.kernel.org List-ID: Hi Andre, On Fri, May 20, 2011 at 09:10:39PM -0300, ext Andre Guedes wrote: > The LE advertising cache should be cleared before performing a LE > scanning. This will force the cache to contain only fresh advertising > entries. 04/11 can be marged with this one. > > Signed-off-by: Andre Guedes > --- > net/bluetooth/hci_event.c | 18 ++++++++++++++++++ > 1 files changed, 18 insertions(+), 0 deletions(-) > > diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c > index ccf4d4d..85e12d8 100644 > --- a/net/bluetooth/hci_event.c > +++ b/net/bluetooth/hci_event.c > @@ -842,9 +842,27 @@ static void hci_cc_read_local_oob_data_reply(struct hci_dev *hdev, > static void hci_cc_le_set_scan_enable(struct hci_dev *hdev, > struct sk_buff *skb) > { > + void *sent; > + __u8 param_scan_enable; > __u8 status = *((__u8 *) skb->data); > > BT_DBG("%s status 0x%x", hdev->name, status); > + > + if (status) > + return; > + > + sent = hci_sent_cmd_data(hdev, HCI_OP_LE_SET_SCAN_ENABLE); > + if (!sent) > + return; > + > + param_scan_enable = *((__u8 *) sent); A proper struct would be better since this command has two parameters. > + > + hci_dev_lock(hdev); > + > + if (param_scan_enable == 0x01) > + hci_adv_entries_clear(hdev); > + > + hci_dev_unlock(hdev); > } > > static inline void hci_cs_inquiry(struct hci_dev *hdev, __u8 status) > -- > 1.7.4.1 > -- Ville