Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5b88abcf authored by Anantha Krishnan's avatar Anantha Krishnan Committed by Gerrit - the friendly Code Review server
Browse files

bluetooth : Configure the Tx idle timeout to 1sec



when there is no activity on the host tx for 1 sec
indicate the controller to enter into sleep.
1sec is the optimal value we need to satisfy the power
and performance requirements.

Change-Id: I9c2a2973a7fbb1a49460e06117c264aa4e0e44e4
Signed-off-by: default avatarAnantha Krishnan <ananthk@codeaurora.org>
parent f81d0b1f
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -58,6 +58,9 @@
#define HCI_IBS_WAKE_IND	0xFD
#define HCI_IBS_WAKE_ACK	0xFC

/* TX idle time out value */
#define TX_IDLE_TO		1000

/* HCI_IBS receiver States */
#define HCI_IBS_W4_PACKET_TYPE	0
#define HCI_IBS_W4_EVENT_HDR	1
@@ -265,7 +268,7 @@ static void ibs_wq_awake_device(struct work_struct *work)
	ibs->ibs_sent_wakes++; /* debug */

	/* start retransmit timer */
	mod_timer(&ibs->wake_retrans_timer, jiffies + wake_retrans);
	mod_timer(&ibs->wake_retrans_timer, jiffies + msecs_to_jiffies(10));

	spin_unlock_irqrestore(&ibs->hci_ibs_lock, flags);

@@ -651,7 +654,8 @@ static void ibs_device_woke_up(struct hci_uart *hu)
			skb_queue_tail(&ibs->txq, skb);
		/* switch timers and change state to HCI_IBS_TX_AWAKE */
		del_timer(&ibs->wake_retrans_timer);
		mod_timer(&ibs->tx_idle_timer, jiffies + tx_idle_delay);
		mod_timer(&ibs->tx_idle_timer, jiffies +
			msecs_to_jiffies(TX_IDLE_TO));
		ibs->tx_ibs_state = HCI_IBS_TX_AWAKE;
	}

@@ -681,7 +685,8 @@ static int ibs_enqueue(struct hci_uart *hu, struct sk_buff *skb)
	case HCI_IBS_TX_AWAKE:
		BT_DBG("device awake, sending normally");
		skb_queue_tail(&ibs->txq, skb);
		mod_timer(&ibs->tx_idle_timer, jiffies + tx_idle_delay);
		mod_timer(&ibs->tx_idle_timer, jiffies +
			msecs_to_jiffies(TX_IDLE_TO));
		break;

	case HCI_IBS_TX_ASLEEP: