Bluetooth: btusb: Make btusb_recv_{event,acl}() take struct hci_dev *

Both helpers currently take struct btusb_data *, which is private to
btusb.c, as parameter type as below:

  int btusb_recv_event(struct btusb_data *data, struct sk_buff *skb)
  int btusb_recv_acl(struct btusb_data *data, struct sk_buff *skb)

To allow vendor USB-transport-specific source files to share them as
well, change the type to struct hci_dev *.

Signed-off-by: Zijun Hu <zijun.hu@oss.qualcomm.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This commit is contained in:
Zijun Hu 2026-07-25 01:54:42 -07:00 committed by Luiz Augusto von Dentz
parent 3914dc8803
commit d6d15018c8

View File

@ -1252,14 +1252,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)
@ -1319,7 +1321,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;
}
}
@ -1330,13 +1332,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);
@ -1391,7 +1395,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;
}
}