[PATCH BlueZ] AVCTP: Fix scope of transactions to be per channel

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Luiz Augusto von Dentz <luiz.von.dentz@xxxxxxxxx>

As per AVRCP spec:

  "It should be noted that transaction labels are scoped to an AVCTP
  channel, so an AVRCP specific AV/C command and an AVRCP specific
  browsing command may be outstanding at the same time with the same
  transaction label."
---
 audio/avctp.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/audio/avctp.c b/audio/avctp.c
index 5f6a677..6ba25e4 100644
--- a/audio/avctp.c
+++ b/audio/avctp.c
@@ -150,6 +150,7 @@ struct avctp_pending_req {
 struct avctp_channel {
 	struct avctp *session;
 	GIOChannel *io;
+	uint8_t transaction;
 	guint watch;
 	uint16_t imtu;
 	uint16_t omtu;
@@ -1224,17 +1225,16 @@ static struct avctp_pending_req *pending_create(struct avctp_channel *chan,
 						GDestroyNotify destroy)
 {
 	struct avctp_pending_req *p;
-	static uint8_t transaction = 0;
 
 	p = g_new0(struct avctp_pending_req, 1);
 	p->chan = chan;
-	p->transaction = transaction;
+	p->transaction = chan->transaction;
 	p->process = process;
 	p->data = data;
 	p->destroy = destroy;
 
-	transaction++;
-	transaction %= 16;
+	chan->transaction++;
+	chan->transaction %= 16;
 
 	return p;
 }
-- 
1.7.11.7

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux