All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: Kiran K <kiran.k@intel.com>
Cc: "linux-bluetooth@vger.kernel.org"
	<linux-bluetooth@vger.kernel.org>,
	"Srivatsa, Ravishankar" <ravishankar.srivatsa@intel.com>,
	Chethan T N <chethan.tumkur.narayan@intel.com>,
	Luiz Augusto Von Dentz <luiz.von.dentz@intel.com>
Subject: Re: [PATCH v1 1/5] avdtp: Add a flag in struct avdtp to control a2dp offload
Date: Mon, 15 Nov 2021 11:42:23 -0800	[thread overview]
Message-ID: <CABBYNZ+rFbfe1joiLmJBGB_twX4_kNu3Nsr=TSs1SyfMvAes8Q@mail.gmail.com> (raw)
In-Reply-To: <20211115094108.24331-1-kiran.k@intel.com>

Hi Kiran,

On Mon, Nov 15, 2021 at 1:36 AM Kiran K <kiran.k@intel.com> wrote:
>
> Define a flag in struct avdtp and set it based on
> the definition of env variable USE_OFFLOAD
> ---
>  profiles/audio/avdtp.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
>
> diff --git a/profiles/audio/avdtp.c b/profiles/audio/avdtp.c
> index d3dfbf96dda3..b6feac0ba4d5 100644
> --- a/profiles/audio/avdtp.c
> +++ b/profiles/audio/avdtp.c
> @@ -409,6 +409,9 @@ struct avdtp {
>
>         /* Attempt stream setup instead of disconnecting */
>         gboolean stream_setup;
> +
> +       /* use offload for transport */
> +       gboolean use_offload;
>  };
>
>  static GSList *state_callbacks = NULL;
> @@ -2425,6 +2428,7 @@ struct avdtp *avdtp_new(GIOChannel *chan, struct btd_device *device,
>                                                         struct queue *lseps)
>  {
>         struct avdtp *session;
> +       char *use_offload;
>
>         session = g_new0(struct avdtp, 1);
>
> @@ -2436,6 +2440,10 @@ struct avdtp *avdtp_new(GIOChannel *chan, struct btd_device *device,
>
>         session->version = get_version(session);
>
> +       use_offload = getenv("USE_OFFLOAD");
> +       if (use_offload && !strncmp(use_offload, "1", 1))
> +               session->use_offload = TRUE;
> +

We already have a configuration for experimental flags:

https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/src/main.conf#n118

So you just have to check if experimental is enabled, or the offload
UUID, in adapter.c, also perhaps we should have something like
btd_adapter_experimental_is_enabled(adapter, uuid) so it would take
care of doing all the checking if that had been enabled in the kernel
or not.

>         if (!chan)
>                 return session;
>
> --
> 2.17.1
>


-- 
Luiz Augusto von Dentz

  parent reply	other threads:[~2021-11-15 20:58 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-15  9:41 [PATCH v1 1/5] avdtp: Add a flag in struct avdtp to control a2dp offload Kiran K
2021-11-15  9:41 ` [PATCH v1 2/5] avdtp: Add support for offload msft open command Kiran K
2021-11-15  9:41 ` [PATCH v1 3/5] avdtp: Add support for offload msft start command Kiran K
2021-11-15  9:41 ` [PATCH v1 4/5] avdtp: Add support for offload msft suspend command Kiran K
2021-11-15  9:41 ` [PATCH v1 5/5] avdtp: Add support for offload msft close command Kiran K
2021-11-15  9:55 ` [v1,1/5] avdtp: Add a flag in struct avdtp to control a2dp offload bluez.test.bot
2021-11-15 19:42 ` Luiz Augusto von Dentz [this message]
2021-11-15 19:44   ` [PATCH v1 1/5] " Luiz Augusto von Dentz
2021-11-19  8:12     ` K, Kiran

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='CABBYNZ+rFbfe1joiLmJBGB_twX4_kNu3Nsr=TSs1SyfMvAes8Q@mail.gmail.com' \
    --to=luiz.dentz@gmail.com \
    --cc=chethan.tumkur.narayan@intel.com \
    --cc=kiran.k@intel.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=luiz.von.dentz@intel.com \
    --cc=ravishankar.srivatsa@intel.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.