All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] Bluetooth: mgmt: Fix update_eir/class with HCI_AUTO_OFF flag set
@ 2012-02-23 14:03 johan.hedberg
  2012-02-23 14:03 ` [PATCH 2/2] Bluetooth: mgmt: Fix return value of add/remove_uuid johan.hedberg
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: johan.hedberg @ 2012-02-23 14:03 UTC (permalink / raw)
  To: linux-bluetooth

From: Johan Hedberg <johan.hedberg@intel.com>

If we're powered but still have the HCI_AUTO_OFF flag set the
update_eir and update_class functions should not do anything.
Additionally these functions need to be called when the flag is finally
cleared through set_powered or when powering on for real.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
---
 net/bluetooth/mgmt.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index 7fdba8f..4e48894 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -532,7 +532,7 @@ static int update_eir(struct hci_dev *hdev)
 {
 	struct hci_cp_write_eir cp;
 
-	if (!test_bit(HCI_UP, &hdev->flags))
+	if (!hdev_is_powered(hdev))
 		return 0;
 
 	if (!(hdev->features[6] & LMP_EXT_INQ))
@@ -573,7 +573,7 @@ static int update_class(struct hci_dev *hdev)
 
 	BT_DBG("%s", hdev->name);
 
-	if (!test_bit(HCI_UP, &hdev->flags))
+	if (!hdev_is_powered(hdev))
 		return 0;
 
 	if (test_bit(HCI_SERVICE_CACHE, &hdev->dev_flags))
@@ -3121,6 +3121,9 @@ int mgmt_powered(struct hci_dev *hdev, u8 powered)
 
 		if (scan)
 			hci_send_cmd(hdev, HCI_OP_WRITE_SCAN_ENABLE, 1, &scan);
+
+		update_class(hdev);
+		update_eir(hdev);
 	} else {
 		u8 status = ENETDOWN;
 		mgmt_pending_foreach(0, hdev, cmd_status_rsp, &status);
-- 
1.7.9


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/2] Bluetooth: mgmt: Fix return value of add/remove_uuid
  2012-02-23 14:03 [PATCH 1/2] Bluetooth: mgmt: Fix update_eir/class with HCI_AUTO_OFF flag set johan.hedberg
@ 2012-02-23 14:03 ` johan.hedberg
  2012-02-23 14:53   ` Gustavo Padovan
  2012-02-23 14:54   ` Marcel Holtmann
  2012-02-23 14:52 ` [PATCH 1/2] Bluetooth: mgmt: Fix update_eir/class with HCI_AUTO_OFF flag set Gustavo Padovan
  2012-02-23 14:53 ` Marcel Holtmann
  2 siblings, 2 replies; 6+ messages in thread
From: johan.hedberg @ 2012-02-23 14:03 UTC (permalink / raw)
  To: linux-bluetooth

From: Johan Hedberg <johan.hedberg@intel.com>

The Add/Remove UUID commands should return the device class instead of
an empty parameter list.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
---
 net/bluetooth/mgmt.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index 4e48894..000abc0 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -1367,7 +1367,7 @@ static int add_uuid(struct sock *sk, u16 index, void *data, u16 len)
 	if (err < 0)
 		goto failed;
 
-	err = cmd_complete(sk, index, MGMT_OP_ADD_UUID, 0, NULL, 0);
+	err = cmd_complete(sk, index, MGMT_OP_ADD_UUID, 0, hdev->dev_class, 3);
 
 failed:
 	hci_dev_unlock(hdev);
@@ -1428,7 +1428,8 @@ static int remove_uuid(struct sock *sk, u16 index, void *data, u16 len)
 	if (err < 0)
 		goto unlock;
 
-	err = cmd_complete(sk, index, MGMT_OP_REMOVE_UUID, 0, NULL, 0);
+	err = cmd_complete(sk, index, MGMT_OP_REMOVE_UUID, 0,
+							hdev->dev_class, 3);
 
 unlock:
 	hci_dev_unlock(hdev);
