Skip to contentSkip to conversation

Fix not being able to register pdu handlers

PATCH Applied Luiz Augusto von Dentz 2 participants 2 messages Oct 5, 2011 Bluetooth drivers

lore
Share & tools
lore

Luiz Augusto von Dentz

author maintainer
#0 lore raw

PATCH 1/1 Fix not being able to register pdu handlers

From: Luiz Augusto von Dentz <[email protected]>

This happens when removing and adding again an adapter

---
 audio/avctp.c |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)
audio/avctp.c +11 -4
index b8cb36e..89ef70c 100644
@@ -463,6 +463,7 @@ static gboolean session_cb(GIOChannel *chan, GIOCondition cond,
 
 	handler = find_handler(handlers, avc->opcode);
 	if (!handler) {
+		DBG("handler not found for 0x%02x", avc->opcode);
 		avc->code = AVC_CTYPE_REJECTED;
 		goto done;
 	}
@@ -824,14 +825,20 @@ void avctp_unregister(const bdaddr_t *src)
 	if (servers)
 		return;
 
-	if (passthrough_id)
+	if (passthrough_id) {
 		avctp_unregister_pdu_handler(passthrough_id);
+		passthrough_id = 0;
+	}
 
-	if (unit_id)
+	if (unit_id) {
 		avctp_unregister_pdu_handler(unit_id);
+		passthrough_id = 0;
+	}
 
-	if (subunit_id)
-		avctp_unregister_pdu_handler(unit_id);
+	if (subunit_id) {
+		avctp_unregister_pdu_handler(subunit_id);
+		subunit_id = 0;
+	}
 }
 
 int avctp_send_passthrough(struct avctp *session, uint8_t op)
Signature · 1 line
1.7.6.4
#1 lore raw

Hi Luiz,

Quoted 4 lines · Luiz Augusto von Dentz

This happens when removing and adding again an adapter

---
 audio/avctp.c |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)

Applied. Thanks.

Johan