Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3910395pxb; Tue, 17 Nov 2020 06:46:29 -0800 (PST) X-Google-Smtp-Source: ABdhPJyrenKApFeQwqB5Ukn7L3XGrvjZQ7FKa6fsgHDOPwXlfAnV6gsUX9T7MG/E5+ruEW8VMHfB X-Received: by 2002:a05:6402:783:: with SMTP id d3mr21422235edy.168.1605624389464; Tue, 17 Nov 2020 06:46:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605624389; cv=none; d=google.com; s=arc-20160816; b=l2/QyZgJZtcdAIsChdspLIg1XLnxdhTuDTU5H6IQvk4yjDh4ZJtw/7HTQEP6zkYzA9 4FlcSNmatq2TDNMXKpDLat4gofb2R74kt7ArglLJ25SEU5fs7ODEhm9fOJgQml5pwP6r 7RjXs2N1+wkY0bJXpDG+zUOjNY+S/5cMvH3eAXYM/2Y3eFMbiJg6PMzO2fs/I6wODcza UI/SQZoMxgMp0tthBNOxJ4HR7YY1F8plfmTPQTCBJHG+zD6d+FATeGb1HlvsphAE2aXU vKfjLvHBAzzvhlsvVilyA+PpngGKGmWYB7KBdp4SxLKLeJd+qXLzG/Q4bnTLQX3QdhF3 4CpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=YnfKtOiK+KgpTfLdPKDWsiCOL6CsXplNGQmgn9n13po=; b=VfzuNwubkrZgRJlUSPNljdvx1Cy44ylMaNuVb3AEFvV/0FD28wiR2HcUj2mrRnRE1/ uku9JF1Ci7C7ncmS8Gv1jEUfImRdjlHypCX7ciLTAJaotVHGc+/ESi7laCO44cKYA2xs dqz3QbI7PumCKBoJ0m3S2w+iG9fZfmfd81LKnV82ebud0+IeHxrQecKRvf9fED4FwUA7 eB8txHlKnW0clK9q88jJp3IbZvmm9G5+WQ/ji4ipUnJTxQBAIfbx4CG3J/pXZ+gX03el S8NP6KSsRxg+Nski0RAA0R+G3K1dj4QvcD5r7qLyUDWDtqoMcTsr8XaRJheSfETpS5LM uIKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=dt9EhiVS; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f19si14898515edr.593.2020.11.17.06.46.00; Tue, 17 Nov 2020 06:46:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=dt9EhiVS; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728807AbgKQOol (ORCPT + 99 others); Tue, 17 Nov 2020 09:44:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44090 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728285AbgKQOok (ORCPT ); Tue, 17 Nov 2020 09:44:40 -0500 Received: from mail-lf1-x142.google.com (mail-lf1-x142.google.com [IPv6:2a00:1450:4864:20::142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 94E80C0613CF for ; Tue, 17 Nov 2020 06:44:38 -0800 (PST) Received: by mail-lf1-x142.google.com with SMTP id u18so30395944lfd.9 for ; Tue, 17 Nov 2020 06:44:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=YnfKtOiK+KgpTfLdPKDWsiCOL6CsXplNGQmgn9n13po=; b=dt9EhiVSHodNpUk+TnsNJciE1ph6q2TIfIm2tniyv9QidFZvp2Zz893EjPlEg+Dfgt 7y/P27TaWUMZsq/HiWF3X5qm4ON0TTGhMcIaXdsVzklHRRY3s5hbJlRlSo0P852X6HEt RkF7Qljz6u2vvVsh5kslJ3VOUKqd/ASnN3YeakczRopYgxhs/oHSBfp8V7xiLtzZn3yg /ptswecIJXSAnasyLnt2KdMTwb//nR/YVhAAnqfm2Zy0ZxAi5xtQGwaW10OuC3HhiibO bOafHRSQ0vmGes1wyCNZysfGhHylAS8ytqz+QEvkywyhI4yosEfY+mIP6pTFmTxUE9KZ ZJ1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=YnfKtOiK+KgpTfLdPKDWsiCOL6CsXplNGQmgn9n13po=; b=ndoMEaFEhtaSTxspycITUbvoA3b1r6a6voI9lwVGwmu4DcFK8X+z9Qabluyp4ge+bL vgdYtzdY71CF49f8QqrjS/TmvFyYCfh1BvZ/egkd5/O3gTDirrBxWFK93V6yFeOg4Ed1 3hDGQxfvM9vNE1/taipERaIBoSyfMnRedrThhBssA5NM3XlpAR9bgYdpcpyXQKPZSdTB sjdyDE/+f3gdNGyAf7IEYsv0xkHAbrmrwFHgMLb2QH818TS/BFoxJHjPTqrEKXUayyuz SAA5vRif0k4xQ1+iUJNSIovx4kc44m5IXAFm1MNnJMa5z3gQIwVgrDibmm3l+VSoHcwS OVkg== X-Gm-Message-State: AOAM5329onPALfLHFoHs4UFK9CNTj6LmttdTCAtoYEhYsICjeraOiWrd ggZMYer6qEJqCp9d2eKAo/BZZujEL3O6U9jnYVNZnQ== X-Received: by 2002:ac2:5083:: with SMTP id f3mr1876412lfm.45.1605624276780; Tue, 17 Nov 2020 06:44:36 -0800 (PST) MIME-Version: 1.0 References: <20201116233910.4128702-1-luiz.dentz@gmail.com> In-Reply-To: <20201116233910.4128702-1-luiz.dentz@gmail.com> From: Alain Michaud Date: Tue, 17 Nov 2020 09:44:24 -0500 Message-ID: Subject: Re: [RFC BlueZ 1/2] avdtp: Fix connecting using streaming mode with signalling channel To: Luiz Augusto von Dentz Cc: BlueZ Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org On Mon, Nov 16, 2020 at 7:22 PM Luiz Augusto von Dentz wrote: > > From: Luiz Augusto von Dentz > > Signalling channel shall only use Basic or ERTM modes. Reviewed-by: Alain Michaud Tested-by: Alain Michaud > --- > profiles/audio/avdtp.c | 26 ++++++++++++++++---------- > 1 file changed, 16 insertions(+), 10 deletions(-) > > diff --git a/profiles/audio/avdtp.c b/profiles/audio/avdtp.c > index 16fa20bba..619b94e29 100644 > --- a/profiles/audio/avdtp.c > +++ b/profiles/audio/avdtp.c > @@ -2429,20 +2429,13 @@ uint16_t avdtp_get_version(struct avdtp *session) > return session->version; > } > > -static GIOChannel *l2cap_connect(struct avdtp *session) > +static GIOChannel *l2cap_connect(struct avdtp *session, BtIOMode mode) > { > GError *err = NULL; > GIOChannel *io; > const bdaddr_t *src; > - BtIOMode mode; > - > src = btd_adapter_get_address(device_get_adapter(session->device)); > > - if (btd_opts.mps == MPS_OFF) > - mode = BT_IO_MODE_BASIC; > - else > - mode = BT_IO_MODE_STREAMING; > - > if (session->phy) > io = bt_io_connect(avdtp_connect_cb, session, > NULL, &err, > @@ -2610,7 +2603,14 @@ static int send_req(struct avdtp *session, gboolean priority, > int err, timeout; > > if (session->state == AVDTP_SESSION_STATE_DISCONNECTED) { > - session->io = l2cap_connect(session); > + BtIOMode mode; > + > + if (btd_opts.mps == MPS_OFF) > + mode = BT_IO_MODE_BASIC; > + else > + mode = BT_IO_MODE_ERTM; > + > + session->io = l2cap_connect(session, mode); > if (!session->io) { > /* Report disconnection anyways, as the other layers > * are using this state for cleanup. > @@ -2807,8 +2807,14 @@ static gboolean avdtp_open_resp(struct avdtp *session, struct avdtp_stream *stre > struct seid_rej *resp, int size) > { > struct avdtp_local_sep *sep = stream->lsep; > + BtIOMode mode; > + > + if (btd_opts.mps == MPS_OFF) > + mode = BT_IO_MODE_BASIC; > + else > + mode = BT_IO_MODE_STREAMING; > > - stream->io = l2cap_connect(session); > + stream->io = l2cap_connect(session, mode); > if (!stream->io) { > avdtp_sep_set_state(session, sep, AVDTP_STATE_IDLE); > return FALSE; > -- > 2.26.2 >