From: Iulia Tanasescu <iulia.tanasescu@nxp.com>
To: luiz.dentz@gmail.com
Cc: iulia.tanasescu@nxp.com, linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH 1/1] Bluetooth: Split bt_iso_qos into dedicated structures
Date: Wed, 22 Mar 2023 17:23:47 +0200 [thread overview]
Message-ID: <20230322152347.42109-1-iulia.tanasescu@nxp.com> (raw)
In-Reply-To: <CABBYNZJTvEFAESfLqebuUrq6mUAw1ZcQbSMqpfgbMLkGbH_k8A@mail.gmail.com>
Hi Luiz,
I have investigated some possible ways to update my patch using your
suggestions.
I think the most convenient method would be to implement the structure
as an union of dedicated parameters and to add an additional parameter
that would indicate the type of QoS the structure is holding.
It would be something like this:
struct bt_iso_bcast_qos {
union {
struct bt_iso_bcast_src_qos bsrc;
struct bt_iso_bcast_snk_qos bsnk;
};
};
enum {
BT_ISO_UCAST_QOS,
BT_ISO_BCAST_SRC_QOS,
BT_ISO_BCAST_SNK_QOS,
};
struct bt_iso_qos {
int qos_type;
union {
struct bt_iso_ucast_qos ucast;
struct bt_iso_bcast_qos bcast;
};
};
The flow would be something like this:
At socket creation, some default unicast QoS parameters are loaded
in the qos field of the socket structure.
When the "setsockopt" function is called on an ISO socket from user
space, the user will provide a bt_iso_qos structure as defined above,
containing the type of QoS to set and the desired parameters.
The kernel will validate the parameters depending on their type, and
it will overwrite the unicast defaults if the check is succesful.
When the user calls other ISO socket APIs, like connect or listen,
and the procedures to execute are broadcast related, the kernel will
either use the QoS options that had been previously set by the user,
or, if the user did not set any options, the unicast defaults will
be replaced with broadcast defaults, and the procedures will start
this way.
Do you think this is a good design? Please let me know if I should
proceed with this implementation.
Regards,
Iulia
next prev parent reply other threads:[~2023-03-22 15:24 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-20 14:36 [PATCH 0/1] Split bt_iso_qos into dedicated structures Iulia Tanasescu
2023-03-20 14:36 ` [PATCH 1/1] Bluetooth: " Iulia Tanasescu
2023-03-20 15:03 ` bluez.test.bot
2023-03-20 18:43 ` [PATCH 1/1] Bluetooth: " Luiz Augusto von Dentz
2023-03-21 8:08 ` Iulia Tanasescu
2023-03-22 15:23 ` Iulia Tanasescu [this message]
2023-03-22 17:38 ` Luiz Augusto von Dentz
2023-03-23 15:06 ` Iulia Tanasescu
2023-03-20 22:49 ` kernel test robot
-- strict thread matches above, loose matches on Subject: below --
2023-03-27 13:45 [PATCH 0/1] " Iulia Tanasescu
2023-03-27 13:45 ` [PATCH 1/1] Bluetooth: " Iulia Tanasescu
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=20230322152347.42109-1-iulia.tanasescu@nxp.com \
--to=iulia.tanasescu@nxp.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=luiz.dentz@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox