From 72af848736d5b7acb8bad56be08aa9d5c7010b12 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Wed, 2 Nov 2011 15:52:02 +0200 Subject: [PATCH] --- yaml --- r: 277723 b: refs/heads/master c: ec1cce24d5950e797f10650abf7890ead67c6e64 h: refs/heads/master i: 277721: d396c5d7151e4458125c96b2fc056df16ab1063d 277719: 5ff281cffc31fe401fcc3b6ccb86f7a901b5f5b9 v: v3 --- [refs] | 2 +- trunk/net/bluetooth/hci_core.c | 18 ++++++++++++++++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index 9512e9644b63..207dc6fd2ee2 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 73d80deb7bdf0171f22e76dc2429c1f99eff90e2 +refs/heads/master: ec1cce24d5950e797f10650abf7890ead67c6e64 diff --git a/trunk/net/bluetooth/hci_core.c b/trunk/net/bluetooth/hci_core.c index 631327dc7fed..19e44533fb01 100644 --- a/trunk/net/bluetooth/hci_core.c +++ b/trunk/net/bluetooth/hci_core.c @@ -2193,10 +2193,17 @@ static inline void hci_sched_acl(struct hci_dev *hdev) while (hdev->acl_cnt && (chan = hci_chan_sent(hdev, ACL_LINK, "e))) { - while (quote-- && (skb = skb_dequeue(&chan->data_q))) { + u32 priority = (skb_peek(&chan->data_q))->priority; + while (quote-- && (skb = skb_peek(&chan->data_q))) { BT_DBG("chan %p skb %p len %d priority %u", chan, skb, skb->len, skb->priority); + /* Stop if priority has changed */ + if (skb->priority < priority) + break; + + skb = skb_dequeue(&chan->data_q); + hci_conn_enter_active_mode(chan->conn, bt_cb(skb)->force_active); @@ -2278,10 +2285,17 @@ static inline void hci_sched_le(struct hci_dev *hdev) cnt = hdev->le_pkts ? hdev->le_cnt : hdev->acl_cnt; while (cnt && (chan = hci_chan_sent(hdev, LE_LINK, "e))) { - while (quote-- && (skb = skb_dequeue(&chan->data_q))) { + u32 priority = (skb_peek(&chan->data_q))->priority; + while (quote-- && (skb = skb_peek(&chan->data_q))) { BT_DBG("chan %p skb %p len %d priority %u", chan, skb, skb->len, skb->priority); + /* Stop if priority has changed */ + if (skb->priority < priority) + break; + + skb = skb_dequeue(&chan->data_q); + hci_send_frame(skb); hdev->le_last_tx = jiffies;