mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Zijun Hu <zijun.hu@oss.qualcomm.com>
To: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
Cc: Marcel Holtmann <marcel@holtmann.org>,
	Zijun Hu <zijun_hu@icloud.com>,
	linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH BlueZ v3 3/4] doc/hci-protocol: Add BT_RECV_VENDOR_PKT socket option for HCI_CHANNEL_USER
Date: Sun, 6 Sep 2026 10:27:37 +0800	[thread overview]
Message-ID: <4df53cf8-b173-423b-bfba-4c5fc539e528@oss.qualcomm.com> (raw)
In-Reply-To: <CABBYNZLddwpM42-jpbGbi+wpiJgqwU6UB4TKc1KjC9pR=aM95Q@mail.gmail.com>

On 9/4/2026 10:31 PM, Luiz Augusto von Dentz wrote:
>> Hi Luiz,
>>
>> Good catch — that socket option is introduced by the below kernel patch, which is still under review:
>> https://lore.kernel.org/all/20260830-btusb_qcc2072-v2-2-5c0e0c9dd98b@oss.qualcomm.com
>> I'll drop this userspace patch in v4 temporarily to avoid confusion.
>>
>>> e.g., HCI_CHANNEL_VENDOR which can then allow packet type rather than
>>> just the known ones.
>> For this new proposal:
>>
>> 1) Is my below understanding correct?
>> - H/W wire: BT and vendor packets are serialized together.
>> - Kernel: splits BT and vendor packets to their own channels.
>> - Userspace: merges both channels on RX, sends to the corresponding channel on TX.
> I guess that is up to us to define, HCI_CHANNEL_VENDOR could just
> serialize everything, so it supersed HCI_CHANNEL_USER which only took
> care of known packet types. That said I don't think it would be an API
> break if we decide HCI_CHANNEL_USER carry everything, but since you
> are trying to introduce BT_RECV_VENDOR_PKT there maybe a reason not to
> enable everything to be send over HCI_CHANNEL_USER.
> 
>> 2) How would a HCI_CHANNEL_USER user, e.g. Chromebook, send and receive vendor packets?
> Would have to switch to use HCI_CHANNEL_VENDOR, just as it would have
> to use BT_RECV_VENDOR_PKT, but then again Id rather do it on
> HCI_CHANNEL_USER if we don't consider it an API breakage.

Good point — I'll drop BT_RECV_VENDOR_PKT from both the kernel and userspace patches and let vendor packets flow over HCI_CHANNEL_USER
unconditionally.

Since HCI_CHANNEL_USER owns the controller exclusively, it should see every packet the controller sends.
There's also precedent for this: HCI_DRV_PKT was introduced over HCI_CHANNEL_USER with no equivalent opt-in gate.

The regression BT_RECV_VENDOR_PKT guarded against is mostly hypothetical anyway — it was added defensively in case some proprietary HCI_CHANNEL_USER
application doesn't handle unknown packet types robustly, not because of any regression we've actually observed. If such an application does break on
vendor packets, it should be fixed to tolerate them, rather than have the packet type gated on its behalf.

  reply	other threads:[~2026-09-06  2:28 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-03 14:47 [PATCH BlueZ v3 0/4] BlueZ: Support vendor packets Zijun Hu
2026-09-03 14:47 ` [PATCH BlueZ v3 1/4] doc/hci-protocol: Fix missing & on mtu argument in BT_RCVMTU example Zijun Hu
2026-09-03 14:47 ` [PATCH BlueZ v3 2/4] monitor: s/vendor_(evt|event)/\1_vendor/ Zijun Hu
2026-09-03 14:47 ` [PATCH BlueZ v3 3/4] doc/hci-protocol: Add BT_RECV_VENDOR_PKT socket option for HCI_CHANNEL_USER Zijun Hu
2026-09-03 15:16   ` Luiz Augusto von Dentz
2026-09-04 14:12     ` Zijun Hu
2026-09-04 14:31       ` Luiz Augusto von Dentz
2026-09-06  2:27         ` Zijun Hu [this message]
2026-09-03 14:47 ` [PATCH BlueZ v3 4/4] monitor: Support vendor packets Zijun Hu

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=4df53cf8-b173-423b-bfba-4c5fc539e528@oss.qualcomm.com \
    --to=zijun.hu@oss.qualcomm.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luiz.dentz@gmail.com \
    --cc=marcel@holtmann.org \
    --cc=zijun_hu@icloud.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

all inboxes | Powered by JetHome®