Re: [PATCH v2 05/11] Bluetooth: Clear advertising cache before scanning

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <andre.guedes@xxxxxxxxxxxxx>
> ---
>  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
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux