Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions crates/virtio-bindings/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Upcoming Release

- Regenerate bindings with Linux 6.4.
- Added bindings for virtio_ids.h
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: missing full stop


# v0.2.1

Expand Down
18 changes: 13 additions & 5 deletions crates/virtio-bindings/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,22 @@ cd linux
# Step 1: Checkout the version you want to generate the bindings for.
git checkout v5.0

# Step 2: Generate the bindings from the kernel headers. We need to
# generate a file for each one of the virtio headers we're interested on.
# For the moment, we're generating "virtio_blk", "virtio_gpu", "virtio_mmio",
# "virtio_net", "virtio_ring" and "virtio_scsi". Feel free to add additional header files if
# Step 2: Generate the bindings from the kernel headers. We need to generate a
# file for each one of the virtio headers. For the moment, we are only picking
# headers that we are interested in. Feel free to add additional header files if
# you need them for your project.
make headers_install INSTALL_HDR_PATH=v5_0_headers
cd v5_0_headers
for i in virtio_blk virtio_config virtio_gpu virtio_mmio virtio_net virtio_ring virtio_scsi ; do \
for i in \
virtio_blk \
virtio_config \
virtio_gpu \
virtio_ids \
virtio_mmio \
virtio_net \
virtio_ring \
virtio_scsi \
; do \
bindgen include/linux/$i.h -o $i.rs \
--allowlist-file include/linux/$i.h \
--with-derive-default \
Expand Down
48 changes: 48 additions & 0 deletions crates/virtio-bindings/src/virtio_ids.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/* automatically generated by rust-bindgen 0.63.0 */

pub const VIRTIO_ID_NET: u32 = 1;
pub const VIRTIO_ID_BLOCK: u32 = 2;
pub const VIRTIO_ID_CONSOLE: u32 = 3;
pub const VIRTIO_ID_RNG: u32 = 4;
pub const VIRTIO_ID_BALLOON: u32 = 5;
pub const VIRTIO_ID_IOMEM: u32 = 6;
pub const VIRTIO_ID_RPMSG: u32 = 7;
pub const VIRTIO_ID_SCSI: u32 = 8;
pub const VIRTIO_ID_9P: u32 = 9;
pub const VIRTIO_ID_MAC80211_WLAN: u32 = 10;
pub const VIRTIO_ID_RPROC_SERIAL: u32 = 11;
pub const VIRTIO_ID_CAIF: u32 = 12;
pub const VIRTIO_ID_MEMORY_BALLOON: u32 = 13;
pub const VIRTIO_ID_GPU: u32 = 16;
pub const VIRTIO_ID_CLOCK: u32 = 17;
pub const VIRTIO_ID_INPUT: u32 = 18;
pub const VIRTIO_ID_VSOCK: u32 = 19;
pub const VIRTIO_ID_CRYPTO: u32 = 20;
pub const VIRTIO_ID_SIGNAL_DIST: u32 = 21;
pub const VIRTIO_ID_PSTORE: u32 = 22;
pub const VIRTIO_ID_IOMMU: u32 = 23;
pub const VIRTIO_ID_MEM: u32 = 24;
pub const VIRTIO_ID_SOUND: u32 = 25;
pub const VIRTIO_ID_FS: u32 = 26;
pub const VIRTIO_ID_PMEM: u32 = 27;
pub const VIRTIO_ID_RPMB: u32 = 28;
pub const VIRTIO_ID_MAC80211_HWSIM: u32 = 29;
pub const VIRTIO_ID_VIDEO_ENCODER: u32 = 30;
pub const VIRTIO_ID_VIDEO_DECODER: u32 = 31;
pub const VIRTIO_ID_SCMI: u32 = 32;
pub const VIRTIO_ID_NITRO_SEC_MOD: u32 = 33;
pub const VIRTIO_ID_I2C_ADAPTER: u32 = 34;
pub const VIRTIO_ID_WATCHDOG: u32 = 35;
pub const VIRTIO_ID_CAN: u32 = 36;
pub const VIRTIO_ID_DMABUF: u32 = 37;
pub const VIRTIO_ID_PARAM_SERV: u32 = 38;
pub const VIRTIO_ID_AUDIO_POLICY: u32 = 39;
pub const VIRTIO_ID_BT: u32 = 40;
pub const VIRTIO_ID_GPIO: u32 = 41;
pub const VIRTIO_TRANS_ID_NET: u32 = 4096;
pub const VIRTIO_TRANS_ID_BLOCK: u32 = 4097;
pub const VIRTIO_TRANS_ID_BALLOON: u32 = 4098;
pub const VIRTIO_TRANS_ID_CONSOLE: u32 = 4099;
pub const VIRTIO_TRANS_ID_SCSI: u32 = 4100;
pub const VIRTIO_TRANS_ID_RNG: u32 = 4101;
pub const VIRTIO_TRANS_ID_9P: u32 = 4105;