* [PATCH] Bluetooth: Fix Class of Device indication when powering off
@ 2013-01-16 14:15 Johan Hedberg
2013-01-17 5:21 ` Marcel Holtmann
2013-01-23 4:20 ` Gustavo Padovan
0 siblings, 2 replies; 3+ messages in thread
From: Johan Hedberg @ 2013-01-16 14:15 UTC (permalink / raw)
To: linux-bluetooth
From: Johan Hedberg <johan.hedberg@intel.com>
When a HCI device is powered off the Management interface specification
dictates that the class of device value is indicated as zero. This patch
fixes sending of the appropriate class of device changed event when a
HCI device is powered off.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
---
net/bluetooth/mgmt.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index fc171f2..54f3ddba 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -2987,7 +2987,13 @@ int mgmt_powered(struct hci_dev *hdev, u8 powered)
}
} else {
u8 status = MGMT_STATUS_NOT_POWERED;
+ u8 zero_cod[] = { 0, 0, 0 };
+
mgmt_pending_foreach(0, hdev, cmd_status_rsp, &status);
+
+ if (memcmp(hdev->dev_class, zero_cod, sizeof(zero_cod)) != 0)
+ mgmt_event(MGMT_EV_CLASS_OF_DEV_CHANGED, hdev,
+ zero_cod, sizeof(zero_cod), NULL);
}
err = new_settings(hdev, match.sk);
--
1.7.10.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] Bluetooth: Fix Class of Device indication when powering off
2013-01-16 14:15 [PATCH] Bluetooth: Fix Class of Device indication when powering off Johan Hedberg
@ 2013-01-17 5:21 ` Marcel Holtmann
2013-01-23 4:20 ` Gustavo Padovan
1 sibling, 0 replies; 3+ messages in thread
From: Marcel Holtmann @ 2013-01-17 5:21 UTC (permalink / raw)
To: Johan Hedberg; +Cc: linux-bluetooth
Hi Johan,
> When a HCI device is powered off the Management interface specification
> dictates that the class of device value is indicated as zero. This patch
> fixes sending of the appropriate class of device changed event when a
> HCI device is powered off.
>
> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
> ---
> net/bluetooth/mgmt.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
> index fc171f2..54f3ddba 100644
> --- a/net/bluetooth/mgmt.c
> +++ b/net/bluetooth/mgmt.c
> @@ -2987,7 +2987,13 @@ int mgmt_powered(struct hci_dev *hdev, u8 powered)
> }
> } else {
> u8 status = MGMT_STATUS_NOT_POWERED;
> + u8 zero_cod[] = { 0, 0, 0 };
> +
> mgmt_pending_foreach(0, hdev, cmd_status_rsp, &status);
> +
> + if (memcmp(hdev->dev_class, zero_cod, sizeof(zero_cod)) != 0)
shouldn't we better use if (memcmp( ...)) here.
> + mgmt_event(MGMT_EV_CLASS_OF_DEV_CHANGED, hdev,
> + zero_cod, sizeof(zero_cod), NULL);
> }
Otherwise this is fine with me.
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Regards
Marcel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Bluetooth: Fix Class of Device indication when powering off
2013-01-16 14:15 [PATCH] Bluetooth: Fix Class of Device indication when powering off Johan Hedberg
2013-01-17 5:21 ` Marcel Holtmann
@ 2013-01-23 4:20 ` Gustavo Padovan
1 sibling, 0 replies; 3+ messages in thread
From: Gustavo Padovan @ 2013-01-23 4:20 UTC (permalink / raw)
To: Johan Hedberg; +Cc: linux-bluetooth
Hi Johan,
* Johan Hedberg <johan.hedberg@gmail.com> [2013-01-16 16:15:34 +0200]:
> From: Johan Hedberg <johan.hedberg@intel.com>
>
> When a HCI device is powered off the Management interface specification
> dictates that the class of device value is indicated as zero. This patch
> fixes sending of the appropriate class of device changed event when a
> HCI device is powered off.
>
> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
> ---
> net/bluetooth/mgmt.c | 6 ++++++
> 1 file changed, 6 insertions(+)
Patch has been applied to bluetooth-next. Thanks.
Gustavo
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-01-23 4:20 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-16 14:15 [PATCH] Bluetooth: Fix Class of Device indication when powering off Johan Hedberg
2013-01-17 5:21 ` Marcel Holtmann
2013-01-23 4:20 ` Gustavo Padovan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).