* [PATCH] Bluetooth: mgmt: Add missing endian conversion
@ 2012-03-09 15:05 Andrei Emeltchenko
2012-03-09 17:13 ` Marcel Holtmann
0 siblings, 1 reply; 2+ messages in thread
From: Andrei Emeltchenko @ 2012-03-09 15:05 UTC (permalink / raw)
To: linux-bluetooth
From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Add missing endian conversion for page scan interval and window.
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
---
net/bluetooth/mgmt.c | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index 97b5b6c..06d2eaf 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -2523,13 +2523,18 @@ static int set_fast_connectable(struct sock *sk, struct hci_dev *hdev,
if (cp->val) {
type = PAGE_SCAN_TYPE_INTERLACED;
- acp.interval = 0x0024; /* 22.5 msec page scan interval */
+
+ /* 22.5 msec page scan interval */
+ acp.interval = cpu_to_le16(0x0024);
} else {
type = PAGE_SCAN_TYPE_STANDARD; /* default */
- acp.interval = 0x0800; /* default 1.28 sec page scan */
+
+ /* default 1.28 sec page scan */
+ acp.interval = cpu_to_le16(0x0800);
}
- acp.window = 0x0012; /* default 11.25 msec page scan window */
+ /* default 11.25 msec page scan window */
+ acp.window = cpu_to_le16(0x0012);
err = hci_send_cmd(hdev, HCI_OP_WRITE_PAGE_SCAN_ACTIVITY, sizeof(acp),
&acp);
--
1.7.9
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] Bluetooth: mgmt: Add missing endian conversion
2012-03-09 15:05 [PATCH] Bluetooth: mgmt: Add missing endian conversion Andrei Emeltchenko
@ 2012-03-09 17:13 ` Marcel Holtmann
0 siblings, 0 replies; 2+ messages in thread
From: Marcel Holtmann @ 2012-03-09 17:13 UTC (permalink / raw)
To: Andrei Emeltchenko; +Cc: linux-bluetooth
Hi Andrei,
> Add missing endian conversion for page scan interval and window.
>
> Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
> ---
> net/bluetooth/mgmt.c | 11 ++++++++---
> 1 files changed, 8 insertions(+), 3 deletions(-)
>
> diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
> index 97b5b6c..06d2eaf 100644
> --- a/net/bluetooth/mgmt.c
> +++ b/net/bluetooth/mgmt.c
> @@ -2523,13 +2523,18 @@ static int set_fast_connectable(struct sock *sk, struct hci_dev *hdev,
>
> if (cp->val) {
> type = PAGE_SCAN_TYPE_INTERLACED;
> - acp.interval = 0x0024; /* 22.5 msec page scan interval */
> +
> + /* 22.5 msec page scan interval */
> + acp.interval = cpu_to_le16(0x0024);
> } else {
> type = PAGE_SCAN_TYPE_STANDARD; /* default */
> - acp.interval = 0x0800; /* default 1.28 sec page scan */
> +
> + /* default 1.28 sec page scan */
> + acp.interval = cpu_to_le16(0x0800);
> }
>
> - acp.window = 0x0012; /* default 11.25 msec page scan window */
> + /* default 11.25 msec page scan window */
> + acp.window = cpu_to_le16(0x0012);
please use __constant_cpu_to_le16.
Regards
Marcel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-03-09 17:13 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-09 15:05 [PATCH] Bluetooth: mgmt: Add missing endian conversion Andrei Emeltchenko
2012-03-09 17:13 ` Marcel Holtmann
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).