Re: [PATCH v2 1/5] Bluetooth: Fix hci_add_sysfs

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

 



Hi Andre,

2013-08-23 Andre Guedes <andre.guedes@xxxxxxxxxxxxx>:

> The inquiry_cache and auto_accept_delay files should be added to
> debugfs only if controller is BR/EDR capable.
> 
> Since in hci_register_dev() hdev has not been initialized yet,
> we are not able to check if the controller is BR/EDR capable.
> Thus, we postpone exporting those two files to just after
> controller's initialization.
> 
> Signed-off-by: Andre Guedes <andre.guedes@xxxxxxxxxxxxx>
> ---
>  include/net/bluetooth/hci_core.h |  1 +
>  net/bluetooth/hci_core.c         | 17 ++++++++++++-----
>  net/bluetooth/hci_sysfs.c        | 16 +++++++++++-----
>  3 files changed, 24 insertions(+), 10 deletions(-)
> 
> diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
> index 3ede820..879bf45 100644
> --- a/include/net/bluetooth/hci_core.h
> +++ b/include/net/bluetooth/hci_core.h
> @@ -775,6 +775,7 @@ int hci_recv_stream_fragment(struct hci_dev *hdev, void *data, int count);
>  void hci_init_sysfs(struct hci_dev *hdev);
>  int hci_add_sysfs(struct hci_dev *hdev);
>  void hci_del_sysfs(struct hci_dev *hdev);
> +void hci_sysfs_export_info(struct hci_dev *hdev);
>  void hci_conn_init_sysfs(struct hci_conn *conn);
>  void hci_conn_add_sysfs(struct hci_conn *conn);
>  void hci_conn_del_sysfs(struct hci_conn *conn);
> diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
> index 8d9b87d..e8be6ec 100644
> --- a/net/bluetooth/hci_core.c
> +++ b/net/bluetooth/hci_core.c
> @@ -1184,11 +1184,18 @@ int hci_dev_open(__u16 dev)
>  		hci_dev_hold(hdev);
>  		set_bit(HCI_UP, &hdev->flags);
>  		hci_notify(hdev, HCI_DEV_UP);
> -		if (!test_bit(HCI_SETUP, &hdev->dev_flags) &&
> -		    mgmt_valid_hdev(hdev)) {
> -			hci_dev_lock(hdev);
> -			mgmt_powered(hdev, 1);
> -			hci_dev_unlock(hdev);
> +		if (mgmt_valid_hdev(hdev)) {
> +			/* If we are in HCI_SETUP phase, meaning the device
> +			 * has just been registered, we should export the
> +			 * remaining infos to debugfs.
> +			 */
> +			if (test_bit(HCI_SETUP, &hdev->dev_flags)) {
> +				hci_sysfs_export_info(hdev);
> +			} else {
> +				hci_dev_lock(hdev);
> +				mgmt_powered(hdev, 1);
> +				hci_dev_unlock(hdev);
> +			}

These patches doesn't apply cleanly on bluetooth-next anymore. Please rebase
the set and resend. Thanks. 

	Gustavo
--
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