From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH BlueZ 1/4] android/AVDTP: Make signalling channel priority 6
Date: Mon, 27 Jan 2014 15:41:47 -0800 [thread overview]
Message-ID: <1390866110-16184-1-git-send-email-luiz.dentz@gmail.com> (raw)
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This makes signalling priority 6 so it can push commands before the
stream channel, without this the stream channel may be schedule
first and cause the signalling commands to timeout while waiting a slot.
---
android/avdtp.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/android/avdtp.c b/android/avdtp.c
index 4abcd75..4cfffc8 100644
--- a/android/avdtp.c
+++ b/android/avdtp.c
@@ -2057,6 +2057,7 @@ struct avdtp *avdtp_new(int fd, size_t imtu, size_t omtu, uint16_t version)
struct avdtp *session;
GIOCondition cond = G_IO_IN | G_IO_ERR | G_IO_HUP | G_IO_NVAL;
int new_fd;
+ int priority;
new_fd = dup(fd);
if (new_fd < 0) {
@@ -2064,6 +2065,14 @@ struct avdtp *avdtp_new(int fd, size_t imtu, size_t omtu, uint16_t version)
return NULL;
}
+ priority = 6;
+ if (setsockopt(new_fd, SOL_SOCKET, SO_PRIORITY,
+ (const void *) &priority, sizeof(priority)) < 0) {
+ error("setsockopt(SO_PRIORITY): %s (%d)", strerror(errno),
+ errno);
+ return NULL;
+ }
+
session = g_new0(struct avdtp, 1);
session->io = g_io_channel_unix_new(new_fd);
session->version = version;
--
1.8.4.2
next reply other threads:[~2014-01-27 23:41 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-27 23:41 Luiz Augusto von Dentz [this message]
2014-01-27 23:41 ` [PATCH BlueZ 2/4] android/AVDTP: Make stream channel priority 5 Luiz Augusto von Dentz
2014-01-27 23:41 ` [PATCH BlueZ 3/4] android/hal-audio: Fix not handling EINTR errors Luiz Augusto von Dentz
2014-01-27 23:41 ` [PATCH BlueZ 4/4] android/hal-audio: Set stream fd to blocking Luiz Augusto von Dentz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1390866110-16184-1-git-send-email-luiz.dentz@gmail.com \
--to=luiz.dentz@gmail.com \
--cc=linux-bluetooth@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox