Commit 679344e4 authored by Gustavo F. Padovan's avatar Gustavo F. Padovan

Bluetooth: Trasmit interrupt channel messages first

interrupt channel is low latency.
Signed-off-by: default avatarGustavo F. Padovan <padovan@profusion.mobi>
parent dc0da5cd
...@@ -663,25 +663,32 @@ static int hidp_send_frame(struct socket *sock, unsigned char *data, int len) ...@@ -663,25 +663,32 @@ static int hidp_send_frame(struct socket *sock, unsigned char *data, int len)
return kernel_sendmsg(sock, &msg, &iv, 1, len); return kernel_sendmsg(sock, &msg, &iv, 1, len);
} }
static void hidp_process_transmit(struct hidp_session *session) static void hidp_process_intr_transmit(struct hidp_session *session)
{ {
struct sk_buff *skb; struct sk_buff *skb;
BT_DBG("session %p", session); BT_DBG("session %p", session);
while ((skb = skb_dequeue(&session->ctrl_transmit))) { while ((skb = skb_dequeue(&session->intr_transmit))) {
if (hidp_send_frame(session->ctrl_sock, skb->data, skb->len) < 0) { if (hidp_send_frame(session->intr_sock, skb->data, skb->len) < 0) {
skb_queue_head(&session->ctrl_transmit, skb); skb_queue_head(&session->intr_transmit, skb);
break; break;
} }
hidp_set_timer(session); hidp_set_timer(session);
kfree_skb(skb); kfree_skb(skb);
} }
}
while ((skb = skb_dequeue(&session->intr_transmit))) { static void hidp_process_ctrl_transmit(struct hidp_session *session)
if (hidp_send_frame(session->intr_sock, skb->data, skb->len) < 0) { {
skb_queue_head(&session->intr_transmit, skb); struct sk_buff *skb;
BT_DBG("session %p", session);
while ((skb = skb_dequeue(&session->ctrl_transmit))) {
if (hidp_send_frame(session->ctrl_sock, skb->data, skb->len) < 0) {
skb_queue_head(&session->ctrl_transmit, skb);
break; break;
} }
...@@ -722,6 +729,8 @@ static int hidp_session(void *arg) ...@@ -722,6 +729,8 @@ static int hidp_session(void *arg)
kfree_skb(skb); kfree_skb(skb);
} }
hidp_process_intr_transmit(session);
while ((skb = skb_dequeue(&ctrl_sk->sk_receive_queue))) { while ((skb = skb_dequeue(&ctrl_sk->sk_receive_queue))) {
skb_orphan(skb); skb_orphan(skb);
if (!skb_linearize(skb)) if (!skb_linearize(skb))
...@@ -730,7 +739,7 @@ static int hidp_session(void *arg) ...@@ -730,7 +739,7 @@ static int hidp_session(void *arg)
kfree_skb(skb); kfree_skb(skb);
} }
hidp_process_transmit(session); hidp_process_ctrl_transmit(session);
schedule(); schedule();
set_current_state(TASK_INTERRUPTIBLE); set_current_state(TASK_INTERRUPTIBLE);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment