mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH][FIX] Bluetooth: always send explicit hci_ll wake-up acks
@ 2008-01-07 16:22 Ohad Ben-Cohen
  2008-01-11  6:24 ` David Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Ohad Ben-Cohen @ 2008-01-07 16:22 UTC (permalink / raw)
  To: marcel, linux-kernel; +Cc: bluez-devel

In the (rare) event of simultaneous mutual wake up requests,
do send the chip an explicit wake-up ack. This is required
for Texas Instruments's BRF6350 chip.

Signed-off-by: Ohad Ben-Cohen <ohad@bencohen.org>

---

 drivers/bluetooth/hci_ll.c |   23 ++++++++++++++---------
 1 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/drivers/bluetooth/hci_ll.c b/drivers/bluetooth/hci_ll.c
index 8c3e62a..b91d45a 100644
--- a/drivers/bluetooth/hci_ll.c
+++ b/drivers/bluetooth/hci_ll.c
@@ -204,6 +204,19 @@ static void ll_device_want_to_wakeup(struct hci_uart *hu)
 	spin_lock_irqsave(&ll->hcill_lock, flags);
 
 	switch (ll->hcill_state) {
+	case HCILL_ASLEEP_TO_AWAKE:
+		/*
+		 * This state means that both the host and the BRF chip
+		 * have simultaneously sent a wake-up-indication packet.
+		 * Traditionaly, in this case, receiving a wake-up-indication
+		 * was enough and an additional wake-up-ack wasn't needed.
+		 * This has changed with the BRF6350, which does require an
+		 * explicit wake-up-ack. Other BRF versions, which do not
+		 * require an explicit ack here, do accept it, thus it is
+		 * perfectly safe to always send one.
+		 */
+		BT_DBG("dual wake-up-indication");
+		/* deliberate fall-through - do not add break */
 	case HCILL_ASLEEP:
 		/* acknowledge device wake up */
 		if (send_hcill_cmd(HCILL_WAKE_UP_ACK, hu) < 0) {
@@ -211,16 +224,8 @@ static void ll_device_want_to_wakeup(struct hci_uart *hu)
 			goto out;
 		}
 		break;
-	case HCILL_ASLEEP_TO_AWAKE:
-		/*
-		 * this state means that a wake-up-indication
-		 * is already on its way to the device,
-		 * and will serve as the required wake-up-ack
-		 */
-		BT_DBG("dual wake-up-indication");
-		break;
 	default:
-		/* any other state are illegal */
+		/* any other state is illegal */
 		BT_ERR("received HCILL_WAKE_UP_IND in state %ld", ll->hcill_state);
 		break;
 	}
-- 
1.4.4.2




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

* Re: [PATCH][FIX] Bluetooth: always send explicit hci_ll wake-up acks
  2008-01-07 16:22 [PATCH][FIX] Bluetooth: always send explicit hci_ll wake-up acks Ohad Ben-Cohen
@ 2008-01-11  6:24 ` David Miller
  2008-01-11  7:58   ` Ohad Ben-Cohen
  0 siblings, 1 reply; 3+ messages in thread
From: David Miller @ 2008-01-11  6:24 UTC (permalink / raw)
  To: ohad; +Cc: marcel, linux-kernel, bluez-devel

From: Ohad Ben-Cohen <ohad@bencohen.org>
Date: Mon, 7 Jan 2008 18:22:48 +0200 (IST)

> In the (rare) event of simultaneous mutual wake up requests,
> do send the chip an explicit wake-up ack. This is required
> for Texas Instruments's BRF6350 chip.
> 
> Signed-off-by: Ohad Ben-Cohen <ohad@bencohen.org>

Applied, thanks.

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

* Re: [PATCH][FIX] Bluetooth: always send explicit hci_ll wake-up acks
  2008-01-11  6:24 ` David Miller
@ 2008-01-11  7:58   ` Ohad Ben-Cohen
  0 siblings, 0 replies; 3+ messages in thread
From: Ohad Ben-Cohen @ 2008-01-11  7:58 UTC (permalink / raw)
  To: David Miller; +Cc: marcel, linux-kernel, bluez-devel

n 1/11/08, David Miller <davem@davemloft.net> wrote:
> From: Ohad Ben-Cohen <ohad@bencohen.org>
> Date: Mon, 7 Jan 2008 18:22:48 +0200 (IST)
>
> > In the (rare) event of simultaneous mutual wake up requests,
> > do send the chip an explicit wake-up ack. This is required
> > for Texas Instruments's BRF6350 chip.
> >
> > Signed-off-by: Ohad Ben-Cohen <ohad@bencohen.org>
>
> Applied, thanks.

Thanks.

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

end of thread, other threads:[~2008-01-11  7:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-01-07 16:22 [PATCH][FIX] Bluetooth: always send explicit hci_ll wake-up acks Ohad Ben-Cohen
2008-01-11  6:24 ` David Miller
2008-01-11  7:58   ` Ohad Ben-Cohen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome