Lines Matching defs:vbt
29 static int virtbt_add_inbuf(struct virtio_bluetooth *vbt)
31 struct virtqueue *vq = vbt->vqs[VIRTBT_VQ_RX];
56 static int virtbt_open_vdev(struct virtio_bluetooth *vbt)
58 if (virtbt_add_inbuf(vbt) < 0)
61 virtqueue_kick(vbt->vqs[VIRTBT_VQ_RX]);
70 static int virtbt_close_vdev(struct virtio_bluetooth *vbt)
74 cancel_work_sync(&vbt->rx);
76 for (i = 0; i < ARRAY_SIZE(vbt->vqs); i++) {
77 struct virtqueue *vq = vbt->vqs[i];
95 struct virtio_bluetooth *vbt = hci_get_drvdata(hdev);
102 err = virtqueue_add_outbuf(vbt->vqs[VIRTBT_VQ_TX], sg, 1, skb,
109 virtqueue_kick(vbt->vqs[VIRTBT_VQ_TX]);
198 static void virtbt_rx_handle(struct virtio_bluetooth *vbt, struct sk_buff *skb)
211 hci_recv_frame(vbt->hdev, skb);
221 struct virtio_bluetooth *vbt = container_of(work,
226 skb = virtqueue_get_buf(vbt->vqs[VIRTBT_VQ_RX], &len);
231 virtbt_rx_handle(vbt, skb);
233 if (virtbt_add_inbuf(vbt) < 0)
236 virtqueue_kick(vbt->vqs[VIRTBT_VQ_RX]);
250 struct virtio_bluetooth *vbt = vq->vdev->priv;
252 schedule_work(&vbt->rx);
265 struct virtio_bluetooth *vbt;
283 vbt = kzalloc(sizeof(*vbt), GFP_KERNEL);
284 if (!vbt)
287 vdev->priv = vbt;
288 vbt->vdev = vdev;
290 INIT_WORK(&vbt->rx, virtbt_rx_work);
292 err = virtio_find_vqs(vdev, VIRTBT_NUM_VQS, vbt->vqs, callbacks,
303 vbt->hdev = hdev;
307 hci_set_drvdata(hdev, vbt);
375 err = virtbt_open_vdev(vbt);
390 struct virtio_bluetooth *vbt = vdev->priv;
391 struct hci_dev *hdev = vbt->hdev;
395 virtbt_close_vdev(vbt);
398 vbt->hdev = NULL;
401 kfree(vbt);