[PATCH 2/6] audio/avdtp: Fix not calling callback if GET_CAPABILITIES is rejected

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

 



If GET_CAPABILITIES command is rejected and a callback exists it should
be called with the reject error, this fixes test /TP/SIG/SMG/BI-04-C.

This patch is made based on cb5058cf26e4ad6fd857fd480675cd6fcd4b7985.
---
 profiles/audio/avdtp.c | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/profiles/audio/avdtp.c b/profiles/audio/avdtp.c
index 14f9a61..57f2d16 100644
--- a/profiles/audio/avdtp.c
+++ b/profiles/audio/avdtp.c
@@ -2915,10 +2915,15 @@ static gboolean avdtp_parse_rej(struct avdtp *session,
 
 	switch (signal_id) {
 	case AVDTP_DISCOVER:
+	case AVDTP_GET_CAPABILITIES:
+	case AVDTP_GET_ALL_CAPABILITIES:
 		if (!seid_rej_to_err(buf, size, &err))
 			return FALSE;
-		error("DISCOVER request rejected: %s (%d)",
-				avdtp_strerror(&err), err.err.error_code);
+		error("%s request rejected: %s (%d)",
+			signal_id == AVDTP_DISCOVER ? "DISCOVER" :
+			signal_id == AVDTP_GET_CAPABILITIES ?
+			"GET_CAPABILITIES" : "GET_ALL_CAPABILITIES",
+			avdtp_strerror(&err), err.err.error_code);
 		if (session->discover) {
 			session->discover->cb(session, session->seps, &err,
 						session->discover->user_data);
@@ -2926,13 +2931,6 @@ static gboolean avdtp_parse_rej(struct avdtp *session,
 			session->discover = NULL;
 		}
 		return TRUE;
-	case AVDTP_GET_CAPABILITIES:
-	case AVDTP_GET_ALL_CAPABILITIES:
-		if (!seid_rej_to_err(buf, size, &err))
-			return FALSE;
-		error("GET_CAPABILITIES request rejected: %s (%d)",
-				avdtp_strerror(&err), err.err.error_code);
-		return TRUE;
 	case AVDTP_OPEN:
 		if (!seid_rej_to_err(buf, size, &err))
 			return FALSE;
-- 
2.1.4

--
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