-- 
1.7.9


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] Bluetooth: mgmt: Fix update_eir/class with HCI_AUTO_OFF flag set
  2012-02-23 14:03 [PATCH 1/2] Bluetooth: mgmt: Fix update_eir/class with HCI_AUTO_OFF flag set johan.hedberg
  2012-02-23 14:03 ` [PATCH 2/2] Bluetooth: mgmt: Fix return value of add/remove_uuid johan.hedberg
@ 2012-02-23 14:52 ` Gustavo Padovan
  2012-02-23 14:53 ` Marcel Holtmann
  2 siblings, 0 replies; 6+ messages in thread
From: Gustavo Padovan @ 2012-02-23 14:52 UTC (permalink / raw)
  To: johan.hedberg; +Cc: linux-bluetooth

Hi Johan,

* johan.hedberg@gmail.com <johan.hedberg@gmail.com> [2012-02-23 16:03:00 +0200]:

> From: Johan Hedberg <johan.hedberg@intel.com>
> 
> If we're powered but still have the HCI_AUTO_OFF flag set the
> update_eir and update_class functions should not do anything.
> Additionally these functions need to be called when the flag is finally
> cleared through set_powered or when powering on for real.
> 
> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
> ---
>  net/bluetooth/mgmt.c |    7 +++++--
>  1 files changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
> index 7fdba8f..4e48894 100644
> --- a/net/bluetooth/mgmt.c
> +++ b/net/bluetooth/mgmt.c
> @@ -532,7 +532,7 @@ static int update_eir(struct hci_dev *hdev)
>  {
>  	struct hci_cp_write_eir cp;
>  
> -	if (!test_bit(HCI_UP, &hdev->flags))
> +	if (!hdev_is_powered(hdev))
>  		return 0;
>  
>  	if (!(hdev->features[6] & LMP_EXT_INQ))
> @@ -573,7 +573,7 @@ static int update_class(struct hci_dev *hdev)
>  
>  	BT_DBG("%s", hdev->name);
>  
> -	if (!test_bit(HCI_UP, &hdev->flags))
> +	if (!hdev_is_powered(hdev))
>  		return 0;
>  
>  	if (test_bit(HCI_SERVICE_CACHE, &hdev->dev_flags))
> @@ -3121,6 +3121,9 @@ int mgmt_powered(struct hci_dev *hdev, u8 powered)
>  
>  		if (scan)
>  			hci_send_cmd(hdev, HCI_OP_WRITE_SCAN_ENABLE, 1, &scan);
> +
> +		update_class(hdev);
> +		update_eir(hdev);
>  	} else {
>  		u8 status = ENETDOWN;
>  		mgmt_pending_foreach(0, hdev, cmd_status_rsp, &status);

Acked-by: Gustavo F. Padovan <padovan@profusion.mobi>

	Gustavo

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] Bluetooth: mgmt: Fix return value of add/remove_uuid
  2012-02-23 14:03 ` [PATCH 2/2] Bluetooth: mgmt: Fix return value of add/remove_uuid johan.hedberg
@ 2012-02-23 14:53   ` Gustavo Padovan
  2012-02-23 14:54   ` Marcel Holtmann
  1 sibling, 0 replies; 6+ messages in thread
From: Gustavo Padovan @ 2012-02-23 14:53 UTC (permalink / raw)
  To: johan.hedberg; +Cc: linux-bluetooth

Hi Johan,

* johan.hedberg@gmail.com <johan.hedberg@gmail.com> [2012-02-23 16:03:01 +0200]:

> From: Johan Hedberg <johan.hedberg@intel.com>
> 
> The Add/Remove UUID commands should return the device class instead of
> an empty parameter list.
> 
> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
> ---
>  net/bluetooth/mgmt.c |    5 +++--
>  1 files changed, 3 insertions(+), 2 deletions(-)

Acked-by: Gustavo F. Padovan <padovan@profusion.mobi>

	Gustavo

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] Bluetooth: mgmt: Fix update_eir/class with HCI_AUTO_OFF flag set
  2012-02-23 14:03 [PATCH 1/2] Bluetooth: mgmt: Fix update_eir/class with HCI_AUTO_OFF flag set johan.hedberg
  2012-02-23 14:03 ` [PATCH 2/2] Bluetooth: mgmt: Fix return value of add/remove_uuid johan.hedberg
  2012-02-23 14:52 ` [PATCH 1/2] Bluetooth: mgmt: Fix update_eir/class with HCI_AUTO_OFF flag set Gustavo Padovan
@ 2012-02-23 14:53 ` Marcel Holtmann
  2 siblings, 0 replies; 6+ messages in thread
From: Marcel Holtmann @ 2012-02-23 14:53 UTC (permalink / raw)
  To: johan.hedberg; +Cc: linux-bluetooth

Hi Johan,

> If we're powered but still have the HCI_AUTO_OFF flag set the
> update_eir and update_class functions should not do anything.
> Additionally these functions need to be called when the flag is finally
> cleared through set_powered or when powering on for real.
> 
> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
> ---
>  net/bluetooth/mgmt.c |    7 +++++--
>  1 files changed, 5 insertions(+), 2 deletions(-)

Acked-by: Marcel Holtmann <marcel@holtmann.org>

Regards

Marcel



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] Bluetooth: mgmt: Fix return value of add/remove_uuid
  2012-02-23 14:03 ` [PATCH 2/2] Bluetooth: mgmt: Fix return value of add/remove_uuid johan.hedberg
  2012-02-23 14:53   ` Gustavo Padovan
@ 2012-02-23 14:54   ` Marcel Holtmann
  1 sibling, 0 replies; 6+ messages in thread
From: Marcel Holtmann @ 2012-02-23 14:54 UTC (permalink / raw)
  To: johan.hedberg; +Cc: linux-bluetooth

Hi Johan,

> The Add/Remove UUID commands should return the device class instead of
> an empty parameter list.
> 
> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
> ---
>  net/bluetooth/mgmt.c |    5 +++--
>  1 files changed, 3 insertions(+), 2 deletions(-)

Acked-by: Marcel Holtmann <marcel@holtmann.org>

Regards

Marcel



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-02-23 14:54 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-23 14:03 [PATCH 1/2] Bluetooth: mgmt: Fix update_eir/class with HCI_AUTO_OFF flag set johan.hedberg
2012-02-23 14:03 ` [PATCH 2/2] Bluetooth: mgmt: Fix return value of add/remove_uuid johan.hedberg
2012-02-23 14:53   ` Gustavo Padovan
2012-02-23 14:54   ` Marcel Holtmann
2012-02-23 14:52 ` [PATCH 1/2] Bluetooth: mgmt: Fix update_eir/class with HCI_AUTO_OFF flag set Gustavo Padovan
2012-02-23 14:53 ` Marcel Holtmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.