linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Bluetooth: Use AUTO_OFF constant in jiffies
@ 2012-06-14  7:45 Andrei Emeltchenko
  2012-06-14 12:07 ` Anderson Lizardo
  0 siblings, 1 reply; 5+ messages in thread
From: Andrei Emeltchenko @ 2012-06-14  7:45 UTC (permalink / raw)
  To: linux-bluetooth

From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

Move AUTO_OFF_TIMEOUT to other constants changing name to
HCI_AUTO_OFF_TIMEOUT and convert to jiffies.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
---
 include/net/bluetooth/hci.h |    3 ++-
 net/bluetooth/hci_core.c    |    5 +----
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
index 3d1ad2c..a7b334e 100644
--- a/include/net/bluetooth/hci.h
+++ b/include/net/bluetooth/hci.h
@@ -153,8 +153,9 @@ enum {
 #define HCI_DISCONN_TIMEOUT	msecs_to_jiffies(4000)	/* 2 seconds */
 #define HCI_PAIRING_TIMEOUT	msecs_to_jiffies(60000)	/* 60 seconds */
 #define HCI_INIT_TIMEOUT	msecs_to_jiffies(10000)	/* 10 seconds */
-#define HCI_CMD_TIMEOUT		msecs_to_jiffies(1000)	/* 1 seconds */
+#define HCI_CMD_TIMEOUT		msecs_to_jiffies(1000)	/* 1 second */
 #define HCI_ACL_TX_TIMEOUT	msecs_to_jiffies(45000)	/* 45 seconds */
+#define HCI_AUTO_OFF_TIMEOUT	msecs_to_jiffies(2000)	/* 2 seconds */
 
 /* HCI data types */
 #define HCI_COMMAND_PKT		0x01
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index a4375d1..d36de9c 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -33,8 +33,6 @@
 #include <net/bluetooth/bluetooth.h>
 #include <net/bluetooth/hci_core.h>
 
-#define AUTO_OFF_TIMEOUT 2000
-
 static void hci_rx_work(struct work_struct *work);
 static void hci_cmd_work(struct work_struct *work);
 static void hci_tx_work(struct work_struct *work);
@@ -1085,8 +1083,7 @@ static void hci_power_on(struct work_struct *work)
 		return;
 
 	if (test_bit(HCI_AUTO_OFF, &hdev->dev_flags))
-		schedule_delayed_work(&hdev->power_off,
-				      msecs_to_jiffies(AUTO_OFF_TIMEOUT));
+		schedule_delayed_work(&hdev->power_off, HCI_AUTO_OFF_TIMEOUT);
 
 	if (test_and_clear_bit(HCI_SETUP, &hdev->dev_flags))
 		mgmt_index_added(hdev);
-- 
1.7.9.5


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

* Re: [PATCH] Bluetooth: Use AUTO_OFF constant in jiffies
  2012-06-14  7:45 [PATCH] Bluetooth: Use AUTO_OFF constant in jiffies Andrei Emeltchenko
@ 2012-06-14 12:07 ` Anderson Lizardo
  2012-06-14 14:22   ` Andrei Emeltchenko
  2012-06-15  7:36   ` [PATCHv2] " Andrei Emeltchenko
  0 siblings, 2 replies; 5+ messages in thread
From: Anderson Lizardo @ 2012-06-14 12:07 UTC (permalink / raw)
  To: Andrei Emeltchenko; +Cc: linux-bluetooth

Hi Andrei,

