diff options
author | Gustavo F. Padovan <padovan@profusion.mobi> | 2011-10-06 19:51:37 -0400 |
---|---|---|
committer | Gustavo F. Padovan <padovan@profusion.mobi> | 2011-10-06 22:15:04 -0400 |
commit | 679344e44e09c74848535a28948df7c3b3c1a071 (patch) | |
tree | 6641d10bf3db2adf038e27d320bea70bd40c10e7 /net/bluetooth/hidp | |
parent | dc0da5cdac44aea6a04b18acc5526931430e0c35 (diff) |
Bluetooth: Trasmit interrupt channel messages first
interrupt channel is low latency.
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Diffstat (limited to 'net/bluetooth/hidp')
-rw-r--r-- | net/bluetooth/hidp/core.c | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/net/bluetooth/hidp/core.c b/net/bluetooth/hidp/core.c index 2694a0a6186d..6cb1d9e8eac5 100644 --- a/net/bluetooth/hidp/core.c +++ b/net/bluetooth/hidp/core.c | |||
@@ -663,25 +663,32 @@ static int hidp_send_frame(struct socket *sock, unsigned char *data, int len) | |||
663 | return kernel_sendmsg(sock, &msg, &iv, 1, len); | 663 | return kernel_sendmsg(sock, &msg, &iv, 1, len); |
664 | } | 664 | } |
665 | 665 | ||
666 | static void hidp_process_transmit(struct hidp_session *session) | 666 | static void hidp_process_intr_transmit(struct hidp_session *session) |
667 | { | 667 | { |
668 | struct sk_buff *skb; | 668 | struct sk_buff *skb; |
669 | 669 | ||
670 | BT_DBG("session %p", session); | 670 | BT_DBG("session %p", session); |
671 | 671 | ||
672 | while ((skb = skb_dequeue(&session->ctrl_transmit))) { | 672 | while ((skb = skb_dequeue(&session->intr_transmit))) { |
673 | if (hidp_send_frame(session->ctrl_sock, skb->data, skb->len) < 0) { | 673 | if (hidp_send_frame(session->intr_sock, skb->data, skb->len) < 0) { |
674 | skb_queue_head(&session->ctrl_transmit, skb); | 674 | skb_queue_head(&session->intr_transmit, skb); |
675 | break; | 675 | break; |
676 | } | 676 | } |
677 | 677 | ||
678 | hidp_set_timer(session); | 678 | hidp_set_timer(session); |
679 | kfree_skb(skb); | 679 | kfree_skb(skb); |
680 | } | 680 | } |
681 | } | ||
681 | 682 | ||
682 | while ((skb = skb_dequeue(&session->intr_transmit))) { | 683 | static void hidp_process_ctrl_transmit(struct hidp_session *session) |
683 | if (hidp_send_frame(session->intr_sock, skb->data, skb->len) < 0) { | 684 | { |
684 | skb_queue_head(&session->intr_transmit, skb); | 685 | struct sk_buff *skb; |
686 | |||
687 | BT_DBG("session %p", session); | ||
688 | |||
689 | while ((skb = skb_dequeue(&session->ctrl_transmit))) { | ||
690 | if (hidp_send_frame(session->ctrl_sock, skb->data, skb->len) < 0) { | ||
691 | skb_queue_head(&session->ctrl_transmit, skb); | ||
685 | break; | 692 | break; |
686 | } | 693 | } |
687 | 694 | ||
@@ -722,6 +729,8 @@ static int hidp_session(void *arg) | |||
722 | kfree_skb(skb); | 729 | kfree_skb(skb); |
723 | } | 730 | } |
724 | 731 | ||
732 | hidp_process_intr_transmit(session); | ||
733 | |||
725 | while ((skb = skb_dequeue(&ctrl_sk->sk_receive_queue))) { | 734 | while ((skb = skb_dequeue(&ctrl_sk->sk_receive_queue))) { |
726 | skb_orphan(skb); | 735 | skb_orphan(skb); |
727 | if (!skb_linearize(skb)) | 736 | if (!skb_linearize(skb)) |
@@ -730,7 +739,7 @@ static int hidp_session(void *arg) | |||
730 | kfree_skb(skb); | 739 | kfree_skb(skb); |
731 | } | 740 | } |
732 | 741 | ||
733 | hidp_process_transmit(session); | 742 | hidp_process_ctrl_transmit(session); |
734 | 743 | ||
735 | schedule(); | 744 | schedule(); |
736 | set_current_state(TASK_INTERRUPTIBLE); | 745 | set_current_state(TASK_INTERRUPTIBLE); |