From: Zijun Hu <zijun.hu@oss.qualcomm.com>
To: Marcel Holtmann <marcel@holtmann.org>,
Luiz Augusto von Dentz <luiz.dentz@gmail.com>
Cc: Zijun Hu <zijun_hu@icloud.com>,
linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org,
Zijun Hu <zijun.hu@oss.qualcomm.com>
Subject: [PATCH v2 4/5] Bluetooth: btusb: Make btusb_recv_{event,acl}() take struct hci_dev *
Date: Mon, 13 Jul 2026 05:01:14 -0700 [thread overview]
Message-ID: <20260713-btusb_prep_qcc2072-v2-4-bbcb651285f2@oss.qualcomm.com> (raw)
In-Reply-To: <20260713-btusb_prep_qcc2072-v2-0-bbcb651285f2@oss.qualcomm.com>
Vendor-specific files need to hand BT frames back to btusb after
filtering out non-BT frames, but these helpers take struct btusb_data *,
which is private to btusb.c:
int btusb_recv_event(struct btusb_data *data, struct sk_buff *skb)
int btusb_recv_acl(struct btusb_data *data, struct sk_buff *skb)
Change both to take struct hci_dev * so btusb and vendor files can share
them.
Signed-off-by: Zijun Hu <zijun.hu@oss.qualcomm.com>
---
drivers/bluetooth/btusb.c | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index 9c3a6d7d8f1e..f4f911c3de52 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -1253,14 +1253,16 @@ static inline void btusb_free_frags(struct btusb_data *data)
spin_unlock_irqrestore(&data->rxlock, flags);
}
-static int btusb_recv_event(struct btusb_data *data, struct sk_buff *skb)
+static int btusb_recv_event(struct hci_dev *hdev, struct sk_buff *skb)
{
+ struct btusb_data *data = hci_get_drvdata(hdev);
+
if (data->intr_interval) {
/* Trigger dequeue immediately if an event is received */
schedule_delayed_work(&data->rx_work, 0);
}
- return data->recv_event(data->hdev, skb);
+ return data->recv_event(hdev, skb);
}
static int btusb_recv_intr(struct btusb_data *data, void *buffer, int count)
@@ -1320,7 +1322,7 @@ static int btusb_recv_intr(struct btusb_data *data, void *buffer, int count)
}
/* Complete frame */
- btusb_recv_event(data, skb);
+ btusb_recv_event(data->hdev, skb);
skb = NULL;
}
}
@@ -1331,13 +1333,15 @@ static int btusb_recv_intr(struct btusb_data *data, void *buffer, int count)
return err;
}
-static int btusb_recv_acl(struct btusb_data *data, struct sk_buff *skb)
+static int btusb_recv_acl(struct hci_dev *hdev, struct sk_buff *skb)
{
+ struct btusb_data *data = hci_get_drvdata(hdev);
+
/* Only queue ACL packet if intr_interval is set as it means
* force_poll_sync has been enabled.
*/
if (!data->intr_interval)
- return data->recv_acl(data->hdev, skb);
+ return data->recv_acl(hdev, skb);
skb_queue_tail(&data->acl_q, skb);
schedule_delayed_work(&data->rx_work, data->intr_interval);
@@ -1392,7 +1396,7 @@ static int btusb_recv_bulk(struct btusb_data *data, void *buffer, int count)
if (!hci_skb_expect(skb)) {
/* Complete frame */
- btusb_recv_acl(data, skb);
+ btusb_recv_acl(data->hdev, skb);
skb = NULL;
}
}
--
2.34.1
next prev parent reply other threads:[~2026-07-13 12:01 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-13 12:01 [PATCH v2 0/5] Bluetooth: btusb: Preparation for upcoming Qualcomm QCC2072 support Zijun Hu
2026-07-13 12:01 ` [PATCH v2 1/5] Bluetooth: coredump: Introduce and apply hci_devcd_state_name() Zijun Hu
2026-07-13 12:01 ` [PATCH v2 2/5] Bluetooth: coredump: Allow drivers to pad dump header to fixed size Zijun Hu
2026-07-13 12:01 ` [PATCH v2 3/5] Bluetooth: btusb: Add an indirect recv_intr() hook to btusb_data Zijun Hu
2026-07-13 12:01 ` Zijun Hu [this message]
2026-07-13 12:01 ` [PATCH v2 5/5] Bluetooth: btusb: Add a simple static btusb_prepare_reset() Zijun Hu
2026-07-27 18:30 ` [PATCH v2 0/5] Bluetooth: btusb: Preparation for upcoming Qualcomm QCC2072 support patchwork-bot+bluetooth
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=20260713-btusb_prep_qcc2072-v2-4-bbcb651285f2@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®