On Thu, Jun 14, 2012 at 3:45 AM, Andrei Emeltchenko
<Andrei.Emeltchenko.news@gmail.com> wrote:
> From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
>
> Move AUTO_OFF_TIMEOUT to other constants changing name to
> HCI_AUTO_OFF_TIMEOUT and convert to jiffies.
>
> Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
> ---
>  include/net/bluetooth/hci.h |    3 ++-
>  net/bluetooth/hci_core.c    |    5 +----
>  2 files changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
> index 3d1ad2c..a7b334e 100644
> --- a/include/net/bluetooth/hci.h
> +++ b/include/net/bluetooth/hci.h
> @@ -153,8 +153,9 @@ enum {
>  #define HCI_DISCONN_TIMEOUT    msecs_to_jiffies(4000)  /* 2 seconds */

There is a typo in the comment above. It should be "4 seconds". Maybe
you can fix it in a separate patch together with the "seconds" ->
"second" fix you did below?

>  #define HCI_PAIRING_TIMEOUT    msecs_to_jiffies(60000) /* 60 seconds */
>  #define HCI_INIT_TIMEOUT       msecs_to_jiffies(10000) /* 10 seconds */
> -#define HCI_CMD_TIMEOUT                msecs_to_jiffies(1000)  /* 1 seconds */
> +#define HCI_CMD_TIMEOUT                msecs_to_jiffies(1000)  /* 1 second */
>  #define HCI_ACL_TX_TIMEOUT     msecs_to_jiffies(45000) /* 45 seconds */
> +#define HCI_AUTO_OFF_TIMEOUT   msecs_to_jiffies(2000)  /* 2 seconds */
>
>  /* HCI data types */
>  #define HCI_COMMAND_PKT                0x01

Regards,
-- 
Anderson Lizardo
Instituto Nokia de Tecnologia - INdT
Manaus - Brazil

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

* Re: [PATCH] Bluetooth: Use AUTO_OFF constant in jiffies
  2012-06-14 12:07 ` Anderson Lizardo
@ 2012-06-14 14:22   ` Andrei Emeltchenko
  2012-06-15  7:36   ` [PATCHv2] " Andrei Emeltchenko
  1 sibling, 0 replies; 5+ messages in thread
From: Andrei Emeltchenko @ 2012-06-14 14:22 UTC (permalink / raw)
  To: Anderson Lizardo; +Cc: linux-bluetooth

Hi Anderson,

On Thu, Jun 14, 2012 at 08:07:40AM -0400, Anderson Lizardo wrote:
> > Move AUTO_OFF_TIMEOUT to other constants changing name to
> > HCI_AUTO_OFF_TIMEOUT and convert to jiffies.
> >
> > Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
> > ---
> >  include/net/bluetooth/hci.h |    3 ++-
> >  net/bluetooth/hci_core.c    |    5 +----
> >  2 files changed, 3 insertions(+), 5 deletions(-)
> >
> > diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
> > index 3d1ad2c..a7b334e 100644
> > --- a/include/net/bluetooth/hci.h
> > +++ b/include/net/bluetooth/hci.h
> > @@ -153,8 +153,9 @@ enum {
> >  #define HCI_DISCONN_TIMEOUT    msecs_to_jiffies(4000)  /* 2 seconds */
> 
> There is a typo in the comment above. It should be "4 seconds". Maybe
> you can fix it in a separate patch together with the "seconds" ->
> "second" fix you did below?

Sorry, the patch applied against my tree where I use this hack for
"slow" device. I will rebase the patch against bluetooth-next.

Best regards 
Andrei Emeltchenko 


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

* [PATCHv2] Bluetooth: Use AUTO_OFF constant in jiffies
  2012-06-14 12:07 ` Anderson Lizardo
  2012-06-14 14:22   ` Andrei Emeltchenko
@ 2012-06-15  7:36   ` Andrei Emeltchenko
  2012-06-19  3:11     ` Gustavo Padovan
  1 sibling, 1 reply; 5+ messages in thread
From: Andrei Emeltchenko @ 2012-06-15  7:36 UTC (permalink / raw)
  To: linux-bluetooth

From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

Move AUTO_OFF_TIMEOUT to other constants changing name to
HCI_AUTO_OFF_TIMEOUT and convert to jiffies.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
---
 include/net/bluetooth/hci.h |    3 ++-
 net/bluetooth/hci_core.c    |    5 +----
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
index 7dcd349..ccd723e 100644
--- a/include/net/bluetooth/hci.h
+++ b/include/net/bluetooth/hci.h
@@ -142,8 +142,9 @@ enum {
 #define HCI_DISCONN_TIMEOUT	msecs_to_jiffies(2000)	/* 2 seconds */
 #define HCI_PAIRING_TIMEOUT	msecs_to_jiffies(60000)	/* 60 seconds */
 #define HCI_INIT_TIMEOUT	msecs_to_jiffies(10000)	/* 10 seconds */
-#define HCI_CMD_TIMEOUT		msecs_to_jiffies(1000)	/* 1 seconds */
+#define HCI_CMD_TIMEOUT		msecs_to_jiffies(1000)	/* 1 second */
 #define HCI_ACL_TX_TIMEOUT	msecs_to_jiffies(45000)	/* 45 seconds */
+#define HCI_AUTO_OFF_TIMEOUT	msecs_to_jiffies(2000)	/* 2 seconds */
 
 /* HCI data types */
 #define HCI_COMMAND_PKT		0x01
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 5979452..8b93491 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -33,8 +33,6 @@
 #include <net/bluetooth/bluetooth.h>
 #include <net/bluetooth/hci_core.h>
 
-#define AUTO_OFF_TIMEOUT 2000
-
 static void hci_rx_work(struct work_struct *work);
 static void hci_cmd_work(struct work_struct *work);
 static void hci_tx_work(struct work_struct *work);
@@ -1083,8 +1081,7 @@ static void hci_power_on(struct work_struct *work)
 		return;
 
 	if (test_bit(HCI_AUTO_OFF, &hdev->dev_flags))
-		schedule_delayed_work(&hdev->power_off,
-				      msecs_to_jiffies(AUTO_OFF_TIMEOUT));
+		schedule_delayed_work(&hdev->power_off, HCI_AUTO_OFF_TIMEOUT);
 
 	if (test_and_clear_bit(HCI_SETUP, &hdev->dev_flags))
 		mgmt_index_added(hdev);
-- 
1.7.9.5


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

* Re: [PATCHv2] Bluetooth: Use AUTO_OFF constant in jiffies
  2012-06-15  7:36   ` [PATCHv2] " Andrei Emeltchenko
@ 2012-06-19  3:11     ` Gustavo Padovan
  0 siblings, 0 replies; 5+ messages in thread
From: Gustavo Padovan @ 2012-06-19  3:11 UTC (permalink / raw)
  To: Andrei Emeltchenko; +Cc: linux-bluetooth

Hi Andrei,

* Andrei Emeltchenko <Andrei.Emeltchenko.news@gmail.com> [2012-06-15 10:36:42 +0300]:

> From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
> 
> Move AUTO_OFF_TIMEOUT to other constants changing name to
> HCI_AUTO_OFF_TIMEOUT and convert to jiffies.
> 
> Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
> ---
>  include/net/bluetooth/hci.h |    3 ++-
>  net/bluetooth/hci_core.c    |    5 +----
>  2 files changed, 3 insertions(+), 5 deletions(-)

Patch has been applied to bluetooth-next. Thanks.

	Gustavo

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

end of thread, other threads:[~2012-06-19  3:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-14  7:45 [PATCH] Bluetooth: Use AUTO_OFF constant in jiffies Andrei Emeltchenko
2012-06-14 12:07 ` Anderson Lizardo
2012-06-14 14:22   ` Andrei Emeltchenko
2012-06-15  7:36   ` [PATCHv2] " Andrei Emeltchenko
2012-06-19  3:11     ` 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).