mirror of
https://github.com/apache/nuttx.git
synced 2026-05-25 18:27:56 +08:00
drivers/vhost: add vhost_get_vq_buffers() to collect scatter-gather buffers
Add vhost_get_vq_buffers() API to retrieve all chained buffers from a virtqueue in one call. This simplifies handling of scatter-gather I/O where data spans multiple descriptors. The function populates an array of virtqueue_buf structures with buffer pointers and lengths, returning the descriptor head index on success. Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com> Signed-off-by: hongfengchen <hongfengchen@xiaomi.com>
This commit is contained in:
@@ -88,6 +88,9 @@ int vhost_register_device(FAR struct vhost_device *hdev);
|
||||
int vhost_register_driver(FAR struct vhost_driver *hdrv);
|
||||
int vhost_unregister_driver(FAR struct vhost_driver *hdrv);
|
||||
int vhost_unregister_device(FAR struct vhost_device *hdev);
|
||||
int vhost_get_vq_buffers(FAR struct virtqueue *vq,
|
||||
FAR struct virtqueue_buf *vb, size_t vbsize,
|
||||
FAR size_t *vbcnt);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: vhost_register_drivers
|
||||
|
||||
Reference in New Issue
Block a user