aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2011-11-02 09:52:02 -0400
committerGustavo F. Padovan <padovan@profusion.mobi>2011-11-07 14:24:56 -0500
commitec1cce24d5950e797f10650abf7890ead67c6e64 (patch)
tree832a18b8eaff406cc0f10669ac6b4c8f0b9008f6 /net/bluetooth
parent73d80deb7bdf0171f22e76dc2429c1f99eff90e2 (diff)
Bluetooth: handle priority change within quote
The quote is calculated based on the first buffer in the queue so if the priority changes to something lower than the priority of the first skb the quote needs to be recalculated. Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com> Acked-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Diffstat (limited to 'net/bluetooth')
-rw-r--r--net/bluetooth/hci_core.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 631327dc7fed..19e44533fb01 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -2193,10 +2193,17 @@ static inline void hci_sched_acl(struct hci_dev *hdev)
2193 2193
2194 while (hdev->acl_cnt && 2194 while (hdev->acl_cnt &&
2195 (chan = hci_chan_sent(hdev, ACL_LINK, &quote))) { 2195 (chan = hci_chan_sent(hdev, ACL_LINK, &quote))) {
2196 while (quote-- && (skb = skb_dequeue(&chan->data_q))) { 2196 u32 priority = (skb_peek(&chan->data_q))->priority;
2197 while (quote-- && (skb = skb_peek(&chan->data_q))) {
2197 BT_DBG("chan %p skb %p len %d priority %u", chan, skb, 2198 BT_DBG("chan %p skb %p len %d priority %u", chan, skb,
2198 skb->len, skb->priority); 2199 skb->len, skb->priority);
2199 2200
2201 /* Stop if priority has changed */
2202 if (skb->priority < priority)
2203 break;
2204
2205 skb = skb_dequeue(&chan->data_q);
2206
2200 hci_conn_enter_active_mode(chan->conn, 2207 hci_conn_enter_active_mode(chan->conn,
2201 bt_cb(skb)->force_active); 2208 bt_cb(skb)->force_active);
2202 2209
@@ -2278,10 +2285,17 @@ static inline void hci_sched_le(struct hci_dev *hdev)
2278 2285
2279 cnt = hdev->le_pkts ? hdev->le_cnt : hdev->acl_cnt; 2286 cnt = hdev->le_pkts ? hdev->le_cnt : hdev->acl_cnt;
2280 while (cnt && (chan = hci_chan_sent(hdev, LE_LINK, &quote))) { 2287 while (cnt && (chan = hci_chan_sent(hdev, LE_LINK, &quote))) {
2281 while (quote-- && (skb = skb_dequeue(&chan->data_q))) { 2288 u32 priority = (skb_peek(&chan->data_q))->priority;
2289 while (quote-- && (skb = skb_peek(&chan->data_q))) {
2282 BT_DBG("chan %p skb %p len %d priority %u", chan, skb, 2290 BT_DBG("chan %p skb %p len %d priority %u", chan, skb,
2283 skb->len, skb->priority); 2291 skb->len, skb->priority);
2284 2292
2293 /* Stop if priority has changed */
2294 if (skb->priority < priority)
2295 break;
2296
2297 skb = skb_dequeue(&chan->data_q);
2298
2285 hci_send_frame(skb); 2299 hci_send_frame(skb);
2286 hdev->le_last_tx = jiffies; 2300 hdev->le_last_tx = jiffies;
2287 2301